Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

raea 9565b5f97

shinyobjectz5e1c192d297f
diff --git a/Cargo.lock b/Cargo.lock
index c7314f56..f86d9cdd 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -29,24 +29,57 @@ dependencies = [
"uuid",
]
+[[package]]
+name = "accesskit"
+version = "0.25.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4e883d1d28c5fd5568c79ed2d2bd48d9f2fd3945c8974ed0f53690ceddb051be"
+dependencies = [
+ "uuid",
+]
+
+[[package]]
+name = "accesskit_atspi_common"
+version = "0.21.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "24f5baf62e34a4a6c30e3d697e4782f821a7337049c44c3b40576a27dfbb580d"
+dependencies = [
+ "accesskit 0.25.2",
+ "accesskit_consumer 0.39.2",
+ "atspi-common",
+ "phf 0.14.0",
+ "serde",
+ "zvariant",
+]
+
[[package]]
name = "accesskit_consumer"
version = "0.38.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d10a236f96f87d70732e44520046785431ef01d5bcd6b041317bfadd2f88245"
dependencies = [
- "accesskit",
+ "accesskit 0.24.1",
"hashbrown 0.16.1",
]
+[[package]]
+name = "accesskit_consumer"
+version = "0.39.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f3da8f27636015191b2264ee1df681503170a632cafd832fdc1edfdd4e3a2fd3"
+dependencies = [
+ "accesskit 0.25.2",
+ "hashbrown 0.17.1",
+]
+
[[package]]
name = "accesskit_ios"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "750c4e9f6ce888dfe8a10c0f1b5ceb646a7854fd46579d74919219d1bb314083"
dependencies = [
- "accesskit",
- "accesskit_consumer",
+ "accesskit 0.24.1",
+ "accesskit_consumer 0.38.0",
"hashbrown 0.16.1",
"objc2 0.5.3",
"objc2-foundation 0.2.2",
@@ -59,38 +92,84 @@ version = "0.26.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce02dc63b43f0c9296af9ac946312a2dc8814427d7a64d2d600971dac55b6076"
dependencies = [
- "accesskit",
- "accesskit_consumer",
+ "accesskit 0.24.1",
+ "accesskit_consumer 0.38.0",
"hashbrown 0.16.1",
"objc2 0.5.3",
"objc2-app-kit 0.2.2",
"objc2-foundation 0.2.2",
]
+[[package]]
+name = "accesskit_macos"
+version = "0.27.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "123828ceeec755b05255e3976cb0852993202de98a0626c97dd8d34246991f84"
+dependencies = [
+ "accesskit 0.25.2",
+ "accesskit_consumer 0.39.2",
+ "hashbrown 0.17.1",
+ "objc2 0.5.3",
+ "objc2-app-kit 0.2.2",
+ "objc2-foundation 0.2.2",
+]
+
+[[package]]
+name = "accesskit_unix"
+version = "0.24.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "30d5192871228c54f1b0fb4a85cef000e11a3804f25d2165f14afa0daa67f3f6"
+dependencies = [
+ "accesskit 0.25.2",
+ "accesskit_atspi_common",
+ "async-channel",
+ "async-executor",
+ "async-task",
+ "atspi",
+ "futures-lite",
+ "futures-util",
+ "serde",
+ "zbus 5.19.0",
+]
+
[[package]]
name = "accesskit_windows"
version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "106c2b961215864d1c2e703ee63269c25c4e80a577ffb2c1017b9c17dcdf83a1"
dependencies = [
- "accesskit",
- "accesskit_consumer",
+ "accesskit 0.24.1",
+ "accesskit_consumer 0.38.0",
"hashbrown 0.16.1",
"static_assertions",
"windows 0.62.2",
"windows-core 0.62.2",
]
+[[package]]
+name = "accesskit_windows"
+version = "0.35.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "498668b90da9995302a0055aaecad4756932333da2ddef6baee1c00844c430fc"
+dependencies = [
+ "accesskit 0.25.2",
+ "accesskit_consumer 0.39.2",
+ "hashbrown 0.17.1",
+ "static_assertions",
+ "windows 0.62.2",
+ "windows-core 0.62.2",
+]
+
[[package]]
name = "accesskit_winit"
version = "0.33.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5b41e63a69f36d9f1f41e70464c7e5f72eee485ef26aab19f0b4f86e6c0a84c"
dependencies = [
- "accesskit",
+ "accesskit 0.24.1",
"accesskit_ios",
- "accesskit_macos",
- "accesskit_windows",
+ "accesskit_macos 0.26.3",
+ "accesskit_windows 0.34.0",
"raw-window-handle",
"winit",
]
@@ -465,7 +544,7 @@ checksum = "d301b3b94cb4b2f23d7917810addbbaff90738e0ca2be692bd027e70d7e0330c"
name = "anyrender"
version = "0.14.0"
dependencies = [
- "kurbo",
+ "kurbo 0.13.1",
"peniko",
"raw-window-handle",
"smallvec",
@@ -477,9 +556,9 @@ version = "0.15.0"
dependencies = [
"anyrender",
"image",
- "kurbo",
+ "kurbo 0.13.1",
"peniko",
- "usvg",
+ "usvg 0.48.1",
]
[[package]]
@@ -491,9 +570,9 @@ dependencies = [
"anyrender",
"debug_timer",
"futures-channel",
- "kurbo",
+ "kurbo 0.13.1",
"peniko",
- "pollster",
+ "pollster 0.4.0",
"rustc-hash 2.1.3",
"vello",
"wasm-bindgen-futures",
@@ -564,6 +643,7 @@ dependencies = [
"parking_lot",
"percent-encoding",
"windows-sys 0.61.2",
+ "wl-clipboard-rs",
"x11rb",
]
@@ -584,6 +664,37 @@ dependencies = [
"syn 2.0.119",
]
+[[package]]
+name = "argh"
+version = "0.1.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "211818e820cda9ca6f167a64a5c808837366a6dfd807157c64c1304c486cd033"
+dependencies = [
+ "argh_derive",
+ "argh_shared",
+]
+
+[[package]]
+name = "argh_derive"
+version = "0.1.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c442a9d18cef5dde467405d27d461d080d68972d6d0dfd0408265b6749ec427d"
+dependencies = [
+ "argh_shared",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "argh_shared"
+version = "0.1.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e5ade012bac4db278517a0132c8c10c6427025868dca16c801087c28d5a411f1"
+dependencies = [
+ "serde",
+]
+
[[package]]
name = "ariadne"
version = "0.6.0"
@@ -798,6 +909,35 @@ dependencies = [
"pin-project-lite",
]
+[[package]]
+name = "async-process"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75"
+dependencies = [
+ "async-channel",
+ "async-io",
+ "async-lock",
+ "async-signal",
+ "async-task",
+ "blocking",
+ "cfg-if",
+ "event-listener",
+ "futures-lite",
+ "rustix 1.1.5",
+]
+
+[[package]]
+name = "async-recursion"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4f8abc12baad266b1c8cec146854c195b5864b4221d4b2ca7296a7ae82d9e451"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+]
+
[[package]]
name = "async-scoped"
version = "0.9.0"
@@ -809,6 +949,24 @@ dependencies = [
"tokio",
]
+[[package]]
+name = "async-signal"
+version = "0.2.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485"
+dependencies = [
+ "async-io",
+ "async-lock",
+ "atomic-waker",
+ "cfg-if",
+ "futures-core",
+ "futures-io",
+ "rustix 1.1.5",
+ "signal-hook-registry",
+ "slab",
+ "windows-sys 0.61.2",
+]
+
[[package]]
name = "async-task"
version = "4.7.1"
@@ -889,6 +1047,43 @@ dependencies = [
"syn 2.0.119",
]
+[[package]]
+name = "atspi"
+version = "0.29.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c77886257be21c9cd89a4ae7e64860c6f0eefca799bb79127913052bd0eefb3d"
+dependencies = [
+ "atspi-common",
+ "atspi-proxies",
+]
+
+[[package]]
+name = "atspi-common"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "20c5617155740c98003016429ad13fe43ce7a77b007479350a9f8bf95a29f63d"
+dependencies = [
+ "enumflags2",
+ "serde",
+ "static_assertions",
+ "zbus 5.19.0",
+ "zbus-lockstep",
+ "zbus-lockstep-macros",
+ "zbus_names",
+ "zvariant",
+]
+
+[[package]]
+name = "atspi-proxies"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2230e48787ed3eb4088996eab66a32ca20c0b67bbd4fd6cdfe79f04f1f04c9fc"
+dependencies = [
+ "atspi-common",
+ "serde",
+ "zbus 5.19.0",
+]
+
[[package]]
name = "atterate"
version = "0.0.2"
@@ -1337,7 +1532,7 @@ version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1070b9b7f087a5073be2da713367f29a831c85cd3391afcfc95bc0498125704"
dependencies = [
- "accesskit",
+ "accesskit 0.24.1",
"bevy_app",
"bevy_derive",
"bevy_ecs",
@@ -1347,9 +1542,9 @@ dependencies = [
[[package]]
name = "bevy_android"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17fd56a4708085b36f8aa1a011e347f8bd9334f0343bb3d5d9c3742897968a55"
+checksum = "e06593a351f0220be555b4a2e2c4a8ff9173756791f245613fffb6b7904fae57"
dependencies = [
"android-activity",
]
@@ -1395,7 +1590,7 @@ version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "011144ef75ba95b665b1e6b03f3b7bbe9aa85d55472abb1d21e64813dac1c0a4"
dependencies = [
- "bevy_macro_utils 0.20.0",
+ "bevy_macro_utils 0.20.1",
"quote",
"syn 2.0.119",
]
@@ -1425,9 +1620,9 @@ dependencies = [
[[package]]
name = "bevy_app"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2489da2972d57cccd19060d7faa44c4c4cfb296a657c84ee6ab8bde2b1c0115"
+checksum = "2549c23ffdf3d3a49483c6716a3502b386f1f9fa523435630b733a77fa414e4f"
dependencies = [
"bevy_derive",
"bevy_ecs",
@@ -1461,9 +1656,9 @@ dependencies = [
[[package]]
name = "bevy_asset"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b88b3767a2c3f5a017b2febca08a670819ea2acb46846e4d8cd02980aeb0ed3e"
+checksum = "f76f4e872ab1723c69dc069a9da605b1d07caeb64992a1e7a0d79ec09d1d8450"
dependencies = [
"async-broadcast",
"async-channel",
@@ -1536,11 +1731,11 @@ dependencies = [
[[package]]
name = "bevy_asset_macros"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "875b4fd236612744dbd61fb0a77ffde0aee37b8b780cf8a89caa308511c70646"
+checksum = "8b986dd0378a4ab84ec0acdd0660c79c5fe8db5eaec6161227e77d0a81d051f7"
dependencies = [
- "bevy_macro_utils 0.20.0",
+ "bevy_macro_utils 0.20.1",
"proc-macro2",
"quote",
"syn 2.0.119",
@@ -1637,9 +1832,9 @@ dependencies = [
[[package]]
name = "bevy_color"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0e57bfc1a0da1c018235fb98bb0e15ab61f1d0253122020ab6e1450e6cfbcf9"
+checksum = "97928389ed7833ae0f12109a217da51b52a6a00e18b5a77f2eaca1b331ab7830"
dependencies = [
"bevy_curve",
"bevy_math",
@@ -1735,9 +1930,9 @@ dependencies = [
[[package]]
name = "bevy_curve"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "21ae28ed95c1c8a1bfc8930471840ee5a4b99b6b31138b17598e7ee6f4291b64"
+checksum = "8d9f08cbe2876a34d0ad0534a5b18c4c77da2dafc1cefd744ece45c79e029196"
dependencies = [
"approx",
"bevy_math",
@@ -1750,11 +1945,11 @@ dependencies = [
[[package]]
name = "bevy_derive"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd59e9e600d792e60df17b4d52719b28c288bf047884ac89ad29d9c7a6592d2c"
+checksum = "b7be8813fd429ff1237bcc5391d1abf4e88ca360302217125d76a1c3cb131b18"
dependencies = [
- "bevy_macro_utils 0.20.0",
+ "bevy_macro_utils 0.20.1",
"quote",
"syn 2.0.119",
]
@@ -1806,9 +2001,9 @@ dependencies = [
[[package]]
name = "bevy_diagnostic"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f8851dc1b253b350bf941695457007e6e44ad4b8f075bf52a1ef202e6866b6a"
+checksum = "f3a243742d6d3ad9d4ae889b67b307f38a86179b46fadb3acabbdf8bf5d15535"
dependencies = [
"atomic-waker",
"bevy_app",
@@ -1843,9 +2038,9 @@ dependencies = [
[[package]]
name = "bevy_ecs"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d5541a1658c5029b39e3ec59c6ecb47ad0a6d85fa083312a5ee2a95d6982a926"
+checksum = "9c546460b4e5dbe72a5e8fce733e9306f747d9a74fd0cd67842ee10831d09aa3"
dependencies = [
"arrayvec",
"bevy_ecs_macros",
@@ -1902,11 +2097,11 @@ dependencies = [
[[package]]
name = "bevy_ecs_macro_logic"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5197fea7643d2733e8b6d81c3dfa99adad3a754cdfd159c00255cea157b795d7"
+checksum = "eb57340122cc39ac36b9ed9c98745c3739dd88c5c89b117c9faf2828978b13f5"
dependencies = [
- "bevy_macro_utils 0.20.0",
+ "bevy_macro_utils 0.20.1",
"proc-macro2",
"quote",
"syn 2.0.119",
@@ -1914,12 +2109,12 @@ dependencies = [
[[package]]
name = "bevy_ecs_macros"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3dde5305169503c9101404bf8cf17e8351f56fccf5152b8e5d7d7c32dcf1c486"
+checksum = "2e50a452e8705504c04f80d359be23bcae829053ef58fdd17572d509a1f460b8"
dependencies = [
"bevy_ecs_macro_logic",
- "bevy_macro_utils 0.20.0",
+ "bevy_macro_utils 0.20.1",
"proc-macro2",
"quote",
"syn 2.0.119",
@@ -2004,7 +2199,7 @@ version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4e4c4183c39ae8d00e53afeeab66aa71c41b08d82638149f9d485a2a62df569"
dependencies = [
- "bevy_macro_utils 0.20.0",
+ "bevy_macro_utils 0.20.1",
"encase_derive_impl",
]
@@ -2088,7 +2283,7 @@ version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a5c67e8c55ef35c65295e8cb614eda169780e21e2748f6df470d3bff21849a3"
dependencies = [
- "bevy_macro_utils 0.20.0",
+ "bevy_macro_utils 0.20.1",
"proc-macro2",
"quote",
"syn 2.0.119",
@@ -2100,7 +2295,7 @@ version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c4566f226580b5d852e3fa4fdb821e45367f598c0c6090896d686e446fa91f4"
dependencies = [
- "accesskit",
+ "accesskit 0.24.1",
"bevy_a11y",
"bevy_app",
"bevy_asset",
@@ -2322,7 +2517,7 @@ version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "501e72c4ac31caef17ef9e627dee212d2107b95402a891ec6f0fc4107dd0cdf4"
dependencies = [
- "bevy_macro_utils 0.20.0",
+ "bevy_macro_utils 0.20.1",
"quote",
"syn 2.0.119",
]
@@ -2459,9 +2654,9 @@ dependencies = [
[[package]]
name = "bevy_image"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb818dd8d705809d54adea08e346edce81a51ddbf06406ddf12a72ee467a3855"
+checksum = "d4146fc2cb8bb75fa3a8352b5298377801dc6ab48f755539b59d5b2619599618"
dependencies = [
"basis-universal",
"bevy_app",
@@ -2700,9 +2895,9 @@ dependencies = [
[[package]]
name = "bevy_macro_utils"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0d03a948df65138e30917d91237797d7e38763135ebacd0f28c891e1a3b2b52"
+checksum = "fdafa048d2bafad7fda1d5a207ab52a6513bbc3a778e5d9e6ab35ac6a41ae11d"
dependencies = [
"proc-macro2",
"quote",
@@ -2739,7 +2934,7 @@ version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70551fa201e1416ab44968631b7ce6320c194acfdb652a1971ec6882af122333"
dependencies = [
- "bevy_macro_utils 0.20.0",
+ "bevy_macro_utils 0.20.1",
"quote",
"syn 2.0.119",
]
@@ -2758,9 +2953,9 @@ dependencies = [
[[package]]
name = "bevy_math"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "598cbdcec4d0f0d966905996240ac76f77a644c583f95fb612d4f59f5f649038"
+checksum = "17b8450e5d05ddd0cbba76e439c769f030a354a685630b919301071943487294"
dependencies = [
"approx",
"bevy_reflect",
@@ -2947,9 +3142,9 @@ dependencies = [
[[package]]
name = "bevy_platform"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "000bc467d1b344b6609fcf217a9b08d349d49c8e85dc4179fb7656f2b6e3db47"
+checksum = "9c1280bc12c975ddb041b8341b005415024994477479861ea4490b9b7f9f6185"
dependencies = [
"async-io",
"bytemuck",
@@ -3012,9 +3207,9 @@ dependencies = [
[[package]]
name = "bevy_ptr"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41935a00c02004753bd7ed5094754397800b3f673bf15553bb007b06216872d5"
+checksum = "845b9f43ea7e4be1a19b93673325d47c091df8e3a57a2cd30dd003d0972796be"
[[package]]
name = "bevy_quinnet"
@@ -3080,9 +3275,9 @@ dependencies = [
[[package]]
name = "bevy_reflect"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46eecc733575b873deedcc37639e36290092388657091b3321fa6e073e7818e6"
+checksum = "31e275d95c84140ae51d58a9e8cae5cf9ed687b59d10e69bfec8da480f5c667f"
dependencies = [
"assert_type_match",
"bevy_platform",
@@ -3109,11 +3304,11 @@ dependencies = [
[[package]]
name = "bevy_reflect_derive"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dfaa1e315676c625ed8d30ba8a671ebf917cad6355320295b9802a8cbc06853b"
+checksum = "c1f0add6e1437551a7f26d22458b6eece9a3e38a5dba0a663a753ab4385d9bfc"
dependencies = [
- "bevy_macro_utils 0.20.0",
+ "bevy_macro_utils 0.20.1",
"indexmap",
"proc-macro2",
"quote",
@@ -3215,7 +3410,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "119ca6d445eba5c9976c658f29bac854094b27c27624aa92c4d9668c319618d0"
dependencies = [
"bevy_extract_macros",
- "bevy_macro_utils 0.20.0",
+ "bevy_macro_utils 0.20.1",
"proc-macro2",
"quote",
"syn 2.0.119",
@@ -3287,7 +3482,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4da846d8418ca6e38943707c88075a4a0b8f6eea0fd286d33a024d0257439d0"
dependencies = [
"bevy_ecs_macro_logic",
- "bevy_macro_utils 0.20.0",
+ "bevy_macro_utils 0.20.1",
"proc-macro2",
"quote",
"syn 2.0.119",
@@ -3540,16 +3735,16 @@ version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fec1a8f6a253e39ddf7e447b1b9286caacb205ed8e619e6fb9a2e010d58dd04b"
dependencies = [
- "bevy_macro_utils 0.20.0",
+ "bevy_macro_utils 0.20.1",
"quote",
"syn 2.0.119",
]
[[package]]
name = "bevy_tasks"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbd8116f12dc50bde3758a72fba85e1f4c00e6c66d0ad58bdc46c0c0690829a8"
+checksum = "84c634a7f09e9ccd26137a2f541ab670c84854a1af4107fecca1541cfcd1b466"
dependencies = [
"async-channel",
"async-executor",
@@ -3593,9 +3788,9 @@ dependencies = [
[[package]]
name = "bevy_time"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13901174b792bb7848d8e088075f0009ea409b99179934c0d5bdd2b95622694e"
+checksum = "e6f52269fa80326e6d0a9c6e53431fc448651d7fbbb719aa9dfbd4895369ef54"
dependencies = [
"bevy_app",
"bevy_ecs",
@@ -3728,7 +3923,7 @@ dependencies = [
name = "bevy_ui"
version = "0.20.0"
dependencies = [
- "accesskit",
+ "accesskit 0.24.1",
"bevy_a11y",
"bevy_app",
"bevy_asset",
@@ -3801,7 +3996,7 @@ dependencies = [
name = "bevy_ui_widgets"
version = "0.20.0"
dependencies = [
- "accesskit",
+ "accesskit 0.24.1",
"bevy_a11y",
"bevy_app",
"bevy_camera",
@@ -3824,9 +4019,9 @@ dependencies = [
[[package]]
name = "bevy_utils"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5cbd58495039d4e63e6fcfef1242fecab33ffe62b4a5e010467e69e790879812"
+checksum = "b1565ae7a124e68a39321620c5339eb501694357c40f50a74413034ed683cdf9"
dependencies = [
"async-channel",
"bevy_platform",
@@ -3890,7 +4085,7 @@ version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ef0a5a55524e793ab13536ef244229fa66a4839fae6564df2aa4b3c13956a82"
dependencies = [
- "accesskit",
+ "accesskit 0.24.1",
"accesskit_winit",
"approx",
"bevy_a11y",
@@ -4110,7 +4305,7 @@ dependencies = [
"icu_segmenter",
"image",
"keyboard-types",
- "kurbo",
+ "kurbo 0.13.1",
"linebender_resource_handle",
"markup5ever 0.40.0",
"objc2 0.6.5",
@@ -4126,12 +4321,12 @@ dependencies = [
"stylo_static_prefs",
"stylo_taffy",
"stylo_traits",
- "svgtypes",
+ "svgtypes 0.16.1",
"taffy",
"thin-vec",
"thread_local",
"url",
- "usvg",
+ "usvg 0.48.1",
"web-time",
"writeable",
"wuff",
@@ -4160,14 +4355,14 @@ dependencies = [
"bytemuck",
"color",
"euclid",
- "kurbo",
+ "kurbo 0.13.1",
"parley",
"peniko",
"skrifa 0.44.0",
"smallvec",
"stylo",
"taffy",
- "usvg",
+ "usvg 0.48.1",
]
[[package]]
@@ -5134,9 +5329,9 @@ dependencies = [
[[package]]
name = "cranelift-bforest"
-version = "0.135.7"
+version = "0.135.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f45c85646c4425cc85b868effaf20c302b437a3fb79bb27a64513dd522f07411"
+checksum = "32a9ad33269057337a70db66950f426fbdce436a66fe8071f55851a13a2e40cd"
dependencies = [
"cranelift-entity",
"wasmtime-internal-core",
@@ -5144,9 +5339,9 @@ dependencies = [
[[package]]
name = "cranelift-bitset"
-version = "0.135.7"
+version = "0.135.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94f56b5c7d564cfa03aa269a6b98c916cab4d545196a391d31403a23ef39333a"
+checksum = "d322e6584efe3b229b1164b49edf55aec561553426f7fe3e228a45e80a15a190"
dependencies = [
"serde",
"serde_derive",
@@ -5155,9 +5350,9 @@ dependencies = [
[[package]]
name = "cranelift-entity"
-version = "0.135.7"
+version = "0.135.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "774d25e36df18696f63a284e9c4ea43455e2ebcca6308e0e02301f18c8e777e2"
+checksum = "ccbd0c43e96db753f44a84e44f680f9423ed0a475b81f301ba7c44b5db52c37b"
dependencies = [
"cranelift-bitset",
"serde",
@@ -6240,7 +6435,7 @@ version = "0.36.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc938cc27cd911415e1e4d151bc56ff9df063d8db081374e87aeb805ea74b2ba"
dependencies = [
- "accesskit",
+ "accesskit 0.24.1",
"ahash 0.8.12",
"bitflags 2.13.2",
"emath",
@@ -6358,6 +6553,12 @@ dependencies = [
"simdutf8",
]
+[[package]]
+name = "endi"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099"
+
[[package]]
name = "endian-type"
version = "0.1.2"
@@ -6401,6 +6602,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef"
dependencies = [
"enumflags2_derive",
+ "serde",
]
[[package]]
@@ -6747,7 +6949,7 @@ dependencies = [
name = "firewheel-macros"
version = "0.12.0"
dependencies = [
- "bevy_macro_utils 0.20.0",
+ "bevy_macro_utils 0.20.1",
"proc-macro2",
"quote",
"syn 2.0.119",
@@ -7950,7 +8152,7 @@ dependencies = [
"tokio",
"tokio-rustls",
"tower-service",
- "webpki-roots 1.0.9",
+ "webpki-roots 1.0.11",
]
[[package]]
@@ -8261,7 +8463,7 @@ dependencies = [
"image-webp",
"moxcms",
"num-traits",
- "png",
+ "png 0.18.1",
"qoi",
"tiff",
"zune-core",
@@ -8278,6 +8480,12 @@ dependencies = [
"quick-error",
]
+[[package]]
+name = "imagesize"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "edcd27d72f2f071c64249075f42e205ff93c9a4c5f6c6da53e79ed9f9832c285"
+
[[package]]
name = "imagesize"
version = "0.15.0"
@@ -8710,6 +8918,17 @@ dependencies = [
"bitflags 2.13.2",
]
+[[package]]
+name = "kurbo"
+version = "0.11.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c62026ae44756f8a599ba21140f350303d4f08dcdcc71b5ad9c9bb8128c13c62"
+dependencies = [
+ "arrayvec",
+ "euclid",
+ "smallvec",
+]
+
[[package]]
name = "kurbo"
version = "0.13.1"
@@ -10069,6 +10288,15 @@ dependencies = [
"libc",
]
+[[package]]
+name = "memoffset"
+version = "0.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
+dependencies = [
+ "autocfg",
+]
+
[[package]]
name = "meshopt"
version = "0.6.2"
@@ -10842,6 +11070,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c"
dependencies = [
"bitflags 2.13.2",
+ "block2 0.6.2",
"objc2 0.6.5",
"objc2-core-graphics",
"objc2-foundation 0.3.2",
@@ -11141,8 +11370,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d"
dependencies = [
"bitflags 2.13.2",
+ "libc",
"objc2 0.6.5",
"objc2-core-foundation",
+ "objc2-foundation 0.3.2",
]
[[package]]
@@ -11189,7 +11420,9 @@ checksum = "a0125f776a10d00af4152d74616409f0d4a2053a6f57fa5b7d6aa2854ac04794"
dependencies = [
"bitflags 2.13.2",
"block2 0.6.2",
+ "dispatch2",
"objc2 0.6.5",
+ "objc2-core-foundation",
"objc2-foundation 0.3.2",
]
@@ -11553,6 +11786,12 @@ dependencies = [
"opusic-sys",
]
+[[package]]
+name = "opuscule"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "418827b94acaa183462024021324b6e733086466375604eb60e584c7acd4462c"
+
[[package]]
name = "opusic-sys"
version = "0.7.5"
@@ -11591,6 +11830,16 @@ dependencies = [
"hashbrown 0.13.2",
]
+[[package]]
+name = "ordered-stream"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50"
+dependencies = [
+ "futures-core",
+ "pin-project-lite",
+]
+
[[package]]
name = "ort"
version = "2.0.0-rc.13"
@@ -11616,6 +11865,16 @@ dependencies = [
"ureq 3.4.2",
]
+[[package]]
+name = "os_pipe"
+version = "1.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967"
+dependencies = [
+ "libc",
+ "windows-sys 0.61.2",
+]
+
[[package]]
name = "outref"
version = "0.1.0"
@@ -12444,7 +12703,7 @@ checksum = "839c8299360d2e998bdb106dc0a6cd71dcc5f4df51df1b620361bf50e283cca6"
dependencies = [
"bytemuck",
"color",
- "kurbo",
+ "kurbo 0.13.1",
"linebender_resource_handle",
"smallvec",
]
@@ -12751,6 +13010,19 @@ dependencies = [
"plotters-backend",
]
+[[package]]
+name = "png"
+version = "0.17.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526"
+dependencies = [
+ "bitflags 1.3.2",
+ "crc32fast",
+ "fdeflate",
+ "flate2",
+ "miniz_oxide 0.8.9",
+]
+
[[package]]
name = "png"
version = "0.18.1"
@@ -12804,6 +13076,12 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3"
+[[package]]
+name = "pollster"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bc6355899e1c9462875b6757c79f3caa011a1fdae12bbb1a2e72dd1f234f8336"
+
[[package]]
name = "poly1305"
version = "0.8.0"
@@ -13077,9 +13355,9 @@ dependencies = [
[[package]]
name = "pulley-interpreter"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b8187c8e7db87d085865fc106502e7b34d5c25f8ce4c272945b21503371f6a0"
+checksum = "4e6d73adcf2f76b98d3de7a31831b6d6436fd2b6518e0ad4f7cc722a12ad4133"
dependencies = [
"cranelift-bitset",
"log",
@@ -13089,9 +13367,9 @@ dependencies = [
[[package]]
name = "pulley-macros"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f98ce0e381d9e45e63ea1d20bba3cf131797086077f43af9203f1fb7de0ed6b"
+checksum = "5bde547f939ab9aa321a54c6694aef2e1e27741c2523c0627ff306677b3cbcff"
dependencies = [
"proc-macro2",
"quote",
@@ -13367,6 +13645,16 @@ dependencies = [
"winit",
]
+[[package]]
+name = "raea-app-targets"
+version = "0.1.0"
+dependencies = [
+ "base64 0.22.1",
+ "raea-io-home",
+ "raea-runtime-bundle",
+ "serde_json",
+]
+
[[package]]
name = "raea-app-tools"
version = "0.1.0"
@@ -13394,7 +13682,7 @@ version = "0.1.0"
dependencies = [
"anyrender",
"blitz-dom",
- "kurbo",
+ "kurbo 0.13.1",
"peniko",
]
@@ -13446,14 +13734,25 @@ dependencies = [
]
[[package]]
-name = "raea-bevy-plugins"
+name = "raea-bevy-parity"
version = "0.1.0"
dependencies = [
- "avian2d",
- "avian3d",
+ "argh",
"bevy",
- "bevy-inspector-egui",
- "bevy-tnua",
+ "chacha20 0.10.2",
+ "raea-sys-parity",
+ "rand 0.10.3",
+]
+
+[[package]]
+name = "raea-bevy-plugins"
+version = "0.1.0"
+dependencies = [
+ "avian2d",
+ "avian3d",
+ "bevy",
+ "bevy-inspector-egui",
+ "bevy-tnua",
"bevy-tnua-avian3d",
"bevy-yoleck",
"bevy_aseprite_ultra",
@@ -13588,6 +13887,7 @@ dependencies = [
"raea-app-game",
"raea-app-media",
"raea-app-play",
+ "raea-app-targets",
"raea-app-tools",
"raea-app-workspace",
"raea-bevy-plugins",
@@ -13698,7 +13998,7 @@ dependencies = [
"bytemuck",
"objc2 0.6.5",
"objc2-metal 0.3.2",
- "pollster",
+ "pollster 0.4.0",
"raea-io-trace",
"serde_json",
"vello",
@@ -13843,6 +14143,16 @@ dependencies = [
"ureq 2.12.1",
]
+[[package]]
+name = "raea-io-net-calls"
+version = "0.1.0"
+dependencies = [
+ "raea-core-wire",
+ "raea-io-net",
+ "serde_json",
+ "tungstenite",
+]
+
[[package]]
name = "raea-io-npm"
version = "0.1.0"
@@ -13868,6 +14178,18 @@ dependencies = [
"tokio",
]
+[[package]]
+name = "raea-io-os"
+version = "0.1.0"
+dependencies = [
+ "arboard",
+ "base64 0.22.1",
+ "opener",
+ "pollster 0.4.0",
+ "rfd",
+ "serde_json",
+]
+
[[package]]
name = "raea-io-shell"
version = "0.1.0"
@@ -13976,6 +14298,8 @@ dependencies = [
"blitz-traits",
"image",
"raea-io-media",
+ "raea-io-net-calls",
+ "raea-io-os",
"raea-page",
"raea-page-stage",
"raea-page-window",
@@ -14069,6 +14393,7 @@ dependencies = [
"raea-sys-material",
"raea-sys-meshseq",
"raea-sys-page",
+ "raea-sys-parity",
"raea-sys-post",
"raea-sys-rt",
"raea-sys-sampler",
@@ -14094,6 +14419,42 @@ dependencies = [
"wgpu",
]
+[[package]]
+name = "raea-rune-host"
+version = "0.1.0"
+dependencies = [
+ "png 0.18.1",
+ "raea-core-wire",
+ "raea-io-net-calls",
+ "raea-io-os",
+ "raea-rune-page",
+ "raea-runtime-bundle-lib",
+ "raea-runtime-jsengine",
+ "rune",
+ "serde",
+ "serde_json",
+]
+
+[[package]]
+name = "raea-rune-page"
+version = "0.1.0"
+dependencies = [
+ "base64 0.22.1",
+ "raea-core-wire",
+ "raea-rune-style",
+ "rune",
+ "rune-kit",
+ "serde_json",
+]
+
+[[package]]
+name = "raea-rune-style"
+version = "0.1.0"
+dependencies = [
+ "rune",
+ "serde_json",
+]
+
[[package]]
name = "raea-runtime-bake"
version = "0.1.0"
@@ -14111,15 +14472,24 @@ name = "raea-runtime-bundle"
version = "0.1.0"
dependencies = [
"dunce",
- "libloading",
+ "junction",
"raea-core-scene",
"raea-io-home",
"raea-io-media",
"raea-native",
+ "raea-runtime-bundle-lib",
"regex",
"serde_json",
]
+[[package]]
+name = "raea-runtime-bundle-lib"
+version = "0.1.0"
+dependencies = [
+ "libloading",
+ "serde_json",
+]
+
[[package]]
name = "raea-runtime-calls"
version = "0.1.0"
@@ -14264,6 +14634,8 @@ dependencies = [
"raea-io-home",
"raea-io-media",
"raea-io-net",
+ "raea-io-net-calls",
+ "raea-io-os",
"raea-runtime-bundle",
"raea-runtime-jsengine",
"serde",
@@ -14305,6 +14677,7 @@ dependencies = [
name = "raea-runtime-look"
version = "0.1.0"
dependencies = [
+ "bevy",
"raea-core-program",
"raea-core-scene",
"serde_json",
@@ -14498,12 +14871,20 @@ dependencies = [
"serde_json",
]
+[[package]]
+name = "raea-shape-web"
+version = "0.1.0"
+dependencies = [
+ "raea-core-shape",
+ "wasm-bindgen",
+]
+
[[package]]
name = "raea-sys-a11y"
version = "0.1.0"
dependencies = [
- "accesskit",
- "accesskit_consumer",
+ "accesskit 0.24.1",
+ "accesskit_consumer 0.38.0",
"serde_json",
]
@@ -14534,11 +14915,11 @@ dependencies = [
"bevy",
"raea-io-media",
"raea-io-net",
- "resvg",
+ "resvg 0.48.1",
"serde_json",
"tiny-skia 0.12.0",
"ttf-parser",
- "usvg",
+ "usvg 0.48.1",
]
[[package]]
@@ -14688,7 +15069,7 @@ name = "raea-sys-k"
version = "0.1.0"
dependencies = [
"bytemuck",
- "pollster",
+ "pollster 0.4.0",
"raea-core-k",
"raea-gpu-device",
"serde_json",
@@ -14747,7 +15128,7 @@ dependencies = [
"raea-io-net",
"raea-sys-frame",
"raea-sys-sampler",
- "resvg",
+ "resvg 0.48.1",
"serde_json",
]
@@ -14824,6 +15205,14 @@ dependencies = [
"url",
]
+[[package]]
+name = "raea-sys-parity"
+version = "0.1.0"
+dependencies = [
+ "bevy",
+ "serde_json",
+]
+
[[package]]
name = "raea-sys-perceive"
version = "0.1.0"
@@ -15542,7 +15931,7 @@ dependencies = [
"wasm-bindgen-futures",
"wasm-streams",
"web-sys",
- "webpki-roots 1.0.9",
+ "webpki-roots 1.0.11",
]
[[package]]
@@ -15560,6 +15949,20 @@ dependencies = [
"tracing",
]
+[[package]]
+name = "resvg"
+version = "0.45.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a8928798c0a55e03c9ca6c4c6846f76377427d2c1e1f7e6de3c06ae57942df43"
+dependencies = [
+ "log",
+ "pico-args",
+ "rgb",
+ "svgtypes 0.15.3",
+ "tiny-skia 0.11.4",
+ "usvg 0.45.1",
+]
+
[[package]]
name = "resvg"
version = "0.48.1"
@@ -15570,9 +15973,33 @@ dependencies = [
"log",
"pico-args",
"rgb",
- "svgtypes",
+ "svgtypes 0.16.1",
"tiny-skia 0.12.0",
- "usvg",
+ "usvg 0.48.1",
+]
+
+[[package]]
+name = "rfd"
+version = "0.17.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "20dafead71c16a34e1ff357ddefc8afc11e7d51d6d2b9fbd07eaa48e3e540220"
+dependencies = [
+ "block2 0.6.2",
+ "dispatch2",
+ "js-sys",
+ "libc",
+ "log",
+ "objc2 0.6.5",
+ "objc2-app-kit 0.3.2",
+ "objc2-core-foundation",
+ "objc2-foundation 0.3.2",
+ "percent-encoding",
+ "pollster 0.4.0",
+ "raw-window-handle",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "web-sys",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -16339,6 +16766,112 @@ dependencies = [
"realfft",
]
+[[package]]
+name = "rune"
+version = "0.0.1"
+source = "git+https://github.com/anomalyco/rune?rev=7ead7d63fcf6f9dd9669385a8b90e2ae80015d7b#7ead7d63fcf6f9dd9669385a8b90e2ae80015d7b"
+dependencies = [
+ "accesskit 0.25.2",
+ "accesskit_macos 0.27.2",
+ "accesskit_unix",
+ "accesskit_windows 0.35.2",
+ "arboard",
+ "blake3",
+ "block2 0.5.1",
+ "block2 0.6.2",
+ "bytemuck",
+ "console_error_panic_hook",
+ "futures-util",
+ "half",
+ "image",
+ "js-sys",
+ "libc",
+ "libloading",
+ "objc2 0.5.3",
+ "objc2 0.6.5",
+ "objc2-app-kit 0.2.2",
+ "objc2-av-foundation",
+ "objc2-core-foundation",
+ "objc2-core-graphics",
+ "objc2-core-media",
+ "objc2-core-video",
+ "objc2-foundation 0.2.2",
+ "objc2-foundation 0.3.2",
+ "objc2-io-surface",
+ "objc2-metal 0.3.2",
+ "objc2-quartz-core 0.3.2",
+ "opuscule",
+ "parking_lot",
+ "parley",
+ "png 0.18.1",
+ "pollster 1.0.1",
+ "portable-atomic",
+ "raw-window-handle",
+ "raw-window-metal",
+ "resvg 0.45.1",
+ "rune-motion",
+ "rune-staging",
+ "rune-taffy",
+ "rustc-demangle",
+ "rustc-hash 2.1.3",
+ "serde",
+ "serde_json",
+ "swash",
+ "symphonia",
+ "taffy",
+ "tokio",
+ "unicode-segmentation",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "wayland-backend",
+ "wayland-client",
+ "wayland-protocols",
+ "wayland-protocols-wlr",
+ "web-sys",
+ "web-time",
+ "wgpu",
+ "wgpu-core",
+ "wgpu-hal",
+ "wgpu-naga-bridge",
+ "windows-sys 0.59.0",
+ "winit",
+ "x11rb",
+ "xkbcommon",
+ "zbus 6.2.1",
+ "zeroize",
+]
+
+[[package]]
+name = "rune-kit"
+version = "0.0.1"
+source = "git+https://github.com/anomalyco/rune?rev=7ead7d63fcf6f9dd9669385a8b90e2ae80015d7b#7ead7d63fcf6f9dd9669385a8b90e2ae80015d7b"
+dependencies = [
+ "rune",
+ "rune-motion",
+ "unicode-segmentation",
+]
+
+[[package]]
+name = "rune-motion"
+version = "0.1.0"
+source = "git+https://github.com/anomalyco/rune?rev=7ead7d63fcf6f9dd9669385a8b90e2ae80015d7b#7ead7d63fcf6f9dd9669385a8b90e2ae80015d7b"
+
+[[package]]
+name = "rune-staging"
+version = "0.0.1"
+source = "git+https://github.com/anomalyco/rune?rev=7ead7d63fcf6f9dd9669385a8b90e2ae80015d7b#7ead7d63fcf6f9dd9669385a8b90e2ae80015d7b"
+dependencies = [
+ "wgpu",
+]
+
+[[package]]
+name = "rune-taffy"
+version = "0.0.1"
+source = "git+https://github.com/anomalyco/rune?rev=7ead7d63fcf6f9dd9669385a8b90e2ae80015d7b#7ead7d63fcf6f9dd9669385a8b90e2ae80015d7b"
+dependencies = [
+ "taffy",
+]
+
[[package]]
name = "rusqlite"
version = "0.37.0"
@@ -16525,9 +17058,9 @@ checksum = "eec689c0bc40ff2458a5977b6619cb718087084a18e02a131c599b62d05e1a5f"
[[package]]
name = "rustls-webpki"
-version = "0.103.15"
+version = "0.103.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f3c3cf1d8b1e7d4927e2d154c3fcb02979afb9939629c62cd9048d4f07b60ac2"
+checksum = "4443b1b6d39d7c663139942cc4558262562d2c84123bb6282ef177009ca8b281"
dependencies = [
"aws-lc-rs",
"ring",
@@ -16543,9 +17076,9 @@ checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
[[package]]
name = "ruzstd"
-version = "0.8.3"
+version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7c1c839d570d835527c9a5e4db7cb2198683a988cb9d7293fc8674e6bd58fc8"
+checksum = "69e4ce4a039f42bf25920b95667e4d789e98749ab11bbb8d2c2936f788421bb5"
dependencies = [
"twox-hash",
]
@@ -16820,6 +17353,17 @@ dependencies = [
"serde",
]
+[[package]]
+name = "serde_repr"
+version = "0.1.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8d3b1629de253c70a0508c3899572da79ca359fdab27c7920ff00406df418906"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+]
+
[[package]]
name = "serde_spanned"
version = "1.1.2"
@@ -16944,6 +17488,16 @@ version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7f45b8998ced5134fb1d75732c77842a3e888f19c1ff98481822e8fbfbf930b"
+[[package]]
+name = "signal-hook-registry"
+version = "1.4.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
+dependencies = [
+ "errno",
+ "libc",
+]
+
[[package]]
name = "simba"
version = "0.10.2"
@@ -17684,13 +18238,23 @@ version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0193cc4331cfd2f3d2011ef287590868599a2f33c3e69bc22c1a3d3acf9e02fb"
+[[package]]
+name = "svgtypes"
+version = "0.15.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "68c7541fff44b35860c1a7a47a7cadf3e4a304c457b58f9870d9706ece028afc"
+dependencies = [
+ "kurbo 0.11.3",
+ "siphasher 1.0.4",
+]
+
[[package]]
name = "svgtypes"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "695b5790b3131dafa99b3bbfd25a216edb3d216dad9ca208d4657bfb8f2abc3d"
dependencies = [
- "kurbo",
+ "kurbo 0.13.1",
"siphasher 1.0.4",
]
@@ -18633,6 +19197,7 @@ dependencies = [
"bytemuck",
"cfg-if",
"log",
+ "png 0.17.16",
"tiny-skia-path 0.11.4",
]
@@ -18647,7 +19212,7 @@ dependencies = [
"bytemuck",
"cfg-if",
"log",
- "png",
+ "png 0.18.1",
"tiny-skia-path 0.12.0",
]
@@ -18801,14 +19366,15 @@ dependencies = [
[[package]]
name = "tokio"
-version = "1.54.0"
+version = "1.54.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a0c168a474b95bfecfe908a65d4bdffc523144b649a74c09c286afb35d53e0bc"
+checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3"
dependencies = [
"bytes",
"libc",
"mio",
"pin-project-lite",
+ "signal-hook-registry",
"socket2",
"tokio-macros",
"windows-sys 0.61.2",
@@ -19282,6 +19848,17 @@ dependencies = [
"strength_reduce",
]
+[[package]]
+name = "tree_magic_mini"
+version = "3.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b8765b90061cba6c22b5831f675da109ae5561588290f9fa2317adab2714d5a6"
+dependencies = [
+ "memchr",
+ "nom 8.0.0",
+ "petgraph",
+]
+
[[package]]
name = "trie-rs"
version = "0.4.2"
@@ -19402,6 +19979,17 @@ version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971"
+[[package]]
+name = "uds_windows"
+version = "1.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e"
+dependencies = [
+ "memoffset",
+ "tempfile",
+ "windows-sys 0.61.2",
+]
+
[[package]]
name = "uluru"
version = "3.1.0"
@@ -19562,7 +20150,7 @@ dependencies = [
"ureq-proto",
"utf8-zero",
"webpki-root-certs",
- "webpki-roots 1.0.9",
+ "webpki-roots 1.0.11",
]
[[package]]
@@ -19596,6 +20184,28 @@ version = "2.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
+[[package]]
+name = "usvg"
+version = "0.45.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "80be9b06fbae3b8b303400ab20778c80bbaf338f563afe567cf3c9eea17b47ef"
+dependencies = [
+ "base64 0.22.1",
+ "data-url 0.3.2",
+ "flate2",
+ "imagesize 0.13.0",
+ "kurbo 0.11.3",
+ "log",
+ "pico-args",
+ "roxmltree 0.20.0",
+ "simplecss",
+ "siphasher 1.0.4",
+ "strict-num",
+ "svgtypes 0.15.3",
+ "tiny-skia-path 0.11.4",
+ "xmlwriter",
+]
+
[[package]]
name = "usvg"
version = "0.48.1"
@@ -19607,8 +20217,8 @@ dependencies = [
"flate2",
"fontdb 0.24.0",
"harfrust 0.12.0",
- "imagesize",
- "kurbo",
+ "imagesize 0.15.0",
+ "kurbo 0.13.1",
"log",
"pico-args",
"roxmltree 0.21.1",
@@ -19616,7 +20226,7 @@ dependencies = [
"siphasher 1.0.4",
"skrifa 0.44.0",
"strict-num",
- "svgtypes",
+ "svgtypes 0.16.1",
"tiny-skia-path 0.12.0",
"unicode-bidi",
"unicode-script",
@@ -19716,7 +20326,7 @@ dependencies = [
"futures-intrusive",
"log",
"peniko",
- "png",
+ "png 0.18.1",
"skrifa 0.44.0",
"static_assertions",
"thiserror 2.0.21",
@@ -19993,9 +20603,9 @@ dependencies = [
[[package]]
name = "wasmtime"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12300d040e8bea7e7ccde75b9919d27ebba47a217a64b09ba058ae8d3b4290b6"
+checksum = "a2afcadb2e7d0417cb8f3f322c66eff49338b288f22290c0ca0bd3e9570732aa"
dependencies = [
"addr2line",
"async-trait",
@@ -20033,9 +20643,9 @@ dependencies = [
[[package]]
name = "wasmtime-environ"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "805d6554eb6dd6e62891061a31383a89d69fd891f785e5ae68f0835a554b7a2a"
+checksum = "2de252f4aedfff6c2054ea5bea2454878a931c56e2553c6356b581e5e30a7e4e"
dependencies = [
"anyhow",
"cpp_demangle",
@@ -20062,9 +20672,9 @@ dependencies = [
[[package]]
name = "wasmtime-internal-component-macro"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b832b80853365d9d3a741681044554be291a4f977aae074b318b55c7a4835f83"
+checksum = "14127b0c5d6e543fa0b90747df60b3f96af499df8570f829acb7b8e2a98faa85"
dependencies = [
"anyhow",
"proc-macro2",
@@ -20077,15 +20687,15 @@ dependencies = [
[[package]]
name = "wasmtime-internal-component-util"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c8a11aaf68d8945991429d45950f32490a30ddcdcdb56629816cb41a255d8fe"
+checksum = "e5ad52499e6246d30bf8bf509506bd637248eee17c8dd623e0c7dbe43e7a1036"
[[package]]
name = "wasmtime-internal-core"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ea266d6cfb31c324c075c8432386654bcbb1559aa8d29be9d47eacf7dcc41012"
+checksum = "d8838d7debfc98a69342d260a990ea6f64adf498184915fccfdbd6718bb40a9b"
dependencies = [
"hashbrown 0.17.1",
"libm",
@@ -20094,9 +20704,9 @@ dependencies = [
[[package]]
name = "wasmtime-internal-fiber"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b54c8c5b02ea985149a90f917e1761af99734c6c27e6d7fdd5b6f69fc1db3950"
+checksum = "96dce7a8ea302c0f1eb4154eb1756525c90c595bbabbc590abad64d4c5ff8bbb"
dependencies = [
"cc",
"libc",
@@ -20108,9 +20718,9 @@ dependencies = [
[[package]]
name = "wasmtime-internal-jit-debug"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72bb10c94724f072b6eca515085033e61da9efae65d054545126df37a15530c3"
+checksum = "895f3231b24ce0c12c8a7bb129a9f6ddc6772ec78e59748e53af743dcdd733d1"
dependencies = [
"cc",
"wasmtime-internal-versioned-export-macros",
@@ -20118,9 +20728,9 @@ dependencies = [
[[package]]
name = "wasmtime-internal-jit-icache-coherence"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b781a27e8958fd07fd3135c0be216f77301efecd15cbf4f14ff210cdad5f169"
+checksum = "28b60a0c1f735da6b862679b763f8bab653caa477ccc603a25752488b795fec5"
dependencies = [
"libc",
"wasmtime-internal-core",
@@ -20129,9 +20739,9 @@ dependencies = [
[[package]]
name = "wasmtime-internal-unwinder"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "121188de1b2741b8e35530a9b0c8adf525b3aa5913a2ca3d4522509cfbc0494a"
+checksum = "b97b2c29c8f458bdf1b948058bfbb8141aad0f7abcf0f7cb3479866f4316bf3c"
dependencies = [
"log",
"object",
@@ -20140,9 +20750,9 @@ dependencies = [
[[package]]
name = "wasmtime-internal-versioned-export-macros"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "933f1990e4e5177547a4abd51dcfa5cb7616fe42b9fb6f0f2b7423627758223c"
+checksum = "32766b38d56927eca9a65858ea8c7b1803424db82562aafd69727aa970057561"
dependencies = [
"proc-macro2",
"quote",
@@ -20151,9 +20761,9 @@ dependencies = [
[[package]]
name = "wasmtime-internal-wit-bindgen"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "417ebd61d2581d86d65413517f3a41294a9ad105da26f0dc7039912a0d97e1ed"
+checksum = "407a8c055545e5c4c6c942237d934c9906cd995639a17af89f3368f0a05534eb"
dependencies = [
"anyhow",
"bitflags 2.13.2",
@@ -20165,9 +20775,9 @@ dependencies = [
[[package]]
name = "wasmtime-wasi"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ef0d3ec88f9406bc5e498848489c49ff515577500acc9f03fa93d0883dce435"
+checksum = "a678afa77874a2d6eed071852f7777ccd77495e0bfbc30f7b8089e1d00b2485f"
dependencies = [
"async-trait",
"bitflags 2.13.2",
@@ -20190,9 +20800,9 @@ dependencies = [
[[package]]
name = "wasmtime-wasi-io"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe7dfc924e222e15455bd6d445ff7065a4595fffc7698c7bbc01acc0ed6c0421"
+checksum = "0879bd441bddd61e1c15cc5f39ec297de8ee34ffc12f5459aad3b7ab6afcf510"
dependencies = [
"async-trait",
"bytes",
@@ -20425,9 +21035,9 @@ dependencies = [
[[package]]
name = "webpki-root-certs"
-version = "1.0.9"
+version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b96554aa2acc8ccdb7e1c9a58a7a68dd5d13bccc69cd124cb09406db612a1c9b"
+checksum = "e49d0e65abc00c142e8f9428da991da9f1a250c39be97459901eb12b9b49f62a"
dependencies = [
"rustls-pki-types",
]
@@ -20438,14 +21048,14 @@ version = "0.26.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9"
dependencies = [
- "webpki-roots 1.0.9",
+ "webpki-roots 1.0.11",
]
[[package]]
name = "webpki-roots"
-version = "1.0.9"
+version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a"
+checksum = "f5f280bbb2b287bc8e7de7e3852945a0ff50d1bbcb5ed42b6c7a568c546df171"
dependencies = [
"rustls-pki-types",
]
@@ -20732,9 +21342,9 @@ dependencies = [
[[package]]
name = "wiggle"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f25221922f042ed78c7857a29f2e54d45d02a73891bcc3a046f2c3c0400cfd3"
+checksum = "17e5cc50b6407d17fdf61e3d4801ea3420356a6892b7cac3a99def3448d5bda9"
dependencies = [
"bitflags 2.13.2",
"thiserror 2.0.21",
@@ -20746,9 +21356,9 @@ dependencies = [
[[package]]
name = "wiggle-generate"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e9ad83cd72263fd94189bdbf3bf37dc131f6a293ff639cebfbb00ed3f21f05f2"
+checksum = "3de41de3f5e1b312a71580b9004eff11ba0a99138aa9e29933b6b5598ebb157d"
dependencies = [
"heck 0.5.0",
"proc-macro2",
@@ -20760,9 +21370,9 @@ dependencies = [
[[package]]
name = "wiggle-macro"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96820f65b0f61bad3e6dd073f670db9a6da537dc71f848fee715f692b19dfd9a"
+checksum = "7ad3b2bd32e9c3066a3fd6da46fc408113edebecc265690ad4653383f728fab9"
dependencies = [
"proc-macro2",
"quote",
@@ -21316,6 +21926,24 @@ dependencies = [
"wast",
]
+[[package]]
+name = "wl-clipboard-rs"
+version = "0.9.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4d7888ccd4896447b2d14d3a9350a85df2aeb6f181e2e7a31349d104ac46cac1"
+dependencies = [
+ "libc",
+ "log",
+ "os_pipe",
+ "rustix 1.1.5",
+ "thiserror 2.0.21",
+ "tree_magic_mini",
+ "wayland-backend",
+ "wayland-client",
+ "wayland-protocols",
+ "wayland-protocols-wlr",
+]
+
[[package]]
name = "wmidi"
version = "4.0.11"
@@ -21341,7 +21969,7 @@ checksum = "3d3d8c2a5be94ed1451407100aa168d50893f3ea125a493a6a46722b01795bbe"
dependencies = [
"font-types 0.11.3",
"indexmap",
- "kurbo",
+ "kurbo 0.13.1",
"log",
"read-fonts 0.38.0",
]
@@ -21505,6 +22133,17 @@ version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "163b33ed8786455e2fa5d72f554057ce3f3182425434f756cd39c99839d88e23"
+[[package]]
+name = "xkbcommon"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a7a974f48060a14e95705c01f24ad9c3345022f4d97441b8a36beb7ed5c4a02d"
+dependencies = [
+ "libc",
+ "memmap2 0.9.11",
+ "xkeysym",
+]
+
[[package]]
name = "xkbcommon-dl"
version = "0.4.2"
@@ -21660,6 +22299,165 @@ dependencies = [
"synstructure 0.14.0",
]
+[[package]]
+name = "zbus"
+version = "5.19.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5db4be7c075cb421e4b7ee645541604239bd243ba7c357511f4ff3a74b555907"
+dependencies = [
+ "async-broadcast",
+ "async-executor",
+ "async-io",
+ "async-lock",
+ "async-process",
+ "async-recursion",
+ "async-task",
+ "async-trait",
+ "blocking",
+ "enumflags2",
+ "event-listener",
+ "futures-core",
+ "futures-lite",
+ "hex",
+ "libc",
+ "ordered-stream",
+ "rustix 1.1.5",
+ "serde",
+ "serde_repr",
+ "tracing",
+ "uds_windows",
+ "uuid",
+ "windows-sys 0.61.2",
+ "winnow 1.0.4",
+ "zbus_macros 5.19.0",
+ "zbus_names",
+ "zvariant",
+]
+
+[[package]]
+name = "zbus"
+version = "6.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ddb2961d9587ef9f24ad14cde1c3bc4c5edc9f1525932a8cffdd5bd98886eb9"
+dependencies = [
+ "async-trait",
+ "bitflags 2.13.2",
+ "endi",
+ "futures-core",
+ "hex",
+ "libc",
+ "ordered-stream",
+ "rustix 1.1.5",
+ "serde",
+ "serde_repr",
+ "socket2",
+ "tokio",
+ "uds_windows",
+ "uuid",
+ "windows-sys 0.61.2",
+ "winnow 1.0.4",
+ "zbus_macros 6.2.1",
+ "zbus_utils",
+ "zcheapstr",
+ "zruntime",
+]
+
+[[package]]
+name = "zbus-lockstep"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6998de05217a084b7578728a9443d04ea4cd80f2a0839b8d78770b76ccd45863"
+dependencies = [
+ "zbus_xml",
+ "zvariant",
+]
+
+[[package]]
+name = "zbus-lockstep-macros"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "10da05367f3a7b7553c8cdf8fa91aee6b64afebe32b51c95177957efc47ca3a0"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+ "zbus-lockstep",
+ "zbus_xml",
+ "zvariant",
+]
+
+[[package]]
+name = "zbus_macros"
+version = "5.19.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2990635d09ade6df1868f72f8cac69a876a90981e8bd3c40b1be413f8dc88f40"
+dependencies = [
+ "proc-macro-crate 3.5.0",
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+ "zbus_names",
+ "zvariant",
+ "zvariant_utils",
+]
+
+[[package]]
+name = "zbus_macros"
+version = "6.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "083b38add47c340fc12ec560124fb1d9c23acb584f7021099f85ec6587a03c54"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+ "zbus_utils",
+]
+
+[[package]]
+name = "zbus_names"
+version = "4.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d8bf88b4a3ff53e883001e0e0115b297a9d53c31b9c1edd2bfdd853e3428624e"
+dependencies = [
+ "serde",
+ "winnow 1.0.4",
+ "zvariant",
+]
+
+[[package]]
+name = "zbus_utils"
+version = "6.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "af55e52da295311b368c45bcae221f020e28e97a2420360170ce389218e76ec7"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "serde",
+ "syn 3.0.9",
+ "winnow 1.0.4",
+]
+
+[[package]]
+name = "zbus_xml"
+version = "5.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d1586c021a01ca0a9216dcd874e546382e156a5cbab5fab6cb5f10087e22682a"
+dependencies = [
+ "serde",
+ "winnow 1.0.4",
+ "zbus_names",
+ "zvariant",
+]
+
+[[package]]
+name = "zcheapstr"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d1afec51604565183aeb5c54c20aeab286120d4e4460f7f76e3e8bb8c0d99473"
+dependencies = [
+ "serde",
+]
+
[[package]]
name = "zeno"
version = "0.3.3"
@@ -21795,20 +22593,30 @@ version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
+[[package]]
+name = "zruntime"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "23ef5ed7d628cdf0af82f93dfe03330a8e37383bf7422a1d3d6eb72326680be5"
+dependencies = [
+ "futures-core",
+ "futures-io",
+]
+
[[package]]
name = "zstd"
-version = "0.13.3"
+version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a"
+checksum = "cdb02c3132d251ab1606e9fc913a7da6c6ed08cc263df15edf082e1dc497d157"
dependencies = [
"zstd-safe",
]
[[package]]
name = "zstd-safe"
-version = "7.3.0"
+version = "7.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64d80649ab6db9d9f6f9c80a40becd948eda4714a0a5ac8c4d157a32231c7882"
+checksum = "1c8ea04668f5de8d8d51051714ba560c9536519cadcdb8829bba4fe2ad159b03"
dependencies = [
"zstd-sys",
]
@@ -21846,3 +22654,44 @@ checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296"
dependencies = [
"zune-core",
]
+
+[[package]]
+name = "zvariant"
+version = "5.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c1d34c27cc6cdd1f458427519dd6b8612f7b7e3f7b9a0b2355d041dda9869147"
+dependencies = [
+ "endi",
+ "enumflags2",
+ "serde",
+ "winnow 1.0.4",
+ "zcheapstr",
+ "zvariant_derive",
+ "zvariant_utils",
+]
+
+[[package]]
+name = "zvariant_derive"
+version = "5.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "864155e69b4352db0c7f374917bf45d1e0c8d17659c8b3dbf9795f3673f8c497"
+dependencies = [
+ "proc-macro-crate 3.5.0",
+ "proc-macro2",
+ "quote",
+ "syn 3.0.9",
+ "zvariant_utils",
+]
+
+[[package]]
+name = "zvariant_utils"
+version = "4.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bad0294361a320b694a328460dc73add56c306150f5cb6bfafc44446120008a3"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "serde",
+ "syn 3.0.9",
+ "winnow 1.0.4",
+]
diff --git a/Cargo.toml b/Cargo.toml
index 994496b0..31c368db 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,10 +12,13 @@ members = [
"core/shape",
"core/wire",
"io/net",
+ "io/net/calls",
+ "io/os",
"systems/animate",
"systems/framepass",
"systems/compute",
"systems/sampler",
+ "systems/parity",
"systems/shader",
"engine/bevy-calls",
"engine/bevy-adapters",
@@ -31,6 +34,9 @@ members = [
"io/npm",
"engine/page",
"engine/page/host",
+ "engine/rune",
+ "engine/rune/page",
+ "engine/rune/style",
"engine/page/stage",
"engine/page/window",
"io/trace",
@@ -104,10 +110,13 @@ members = [
"engine/seedling",
"runtime/react",
"bench/bridge",
+ "bench/bevy-parity",
"bench/bridge/swatch",
"core/alloc",
"runtime/bake",
"runtime/bundle",
+ "runtime/bundle/lib",
+ "engine/shape-web",
"runtime/calls",
"runtime/export",
"runtime/live",
@@ -121,6 +130,7 @@ members = [
"apps/ci",
"apps/tools",
"apps/media",
+ "apps/targets",
"apps/game",
"apps/play",
"tools/sdk-props",
@@ -132,6 +142,9 @@ exclude = [
# io/npm's reqwest = { workspace = true }
[workspace.dependencies]
+# Rune (MIT, the native target: engine/rune) by a pinned rev of `dev`, never rewritten upstream; bump on purpose, in a commit of its own
+rune = { git = "https://github.com/anomalyco/rune", rev = "7ead7d63fcf6f9dd9669385a8b90e2ae80015d7b" }
+rune-kit = { git = "https://github.com/anomalyco/rune", rev = "7ead7d63fcf6f9dd9669385a8b90e2ae80015d7b" }
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls", "stream"] }
[profile.release]
diff --git a/LICENSES/bevy_scene_macros-0.20.0/LICENSE.txt b/LICENSES/accesskit-0.25.2/LICENSE.txt
similarity index 86%
rename from LICENSES/bevy_scene_macros-0.20.0/LICENSE.txt
rename to LICENSES/accesskit-0.25.2/LICENSE.txt
index 8f39b5e5..fd04a95d 100644
--- a/LICENSES/bevy_scene_macros-0.20.0/LICENSE.txt
+++ b/LICENSES/accesskit-0.25.2/LICENSE.txt
@@ -1,10 +1,10 @@
-bevy_scene_macros 0.20.0 ships no licence file of its own. Its Cargo.toml declares MIT OR Apache-2.0, by its authors.
+accesskit 0.25.2 ships no licence file of its own. Its Cargo.toml declares MIT OR Apache-2.0, by The AccessKit contributors.
---- Apache-2.0: the text is LICENSES/texts/Apache-2.0.txt ----
---- MIT ----
-Copyright (c) its authors
+Copyright (c) The AccessKit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
diff --git a/LICENSES/objc2-app-kit-0.3.2/LICENSE.txt b/LICENSES/accesskit_atspi_common-0.21.1/LICENSE.txt
similarity index 52%
rename from LICENSES/objc2-app-kit-0.3.2/LICENSE.txt
rename to LICENSES/accesskit_atspi_common-0.21.1/LICENSE.txt
index 0273e9df..8ea24940 100644
--- a/LICENSES/objc2-app-kit-0.3.2/LICENSE.txt
+++ b/LICENSES/accesskit_atspi_common-0.21.1/LICENSE.txt
@@ -1,10 +1,10 @@
-objc2-app-kit 0.3.2 ships no licence file of its own. Its Cargo.toml declares Zlib OR Apache-2.0 OR MIT, by its authors.
+accesskit_atspi_common 0.21.1 ships no licence file of its own. Its Cargo.toml declares MIT OR Apache-2.0, by The AccessKit contributors.
---- Apache-2.0: the text is LICENSES/texts/Apache-2.0.txt ----
---- MIT ----
-Copyright (c) its authors
+Copyright (c) The AccessKit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
@@ -18,20 +18,3 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
----- Zlib ----
-
-Copyright (c) its authors
-
-This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held
-liable for any damages arising from the use of this software.
-
-Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter
-it and redistribute it freely, subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If
- you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not
- required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original
- software.
-3. This notice may not be removed or altered from any source distribution.
diff --git a/LICENSES/accesskit_consumer-0.39.2/LICENSE.txt b/LICENSES/accesskit_consumer-0.39.2/LICENSE.txt
new file mode 100644
index 00000000..52d8fc55
--- /dev/null
+++ b/LICENSES/accesskit_consumer-0.39.2/LICENSE.txt
@@ -0,0 +1,20 @@
+accesskit_consumer 0.39.2 ships no licence file of its own. Its Cargo.toml declares MIT OR Apache-2.0, by The AccessKit contributors.
+
+---- Apache-2.0: the text is LICENSES/texts/Apache-2.0.txt ----
+
+---- MIT ----
+
+Copyright (c) The AccessKit contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/accesskit_macos-0.27.2/LICENSE.txt b/LICENSES/accesskit_macos-0.27.2/LICENSE.txt
new file mode 100644
index 00000000..56ae04cf
--- /dev/null
+++ b/LICENSES/accesskit_macos-0.27.2/LICENSE.txt
@@ -0,0 +1,20 @@
+accesskit_macos 0.27.2 ships no licence file of its own. Its Cargo.toml declares MIT OR Apache-2.0, by The AccessKit contributors.
+
+---- Apache-2.0: the text is LICENSES/texts/Apache-2.0.txt ----
+
+---- MIT ----
+
+Copyright (c) The AccessKit contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/accesskit_unix-0.24.1/LICENSE.txt b/LICENSES/accesskit_unix-0.24.1/LICENSE.txt
new file mode 100644
index 00000000..6573e744
--- /dev/null
+++ b/LICENSES/accesskit_unix-0.24.1/LICENSE.txt
@@ -0,0 +1,20 @@
+accesskit_unix 0.24.1 ships no licence file of its own. Its Cargo.toml declares MIT OR Apache-2.0, by The AccessKit contributors.
+
+---- Apache-2.0: the text is LICENSES/texts/Apache-2.0.txt ----
+
+---- MIT ----
+
+Copyright (c) The AccessKit contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/accesskit_windows-0.35.2/LICENSE.txt b/LICENSES/accesskit_windows-0.35.2/LICENSE.txt
new file mode 100644
index 00000000..a2c3dc24
--- /dev/null
+++ b/LICENSES/accesskit_windows-0.35.2/LICENSE.txt
@@ -0,0 +1,20 @@
+accesskit_windows 0.35.2 ships no licence file of its own. Its Cargo.toml declares MIT OR Apache-2.0, by The AccessKit contributors.
+
+---- Apache-2.0: the text is LICENSES/texts/Apache-2.0.txt ----
+
+---- MIT ----
+
+Copyright (c) The AccessKit contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/async-process-2.5.0/LICENSE-APACHE b/LICENSES/async-process-2.5.0/LICENSE-APACHE
new file mode 100644
index 00000000..16fe87b0
--- /dev/null
+++ b/LICENSES/async-process-2.5.0/LICENSE-APACHE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/LICENSES/async-process-2.5.0/LICENSE-MIT b/LICENSES/async-process-2.5.0/LICENSE-MIT
new file mode 100644
index 00000000..31aa7938
--- /dev/null
+++ b/LICENSES/async-process-2.5.0/LICENSE-MIT
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/async-recursion-1.2.0/LICENSE-APACHE b/LICENSES/async-recursion-1.2.0/LICENSE-APACHE
new file mode 100644
index 00000000..ec68b7e2
--- /dev/null
+++ b/LICENSES/async-recursion-1.2.0/LICENSE-APACHE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
\ No newline at end of file
diff --git a/LICENSES/async-recursion-1.2.0/LICENSE-MIT b/LICENSES/async-recursion-1.2.0/LICENSE-MIT
new file mode 100644
index 00000000..b6b94c73
--- /dev/null
+++ b/LICENSES/async-recursion-1.2.0/LICENSE-MIT
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/LICENSES/async-signal-0.2.14/LICENSE-APACHE b/LICENSES/async-signal-0.2.14/LICENSE-APACHE
new file mode 100644
index 00000000..16fe87b0
--- /dev/null
+++ b/LICENSES/async-signal-0.2.14/LICENSE-APACHE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/LICENSES/async-signal-0.2.14/LICENSE-MIT b/LICENSES/async-signal-0.2.14/LICENSE-MIT
new file mode 100644
index 00000000..31aa7938
--- /dev/null
+++ b/LICENSES/async-signal-0.2.14/LICENSE-MIT
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/arboard-3.7.0/LICENSE-APACHE.txt b/LICENSES/atspi-0.29.0/LICENSE-APACHE2.txt
similarity index 89%
rename from LICENSES/arboard-3.7.0/LICENSE-APACHE.txt
rename to LICENSES/atspi-0.29.0/LICENSE-APACHE2.txt
index f433b1a5..b09cd785 100644
--- a/LICENSES/arboard-3.7.0/LICENSE-APACHE.txt
+++ b/LICENSES/atspi-0.29.0/LICENSE-APACHE2.txt
@@ -1,5 +1,4 @@
-
- Apache License
+Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
@@ -175,3 +174,28 @@
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/LICENSES/atspi-0.29.0/LICENSE-MIT.txt b/LICENSES/atspi-0.29.0/LICENSE-MIT.txt
new file mode 100644
index 00000000..95c43833
--- /dev/null
+++ b/LICENSES/atspi-0.29.0/LICENSE-MIT.txt
@@ -0,0 +1,19 @@
+Copyright (c) 2022 Tait Hoyem <[email protected]>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/LICENSES/normpath-1.5.2/LICENSE-APACHE b/LICENSES/atspi-common-0.13.0/LICENSE-APACHE2.txt
similarity index 89%
rename from LICENSES/normpath-1.5.2/LICENSE-APACHE
rename to LICENSES/atspi-common-0.13.0/LICENSE-APACHE2.txt
index d9a10c0d..b09cd785 100644
--- a/LICENSES/normpath-1.5.2/LICENSE-APACHE
+++ b/LICENSES/atspi-common-0.13.0/LICENSE-APACHE2.txt
@@ -1,4 +1,4 @@
- Apache License
+Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
@@ -174,3 +174,28 @@
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/LICENSES/atspi-common-0.13.0/LICENSE-MIT.txt b/LICENSES/atspi-common-0.13.0/LICENSE-MIT.txt
new file mode 100644
index 00000000..95c43833
--- /dev/null
+++ b/LICENSES/atspi-common-0.13.0/LICENSE-MIT.txt
@@ -0,0 +1,19 @@
+Copyright (c) 2022 Tait Hoyem <[email protected]>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/LICENSES/atspi-proxies-0.13.0/LICENSE-APACHE2.txt b/LICENSES/atspi-proxies-0.13.0/LICENSE-APACHE2.txt
new file mode 100644
index 00000000..b09cd785
--- /dev/null
+++ b/LICENSES/atspi-proxies-0.13.0/LICENSE-APACHE2.txt
@@ -0,0 +1,201 @@
+Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/LICENSES/atspi-proxies-0.13.0/LICENSE-MIT.txt b/LICENSES/atspi-proxies-0.13.0/LICENSE-MIT.txt
new file mode 100644
index 00000000..95c43833
--- /dev/null
+++ b/LICENSES/atspi-proxies-0.13.0/LICENSE-MIT.txt
@@ -0,0 +1,19 @@
+Copyright (c) 2022 Tait Hoyem <[email protected]>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/LICENSES/clipboard-win-5.4.1/LICENSE.txt b/LICENSES/clipboard-win-5.4.1/LICENSE.txt
deleted file mode 100644
index 873a1983..00000000
--- a/LICENSES/clipboard-win-5.4.1/LICENSE.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-clipboard-win 5.4.1 ships no licence file of its own. Its Cargo.toml declares BSL-1.0, by Douman <[email protected]>.
-
----- BSL-1.0: the text is LICENSES/texts/BSL-1.0.txt ----
diff --git a/LICENSES/endi-1.1.1/LICENSE-MIT b/LICENSES/endi-1.1.1/LICENSE-MIT
new file mode 100644
index 00000000..31aa7938
--- /dev/null
+++ b/LICENSES/endi-1.1.1/LICENSE-MIT
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/error-code-3.4.0/LICENSE b/LICENSES/error-code-3.4.0/LICENSE
deleted file mode 100644
index 36b7cd93..00000000
--- a/LICENSES/error-code-3.4.0/LICENSE
+++ /dev/null
@@ -1,23 +0,0 @@
-Boost Software License - Version 1.0 - August 17th, 2003
-
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/normpath-1.5.2/LICENSE-MIT b/LICENSES/imagesize-0.13.0/LICENSE
similarity index 95%
rename from LICENSES/normpath-1.5.2/LICENSE-MIT
rename to LICENSES/imagesize-0.13.0/LICENSE
index 5a602c03..7208322b 100644
--- a/LICENSES/normpath-1.5.2/LICENSE-MIT
+++ b/LICENSES/imagesize-0.13.0/LICENSE
@@ -1,21 +1,21 @@
-MIT License
-
-Copyright (c) 2020 dylni (https://github.com/dylni)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+MIT License
+
+Copyright (c) 2017 Maiddog
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/LICENSES/opener-0.9.0/LICENSE-APACHE b/LICENSES/kurbo-0.11.3/LICENSE-APACHE
similarity index 99%
rename from LICENSES/opener-0.9.0/LICENSE-APACHE
rename to LICENSES/kurbo-0.11.3/LICENSE-APACHE
index 4c8c37f5..d6456956 100644
--- a/LICENSES/opener-0.9.0/LICENSE-APACHE
+++ b/LICENSES/kurbo-0.11.3/LICENSE-APACHE
@@ -1,3 +1,4 @@
+
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
@@ -186,6 +187,8 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
+ Copyright [yyyy] [name of copyright owner]
+
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
@@ -196,4 +199,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
- limitations under the License.
\ No newline at end of file
+ limitations under the License.
diff --git a/LICENSES/kurbo-0.11.3/LICENSE-MIT b/LICENSES/kurbo-0.11.3/LICENSE-MIT
new file mode 100644
index 00000000..f3d84348
--- /dev/null
+++ b/LICENSES/kurbo-0.11.3/LICENSE-MIT
@@ -0,0 +1,25 @@
+Copyright (c) 2018 Raph Levien
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/memoffset-0.9.1/LICENSE b/LICENSES/memoffset-0.9.1/LICENSE
new file mode 100644
index 00000000..61f60813
--- /dev/null
+++ b/LICENSES/memoffset-0.9.1/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2017 Gilad Naaman
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/LICENSES/normpath-1.5.2/COPYRIGHT b/LICENSES/normpath-1.5.2/COPYRIGHT
deleted file mode 100644
index dba67e08..00000000
--- a/LICENSES/normpath-1.5.2/COPYRIGHT
+++ /dev/null
@@ -1,7 +0,0 @@
-Copyright (c) 2020 dylni (https://github.com/dylni)
-
-Some files also include explicit copyright notices.
-
-Licensed under the Apache License, Version 2.0 <LICENSE-APACHE> or the MIT
-license <LICENSE-MIT>, at your option. All files in this project may not be
-copied, modified, or distributed except according to those terms.
diff --git a/LICENSES/normpath-1.5.2/LICENSE-THIRD-PARTY b/LICENSES/normpath-1.5.2/LICENSE-THIRD-PARTY
deleted file mode 100644
index 58b1902b..00000000
--- a/LICENSES/normpath-1.5.2/LICENSE-THIRD-PARTY
+++ /dev/null
@@ -1,444 +0,0 @@
-===============================================================================
-
-The Rust Programming Language
-https://github.com/rust-lang/rust/blob/b1277d04db0dc8009037e872a1be7cdc2bd74a43/LICENSE-MIT
-
-Permission is hereby granted, free of charge, to any
-person obtaining a copy of this software and associated
-documentation files (the "Software"), to deal in the
-Software without restriction, including without
-limitation the rights to use, copy, modify, merge,
-publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software
-is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice
-shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
-ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-
-===============================================================================
-
-The Rust Programming Language
-https://github.com/rust-lang/rust/blob/b1277d04db0dc8009037e872a1be7cdc2bd74a43/LICENSE-APACHE
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-===============================================================================
-
-Fruity
-https://github.com/nvzqz/fruity/blob/320efcf715c2c5fbd2f3084f671f2be2e03a6f2b/LICENSE-MIT
-
-MIT License
-
-Copyright (c) 2020 Nikolai Vazquez
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
-===============================================================================
-
-Fruity
-https://github.com/nvzqz/fruity/blob/320efcf715c2c5fbd2f3084f671f2be2e03a6f2b/LICENSE-APACHE
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/LICENSES/opener-0.9.0/LICENSE-THIRD-PARTY b/LICENSES/opener-0.9.0/LICENSE-THIRD-PARTY
deleted file mode 100644
index 10307a7b..00000000
--- a/LICENSES/opener-0.9.0/LICENSE-THIRD-PARTY
+++ /dev/null
@@ -1,19 +0,0 @@
-- xdg-utils: https://cgit.freedesktop.org/xdg/xdg-utils/plain/LICENSE
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal in the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
- #
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
- #
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/LICENSES/opuscule-0.2.2/LICENSE b/LICENSES/opuscule-0.2.2/LICENSE
new file mode 100644
index 00000000..ee6256cd
--- /dev/null
+++ b/LICENSES/opuscule-0.2.2/LICENSE
@@ -0,0 +1,373 @@
+Mozilla Public License Version 2.0
+==================================
+
+1. Definitions
+--------------
+
+1.1. "Contributor"
+ means each individual or legal entity that creates, contributes to
+ the creation of, or owns Covered Software.
+
+1.2. "Contributor Version"
+ means the combination of the Contributions of others (if any) used
+ by a Contributor and that particular Contributor's Contribution.
+
+1.3. "Contribution"
+ means Covered Software of a particular Contributor.
+
+1.4. "Covered Software"
+ means Source Code Form to which the initial Contributor has attached
+ the notice in Exhibit A, the Executable Form of such Source Code
+ Form, and Modifications of such Source Code Form, in each case
+ including portions thereof.
+
+1.5. "Incompatible With Secondary Licenses"
+ means
+
+ (a) that the initial Contributor has attached the notice described
+ in Exhibit B to the Covered Software; or
+
+ (b) that the Covered Software was made available under the terms of
+ version 1.1 or earlier of the License, but not also under the
+ terms of a Secondary License.
+
+1.6. "Executable Form"
+ means any form of the work other than Source Code Form.
+
+1.7. "Larger Work"
+ means a work that combines Covered Software with other material, in
+ a separate file or files, that is not Covered Software.
+
+1.8. "License"
+ means this document.
+
+1.9. "Licensable"
+ means having the right to grant, to the maximum extent possible,
+ whether at the time of the initial grant or subsequently, any and
+ all of the rights conveyed by this License.
+
+1.10. "Modifications"
+ means any of the following:
+
+ (a) any file in Source Code Form that results from an addition to,
+ deletion from, or modification of the contents of Covered
+ Software; or
+
+ (b) any new file in Source Code Form that contains any Covered
+ Software.
+
+1.11. "Patent Claims" of a Contributor
+ means any patent claim(s), including without limitation, method,
+ process, and apparatus claims, in any patent Licensable by such
+ Contributor that would be infringed, but for the grant of the
+ License, by the making, using, selling, offering for sale, having
+ made, import, or transfer of either its Contributions or its
+ Contributor Version.
+
+1.12. "Secondary License"
+ means either the GNU General Public License, Version 2.0, the GNU
+ Lesser General Public License, Version 2.1, the GNU Affero General
+ Public License, Version 3.0, or any later versions of those
+ licenses.
+
+1.13. "Source Code Form"
+ means the form of the work preferred for making modifications.
+
+1.14. "You" (or "Your")
+ means an individual or a legal entity exercising rights under this
+ License. For legal entities, "You" includes any entity that
+ controls, is controlled by, or is under common control with You. For
+ purposes of this definition, "control" means (a) the power, direct
+ or indirect, to cause the direction or management of such entity,
+ whether by contract or otherwise, or (b) ownership of more than
+ fifty percent (50%) of the outstanding shares or beneficial
+ ownership of such entity.
+
+2. License Grants and Conditions
+--------------------------------
+
+2.1. Grants
+
+Each Contributor hereby grants You a world-wide, royalty-free,
+non-exclusive license:
+
+(a) under intellectual property rights (other than patent or trademark)
+ Licensable by such Contributor to use, reproduce, make available,
+ modify, display, perform, distribute, and otherwise exploit its
+ Contributions, either on an unmodified basis, with Modifications, or
+ as part of a Larger Work; and
+
+(b) under Patent Claims of such Contributor to make, use, sell, offer
+ for sale, have made, import, and otherwise transfer either its
+ Contributions or its Contributor Version.
+
+2.2. Effective Date
+
+The licenses granted in Section 2.1 with respect to any Contribution
+become effective for each Contribution on the date the Contributor first
+distributes such Contribution.
+
+2.3. Limitations on Grant Scope
+
+The licenses granted in this Section 2 are the only rights granted under
+this License. No additional rights or licenses will be implied from the
+distribution or licensing of Covered Software under this License.
+Notwithstanding Section 2.1(b) above, no patent license is granted by a
+Contributor:
+
+(a) for any code that a Contributor has removed from Covered Software;
+ or
+
+(b) for infringements caused by: (i) Your and any other third party's
+ modifications of Covered Software, or (ii) the combination of its
+ Contributions with other software (except as part of its Contributor
+ Version); or
+
+(c) under Patent Claims infringed by Covered Software in the absence of
+ its Contributions.
+
+This License does not grant any rights in the trademarks, service marks,
+or logos of any Contributor (except as may be necessary to comply with
+the notice requirements in Section 3.4).
+
+2.4. Subsequent Licenses
+
+No Contributor makes additional grants as a result of Your choice to
+distribute the Covered Software under a subsequent version of this
+License (see Section 10.2) or under the terms of a Secondary License (if
+permitted under the terms of Section 3.3).
+
+2.5. Representation
+
+Each Contributor represents that the Contributor believes its
+Contributions are its original creation(s) or it has sufficient rights
+to grant the rights to its Contributions conveyed by this License.
+
+2.6. Fair Use
+
+This License is not intended to limit any rights You have under
+applicable copyright doctrines of fair use, fair dealing, or other
+equivalents.
+
+2.7. Conditions
+
+Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
+in Section 2.1.
+
+3. Responsibilities
+-------------------
+
+3.1. Distribution of Source Form
+
+All distribution of Covered Software in Source Code Form, including any
+Modifications that You create or to which You contribute, must be under
+the terms of this License. You must inform recipients that the Source
+Code Form of the Covered Software is governed by the terms of this
+License, and how they can obtain a copy of this License. You may not
+attempt to alter or restrict the recipients' rights in the Source Code
+Form.
+
+3.2. Distribution of Executable Form
+
+If You distribute Covered Software in Executable Form then:
+
+(a) such Covered Software must also be made available in Source Code
+ Form, as described in Section 3.1, and You must inform recipients of
+ the Executable Form how they can obtain a copy of such Source Code
+ Form by reasonable means in a timely manner, at a charge no more
+ than the cost of distribution to the recipient; and
+
+(b) You may distribute such Executable Form under the terms of this
+ License, or sublicense it under different terms, provided that the
+ license for the Executable Form does not attempt to limit or alter
+ the recipients' rights in the Source Code Form under this License.
+
+3.3. Distribution of a Larger Work
+
+You may create and distribute a Larger Work under terms of Your choice,
+provided that You also comply with the requirements of this License for
+the Covered Software. If the Larger Work is a combination of Covered
+Software with a work governed by one or more Secondary Licenses, and the
+Covered Software is not Incompatible With Secondary Licenses, this
+License permits You to additionally distribute such Covered Software
+under the terms of such Secondary License(s), so that the recipient of
+the Larger Work may, at their option, further distribute the Covered
+Software under the terms of either this License or such Secondary
+License(s).
+
+3.4. Notices
+
+You may not remove or alter the substance of any license notices
+(including copyright notices, patent notices, disclaimers of warranty,
+or limitations of liability) contained within the Source Code Form of
+the Covered Software, except that You may alter any license notices to
+the extent required to remedy known factual inaccuracies.
+
+3.5. Application of Additional Terms
+
+You may choose to offer, and to charge a fee for, warranty, support,
+indemnity or liability obligations to one or more recipients of Covered
+Software. However, You may do so only on Your own behalf, and not on
+behalf of any Contributor. You must make it absolutely clear that any
+such warranty, support, indemnity, or liability obligation is offered by
+You alone, and You hereby agree to indemnify every Contributor for any
+liability incurred by such Contributor as a result of warranty, support,
+indemnity or liability terms You offer. You may include additional
+disclaimers of warranty and limitations of liability specific to any
+jurisdiction.
+
+4. Inability to Comply Due to Statute or Regulation
+---------------------------------------------------
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Software due to
+statute, judicial order, or regulation then You must: (a) comply with
+the terms of this License to the maximum extent possible; and (b)
+describe the limitations and the code they affect. Such description must
+be placed in a text file included with all distributions of the Covered
+Software under this License. Except to the extent prohibited by statute
+or regulation, such description must be sufficiently detailed for a
+recipient of ordinary skill to be able to understand it.
+
+5. Termination
+--------------
+
+5.1. The rights granted under this License will terminate automatically
+if You fail to comply with any of its terms. However, if You become
+compliant, then the rights granted under this License from a particular
+Contributor are reinstated (a) provisionally, unless and until such
+Contributor explicitly and finally terminates Your grants, and (b) on an
+ongoing basis, if such Contributor fails to notify You of the
+non-compliance by some reasonable means prior to 60 days after You have
+come back into compliance. Moreover, Your grants from a particular
+Contributor are reinstated on an ongoing basis if such Contributor
+notifies You of the non-compliance by some reasonable means, this is the
+first time You have received notice of non-compliance with this License
+from such Contributor, and You become compliant prior to 30 days after
+Your receipt of the notice.
+
+5.2. If You initiate litigation against any entity by asserting a patent
+infringement claim (excluding declaratory judgment actions,
+counter-claims, and cross-claims) alleging that a Contributor Version
+directly or indirectly infringes any patent, then the rights granted to
+You by any and all Contributors for the Covered Software under Section
+2.1 of this License shall terminate.
+
+5.3. In the event of termination under Sections 5.1 or 5.2 above, all
+end user license agreements (excluding distributors and resellers) which
+have been validly granted by You or Your distributors under this License
+prior to termination shall survive termination.
+
+************************************************************************
+* *
+* 6. Disclaimer of Warranty *
+* ------------------------- *
+* *
+* Covered Software is provided under this License on an "as is" *
+* basis, without warranty of any kind, either expressed, implied, or *
+* statutory, including, without limitation, warranties that the *
+* Covered Software is free of defects, merchantable, fit for a *
+* particular purpose or non-infringing. The entire risk as to the *
+* quality and performance of the Covered Software is with You. *
+* Should any Covered Software prove defective in any respect, You *
+* (not any Contributor) assume the cost of any necessary servicing, *
+* repair, or correction. This disclaimer of warranty constitutes an *
+* essential part of this License. No use of any Covered Software is *
+* authorized under this License except under this disclaimer. *
+* *
+************************************************************************
+
+************************************************************************
+* *
+* 7. Limitation of Liability *
+* -------------------------- *
+* *
+* Under no circumstances and under no legal theory, whether tort *
+* (including negligence), contract, or otherwise, shall any *
+* Contributor, or anyone who distributes Covered Software as *
+* permitted above, be liable to You for any direct, indirect, *
+* special, incidental, or consequential damages of any character *
+* including, without limitation, damages for lost profits, loss of *
+* goodwill, work stoppage, computer failure or malfunction, or any *
+* and all other commercial damages or losses, even if such party *
+* shall have been informed of the possibility of such damages. This *
+* limitation of liability shall not apply to liability for death or *
+* personal injury resulting from such party's negligence to the *
+* extent applicable law prohibits such limitation. Some *
+* jurisdictions do not allow the exclusion or limitation of *
+* incidental or consequential damages, so this exclusion and *
+* limitation may not apply to You. *
+* *
+************************************************************************
+
+8. Litigation
+-------------
+
+Any litigation relating to this License may be brought only in the
+courts of a jurisdiction where the defendant maintains its principal
+place of business and such litigation shall be governed by laws of that
+jurisdiction, without reference to its conflict-of-law provisions.
+Nothing in this Section shall prevent a party's ability to bring
+cross-claims or counter-claims.
+
+9. Miscellaneous
+----------------
+
+This License represents the complete agreement concerning the subject
+matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent
+necessary to make it enforceable. Any law or regulation which provides
+that the language of a contract shall be construed against the drafter
+shall not be used to construe this License against a Contributor.
+
+10. Versions of the License
+---------------------------
+
+10.1. New Versions
+
+Mozilla Foundation is the license steward. Except as provided in Section
+10.3, no one other than the license steward has the right to modify or
+publish new versions of this License. Each version will be given a
+distinguishing version number.
+
+10.2. Effect of New Versions
+
+You may distribute the Covered Software under the terms of the version
+of the License under which You originally received the Covered Software,
+or under the terms of any subsequent version published by the license
+steward.
+
+10.3. Modified Versions
+
+If you create software not governed by this License, and you want to
+create a new license for such software, you may create and use a
+modified version of this License if you rename the license and remove
+any references to the name of the license steward (except to note that
+such modified license differs from this License).
+
+10.4. Distributing Source Code Form that is Incompatible With Secondary
+Licenses
+
+If You choose to distribute Source Code Form that is Incompatible With
+Secondary Licenses under the terms of this version of the License, the
+notice described in Exhibit B of this License must be attached.
+
+Exhibit A - Source Code Form License Notice
+-------------------------------------------
+
+ This Source Code Form is subject to the terms of the Mozilla Public
+ License, v. 2.0. If a copy of the MPL was not distributed with this
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
+
+If it is not possible or desirable to put the notice in a particular
+file, then You may include the notice in a location (such as a LICENSE
+file in a relevant directory) where a recipient would be likely to look
+for such a notice.
+
+You may add additional accurate notices of copyright ownership.
+
+Exhibit B - "Incompatible With Secondary Licenses" Notice
+---------------------------------------------------------
+
+ This Source Code Form is "Incompatible With Secondary Licenses", as
+ defined by the Mozilla Public License, v. 2.0.
diff --git a/LICENSES/opuscule-0.2.2/LICENSE-XIPH b/LICENSES/opuscule-0.2.2/LICENSE-XIPH
new file mode 100644
index 00000000..75711467
--- /dev/null
+++ b/LICENSES/opuscule-0.2.2/LICENSE-XIPH
@@ -0,0 +1,44 @@
+Copyright 2001-2023 Xiph.Org, Skype Limited, Octasic,
+ Jean-Marc Valin, Timothy B. Terriberry,
+ CSIRO, Gregory Maxwell, Mark Borgerding,
+ Erik de Castro Lopo, Mozilla, Amazon
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+- Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
+names of specific contributors, may be used to endorse or promote
+products derived from this software without specific prior written
+permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Opus is subject to the royalty-free patent licenses which are
+specified at:
+
+Xiph.Org Foundation:
+https://datatracker.ietf.org/ipr/1524/
+
+Microsoft Corporation:
+https://datatracker.ietf.org/ipr/1914/
+
+Broadcom Corporation:
+https://datatracker.ietf.org/ipr/1526/
diff --git a/LICENSES/ordered-stream-0.2.0/LICENSE-APACHE b/LICENSES/ordered-stream-0.2.0/LICENSE-APACHE
new file mode 100644
index 00000000..16fe87b0
--- /dev/null
+++ b/LICENSES/ordered-stream-0.2.0/LICENSE-APACHE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/LICENSES/ordered-stream-0.2.0/LICENSE-MIT b/LICENSES/ordered-stream-0.2.0/LICENSE-MIT
new file mode 100644
index 00000000..31aa7938
--- /dev/null
+++ b/LICENSES/ordered-stream-0.2.0/LICENSE-MIT
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/pollster-1.0.1/LICENSE-APACHE b/LICENSES/pollster-1.0.1/LICENSE-APACHE
new file mode 100644
index 00000000..16fe87b0
--- /dev/null
+++ b/LICENSES/pollster-1.0.1/LICENSE-APACHE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/LICENSES/pollster-1.0.1/LICENSE-MIT b/LICENSES/pollster-1.0.1/LICENSE-MIT
new file mode 100644
index 00000000..ed447976
--- /dev/null
+++ b/LICENSES/pollster-1.0.1/LICENSE-MIT
@@ -0,0 +1,25 @@
+Copyright (c) 2020-2021 Joshua Barretto
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/bevy_scene-0.20.0/LICENSE-APACHE b/LICENSES/resvg-0.45.1/LICENSE-APACHE
similarity index 100%
rename from LICENSES/bevy_scene-0.20.0/LICENSE-APACHE
rename to LICENSES/resvg-0.45.1/LICENSE-APACHE
diff --git a/LICENSES/resvg-0.45.1/LICENSE-MIT b/LICENSES/resvg-0.45.1/LICENSE-MIT
new file mode 100644
index 00000000..6f7cc66b
--- /dev/null
+++ b/LICENSES/resvg-0.45.1/LICENSE-MIT
@@ -0,0 +1,25 @@
+Copyright 2017 the Resvg Authors
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/rune-0.0.1/assets-IBMPlexMono-LICENSE.txt b/LICENSES/rune-0.0.1/assets-IBMPlexMono-LICENSE.txt
new file mode 100644
index 00000000..c35c4c61
--- /dev/null
+++ b/LICENSES/rune-0.0.1/assets-IBMPlexMono-LICENSE.txt
@@ -0,0 +1,93 @@
+Copyright © 2017 IBM Corp. with Reserved Font Name "Plex"
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+
+This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/LICENSES/rune-0.0.1/assets-Inter-LICENSE.txt b/LICENSES/rune-0.0.1/assets-Inter-LICENSE.txt
new file mode 100644
index 00000000..9b2ca37b
--- /dev/null
+++ b/LICENSES/rune-0.0.1/assets-Inter-LICENSE.txt
@@ -0,0 +1,92 @@
+Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION AND CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/LICENSES/bevy_solari-0.20.0/LICENSE-MIT b/LICENSES/rune-0.0.1/repository-LICENSE
similarity index 97%
rename from LICENSES/bevy_solari-0.20.0/LICENSE-MIT
rename to LICENSES/rune-0.0.1/repository-LICENSE
index 9cf10627..66aed126 100644
--- a/LICENSES/bevy_solari-0.20.0/LICENSE-MIT
+++ b/LICENSES/rune-0.0.1/repository-LICENSE
@@ -1,5 +1,7 @@
MIT License
+Copyright (c) 2026 Anomaly
+
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
diff --git a/LICENSES/bevy_scene-0.20.0/LICENSE-MIT b/LICENSES/rune-kit-0.0.1/repository-LICENSE
similarity index 97%
rename from LICENSES/bevy_scene-0.20.0/LICENSE-MIT
rename to LICENSES/rune-kit-0.0.1/repository-LICENSE
index 9cf10627..66aed126 100644
--- a/LICENSES/bevy_scene-0.20.0/LICENSE-MIT
+++ b/LICENSES/rune-kit-0.0.1/repository-LICENSE
@@ -1,5 +1,7 @@
MIT License
+Copyright (c) 2026 Anomaly
+
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
diff --git a/LICENSES/opener-0.9.0/LICENSE-MIT b/LICENSES/rune-motion-0.1.0/repository-LICENSE
similarity index 96%
rename from LICENSES/opener-0.9.0/LICENSE-MIT
rename to LICENSES/rune-motion-0.1.0/repository-LICENSE
index 6802bc4b..66aed126 100644
--- a/LICENSES/opener-0.9.0/LICENSE-MIT
+++ b/LICENSES/rune-motion-0.1.0/repository-LICENSE
@@ -1,5 +1,7 @@
MIT License
+Copyright (c) 2026 Anomaly
+
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@@ -16,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file
+SOFTWARE.
diff --git a/LICENSES/arboard-3.7.0/LICENSE-MIT.txt b/LICENSES/rune-staging-0.0.1/repository-LICENSE
similarity index 95%
rename from LICENSES/arboard-3.7.0/LICENSE-MIT.txt
rename to LICENSES/rune-staging-0.0.1/repository-LICENSE
index 796e84b4..66aed126 100644
--- a/LICENSES/arboard-3.7.0/LICENSE-MIT.txt
+++ b/LICENSES/rune-staging-0.0.1/repository-LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2022 The Arboard contributors
+Copyright (c) 2026 Anomaly
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/LICENSES/rune-taffy-0.0.1/repository-LICENSE b/LICENSES/rune-taffy-0.0.1/repository-LICENSE
new file mode 100644
index 00000000..66aed126
--- /dev/null
+++ b/LICENSES/rune-taffy-0.0.1/repository-LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 Anomaly
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/LICENSES/serde_repr-0.1.21/LICENSE-APACHE b/LICENSES/serde_repr-0.1.21/LICENSE-APACHE
new file mode 100644
index 00000000..1b5ec8b7
--- /dev/null
+++ b/LICENSES/serde_repr-0.1.21/LICENSE-APACHE
@@ -0,0 +1,176 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
diff --git a/LICENSES/serde_repr-0.1.21/LICENSE-MIT b/LICENSES/serde_repr-0.1.21/LICENSE-MIT
new file mode 100644
index 00000000..31aa7938
--- /dev/null
+++ b/LICENSES/serde_repr-0.1.21/LICENSE-MIT
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/svgtypes-0.15.3/LICENSE-APACHE b/LICENSES/svgtypes-0.15.3/LICENSE-APACHE
new file mode 100644
index 00000000..16fe87b0
--- /dev/null
+++ b/LICENSES/svgtypes-0.15.3/LICENSE-APACHE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/LICENSES/svgtypes-0.15.3/LICENSE-MIT b/LICENSES/svgtypes-0.15.3/LICENSE-MIT
new file mode 100644
index 00000000..30d095e0
--- /dev/null
+++ b/LICENSES/svgtypes-0.15.3/LICENSE-MIT
@@ -0,0 +1,20 @@
+Copyright (c) 2018 Yevhenii Reizner
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
diff --git a/LICENSES/texts/BSL-1.0.txt b/LICENSES/texts/BSL-1.0.txt
deleted file mode 100644
index 36b7cd93..00000000
--- a/LICENSES/texts/BSL-1.0.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-Boost Software License - Version 1.0 - August 17th, 2003
-
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/uds_windows-1.2.1/LICENSE b/LICENSES/uds_windows-1.2.1/LICENSE
new file mode 100644
index 00000000..21071075
--- /dev/null
+++ b/LICENSES/uds_windows-1.2.1/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/LICENSES/bevy_solari-0.20.0/LICENSE-APACHE b/LICENSES/usvg-0.45.1/LICENSE-APACHE
similarity index 100%
rename from LICENSES/bevy_solari-0.20.0/LICENSE-APACHE
rename to LICENSES/usvg-0.45.1/LICENSE-APACHE
diff --git a/LICENSES/usvg-0.45.1/LICENSE-MIT b/LICENSES/usvg-0.45.1/LICENSE-MIT
new file mode 100644
index 00000000..6f7cc66b
--- /dev/null
+++ b/LICENSES/usvg-0.45.1/LICENSE-MIT
@@ -0,0 +1,25 @@
+Copyright 2017 the Resvg Authors
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/xkbcommon-0.9.0/LICENSE b/LICENSES/xkbcommon-0.9.0/LICENSE
new file mode 100644
index 00000000..5be99657
--- /dev/null
+++ b/LICENSES/xkbcommon-0.9.0/LICENSE
@@ -0,0 +1,25 @@
+Copyright (c) 2016 Remi Thebault <[email protected]>
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/zbus-5.19.0/LICENSE b/LICENSES/zbus-5.19.0/LICENSE
new file mode 100644
index 00000000..74930515
--- /dev/null
+++ b/LICENSES/zbus-5.19.0/LICENSE
@@ -0,0 +1,25 @@
+Copyright (c) 2024 Zeeshan Ali Khan & zbus contributors
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/zbus-6.2.1/LICENSE b/LICENSES/zbus-6.2.1/LICENSE
new file mode 100644
index 00000000..74930515
--- /dev/null
+++ b/LICENSES/zbus-6.2.1/LICENSE
@@ -0,0 +1,25 @@
+Copyright (c) 2024 Zeeshan Ali Khan & zbus contributors
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/zbus-lockstep-0.5.2/LICENSE-MIT b/LICENSES/zbus-lockstep-0.5.2/LICENSE-MIT
new file mode 100644
index 00000000..31aa7938
--- /dev/null
+++ b/LICENSES/zbus-lockstep-0.5.2/LICENSE-MIT
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/zbus-lockstep-macros-0.5.2/LICENSE-MIT b/LICENSES/zbus-lockstep-macros-0.5.2/LICENSE-MIT
new file mode 100644
index 00000000..31aa7938
--- /dev/null
+++ b/LICENSES/zbus-lockstep-macros-0.5.2/LICENSE-MIT
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/zbus_macros-5.19.0/LICENSE b/LICENSES/zbus_macros-5.19.0/LICENSE
new file mode 100644
index 00000000..74930515
--- /dev/null
+++ b/LICENSES/zbus_macros-5.19.0/LICENSE
@@ -0,0 +1,25 @@
+Copyright (c) 2024 Zeeshan Ali Khan & zbus contributors
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/zbus_macros-6.2.1/LICENSE b/LICENSES/zbus_macros-6.2.1/LICENSE
new file mode 100644
index 00000000..74930515
--- /dev/null
+++ b/LICENSES/zbus_macros-6.2.1/LICENSE
@@ -0,0 +1,25 @@
+Copyright (c) 2024 Zeeshan Ali Khan & zbus contributors
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/zbus_names-4.3.4/LICENSE b/LICENSES/zbus_names-4.3.4/LICENSE
new file mode 100644
index 00000000..74930515
--- /dev/null
+++ b/LICENSES/zbus_names-4.3.4/LICENSE
@@ -0,0 +1,25 @@
+Copyright (c) 2024 Zeeshan Ali Khan & zbus contributors
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/zbus_utils-6.1.0/LICENSE b/LICENSES/zbus_utils-6.1.0/LICENSE
new file mode 100644
index 00000000..74930515
--- /dev/null
+++ b/LICENSES/zbus_utils-6.1.0/LICENSE
@@ -0,0 +1,25 @@
+Copyright (c) 2024 Zeeshan Ali Khan & zbus contributors
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/zbus_xml-5.2.1/LICENSE b/LICENSES/zbus_xml-5.2.1/LICENSE
new file mode 100644
index 00000000..74930515
--- /dev/null
+++ b/LICENSES/zbus_xml-5.2.1/LICENSE
@@ -0,0 +1,25 @@
+Copyright (c) 2024 Zeeshan Ali Khan & zbus contributors
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/zcheapstr-1.1.0/LICENSE b/LICENSES/zcheapstr-1.1.0/LICENSE
new file mode 100644
index 00000000..79553ba3
--- /dev/null
+++ b/LICENSES/zcheapstr-1.1.0/LICENSE
@@ -0,0 +1,25 @@
+Copyright (c) 2026 Zeeshan Ali Khan & zcheapstr contributors
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/zruntime-0.2.2/LICENSE b/LICENSES/zruntime-0.2.2/LICENSE
new file mode 100644
index 00000000..ec4f2eed
--- /dev/null
+++ b/LICENSES/zruntime-0.2.2/LICENSE
@@ -0,0 +1,31 @@
+Copyright (c) 2026 Zeeshan Ali Khan & zruntime contributors
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+The broadcast channel (`src/broadcast.rs`), its tests (`src/tests/broadcast.rs`) and its
+benchmark (`benches/broadcast.rs`) come from the async-broadcast crate
+(https://github.com/smol-rs/async-broadcast), under the license above and this notice:
+
+Copyright (c) 2020 Yoshua Wuyts, Stjepan Glavina & Zeeshan Ali Khan
diff --git a/LICENSES/zstd-0.13.3/LICENSE b/LICENSES/zstd-0.13.3/LICENSE
deleted file mode 100644
index 1190b3c6..00000000
--- a/LICENSES/zstd-0.13.3/LICENSE
+++ /dev/null
@@ -1,8 +0,0 @@
-The MIT License (MIT)
-Copyright (c) 2016 Alexandre Bury
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/zstd-safe-7.3.0/LICENSE b/LICENSES/zstd-0.13.4/LICENSE
similarity index 100%
rename from LICENSES/zstd-safe-7.3.0/LICENSE
rename to LICENSES/zstd-0.13.4/LICENSE
diff --git a/LICENSES/zstd-safe-7.4.0/LICENSE b/LICENSES/zstd-safe-7.4.0/LICENSE
new file mode 100644
index 00000000..93223ef4
--- /dev/null
+++ b/LICENSES/zstd-safe-7.4.0/LICENSE
@@ -0,0 +1,28 @@
+BSD 3-Clause License
+
+Copyright (c) 2026, Alexandre Bury
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/LICENSES/zvariant-5.15.0/LICENSE b/LICENSES/zvariant-5.15.0/LICENSE
new file mode 100644
index 00000000..74930515
--- /dev/null
+++ b/LICENSES/zvariant-5.15.0/LICENSE
@@ -0,0 +1,25 @@
+Copyright (c) 2024 Zeeshan Ali Khan & zbus contributors
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/zvariant_derive-5.15.0/LICENSE b/LICENSES/zvariant_derive-5.15.0/LICENSE
new file mode 100644
index 00000000..74930515
--- /dev/null
+++ b/LICENSES/zvariant_derive-5.15.0/LICENSE
@@ -0,0 +1,25 @@
+Copyright (c) 2024 Zeeshan Ali Khan & zbus contributors
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/LICENSES/zvariant_utils-4.2.0/LICENSE b/LICENSES/zvariant_utils-4.2.0/LICENSE
new file mode 100644
index 00000000..31aa7938
--- /dev/null
+++ b/LICENSES/zvariant_utils-4.2.0/LICENSE
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/README.md b/README.md
index 538ecdf0..a94617a7 100644
--- a/README.md
+++ b/README.md
@@ -108,6 +108,7 @@ Requirements: [Rust](https://rustup.rs) (stable) and [bun](https://bun.sh). On m
```sh
git clone https://github.com/shinyobjectz/raea && cd raea
cargo build --release -p raea-cli --no-default-features
+for d in sdk/raea sdk/react/js sdk/react/tw; do (cd $d && bun install); done
target/release/raea render sdk/react/bench/games/pong/edit.tsx -o pong.mp4
```
diff --git a/apps/check/src/flash.rs b/apps/check/src/flash.rs
new file mode 100644
index 00000000..092dba14
--- /dev/null
+++ b/apps/check/src/flash.rs
@@ -0,0 +1,348 @@
+use super::*;
+
+/// Flashing past WCAG 2.3.1: more than three flashes in any one second, over enough of the frame to matter. A flash is a
+/// pair of opposing changes in the same pixels, so a shape sliding past isn't one. Each window, a third of the frame wide
+/// and high, stands in for WCAG's quarter of a 10-degree field (the real area depends on the screen and how far away it
+/// is, which a file doesn't say), and a quarter of its pixels must swing together: by 0.10 relative luminance with the
+/// darker end under 0.80, or by 20 of saturated red ((R-G-B)*320, where R/(R+G+B) is at least 0.8). Every decoded frame
+/// counts, on its own timestamp, and the picture is sampled twice, by area and by point, so fine patterns don't average
+/// away. A screen for review, not a Harding or PEAT certification; an interlaced picture isn't split into its fields.
+const FLASH_W: usize = 192;
+const FLASH_MOST: usize = 6;
+const FLASH_PAIR_S: f64 = 1.0 + 1e-9;
+
+/// A pixel in one measure: its value, and whether it can count. Red's value runs on through the saturation line, and a change
+/// counts when either end of it is saturated; a one-level step across the line isn't a jump from zero.
+#[derive(Clone, Copy)]
+struct Px {
+ value: f32,
+ counts: bool,
+}
+
+struct Swing {
+ at: f64,
+ direction: f32,
+ moved: Vec<bool>,
+ plain: bool,
+ kept: bool,
+}
+
+/// One window's swings in one measure: the ones an opposite swing within a second moves back in the same pixels. The
+/// general measure leaves out swings where another quarter of the window moved the other way at once (a moving pattern).
+struct Swings {
+ by: f32,
+ under: f32,
+ mixed_counts: bool,
+ pivot: Vec<Px>,
+ extreme: Vec<Px>,
+ at: f64,
+ direction: f32,
+ recent: std::collections::VecDeque<Swing>,
+ ends: Vec<f64>,
+}
+
+impl Swings {
+ fn new(by: f32, under: f32, mixed_counts: bool) -> Swings {
+ Swings { by, under, mixed_counts, pivot: Vec::new(), extreme: Vec::new(), at: 0.0, direction: 0.0, recent: Default::default(), ends: Vec::new() }
+ }
+
+ fn moves(&self, a: Px, b: Px, direction: f32) -> bool {
+ (b.value - a.value) * direction >= self.by && a.value.min(b.value) < self.under && (a.counts || b.counts)
+ }
+
+ fn changed(&self, earlier: &[Px], later: &[Px], direction: f32) -> bool {
+ earlier.iter().zip(later).filter(|(a, b)| self.moves(**a, **b, direction)).count() * 4 >= earlier.len()
+ }
+
+ fn push(&mut self, t: f64, px: &[Px]) {
+ if self.pivot.is_empty() {
+ self.pivot = px.to_vec();
+ self.extreme = px.to_vec();
+ self.at = t;
+ return;
+ }
+ if self.direction == 0.0 {
+ for direction in [1.0, -1.0] {
+ if self.changed(&self.pivot, px, direction) {
+ self.direction = direction;
+ self.extreme = px.to_vec();
+ self.at = t;
+ break;
+ }
+ }
+ return;
+ }
+ if self.changed(&self.extreme, px, -self.direction) {
+ self.record();
+ self.pivot = std::mem::replace(&mut self.extreme, px.to_vec());
+ self.at = t;
+ self.direction = -self.direction;
+ } else if self.changed(&self.pivot, px, self.direction) && self.went_further(px) {
+ self.extreme = px.to_vec();
+ }
+ }
+
+ /// Whether the pixels swinging from the pivot went further than the saved extreme, judged on those pixels alone: the
+ /// rest of the window can dim by less than counts and still outweigh a patch that's flashing.
+ fn went_further(&self, px: &[Px]) -> bool {
+ let further: f32 = self.pivot.iter().zip(px).zip(&self.extreme).filter(|((p, n), _)| self.moves(**p, **n, self.direction)).map(|((_, n), e)| (n.value - e.value) * self.direction).sum();
+ further > 0.0
+ }
+
+ fn record(&mut self) {
+ if !self.changed(&self.pivot, &self.extreme, self.direction) {
+ return;
+ }
+ let moved: Vec<bool> = self.pivot.iter().zip(&self.extreme).map(|(a, b)| self.moves(*a, *b, self.direction)).collect();
+ let plain = self.mixed_counts || !self.changed(&self.pivot, &self.extreme, -self.direction);
+ let (at, direction) = (self.at, self.direction);
+ let mut kept = false;
+ for other in self.recent.iter_mut().rev() {
+ if at - other.at > FLASH_PAIR_S {
+ break;
+ }
+ let same = moved.iter().zip(&other.moved).filter(|(x, y)| **x && **y).count();
+ if other.direction == -direction && same * 4 >= moved.len() {
+ other.kept = true;
+ kept = true;
+ }
+ }
+ self.recent.push_back(Swing { at, direction, moved, plain, kept });
+ while self.recent.front().is_some_and(|s| at - s.at > FLASH_PAIR_S) {
+ self.retire();
+ }
+ }
+
+ /// The oldest swing leaves the second it could still pair within; only the seconds' ends are kept for good.
+ fn retire(&mut self) {
+ if let Some(s) = self.recent.pop_front()
+ && s.plain
+ && s.kept
+ {
+ self.ends.push(s.at);
+ }
+ }
+
+ /// The most swings in any one second, and when that second starts.
+ fn busiest(&mut self) -> (usize, f64) {
+ if self.direction != 0.0 {
+ self.record();
+ self.direction = 0.0;
+ }
+ while !self.recent.is_empty() {
+ self.retire();
+ }
+ self.ends.sort_by(f64::total_cmp);
+ let (mut best, mut from, mut j) = (0, 0.0, 0);
+ for i in 0..self.ends.len() {
+ while self.ends[i] - self.ends[j] >= 1.0 - 1e-9 {
+ j += 1;
+ }
+ if i - j + 1 > best {
+ (best, from) = (i - j + 1, self.ends[j]);
+ }
+ }
+ (best, from)
+ }
+}
+
+/// Frames of two pictures side by side, each `w` by `h` RGB: the area sample and the point sample of one frame.
+pub(crate) struct FlashScreen {
+ w: usize,
+ h: usize,
+ last: Vec<u8>,
+ linear: Vec<f32>,
+ luma: Vec<Px>,
+ red: Vec<Px>,
+ cut: Vec<Px>,
+ windows: Vec<(usize, usize, Swings, Swings)>,
+}
+
+impl FlashScreen {
+ pub(crate) fn new(w: usize, h: usize) -> FlashScreen {
+ let (ww, wh) = (w / 3, h / 3);
+ let places = |size: usize, window: usize| {
+ let mut at: Vec<usize> = (0..=size - window).step_by((size / 6).max(1)).collect();
+ at.push(size - window);
+ at.dedup();
+ at
+ };
+ let mut windows = Vec::new();
+ for sample in 0..2 {
+ for &y in &places(h, wh) {
+ for &x in &places(w, ww) {
+ windows.push((x + sample * w, y, Swings::new(0.10, 0.80, false), Swings::new(20.0, f32::INFINITY, true)));
+ }
+ }
+ }
+ let linear = (0..=255u32)
+ .map(|c| {
+ let c = c as f32 / 255.0;
+ if c <= 0.04045 { c / 12.92 } else { ((c + 0.055) / 1.055).powf(2.4) }
+ })
+ .collect();
+ FlashScreen { w, h, last: Vec::new(), linear, luma: Vec::new(), red: Vec::new(), cut: Vec::new(), windows }
+ }
+
+ pub(crate) fn push(&mut self, rgb: &[u8], t: f64) {
+ if rgb == self.last {
+ return;
+ }
+ self.luma.clear();
+ self.red.clear();
+ for px in rgb.chunks_exact(3) {
+ let (r, g, b) = (self.linear[px[0] as usize], self.linear[px[1] as usize], self.linear[px[2] as usize]);
+ self.luma.push(Px { value: 0.2126 * r + 0.7152 * g + 0.0722 * b, counts: true });
+ let sum = r + g + b + 1e-9;
+ self.red.push(Px { value: ((r - g - b) * 320.0).max(0.0), counts: r / sum >= 0.8 });
+ }
+ let (stride, ww, wh) = (self.w * 2, self.w / 3, self.h / 3);
+ for (x, y, general, saturated) in &mut self.windows {
+ self.cut.clear();
+ for r in 0..wh {
+ self.cut.extend_from_slice(&self.luma[(*y + r) * stride + *x..][..ww]);
+ }
+ general.push(t, &self.cut);
+ self.cut.clear();
+ for r in 0..wh {
+ self.cut.extend_from_slice(&self.red[(*y + r) * stride + *x..][..ww]);
+ }
+ saturated.push(t, &self.cut);
+ }
+ self.last.clear();
+ self.last.extend_from_slice(rgb);
+ }
+
+ /// (swings in the worst second, when it starts, which measure) when past the limit
+ pub(crate) fn finish(mut self) -> Option<(usize, f64, &'static str)> {
+ let mut worst: Option<(usize, f64, &'static str)> = None;
+ for (_, _, general, saturated) in &mut self.windows {
+ for (swings, kind) in [(general, "general"), (saturated, "red")] {
+ let (n, from) = swings.busiest();
+ if n > FLASH_MOST && worst.is_none_or(|w| n > w.0) {
+ worst = Some((n, from, kind));
+ }
+ }
+ }
+ worst
+ }
+}
+
+/// Every decoded frame, once: -fps_mode from FFmpeg 5.1 on, -vsync before it.
+fn passthrough() -> [&'static str; 2] {
+ let out = Command::new("ffmpeg").args(["-hide_banner", "-version"]).output().map(|o| o.stdout).unwrap_or_default();
+ let head = String::from_utf8_lossy(&out);
+ let version = head.split("version ").nth(1).and_then(|v| {
+ let mut parts = v.trim_start_matches('n').split(|c: char| !c.is_ascii_digit());
+ Some((parts.next()?.parse::<u32>().ok()?, parts.next()?.parse::<u32>().ok()?))
+ });
+ [if version.is_some_and(|v| v < (5, 1)) { "-vsync" } else { "-fps_mode" }, "passthrough"]
+}
+
+/// A frame's number and time from showinfo's log, exact: its `pts` in ticks of the time base. `pts_time` is rounded to six
+/// significant digits, which is enough to push a legal third flash across the one-second line.
+pub(crate) fn showinfo_frame(line: &str, base: Option<(i64, i64)>) -> Option<(usize, f64)> {
+ let rest = line.split(" n:").nth(1)?;
+ let n = rest.split_whitespace().next()?.parse().ok()?;
+ let pts: i64 = rest.split("pts:").nth(1)?.split_whitespace().next()?.parse().ok()?;
+ let (num, den) = base?;
+ Some((n, pts as f64 * num as f64 / den as f64))
+}
+
+pub(crate) fn showinfo_base(line: &str) -> Option<(i64, i64)> {
+ let (num, den) = line.split("config in time_base:").nth(1)?.split(',').next()?.trim().split_once('/')?;
+ Some((num.parse().ok()?, den.parse().ok()?))
+}
+
+/// A line's severity under `-loglevel level+`: the first bracket after any `[context @ address]`. Searching the whole line
+/// would take a file's own metadata for an error when its title happens to say one.
+pub(crate) fn log_level(line: &str) -> Option<&str> {
+ let mut rest = line.trim_start();
+ if rest.starts_with('[') && rest[..rest.find(']')?].contains(" @ ") {
+ rest = rest[rest.find(']')? + 1..].trim_start();
+ }
+ let rest = rest.strip_prefix('[')?;
+ Some(&rest[..rest.find(']')?])
+}
+
+pub(crate) fn flashing(video: &str, probe: &Probe, issues: &mut Vec<Issue>, passed: &mut Vec<String>) -> R<()> {
+ let w = FLASH_W;
+ let h = (((w as f64 * probe.h / probe.w.max(1.0)) / 2.0).round() as usize * 2).max(6);
+ let graph = format!("showinfo,split=2[area][point];[area]scale={w}:{h}:flags=area[a];[point]scale={w}:{h}:flags=neighbor[b];[a][b]hstack=inputs=2,format=rgb24");
+ let sync = passthrough();
+ let mut child = Command::new("ffmpeg")
+ .args(["-hide_banner", "-nostats", "-nostdin", "-loglevel", "level+info", "-i", video, "-map", "0:v:0", "-vf", &graph, sync[0], sync[1], "-f", "rawvideo", "-"])
+ .stdin(std::process::Stdio::null())
+ .stdout(std::process::Stdio::piped())
+ .stderr(std::process::Stdio::piped())
+ .spawn()
+ .map_err(|e| format!("ffmpeg: {e}"))?;
+ let mut out = child.stdout.take().unwrap();
+ let err = child.stderr.take().unwrap();
+ let (times, clock) = std::sync::mpsc::channel();
+ // read apart from the frames, so that neither pipe can fill while the other is being waited on
+ let log = std::thread::spawn(move || {
+ let mut err = std::io::BufReader::new(err);
+ let (mut line, mut base, mut errors, mut first) = (Vec::new(), None, 0usize, String::new());
+ while std::io::BufRead::read_until(&mut err, b'\n', &mut line).is_ok_and(|n| n > 0) {
+ let text = String::from_utf8_lossy(&line);
+ if matches!(log_level(&text), Some("error" | "fatal" | "panic")) {
+ errors += 1;
+ if first.is_empty() {
+ first = text.trim().to_string();
+ }
+ } else if text.trim_start().starts_with("[Parsed_showinfo") {
+ base = showinfo_base(&text).or(base);
+ if let Some(frame) = showinfo_frame(&text, base) {
+ let _ = times.send(frame);
+ }
+ }
+ line.clear();
+ }
+ (errors, first)
+ });
+ let mut screen = FlashScreen::new(w, h);
+ let mut buf = vec![0u8; w * 2 * h * 3];
+ let mut frames = 0;
+ let mut lost = false;
+ while std::io::Read::read_exact(&mut out, &mut buf).is_ok() {
+ // the frame's own line is written before its pixels, so one that doesn't come isn't going to
+ match clock.recv_timeout(std::time::Duration::from_secs(60)) {
+ Ok((n, t)) if n == frames => screen.push(&buf, t),
+ _ => {
+ lost = true;
+ let _ = child.kill();
+ break;
+ }
+ }
+ frames += 1;
+ }
+ drop(out);
+ let status = child.wait().map_err(|e| format!("ffmpeg: {e}"))?;
+ let (errors, first) = log.join().unwrap_or_default();
+ if lost {
+ return Err(format!("{video}: flashing can't be screened, frame {frames} has no timestamp of its own"));
+ }
+ if !status.success() || frames == 0 {
+ return Err(format!("{video}: flashing can't be screened, FFmpeg decoded {frames} frames ({first})"));
+ }
+ if errors > 0 {
+ issues.push(Issue {
+ rule: "decode",
+ p: 1,
+ at: None,
+ says: format!("FFmpeg hit {errors} errors decoding the picture, so it may be damaged and flashing was only screened on what decoded: {first}"),
+ });
+ }
+ match screen.finish() {
+ Some((swings, at, kind)) => issues.push(Issue {
+ rule: "flash",
+ p: 1,
+ at: Some(at),
+ says: format!("{swings} opposing {kind} changes in one second, past WCAG 2.3.1's limit of 3 flashes (6 changes); flashing like this can cause seizures: slow it, shrink it or lower its contrast"),
+ }),
+ None if errors == 0 => passed.push("flashing: no more than 3 flashes a second found (a screen, not a certification)".to_string()),
+ None => {}
+ }
+ Ok(())
+}
diff --git a/apps/check/src/lib.rs b/apps/check/src/lib.rs
index 020eb6f0..553023e6 100644
--- a/apps/check/src/lib.rs
+++ b/apps/check/src/lib.rs
@@ -18,6 +18,8 @@ mod sound;
use sound::*;
mod picture;
use picture::*;
+mod flash;
+use flash::*;
mod text;
use text::*;
pub mod quick;
@@ -53,7 +55,7 @@ fn flag<'a>(args: &'a [String], name: &str) -> Option<&'a str> {
args.iter().position(|a| a == name).and_then(|i| args.get(i + 1)).map(String::as_str)
}
-pub const USAGE: &str = "raea check VIDEO.mp4 [--manifest render.json] [--words W.json] [--perception P.json] [--shape 16:9|9:16|4:5|1:1] [--platform tiktok|reels|shorts] [--taste taste.ts|DIR] [-o check.json] (an export against the floor: clipped text, contrast, safe areas, freezes, cues, loudness, blotching, a placeholder brand kit; P0-P3)";
+pub const USAGE: &str = "raea check VIDEO.mp4 [--manifest render.json] [--words W.json] [--perception P.json] [--shape 16:9|9:16|4:5|1:1] [--platform tiktok|reels|shorts] [--taste taste.ts|DIR] [-o check.json] (an export against the floor: clipped text, contrast, safe areas, freezes, flashing, cues, loudness, blotching, a placeholder brand kit; P0-P3)";
/// A rule from the person's taste: a form raea can measure, its value, and the taste line it stands for.
#[derive(Clone, Debug, PartialEq)]
@@ -124,6 +126,7 @@ fn run(args: &[String], tastes: Vec<raea_core_brief::Taste>) -> R<(String, bool)
sound(&video, words.as_deref(), &mut issues, &mut passed)?;
}
freezes(&video, &probe, taste_of(&taste, "still-max"), &mut issues, &mut passed)?;
+ flashing(&video, &probe, &mut issues, &mut passed)?;
blotching(&video, &probe, &mut issues, &mut passed)?;
brand_kit(&[flag(args, "--manifest").unwrap_or(""), video.as_str()], &mut issues, &mut passed);
if let Some(manifest) = &manifest {
@@ -176,22 +179,46 @@ struct Probe {
w: f64,
h: f64,
duration: f64,
+ /// when the picture ends, on the clock FFmpeg's filters read: it starts at the file's first stream, sound can run on
+ /// past the picture, and the container's duration counts that
+ picture: f64,
audio: bool,
}
+/// Where the picture's last packet ends, for a container that doesn't state the video stream's own length (Matroska)
+fn last_packet_end(video: &str) -> Option<f64> {
+ let out = Command::new("ffprobe").args(["-v", "error", "-select_streams", "v:0", "-show_entries", "packet=pts_time,duration_time", "-of", "csv=p=0", video]).output().ok()?;
+ String::from_utf8_lossy(&out.stdout)
+ .lines()
+ .filter_map(|l| {
+ let mut parts = l.split(',');
+ let t: f64 = parts.next()?.trim().parse().ok()?;
+ Some(t + parts.next().and_then(|d| d.trim().parse::<f64>().ok()).unwrap_or(0.0))
+ })
+ .max_by(f64::total_cmp)
+}
+
impl Probe {
fn of(video: &str) -> R<Probe> {
let out = Command::new("ffprobe")
- .args(["-v", "error", "-show_entries", "stream=codec_type,width,height,r_frame_rate:format=duration", "-of", "json", video])
+ .args(["-v", "error", "-show_entries", "stream=codec_type,width,height,r_frame_rate,duration,start_time:format=duration,start_time", "-of", "json", video])
.output()
.map_err(|e| format!("ffprobe: {e}"))?;
let v: Value = serde_json::from_slice(&out.stdout).map_err(|e| format!("ffprobe: {e}"))?;
let streams = v["streams"].as_array().cloned().unwrap_or_default();
let vid = streams.iter().find(|s| s["codec_type"] == "video").ok_or("no video stream")?;
+ let seconds = |field: &Value| field.as_str().and_then(|d| d.parse::<f64>().ok());
+ let duration = seconds(&v["format"]["duration"]).unwrap_or(0.0);
+ let origin = seconds(&v["format"]["start_time"]).unwrap_or(0.0);
+ let picture = match seconds(&vid["duration"]) {
+ Some(length) => seconds(&vid["start_time"]).unwrap_or(origin) - origin + length,
+ None => last_packet_end(video).map_or(duration, |end| end - origin),
+ };
Ok(Probe {
w: vid["width"].as_f64().unwrap_or(1920.0),
h: vid["height"].as_f64().unwrap_or(1080.0),
- duration: v["format"]["duration"].as_str().and_then(|d| d.parse().ok()).unwrap_or(0.0),
+ duration,
+ picture,
audio: streams.iter().any(|s| s["codec_type"] == "audio"),
})
}
diff --git a/apps/check/src/sound.rs b/apps/check/src/sound.rs
index 8c7e61f2..d47d8592 100644
--- a/apps/check/src/sound.rs
+++ b/apps/check/src/sound.rs
@@ -231,27 +231,38 @@ pub(crate) fn loudness(video: &str, taste: Option<&Taste>, issues: &mut Vec<Issu
}
/// three seconds or more where the picture doesn't change (the floor: nothing stands still that long without a reason)
-pub(crate) fn freezes(video: &str, probe: &Probe, taste: Option<&Taste>, issues: &mut Vec<Issue>, passed: &mut Vec<String>) -> R<()> {
- let most = taste.map_or(3.0, |t| t.value);
- let err = ffmpeg_stderr(&["-hide_banner", "-nostats", "-i", video, "-an", "-vf", &format!("freezedetect=n=-60dB:d={most}"), "-f", "null", "-"])?;
+/// The stretches freezedetect logged, each (start, seconds). FFmpeg logs a freeze's duration when the picture moves
+/// again, so a freeze still running when the file ends has only its start, and lasts to the end of the file.
+pub(crate) fn frozen_stretches(log: &str, duration: f64) -> Vec<(f64, f64)> {
+ let mut stretches = Vec::new();
let mut start = None;
- let mut found = 0;
- for l in err.lines() {
+ for l in log.lines() {
if let Some(x) = l.split("freeze_start: ").nth(1) {
start = x.trim().parse::<f64>().ok();
}
if let (Some(x), Some(s)) = (l.split("freeze_duration: ").nth(1), start) {
- let d: f64 = x.trim().parse().unwrap_or(0.0);
- found += 1;
- let says = format!("nothing changes for {d:.1} s; give it a reason to hold, or cut it shorter");
- issues.push(match taste {
- Some(t) => Issue { rule: "taste", p: 1, at: Some(s), says: format!("{says} (\"{}\")", t.line) },
- None => Issue { rule: "frozen", p: if d >= 6.0 || d >= probe.duration * 0.5 { 1 } else { 2 }, at: Some(s), says },
- });
+ stretches.push((s, x.trim().parse().unwrap_or(0.0)));
start = None;
}
}
- if found == 0 {
+ if let Some(s) = start {
+ stretches.push((s, (duration - s).max(0.0)));
+ }
+ stretches
+}
+
+pub(crate) fn freezes(video: &str, probe: &Probe, taste: Option<&Taste>, issues: &mut Vec<Issue>, passed: &mut Vec<String>) -> R<()> {
+ let most = taste.map_or(3.0, |t| t.value);
+ let err = ffmpeg_stderr(&["-hide_banner", "-nostats", "-i", video, "-an", "-vf", &format!("freezedetect=n=-60dB:d={most}"), "-f", "null", "-"])?;
+ let stretches = frozen_stretches(&err, probe.picture);
+ for &(s, d) in &stretches {
+ let says = format!("nothing changes for {d:.1} s; give it a reason to hold, or cut it shorter");
+ issues.push(match taste {
+ Some(t) => Issue { rule: "taste", p: 1, at: Some(s), says: format!("{says} (\"{}\")", t.line) },
+ None => Issue { rule: "frozen", p: if d >= 6.0 || d >= probe.duration * 0.5 { 1 } else { 2 }, at: Some(s), says },
+ });
+ }
+ if stretches.is_empty() {
passed.push(format!("frozen: nothing holds still for {most} s"));
}
Ok(())
diff --git a/apps/check/src/tests.rs b/apps/check/src/tests.rs
index b9b0970b..f4797b5a 100644
--- a/apps/check/src/tests.rs
+++ b/apps/check/src/tests.rs
@@ -147,6 +147,23 @@ fn a_voice_that_ends_a_sentence_isnt_a_dead_stop() {
assert!(found.iter().any(|(at, says)| (at - 1.6).abs() < 0.02 && says.starts_with("the highs")), "{found:?}");
}
+#[test]
+fn a_freeze_still_running_when_the_file_ends_is_found() {
+ // what FFmpeg 9.0.2's freezedetect logged on a film held from 3.4 s to its end, after a hold that ended at 3 s: the
+ // last freeze has a start and nothing after it, since it logs the duration when the picture moves again
+ let log = "[Parsed_freezedetect_0 @ 0000] lavfi.freezedetect.freeze_start: 0
+ [Parsed_freezedetect_0 @ 0000] lavfi.freezedetect.freeze_duration: 3
+ [Parsed_freezedetect_0 @ 0000] lavfi.freezedetect.freeze_end: 3
+ [Parsed_freezedetect_0 @ 0000] lavfi.freezedetect.freeze_start: 3.4
+";
+ assert_eq!(frozen_stretches(log, 10.0), vec![(0.0, 3.0), (3.4, 6.6)]);
+ // the whole file frozen: one start, at zero
+ assert_eq!(frozen_stretches("lavfi.freezedetect.freeze_start: 0
+", 8.0), vec![(0.0, 8.0)]);
+ assert!(frozen_stretches("frame= 300 fps=0.0
+", 10.0).is_empty());
+}
+
#[test]
fn a_bed_close_under_the_voice_and_a_loud_stretch_without_it_are_found() {
// 8 s of voice (-20 dBFS) in phrases with gaps, over a bed at -26 (6 dB under) and then at -40 (20 dB under)
@@ -274,3 +291,125 @@ fn a_sign_the_camera_carries_off_isnt_clipped_but_a_title_held_off_is() {
let rules: Vec<_> = issues.iter().map(|i| (i.rule, i.says.split('”').next().unwrap().trim_start_matches('“').to_string())).collect();
assert_eq!(rules, vec![("safe-area", "THE NIGHT MARKET".to_string()), ("clipped", "WIDE".to_string())]);
}
+
+/// a 96x54 picture drawn by `paint(frame index, sample, x, y)`, sample 0 the area sample and 1 the point sample, for
+/// `frames` frames at `fps`
+fn flash_samples(frames: usize, fps: f64, paint: impl Fn(usize, usize, usize, usize) -> [u8; 3]) -> Option<(usize, f64, &'static str)> {
+ let (w, h) = (96, 54);
+ let mut screen = FlashScreen::new(w, h);
+ for f in 0..frames {
+ let mut rgb = Vec::with_capacity(w * 2 * h * 3);
+ for y in 0..h {
+ for sample in 0..2 {
+ for x in 0..w {
+ rgb.extend_from_slice(&paint(f, sample, x, y));
+ }
+ }
+ }
+ screen.push(&rgb, f as f64 / fps);
+ }
+ screen.finish()
+}
+
+fn flash_of(seconds: usize, paint: impl Fn(usize, usize, usize) -> [u8; 3]) -> Option<(usize, f64, &'static str)> {
+ flash_samples(seconds * 60, 60.0, move |f, _, x, y| paint(f, x, y))
+}
+
+/// two colours taking turns `hz` times a second, over a box of the frame
+fn turns(hz: usize, on: [u8; 3], off: [u8; 3], bx: (usize, usize, usize, usize)) -> Option<(usize, f64, &'static str)> {
+ flash_of(3, move |f, x, y| {
+ let inside = x >= bx.0 && x < bx.0 + bx.2 && y >= bx.1 && y < bx.1 + bx.3;
+ if inside && f * hz * 2 / 60 % 2 == 0 { on } else { off }
+ })
+}
+
+#[test]
+fn flashing_is_found_past_three_a_second_and_not_at_it() {
+ let (white, black) = ([255, 255, 255], [0, 0, 0]);
+ let all = (0, 0, 96, 54);
+ assert_eq!(turns(3, white, black, all), None, "three a second is the limit, not past it");
+ let (swings, _, kind) = turns(4, white, black, all).expect("four a second");
+ assert_eq!((swings / 2, kind), (4, "general"));
+ // a small box: under a quarter of any window, and then over it
+ assert_eq!(turns(5, white, black, (40, 20, 10, 10)), None);
+ assert!(turns(5, white, black, (30, 18, 32, 18)).is_some());
+ // too small a change, and both ends too bright for WCAG to count it
+ assert_eq!(turns(5, [60, 60, 60], [30, 30, 30], all), None);
+ assert_eq!(turns(5, [255, 255, 255], [235, 235, 235], all), None);
+ // a dark saturated red: too dim to count as a general flash, past the limit as a red one
+ assert_eq!(turns(5, [150, 0, 0], black, all).map(|t| t.2), Some("red"));
+}
+
+#[test]
+fn a_flash_of_single_frames_counts_at_any_frame_rate() {
+ // 120 fps with one white frame in every 30: four flashes a second, each gone within a sixtieth of a second
+ let found = flash_samples(360, 120.0, |f, _, _, _| if f % 30 == 1 { [255, 255, 255] } else { [0, 0, 0] });
+ assert_eq!(found.map(|(swings, _, kind)| (swings / 2, kind)), Some((4, "general")));
+}
+
+#[test]
+fn a_flash_the_area_sample_averages_away_is_found_in_the_point_sample() {
+ let found = flash_samples(180, 60.0, |f, sample, _, _| {
+ if sample == 0 {
+ return [128, 128, 128];
+ }
+ if f * 5 * 2 / 60 % 2 == 0 { [255, 255, 255] } else { [0, 0, 0] }
+ });
+ assert!(found.is_some(), "the same flash in the point sample alone");
+}
+
+#[test]
+fn a_frame_gets_its_exact_time_from_the_log() {
+ // lines FFmpeg 9.0.2 logged with -loglevel level+info
+ let base = showinfo_base("[Parsed_showinfo_0 @ 000001] [info] config in time_base: 1/15360, frame_rate: 30/1");
+ assert_eq!(base, Some((1, 15360)));
+ let line = "[Parsed_showinfo_0 @ 000001] [info] n: 12 pts: 6144 pts_time:0.4 duration: 512 fmt:yuv420p";
+ assert_eq!(showinfo_frame(line, base), Some((12, 0.4)));
+ // rounded to six significant digits at long times: the ticks stay exact
+ let late = "[Parsed_showinfo_0 @ 000001] [info] n:40000 pts:20480512 pts_time:1333.37 duration: 512";
+ assert_eq!(showinfo_frame(late, base), Some((40000, 20480512.0 / 15360.0)));
+ assert_eq!(showinfo_frame(line, None), None);
+ assert_eq!(showinfo_frame("[info] frame= 300 fps=0.0", base), None);
+}
+
+#[test]
+fn only_a_lines_own_severity_counts_as_an_error() {
+ assert_eq!(log_level("[h264 @ 000001] [error] error while decoding MB 3 5"), Some("error"));
+ assert_eq!(log_level("[error] Conversion failed!"), Some("error"));
+ assert_eq!(log_level("[Parsed_showinfo_0 @ 000001] [info] n: 0 pts: 0"), Some("info"));
+ // a file's own metadata, which FFmpeg prints back at info
+ assert_eq!(log_level("[info] title : [error] harmless title"), Some("info"));
+ assert_eq!(log_level("frame= 300 fps=0.0"), None);
+}
+
+#[test]
+fn a_shape_sliding_past_and_ordinary_cuts_are_not_flashing() {
+ let (white, black) = ([255, 255, 255], [0, 0, 0]);
+ assert_eq!(flash_of(3, move |f, x, _| if x < f { white } else { black }), None, "one wipe across the frame");
+ assert_eq!(flash_of(4, move |f, _, _| if (f / 30) % 2 == 0 { white } else { black }), None, "a cut every half second");
+}
+
+#[test]
+fn a_patch_strobing_while_its_background_dims_is_still_found() {
+ // a third of a window: 0 then 124 on a 148 background, then the background settles at 124 and the patch cycles 124 and 160.
+ // The background's drop is under the 0.10 that counts, but it outweighs the patch in the window's mean.
+ let found = flash_samples(180, 60.0, |f, _, x, y| {
+ let patch = x < 16 && y < 12;
+ let level = match (patch, f) {
+ (true, 0) => 0,
+ (true, 1) => 124,
+ (true, _) => if (f - 2) * 5 * 2 / 60 % 2 == 0 { 160 } else { 124 },
+ (false, 0 | 1) => 148,
+ (false, _) => 124,
+ };
+ [level, level, level]
+ });
+ assert!(found.is_some(), "the patch flashes five times a second");
+}
+
+#[test]
+fn a_colour_crossing_the_saturation_line_is_not_a_red_flash() {
+ // one level of green moves the pixel across R/(R+G+B) = 0.8 and hardly changes its red at all
+ let found = flash_samples(180, 60.0, |f, _, _, _| if f * 5 * 2 / 60 % 2 == 0 { [100, 49, 0] } else { [100, 50, 0] });
+ assert_eq!(found, None);
+}
diff --git a/apps/media/src/frames.rs b/apps/media/src/frames.rs
new file mode 100644
index 00000000..80361fc6
--- /dev/null
+++ b/apps/media/src/frames.rs
@@ -0,0 +1,62 @@
+//! `media encode`: raw RGBA frames on stdin into an MP4 (docs/rune.feature R8a: a program that draws its own frames,
+//! raea-rune-host's UI as video, hands them to raea's encoder without linking it). raea's own build signs the file and
+//! marks its frames like every raea export; the public engine writes it unsigned, and the report's `credentials` says
+//! which (docs/targets.feature T1e). A sound file is laid under the picture from 0 s, cut to the picture's length.
+
+use std::io::Read;
+
+use super::*;
+
+/// Frames of `size` at `fps` from stdin, w x h x 4 bytes each, until it closes, into `out`.
+pub fn frames(out: &Path, size: (u32, u32), fps: f64, quality: Option<f32>, audio: Option<&Path>) -> R<Value> {
+ let (w, h) = size;
+ if w == 0 || h == 0 || w % 2 == 1 || h % 2 == 1 {
+ return Err(format!("--size {w}x{h}: an even width and height (H.264 halves the colour planes)"));
+ }
+ if let Some(d) = out.parent().filter(|d| !d.as_os_str().is_empty()) {
+ std::fs::create_dir_all(d).map_err(|e| format!("{}: {e}", d.display()))?;
+ }
+ let kbps = ((w as f64 * h as f64 * fps * 0.1) / 1000.0).clamp(300.0, 20000.0) as u32;
+ let mut enc = backend()?.encoder(out, &EncodeOpts { width: w, height: h, fps, kbps, quality, nv12: false, realtime: false })?;
+ let mut buf = vec![0u8; w as usize * h as usize * 4];
+ let mut input = std::io::stdin().lock();
+ let mut frames = 0usize;
+ loop {
+ let mut got = 0;
+ while got < buf.len() {
+ match input.read(&mut buf[got..]) {
+ Ok(0) => break,
+ Ok(n) => got += n,
+ Err(e) if e.kind() == std::io::ErrorKind::Interrupted => {}
+ Err(e) => return Err(format!("stdin: {e}")),
+ }
+ }
+ if got == 0 {
+ break;
+ }
+ if got < buf.len() {
+ return Err(format!("stdin ended inside frame {frames}: {got} of its {} bytes ({w}x{h} RGBA)", buf.len()));
+ }
+ enc.push(&buf)?;
+ frames += 1;
+ }
+ if frames == 0 {
+ return Err("no frames on stdin".into());
+ }
+ let secs = frames as f64 / fps;
+ let sound = match audio {
+ Some(p) => {
+ let a = soft()?.decode_audio(p).map_err(|e| format!("{}: {e}", p.display()))?;
+ let a = raea_io_media::soft_resample(&a, raea_io_media::audio::RATE);
+ let n = (secs * raea_io_media::audio::RATE as f64).round() as usize;
+ let channels = a.channels.into_iter().map(|mut c| {
+ c.resize(n, 0.0);
+ c
+ });
+ Some(Audio { rate: raea_io_media::audio::RATE, channels: channels.collect() })
+ }
+ None => None,
+ };
+ let stats = enc.finish(sound.as_ref())?;
+ Ok(json!({"wrote": out, "frames": frames, "seconds": round3(secs), "width": w, "height": h, "fps": round3(fps), "bytes": stats.bytes, "sound": sound.is_some(), "credentials": if raea_io_media::SIGNS { "signed" } else { "unsigned" }}))
+}
diff --git a/apps/media/src/lib.rs b/apps/media/src/lib.rs
index c7789a4c..f6459fb9 100644
--- a/apps/media/src/lib.rs
+++ b/apps/media/src/lib.rs
@@ -12,6 +12,7 @@
//! raea media proxy FILE [--height 720] -o OUT.mp4 a smaller copy
//! raea media trim FILE --from S --to S -o OUT.mp4 a stretch, frame-exact (re-encoded)
//! raea media concat A B ... -o OUT.mp4 one after another (same aspect)
+//! raea media encode --size WxH [--fps 60] [--quality Q] [--audio FILE] -o OUT.mp4 raw RGBA frames on stdin, signed
//!
//! `raea ffmpeg ...` and `raea ffprobe ...` read the command lines models write by reflex and run them as these verbs; what
//! they can't read is refused with the verb or edit that does it. No ffmpeg binary is involved.
@@ -39,6 +40,7 @@ mod encode;
use encode::*;
mod ff;
use ff::*;
+mod frames;
type R<T> = Result<T, String>;
@@ -84,11 +86,11 @@ fn num(fl: &BTreeMap<String, String>, k: &str) -> R<Option<f64>> {
}
/// The verbs `raea media` answers here.
-pub const VERBS: &[&str] = &["probe", "still", "sheet", "audio", "loudness", "motion", "cuts", "freezes", "proxy", "trim", "concat", "help"];
+pub const VERBS: &[&str] = &["probe", "still", "sheet", "audio", "loudness", "motion", "cuts", "freezes", "proxy", "trim", "concat", "encode", "help"];
pub fn cli(args: &[String]) -> i32 {
let Some(verb) = args.first() else {
- println!("usage: raea media <probe|still|sheet|audio|loudness|motion|cuts|proxy|trim|concat> FILE ... (raea media help)");
+ println!("usage: raea media <probe|still|sheet|audio|loudness|motion|cuts|proxy|trim|concat|encode> FILE ... (raea media help)");
return 2;
};
let (pos, fl) = parse(&args[1..]);
@@ -174,10 +176,15 @@ fn run(verb: &str, pos: &[String], fl: &BTreeMap<String, String>) -> R<Option<Va
let srcs: Vec<_> = pos.iter().map(|p| (PathBuf::from(p), None, None)).collect();
encode(&srcs, None, &out()?, fl.get("kbps").and_then(|k| k.parse().ok())).map(Some)
}
+ "encode" => {
+ let size = fl.get("size").and_then(|s| s.split_once('x')).and_then(|(w, h)| Some((w.parse().ok()?, h.parse().ok()?))).ok_or("raea media encode --size WxH -o OUT.mp4 (raw RGBA frames on stdin)")?;
+ let quality = fl.get("quality").map(|q| raea_io_media::parse_quality(q)).transpose()?;
+ frames::frames(&out()?, size, num(fl, "fps")?.unwrap_or(60.0), quality, fl.get("audio").map(Path::new)).map(Some)
+ }
"help" => {
println!("{}", include_str!("lib.rs").lines().take_while(|l| l.starts_with("//!")).map(|l| l.trim_start_matches("//!").strip_prefix(' ').unwrap_or("")).collect::<Vec<_>>().join("\n"));
Ok(None)
}
- v => Err(format!("no media verb {v:?}: probe, still, sheet, audio, loudness, motion, cuts, freezes, proxy, trim, concat")),
+ v => Err(format!("no media verb {v:?}: probe, still, sheet, audio, loudness, motion, cuts, freezes, proxy, trim, concat, encode")),
}
}
diff --git a/apps/targets/Cargo.toml b/apps/targets/Cargo.toml
new file mode 100644
index 00000000..37a7efcb
--- /dev/null
+++ b/apps/targets/Cargo.toml
@@ -0,0 +1,15 @@
+[package]
+name = "raea-app-targets"
+version = "0.1.0"
+edition = "2024"
+license = "FSL-1.1-ALv2"
+description = "An app's target, web (Blitz on Bevy) or native (Rune), read from its file, and raea app run|check|bundle on either (docs/targets.feature)"
+
+[dependencies]
+serde_json = "1"
+# the page host's frames over BRP
+base64 = "0.22"
+# raea's home: the SDK the web bundle resolves from, and the checkout's built hosts
+raea-io-home = { path = "../../io/home" }
+# the web bundle (raea-bundle's library, in process) and Tailwind's CSS for the app's classes
+raea-runtime-bundle = { path = "../../runtime/bundle", features = ["modules"] }
diff --git a/apps/targets/src/brp.rs b/apps/targets/src/brp.rs
new file mode 100644
index 00000000..82546847
--- /dev/null
+++ b/apps/targets/src/brp.rs
@@ -0,0 +1,61 @@
+//! The page host's Bevy Remote Protocol, as a client: one JSON-RPC call over HTTP, its result or its error. A +watch
+//! method answers as an event stream; its first event is the answer, and the connection is dropped after it (bevy_remote
+//! then stops watching). The same client as sdk/ui/parity's bevy.rs.
+
+use std::io::{BufRead, BufReader, Read, Write};
+use std::time::Duration;
+
+use serde_json::{Value, json};
+
+pub fn free_port() -> Result<u16, String> {
+ std::net::TcpListener::bind("127.0.0.1:0").and_then(|l| l.local_addr()).map(|a| a.port()).map_err(|e| e.to_string())
+}
+
+pub fn call(port: u16, method: &str, params: Value, limit: Duration) -> Result<Value, String> {
+ let body = json!({"jsonrpc": "2.0", "id": 1, "method": method, "params": params}).to_string();
+ let mut sock = std::net::TcpStream::connect(("127.0.0.1", port)).map_err(|e| format!("brp on {port}: {e}"))?;
+ sock.set_read_timeout(Some(limit)).ok();
+ write!(sock, "POST / HTTP/1.1\r\nHost: 127.0.0.1\r\nContent-Type: application/json\r\nContent-Length: {}\r\nConnection: close\r\n\r\n{body}", body.len()).map_err(|e| e.to_string())?;
+ let mut r = BufReader::new(sock);
+ let (mut stream, mut chunked, mut len) = (false, false, None::<usize>);
+ loop {
+ let mut line = String::new();
+ if r.read_line(&mut line).map_err(|e| format!("{method}: {e}"))? == 0 {
+ return Err(format!("{method}: the page host closed the connection"));
+ }
+ let l = line.trim_end().to_ascii_lowercase();
+ if l.is_empty() {
+ break;
+ }
+ stream |= l.starts_with("content-type:") && l.contains("event-stream");
+ chunked |= l.starts_with("transfer-encoding:") && l.contains("chunked");
+ if let Some(n) = l.strip_prefix("content-length:") {
+ len = n.trim().parse().ok();
+ }
+ }
+ let text = if stream {
+ loop {
+ let mut line = String::new();
+ if r.read_line(&mut line).map_err(|_| format!("{method}: no answer in {} s", limit.as_secs()))? == 0 {
+ return Err(format!("{method}: the stream ended without an answer"));
+ }
+ if let Some(d) = line.trim_end().strip_prefix("data:") {
+ break d.trim().to_string();
+ }
+ }
+ } else if let Some(n) = len.filter(|_| !chunked) {
+ let mut b = vec![0; n];
+ r.read_exact(&mut b).map_err(|e| e.to_string())?;
+ String::from_utf8_lossy(&b).into_owned()
+ } else {
+ let mut all = String::new();
+ r.read_to_string(&mut all).map_err(|e| e.to_string())?;
+ all.lines().filter(|l| l.trim_start().starts_with('{')).collect::<Vec<_>>().join("")
+ };
+ let v: Value = serde_json::from_str(&text).map_err(|e| format!("{method}: {e}: {}", &text[..text.len().min(200)]))?;
+ match (v.get("result"), v.get("error")) {
+ (_, Some(e)) => Err(format!("{method}: {}", e["message"].as_str().map(str::to_string).unwrap_or_else(|| e.to_string()))),
+ (Some(r), _) => Ok(r.clone()),
+ _ => Err(format!("{method}: {text}")),
+ }
+}
diff --git a/apps/targets/src/config.rs b/apps/targets/src/config.rs
new file mode 100644
index 00000000..85c301ef
--- /dev/null
+++ b/apps/targets/src/config.rs
@@ -0,0 +1,145 @@
+//! An app's `export const app` (docs/targets.feature T0a), read from its source before anything is bundled or run:
+//! which target hosts it and its window. The value must be a literal (objects, arrays, strings, numbers, booleans),
+//! so the CLI knows the host without running the app. Anything else is refused with the file and line, never read as
+//! the default. With no `app` export, or no `target` in it, the target is web.
+
+use std::path::Path;
+
+use serde_json::{Map, Value};
+
+use crate::literal::{self, Error};
+
+/// Where an app runs: Blitz on Bevy (web, the default) or Rune (native).
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+pub enum Target {
+ Web,
+ Native,
+}
+
+impl Target {
+ pub fn parse(s: &str) -> Result<Target, String> {
+ match s {
+ "web" => Ok(Target::Web),
+ "native" => Ok(Target::Native),
+ other => Err(format!("target {other:?}: \"web\" or \"native\"")),
+ }
+ }
+
+ pub fn name(self) -> &'static str {
+ match self {
+ Target::Web => "web",
+ Target::Native => "native",
+ }
+ }
+}
+
+/// What the app's file says, with the defaults filled in where it says nothing.
+#[derive(Clone, Debug, PartialEq)]
+pub struct AppConfig {
+ pub target: Target,
+ pub title: Option<String>,
+ pub size: Option<(f32, f32)>,
+ pub min_size: Option<(f32, f32)>,
+ /// whether the file had an `app` export at all
+ pub declared: bool,
+}
+
+const KEYS: [&str; 4] = ["target", "title", "size", "minSize"];
+
+/// `path`'s app config, `target` (from `--target`) over what the file says.
+pub fn read(path: &Path, target: Option<Target>) -> Result<AppConfig, String> {
+ let src = std::fs::read_to_string(path).map_err(|e| format!("{}: {e}", path.display()))?;
+ let mut c = parse(&src).map_err(|e| format!("{}:{}: {}", path.display(), e.line, e.why))?;
+ if let Some(t) = target {
+ c.target = t;
+ }
+ Ok(c)
+}
+
+/// The config in `src`: the default when it exports no `app`.
+pub fn parse(src: &str) -> Result<AppConfig, Error> {
+ let code = literal::blank_comments(src);
+ // where to look for the export: strings blanked too, so one written inside a string isn't it
+ let bare = literal::blank_strings(&code);
+ let mut c = AppConfig { target: Target::Web, title: None, size: None, min_size: None, declared: false };
+ if let Some(at) = other_export(&bare) {
+ return Err(Error::at(src, at, "`app` is exported, but not as `export const app = { ... }` (a literal the CLI can read)"));
+ }
+ let Some(start) = find_export(&bare) else { return Ok(c) };
+ c.declared = true;
+ let (value, _) = literal::value(src, &code, start)?;
+ let Value::Object(o) = value else { return Err(Error::at(src, start, "`app` must be an object literal")) };
+ fields(src, start, &o, &mut c)?;
+ Ok(c)
+}
+
+fn fields(src: &str, at: usize, o: &Map<String, Value>, c: &mut AppConfig) -> Result<(), Error> {
+ if let Some(k) = o.keys().find(|k| !KEYS.contains(&k.as_str())) {
+ return Err(Error::at(src, at, &format!("`app` has no field {k:?} (it has {})", KEYS.join(", "))));
+ }
+ if let Some(t) = o.get("target") {
+ let s = t.as_str().ok_or_else(|| Error::at(src, at, "`app.target` is a string"))?;
+ c.target = Target::parse(s).map_err(|e| Error::at(src, at, &e))?;
+ }
+ if let Some(t) = o.get("title") {
+ c.title = Some(t.as_str().ok_or_else(|| Error::at(src, at, "`app.title` is a string"))?.to_string());
+ }
+ c.size = o.get("size").map(|v| pair(src, at, "size", v)).transpose()?;
+ c.min_size = o.get("minSize").map(|v| pair(src, at, "minSize", v)).transpose()?;
+ Ok(())
+}
+
+fn pair(src: &str, at: usize, key: &str, v: &Value) -> Result<(f32, f32), Error> {
+ let bad = || Error::at(src, at, &format!("`app.{key}` is [width, height], two positive numbers"));
+ let a = v.as_array().filter(|a| a.len() == 2).ok_or_else(bad)?;
+ let (w, h) = (a[0].as_f64().ok_or_else(bad)?, a[1].as_f64().ok_or_else(bad)?);
+ if w <= 0.0 || h <= 0.0 {
+ return Err(bad());
+ }
+ Ok((w as f32, h as f32))
+}
+
+/// Where `export const app` starts its value: past `=`, its type annotation skipped.
+fn find_export(code: &str) -> Option<usize> {
+ let mut from = 0;
+ while let Some(i) = code[from..].find("export") {
+ let at = from + i;
+ let rest = &code[at + 6..];
+ let t = rest.trim_start();
+ if let Some(r) = t.strip_prefix("const")
+ && r.starts_with(char::is_whitespace)
+ && let Some(r) = r.trim_start().strip_prefix("app")
+ && !r.starts_with(|ch: char| ch.is_alphanumeric() || ch == '_' || ch == '$')
+ {
+ let off = code.len() - r.len();
+ return code[off..].find('=').map(|e| off + e + 1);
+ }
+ from = at + 6;
+ }
+ None
+}
+
+/// An `app` exported some other way: `export let/var/function app`, or `app` in an `export { ... }` list.
+fn other_export(code: &str) -> Option<usize> {
+ let word = |s: &str| s.starts_with("app") && !s[3..].starts_with(|ch: char| ch.is_alphanumeric() || ch == '_' || ch == '$');
+ let mut from = 0;
+ while let Some(i) = code[from..].find("export") {
+ let at = from + i;
+ let t = code[at + 6..].trim_start();
+ for kw in ["let", "var", "function", "class"] {
+ if let Some(r) = t.strip_prefix(kw)
+ && r.starts_with(char::is_whitespace)
+ && word(r.trim_start())
+ {
+ return Some(at);
+ }
+ }
+ if let Some(list) = t.strip_prefix('{').and_then(|r| r.split_once('}')).map(|(l, _)| l)
+ && list.split(',').any(|n| n.trim() == "app" || n.trim().ends_with(" as app"))
+ {
+ return Some(at);
+ }
+ from = at + 6;
+ }
+ None
+}
diff --git a/apps/targets/src/lib.rs b/apps/targets/src/lib.rs
new file mode 100644
index 00000000..2fea0dfc
--- /dev/null
+++ b/apps/targets/src/lib.rs
@@ -0,0 +1,17 @@
+//! raea-app-targets: the app targets of docs/targets.feature. An app is React TSX on @raea/ui's wire, hosted by Blitz on
+//! Bevy (the web target, the default) or by Rune (the native target); the app's own file says which (T0a), and
+//! `raea app run|check|bundle` work on either (T0b: verbs.rs).
+
+pub mod brp;
+pub mod config;
+pub mod literal;
+pub mod macapp;
+pub mod native;
+pub mod sign;
+pub mod steps;
+pub mod verbs;
+pub mod web;
+pub mod webcheck;
+
+pub use config::{AppConfig, Target, read};
+pub use verbs::command;
diff --git a/apps/targets/src/literal.rs b/apps/targets/src/literal.rs
new file mode 100644
index 00000000..91af1146
--- /dev/null
+++ b/apps/targets/src/literal.rs
@@ -0,0 +1,211 @@
+//! A JavaScript literal read without running it (T0a's `export const app`): objects with bare or quoted keys, arrays,
+//! strings in single or double quotes, numbers, true, false and null, trailing commas allowed. Anything else (a name,
+//! a call, a spread, a template string, a computed key) is an error at its line.
+
+use serde_json::{Map, Number, Value};
+
+/// A refusal at a line of the file.
+#[derive(Debug, PartialEq)]
+pub struct Error {
+ pub line: usize,
+ pub why: String,
+}
+
+impl Error {
+ /// `why` at byte `at` of `src`.
+ pub fn at(src: &str, at: usize, why: &str) -> Error {
+ Error { line: src[..at.min(src.len())].matches('\n').count() + 1, why: why.into() }
+ }
+}
+
+/// `src` with each comment replaced by spaces (newlines kept), so byte offsets and lines still match `src`. Strings
+/// are left alone, so a "//" inside one isn't a comment.
+pub fn blank_comments(src: &str) -> String {
+ let b = src.as_bytes();
+ let mut out = b.to_vec();
+ let (mut i, mut quote) = (0, None::<u8>);
+ while i < b.len() {
+ match quote {
+ Some(q) => {
+ if b[i] == b'\\' {
+ i += 1;
+ } else if b[i] == q {
+ quote = None;
+ }
+ }
+ None if b[i] == b'"' || b[i] == b'\'' || b[i] == b'`' => quote = Some(b[i]),
+ None if b[i..].starts_with(b"//") => {
+ while i < b.len() && b[i] != b'\n' {
+ out[i] = b' ';
+ i += 1;
+ }
+ continue;
+ }
+ None if b[i..].starts_with(b"/*") => {
+ let end = src[i + 2..].find("*/").map_or(b.len(), |e| i + 2 + e + 2);
+ for o in &mut out[i..end] {
+ if *o != b'\n' {
+ *o = b' ';
+ }
+ }
+ i = end;
+ continue;
+ }
+ None => {}
+ }
+ i += 1;
+ }
+ String::from_utf8(out).unwrap_or_else(|_| src.to_string())
+}
+
+/// `code` (comments already blanked) with every string's contents replaced by spaces, quotes kept: where to look for
+/// an `export`, so one written inside a string isn't found.
+pub fn blank_strings(code: &str) -> String {
+ let b = code.as_bytes();
+ let mut out = b.to_vec();
+ let (mut i, mut quote) = (0, None::<u8>);
+ while i < b.len() {
+ match quote {
+ Some(_) if b[i] == b'\\' => {
+ out[i] = b' ';
+ if i + 1 < b.len() && b[i + 1] != b'\n' {
+ out[i + 1] = b' ';
+ }
+ i += 1;
+ }
+ Some(q) if b[i] == q => quote = None,
+ Some(_) if b[i] != b'\n' => out[i] = b' ',
+ Some(_) => {}
+ None if matches!(b[i], b'"' | b'\'' | b'`') => quote = Some(b[i]),
+ None => {}
+ }
+ i += 1;
+ }
+ String::from_utf8(out).unwrap_or_else(|_| code.to_string())
+}
+
+/// The literal starting at byte `at` of `code` (comments blanked), and the byte after it. `src` gives error lines.
+pub fn value(src: &str, code: &str, at: usize) -> Result<(Value, usize), Error> {
+ let b = code.as_bytes();
+ let i = skip(b, at);
+ let err = |at: usize, why: &str| Err(Error::at(src, at, why));
+ match b.get(i) {
+ Some(b'{') => object(src, code, i),
+ Some(b'[') => array(src, code, i),
+ Some(b'"' | b'\'') => string(src, code, i).map(|(s, e)| (Value::String(s), e)),
+ Some(b'`') => err(i, "a template string isn't a literal the CLI can read; use quotes"),
+ Some(c) if c.is_ascii_digit() || *c == b'-' || *c == b'.' => number(src, code, i),
+ Some(_) => {
+ let word: String = code[i..].chars().take_while(|ch| ch.is_alphanumeric() || *ch == '_' || *ch == '$').collect();
+ match word.as_str() {
+ "true" => Ok((Value::Bool(true), i + 4)),
+ "false" => Ok((Value::Bool(false), i + 5)),
+ "null" => Ok((Value::Null, i + 4)),
+ "" => err(i, "expected a literal here"),
+ w => err(i, &format!("`{w}` isn't a literal; the CLI reads `app` without running the file")),
+ }
+ }
+ None => err(i, "the file ends inside `app`"),
+ }
+}
+
+fn skip(b: &[u8], mut i: usize) -> usize {
+ while i < b.len() && b[i].is_ascii_whitespace() {
+ i += 1;
+ }
+ i
+}
+
+fn object(src: &str, code: &str, open: usize) -> Result<(Value, usize), Error> {
+ let b = code.as_bytes();
+ let mut m = Map::new();
+ let mut i = skip(b, open + 1);
+ loop {
+ match b.get(i) {
+ Some(b'}') => return Ok((Value::Object(m), i + 1)),
+ None => return Err(Error::at(src, open, "`{` is never closed")),
+ Some(b'.') => return Err(Error::at(src, i, "a spread isn't a literal the CLI can read")),
+ Some(b'[') => return Err(Error::at(src, i, "a computed key isn't a literal the CLI can read")),
+ _ => {}
+ }
+ let (key, after) = if matches!(b[i], b'"' | b'\'') {
+ string(src, code, i)?
+ } else {
+ let k: String = code[i..].chars().take_while(|ch| ch.is_alphanumeric() || *ch == '_' || *ch == '$').collect();
+ if k.is_empty() {
+ return Err(Error::at(src, i, "expected a key"));
+ }
+ let n = i + k.len();
+ (k, n)
+ };
+ i = skip(b, after);
+ if b.get(i) != Some(&b':') {
+ return Err(Error::at(src, i, &format!("`{key}` needs `: value` (shorthand names a variable, which the CLI can't read)")));
+ }
+ let (v, e) = value(src, code, i + 1)?;
+ m.insert(key, v);
+ i = skip(b, e);
+ match b.get(i) {
+ Some(b',') => i = skip(b, i + 1),
+ Some(b'}') => {}
+ _ => return Err(Error::at(src, i, "expected `,` or `}`")),
+ }
+ }
+}
+
+fn array(src: &str, code: &str, open: usize) -> Result<(Value, usize), Error> {
+ let b = code.as_bytes();
+ let mut v = Vec::new();
+ let mut i = skip(b, open + 1);
+ loop {
+ match b.get(i) {
+ Some(b']') => return Ok((Value::Array(v), i + 1)),
+ None => return Err(Error::at(src, open, "`[` is never closed")),
+ Some(b'.') if b[i..].starts_with(b"...") => return Err(Error::at(src, i, "a spread isn't a literal the CLI can read")),
+ _ => {}
+ }
+ let (x, e) = value(src, code, i)?;
+ v.push(x);
+ i = skip(b, e);
+ match b.get(i) {
+ Some(b',') => i = skip(b, i + 1),
+ Some(b']') => {}
+ _ => return Err(Error::at(src, i, "expected `,` or `]`")),
+ }
+ }
+}
+
+fn string(src: &str, code: &str, open: usize) -> Result<(String, usize), Error> {
+ let b = code.as_bytes();
+ let q = b[open];
+ let mut s = String::new();
+ let mut i = open + 1;
+ while i < b.len() {
+ match b[i] {
+ c if c == q => return Ok((s, i + 1)),
+ b'\\' if i + 1 < b.len() => {
+ let n = b[i + 1] as char;
+ s.push(match n {
+ 'n' => '\n',
+ 't' => '\t',
+ other => other,
+ });
+ i += 2;
+ }
+ b'\n' => break,
+ _ => {
+ let ch = code[i..].chars().next().unwrap();
+ s.push(ch);
+ i += ch.len_utf8();
+ }
+ }
+ }
+ Err(Error::at(src, open, "a string is never closed"))
+}
+
+fn number(src: &str, code: &str, at: usize) -> Result<(Value, usize), Error> {
+ let t: String = code[at..].chars().take_while(|ch| ch.is_ascii_digit() || matches!(ch, '-' | '.' | 'e' | 'E' | '+' | '_')).collect();
+ let n: f64 = t.replace('_', "").parse().map_err(|_| Error::at(src, at, &format!("`{t}` isn't a number")))?;
+ let v = Number::from_f64(n).ok_or_else(|| Error::at(src, at, "a number that isn't finite"))?;
+ Ok((Value::Number(v), at + t.len()))
+}
diff --git a/apps/targets/src/macapp.rs b/apps/targets/src/macapp.rs
new file mode 100644
index 00000000..6dc0962a
--- /dev/null
+++ b/apps/targets/src/macapp.rs
@@ -0,0 +1,77 @@
+//! `raea app bundle` on the web target: a Mac app that opens the page in raea-page-host's window. App.app/Contents has
+//! the page host, the app's script and stylesheet in Resources/, and a launcher in MacOS/ that starts the host on them
+//! at the app's title and size, signed by the developer (sign.rs, T1d).
+
+use std::path::PathBuf;
+
+use crate::verbs::Ask;
+
+fn plist(name: &str, id: &str) -> String {
+ format!(
+ r#"<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleName</key><string>{name}</string>
+ <key>CFBundleDisplayName</key><string>{name}</string>
+ <key>CFBundleIdentifier</key><string>{id}</string>
+ <key>CFBundleExecutable</key><string>{name}</string>
+ <key>CFBundlePackageType</key><string>APPL</string>
+ <key>CFBundleShortVersionString</key><string>1.0</string>
+ <key>CFBundleVersion</key><string>1</string>
+ <key>LSMinimumSystemVersion</key><string>13.0</string>
+ <key>NSHighResolutionCapable</key><true/>
+</dict>
+</plist>
+"#,
+ name = xml(name)
+ )
+}
+
+fn xml(s: &str) -> String {
+ s.replace('&', "&amp;").replace('<', "&lt;").replace('>', "&gt;")
+}
+
+/// A shell word, quoted
+fn sh(s: &str) -> String {
+ format!("'{}'", s.replace('\'', "'\\''"))
+}
+
+/// The bundle id from the title: ascii letters and digits, under app.raea.local
+fn bundle_id(title: &str) -> String {
+ let id: String = title.chars().filter(|c| c.is_ascii_alphanumeric()).collect::<String>().to_lowercase();
+ format!("local.raea.app.{}", if id.is_empty() { "app" } else { &id })
+}
+
+pub fn web(a: &Ask) -> Result<String, String> {
+ let out = a.out.clone().unwrap_or_else(|| PathBuf::from(format!("{}.app", crate::verbs::stem(&a.app))));
+ if out.exists() {
+ std::fs::remove_dir_all(&out).map_err(|e| format!("{}: {e}", out.display()))?;
+ }
+ let contents = out.join("Contents");
+ let (macos, res) = (contents.join("MacOS"), contents.join("Resources"));
+ for d in [&macos, &res] {
+ std::fs::create_dir_all(d).map_err(|e| format!("{}: {e}", d.display()))?;
+ }
+ crate::web::build(&a.app, &res)?;
+ let host = crate::web::bin()?;
+ std::fs::copy(&host, res.join("raea-page-host")).map_err(|e| format!("{}: {e}", host.display()))?;
+ let name = &a.title;
+ std::fs::write(contents.join("Info.plist"), plist(name, &bundle_id(name))).map_err(|e| e.to_string())?;
+ let launcher = macos.join(name);
+ let script = format!(
+ "#!/bin/sh\n# made by raea app bundle: the page in raea-page-host's window\nR=\"$(cd \"$(dirname \"$0\")/../Resources\" && pwd)\"\nexec \"$R/raea-page-host\" \"$R/app.js\" --css \"$R/app.css\" --window --title {} --size {}x{}\n",
+ sh(name),
+ a.size.0,
+ a.size.1
+ );
+ std::fs::write(&launcher, script).map_err(|e| e.to_string())?;
+ #[cfg(unix)]
+ {
+ use std::os::unix::fs::PermissionsExt;
+ std::fs::set_permissions(&launcher, std::fs::Permissions::from_mode(0o755)).map_err(|e| e.to_string())?;
+ }
+ let mut said = crate::sign::sign(&out, &a.sign)?;
+ said.push(format!("{} (web)", out.display()));
+ Ok(said.join("\n"))
+}
diff --git a/apps/targets/src/native.rs b/apps/targets/src/native.rs
new file mode 100644
index 00000000..a6df3bc5
--- /dev/null
+++ b/apps/targets/src/native.rs
@@ -0,0 +1,80 @@
+//! The native target: raea-rune-host (docs/rune.feature), handed the verb, the app's script and its window. raea bundles
+//! the app (runtime/bundle/lib app.rs, the same script the web target runs), as the page host is handed its bundle:
+//! no bun (docs/targets.feature T1c).
+
+use std::path::{Path, PathBuf};
+
+use crate::verbs::{Ask, Verb, find};
+
+const HOST: &str = "raea-rune-host";
+
+/// raea-rune-host beside raea, on PATH, or built in the checkout (engine/rune, into the workspace's target/)
+fn bin() -> Result<PathBuf, String> {
+ let home = raea_io_home::home();
+ let built: Vec<PathBuf> = ["release", "debug"].map(|p| home.join("target").join(p).join(HOST)).to_vec();
+ find(HOST, &built)
+}
+
+/// The host's own arguments, for an ask
+pub fn args(a: &Ask) -> Vec<String> {
+ let size = format!("{}x{}", a.size.0, a.size.1);
+ let app = a.app.display().to_string();
+ let mut v: Vec<String> = match a.verb {
+ Verb::Run => vec!["run".into(), app, "--size".into(), size, "--title".into(), a.title.clone()],
+ Verb::Bundle => {
+ let mut v = vec!["bundle".into(), app, "--size".into(), size, "--title".into(), a.title.clone()];
+ if let Some(o) = &a.out {
+ v.extend(["-o".into(), o.display().to_string()]);
+ }
+ v
+ }
+ Verb::Check => {
+ let mut v = vec!["--headless".into(), app, "--png".into(), a.png.display().to_string(), "--size".into(), size, "--settle".into(), a.settle.to_string()];
+ if let Some(s) = &a.script {
+ v.extend(["--script".into(), s.display().to_string()]);
+ }
+ v
+ }
+ };
+ v.extend(a.rest.iter().cloned());
+ v
+}
+
+pub fn run(a: &Ask) -> Result<String, String> {
+ host(&args(a))?;
+ if a.verb != Verb::Bundle {
+ return Ok(String::new());
+ }
+ // the host makes the .app (signed ad hoc); raea signs it as the developer asks, as it does a web app (T1d)
+ let out = a.out.clone().unwrap_or_else(|| PathBuf::from(format!("{}.app", crate::verbs::stem(&a.app))));
+ Ok(crate::sign::sign(&out, &a.sign)?.join("\n"))
+}
+
+/// raea-rune-host run with `args`, its output passed through; an app's source among them (a .tsx, .ts or .jsx file) is
+/// bundled first and the host is handed its script
+pub fn host(args: &[String]) -> Result<String, String> {
+ let host = bin()?;
+ let work = std::env::temp_dir().join(format!("raea-rune-app-{}", std::process::id()));
+ let mut handed = Vec::with_capacity(args.len());
+ for a in args {
+ let p = Path::new(a);
+ if p.extension().is_some_and(|x| x == "tsx" || x == "ts" || x == "jsx") && p.is_file() {
+ std::fs::create_dir_all(&work).map_err(|e| format!("{}: {e}", work.display()))?;
+ let (js, _css) = raea_runtime_bundle::inproc::app::bundle(p, &raea_io_home::home())?;
+ let script = work.join(format!("{}.js", p.file_stem().unwrap_or_default().to_string_lossy()));
+ std::fs::write(&script, js).map_err(|e| format!("{}: {e}", script.display()))?;
+ handed.push(script.display().to_string());
+ } else {
+ handed.push(a.clone());
+ }
+ }
+ let mut cmd = std::process::Command::new(&host);
+ // the host films through `raea media encode`: this raea, so the film is signed (or not) as this build signs (T1e)
+ if std::env::var_os("RAEA_BIN").is_none() && let Ok(me) = std::env::current_exe() {
+ cmd.env("RAEA_BIN", me);
+ }
+ let status = cmd.args(&handed).status().map_err(|e| format!("{}: {e}", host.display()));
+ let _ = std::fs::remove_dir_all(&work);
+ let status = status?;
+ status.success().then(String::new).ok_or(format!("{HOST} exited with {status}"))
+}
diff --git a/apps/targets/src/sign.rs b/apps/targets/src/sign.rs
new file mode 100644
index 00000000..8c97ed28
--- /dev/null
+++ b/apps/targets/src/sign.rs
@@ -0,0 +1,101 @@
+//! A Mac app signed by its developer (docs/targets.feature T1d), on either target: `--identity NAME` (or
+//! RAEA_SIGN_IDENTITY) is a codesign identity, e.g. "Developer ID Application: NAME (TEAM)", found in RAEA_SIGN_KEYCHAIN
+//! when that's set (the caller unlocks it); `--notarize PROFILE` is a notarytool keychain profile (`xcrun notarytool
+//! store-credentials PROFILE ...`, once). With an identity, each Mach-O inside the app and then the app are signed with
+//! the hardened runtime, a timestamp and JavaScriptCore's JIT entitlement; with none it's signed ad hoc, and says so.
+//! Nothing here names any one developer: raea's own builds pass theirs by the environment.
+
+use std::path::{Path, PathBuf};
+use std::process::Command;
+
+/// How the app is signed, from the flags and the environment
+#[derive(Debug, Default, Clone, PartialEq, Eq)]
+pub struct Signing {
+ pub identity: Option<String>,
+ pub notarize: Option<String>,
+}
+
+impl Signing {
+ /// `--identity` over RAEA_SIGN_IDENTITY; `--notarize PROFILE` as given
+ pub fn new(identity: Option<String>, notarize: Option<String>) -> Self {
+ let env = std::env::var("RAEA_SIGN_IDENTITY").ok().filter(|v| !v.trim().is_empty());
+ Signing { identity: identity.or(env), notarize }
+ }
+}
+
+const ENTITLEMENTS: &str = r#"<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0"><dict>
+<key>com.apple.security.cs.allow-jit</key><true/>
+</dict></plist>
+"#;
+
+fn run(cmd: &mut Command) -> Result<String, String> {
+ let o = cmd.output().map_err(|e| format!("{:?}: {e}", cmd.get_program()))?;
+ let text = format!("{}{}", String::from_utf8_lossy(&o.stdout), String::from_utf8_lossy(&o.stderr));
+ o.status.success().then(|| text.clone()).ok_or_else(|| format!("{} failed: {}", cmd.get_program().to_string_lossy(), text.trim()))
+}
+
+/// The Mach-O files under `dir` (by their magic), deepest first, so each is signed before what holds it
+fn machos(dir: &Path) -> Vec<PathBuf> {
+ let mut out = Vec::new();
+ for e in std::fs::read_dir(dir).into_iter().flatten().flatten() {
+ let p = e.path();
+ if p.is_dir() {
+ out.extend(machos(&p));
+ } else if let Ok(b) = std::fs::read(&p).map(|b| b.get(..4).map(<[u8]>::to_vec).unwrap_or_default()) {
+ if matches!(b.as_slice(), [0xcf, 0xfa, 0xed, 0xfe] | [0xca, 0xfe, 0xba, 0xbe]) {
+ out.push(p);
+ }
+ }
+ }
+ out
+}
+
+/// `app` signed as `s` says, notarized and stapled when it names a profile: what each step said
+pub fn sign(app: &Path, s: &Signing) -> Result<Vec<String>, String> {
+ if !cfg!(target_os = "macos") {
+ return Ok(vec!["not signed: codesign is the Mac's".into()]);
+ }
+ let Some(identity) = &s.identity else {
+ if s.notarize.is_some() {
+ return Err("--notarize needs a Developer ID: --identity NAME or RAEA_SIGN_IDENTITY".into());
+ }
+ run(Command::new("codesign").args(["--force", "--deep", "--sign", "-"]).arg(app))?;
+ return Ok(vec!["signed ad hoc (no --identity or RAEA_SIGN_IDENTITY): it opens on the Mac that made it".into()]);
+ };
+ let ent = std::env::temp_dir().join(format!("raea-entitlements-{}.plist", std::process::id()));
+ std::fs::write(&ent, ENTITLEMENTS).map_err(|e| e.to_string())?;
+ let keychain = std::env::var("RAEA_SIGN_KEYCHAIN").ok().filter(|v| !v.trim().is_empty());
+ let one = |p: &Path| {
+ let mut c = Command::new("codesign");
+ c.args(["--force", "--options", "runtime", "--timestamp", "--entitlements"]).arg(&ent).args(["-s", identity]);
+ if let Some(k) = &keychain {
+ c.args(["--keychain", k]);
+ }
+ run(c.arg(p))
+ };
+ let signed = machos(&app.join("Contents")).iter().try_for_each(|p| one(p).map(drop)).and_then(|_| one(app));
+ let _ = std::fs::remove_file(&ent);
+ signed?;
+ let mut said = vec![format!("codesign --verify --deep --strict: {}", run(Command::new("codesign").args(["--verify", "--deep", "--strict", "--verbose=2"]).arg(app))?.trim())];
+ if let Some(profile) = &s.notarize {
+ said.push(notarized(app, profile)?);
+ said.push(format!("spctl: {}", run(Command::new("spctl").args(["--assess", "--type", "execute", "--verbose=2"]).arg(app))?.trim()));
+ }
+ Ok(said)
+}
+
+/// `app` sent to Apple's notary service with the notarytool keychain profile `profile`, and its ticket stapled
+fn notarized(app: &Path, profile: &str) -> Result<String, String> {
+ let zip = std::env::temp_dir().join(format!("raea-notarize-{}.zip", std::process::id()));
+ run(Command::new("ditto").args(["-c", "-k", "--keepParent"]).arg(app).arg(&zip))?;
+ let r = run(Command::new("xcrun").args(["notarytool", "submit"]).arg(&zip).args(["--keychain-profile", profile, "--wait"]));
+ let _ = std::fs::remove_file(&zip);
+ let r = r?;
+ if !r.contains("status: Accepted") {
+ return Err(format!("notarytool: {}", r.trim()));
+ }
+ run(Command::new("xcrun").args(["stapler", "staple"]).arg(app))?;
+ Ok("notarytool: Accepted, stapled".into())
+}
diff --git a/apps/targets/src/steps.rs b/apps/targets/src/steps.rs
new file mode 100644
index 00000000..71db614c
--- /dev/null
+++ b/apps/targets/src/steps.rs
@@ -0,0 +1,61 @@
+//! A check's script (R4b): the steps both targets play, each element by its data-testid. The same JSON raea-rune-host
+//! reads (engine/rune/src/script.rs): a press, text typed into a field, a wheel over an element, a key at the focus,
+//! frames with no input, and the answer to the app's next pick, save or dialog. Any other field on a step (a `name`) is
+//! left alone.
+
+use serde_json::Value;
+
+#[derive(Clone, Debug, PartialEq)]
+pub enum Step {
+ Press(String),
+ Type { text: String, into: String },
+ Wheel { over: String, dy: f64 },
+ Key(String),
+ Frames(u32),
+ /// the answer to the app's next fs.pick, fs.save or dialog.message (`{"pick": [file]}`, `{"save": file}`,
+ /// `{"dialog": index}`, docs/targets.feature T2d): a headless check opens no dialog
+ Os(Value),
+}
+
+/// `json`, an array of steps.
+pub fn parse(json: &str) -> Result<Vec<Step>, String> {
+ let v: Value = serde_json::from_str(json).map_err(|e| format!("the script: {e}"))?;
+ let list = v.as_array().ok_or("the script: an array of steps")?;
+ list.iter().enumerate().map(|(i, s)| step(s).ok_or_else(|| format!("the script's step {}: {s} is none of press, type+into, wheel+dy, key, frames, pick, save, dialog", i + 1))).collect()
+}
+
+fn step(s: &Value) -> Option<Step> {
+ let str_ = |k: &str| s.get(k).and_then(Value::as_str).map(str::to_string);
+ if let Some(p) = str_("press") {
+ return Some(Step::Press(p));
+ }
+ if let (Some(text), Some(into)) = (str_("type"), str_("into")) {
+ return Some(Step::Type { text, into });
+ }
+ if let (Some(over), Some(dy)) = (str_("wheel"), s.get("dy").and_then(Value::as_f64)) {
+ return Some(Step::Wheel { over, dy });
+ }
+ if let Some(k) = str_("key") {
+ return Some(Step::Key(k));
+ }
+ if ["pick", "save", "dialog"].iter().any(|k| s.get(k).is_some()) {
+ return Some(Step::Os(s.clone()));
+ }
+ s.get("frames").and_then(Value::as_u64).map(|n| Step::Frames(n as u32))
+}
+
+/// A step's file name: what it did, by its element (as raea-rune-host names it)
+pub fn name(s: &Step) -> String {
+ let n = match s {
+ Step::Press(p) => format!("press-{p}"),
+ Step::Type { into, .. } => format!("type-{into}"),
+ Step::Wheel { over, .. } => format!("wheel-{over}"),
+ Step::Key(k) => format!("key-{k}"),
+ Step::Frames(n) => format!("frames-{n}"),
+ Step::Os(v) => match v.get("pick").and_then(Value::as_array) {
+ Some(f) => format!("pick-{}", f.len()),
+ None => v.get("dialog").map_or("save".into(), |d| format!("dialog-{d}")),
+ },
+ };
+ n.chars().map(|c| if c.is_ascii_alphanumeric() || c == '-' { c } else { '_' }).collect()
+}
diff --git a/apps/targets/src/verbs.rs b/apps/targets/src/verbs.rs
new file mode 100644
index 00000000..28779db1
--- /dev/null
+++ b/apps/targets/src/verbs.rs
@@ -0,0 +1,133 @@
+//! `raea app run|check|bundle APP.tsx [--target web|native]` (docs/targets.feature T0b): one set of verbs for both
+//! targets, the target read from the app's own `export const app` (T0a) unless `--target` says otherwise.
+//!
+//! run a window of its own: Blitz on Bevy for web (raea-page-host's window build), Rune for native
+//! check headless (R4b): the mount and each step of `--script` written as PNGs to `--png DIR`, with tree.json (each
+//! frame's elements by data-testid) and unmapped.json (what the target didn't draw)
+//! bundle a Mac app, `-o App.app` (the file's name when left out)
+//!
+//! `raea rune ARGS` is `raea app ARGS --target native`, and its older spellings (`rune --headless APP`) still reach
+//! raea-rune-host as they are.
+
+use std::path::{Path, PathBuf};
+
+use crate::{AppConfig, Target};
+
+pub const USAGE: &str = "usage: raea app run APP.tsx [--target web|native] [--size WxH]\n raea app check APP.tsx [--target web|native] [--script steps.json] [--png DIR] [--size WxH] [--settle N]\n raea app bundle APP.tsx [--target web|native] [-o App.app] [--size WxH] [--identity NAME] [--notarize PROFILE]\n raea rune ... (raea app ... --target native)";
+
+/// What a verb was asked for, after the target is known
+#[derive(Debug)]
+pub struct Ask {
+ pub verb: Verb,
+ pub app: PathBuf,
+ pub config: AppConfig,
+ /// `--size WxH`, over the app's own
+ pub size: (u32, u32),
+ pub title: String,
+ pub script: Option<PathBuf>,
+ pub png: PathBuf,
+ pub settle: u32,
+ pub out: Option<PathBuf>,
+ /// the flags passed on to the native host as they are (--video, --audio)
+ pub rest: Vec<String>,
+ /// bundle: `--identity NAME` (or RAEA_SIGN_IDENTITY) and `--notarize PROFILE` (T1d)
+ pub sign: crate::sign::Signing,
+}
+
+#[derive(Clone, Copy, PartialEq, Eq, Debug)]
+pub enum Verb {
+ Run,
+ Check,
+ Bundle,
+}
+
+/// `raea app ...` or `raea rune ...`: the exit's message (empty on success) or the error.
+pub fn command(args: &[String]) -> Result<String, String> {
+ let (first, rest) = args.split_first().ok_or(USAGE)?;
+ match first.as_str() {
+ "app" => app(rest, None),
+ // the R-era spelling: `rune --headless APP ...` goes to the host untouched
+ "rune" if rest.first().is_some_and(|a| a.starts_with("--")) => crate::native::host(rest),
+ "rune" => app(rest, Some(Target::Native)),
+ _ => Err(USAGE.into()),
+ }
+}
+
+fn app(args: &[String], forced: Option<Target>) -> Result<String, String> {
+ let ask = parse(args, forced)?;
+ match ask.config.target {
+ Target::Native => crate::native::run(&ask),
+ Target::Web => crate::web::run(&ask),
+ }
+}
+
+pub fn parse(args: &[String], forced: Option<Target>) -> Result<Ask, String> {
+ let mut it = args.iter();
+ let verb = match it.next().map(String::as_str) {
+ Some("run") => Verb::Run,
+ Some("check") => Verb::Check,
+ Some("bundle") => Verb::Bundle,
+ Some("-h" | "--help" | "help") | None => return Err(USAGE.into()),
+ Some(v) => return Err(format!("no verb {v:?}\n{USAGE}")),
+ };
+ let (mut app, mut target, mut size, mut script, mut png, mut settle, mut out, mut rest) = (None, forced, None, None, PathBuf::from("out"), 12, None, Vec::new());
+ let (mut identity, mut notarize) = (None, None);
+ while let Some(a) = it.next() {
+ let mut val = || it.next().cloned().ok_or_else(|| format!("{a} needs a value"));
+ match a.as_str() {
+ "--target" => {
+ let t = Target::parse(&val()?)?;
+ if forced.is_some_and(|f| f != t) {
+ return Err(format!("raea rune is the native target; --target {} is `raea app`'s", t.name()));
+ }
+ target = Some(t);
+ }
+ "--size" => size = Some(wxh(&val()?)?),
+ "--script" => script = Some(PathBuf::from(val()?)),
+ "--png" => png = PathBuf::from(val()?),
+ "--settle" => settle = val()?.parse().map_err(|_| "--settle is a number of frames")?,
+ "-o" | "--out" => out = Some(PathBuf::from(val()?)),
+ "--video" | "--audio" => rest.extend([a.clone(), val()?]),
+ "--identity" => identity = Some(val()?),
+ "--notarize" => notarize = Some(val()?),
+ s if s.starts_with('-') => return Err(format!("no option {s}\n{USAGE}")),
+ s if app.is_none() => app = Some(PathBuf::from(s)),
+ s => return Err(format!("one app at a time ({s:?} too)")),
+ }
+ }
+ let app = app.ok_or(USAGE)?;
+ let config = crate::read(&app, target)?;
+ let size = size.or(config.size.map(|(w, h)| (w.round() as u32, h.round() as u32))).unwrap_or((800, 600));
+ let title = config.title.clone().unwrap_or_else(|| stem(&app));
+ if !rest.is_empty() && config.target == Target::Web {
+ return Err(format!("{} is the native target's (raea-rune-host); this app is web", rest[0]));
+ }
+ if (identity.is_some() || notarize.is_some()) && verb != Verb::Bundle {
+ return Err("--identity and --notarize sign a Mac app: they're `raea app bundle`'s".into());
+ }
+ let sign = crate::sign::Signing::new(identity, notarize);
+ Ok(Ask { verb, app, config, size, title, script, png, settle, out, rest, sign })
+}
+
+pub fn wxh(v: &str) -> Result<(u32, u32), String> {
+ let bad = || format!("--size {v}: WxH");
+ let (w, h) = v.split_once('x').ok_or_else(bad)?;
+ Ok((w.trim().parse().map_err(|_| bad())?, h.trim().parse().map_err(|_| bad())?))
+}
+
+pub fn stem(p: &Path) -> String {
+ p.file_stem().map_or("app".into(), |s| s.to_string_lossy().into_owned())
+}
+
+/// A binary of raea's by `name`: beside this one, on PATH, or built in the checkout's `built` target folders.
+pub fn find(name: &str, built: &[PathBuf]) -> Result<PathBuf, String> {
+ // name.exe on Windows (T1f: the Windows archive's hosts)
+ let exe = |p: PathBuf| {
+ let mut s = p.into_os_string();
+ s.push(std::env::consts::EXE_SUFFIX);
+ PathBuf::from(s)
+ };
+ let beside = std::env::current_exe().ok().map(|e| e.canonicalize().unwrap_or(e)).and_then(|e| e.parent().map(|d| d.join(name)));
+ let on_path = std::env::var_os("PATH").map(|p| std::env::split_paths(&p).map(|d| d.join(name)).collect::<Vec<_>>()).unwrap_or_default();
+ beside.into_iter().chain(on_path).chain(built.iter().cloned()).map(exe).find(|p| p.is_file()).ok_or(format!("no {name}: put it beside raea or on PATH (in a checkout, build it)"))
+}
diff --git a/apps/targets/src/web.rs b/apps/targets/src/web.rs
new file mode 100644
index 00000000..a27832ad
--- /dev/null
+++ b/apps/targets/src/web.rs
@@ -0,0 +1,52 @@
+//! The web target: the app on @raea/ui's React adapter in DOM mode, bundled by raea's own bundler (Rolldown, in
+//! process) with Tailwind's CSS for the classes it uses, on a Blitz page in Bevy: raea-page-host, as the feed is.
+
+use std::path::{Path, PathBuf};
+
+use crate::verbs::{Ask, Verb, find};
+
+const HOST: &str = "raea-page-host";
+
+/// The page host beside raea, on PATH, or built in the checkout (its window build: `--features window`)
+pub fn bin() -> Result<PathBuf, String> {
+ let home = raea_io_home::home();
+ find(HOST, &[home.join("target/release").join(HOST), home.join("target/debug").join(HOST)])
+}
+
+/// The app's page, built: its script and its stylesheet, in `dir`
+pub struct Built {
+ pub js: PathBuf,
+ pub css: PathBuf,
+}
+
+/// `app` bundled into `dir` (made if missing): app.js and app.css (Tailwind's, for the classes the app's folder uses, after
+/// any CSS the app imports)
+pub fn build(app: &Path, dir: &Path) -> Result<Built, String> {
+ let app = app.canonicalize().map_err(|e| format!("{}: {e}", app.display()))?;
+ std::fs::create_dir_all(dir).map_err(|e| format!("{}: {e}", dir.display()))?;
+ let (js, imported) = raea_runtime_bundle::inproc::app::bundle(&app, &raea_io_home::home())?;
+ let folder = app.parent().unwrap_or(Path::new("."));
+ let tw = raea_runtime_bundle::styles::tailwind(folder)?;
+ let built = Built { js: dir.join("app.js"), css: dir.join("app.css") };
+ std::fs::write(&built.js, js).map_err(|e| format!("{}: {e}", built.js.display()))?;
+ std::fs::write(&built.css, format!("{imported}\n{tw}")).map_err(|e| format!("{}: {e}", built.css.display()))?;
+ Ok(built)
+}
+
+pub fn run(a: &Ask) -> Result<String, String> {
+ match a.verb {
+ Verb::Run => {
+ let dir = std::env::temp_dir().join(format!("raea-app-run-{}", std::process::id()));
+ let b = build(&a.app, &dir)?;
+ let st = std::process::Command::new(bin()?)
+ .arg(&b.js)
+ .args(["--css".as_ref(), b.css.as_os_str(), "--window".as_ref(), "--title".as_ref(), a.title.as_ref(), "--size".as_ref(), format!("{}x{}", a.size.0, a.size.1).as_ref()])
+ .status()
+ .map_err(|e| format!("{HOST}: {e}"))?;
+ let _ = std::fs::remove_dir_all(&dir);
+ st.success().then(String::new).ok_or(format!("{HOST} exited with {st}"))
+ }
+ Verb::Check => crate::webcheck::check(a),
+ Verb::Bundle => crate::macapp::web(a),
+ }
+}
diff --git a/apps/targets/src/webcheck.rs b/apps/targets/src/webcheck.rs
new file mode 100644
index 00000000..3be64fcd
--- /dev/null
+++ b/apps/targets/src/webcheck.rs
@@ -0,0 +1,203 @@
+//! `raea app check` on the web target: the app on raea-page-host headless, driven over BRP as ui-parity drives it. After
+//! the mount and after each step, `--settle` frames run and then until two frames lay out the same, and the frame is
+//! written as NN-name.png with its elements (by data-testid) in tree.json, as raea-rune-host writes them. unmapped.json
+//! is empty on web: Blitz takes the page's CSS as Chrome does, with no table of mapped props (what native wouldn't draw
+//! is T4a's report). A page that throws, or a host that exits, fails the check with its log's tail.
+
+use std::path::Path;
+use std::process::{Child, Command, Stdio};
+use std::time::{Duration, Instant};
+
+use base64::Engine as _;
+use serde_json::{Value, json};
+
+use crate::brp::{call, free_port};
+use crate::steps::{self, Step};
+use crate::verbs::Ask;
+
+struct Host {
+ child: Child,
+ port: u16,
+ log: std::path::PathBuf,
+ /// the frame the latest input landed before
+ last: u64,
+ req: u64,
+}
+
+impl Drop for Host {
+ fn drop(&mut self) {
+ let _ = self.child.kill();
+ let _ = self.child.wait();
+ }
+}
+
+const S: Duration = Duration::from_secs(20);
+
+impl Host {
+ fn tail(&self) -> String {
+ let t = std::fs::read_to_string(&self.log).unwrap_or_default();
+ let t: Vec<&str> = t.lines().rev().take(8).collect();
+ t.into_iter().rev().collect::<Vec<_>>().join(" | ")
+ }
+
+ fn call(&mut self, m: &str, p: Value) -> Result<Value, String> {
+ call(self.port, m, p, S).map_err(|e| match self.child.try_wait() {
+ Ok(Some(st)) => format!("raea-page-host exited ({st}): {}", self.tail()),
+ _ => e,
+ })
+ }
+
+ fn send(&mut self, ev: Value) -> Result<(), String> {
+ let r = self.call("page.input", ev)?;
+ self.last = self.last.max(r["frame"].as_u64().unwrap_or(0));
+ Ok(())
+ }
+
+ fn frame(&mut self) -> Result<u64, String> {
+ Ok(self.call("page.state", json!({}))?["frame"].as_u64().unwrap_or(0))
+ }
+
+ fn tree_after(&mut self, f: u64) -> Result<Value, String> {
+ self.call("page.ui+watch", json!({"after": f}))
+ }
+
+ /// the middle of the element `tid` in the latest tree
+ fn middle(&mut self, tid: &str) -> Result<(f64, f64), String> {
+ let f = self.frame()?;
+ let t = self.tree_after(f)?;
+ let n = t["nodes"].as_array().into_iter().flatten().find(|n| n["id"].as_str() == Some(tid)).ok_or_else(|| format!("no element with data-testid {tid:?}"))?;
+ let r = &n["rect"];
+ let g = |k: &str| r[k].as_f64().unwrap_or(0.0);
+ Ok((g("x") + g("w") / 2.0, g("y") + g("h") / 2.0))
+ }
+
+ fn press_at(&mut self, (x, y): (f64, f64)) -> Result<(), String> {
+ self.send(json!({"type": "move", "x": x, "y": y}))?;
+ self.send(json!({"type": "down", "x": x, "y": y, "clicks": 1, "button": "left"}))?;
+ self.send(json!({"type": "up", "x": x, "y": y, "button": "left"}))
+ }
+
+ fn play(&mut self, s: &Step) -> Result<u32, String> {
+ match s {
+ Step::Press(t) => {
+ let at = self.middle(t)?;
+ self.press_at(at)?;
+ }
+ Step::Type { text, into } => {
+ let at = self.middle(into)?;
+ self.press_at(at)?;
+ self.send(json!({"type": "key", "key": "End", "mods": []}))?;
+ for c in text.chars() {
+ self.send(json!({"type": "text", "text": c.to_string()}))?;
+ }
+ }
+ Step::Wheel { over, dy } => {
+ let (x, y) = self.middle(over)?;
+ self.send(json!({"type": "move", "x": x, "y": y}))?;
+ self.send(json!({"type": "wheel", "x": x, "y": y, "dx": 0, "dy": -dy, "unit": "pixel"}))?;
+ }
+ Step::Key(k) => self.send(json!({"type": "key", "key": k, "mods": []}))?,
+ Step::Frames(n) => return Ok(*n),
+ // queued in the page host's raea-io-os for the app's next pick, save or dialog
+ Step::Os(v) => {
+ call(self.port, "page.os", v.clone(), Duration::from_secs(10))?;
+ }
+ }
+ Ok(0)
+ }
+
+ /// the page once settled: `min` frames after the latest input, then until two frames lay out the same (90 at most);
+ /// the tree and the frame's PNG
+ fn read(&mut self, min: u32) -> Result<(Value, Vec<u8>), String> {
+ let now = self.frame()?;
+ let mut at = self.last.max(now) + min as u64;
+ let mut tree = self.tree_after(at)?;
+ for _ in 0..90 {
+ at = tree["frame"].as_u64().unwrap_or(at) + 1;
+ let next = self.tree_after(at)?;
+ let same = next["nodes"] == tree["nodes"];
+ tree = next;
+ if same {
+ break;
+ }
+ }
+ self.req += 1;
+ let shot = self.call("page.frame_png+watch", json!({"req": format!("check-{}", self.req)}))?;
+ let png = base64::engine::general_purpose::STANDARD.decode(shot["png"].as_str().unwrap_or("")).map_err(|e| e.to_string())?;
+ Ok((tree, png))
+ }
+}
+
+fn launch(js: &Path, css: &Path, out: &Path, size: (u32, u32)) -> Result<Host, String> {
+ let port = free_port()?;
+ let log = out.join("page-host.log");
+ let f = std::fs::File::create(&log).map_err(|e| e.to_string())?;
+ let child = Command::new(crate::web::bin()?)
+ .arg(js)
+ .arg("--css")
+ .arg(css)
+ .arg("--size")
+ .arg(format!("{}x{}", size.0, size.1))
+ .env("RAEA_PAGE_BRP_PORT", port.to_string())
+ .env("RAEA_PAGE_MCP_PORT", "0")
+ .env("RAEA_AUDIO_MUTE", "1")
+ .stdin(Stdio::null())
+ .stdout(Stdio::from(f.try_clone().map_err(|e| e.to_string())?))
+ .stderr(Stdio::from(f))
+ .spawn()
+ .map_err(|e| format!("raea-page-host: {e}"))?;
+ let mut h = Host { child, port, log, last: 0, req: 0 };
+ // its first frame, or its exit (a host that never answers fails at 60 s)
+ let t = Instant::now();
+ loop {
+ if let Ok(Some(st)) = h.child.try_wait() {
+ return Err(format!("raea-page-host exited ({st}) before its first frame: {}", h.tail()));
+ }
+ if call(port, "page.state", json!({}), Duration::from_secs(2)).is_ok() {
+ return Ok(h);
+ }
+ if t.elapsed() > Duration::from_secs(60) {
+ return Err(format!("raea-page-host's BRP didn't answer in 60 s: {}", h.tail()));
+ }
+ std::thread::sleep(Duration::from_millis(50));
+ }
+}
+
+/// A page's own errors in the host's log (the page's console.error and uncaught throws)
+fn page_errors(log: &Path) -> Vec<String> {
+ let t = std::fs::read_to_string(log).unwrap_or_default();
+ t.lines().filter(|l| l.contains("Uncaught") || l.contains("[page] error") || l.contains("console.error")).map(str::to_string).collect()
+}
+
+pub fn check(a: &Ask) -> Result<String, String> {
+ let steps = match &a.script {
+ Some(p) => steps::parse(&std::fs::read_to_string(p).map_err(|e| format!("{}: {e}", p.display()))?)?,
+ None => Vec::new(),
+ };
+ let out = &a.png;
+ std::fs::create_dir_all(out).map_err(|e| format!("{}: {e}", out.display()))?;
+ let built = crate::web::build(&a.app, &out.join("page"))?;
+ let mut h = launch(&built.js, &built.css, out, a.size)?;
+ let mut trees = Vec::new();
+ let mut shoot = |h: &mut Host, i: usize, name: &str, extra: u32| -> Result<(), String> {
+ let (tree, png) = h.read(a.settle + extra)?;
+ let file = format!("{i:02}-{name}.png");
+ std::fs::write(out.join(&file), png).map_err(|e| format!("{file}: {e}"))?;
+ trees.push(json!({"step": i, "name": name, "png": file, "frame": tree["frame"], "tree": tree["nodes"]}));
+ Ok(())
+ };
+ shoot(&mut h, 0, "mount", 0)?;
+ for (i, s) in steps.iter().enumerate() {
+ let wait = h.play(s).map_err(|e| format!("step {}: {e}", i + 1))?;
+ shoot(&mut h, i + 1, &steps::name(s), wait)?;
+ }
+ let errors = page_errors(&h.log);
+ drop(h);
+ let tree = out.join("tree.json");
+ std::fs::write(&tree, serde_json::to_string_pretty(&trees).unwrap()).map_err(|e| format!("{}: {e}", tree.display()))?;
+ std::fs::write(out.join("unmapped.json"), "[]\n").map_err(|e| e.to_string())?;
+ if !errors.is_empty() {
+ return Err(format!("the page reported {} error(s) (page-host.log): {}", errors.len(), errors.join(" | ")));
+ }
+ Ok(format!("{} frames written to {} (web: Blitz on Bevy)", trees.len(), out.display()))
+}
diff --git a/apps/targets/tests/config.rs b/apps/targets/tests/config.rs
new file mode 100644
index 00000000..2a74ffaf
--- /dev/null
+++ b/apps/targets/tests/config.rs
@@ -0,0 +1,70 @@
+//! T0a: an app's `export const app`, read without running it.
+
+use raea_app_targets::config::{Target, parse};
+
+#[test]
+fn no_export_or_no_target_is_web() {
+ let c = parse("export default function App() { return <div /> }").unwrap();
+ assert_eq!((c.target, c.declared), (Target::Web, false));
+ let c = parse("export const app = { title: 'Notes' };").unwrap();
+ assert_eq!((c.target, c.declared, c.title.as_deref()), (Target::Web, true, Some("Notes")));
+}
+
+#[test]
+fn a_literal_is_read_with_its_type_and_comments() {
+ let src = r#"
+import type { AppConfig } from "@raea/ui/app";
+// the ad's app, a phone's width
+export const app: AppConfig = {
+ target: "native", /* Rune */
+ title: "Tally — split it",
+ size: [1080, 1920],
+ minSize: [420, 400,],
+} satisfies AppConfig;
+export default function Tally() { return null }
+"#;
+ let c = parse(src).unwrap();
+ assert_eq!(c.target, Target::Native);
+ assert_eq!(c.title.as_deref(), Some("Tally — split it"));
+ assert_eq!((c.size, c.min_size), (Some((1080.0, 1920.0)), Some((420.0, 400.0))));
+}
+
+#[test]
+fn anything_but_a_literal_is_refused_at_its_line() {
+ for (src, line, says) in [
+ ("const t = 'native';\nexport const app = { target: t };", 2, "`t` isn't a literal"),
+ ("\n\nexport const app = makeApp();", 3, "`makeApp` isn't a literal"),
+ ("export const app = { ...base, title: 'x' };", 1, "spread"),
+ ("export const app = {\n title: `T ${n}`,\n};", 2, "template"),
+ ("const title = 'x';\nexport const app = { title };", 2, "shorthand"),
+ ("export const app = { target: 'mobile' };", 1, "\"web\" or \"native\""),
+ ("export const app = { targt: 'native' };", 1, "no field \"targt\""),
+ ("export const app = { size: [0, 10] };", 1, "two positive numbers"),
+ ("const app = {};\n\nexport { app };", 3, "not as `export const app"),
+ ("export let app = { target: 'native' };", 1, "not as `export const app"),
+ ] {
+ let e = parse(src).expect_err(src);
+ assert_eq!(e.line, line, "{src}: {}", e.why);
+ assert!(e.why.contains(says), "{src}: {}", e.why);
+ }
+}
+
+#[test]
+fn a_comment_or_a_string_is_not_an_export() {
+ let c = parse("// export const app = { target: 'native' }\nconst s = \"export const app = 1\";").unwrap();
+ assert!(!c.declared);
+}
+
+#[test]
+fn the_command_line_overrides_the_file() {
+ let dir = std::env::temp_dir().join(format!("raea-target-{}", std::process::id()));
+ std::fs::create_dir_all(&dir).unwrap();
+ let f = dir.join("app.tsx");
+ std::fs::write(&f, "export const app = { target: 'native' };").unwrap();
+ assert_eq!(raea_app_targets::read(&f, None).unwrap().target, Target::Native);
+ assert_eq!(raea_app_targets::read(&f, Some(Target::Web)).unwrap().target, Target::Web);
+ std::fs::write(&f, "\nexport const app = { target: t };").unwrap();
+ let e = raea_app_targets::read(&f, None).unwrap_err();
+ assert!(e.starts_with(&format!("{}:2: ", f.display())), "{e}");
+ std::fs::remove_dir_all(&dir).unwrap();
+}
diff --git a/apps/targets/tests/verbs.rs b/apps/targets/tests/verbs.rs
new file mode 100644
index 00000000..66f15708
--- /dev/null
+++ b/apps/targets/tests/verbs.rs
@@ -0,0 +1,70 @@
+//! T0b: the verbs read the target from the app (or --target), and each target is handed what its host takes.
+use std::path::PathBuf;
+
+use raea_app_targets::steps::{self, Step};
+use raea_app_targets::verbs::{Verb, parse};
+use raea_app_targets::{Target, native};
+
+fn app(src: &str) -> PathBuf {
+ let dir = std::env::temp_dir().join(format!("raea-targets-verbs-{}-{}", std::process::id(), src.len()));
+ std::fs::create_dir_all(&dir).unwrap();
+ let f = dir.join("app.tsx");
+ std::fs::write(&f, src).unwrap();
+ f
+}
+
+fn s(v: &[&str]) -> Vec<String> {
+ v.iter().map(|x| x.to_string()).collect()
+}
+
+#[test]
+fn the_app_says_its_target_and_window_and_flags_win() {
+ let f = app("export const app = { target: \"native\", title: \"Tally\", size: [390, 844] };\nexport default function A() { return null }\n");
+ let p = f.display().to_string();
+ let a = parse(&s(&["check", &p, "--png", "o"]), None).unwrap();
+ assert_eq!((a.verb, a.config.target, a.size, a.title.as_str()), (Verb::Check, Target::Native, (390, 844), "Tally"));
+ let a = parse(&s(&["run", &p, "--target", "web", "--size", "640x480"]), None).unwrap();
+ assert_eq!((a.config.target, a.size), (Target::Web, (640, 480)));
+}
+
+#[test]
+fn an_app_with_no_setting_is_web_and_rune_is_native() {
+ let f = app("export default function A() { return null }\n");
+ let p = f.display().to_string();
+ assert_eq!(parse(&s(&["run", &p]), None).unwrap().config.target, Target::Web);
+ assert_eq!(parse(&s(&["run", &p]), Some(Target::Native)).unwrap().config.target, Target::Native);
+ assert!(parse(&s(&["run", &p, "--target", "web"]), Some(Target::Native)).is_err());
+ // the native host's own flags aren't taken quietly for a web app
+ assert!(parse(&s(&["check", &p, "--video", "x.mp4"]), None).unwrap_err().contains("native"));
+}
+
+#[test]
+fn native_gets_raea_rune_hosts_arguments() {
+ let f = app("export const app = { target: \"native\" };\n");
+ let p = f.display().to_string();
+ let a = parse(&s(&["check", &p, "--script", "steps.json", "--png", "out", "--video", "v.mp4"]), None).unwrap();
+ assert_eq!(native::args(&a), s(&["--headless", &p, "--png", "out", "--size", "800x600", "--settle", "12", "--script", "steps.json", "--video", "v.mp4"]));
+ let a = parse(&s(&["bundle", &p, "-o", "T.app"]), None).unwrap();
+ assert_eq!(native::args(&a), s(&["bundle", &p, "--size", "800x600", "--title", "app", "-o", "T.app"]));
+}
+
+#[test]
+fn a_script_is_the_same_steps_on_both_targets() {
+ let v = steps::parse(r#"[{"press":"add","name":"press-add"},{"type":"Tacos","into":"what"},{"wheel":"list","dy":120},{"key":"Enter"},{"frames":30}]"#).unwrap();
+ assert_eq!(v, vec![Step::Press("add".into()), Step::Type { text: "Tacos".into(), into: "what".into() }, Step::Wheel { over: "list".into(), dy: 120.0 }, Step::Key("Enter".into()), Step::Frames(30)]);
+ assert_eq!(steps::name(&v[0]), "press-add");
+ assert!(steps::parse(r#"[{"tap":"x"}]"#).unwrap_err().contains("step 1"));
+}
+
+#[test]
+fn bundle_signs_as_the_developer_asks() {
+ let f = app("export const app = { target: \"native\" };\nexport default function A() { return null }\n");
+ let p = f.display().to_string();
+ let a = parse(&s(&["bundle", &p, "--identity", "Developer ID Application: Someone (TEAM)", "--notarize", "my-profile"]), None).unwrap();
+ assert_eq!((a.sign.identity.as_deref(), a.sign.notarize.as_deref()), (Some("Developer ID Application: Someone (TEAM)"), Some("my-profile")));
+ // neither reaches the host: raea signs the .app after the host makes it
+ assert!(!native::args(&a).iter().any(|x| x.contains("notarize") || x.contains("identity")));
+ // signing is bundle's alone, and --notarize names its profile
+ assert!(parse(&s(&["check", &p, "--identity", "X"]), None).unwrap_err().contains("bundle"));
+ assert!(parse(&s(&["bundle", &p, "--notarize"]), None).unwrap_err().contains("needs a value"));
+}
diff --git a/bench/bevy-parity/Cargo.toml b/bench/bevy-parity/Cargo.toml
new file mode 100644
index 00000000..b42c14ba
--- /dev/null
+++ b/bench/bevy-parity/Cargo.toml
@@ -0,0 +1,21 @@
+[package]
+name = "raea-bevy-parity"
+version = "0.1.0"
+edition = "2024"
+license = "FSL-1.1-ALv2"
+publish = false
+description = "Bevy's own examples, built against raea's Bevy with the parity probe in their App (docs/control.feature FC0a): one binary, RAEA_PARITY_EXAMPLE picks the example"
+
+[dependencies]
+# the feature list engine/render's bevy has, so the examples build against the Bevy raea already compiled, and winit: the
+# examples open a window (raea's renders don't), and bevy_scene: Bevy 0.20's examples write their scenes in BSN
+bevy = { version = "=0.20.0", default-features = false, features = ["std", "default_app", "default_font", "multi_threaded", "3d_bevy_render", "ui_bevy_render", "png", "jpeg", "tonemapping_luts", "ktx2", "zstd_rust", "smaa_luts", "experimental_pbr_pcss", "area_light_luts", "bevy_gilrs", "bevy_winit", "bevy_scene"] }
+raea-sys-parity = { path = "../../systems/parity" }
+# Bevy's examples' own dependencies (bevy v0.20.0's dev-dependencies)
+argh = "0.1.12"
+rand = "0.10.0"
+chacha20 = { version = "0.10.0", default-features = false, features = ["rng"] }
+
+# used by the ported examples, which build.rs copies in through include! where cargo-shear doesn't look
+[package.metadata.cargo-shear]
+ignored = ["argh", "rand", "chacha20"]
diff --git a/bench/bevy-parity/build.rs b/bench/bevy-parity/build.rs
new file mode 100644
index 00000000..10655906
--- /dev/null
+++ b/bench/bevy-parity/build.rs
@@ -0,0 +1,49 @@
+//! Each example in examples.list, copied from Bevy's checkout (BEVY_SRC, default ~/.cache/raea-vendor/bevy-0.20.0)
+//! into a module: its inner doc comments and attributes become plain comments, its `App::new()` is the host's
+//! `crate::parity_app()` (the fixed clock and the probe, then the example's own plugins) and its `main` is public.
+
+use std::fmt::Write as _;
+use std::path::PathBuf;
+
+fn main() {
+ let here = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap());
+ let src = std::env::var("BEVY_SRC")
+ .map(PathBuf::from)
+ .unwrap_or_else(|_| PathBuf::from(std::env::var("HOME").unwrap()).join(".cache/raea-vendor/bevy-0.20.0"));
+ let out = PathBuf::from(std::env::var("OUT_DIR").unwrap());
+ println!("cargo:rerun-if-changed=examples.list");
+ println!("cargo:rerun-if-env-changed=BEVY_SRC");
+ // without Bevy's source (a fresh clone of the public repository) the workspace still builds: the host is built
+ // with no examples, and says so when one is asked for
+ let have = src.join("examples").is_dir();
+ println!("cargo:rerun-if-changed={}", src.join("examples").display());
+ if !have {
+ println!("cargo:warning=raea-bevy-parity: no Bevy v0.20.0 at {} (set BEVY_SRC), so no examples are built in", src.display());
+ }
+ let list = if have { std::fs::read_to_string(here.join("examples.list")).unwrap() } else { String::new() };
+ let (mut mods, mut arms) = (String::new(), String::new());
+ for path in list.lines().map(str::trim).filter(|l| !l.is_empty() && !l.starts_with('#')) {
+ let file = src.join("examples").join(format!("{path}.rs"));
+ println!("cargo:rerun-if-changed={}", file.display());
+ let code = std::fs::read_to_string(&file).unwrap_or_else(|e| panic!("{}: {e} (clone bevy v0.20.0 to BEVY_SRC)", file.display()));
+ let code: String = code
+ .lines()
+ .map(|l| {
+ let t = l.trim_start();
+ if t.starts_with("//!") || t.starts_with("#![") { format!("// {t}") } else { l.to_string() }
+ })
+ .collect::<Vec<_>>()
+ .join("\n")
+ // include_str!/include_bytes! paths are relative to the example, not to OUT_DIR
+ .replace("include_str!(\"", &format!("include_str!(\"{}/", file.parent().unwrap().display()))
+ .replace("include_bytes!(\"", &format!("include_bytes!(\"{}/", file.parent().unwrap().display()))
+ .replace("App::new()", "crate::parity_app()")
+ .replace("\nfn main()", "\npub fn main()");
+ let m = format!("ex_{}", path.replace('/', "__"));
+ std::fs::write(out.join(format!("{m}.rs")), code).unwrap();
+ writeln!(mods, "#[allow(dead_code, unused_imports, non_snake_case, clippy::all)]\npub mod {m} {{ include!(concat!(env!(\"OUT_DIR\"), \"/{m}.rs\")); }}").unwrap();
+ writeln!(arms, " \"{path}\" => {m}::main(),").unwrap();
+ }
+ let reg = format!("{mods}\n/// Where the examples came from: empty when Bevy's source wasn't found at build time.\npub const BEVY_SRC: &str = {:?};\n/// Runs the example at `path`, false when the host doesn't build it.\npub fn run(path: &str) -> bool {{\n match path {{\n{arms} _ => return false,\n }}\n true\n}}\n", if have { src.display().to_string() } else { String::new() });
+ std::fs::write(out.join("registry.rs"), reg).unwrap();
+}
diff --git a/bench/bevy-parity/examples.list b/bench/bevy-parity/examples.list
new file mode 100644
index 00000000..110b6525
--- /dev/null
+++ b/bench/bevy-parity/examples.list
@@ -0,0 +1,4 @@
+# Bevy v0.20.0 examples the host builds, as their path under examples/ without .rs (docs/control.feature FC0a).
+# A port beside each is sdk/raea/bench/bevy-parity/<path>.tsx.
+stress_tests/many_cubes
+3d/3d_scene
diff --git a/bench/bevy-parity/runs.tsv b/bench/bevy-parity/runs.tsv
new file mode 100644
index 00000000..b50b73f2
--- /dev/null
+++ b/bench/bevy-parity/runs.tsv
@@ -0,0 +1,3 @@
+# path example arguments (- for none) frames probed (docs/control.feature FC0a; tools/bevy-parity)
+stress_tests/many_cubes --benchmark --instance-count 10000 30,60
+3d/3d_scene - 5,10
diff --git a/bench/bevy-parity/src/main.rs b/bench/bevy-parity/src/main.rs
new file mode 100644
index 00000000..c97321c7
--- /dev/null
+++ b/bench/bevy-parity/src/main.rs
@@ -0,0 +1,28 @@
+//! Bevy's own examples with the parity probe (docs/control.feature FC0a). RAEA_PARITY_EXAMPLE=stress_tests/many_cubes
+//! picks one; the rest of the command line is the example's own (`-- --benchmark --instance-count 10000`).
+//! tools/bevy-parity runs it beside the example's TSX port.
+
+use bevy::prelude::*;
+
+include!(concat!(env!("OUT_DIR"), "/registry.rs"));
+
+/// The example's App: a fixed 60 fps clock (RAEA_PARITY_FPS) and the probe, before the example's own plugins.
+pub fn parity_app() -> App {
+ let mut app = App::new();
+ let fps = std::env::var("RAEA_PARITY_FPS").ok().and_then(|f| f.parse().ok()).unwrap_or(60.0);
+ raea_sys_parity::fixed_clock(&mut app, fps);
+ raea_sys_parity::install(&mut app);
+ app
+}
+
+fn main() {
+ let ex = std::env::var("RAEA_PARITY_EXAMPLE").unwrap_or_default();
+ if !run(&ex) {
+ if BEVY_SRC.is_empty() {
+ eprintln!("raea-bevy-parity: built without Bevy's examples: clone bevy v0.20.0 to BEVY_SRC (~/.cache/raea-vendor/bevy-0.20.0) and rebuild");
+ std::process::exit(2);
+ }
+ eprintln!("raea-bevy-parity: RAEA_PARITY_EXAMPLE={ex:?} isn't in bench/bevy-parity/examples.list");
+ std::process::exit(2);
+ }
+}
diff --git a/core/scene/src/lib.rs b/core/scene/src/lib.rs
index 926817ec..a72f2097 100644
--- a/core/scene/src/lib.rs
+++ b/core/scene/src/lib.rs
@@ -23,7 +23,9 @@ pub struct Node3 {
/// rows by reference (ZeroHeap: a live 3D frame parsed and copied every part's props)
pub props: std::sync::Arc<Map<String, Value>>,
pub shape: Option<std::sync::Arc<str>>,
- pub kids: Vec<Node3>,
+ /// shared: a subtree no commit touched is the last frame's, handed on for an Arc's count (docs/control.feature
+ /// FC1b: many_cubes' 10,000 parts were re-read each frame for a camera's move). Build from a Vec with `.into()`
+ pub kids: std::sync::Arc<[Node3]>,
}
/// A part of a frame's 3D, placed: its kind, props and shape, a material child, and its world transform.
diff --git a/core/scene/src/parts.rs b/core/scene/src/parts.rs
index 5a0f8600..15c6f417 100644
--- a/core/scene/src/parts.rs
+++ b/core/scene/src/parts.rs
@@ -168,7 +168,7 @@ pub fn own_tris(it: &Item) -> Result<Arc<(Vec<(String, Vec<[Vec3; 3]>)>, bool)>,
pub fn parts_of(its: &[Item], moving: &[bool]) -> (Vec<Part>, Vec<Item>, Vec<String>) {
let (mut parts, mut items, mut skipped) = (Vec::new(), Vec::new(), Vec::new());
- for (it, &moves) in its.iter().zip(moving).filter(|(it, _)| it.kind == "mesh" || it.kind == "model") {
+ for (it, &moves) in its.iter().zip(moving).filter(|(it, _)| (it.kind == "mesh" || it.kind == "model") && !it.props.contains_key("at")) {
let name = label(it, "");
let own = match own_tris(it) {
Ok(t) => t,
diff --git a/core/scene/src/props.rs b/core/scene/src/props.rs
index 644401aa..0d066d43 100644
--- a/core/scene/src/props.rs
+++ b/core/scene/src/props.rs
@@ -76,6 +76,18 @@ pub const LUX: f64 = 8000.0;
pub const LUMENS: f64 = 9.0e5;
/// An AmbientLight of intensity 1, in cd/m² (as before).
pub const AMBIENT: f64 = 400.0;
+/// A light's power in Bevy's units (docs/control.feature FC1f): a Bevy light's own `lux` (directional), `lumens`
+/// (point, spot, rect) or `nits` (ambient, cd/m²) as written; a 3d.tsx light's relative `intensity` times LUX, LUMENS
+/// or AMBIENT.
+pub fn light_power(kind: &str, p: &Map<String, Value>) -> f64 {
+ let (field, k) = match kind {
+ "directional" => ("lux", LUX),
+ "ambient" => ("nits", AMBIENT),
+ _ => ("lumens", LUMENS),
+ };
+ num(p, field).unwrap_or_else(|| num(p, "intensity").unwrap_or(1.0) * k)
+}
+
/// An <Environment> of intensity 1: the panorama's values (a Poly Haven HDR's sky is about 1) times this, in cd/m².
pub const ENV: f64 = 1000.0;
/// Bevy's default exposure (EV100): exposure 0; +1 is a stop brighter.
diff --git a/core/scene/tests/glam_fixture.rs b/core/scene/tests/glam_fixture.rs
new file mode 100644
index 00000000..61037040
--- /dev/null
+++ b/core/scene/tests/glam_fixture.rs
@@ -0,0 +1,37 @@
+//! glam's (Bevy 0.20's) answers for the TS Transform/Quat helpers' inputs (docs/control.feature FC1d), printed as JSON
+//! for sdk/raea/conformance/glam.json: `cargo test -p raea-core-scene --test glam_fixture -- --ignored --nocapture`.
+
+use bevy::math::{EulerRot, Quat, Vec3};
+use bevy::transform::components::Transform;
+
+fn q(q: Quat) -> String {
+ format!("[{},{},{},{}]", q.x, q.y, q.z, q.w)
+}
+
+#[test]
+#[ignore]
+fn print_fixture() {
+ let mut out = Vec::new();
+ for a in [0.0f32, 0.5, -1.25, std::f32::consts::FRAC_PI_2, 3.0] {
+ out.push(format!("{{\"op\":\"x\",\"a\":{a},\"q\":{}}}", q(Quat::from_rotation_x(a))));
+ out.push(format!("{{\"op\":\"y\",\"a\":{a},\"q\":{}}}", q(Quat::from_rotation_y(a))));
+ out.push(format!("{{\"op\":\"z\",\"a\":{a},\"q\":{}}}", q(Quat::from_rotation_z(a))));
+ }
+ let n = Vec3::new(1.0, 2.0, 3.0).normalize();
+ out.push(format!("{{\"op\":\"axis\",\"axis\":[{},{},{}],\"a\":1,\"q\":{}}}", n.x, n.y, n.z, q(Quat::from_axis_angle(n, 1.0))));
+ let orders = [("XYZ", EulerRot::XYZ), ("XZY", EulerRot::XZY), ("YXZ", EulerRot::YXZ), ("YZX", EulerRot::YZX), ("ZXY", EulerRot::ZXY), ("ZYX", EulerRot::ZYX)];
+ for (name, o) in orders {
+ for (a, b, c) in [(0.3f32, -0.7, 1.1), (0.5, std::f32::consts::FRAC_PI_2, 0.3)] {
+ out.push(format!("{{\"op\":\"euler\",\"order\":\"{name}\",\"abc\":[{a},{b},{c}],\"q\":{}}}", q(Quat::from_euler(o, a, b, c))));
+ }
+ }
+ let (p, r) = (Quat::from_rotation_y(0.4), Quat::from_rotation_x(-0.9));
+ out.push(format!("{{\"op\":\"mul\",\"a\":{},\"b\":{},\"q\":{}}}", q(p), q(r), q(p * r)));
+ let v = p * Vec3::new(1.0, 2.0, 3.0);
+ out.push(format!("{{\"op\":\"mulVec3\",\"q\":{},\"v\":[1,2,3],\"out\":[{},{},{}]}}", q(p), v.x, v.y, v.z));
+ for (eye, target, up) in [([0.0f32, 2.0, 7.0], [0.0f32, 0.5, 0.0], [0.0f32, 1.0, 0.0]), ([3.0, -1.0, 2.0], [0.0, 0.0, 0.0], [0.0, 0.0, 1.0]), ([0.0, 5.0, 0.0], [0.0, 0.0, 0.0], [0.0, 1.0, 0.0])] {
+ let t = Transform::from_translation(Vec3::from(eye)).looking_at(Vec3::from(target), Vec3::from(up));
+ out.push(format!("{{\"op\":\"lookingAt\",\"eye\":{eye:?},\"target\":{target:?},\"up\":{up:?},\"q\":{}}}", q(t.rotation)));
+ }
+ println!("GLAM_FIXTURE [{}]", out.join(","));
+}
diff --git a/core/scene/tests/light_power.rs b/core/scene/tests/light_power.rs
new file mode 100644
index 00000000..a7b40155
--- /dev/null
+++ b/core/scene/tests/light_power.rs
@@ -0,0 +1,24 @@
+//! A light's power in Bevy's units (docs/control.feature FC1f): a Bevy light's own field as written, else a 3d.tsx
+//! light's relative intensity times the scale.
+
+use raea_core_scene::{AMBIENT, LUMENS, LUX, light_power};
+use serde_json::json;
+
+#[test]
+fn own_units_win_over_intensity() {
+ // the 3d.tsx default intensity of 1 rides along; the Bevy field is what counts
+ assert_eq!(light_power("directional", json!({ "lux": 100000.0, "intensity": 1.0 }).as_object().unwrap()), 100000.0);
+ assert_eq!(light_power("point", json!({ "lumens": 123456.0, "intensity": 1.0 }).as_object().unwrap()), 123456.0);
+ assert_eq!(light_power("spot", json!({ "lumens": 0.0, "intensity": 1.0 }).as_object().unwrap()), 0.0);
+ assert_eq!(light_power("rect", json!({ "lumens": 900.0 }).as_object().unwrap()), 900.0);
+ assert_eq!(light_power("ambient", json!({ "nits": 77.0, "intensity": 1.0 }).as_object().unwrap()), 77.0);
+}
+
+#[test]
+fn intensity_is_relative_without_them() {
+ assert_eq!(light_power("directional", json!({ "intensity": 2.0 }).as_object().unwrap()), 2.0 * LUX);
+ assert_eq!(light_power("point", json!({}).as_object().unwrap()), LUMENS);
+ assert_eq!(light_power("ambient", json!({ "intensity": 0.5 }).as_object().unwrap()), 0.5 * AMBIENT);
+ // a directional light ignores a stray lumens
+ assert_eq!(light_power("directional", json!({ "lumens": 5.0 }).as_object().unwrap()), LUX);
+}
diff --git a/docs/r3f.feature b/docs/r3f.feature
new file mode 100644
index 00000000..bfef509b
--- /dev/null
+++ b/docs/r3f.feature
@@ -0,0 +1,95 @@
+@spec
+Feature: React Three Fiber both ways: an R3F scene drawn by raea, a raea composition drawn in R3F
+ Goal, 2026-11-06: "complete r3f support so that raea can also render to r3f or use r3f as input in raea, two way
+ complete r3f support, and measure so that it is complete and nothing is missing". The code is sdk/r3f (raea/r3f for
+ authors). Both ways go through raea's scene contract, the `data-3d` elements a frame renders: an R3F scene is read
+ into those elements (input), and those elements are drawn as a three.js scene (output). The same units, shapes and
+ tone mapping hold on both sides, and both are measured: every kind and class has a row (R3F7) and every case is
+ held to the other renderer by SSIM (R3F8).
+
+ Rule: R3F as raea's input
+
+ @done
+ Scenario: R3F1. An R3F scene in a raea composition
+ Given an R3F scene, the JSX a <Canvas> holds (meshes, lights, cameras, useFrame, refs, primitives)
+ When a composition puts it inside <R3F camera={...} shadows> from raea/r3f
+ Then raea's engine draws it: each frame R3F's reconciler builds the three.js scene off screen (a stand-in
+ renderer, no WebGL), raea steps R3F's clock to the frame and reads the scene into raea's parts
+ And useFrame runs once a frame, 1/fps a step, from frame 0; a seek back starts again from 0, so a render, a
+ seek and a play give the same frame (test/input.test.tsx "the clock")
+ And raea's own hooks work inside it (useCurrentFrame, a context from outside the canvas): the context bridge
+ re-provides the composition's contexts to R3F's tree
+
+ @done
+ Scenario: R3F2. What is read from three.js
+ Then input/kinds.ts has a row for every Object3D and Material class three exports (62 in three 0.180):
+ 41 drawn, 12 near (a note says what differs), 9 with nothing to draw (a bone, a camera that isn't drawn with,
+ a sound, a base class, ShadowMaterial)
+ And meshes keep their triangles, normals, uvs (v flipped: Bevy counts from the top), vertex colours, geometry
+ groups (a mesh a material); skinned and morphed meshes are posed on the CPU each frame; an InstancedMesh is
+ Instances while its copies hold still; Points, Lines, Sprites and three's helpers are drawn
+ And lights convert by units.ts, so a three light and the raea light it becomes put the same light on screen; a
+ HemisphereLight is an ambient light of its colours' average plus half their difference from straight up
+ And textures keep their url; a DataTexture or a canvas becomes a PNG; repeat, offset, rotation and samplers hold
+
+ Rule: raea drawn in R3F and three.js
+
+ @done
+ Scenario: R3F3. A raea composition inside an R3F <Canvas>
+ Given a raea composition's component
+ When an R3F app puts <Raea component={Edit} /> inside its <Canvas>
+ Then its 3D is drawn by three.js in that canvas: the component renders as under raea (into a page off screen,
+ at its frame), and Scene3d draws the page's parts into a three.js scene R3F holds
+ And its camera becomes R3F's, its tone mapping, exposure, shadows, fog, environment and background the canvas's
+ (camera={false} and settings={false} leave them to the app)
+ And its frame follows R3F's clock at its fps, or `frame` pins it
+
+ @done
+ Scenario: R3F4. Scene3d, the three.js host, for any three.js app
+ Then sdk/r3f/src/three draws a raea page into a three.js scene without React Three Fiber (sdk/playable's host
+ is built on it): Scene3d.sync(page, seconds), fit(width, height), apply(renderer)
+ And three/kinds.ts has a row for every kind raea's SDK renders (58): 26 drawn, 11 near, 4 settings, 9 effects
+ and 8 that are Bevy's own (a WESL shader or frame pass, a compute pass, a Bevy component or resource, an ECS
+ world read from the engine's tables, volumetric fog and fog volumes)
+
+ @done
+ Scenario: R3F5. raea's solids on the web
+ Given a Mesh whose shape is a solid (minus, hull, extrude, Text3D: core/shape's expression)
+ Then engine/shape-web compiles core/shape to wasm (tools/shape-wasm.sh, 2.6 MB) and loadShapes() brings it in:
+ the solid's own triangles, the same as raea's engine meshes
+ And until it loads, a solid waits (it isn't drawn as something else)
+
+ @done
+ Scenario: R3F6. Frame effects
+ Then three/effects.ts draws raea's effects with three's EffectComposer in Bevy's order: ambient occlusion,
+ outlines, depth of field, bloom (energy-conserving, as Bevy's) and motion blur in the scene's light; Bevy's
+ grade (fringes, vignette, white balance, levels) before tone mapping; saturation, looks and lenses after
+ And <Raea> runs it whenever the composition has effects; effects={false} hands them to the app's own composer
+
+ Rule: Measured
+
+ @done
+ Scenario: R3F7. Nothing is left without a row
+ Then test/coverage.test.tsx reads the SDK's sources for every kind it renders and fails on one missing from
+ three/kinds.ts, draws every kind three.js draws and fails on a warning, and fails on an effect row the
+ composer doesn't draw
+ And it walks three's exports and fails on an Object3D or Material class missing from input/kinds.ts
+ And `bun test` in sdk/r3f runs these with the input and round-trip tests (22 tests)
+
+ @done
+ Scenario: R3F8. Each way held to the other renderer
+ Given test/parity/fixtures.tsx: R3F scenes (in-*) and raea compositions (out-*) at 640x360
+ When tools/parity.sh renders each with `raea render` (native.tsx) and with three.js in headless Chrome
+ (test/parity/page.tsx, served by a Vite host), and compares the two by SSIM
+ Then every case is at least 0.92 (measured 11-06)
+ | case | what | SSIM |
+ | in-basic | a spinning box (useFrame), PBR and clearcoat, shadows, a point light | 0.9911 |
+ | in-lights | spot, hemisphere and area lights, fog, Lambert and flat Phong | 0.9793 |
+ | in-things | InstancedMesh, multi-material, edge lines, a sprite | 0.9908 |
+ | out-basic | a raea scene, ACES, a moving box | 0.9958 |
+ | out-lights | spot and area lights, fog, Text3D (a solid) | 0.9627 |
+ | out-bloom | <Bloom intensity={2}> | 0.9444 |
+ | out-grade | <Grade> saturation, contrast, vignette | 0.9748 |
+ | out-lens | <LensDistortion k1={0.15}> | 0.9933 |
+ And three's ACES scales its input by 1/0.6 where Bevy's doesn't: the host's exposure takes 0.6 under ACES, and
+ an R3F canvas's ACES reads as 0.74 stops more (measured: out-lights 0.927 to 0.963, in-lights 0.927 to 0.979)
diff --git a/engine/bundle/src/edit.rs b/engine/bundle/src/edit.rs
index 5063517b..af4593a7 100644
--- a/engine/bundle/src/edit.rs
+++ b/engine/bundle/src/edit.rs
@@ -22,13 +22,33 @@ pub struct Edit {
pub struct EditResolve(Edit);
impl EditResolve {
- /// its folders as the resolver names modules: symlinks resolved (the Mac's temp folder is /var, a link to /private/var)
+ /// its folders as the resolver names modules: symlinks resolved (the Mac's temp folder is /var, a link to /private/var),
+ /// and on Windows without canonicalize()'s verbatim `\\?\` prefix, which the resolver never writes: with it no
+ /// importer was ever under the work folder, so a live game's own `import "react"` went to the engine's React instead of
+ /// the live runtime its tsconfig paths name, and `raea play` threw "not a function" before the first frame
pub fn new(e: Edit) -> Self {
- let real = |p: PathBuf| p.canonicalize().unwrap_or(p);
+ let real = |p: PathBuf| p.canonicalize().map(raea_io_home::plain).unwrap_or(p);
EditResolve(Edit { dir: real(e.dir), js: real(e.js), work: real(e.work) })
}
}
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn its_folders_are_named_as_the_resolver_names_modules() {
+ assert_eq!(raea_io_home::plain(PathBuf::from(r"\\?\C:\Temp\raea-cli-1")), PathBuf::from(r"C:\Temp\raea-cli-1"));
+ assert_eq!(raea_io_home::plain(PathBuf::from(r"\\?\UNC\server\share")), PathBuf::from(r"\\?\UNC\server\share"));
+ assert_eq!(raea_io_home::plain(PathBuf::from("/private/var/x")), PathBuf::from("/private/var/x"));
+ // a real folder: canonicalized on Windows that was \\?\C:\..., which no importer starts with
+ let dir = std::env::temp_dir();
+ let r = EditResolve::new(Edit { dir: dir.clone(), js: dir.clone(), work: dir.clone() });
+ assert!(!r.0.work.display().to_string().starts_with(r"\\?\"), "{}", r.0.work.display());
+ assert!(dir.join("entry.tsx").starts_with(&r.0.work) || cfg!(unix), "{} under {}", dir.display(), r.0.work.display());
+ }
+}
+
/// `spec` resolved by Rolldown's resolver as if imported from a file in `dir`
async fn resolve_from(ctx: &PluginContext, spec: &str, dir: &Path) -> anyhow::Result<Option<HookResolveIdOutput>> {
let importer = dir.join("_raea.js");
diff --git a/engine/cli/Cargo.toml b/engine/cli/Cargo.toml
index d0b423a2..d233f227 100644
--- a/engine/cli/Cargo.toml
+++ b/engine/cli/Cargo.toml
@@ -52,6 +52,8 @@ raea-app-check = { path = "../../apps/check" }
raea-app-ci = { path = "../../apps/ci" }
raea-app-tools = { path = "../../apps/tools" }
raea-app-media = { path = "../../apps/media" }
+# `raea app run|check|bundle` and `raea rune` on either target (docs/targets.feature T0b)
+raea-app-targets = { path = "../../apps/targets" }
raea-app-game = { path = "../../apps/game" }
raea-app-play = { path = "../../apps/play", features = ["ml"] }
raea-bevy-plugins = { path = "../../engine/bevy-plugins", optional = true }
diff --git a/engine/cli/src/cli.rs b/engine/cli/src/cli.rs
index a92bf56b..e4c22a44 100644
--- a/engine/cli/src/cli.rs
+++ b/engine/cli/src/cli.rs
@@ -19,6 +19,21 @@ pub fn cli(args: &[String]) -> i32 {
if html || matches!(args.first().map(String::as_str), Some("media" | "ffmpeg" | "ffprobe" | "shots")) {
return raea_app_media::command(args);
}
+ // `app run|check|bundle APP.tsx` and `rune ...`: an app on the web or native target (apps/targets, docs/targets.feature)
+ if matches!(args.first().map(String::as_str), Some("app" | "rune")) {
+ return match raea_app_targets::command(args) {
+ Ok(m) => {
+ if !m.is_empty() {
+ println!("{m}");
+ }
+ 0
+ }
+ Err(e) => {
+ eprintln!("raea: {e}");
+ 1
+ }
+ };
+ }
raea_runtime_react::native::register();
raea_runtime_react::startup_mark("native calls registered");
if matches!(args.first().map(String::as_str), Some("run" | "test" | "types")) {
@@ -107,7 +122,7 @@ pub fn run(args: &[String]) -> R<String> {
// `raea library` (engine/cli/src/library.ts), listed under render's usage
let usage = format!("{usage}\n raea library [new NAME [--cloud] | add LIBRARY PATH | files LIBRARY | tag SHA TAGS | status | scan ...] | raea library search \"WORDS\" [--library LIBRARY] [--kind KIND] [--limit N] [--sound] (the person's libraries in the raea app: folders and drives indexed on this machine, searched by meaning; a folder an agent adds waits for the person's yes)");
// a workspace's files and specs (docs/projects.feature), listed under render's usage like library
- let usage = format!("{usage}\n raea spec FILE.ts [--as brief|script|taste|plan|controller] (a spec's default export as JSON, checked against its schema: brief.ts, script.ts, taste.ts, plan.ts, controllers/ID.ts)\n raea workspace init [NAME] [--layout LAYOUT] | raea workspace adopt DIR [--name NAME] | raea workspace [--json] (a workspace: a git repo of projects and controllers under raea.root, ~/Studio unless git config says)\n raea project new NAME [--storage inline|submodule] | raea project split NAME [--remote URL] | raea project join NAME | raea project [--json] (a project in the workspace: its folder, brief.ts, media/, out/; split and join keep its history)\n raea controller ls [--json] | raea controller get PATH [--json] | raea controller set PATH VALUE [--project] [--by NAME] | raea controller write FILE.ts [--by NAME] | raea controller rm ID [--by NAME] (the workspace's controllers, controllers/ID.ts; PATH is controller.group.field; every change a commit)\n raea check EDIT.tsx --quick [--shape S] [--platform P] [--taste T] [-o check.json] (three stills of a composition checked for text: clipped, cramped, safe areas, sizes; about a second)\n raea hook claude (Claude Code's PostToolUse hook: the quick check after a composition is saved)\n raea next [DIR] (the two or three useful next steps for the project, from its brief, compositions, renders and checks)\n raea doctor [--fix] [DIR] (what doesn't match this raea: old brief files, an older workspace format, an agent's skill from another version)\n {}\n {}", skill::USAGE, tools::blender::USAGE);
+ let usage = format!("{usage}\n raea spec FILE.ts [--as brief|script|taste|plan|controller] (a spec's default export as JSON, checked against its schema: brief.ts, script.ts, taste.ts, plan.ts, controllers/ID.ts)\n raea workspace init [NAME] [--layout LAYOUT] | raea workspace adopt DIR [--name NAME] | raea workspace [--json] (a workspace: a git repo of projects and controllers under raea.root, ~/Studio unless git config says)\n raea project new NAME [--storage inline|submodule] | raea project split NAME [--remote URL] | raea project join NAME | raea project [--json] (a project in the workspace: its folder, brief.ts, media/, out/; split and join keep its history)\n raea controller ls [--json] | raea controller get PATH [--json] | raea controller set PATH VALUE [--project] [--by NAME] | raea controller write FILE.ts [--by NAME] | raea controller rm ID [--by NAME] (the workspace's controllers, controllers/ID.ts; PATH is controller.group.field; every change a commit)\n raea check EDIT.tsx --quick [--shape S] [--platform P] [--taste T] [-o check.json] (three stills of a composition checked for text: clipped, cramped, safe areas, sizes; about a second)\n raea hook claude (Claude Code's PostToolUse hook: the quick check after a composition is saved)\n raea next [DIR] (the two or three useful next steps for the project, from its brief, compositions, renders and checks)\n raea doctor [--fix] [DIR] (what doesn't match this raea: old brief files, an older workspace format, an agent's skill from another version)\n raea app run|check|bundle APP.tsx [--target web|native] [--size WxH] [--script steps.json] [--png DIR] [-o App.app] (a TSX app on @raea/ui: its window, the headless check, a Mac app; web is Blitz on Bevy, native is Rune; the app's `export const app` sets the target, web when it doesn't; raea rune ... is --target native)\n {}\n {}", skill::USAGE, tools::blender::USAGE);
let (export_game, scene, physics, splat) = (raea_app_game::USAGE, export::SCENE_USAGE, motion::physics::USAGE, tools::splat::USAGE);
let apps = format!(" {}\n", raea_app_check::USAGE);
return Ok(format!("raea: renders, plays and checks raea compositions (React and TypeScript) on the GPU.\n\nusage: {usage}\n raea init (a project's files where they're missing: edit.tsx, cuts.ts, components/, AGENTS.md)\n raea cut TAKE \"line\" ... | --at A-B ... [--append] (cuts.ts and words.json: a take under media/ cut in the pauses around each line it says, transcribed first if it has no TAKE.words.json; or at those seconds)\n raea frame TAKE [--at S] (how a take fits the edit: a talking take for <FaceFrame>, a screen for <ScreenFit>, from where its face is)\n raea part list | raea part add NAME ... [--force] (a ready part copied into components/, yours to change)\n raea brand DOMAIN|URL (the brand kit read from its website on this machine: brand/brand.css, brand/brand.json, BRAND.md, logos in media/brand; says when a plain fetch saw too little)\n raea guide [NAME] (craft, the floor read before any edit; the modes: pitch, explain, story, play, tool; motion, music, layout and the rest; bevy and bevy/NAME for 3D)\n raea context PROJECT (what to read before working on a project: taste, brief, look, the floor and its modes' guides)\n{apps} raea play EDIT.tsx [--input | --input-script KEYS.json] [--size WxH] [--seconds N|end] (a game, live; also: --input-log FILE --offscreen --snapshot T FILE --json FILE --seek F FILE --scrub N --baked --autoplay --no-vsync --master --3d)\n {export_game} (a game as a program of its own: a Mac app or a command)\n {scene} (what each 3D part rests on: floating, sunk and clipping parts; light: the scene's lighting)\n {physics} (the bakes <Physics> and <Goo> make)\n {splat} (footage trained into a Gaussian splat for <Splat>; setup installs its tools)\n raea run SCRIPT.ts (a TypeScript program on the engine, headless: its default export is called, what it prints is the answer; a check like a room's checkLayout; also: --timeout S)\n raea gen image|video|music|sfx|speech|mesh|text \"PROMPT\" | gen plan|run FLOW.ts|FLOW.json | gen comfy import|export|run|schema FILE | gen models | gen balance (generated media through made.app, fal, Replicate, OpenRouter, Modal or ComfyUI; ComfyUI workflows both ways: raea gen alone lists its flags)\n {neural_usage} (DLSS 5 neural rendering on a `render --aov` folder, with its motion and depth: your own MLX-DLSS build and weights, RAEA_MLXDLSS and RAEA_DLSS_MODEL)\n raea mezz [--check] PATH... (an intra-only ProRes copy of each long-GOP source over 1080p, for smooth scrubbing; --check says which would get one)\n raea traces [show [N|last|DIR]] (the sessions raea left, newest first: how each ended, its glitches; show tells one in full)"));
@@ -332,3 +347,4 @@ pub fn run(args: &[String]) -> R<String> {
}
raea_runtime_export::render(args)
}
+
diff --git a/engine/page/host/Cargo.toml b/engine/page/host/Cargo.toml
index 2896134f..acd5fcd4 100644
--- a/engine/page/host/Cargo.toml
+++ b/engine/page/host/Cargo.toml
@@ -31,6 +31,8 @@ raea-page = { path = ".." }
# the desktop window: --chrome and the native calls (clipboard, links, notifications, the dock badge, raea:// links)
raea-page-window = { path = "../window" }
raea-sys-page = { path = "../../../systems/page" }
+# headless, the system calls are scripted (docs/targets.feature T2d)
+raea-io-os = { path = "../../../io/os" }
raea-sys-fonts = { path = "../../../systems/fonts" }
raea-runtime-dom = { path = "../../../runtime/dom" }
raea-runtime-input = { path = "../../../runtime/input" }
@@ -53,3 +55,8 @@ base64 = "0.22"
# raea-io-media is here for its feature (the platform decoders raea-page and raea-runtime-js use), not called directly
[package.metadata.cargo-shear]
ignored = ["raea-io-media"]
+
+[dev-dependencies]
+# T2b and T2d: the recorded net and system calls (tests/net_calls.rs)
+raea-io-net-calls = { path = "../../../io/net/calls", features = ["serve"] }
+raea-io-os = { path = "../../../io/os", features = ["recorded"] }
diff --git a/engine/page/host/src/brp.rs b/engine/page/host/src/brp.rs
index 047d6bdd..4597d49b 100644
--- a/engine/page/host/src/brp.rs
+++ b/engine/page/host/src/brp.rs
@@ -63,6 +63,19 @@ pub fn methods(r: RemotePlugin, prefix: &str) -> RemotePlugin {
.with_method_main(format!("{prefix}.state"), state)
.with_method_main(format!("{prefix}.actions"), actions)
.with_watching_method_main(format!("{prefix}.action+watch"), action)
+ .with_method_main(format!("{prefix}.os"), os)
+}
+
+/// A check's step for the next pick, save or dialog (`{"pick": [file]}`, `{"save": file}`, `{"dialog": index}`,
+/// docs/targets.feature T2d), queued in raea-io-os; with no params, what os.open was asked for while headless.
+pub fn os(In(p): In<Option<Value>>) -> BrpResult {
+ match p {
+ Some(s) => {
+ raea_io_os::script(raea_io_os::step(&s).ok_or_else(|| internal(format!("{s} is none of pick, save, dialog")))?);
+ Ok(Value::Null)
+ }
+ None => Ok(serde_json::json!(raea_io_os::opened())),
+ }
}
/// The plugins on `port`, the host's methods under `page.` (an app adds its own to `r` first: `with`).
diff --git a/engine/page/host/src/main.rs b/engine/page/host/src/main.rs
index 61962cda..6feeea91 100644
--- a/engine/page/host/src/main.rs
+++ b/engine/page/host/src/main.rs
@@ -62,6 +62,10 @@ fn main() {
eprintln!("raea-page-host: {e}");
std::process::exit(2);
});
+ // headless (the benches, raea app check): the system's clipboard, files, dialogs and browser stay untouched (T2d)
+ if !a.window {
+ raea_io_os::set_headless();
+ }
let code = std::fs::read_to_string(&a.bundle).unwrap_or_else(|e| {
eprintln!("raea-page-host: {}: {e}", a.bundle);
std::process::exit(1);
diff --git a/engine/page/host/tests/net_calls.rs b/engine/page/host/tests/net_calls.rs
new file mode 100644
index 00000000..a8b0f894
--- /dev/null
+++ b/engine/page/host/tests/net_calls.rs
@@ -0,0 +1,49 @@
+//! T2b and T2d (docs/targets.feature): the page host answers io/net/calls' recorded calls (a fetch, storage set and
+//! get, a socket's open, send and close) and io/os's (os.open, the clipboard, files picked and saved, dialogs;
+//! headless, the answers queued) with the recorded answers, as engine/rune's tests/net.rs checks the native host does.
+use std::time::{Duration, Instant};
+
+use bevy::prelude::*;
+use raea_io_net_calls::serve;
+use raea_io_os::recorded;
+use raea_runtime_dom::host::{self, HostStepPlugin, PageAsks};
+use raea_sys_page::{Docs, PageClock, PageSystems};
+
+/// `script` mounted on a page of its own and stepped until it emits its record.
+fn record(script: &str) -> String {
+ let mut app = App::new();
+ app.add_plugins((MinimalPlugins, HostStepPlugin))
+ .init_non_send::<Docs>()
+ .init_resource::<PageClock>()
+ .add_systems(PostUpdate, raea_sys_page::resolve.in_set(PageSystems::Restyle));
+ host::mount(app.world_mut(), 320, 240, script, &[], None).unwrap();
+ let until = Instant::now() + Duration::from_secs(20);
+ loop {
+ // an emit's payload is its JSON, read: the record itself
+ if let Some((_, _, v)) = app.world().resource::<PageAsks>().0.iter().find(|(_, n, _)| n == "recorded") {
+ break v.to_string();
+ }
+ assert!(Instant::now() < until, "no record after 20 s");
+ // the answers come from the calls' threads: a step delivers whatever has arrived
+ std::thread::sleep(Duration::from_millis(5));
+ app.update();
+ }
+}
+
+// one test: the storage folder and headless mode are the process's
+#[test]
+fn the_recorded_calls_get_the_recorded_answers() {
+ let dir = std::env::temp_dir().join(format!("raea-page-calls-{}", std::process::id()));
+ // SAFETY: this test binary's only test, set before any thread reads it
+ unsafe { std::env::set_var("BEVY_TSX_STORAGE", dir.join("storage")) };
+ let servers = serve::serve();
+ let net = record(&servers.script());
+ if let Err(e) = servers.check(&net) {
+ panic!("net: {e}\nrecorded: {}", net.replace(&servers.http, "HTTP").replace(&servers.ws, "WS"));
+ }
+ let os = recorded::setup(dir.join("files"));
+ let got = record(os.script());
+ let checked = os.check(&got);
+ let _ = std::fs::remove_dir_all(&dir);
+ checked.unwrap_or_else(|e| panic!("os: {e}\nrecorded: {got}"));
+}
diff --git a/engine/render/Cargo.toml b/engine/render/Cargo.toml
index 9603ebdd..30818104 100644
--- a/engine/render/Cargo.toml
+++ b/engine/render/Cargo.toml
@@ -37,6 +37,7 @@ raea-sys-material = { path = "../../systems/material" }
raea-sys-framepass = { path = "../../systems/framepass" }
raea-sys-compute = { path = "../../systems/compute" }
raea-sys-sampler = { path = "../../systems/sampler" }
+raea-sys-parity = { path = "../../systems/parity" }
raea-sys-shader = { path = "../../systems/shader" }
raea-sys-post = { path = "../../systems/post" }
raea-sys-fog = { path = "../../systems/fog" }
diff --git a/engine/render/src/engine/raea_plugins.rs b/engine/render/src/engine/raea_plugins.rs
index f37e3308..d3f16a8d 100644
--- a/engine/render/src/engine/raea_plugins.rs
+++ b/engine/render/src/engine/raea_plugins.rs
@@ -67,6 +67,7 @@ raea_plugin! {
FramePassPlugin: raea_sys_framepass::install, "Full-screen passes written in TypeScript (raea-sys-framepass).";
ComputePlugin: raea_sys_compute::install, "Compute shaders written in TypeScript, run before the cameras draw (raea-sys-compute).";
LensPlugin: super::lens::install, "The camera's lens (Fisheye, LensDistortion), after tone mapping (lens.rs).";
+ ParityPlugin: raea_sys_parity::install, "The parity probe: a frame's cost and World, written when RAEA_PARITY is set (raea-sys-parity, docs/control.feature FC0a).";
MotionBlurPlugin: super::motion_blur::install, "Motion blur's frame counter pinned to the frame (motion_blur.rs).";
}
@@ -104,6 +105,8 @@ pub fn scene3d_systems() -> ScheduleConfigs<ScheduleSystem> {
// 2D over the 3D: its camera once there's a part, then each part's place, cell and colour (raea-sys-sprite)
(super::sprite2d::camera_2d, super::sprite2d::sync_2d).chain(),
super::scene3d::model_setup,
+ super::scene3d::instance_models,
+ super::scene3d::model_shadow_markers,
super::scene3d::toon_models,
((super::scene3d::sync_meshes, super::scene3d::sync_pictures, super::shader_ext::sync_shaded, raea_sys_sampler::arrays::sync_arrays, raea_sys_sampler::sync_samplers).chain(), super::toon::sync_toon, super::scene3d::sync_camera, super::motion_blur::sync_motion_blur, super::environment::sync_environment, super::scene3d::sync_lights, super::scene3d::sync_fog_volumes, super::scene3d::sync_fog_dither, super::scene3d::sync_models, super::scene3d::sync_morphs, super::scene3d::sync_attach, super::grid::grid_models, super::scene3d::sync_bones, super::look::sync_frame_look, super::look::sync_looks, super::compose::sync_passes, super::look::sync_flat, super::paint::sync_paint, super::decal::sync_decals, super::text3d::sync_texts).chain(),
)
diff --git a/engine/render/src/engine/spawn.rs b/engine/render/src/engine/spawn.rs
index 1cdfd24d..23c1cbf1 100644
--- a/engine/render/src/engine/spawn.rs
+++ b/engine/render/src/engine/spawn.rs
@@ -207,50 +207,60 @@ pub(crate) fn spawn_3d(world: &mut World, e: Entity, t: &Tup, inserted: &[Tup],
"plate" => matchmove::spawn_plate(world, e, t, inserted, dir)?,
"cube" | "sphere" | "plane" => {
let size = g("size", 1.0);
- let mesh = match t.kind.as_str() {
- "cube" => Mesh::from(Cuboid::from_length(size)),
- "sphere" => Mesh::from(Sphere::new(size / 2.0).mesh().ico(5).unwrap()),
- _ => Mesh::from(Plane3d::default().mesh().size(size, size)),
- };
- let mesh = world.resource_mut::<Assets<Mesh>>().add(mesh);
- let mat = world.resource_mut::<Assets<StandardMaterial>>().add(StandardMaterial {
+ // shared as a mesh row's are (share.rs): one Mesh per kind and size, one material per value
+ let mesh = scene3d::shared_mesh(world, &format!("{}\0{size}", t.kind), || {
+ Ok(match t.kind.as_str() {
+ "cube" => Mesh::from(Cuboid::from_length(size)),
+ "sphere" => Mesh::from(Sphere::new(size / 2.0).mesh().ico(5).unwrap()),
+ _ => Mesh::from(Plane3d::default().mesh().size(size, size)),
+ })
+ })?;
+ let (mat, shared) = scene3d::shared_material(world, StandardMaterial {
base_color: colour(vals.get("color"), [0.8, 0.8, 0.8, 1.0]),
perceptual_roughness: g("rough", 0.45),
metallic: g("metal", 0.0),
..default()
});
world.entity_mut(e).insert((Mesh3d(mesh), MeshMaterial3d(mat), Transform::from_xyz(g("x", 0.0), g("y", 0.0), g("z", 0.0))));
+ if shared {
+ world.entity_mut(e).insert(scene3d::SharedMaterial);
+ }
}
"mesh" => {
// a shape as a value (docs/media.feature M2): its `shape` column, a CSG expression, built by Manifold
// once per expression (shape::cached), flat-shaded
let expr = match vals.get("shape") { Some(V::S(s)) => s.clone(), _ => return Err(format!("mesh {}: needs shape, as box(1, 1, 1) or minus(rounded_box(2, 1, 0.2, 0.1), text3d(\"SALE\", 0.45, 0.3))", t.id)) };
- // or its own vertex buffers (<BufferMesh>: "buffer:{positions, indices, normals, uvs}")
- let (tris, own_uvs, own_colors) = match expr.strip_prefix("buffer:") {
- Some(b) => {
- let c = scene3d::buffer_colors(b).map_err(|e| format!("mesh {}: {e}", t.id))?;
- let (t, u) = scene3d::buffer_tris(b).map_err(|e| format!("mesh {}: {e}", t.id))?;
- (std::sync::Arc::new(t), u, c)
- }
- None => (raea_core_shape::cached(&expr).map_err(|e| format!("mesh {}: {e}", t.id))?, None, None),
- };
- let mut m = Mesh::new(bevy::render::render_resource::PrimitiveTopology::TriangleList, bevy::asset::RenderAssetUsages::default());
- m.insert_attribute(Mesh::ATTRIBUTE_POSITION, tris.positions.clone());
- m.insert_attribute(Mesh::ATTRIBUTE_NORMAL, tris.normals.clone());
- // a <BufferMesh colors>: per-vertex colours, which StandardMaterial multiplies its colour by
- if let Some(c) = own_colors {
- m.insert_attribute(Mesh::ATTRIBUTE_COLOR, c);
- }
// a picture map needs texture coordinates, which Manifold doesn't make (scene3d); a normal map needs
// tangents too, made from them (mikktspace); so does a grid's outline (grid.rs)
let grid = grid::grid_of(vals);
- if own_uvs.is_some() || scene3d::has_maps(vals) || grid.is_some() {
- m.insert_attribute(Mesh::ATTRIBUTE_UV_0, own_uvs.unwrap_or_else(|| scene3d::box_uvs(&tris.positions, &tris.normals)));
- if vals.get("normal_map").is_some_and(V::truthy) {
- m.generate_tangents().map_err(|e| format!("mesh {}: normalMap: its tangents: {e}", t.id))?;
+ let uvs = scene3d::has_maps(vals) || grid.is_some();
+ let tangents = vals.get("normal_map").is_some_and(V::truthy);
+ // made once per shape and what it's given (share.rs): equal parts hold one Mesh, so Bevy batches them
+ let mesh = scene3d::shared_mesh(world, &format!("{expr}\0{uvs}\0{tangents}"), || {
+ // or its own vertex buffers (<BufferMesh>: "buffer:{positions, indices, normals, uvs}")
+ let (tris, own_uvs, own_colors) = match expr.strip_prefix("buffer:") {
+ Some(b) => {
+ let c = scene3d::buffer_colors(b).map_err(|e| format!("mesh {}: {e}", t.id))?;
+ let (t, u) = scene3d::buffer_tris(b).map_err(|e| format!("mesh {}: {e}", t.id))?;
+ (std::sync::Arc::new(t), u, c)
+ }
+ None => (raea_core_shape::cached(&expr).map_err(|e| format!("mesh {}: {e}", t.id))?, None, None),
+ };
+ let mut m = Mesh::new(bevy::render::render_resource::PrimitiveTopology::TriangleList, bevy::asset::RenderAssetUsages::default());
+ m.insert_attribute(Mesh::ATTRIBUTE_POSITION, tris.positions.clone());
+ m.insert_attribute(Mesh::ATTRIBUTE_NORMAL, tris.normals.clone());
+ // a <BufferMesh colors>: per-vertex colours, which StandardMaterial multiplies its colour by
+ if let Some(c) = own_colors {
+ m.insert_attribute(Mesh::ATTRIBUTE_COLOR, c);
}
- }
- let mesh = world.resource_mut::<Assets<Mesh>>().add(m);
+ if own_uvs.is_some() || uvs {
+ m.insert_attribute(Mesh::ATTRIBUTE_UV_0, own_uvs.unwrap_or_else(|| scene3d::box_uvs(&tris.positions, &tris.normals)));
+ if tangents {
+ m.generate_tangents().map_err(|e| format!("mesh {}: normalMap: its tangents: {e}", t.id))?;
+ }
+ }
+ Ok(m)
+ })?;
// the surface (emissive, opacity, unlit, clearcoat, a picture map...) and transform: scene3d
let mat = scene3d::material(world, t, inserted, dir)?;
// rot_x/y/z in radians and scale (or scale_x/y/z), as sync_meshes moves every mesh frame by frame
@@ -267,6 +277,14 @@ pub(crate) fn spawn_3d(world: &mut World, e: Entity, t: &Tup, inserted: &[Tup],
} else if let Some(extension) = raea_sys_wear::of(vals) {
// worn paint (systems/wear): chipped edges, grime and rust, fixed in the part's own space
grid::put(world, e, mesh, raea_sys_wear::WearMaterial { base: mat, extension }, vals);
+ } else if vals.get("shader").is_none() && !vals.contains_key("opacity") {
+ // a plain surface: one material per value, shared by the parts that have it (share.rs; a see-through
+ // one keeps its own, as froxel_glass copies it per standard material)
+ let (mat, shared) = scene3d::shared_material(world, mat);
+ world.entity_mut(e).insert((Mesh3d(mesh), MeshMaterial3d(mat), transform_of(vals)));
+ if shared {
+ world.entity_mut(e).insert(scene3d::SharedMaterial);
+ }
} else {
grid::put(world, e, mesh, mat, vals);
// a shader over the lit surface (shader_ext.rs): put on once the rows are applied (scene3d's shade_rows)
@@ -284,6 +302,8 @@ pub(crate) fn spawn_3d(world: &mut World, e: Entity, t: &Tup, inserted: &[Tup],
world.entity_mut(e).insert(bevy::light::NotShadowReceiver);
}
layers(world, e, vals);
+ // <Instances>: its mesh and material on one child a copy (scene3d's instance.rs)
+ scene3d::instance_mesh(world, e, t)?;
}
// 2D over the 3D (<Sprite>, <Shape2D>): raea-sys-sprite; a sprite's picture found and decoded as a panel's
"sprite" => {
diff --git a/engine/rune/Cargo.toml b/engine/rune/Cargo.toml
new file mode 100644
index 00000000..611482d2
--- /dev/null
+++ b/engine/rune/Cargo.toml
@@ -0,0 +1,31 @@
+[package]
+name = "raea-rune-host"
+version = "0.1.0"
+edition = "2024"
+license = "FSL-1.1-ALv2"
+publish = false
+description = "The native target's host (docs/targets.feature): raea's op wire drawn by Rune, in a native window, headless for the check, or as a Mac app"
+
+[dependencies]
+rune.workspace = true
+raea-core-wire = { path = "../../core/wire" }
+# the net.* host calls, answered as the web target answers them (docs/targets.feature T2a)
+raea-io-net-calls = { path = "../../io/net/calls" }
+# os.open, the clipboard, files and dialogs, answered as the web target answers them (docs/targets.feature T2d)
+raea-io-os = { path = "../../io/os" }
+raea-runtime-jsengine = { path = "../../runtime/jsengine" }
+raea-rune-page = { path = "page" }
+serde = { version = "1", features = ["derive"] }
+serde_json = "1"
+png = "0.18"
+
+[features]
+# QuickJS beside JavaScriptCore on a Mac (BEVY_TSX_ENGINE=quickjs picks it): the portable engine tested here
+portable = ["raea-runtime-jsengine/portable"]
+
+[dev-dependencies]
+# the tests bundle their apps as raea does (runtime/bundle/lib app.rs), with nothing of Bevy in their tree
+raea-runtime-bundle-lib = { path = "../../runtime/bundle/lib" }
+# T2b and T2d: the recorded net and system calls (tests/net.rs)
+raea-io-net-calls = { path = "../../io/net/calls", features = ["serve"] }
+raea-io-os = { path = "../../io/os", features = ["recorded"] }
diff --git a/engine/rune/page/Cargo.toml b/engine/rune/page/Cargo.toml
new file mode 100644
index 00000000..2ba2849c
--- /dev/null
+++ b/engine/rune/page/Cargo.toml
@@ -0,0 +1,15 @@
+[package]
+name = "raea-rune-page"
+version = "0.1.0"
+edition = "2024"
+license = "FSL-1.1-ALv2"
+publish = false
+description = "The native target's page (docs/targets.feature): raea's op wire kept as a tree, drawn as Rune elements, with input and events back to the app"
+
+[dependencies]
+rune.workspace = true
+rune-kit.workspace = true
+raea-core-wire = { path = "../../../core/wire" }
+raea-rune-style = { path = "../style" }
+serde_json = "1"
+base64 = "0.22"
diff --git a/engine/rune/page/src/dump.rs b/engine/rune/page/src/dump.rs
new file mode 100644
index 00000000..8e2b25bd
--- /dev/null
+++ b/engine/rune/page/src/dump.rs
@@ -0,0 +1,61 @@
+//! The element tree as an agent checks it (R4b): each wire element Rune drew, with its wire id, Rune key, role,
+//! label, text and box, in paint order.
+
+use serde_json::{Value, json};
+
+use crate::session::Session;
+
+/// The tree after the last frame.
+pub fn tree(s: &Session) -> Value {
+ let els = s.rt.elements();
+ let ids: Vec<Option<u64>> = els.iter().map(|e| e.key.as_deref().and_then(|k| k.strip_prefix('w')).and_then(|k| k.parse().ok())).collect();
+ let mut out = Vec::new();
+ for (i, e) in els.iter().enumerate() {
+ let Some(id) = ids[i] else { continue };
+ if e.exiting {
+ continue;
+ }
+ let n = s.rt.state.tree.get(id);
+ // the text under it: its own text elements' strings, as Rune drew them
+ let text: String = els.iter().enumerate().filter(|(j, k)| ids[*j].is_none() && nearest(&els, &ids, *j) == Some(i) && k.text.is_some()).filter_map(|(_, k)| k.text.clone()).collect::<Vec<_>>().join(" ");
+ let mut v = json!({"id": id, "key": e.key, "kind": n.map(|n| n.kind.clone()), "rect": crate::session::shown(e).map(|x| (x * 100.0).round() / 100.0)});
+ if !e.role.is_empty() {
+ v["role"] = json!(e.role);
+ }
+ if let Some(l) = &e.label {
+ v["label"] = json!(l);
+ }
+ if let Some(t) = n.and_then(|n| n.props.get("data-testid")) {
+ v["testid"] = t.clone();
+ }
+ if !text.is_empty() {
+ v["text"] = json!(text);
+ }
+ if e.focused {
+ v["focused"] = json!(true);
+ }
+ // where a transform (an offset, a scale, a turn) drew it, when that isn't its box: Rune's drawn rect, scaled and
+ // turned, and its scale (T3c)
+ if (0..4).any(|k| (e.rect[k] - e.target[k]).abs() > 0.005) {
+ v["drawn"] = json!(e.rect.map(|x| (f64::from(x) * 100.0).round() / 100.0));
+ v["scale"] = json!((f64::from(e.scale) * 1000.0).round() / 1000.0);
+ }
+ if e.opacity < 0.999 {
+ v["opacity"] = json!((f64::from(e.opacity) * 1000.0).round() / 1000.0);
+ }
+ out.push(v);
+ }
+ Value::Array(out)
+}
+
+/// The nearest keyed element up from element `i` (its parent chain in Rune's elements).
+fn nearest(els: &[rune::ElementInfo], ids: &[Option<u64>], i: usize) -> Option<usize> {
+ let mut at = els[i].parent;
+ while let Some(j) = at {
+ if ids[j].is_some() {
+ return Some(j);
+ }
+ at = els[j].parent;
+ }
+ None
+}
diff --git a/engine/rune/page/src/events.rs b/engine/rune/page/src/events.rs
new file mode 100644
index 00000000..6f8741ff
--- /dev/null
+++ b/engine/rune/page/src/events.rs
@@ -0,0 +1,154 @@
+//! Rune's input back over the wire (R3a): each wire element gets Rune handlers only for the events it listens for,
+//! so Rune's hit test hands a gesture to the nearest element that listens, as raea's other host does
+//! (runtime/dom/src/host/bridge.rs). A handler queues `{t: "event", id, event, payload}` on the page's outbox with the
+//! same payload that host sends: for pointers, where in the element as fractions of its size, the client point, the
+//! button, the press count and the modifiers. Text fields are Rune text inputs whose edits go back as `change` with the
+//! whole value, one per edit, as the other host sends them.
+
+use raea_core_wire::{Ev, event};
+use rune::{Drag, El, Mods, Phase, PointerEvent, Tx, WheelEvent};
+use serde_json::{Value, json};
+
+use crate::page::{Out, Page};
+use crate::tree::Node;
+
+/// `e` with the handlers for what element `id` (`n`) listens for.
+pub fn attach(mut e: El, id: u64, n: &Node, root: bool) -> El {
+ let hears = |ev: Ev| n.on.contains(&ev);
+ // A press is also the page's (input.rs): the open menu's close before it, the focus and a menu item's select after
+ // it. So a focusable element or menu item gets the handler even when it doesn't listen, passing the press to its
+ // nearest listener up, and the root takes a press on nothing. Fields are left to Rune's text input (their focus
+ // follows Rune's: Page::follow_field_focus).
+ let field = n.kind == "editableText";
+ let presses = hears(Ev::PointerDown) || hears(Ev::PointerUp) || root || (!field && (crate::input::focusable(n) || n.props.get("role").and_then(Value::as_str) == Some("menuitem")));
+ if presses {
+ e = e.on_drag(move |p: &mut Page, d: &mut Drag, tx: &mut Tx| {
+ let r = p.rect(id);
+ let (x, y) = (r[0] + d.x, r[1] + d.y);
+ match d.phase {
+ Phase::Down => {
+ p.press_began(x, y);
+ p.before_press(x, y);
+ p.send_up(id, Ev::PointerDown, x, y, d.clicks, Mods::default());
+ }
+ Phase::Up => {
+ p.press_ended();
+ p.send_up(id, Ev::PointerUp, x, y, d.clicks, Mods::default());
+ p.after_press(x, y, tx);
+ }
+ Phase::Move => {}
+ }
+ });
+ }
+ if hears(Ev::PointerMove) {
+ e = e.on_pointer_move_local(move |p: &mut Page, m: PointerEvent, _: &mut Tx| at(p, id, Ev::PointerMove, &m, 0, 0));
+ }
+ // a `hover:` class is restyled by Rune's own hover (state.rs), whether or not the element listens
+ let styled = crate::state::has_variant(n, "hover");
+ let listens = hears(Ev::PointerEnter) || hears(Ev::PointerLeave);
+ if listens || styled {
+ e = e.on_hover_change(move |p: &mut Page, inside: bool, _: &mut Tx| {
+ if styled {
+ if inside {
+ p.hovered.insert(id);
+ } else {
+ p.hovered.remove(&id);
+ }
+ }
+ if !listens {
+ return;
+ }
+ let ev = if inside { Ev::PointerEnter } else { Ev::PointerLeave };
+ let (x, y) = p.pointer;
+ let r = p.rect(id);
+ let payload = pointer(p, id, x - r[0], y - r[1], 0, 0, Mods::default());
+ p.send(id, ev, payload);
+ });
+ }
+ if hears(Ev::ContextMenu) {
+ e = e.on_secondary_press_local(move |p: &mut Page, m: PointerEvent, _: &mut Tx| at(p, id, Ev::ContextMenu, &m, 2, 1));
+ }
+ if hears(Ev::Wheel) {
+ e = e.on_wheel(move |p: &mut Page, w: WheelEvent, _: &mut Tx| {
+ let mut payload = pointer(p, id, w.x, w.y, 0, 0, w.mods);
+ // the wire's deltas are DOM's: positive scrolls content up and left, the opposite of Rune's
+ payload["deltaX"] = json!(-w.dx);
+ payload["deltaY"] = json!(-w.dy);
+ payload["deltaMode"] = json!(0);
+ p.send(id, Ev::Wheel, payload);
+ false
+ });
+ }
+ // keys, focus and blur, scroll, and menus' select and close are the page's (input.rs): they follow its focus and
+ // scroll offsets, not a Rune element's handlers
+ e
+}
+
+/// A text field: Rune's text input over the page's edit for element `id`, its edits going back as `change`.
+pub fn field(id: u64, edit: &rune::TextEdit, style: rune::TextStyle, color: rune::Color, placeholder: &str) -> El {
+ rune::text_input(edit, style)
+ .color(color)
+ .single_line()
+ .placeholder(placeholder, color.alpha(color.a * 0.5))
+ .on_edit(move |p: &mut Page| p.edit_mut(id))
+ .on_input_change(move |p: &mut Page, _: &mut Tx| {
+ let v = p.edit_mut(id).text.clone();
+ p.send(id, Ev::Change, json!(v));
+ })
+}
+
+/// A pointer payload for element `id` at `(lx, ly)` in its own points.
+/// A pointer event at a point local to the element, sent as `ev` with `button` and `detail`
+fn at(p: &mut Page, id: u64, ev: Ev, m: &PointerEvent, button: u8, detail: u32) {
+ let payload = pointer(p, id, m.x, m.y, button, detail, Mods::default());
+ p.send(id, ev, payload);
+}
+
+fn pointer(p: &Page, id: u64, lx: f32, ly: f32, button: u8, detail: u32, m: Mods) -> Value {
+ let r = p.rect(id);
+ let (cx, cy) = (r[0] + lx, r[1] + ly);
+ json!({"x": lx / r[2].max(1.0), "y": ly / r[3].max(1.0), "clientX": cx, "clientY": cy, "button": button, "detail": detail,
+ "shiftKey": m.shift, "ctrlKey": m.ctrl, "altKey": m.alt, "metaKey": m.logo})
+}
+
+/// A key's payload: DOM's `key` name and the modifiers.
+pub fn key_payload(k: &rune::KeyEvent) -> Value {
+ use rune::Key;
+ let name = match &k.key {
+ Key::Text(t) => t.clone(),
+ Key::Enter => "Enter".into(),
+ Key::Backspace => "Backspace".into(),
+ Key::Delete => "Delete".into(),
+ Key::Left => "ArrowLeft".into(),
+ Key::Right => "ArrowRight".into(),
+ Key::Up => "ArrowUp".into(),
+ Key::Down => "ArrowDown".into(),
+ Key::Home => "Home".into(),
+ Key::End => "End".into(),
+ Key::PageUp => "PageUp".into(),
+ Key::PageDown => "PageDown".into(),
+ Key::Escape => "Escape".into(),
+ Key::Tab => "Tab".into(),
+ other => format!("{other:?}"),
+ };
+ let m = k.mods;
+ json!({"key": name, "shiftKey": m.shift, "ctrlKey": m.ctrl, "altKey": m.alt, "metaKey": m.logo})
+}
+
+impl Page {
+ /// A press's `ev` at window point `(x, y)` for the nearest element up from `id` that listens, where in it.
+ fn send_up(&mut self, id: u64, ev: Ev, x: f32, y: f32, clicks: u32, m: Mods) {
+ if let Some(t) = self.up(Some(id), |n| n.on.contains(&ev)) {
+ let r = self.rect(t);
+ let payload = pointer(self, t, x - r[0], y - r[1], 0, clicks, m);
+ self.send(t, ev, payload);
+ }
+ }
+
+ /// `ev` for element `id`, queued for the JS, if it still listens.
+ pub fn send(&mut self, id: u64, ev: Ev, payload: Value) {
+ if self.tree.get(id).is_some_and(|n| n.on.contains(&ev)) {
+ self.outbox.push(Out::Deliver(event(id, ev, payload).to_string()));
+ }
+ }
+}
diff --git a/engine/rune/page/src/images.rs b/engine/rune/page/src/images.rs
new file mode 100644
index 00000000..886b4441
--- /dev/null
+++ b/engine/rune/page/src/images.rs
@@ -0,0 +1,55 @@
+//! `<img>` sources (R2a): a local file (a path or `file://`) or a `data:` URL, decoded by Rune's image cache on its
+//! worker threads, one load per source. Any other URL needs the host's media (R4) and is reported until then.
+
+use std::cell::RefCell;
+use std::collections::HashMap;
+use std::sync::Arc;
+
+use base64::Engine;
+use rune::image::{Image, ImageCache};
+
+pub struct Images {
+ cache: ImageCache,
+ by_src: RefCell<HashMap<String, Result<Image, String>>>,
+}
+
+impl Default for Images {
+ /// Images whose decodes wake nothing: a headless run draws them on its next frame.
+ fn default() -> Self {
+ Self::new(Arc::new(|| {}))
+ }
+}
+
+impl Images {
+ /// `waker` is the window's (AppSpec::setup's), so a decoded image redraws.
+ pub fn new(waker: rune::Waker) -> Self {
+ Images { cache: ImageCache::new(waker), by_src: RefCell::new(HashMap::new()) }
+ }
+
+ /// The image for `src`, or why there is none.
+ pub fn get(&self, src: &str) -> Result<Image, String> {
+ if let Some(r) = self.by_src.borrow().get(src) {
+ return r.clone();
+ }
+ let r = self.load(src);
+ self.by_src.borrow_mut().insert(src.to_string(), r.clone());
+ r
+ }
+
+ fn load(&self, src: &str) -> Result<Image, String> {
+ if let Some(data) = src.strip_prefix("data:") {
+ let (meta, body) = data.split_once(',').ok_or("a data URL without a comma")?;
+ if !meta.ends_with(";base64") {
+ return Err("only base64 data URLs are read".into());
+ }
+ let bytes = base64::engine::general_purpose::STANDARD.decode(body.trim()).map_err(|e| format!("its base64: {e}"))?;
+ return Ok(self.cache.load(bytes));
+ }
+ let path = src.strip_prefix("file://").unwrap_or(src);
+ if path.starts_with('/') {
+ let bytes = std::fs::read(path).map_err(|e| format!("{path}: {e}"))?;
+ return Ok(self.cache.load(bytes));
+ }
+ Err("a URL the host doesn't load yet (http, relative: the host's media, R4)".into())
+ }
+}
diff --git a/engine/rune/page/src/input.rs b/engine/rune/page/src/input.rs
new file mode 100644
index 00000000..4d478560
--- /dev/null
+++ b/engine/rune/page/src/input.rs
@@ -0,0 +1,213 @@
+//! What raea's other host makes of input beyond Rune's handlers (runtime/dom/src/host/bridge.rs), kept by the page
+//! (R3a) so the headless session and a window (R7a) do the same: the focus (a press moves it to the nearest focusable
+//! element up from its target, `focus` and `blur` go to the elements that listen, and a ref's `focus()` and `blur()`
+//! arrive as emits), keys sent to the focused element when it listens and as the host's own `keydown`/`keyup`
+//! otherwise, menus (a click, Enter or Space on a menu item is its `select`; Escape, or a press outside the open menu,
+//! is the menu's `close`), and `scroll` when an element's scroll offset moved. Presses come through events.rs's
+//! handlers, so they run inside Rune's dispatch wherever Rune runs.
+
+use raea_core_wire::{Ev, named};
+use rune::Tx;
+use serde_json::{Value, json};
+
+use crate::page::{Out, Page};
+use crate::tree::Node;
+
+/// A scroll viewport's numbers after a frame: scroll left, top, width, height, client width, height.
+pub type Scroll = [f32; 6];
+
+impl Page {
+ /// The wire element on top at `(x, y)`: the last in paint order whose box held it after the last frame.
+ pub fn at(&self, x: f32, y: f32) -> Option<u64> {
+ self.order.iter().rev().copied().find(|id| {
+ let r = self.rect(*id);
+ x >= r[0] && y >= r[1] && x < r[0] + r[2] && y < r[1] + r[3]
+ })
+ }
+
+ /// The nearest element up from `id` (itself included) that `f` holds for.
+ pub fn up(&self, id: Option<u64>, f: impl Fn(&Node) -> bool) -> Option<u64> {
+ let mut at = id;
+ while let Some(i) = at {
+ let n = self.tree.get(i)?;
+ if f(n) {
+ return Some(i);
+ }
+ at = n.parent;
+ }
+ None
+ }
+
+ fn role_up(&self, id: Option<u64>, role: &str) -> Option<u64> {
+ self.up(id, |n| n.props.get("role").and_then(Value::as_str) == Some(role))
+ }
+
+ fn is_field(&self, id: u64) -> bool {
+ self.tree.get(id).is_some_and(|n| n.kind == "editableText")
+ }
+
+ /// The element with the page's focus.
+ pub fn focus(&self) -> Option<u64> {
+ self.focus
+ }
+
+ /// The text field Rune has focused, by wire id.
+ pub fn focused_field(&self) -> Option<u64> {
+ self.edits.iter().find(|(_, e)| e.focused).map(|(id, _)| *id)
+ }
+
+ /// Before a press at `(x, y)`: the open menu closes if the press is outside it.
+ pub(crate) fn before_press(&mut self, x: f32, y: f32) {
+ let menu = self.role_up(self.focus, "menu");
+ if let Some(m) = menu.filter(|_| self.role_up(self.at(x, y), "menu") != menu) {
+ self.send(m, Ev::Close, Value::Null);
+ }
+ }
+
+ /// After a press at `(x, y)`: the focus moves (Chrome focuses on the press), and a menu item is selected.
+ pub(crate) fn after_press(&mut self, x: f32, y: f32, tx: &mut Tx) {
+ let t = self.at(x, y);
+ let to = self.up(t, focusable);
+ self.focus_to(to, tx);
+ if let Some(item) = self.role_up(t, "menuitem") {
+ self.send(item, Ev::Select, Value::Null);
+ }
+ }
+
+ /// The focus to `to`: `blur` to the element that had it (its value and where the focus went), `focus` to `to`, and
+ /// Rune's own focus with it (a field focused, or the field that had it blurred).
+ pub fn focus_to(&mut self, to: Option<u64>, tx: &mut Tx) {
+ let from = self.focus;
+ if from == to {
+ return;
+ }
+ self.focus = to;
+ // Chrome's heuristic: a focus a key moved shows, and so does a text field's however it came
+ self.focus_visible = to.is_some_and(|t| self.keyed || self.is_field(t));
+ if let Some(f) = from {
+ let value = if self.is_field(f) { self.edit_mut(f).text.clone() } else { String::new() };
+ self.send(f, Ev::Blur, json!({"value": value, "related": to}));
+ }
+ match to {
+ Some(t) if self.is_field(t) => self.edit_mut(t).focused = true,
+ _ if self.focused_field().is_some() => tx.blur(),
+ _ => {}
+ }
+ if let Some(t) = to {
+ self.send(t, Ev::Focus, Value::Null);
+ }
+ }
+
+ /// Tab (Shift+Tab when `back`): the focus to the next (previous) element in the tree's order that is focusable,
+ /// shown and not taken out of the order by a negative tabIndex, as Chrome's sequential navigation goes; past the
+ /// last (first) it leaves the page. Whether the focus moved (Rune shouldn't then move its own).
+ pub fn tab(&mut self, back: bool, tx: &mut Tx) -> bool {
+ let mut order = Vec::new();
+ let mut stack = vec![crate::tree::ROOT];
+ while let Some(id) = stack.pop() {
+ let Some(n) = self.tree.get(id) else { continue };
+ let skip = n.props.get("tabIndex").and_then(Value::as_i64).is_some_and(|t| t < 0);
+ let r = self.rect(id);
+ if focusable(n) && !skip && self.rects.contains_key(&id) && r[2] > 0.0 && r[3] > 0.0 {
+ order.push(id);
+ }
+ stack.extend(n.children.iter().rev());
+ }
+ if back {
+ order.reverse();
+ }
+ let next = match self.focus.and_then(|f| order.iter().position(|o| *o == f)) {
+ Some(i) => order.get(i + 1).copied(),
+ None => order.first().copied(),
+ };
+ let moved = next != self.focus;
+ self.focus_to(next, tx);
+ moved
+ }
+
+ /// A field Rune focused itself (a press on it, Tab between fields) taken as the page's focus.
+ pub fn follow_field_focus(&mut self, tx: &mut Tx) {
+ if let Some(f) = self.focused_field().filter(|f| Some(*f) != self.focus) {
+ self.focus_to(Some(f), tx);
+ }
+ }
+
+ /// What the page asked of the host by `__ui_emit`: `ticks` (a `frame` host event every frame), a ref's `focus`
+ /// (by wire id or data-testid) and `blur`. Other names are the JS's own business.
+ pub fn emit(&mut self, name: &str, v: &Value, tx: &mut Tx) {
+ match name {
+ "ticks" => self.ticking = v.as_bool().unwrap_or(false),
+ "focus" => {
+ let id = v.as_u64().or_else(|| v.as_str().and_then(|t| self.tid(t)));
+ if id.is_some() {
+ self.focus_to(id, tx);
+ }
+ }
+ "blur" => self.focus_to(None, tx),
+ _ => {}
+ }
+ }
+
+ /// The element whose `data-testid` is `t`.
+ pub fn tid(&self, t: &str) -> Option<u64> {
+ self.tree.ids().find(|id| self.tree.get(*id).is_some_and(|n| n.props.get("data-testid").and_then(Value::as_str) == Some(t)))
+ }
+
+ /// A key's message: to the focused element if it listens (with a field's value), else the host's own; and a menu
+ /// item's `select` or the menu's `close` for Enter, Space and Escape. Whether Rune should still see the key.
+ pub fn key_out(&mut self, ev: Ev, mut payload: Value) -> bool {
+ let f = self.focus;
+ if ev == Ev::KeyDown {
+ // a key met by the focus where it is shows it from now on
+ self.keyed = true;
+ self.focus_visible |= f.is_some();
+ }
+ if let Some(id) = f.filter(|id| self.is_field(*id)) {
+ payload["value"] = json!(self.edit_mut(id).text.clone());
+ }
+ match f.filter(|id| self.tree.get(*id).is_some_and(|n| n.on.contains(&ev))) {
+ Some(id) => self.send(id, ev, payload.clone()),
+ None => self.outbox.push(Out::Deliver(named(if ev == Ev::KeyDown { "keydown" } else { "keyup" }, payload.clone()).to_string())),
+ }
+ if ev != Ev::KeyDown {
+ return true;
+ }
+ let k = payload["key"].as_str().unwrap_or("");
+ if matches!(k, "Enter" | " ")
+ && let Some(item) = self.role_up(f, "menuitem")
+ {
+ self.send(item, Ev::Select, Value::Null);
+ return false;
+ }
+ if k == "Escape"
+ && let Some(menu) = self.role_up(f, "menu")
+ {
+ self.send(menu, Ev::Close, Value::Null);
+ return false;
+ }
+ true
+ }
+
+ /// After a frame: `scroll` to each element whose scroll offset moved since the last.
+ pub(crate) fn scrolled(&mut self, now: Vec<(u64, Scroll)>) {
+ for (id, s) in now {
+ let before = self.scrolls.insert(id, [s[0], s[1]]);
+ if before.is_some_and(|b| b != [s[0], s[1]]) {
+ let payload = json!({"scrollLeft": s[0], "scrollTop": s[1], "scrollWidth": s[2], "scrollHeight": s[3], "clientWidth": s[4], "clientHeight": s[5]});
+ self.send(id, Ev::Scroll, payload);
+ }
+ }
+ }
+
+ /// A new viewport: the JS hears `resize` (the snapshot after the next frame carries the size).
+ pub fn resized(&mut self, w: f32, h: f32) {
+ self.viewport = (w, h);
+ self.outbox.push(Out::Deliver(named("resize", json!({"w": w, "h": h})).to_string()));
+ }
+}
+
+/// Focusable as Chrome has it: buttons, fields and links, and anything with a `tabIndex`, unless disabled.
+pub fn focusable(n: &Node) -> bool {
+ let disabled = n.props.get("disabled").is_some_and(|v| v.as_bool().unwrap_or(true));
+ !disabled && (matches!(n.kind.as_str(), "button" | "editableText" | "select" | "textarea") || n.props.contains_key("tabIndex") || (n.kind == "a" && n.props.contains_key("href")))
+}
diff --git a/engine/rune/page/src/kit.rs b/engine/rune/page/src/kit.rs
new file mode 100644
index 00000000..a61d19ac
--- /dev/null
+++ b/engine/rune/page/src/kit.rs
@@ -0,0 +1,48 @@
+//! rune-kit's components in place of @raea/rune's stand-ins (R6a, sdk/rune/src/kit.tsx): an element whose
+//! `data-rune-kit` names one is drawn as that component, built with the neutral kit (its dark one when the component
+//! says `dark`; RollingText takes the CSS colour and font it inherits). The stand-in's own events still go back over
+//! the wire (view.rs attaches them as for any element), so a Switch's press reaches React's onClick and the new
+//! `checked` comes back in the next batch.
+
+use rune::El;
+use rune_kit::{Badge, BadgeVariant, Kit, Progress, RollingText, Spinner, Switch};
+use serde_json::Value;
+
+use crate::report::Report;
+
+/// The component `json` describes for element `id`, or None (reported) when the host doesn't know it.
+pub fn build(id: u64, json: &str, color: rune::Color, font: rune::TextStyle, path: &str, report: &mut Report) -> Option<El> {
+ let v: Value = serde_json::from_str(json).ok()?;
+ let k = Kit::neutral(v.get("dark").and_then(Value::as_bool).unwrap_or(false));
+ let s = |f: &str| v.get(f).and_then(Value::as_str).unwrap_or("").to_string();
+ Some(match v.get("kit").and_then(Value::as_str).unwrap_or("") {
+ "badge" => {
+ let variant = match s("variant").as_str() {
+ "accent" => BadgeVariant::Accent,
+ "subtle" => BadgeVariant::Subtle,
+ _ => BadgeVariant::Neutral,
+ };
+ Badge::new(s("label")).variant(variant).build(&k)
+ }
+ "spinner" => Spinner::new().build(&k),
+ "progress" => Progress::new(v.get("value").and_then(Value::as_f64).map(|x| x as f32)).build(&k),
+ "rolling" => {
+ let r = RollingText::new(format!("rolling-{id}"), s("text")).color(color).font(font);
+ let r = match v.get("motion").and_then(crate::runeprops::spring) {
+ Some(sp) => r.spring(sp),
+ None => r,
+ };
+ r.build(&k)
+ }
+ "switch" => {
+ let sw = Switch::new(v.get("checked").and_then(Value::as_bool).unwrap_or(false));
+ let label = s("label");
+ let sw = if label.is_empty() { sw } else { sw.label(label) };
+ sw.build(&k)
+ }
+ other => {
+ report.note(path, "data-rune-kit", other, "a rune-kit component the host doesn't know");
+ return None;
+ }
+ })
+}
diff --git a/engine/rune/page/src/layout.rs b/engine/rune/page/src/layout.rs
new file mode 100644
index 00000000..e1cdaa9f
--- /dev/null
+++ b/engine/rune/page/src/layout.rs
@@ -0,0 +1,83 @@
+//! What a frame's layout means for the page, whoever ran the frame (the headless session, or a window's
+//! `on_frame_drawn`): each wire element's box as getBoundingClientRect has it, their paint order (for hit tests), each
+//! scroll viewport's numbers, and DOM mode's layout snapshot (sdk/ui dom/core.ts: per element its id, box, scroll box,
+//! padding, border and z, 18 numbers). `Page::measured` takes it in.
+
+use std::collections::HashMap;
+
+use rune::ElementInfo;
+use serde_json::json;
+
+use crate::input::Scroll;
+use crate::page::{Out, Page};
+
+/// One frame's layout, measured.
+#[derive(Default)]
+pub struct Measured {
+ pub rects: HashMap<u64, [f32; 4]>,
+ /// wire ids in Rune's paint order
+ pub order: Vec<u64>,
+ pub scrolls: Vec<(u64, Scroll)>,
+ pub snap: String,
+}
+
+/// The wire id an element of the view stands for (its key is `w<id>`).
+pub fn wire_id(e: &ElementInfo) -> Option<u64> {
+ e.key.as_deref()?.strip_prefix('w')?.parse().ok()
+}
+
+/// An element's box where it's drawn at rest: its layout box carried by its scroll viewports' offsets (Rune's `target`
+/// is before them), as getBoundingClientRect has it.
+pub fn shown(e: &ElementInfo) -> [f32; 4] {
+ [e.target[0] - e.scrolled[0], e.target[1] - e.scrolled[1], e.target[2], e.target[3]]
+}
+
+/// `els` (Rune's elements after a frame) measured; `boxes` are the padding and border widths the view mapped.
+pub fn measure(els: &[ElementInfo], boxes: &HashMap<u64, [f32; 8]>, viewport: (f32, f32)) -> Measured {
+ let mut m = Measured::default();
+ let mut n: Vec<f64> = Vec::new();
+ for (i, e) in els.iter().enumerate() {
+ let Some(id) = wire_id(e) else { continue };
+ if e.exiting {
+ continue;
+ }
+ let r = shown(e);
+ m.rects.insert(id, r);
+ m.order.push(id);
+ // a scroll viewport's offset is what it carries its children by; its extent, theirs
+ let kids: Vec<&ElementInfo> = els.iter().filter(|k| k.parent == Some(i)).collect();
+ let b = boxes.get(&id).copied().unwrap_or_default();
+ let (mut sl, mut st, mut sw, mut sh) = (0.0, 0.0, r[2], r[3]);
+ if let Some(k) = kids.first() {
+ (sl, st) = (k.scrolled[0] - e.scrolled[0], k.scrolled[1] - e.scrolled[1]);
+ }
+ for k in &kids {
+ sw = sw.max(k.target[0] + k.target[2] - e.target[0] + b[2]);
+ sh = sh.max(k.target[1] + k.target[3] - e.target[1] + b[3]);
+ }
+ if sw > r[2] + 0.5 || sh > r[3] + 0.5 {
+ m.scrolls.push((id, [sl, st, sw, sh, r[2] - b[4] - b[6], r[3] - b[5] - b[7]]));
+ }
+ n.extend([id as f32, r[0], r[1], r[2], r[3], sl, st, sw, sh].map(f64::from));
+ n.extend(b.map(f64::from));
+ n.push(0.0);
+ }
+ m.snap = json!({"vw": viewport.0, "vh": viewport.1, "dpr": 1, "n": n}).to_string();
+ m
+}
+
+impl Page {
+ /// A frame's layout taken in: the rects and paint order, `scroll` to each element whose offset moved, and the
+ /// snapshot queued for the JS when it changed. Whether it did.
+ pub fn measured(&mut self, m: Measured) -> bool {
+ self.rects = m.rects;
+ self.order = m.order;
+ self.scrolled(m.scrolls);
+ if m.snap == self.last_layout {
+ return false;
+ }
+ self.outbox.push(Out::Layout(m.snap.clone()));
+ self.last_layout = m.snap;
+ true
+ }
+}
diff --git a/engine/rune/page/src/lib.rs b/engine/rune/page/src/lib.rs
new file mode 100644
index 00000000..35753341
--- /dev/null
+++ b/engine/rune/page/src/lib.rs
@@ -0,0 +1,18 @@
+//! raea-rune-page: the page the native host keeps from raea's op wire (docs/rune.feature R1-R3): the element tree, its
+//! view as Rune elements (raea-rune-style's props), the session that lays it out on Rune's virtual clock, and input and
+//! events back to the app.
+
+pub use raea_rune_style::{css, motion, report, runeprops, tailwind, variants};
+
+pub mod dump;
+pub mod events;
+pub mod images;
+pub mod input;
+pub mod kit;
+pub mod layout;
+pub mod measure;
+pub mod page;
+pub mod session;
+pub mod state;
+pub mod tree;
+pub mod view;
diff --git a/engine/rune/page/src/measure.rs b/engine/rune/page/src/measure.rs
new file mode 100644
index 00000000..d6594ed3
--- /dev/null
+++ b/engine/rune/page/src/measure.rs
@@ -0,0 +1,21 @@
+//! Text widths as a browser has them (R5a). Rune's own measure rounds a text's width up to whole device pixels
+//! (rune src/text.rs `measure`, to keep layout on the pixel grid), so every box that shrinks to fit a text comes out up
+//! to a pixel wider than Chrome's, which keeps the fraction. The host measures each text with a TextSystem of its own
+//! over the same embedded fonts and caps the text at that width; Rune's layout then has the unrounded width.
+
+use std::cell::RefCell;
+
+use rune::text::TextSystem;
+use rune::TextStyle;
+
+#[derive(Default)]
+pub struct Measure(RefCell<Option<TextSystem>>);
+
+impl Measure {
+ /// `s`'s width on one line, unrounded, in points.
+ pub fn width(&self, s: &str, style: TextStyle) -> f32 {
+ let mut ts = self.0.borrow_mut();
+ let ts = ts.get_or_insert_with(|| TextSystem::new(&[], ("Inter", "Inter")));
+ ts.layout_rich(s, &[], style, 1.0, None).full_width()
+ }
+}
diff --git a/engine/rune/page/src/page.rs b/engine/rune/page/src/page.rs
new file mode 100644
index 00000000..b4c3a61a
--- /dev/null
+++ b/engine/rune/page/src/page.rs
@@ -0,0 +1,111 @@
+//! A page as a Rune app's state: the tree the wire built, its text fields' edits, its images, what couldn't be
+//! mapped, and what goes back to the JS (R3). `view` is the Rune view function (`fn(&S, &mut Cx<S>) -> El`).
+
+use std::cell::RefCell;
+use std::collections::HashMap;
+
+use rune::{Cx, El, Env, Runtime, TextEdit};
+use serde_json::Value;
+
+use crate::images::Images;
+use crate::report::Report;
+use crate::tree::Tree;
+use crate::view::Ctx;
+
+/// What goes back to the JS.
+#[derive(Clone, Debug, PartialEq)]
+pub enum Out {
+ /// a message for `__ui_deliver` (an element's event, a host event)
+ Deliver(String),
+ /// a layout snapshot for `__ui_layout` (DOM mode's geometry)
+ Layout(String),
+}
+
+#[derive(Default)]
+pub struct Page {
+ pub tree: Tree,
+ pub images: Images,
+ pub report: RefCell<Report>,
+ /// each text field's edit, by wire id, its text kept equal to the field's `value` prop
+ pub edits: HashMap<u64, TextEdit>,
+ /// what the JS hasn't been sent yet
+ pub outbox: Vec<Out>,
+ /// each element's box in window points after the last frame, by wire id
+ pub rects: HashMap<u64, [f32; 4]>,
+ /// wire ids in Rune's paint order after the last frame (input.rs's hit test)
+ pub order: Vec<u64>,
+ /// the element with the page's focus (input.rs)
+ pub(crate) focus: Option<u64>,
+ /// each scroll viewport's offset after the last frame
+ pub(crate) scrolls: HashMap<u64, [f32; 2]>,
+ /// the last layout snapshot the JS was sent
+ pub last_layout: String,
+ /// each element's padding and border widths (l t r b, l t r b) as the last view mapped them
+ pub boxes: RefCell<HashMap<u64, [f32; 8]>>,
+ /// the pointer in window points, as last seen
+ pub pointer: (f32, f32),
+ /// the page asked for a `frame` host event every frame (`__ui_emit("ticks", true)`)
+ pub ticking: bool,
+ /// unrounded text widths for the view
+ pub measure: crate::measure::Measure,
+ /// the elements with a `hover:` class the pointer is over (state.rs)
+ pub hovered: std::collections::HashSet<u64>,
+ /// the elements a press holds until its release (state.rs)
+ pub pressed: Vec<u64>,
+ /// the focus is one the page shows (:focus-visible)
+ pub(crate) focus_visible: bool,
+ /// the last input was a key (Chrome's focus-visible heuristic)
+ pub(crate) keyed: bool,
+ /// the viewport in points: a breakpoint's width
+ pub viewport: (f32, f32),
+}
+
+impl Page {
+ /// A batch from the JS, applied to the tree; each text field's edit follows its `value` (a controlled input: what
+ /// React decides the value is wins over what was typed).
+ pub fn apply(&mut self, json: &str) -> Result<(), String> {
+ self.tree.apply_json(json)?;
+ let fields: Vec<(u64, String)> = self.tree.ids().filter_map(|id| {
+ let n = self.tree.get(id)?;
+ (n.kind == "editableText").then(|| (id, n.props.get("value").and_then(Value::as_str).unwrap_or("").to_string()))
+ }).collect();
+ self.edits.retain(|id, _| fields.iter().any(|(f, _)| f == id));
+ for (id, v) in fields {
+ let e = self.edits.entry(id).or_insert_with(|| TextEdit::new(""));
+ if e.text != v {
+ *e = TextEdit::new(v);
+ }
+ }
+ Ok(())
+ }
+
+ /// Element `id`'s box after the last frame (zero before its first).
+ pub fn rect(&self, id: u64) -> [f32; 4] {
+ self.rects.get(&id).copied().unwrap_or_default()
+ }
+
+ /// Element `id`'s edit (made empty if the page had none).
+ pub fn edit_mut(&mut self, id: u64) -> &mut TextEdit {
+ self.edits.entry(id).or_insert_with(|| TextEdit::new(""))
+ }
+
+ /// What the JS hasn't been sent, taken.
+ pub fn take_out(&mut self) -> Vec<Out> {
+ std::mem::take(&mut self.outbox)
+ }
+}
+
+/// Rune's view of the page.
+pub fn view(p: &Page, cx: &mut Cx<Page>) -> El {
+ let mut report = p.report.borrow_mut();
+ let mut boxes = p.boxes.borrow_mut();
+ let live = p.live(cx.system_dark());
+ crate::view::build(&p.tree, &mut Ctx { report: &mut report, images: &p.images, edits: &p.edits, boxes: &mut boxes, measure: &p.measure, marks: 0, live })
+}
+
+/// A headless Rune runtime for `page` at `viewport` points, with Rune's text (Inter, embedded) so text has its size.
+pub fn headless(mut page: Page, viewport: (f32, f32)) -> Runtime<Page> {
+ page.viewport = viewport;
+ let text = rune::text::TextSystem::new(&[], ("Inter", "Inter"));
+ Runtime::with_text(page, view, viewport, Env::new(false, 1.0), text)
+}
diff --git a/engine/rune/page/src/session.rs b/engine/rune/page/src/session.rs
new file mode 100644
index 00000000..a0fce13b
--- /dev/null
+++ b/engine/rune/page/src/session.rs
@@ -0,0 +1,236 @@
+//! A page run by Rune frame by frame, headless (R3, R4): input in through Rune's own pointer, wheel and key paths (so
+//! hit-testing, text editing and the page's press rules in events.rs run as they do in a window), and out the messages
+//! the JS needs: each element event the page's handlers queued, and after each frame whose layout changed, the layout
+//! snapshot (layout.rs).
+
+use rune::{Key, KeyEvent, Mods, Runtime};
+use serde_json::{Value, json};
+
+use raea_core_wire::{Ev, named};
+
+use crate::page::{Out, Page, headless};
+use crate::view::key;
+
+pub struct Session {
+ pub rt: Runtime<Page>,
+ pub(crate) viewport: (f32, f32),
+ clock: f64,
+ frames: u64,
+ /// run at the end of every frame with the runtime and the pointer (R8a's encoder: each virtual-clock frame,
+ /// those inside a press or a drag too); none by default
+ pub on_frame: Option<Box<dyn FnMut(&mut Runtime<Page>, (f32, f32))>>,
+}
+
+/// One frame at 60 fps.
+pub const FRAME: f64 = 1.0 / 60.0;
+
+impl Session {
+ pub fn new(page: Page, viewport: (f32, f32)) -> Self {
+ let mut s = Session { rt: headless(page, viewport), viewport, clock: 0.0, frames: 0, on_frame: None };
+ s.frame();
+ s
+ }
+
+ /// A frame: the clock moves on a frame, the view runs if anything changed, layout and motion advance, rects and the
+ /// snapshot follow, and a ticking page hears `frame`.
+ pub fn frame(&mut self) {
+ let dt = if self.frames == 0 { 0.0 } else { FRAME };
+ self.clock += dt;
+ self.step(dt);
+ // every frame reaches the page's `__ui_layout`, "" when its layout didn't change, as the page host's does
+ // (runtime/dom elements.rs): it's where @raea/ui runs a frame's requestAnimationFrame callbacks, so a JS
+ // animation that only moves transforms or opacity (Motion's) keeps its frames (T3c)
+ if !self.rt.state.outbox.iter().any(|o| matches!(o, Out::Layout(_))) {
+ self.rt.state.outbox.push(Out::Layout(String::new()));
+ }
+ self.frames += 1;
+ if self.rt.state.ticking {
+ self.rt.state.outbox.push(Out::Deliver(named("frame", json!(self.frames)).to_string()));
+ }
+ if let Some(f) = self.on_frame.as_mut() {
+ let p = self.rt.state.pointer;
+ f(&mut self.rt, p);
+ }
+ }
+
+ /// The virtual clock, in seconds: a frame's worth per frame since the first.
+ pub fn clock(&self) -> f64 {
+ self.clock
+ }
+
+ /// Frames run so far.
+ pub fn frames(&self) -> u64 {
+ self.frames
+ }
+
+ /// Rune's frame over `dt` seconds, then the page takes in its layout.
+ fn step(&mut self, dt: f64) {
+ self.rt.frame(dt);
+ let m = crate::layout::measure(&self.rt.elements(), &self.rt.state.boxes.borrow(), self.viewport);
+ self.rt.state.measured(m);
+ }
+
+ /// A batch from the JS, laid out at once (the clock stays: a batch answers what happened in this frame, and a
+ /// ticking page that renders on every `frame` mustn't make another).
+ pub fn apply(&mut self, batch: &str) -> Result<(), String> {
+ // through `update`, so Rune knows the state changed and runs the view again. It animates only where the page
+ // asked for Rune's motion: view.rs lands every other subtree at once and shows each element whole when it mounts
+ let mut r = Ok(());
+ self.rt.update(|p, _| r = p.apply(batch));
+ r?;
+ self.step(0.0);
+ Ok(())
+ }
+
+ /// What the page asked of the host by `__ui_emit` (input.rs), a frame after it when it moved the focus.
+ pub fn emit(&mut self, name: &str, v: &Value) {
+ let before = self.rt.state.focus();
+ self.rt.update(|p, tx| p.emit(name, v, tx));
+ if self.rt.state.focus() != before {
+ self.frame();
+ }
+ }
+
+ /// Element `id`'s box after the last frame.
+ pub fn rect(&self, id: u64) -> Option<[f32; 4]> {
+ self.rt.state.rects.get(&id).copied()
+ }
+
+ /// The element whose `data-testid` is `t`.
+ pub fn tid(&self, t: &str) -> Option<u64> {
+ self.rt.state.tid(t)
+ }
+
+ /// The wire element on top at `(x, y)` after the last frame.
+ pub fn at(&self, x: f32, y: f32) -> Option<u64> {
+ self.rt.state.at(x, y)
+ }
+
+ /// The pointer to `(x, y)`.
+ pub fn pointer_move(&mut self, x: f32, y: f32) {
+ self.rt.state.pointer = (x, y);
+ self.rt.pointer_move(x, y);
+ self.frame();
+ }
+
+ /// A press and release at `(x, y)`, a frame between.
+ pub fn click(&mut self, x: f32, y: f32) {
+ self.pointer_move(x, y);
+ self.rt.pointer_down(x, y);
+ self.frame();
+ self.rt.pointer_up(x, y);
+ self.frame();
+ self.follow_field_focus();
+ }
+
+ /// A press at `from`, the pointer moved to `to` in `steps` frames, and a release there.
+ pub fn drag(&mut self, from: (f32, f32), to: (f32, f32), steps: u32) {
+ self.pointer_move(from.0, from.1);
+ self.rt.pointer_down(from.0, from.1);
+ self.frame();
+ for i in 1..=steps {
+ let t = i as f32 / steps as f32;
+ self.pointer_move(from.0 + (to.0 - from.0) * t, from.1 + (to.1 - from.1) * t);
+ }
+ self.rt.pointer_up(to.0, to.1);
+ self.frame();
+ self.follow_field_focus();
+ }
+
+ /// A press and release in the middle of element `id`.
+ pub fn click_el(&mut self, id: u64) -> Option<()> {
+ let r = self.rect(id)?;
+ self.click(r[0] + r[2] / 2.0, r[1] + r[3] / 2.0);
+ Some(())
+ }
+
+ /// A wheel at `(x, y)`: `dy` points, positive scrolling the content up (DOM's sign).
+ pub fn wheel(&mut self, x: f32, y: f32, dy: f32) {
+ self.pointer_move(x, y);
+ self.rt.wheel_xy(x, y, 0.0, -dy);
+ self.frame();
+ }
+
+ /// Text typed at the focus, a character at a time, a frame after each.
+ pub fn type_text(&mut self, text: &str) {
+ for c in text.chars() {
+ self.key(Key::Text(c.to_string()));
+ }
+ }
+
+ /// A key at the focus, as raea's other host sends it: `keydown` (input.rs's `key_out`), Rune's own handling (a
+ /// field's edit, which sends its `change`; Tab's focus move), then `keyup`.
+ pub fn key(&mut self, k: Key) {
+ let ev = KeyEvent { key: k, mods: Mods::default() };
+ let payload = crate::events::key_payload(&ev);
+ if self.rt.state.key_out(Ev::KeyDown, payload.clone()) {
+ // Tab is the page's sequential focus (input.rs), Rune's own only where the page has nowhere to go
+ let mut moved = false;
+ if ev.key == Key::Tab {
+ self.rt.update(|p, tx| moved = p.tab(ev.mods.shift, tx));
+ }
+ if !moved {
+ self.rt.key(ev.clone());
+ }
+ }
+ self.frame();
+ self.follow_field_focus();
+ self.rt.key_up(ev);
+ self.rt.state.key_out(Ev::KeyUp, payload);
+ self.frame();
+ }
+
+ /// A field Rune focused itself is the page's focus too, with a frame for it when it moved.
+ fn follow_field_focus(&mut self) {
+ if self.rt.state.focused_field().is_some_and(|f| Some(f) != self.rt.state.focus()) {
+ self.rt.update(|p, tx| p.follow_field_focus(tx));
+ self.frame();
+ }
+ }
+
+ /// The text field with the focus, by wire id.
+ pub fn focused_field(&self) -> Option<u64> {
+ self.rt.state.focused_field()
+ }
+
+ /// A new viewport: Rune lays out to it, and the JS hears `resize`.
+ pub fn resize(&mut self, w: f32, h: f32) {
+ self.viewport = (w, h);
+ self.rt.set_viewport((w, h), 1.0);
+ // through `update`: a breakpoint's classes restyle with the width (T3b)
+ self.rt.update(|p, _| p.resized(w, h));
+ self.frame();
+ }
+
+ /// The viewport in points.
+ pub fn viewport(&self) -> (f32, f32) {
+ self.viewport
+ }
+
+ /// The system's appearance (Tailwind's `dark:`): Rune's environment, as a window has it from the system.
+ pub fn set_dark(&mut self, dark: bool) {
+ self.rt.set_system_dark(dark);
+ self.frame();
+ }
+
+ /// The pointer moved to the middle of element `id` and left there (hover).
+ pub fn hover_el(&mut self, id: u64) -> Option<()> {
+ let r = self.rect(id)?;
+ self.pointer_move(r[0] + r[2] / 2.0, r[1] + r[3] / 2.0);
+ // Rune's hover change lands in this frame; the restyle it asks for, in the next
+ self.frame();
+ Some(())
+ }
+
+ /// What the JS hasn't been sent, taken.
+ pub fn take_out(&mut self) -> Vec<Out> {
+ self.rt.state.take_out()
+ }
+
+ /// The Rune element key for wire id `id` (for reading `rt.elements()`).
+ pub fn key_of(id: u64) -> String {
+ key(id)
+ }
+}
+
+pub use crate::layout::shown;
diff --git a/engine/rune/page/src/state.rs b/engine/rune/page/src/state.rs
new file mode 100644
index 00000000..c6dbd80b
--- /dev/null
+++ b/engine/rune/page/src/state.rs
@@ -0,0 +1,71 @@
+//! What Tailwind's variants test (docs/targets.feature T3b), kept by the page so a window and the headless session do
+//! the same. Hover is Rune's: an element with a `hover:` class hears its hover change (events.rs), and the pointer over
+//! something inside it counts, as CSS's :hover does. A press is active from its down to its up on the element on top
+//! where it began and everything holding it. Focus-visible follows Chrome: a focus that a key moved, or that any key
+//! met while it stayed, shows, and so does a text field's however it came. The system's appearance is Rune's
+//! (`Cx::system_dark`), and the width is the viewport's.
+
+use std::collections::HashSet;
+
+use serde_json::Value;
+
+use crate::page::Page;
+use crate::tree::Node;
+use crate::variants::State;
+
+/// The page's state for one view: what each element's `State` is made from.
+#[derive(Clone, Copy)]
+pub struct Live<'a> {
+ pub hovered: &'a HashSet<u64>,
+ /// the elements a press holds: the one on top where it began and those up from it
+ pub pressed: &'a [u64],
+ pub focus: Option<u64>,
+ pub focus_visible: bool,
+ pub dark: bool,
+ pub width: f32,
+}
+
+impl Live<'_> {
+ /// Element `id`'s (`n`'s) state.
+ pub fn of(&self, id: u64, n: &Node) -> State {
+ let control = matches!(n.kind.as_str(), "button" | "editableText" | "select" | "textarea");
+ State {
+ hover: self.hovered.contains(&id),
+ active: self.pressed.contains(&id),
+ focus: self.focus == Some(id),
+ focus_visible: self.focus == Some(id) && self.focus_visible,
+ control,
+ disabled: control && n.props.get("disabled").is_some_and(|v| v.as_bool().unwrap_or(true)),
+ dark: self.dark,
+ width: self.width,
+ }
+ }
+}
+
+/// Whether element `n`'s classes have a variant `v:` anywhere in a chain.
+pub fn has_variant(n: &Node, v: &str) -> bool {
+ n.props.get("className").and_then(Value::as_str).is_some_and(|c| c.split_whitespace().any(|u| u.split(':').rev().skip(1).any(|p| p == v)))
+}
+
+impl Page {
+ /// The page's state for a view, with the system's appearance as Rune has it.
+ pub fn live(&self, dark: bool) -> Live<'_> {
+ Live { hovered: &self.hovered, pressed: &self.pressed, focus: self.focus, focus_visible: self.focus_visible, dark, width: self.viewport.0 }
+ }
+
+ /// A press began at `(x, y)`: the element on top there and those up from it are active until it ends.
+ pub(crate) fn press_began(&mut self, x: f32, y: f32) {
+ self.pressed.clear();
+ let mut at = self.at(x, y);
+ while let Some(i) = at {
+ self.pressed.push(i);
+ at = self.tree.get(i).and_then(|n| n.parent);
+ }
+ self.keyed = false;
+ }
+
+ /// The press ended.
+ pub(crate) fn press_ended(&mut self) {
+ self.pressed.clear();
+ }
+}
diff --git a/engine/rune/page/src/tree.rs b/engine/rune/page/src/tree.rs
new file mode 100644
index 00000000..9110df39
--- /dev/null
+++ b/engine/rune/page/src/tree.rs
@@ -0,0 +1,257 @@
+//! The page as the wire's ops leave it (R1a): every element by its wire id (0 is the root), with its kind, props, text,
+//! the events it listens for and its children in order. It applies a batch the way sdk/ui's strict test host does
+//! (sdk/ui/test/host.ts): an op on an id it doesn't know, a second create, a listen twice or an empty update is an
+//! error, so a driver's mistake fails a test instead of passing quietly. `view` (R2) draws this tree with Rune.
+
+use std::collections::{HashMap, HashSet};
+
+use raea_core_wire::{Ev, Op, decode};
+use serde_json::{Map, Value, json};
+
+/// The root's id, as the wire numbers it (sdk/ui wire.ts ROOT).
+pub const ROOT: u64 = 0;
+
+/// One element of the page.
+#[derive(Clone, Debug, PartialEq)]
+pub struct Node {
+ pub kind: String,
+ pub props: Map<String, Value>,
+ /// a text element's string
+ pub text: Option<String>,
+ /// the events it listens for
+ pub on: HashSet<Ev>,
+ pub children: Vec<u64>,
+ pub parent: Option<u64>,
+}
+
+impl Node {
+ fn new(kind: &str, props: Map<String, Value>, text: Option<String>) -> Self {
+ Node { kind: kind.to_string(), props, text, on: HashSet::new(), children: Vec::new(), parent: None }
+ }
+}
+
+/// The page's elements.
+#[derive(Debug)]
+pub struct Tree {
+ nodes: HashMap<u64, Node>,
+}
+
+impl Default for Tree {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
+impl Tree {
+ /// A page with only its root.
+ pub fn new() -> Self {
+ Tree { nodes: HashMap::from([(ROOT, Node::new("#root", Map::new(), None))]) }
+ }
+
+ /// Every element's wire id, the root's included.
+ pub fn ids(&self) -> impl Iterator<Item = u64> + '_ {
+ self.nodes.keys().copied()
+ }
+
+ /// An element by its wire id.
+ pub fn get(&self, id: u64) -> Option<&Node> {
+ self.nodes.get(&id)
+ }
+
+ /// How many elements there are, the root's included.
+ pub fn len(&self) -> usize {
+ self.nodes.len()
+ }
+
+ /// Whether the page holds only its root.
+ pub fn is_empty(&self) -> bool {
+ self.nodes.len() == 1
+ }
+
+ /// A batch as the JS flushed it (`{v, ops}`), applied in order. A batch of another version is refused whole; an op
+ /// that can't apply stops the batch there with why.
+ pub fn apply_json(&mut self, json: &str) -> Result<(), String> {
+ for op in decode(json)? {
+ self.apply(&op)?;
+ }
+ Ok(())
+ }
+
+ /// One op.
+ pub fn apply(&mut self, op: &Op) -> Result<(), String> {
+ match op {
+ Op::Clear => {
+ for c in std::mem::take(&mut self.node_mut(ROOT)?.children) {
+ self.node_mut(c)?.parent = None;
+ self.drop_subtree(c);
+ }
+ }
+ Op::Create { id, kind, props, text } => {
+ if self.nodes.contains_key(id) {
+ return Err(format!("element {id} made twice"));
+ }
+ self.nodes.insert(*id, Node::new(kind, props.clone(), text.clone()));
+ }
+ Op::Append { parent, child } => self.place(*parent, *child, None)?,
+ Op::Insert { parent, child, before } => self.place(*parent, *child, Some(*before))?,
+ Op::Remove { id } => {
+ self.detach(*id)?;
+ self.drop_subtree(*id);
+ }
+ Op::Update { id, set, unset, text } => {
+ if set.is_none() && unset.is_none() && text.is_none() {
+ return Err(format!("an empty update of {id}"));
+ }
+ let n = self.node_mut(*id)?;
+ for (k, v) in set.iter().flatten() {
+ n.props.insert(k.clone(), v.clone());
+ }
+ for k in unset.iter().flatten() {
+ n.props.remove(k);
+ }
+ if let Some(t) = text {
+ n.text = Some(t.clone());
+ }
+ }
+ Op::Listen { id, events } => {
+ let n = self.node_mut(*id)?;
+ for e in events {
+ if !n.on.insert(*e) {
+ return Err(format!("{id} listens for {} twice", ev_name(*e)));
+ }
+ }
+ }
+ Op::Unlisten { id, events } => {
+ let n = self.node_mut(*id)?;
+ for e in events {
+ if !n.on.remove(e) {
+ return Err(format!("{id} unlistens {}, which it didn't listen for", ev_name(*e)));
+ }
+ }
+ }
+ }
+ Ok(())
+ }
+
+ /// The tree from `id` as sdk/ui's test host's `shape()` dumps it: `[kind, props, text|null, events, children]`,
+ /// events sorted by name, ids left out (two drivers number their elements differently).
+ pub fn shape(&self, id: u64) -> Value {
+ let Some(n) = self.nodes.get(&id) else { return Value::Null };
+ let mut events: Vec<&str> = n.on.iter().map(|e| ev_name(*e)).collect();
+ events.sort_unstable();
+ let mut keys: Vec<&String> = n.props.keys().collect();
+ keys.sort();
+ let props: Map<String, Value> = keys.into_iter().map(|k| (k.clone(), n.props[k].clone())).collect();
+ let kids: Vec<Value> = n.children.iter().map(|c| self.shape(*c)).collect();
+ json!([n.kind, props, n.text, events, kids])
+ }
+
+ fn node_mut(&mut self, id: u64) -> Result<&mut Node, String> {
+ self.nodes.get_mut(&id).ok_or_else(|| format!("no element {id}"))
+ }
+
+ /// `child` under `parent`, last or before `before`, moved there if it was elsewhere.
+ fn place(&mut self, parent: u64, child: u64, before: Option<u64>) -> Result<(), String> {
+ self.node_mut(parent)?;
+ self.detach(child)?;
+ let p = self.node_mut(parent)?;
+ match before {
+ None => p.children.push(child),
+ Some(b) => {
+ let at = p.children.iter().position(|c| *c == b).ok_or_else(|| format!("insert before {b}, which isn't under {parent}"))?;
+ p.children.insert(at, child);
+ }
+ }
+ self.node_mut(child)?.parent = Some(parent);
+ Ok(())
+ }
+
+ /// `id` out of its parent's children (nothing when it has no parent).
+ fn detach(&mut self, id: u64) -> Result<(), String> {
+ let Some(parent) = self.node_mut(id)?.parent.take() else { return Ok(()) };
+ let p = self.node_mut(parent)?;
+ p.children.retain(|c| *c != id);
+ Ok(())
+ }
+
+ /// `id` and everything in it gone.
+ fn drop_subtree(&mut self, id: u64) {
+ if let Some(n) = self.nodes.remove(&id) {
+ for c in n.children {
+ self.drop_subtree(c);
+ }
+ }
+ }
+}
+
+/// An event's name on the wire ("pointerdown").
+pub fn ev_name(e: Ev) -> &'static str {
+ match e {
+ Ev::PointerDown => "pointerdown",
+ Ev::PointerMove => "pointermove",
+ Ev::PointerUp => "pointerup",
+ Ev::PointerEnter => "pointerenter",
+ Ev::PointerLeave => "pointerleave",
+ Ev::ContextMenu => "contextmenu",
+ Ev::Wheel => "wheel",
+ Ev::Scroll => "scroll",
+ Ev::Change => "change",
+ Ev::KeyDown => "keydown",
+ Ev::Focus => "focus",
+ Ev::Blur => "blur",
+ Ev::Select => "select",
+ Ev::Close => "close",
+ Ev::KeyUp => "keyup",
+ }
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ fn run(t: &mut Tree, ops: &str) -> Result<(), String> {
+ t.apply_json(&format!(r#"{{"v":1,"ops":[{ops}]}}"#))
+ }
+
+ #[test]
+ fn applies_each_op() {
+ let mut t = Tree::new();
+ run(
+ &mut t,
+ r#"{"op":"create","id":1,"kind":"div","props":{"style":{"width":3}}},{"op":"create","id":2,"kind":"text","text":"a"},
+ {"op":"create","id":3,"kind":"text","text":"b"},{"op":"append","parent":0,"child":1},{"op":"append","parent":1,"child":2},
+ {"op":"insert","parent":1,"child":3,"before":2},{"op":"listen","id":1,"events":["pointerdown","keydown"]}"#,
+ )
+ .unwrap();
+ assert_eq!(t.get(1).unwrap().children, vec![3, 2]);
+ // a move: 2 goes under the root, out of 1
+ run(&mut t, r#"{"op":"append","parent":0,"child":2},{"op":"update","id":1,"set":{"title":"x"},"unset":["style"]},{"op":"update","id":3,"text":"c"}"#).unwrap();
+ assert_eq!(t.get(1).unwrap().children, vec![3]);
+ assert_eq!(t.get(0).unwrap().children, vec![1, 2]);
+ assert_eq!(t.shape(1), json!(["div", {"title": "x"}, null, ["keydown", "pointerdown"], [["text", {}, "c", [], []]]]));
+ run(&mut t, r#"{"op":"unlisten","id":1,"events":["keydown"]},{"op":"remove","id":1}"#).unwrap();
+ assert!(t.get(3).is_none(), "a removed element's subtree goes with it");
+ run(&mut t, r#"{"op":"clear"}"#).unwrap();
+ assert!(t.is_empty());
+ }
+
+ #[test]
+ fn strict_like_the_test_host() {
+ let mut t = Tree::new();
+ run(&mut t, r#"{"op":"create","id":1,"kind":"div"}"#).unwrap();
+ assert!(run(&mut t, r#"{"op":"create","id":1,"kind":"div"}"#).unwrap_err().contains("twice"));
+ assert!(run(&mut t, r#"{"op":"append","parent":0,"child":9}"#).unwrap_err().contains("no element 9"));
+ assert!(run(&mut t, r#"{"op":"update","id":1}"#).unwrap_err().contains("empty update"));
+ assert!(run(&mut t, r#"{"op":"insert","parent":0,"child":1,"before":5}"#).unwrap_err().contains("isn't under"));
+ run(&mut t, r#"{"op":"listen","id":1,"events":["wheel"]}"#).unwrap();
+ assert!(run(&mut t, r#"{"op":"listen","id":1,"events":["wheel"]}"#).unwrap_err().contains("twice"));
+ assert!(run(&mut t, r#"{"op":"unlisten","id":1,"events":["blur"]}"#).unwrap_err().contains("didn't listen"));
+ }
+
+ #[test]
+ fn refuses_another_version_whole() {
+ let mut t = Tree::new();
+ assert!(t.apply_json(r#"{"v":2,"ops":[{"op":"create","id":1,"kind":"div"}]}"#).unwrap_err().contains("version 2"));
+ assert!(t.get(1).is_none());
+ }
+}
diff --git a/engine/rune/page/src/view.rs b/engine/rune/page/src/view.rs
new file mode 100644
index 00000000..67cbb504
--- /dev/null
+++ b/engine/rune/page/src/view.rs
@@ -0,0 +1,481 @@
+//! The tree drawn as Rune elements (R2a): each wire element is a Rune box keyed by its wire id ("w12"), each text node
+//! a Rune text with the font props it inherits, and each style prop a builder call (css.rs reads them). The host's
+//! defaults are Tailwind's preflight, the base TSX + Tailwind apps run on: border-box, no margins or borders, controls
+//! inheriting font, line-height 1.5, black text at 16px in Inter. Rune has no block or inline layout, so a block is a
+//! stretched column and a run of inline children a wrapping row; where that differs from CSS it is reported.
+
+use std::collections::HashMap;
+
+use rune::{Color, El, Family, ScrollSpec, Shadow, Spring, TextEdit, TextStyle, Transition, col, el, row, text};
+use serde_json::{Map, Value};
+
+use crate::css::{self, Align, Css, Display, Len, Overflow};
+use crate::images::Images;
+use crate::report::Report;
+use crate::tree::{Node, ROOT, Tree};
+
+/// What text inherits from its ancestors (CSS's inherited font props).
+#[derive(Clone, Debug)]
+struct Inherit {
+ color: Color,
+ size: f32,
+ weight: f32,
+ family: Option<&'static str>,
+ line: Len,
+ tracking: f32,
+ align: Align,
+ italic: bool,
+ /// the strut: the line height of the nearest element that isn't laid out inline (CSS: every line box in a block is at
+ /// least as tall as the block's own line height, whatever its inline content's)
+ strut: f32,
+ /// the parent is a flex container, so this element is a flex item: blockified, inline or not
+ flex_parent: bool,
+}
+
+impl Default for Inherit {
+ fn default() -> Self {
+ Inherit { color: Color::BLACK, size: 16.0, weight: 400.0, family: None, line: Len::Pct(150.0), tracking: 0.0, align: Align::Start, italic: false, strut: 24.0, flex_parent: false }
+ }
+}
+
+/// An element's Rune key: its wire id.
+pub fn key(id: u64) -> String {
+ format!("w{id}")
+}
+
+/// The page under the root as one Rune element filling the viewport, as the document's body does.
+/// What a build reports to and loads from.
+pub struct Ctx<'a> {
+ pub report: &'a mut Report,
+ pub images: &'a Images,
+ /// the page's text fields' edits, by wire id
+ pub edits: &'a HashMap<u64, TextEdit>,
+ /// each element's padding and border widths as mapped (l t r b, l t r b): the layout snapshot's
+ pub boxes: &'a mut HashMap<u64, [f32; 8]>,
+ /// unrounded text widths (measure.rs)
+ pub measure: &'a crate::measure::Measure,
+ /// elements built so far that asked for Rune motion (runeprops.rs): a subtree that adds none lands at once
+ pub marks: usize,
+ /// what Tailwind's variants test (state.rs)
+ pub live: crate::state::Live<'a>,
+}
+
+pub fn build(tree: &Tree, cx: &mut Ctx) -> El {
+ let root = tree.get(ROOT).expect("the root is always there");
+ let inh = Inherit::default();
+ // the canvas is white, as a browser's is: Rune clears the window with the root's fill
+ let e = col().key(key(ROOT)).w_full().h_full().items_stretch().fill(Color::WHITE).children(kids(tree, root, &inh, "", cx));
+ let e = crate::events::attach(e, ROOT, root, true).transition(Transition::none()).motion(Spring::NONE);
+ if cx.marks == 0 { e.instant_changes() } else { e }
+}
+
+fn kids(tree: &Tree, n: &Node, inh: &Inherit, path: &str, cx: &mut Ctx) -> Vec<El> {
+ let mut out = Vec::new();
+ for (i, c) in n.children.iter().enumerate() {
+ let Some(child) = tree.get(*c) else { continue };
+ let p = format!("{path}/{}[{i}]", child.kind);
+ if let Some(e) = node(tree, *c, child, inh, &p, cx) {
+ out.push(e);
+ }
+ }
+ out
+}
+
+/// The display a tag has when its style doesn't say (Chrome's defaults, as preflight leaves them).
+fn default_display(kind: &str) -> Display {
+ match kind {
+ "span" | "a" | "b" | "i" | "em" | "strong" | "label" | "code" | "small" | "button" | "editableText" | "img" | "text" => Display::Inline,
+ _ => Display::Block,
+ }
+}
+
+/// The element's style props: its Tailwind classes' (R2c) under its inline style, which wins as CSS has it (an inline
+/// shorthand also overrides the classes' longhands of it), and the utilities nothing knew.
+fn style_of(id: u64, n: &Node, live: &crate::state::Live) -> (Map<String, Value>, Vec<String>) {
+ let inline = n.props.get("style").and_then(Value::as_object).cloned().unwrap_or_default();
+ let Some(class) = n.props.get("className").and_then(Value::as_str) else { return (inline, Vec::new()) };
+ let (mut out, unknown) = crate::tailwind::style_in(class, &live.of(id, n));
+ for (k, v) in inline {
+ let longhand = |l: &String| match k.as_str() {
+ "padding" | "margin" => l.starts_with(k.as_str()),
+ "gap" => l == "rowGap" || l == "columnGap",
+ "borderWidth" => l.starts_with("border") && l.ends_with("Width"),
+ "borderRadius" => l.starts_with("border") && l.ends_with("Radius"),
+ "overflow" => l.starts_with("overflow"),
+ _ => false,
+ };
+ out.retain(|l, _| !longhand(l));
+ out.insert(k, v);
+ }
+ (out, unknown)
+}
+
+fn display_of(id: u64, n: &Node, live: &crate::state::Live) -> Display {
+ css::parse(&style_of(id, n, live).0).0.display.unwrap_or(default_display(&n.kind))
+}
+
+fn node(tree: &Tree, id: u64, n: &Node, inh: &Inherit, path: &str, cx: &mut Ctx) -> Option<El> {
+ if n.kind == "text" {
+ return Some(text_el(n.text.as_deref().unwrap_or(""), inh, cx));
+ }
+ let (style, unknown) = style_of(id, n, &cx.live);
+ for u in unknown {
+ cx.report.note(path, "className", &u, "a Tailwind utility the host doesn't map");
+ }
+ let (c, bad) = css::parse(&style);
+ for b in bad {
+ cx.report.add(path, b);
+ }
+ props(n, path, cx.report);
+ let display = c.display.unwrap_or(default_display(&n.kind));
+ if display == Display::None {
+ return None;
+ }
+ let mut inh = inherit(inh, &c);
+ // a new strut where a block (or a flex item, or a button or field: inline-blocks) holds the lines; inline elements
+ // keep their block's
+ if display != Display::Inline || inh.flex_parent || matches!(n.kind.as_str(), "button" | "editableText" | "img") {
+ inh.strut = line_px(&inh);
+ }
+ inh.flex_parent = display == Display::Flex;
+ let before = cx.marks;
+ let kit = n.props.get("data-rune-kit").and_then(Value::as_str).and_then(|j| crate::kit::build(id, j, inh.color, text_style(&inh), path, cx.report));
+ let is_kit = kit.is_some();
+ let mut e = if let Some(k) = kit {
+ // the kit's element inside a row of the stand-in's own: the span's style and the DOM's no-motion defaults go
+ // on the row, so they don't clobber the kit's padding (RollingText's edge fades sit in it), its springs, or
+ // its rolling (a kit moves as Rune's does, so its subtree isn't made instant). The stand-in's role and
+ // events stay on the kit's element, where a press lands.
+ cx.marks += 1;
+ row().child(crate::events::attach(a11y(k, n), id, n, false))
+ } else {
+ match (n.kind.as_str(), display) {
+ ("editableText", _) => field(id, n, &inh, cx),
+ ("img", _) => img(n, path, cx),
+ ("button", _) => row().items_center().justify_center().children(kids(tree, n, &inh, path, cx)),
+ (_, Display::Flex) => {
+ let b = if c.column == Some(true) { col() } else { row() };
+ let b = if c.wrap { b.flex_wrap() } else { b };
+ b.children(kids(tree, n, &inh, path, cx))
+ }
+ (_, Display::Inline) => row().flex_wrap().children(kids(tree, n, &inh, path, cx)),
+ (_, _) => block(tree, n, &inh, path, cx),
+ }
+ };
+ e = e.key(key(id));
+ if !is_kit {
+ e = a11y(e, n);
+ e = crate::events::attach(e, id, n, false);
+ }
+ // Rune's own props; without a transition of its own an element shows whole the frame it mounts, as the DOM does,
+ // and a subtree with no motion in it lands every change at once
+ let (mut own_transition, mut own_motion) = (false, false);
+ if let Some(j) = n.props.get("data-rune").and_then(Value::as_str) {
+ let (x, animated) = crate::runeprops::apply(e, j, path, cx.report);
+ e = x;
+ cx.marks += usize::from(animated);
+ own_transition = j.contains("\"transition\"");
+ own_motion = j.contains("\"motion\"");
+ }
+ if !own_transition {
+ e = e.transition(Transition::none());
+ }
+ // CSS transforms and transitions (T3c): an element with a transition animates, so its subtree isn't instant
+ let (x, animated) = crate::motion::apply(e, &c.motion);
+ e = x;
+ cx.marks += usize::from(animated);
+ own_motion |= animated && c.motion.transition.as_ref().is_some_and(|t| t.props.colours || t.props.shadow);
+ // and its own changes, colours too, land at once unless it has a spring of its own (CSS changes without a transition)
+ if !own_motion {
+ e = e.motion(Spring::NONE);
+ }
+ if cx.marks == before {
+ e = e.instant_changes();
+ }
+ let (pad, bw) = padding(&c);
+ cx.boxes.insert(id, [pad[3], pad[0], pad[1], pad[2], bw[3], bw[0], bw[1], bw[2]]);
+ Some(boxed(e, &c, &inh, display == Display::Flex, path, cx.report))
+}
+
+/// A block's children: a stretched column, or a wrapping row when every child is inline (CSS's line boxes, as near
+/// as flex comes).
+fn block(tree: &Tree, n: &Node, inh: &Inherit, path: &str, cx: &mut Ctx) -> El {
+ let live = cx.live;
+ let inline: Vec<bool> = n.children.iter().filter_map(|c| Some((*c, tree.get(*c)?))).map(|(c, k)| k.kind == "text" || display_of(c, k, &live) == Display::Inline).collect();
+ let all = !inline.is_empty() && inline.iter().all(|i| *i);
+ if all && inline.len() > 1 {
+ cx.report.note(path, "inline layout", &format!("{} inline children", inline.len()), "inline formatting drawn as a wrapping row");
+ } else if !all && inline.iter().any(|i| *i) {
+ cx.report.note(path, "inline layout", "inline and block children mixed", "each inline child drawn on its own line");
+ }
+ let b = if all { row().flex_wrap() } else { col().items_stretch() };
+ b.children(kids(tree, n, inh, path, cx))
+}
+
+/// An image: its pixels when its source loads (images.rs), sized by its style or its own aspect, else an empty box and
+/// a report.
+fn img(n: &Node, path: &str, cx: &mut Ctx) -> El {
+ let src = n.props.get("src").and_then(Value::as_str).unwrap_or("");
+ match cx.images.get(src) {
+ Ok(image) => el().pixels(image.pixels()),
+ Err(why) => {
+ cx.report.note(path, "img src", src, "an image source the host can't load");
+ let _ = why;
+ el()
+ }
+ }
+}
+
+/// A text field (R3 makes it editable): its value, or its placeholder at half the text's colour (preflight's).
+fn field(id: u64, n: &Node, inh: &Inherit, cx: &mut Ctx) -> El {
+ let blank = TextEdit::new(n.props.get("value").and_then(Value::as_str).unwrap_or(""));
+ let edit = cx.edits.get(&id).unwrap_or(&blank);
+ let placeholder = n.props.get("placeholder").and_then(Value::as_str).unwrap_or("");
+ let input = crate::events::field(id, edit, text_style(inh), inh.color, placeholder).grow(1.0);
+ row().items_center().child(input)
+}
+
+/// The element's own line height in points (0: Rune's default, for `normal`).
+fn line_px(inh: &Inherit) -> f32 {
+ match inh.line {
+ Len::Px(p) => p,
+ Len::Pct(p) => inh.size * p / 100.0,
+ Len::Auto => 0.0,
+ }
+}
+
+fn text_style(inh: &Inherit) -> TextStyle {
+ // each line at least the strut tall, as a line box is
+ let line = line_px(inh).max(inh.strut);
+ let family = match inh.family {
+ None | Some("Inter") | Some("sans-serif") | Some("ui-sans-serif") | Some("system-ui") => Family::Sans,
+ Some("monospace") | Some("ui-monospace") => Family::Mono,
+ Some(f) => Family::Named(f),
+ };
+ TextStyle { family, line_height: line, tracking: inh.tracking, italic: inh.italic, ..TextStyle::new(inh.size, inh.weight) }
+}
+
+fn text_el(s: &str, inh: &Inherit, cx: &Ctx) -> El {
+ let style = text_style(inh);
+ let a = match inh.align {
+ Align::Center => rune::Align::Center,
+ Align::End => rune::Align::End,
+ _ => rune::Align::Start,
+ };
+ // inert: a text node never listens, so presses and hovers go to the element under it, as DOM events target the
+ // element around a text (Rune ends a press at plain text that isn't selectable)
+ let e = text(s).font(style).color(inh.color).wrap().align(a).inert().transition(Transition::none());
+ // Rune rounds a text's width up to a whole pixel; a browser doesn't (measure.rs). The unrounded width as the text's own,
+ // which a container's intrinsic size reads (a max width it ignores), shrinkable so a short line still wraps.
+ // Start-aligned text paints the same in that box; centred and end-aligned text keep Rune's width
+ if matches!(inh.align, Align::Center | Align::End) { e } else { e.w(cx.measure.width(s, style)).shrink() }
+}
+
+fn inherit(inh: &Inherit, c: &Css) -> Inherit {
+ let mut o = inh.clone();
+ if let Some(v) = c.color {
+ o.color = v;
+ }
+ if let Some(v) = c.font_size {
+ o.size = v;
+ }
+ if let Some(v) = c.font_weight {
+ o.weight = v;
+ }
+ if let Some(f) = &c.font_family {
+ o.family = Some(intern(f));
+ }
+ if let Some(v) = c.line_height {
+ o.line = v;
+ }
+ if let Some(v) = c.letter_spacing {
+ o.tracking = v;
+ }
+ if let Some(v) = c.text_align {
+ o.align = v;
+ }
+ if let Some(v) = c.italic {
+ o.italic = v;
+ }
+ o
+}
+
+/// A family name as Rune's `Family::Named` wants it: 'static, each name leaked once.
+fn intern(s: &str) -> &'static str {
+ use std::sync::{Mutex, OnceLock};
+ static NAMES: OnceLock<Mutex<Vec<&'static str>>> = OnceLock::new();
+ let mut names = NAMES.get_or_init(Default::default).lock().unwrap();
+ if let Some(n) = names.iter().find(|n| **n == s) {
+ return n;
+ }
+ let n: &'static str = Box::leak(s.to_string().into_boxed_str());
+ names.push(n);
+ n
+}
+
+/// Props other than `style` that the host reads, and a report for the rest.
+fn props(n: &Node, path: &str, report: &mut Report) {
+ for k in n.props.keys() {
+ let known = k == "style" || k == "className" || k.starts_with("data-") || k.starts_with("aria-") || matches!(k.as_str(), "role" | "id" | "tabIndex" | "value" | "placeholder" | "disabled" | "type" | "name" | "src" | "alt");
+ if !known {
+ report.add(path, css::Unmapped { prop: k.clone(), value: n.props[k].to_string(), why: "a prop the Rune host doesn't read" });
+ }
+ }
+}
+
+const ROLES: [&str; 20] = [
+ "button", "switch", "checkbox", "textbox", "link", "list", "listitem", "listbox", "option", "tab", "tablist", "dialog", "img", "heading", "group", "slider", "menu", "menuitem", "progressbar", "radio",
+];
+
+fn a11y(mut e: El, n: &Node) -> El {
+ let role = n.props.get("role").and_then(Value::as_str).or(match n.kind.as_str() {
+ "button" => Some("button"),
+ "editableText" => Some("textbox"),
+ "a" => Some("link"),
+ "img" => Some("img"),
+ _ => None,
+ });
+ if let Some(r) = role.and_then(|r| ROLES.iter().find(|x| **x == r)) {
+ e = e.role(r);
+ }
+ if let Some(l) = n.props.get("aria-label").and_then(Value::as_str) {
+ e = e.label(l);
+ }
+ if let Some(c) = n.props.get("aria-checked") {
+ e = e.checked(c == true || c == "true");
+ }
+ if n.props.get("disabled").is_some_and(|d| d == true) {
+ e = e.disabled(true);
+ }
+ e
+}
+
+/// The box props: size, spacing, position, paint.
+/// The padding Rune lays out with, top, right, bottom, left, and the border widths: CSS borders take room inside the
+/// border box, and Rune's border is paint only, so their widths join the padding
+fn padding(c: &Css) -> ([f32; 4], [f32; 4]) {
+ let bw = c.border_width.map(|w| w.unwrap_or(0.0));
+ (std::array::from_fn(|i| c.padding[i].unwrap_or(0.0) + bw[i]), bw)
+}
+
+fn boxed(mut e: El, c: &Css, inh: &Inherit, flex: bool, path: &str, report: &mut Report) -> El {
+ let mut note = |what: &str, v: &Len, why: &'static str| report.note(path, what, &format!("{v:?}"), why);
+ for (v, what) in [(c.width, "width"), (c.height, "height")] {
+ match v {
+ Some(Len::Px(p)) => e = if what == "width" { e.w(p) } else { e.h(p) },
+ Some(Len::Pct(p)) if (p - 100.0).abs() < 1e-3 => e = if what == "width" { e.w_full() } else { e.h_full() },
+ Some(l @ Len::Pct(_)) => note(what, &l, "only 100% sizes are mapped"),
+ _ => {}
+ }
+ }
+ for (v, f) in [(c.min_width, El::min_w as fn(El, f32) -> El), (c.min_height, El::min_h), (c.max_width, El::max_w), (c.max_height, El::max_h)] {
+ match v {
+ Some(Len::Px(p)) => e = f(e, p),
+ Some(l @ Len::Pct(_)) => note("min/max size", &l, "only px min and max sizes are mapped"),
+ _ => {}
+ }
+ }
+ if let Some(g) = c.grow.filter(|g| *g > 0.0) {
+ e = e.grow(g);
+ } else if c.shrink.is_some_and(|s| s > 0.0) {
+ e = e.shrink();
+ }
+ // Rune's grow(g) is `flex: g 1 0`, so a zero basis beside a grow is exact (flex-1); any other basis isn't
+ let zero = |b: &Len| matches!(b, Len::Px(0.0) | Len::Pct(0.0));
+ if let Some(b) = c.basis.filter(|b| *b != Len::Auto && !(zero(b) && c.grow.is_some_and(|g| g > 0.0))) {
+ note("flexBasis", &b, "Rune sets no flex-basis of its own");
+ }
+ if let Some(a) = c.align_items {
+ e = match a {
+ Align::Start => e.items_start(),
+ Align::End => e.items_end(),
+ Align::Center => e.items_center(),
+ _ => e.items_stretch(),
+ };
+ }
+ if let Some(a) = c.align_self {
+ e = match a {
+ Align::Start => e.self_start(),
+ Align::End => e.self_end(),
+ Align::Center => e.self_center(),
+ _ => e.self_stretch(),
+ };
+ }
+ if let Some(j) = c.justify {
+ e = match j {
+ Align::Start | Align::Stretch => e.justify_start(),
+ Align::End => e.justify_end(),
+ Align::Center => e.justify_center(),
+ Align::Between => e.justify_between(),
+ Align::Around => e.justify_around(),
+ Align::Evenly => e.justify_evenly(),
+ };
+ }
+ if flex && (c.row_gap.is_some() || c.column_gap.is_some()) {
+ e = e.gaps(c.row_gap.unwrap_or(0.0), c.column_gap.unwrap_or(0.0));
+ }
+ let (pad, bw) = padding(c);
+ e = e.pt(pad[0]).pr(pad[1]).pb(pad[2]).pl(pad[3]);
+ for (i, m) in c.margin.iter().enumerate() {
+ match m {
+ Some(Len::Px(p)) => e = [El::mt as fn(El, f32) -> El, El::mr, El::mb, El::ml][i](e, *p),
+ Some(l) => note("margin", l, "auto and % margins aren't mapped"),
+ None => {}
+ }
+ }
+ if c.absolute {
+ e = e.pin(c.inset[3], c.inset[0], c.inset[1], c.inset[2]);
+ }
+ e = paint(e, c, inh, bw, path, report);
+ e
+}
+
+fn paint(mut e: El, c: &Css, inh: &Inherit, bw: [f32; 4], path: &str, report: &mut Report) -> El {
+ if let Some(b) = c.background {
+ e = e.fill(b);
+ }
+ if let Some((angle, stops)) = &c.gradient {
+ e = e.linear_gradient(*angle, stops);
+ }
+ let radius = c.radius.map(|r| r.unwrap_or(0.0));
+ if radius.iter().any(|r| *r > 0.0) {
+ e = e.corners(radius);
+ }
+ let border = c.border_color.unwrap_or(inh.color);
+ if bw.iter().all(|w| *w == bw[0]) {
+ if bw[0] > 0.0 {
+ e = e.border(bw[0], border);
+ }
+ } else {
+ // one-sided borders: a line pinned along each side (Rune draws only a ring)
+ if radius.iter().any(|r| *r > 0.0) {
+ report.note(path, "border", "one-sided with a radius", "one-sided borders are drawn square");
+ }
+ let [t, r, b, l] = bw;
+ let line = |e: El, w: f32, pin: (Option<f32>, Option<f32>, Option<f32>, Option<f32>), horizontal: bool| {
+ if w <= 0.0 {
+ return e;
+ }
+ let ln = el().fill(border).inert().pin(pin.0, pin.1, pin.2, pin.3);
+ e.child(if horizontal { ln.h(w) } else { ln.w(w) })
+ };
+ e = line(e, t, (Some(0.0), Some(0.0), Some(0.0), None), true);
+ e = line(e, b, (Some(0.0), None, Some(0.0), Some(0.0)), true);
+ e = line(e, l, (Some(0.0), Some(0.0), None, Some(0.0)), false);
+ e = line(e, r, (None, Some(0.0), Some(0.0), Some(0.0)), false);
+ }
+ for s in &c.shadows {
+ e = e.box_shadow(Shadow { x: s.x, y: s.y, blur: s.blur, spread: s.spread, color: s.color, inset: s.inset });
+ }
+ if let Some(o) = c.opacity {
+ e = e.opacity(o);
+ }
+ match (c.overflow_x, c.overflow_y) {
+ (Overflow::Scroll, Overflow::Scroll) => e = e.scroll_xy(),
+ (Overflow::Scroll, _) => e = e.scroll_x(),
+ (_, Overflow::Scroll) => e = e.scroll(ScrollSpec { stick_bottom: false }),
+ (Overflow::Hidden, _) | (_, Overflow::Hidden) => e = e.clip_corners(radius),
+ _ => {}
+ }
+ e
+}
diff --git a/engine/rune/page/tests/motion.rs b/engine/rune/page/tests/motion.rs
new file mode 100644
index 00000000..68ec5b10
--- /dev/null
+++ b/engine/rune/page/tests/motion.rs
@@ -0,0 +1,58 @@
+//! T3c (docs/targets.feature): transitions become curves of their duration on a page, so a hover fades and slides as it
+//! would in a browser; without a transition a change lands at once. style/tests/motion.rs checks the parsing.
+
+use raea_rune_page::page::Page;
+use raea_rune_page::session::Session;
+use serde_json::json;
+
+/// One 160x40 box with `class` at the top left (wide enough to stay under the pointer when it slides 40), and its drawn element after each of `frames` frames once it's hovered.
+fn hovered(class: &str, frames: usize) -> Vec<rune::ElementInfo> {
+ let mut s = Session::new(Page::default(), (400.0, 300.0));
+ let batch = json!({"v": 1, "ops": [{"op": "create", "id": 1, "kind": "div", "props": {"className": format!("w-40 h-10 {class}")}}, {"op": "append", "parent": 0, "child": 1}]});
+ s.apply(&batch.to_string()).unwrap();
+ s.frame();
+ s.pointer_move(100.0, 20.0);
+ (0..frames)
+ .map(|_| {
+ s.frame();
+ s.rt.elements().into_iter().find(|e| e.key.as_deref() == Some("w1")).unwrap()
+ })
+ .collect()
+}
+
+#[test]
+fn a_hover_fades_and_slides_over_the_transitions_duration() {
+ // 100 ms linear: six frames at 60 fps; the restyle lands a frame after the hover
+ let f = hovered("opacity-100 hover:opacity-50 hover:translate-x-10 transition duration-100 ease-linear", 12);
+ let (o, x): (Vec<f32>, Vec<f32>) = f.iter().map(|e| (e.opacity, e.rect[0])).unzip();
+ assert!(o.windows(2).all(|w| w[1] <= w[0] + 1e-4) && x.windows(2).all(|w| w[1] >= w[0] - 1e-4), "monotonic: {o:?} {x:?}");
+ // linear over 100 ms: an equal step each 1/60 s frame (a sixth of the way), so the whole change takes six frames
+ // counted from where it began (the frames before the first recorded one included)
+ let steps = |v: &[f32], from: f32, to: f32| -> f32 {
+ let step = (to - from) / 6.0;
+ let moving: Vec<f32> = v.iter().copied().take_while(|a| (a - to).abs() > 1e-3).collect();
+ for w in moving.windows(2) {
+ assert!((w[1] - w[0] - step).abs() < 1e-3 * (to - from).abs().max(1.0), "an even step each frame: {v:?}");
+ }
+ (moving[0] - from) / step + moving.len() as f32
+ };
+ assert!((steps(&o, 1.0, 0.5) - 6.0).abs() < 1e-2, "{o:?}");
+ assert!((steps(&x, 0.0, 40.0) - 6.0).abs() < 1e-2, "{x:?}");
+ assert_eq!((*o.last().unwrap(), *x.last().unwrap()), (0.5, 40.0));
+}
+
+#[test]
+fn without_a_transition_a_hover_lands_at_once() {
+ let f = hovered("bg-white hover:bg-black hover:translate-x-10", 3);
+ let at = f.iter().position(|e| e.rect[0] > 0.0).expect("the hover lands");
+ assert_eq!(f[at].rect[0], 40.0);
+ assert_eq!(f[at].fill, rune::Color::BLACK);
+}
+
+#[test]
+fn colours_spring_for_the_transitions_duration() {
+ let f = hovered("bg-white hover:bg-black transition-colors duration-200", 20);
+ let at = f.iter().position(|e| e.fill != rune::Color::WHITE).expect("it changes");
+ assert_ne!(f[at].fill, rune::Color::BLACK, "on its way, not landed");
+ assert_eq!(f.last().unwrap().fill, rune::Color::BLACK, "settled within 20 frames of a 200 ms spring");
+}
diff --git a/engine/rune/page/tests/variants.rs b/engine/rune/page/tests/variants.rs
new file mode 100644
index 00000000..0c2b5388
--- /dev/null
+++ b/engine/rune/page/tests/variants.rs
@@ -0,0 +1,114 @@
+//! T3b (docs/targets.feature): Tailwind's variants resolve per element and per state. The cascade follows Tailwind
+//! 4.3.3's order, and through a headless session hover, active, focus, focus-visible, disabled, dark and the
+//! breakpoints restyle what they're on (seen here as the widths they set).
+
+use raea_rune_page::page::Page;
+use raea_rune_page::session::Session;
+use raea_rune_page::tailwind::style_in;
+use raea_rune_page::variants::State;
+use serde_json::json;
+
+#[test]
+fn variants_hold_per_state_in_tailwinds_order() {
+ let at = |s: State| style_in("w-1 hover:w-2 focus:w-3 md:w-4 md:hover:w-5 lg:w-6 dark:w-7 dark:hover:w-8", &s).0["width"].clone();
+ let w = |n: f64| json!(n * 4.0);
+ assert_eq!(at(State::default()), w(1.0));
+ assert_eq!(at(State { hover: true, ..State::default() }), w(2.0));
+ // focus comes after hover in Tailwind's CSS, so it wins when both hold
+ assert_eq!(at(State { hover: true, focus: true, ..State::default() }), w(3.0));
+ // breakpoints are min-widths (md: 48rem), after the pseudo-classes; md:hover: sits between md: and lg:
+ assert_eq!(at(State { focus: true, width: 768.0, ..State::default() }), w(4.0));
+ assert_eq!(at(State { hover: true, width: 800.0, ..State::default() }), w(5.0));
+ assert_eq!(at(State { hover: true, width: 1024.0, ..State::default() }), w(6.0));
+ assert_eq!(at(State { width: 767.0, ..State::default() }), w(1.0));
+ // dark: comes last, and dark:hover: after it
+ assert_eq!(at(State { dark: true, width: 1100.0, ..State::default() }), w(7.0));
+ assert_eq!(at(State { dark: true, hover: true, width: 1100.0, ..State::default() }), w(8.0));
+ // focus-visible needs the focus; enabled and disabled only a control
+ let fv = |s: State| style_in("w-1 focus-visible:w-2 disabled:w-3", &s).0["width"].clone();
+ assert_eq!(fv(State { focus_visible: true, ..State::default() }), w(1.0));
+ assert_eq!(fv(State { focus: true, focus_visible: true, ..State::default() }), w(2.0));
+ assert_eq!(fv(State { disabled: true, ..State::default() }), w(1.0));
+ assert_eq!(fv(State { disabled: true, control: true, ..State::default() }), w(3.0));
+}
+
+#[test]
+fn unmapped_variants_are_reported_in_any_state() {
+ let (_, unknown) = style_in("hover:bg-red-500 md:flex dark:hover:ring-2 group-hover:flex first:p-2 placeholder:text-sm -mt-2 p-4", &State::default());
+ assert_eq!(unknown, ["dark:hover:ring-2", "group-hover:flex", "first:p-2", "placeholder:text-sm", "-mt-2"]);
+}
+
+/// A page of three: a box with `class` (id 1) after a focusable one (id 2) to Tab from, under an 800x600 viewport.
+fn page(class: &str, kind: &str) -> Session {
+ let mut s = Session::new(Page::default(), (800.0, 600.0));
+ let batch = json!({"v": 1, "ops": [
+ {"op": "create", "id": 2, "kind": "div", "props": {"tabIndex": 0, "style": {"width": 10, "height": 10}}},
+ {"op": "create", "id": 1, "kind": kind, "props": {"className": class, "tabIndex": 0, "style": {"height": 20}}},
+ {"op": "append", "parent": 0, "child": 2}, {"op": "append", "parent": 0, "child": 1}]});
+ s.apply(&batch.to_string()).unwrap();
+ s.take_out();
+ s
+}
+
+fn width(s: &Session) -> Option<f32> {
+ s.rect(1).filter(|r| r[2] > 0.0).map(|r| r[2])
+}
+
+#[test]
+fn hover_restyles_through_runes_own_hover() {
+ let mut s = page("w-10 hover:w-20", "div");
+ assert_eq!(width(&s), Some(40.0));
+ s.hover_el(1);
+ assert_eq!(width(&s), Some(80.0));
+ s.pointer_move(700.0, 500.0);
+ s.frame();
+ assert_eq!(width(&s), Some(40.0));
+}
+
+#[test]
+fn a_press_focuses_without_showing_it_and_tab_shows_it() {
+ let mut s = page("w-10 focus:w-16 focus-visible:w-20", "div");
+ s.click_el(1);
+ s.frame();
+ assert_eq!(width(&s), Some(64.0), "focused by a press: focus, not focus-visible");
+ s.click_el(2);
+ s.key(rune::Key::Tab);
+ s.frame();
+ assert_eq!(s.rt.state.focus(), Some(1));
+ assert_eq!(width(&s), Some(80.0), "focused by Tab: focus-visible");
+ // a press on what already has the focus leaves it visible, as Chrome does
+ s.click_el(1);
+ s.frame();
+ assert_eq!(width(&s), Some(80.0));
+ // past the last, Tab leaves the page
+ s.key(rune::Key::Tab);
+ s.frame();
+ assert_eq!(s.rt.state.focus(), None);
+ assert_eq!(width(&s), Some(40.0));
+}
+
+#[test]
+fn dark_and_the_breakpoints_follow_the_system_and_the_window() {
+ let mut s = page("hidden w-10 md:flex dark:w-20", "div");
+ assert_eq!(width(&s), Some(40.0), "md: holds at 800");
+ s.set_dark(true);
+ s.frame();
+ assert_eq!(width(&s), Some(80.0));
+ s.resize(600.0, 600.0);
+ s.frame();
+ assert_eq!(width(&s), None, "below md: hidden");
+ s.set_dark(false);
+ s.resize(1100.0, 600.0);
+ s.frame();
+ assert_eq!(width(&s), Some(40.0));
+}
+
+#[test]
+fn disabled_is_a_controls() {
+ let mut s = page("w-10 disabled:w-20", "button");
+ assert_eq!(width(&s), Some(40.0));
+ let off = json!({"v": 1, "ops": [{"op": "update", "id": 1, "set": {"disabled": true}}]});
+ s.apply(&off.to_string()).unwrap();
+ s.frame();
+ assert_eq!(width(&s), Some(80.0));
+}
diff --git a/engine/rune/src/js.rs b/engine/rune/src/js.rs
new file mode 100644
index 00000000..fd31b3f3
--- /dev/null
+++ b/engine/rune/src/js.rs
@@ -0,0 +1,290 @@
+//! A bundled TSX app run in the host (R4a): raea-runtime-jsengine's engine (JavaScriptCore on Apple, QuickJS
+//! elsewhere) with the natives @raea/ui's wire.ts talks to a host through. What the JS hands the host (op batches, asks,
+//! calls) and what the host has for the JS (events, host events, layout snapshots) go back and forth until neither has
+//! anything left: `Js::pump`, against a `Host` (the headless session, or a window's page, R7a). JS time is the host's
+//! clock: virtual headless, so a run is the same every time.
+
+use std::cell::{Cell, RefCell};
+use std::collections::BTreeMap;
+use std::rc::Rc;
+use std::sync::Arc;
+use std::sync::mpsc::{Receiver, Sender, channel};
+
+use raea_io_net_calls::{CALLS, Net};
+use raea_runtime_jsengine::{Arg, Engine, JsEngine, Native, Ret, arg};
+use serde_json::{Value, json};
+
+use crate::page::{Out, Page};
+use crate::session::Session;
+
+/// The platform a bundle expects (console, microtasks, timers on the host's clock).
+pub const PRELUDE: &str = include_str!("prelude.js");
+
+/// What the JS pumps against.
+pub trait Host {
+ /// The clock, in seconds.
+ fn clock(&self) -> f64;
+ /// An op batch from the JS.
+ fn apply(&mut self, batch: &str) -> Result<(), String>;
+ /// An `__ui_emit` from the JS.
+ fn emit(&mut self, name: &str, v: &Value);
+ /// What the JS hasn't been sent, taken.
+ fn take_out(&mut self) -> Vec<Out>;
+}
+
+/// What the JS handed the host since the last pump.
+#[derive(Default)]
+struct Asks {
+ flushed: Vec<String>,
+ emits: Vec<(String, String)>,
+ /// a call's id, name and args (JSON)
+ calls: Vec<(u64, String, String)>,
+}
+
+/// The host calls the native target answers (docs/targets.feature T2a): net.* by raea-io-net-calls, as the web
+/// target does. Their answers and a socket's events (the wire's `answer` and `named` messages) come back on `rx`, from
+/// whichever thread has them, and go to the JS at the next pump.
+struct Calls {
+ net: Net<()>,
+ tx: Sender<Value>,
+ rx: Receiver<Value>,
+ refused: Refused,
+}
+
+/// The calls this host refused (T2c), by name: why, and how many times. The check lists them beside unmapped.json.
+pub type Refused = Rc<RefCell<BTreeMap<String, (String, u32)>>>;
+
+/// Why `name` isn't answered here: the world API is the web target's until T6, anything else this host lacks.
+fn refusal(name: &str) -> String {
+ if name.starts_with("world.") || name.starts_with("registry.") || name.starts_with("schedule.") {
+ format!("{name}: no world on the native target (targets.feature T6)")
+ } else {
+ format!("the Rune host has no {name}")
+ }
+}
+
+fn refuse(refused: &Refused, name: &str) -> String {
+ refuse_as(refused, name, refusal(name))
+}
+
+fn refuse_as(refused: &Refused, name: &str, why: String) -> String {
+ refused.borrow_mut().entry(name.to_string()).or_insert_with(|| (why.clone(), 0)).1 += 1;
+ why
+}
+
+impl Calls {
+ fn new(refused: Refused) -> Calls {
+ let (tx, rx) = channel();
+ let push = tx.clone();
+ let net = Net::new(Arc::new(move |(), ev| {
+ let _ = push.send(ev);
+ }));
+ Calls { net, tx, rx, refused }
+ }
+
+ /// Call `id`: answered here (now or later), or refused as a call this host doesn't have.
+ fn call(&self, id: u64, name: &str, args: &str) {
+ let tx = self.tx.clone();
+ let done = Box::new(move |r| {
+ let _ = tx.send(raea_core_wire::answer(id, r));
+ });
+ let args = || serde_json::from_str(args).unwrap_or(Value::Null);
+ if CALLS.contains(&name) {
+ self.net.call((), name, args(), done);
+ } else if raea_io_os::CALLS.contains(&name) {
+ // a headless pick, save or dialog no step answers is refused and listed, as a call this host lacks is
+ match raea_io_os::unscripted(name) {
+ Some(why) => done(Err(refuse_as(&self.refused, name, why))),
+ None => raea_io_os::call(name, args(), done),
+ }
+ } else {
+ done(Err(refuse(&self.refused, name)));
+ }
+ }
+}
+
+/// The engine with a bundle running in it.
+pub struct Js {
+ js: Box<dyn JsEngine>,
+ asks: Rc<RefCell<Asks>>,
+ calls: Calls,
+ now: Rc<Cell<f64>>,
+ /// what the page logged, as `level: text` (0 log, 1 warn, 2 error)
+ pub logs: Rc<RefCell<Vec<String>>>,
+ /// the calls, async and sync, this host refused
+ pub refused: Refused,
+}
+
+/// Rounds of back and forth one pump allows: a page and host still answering each other past this are a loop.
+const ROUNDS: usize = 256;
+
+impl Js {
+ /// A fresh engine with the natives and the prelude; `bundle` runs with `eval` once the host is ready for it.
+ pub fn new() -> Result<Js, String> {
+ let asks: Rc<RefCell<Asks>> = Rc::default();
+ let now = Rc::new(Cell::new(0.0));
+ let logs: Rc<RefCell<Vec<String>>> = Rc::default();
+ let refused: Refused = Rc::default();
+ let mut js = Engine::default().start()?;
+ let push = |a: &Rc<RefCell<Asks>>, f: fn(&mut Asks, &[String])| -> Native {
+ let a = a.clone();
+ Box::new(move |x| {
+ let args: Vec<String> = (0..3).map(|i| arg(x, i).to_string()).collect();
+ f(&mut a.borrow_mut(), &args);
+ Ok(Ret::Undefined)
+ })
+ };
+ let natives: [(&str, Native); 6] = [
+ ("__ui_flush", push(&asks, |a, x| a.flushed.push(x[0].clone()))),
+ ("__ui_emit", push(&asks, |a, x| a.emits.push((x[0].clone(), x[1].clone())))),
+ ("__ui_call", push(&asks, |a, x| a.calls.push((x[0].parse::<f64>().unwrap_or(0.0) as u64, x[1].clone(), x[2].clone())))),
+ // no synchronous host calls yet: each answers that it isn't there, as a host without it does
+ ("__ui_sync", {
+ let r = refused.clone();
+ Box::new(move |x| Ok(Ret::Str(json!({"err": refuse(&r, arg(x, 0))}).to_string())))
+ }),
+ ("__ui_log", {
+ let l = logs.clone();
+ Box::new(move |x| {
+ let (level, text) = (arg(x, 0), arg(x, 1));
+ if level != "0" {
+ eprintln!("raea-rune-host: js: {text}");
+ }
+ l.borrow_mut().push(format!("{level}: {text}"));
+ Ok(Ret::Undefined)
+ })
+ }),
+ ("__ui_now", {
+ let n = now.clone();
+ Box::new(move |_| Ok(Ret::Num(n.get())))
+ }),
+ ];
+ for (name, f) in natives {
+ js.native(name, f)?;
+ }
+ js.eval(PRELUDE, "prelude.js")?;
+ Ok(Js { js, asks, calls: Calls::new(refused.clone()), now, logs, refused })
+ }
+
+ /// `bundle` (a classic script: an IIFE that mounts its app) run, then the pump.
+ pub fn run(&mut self, bundle: &str, h: &mut impl Host) -> Result<(), String> {
+ self.now.set(h.clock() * 1e3);
+ self.js.eval(bundle, "app.js")?;
+ self.pump(h)
+ }
+
+ /// The JS's asks to the host and the host's messages to the JS, until neither has any.
+ pub fn pump(&mut self, h: &mut impl Host) -> Result<(), String> {
+ for _ in 0..ROUNDS {
+ self.now.set(h.clock() * 1e3);
+ let asks = std::mem::take(&mut *self.asks.borrow_mut());
+ let out = h.take_out();
+ let answered: Vec<Value> = self.calls.rx.try_iter().collect();
+ if asks.flushed.is_empty() && asks.emits.is_empty() && asks.calls.is_empty() && out.is_empty() && answered.is_empty() {
+ return Ok(());
+ }
+ for m in &answered {
+ self.call("__ui_deliver", &m.to_string())?;
+ }
+ for b in &asks.flushed {
+ h.apply(b)?;
+ }
+ for (name, v) in &asks.emits {
+ h.emit(name, &serde_json::from_str(v).unwrap_or(Value::Null));
+ }
+ for (id, name, args) in &asks.calls {
+ self.calls.call(*id, name, args);
+ }
+ for o in out {
+ match o {
+ Out::Deliver(m) => self.call("__ui_deliver", &m)?,
+ Out::Layout(l) => self.call("__ui_layout", &l)?,
+ }
+ }
+ }
+ Err(format!("the page and the host were still answering each other after {ROUNDS} rounds"))
+ }
+
+ /// Frame `n` at the host's clock: the JS's frame number, its timers due, then the pump. The ms to the next timer
+ /// (none: None).
+ pub fn frame(&mut self, n: u64, h: &mut impl Host) -> Result<Option<f64>, String> {
+ self.now.set(h.clock() * 1e3);
+ self.js.call("__ui_setFrame", &[Arg::Num(n as f64)]);
+ let next = self.timers()?;
+ self.pump(h)?;
+ Ok(next)
+ }
+
+ /// Each JS timer due by now, one call each (its microtasks run before the next); the ms to the next one after.
+ pub fn timers(&mut self) -> Result<Option<f64>, String> {
+ let now = self.now.get();
+ for _ in 0..10_000 {
+ match self.js.call("__ui_timers", &[Arg::Num(now)]) {
+ Some(Ok(n)) if n == 0.0 => continue,
+ Some(Ok(n)) if n > 0.0 => return Ok(Some(n)),
+ Some(Err(e)) => return Err(format!("timers: {e}")),
+ _ => return Ok(None),
+ }
+ }
+ Err("timers kept coming due at the same time".into())
+ }
+
+ fn call(&mut self, f: &str, s: &str) -> Result<(), String> {
+ match self.js.call(f, &[Arg::Str(s)]) {
+ Some(Err(e)) => Err(format!("{f}: {e}")),
+ _ => Ok(()),
+ }
+ }
+}
+
+impl Host for Session {
+ fn clock(&self) -> f64 {
+ Session::clock(self)
+ }
+ fn apply(&mut self, batch: &str) -> Result<(), String> {
+ Session::apply(self, batch)
+ }
+ fn emit(&mut self, name: &str, v: &Value) {
+ Session::emit(self, name, v)
+ }
+ fn take_out(&mut self) -> Vec<Out> {
+ Session::take_out(self)
+ }
+}
+
+/// A bundle run headless: the engine and the session its page lives in.
+pub struct App {
+ js: Js,
+ pub session: Session,
+ pub logs: Rc<RefCell<Vec<String>>>,
+ pub refused: Refused,
+}
+
+impl App {
+ /// `bundle` run in a fresh engine over a `viewport` page.
+ pub fn new(bundle: &str, viewport: (f32, f32)) -> Result<App, String> {
+ let mut js = Js::new()?;
+ let mut session = Session::new(Page::default(), viewport);
+ js.run(bundle, &mut session)?;
+ Ok(App { logs: js.logs.clone(), refused: js.refused.clone(), js, session })
+ }
+
+ /// The pump (Js::pump) against the session.
+ pub fn pump(&mut self) -> Result<(), String> {
+ self.js.pump(&mut self.session)
+ }
+
+ /// A frame: the session's (the clock moves on, Rune lays out), then the JS's.
+ pub fn frame(&mut self) -> Result<(), String> {
+ self.session.frame();
+ self.js.frame(self.session.frames(), &mut self.session).map(drop)
+ }
+
+ /// Input through the session (`f` drives it: a click, keys, a wheel), then the JS's timers and the pump.
+ pub fn input(&mut self, f: impl FnOnce(&mut Session)) -> Result<(), String> {
+ f(&mut self.session);
+ self.js.now.set(self.session.clock() * 1e3);
+ self.js.timers()?;
+ self.pump()
+ }
+}
diff --git a/engine/rune/src/lib.rs b/engine/rune/src/lib.rs
new file mode 100644
index 00000000..b920a571
--- /dev/null
+++ b/engine/rune/src/lib.rs
@@ -0,0 +1,25 @@
+//! raea-rune-host: applies raea's op wire (core/wire, the Rust half of sdk/ui's wire.ts) to a tree and draws that
+//! tree with Rune. docs/rune.feature in raea is the plan.
+
+// the page and its styles, from their crates (raea-rune-page, raea-rune-style), at the paths they had here
+pub use raea_rune_page::{css, dump, events, images, input, kit, layout, measure, motion, page, report, runeprops, session, state, tailwind, tree, variants, view};
+
+pub mod js;
+pub mod macapp;
+pub mod script;
+pub mod shot;
+pub mod video;
+pub mod window;
+
+/// The op protocol version this host speaks: core/wire's, so a wire bump reaches this crate as a build error.
+pub const OPS_VERSION: u32 = raea_core_wire::OPS_VERSION;
+
+#[cfg(test)]
+mod tests {
+ #[test]
+ fn links_rune_and_the_wire() {
+ // Both dependencies resolve and link: Rune's view API and the wire's version.
+ let _ = rune::col();
+ assert_eq!(super::OPS_VERSION, 1);
+ }
+}
diff --git a/engine/rune/src/macapp.rs b/engine/rune/src/macapp.rs
new file mode 100644
index 00000000..dd1b1c28
--- /dev/null
+++ b/engine/rune/src/macapp.rs
@@ -0,0 +1,58 @@
+//! A TSX app as a Mac app (R7b): `raea-rune-host bundle app.js [-o Name.app]`.
+//!
+//! The .app holds the app's script (Contents/Resources/app.js) and this host (Contents/MacOS/<name>), which, started
+//! with no arguments from inside an .app, opens that script in a window (`bundled`). The host signs it ad hoc, so it
+//! opens on the Mac that made it; `raea app bundle` then signs it as its developer asks (apps/targets sign.rs:
+//! `--identity`, `--notarize`, docs/targets.feature T1d), as it does a web app.
+
+use std::path::{Path, PathBuf};
+use std::process::Command;
+/// The bundle inside the .app this host runs from, if it does.
+pub fn bundled() -> Option<PathBuf> {
+ let exe = std::env::current_exe().ok()?;
+ let js = exe.parent()?.parent()?.join("Resources/app.js");
+ (exe.parent()?.ends_with("Contents/MacOS") && js.is_file()).then_some(js)
+}
+
+fn run(cmd: &mut Command) -> Result<String, String> {
+ let o = cmd.output().map_err(|e| format!("{cmd:?}: {e}"))?;
+ let text = format!("{}{}", String::from_utf8_lossy(&o.stdout), String::from_utf8_lossy(&o.stderr));
+ if !o.status.success() {
+ return Err(format!("{:?} failed: {}", cmd.get_program(), text.trim()));
+ }
+ Ok(text)
+}
+
+/// `src` (the app's script) as `out`, an app named `name` with window size `size`, signed ad hoc. What codesign said.
+pub fn make(src: &str, name: &str, size: (u32, u32), out: &Path) -> Result<Vec<String>, String> {
+ let _ = std::fs::remove_dir_all(out);
+ let contents = out.join("Contents");
+ let (macos, res) = (contents.join("MacOS"), contents.join("Resources"));
+ for d in [&macos, &res] {
+ std::fs::create_dir_all(d).map_err(|e| format!("{}: {e}", d.display()))?;
+ }
+ std::fs::write(res.join("app.js"), src).map_err(|e| e.to_string())?;
+ std::fs::write(res.join("size"), format!("{}x{}", size.0, size.1)).map_err(|e| e.to_string())?;
+ let exe = std::env::current_exe().map_err(|e| e.to_string())?;
+ std::fs::copy(&exe, macos.join(name)).map_err(|e| format!("{}: {e}", exe.display()))?;
+ let id: String = name.chars().filter(char::is_ascii_alphanumeric).collect::<String>().to_lowercase();
+ let plist = format!(
+ r#"<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0"><dict>
+<key>CFBundleExecutable</key><string>{name}</string>
+<key>CFBundleIdentifier</key><string>io.raea.rune.{id}</string>
+<key>CFBundleName</key><string>{name}</string>
+<key>CFBundlePackageType</key><string>APPL</string>
+<key>CFBundleShortVersionString</key><string>0.1.0</string>
+<key>CFBundleVersion</key><string>1</string>
+<key>LSMinimumSystemVersion</key><string>13.0</string>
+<key>NSHighResolutionCapable</key><true/>
+</dict></plist>
+"#
+ );
+ std::fs::write(contents.join("Info.plist"), plist).map_err(|e| e.to_string())?;
+
+ run(Command::new("codesign").args(["--force", "--deep", "--sign", "-"]).arg(out))?;
+ Ok(vec!["signed ad hoc: it opens on the Mac that made it".into()])
+}
diff --git a/engine/rune/src/main.rs b/engine/rune/src/main.rs
new file mode 100644
index 00000000..f3df06ec
--- /dev/null
+++ b/engine/rune/src/main.rs
@@ -0,0 +1,210 @@
+//! raea-rune-host: an app's script drawn by Rune. The script is the one raea bundles (`raea app run|check|bundle APP.tsx
+//! --target native` hands it here; runtime/bundle/lib app.rs), as the page host is handed its bundle: no bun (T1c).
+//!
+//! raea-rune-host run app.js [--size 800x600]
+//! raea-rune-host --headless app.js [--script steps.json] [--png out/] [--size 800x600] [--settle 12] [--video OUT.mp4 [--audio FILE]]
+//!
+//! Headless (R4b), how an agent checks its work: the app bundled and mounted, then each step of the script played
+//! through Rune's input. After the mount and after each step, `--settle` frames run on Rune's virtual clock and a PNG
+//! of the frame is written to the `--png` folder (00-mount.png, 01-press-inc.png, ...), and tree.json gets the element
+//! tree at each (keys, roles, labels, text, boxes). The same app and script give the same files every run.
+//!
+//! `--video OUT.mp4` (R8a) also films the session: every frame on the virtual clock at 60 fps, a cursor gliding to
+//! each element before it is pressed, through `raea media encode` (raea's encoder, signed), `--audio FILE` under it.
+//! video.json beside the PNGs has each frame's hash, so two runs can be compared frame for frame.
+//!
+//! `run` (R7a) opens the app in a native window through Rune's shell (window.rs) until it's closed: Rune's window, GPU
+//! and input, in real time.
+
+use std::path::{Path, PathBuf};
+
+use raea_rune_host::script::{self, Step};
+use raea_rune_host::{dump, js::App, shot::Shooter};
+use serde_json::json;
+
+struct Args {
+ app: PathBuf,
+ script: Option<PathBuf>,
+ out: PathBuf,
+ size: (u32, u32),
+ settle: u32,
+ mode: Mode,
+ video: Option<PathBuf>,
+ audio: Option<PathBuf>,
+ /// the window's title and the app's name (the file's name when left out)
+ title: Option<String>,
+}
+
+enum Mode {
+ Headless,
+ Window,
+ /// a .app at the path, signed ad hoc (R7b; raea signs it as its developer asks, T1d)
+ Bundle(PathBuf),
+}
+
+fn args() -> Result<Args, String> {
+ let mut it = std::env::args().skip(1);
+ let (mut app, mut script, mut out, mut size, mut settle) = (None, None, PathBuf::from("out"), (800, 600), 12);
+ let (mut headless, mut bundle, mut app_out) = (false, false, None);
+ let (mut video, mut audio, mut title) = (None, None, None);
+ while let Some(a) = it.next() {
+ let mut val = || it.next().ok_or_else(|| format!("{a} needs a value"));
+ match a.as_str() {
+ "--headless" => (headless, app) = (true, Some(PathBuf::from(val()?))),
+ "run" if app.is_none() => app = Some(PathBuf::from(val()?)),
+ "bundle" if app.is_none() => (bundle, app) = (true, Some(PathBuf::from(val()?))),
+ "-o" => app_out = Some(PathBuf::from(val()?)),
+ "--script" => script = Some(PathBuf::from(val()?)),
+ "--png" => out = PathBuf::from(val()?),
+ "--video" => video = Some(PathBuf::from(val()?)),
+ "--audio" => audio = Some(PathBuf::from(val()?)),
+ "--size" => {
+ let v = val()?;
+ let (w, h) = v.split_once('x').ok_or("--size is WxH")?;
+ size = (w.parse().map_err(|_| "--size is WxH")?, h.parse().map_err(|_| "--size is WxH")?);
+ }
+ "--title" => title = Some(val()?),
+ "--settle" => settle = val()?.parse().map_err(|_| "--settle is a number of frames")?,
+ "-h" | "--help" => return Err(USAGE.into()),
+ other => return Err(format!("{other}?\n{USAGE}")),
+ }
+ }
+ let app: PathBuf = app.ok_or(USAGE)?;
+ let mode = if headless {
+ // the system's clipboard, files, dialogs and browser stay untouched: the check's steps answer them (T2d)
+ raea_io_os::set_headless();
+ Mode::Headless
+ } else if bundle {
+ let name = app.file_stem().map_or("App".into(), |s| s.to_string_lossy().into_owned());
+ Mode::Bundle(app_out.unwrap_or_else(|| PathBuf::from(format!("{name}.app"))))
+ } else {
+ Mode::Window
+ };
+ Ok(Args { app, script, out, size, settle, mode, video, audio, title })
+}
+
+const USAGE: &str = "usage: raea-rune-host run app.js [--size 800x600] [--title T]\n raea-rune-host bundle app.js [-o App.app] [--size 800x600] [--title T]\n raea-rune-host --headless app.js [--script steps.json] [--png out/] [--size 800x600] [--settle 12] [--video OUT.mp4 [--audio FILE]]";
+
+/// The app's script: a bundle raea made. A source file is refused with what makes its script.
+fn script_of(app: &Path) -> Result<String, String> {
+ if app.extension().is_some_and(|x| x != "js") {
+ return Err(format!("{}: the host runs an app's script (one .js); `raea app run|check|bundle {} --target native` bundles it", app.display(), app.display()));
+ }
+ std::fs::read_to_string(app).map_err(|e| format!("{}: {e}", app.display()))
+}
+
+fn main() {
+ if let Err(e) = run() {
+ eprintln!("raea-rune-host: {e}");
+ std::process::exit(1);
+ }
+}
+
+fn run() -> Result<(), String> {
+ // inside a .app made by `bundle`: its app, in a window
+ if std::env::args().len() == 1 && let Some(js) = raea_rune_host::macapp::bundled() {
+ let src = std::fs::read_to_string(&js).map_err(|e| format!("{}: {e}", js.display()))?;
+ let size = std::fs::read_to_string(js.with_file_name("size")).ok().and_then(|s| s.trim().split_once('x').and_then(|(w, h)| Some((w.parse().ok()?, h.parse().ok()?)))).unwrap_or((800.0, 600.0));
+ let name = std::env::current_exe().ok().and_then(|e| e.file_name().map(|n| n.to_string_lossy().into_owned())).unwrap_or_default();
+ return raea_rune_host::window::run(src, &name, size);
+ }
+ let a = args()?;
+ let steps: Vec<Step> = match &a.script {
+ Some(p) => script::parse(&std::fs::read_to_string(p).map_err(|e| format!("{}: {e}", p.display()))?)?,
+ None => Vec::new(),
+ };
+ let src = script_of(&a.app);
+ let title = a.title.clone().unwrap_or_else(|| a.app.file_stem().map_or("app".into(), |s| s.to_string_lossy().into_owned()));
+ match &a.mode {
+ Mode::Window => return raea_rune_host::window::run(src?, &title, (a.size.0 as f32, a.size.1 as f32)),
+ Mode::Bundle(out) => {
+ for line in raea_rune_host::macapp::make(&src?, &title, a.size, out)? {
+ println!("{line}");
+ }
+ println!("{}", out.display());
+ return Ok(());
+ }
+ Mode::Headless => {}
+ }
+ std::fs::create_dir_all(&a.out).map_err(|e| format!("{}: {e}", a.out.display()))?;
+ let mut app = App::new(&src?, (a.size.0 as f32, a.size.1 as f32))?;
+ let film = a.video.as_deref().map(|v| raea_rune_host::video::start(&mut app.session, v, a.size, a.audio.as_deref())).transpose()?;
+ // one renderer per session: while filming, the stills are the film's own frames (video.rs, `last`)
+ let mut shooter = film.is_none().then(|| Shooter::new(a.size.0, a.size.1));
+ let mut trees = Vec::new();
+ let film_ref = film.as_ref();
+ let mut shoot = |app: &mut App, i: usize, name: &str| -> Result<(), String> {
+ for _ in 0..a.settle.max(film_ref.map_or(0, |_| 1)) {
+ app.frame()?;
+ }
+ let file = format!("{i:02}-{name}.png");
+ match (shooter.as_mut(), film_ref) {
+ (Some(s), _) => s.png(&mut app.session.rt, &a.out.join(&file))?,
+ (None, Some(f)) => f.png(&a.out.join(&file))?,
+ (None, None) => unreachable!("a shooter or a film"),
+ }
+ trees.push(json!({"step": i, "name": name, "png": file, "clock": app.session.clock(), "tree": dump::tree(&app.session)}));
+ Ok(())
+ };
+ shoot(&mut app, 0, "mount")?;
+ for (i, s) in steps.iter().enumerate() {
+ let glide = film.as_ref().map(|f| f.at());
+ if let Some(f) = &film {
+ f.glide(&mut app, s).map_err(|e| format!("step {}: {e}", i + 1))?;
+ }
+ let act = film.as_ref().map(|f| f.at());
+ script::play(&mut app, s).map_err(|e| format!("step {}: {e}", i + 1))?;
+ if let Some(f) = &film {
+ f.mark(json!({"step": i + 1, "name": name(s), "glide": glide, "act": act, "done": f.at()}));
+ }
+ shoot(&mut app, i + 1, &name(s))?;
+ }
+ let tree = a.out.join("tree.json");
+ std::fs::write(&tree, serde_json::to_string_pretty(&trees).unwrap()).map_err(|e| format!("{}: {e}", tree.display()))?;
+ // what the host couldn't map, never dropped quietly: said here and kept beside the frames
+ let unmapped: Vec<_> = app.session.rt.state.report.borrow().all().map(|(prop, s)| json!({"prop": prop, "value": s.value, "path": s.path, "why": s.why})).collect();
+ for u in &unmapped {
+ eprintln!("raea-rune-host: unmapped {}: {} at {} ({})", u["prop"].as_str().unwrap(), u["value"].as_str().unwrap(), u["path"].as_str().unwrap(), u["why"].as_str().unwrap());
+ }
+ let report = a.out.join("unmapped.json");
+ std::fs::write(&report, serde_json::to_string_pretty(&unmapped).unwrap()).map_err(|e| format!("{}: {e}", report.display()))?;
+ // and every call the app made that this host didn't answer (T2c), the same way
+ let unanswered: Vec<_> = app.refused.borrow().iter().map(|(name, (why, n))| json!({"call": name, "why": why, "times": n})).collect();
+ for (name, (why, n)) in app.refused.borrow().iter() {
+ eprintln!("raea-rune-host: unanswered {name} ({why}), {n} time{}", if *n == 1 { "" } else { "s" });
+ }
+ let report = a.out.join("unanswered.json");
+ std::fs::write(&report, serde_json::to_string_pretty(&unanswered).unwrap()).map_err(|e| format!("{}: {e}", report.display()))?;
+ println!("{} frames written to {}", trees.len(), shown(&a.out));
+ if let Some(f) = film {
+ let v = f.finish(&mut app.session)?;
+ let file = a.out.join("video.json");
+ std::fs::write(&file, serde_json::to_string_pretty(&v).unwrap()).map_err(|e| format!("{}: {e}", file.display()))?;
+ // raea's encoder says whether it signed the file (T1e): the public engine's doesn't
+ let credentials = v["encoded"]["credentials"].as_str().unwrap_or("its signing unreported");
+ println!("{} frames ({}) filmed to {}, {credentials}", v["frames"], v["hash"].as_str().unwrap_or(""), a.video.as_deref().map_or(String::new(), shown));
+ }
+ Ok(())
+}
+
+/// A step's file name: what it did, by its element.
+fn name(s: &Step) -> String {
+ let n = match s {
+ Step::Press { press } => format!("press-{press}"),
+ Step::Type { into, .. } => format!("type-{into}"),
+ Step::Wheel { wheel, .. } => format!("wheel-{wheel}"),
+ Step::Key { key } => format!("key-{key}"),
+ Step::Frames { frames } => format!("frames-{frames}"),
+ Step::Pick { pick } => format!("pick-{}", pick.len()),
+ Step::Save { .. } => "save".into(),
+ Step::Dialog { dialog } => format!("dialog-{dialog}"),
+ Step::Hover { hover } => format!("hover-{hover}"),
+ Step::Dark { dark } => format!("dark-{dark}"),
+ Step::Width { width } => format!("width-{width}"),
+ };
+ n.chars().map(|c| if c.is_ascii_alphanumeric() || c == '-' { c } else { '_' }).collect()
+}
+
+fn shown(p: &Path) -> String {
+ p.display().to_string()
+}
diff --git a/engine/rune/src/prelude.js b/engine/rune/src/prelude.js
new file mode 100644
index 00000000..b2816514
--- /dev/null
+++ b/engine/rune/src/prelude.js
@@ -0,0 +1,73 @@
+// What a bundle expects of its platform before it runs in raea-rune-host (R4a): the console, microtasks, timers the
+// host runs on Rune's virtual clock through __ui_timers(now), performance.now, process.env and the frame number. The
+// host's natives, installed first: __ui_log(level, text), __ui_now() (the virtual clock, ms), __ui_flush(json),
+// __ui_emit(name, json), __ui_call(id, name, json), __ui_sync(name, json).
+(() => {
+ const g = globalThis;
+ const str = (a) => a.map((x) => (x && x.stack) || (typeof x === "object" ? safe(x) : String(x))).join(" ");
+ const safe = (x) => {
+ try {
+ return JSON.stringify(x);
+ } catch {
+ return String(x);
+ }
+ };
+ g.console = {
+ log: (...a) => __ui_log(0, str(a)),
+ info: (...a) => __ui_log(0, str(a)),
+ debug: () => {},
+ warn: (...a) => __ui_log(1, str(a)),
+ error: (...a) => __ui_log(2, str(a)),
+ };
+ if (typeof g.queueMicrotask !== "function") g.queueMicrotask = (fn) => void Promise.resolve().then(fn);
+ // Timers on the host's clock: each is due at a whole millisecond, those due together run in the order they were set,
+ // and while one runs "now" is when it was due, so a timer it sets is due after it by its delay
+ let seq = 1;
+ let cur = null;
+ const timers = new Map();
+ const due = (ms) => Math.floor(cur ?? __ui_now()) + Math.max(0, Number(ms) || 0);
+ g.setTimeout = (fn, ms = 0, ...args) => {
+ const id = seq++;
+ timers.set(id, { at: due(ms), fn: () => fn(...args) });
+ return id;
+ };
+ // an interval runs again unless cleared, from its own callback too
+ const live = new Set();
+ g.setInterval = (fn, ms = 0, ...args) => {
+ const id = seq++;
+ const run = () => {
+ fn(...args);
+ if (live.has(id)) timers.set(id, { at: due(ms), fn: run });
+ };
+ live.add(id);
+ timers.set(id, { at: due(ms), fn: run });
+ return id;
+ };
+ g.clearInterval = g.clearTimeout = (id) => {
+ timers.delete(id);
+ live.delete(id);
+ };
+ // The earliest timer due by `now`, run alone (its microtasks run before the host's next call). Answers 0 when another
+ // is due by `now`, else ms to the next one, or -1 when none is set.
+ g.__ui_timers = (now) => {
+ let first = null;
+ for (const e of timers) if (e[1].at <= now && (first === null || e[1].at < first[1].at)) first = e;
+ if (first) {
+ timers.delete(first[0]);
+ cur = first[1].at;
+ try {
+ first[1].fn();
+ } catch (e) {
+ console.error(e);
+ }
+ cur = null;
+ }
+ let next = -1;
+ for (const t of timers.values()) next = next < 0 ? Math.max(0, t.at - now) : Math.min(next, Math.max(0, t.at - now));
+ return next;
+ };
+ g.performance = { now: () => __ui_now() };
+ g.process = { env: { NODE_ENV: "production" } };
+ g.__ui_frame = 0;
+ g.__ui_setFrame = (n) => void (g.__ui_frame = n);
+})();
diff --git a/engine/rune/src/script.rs b/engine/rune/src/script.rs
new file mode 100644
index 00000000..262b75dc
--- /dev/null
+++ b/engine/rune/src/script.rs
@@ -0,0 +1,106 @@
+//! A scripted session (R4b): the steps js/apps/steps.ts names (a press, text typed into a field, a wheel over an
+//! element, each by data-testid), plus a key at the focus and frames to wait, played through Rune's input. T3's set adds
+//! a hover (the pointer left over an element), the system's appearance and the window's width (docs/targets.feature T3a).
+
+use serde::Deserialize;
+
+use crate::js::App;
+
+#[derive(Clone, Debug, Deserialize)]
+#[serde(untagged)]
+pub enum Step {
+ /// a press and release in the middle of the element
+ Press { press: String },
+ /// the field pressed, the caret to its end, and the text typed a character at a time
+ Type { r#type: String, into: String },
+ /// a wheel over the element's middle, `dy` points (positive scrolls the content up)
+ Wheel { wheel: String, dy: f32 },
+ /// a key at the focus, by DOM's name ("Enter", "Escape", "ArrowDown", "a")
+ Key { key: String },
+ /// frames to run with no input
+ Frames { frames: u32 },
+ /// the files the app's next fs.pick picks (T2d: a headless check opens no dialog)
+ Pick { pick: Vec<String> },
+ /// the file the app's next fs.save saves to
+ Save { save: String },
+ /// the button pressed in the app's next dialog.message
+ Dialog { dialog: usize },
+ /// the pointer moved to the element's middle and left there (T3: hover)
+ Hover { hover: String },
+ /// the system's appearance (T3: Tailwind's dark:)
+ Dark { dark: bool },
+ /// the window's width at the same height (T3: a breakpoint)
+ Width { width: f32 },
+}
+
+/// `steps` as JSON: an array of steps.
+pub fn parse(json: &str) -> Result<Vec<Step>, String> {
+ serde_json::from_str(json).map_err(|e| format!("the script: {e}"))
+}
+
+/// DOM's key name as Rune's key.
+pub fn key(name: &str) -> rune::Key {
+ use rune::Key;
+ match name {
+ "Enter" => Key::Enter,
+ "Backspace" => Key::Backspace,
+ "Delete" => Key::Delete,
+ "ArrowLeft" => Key::Left,
+ "ArrowRight" => Key::Right,
+ "ArrowUp" => Key::Up,
+ "ArrowDown" => Key::Down,
+ "Home" => Key::Home,
+ "End" => Key::End,
+ "PageUp" => Key::PageUp,
+ "PageDown" => Key::PageDown,
+ "Escape" => Key::Escape,
+ "Tab" => Key::Tab,
+ t => Key::Text(t.into()),
+ }
+}
+
+/// `step` played on `app`.
+pub fn play(app: &mut App, step: &Step) -> Result<(), String> {
+ let el = |app: &App, t: &str| app.session.tid(t).ok_or_else(|| format!("no element with data-testid {t:?}"));
+ match step {
+ Step::Press { press } => {
+ let id = el(app, press)?;
+ app.input(|s| { let _ = s.click_el(id); })
+ }
+ Step::Type { r#type, into } => {
+ let id = el(app, into)?;
+ app.input(|s| { let _ = s.click_el(id); })?;
+ app.input(|s| s.key(rune::Key::End))?;
+ for c in r#type.chars() {
+ app.input(|s| s.key(rune::Key::Text(c.to_string())))?;
+ }
+ Ok(())
+ }
+ Step::Wheel { wheel, dy } => {
+ let id = el(app, wheel)?;
+ let r = app.session.rect(id).ok_or("the element has no box")?;
+ app.input(|s| s.wheel(r[0] + r[2] / 2.0, r[1] + r[3] / 2.0, *dy))
+ }
+ Step::Key { key: k } => app.input(|s| s.key(key(k))),
+ Step::Frames { frames } => {
+ for _ in 0..*frames {
+ app.frame()?;
+ }
+ Ok(())
+ }
+ Step::Pick { pick } => queue(raea_io_os::Scripted::Pick(pick.iter().map(Into::into).collect())),
+ Step::Save { save } => queue(raea_io_os::Scripted::Save(save.into())),
+ Step::Dialog { dialog } => queue(raea_io_os::Scripted::Dialog(*dialog)),
+ Step::Hover { hover } => {
+ let id = el(app, hover)?;
+ app.input(|s| { let _ = s.hover_el(id); })
+ }
+ Step::Dark { dark } => app.input(|s| s.set_dark(*dark)),
+ Step::Width { width } => app.input(|s| { let h = s.viewport().1; s.resize(*width, h) }),
+ }
+}
+
+fn queue(s: raea_io_os::Scripted) -> Result<(), String> {
+ raea_io_os::script(s);
+ Ok(())
+}
diff --git a/engine/rune/src/shot.rs b/engine/rune/src/shot.rs
new file mode 100644
index 00000000..294f7a0a
--- /dev/null
+++ b/engine/rune/src/shot.rs
@@ -0,0 +1,55 @@
+//! A frame drawn offscreen by Rune's own renderer and written as a PNG (R4b): what the window would show, at the
+//! session's viewport and scale 1, without a window.
+
+use std::path::Path;
+
+use rune::Runtime;
+use rune::render::{Gpu, OFFSCREEN_FORMAT, Offscreen, Renderer};
+
+use crate::page::Page;
+
+pub struct Shooter {
+ gpu: Gpu,
+ renderer: Renderer,
+ target: Offscreen,
+}
+
+impl Shooter {
+ /// A headless GPU and a `w` x `h` target.
+ pub fn new(w: u32, h: u32) -> Shooter {
+ let gpu = Gpu::headless();
+ let renderer = Renderer::new(&gpu.device, OFFSCREEN_FORMAT);
+ let target = Offscreen::with_format(&gpu.device, w, h, OFFSCREEN_FORMAT);
+ Shooter { gpu, renderer, target }
+ }
+
+ /// The runtime's last frame drawn: tightly packed sRGB RGBA8, `w * h * 4` bytes.
+ pub fn pixels(&mut self, rt: &mut Runtime<Page>) -> Vec<u8> {
+ let (w, h) = (self.target.width, self.target.height);
+ self.renderer.upload_images(&self.gpu.device, &self.gpu.queue, &mut rt.images);
+ self.renderer.prepare(&self.gpu.device, &self.gpu.queue, &mut rt.text.atlas, &rt.instances, (w, h));
+ let mut enc = self.gpu.device.create_command_encoder(&Default::default());
+ // a browser's canvas: white under a page that paints nothing there (Chrome is R5's reference)
+ self.renderer.draw(&mut enc, &self.target.view, [1.0, 1.0, 1.0, 1.0]);
+ self.target.copy(&mut enc);
+ self.renderer.submit(&self.gpu.queue, enc);
+ self.target.read(&self.gpu.device)
+ }
+
+ /// The runtime's last frame as a PNG at `path`.
+ pub fn png(&mut self, rt: &mut Runtime<Page>, path: &Path) -> Result<(), String> {
+ let px = self.pixels(rt);
+ write_png(path, self.target.width, self.target.height, &px)
+ }
+}
+
+/// RGBA8 pixels as a PNG file.
+pub fn write_png(path: &Path, w: u32, h: u32, px: &[u8]) -> Result<(), String> {
+ let f = std::fs::File::create(path).map_err(|e| format!("{}: {e}", path.display()))?;
+ let mut enc = png::Encoder::new(std::io::BufWriter::new(f), w, h);
+ enc.set_color(png::ColorType::Rgba);
+ enc.set_depth(png::BitDepth::Eight);
+ enc.set_source_srgb(png::SrgbRenderingIntent::Perceptual);
+ let mut wr = enc.write_header().map_err(|e| format!("{}: {e}", path.display()))?;
+ wr.write_image_data(px).map_err(|e| format!("{}: {e}", path.display()))
+}
diff --git a/engine/rune/src/video.rs b/engine/rune/src/video.rs
new file mode 100644
index 00000000..9106437b
--- /dev/null
+++ b/engine/rune/src/video.rs
@@ -0,0 +1,210 @@
+//! The session as video (R8a): every frame on the virtual clock, those inside a press or a drag too, drawn offscreen,
+//! a cursor painted where the pointer is, and piped as raw RGBA to `raea media encode`. raea's encoder makes the MP4,
+//! lays the sound under it and signs it (C2PA) like every raea export; this crate doesn't link it (the goal's rule:
+//! raea only through core/wire and runtime/jsengine). Each frame's FNV-1a hash is kept, so two runs can be compared
+//! frame for frame: the MP4's bytes differ by the signature's time, the frames don't.
+
+use std::cell::RefCell;
+use std::io::Write;
+use std::path::Path;
+use std::process::{Child, ChildStdin, Command, Stdio};
+use std::rc::Rc;
+
+use serde_json::{Value, json};
+
+use crate::js::App;
+use crate::script::Step;
+use crate::session::{FRAME, Session};
+use crate::shot::Shooter;
+
+struct Shared {
+ stdin: Option<ChildStdin>,
+ shooter: Shooter,
+ size: (u32, u32),
+ hashes: Vec<u64>,
+ /// the cursor is drawn once the pointer has first glided in
+ cursor: bool,
+ /// the arrow's size: a point of it per this many pixels (a 1080-wide view draws it 2.7 times its 400-wide size)
+ scale: f32,
+ /// each step: its name and the frames its glide starts, its action starts and it ends
+ marks: Vec<Value>,
+ /// the last frame before its cursor: what `png` writes (a second Shooter would miss glyphs: both renderers read
+ /// one atlas, and the first to prepare marks it uploaded)
+ last: Vec<u8>,
+ /// where the pointer was and how many frames it has stayed there: the cursor fades out when it rests
+ rest: ((f32, f32), u32),
+ err: Option<String>,
+}
+
+/// Frames the pointer rests before its cursor fades, and the frames the fade takes.
+const REST: u32 = 50;
+const FADE: u32 = 14;
+
+pub struct Video {
+ child: Child,
+ shared: Rc<RefCell<Shared>>,
+}
+
+/// Frames a glide to a step's element takes: 0.33 s at 60 fps.
+const GLIDE: u32 = 20;
+
+/// `session`'s frames from now on into `out` at `size` (the viewport), with `audio` under them when given.
+pub fn start(session: &mut Session, out: &Path, size: (u32, u32), audio: Option<&Path>) -> Result<Video, String> {
+ let raea = std::env::var_os("RAEA_BIN").unwrap_or_else(|| "raea".into());
+ let mut cmd = Command::new(&raea);
+ cmd.args(["media", "encode", "--size", &format!("{}x{}", size.0, size.1), "--fps", &format!("{}", 1.0 / FRAME), "-o"]).arg(out);
+ if let Some(a) = audio {
+ cmd.arg("--audio").arg(a);
+ }
+ let mut child = cmd.stdin(Stdio::piped()).stdout(Stdio::piped()).spawn().map_err(|e| format!("{}: {e} (raea on PATH, or RAEA_BIN)", raea.to_string_lossy()))?;
+ let stdin = child.stdin.take();
+ let shared = Rc::new(RefCell::new(Shared { stdin, shooter: Shooter::new(size.0, size.1), size, hashes: Vec::new(), cursor: false, scale: (size.0.min(size.1) as f32 / 400.0).max(1.0), marks: Vec::new(), last: Vec::new(), rest: ((-1.0, -1.0), 0), err: None }));
+ let s = shared.clone();
+ session.on_frame = Some(Box::new(move |rt, pointer| {
+ let mut s = s.borrow_mut();
+ if s.err.is_some() {
+ return;
+ }
+ s.last = s.shooter.pixels(rt);
+ let mut px = s.last.clone();
+ s.rest = if s.rest.0 == pointer { (pointer, s.rest.1 + 1) } else { (pointer, 0) };
+ let shown = 1.0 - (s.rest.1.saturating_sub(REST) as f32 / FADE as f32).min(1.0);
+ if s.cursor && shown > 0.0 {
+ paint_cursor(&mut px, s.size, pointer, s.scale, shown);
+ }
+ s.hashes.push(fnv(&px));
+ if let Some(w) = s.stdin.as_mut()
+ && let Err(e) = w.write_all(&px)
+ {
+ s.err = Some(format!("raea media encode: {e}"));
+ }
+ }));
+ Ok(Video { child, shared })
+}
+
+impl Video {
+ /// Before `step`: the pointer glides to its element's middle, eased, a frame at a time (a press, a field typed
+ /// into, a wheel; a key or a wait has nowhere to go). The first glide starts low in the middle of the view.
+ pub fn glide(&self, app: &mut App, step: &Step) -> Result<(), String> {
+ let t = match step {
+ Step::Press { press } => press,
+ Step::Type { into, .. } => into,
+ Step::Wheel { wheel, .. } => wheel,
+ Step::Hover { hover } => hover,
+ Step::Key { .. } | Step::Frames { .. } | Step::Pick { .. } | Step::Save { .. } | Step::Dialog { .. } | Step::Dark { .. } | Step::Width { .. } => return Ok(()),
+ };
+ let id = app.session.tid(t).ok_or_else(|| format!("no element with data-testid {t:?}"))?;
+ let r = app.session.rect(id).ok_or("the element has no box")?;
+ let to = (r[0] + r[2] / 2.0, r[1] + r[3] / 2.0);
+ let from = {
+ let mut s = self.shared.borrow_mut();
+ if !s.cursor {
+ s.cursor = true;
+ let (w, h) = s.size;
+ (w as f32 * 0.5, h as f32 * 0.85)
+ } else {
+ app.session.rt.state.pointer
+ }
+ };
+ for i in 1..=GLIDE {
+ let k = i as f32 / GLIDE as f32;
+ let k = k * k * (3.0 - 2.0 * k);
+ let (x, y) = (from.0 + (to.0 - from.0) * k, from.1 + (to.1 - from.1) * k);
+ app.input(|s| s.pointer_move(x, y))?;
+ }
+ Ok(())
+ }
+
+ /// Frames filmed so far: the next frame's index.
+ pub fn at(&self) -> usize {
+ self.shared.borrow().hashes.len()
+ }
+
+ /// The last frame, without its cursor, as a PNG at `path` (the headless run's step stills while filming).
+ pub fn png(&self, path: &Path) -> Result<(), String> {
+ let s = self.shared.borrow();
+ crate::shot::write_png(path, s.size.0, s.size.1, &s.last)
+ }
+
+ /// A step's timing kept in video.json (what a sound pass cues on).
+ pub fn mark(&self, m: Value) {
+ self.shared.borrow_mut().marks.push(m);
+ }
+
+ /// The pipe closed and the encoder waited for: its report, the frames' hashes and one hash over them all.
+ pub fn finish(self, session: &mut Session) -> Result<Value, String> {
+ session.on_frame = None;
+ let (hashes, marks, err) = {
+ let mut s = self.shared.borrow_mut();
+ drop(s.stdin.take());
+ (std::mem::take(&mut s.hashes), std::mem::take(&mut s.marks), s.err.take())
+ };
+ let out = self.child.wait_with_output().map_err(|e| format!("raea media encode: {e}"))?;
+ if let Some(e) = err {
+ return Err(e);
+ }
+ if !out.status.success() {
+ return Err(format!("raea media encode exited with {}", out.status));
+ }
+ let encoded: Value = serde_json::from_slice(&out.stdout).unwrap_or(Value::Null);
+ let all = fnv(&hashes.iter().flat_map(|h| h.to_le_bytes()).collect::<Vec<_>>());
+ Ok(json!({"encoded": encoded, "frames": hashes.len(), "fps": 1.0 / FRAME, "marks": marks, "hash": format!("{all:016x}"), "frame_hashes": hashes.iter().map(|h| format!("{h:016x}")).collect::<Vec<_>>()}))
+ }
+}
+
+/// FNV-1a over `b`: stable across runs and machines, no dependency. The same hash as systems/tone's tonegraph.rs `hash`
+/// (the host can't depend on systems/): a fix to one goes to the other.
+fn fnv(b: &[u8]) -> u64 {
+ b.iter().fold(0xcbf2_9ce4_8422_2325, |h, &x| (h ^ x as u64).wrapping_mul(0x100_0000_01b3))
+}
+
+/// An arrow pointer, tip at the origin, in points.
+const ARROW: [(f32, f32); 7] = [(0.0, 0.0), (0.0, 17.0), (4.2, 13.2), (7.0, 19.6), (9.6, 18.5), (6.9, 12.2), (12.2, 12.2)];
+
+/// The arrow at `at` over `px`, `k` pixels a point, at `alpha`: black, a white edge 1.5 points wide, 4 samples a pixel for its edges.
+fn paint_cursor(px: &mut [u8], (w, h): (u32, u32), at: (f32, f32), k: f32, alpha: f32) {
+ let (x0, y0) = ((at.0 - 2.0 * k).floor().max(0.0) as u32, (at.1 - 2.0 * k).floor().max(0.0) as u32);
+ let (x1, y1) = (((at.0 + 15.0 * k).ceil() as u32).min(w), ((at.1 + 22.0 * k).ceil() as u32).min(h));
+ for y in y0..y1 {
+ for x in x0..x1 {
+ let (mut ink, mut edge) = (0.0f32, 0.0f32);
+ for (sx, sy) in [(0.25, 0.25), (0.75, 0.25), (0.25, 0.75), (0.75, 0.75)] {
+ let p = ((x as f32 + sx - at.0) / k, (y as f32 + sy - at.1) / k);
+ if inside(p) {
+ ink += 0.25 * alpha;
+ } else if near(p, 1.5) {
+ edge += 0.25 * alpha;
+ }
+ }
+ if ink + edge == 0.0 {
+ continue;
+ }
+ let i = (y * w + x) as usize * 4;
+ for c in 0..3 {
+ let under = px[i + c] as f32;
+ px[i + c] = (under * (1.0 - ink - edge) + 255.0 * edge).round() as u8;
+ }
+ }
+ }
+}
+
+fn inside(p: (f32, f32)) -> bool {
+ let mut odd = false;
+ for i in 0..ARROW.len() {
+ let (a, b) = (ARROW[i], ARROW[(i + 1) % ARROW.len()]);
+ if (a.1 > p.1) != (b.1 > p.1) && p.0 < a.0 + (p.1 - a.1) / (b.1 - a.1) * (b.0 - a.0) {
+ odd = !odd;
+ }
+ }
+ odd
+}
+
+fn near(p: (f32, f32), r: f32) -> bool {
+ (0..ARROW.len()).any(|i| {
+ let (a, b) = (ARROW[i], ARROW[(i + 1) % ARROW.len()]);
+ let (dx, dy) = (b.0 - a.0, b.1 - a.1);
+ let t = (((p.0 - a.0) * dx + (p.1 - a.1) * dy) / (dx * dx + dy * dy)).clamp(0.0, 1.0);
+ let (ex, ey) = (a.0 + dx * t - p.0, a.1 + dy * t - p.1);
+ ex * ex + ey * ey <= r * r
+ })
+}
diff --git a/engine/rune/src/window.rs b/engine/rune/src/window.rs
new file mode 100644
index 00000000..4c25587e
--- /dev/null
+++ b/engine/rune/src/window.rs
@@ -0,0 +1,169 @@
+//! A TSX app in a native window through Rune's shell (R7a): Rune's `App` owns the window, the GPU, the event loop and
+//! the page (`Page`, its state); the JS engine lives beside it on the main thread. Every frame starts with `poll`,
+//! which takes in the last frame's layout (layout.rs), moves the JS on to real time (its frame number, its timers due)
+//! and pumps it against the page. Input is Rune's: the page's handlers (events.rs, input.rs) do in the window exactly
+//! what they do headless. A frame whose layout changed wakes the loop for one more poll, so the JS hears it.
+
+use std::cell::RefCell;
+use std::time::Duration;
+
+use raea_core_wire::{Ev, named};
+use rune::{App, AppSpec, KeyEvent, Tx, Waker};
+use serde_json::{Value, json};
+
+use crate::js::{Host, Js};
+use crate::layout::Measured;
+use crate::page::{Out, Page, view};
+
+/// The engine, its bundle until the first poll runs it, and what the window's hooks hand the next poll.
+#[derive(Default)]
+struct Beside {
+ js: Option<Js>,
+ bundle: Option<String>,
+ measured: Option<Measured>,
+ viewport: (f32, f32),
+ /// the viewport the page last heard of
+ heard: (f32, f32),
+ waker: Option<Waker>,
+ frames: u64,
+ error: Option<String>,
+}
+
+thread_local! {
+ static BESIDE: RefCell<Beside> = RefCell::default();
+}
+
+/// The page in the window, as the JS's host for one poll.
+struct Win<'a> {
+ page: &'a mut Page,
+ tx: &'a mut Tx,
+ clock: f64,
+ changed: bool,
+}
+
+impl Host for Win<'_> {
+ fn clock(&self) -> f64 {
+ self.clock
+ }
+ fn apply(&mut self, batch: &str) -> Result<(), String> {
+ self.changed = true;
+ self.page.apply(batch)
+ }
+ fn emit(&mut self, name: &str, v: &Value) {
+ self.changed = true;
+ self.page.emit(name, v, self.tx);
+ }
+ fn take_out(&mut self) -> Vec<Out> {
+ self.page.take_out()
+ }
+}
+
+/// `bundle` in a `size` window titled `title`, until it closes. Errors from the JS end the app and come back here.
+pub fn run(bundle: String, title: &str, size: (f32, f32)) -> Result<(), String> {
+ BESIDE.with_borrow_mut(|b| {
+ b.js = Some(Js::new()?);
+ b.bundle = Some(bundle);
+ b.viewport = size;
+ b.heard = size;
+ Ok::<_, String>(())
+ })?;
+ // the window can shrink below Rune's default floor (420x400) when the app asks for less
+ let min_size = Some((size.0.min(420.0), size.1.min(400.0)));
+ let spec = AppSpec { setup: Some(setup), poll: Some(poll), on_key: Some(on_key), min_size, ..AppSpec::new(Box::leak(title.to_string().into_boxed_str()), size, Page::default, view) };
+ App::new(spec).on_frame_drawn(drawn).run();
+ BESIDE.with_borrow_mut(|b| b.error.take()).map_or(Ok(()), Err)
+}
+
+fn setup(_: &mut Page, w: Waker) {
+ BESIDE.with_borrow_mut(|b| b.waker = Some(w));
+}
+
+/// After each frame: its layout, for the next poll, and a wake for that poll when it changed.
+fn drawn(rt: &rune::Runtime<Page>) {
+ // what a handler queued in this frame (a press, an edit, a hover) waits for the JS: a poll now
+ if !rt.state.outbox.is_empty() {
+ wake();
+ }
+ let m = crate::layout::measure(&rt.elements(), &rt.state.boxes.borrow(), rt.viewport);
+ if m.snap == rt.state.last_layout {
+ return;
+ }
+ BESIDE.with_borrow_mut(|b| {
+ b.measured = Some(m);
+ b.viewport = rt.viewport;
+ });
+ wake();
+}
+
+/// A poll soon, from outside one (the loop's waker).
+fn wake() {
+ if let Some(w) = BESIDE.with_borrow(|b| b.waker.clone()) {
+ w();
+ }
+}
+
+/// The start of a frame, `t` seconds in: the layout taken in, a field Rune focused followed, and the JS moved on.
+fn poll(page: &mut Page, t: f64, tx: &mut Tx) -> bool {
+ let (measured, resized) = BESIDE.with_borrow_mut(|b| {
+ let resized = (b.viewport != b.heard).then_some(b.viewport);
+ b.heard = b.viewport;
+ (b.measured.take(), resized)
+ });
+ let focus = page.focus();
+ if let Some((w, h)) = resized {
+ page.resized(w, h);
+ }
+ // every frame reaches the page's `__ui_layout` ("" when unchanged), where @raea/ui runs rAF callbacks (T3c)
+ if !measured.is_some_and(|m| page.measured(m)) {
+ page.outbox.push(Out::Layout(String::new()));
+ }
+ page.follow_field_focus(tx);
+ if page.ticking {
+ let n = BESIDE.with_borrow(|b| b.frames);
+ page.outbox.push(Out::Deliver(named("frame", json!(n)).to_string()));
+ }
+ let (mut js, bundle, n) = BESIDE.with_borrow_mut(|b| {
+ b.frames += 1;
+ (b.js.take(), b.bundle.take(), b.frames)
+ });
+ let Some(engine) = js.as_mut() else { return false };
+ let mut win = Win { page, tx, clock: t, changed: false };
+ let next = match bundle {
+ Some(src) => engine.run(&src, &mut win).and_then(|()| engine.timers()),
+ None => engine.frame(n, &mut win),
+ };
+ // a new width restyles what a breakpoint is on (T3b), whether or not the JS draws again
+ let changed = win.changed || win.page.focus() != focus || resized.is_some();
+ let ticking = win.page.ticking;
+ let wrote = win.changed;
+ match next {
+ Ok(next) => {
+ if let Some(ms) = next {
+ tx.wake_after(Duration::from_secs_f64(ms / 1e3));
+ }
+ // a page that wrote this frame gets the next one: a rAF animation (Motion's) writes every frame it moves
+ if ticking || wrote {
+ tx.wake_after(Duration::from_millis(16));
+ }
+ }
+ Err(e) => {
+ eprintln!("raea-rune-host: {e}");
+ BESIDE.with_borrow_mut(|b| b.error = Some(e));
+ tx.quit();
+ }
+ }
+ BESIDE.with_borrow_mut(|b| b.js = js);
+ changed
+}
+
+/// A key Rune's focused control didn't take (or any key while nothing has Rune's focus): the page's keydown, and
+/// whether the page took it from Rune (a menu's Enter, Space or Escape).
+fn on_key(page: &mut Page, k: &KeyEvent, tx: &mut Tx) -> bool {
+ let mut taken = !page.key_out(Ev::KeyDown, crate::events::key_payload(k));
+ // Tab is the page's sequential focus (input.rs)
+ if !taken && k.key == rune::Key::Tab {
+ taken = page.tab(k.mods.shift, tx);
+ }
+ wake();
+ taken
+}
diff --git a/engine/rune/style/Cargo.toml b/engine/rune/style/Cargo.toml
new file mode 100644
index 00000000..c0f44d48
--- /dev/null
+++ b/engine/rune/style/Cargo.toml
@@ -0,0 +1,11 @@
+[package]
+name = "raea-rune-style"
+version = "0.1.0"
+edition = "2024"
+license = "FSL-1.1-ALv2"
+publish = false
+description = "The native target's styles (docs/targets.feature): CSS and Tailwind resolved per element, mapped to Rune's props, and what didn't map reported"
+
+[dependencies]
+rune.workspace = true
+serde_json = "1"
diff --git a/engine/rune/style/assets/tailwind-LICENSE b/engine/rune/style/assets/tailwind-LICENSE
new file mode 100644
index 00000000..d6a82290
--- /dev/null
+++ b/engine/rune/style/assets/tailwind-LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) Tailwind Labs, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/engine/rune/style/assets/tailwind-theme.css b/engine/rune/style/assets/tailwind-theme.css
new file mode 100644
index 00000000..05364f5c
--- /dev/null
+++ b/engine/rune/style/assets/tailwind-theme.css
@@ -0,0 +1,510 @@
+@theme default {
+ --font-sans:
+ -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', Arial,
+ sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
+ --font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
+ --font-mono:
+ ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
+ monospace;
+
+ --color-red-50: oklch(97.1% 0.013 17.38);
+ --color-red-100: oklch(93.6% 0.032 17.717);
+ --color-red-200: oklch(88.5% 0.062 18.334);
+ --color-red-300: oklch(80.8% 0.114 19.571);
+ --color-red-400: oklch(70.4% 0.191 22.216);
+ --color-red-500: oklch(63.7% 0.237 25.331);
+ --color-red-600: oklch(57.7% 0.245 27.325);
+ --color-red-700: oklch(50.5% 0.213 27.518);
+ --color-red-800: oklch(44.4% 0.177 26.899);
+ --color-red-900: oklch(39.6% 0.141 25.723);
+ --color-red-950: oklch(25.8% 0.092 26.042);
+
+ --color-orange-50: oklch(98% 0.016 73.684);
+ --color-orange-100: oklch(95.4% 0.038 75.164);
+ --color-orange-200: oklch(90.1% 0.076 70.697);
+ --color-orange-300: oklch(83.7% 0.128 66.29);
+ --color-orange-400: oklch(75% 0.183 55.934);
+ --color-orange-500: oklch(70.5% 0.213 47.604);
+ --color-orange-600: oklch(64.6% 0.222 41.116);
+ --color-orange-700: oklch(55.3% 0.195 38.402);
+ --color-orange-800: oklch(47% 0.157 37.304);
+ --color-orange-900: oklch(40.8% 0.123 38.172);
+ --color-orange-950: oklch(26.6% 0.079 36.259);
+
+ --color-amber-50: oklch(98.7% 0.022 95.277);
+ --color-amber-100: oklch(96.2% 0.059 95.617);
+ --color-amber-200: oklch(92.4% 0.12 95.746);
+ --color-amber-300: oklch(87.9% 0.169 91.605);
+ --color-amber-400: oklch(82.8% 0.189 84.429);
+ --color-amber-500: oklch(76.9% 0.188 70.08);
+ --color-amber-600: oklch(66.6% 0.179 58.318);
+ --color-amber-700: oklch(55.5% 0.163 48.998);
+ --color-amber-800: oklch(47.3% 0.137 46.201);
+ --color-amber-900: oklch(41.4% 0.112 45.904);
+ --color-amber-950: oklch(27.9% 0.077 45.635);
+
+ --color-yellow-50: oklch(98.7% 0.026 102.212);
+ --color-yellow-100: oklch(97.3% 0.071 103.193);
+ --color-yellow-200: oklch(94.5% 0.129 101.54);
+ --color-yellow-300: oklch(90.5% 0.182 98.111);
+ --color-yellow-400: oklch(85.2% 0.199 91.936);
+ --color-yellow-500: oklch(79.5% 0.184 86.047);
+ --color-yellow-600: oklch(68.1% 0.162 75.834);
+ --color-yellow-700: oklch(55.4% 0.135 66.442);
+ --color-yellow-800: oklch(47.6% 0.114 61.907);
+ --color-yellow-900: oklch(42.1% 0.095 57.708);
+ --color-yellow-950: oklch(28.6% 0.066 53.813);
+
+ --color-lime-50: oklch(98.6% 0.031 120.757);
+ --color-lime-100: oklch(96.7% 0.067 122.328);
+ --color-lime-200: oklch(93.8% 0.127 124.321);
+ --color-lime-300: oklch(89.7% 0.196 126.665);
+ --color-lime-400: oklch(84.1% 0.238 128.85);
+ --color-lime-500: oklch(76.8% 0.233 130.85);
+ --color-lime-600: oklch(64.8% 0.2 131.684);
+ --color-lime-700: oklch(53.2% 0.157 131.589);
+ --color-lime-800: oklch(45.3% 0.124 130.933);
+ --color-lime-900: oklch(40.5% 0.101 131.063);
+ --color-lime-950: oklch(27.4% 0.072 132.109);
+
+ --color-green-50: oklch(98.2% 0.018 155.826);
+ --color-green-100: oklch(96.2% 0.044 156.743);
+ --color-green-200: oklch(92.5% 0.084 155.995);
+ --color-green-300: oklch(87.1% 0.15 154.449);
+ --color-green-400: oklch(79.2% 0.209 151.711);
+ --color-green-500: oklch(72.3% 0.219 149.579);
+ --color-green-600: oklch(62.7% 0.194 149.214);
+ --color-green-700: oklch(52.7% 0.154 150.069);
+ --color-green-800: oklch(44.8% 0.119 151.328);
+ --color-green-900: oklch(39.3% 0.095 152.535);
+ --color-green-950: oklch(26.6% 0.065 152.934);
+
+ --color-emerald-50: oklch(97.9% 0.021 166.113);
+ --color-emerald-100: oklch(95% 0.052 163.051);
+ --color-emerald-200: oklch(90.5% 0.093 164.15);
+ --color-emerald-300: oklch(84.5% 0.143 164.978);
+ --color-emerald-400: oklch(76.5% 0.177 163.223);
+ --color-emerald-500: oklch(69.6% 0.17 162.48);
+ --color-emerald-600: oklch(59.6% 0.145 163.225);
+ --color-emerald-700: oklch(50.8% 0.118 165.612);
+ --color-emerald-800: oklch(43.2% 0.095 166.913);
+ --color-emerald-900: oklch(37.8% 0.077 168.94);
+ --color-emerald-950: oklch(26.2% 0.051 172.552);
+
+ --color-teal-50: oklch(98.4% 0.014 180.72);
+ --color-teal-100: oklch(95.3% 0.051 180.801);
+ --color-teal-200: oklch(91% 0.096 180.426);
+ --color-teal-300: oklch(85.5% 0.138 181.071);
+ --color-teal-400: oklch(77.7% 0.152 181.912);
+ --color-teal-500: oklch(70.4% 0.14 182.503);
+ --color-teal-600: oklch(60% 0.118 184.704);
+ --color-teal-700: oklch(51.1% 0.096 186.391);
+ --color-teal-800: oklch(43.7% 0.078 188.216);
+ --color-teal-900: oklch(38.6% 0.063 188.416);
+ --color-teal-950: oklch(27.7% 0.046 192.524);
+
+ --color-cyan-50: oklch(98.4% 0.019 200.873);
+ --color-cyan-100: oklch(95.6% 0.045 203.388);
+ --color-cyan-200: oklch(91.7% 0.08 205.041);
+ --color-cyan-300: oklch(86.5% 0.127 207.078);
+ --color-cyan-400: oklch(78.9% 0.154 211.53);
+ --color-cyan-500: oklch(71.5% 0.143 215.221);
+ --color-cyan-600: oklch(60.9% 0.126 221.723);
+ --color-cyan-700: oklch(52% 0.105 223.128);
+ --color-cyan-800: oklch(45% 0.085 224.283);
+ --color-cyan-900: oklch(39.8% 0.07 227.392);
+ --color-cyan-950: oklch(30.2% 0.056 229.695);
+
+ --color-sky-50: oklch(97.7% 0.013 236.62);
+ --color-sky-100: oklch(95.1% 0.026 236.824);
+ --color-sky-200: oklch(90.1% 0.058 230.902);
+ --color-sky-300: oklch(82.8% 0.111 230.318);
+ --color-sky-400: oklch(74.6% 0.16 232.661);
+ --color-sky-500: oklch(68.5% 0.169 237.323);
+ --color-sky-600: oklch(58.8% 0.158 241.966);
+ --color-sky-700: oklch(50% 0.134 242.749);
+ --color-sky-800: oklch(44.3% 0.11 240.79);
+ --color-sky-900: oklch(39.1% 0.09 240.876);
+ --color-sky-950: oklch(29.3% 0.066 243.157);
+
+ --color-blue-50: oklch(97% 0.014 254.604);
+ --color-blue-100: oklch(93.2% 0.032 255.585);
+ --color-blue-200: oklch(88.2% 0.059 254.128);
+ --color-blue-300: oklch(80.9% 0.105 251.813);
+ --color-blue-400: oklch(70.7% 0.165 254.624);
+ --color-blue-500: oklch(62.3% 0.214 259.815);
+ --color-blue-600: oklch(54.6% 0.245 262.881);
+ --color-blue-700: oklch(48.8% 0.243 264.376);
+ --color-blue-800: oklch(42.4% 0.199 265.638);
+ --color-blue-900: oklch(37.9% 0.146 265.522);
+ --color-blue-950: oklch(28.2% 0.091 267.935);
+
+ --color-indigo-50: oklch(96.2% 0.018 272.314);
+ --color-indigo-100: oklch(93% 0.034 272.788);
+ --color-indigo-200: oklch(87% 0.065 274.039);
+ --color-indigo-300: oklch(78.5% 0.115 274.713);
+ --color-indigo-400: oklch(67.3% 0.182 276.935);
+ --color-indigo-500: oklch(58.5% 0.233 277.117);
+ --color-indigo-600: oklch(51.1% 0.262 276.966);
+ --color-indigo-700: oklch(45.7% 0.24 277.023);
+ --color-indigo-800: oklch(39.8% 0.195 277.366);
+ --color-indigo-900: oklch(35.9% 0.144 278.697);
+ --color-indigo-950: oklch(25.7% 0.09 281.288);
+
+ --color-violet-50: oklch(96.9% 0.016 293.756);
+ --color-violet-100: oklch(94.3% 0.029 294.588);
+ --color-violet-200: oklch(89.4% 0.057 293.283);
+ --color-violet-300: oklch(81.1% 0.111 293.571);
+ --color-violet-400: oklch(70.2% 0.183 293.541);
+ --color-violet-500: oklch(60.6% 0.25 292.717);
+ --color-violet-600: oklch(54.1% 0.281 293.009);
+ --color-violet-700: oklch(49.1% 0.27 292.581);
+ --color-violet-800: oklch(43.2% 0.232 292.759);
+ --color-violet-900: oklch(38% 0.189 293.745);
+ --color-violet-950: oklch(28.3% 0.141 291.089);
+
+ --color-purple-50: oklch(97.7% 0.014 308.299);
+ --color-purple-100: oklch(94.6% 0.033 307.174);
+ --color-purple-200: oklch(90.2% 0.063 306.703);
+ --color-purple-300: oklch(82.7% 0.119 306.383);
+ --color-purple-400: oklch(71.4% 0.203 305.504);
+ --color-purple-500: oklch(62.7% 0.265 303.9);
+ --color-purple-600: oklch(55.8% 0.288 302.321);
+ --color-purple-700: oklch(49.6% 0.265 301.924);
+ --color-purple-800: oklch(43.8% 0.218 303.724);
+ --color-purple-900: oklch(38.1% 0.176 304.987);
+ --color-purple-950: oklch(29.1% 0.149 302.717);
+
+ --color-fuchsia-50: oklch(97.7% 0.017 320.058);
+ --color-fuchsia-100: oklch(95.2% 0.037 318.852);
+ --color-fuchsia-200: oklch(90.3% 0.076 319.62);
+ --color-fuchsia-300: oklch(83.3% 0.145 321.434);
+ --color-fuchsia-400: oklch(74% 0.238 322.16);
+ --color-fuchsia-500: oklch(66.7% 0.295 322.15);
+ --color-fuchsia-600: oklch(59.1% 0.293 322.896);
+ --color-fuchsia-700: oklch(51.8% 0.253 323.949);
+ --color-fuchsia-800: oklch(45.2% 0.211 324.591);
+ --color-fuchsia-900: oklch(40.1% 0.17 325.612);
+ --color-fuchsia-950: oklch(29.3% 0.136 325.661);
+
+ --color-pink-50: oklch(97.1% 0.014 343.198);
+ --color-pink-100: oklch(94.8% 0.028 342.258);
+ --color-pink-200: oklch(89.9% 0.061 343.231);
+ --color-pink-300: oklch(82.3% 0.12 346.018);
+ --color-pink-400: oklch(71.8% 0.202 349.761);
+ --color-pink-500: oklch(65.6% 0.241 354.308);
+ --color-pink-600: oklch(59.2% 0.249 0.584);
+ --color-pink-700: oklch(52.5% 0.223 3.958);
+ --color-pink-800: oklch(45.9% 0.187 3.815);
+ --color-pink-900: oklch(40.8% 0.153 2.432);
+ --color-pink-950: oklch(28.4% 0.109 3.907);
+
+ --color-rose-50: oklch(96.9% 0.015 12.422);
+ --color-rose-100: oklch(94.1% 0.03 12.58);
+ --color-rose-200: oklch(89.2% 0.058 10.001);
+ --color-rose-300: oklch(81% 0.117 11.638);
+ --color-rose-400: oklch(71.2% 0.194 13.428);
+ --color-rose-500: oklch(64.5% 0.246 16.439);
+ --color-rose-600: oklch(58.6% 0.253 17.585);
+ --color-rose-700: oklch(51.4% 0.222 16.935);
+ --color-rose-800: oklch(45.5% 0.188 13.697);
+ --color-rose-900: oklch(41% 0.159 10.272);
+ --color-rose-950: oklch(27.1% 0.105 12.094);
+
+ --color-slate-50: oklch(98.4% 0.003 247.858);
+ --color-slate-100: oklch(96.8% 0.007 247.896);
+ --color-slate-200: oklch(92.9% 0.013 255.508);
+ --color-slate-300: oklch(86.9% 0.022 252.894);
+ --color-slate-400: oklch(70.4% 0.04 256.788);
+ --color-slate-500: oklch(55.4% 0.046 257.417);
+ --color-slate-600: oklch(44.6% 0.043 257.281);
+ --color-slate-700: oklch(37.2% 0.044 257.287);
+ --color-slate-800: oklch(27.9% 0.041 260.031);
+ --color-slate-900: oklch(20.8% 0.042 265.755);
+ --color-slate-950: oklch(12.9% 0.042 264.695);
+
+ --color-gray-50: oklch(98.5% 0.002 247.839);
+ --color-gray-100: oklch(96.7% 0.003 264.542);
+ --color-gray-200: oklch(92.8% 0.006 264.531);
+ --color-gray-300: oklch(87.2% 0.01 258.338);
+ --color-gray-400: oklch(70.7% 0.022 261.325);
+ --color-gray-500: oklch(55.1% 0.027 264.364);
+ --color-gray-600: oklch(44.6% 0.03 256.802);
+ --color-gray-700: oklch(37.3% 0.034 259.733);
+ --color-gray-800: oklch(27.8% 0.033 256.848);
+ --color-gray-900: oklch(21% 0.034 264.665);
+ --color-gray-950: oklch(13% 0.028 261.692);
+
+ --color-zinc-50: oklch(98.5% 0 none);
+ --color-zinc-100: oklch(96.7% 0.001 286.375);
+ --color-zinc-200: oklch(92% 0.004 286.32);
+ --color-zinc-300: oklch(87.1% 0.006 286.286);
+ --color-zinc-400: oklch(70.5% 0.015 286.067);
+ --color-zinc-500: oklch(55.2% 0.016 285.938);
+ --color-zinc-600: oklch(44.2% 0.017 285.786);
+ --color-zinc-700: oklch(37% 0.013 285.805);
+ --color-zinc-800: oklch(27.4% 0.006 286.033);
+ --color-zinc-900: oklch(21% 0.006 285.885);
+ --color-zinc-950: oklch(14.1% 0.005 285.823);
+
+ --color-neutral-50: oklch(98.5% 0 none);
+ --color-neutral-100: oklch(97% 0 none);
+ --color-neutral-200: oklch(92.2% 0 none);
+ --color-neutral-300: oklch(87% 0 none);
+ --color-neutral-400: oklch(70.8% 0 none);
+ --color-neutral-500: oklch(55.6% 0 none);
+ --color-neutral-600: oklch(43.9% 0 none);
+ --color-neutral-700: oklch(37.1% 0 none);
+ --color-neutral-800: oklch(26.9% 0 none);
+ --color-neutral-900: oklch(20.5% 0 none);
+ --color-neutral-950: oklch(14.5% 0 none);
+
+ --color-stone-50: oklch(98.5% 0.001 106.423);
+ --color-stone-100: oklch(97% 0.001 106.424);
+ --color-stone-200: oklch(92.3% 0.003 48.717);
+ --color-stone-300: oklch(86.9% 0.005 56.366);
+ --color-stone-400: oklch(70.9% 0.01 56.259);
+ --color-stone-500: oklch(55.3% 0.013 58.071);
+ --color-stone-600: oklch(44.4% 0.011 73.639);
+ --color-stone-700: oklch(37.4% 0.01 67.558);
+ --color-stone-800: oklch(26.8% 0.007 34.298);
+ --color-stone-900: oklch(21.6% 0.006 56.043);
+ --color-stone-950: oklch(14.7% 0.004 49.25);
+
+ --color-mauve-50: oklch(98.5% 0 none);
+ --color-mauve-100: oklch(96% 0.003 325.6);
+ --color-mauve-200: oklch(92.2% 0.005 325.62);
+ --color-mauve-300: oklch(86.5% 0.012 325.68);
+ --color-mauve-400: oklch(71.1% 0.019 323.02);
+ --color-mauve-500: oklch(54.2% 0.034 322.5);
+ --color-mauve-600: oklch(43.5% 0.029 321.78);
+ --color-mauve-700: oklch(36.4% 0.029 323.89);
+ --color-mauve-800: oklch(26.3% 0.024 320.12);
+ --color-mauve-900: oklch(21.2% 0.019 322.12);
+ --color-mauve-950: oklch(14.5% 0.008 326);
+
+ --color-olive-50: oklch(98.8% 0.003 106.5);
+ --color-olive-100: oklch(96.6% 0.005 106.5);
+ --color-olive-200: oklch(93% 0.007 106.5);
+ --color-olive-300: oklch(88% 0.011 106.6);
+ --color-olive-400: oklch(73.7% 0.021 106.9);
+ --color-olive-500: oklch(58% 0.031 107.3);
+ --color-olive-600: oklch(46.6% 0.025 107.3);
+ --color-olive-700: oklch(39.4% 0.023 107.4);
+ --color-olive-800: oklch(28.6% 0.016 107.4);
+ --color-olive-900: oklch(22.8% 0.013 107.4);
+ --color-olive-950: oklch(15.3% 0.006 107.1);
+
+ --color-mist-50: oklch(98.7% 0.002 197.1);
+ --color-mist-100: oklch(96.3% 0.002 197.1);
+ --color-mist-200: oklch(92.5% 0.005 214.3);
+ --color-mist-300: oklch(87.2% 0.007 219.6);
+ --color-mist-400: oklch(72.3% 0.014 214.4);
+ --color-mist-500: oklch(56% 0.021 213.5);
+ --color-mist-600: oklch(45% 0.017 213.2);
+ --color-mist-700: oklch(37.8% 0.015 216);
+ --color-mist-800: oklch(27.5% 0.011 216.9);
+ --color-mist-900: oklch(21.8% 0.008 223.9);
+ --color-mist-950: oklch(14.8% 0.004 228.8);
+
+ --color-taupe-50: oklch(98.6% 0.002 67.8);
+ --color-taupe-100: oklch(96% 0.002 17.2);
+ --color-taupe-200: oklch(92.2% 0.005 34.3);
+ --color-taupe-300: oklch(86.8% 0.007 39.5);
+ --color-taupe-400: oklch(71.4% 0.014 41.2);
+ --color-taupe-500: oklch(54.7% 0.021 43.1);
+ --color-taupe-600: oklch(43.8% 0.017 39.3);
+ --color-taupe-700: oklch(36.7% 0.016 35.7);
+ --color-taupe-800: oklch(26.8% 0.011 36.5);
+ --color-taupe-900: oklch(21.4% 0.009 43.1);
+ --color-taupe-950: oklch(14.7% 0.004 49.3);
+
+ --color-black: #000;
+ --color-white: #fff;
+
+ --spacing: 0.25rem;
+
+ --breakpoint-sm: 40rem;
+ --breakpoint-md: 48rem;
+ --breakpoint-lg: 64rem;
+ --breakpoint-xl: 80rem;
+ --breakpoint-2xl: 96rem;
+
+ --container-3xs: 16rem;
+ --container-2xs: 18rem;
+ --container-xs: 20rem;
+ --container-sm: 24rem;
+ --container-md: 28rem;
+ --container-lg: 32rem;
+ --container-xl: 36rem;
+ --container-2xl: 42rem;
+ --container-3xl: 48rem;
+ --container-4xl: 56rem;
+ --container-5xl: 64rem;
+ --container-6xl: 72rem;
+ --container-7xl: 80rem;
+
+ --text-xs: 0.75rem;
+ --text-xs--line-height: calc(1 / 0.75);
+ --text-sm: 0.875rem;
+ --text-sm--line-height: calc(1.25 / 0.875);
+ --text-base: 1rem;
+ --text-base--line-height: calc(1.5 / 1);
+ --text-lg: 1.125rem;
+ --text-lg--line-height: calc(1.75 / 1.125);
+ --text-xl: 1.25rem;
+ --text-xl--line-height: calc(1.75 / 1.25);
+ --text-2xl: 1.5rem;
+ --text-2xl--line-height: calc(2 / 1.5);
+ --text-3xl: 1.875rem;
+ --text-3xl--line-height: calc(2.25 / 1.875);
+ --text-4xl: 2.25rem;
+ --text-4xl--line-height: calc(2.5 / 2.25);
+ --text-5xl: 3rem;
+ --text-5xl--line-height: 1;
+ --text-6xl: 3.75rem;
+ --text-6xl--line-height: 1;
+ --text-7xl: 4.5rem;
+ --text-7xl--line-height: 1;
+ --text-8xl: 6rem;
+ --text-8xl--line-height: 1;
+ --text-9xl: 8rem;
+ --text-9xl--line-height: 1;
+
+ --font-weight-thin: 100;
+ --font-weight-extralight: 200;
+ --font-weight-light: 300;
+ --font-weight-normal: 400;
+ --font-weight-medium: 500;
+ --font-weight-semibold: 600;
+ --font-weight-bold: 700;
+ --font-weight-extrabold: 800;
+ --font-weight-black: 900;
+
+ --tracking-tighter: -0.05em;
+ --tracking-tight: -0.025em;
+ --tracking-normal: 0em;
+ --tracking-wide: 0.025em;
+ --tracking-wider: 0.05em;
+ --tracking-widest: 0.1em;
+
+ --leading-tight: 1.25;
+ --leading-snug: 1.375;
+ --leading-normal: 1.5;
+ --leading-relaxed: 1.625;
+ --leading-loose: 2;
+
+ --radius-xs: 0.125rem;
+ --radius-sm: 0.25rem;
+ --radius-md: 0.375rem;
+ --radius-lg: 0.5rem;
+ --radius-xl: 0.75rem;
+ --radius-2xl: 1rem;
+ --radius-3xl: 1.5rem;
+ --radius-4xl: 2rem;
+
+ --shadow-2xs: 0 1px rgb(0 0 0 / 0.05);
+ --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
+ --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
+ --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
+ --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
+ --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
+ --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
+
+ --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / 0.05);
+ --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / 0.05);
+ --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / 0.05);
+
+ --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / 0.05);
+ --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.15);
+ --drop-shadow-md: 0 3px 3px rgb(0 0 0 / 0.12);
+ --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / 0.15);
+ --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / 0.1);
+ --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / 0.15);
+
+ --text-shadow-2xs: 0px 1px 0px rgb(0 0 0 / 0.15);
+ --text-shadow-xs: 0px 1px 1px rgb(0 0 0 / 0.2);
+ --text-shadow-sm:
+ 0px 1px 0px rgb(0 0 0 / 0.075), 0px 1px 1px rgb(0 0 0 / 0.075), 0px 2px 2px rgb(0 0 0 / 0.075);
+ --text-shadow-md:
+ 0px 1px 1px rgb(0 0 0 / 0.1), 0px 1px 2px rgb(0 0 0 / 0.1), 0px 2px 4px rgb(0 0 0 / 0.1);
+ --text-shadow-lg:
+ 0px 1px 2px rgb(0 0 0 / 0.1), 0px 3px 2px rgb(0 0 0 / 0.1), 0px 4px 8px rgb(0 0 0 / 0.1);
+
+ --ease-in: cubic-bezier(0.4, 0, 1, 1);
+ --ease-out: cubic-bezier(0, 0, 0.2, 1);
+ --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
+
+ --animate-spin: spin 1s linear infinite;
+ --animate-ping: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
+ --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
+ --animate-bounce: bounce 1s infinite;
+
+ @keyframes spin {
+ to {
+ transform: rotate(360deg);
+ }
+ }
+
+ @keyframes ping {
+ 75%,
+ 100% {
+ transform: scale(2);
+ opacity: 0;
+ }
+ }
+
+ @keyframes pulse {
+ 50% {
+ opacity: 0.5;
+ }
+ }
+
+ @keyframes bounce {
+ 0%,
+ 100% {
+ transform: translateY(-25%);
+ animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
+ }
+
+ 50% {
+ transform: none;
+ animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
+ }
+ }
+
+ --blur-xs: 4px;
+ --blur-sm: 8px;
+ --blur-md: 12px;
+ --blur-lg: 16px;
+ --blur-xl: 24px;
+ --blur-2xl: 40px;
+ --blur-3xl: 64px;
+
+ --perspective-dramatic: 100px;
+ --perspective-near: 300px;
+ --perspective-normal: 500px;
+ --perspective-midrange: 800px;
+ --perspective-distant: 1200px;
+
+ --aspect-video: 16 / 9;
+
+ --default-transition-duration: 150ms;
+ --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
+ --default-font-family: --theme(--font-sans, initial);
+ --default-font-feature-settings: --theme(--font-sans--font-feature-settings, initial);
+ --default-font-variation-settings: --theme(--font-sans--font-variation-settings, initial);
+ --default-mono-font-family: --theme(--font-mono, initial);
+ --default-mono-font-feature-settings: --theme(--font-mono--font-feature-settings, initial);
+ --default-mono-font-variation-settings: --theme(--font-mono--font-variation-settings, initial);
+}
+
+/* Deprecated */
+@theme default inline reference {
+ --blur: 8px;
+ --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
+ --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
+ --drop-shadow: 0 1px 2px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.06);
+ --radius: 0.25rem;
+ --max-width-prose: 65ch;
+}
diff --git a/engine/rune/style/src/css.rs b/engine/rune/style/src/css.rs
new file mode 100644
index 00000000..b7620dd2
--- /dev/null
+++ b/engine/rune/style/src/css.rs
@@ -0,0 +1,455 @@
+//! An element's `style` prop read into typed values (R2b): what the wire carries (React's style object: numbers are
+//! px, strings are CSS) parsed once, each prop either understood or reported. Nothing is dropped silently: a prop this
+//! doesn't know, or a value it can't read, goes to `unmapped` with why. `view` turns a `Css` into Rune builder calls.
+
+use rune::Color;
+use serde_json::{Map, Value};
+
+/// A length: px, a share of the parent (`50%`), or auto.
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub enum Len {
+ Px(f32),
+ Pct(f32),
+ Auto,
+}
+
+#[derive(Clone, Copy, Debug, PartialEq, Default)]
+pub enum Display {
+ #[default]
+ Block,
+ Flex,
+ Inline,
+ None,
+}
+
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub enum Align {
+ Start,
+ End,
+ Center,
+ Stretch,
+ Between,
+ Around,
+ Evenly,
+}
+
+#[derive(Clone, Copy, Debug, PartialEq, Default)]
+pub enum Overflow {
+ #[default]
+ Visible,
+ Hidden,
+ Scroll,
+}
+
+/// A `box-shadow` layer.
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub struct ShadowCss {
+ pub x: f32,
+ pub y: f32,
+ pub blur: f32,
+ pub spread: f32,
+ pub color: Color,
+ pub inset: bool,
+}
+
+/// What an element's style says, prop by prop (None: not set). Edges are [top, right, bottom, left]; corners
+/// [top-left, top-right, bottom-right, bottom-left], CSS's orders.
+#[derive(Clone, Debug, Default, PartialEq)]
+pub struct Css {
+ pub display: Option<Display>,
+ pub column: Option<bool>,
+ pub reverse: bool,
+ pub wrap: bool,
+ pub align_items: Option<Align>,
+ pub align_self: Option<Align>,
+ pub justify: Option<Align>,
+ pub grow: Option<f32>,
+ pub shrink: Option<f32>,
+ pub basis: Option<Len>,
+ pub width: Option<Len>,
+ pub height: Option<Len>,
+ pub min_width: Option<Len>,
+ pub min_height: Option<Len>,
+ pub max_width: Option<Len>,
+ pub max_height: Option<Len>,
+ pub padding: [Option<f32>; 4],
+ pub margin: [Option<Len>; 4],
+ pub row_gap: Option<f32>,
+ pub column_gap: Option<f32>,
+ pub absolute: bool,
+ pub inset: [Option<f32>; 4],
+ pub overflow_x: Overflow,
+ pub overflow_y: Overflow,
+ pub background: Option<Color>,
+ /// `linear-gradient(angle, stops)`: the angle in radians (CSS's: 0 up, PI/2 right), stops at 0..1
+ pub gradient: Option<(f32, Vec<(f32, Color)>)>,
+ pub border_width: [Option<f32>; 4],
+ pub border_color: Option<Color>,
+ pub radius: [Option<f32>; 4],
+ pub shadows: Vec<ShadowCss>,
+ pub opacity: Option<f32>,
+ // inherited by text
+ pub color: Option<Color>,
+ pub font_size: Option<f32>,
+ pub font_weight: Option<f32>,
+ pub font_family: Option<String>,
+ pub line_height: Option<Len>,
+ pub letter_spacing: Option<f32>,
+ pub text_align: Option<Align>,
+ pub italic: Option<bool>,
+ /// transform, translate, scale, rotate, their origin and the transition (motion.rs, T3c)
+ pub motion: crate::motion::Motion,
+}
+
+/// A style prop the host couldn't use: its name, its value as given, and why.
+#[derive(Clone, Debug, PartialEq)]
+pub struct Unmapped {
+ pub prop: String,
+ pub value: String,
+ pub why: &'static str,
+}
+
+/// `style` read into a `Css`, and what it couldn't read.
+pub fn parse(style: &Map<String, Value>) -> (Css, Vec<Unmapped>) {
+ let mut c = Css::default();
+ let mut bad = Vec::new();
+ // shorthands first, so a longhand beside one wins whatever order the map iterates in (serde_json's is by name)
+ let short = |k: &str| SHORTHANDS.contains(&k);
+ for pass in [true, false] {
+ for (k, v) in style.iter().filter(|(k, _)| short(k) == pass) {
+ if let Err(why) = prop(&mut c, k, v) {
+ bad.push(Unmapped { prop: k.clone(), value: show(v), why });
+ }
+ }
+ }
+ (c, bad)
+}
+
+/// The props that set several others, applied before those others.
+const SHORTHANDS: [&str; 7] = ["padding", "margin", "gap", "borderWidth", "borderRadius", "overflow", "transition"];
+
+fn show(v: &Value) -> String {
+ match v {
+ Value::String(s) => s.clone(),
+ v => v.to_string(),
+ }
+}
+
+pub(crate) const NO_PROP: &str = "no Rune equivalent mapped";
+pub(crate) const BAD_VALUE: &str = "a value the host can't read";
+
+/// One prop into `c`, or why not.
+fn prop(c: &mut Css, k: &str, v: &Value) -> Result<(), &'static str> {
+ let len = || length(v).ok_or(BAD_VALUE);
+ let px = || match length(v) {
+ Some(Len::Px(p)) => Ok(p),
+ _ => Err(BAD_VALUE),
+ };
+ let edges4 = |c: &mut [Option<f32>; 4], i: Option<usize>| -> Result<(), &'static str> {
+ let p = px()?;
+ match i {
+ Some(i) => c[i] = Some(p),
+ None => *c = [Some(p); 4],
+ }
+ Ok(())
+ };
+ match k {
+ "display" => {
+ c.display = Some(match text(v)? {
+ "flex" => Display::Flex,
+ "block" => Display::Block,
+ "inline" | "inline-block" => Display::Inline,
+ "none" => Display::None,
+ _ => return Err(BAD_VALUE),
+ })
+ }
+ "flexDirection" => {
+ let (col, rev) = match text(v)? {
+ "row" => (false, false),
+ "column" => (true, false),
+ "row-reverse" => (false, true),
+ "column-reverse" => (true, true),
+ _ => return Err(BAD_VALUE),
+ };
+ (c.column, c.reverse) = (Some(col), rev);
+ if rev {
+ return Err("reversed flex directions aren't mapped");
+ }
+ }
+ "flexWrap" => c.wrap = text(v)? == "wrap",
+ "alignItems" => c.align_items = Some(align(v)?),
+ "alignSelf" => c.align_self = Some(align(v)?),
+ "justifyContent" => c.justify = Some(align(v)?),
+ "flexGrow" => c.grow = Some(num(v)?),
+ "flexShrink" => c.shrink = Some(num(v)?),
+ "flexBasis" => c.basis = Some(len()?),
+ "width" => c.width = Some(len()?),
+ "height" => c.height = Some(len()?),
+ "minWidth" => c.min_width = Some(len()?),
+ "minHeight" => c.min_height = Some(len()?),
+ "maxWidth" => c.max_width = Some(len()?),
+ "maxHeight" => c.max_height = Some(len()?),
+ "padding" => edges4(&mut c.padding, None)?,
+ "paddingTop" => edges4(&mut c.padding, Some(0))?,
+ "paddingRight" => edges4(&mut c.padding, Some(1))?,
+ "paddingBottom" => edges4(&mut c.padding, Some(2))?,
+ "paddingLeft" => edges4(&mut c.padding, Some(3))?,
+ "margin" => c.margin = [Some(len()?); 4],
+ "marginTop" => c.margin[0] = Some(len()?),
+ "marginRight" => c.margin[1] = Some(len()?),
+ "marginBottom" => c.margin[2] = Some(len()?),
+ "marginLeft" => c.margin[3] = Some(len()?),
+ "gap" => (c.row_gap, c.column_gap) = (Some(px()?), Some(px()?)),
+ "rowGap" => c.row_gap = Some(px()?),
+ "columnGap" => c.column_gap = Some(px()?),
+ "position" => match text(v)? {
+ "absolute" => c.absolute = true,
+ "relative" | "static" => c.absolute = false,
+ _ => return Err("only static, relative and absolute positions are mapped"),
+ },
+ "top" => c.inset[0] = Some(px()?),
+ "right" => c.inset[1] = Some(px()?),
+ "bottom" => c.inset[2] = Some(px()?),
+ "left" => c.inset[3] = Some(px()?),
+ "overflow" => (c.overflow_x, c.overflow_y) = (overflow(v)?, overflow(v)?),
+ "overflowX" => c.overflow_x = overflow(v)?,
+ "overflowY" => c.overflow_y = overflow(v)?,
+ "backgroundColor" => c.background = Some(color(text(v)?).ok_or(BAD_VALUE)?),
+ "backgroundImage" => c.gradient = Some(gradient(text(v)?).ok_or("only linear-gradient(angle, colour stops) is mapped")?),
+ "borderWidth" => edges4(&mut c.border_width, None)?,
+ "borderTopWidth" => edges4(&mut c.border_width, Some(0))?,
+ "borderRightWidth" => edges4(&mut c.border_width, Some(1))?,
+ "borderBottomWidth" => edges4(&mut c.border_width, Some(2))?,
+ "borderLeftWidth" => edges4(&mut c.border_width, Some(3))?,
+ "borderColor" => c.border_color = Some(color(text(v)?).ok_or(BAD_VALUE)?),
+ "borderRadius" => edges4(&mut c.radius, None)?,
+ "borderTopLeftRadius" => edges4(&mut c.radius, Some(0))?,
+ "borderTopRightRadius" => edges4(&mut c.radius, Some(1))?,
+ "borderBottomRightRadius" => edges4(&mut c.radius, Some(2))?,
+ "borderBottomLeftRadius" => edges4(&mut c.radius, Some(3))?,
+ "boxShadow" => c.shadows = shadows(text(v)?).ok_or(BAD_VALUE)?,
+ "opacity" => c.opacity = Some(num(v)?),
+ "color" => c.color = Some(color(text(v)?).ok_or(BAD_VALUE)?),
+ "fontSize" => c.font_size = Some(px()?),
+ "fontWeight" => c.font_weight = Some(weight(v)?),
+ "fontFamily" => c.font_family = Some(text(v)?.split(',').next().unwrap_or("").trim().trim_matches(['"', '\'']).to_string()),
+ "fontStyle" => c.italic = Some(text(v)? == "italic"),
+ "lineHeight" => {
+ c.line_height = Some(match v {
+ // a bare number is a multiple of the font size
+ Value::Number(n) => Len::Pct(n.as_f64().ok_or(BAD_VALUE)? as f32 * 100.0),
+ _ => len()?,
+ })
+ }
+ "letterSpacing" => c.letter_spacing = Some(px()?),
+ "textAlign" => {
+ c.text_align = Some(match text(v)? {
+ "left" | "start" => Align::Start,
+ "right" | "end" => Align::End,
+ "center" => Align::Center,
+ _ => return Err(BAD_VALUE),
+ })
+ }
+ _ => return crate::motion::prop(&mut c.motion, k, v),
+ }
+ Ok(())
+}
+
+fn text(v: &Value) -> Result<&str, &'static str> {
+ v.as_str().map(str::trim).ok_or(BAD_VALUE)
+}
+
+fn num(v: &Value) -> Result<f32, &'static str> {
+ match v {
+ Value::Number(n) => n.as_f64().map(|f| f as f32).ok_or(BAD_VALUE),
+ Value::String(s) => s.trim().parse().map_err(|_| BAD_VALUE),
+ _ => Err(BAD_VALUE),
+ }
+}
+
+/// A React style length: a number is px; a string is `Npx`, `N%`, `0` or `auto`.
+pub fn length(v: &Value) -> Option<Len> {
+ match v {
+ Value::Number(n) => Some(Len::Px(n.as_f64()? as f32)),
+ Value::String(s) => {
+ let s = s.trim();
+ if s == "auto" {
+ Some(Len::Auto)
+ } else if let Some(p) = s.strip_suffix('%') {
+ p.trim().parse().ok().map(Len::Pct)
+ } else {
+ s.strip_suffix("px").unwrap_or(s).trim().parse().ok().map(Len::Px)
+ }
+ }
+ _ => None,
+ }
+}
+
+fn align(v: &Value) -> Result<Align, &'static str> {
+ Ok(match text(v)? {
+ "flex-start" | "start" | "normal" => Align::Start,
+ "flex-end" | "end" => Align::End,
+ "center" => Align::Center,
+ "stretch" => Align::Stretch,
+ "space-between" => Align::Between,
+ "space-around" => Align::Around,
+ "space-evenly" => Align::Evenly,
+ _ => return Err(BAD_VALUE),
+ })
+}
+
+fn overflow(v: &Value) -> Result<Overflow, &'static str> {
+ Ok(match text(v)? {
+ "visible" => Overflow::Visible,
+ "hidden" | "clip" => Overflow::Hidden,
+ "scroll" | "auto" => Overflow::Scroll,
+ _ => return Err(BAD_VALUE),
+ })
+}
+
+fn weight(v: &Value) -> Result<f32, &'static str> {
+ match v.as_str().map(str::trim) {
+ Some("normal") => Ok(400.0),
+ Some("bold") => Ok(700.0),
+ _ => num(v),
+ }
+}
+
+/// A CSS colour: `#rgb`, `#rrggbb`, `#rrggbbaa`, `rgb()`/`rgba()` with commas or spaces, `transparent`, or one of the
+/// basic named colours.
+pub fn color(s: &str) -> Option<Color> {
+ let s = s.trim();
+ if s.starts_with('#') {
+ return rune::color::hex(s);
+ }
+ if let Some(body) = s.strip_prefix("rgba(").or_else(|| s.strip_prefix("rgb(")) {
+ let body = body.strip_suffix(')')?.replace('/', " ");
+ let parts: Vec<f32> = body.split([',', ' ']).filter(|p| !p.is_empty()).map(|p| p.trim().parse().ok()).collect::<Option<_>>()?;
+ let (r, g, b) = (*parts.first()?, *parts.get(1)?, *parts.get(2)?);
+ let a = parts.get(3).copied().unwrap_or(1.0);
+ let d = |x: f32| rune::color::srgb_decode(x / 255.0);
+ return Some(Color { r: d(r), g: d(g), b: d(b), a });
+ }
+ if let Some(body) = s.strip_prefix("oklch(").and_then(|b| b.strip_suffix(')')) {
+ // Tailwind v4's palette: `oklch(62.3% 0.214 259.815 [/ a])`
+ let (lch, a) = body.split_once('/').map_or((body, None), |(l, a)| (l, Some(a)));
+ let p: Vec<&str> = lch.split_whitespace().collect();
+ let l = match p.first()?.strip_suffix('%') {
+ Some(pct) => pct.parse::<f32>().ok()? / 100.0,
+ None => p.first()?.parse().ok()?,
+ };
+ let a = a.map_or(Some(1.0), |a| a.trim().parse().ok())?;
+ return Some(rune::oklcha(l, p.get(1)?.parse().ok()?, p.get(2)?.parse().ok()?, a));
+ }
+ let hex = match s {
+ "transparent" => return Some(Color::TRANSPARENT),
+ "black" => "#000000",
+ "white" => "#ffffff",
+ "red" => "#ff0000",
+ "green" => "#008000",
+ "blue" => "#0000ff",
+ "gray" | "grey" => "#808080",
+ _ => return None,
+ };
+ rune::color::hex(hex)
+}
+
+/// `linear-gradient(<angle>?, <colour> <stop%>?, ...)`, stops without a position spread evenly.
+pub fn gradient(s: &str) -> Option<(f32, Vec<(f32, Color)>)> {
+ let body = s.trim().strip_prefix("linear-gradient(")?.strip_suffix(')')?;
+ let parts = split_top(body);
+ let (angle, stops) = match parts.first()?.trim() {
+ a if a.ends_with("deg") => (a.strip_suffix("deg")?.trim().parse::<f32>().ok()?.to_radians(), &parts[1..]),
+ "to bottom" => (std::f32::consts::PI, &parts[1..]),
+ "to top" => (0.0, &parts[1..]),
+ "to right" => (std::f32::consts::FRAC_PI_2, &parts[1..]),
+ "to left" => (3.0 * std::f32::consts::FRAC_PI_2, &parts[1..]),
+ _ => (std::f32::consts::PI, &parts[..]),
+ };
+ if stops.len() < 2 || stops.len() > 8 {
+ return None;
+ }
+ let n = (stops.len() - 1) as f32;
+ let out = stops
+ .iter()
+ .enumerate()
+ .map(|(i, st)| {
+ let st = st.trim();
+ let (col, at) = match st.rsplit_once(' ') {
+ Some((c, p)) if p.ends_with('%') && !c.ends_with(',') && color(c).is_some() => (c, p.strip_suffix('%')?.parse::<f32>().ok()? / 100.0),
+ _ => (st, i as f32 / n),
+ };
+ Some((at, color(col)?))
+ })
+ .collect::<Option<Vec<_>>>()?;
+ Some((angle, out))
+}
+
+/// `box-shadow` layers: `[inset] x y [blur [spread]] colour`, comma-separated.
+pub fn shadows(s: &str) -> Option<Vec<ShadowCss>> {
+ if s.trim() == "none" {
+ return Some(Vec::new());
+ }
+ split_top(s)
+ .into_iter()
+ .map(|layer| {
+ let mut inset = false;
+ let mut nums = Vec::new();
+ let mut col = None;
+ for tok in split_space(layer) {
+ if tok == "inset" {
+ inset = true;
+ } else if let Some(Len::Px(p)) = length(&Value::String(tok.to_string())) {
+ nums.push(p);
+ } else {
+ col = Some(color(tok)?);
+ }
+ }
+ if nums.len() < 2 {
+ return None;
+ }
+ let g = |i: usize| nums.get(i).copied().unwrap_or(0.0);
+ Some(ShadowCss { x: g(0), y: g(1), blur: g(2), spread: g(3), color: col.unwrap_or(Color::BLACK), inset })
+ })
+ .collect()
+}
+
+/// `s` split at commas outside parentheses.
+fn split_top(s: &str) -> Vec<&str> {
+ let (mut out, mut depth, mut start) = (Vec::new(), 0, 0);
+ for (i, ch) in s.char_indices() {
+ match ch {
+ '(' => depth += 1,
+ ')' => depth -= 1,
+ ',' if depth == 0 => {
+ out.push(&s[start..i]);
+ start = i + 1;
+ }
+ _ => {}
+ }
+ }
+ out.push(&s[start..]);
+ out
+}
+
+/// `s` split at spaces outside parentheses.
+fn split_space(s: &str) -> Vec<&str> {
+ let (mut out, mut depth, mut start) = (Vec::new(), 0, 0);
+ for (i, ch) in s.char_indices() {
+ match ch {
+ '(' => depth += 1,
+ ')' => depth -= 1,
+ ' ' if depth == 0 => {
+ if i > start {
+ out.push(&s[start..i]);
+ }
+ start = i + 1;
+ }
+ _ => {}
+ }
+ }
+ if start < s.len() {
+ out.push(&s[start..]);
+ }
+ out
+}
diff --git a/engine/rune/style/src/lib.rs b/engine/rune/style/src/lib.rs
new file mode 100644
index 00000000..30bb0caa
--- /dev/null
+++ b/engine/rune/style/src/lib.rs
@@ -0,0 +1,9 @@
+//! raea-rune-style: an element's CSS (inline styles and Tailwind classes, Tailwind 4.3.3's theme) resolved and mapped
+//! to Rune's builder, with every prop that didn't map reported (docs/rune.feature R2, docs/targets.feature T3).
+
+pub mod css;
+pub mod motion;
+pub mod report;
+pub mod runeprops;
+pub mod tailwind;
+pub mod variants;
diff --git a/engine/rune/style/src/motion.rs b/engine/rune/style/src/motion.rs
new file mode 100644
index 00000000..41e9fada
--- /dev/null
+++ b/engine/rune/style/src/motion.rs
@@ -0,0 +1,311 @@
+//! CSS transforms and transitions on Rune (docs/targets.feature T3c). `transform`'s translate, scale and rotate
+//! functions, the individual `translate`, `scale` and `rotate` properties (Tailwind 4 writes those), and
+//! `transformOrigin` become Rune's offset, scale, rotation and origin, which leave layout alone as CSS's do. A
+//! transition becomes the element's curves: opacity and the transforms tween over the transition's duration on its
+//! timing function (Rune's `Curve::tween`, CSS's own model) after its delay, and colours, corners and shadows take a
+//! Rune spring of that duration (Rune moves those on springs only). Whatever Rune has no equivalent for (skew, matrix,
+//! 3D, a scale that differs per axis, a translate after a rotate or scale, a percentage, `steps()`) is reported.
+
+use rune::{AnimExt, Curve, El, Easing, Spring};
+use serde_json::Value;
+
+/// What `transform` and its siblings set: an offset in points, a uniform scale, a rotation in radians, the origin as
+/// fractions of the box, and the transition.
+#[derive(Clone, Debug, Default, PartialEq)]
+pub struct Motion {
+ /// `translate` (x, y), then `transform`'s translation, in points
+ pub translate: [f32; 2],
+ pub scale: Option<f32>,
+ /// radians, clockwise
+ pub rotate: Option<f32>,
+ pub origin: Option<(f32, f32)>,
+ pub transition: Option<Transition>,
+ /// Tailwind's translate-x and translate-y (its --tw-translate-x/y), added to `translate`
+ pub tw_translate: [f32; 2],
+}
+
+/// A CSS transition: which properties, for how long, on what curve, after what delay.
+#[derive(Clone, Debug, PartialEq)]
+pub struct Transition {
+ pub props: Props,
+ /// seconds
+ pub duration: f32,
+ /// cubic-bezier control points
+ pub easing: [f32; 4],
+ /// seconds
+ pub delay: f32,
+}
+
+/// The groups of properties a transition can name.
+#[derive(Clone, Copy, Debug, Default, PartialEq)]
+pub struct Props {
+ pub colours: bool,
+ pub opacity: bool,
+ pub transform: bool,
+ pub shadow: bool,
+}
+
+/// Tailwind 4.3.3's defaults: `--default-transition-duration` and `--default-transition-timing-function`.
+pub const DEFAULT_DURATION: f32 = 0.15;
+pub const DEFAULT_EASING: [f32; 4] = [0.4, 0.0, 0.2, 1.0];
+
+use crate::css::{BAD_VALUE as BAD, NO_PROP as NOT_RUNE};
+
+/// One prop into `m`; Err(NOT_RUNE) when it isn't one of these.
+pub fn prop(m: &mut Motion, k: &str, v: &Value) -> Result<(), &'static str> {
+ let s = || v.as_str().ok_or(BAD);
+ match k {
+ "transform" => transform(m, s()?),
+ "translate" => {
+ let p: Vec<&str> = s()?.split_whitespace().collect();
+ let x = px(p.first().ok_or(BAD)?)?;
+ let y = p.get(1).map_or(Ok(0.0), |y| px(y))?;
+ m.translate = [m.translate[0] + x, m.translate[1] + y];
+ Ok(())
+ }
+ "--tw-translate-x" => Ok(m.tw_translate[0] = num_or_px(v)?),
+ "--tw-translate-y" => Ok(m.tw_translate[1] = num_or_px(v)?),
+ // a Tailwind transition-* utility: Tailwind's defaults, which duration-* and ease-* (read after, by name) override
+ "--tw-transition" => {
+ let t = tr(m);
+ (t.duration, t.easing) = (DEFAULT_DURATION, DEFAULT_EASING);
+ Ok(())
+ }
+ "scale" => {
+ let k = match v {
+ Value::Number(n) => n.as_f64().ok_or(BAD)? as f32,
+ _ => uniform(s()?)?,
+ };
+ m.scale = Some(m.scale.unwrap_or(1.0) * k);
+ Ok(())
+ }
+ "rotate" => {
+ m.rotate = Some(m.rotate.unwrap_or(0.0) + angle(s()?)?);
+ Ok(())
+ }
+ "transformOrigin" => Ok(m.origin = Some(origin(s()?)?)),
+ "transition" => {
+ // one transition, or several with the same timing (Tailwind's lists): their properties together
+ let mut t: Option<Transition> = None;
+ for part in s()?.split(',') {
+ let words: Vec<&str> = part.split_whitespace().collect();
+ let mut one = Transition { props: Props::default(), duration: 0.0, easing: EASE, delay: 0.0 };
+ let mut times = 0;
+ for w in words {
+ if let Some(d) = seconds(w) {
+ if times == 0 { one.duration = d } else { one.delay = d }
+ times += 1;
+ } else if let Some(e) = easing(w) {
+ one.easing = e;
+ } else {
+ one.props = union(one.props, group(w)?);
+ }
+ }
+ t = Some(match t {
+ None => one,
+ Some(a) if a.duration == one.duration && a.easing == one.easing && a.delay == one.delay => Transition { props: union(a.props, one.props), ..a },
+ Some(_) => return Err("transitions with different timings on one element aren't mapped"),
+ });
+ }
+ Ok(m.transition = t)
+ }
+ "transitionProperty" => {
+ let mut p = Props::default();
+ for w in s()?.split(',') {
+ p = union(p, group(w.trim())?);
+ }
+ Ok(tr(m).props = p)
+ }
+ "transitionDuration" => Ok(tr(m).duration = seconds(s()?.trim()).ok_or(BAD)?),
+ "transitionDelay" => Ok(tr(m).delay = seconds(s()?.trim()).ok_or(BAD)?),
+ "transitionTimingFunction" => Ok(tr(m).easing = easing(s()?.trim()).ok_or("only ease, linear, ease-in, ease-out, ease-in-out and cubic-bezier() are mapped")?),
+ _ => Err(NOT_RUNE),
+ }
+}
+
+/// CSS's initial timing function, `ease`.
+const EASE: [f32; 4] = [0.25, 0.1, 0.25, 1.0];
+
+fn tr(m: &mut Motion) -> &mut Transition {
+ m.transition.get_or_insert(Transition { props: Props { colours: true, opacity: true, transform: true, shadow: true }, duration: 0.0, easing: EASE, delay: 0.0 })
+}
+
+fn union(a: Props, b: Props) -> Props {
+ Props { colours: a.colours || b.colours, opacity: a.opacity || b.opacity, transform: a.transform || b.transform, shadow: a.shadow || b.shadow }
+}
+
+/// A transition-property name as the group it moves.
+fn group(w: &str) -> Result<Props, &'static str> {
+ let none = Props::default();
+ Ok(match w {
+ "all" => Props { colours: true, opacity: true, transform: true, shadow: true },
+ "none" => none,
+ "opacity" => Props { opacity: true, ..none },
+ "transform" | "translate" | "scale" | "rotate" => Props { transform: true, ..none },
+ "box-shadow" | "boxShadow" => Props { shadow: true, ..none },
+ _ if w.ends_with("color") || w.ends_with("Color") || matches!(w, "fill" | "stroke" | "background") || w.starts_with("--tw-gradient") => Props { colours: true, ..none },
+ // what a transition names that a Rune element doesn't move (filter, display, visibility...): nothing to animate
+ _ if matches!(w, "filter" | "-webkit-backdrop-filter" | "backdrop-filter" | "display" | "visibility" | "content-visibility" | "overlay" | "pointer-events") => none,
+ _ => return Err("a transition property the host doesn't animate"),
+ })
+}
+
+fn seconds(w: &str) -> Option<f32> {
+ if let Some(ms) = w.strip_suffix("ms") {
+ return ms.parse::<f32>().ok().map(|x| x / 1000.0);
+ }
+ w.strip_suffix('s')?.parse().ok()
+}
+
+fn easing(w: &str) -> Option<[f32; 4]> {
+ Some(match w {
+ "ease" => EASE,
+ "linear" => [0.0, 0.0, 1.0, 1.0],
+ "ease-in" => [0.42, 0.0, 1.0, 1.0],
+ "ease-out" => [0.0, 0.0, 0.58, 1.0],
+ "ease-in-out" => [0.42, 0.0, 0.58, 1.0],
+ _ => {
+ let body = w.strip_prefix("cubic-bezier(")?.strip_suffix(')')?;
+ let n: Vec<f32> = body.split(',').map(|x| x.trim().parse().ok()).collect::<Option<_>>()?;
+ <[f32; 4]>::try_from(n).ok()?
+ }
+ })
+}
+
+fn px(w: &str) -> Result<f32, &'static str> {
+ let w = w.trim();
+ if w == "0" {
+ return Ok(0.0);
+ }
+ w.strip_suffix("px").and_then(|p| p.trim().parse().ok()).ok_or("only px (or 0) translations are mapped")
+}
+
+fn num_or_px(v: &Value) -> Result<f32, &'static str> {
+ match v {
+ Value::Number(n) => n.as_f64().map(|x| x as f32).ok_or(BAD),
+ Value::String(s) => px(s),
+ _ => Err(BAD),
+ }
+}
+
+/// A scale: `1.1`, `110%`, or two equal values.
+fn uniform(w: &str) -> Result<f32, &'static str> {
+ let one = |x: &str| -> Result<f32, &'static str> {
+ match x.strip_suffix('%') {
+ Some(p) => p.parse::<f32>().map(|p| p / 100.0).map_err(|_| BAD),
+ None => x.parse().map_err(|_| BAD),
+ }
+ };
+ let vals = w.split([' ', ',']).filter(|x| !x.is_empty()).map(one).collect::<Result<Vec<_>, _>>()?;
+ match vals.as_slice() {
+ [k] => Ok(*k),
+ [x, y] | [x, y, _] if x == y => Ok(*x),
+ _ => Err("a scale that differs per axis has no Rune equivalent"),
+ }
+}
+
+/// An angle in radians: deg, rad, turn, grad.
+fn angle(w: &str) -> Result<f32, &'static str> {
+ let w = w.trim();
+ let (n, k) = if let Some(n) = w.strip_suffix("deg") {
+ (n, std::f32::consts::PI / 180.0)
+ } else if let Some(n) = w.strip_suffix("grad") {
+ (n, std::f32::consts::PI / 200.0)
+ } else if let Some(n) = w.strip_suffix("rad") {
+ (n, 1.0)
+ } else if let Some(n) = w.strip_suffix("turn") {
+ (n, std::f32::consts::TAU)
+ } else if w == "0" {
+ ("0", 1.0)
+ } else {
+ return Err(BAD);
+ };
+ n.trim().parse::<f32>().map(|x| x * k).map_err(|_| BAD)
+}
+
+/// `transformOrigin` as fractions of the box: keywords or percentages, x then y.
+fn origin(w: &str) -> Result<(f32, f32), &'static str> {
+ let mut xy = (0.5, 0.5);
+ let words: Vec<&str> = w.split_whitespace().collect();
+ for (i, t) in words.iter().enumerate() {
+ match *t {
+ "left" => xy.0 = 0.0,
+ "right" => xy.0 = 1.0,
+ "top" => xy.1 = 0.0,
+ "bottom" => xy.1 = 1.0,
+ "center" => {}
+ _ => {
+ let f = t.strip_suffix('%').and_then(|p| p.parse::<f32>().ok()).ok_or("only keyword and % origins are mapped")? / 100.0;
+ if i == 0 { xy.0 = f } else { xy.1 = f }
+ }
+ }
+ }
+ Ok(xy)
+}
+
+/// `transform`'s functions, left to right: translations first, then rotations and uniform scales.
+fn transform(m: &mut Motion, s: &str) -> Result<(), &'static str> {
+ if s.trim() == "none" {
+ return Ok(());
+ }
+ let mut turned = false;
+ for f in s.split(')').map(str::trim).filter(|f| !f.is_empty()) {
+ let (name, args) = f.split_once('(').ok_or(BAD)?;
+ let a: Vec<&str> = args.split(',').map(str::trim).collect();
+ let shift = |m: &mut Motion, x: f32, y: f32| -> Result<(), &'static str> {
+ // a translation after a rotation or scale moves along the turned axes: Rune's offset doesn't
+ if turned && (x != 0.0 || y != 0.0) {
+ return Err("a translate after a rotate or scale has no Rune equivalent");
+ }
+ m.translate = [m.translate[0] + x, m.translate[1] + y];
+ Ok(())
+ };
+ match name.trim() {
+ "translate" => shift(m, px(a[0])?, a.get(1).map_or(Ok(0.0), |y| px(y))?)?,
+ "translateX" => shift(m, px(a[0])?, 0.0)?,
+ "translateY" => shift(m, 0.0, px(a[0])?)?,
+ "translate3d" if a.get(2).is_some_and(|z| px(z) == Ok(0.0)) => shift(m, px(a[0])?, px(a[1])?)?,
+ "scale" | "scale3d" => {
+ m.scale = Some(m.scale.unwrap_or(1.0) * uniform(&a.join(" "))?);
+ turned = true;
+ }
+ "rotate" | "rotateZ" => {
+ m.rotate = Some(m.rotate.unwrap_or(0.0) + angle(a[0])?);
+ turned = true;
+ }
+ _ => return Err("skew, matrix, perspective and 3D transforms have no Rune equivalent"),
+ }
+ }
+ Ok(())
+}
+
+/// `e` with `m`'s transforms and transition, and whether it animates (a transition with a duration): a subtree with
+/// one isn't landed at once.
+pub fn apply(mut e: El, m: &Motion) -> (El, bool) {
+ let [x, y] = [m.translate[0] + m.tw_translate[0], m.translate[1] + m.tw_translate[1]];
+ if x != 0.0 || y != 0.0 {
+ e = e.offset(x, y);
+ }
+ if let Some(k) = m.scale {
+ e = e.scale(k);
+ }
+ if let Some(r) = m.rotate {
+ e = e.rotate(r);
+ }
+ if let Some((ox, oy)) = m.origin {
+ e = e.origin(ox, oy);
+ }
+ let Some(t) = m.transition.as_ref().filter(|t| t.duration > 0.0) else { return (e, false) };
+ let [a, b, c, d] = t.easing;
+ let tween = Curve::tween(t.duration, Easing::cubic(a, b, c, d)).delay(t.delay);
+ if t.props.opacity {
+ e = e.opacity_motion(tween);
+ }
+ if t.props.transform {
+ e = e.offset_motion(tween).scale_motion(tween).rotate_motion(tween);
+ }
+ if t.props.colours || t.props.shadow {
+ e = e.motion(Spring::new(t.duration, 0.0));
+ }
+ (e, true)
+}
diff --git a/engine/rune/style/src/report.rs b/engine/rune/style/src/report.rs
new file mode 100644
index 00000000..6cb89a3a
--- /dev/null
+++ b/engine/rune/style/src/report.rs
@@ -0,0 +1,52 @@
+//! What the host couldn't map (R2b), reported once per page: the first element it was seen on (by path) and why. A
+//! page's report is kept across rebuilds, so a prop that stays unmapped is said once, not every frame.
+
+use std::collections::BTreeMap;
+
+use crate::css::Unmapped;
+
+/// One unmapped prop or value, where it was first seen.
+#[derive(Clone, Debug, PartialEq)]
+pub struct Seen {
+ pub path: String,
+ pub value: String,
+ pub why: &'static str,
+}
+
+/// The page's unmapped props: one entry per (prop, why).
+#[derive(Default, Debug)]
+pub struct Report {
+ seen: BTreeMap<(String, &'static str), Seen>,
+ fresh: Vec<String>,
+}
+
+impl Report {
+ /// `u` seen on the element at `path`; a line for the log the first time this (prop, why) is seen.
+ pub fn add(&mut self, path: &str, u: Unmapped) {
+ let key = (u.prop.clone(), u.why);
+ if self.seen.contains_key(&key) {
+ return;
+ }
+ self.fresh.push(format!("[rune] unmapped {}: {} at {} ({})", u.prop, u.value, path, u.why));
+ self.seen.insert(key, Seen { path: path.to_string(), value: u.value, why: u.why });
+ }
+
+ /// The same, for something that isn't a style prop (a kind, an inline layout the host approximates).
+ pub fn note(&mut self, path: &str, what: &str, value: &str, why: &'static str) {
+ self.add(path, Unmapped { prop: what.to_string(), value: value.to_string(), why });
+ }
+
+ /// Lines not yet logged.
+ pub fn take_fresh(&mut self) -> Vec<String> {
+ std::mem::take(&mut self.fresh)
+ }
+
+ /// Everything seen, by (prop, why).
+ pub fn all(&self) -> impl Iterator<Item = (&str, &Seen)> {
+ self.seen.iter().map(|((p, _), s)| (p.as_str(), s))
+ }
+
+ pub fn is_empty(&self) -> bool {
+ self.seen.is_empty()
+ }
+}
diff --git a/engine/rune/style/src/runeprops.rs b/engine/rune/style/src/runeprops.rs
new file mode 100644
index 00000000..ca338258
--- /dev/null
+++ b/engine/rune/style/src/runeprops.rs
@@ -0,0 +1,130 @@
+//! @raea/rune's props (R6a, sdk/rune/src/index.ts): an element's `data-rune` JSON mapped to Rune's builder. A field the
+//! host can't read is reported with its element's path, never dropped quietly. Motion, a transition or lead and trail
+//! mark the element as animated (view.rs lands every unmarked subtree at once, as the DOM does).
+
+use rune::tok::motion as tok;
+use rune::{Edge, El, Spring, SpringPair, SystemMaterial, Transition};
+use serde_json::Value;
+
+use crate::report::Report;
+
+/// `e` with `json`'s props; whether it asked for motion.
+pub fn apply(mut e: El, json: &str, path: &str, report: &mut Report) -> (El, bool) {
+ let Ok(Value::Object(p)) = serde_json::from_str::<Value>(json) else {
+ report.note(path, "data-rune", json, "not a JSON object of Rune props");
+ return (e, false);
+ };
+ let mut animated = false;
+ let mut bad = |what: &str, v: &Value| report.note(path, &format!("data-rune {what}"), &v.to_string(), "a Rune prop the host can't read");
+ for (k, v) in &p {
+ match k.as_str() {
+ "motion" => match spring(v) {
+ Some(s) => (e, animated) = (e.motion(s), true),
+ None => bad(k, v),
+ },
+ "transition" => match transition(v) {
+ Some(t) => (e, animated) = (e.transition(t), true),
+ None => bad(k, v),
+ },
+ "lead" => match (spring(&v["lead"]), spring(&v["trail"])) {
+ (Some(l), Some(t)) => (e, animated) = (e.lead(l, t), true),
+ _ => bad(k, v),
+ },
+ "instant" => match v.as_bool() {
+ Some(true) => e = e.instant_changes(),
+ Some(false) => {}
+ None => bad(k, v),
+ },
+ "blur" => match v.as_f64() {
+ Some(s) => e = e.blur(s as f32),
+ None => bad(k, v),
+ },
+ "backdropBlur" => match v.as_f64() {
+ Some(s) => e = e.backdrop_blur(s as f32),
+ None => bad(k, v),
+ },
+ "glass" => match v.as_bool() {
+ Some(true) => e = e.system_material(SystemMaterial::Glass),
+ Some(false) => {}
+ None => bad(k, v),
+ },
+ _ => bad(k, v),
+ }
+ }
+ (e, animated)
+}
+
+/// A preset's name or `{duration, bounce}`.
+pub fn spring(v: &Value) -> Option<Spring> {
+ match v {
+ Value::String(s) => Some(match s.as_str() {
+ "instant" => tok::INSTANT,
+ "snap" => tok::SNAP,
+ "settle" => tok::SETTLE,
+ "reflow" => tok::REFLOW,
+ "glide" => tok::GLIDE,
+ "morph" => tok::MORPH,
+ "pop" => tok::POP,
+ "drift" => tok::DRIFT,
+ _ => return None,
+ }),
+ Value::Object(o) => {
+ let d = o.get("duration")?.as_f64()? as f32;
+ let b = o.get("bounce").and_then(Value::as_f64).unwrap_or(0.0) as f32;
+ (d > 0.0 && (0.0..=1.0).contains(&b)).then(|| Spring::new(d, b))
+ }
+ _ => None,
+ }
+}
+
+fn edge(v: &Value) -> Option<Edge> {
+ Some(match v.as_str()? {
+ "leading" => Edge::Leading,
+ "trailing" => Edge::Trailing,
+ "top" => Edge::Top,
+ "bottom" => Edge::Bottom,
+ _ => return None,
+ })
+}
+
+/// An effect, or `{effect, enter?, exit?}`.
+fn transition(v: &Value) -> Option<Transition> {
+ let (effect, enter, exit) = match v.get("effect") {
+ Some(e) => (e, v.get("enter"), v.get("exit")),
+ None => (v, None, None),
+ };
+ let t = match effect {
+ Value::String(s) => match s.as_str() {
+ "none" => Transition::none(),
+ "opacity" => Transition::opacity(),
+ "slide" => Transition::slide(),
+ "blurReplace" => Transition::blur_replace(),
+ _ => return None,
+ },
+ Value::Object(o) => {
+ let (k, x) = o.iter().next()?;
+ match k.as_str() {
+ "scale" => Transition::scale(x.as_f64()? as f32),
+ "offset" => Transition::offset(x.get(0)?.as_f64()? as f32, x.get(1)?.as_f64()? as f32),
+ "move" => Transition::move_edge(edge(x)?),
+ "push" => Transition::push(edge(x)?),
+ "blur" => Transition::blur(x.as_f64()? as f32),
+ _ => return None,
+ }
+ }
+ _ => return None,
+ };
+ if enter.is_none() && exit.is_none() {
+ return Some(t);
+ }
+ // a side left out keeps the token pair's own spring
+ let enter = match enter {
+ Some(s) => spring(s)?,
+ None => tok::SETTLE,
+ };
+ let exit = match exit {
+ Some(s) => spring(s)?,
+ None => tok::SETTLE_EXIT,
+ };
+ Some(t.springs(SpringPair::new(enter, exit)))
+}
diff --git a/engine/rune/style/src/tailwind.rs b/engine/rune/style/src/tailwind.rs
new file mode 100644
index 00000000..8555fd47
--- /dev/null
+++ b/engine/rune/style/src/tailwind.rs
@@ -0,0 +1,342 @@
+//! Tailwind classes as style props (R2c): `className`'s utilities resolved with Tailwind's own theme (v4.3.3's
+//! theme.css, MIT, in assets/) into the React style props css.rs reads, so a utility maps exactly as far as the prop
+//! it sets does. Variants (`hover:`, `md:`, `dark:` and the rest variants.rs maps) hold or not for the element's state
+//! (T3b). A utility this doesn't know (an unmapped variant, an important `!`, a negative, a name outside the table)
+//! comes back in `unknown` to be reported, never dropped.
+
+use std::collections::HashMap;
+use std::sync::OnceLock;
+
+use serde_json::{Map, Value, json};
+
+use crate::variants::{self, State};
+
+const THEME: &str = include_str!("../assets/tailwind-theme.css");
+
+/// theme.css's custom properties, by name without the leading `--`.
+fn theme() -> &'static HashMap<String, String> {
+ static T: OnceLock<HashMap<String, String>> = OnceLock::new();
+ T.get_or_init(|| {
+ let mut m = HashMap::new();
+ for decl in THEME.split(';') {
+ let Some(i) = decl.find("--") else { continue };
+ let Some((k, v)) = decl[i + 2..].split_once(':') else { continue };
+ let v = v.split_whitespace().collect::<Vec<_>>().join(" ");
+ m.insert(k.trim().to_string(), v);
+ }
+ m
+ })
+}
+
+pub(crate) fn var(name: &str) -> Option<&'static str> {
+ theme().get(name).map(String::as_str)
+}
+
+/// A theme length in px: `0.25rem`, `2px`, `0`, `calc(1.25 / 0.875)` (a plain number).
+pub(crate) fn px(v: &str) -> Option<f64> {
+ let v = v.trim();
+ if let Some(r) = v.strip_suffix("rem") {
+ return r.trim().parse::<f64>().ok().map(|x| x * 16.0);
+ }
+ if let Some(p) = v.strip_suffix("px") {
+ return p.trim().parse().ok();
+ }
+ if let Some(body) = v.strip_prefix("calc(").and_then(|b| b.strip_suffix(')')) {
+ let (a, b) = body.split_once('/')?;
+ return Some(a.trim().parse::<f64>().ok()? / b.trim().parse::<f64>().ok()?);
+ }
+ v.parse().ok()
+}
+
+/// A spacing step (`4`, `0.5`, `px`), a fraction (`1/2`, as a %), or an arbitrary value (`[13px]`).
+fn spacing(s: &str) -> Option<Value> {
+ if let Some(a) = s.strip_prefix('[').and_then(|a| a.strip_suffix(']')) {
+ return Some(match a.strip_suffix("px").and_then(|p| p.parse::<f64>().ok()) {
+ Some(p) => json!(p),
+ None => json!(a.replace('_', " ")),
+ });
+ }
+ if s == "px" {
+ return Some(json!(1.0));
+ }
+ if let Some((a, b)) = s.split_once('/') {
+ let (a, b) = (a.parse::<f64>().ok()?, b.parse::<f64>().ok()?);
+ return Some(json!(format!("{}%", a / b * 100.0)));
+ }
+ let n: f64 = s.parse().ok()?;
+ Some(json!(n * px(var("spacing")?)?))
+}
+
+/// A size utility's value: spacing, or full/auto.
+fn size(s: &str) -> Option<Value> {
+ match s {
+ "full" => Some(json!("100%")),
+ "auto" => Some(json!("auto")),
+ _ => spacing(s),
+ }
+}
+
+/// A colour (`blue-500`, `white`, `blue-500/50`, `[#123456]`) as CSS text css.rs reads.
+fn colour(s: &str) -> Option<String> {
+ let (name, alpha) = match s.split_once('/') {
+ Some((n, a)) => (n, Some(a.parse::<f64>().ok()? / 100.0)),
+ None => (s, None),
+ };
+ let base = match name {
+ "transparent" => "transparent".to_string(),
+ _ if name.starts_with('[') => name.trim_start_matches('[').trim_end_matches(']').to_string(),
+ _ => var(&format!("color-{name}"))?.to_string(),
+ };
+ let Some(a) = alpha else { return Some(base) };
+ if let Some(body) = base.strip_prefix("oklch(").and_then(|b| b.strip_suffix(')')) {
+ return Some(format!("oklch({body} / {a})"));
+ }
+ let c = rune::color::hex(&base)?;
+ let e = |x: f32| (rune::color::srgb_encode(x) * 255.0).round();
+ Some(format!("rgb({} {} {} / {a})", e(c.r), e(c.g), e(c.b)))
+}
+
+/// `className` as style props for an element in state `s` (variants.rs; `State::default()` is light at no width, where
+/// no variant holds): the plain utilities, then those whose variants
+/// hold in Tailwind's order, a later one winning; and the utilities, variants included, that it couldn't place. A
+/// variant's utility that doesn't hold now is still checked, so what can't map is reported in any state.
+pub fn style_in(class: &str, s: &State) -> (Map<String, Value>, Vec<String>) {
+ let mut hits: Vec<(u64, Props)> = Vec::new();
+ let mut unknown = Vec::new();
+ for u in class.split_whitespace() {
+ match variants::split(u, s).and_then(|(util, key, holds)| Some((utility(util)?, key, holds))) {
+ Some((props, key, true)) => hits.push((key, props)),
+ Some(_) => {}
+ None => unknown.push(u.to_string()),
+ }
+ }
+ // stable: within one place in the cascade, the class's own order
+ hits.sort_by_key(|h| h.0);
+ let mut out = Map::new();
+ for (k, v) in hits.into_iter().flat_map(|h| h.1) {
+ out.insert(k.to_string(), v);
+ }
+ (out, unknown)
+}
+
+type Props = Vec<(&'static str, Value)>;
+
+fn one(k: &'static str, v: Value) -> Option<Props> {
+ Some(vec![(k, v)])
+}
+
+fn utility(u: &str) -> Option<Props> {
+ if u.contains(':') || u.starts_with('!') || u.starts_with('-') {
+ return None;
+ }
+ let s = |v: &str| json!(v);
+ match u {
+ "flex" | "inline-flex" => return one("display", s("flex")),
+ "block" => return one("display", s("block")),
+ "inline" | "inline-block" => return one("display", s("inline")),
+ "hidden" => return one("display", s("none")),
+ "flex-row" => return one("flexDirection", s("row")),
+ "flex-col" => return one("flexDirection", s("column")),
+ "flex-wrap" => return one("flexWrap", s("wrap")),
+ "flex-nowrap" => return one("flexWrap", s("nowrap")),
+ "flex-1" => return Some(vec![("flexGrow", json!(1)), ("flexShrink", json!(1)), ("flexBasis", s("0%"))]),
+ "flex-auto" => return Some(vec![("flexGrow", json!(1)), ("flexShrink", json!(1)), ("flexBasis", s("auto"))]),
+ "flex-none" => return Some(vec![("flexGrow", json!(0)), ("flexShrink", json!(0)), ("flexBasis", s("auto"))]),
+ "grow" => return one("flexGrow", json!(1)),
+ "grow-0" => return one("flexGrow", json!(0)),
+ "shrink" => return one("flexShrink", json!(1)),
+ "shrink-0" => return one("flexShrink", json!(0)),
+ "absolute" | "relative" | "static" => return one("position", s(u)),
+ "italic" => return one("fontStyle", s("italic")),
+ "not-italic" => return one("fontStyle", s("normal")),
+ "text-left" | "text-center" | "text-right" => return one("textAlign", s(&u[5..])),
+ "border" => return one("borderWidth", json!(1)),
+ "rounded" => return one("borderRadius", json!(px(var("radius")?)?)),
+ "rounded-none" => return one("borderRadius", json!(0)),
+ "rounded-full" => return one("borderRadius", json!(9999)),
+ "shadow" => return one("boxShadow", s(var("shadow")?)),
+ "shadow-none" => return one("boxShadow", s("none")),
+ // transitions (T3c): the property list Tailwind 4.3.3 writes, its default duration and curve under any
+ // duration-* or ease-* (motion.rs reads --tw-transition first)
+ "transition" => return transition("color, background-color, border-color, outline-color, opacity, box-shadow, transform, translate, scale, rotate"),
+ "transition-all" => return transition("all"),
+ "transition-colors" => return transition("color, background-color, border-color, outline-color, fill, stroke"),
+ "transition-opacity" => return transition("opacity"),
+ "transition-shadow" => return transition("box-shadow"),
+ "transition-transform" => return transition("transform, translate, scale, rotate"),
+ "transition-none" => return one("transitionProperty", s("none")),
+ "ease-linear" => return one("transitionTimingFunction", s("linear")),
+ "ease-in" => return one("transitionTimingFunction", s(var("ease-in")?)),
+ "ease-out" => return one("transitionTimingFunction", s(var("ease-out")?)),
+ "ease-in-out" => return one("transitionTimingFunction", s(var("ease-in-out")?)),
+ "origin-center" => return one("transformOrigin", s("center")),
+ "origin-top" | "origin-bottom" | "origin-left" | "origin-right" => return one("transformOrigin", s(&u[7..])),
+ "origin-top-left" | "origin-top-right" | "origin-bottom-left" | "origin-bottom-right" => return one("transformOrigin", s(&u[7..].replace('-', " "))),
+ "inset-0" => return Some(["top", "right", "bottom", "left"].map(|k| (k, json!(0))).to_vec()),
+ _ => {}
+ }
+ let (head, rest) = u.split_once('-')?;
+ let pad = |keys: &[&'static str]| -> Option<Props> {
+ let v = spacing(rest.split_once('-').map_or(rest, |(_, r)| r))?;
+ Some(keys.iter().map(|k| (*k, v.clone())).collect())
+ };
+ match head {
+ "p" => one("padding", spacing(rest)?),
+ "px" => one_two("paddingLeft", "paddingRight", spacing(rest)?),
+ "py" => one_two("paddingTop", "paddingBottom", spacing(rest)?),
+ "pt" => one("paddingTop", spacing(rest)?),
+ "pr" => one("paddingRight", spacing(rest)?),
+ "pb" => one("paddingBottom", spacing(rest)?),
+ "pl" => one("paddingLeft", spacing(rest)?),
+ "m" => one("margin", size(rest)?),
+ "mx" => one_two("marginLeft", "marginRight", size(rest)?),
+ "my" => one_two("marginTop", "marginBottom", size(rest)?),
+ "mt" => one("marginTop", size(rest)?),
+ "mr" => one("marginRight", size(rest)?),
+ "mb" => one("marginBottom", size(rest)?),
+ "ml" => one("marginLeft", size(rest)?),
+ "gap" => match rest.split_once('-') {
+ Some(("x", _)) => pad(&["columnGap"]),
+ Some(("y", _)) => pad(&["rowGap"]),
+ _ => one("gap", spacing(rest)?),
+ },
+ "w" => one("width", size(rest)?),
+ "h" => one("height", size(rest)?),
+ "size" => one_two("width", "height", size(rest)?),
+ "min" | "max" => {
+ let (axis, v) = rest.split_once('-')?;
+ let k = match (head, axis) {
+ ("min", "w") => "minWidth",
+ ("min", "h") => "minHeight",
+ ("max", "w") => "maxWidth",
+ ("max", "h") => "maxHeight",
+ _ => return None,
+ };
+ let v = match var(&format!("container-{v}")) {
+ Some(c) if axis == "w" => json!(px(c)?),
+ _ => size(v)?,
+ };
+ one(k, v)
+ }
+ "top" | "right" | "bottom" | "left" => one(["top", "right", "bottom", "left"].into_iter().find(|k| *k == head)?, spacing(rest)?),
+ "inset" => match rest.split_once('-') {
+ Some(("x", _)) => pad(&["left", "right"]),
+ Some(("y", _)) => pad(&["top", "bottom"]),
+ _ => Some(["top", "right", "bottom", "left"].map(|k| (k, spacing(rest).unwrap_or(json!(0)))).to_vec()),
+ },
+ "items" => one("alignItems", s(flexword(rest)?)),
+ "self" => one("alignSelf", s(flexword(rest)?)),
+ "justify" => one("justifyContent", s(flexword(rest)?)),
+ "basis" => one("flexBasis", size(rest)?),
+ "overflow" => match rest.split_once('-') {
+ Some(("x", v)) => one("overflowX", s(v)),
+ Some(("y", v)) => one("overflowY", s(v)),
+ _ => one("overflow", s(rest)),
+ },
+ "opacity" => one("opacity", json!(rest.parse::<f64>().ok()? / 100.0)),
+ "bg" => one("backgroundColor", s(&colour(rest)?)),
+ "text" => match var(&format!("text-{rest}")) {
+ Some(sz) => {
+ let lh = var(&format!("text-{rest}--line-height")).and_then(px)?;
+ Some(vec![("fontSize", json!(px(sz)?)), ("lineHeight", json!(lh))])
+ }
+ None => one("color", s(&colour(rest)?)),
+ },
+ "font" => match var(&format!("font-weight-{rest}")) {
+ Some(w) => one("fontWeight", json!(w.parse::<f64>().ok()?)),
+ None => one("fontFamily", s(match rest {
+ "sans" => "Inter",
+ "mono" => "monospace",
+ _ => return None,
+ })),
+ },
+ "leading" => one("lineHeight", match var(&format!("leading-{rest}")) {
+ Some(l) => json!(l.parse::<f64>().ok()?),
+ None => spacing(rest)?,
+ }),
+ "rounded" => radius(rest),
+ "border" => border(rest),
+ "shadow" => one("boxShadow", s(var(&format!("shadow-{rest}"))?)),
+ "duration" => one("transitionDuration", s(&format!("{}ms", rest.parse::<f64>().ok()?))),
+ "delay" => one("transitionDelay", s(&format!("{}ms", rest.parse::<f64>().ok()?))),
+ "translate" => match rest.split_once('-') {
+ Some(("x", v)) => one("--tw-translate-x", spacing(v)?),
+ Some(("y", v)) => one("--tw-translate-y", spacing(v)?),
+ _ => None,
+ },
+ // scale-105 is 1.05 (both axes); scale-x-* and scale-y-* differ per axis, which Rune can't
+ "scale" => one("scale", json!(rest.parse::<f64>().ok()? / 100.0)),
+ "rotate" => one("rotate", s(&format!("{}deg", rest.parse::<f64>().ok()?))),
+ _ => None,
+ }
+}
+
+fn one_two(a: &'static str, b: &'static str, v: Value) -> Option<Props> {
+ Some(vec![(a, v.clone()), (b, v)])
+}
+
+fn flexword(w: &str) -> Option<&'static str> {
+ Some(match w {
+ "start" => "flex-start",
+ "end" => "flex-end",
+ "center" => "center",
+ "stretch" => "stretch",
+ "between" => "space-between",
+ "around" => "space-around",
+ "evenly" => "space-evenly",
+ _ => return None,
+ })
+}
+
+/// `rounded-{size}`, `rounded-{t|r|b|l|tl|tr|br|bl}[-{size}]`.
+fn radius(rest: &str) -> Option<Props> {
+ let size = |s: &str| -> Option<Value> {
+ match s {
+ "none" => Some(json!(0)),
+ "full" => Some(json!(9999)),
+ "" => Some(json!(px(var("radius")?)?)),
+ _ => Some(json!(px(var(&format!("radius-{s}"))?)?)),
+ }
+ };
+ if let Some(v) = size(rest) {
+ return one("borderRadius", v);
+ }
+ let (side, s) = rest.split_once('-').unwrap_or((rest, ""));
+ let corners: &[&'static str] = match side {
+ "t" => &["borderTopLeftRadius", "borderTopRightRadius"],
+ "r" => &["borderTopRightRadius", "borderBottomRightRadius"],
+ "b" => &["borderBottomRightRadius", "borderBottomLeftRadius"],
+ "l" => &["borderTopLeftRadius", "borderBottomLeftRadius"],
+ "tl" => &["borderTopLeftRadius"],
+ "tr" => &["borderTopRightRadius"],
+ "br" => &["borderBottomRightRadius"],
+ "bl" => &["borderBottomLeftRadius"],
+ _ => return None,
+ };
+ let v = size(s)?;
+ Some(corners.iter().map(|k| (*k, v.clone())).collect())
+}
+
+/// `border-{n}`, `border-{t|r|b|l|x|y}[-{n}]`, `border-{colour}`.
+fn border(rest: &str) -> Option<Props> {
+ if let Ok(n) = rest.parse::<f64>() {
+ return one("borderWidth", json!(n));
+ }
+ let (side, n) = rest.split_once('-').unwrap_or((rest, "1"));
+ let sides: &[&'static str] = match side {
+ "t" => &["borderTopWidth"],
+ "r" => &["borderRightWidth"],
+ "b" => &["borderBottomWidth"],
+ "l" => &["borderLeftWidth"],
+ "x" => &["borderLeftWidth", "borderRightWidth"],
+ "y" => &["borderTopWidth", "borderBottomWidth"],
+ _ => return one("borderColor", json!(colour(rest)?)),
+ };
+ let w = n.parse::<f64>().ok()?;
+ Some(sides.iter().map(|k| (*k, json!(w))).collect())
+}
+
+/// A `transition-*` utility: its properties, and Tailwind's default duration and curve under any duration-* or ease-*.
+fn transition(props: &str) -> Option<Props> {
+ Some(vec![("transitionProperty", json!(props)), ("--tw-transition", json!(true))])
+}
diff --git a/engine/rune/style/src/variants.rs b/engine/rune/style/src/variants.rs
new file mode 100644
index 00000000..f1a4adeb
--- /dev/null
+++ b/engine/rune/style/src/variants.rs
@@ -0,0 +1,80 @@
+//! Tailwind's variants (docs/targets.feature T3b): `hover:`, `focus:`, `focus-visible:`, `active:`, `enabled:`,
+//! `disabled:`, `sm:` to `2xl:` (the window's width against Tailwind 4.3.3's breakpoints) and `dark:` (the system's
+//! appearance, Tailwind 4's default media strategy), chained in any order. Each holds or not for an element's `State`,
+//! and a utility under variants lands where Tailwind's CSS puts it: after the plain utilities, ordered by its variants
+//! as Tailwind 4.3.3 orders them (a bit per variant in the order below, a chain being the sum, so `md:hover:` comes
+//! after `md:` and before `lg:`, and `dark:hover:` after `dark:`). Any other variant (`group-hover:`, `first:`,
+//! `placeholder:`, an arbitrary one) leaves its utility unknown, to be reported.
+
+use crate::tailwind::{px, var};
+
+/// What an element's variants test: its own state and the page's.
+#[derive(Clone, Copy, Debug, Default, PartialEq)]
+pub struct State {
+ /// the pointer is over it or something inside it (CSS's :hover)
+ pub hover: bool,
+ /// a press began on it or inside it and hasn't been released (:active)
+ pub active: bool,
+ /// it has the page's focus (:focus)
+ pub focus: bool,
+ /// its focus is one the page shows (:focus-visible: from a key, or a text field however it was focused)
+ pub focus_visible: bool,
+ /// a form control (button, input, select, textarea): only these are :enabled or :disabled
+ pub control: bool,
+ /// a disabled control
+ pub disabled: bool,
+ /// the system's appearance is dark (prefers-color-scheme)
+ pub dark: bool,
+ /// the window's width in points (the viewport's, for min-width breakpoints)
+ pub width: f32,
+}
+
+const BREAKPOINTS: [&str; 5] = ["sm", "md", "lg", "xl", "2xl"];
+
+/// Variant `v`'s bit in Tailwind 4.3.3's order, and whether it holds for `s`; None for a variant this doesn't map.
+fn variant(v: &str, s: &State) -> Option<(u32, bool)> {
+ Some(match v {
+ "hover" => (0, s.hover),
+ "focus" => (1, s.focus),
+ "focus-visible" => (2, s.focus && s.focus_visible),
+ "active" => (3, s.active),
+ "enabled" => (4, s.control && !s.disabled),
+ "disabled" => (5, s.control && s.disabled),
+ "dark" => (11, s.dark),
+ _ => {
+ let i = BREAKPOINTS.iter().position(|b| *b == v)?;
+ let min = px(var(&format!("breakpoint-{v}"))?)?;
+ (6 + i as u32, f64::from(s.width) >= min)
+ }
+ })
+}
+
+/// A class as its utility, its variants' place in the cascade (0 for none) and whether they all hold for `s`; None when
+/// a variant isn't one this maps.
+pub fn split<'a>(class: &'a str, s: &State) -> Option<(&'a str, u64, bool)> {
+ // a colon inside an arbitrary value's brackets (`bg-[url(a:b)]`) isn't a variant's
+ let mut parts = Vec::new();
+ let (mut depth, mut start) = (0i32, 0);
+ for (i, c) in class.char_indices() {
+ match c {
+ '[' => depth += 1,
+ ']' => depth -= 1,
+ ':' if depth == 0 => {
+ parts.push(&class[start..i]);
+ start = i + 1;
+ }
+ _ => {}
+ }
+ }
+ let util = &class[start..];
+ let (mut key, mut holds) = (0u64, true);
+ for v in parts {
+ let (bit, on) = variant(v, s)?;
+ key |= 1 << bit;
+ holds &= on;
+ }
+ Some((util, key, holds))
+}
+
+/// The variants this maps, for the README's table.
+pub const MAPPED: [&str; 12] = ["hover", "focus", "focus-visible", "active", "enabled", "disabled", "sm", "md", "lg", "xl", "2xl", "dark"];
diff --git a/engine/rune/style/tests/motion.rs b/engine/rune/style/tests/motion.rs
new file mode 100644
index 00000000..dd640389
--- /dev/null
+++ b/engine/rune/style/tests/motion.rs
@@ -0,0 +1,49 @@
+//! T3c (docs/targets.feature): CSS transforms read as Rune's offset, scale and rotation, and transitions as their
+//! properties and timing (Tailwind's utilities too). page/tests/motion.rs runs them on a page.
+
+use raea_rune_style::css::parse;
+use raea_rune_style::tailwind::style_in;
+use raea_rune_style::variants::State;
+use serde_json::{Map, Value, json};
+
+fn css(v: Value) -> (raea_rune_style::css::Css, Vec<String>) {
+ let (c, bad) = parse(&serde_json::from_value::<Map<String, Value>>(v).unwrap());
+ (c, bad.into_iter().map(|b| b.prop).collect())
+}
+
+#[test]
+fn transforms_read_as_offset_scale_and_rotation() {
+ let (c, bad) = css(json!({"transform": "translateX(10px) translateY(-4px) scale(1.5) rotate(90deg)", "transformOrigin": "left top"}));
+ assert!(bad.is_empty(), "{bad:?}");
+ let m = c.motion;
+ assert_eq!((m.translate, m.scale, m.origin), ([10.0, -4.0], Some(1.5), Some((0.0, 0.0))));
+ assert!((m.rotate.unwrap() - std::f32::consts::FRAC_PI_2).abs() < 1e-6);
+ // what Rune can't draw is reported: a translate along turned axes, skew, a scale per axis, a percentage
+ for t in ["rotate(10deg) translateX(5px)", "skewX(10deg)", "scale(1, 2)", "translateX(50%)"] {
+ assert_eq!(css(json!({"transform": t})).1, ["transform"], "{t}");
+ }
+ let (c, bad) = css(json!({"translate": "3px 4px", "scale": "110%", "rotate": "0.5turn"}));
+ assert!(bad.is_empty(), "{bad:?}");
+ assert_eq!((c.motion.translate, c.motion.scale), ([3.0, 4.0], Some(1.1)));
+}
+
+#[test]
+fn transitions_read_their_properties_and_timing() {
+ let (c, bad) = css(json!({"transition": "opacity 200ms ease-in 50ms, transform 200ms ease-in 50ms"}));
+ assert!(bad.is_empty(), "{bad:?}");
+ let t = c.motion.transition.unwrap();
+ assert_eq!((t.duration, t.delay, t.easing), (0.2, 0.05, [0.42, 0.0, 1.0, 1.0]));
+ assert!(t.props.opacity && t.props.transform && !t.props.colours);
+ assert_eq!(css(json!({"transition": "opacity 1s, color 2s"})).1, ["transition"], "two timings on one element");
+ // Tailwind: the utility's properties and its defaults, under duration-* and ease-* whatever their order
+ let (s, unknown) = style_in("duration-300 transition-colors ease-out translate-x-4 scale-105 rotate-45 origin-top-left", &State::default());
+ assert!(unknown.is_empty(), "{unknown:?}");
+ let (c, bad) = parse(&s);
+ assert!(bad.is_empty(), "{bad:?}");
+ let t = c.motion.transition.unwrap();
+ assert_eq!((t.duration, t.easing), (0.3, [0.0, 0.0, 0.2, 1.0]));
+ assert!(t.props.colours && !t.props.opacity);
+ assert_eq!((c.motion.tw_translate, c.motion.scale, c.motion.origin), ([16.0, 0.0], Some(1.05), Some((0.0, 0.0))));
+ let (c, _) = parse(&style_in("transition", &State::default()).0);
+ assert_eq!(c.motion.transition.unwrap().duration, 0.15, "Tailwind's default duration");
+}
diff --git a/engine/rune/tests/apps/asks.tsx b/engine/rune/tests/apps/asks.tsx
new file mode 100644
index 00000000..a31ba6d0
--- /dev/null
+++ b/engine/rune/tests/apps/asks.tsx
@@ -0,0 +1,31 @@
+// R4a's test page for the host bindings (not an R5 app): frames asked for with `ticks`, a host call answered later,
+// a synchronous one answered at once, and a timer on the host's clock.
+import { useEffect, useState } from "react";
+import { call, callSync, emit, on } from "@raea/ui/wire";
+
+export default function Asks() {
+ const [frames, setFrames] = useState(0);
+ const [answer, setAnswer] = useState("pending");
+ const [sync, setSync] = useState("");
+ const [timer, setTimer] = useState("waiting");
+ useEffect(() => {
+ emit("ticks", true);
+ const off = on<number>("frame", () => setFrames((f) => f + 1));
+ call("nothing").then(() => setAnswer("ok"), (e) => setAnswer(`err: ${e?.message ?? e}`));
+ try {
+ setSync(`ok: ${callSync("nothing")}`);
+ } catch (e) {
+ setSync(`err: ${(e as Error).message}`);
+ }
+ const t = setTimeout(() => setTimer(`fired at ${Math.round(performance.now())}`), 100);
+ return () => (off(), clearTimeout(t));
+ }, []);
+ return (
+ <div style={{ display: "flex", flexDirection: "column" }}>
+ <span data-testid="frames">{frames > 0 ? "ticking" : "still"}</span>
+ <span data-testid="answer">{answer}</span>
+ <span data-testid="sync">{sync}</span>
+ <span data-testid="timer">{timer}</span>
+ </div>
+ );
+}
diff --git a/engine/rune/tests/apps/counter.tsx b/engine/rune/tests/apps/counter.tsx
new file mode 100644
index 00000000..d000c4a7
--- /dev/null
+++ b/engine/rune/tests/apps/counter.tsx
@@ -0,0 +1,24 @@
+// R5's counter (projects/rune/js/apps/counter.tsx), as the host's tests run it.
+// Text that changes, a button whose style follows state, a reset that appears past 2.
+import { useState } from "react";
+
+export default function App() {
+ const [n, setN] = useState(0);
+ return (
+ <div data-testid="root" style={{ display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", gap: 16, width: 360, height: 240, backgroundColor: "#111318" }}>
+ <span data-testid="count" style={{ fontSize: 32, fontWeight: 600, color: "#f2f3f5" }}>{`Count: ${n}`}</span>
+ <div style={{ display: "flex", flexDirection: "row", gap: 8 }}>
+ <button data-testid="inc" onClick={() => setN(n + 1)} style={{ padding: 10, borderRadius: 8, backgroundColor: n % 2 ? "#3b82f6" : "#2a2d35", color: "#fff", fontSize: 14 }}>
+ Add one
+ </button>
+ {n > 2 && (
+ <button data-testid="reset" onClick={() => setN(0)} style={{ padding: 10, borderRadius: 8, backgroundColor: "#2a2d35", color: "#fca5a5", fontSize: 14 }}>
+ Reset
+ </button>
+ )}
+ </div>
+ </div>
+ );
+}
+
+export const steps = [{ press: "inc" }, { press: "inc" }, { press: "inc" }, { press: "reset" }, { press: "inc" }];
diff --git a/engine/rune/tests/calls.rs b/engine/rune/tests/calls.rs
new file mode 100644
index 00000000..982a3ba7
--- /dev/null
+++ b/engine/rune/tests/calls.rs
@@ -0,0 +1,24 @@
+//! T2c (docs/targets.feature): a call the native target can't answer says so. world.* is refused with a typed error
+//! naming T6, any other unknown call as one this host lacks, a sync call the same way, and every one is kept for the
+//! check's unanswered.json.
+use raea_rune_host::js::App;
+
+const SCRIPT: &str = r#"
+ globalThis.__ui_deliver = (json) => { const m = JSON.parse(json); if (m.t === "answer") console.log("answer " + m.id + " " + m.ok + " " + m.error); };
+ __ui_call(1, "world.spawn_entity", JSON.stringify({ components: {} }));
+ __ui_call(2, "files.open", "{}");
+ __ui_call(3, "world.spawn_entity", "{}");
+ console.log("sync " + __ui_sync("layout.now", "null"));
+"#;
+
+#[test]
+fn a_call_the_native_target_can_t_answer_says_so_and_is_listed() {
+ let app = App::new(SCRIPT, (100.0, 100.0)).unwrap();
+ let logs = app.logs.borrow().join("\n");
+ assert!(logs.contains("answer 1 false world.spawn_entity: no world on the native target (targets.feature T6)"), "{logs}");
+ assert!(logs.contains("answer 2 false the Rune host has no files.open"), "{logs}");
+ assert!(logs.contains("the Rune host has no layout.now"), "{logs}");
+ let refused = app.refused.borrow();
+ let listed: Vec<(&str, u32)> = refused.iter().map(|(k, (_, n))| (k.as_str(), *n)).collect();
+ assert_eq!(listed, [("files.open", 1), ("layout.now", 1), ("world.spawn_entity", 2)]);
+}
diff --git a/engine/rune/tests/common/mod.rs b/engine/rune/tests/common/mod.rs
new file mode 100644
index 00000000..85a27a56
--- /dev/null
+++ b/engine/rune/tests/common/mod.rs
@@ -0,0 +1,28 @@
+//! What the tests share: an app (tests/apps) or an example of @raea/rune (sdk/rune/examples), bundled as raea bundles
+//! it (runtime/bundle/lib app.rs: raea-bundle's library beside the test binary, or RAEA_BUNDLE_LIB) and mounted at
+//! 800x600.
+use std::path::{Path, PathBuf};
+
+use raea_rune_host::js::App;
+
+/// raea's checkout, which the bundle resolves React, @raea/ui and @raea/rune from
+fn home() -> PathBuf {
+ Path::new(env!("CARGO_MANIFEST_DIR")).join("../..")
+}
+
+/// `file`'s script
+pub fn script(file: &Path) -> String {
+ raea_runtime_bundle_lib::app::bundle(file, &home()).unwrap().0
+}
+
+/// tests/apps/`name`
+#[allow(dead_code)]
+pub fn app(name: &str) -> App {
+ App::new(&script(&Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/apps").join(name)), (800.0, 600.0)).unwrap()
+}
+
+/// sdk/rune/examples/`name`
+#[allow(dead_code)]
+pub fn example(name: &str) -> App {
+ App::new(&script(&home().join("sdk/rune/examples").join(name)), (800.0, 600.0)).unwrap()
+}
diff --git a/engine/rune/tests/css.rs b/engine/rune/tests/css.rs
new file mode 100644
index 00000000..f89a7cf2
--- /dev/null
+++ b/engine/rune/tests/css.rs
@@ -0,0 +1,71 @@
+//! R2b: the style reader. Values it understands become typed values; anything else is reported with why.
+
+use raea_rune_host::css::{self, Align, Len, parse};
+use raea_rune_host::page::{Page, headless};
+use serde_json::{Map, Value, json};
+
+fn style(v: Value) -> Map<String, Value> {
+ v.as_object().unwrap().clone()
+}
+
+#[test]
+fn reads_what_react_sends() {
+ let (c, bad) = parse(&style(json!({
+ "display": "flex", "flexDirection": "column", "alignItems": "center", "justifyContent": "space-between",
+ "width": 180, "height": "50%", "minHeight": 0, "padding": 6, "paddingLeft": "10px", "gap": 8,
+ "borderWidth": 1, "borderTopWidth": 2, "borderRadius": 8, "lineHeight": 1.25, "fontWeight": "bold",
+ "boxShadow": "0 4px 12px rgba(0,0,0,0.5), inset 1px 1px #fff",
+ "backgroundImage": "linear-gradient(180deg, #f97316, #16181d 80%)"
+ })));
+ assert!(bad.is_empty(), "{bad:?}");
+ assert_eq!((c.column, c.align_items, c.justify), (Some(true), Some(Align::Center), Some(Align::Between)));
+ assert_eq!((c.width, c.height, c.min_height), (Some(Len::Px(180.0)), Some(Len::Pct(50.0)), Some(Len::Px(0.0))));
+ assert_eq!(c.padding, [Some(6.0), Some(6.0), Some(6.0), Some(10.0)]);
+ assert_eq!(c.border_width, [Some(2.0), Some(1.0), Some(1.0), Some(1.0)]);
+ assert_eq!((c.line_height, c.font_weight), (Some(Len::Pct(125.0)), Some(700.0)));
+ assert_eq!(c.shadows.len(), 2);
+ assert!((c.shadows[0].color.a - 0.5).abs() < 1e-6 && c.shadows[1].inset && c.shadows[0].blur == 12.0);
+ let (angle, stops) = c.gradient.unwrap();
+ assert!((angle - std::f32::consts::PI).abs() < 1e-5);
+ assert_eq!(stops.iter().map(|s| s.0).collect::<Vec<_>>(), vec![0.0, 0.8]);
+}
+
+#[test]
+fn colours() {
+ let w = css::color("#fff").unwrap();
+ assert_eq!((w.r, w.a), (1.0, 1.0));
+ assert_eq!(css::color("rgb(255 255 255 / 0.25)").unwrap().a, 0.25);
+ assert_eq!(css::color("transparent").unwrap().a, 0.0);
+ assert!(css::color("hsl(0 0% 0%)").is_none());
+}
+
+#[test]
+fn reports_what_it_cant_map() {
+ let (_, bad) = parse(&style(json!({"transform": "skewX(4deg)", "width": "calc(100% - 4px)", "flexDirection": "row-reverse", "backgroundImage": "url(a.png)"})));
+ let mut got: Vec<(&str, &str)> = bad.iter().map(|u| (u.prop.as_str(), u.why)).collect();
+ got.sort();
+ assert_eq!(got.len(), 4, "{got:?}");
+ assert!(got.iter().any(|(p, w)| *p == "transform" && w.contains("no Rune equivalent")));
+ assert!(got.iter().any(|(p, w)| *p == "width" && w.contains("can't read")));
+}
+
+#[test]
+fn the_page_reports_once_with_the_element_s_path() {
+ let mut page = Page::default();
+ page.apply(
+ r#"{"v":1,"ops":[{"op":"create","id":1,"kind":"div","props":{"style":{"transform":"skewX(2deg)","width":"40%"}}},
+ {"op":"create","id":2,"kind":"div","props":{"style":{"transform":"skewY(3deg)"},"title":"hi"}},
+ {"op":"append","parent":0,"child":1},{"op":"append","parent":1,"child":2}]}"#,
+ )
+ .unwrap();
+ let mut rt = headless(page, (400.0, 300.0));
+ rt.frame(0.0);
+ rt.frame(1.0 / 60.0);
+ let mut r = rt.state.report.borrow_mut();
+ let all: Vec<(String, String)> = r.all().map(|(p, s)| (p.to_string(), s.path.clone())).collect();
+ assert!(all.contains(&("transform".into(), "/div[0]".into())), "{all:?}");
+ assert!(all.contains(&("width".into(), "/div[0]".into())), "{all:?}");
+ assert!(all.contains(&("title".into(), "/div[0]/div[0]".into())), "{all:?}");
+ assert_eq!(all.iter().filter(|(p, _)| p == "transform").count(), 1, "said once per page");
+ assert_eq!(r.take_fresh().len(), all.len());
+}
diff --git a/engine/rune/tests/events.rs b/engine/rune/tests/events.rs
new file mode 100644
index 00000000..5172f427
--- /dev/null
+++ b/engine/rune/tests/events.rs
@@ -0,0 +1,227 @@
+//! R3a: Rune's input back over the wire, driven through Rune's own input paths on the R5 apps' recorded mounts (DOM
+//! mode: the root listens for pointer events, some elements for enter and leave, fields send change).
+
+use raea_rune_host::page::{Out, Page};
+use raea_rune_host::session::Session;
+use serde_json::Value;
+
+fn mounted(app: &str) -> Session {
+ let path = format!("{}/tests/recorded/{app}.json", env!("CARGO_MANIFEST_DIR"));
+ let rec: Value = serde_json::from_str(&std::fs::read_to_string(path).unwrap()).unwrap();
+ let mut s = Session::new(Page::default(), (800.0, 600.0));
+ s.apply(rec["frames"][0]["batch"].as_str().unwrap()).unwrap();
+ s.take_out();
+ s
+}
+
+fn delivered(out: &[Out]) -> Vec<Value> {
+ out.iter().filter_map(|o| if let Out::Deliver(m) = o { Some(serde_json::from_str(m).unwrap()) } else { None }).collect()
+}
+
+/// A press on `id`: what was sent, and its downs and ups as (event, element).
+fn press(s: &mut Session, id: u64) -> (Vec<Value>, Vec<(String, u64)>) {
+ s.click_el(id).unwrap();
+ let msgs = delivered(&s.take_out());
+ let kinds = msgs.iter().filter(|m| m["t"] == "event" && matches!(m["event"].as_str(), Some("pointerdown" | "pointerup")))
+ .map(|m| (m["event"].as_str().unwrap().to_string(), m["id"].as_u64().unwrap())).collect();
+ (msgs, kinds)
+}
+
+/// As raea's other host does: a press goes to the nearest element up from its target that listens, and only to it.
+#[test]
+fn a_press_goes_to_the_nearest_listener_at_its_client_point() {
+ let mut s = mounted("counter");
+ let inc = s.tid("inc").unwrap();
+ let r = s.rect(inc).unwrap();
+ let (msgs, kinds) = press(&mut s, inc);
+ assert_eq!(kinds, [("pointerdown".to_string(), inc), ("pointerup".to_string(), inc)]);
+ // the count doesn't listen for presses, so the root hears them
+ let count = s.tid("count").unwrap();
+ let (_, under) = press(&mut s, count);
+ assert_eq!(under, [("pointerdown".to_string(), 0), ("pointerup".to_string(), 0)]);
+ let down = msgs.iter().find(|m| m["event"] == "pointerdown").unwrap();
+ let (cx, cy) = (down["payload"]["clientX"].as_f64().unwrap() as f32, down["payload"]["clientY"].as_f64().unwrap() as f32);
+ assert!((cx - (r[0] + r[2] / 2.0)).abs() < 0.5 && (cy - (r[1] + r[3] / 2.0)).abs() < 0.5, "client ({cx}, {cy}) for {r:?}");
+ assert_eq!(down["payload"]["detail"], 1);
+}
+
+#[test]
+fn hover_enters_and_leaves() {
+ let mut s = mounted("counter");
+ let count = s.tid("count").unwrap();
+ let r = s.rect(count).unwrap();
+ s.pointer_move(r[0] + 2.0, r[1] + 2.0);
+ s.pointer_move(790.0, 590.0);
+ let msgs = delivered(&s.take_out());
+ let mine: Vec<&str> = msgs.iter().filter(|m| m["id"] == count).map(|m| m["event"].as_str().unwrap()).collect();
+ assert_eq!(mine, ["pointerenter", "pointerleave"]);
+}
+
+#[test]
+fn typing_in_a_field_sends_its_value_and_the_keys() {
+ let mut s = mounted("settings");
+ let name = s.tid("name").unwrap();
+ s.click_el(name).unwrap();
+ assert_eq!(s.focused_field(), Some(name), "a press focuses the field");
+ s.key(rune::Key::End);
+ s.take_out();
+ s.type_text(" B");
+ let msgs = delivered(&s.take_out());
+ let changes: Vec<&str> = msgs.iter().filter(|m| m["event"] == "change" && m["id"] == name).map(|m| m["payload"].as_str().unwrap()).collect();
+ assert_eq!(changes, ["Shane ", "Shane B"]);
+ // the field listens for keys, so they're its events (the bridge's hearer), not the host's
+ let keys: Vec<(&str, &str)> = msgs.iter().filter(|m| m["id"] == name && m["event"].as_str().unwrap().starts_with("key")).map(|m| (m["event"].as_str().unwrap(), m["payload"]["key"].as_str().unwrap())).collect();
+ assert_eq!(keys, [("keydown", " "), ("keyup", " "), ("keydown", "B"), ("keyup", "B")]);
+ let first = msgs.iter().find(|m| m["event"] == "keydown").unwrap();
+ assert_eq!(first["payload"]["value"], "Shane", "a key's payload carries the field's value before it");
+}
+
+#[test]
+fn a_key_nothing_focused_hears_is_the_host_s() {
+ let mut s = mounted("cards");
+ s.key(rune::Key::Escape);
+ let msgs = delivered(&s.take_out());
+ let keys: Vec<(&str, &str)> = msgs.iter().filter(|m| m["t"] == "named").map(|m| (m["name"].as_str().unwrap(), m["value"]["key"].as_str().unwrap())).collect();
+ assert_eq!(keys, [("keydown", "Escape"), ("keyup", "Escape")]);
+}
+
+#[test]
+fn a_press_moves_the_focus_with_focus_and_blur() {
+ let mut s = mounted("settings");
+ let name = s.tid("name").unwrap();
+ s.click_el(name).unwrap();
+ let msgs = delivered(&s.take_out());
+ assert!(msgs.iter().any(|m| m["event"] == "focus" && m["id"] == name), "focus to the field");
+ // a press on the page's background: the field blurs with its value, the focus going nowhere
+ s.click(790.0, 590.0);
+ let msgs = delivered(&s.take_out());
+ let blur = msgs.iter().find(|m| m["event"] == "blur").expect("a blur");
+ assert_eq!((blur["id"].as_u64(), &blur["payload"]["value"], &blur["payload"]["related"]), (Some(name), &Value::from("Shane"), &Value::Null));
+ assert_eq!(s.focused_field(), None, "Rune's focus follows");
+}
+
+#[test]
+fn a_ref_s_focus_and_blur_move_it() {
+ let mut s = mounted("settings");
+ s.emit("focus", &Value::from("name"));
+ let name = s.tid("name").unwrap();
+ assert_eq!(s.focused_field(), Some(name));
+ assert!(delivered(&s.take_out()).iter().any(|m| m["event"] == "focus" && m["id"] == name));
+ s.emit("blur", &Value::Null);
+ assert_eq!(s.focused_field(), None);
+ assert!(delivered(&s.take_out()).iter().any(|m| m["event"] == "blur" && m["id"] == name));
+}
+
+#[test]
+fn a_scroll_reports_its_offset() {
+ let mut s = mounted("list");
+ let sc = s.tid("scroller").unwrap();
+ let r = s.rect(sc).unwrap();
+ s.wheel(r[0] + r[2] / 2.0, r[1] + r[3] / 2.0, 120.0);
+ for _ in 0..30 {
+ s.frame();
+ }
+ let msgs = delivered(&s.take_out());
+ let last = msgs.iter().filter(|m| m["event"] == "scroll" && m["id"] == sc).last().expect("a scroll");
+ let p = &last["payload"];
+ assert!(p["scrollTop"].as_f64().unwrap() > 0.0, "{p}");
+ assert!(p["scrollHeight"].as_f64().unwrap() > p["clientHeight"].as_f64().unwrap(), "{p}");
+}
+
+#[test]
+fn a_resize_is_heard_and_laid_out() {
+ let mut s = mounted("cards");
+ s.resize(640.0, 480.0);
+ let out = s.take_out();
+ assert!(delivered(&out).iter().any(|m| m["name"] == "resize" && m["value"] == serde_json::json!({"w": 640.0, "h": 480.0})));
+ let snap = out.iter().rev().find_map(|o| if let Out::Layout(l) = o { Some(serde_json::from_str::<Value>(l).unwrap()) } else { None }).unwrap();
+ assert_eq!((snap["vw"].as_f64(), snap["vh"].as_f64()), (Some(640.0), Some(480.0)));
+ assert_eq!(s.rect(0).unwrap()[2], 640.0);
+}
+
+/// A menu (raea-runtime-js's `menu` and `menuitem` roles): a click or Enter selects an item, Escape or a press
+/// outside closes the menu.
+#[test]
+fn menus_select_and_close() {
+ let batch = r#"{"v":1,"ops":[
+ {"op":"create","id":1,"kind":"div","props":{"role":"menu","style":{"width":200,"height":80}}},
+ {"op":"create","id":2,"kind":"div","props":{"role":"menuitem","tabIndex":-1,"style":{"height":40}}},
+ {"op":"create","id":3,"kind":"div","props":{"role":"menuitem","tabIndex":-1,"style":{"height":40}}},
+ {"op":"append","parent":0,"child":1},{"op":"append","parent":1,"child":2},{"op":"append","parent":1,"child":3},
+ {"op":"listen","id":1,"events":["close"]},{"op":"listen","id":2,"events":["select"]},{"op":"listen","id":3,"events":["select"]}]}"#;
+ let mut s = Session::new(Page::default(), (400.0, 300.0));
+ s.apply(batch).unwrap();
+ let ev = |out: Vec<Out>| delivered(&out).iter().filter(|m| m["t"] == "event").map(|m| (m["event"].as_str().unwrap().to_string(), m["id"].as_u64().unwrap())).collect::<Vec<_>>();
+ s.click(100.0, 60.0);
+ assert_eq!(ev(s.take_out()), [("select".to_string(), 3)]);
+ s.emit("focus", &Value::from(2));
+ s.key(rune::Key::Enter);
+ assert_eq!(ev(s.take_out()), [("select".to_string(), 2)]);
+ s.key(rune::Key::Escape);
+ assert_eq!(ev(s.take_out()), [("close".to_string(), 1)]);
+ s.click(300.0, 250.0);
+ assert_eq!(ev(s.take_out()), [("close".to_string(), 1)]);
+}
+
+#[test]
+fn a_controlled_field_follows_its_value() {
+ let mut s = mounted("settings");
+ let name = s.tid("name").unwrap();
+ s.apply(&format!(r#"{{"v":1,"ops":[{{"op":"update","id":{name},"set":{{"value":"Ana"}}}}]}}"#)).unwrap();
+ assert_eq!(s.rt.state.edits[&name].text, "Ana");
+}
+
+#[test]
+fn a_wheel_reaches_an_element_that_listens() {
+ let mut s = Session::new(Page::default(), (400.0, 300.0));
+ s.apply(r#"{"v":1,"ops":[{"op":"create","id":1,"kind":"div","props":{"style":{"width":200,"height":100}}},{"op":"append","parent":0,"child":1},{"op":"listen","id":1,"events":["wheel"]}]}"#).unwrap();
+ s.take_out();
+ s.wheel(50.0, 50.0, 30.0);
+ let msgs = delivered(&s.take_out());
+ let w = msgs.iter().find(|m| m["event"] == "wheel").expect("a wheel event");
+ assert_eq!((w["id"].as_u64(), w["payload"]["deltaY"].as_f64()), (Some(1), Some(30.0)));
+}
+
+#[test]
+fn the_layout_snapshot_has_a_record_per_element() {
+ let mut s = Session::new(Page::default(), (400.0, 300.0));
+ s.apply(r#"{"v":1,"ops":[{"op":"create","id":1,"kind":"div","props":{"style":{"width":200,"height":100,"padding":7,"borderWidth":2}}},{"op":"append","parent":0,"child":1}]}"#).unwrap();
+ let snap = s.take_out().into_iter().rev().find_map(|o| if let Out::Layout(j) = o { Some(j) } else { None }).expect("a snapshot after the batch");
+ let v: Value = serde_json::from_str(&snap).unwrap();
+ let n: Vec<f64> = v["n"].as_array().unwrap().iter().map(|x| x.as_f64().unwrap()).collect();
+ assert_eq!(n.len() % 18, 0);
+ let rec = n.chunks(18).find(|r| r[0] == 1.0).unwrap();
+ assert_eq!(&rec[1..5], &[0.0, 0.0, 200.0, 100.0]);
+ assert_eq!(&rec[9..17], &[9.0, 9.0, 9.0, 9.0, 2.0, 2.0, 2.0, 2.0], "padding with the border, then the border");
+ s.frame();
+ // the frame still reaches `__ui_layout` (its rAF callbacks), with "" for an unchanged layout (T3c)
+ assert!(!s.take_out().iter().any(|o| matches!(o, Out::Layout(j) if !j.is_empty())), "no snapshot when nothing moved");
+}
+
+#[test]
+fn frames_tick_when_asked() {
+ let mut s = Session::new(Page::default(), (100.0, 100.0));
+ s.rt.state.ticking = true;
+ s.frame();
+ assert!(delivered(&s.take_out()).iter().any(|m| m["t"] == "named" && m["name"] == "frame"));
+}
+
+/// A drag as DOM mode follows one: the press, the root's moves all the way, the release where it ended.
+#[test]
+fn a_drag_s_moves_reach_the_root() {
+ let mut s = mounted("cards");
+ let card = s.tid("card-a").unwrap();
+ let r = s.rect(card).unwrap();
+ let from = (r[0] + 10.0, r[1] + 10.0);
+ let to = (from.0 + 120.0, from.1 + 40.0);
+ s.drag(from, to, 6);
+ let msgs = delivered(&s.take_out());
+ let seq: Vec<(&str, u64)> = msgs.iter().filter(|m| m["t"] == "event" && !matches!(m["event"].as_str(), Some("pointerenter" | "pointerleave")))
+ .map(|m| (m["event"].as_str().unwrap(), m["id"].as_u64().unwrap())).collect();
+ assert_eq!(seq.iter().filter(|e| e.0 == "pointerdown").count(), 1, "{seq:?}");
+ let down = seq.iter().position(|e| e.0 == "pointerdown").unwrap();
+ let up = seq.iter().position(|e| e.0 == "pointerup").unwrap();
+ assert!(seq[down..up].iter().filter(|e| *e == &("pointermove", 0)).count() >= 6, "the moves between: {seq:?}");
+ let last = msgs.iter().find(|m| m["event"] == "pointerup").unwrap();
+ assert_eq!((last["payload"]["clientX"].as_f64(), last["payload"]["clientY"].as_f64()), (Some(to.0 as f64), Some(to.1 as f64)));
+}
diff --git a/engine/rune/tests/headless.rs b/engine/rune/tests/headless.rs
new file mode 100644
index 00000000..831d0143
--- /dev/null
+++ b/engine/rune/tests/headless.rs
@@ -0,0 +1,71 @@
+//! R4b: `raea-rune-host --headless app.js --script steps.json --png out/` writes a PNG per step and the element tree,
+//! on Rune's virtual clock (the same files every run).
+
+use std::path::{Path, PathBuf};
+use std::process::Command;
+
+use serde_json::Value;
+
+mod common;
+
+fn run(out: &Path) {
+ let _ = std::fs::remove_dir_all(out);
+ std::fs::create_dir_all(out).unwrap();
+ let script = out.join("steps.json");
+ std::fs::write(&script, r#"[{"press": "inc"}, {"press": "inc"}, {"press": "inc"}, {"press": "reset"}]"#).unwrap();
+ let app = out.join("counter.js");
+ std::fs::write(&app, common::script(&Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/apps/counter.tsx"))).unwrap();
+ let r = Command::new(env!("CARGO_BIN_EXE_raea-rune-host")).arg("--headless").arg(&app).arg("--script").arg(&script).arg("--png").arg(out.join("png")).output().unwrap();
+ assert!(r.status.success(), "{}", String::from_utf8_lossy(&r.stderr));
+}
+
+fn pixels(p: &Path) -> (u32, u32, Vec<u8>) {
+ let dec = png::Decoder::new(std::io::BufReader::new(std::fs::File::open(p).unwrap()));
+ let mut r = dec.read_info().unwrap();
+ let mut buf = vec![0; r.output_buffer_size().unwrap()];
+ let info = r.next_frame(&mut buf).unwrap();
+ (info.width, info.height, buf)
+}
+
+fn at(img: &(u32, u32, Vec<u8>), x: f32, y: f32) -> [u8; 3] {
+ let i = ((y as u32 * img.0 + x as u32) * 4) as usize;
+ [img.2[i], img.2[i + 1], img.2[i + 2]]
+}
+
+fn near(a: [u8; 3], hex: u32) -> bool {
+ let b = [(hex >> 16) as u8, (hex >> 8) as u8, hex as u8];
+ a.iter().zip(b).all(|(x, y)| x.abs_diff(y) <= 2)
+}
+
+#[test]
+fn a_png_and_the_tree_per_step_the_same_every_run() {
+ let tmp = PathBuf::from(env!("CARGO_TARGET_TMPDIR"));
+ let (a, b) = (tmp.join("r4b-a"), tmp.join("r4b-b"));
+ run(&a);
+ let names: Vec<String> = ["00-mount", "01-press-inc", "02-press-inc", "03-press-inc", "04-press-reset"].iter().map(|n| format!("{n}.png")).collect();
+ for n in &names {
+ assert!(a.join("png").join(n).exists(), "{n}");
+ }
+ let trees: Value = serde_json::from_str(&std::fs::read_to_string(a.join("png/tree.json")).unwrap()).unwrap();
+ assert_eq!(trees.as_array().unwrap().len(), 5);
+ let el = |step: usize, t: &str| trees[step]["tree"].as_array().unwrap().iter().find(|e| e["testid"] == t).cloned();
+ assert_eq!(el(1, "count").unwrap()["text"], "Count: 1");
+ let inc = el(1, "inc").unwrap();
+ assert_eq!((inc["role"].as_str(), inc["key"].as_str()), (Some("button"), Some("w4")));
+ assert!(el(2, "reset").is_none() && el(3, "reset").is_some() && el(4, "reset").is_none());
+
+ // the pixels: the button is #2a2d35 at an even count and #3b82f6 at an odd one, on the app's #111318
+ let r: Vec<f32> = inc["rect"].as_array().unwrap().iter().map(|v| v.as_f64().unwrap() as f32).collect();
+ let (cx, cy) = (r[0] + 4.0, r[1] + r[3] / 2.0);
+ let mount = pixels(&a.join("png/00-mount.png"));
+ assert_eq!((mount.0, mount.1), (800, 600));
+ assert!(near(at(&mount, cx, cy), 0x2a2d35), "{:?}", at(&mount, cx, cy));
+ assert!(near(at(&pixels(&a.join("png/01-press-inc.png")), cx, cy), 0x3b82f6));
+ assert!(near(at(&mount, 4.0, 4.0), 0x111318), "the app's background");
+ assert!(near(at(&mount, 700.0, 500.0), 0xffffff), "the canvas outside it");
+
+ run(&b);
+ for n in names.iter().chain([&"tree.json".to_string()]) {
+ assert!(std::fs::read(a.join("png").join(n)).unwrap() == std::fs::read(b.join("png").join(n)).unwrap(), "{n} differs between runs");
+ }
+}
diff --git a/engine/rune/tests/js.rs b/engine/rune/tests/js.rs
new file mode 100644
index 00000000..a6d905dd
--- /dev/null
+++ b/engine/rune/tests/js.rs
@@ -0,0 +1,66 @@
+//! R4a: a bundled TSX app (the R5 counter) run by raea-runtime-jsengine in the host, clicked by a headless script
+//! through Rune's input, re-rendering through React and Rune.
+
+use raea_rune_host::js::App;
+use raea_rune_host::session::Session;
+
+mod common;
+
+
+/// The text under element `t` (by data-testid), as the host's tree has it.
+fn text(s: &Session, t: &str) -> String {
+ let tree = &s.rt.state.tree;
+ let mut out = String::new();
+ let mut stack = vec![s.tid(t).unwrap()];
+ while let Some(id) = stack.pop() {
+ let n = tree.get(id).unwrap();
+ out.push_str(n.text.as_deref().unwrap_or(""));
+ stack.extend(n.children.iter().rev());
+ }
+ out
+}
+
+#[test]
+fn the_counter_mounts_and_a_click_re_renders_it() {
+ let mut app = common::app("counter.tsx");
+ assert_eq!(text(&app.session, "count"), "Count: 0");
+ let inc = app.session.tid("inc").unwrap();
+ assert!(app.session.rect(inc).is_some_and(|r| r[2] > 0.0), "Rune laid the button out");
+ for want in 1..=3 {
+ app.input(|s| s.click_el(inc).unwrap()).unwrap();
+ app.frame().unwrap();
+ assert_eq!(text(&app.session, "count"), format!("Count: {want}"));
+ }
+ // past 2 a reset appears, laid out by Rune, and pressing it goes back to 0
+ let reset = app.session.tid("reset").expect("the reset button");
+ assert!(app.session.rect(reset).is_some_and(|r| r[2] > 0.0));
+ app.input(|s| s.click_el(reset).unwrap()).unwrap();
+ app.frame().unwrap();
+ assert_eq!(text(&app.session, "count"), "Count: 0");
+ assert!(app.session.tid("reset").is_none());
+ assert!(!app.logs.borrow().iter().any(|l| !l.starts_with("0:")), "{:?}", app.logs.borrow());
+}
+
+#[test]
+fn emits_calls_syncs_and_timers_go_through_the_host() {
+ let src = common::script(&std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/apps/asks.tsx"));
+ let mut app = App::new(&src, (400.0, 300.0)).unwrap();
+ // effects run after the mount's commit, in a task of their own: the first frame has them
+ app.frame().unwrap();
+ let set = app.session.clock() * 1e3;
+ assert_eq!(text(&app.session, "sync"), "err: the Rune host has no nothing");
+ assert_eq!(text(&app.session, "answer"), "err: the Rune host has no nothing");
+ assert!(app.session.rt.state.ticking, "the page asked for frames");
+ app.frame().unwrap();
+ assert_eq!(text(&app.session, "frames"), "ticking");
+ // the timer fires on the virtual clock, 100 ms after the effect set it, and not before
+ while app.session.clock() * 1e3 + 1e-6 < set + 100.0 - 1000.0 / 60.0 {
+ assert_eq!(text(&app.session, "timer"), "waiting", "at {} ms", app.session.clock() * 1e3);
+ app.frame().unwrap();
+ }
+ app.frame().unwrap();
+ app.frame().unwrap();
+ let fired = text(&app.session, "timer");
+ let at: f64 = fired.strip_prefix("fired at ").expect(&fired).parse().unwrap();
+ assert!((at - (set + 100.0)).abs() <= 17.0, "fired at {at} ms, set at {set} ms");
+}
diff --git a/engine/rune/tests/layout.rs b/engine/rune/tests/layout.rs
new file mode 100644
index 00000000..e647f856
--- /dev/null
+++ b/engine/rune/tests/layout.rs
@@ -0,0 +1,52 @@
+//! R5a's host fixes, each against the number Chrome gives for the same page (target/parity, js/parity/run.ts): a
+//! text's width unrounded, the strut under inline content, and boxes carried by their scroll viewports.
+
+use raea_rune_host::page::Page;
+use raea_rune_host::session::Session;
+
+fn page(ops: &str) -> Session {
+ let mut s = Session::new(Page::default(), (800.0, 600.0));
+ s.apply(&format!(r#"{{"v":1,"ops":[{ops}]}}"#)).unwrap();
+ s.frame();
+ s
+}
+
+#[test]
+fn a_box_around_a_text_has_the_text_s_unrounded_width() {
+ // Chrome: 125.33 (Inter 600 at 32 px), centred in 360 at 117.34; Rune's own measure rounds it to 126
+ let s = page(r#"{"op":"create","id":9,"kind":"div","props":{"style":{"display":"flex","flexDirection":"column","alignItems":"center","width":360}}},
+ {"op":"create","id":1,"kind":"span","props":{"style":{"fontSize":32,"fontWeight":600}}},{"op":"create","id":2,"kind":"text","props":{},"text":"Count: 1"},
+ {"op":"append","parent":1,"child":2},{"op":"append","parent":9,"child":1},{"op":"append","parent":0,"child":9}"#);
+ let r = s.rect(1).unwrap();
+ assert!((r[2] - 125.33).abs() < 0.01 && (r[0] - 117.34).abs() < 0.01, "{r:?}");
+}
+
+#[test]
+fn a_text_given_its_width_still_wraps_where_it_must() {
+ let s = page(r#"{"op":"create","id":1,"kind":"div","props":{"style":{"width":80}}},{"op":"create","id":2,"kind":"text","props":{},"text":"a long line that wraps here"},
+ {"op":"append","parent":1,"child":2},{"op":"append","parent":0,"child":1}"#);
+ assert_eq!(s.rect(1).unwrap()[3], 72.0, "three lines of 24");
+}
+
+#[test]
+fn inline_text_in_a_block_stands_on_the_block_s_strut() {
+ // Chrome: a 14 px span (line 21) in a 16 px block (line 24) makes a 24 pt line box, so the bubble is 24 + 16
+ let s = page(r#"{"op":"create","id":1,"kind":"div","props":{"style":{"paddingTop":8,"paddingBottom":8}}},{"op":"create","id":2,"kind":"span","props":{"style":{"fontSize":14}}},
+ {"op":"create","id":3,"kind":"text","props":{},"text":"Did the render finish?"},{"op":"append","parent":2,"child":3},{"op":"append","parent":1,"child":2},{"op":"append","parent":0,"child":1}"#);
+ assert_eq!(s.rect(1).unwrap()[3], 40.0);
+}
+
+#[test]
+fn a_scrolled_element_s_box_is_where_it_is_drawn() {
+ let mut rows = String::new();
+ for i in 0..20 {
+ rows.push_str(&format!(r#",{{"op":"create","id":{},"kind":"div","props":{{"style":{{"height":30}}}}}},{{"op":"append","parent":1,"child":{}}}"#, 10 + i, 10 + i));
+ }
+ let mut s = page(&format!(r#"{{"op":"create","id":1,"kind":"div","props":{{"style":{{"height":100,"overflowY":"scroll"}}}}}},{{"op":"append","parent":0,"child":1}}{rows},{{"op":"listen","id":1,"events":["wheel"]}}"#));
+ s.wheel(50.0, 50.0, 90.0);
+ for _ in 0..30 {
+ s.frame();
+ }
+ assert_eq!(s.rect(13).unwrap()[1], 0.0, "the fourth row at the top after 90 pt");
+ assert_eq!(s.at(50.0, 15.0), Some(13), "and the pointer finds it there");
+}
diff --git a/engine/rune/tests/net.rs b/engine/rune/tests/net.rs
new file mode 100644
index 00000000..18a7602f
--- /dev/null
+++ b/engine/rune/tests/net.rs
@@ -0,0 +1,45 @@
+//! T2b and T2d (docs/targets.feature): the native host answers net.* and the system calls as the page host does.
+//! io/net/calls' recorded calls (a fetch, storage set and get, a socket's open, send and close) and io/os's (os.open,
+//! the clipboard, files picked and saved, dialogs; headless, the answers queued) made through this host's pump get the
+//! recorded answers; engine/page/host tests/net_calls.rs checks the web target against the same records.
+use std::time::{Duration, Instant};
+
+use raea_io_net_calls::serve;
+use raea_io_os::recorded;
+use raea_rune_host::js::App;
+
+/// `script` run until it logs its record.
+fn record(script: &str) -> (App, String) {
+ let mut app = App::new(script, (320.0, 240.0)).unwrap();
+ let until = Instant::now() + Duration::from_secs(20);
+ loop {
+ let found = app.logs.borrow().iter().find_map(|l| l.strip_prefix("0: recorded ").map(str::to_string));
+ if let Some(r) = found {
+ break (app, r);
+ }
+ assert!(Instant::now() < until, "no record after 20 s; the page logged {:?}", app.logs.borrow());
+ // the answers come from the calls' threads: a frame pumps whatever has arrived
+ std::thread::sleep(Duration::from_millis(5));
+ app.frame().unwrap();
+ }
+}
+
+// one test: the storage folder and headless mode are the process's
+#[test]
+fn the_recorded_calls_get_the_recorded_answers() {
+ let dir = std::env::temp_dir().join(format!("raea-rune-calls-{}", std::process::id()));
+ // SAFETY: this test binary's only test, set before any thread reads it
+ unsafe { std::env::set_var("BEVY_TSX_STORAGE", dir.join("storage")) };
+ let servers = serve::serve();
+ let (_, net) = record(&servers.script());
+ if let Err(e) = servers.check(&net) {
+ panic!("net: {e}\nrecorded: {}", net.replace(&servers.http, "HTTP").replace(&servers.ws, "WS"));
+ }
+ let os = recorded::setup(dir.join("files"));
+ let (app, got) = record(os.script());
+ let checked = os.check(&got);
+ let _ = std::fs::remove_dir_all(&dir);
+ checked.unwrap_or_else(|e| panic!("os: {e}\nrecorded: {got}"));
+ // the dialog no step answered is listed with the calls this host refused (T2c)
+ assert!(app.refused.borrow().contains_key("dialog.message"), "{:?}", app.refused.borrow());
+}
diff --git a/engine/rune/tests/recorded.rs b/engine/rune/tests/recorded.rs
new file mode 100644
index 00000000..466fc9f0
--- /dev/null
+++ b/engine/rune/tests/recorded.rs
@@ -0,0 +1,28 @@
+//! R1b: batches recorded from @raea/ui's React driver (js/record.ts, the R5 set in DOM mode) replay into the tree, and
+//! after every batch the tree's shape equals what sdk/ui's strict test host held after the same batch.
+
+use raea_rune_host::tree::{ROOT, Tree};
+use serde_json::Value;
+
+const APPS: [&str; 5] = ["counter", "settings", "list", "cards", "chat"];
+
+#[test]
+fn recorded_batches_replay_to_the_test_host_s_tree() {
+ for app in APPS {
+ let path = format!("{}/tests/recorded/{app}.json", env!("CARGO_MANIFEST_DIR"));
+ let rec: Value = serde_json::from_str(&std::fs::read_to_string(&path).unwrap_or_else(|e| panic!("{path}: {e} (run js/record.ts)"))).unwrap();
+ let frames = rec["frames"].as_array().unwrap();
+ assert!(frames.len() > 1, "{app}: a mount and at least one step");
+ let mut tree = Tree::new();
+ let mut kinds = std::collections::BTreeSet::new();
+ for (i, f) in frames.iter().enumerate() {
+ let batch = f["batch"].as_str().unwrap();
+ for op in serde_json::from_str::<Value>(batch).unwrap()["ops"].as_array().unwrap() {
+ kinds.insert(op["op"].as_str().unwrap().to_string());
+ }
+ tree.apply_json(batch).unwrap_or_else(|e| panic!("{app} batch {i} (step {}): {e}", f["step"]));
+ assert_eq!(tree.shape(ROOT), f["shape"], "{app}: the tree after batch {i} (step {})", f["step"]);
+ }
+ eprintln!("{app}: {} batches replayed, ops {kinds:?}", frames.len());
+ }
+}
diff --git a/engine/rune/tests/recorded/cards.json b/engine/rune/tests/recorded/cards.json
new file mode 100644
index 00000000..a6c46f36
--- /dev/null
+++ b/engine/rune/tests/recorded/cards.json
@@ -0,0 +1,2819 @@
+{
+ "app": "cards",
+ "steps": [
+ {
+ "press": "tag-work"
+ },
+ {
+ "press": "tag-travel"
+ },
+ {
+ "press": "tag-all"
+ },
+ {
+ "press": "tag-sport"
+ }
+ ],
+ "frames": [
+ {
+ "step": -1,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"clear\"},{\"op\":\"listen\",\"id\":0,\"events\":[\"pointerdown\",\"pointerup\",\"pointermove\"]},{\"op\":\"create\",\"id\":1,\"kind\":\"text\",\"props\":{},\"text\":\"all\"},{\"op\":\"create\",\"id\":2,\"kind\":\"div\",\"props\":{\"data-testid\":\"tag-all\",\"style\":{\"paddingLeft\":12,\"paddingRight\":12,\"paddingTop\":6,\"paddingBottom\":6,\"borderRadius\":999,\"backgroundColor\":\"#f3f4f6\",\"color\":\"#111\",\"fontSize\":13}}},{\"op\":\"listen\",\"id\":2,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":2,\"child\":1},{\"op\":\"create\",\"id\":3,\"kind\":\"text\",\"props\":{},\"text\":\"work\"},{\"op\":\"create\",\"id\":4,\"kind\":\"div\",\"props\":{\"data-testid\":\"tag-work\",\"style\":{\"paddingLeft\":12,\"paddingRight\":12,\"paddingTop\":6,\"paddingBottom\":6,\"borderRadius\":999,\"backgroundColor\":\"#1f2128\",\"color\":\"#d1d5db\",\"fontSize\":13}}},{\"op\":\"listen\",\"id\":4,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":4,\"child\":3},{\"op\":\"create\",\"id\":5,\"kind\":\"text\",\"props\":{},\"text\":\"travel\"},{\"op\":\"create\",\"id\":6,\"kind\":\"div\",\"props\":{\"data-testid\":\"tag-travel\",\"style\":{\"paddingLeft\":12,\"paddingRight\":12,\"paddingTop\":6,\"paddingBottom\":6,\"borderRadius\":999,\"backgroundColor\":\"#1f2128\",\"color\":\"#d1d5db\",\"fontSize\":13}}},{\"op\":\"listen\",\"id\":6,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":6,\"child\":5},{\"op\":\"create\",\"id\":7,\"kind\":\"text\",\"props\":{},\"text\":\"sport\"},{\"op\":\"create\",\"id\":8,\"kind\":\"div\",\"props\":{\"data-testid\":\"tag-sport\",\"style\":{\"paddingLeft\":12,\"paddingRight\":12,\"paddingTop\":6,\"paddingBottom\":6,\"borderRadius\":999,\"backgroundColor\":\"#1f2128\",\"color\":\"#d1d5db\",\"fontSize\":13}}},{\"op\":\"listen\",\"id\":8,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":8,\"child\":7},{\"op\":\"create\",\"id\":9,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"gap\":6}}},{\"op\":\"listen\",\"id\":9,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":9,\"child\":2},{\"op\":\"append\",\"parent\":9,\"child\":4},{\"op\":\"append\",\"parent\":9,\"child\":6},{\"op\":\"append\",\"parent\":9,\"child\":8},{\"op\":\"create\",\"id\":10,\"kind\":\"div\",\"props\":{\"style\":{\"height\":110,\"backgroundImage\":\"linear-gradient(180deg, #f97316, #16181d)\"}}},{\"op\":\"listen\",\"id\":10,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"create\",\"id\":11,\"kind\":\"text\",\"props\":{},\"text\":\"Morning run\"},{\"op\":\"create\",\"id\":12,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"fontWeight\":600,\"color\":\"#fff\"}}},{\"op\":\"listen\",\"id\":12,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":12,\"child\":11},{\"op\":\"create\",\"id\":13,\"kind\":\"text\",\"props\":{},\"text\":\"sport\"},{\"op\":\"create\",\"id\":14,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":14,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":14,\"child\":13},{\"op\":\"create\",\"id\":15,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"column\",\"padding\":10,\"gap\":4}}},{\"op\":\"listen\",\"id\":15,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":15,\"child\":12},{\"op\":\"append\",\"parent\":15,\"child\":14},{\"op\":\"create\",\"id\":16,\"kind\":\"div\",\"props\":{\"data-testid\":\"card-a\",\"style\":{\"width\":196,\"borderRadius\":12,\"overflow\":\"hidden\",\"backgroundColor\":\"#16181d\",\"boxShadow\":\"0 4px 12px rgba(0,0,0,0.5)\"}}},{\"op\":\"listen\",\"id\":16,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":16,\"child\":10},{\"op\":\"append\",\"parent\":16,\"child\":15},{\"op\":\"create\",\"id\":17,\"kind\":\"div\",\"props\":{\"style\":{\"height\":110,\"backgroundImage\":\"linear-gradient(180deg, #22c55e, #16181d)\"}}},{\"op\":\"listen\",\"id\":17,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"create\",\"id\":18,\"kind\":\"text\",\"props\":{},\"text\":\"Studio tour\"},{\"op\":\"create\",\"id\":19,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"fontWeight\":600,\"color\":\"#fff\"}}},{\"op\":\"listen\",\"id\":19,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":19,\"child\":18},{\"op\":\"create\",\"id\":20,\"kind\":\"text\",\"props\":{},\"text\":\"work\"},{\"op\":\"create\",\"id\":21,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":21,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":21,\"child\":20},{\"op\":\"create\",\"id\":22,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"column\",\"padding\":10,\"gap\":4}}},{\"op\":\"listen\",\"id\":22,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":22,\"child\":19},{\"op\":\"append\",\"parent\":22,\"child\":21},{\"op\":\"create\",\"id\":23,\"kind\":\"div\",\"props\":{\"data-testid\":\"card-b\",\"style\":{\"width\":196,\"borderRadius\":12,\"overflow\":\"hidden\",\"backgroundColor\":\"#16181d\",\"boxShadow\":\"0 4px 12px rgba(0,0,0,0.5)\"}}},{\"op\":\"listen\",\"id\":23,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":23,\"child\":17},{\"op\":\"append\",\"parent\":23,\"child\":22},{\"op\":\"create\",\"id\":24,\"kind\":\"div\",\"props\":{\"style\":{\"height\":110,\"backgroundImage\":\"linear-gradient(180deg, #6366f1, #16181d)\"}}},{\"op\":\"listen\",\"id\":24,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"create\",\"id\":25,\"kind\":\"text\",\"props\":{},\"text\":\"Night drive\"},{\"op\":\"create\",\"id\":26,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"fontWeight\":600,\"color\":\"#fff\"}}},{\"op\":\"listen\",\"id\":26,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":26,\"child\":25},{\"op\":\"create\",\"id\":27,\"kind\":\"text\",\"props\":{},\"text\":\"travel\"},{\"op\":\"create\",\"id\":28,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":28,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":28,\"child\":27},{\"op\":\"create\",\"id\":29,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"column\",\"padding\":10,\"gap\":4}}},{\"op\":\"listen\",\"id\":29,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":29,\"child\":26},{\"op\":\"append\",\"parent\":29,\"child\":28},{\"op\":\"create\",\"id\":30,\"kind\":\"div\",\"props\":{\"data-testid\":\"card-c\",\"style\":{\"width\":196,\"borderRadius\":12,\"overflow\":\"hidden\",\"backgroundColor\":\"#16181d\",\"boxShadow\":\"0 4px 12px rgba(0,0,0,0.5)\"}}},{\"op\":\"listen\",\"id\":30,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":30,\"child\":24},{\"op\":\"append\",\"parent\":30,\"child\":29},{\"op\":\"create\",\"id\":31,\"kind\":\"div\",\"props\":{\"style\":{\"height\":110,\"backgroundImage\":\"linear-gradient(180deg, #06b6d4, #16181d)\"}}},{\"op\":\"listen\",\"id\":31,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"create\",\"id\":32,\"kind\":\"text\",\"props\":{},\"text\":\"Product demo\"},{\"op\":\"create\",\"id\":33,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"fontWeight\":600,\"color\":\"#fff\"}}},{\"op\":\"listen\",\"id\":33,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":33,\"child\":32},{\"op\":\"create\",\"id\":34,\"kind\":\"text\",\"props\":{},\"text\":\"work\"},{\"op\":\"create\",\"id\":35,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":35,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":35,\"child\":34},{\"op\":\"create\",\"id\":36,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"column\",\"padding\":10,\"gap\":4}}},{\"op\":\"listen\",\"id\":36,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":36,\"child\":33},{\"op\":\"append\",\"parent\":36,\"child\":35},{\"op\":\"create\",\"id\":37,\"kind\":\"div\",\"props\":{\"data-testid\":\"card-d\",\"style\":{\"width\":196,\"borderRadius\":12,\"overflow\":\"hidden\",\"backgroundColor\":\"#16181d\",\"boxShadow\":\"0 4px 12px rgba(0,0,0,0.5)\"}}},{\"op\":\"listen\",\"id\":37,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":37,\"child\":31},{\"op\":\"append\",\"parent\":37,\"child\":36},{\"op\":\"create\",\"id\":38,\"kind\":\"div\",\"props\":{\"style\":{\"height\":110,\"backgroundImage\":\"linear-gradient(180deg, #eab308, #16181d)\"}}},{\"op\":\"listen\",\"id\":38,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"create\",\"id\":39,\"kind\":\"text\",\"props\":{},\"text\":\"Beach day\"},{\"op\":\"create\",\"id\":40,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"fontWeight\":600,\"color\":\"#fff\"}}},{\"op\":\"listen\",\"id\":40,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":40,\"child\":39},{\"op\":\"create\",\"id\":41,\"kind\":\"text\",\"props\":{},\"text\":\"travel\"},{\"op\":\"create\",\"id\":42,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":42,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":42,\"child\":41},{\"op\":\"create\",\"id\":43,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"column\",\"padding\":10,\"gap\":4}}},{\"op\":\"listen\",\"id\":43,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":43,\"child\":40},{\"op\":\"append\",\"parent\":43,\"child\":42},{\"op\":\"create\",\"id\":44,\"kind\":\"div\",\"props\":{\"data-testid\":\"card-e\",\"style\":{\"width\":196,\"borderRadius\":12,\"overflow\":\"hidden\",\"backgroundColor\":\"#16181d\",\"boxShadow\":\"0 4px 12px rgba(0,0,0,0.5)\"}}},{\"op\":\"listen\",\"id\":44,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":44,\"child\":38},{\"op\":\"append\",\"parent\":44,\"child\":43},{\"op\":\"create\",\"id\":45,\"kind\":\"div\",\"props\":{\"style\":{\"height\":110,\"backgroundImage\":\"linear-gradient(180deg, #ef4444, #16181d)\"}}},{\"op\":\"listen\",\"id\":45,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"create\",\"id\":46,\"kind\":\"text\",\"props\":{},\"text\":\"Leg day\"},{\"op\":\"create\",\"id\":47,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"fontWeight\":600,\"color\":\"#fff\"}}},{\"op\":\"listen\",\"id\":47,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":47,\"child\":46},{\"op\":\"create\",\"id\":48,\"kind\":\"text\",\"props\":{},\"text\":\"sport\"},{\"op\":\"create\",\"id\":49,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":49,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":49,\"child\":48},{\"op\":\"create\",\"id\":50,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"column\",\"padding\":10,\"gap\":4}}},{\"op\":\"listen\",\"id\":50,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":50,\"child\":47},{\"op\":\"append\",\"parent\":50,\"child\":49},{\"op\":\"create\",\"id\":51,\"kind\":\"div\",\"props\":{\"data-testid\":\"card-f\",\"style\":{\"width\":196,\"borderRadius\":12,\"overflow\":\"hidden\",\"backgroundColor\":\"#16181d\",\"boxShadow\":\"0 4px 12px rgba(0,0,0,0.5)\"}}},{\"op\":\"listen\",\"id\":51,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":51,\"child\":45},{\"op\":\"append\",\"parent\":51,\"child\":50},{\"op\":\"create\",\"id\":52,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"flexWrap\":\"wrap\",\"gap\":12}}},{\"op\":\"listen\",\"id\":52,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":52,\"child\":16},{\"op\":\"append\",\"parent\":52,\"child\":23},{\"op\":\"append\",\"parent\":52,\"child\":30},{\"op\":\"append\",\"parent\":52,\"child\":37},{\"op\":\"append\",\"parent\":52,\"child\":44},{\"op\":\"append\",\"parent\":52,\"child\":51},{\"op\":\"create\",\"id\":53,\"kind\":\"div\",\"props\":{\"data-testid\":\"root\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"column\",\"width\":640,\"padding\":16,\"gap\":12,\"backgroundColor\":\"#0b0c0f\"}}},{\"op\":\"listen\",\"id\":53,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":53,\"child\":9},{\"op\":\"append\",\"parent\":53,\"child\":52},{\"op\":\"append\",\"parent\":0,\"child\":53}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 640,
+ "padding": 16,
+ "gap": 12,
+ "backgroundColor": "#0b0c0f"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 6
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "tag-all",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#f3f4f6",
+ "color": "#111",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "all",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "tag-work",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#1f2128",
+ "color": "#d1d5db",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "work",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "tag-travel",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#1f2128",
+ "color": "#d1d5db",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "travel",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "tag-sport",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#1f2128",
+ "color": "#d1d5db",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "sport",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "flexWrap": "wrap",
+ "gap": 12
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "card-a",
+ "style": {
+ "width": 196,
+ "borderRadius": 12,
+ "overflow": "hidden",
+ "backgroundColor": "#16181d",
+ "boxShadow": "0 4px 12px rgba(0,0,0,0.5)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "height": 110,
+ "backgroundImage": "linear-gradient(180deg, #f97316, #16181d)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "padding": 10,
+ "gap": 4
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Morning run",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "sport",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "card-b",
+ "style": {
+ "width": 196,
+ "borderRadius": 12,
+ "overflow": "hidden",
+ "backgroundColor": "#16181d",
+ "boxShadow": "0 4px 12px rgba(0,0,0,0.5)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "height": 110,
+ "backgroundImage": "linear-gradient(180deg, #22c55e, #16181d)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "padding": 10,
+ "gap": 4
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Studio tour",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "work",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "card-c",
+ "style": {
+ "width": 196,
+ "borderRadius": 12,
+ "overflow": "hidden",
+ "backgroundColor": "#16181d",
+ "boxShadow": "0 4px 12px rgba(0,0,0,0.5)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "height": 110,
+ "backgroundImage": "linear-gradient(180deg, #6366f1, #16181d)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "padding": 10,
+ "gap": 4
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Night drive",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "travel",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "card-d",
+ "style": {
+ "width": 196,
+ "borderRadius": 12,
+ "overflow": "hidden",
+ "backgroundColor": "#16181d",
+ "boxShadow": "0 4px 12px rgba(0,0,0,0.5)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "height": 110,
+ "backgroundImage": "linear-gradient(180deg, #06b6d4, #16181d)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "padding": 10,
+ "gap": 4
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Product demo",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "work",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "card-e",
+ "style": {
+ "width": 196,
+ "borderRadius": 12,
+ "overflow": "hidden",
+ "backgroundColor": "#16181d",
+ "boxShadow": "0 4px 12px rgba(0,0,0,0.5)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "height": 110,
+ "backgroundImage": "linear-gradient(180deg, #eab308, #16181d)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "padding": 10,
+ "gap": 4
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Beach day",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "travel",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "card-f",
+ "style": {
+ "width": 196,
+ "borderRadius": 12,
+ "overflow": "hidden",
+ "backgroundColor": "#16181d",
+ "boxShadow": "0 4px 12px rgba(0,0,0,0.5)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "height": 110,
+ "backgroundImage": "linear-gradient(180deg, #ef4444, #16181d)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "padding": 10,
+ "gap": 4
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Leg day",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "sport",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 0,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":2,\"set\":{\"style\":{\"paddingLeft\":12,\"paddingRight\":12,\"paddingTop\":6,\"paddingBottom\":6,\"borderRadius\":999,\"backgroundColor\":\"#1f2128\",\"color\":\"#d1d5db\",\"fontSize\":13}}},{\"op\":\"update\",\"id\":4,\"set\":{\"style\":{\"paddingLeft\":12,\"paddingRight\":12,\"paddingTop\":6,\"paddingBottom\":6,\"borderRadius\":999,\"backgroundColor\":\"#f3f4f6\",\"color\":\"#111\",\"fontSize\":13}}},{\"op\":\"remove\",\"id\":16},{\"op\":\"remove\",\"id\":30},{\"op\":\"remove\",\"id\":44},{\"op\":\"remove\",\"id\":51}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 640,
+ "padding": 16,
+ "gap": 12,
+ "backgroundColor": "#0b0c0f"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 6
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "tag-all",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#1f2128",
+ "color": "#d1d5db",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "all",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "tag-work",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#f3f4f6",
+ "color": "#111",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "work",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "tag-travel",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#1f2128",
+ "color": "#d1d5db",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "travel",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "tag-sport",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#1f2128",
+ "color": "#d1d5db",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "sport",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "flexWrap": "wrap",
+ "gap": 12
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "card-b",
+ "style": {
+ "width": 196,
+ "borderRadius": 12,
+ "overflow": "hidden",
+ "backgroundColor": "#16181d",
+ "boxShadow": "0 4px 12px rgba(0,0,0,0.5)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "height": 110,
+ "backgroundImage": "linear-gradient(180deg, #22c55e, #16181d)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "padding": 10,
+ "gap": 4
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Studio tour",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "work",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "card-d",
+ "style": {
+ "width": 196,
+ "borderRadius": 12,
+ "overflow": "hidden",
+ "backgroundColor": "#16181d",
+ "boxShadow": "0 4px 12px rgba(0,0,0,0.5)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "height": 110,
+ "backgroundImage": "linear-gradient(180deg, #06b6d4, #16181d)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "padding": 10,
+ "gap": 4
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Product demo",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "work",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 1,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"create\",\"id\":54,\"kind\":\"div\",\"props\":{\"style\":{\"height\":110,\"backgroundImage\":\"linear-gradient(180deg, #6366f1, #16181d)\"}}},{\"op\":\"listen\",\"id\":54,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"create\",\"id\":55,\"kind\":\"text\",\"props\":{},\"text\":\"Night drive\"},{\"op\":\"create\",\"id\":56,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"fontWeight\":600,\"color\":\"#fff\"}}},{\"op\":\"listen\",\"id\":56,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":56,\"child\":55},{\"op\":\"create\",\"id\":57,\"kind\":\"text\",\"props\":{},\"text\":\"travel\"},{\"op\":\"create\",\"id\":58,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":58,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":58,\"child\":57},{\"op\":\"create\",\"id\":59,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"column\",\"padding\":10,\"gap\":4}}},{\"op\":\"listen\",\"id\":59,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":59,\"child\":56},{\"op\":\"append\",\"parent\":59,\"child\":58},{\"op\":\"create\",\"id\":60,\"kind\":\"div\",\"props\":{\"data-testid\":\"card-c\",\"style\":{\"width\":196,\"borderRadius\":12,\"overflow\":\"hidden\",\"backgroundColor\":\"#16181d\",\"boxShadow\":\"0 4px 12px rgba(0,0,0,0.5)\"}}},{\"op\":\"listen\",\"id\":60,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":60,\"child\":54},{\"op\":\"append\",\"parent\":60,\"child\":59},{\"op\":\"create\",\"id\":61,\"kind\":\"div\",\"props\":{\"style\":{\"height\":110,\"backgroundImage\":\"linear-gradient(180deg, #eab308, #16181d)\"}}},{\"op\":\"listen\",\"id\":61,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"create\",\"id\":62,\"kind\":\"text\",\"props\":{},\"text\":\"Beach day\"},{\"op\":\"create\",\"id\":63,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"fontWeight\":600,\"color\":\"#fff\"}}},{\"op\":\"listen\",\"id\":63,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":63,\"child\":62},{\"op\":\"create\",\"id\":64,\"kind\":\"text\",\"props\":{},\"text\":\"travel\"},{\"op\":\"create\",\"id\":65,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":65,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":65,\"child\":64},{\"op\":\"create\",\"id\":66,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"column\",\"padding\":10,\"gap\":4}}},{\"op\":\"listen\",\"id\":66,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":66,\"child\":63},{\"op\":\"append\",\"parent\":66,\"child\":65},{\"op\":\"create\",\"id\":67,\"kind\":\"div\",\"props\":{\"data-testid\":\"card-e\",\"style\":{\"width\":196,\"borderRadius\":12,\"overflow\":\"hidden\",\"backgroundColor\":\"#16181d\",\"boxShadow\":\"0 4px 12px rgba(0,0,0,0.5)\"}}},{\"op\":\"listen\",\"id\":67,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":67,\"child\":61},{\"op\":\"append\",\"parent\":67,\"child\":66},{\"op\":\"update\",\"id\":4,\"set\":{\"style\":{\"paddingLeft\":12,\"paddingRight\":12,\"paddingTop\":6,\"paddingBottom\":6,\"borderRadius\":999,\"backgroundColor\":\"#1f2128\",\"color\":\"#d1d5db\",\"fontSize\":13}}},{\"op\":\"update\",\"id\":6,\"set\":{\"style\":{\"paddingLeft\":12,\"paddingRight\":12,\"paddingTop\":6,\"paddingBottom\":6,\"borderRadius\":999,\"backgroundColor\":\"#f3f4f6\",\"color\":\"#111\",\"fontSize\":13}}},{\"op\":\"remove\",\"id\":23},{\"op\":\"remove\",\"id\":37},{\"op\":\"append\",\"parent\":52,\"child\":60},{\"op\":\"append\",\"parent\":52,\"child\":67}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 640,
+ "padding": 16,
+ "gap": 12,
+ "backgroundColor": "#0b0c0f"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 6
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "tag-all",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#1f2128",
+ "color": "#d1d5db",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "all",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "tag-work",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#1f2128",
+ "color": "#d1d5db",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "work",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "tag-travel",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#f3f4f6",
+ "color": "#111",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "travel",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "tag-sport",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#1f2128",
+ "color": "#d1d5db",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "sport",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "flexWrap": "wrap",
+ "gap": 12
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "card-c",
+ "style": {
+ "width": 196,
+ "borderRadius": 12,
+ "overflow": "hidden",
+ "backgroundColor": "#16181d",
+ "boxShadow": "0 4px 12px rgba(0,0,0,0.5)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "height": 110,
+ "backgroundImage": "linear-gradient(180deg, #6366f1, #16181d)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "padding": 10,
+ "gap": 4
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Night drive",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "travel",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "card-e",
+ "style": {
+ "width": 196,
+ "borderRadius": 12,
+ "overflow": "hidden",
+ "backgroundColor": "#16181d",
+ "boxShadow": "0 4px 12px rgba(0,0,0,0.5)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "height": 110,
+ "backgroundImage": "linear-gradient(180deg, #eab308, #16181d)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "padding": 10,
+ "gap": 4
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Beach day",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "travel",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"create\",\"id\":68,\"kind\":\"div\",\"props\":{\"style\":{\"height\":110,\"backgroundImage\":\"linear-gradient(180deg, #f97316, #16181d)\"}}},{\"op\":\"listen\",\"id\":68,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"create\",\"id\":69,\"kind\":\"text\",\"props\":{},\"text\":\"Morning run\"},{\"op\":\"create\",\"id\":70,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"fontWeight\":600,\"color\":\"#fff\"}}},{\"op\":\"listen\",\"id\":70,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":70,\"child\":69},{\"op\":\"create\",\"id\":71,\"kind\":\"text\",\"props\":{},\"text\":\"sport\"},{\"op\":\"create\",\"id\":72,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":72,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":72,\"child\":71},{\"op\":\"create\",\"id\":73,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"column\",\"padding\":10,\"gap\":4}}},{\"op\":\"listen\",\"id\":73,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":73,\"child\":70},{\"op\":\"append\",\"parent\":73,\"child\":72},{\"op\":\"create\",\"id\":74,\"kind\":\"div\",\"props\":{\"data-testid\":\"card-a\",\"style\":{\"width\":196,\"borderRadius\":12,\"overflow\":\"hidden\",\"backgroundColor\":\"#16181d\",\"boxShadow\":\"0 4px 12px rgba(0,0,0,0.5)\"}}},{\"op\":\"listen\",\"id\":74,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":74,\"child\":68},{\"op\":\"append\",\"parent\":74,\"child\":73},{\"op\":\"create\",\"id\":75,\"kind\":\"div\",\"props\":{\"style\":{\"height\":110,\"backgroundImage\":\"linear-gradient(180deg, #22c55e, #16181d)\"}}},{\"op\":\"listen\",\"id\":75,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"create\",\"id\":76,\"kind\":\"text\",\"props\":{},\"text\":\"Studio tour\"},{\"op\":\"create\",\"id\":77,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"fontWeight\":600,\"color\":\"#fff\"}}},{\"op\":\"listen\",\"id\":77,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":77,\"child\":76},{\"op\":\"create\",\"id\":78,\"kind\":\"text\",\"props\":{},\"text\":\"work\"},{\"op\":\"create\",\"id\":79,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":79,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":79,\"child\":78},{\"op\":\"create\",\"id\":80,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"column\",\"padding\":10,\"gap\":4}}},{\"op\":\"listen\",\"id\":80,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":80,\"child\":77},{\"op\":\"append\",\"parent\":80,\"child\":79},{\"op\":\"create\",\"id\":81,\"kind\":\"div\",\"props\":{\"data-testid\":\"card-b\",\"style\":{\"width\":196,\"borderRadius\":12,\"overflow\":\"hidden\",\"backgroundColor\":\"#16181d\",\"boxShadow\":\"0 4px 12px rgba(0,0,0,0.5)\"}}},{\"op\":\"listen\",\"id\":81,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":81,\"child\":75},{\"op\":\"append\",\"parent\":81,\"child\":80},{\"op\":\"create\",\"id\":82,\"kind\":\"div\",\"props\":{\"style\":{\"height\":110,\"backgroundImage\":\"linear-gradient(180deg, #06b6d4, #16181d)\"}}},{\"op\":\"listen\",\"id\":82,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"create\",\"id\":83,\"kind\":\"text\",\"props\":{},\"text\":\"Product demo\"},{\"op\":\"create\",\"id\":84,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"fontWeight\":600,\"color\":\"#fff\"}}},{\"op\":\"listen\",\"id\":84,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":84,\"child\":83},{\"op\":\"create\",\"id\":85,\"kind\":\"text\",\"props\":{},\"text\":\"work\"},{\"op\":\"create\",\"id\":86,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":86,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":86,\"child\":85},{\"op\":\"create\",\"id\":87,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"column\",\"padding\":10,\"gap\":4}}},{\"op\":\"listen\",\"id\":87,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":87,\"child\":84},{\"op\":\"append\",\"parent\":87,\"child\":86},{\"op\":\"create\",\"id\":88,\"kind\":\"div\",\"props\":{\"data-testid\":\"card-d\",\"style\":{\"width\":196,\"borderRadius\":12,\"overflow\":\"hidden\",\"backgroundColor\":\"#16181d\",\"boxShadow\":\"0 4px 12px rgba(0,0,0,0.5)\"}}},{\"op\":\"listen\",\"id\":88,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":88,\"child\":82},{\"op\":\"append\",\"parent\":88,\"child\":87},{\"op\":\"create\",\"id\":89,\"kind\":\"div\",\"props\":{\"style\":{\"height\":110,\"backgroundImage\":\"linear-gradient(180deg, #ef4444, #16181d)\"}}},{\"op\":\"listen\",\"id\":89,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"create\",\"id\":90,\"kind\":\"text\",\"props\":{},\"text\":\"Leg day\"},{\"op\":\"create\",\"id\":91,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"fontWeight\":600,\"color\":\"#fff\"}}},{\"op\":\"listen\",\"id\":91,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":91,\"child\":90},{\"op\":\"create\",\"id\":92,\"kind\":\"text\",\"props\":{},\"text\":\"sport\"},{\"op\":\"create\",\"id\":93,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":93,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":93,\"child\":92},{\"op\":\"create\",\"id\":94,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"column\",\"padding\":10,\"gap\":4}}},{\"op\":\"listen\",\"id\":94,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":94,\"child\":91},{\"op\":\"append\",\"parent\":94,\"child\":93},{\"op\":\"create\",\"id\":95,\"kind\":\"div\",\"props\":{\"data-testid\":\"card-f\",\"style\":{\"width\":196,\"borderRadius\":12,\"overflow\":\"hidden\",\"backgroundColor\":\"#16181d\",\"boxShadow\":\"0 4px 12px rgba(0,0,0,0.5)\"}}},{\"op\":\"listen\",\"id\":95,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":95,\"child\":89},{\"op\":\"append\",\"parent\":95,\"child\":94},{\"op\":\"update\",\"id\":2,\"set\":{\"style\":{\"paddingLeft\":12,\"paddingRight\":12,\"paddingTop\":6,\"paddingBottom\":6,\"borderRadius\":999,\"backgroundColor\":\"#f3f4f6\",\"color\":\"#111\",\"fontSize\":13}}},{\"op\":\"update\",\"id\":6,\"set\":{\"style\":{\"paddingLeft\":12,\"paddingRight\":12,\"paddingTop\":6,\"paddingBottom\":6,\"borderRadius\":999,\"backgroundColor\":\"#1f2128\",\"color\":\"#d1d5db\",\"fontSize\":13}}},{\"op\":\"insert\",\"parent\":52,\"child\":74,\"before\":60},{\"op\":\"insert\",\"parent\":52,\"child\":81,\"before\":60},{\"op\":\"insert\",\"parent\":52,\"child\":88,\"before\":67},{\"op\":\"append\",\"parent\":52,\"child\":95}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 640,
+ "padding": 16,
+ "gap": 12,
+ "backgroundColor": "#0b0c0f"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 6
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "tag-all",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#f3f4f6",
+ "color": "#111",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "all",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "tag-work",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#1f2128",
+ "color": "#d1d5db",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "work",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "tag-travel",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#1f2128",
+ "color": "#d1d5db",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "travel",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "tag-sport",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#1f2128",
+ "color": "#d1d5db",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "sport",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "flexWrap": "wrap",
+ "gap": 12
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "card-a",
+ "style": {
+ "width": 196,
+ "borderRadius": 12,
+ "overflow": "hidden",
+ "backgroundColor": "#16181d",
+ "boxShadow": "0 4px 12px rgba(0,0,0,0.5)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "height": 110,
+ "backgroundImage": "linear-gradient(180deg, #f97316, #16181d)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "padding": 10,
+ "gap": 4
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Morning run",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "sport",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "card-b",
+ "style": {
+ "width": 196,
+ "borderRadius": 12,
+ "overflow": "hidden",
+ "backgroundColor": "#16181d",
+ "boxShadow": "0 4px 12px rgba(0,0,0,0.5)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "height": 110,
+ "backgroundImage": "linear-gradient(180deg, #22c55e, #16181d)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "padding": 10,
+ "gap": 4
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Studio tour",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "work",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "card-c",
+ "style": {
+ "width": 196,
+ "borderRadius": 12,
+ "overflow": "hidden",
+ "backgroundColor": "#16181d",
+ "boxShadow": "0 4px 12px rgba(0,0,0,0.5)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "height": 110,
+ "backgroundImage": "linear-gradient(180deg, #6366f1, #16181d)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "padding": 10,
+ "gap": 4
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Night drive",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "travel",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "card-d",
+ "style": {
+ "width": 196,
+ "borderRadius": 12,
+ "overflow": "hidden",
+ "backgroundColor": "#16181d",
+ "boxShadow": "0 4px 12px rgba(0,0,0,0.5)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "height": 110,
+ "backgroundImage": "linear-gradient(180deg, #06b6d4, #16181d)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "padding": 10,
+ "gap": 4
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Product demo",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "work",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "card-e",
+ "style": {
+ "width": 196,
+ "borderRadius": 12,
+ "overflow": "hidden",
+ "backgroundColor": "#16181d",
+ "boxShadow": "0 4px 12px rgba(0,0,0,0.5)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "height": 110,
+ "backgroundImage": "linear-gradient(180deg, #eab308, #16181d)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "padding": 10,
+ "gap": 4
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Beach day",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "travel",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "card-f",
+ "style": {
+ "width": 196,
+ "borderRadius": 12,
+ "overflow": "hidden",
+ "backgroundColor": "#16181d",
+ "boxShadow": "0 4px 12px rgba(0,0,0,0.5)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "height": 110,
+ "backgroundImage": "linear-gradient(180deg, #ef4444, #16181d)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "padding": 10,
+ "gap": 4
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Leg day",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "sport",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 3,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":2,\"set\":{\"style\":{\"paddingLeft\":12,\"paddingRight\":12,\"paddingTop\":6,\"paddingBottom\":6,\"borderRadius\":999,\"backgroundColor\":\"#1f2128\",\"color\":\"#d1d5db\",\"fontSize\":13}}},{\"op\":\"update\",\"id\":8,\"set\":{\"style\":{\"paddingLeft\":12,\"paddingRight\":12,\"paddingTop\":6,\"paddingBottom\":6,\"borderRadius\":999,\"backgroundColor\":\"#f3f4f6\",\"color\":\"#111\",\"fontSize\":13}}},{\"op\":\"remove\",\"id\":81},{\"op\":\"remove\",\"id\":60},{\"op\":\"remove\",\"id\":88},{\"op\":\"remove\",\"id\":67}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 640,
+ "padding": 16,
+ "gap": 12,
+ "backgroundColor": "#0b0c0f"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 6
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "tag-all",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#1f2128",
+ "color": "#d1d5db",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "all",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "tag-work",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#1f2128",
+ "color": "#d1d5db",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "work",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "tag-travel",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#1f2128",
+ "color": "#d1d5db",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "travel",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "tag-sport",
+ "style": {
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 6,
+ "paddingBottom": 6,
+ "borderRadius": 999,
+ "backgroundColor": "#f3f4f6",
+ "color": "#111",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "sport",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "flexWrap": "wrap",
+ "gap": 12
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "card-a",
+ "style": {
+ "width": 196,
+ "borderRadius": 12,
+ "overflow": "hidden",
+ "backgroundColor": "#16181d",
+ "boxShadow": "0 4px 12px rgba(0,0,0,0.5)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "height": 110,
+ "backgroundImage": "linear-gradient(180deg, #f97316, #16181d)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "padding": 10,
+ "gap": 4
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Morning run",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "sport",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "card-f",
+ "style": {
+ "width": 196,
+ "borderRadius": 12,
+ "overflow": "hidden",
+ "backgroundColor": "#16181d",
+ "boxShadow": "0 4px 12px rgba(0,0,0,0.5)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "height": 110,
+ "backgroundImage": "linear-gradient(180deg, #ef4444, #16181d)"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "padding": 10,
+ "gap": 4
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Leg day",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "sport",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/engine/rune/tests/recorded/chat.json b/engine/rune/tests/recorded/chat.json
new file mode 100644
index 00000000..9cd6c14c
--- /dev/null
+++ b/engine/rune/tests/recorded/chat.json
@@ -0,0 +1,9557 @@
+{
+ "app": "chat",
+ "steps": [
+ {
+ "type": "Uploading now",
+ "into": "draft"
+ },
+ {
+ "press": "send"
+ },
+ {
+ "type": "Done: raea.io/x",
+ "into": "draft"
+ },
+ {
+ "press": "send"
+ }
+ ],
+ "frames": [
+ {
+ "step": -1,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"clear\"},{\"op\":\"listen\",\"id\":0,\"events\":[\"pointerdown\",\"pointerup\",\"pointermove\"]},{\"op\":\"create\",\"id\":1,\"kind\":\"text\",\"props\":{},\"text\":\"Did the render finish?\"},{\"op\":\"create\",\"id\":2,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"color\":\"#f9fafb\"}}},{\"op\":\"listen\",\"id\":2,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":2,\"child\":1},{\"op\":\"create\",\"id\":3,\"kind\":\"div\",\"props\":{\"data-testid\":\"msg-1\",\"style\":{\"alignSelf\":\"flex-start\",\"maxWidth\":260,\"paddingLeft\":12,\"paddingRight\":12,\"paddingTop\":8,\"paddingBottom\":8,\"borderRadius\":14,\"backgroundColor\":\"#23262d\"}}},{\"op\":\"listen\",\"id\":3,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":3,\"child\":2},{\"op\":\"create\",\"id\":4,\"kind\":\"text\",\"props\":{},\"text\":\"Yes, 42 seconds at 1080p.\"},{\"op\":\"create\",\"id\":5,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"color\":\"#f9fafb\"}}},{\"op\":\"listen\",\"id\":5,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":5,\"child\":4},{\"op\":\"create\",\"id\":6,\"kind\":\"div\",\"props\":{\"data-testid\":\"msg-2\",\"style\":{\"alignSelf\":\"flex-end\",\"maxWidth\":260,\"paddingLeft\":12,\"paddingRight\":12,\"paddingTop\":8,\"paddingBottom\":8,\"borderRadius\":14,\"backgroundColor\":\"#2563eb\"}}},{\"op\":\"listen\",\"id\":6,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":6,\"child\":5},{\"op\":\"create\",\"id\":7,\"kind\":\"text\",\"props\":{},\"text\":\"Send me the link when it's up.\"},{\"op\":\"create\",\"id\":8,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"color\":\"#f9fafb\"}}},{\"op\":\"listen\",\"id\":8,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":8,\"child\":7},{\"op\":\"create\",\"id\":9,\"kind\":\"div\",\"props\":{\"data-testid\":\"msg-3\",\"style\":{\"alignSelf\":\"flex-start\",\"maxWidth\":260,\"paddingLeft\":12,\"paddingRight\":12,\"paddingTop\":8,\"paddingBottom\":8,\"borderRadius\":14,\"backgroundColor\":\"#23262d\"}}},{\"op\":\"listen\",\"id\":9,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":9,\"child\":8},{\"op\":\"create\",\"id\":10,\"kind\":\"div\",\"props\":{\"data-testid\":\"log\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"column\",\"flexGrow\":1,\"minHeight\":0,\"overflowY\":\"scroll\",\"justifyContent\":\"flex-end\",\"padding\":12,\"gap\":8}}},{\"op\":\"listen\",\"id\":10,\"events\":[\"pointerenter\",\"pointerleave\",\"scroll\"]},{\"op\":\"append\",\"parent\":10,\"child\":3},{\"op\":\"append\",\"parent\":10,\"child\":6},{\"op\":\"append\",\"parent\":10,\"child\":9},{\"op\":\"create\",\"id\":11,\"kind\":\"editableText\",\"props\":{\"data-testid\":\"draft\",\"value\":\"\",\"placeholder\":\"Message\",\"style\":{\"flexGrow\":1,\"padding\":8,\"borderRadius\":8,\"backgroundColor\":\"#1a1c21\",\"color\":\"#fff\",\"fontSize\":14},\"tabIndex\":0}},{\"op\":\"listen\",\"id\":11,\"events\":[\"change\",\"blur\",\"pointerenter\",\"pointerleave\",\"focus\",\"keydown\",\"keyup\"]},{\"op\":\"create\",\"id\":12,\"kind\":\"text\",\"props\":{},\"text\":\"Send\"},{\"op\":\"create\",\"id\":13,\"kind\":\"button\",\"props\":{\"data-testid\":\"send\",\"disabled\":true,\"style\":{\"padding\":8,\"borderRadius\":8,\"backgroundColor\":\"#23262d\",\"color\":\"#fff\",\"fontSize\":14}}},{\"op\":\"listen\",\"id\":13,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\",\"focus\",\"blur\",\"keydown\",\"keyup\"]},{\"op\":\"append\",\"parent\":13,\"child\":12},{\"op\":\"create\",\"id\":14,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"gap\":8,\"padding\":12,\"borderTopWidth\":1,\"borderColor\":\"#23262d\"}}},{\"op\":\"listen\",\"id\":14,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":14,\"child\":11},{\"op\":\"append\",\"parent\":14,\"child\":13},{\"op\":\"create\",\"id\":15,\"kind\":\"div\",\"props\":{\"data-testid\":\"root\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"column\",\"width\":380,\"height\":520,\"backgroundColor\":\"#0f1013\"}}},{\"op\":\"listen\",\"id\":15,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":15,\"child\":10},{\"op\":\"append\",\"parent\":15,\"child\":14},{\"op\":\"append\",\"parent\":0,\"child\":15}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": ""
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": true,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#23262d",
+ "color": "#fff",
+ "fontSize": 14
+ }
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 0,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"U\"}},{\"op\":\"update\",\"id\":13,\"set\":{\"disabled\":false,\"tabIndex\":0,\"style\":{\"padding\":8,\"borderRadius\":8,\"backgroundColor\":\"#2563eb\",\"color\":\"#fff\",\"fontSize\":14}}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "U"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 0,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Up\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Up"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 0,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Upl\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Upl"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 0,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Uplo\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Uplo"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 0,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Uploa\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Uploa"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 0,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Upload\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Upload"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 0,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Uploadi\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Uploadi"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 0,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Uploadin\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Uploadin"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 0,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Uploading\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Uploading"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 0,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Uploading \"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Uploading "
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 0,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Uploading n\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Uploading n"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 0,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Uploading no\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Uploading no"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 0,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Uploading now\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Uploading now"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 1,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"create\",\"id\":16,\"kind\":\"text\",\"props\":{},\"text\":\"Uploading now\"},{\"op\":\"create\",\"id\":17,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"color\":\"#f9fafb\"}}},{\"op\":\"listen\",\"id\":17,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":17,\"child\":16},{\"op\":\"create\",\"id\":18,\"kind\":\"div\",\"props\":{\"data-testid\":\"msg-4\",\"style\":{\"alignSelf\":\"flex-end\",\"maxWidth\":260,\"paddingLeft\":12,\"paddingRight\":12,\"paddingTop\":8,\"paddingBottom\":8,\"borderRadius\":14,\"backgroundColor\":\"#2563eb\"}}},{\"op\":\"listen\",\"id\":18,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":18,\"child\":17},{\"op\":\"append\",\"parent\":10,\"child\":18},{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"\"}},{\"op\":\"update\",\"id\":13,\"unset\":[\"tabIndex\"],\"set\":{\"disabled\":true,\"style\":{\"padding\":8,\"borderRadius\":8,\"backgroundColor\":\"#23262d\",\"color\":\"#fff\",\"fontSize\":14}}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-4",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Uploading now",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": ""
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": true,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#23262d",
+ "color": "#fff",
+ "fontSize": 14
+ }
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"D\"}},{\"op\":\"update\",\"id\":13,\"set\":{\"disabled\":false,\"tabIndex\":0,\"style\":{\"padding\":8,\"borderRadius\":8,\"backgroundColor\":\"#2563eb\",\"color\":\"#fff\",\"fontSize\":14}}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-4",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Uploading now",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "D"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Do\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-4",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Uploading now",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Do"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Don\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-4",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Uploading now",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Don"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Done\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-4",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Uploading now",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Done"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Done:\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-4",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Uploading now",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Done:"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Done: \"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-4",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Uploading now",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Done: "
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Done: r\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-4",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Uploading now",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Done: r"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Done: ra\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-4",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Uploading now",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Done: ra"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Done: rae\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-4",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Uploading now",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Done: rae"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Done: raea\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-4",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Uploading now",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Done: raea"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Done: raea.\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-4",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Uploading now",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Done: raea."
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Done: raea.i\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-4",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Uploading now",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Done: raea.i"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Done: raea.io\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-4",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Uploading now",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Done: raea.io"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Done: raea.io/\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-4",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Uploading now",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Done: raea.io/"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"Done: raea.io/x\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-4",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Uploading now",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Done: raea.io/x"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": false,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#2563eb",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 3,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"create\",\"id\":19,\"kind\":\"text\",\"props\":{},\"text\":\"Done: raea.io/x\"},{\"op\":\"create\",\"id\":20,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"color\":\"#f9fafb\"}}},{\"op\":\"listen\",\"id\":20,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":20,\"child\":19},{\"op\":\"create\",\"id\":21,\"kind\":\"div\",\"props\":{\"data-testid\":\"msg-5\",\"style\":{\"alignSelf\":\"flex-end\",\"maxWidth\":260,\"paddingLeft\":12,\"paddingRight\":12,\"paddingTop\":8,\"paddingBottom\":8,\"borderRadius\":14,\"backgroundColor\":\"#2563eb\"}}},{\"op\":\"listen\",\"id\":21,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":21,\"child\":20},{\"op\":\"append\",\"parent\":10,\"child\":21},{\"op\":\"update\",\"id\":11,\"set\":{\"value\":\"\"}},{\"op\":\"update\",\"id\":13,\"unset\":[\"tabIndex\"],\"set\":{\"disabled\":true,\"style\":{\"padding\":8,\"borderRadius\":8,\"backgroundColor\":\"#23262d\",\"color\":\"#fff\",\"fontSize\":14}}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 380,
+ "height": 520,
+ "backgroundColor": "#0f1013"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "log",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll",
+ "justifyContent": "flex-end",
+ "padding": 12,
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "msg-1",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Did the render finish?",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-2",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Yes, 42 seconds at 1080p.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-3",
+ "style": {
+ "alignSelf": "flex-start",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send me the link when it's up.",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-4",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Uploading now",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "msg-5",
+ "style": {
+ "alignSelf": "flex-end",
+ "maxWidth": 260,
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "paddingTop": 8,
+ "paddingBottom": 8,
+ "borderRadius": 14,
+ "backgroundColor": "#2563eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#f9fafb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Done: raea.io/x",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8,
+ "padding": 12,
+ "borderTopWidth": 1,
+ "borderColor": "#23262d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "editableText",
+ {
+ "data-testid": "draft",
+ "placeholder": "Message",
+ "style": {
+ "flexGrow": 1,
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#1a1c21",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": ""
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ],
+ [
+ "button",
+ {
+ "data-testid": "send",
+ "disabled": true,
+ "style": {
+ "padding": 8,
+ "borderRadius": 8,
+ "backgroundColor": "#23262d",
+ "color": "#fff",
+ "fontSize": 14
+ }
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Send",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/engine/rune/tests/recorded/counter.json b/engine/rune/tests/recorded/counter.json
new file mode 100644
index 00000000..4ae6b4e7
--- /dev/null
+++ b/engine/rune/tests/recorded/counter.json
@@ -0,0 +1,746 @@
+{
+ "app": "counter",
+ "steps": [
+ {
+ "press": "inc"
+ },
+ {
+ "press": "inc"
+ },
+ {
+ "press": "inc"
+ },
+ {
+ "press": "reset"
+ },
+ {
+ "press": "inc"
+ }
+ ],
+ "frames": [
+ {
+ "step": -1,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"listen\",\"id\":0,\"events\":[\"pointermove\",\"pointerdown\",\"pointerup\"]},{\"op\":\"clear\"},{\"op\":\"create\",\"id\":1,\"kind\":\"text\",\"props\":{},\"text\":\"Count: 0\"},{\"op\":\"create\",\"id\":2,\"kind\":\"span\",\"props\":{\"data-testid\":\"count\",\"style\":{\"fontSize\":32,\"fontWeight\":600,\"color\":\"#f2f3f5\"}}},{\"op\":\"listen\",\"id\":2,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":2,\"child\":1},{\"op\":\"create\",\"id\":3,\"kind\":\"text\",\"props\":{},\"text\":\"Add one\"},{\"op\":\"create\",\"id\":4,\"kind\":\"button\",\"props\":{\"data-testid\":\"inc\",\"style\":{\"padding\":10,\"borderRadius\":8,\"backgroundColor\":\"#2a2d35\",\"color\":\"#fff\",\"fontSize\":14},\"tabIndex\":0}},{\"op\":\"listen\",\"id\":4,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\",\"focus\",\"blur\",\"keydown\",\"keyup\"]},{\"op\":\"append\",\"parent\":4,\"child\":3},{\"op\":\"create\",\"id\":5,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"gap\":8}}},{\"op\":\"listen\",\"id\":5,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":5,\"child\":4},{\"op\":\"create\",\"id\":6,\"kind\":\"div\",\"props\":{\"data-testid\":\"root\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"gap\":16,\"width\":360,\"height\":240,\"backgroundColor\":\"#111318\"}}},{\"op\":\"listen\",\"id\":6,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":6,\"child\":2},{\"op\":\"append\",\"parent\":6,\"child\":5},{\"op\":\"append\",\"parent\":0,\"child\":6}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "gap": 16,
+ "width": 360,
+ "height": 240,
+ "backgroundColor": "#111318"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "data-testid": "count",
+ "style": {
+ "fontSize": 32,
+ "fontWeight": 600,
+ "color": "#f2f3f5"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Count: 0",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "button",
+ {
+ "data-testid": "inc",
+ "style": {
+ "padding": 10,
+ "borderRadius": 8,
+ "backgroundColor": "#2a2d35",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Add one",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 0,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":1,\"text\":\"Count: 1\"},{\"op\":\"update\",\"id\":4,\"set\":{\"style\":{\"padding\":10,\"borderRadius\":8,\"backgroundColor\":\"#3b82f6\",\"color\":\"#fff\",\"fontSize\":14}}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "gap": 16,
+ "width": 360,
+ "height": 240,
+ "backgroundColor": "#111318"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "data-testid": "count",
+ "style": {
+ "fontSize": 32,
+ "fontWeight": 600,
+ "color": "#f2f3f5"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Count: 1",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "button",
+ {
+ "data-testid": "inc",
+ "style": {
+ "padding": 10,
+ "borderRadius": 8,
+ "backgroundColor": "#3b82f6",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Add one",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 1,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":1,\"text\":\"Count: 2\"},{\"op\":\"update\",\"id\":4,\"set\":{\"style\":{\"padding\":10,\"borderRadius\":8,\"backgroundColor\":\"#2a2d35\",\"color\":\"#fff\",\"fontSize\":14}}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "gap": 16,
+ "width": 360,
+ "height": 240,
+ "backgroundColor": "#111318"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "data-testid": "count",
+ "style": {
+ "fontSize": 32,
+ "fontWeight": 600,
+ "color": "#f2f3f5"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Count: 2",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "button",
+ {
+ "data-testid": "inc",
+ "style": {
+ "padding": 10,
+ "borderRadius": 8,
+ "backgroundColor": "#2a2d35",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Add one",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"create\",\"id\":7,\"kind\":\"text\",\"props\":{},\"text\":\"Reset\"},{\"op\":\"create\",\"id\":8,\"kind\":\"button\",\"props\":{\"data-testid\":\"reset\",\"style\":{\"padding\":10,\"borderRadius\":8,\"backgroundColor\":\"#2a2d35\",\"color\":\"#fca5a5\",\"fontSize\":14},\"tabIndex\":0}},{\"op\":\"listen\",\"id\":8,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\",\"focus\",\"blur\",\"keydown\",\"keyup\"]},{\"op\":\"append\",\"parent\":8,\"child\":7},{\"op\":\"update\",\"id\":1,\"text\":\"Count: 3\"},{\"op\":\"update\",\"id\":4,\"set\":{\"style\":{\"padding\":10,\"borderRadius\":8,\"backgroundColor\":\"#3b82f6\",\"color\":\"#fff\",\"fontSize\":14}}},{\"op\":\"append\",\"parent\":5,\"child\":8}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "gap": 16,
+ "width": 360,
+ "height": 240,
+ "backgroundColor": "#111318"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "data-testid": "count",
+ "style": {
+ "fontSize": 32,
+ "fontWeight": 600,
+ "color": "#f2f3f5"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Count: 3",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "button",
+ {
+ "data-testid": "inc",
+ "style": {
+ "padding": 10,
+ "borderRadius": 8,
+ "backgroundColor": "#3b82f6",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Add one",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "button",
+ {
+ "data-testid": "reset",
+ "style": {
+ "padding": 10,
+ "borderRadius": 8,
+ "backgroundColor": "#2a2d35",
+ "color": "#fca5a5",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Reset",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 3,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":1,\"text\":\"Count: 0\"},{\"op\":\"remove\",\"id\":8},{\"op\":\"update\",\"id\":4,\"set\":{\"style\":{\"padding\":10,\"borderRadius\":8,\"backgroundColor\":\"#2a2d35\",\"color\":\"#fff\",\"fontSize\":14}}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "gap": 16,
+ "width": 360,
+ "height": 240,
+ "backgroundColor": "#111318"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "data-testid": "count",
+ "style": {
+ "fontSize": 32,
+ "fontWeight": 600,
+ "color": "#f2f3f5"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Count: 0",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "button",
+ {
+ "data-testid": "inc",
+ "style": {
+ "padding": 10,
+ "borderRadius": 8,
+ "backgroundColor": "#2a2d35",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Add one",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 4,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":1,\"text\":\"Count: 1\"},{\"op\":\"update\",\"id\":4,\"set\":{\"style\":{\"padding\":10,\"borderRadius\":8,\"backgroundColor\":\"#3b82f6\",\"color\":\"#fff\",\"fontSize\":14}}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "alignItems": "center",
+ "justifyContent": "center",
+ "gap": 16,
+ "width": 360,
+ "height": 240,
+ "backgroundColor": "#111318"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "data-testid": "count",
+ "style": {
+ "fontSize": 32,
+ "fontWeight": 600,
+ "color": "#f2f3f5"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Count: 1",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "button",
+ {
+ "data-testid": "inc",
+ "style": {
+ "padding": 10,
+ "borderRadius": 8,
+ "backgroundColor": "#3b82f6",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Add one",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/engine/rune/tests/recorded/list.json b/engine/rune/tests/recorded/list.json
new file mode 100644
index 00000000..cca2493d
--- /dev/null
+++ b/engine/rune/tests/recorded/list.json
@@ -0,0 +1,17691 @@
+{
+ "app": "list",
+ "steps": [
+ {
+ "press": "row-3"
+ },
+ {
+ "press": "delete"
+ },
+ {
+ "press": "sort"
+ },
+ {
+ "wheel": "scroller",
+ "dy": 300
+ },
+ {
+ "press": "row-30"
+ },
+ {
+ "press": "sort"
+ }
+ ],
+ "frames": [
+ {
+ "step": -1,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"clear\"},{\"op\":\"listen\",\"id\":0,\"events\":[\"pointerdown\",\"pointerup\",\"pointermove\"]},{\"op\":\"create\",\"id\":1,\"kind\":\"text\",\"props\":{},\"text\":\"40 clips\"},{\"op\":\"create\",\"id\":2,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":15,\"fontWeight\":600,\"color\":\"#fff\"}}},{\"op\":\"listen\",\"id\":2,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":2,\"child\":1},{\"op\":\"create\",\"id\":3,\"kind\":\"text\",\"props\":{},\"text\":\"In order\"},{\"op\":\"create\",\"id\":4,\"kind\":\"button\",\"props\":{\"data-testid\":\"sort\",\"style\":{\"padding\":6,\"borderRadius\":6,\"backgroundColor\":\"#24262c\",\"color\":\"#d1d5db\",\"fontSize\":12},\"tabIndex\":0}},{\"op\":\"listen\",\"id\":4,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\",\"focus\",\"blur\",\"keydown\",\"keyup\"]},{\"op\":\"append\",\"parent\":4,\"child\":3},{\"op\":\"create\",\"id\":5,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"alignItems\":\"center\",\"padding\":12,\"borderBottomWidth\":1,\"borderColor\":\"#24262c\"}}},{\"op\":\"listen\",\"id\":5,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":5,\"child\":2},{\"op\":\"append\",\"parent\":5,\"child\":4},{\"op\":\"create\",\"id\":6,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 01\"},{\"op\":\"create\",\"id\":7,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":7,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":7,\"child\":6},{\"op\":\"create\",\"id\":8,\"kind\":\"text\",\"props\":{},\"text\":\"5s\"},{\"op\":\"create\",\"id\":9,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":9,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":9,\"child\":8},{\"op\":\"create\",\"id\":10,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-1\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":10,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":10,\"child\":7},{\"op\":\"append\",\"parent\":10,\"child\":9},{\"op\":\"create\",\"id\":11,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 02\"},{\"op\":\"create\",\"id\":12,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":12,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":12,\"child\":11},{\"op\":\"create\",\"id\":13,\"kind\":\"text\",\"props\":{},\"text\":\"42s\"},{\"op\":\"create\",\"id\":14,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":14,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":14,\"child\":13},{\"op\":\"create\",\"id\":15,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-2\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":15,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":15,\"child\":12},{\"op\":\"append\",\"parent\":15,\"child\":14},{\"op\":\"create\",\"id\":16,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 03\"},{\"op\":\"create\",\"id\":17,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":17,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":17,\"child\":16},{\"op\":\"create\",\"id\":18,\"kind\":\"text\",\"props\":{},\"text\":\"79s\"},{\"op\":\"create\",\"id\":19,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":19,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":19,\"child\":18},{\"op\":\"create\",\"id\":20,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-3\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":20,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":20,\"child\":17},{\"op\":\"append\",\"parent\":20,\"child\":19},{\"op\":\"create\",\"id\":21,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 04\"},{\"op\":\"create\",\"id\":22,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":22,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":22,\"child\":21},{\"op\":\"create\",\"id\":23,\"kind\":\"text\",\"props\":{},\"text\":\"26s\"},{\"op\":\"create\",\"id\":24,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":24,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":24,\"child\":23},{\"op\":\"create\",\"id\":25,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-4\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":25,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":25,\"child\":22},{\"op\":\"append\",\"parent\":25,\"child\":24},{\"op\":\"create\",\"id\":26,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 05\"},{\"op\":\"create\",\"id\":27,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":27,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":27,\"child\":26},{\"op\":\"create\",\"id\":28,\"kind\":\"text\",\"props\":{},\"text\":\"63s\"},{\"op\":\"create\",\"id\":29,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":29,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":29,\"child\":28},{\"op\":\"create\",\"id\":30,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-5\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":30,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":30,\"child\":27},{\"op\":\"append\",\"parent\":30,\"child\":29},{\"op\":\"create\",\"id\":31,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 06\"},{\"op\":\"create\",\"id\":32,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":32,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":32,\"child\":31},{\"op\":\"create\",\"id\":33,\"kind\":\"text\",\"props\":{},\"text\":\"10s\"},{\"op\":\"create\",\"id\":34,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":34,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":34,\"child\":33},{\"op\":\"create\",\"id\":35,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-6\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":35,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":35,\"child\":32},{\"op\":\"append\",\"parent\":35,\"child\":34},{\"op\":\"create\",\"id\":36,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 07\"},{\"op\":\"create\",\"id\":37,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":37,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":37,\"child\":36},{\"op\":\"create\",\"id\":38,\"kind\":\"text\",\"props\":{},\"text\":\"47s\"},{\"op\":\"create\",\"id\":39,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":39,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":39,\"child\":38},{\"op\":\"create\",\"id\":40,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-7\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":40,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":40,\"child\":37},{\"op\":\"append\",\"parent\":40,\"child\":39},{\"op\":\"create\",\"id\":41,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 08\"},{\"op\":\"create\",\"id\":42,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":42,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":42,\"child\":41},{\"op\":\"create\",\"id\":43,\"kind\":\"text\",\"props\":{},\"text\":\"84s\"},{\"op\":\"create\",\"id\":44,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":44,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":44,\"child\":43},{\"op\":\"create\",\"id\":45,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-8\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":45,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":45,\"child\":42},{\"op\":\"append\",\"parent\":45,\"child\":44},{\"op\":\"create\",\"id\":46,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 09\"},{\"op\":\"create\",\"id\":47,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":47,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":47,\"child\":46},{\"op\":\"create\",\"id\":48,\"kind\":\"text\",\"props\":{},\"text\":\"31s\"},{\"op\":\"create\",\"id\":49,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":49,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":49,\"child\":48},{\"op\":\"create\",\"id\":50,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-9\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":50,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":50,\"child\":47},{\"op\":\"append\",\"parent\":50,\"child\":49},{\"op\":\"create\",\"id\":51,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 10\"},{\"op\":\"create\",\"id\":52,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":52,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":52,\"child\":51},{\"op\":\"create\",\"id\":53,\"kind\":\"text\",\"props\":{},\"text\":\"68s\"},{\"op\":\"create\",\"id\":54,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":54,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":54,\"child\":53},{\"op\":\"create\",\"id\":55,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-10\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":55,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":55,\"child\":52},{\"op\":\"append\",\"parent\":55,\"child\":54},{\"op\":\"create\",\"id\":56,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 11\"},{\"op\":\"create\",\"id\":57,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":57,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":57,\"child\":56},{\"op\":\"create\",\"id\":58,\"kind\":\"text\",\"props\":{},\"text\":\"15s\"},{\"op\":\"create\",\"id\":59,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":59,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":59,\"child\":58},{\"op\":\"create\",\"id\":60,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-11\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":60,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":60,\"child\":57},{\"op\":\"append\",\"parent\":60,\"child\":59},{\"op\":\"create\",\"id\":61,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 12\"},{\"op\":\"create\",\"id\":62,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":62,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":62,\"child\":61},{\"op\":\"create\",\"id\":63,\"kind\":\"text\",\"props\":{},\"text\":\"52s\"},{\"op\":\"create\",\"id\":64,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":64,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":64,\"child\":63},{\"op\":\"create\",\"id\":65,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-12\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":65,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":65,\"child\":62},{\"op\":\"append\",\"parent\":65,\"child\":64},{\"op\":\"create\",\"id\":66,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 13\"},{\"op\":\"create\",\"id\":67,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":67,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":67,\"child\":66},{\"op\":\"create\",\"id\":68,\"kind\":\"text\",\"props\":{},\"text\":\"89s\"},{\"op\":\"create\",\"id\":69,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":69,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":69,\"child\":68},{\"op\":\"create\",\"id\":70,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-13\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":70,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":70,\"child\":67},{\"op\":\"append\",\"parent\":70,\"child\":69},{\"op\":\"create\",\"id\":71,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 14\"},{\"op\":\"create\",\"id\":72,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":72,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":72,\"child\":71},{\"op\":\"create\",\"id\":73,\"kind\":\"text\",\"props\":{},\"text\":\"36s\"},{\"op\":\"create\",\"id\":74,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":74,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":74,\"child\":73},{\"op\":\"create\",\"id\":75,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-14\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":75,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":75,\"child\":72},{\"op\":\"append\",\"parent\":75,\"child\":74},{\"op\":\"create\",\"id\":76,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 15\"},{\"op\":\"create\",\"id\":77,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":77,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":77,\"child\":76},{\"op\":\"create\",\"id\":78,\"kind\":\"text\",\"props\":{},\"text\":\"73s\"},{\"op\":\"create\",\"id\":79,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":79,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":79,\"child\":78},{\"op\":\"create\",\"id\":80,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-15\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":80,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":80,\"child\":77},{\"op\":\"append\",\"parent\":80,\"child\":79},{\"op\":\"create\",\"id\":81,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 16\"},{\"op\":\"create\",\"id\":82,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":82,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":82,\"child\":81},{\"op\":\"create\",\"id\":83,\"kind\":\"text\",\"props\":{},\"text\":\"20s\"},{\"op\":\"create\",\"id\":84,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":84,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":84,\"child\":83},{\"op\":\"create\",\"id\":85,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-16\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":85,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":85,\"child\":82},{\"op\":\"append\",\"parent\":85,\"child\":84},{\"op\":\"create\",\"id\":86,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 17\"},{\"op\":\"create\",\"id\":87,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":87,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":87,\"child\":86},{\"op\":\"create\",\"id\":88,\"kind\":\"text\",\"props\":{},\"text\":\"57s\"},{\"op\":\"create\",\"id\":89,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":89,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":89,\"child\":88},{\"op\":\"create\",\"id\":90,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-17\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":90,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":90,\"child\":87},{\"op\":\"append\",\"parent\":90,\"child\":89},{\"op\":\"create\",\"id\":91,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 18\"},{\"op\":\"create\",\"id\":92,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":92,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":92,\"child\":91},{\"op\":\"create\",\"id\":93,\"kind\":\"text\",\"props\":{},\"text\":\"94s\"},{\"op\":\"create\",\"id\":94,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":94,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":94,\"child\":93},{\"op\":\"create\",\"id\":95,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-18\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":95,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":95,\"child\":92},{\"op\":\"append\",\"parent\":95,\"child\":94},{\"op\":\"create\",\"id\":96,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 19\"},{\"op\":\"create\",\"id\":97,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":97,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":97,\"child\":96},{\"op\":\"create\",\"id\":98,\"kind\":\"text\",\"props\":{},\"text\":\"41s\"},{\"op\":\"create\",\"id\":99,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":99,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":99,\"child\":98},{\"op\":\"create\",\"id\":100,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-19\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":100,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":100,\"child\":97},{\"op\":\"append\",\"parent\":100,\"child\":99},{\"op\":\"create\",\"id\":101,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 20\"},{\"op\":\"create\",\"id\":102,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":102,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":102,\"child\":101},{\"op\":\"create\",\"id\":103,\"kind\":\"text\",\"props\":{},\"text\":\"78s\"},{\"op\":\"create\",\"id\":104,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":104,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":104,\"child\":103},{\"op\":\"create\",\"id\":105,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-20\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":105,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":105,\"child\":102},{\"op\":\"append\",\"parent\":105,\"child\":104},{\"op\":\"create\",\"id\":106,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 21\"},{\"op\":\"create\",\"id\":107,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":107,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":107,\"child\":106},{\"op\":\"create\",\"id\":108,\"kind\":\"text\",\"props\":{},\"text\":\"25s\"},{\"op\":\"create\",\"id\":109,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":109,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":109,\"child\":108},{\"op\":\"create\",\"id\":110,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-21\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":110,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":110,\"child\":107},{\"op\":\"append\",\"parent\":110,\"child\":109},{\"op\":\"create\",\"id\":111,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 22\"},{\"op\":\"create\",\"id\":112,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":112,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":112,\"child\":111},{\"op\":\"create\",\"id\":113,\"kind\":\"text\",\"props\":{},\"text\":\"62s\"},{\"op\":\"create\",\"id\":114,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":114,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":114,\"child\":113},{\"op\":\"create\",\"id\":115,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-22\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":115,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":115,\"child\":112},{\"op\":\"append\",\"parent\":115,\"child\":114},{\"op\":\"create\",\"id\":116,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 23\"},{\"op\":\"create\",\"id\":117,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":117,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":117,\"child\":116},{\"op\":\"create\",\"id\":118,\"kind\":\"text\",\"props\":{},\"text\":\"9s\"},{\"op\":\"create\",\"id\":119,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":119,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":119,\"child\":118},{\"op\":\"create\",\"id\":120,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-23\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":120,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":120,\"child\":117},{\"op\":\"append\",\"parent\":120,\"child\":119},{\"op\":\"create\",\"id\":121,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 24\"},{\"op\":\"create\",\"id\":122,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":122,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":122,\"child\":121},{\"op\":\"create\",\"id\":123,\"kind\":\"text\",\"props\":{},\"text\":\"46s\"},{\"op\":\"create\",\"id\":124,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":124,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":124,\"child\":123},{\"op\":\"create\",\"id\":125,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-24\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":125,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":125,\"child\":122},{\"op\":\"append\",\"parent\":125,\"child\":124},{\"op\":\"create\",\"id\":126,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 25\"},{\"op\":\"create\",\"id\":127,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":127,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":127,\"child\":126},{\"op\":\"create\",\"id\":128,\"kind\":\"text\",\"props\":{},\"text\":\"83s\"},{\"op\":\"create\",\"id\":129,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":129,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":129,\"child\":128},{\"op\":\"create\",\"id\":130,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-25\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":130,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":130,\"child\":127},{\"op\":\"append\",\"parent\":130,\"child\":129},{\"op\":\"create\",\"id\":131,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 26\"},{\"op\":\"create\",\"id\":132,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":132,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":132,\"child\":131},{\"op\":\"create\",\"id\":133,\"kind\":\"text\",\"props\":{},\"text\":\"30s\"},{\"op\":\"create\",\"id\":134,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":134,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":134,\"child\":133},{\"op\":\"create\",\"id\":135,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-26\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":135,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":135,\"child\":132},{\"op\":\"append\",\"parent\":135,\"child\":134},{\"op\":\"create\",\"id\":136,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 27\"},{\"op\":\"create\",\"id\":137,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":137,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":137,\"child\":136},{\"op\":\"create\",\"id\":138,\"kind\":\"text\",\"props\":{},\"text\":\"67s\"},{\"op\":\"create\",\"id\":139,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":139,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":139,\"child\":138},{\"op\":\"create\",\"id\":140,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-27\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":140,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":140,\"child\":137},{\"op\":\"append\",\"parent\":140,\"child\":139},{\"op\":\"create\",\"id\":141,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 28\"},{\"op\":\"create\",\"id\":142,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":142,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":142,\"child\":141},{\"op\":\"create\",\"id\":143,\"kind\":\"text\",\"props\":{},\"text\":\"14s\"},{\"op\":\"create\",\"id\":144,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":144,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":144,\"child\":143},{\"op\":\"create\",\"id\":145,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-28\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":145,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":145,\"child\":142},{\"op\":\"append\",\"parent\":145,\"child\":144},{\"op\":\"create\",\"id\":146,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 29\"},{\"op\":\"create\",\"id\":147,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":147,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":147,\"child\":146},{\"op\":\"create\",\"id\":148,\"kind\":\"text\",\"props\":{},\"text\":\"51s\"},{\"op\":\"create\",\"id\":149,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":149,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":149,\"child\":148},{\"op\":\"create\",\"id\":150,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-29\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":150,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":150,\"child\":147},{\"op\":\"append\",\"parent\":150,\"child\":149},{\"op\":\"create\",\"id\":151,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 30\"},{\"op\":\"create\",\"id\":152,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":152,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":152,\"child\":151},{\"op\":\"create\",\"id\":153,\"kind\":\"text\",\"props\":{},\"text\":\"88s\"},{\"op\":\"create\",\"id\":154,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":154,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":154,\"child\":153},{\"op\":\"create\",\"id\":155,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-30\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":155,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":155,\"child\":152},{\"op\":\"append\",\"parent\":155,\"child\":154},{\"op\":\"create\",\"id\":156,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 31\"},{\"op\":\"create\",\"id\":157,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":157,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":157,\"child\":156},{\"op\":\"create\",\"id\":158,\"kind\":\"text\",\"props\":{},\"text\":\"35s\"},{\"op\":\"create\",\"id\":159,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":159,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":159,\"child\":158},{\"op\":\"create\",\"id\":160,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-31\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":160,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":160,\"child\":157},{\"op\":\"append\",\"parent\":160,\"child\":159},{\"op\":\"create\",\"id\":161,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 32\"},{\"op\":\"create\",\"id\":162,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":162,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":162,\"child\":161},{\"op\":\"create\",\"id\":163,\"kind\":\"text\",\"props\":{},\"text\":\"72s\"},{\"op\":\"create\",\"id\":164,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":164,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":164,\"child\":163},{\"op\":\"create\",\"id\":165,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-32\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":165,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":165,\"child\":162},{\"op\":\"append\",\"parent\":165,\"child\":164},{\"op\":\"create\",\"id\":166,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 33\"},{\"op\":\"create\",\"id\":167,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":167,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":167,\"child\":166},{\"op\":\"create\",\"id\":168,\"kind\":\"text\",\"props\":{},\"text\":\"19s\"},{\"op\":\"create\",\"id\":169,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":169,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":169,\"child\":168},{\"op\":\"create\",\"id\":170,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-33\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":170,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":170,\"child\":167},{\"op\":\"append\",\"parent\":170,\"child\":169},{\"op\":\"create\",\"id\":171,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 34\"},{\"op\":\"create\",\"id\":172,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":172,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":172,\"child\":171},{\"op\":\"create\",\"id\":173,\"kind\":\"text\",\"props\":{},\"text\":\"56s\"},{\"op\":\"create\",\"id\":174,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":174,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":174,\"child\":173},{\"op\":\"create\",\"id\":175,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-34\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":175,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":175,\"child\":172},{\"op\":\"append\",\"parent\":175,\"child\":174},{\"op\":\"create\",\"id\":176,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 35\"},{\"op\":\"create\",\"id\":177,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":177,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":177,\"child\":176},{\"op\":\"create\",\"id\":178,\"kind\":\"text\",\"props\":{},\"text\":\"93s\"},{\"op\":\"create\",\"id\":179,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":179,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":179,\"child\":178},{\"op\":\"create\",\"id\":180,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-35\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":180,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":180,\"child\":177},{\"op\":\"append\",\"parent\":180,\"child\":179},{\"op\":\"create\",\"id\":181,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 36\"},{\"op\":\"create\",\"id\":182,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":182,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":182,\"child\":181},{\"op\":\"create\",\"id\":183,\"kind\":\"text\",\"props\":{},\"text\":\"40s\"},{\"op\":\"create\",\"id\":184,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":184,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":184,\"child\":183},{\"op\":\"create\",\"id\":185,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-36\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":185,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":185,\"child\":182},{\"op\":\"append\",\"parent\":185,\"child\":184},{\"op\":\"create\",\"id\":186,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 37\"},{\"op\":\"create\",\"id\":187,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":187,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":187,\"child\":186},{\"op\":\"create\",\"id\":188,\"kind\":\"text\",\"props\":{},\"text\":\"77s\"},{\"op\":\"create\",\"id\":189,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":189,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":189,\"child\":188},{\"op\":\"create\",\"id\":190,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-37\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":190,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":190,\"child\":187},{\"op\":\"append\",\"parent\":190,\"child\":189},{\"op\":\"create\",\"id\":191,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 38\"},{\"op\":\"create\",\"id\":192,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":192,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":192,\"child\":191},{\"op\":\"create\",\"id\":193,\"kind\":\"text\",\"props\":{},\"text\":\"24s\"},{\"op\":\"create\",\"id\":194,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":194,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":194,\"child\":193},{\"op\":\"create\",\"id\":195,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-38\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":195,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":195,\"child\":192},{\"op\":\"append\",\"parent\":195,\"child\":194},{\"op\":\"create\",\"id\":196,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 39\"},{\"op\":\"create\",\"id\":197,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":197,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":197,\"child\":196},{\"op\":\"create\",\"id\":198,\"kind\":\"text\",\"props\":{},\"text\":\"61s\"},{\"op\":\"create\",\"id\":199,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":199,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":199,\"child\":198},{\"op\":\"create\",\"id\":200,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-39\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":200,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":200,\"child\":197},{\"op\":\"append\",\"parent\":200,\"child\":199},{\"op\":\"create\",\"id\":201,\"kind\":\"text\",\"props\":{},\"text\":\"Clip 40\"},{\"op\":\"create\",\"id\":202,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":13,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":202,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":202,\"child\":201},{\"op\":\"create\",\"id\":203,\"kind\":\"text\",\"props\":{},\"text\":\"8s\"},{\"op\":\"create\",\"id\":204,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":12,\"color\":\"#9ca3af\"}}},{\"op\":\"listen\",\"id\":204,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":204,\"child\":203},{\"op\":\"create\",\"id\":205,\"kind\":\"div\",\"props\":{\"data-testid\":\"row-40\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"transparent\"}}},{\"op\":\"listen\",\"id\":205,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":205,\"child\":202},{\"op\":\"append\",\"parent\":205,\"child\":204},{\"op\":\"create\",\"id\":206,\"kind\":\"div\",\"props\":{\"data-testid\":\"scroller\",\"style\":{\"flexGrow\":1,\"minHeight\":0,\"overflowY\":\"scroll\"}}},{\"op\":\"listen\",\"id\":206,\"events\":[\"pointerenter\",\"pointerleave\",\"scroll\"]},{\"op\":\"append\",\"parent\":206,\"child\":10},{\"op\":\"append\",\"parent\":206,\"child\":15},{\"op\":\"append\",\"parent\":206,\"child\":20},{\"op\":\"append\",\"parent\":206,\"child\":25},{\"op\":\"append\",\"parent\":206,\"child\":30},{\"op\":\"append\",\"parent\":206,\"child\":35},{\"op\":\"append\",\"parent\":206,\"child\":40},{\"op\":\"append\",\"parent\":206,\"child\":45},{\"op\":\"append\",\"parent\":206,\"child\":50},{\"op\":\"append\",\"parent\":206,\"child\":55},{\"op\":\"append\",\"parent\":206,\"child\":60},{\"op\":\"append\",\"parent\":206,\"child\":65},{\"op\":\"append\",\"parent\":206,\"child\":70},{\"op\":\"append\",\"parent\":206,\"child\":75},{\"op\":\"append\",\"parent\":206,\"child\":80},{\"op\":\"append\",\"parent\":206,\"child\":85},{\"op\":\"append\",\"parent\":206,\"child\":90},{\"op\":\"append\",\"parent\":206,\"child\":95},{\"op\":\"append\",\"parent\":206,\"child\":100},{\"op\":\"append\",\"parent\":206,\"child\":105},{\"op\":\"append\",\"parent\":206,\"child\":110},{\"op\":\"append\",\"parent\":206,\"child\":115},{\"op\":\"append\",\"parent\":206,\"child\":120},{\"op\":\"append\",\"parent\":206,\"child\":125},{\"op\":\"append\",\"parent\":206,\"child\":130},{\"op\":\"append\",\"parent\":206,\"child\":135},{\"op\":\"append\",\"parent\":206,\"child\":140},{\"op\":\"append\",\"parent\":206,\"child\":145},{\"op\":\"append\",\"parent\":206,\"child\":150},{\"op\":\"append\",\"parent\":206,\"child\":155},{\"op\":\"append\",\"parent\":206,\"child\":160},{\"op\":\"append\",\"parent\":206,\"child\":165},{\"op\":\"append\",\"parent\":206,\"child\":170},{\"op\":\"append\",\"parent\":206,\"child\":175},{\"op\":\"append\",\"parent\":206,\"child\":180},{\"op\":\"append\",\"parent\":206,\"child\":185},{\"op\":\"append\",\"parent\":206,\"child\":190},{\"op\":\"append\",\"parent\":206,\"child\":195},{\"op\":\"append\",\"parent\":206,\"child\":200},{\"op\":\"append\",\"parent\":206,\"child\":205},{\"op\":\"create\",\"id\":207,\"kind\":\"div\",\"props\":{\"data-testid\":\"root\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"column\",\"width\":320,\"height\":480,\"backgroundColor\":\"#101114\"}}},{\"op\":\"listen\",\"id\":207,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":207,\"child\":5},{\"op\":\"append\",\"parent\":207,\"child\":206},{\"op\":\"append\",\"parent\":0,\"child\":207}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 320,
+ "height": 480,
+ "backgroundColor": "#101114"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "alignItems": "center",
+ "padding": 12,
+ "borderBottomWidth": 1,
+ "borderColor": "#24262c"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 15,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "40 clips",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "button",
+ {
+ "data-testid": "sort",
+ "style": {
+ "padding": 6,
+ "borderRadius": 6,
+ "backgroundColor": "#24262c",
+ "color": "#d1d5db",
+ "fontSize": 12
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "In order",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "scroller",
+ "style": {
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "row-1",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 01",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "5s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-2",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 02",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "42s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-3",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 03",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "79s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-4",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 04",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "26s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-5",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 05",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "63s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-6",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 06",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "10s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-7",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 07",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "47s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-8",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 08",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "84s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-9",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 09",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "31s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-10",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 10",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "68s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-11",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 11",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "15s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-12",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 12",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "52s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-13",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 13",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "89s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-14",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 14",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "36s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-15",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 15",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "73s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-16",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 16",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "20s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-17",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 17",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "57s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-18",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 18",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "94s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-19",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 19",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "41s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-20",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 20",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "78s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-21",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 21",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "25s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-22",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 22",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "62s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-23",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 23",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "9s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-24",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 24",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "46s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-25",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 25",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "83s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-26",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 26",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "30s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-27",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 27",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "67s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-28",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 28",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "14s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-29",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 29",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "51s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-30",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 30",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "88s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-31",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 31",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "35s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-32",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 32",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "72s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-33",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 33",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "19s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-34",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 34",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "56s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-35",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 35",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "93s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-36",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 36",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "40s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-37",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 37",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "77s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-38",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 38",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "24s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-39",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 39",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "61s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-40",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 40",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "8s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 0,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"create\",\"id\":208,\"kind\":\"text\",\"props\":{},\"text\":\"Delete selected\"},{\"op\":\"create\",\"id\":209,\"kind\":\"button\",\"props\":{\"data-testid\":\"delete\",\"style\":{\"margin\":12,\"padding\":8,\"borderRadius\":6,\"backgroundColor\":\"#7f1d1d\",\"color\":\"#fff\",\"fontSize\":13},\"tabIndex\":0}},{\"op\":\"listen\",\"id\":209,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\",\"focus\",\"blur\",\"keydown\",\"keyup\"]},{\"op\":\"append\",\"parent\":209,\"child\":208},{\"op\":\"update\",\"id\":20,\"set\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"#1e3a8a\"}}},{\"op\":\"append\",\"parent\":207,\"child\":209}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 320,
+ "height": 480,
+ "backgroundColor": "#101114"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "alignItems": "center",
+ "padding": 12,
+ "borderBottomWidth": 1,
+ "borderColor": "#24262c"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 15,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "40 clips",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "button",
+ {
+ "data-testid": "sort",
+ "style": {
+ "padding": 6,
+ "borderRadius": 6,
+ "backgroundColor": "#24262c",
+ "color": "#d1d5db",
+ "fontSize": 12
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "In order",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "scroller",
+ "style": {
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "row-1",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 01",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "5s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-2",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 02",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "42s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-3",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "#1e3a8a"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 03",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "79s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-4",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 04",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "26s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-5",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 05",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "63s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-6",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 06",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "10s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-7",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 07",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "47s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-8",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 08",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "84s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-9",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 09",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "31s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-10",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 10",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "68s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-11",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 11",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "15s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-12",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 12",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "52s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-13",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 13",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "89s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-14",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 14",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "36s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-15",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 15",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "73s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-16",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 16",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "20s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-17",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 17",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "57s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-18",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 18",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "94s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-19",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 19",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "41s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-20",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 20",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "78s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-21",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 21",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "25s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-22",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 22",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "62s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-23",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 23",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "9s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-24",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 24",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "46s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-25",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 25",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "83s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-26",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 26",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "30s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-27",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 27",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "67s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-28",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 28",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "14s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-29",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 29",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "51s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-30",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 30",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "88s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-31",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 31",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "35s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-32",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 32",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "72s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-33",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 33",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "19s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-34",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 34",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "56s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-35",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 35",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "93s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-36",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 36",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "40s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-37",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 37",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "77s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-38",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 38",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "24s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-39",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 39",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "61s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-40",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 40",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "8s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "button",
+ {
+ "data-testid": "delete",
+ "style": {
+ "margin": 12,
+ "padding": 8,
+ "borderRadius": 6,
+ "backgroundColor": "#7f1d1d",
+ "color": "#fff",
+ "fontSize": 13
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Delete selected",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 1,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"remove\",\"id\":209},{\"op\":\"update\",\"id\":1,\"text\":\"39 clips\"},{\"op\":\"remove\",\"id\":20}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 320,
+ "height": 480,
+ "backgroundColor": "#101114"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "alignItems": "center",
+ "padding": 12,
+ "borderBottomWidth": 1,
+ "borderColor": "#24262c"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 15,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "39 clips",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "button",
+ {
+ "data-testid": "sort",
+ "style": {
+ "padding": 6,
+ "borderRadius": 6,
+ "backgroundColor": "#24262c",
+ "color": "#d1d5db",
+ "fontSize": 12
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "In order",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "scroller",
+ "style": {
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "row-1",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 01",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "5s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-2",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 02",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "42s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-4",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 04",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "26s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-5",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 05",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "63s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-6",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 06",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "10s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-7",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 07",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "47s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-8",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 08",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "84s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-9",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 09",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "31s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-10",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 10",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "68s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-11",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 11",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "15s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-12",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 12",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "52s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-13",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 13",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "89s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-14",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 14",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "36s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-15",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 15",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "73s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-16",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 16",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "20s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-17",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 17",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "57s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-18",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 18",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "94s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-19",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 19",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "41s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-20",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 20",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "78s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-21",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 21",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "25s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-22",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 22",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "62s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-23",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 23",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "9s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-24",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 24",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "46s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-25",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 25",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "83s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-26",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 26",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "30s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-27",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 27",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "67s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-28",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 28",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "14s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-29",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 29",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "51s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-30",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 30",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "88s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-31",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 31",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "35s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-32",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 32",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "72s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-33",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 33",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "19s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-34",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 34",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "56s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-35",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 35",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "93s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-36",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 36",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "40s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-37",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 37",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "77s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-38",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 38",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "24s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-39",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 39",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "61s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-40",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 40",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "8s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":3,\"text\":\"Longest first\"},{\"op\":\"insert\",\"parent\":206,\"child\":70,\"before\":190},{\"op\":\"insert\",\"parent\":206,\"child\":155,\"before\":190},{\"op\":\"insert\",\"parent\":206,\"child\":45,\"before\":190},{\"op\":\"insert\",\"parent\":206,\"child\":130,\"before\":190},{\"op\":\"insert\",\"parent\":206,\"child\":105,\"before\":190},{\"op\":\"insert\",\"parent\":206,\"child\":80,\"before\":200},{\"op\":\"insert\",\"parent\":206,\"child\":165,\"before\":200},{\"op\":\"insert\",\"parent\":206,\"child\":55,\"before\":200},{\"op\":\"insert\",\"parent\":206,\"child\":140,\"before\":200},{\"op\":\"insert\",\"parent\":206,\"child\":30,\"before\":200},{\"op\":\"insert\",\"parent\":206,\"child\":115,\"before\":200},{\"op\":\"insert\",\"parent\":206,\"child\":90,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":175,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":65,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":150,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":40,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":125,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":15,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":100,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":185,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":75,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":160,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":50,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":135,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":25,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":110,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":195,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":85,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":170,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":60,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":145,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":35,\"before\":205},{\"op\":\"insert\",\"parent\":206,\"child\":120,\"before\":205},{\"op\":\"append\",\"parent\":206,\"child\":10}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 320,
+ "height": 480,
+ "backgroundColor": "#101114"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "alignItems": "center",
+ "padding": 12,
+ "borderBottomWidth": 1,
+ "borderColor": "#24262c"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 15,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "39 clips",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "button",
+ {
+ "data-testid": "sort",
+ "style": {
+ "padding": 6,
+ "borderRadius": 6,
+ "backgroundColor": "#24262c",
+ "color": "#d1d5db",
+ "fontSize": 12
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Longest first",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "scroller",
+ "style": {
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "row-18",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 18",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "94s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-35",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 35",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "93s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-13",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 13",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "89s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-30",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 30",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "88s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-8",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 08",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "84s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-25",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 25",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "83s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-20",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 20",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "78s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-37",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 37",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "77s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-15",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 15",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "73s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-32",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 32",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "72s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-10",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 10",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "68s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-27",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 27",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "67s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-5",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 05",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "63s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-22",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 22",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "62s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-39",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 39",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "61s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-17",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 17",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "57s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-34",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 34",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "56s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-12",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 12",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "52s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-29",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 29",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "51s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-7",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 07",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "47s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-24",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 24",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "46s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-2",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 02",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "42s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-19",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 19",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "41s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-36",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 36",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "40s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-14",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 14",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "36s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-31",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 31",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "35s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-9",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 09",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "31s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-26",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 26",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "30s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-4",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 04",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "26s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-21",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 21",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "25s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-38",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 38",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "24s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-16",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 16",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "20s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-33",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 33",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "19s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-11",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 11",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "15s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-28",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 28",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "14s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-6",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 06",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "10s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-23",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 23",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "9s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-40",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 40",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "8s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-1",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 01",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "5s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 4,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"create\",\"id\":210,\"kind\":\"text\",\"props\":{},\"text\":\"Delete selected\"},{\"op\":\"create\",\"id\":211,\"kind\":\"button\",\"props\":{\"data-testid\":\"delete\",\"style\":{\"margin\":12,\"padding\":8,\"borderRadius\":6,\"backgroundColor\":\"#7f1d1d\",\"color\":\"#fff\",\"fontSize\":13},\"tabIndex\":0}},{\"op\":\"listen\",\"id\":211,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\",\"focus\",\"blur\",\"keydown\",\"keyup\"]},{\"op\":\"append\",\"parent\":211,\"child\":210},{\"op\":\"update\",\"id\":155,\"set\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"justifyContent\":\"space-between\",\"paddingLeft\":12,\"paddingRight\":12,\"height\":36,\"alignItems\":\"center\",\"backgroundColor\":\"#1e3a8a\"}}},{\"op\":\"append\",\"parent\":207,\"child\":211}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 320,
+ "height": 480,
+ "backgroundColor": "#101114"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "alignItems": "center",
+ "padding": 12,
+ "borderBottomWidth": 1,
+ "borderColor": "#24262c"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 15,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "39 clips",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "button",
+ {
+ "data-testid": "sort",
+ "style": {
+ "padding": 6,
+ "borderRadius": 6,
+ "backgroundColor": "#24262c",
+ "color": "#d1d5db",
+ "fontSize": 12
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Longest first",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "scroller",
+ "style": {
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "row-18",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 18",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "94s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-35",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 35",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "93s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-13",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 13",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "89s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-30",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "#1e3a8a"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 30",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "88s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-8",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 08",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "84s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-25",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 25",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "83s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-20",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 20",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "78s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-37",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 37",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "77s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-15",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 15",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "73s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-32",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 32",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "72s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-10",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 10",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "68s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-27",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 27",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "67s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-5",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 05",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "63s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-22",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 22",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "62s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-39",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 39",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "61s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-17",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 17",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "57s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-34",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 34",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "56s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-12",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 12",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "52s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-29",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 29",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "51s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-7",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 07",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "47s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-24",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 24",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "46s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-2",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 02",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "42s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-19",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 19",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "41s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-36",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 36",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "40s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-14",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 14",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "36s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-31",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 31",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "35s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-9",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 09",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "31s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-26",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 26",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "30s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-4",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 04",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "26s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-21",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 21",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "25s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-38",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 38",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "24s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-16",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 16",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "20s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-33",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 33",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "19s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-11",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 11",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "15s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-28",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 28",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "14s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-6",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 06",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "10s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-23",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 23",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "9s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-40",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 40",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "8s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-1",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 01",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "5s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "button",
+ {
+ "data-testid": "delete",
+ "style": {
+ "margin": 12,
+ "padding": 8,
+ "borderRadius": 6,
+ "backgroundColor": "#7f1d1d",
+ "color": "#fff",
+ "fontSize": 13
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Delete selected",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 5,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":3,\"text\":\"In order\"},{\"op\":\"append\",\"parent\":206,\"child\":15},{\"op\":\"append\",\"parent\":206,\"child\":25},{\"op\":\"append\",\"parent\":206,\"child\":30},{\"op\":\"append\",\"parent\":206,\"child\":35},{\"op\":\"append\",\"parent\":206,\"child\":40},{\"op\":\"append\",\"parent\":206,\"child\":45},{\"op\":\"append\",\"parent\":206,\"child\":50},{\"op\":\"append\",\"parent\":206,\"child\":55},{\"op\":\"append\",\"parent\":206,\"child\":60},{\"op\":\"append\",\"parent\":206,\"child\":65},{\"op\":\"append\",\"parent\":206,\"child\":70},{\"op\":\"append\",\"parent\":206,\"child\":75},{\"op\":\"append\",\"parent\":206,\"child\":80},{\"op\":\"append\",\"parent\":206,\"child\":85},{\"op\":\"append\",\"parent\":206,\"child\":90},{\"op\":\"append\",\"parent\":206,\"child\":95},{\"op\":\"append\",\"parent\":206,\"child\":100},{\"op\":\"append\",\"parent\":206,\"child\":105},{\"op\":\"append\",\"parent\":206,\"child\":110},{\"op\":\"append\",\"parent\":206,\"child\":115},{\"op\":\"append\",\"parent\":206,\"child\":120},{\"op\":\"append\",\"parent\":206,\"child\":125},{\"op\":\"append\",\"parent\":206,\"child\":130},{\"op\":\"append\",\"parent\":206,\"child\":135},{\"op\":\"append\",\"parent\":206,\"child\":140},{\"op\":\"append\",\"parent\":206,\"child\":145},{\"op\":\"append\",\"parent\":206,\"child\":150},{\"op\":\"append\",\"parent\":206,\"child\":155},{\"op\":\"append\",\"parent\":206,\"child\":160},{\"op\":\"append\",\"parent\":206,\"child\":165},{\"op\":\"append\",\"parent\":206,\"child\":170},{\"op\":\"append\",\"parent\":206,\"child\":175},{\"op\":\"append\",\"parent\":206,\"child\":180},{\"op\":\"append\",\"parent\":206,\"child\":185},{\"op\":\"append\",\"parent\":206,\"child\":190},{\"op\":\"append\",\"parent\":206,\"child\":195},{\"op\":\"append\",\"parent\":206,\"child\":200},{\"op\":\"append\",\"parent\":206,\"child\":205}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 320,
+ "height": 480,
+ "backgroundColor": "#101114"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "alignItems": "center",
+ "padding": 12,
+ "borderBottomWidth": 1,
+ "borderColor": "#24262c"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 15,
+ "fontWeight": 600,
+ "color": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "39 clips",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "button",
+ {
+ "data-testid": "sort",
+ "style": {
+ "padding": 6,
+ "borderRadius": 6,
+ "backgroundColor": "#24262c",
+ "color": "#d1d5db",
+ "fontSize": 12
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "In order",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "scroller",
+ "style": {
+ "flexGrow": 1,
+ "minHeight": 0,
+ "overflowY": "scroll"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave",
+ "scroll"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "row-1",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 01",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "5s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-2",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 02",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "42s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-4",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 04",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "26s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-5",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 05",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "63s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-6",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 06",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "10s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-7",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 07",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "47s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-8",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 08",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "84s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-9",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 09",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "31s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-10",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 10",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "68s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-11",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 11",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "15s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-12",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 12",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "52s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-13",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 13",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "89s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-14",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 14",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "36s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-15",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 15",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "73s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-16",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 16",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "20s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-17",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 17",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "57s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-18",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 18",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "94s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-19",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 19",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "41s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-20",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 20",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "78s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-21",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 21",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "25s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-22",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 22",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "62s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-23",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 23",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "9s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-24",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 24",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "46s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-25",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 25",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "83s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-26",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 26",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "30s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-27",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 27",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "67s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-28",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 28",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "14s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-29",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 29",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "51s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-30",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "#1e3a8a"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 30",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "88s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-31",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 31",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "35s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-32",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 32",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "72s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-33",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 33",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "19s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-34",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 34",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "56s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-35",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 35",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "93s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-36",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 36",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "40s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-37",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 37",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "77s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-38",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 38",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "24s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-39",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 39",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "61s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "row-40",
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "justifyContent": "space-between",
+ "paddingLeft": 12,
+ "paddingRight": 12,
+ "height": 36,
+ "alignItems": "center",
+ "backgroundColor": "transparent"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 13,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Clip 40",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 12,
+ "color": "#9ca3af"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "8s",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "button",
+ {
+ "data-testid": "delete",
+ "style": {
+ "margin": 12,
+ "padding": 8,
+ "borderRadius": 6,
+ "backgroundColor": "#7f1d1d",
+ "color": "#fff",
+ "fontSize": 13
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Delete selected",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/engine/rune/tests/recorded/settings.json b/engine/rune/tests/recorded/settings.json
new file mode 100644
index 00000000..74ada19d
--- /dev/null
+++ b/engine/rune/tests/recorded/settings.json
@@ -0,0 +1,3524 @@
+{
+ "app": "settings",
+ "steps": [
+ {
+ "press": "sound"
+ },
+ {
+ "press": "size-L"
+ },
+ {
+ "type": " B",
+ "into": "name"
+ },
+ {
+ "press": "save"
+ },
+ {
+ "press": "dark"
+ }
+ ],
+ "frames": [
+ {
+ "step": -1,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"clear\"},{\"op\":\"listen\",\"id\":0,\"events\":[\"pointerdown\",\"pointerup\",\"pointermove\"]},{\"op\":\"create\",\"id\":1,\"kind\":\"text\",\"props\":{},\"text\":\"Settings\"},{\"op\":\"create\",\"id\":2,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":20,\"fontWeight\":600,\"color\":\"#fff\",\"marginBottom\":8}}},{\"op\":\"listen\",\"id\":2,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":2,\"child\":1},{\"op\":\"create\",\"id\":3,\"kind\":\"text\",\"props\":{},\"text\":\"Name\"},{\"op\":\"create\",\"id\":4,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":4,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":4,\"child\":3},{\"op\":\"create\",\"id\":5,\"kind\":\"editableText\",\"props\":{\"data-testid\":\"name\",\"value\":\"Shane\",\"style\":{\"width\":180,\"padding\":6,\"borderRadius\":6,\"borderWidth\":1,\"borderColor\":\"#3f434c\",\"fontSize\":14},\"tabIndex\":0}},{\"op\":\"listen\",\"id\":5,\"events\":[\"change\",\"blur\",\"pointerenter\",\"pointerleave\",\"focus\",\"keydown\",\"keyup\"]},{\"op\":\"create\",\"id\":6,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"alignItems\":\"center\",\"justifyContent\":\"space-between\",\"paddingTop\":10,\"paddingBottom\":10}}},{\"op\":\"listen\",\"id\":6,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":6,\"child\":4},{\"op\":\"append\",\"parent\":6,\"child\":5},{\"op\":\"create\",\"id\":7,\"kind\":\"text\",\"props\":{},\"text\":\"Sound\"},{\"op\":\"create\",\"id\":8,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":8,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":8,\"child\":7},{\"op\":\"create\",\"id\":9,\"kind\":\"div\",\"props\":{\"style\":{\"position\":\"absolute\",\"top\":2,\"left\":18,\"width\":18,\"height\":18,\"borderRadius\":9,\"backgroundColor\":\"#fff\"}}},{\"op\":\"listen\",\"id\":9,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"create\",\"id\":10,\"kind\":\"div\",\"props\":{\"data-testid\":\"sound\",\"role\":\"switch\",\"aria-checked\":true,\"style\":{\"width\":38,\"height\":22,\"borderRadius\":11,\"backgroundColor\":\"#3b82f6\",\"position\":\"relative\"}}},{\"op\":\"listen\",\"id\":10,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":10,\"child\":9},{\"op\":\"create\",\"id\":11,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"alignItems\":\"center\",\"justifyContent\":\"space-between\",\"paddingTop\":10,\"paddingBottom\":10}}},{\"op\":\"listen\",\"id\":11,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":11,\"child\":8},{\"op\":\"append\",\"parent\":11,\"child\":10},{\"op\":\"create\",\"id\":12,\"kind\":\"text\",\"props\":{},\"text\":\"Dark\"},{\"op\":\"create\",\"id\":13,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":13,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":13,\"child\":12},{\"op\":\"create\",\"id\":14,\"kind\":\"div\",\"props\":{\"style\":{\"position\":\"absolute\",\"top\":2,\"left\":18,\"width\":18,\"height\":18,\"borderRadius\":9,\"backgroundColor\":\"#fff\"}}},{\"op\":\"listen\",\"id\":14,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"create\",\"id\":15,\"kind\":\"div\",\"props\":{\"data-testid\":\"dark\",\"role\":\"switch\",\"aria-checked\":true,\"style\":{\"width\":38,\"height\":22,\"borderRadius\":11,\"backgroundColor\":\"#3b82f6\",\"position\":\"relative\"}}},{\"op\":\"listen\",\"id\":15,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":15,\"child\":14},{\"op\":\"create\",\"id\":16,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"alignItems\":\"center\",\"justifyContent\":\"space-between\",\"paddingTop\":10,\"paddingBottom\":10}}},{\"op\":\"listen\",\"id\":16,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":16,\"child\":13},{\"op\":\"append\",\"parent\":16,\"child\":15},{\"op\":\"create\",\"id\":17,\"kind\":\"text\",\"props\":{},\"text\":\"Text size\"},{\"op\":\"create\",\"id\":18,\"kind\":\"span\",\"props\":{\"style\":{\"fontSize\":14,\"color\":\"#e5e7eb\"}}},{\"op\":\"listen\",\"id\":18,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":18,\"child\":17},{\"op\":\"create\",\"id\":19,\"kind\":\"text\",\"props\":{},\"text\":\"S\"},{\"op\":\"create\",\"id\":20,\"kind\":\"div\",\"props\":{\"data-testid\":\"size-S\",\"style\":{\"paddingLeft\":10,\"paddingRight\":10,\"paddingTop\":4,\"paddingBottom\":4,\"borderRadius\":4,\"backgroundColor\":\"transparent\",\"color\":\"#fff\",\"fontSize\":13}}},{\"op\":\"listen\",\"id\":20,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":20,\"child\":19},{\"op\":\"create\",\"id\":21,\"kind\":\"text\",\"props\":{},\"text\":\"M\"},{\"op\":\"create\",\"id\":22,\"kind\":\"div\",\"props\":{\"data-testid\":\"size-M\",\"style\":{\"paddingLeft\":10,\"paddingRight\":10,\"paddingTop\":4,\"paddingBottom\":4,\"borderRadius\":4,\"backgroundColor\":\"#4b5563\",\"color\":\"#fff\",\"fontSize\":13}}},{\"op\":\"listen\",\"id\":22,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":22,\"child\":21},{\"op\":\"create\",\"id\":23,\"kind\":\"text\",\"props\":{},\"text\":\"L\"},{\"op\":\"create\",\"id\":24,\"kind\":\"div\",\"props\":{\"data-testid\":\"size-L\",\"style\":{\"paddingLeft\":10,\"paddingRight\":10,\"paddingTop\":4,\"paddingBottom\":4,\"borderRadius\":4,\"backgroundColor\":\"transparent\",\"color\":\"#fff\",\"fontSize\":13}}},{\"op\":\"listen\",\"id\":24,\"events\":[\"pointerdown\",\"pointerup\",\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":24,\"child\":23},{\"op\":\"create\",\"id\":25,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"gap\":2,\"borderRadius\":6,\"backgroundColor\":\"#2a2d35\",\"padding\":2}}},{\"op\":\"listen\",\"id\":25,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":25,\"child\":20},{\"op\":\"append\",\"parent\":25,\"child\":22},{\"op\":\"append\",\"parent\":25,\"child\":24},{\"op\":\"create\",\"id\":26,\"kind\":\"div\",\"props\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"row\",\"alignItems\":\"center\",\"justifyContent\":\"space-between\",\"paddingTop\":10,\"paddingBottom\":10}}},{\"op\":\"listen\",\"id\":26,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":26,\"child\":18},{\"op\":\"append\",\"parent\":26,\"child\":25},{\"op\":\"create\",\"id\":27,\"kind\":\"text\",\"props\":{},\"text\":\"Saved\"},{\"op\":\"create\",\"id\":28,\"kind\":\"button\",\"props\":{\"data-testid\":\"save\",\"disabled\":true,\"style\":{\"marginTop\":12,\"padding\":10,\"borderRadius\":8,\"backgroundColor\":\"#2a2d35\",\"color\":\"#6b7280\",\"fontSize\":14}}},{\"op\":\"listen\",\"id\":28,\"events\":[\"pointerenter\",\"pointerleave\",\"focus\",\"blur\",\"keydown\",\"keyup\"]},{\"op\":\"append\",\"parent\":28,\"child\":27},{\"op\":\"create\",\"id\":29,\"kind\":\"div\",\"props\":{\"data-testid\":\"root\",\"style\":{\"display\":\"flex\",\"flexDirection\":\"column\",\"width\":420,\"padding\":20,\"gap\":4,\"backgroundColor\":\"#16181d\"}}},{\"op\":\"listen\",\"id\":29,\"events\":[\"pointerenter\",\"pointerleave\"]},{\"op\":\"append\",\"parent\":29,\"child\":2},{\"op\":\"append\",\"parent\":29,\"child\":6},{\"op\":\"append\",\"parent\":29,\"child\":11},{\"op\":\"append\",\"parent\":29,\"child\":16},{\"op\":\"append\",\"parent\":29,\"child\":26},{\"op\":\"append\",\"parent\":29,\"child\":28},{\"op\":\"append\",\"parent\":0,\"child\":29}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 420,
+ "padding": 20,
+ "gap": 4,
+ "backgroundColor": "#16181d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 20,
+ "fontWeight": 600,
+ "color": "#fff",
+ "marginBottom": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Settings",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Name",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "editableText",
+ {
+ "data-testid": "name",
+ "style": {
+ "width": 180,
+ "padding": 6,
+ "borderRadius": 6,
+ "borderWidth": 1,
+ "borderColor": "#3f434c",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Shane"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Sound",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "aria-checked": true,
+ "data-testid": "sound",
+ "role": "switch",
+ "style": {
+ "width": 38,
+ "height": 22,
+ "borderRadius": 11,
+ "backgroundColor": "#3b82f6",
+ "position": "relative"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "position": "absolute",
+ "top": 2,
+ "left": 18,
+ "width": 18,
+ "height": 18,
+ "borderRadius": 9,
+ "backgroundColor": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Dark",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "aria-checked": true,
+ "data-testid": "dark",
+ "role": "switch",
+ "style": {
+ "width": 38,
+ "height": 22,
+ "borderRadius": 11,
+ "backgroundColor": "#3b82f6",
+ "position": "relative"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "position": "absolute",
+ "top": 2,
+ "left": 18,
+ "width": 18,
+ "height": 18,
+ "borderRadius": 9,
+ "backgroundColor": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Text size",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 2,
+ "borderRadius": 6,
+ "backgroundColor": "#2a2d35",
+ "padding": 2
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "size-S",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "transparent",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "S",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "size-M",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "#4b5563",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "M",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "size-L",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "transparent",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "L",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "button",
+ {
+ "data-testid": "save",
+ "disabled": true,
+ "style": {
+ "marginTop": 12,
+ "padding": 10,
+ "borderRadius": 8,
+ "backgroundColor": "#2a2d35",
+ "color": "#6b7280",
+ "fontSize": 14
+ }
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Saved",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 0,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":9,\"set\":{\"style\":{\"position\":\"absolute\",\"top\":2,\"left\":2,\"width\":18,\"height\":18,\"borderRadius\":9,\"backgroundColor\":\"#fff\"}}},{\"op\":\"update\",\"id\":10,\"set\":{\"aria-checked\":false,\"style\":{\"width\":38,\"height\":22,\"borderRadius\":11,\"backgroundColor\":\"#3f434c\",\"position\":\"relative\"}}},{\"op\":\"update\",\"id\":27,\"text\":\"Save\"},{\"op\":\"update\",\"id\":28,\"set\":{\"disabled\":false,\"tabIndex\":0,\"style\":{\"marginTop\":12,\"padding\":10,\"borderRadius\":8,\"backgroundColor\":\"#3b82f6\",\"color\":\"#fff\",\"fontSize\":14}}},{\"op\":\"listen\",\"id\":28,\"events\":[\"pointerdown\",\"pointerup\"]}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 420,
+ "padding": 20,
+ "gap": 4,
+ "backgroundColor": "#16181d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 20,
+ "fontWeight": 600,
+ "color": "#fff",
+ "marginBottom": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Settings",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Name",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "editableText",
+ {
+ "data-testid": "name",
+ "style": {
+ "width": 180,
+ "padding": 6,
+ "borderRadius": 6,
+ "borderWidth": 1,
+ "borderColor": "#3f434c",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Shane"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Sound",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "aria-checked": false,
+ "data-testid": "sound",
+ "role": "switch",
+ "style": {
+ "width": 38,
+ "height": 22,
+ "borderRadius": 11,
+ "backgroundColor": "#3f434c",
+ "position": "relative"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "position": "absolute",
+ "top": 2,
+ "left": 2,
+ "width": 18,
+ "height": 18,
+ "borderRadius": 9,
+ "backgroundColor": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Dark",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "aria-checked": true,
+ "data-testid": "dark",
+ "role": "switch",
+ "style": {
+ "width": 38,
+ "height": 22,
+ "borderRadius": 11,
+ "backgroundColor": "#3b82f6",
+ "position": "relative"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "position": "absolute",
+ "top": 2,
+ "left": 18,
+ "width": 18,
+ "height": 18,
+ "borderRadius": 9,
+ "backgroundColor": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Text size",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 2,
+ "borderRadius": 6,
+ "backgroundColor": "#2a2d35",
+ "padding": 2
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "size-S",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "transparent",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "S",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "size-M",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "#4b5563",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "M",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "size-L",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "transparent",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "L",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "button",
+ {
+ "data-testid": "save",
+ "disabled": false,
+ "style": {
+ "marginTop": 12,
+ "padding": 10,
+ "borderRadius": 8,
+ "backgroundColor": "#3b82f6",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Save",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 1,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":22,\"set\":{\"style\":{\"paddingLeft\":10,\"paddingRight\":10,\"paddingTop\":4,\"paddingBottom\":4,\"borderRadius\":4,\"backgroundColor\":\"transparent\",\"color\":\"#fff\",\"fontSize\":13}}},{\"op\":\"update\",\"id\":24,\"set\":{\"style\":{\"paddingLeft\":10,\"paddingRight\":10,\"paddingTop\":4,\"paddingBottom\":4,\"borderRadius\":4,\"backgroundColor\":\"#4b5563\",\"color\":\"#fff\",\"fontSize\":13}}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 420,
+ "padding": 20,
+ "gap": 4,
+ "backgroundColor": "#16181d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 20,
+ "fontWeight": 600,
+ "color": "#fff",
+ "marginBottom": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Settings",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Name",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "editableText",
+ {
+ "data-testid": "name",
+ "style": {
+ "width": 180,
+ "padding": 6,
+ "borderRadius": 6,
+ "borderWidth": 1,
+ "borderColor": "#3f434c",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Shane"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Sound",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "aria-checked": false,
+ "data-testid": "sound",
+ "role": "switch",
+ "style": {
+ "width": 38,
+ "height": 22,
+ "borderRadius": 11,
+ "backgroundColor": "#3f434c",
+ "position": "relative"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "position": "absolute",
+ "top": 2,
+ "left": 2,
+ "width": 18,
+ "height": 18,
+ "borderRadius": 9,
+ "backgroundColor": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Dark",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "aria-checked": true,
+ "data-testid": "dark",
+ "role": "switch",
+ "style": {
+ "width": 38,
+ "height": 22,
+ "borderRadius": 11,
+ "backgroundColor": "#3b82f6",
+ "position": "relative"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "position": "absolute",
+ "top": 2,
+ "left": 18,
+ "width": 18,
+ "height": 18,
+ "borderRadius": 9,
+ "backgroundColor": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Text size",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 2,
+ "borderRadius": 6,
+ "backgroundColor": "#2a2d35",
+ "padding": 2
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "size-S",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "transparent",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "S",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "size-M",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "transparent",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "M",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "size-L",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "#4b5563",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "L",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "button",
+ {
+ "data-testid": "save",
+ "disabled": false,
+ "style": {
+ "marginTop": 12,
+ "padding": 10,
+ "borderRadius": 8,
+ "backgroundColor": "#3b82f6",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Save",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":5,\"set\":{\"value\":\"Shane \"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 420,
+ "padding": 20,
+ "gap": 4,
+ "backgroundColor": "#16181d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 20,
+ "fontWeight": 600,
+ "color": "#fff",
+ "marginBottom": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Settings",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Name",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "editableText",
+ {
+ "data-testid": "name",
+ "style": {
+ "width": 180,
+ "padding": 6,
+ "borderRadius": 6,
+ "borderWidth": 1,
+ "borderColor": "#3f434c",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Shane "
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Sound",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "aria-checked": false,
+ "data-testid": "sound",
+ "role": "switch",
+ "style": {
+ "width": 38,
+ "height": 22,
+ "borderRadius": 11,
+ "backgroundColor": "#3f434c",
+ "position": "relative"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "position": "absolute",
+ "top": 2,
+ "left": 2,
+ "width": 18,
+ "height": 18,
+ "borderRadius": 9,
+ "backgroundColor": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Dark",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "aria-checked": true,
+ "data-testid": "dark",
+ "role": "switch",
+ "style": {
+ "width": 38,
+ "height": 22,
+ "borderRadius": 11,
+ "backgroundColor": "#3b82f6",
+ "position": "relative"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "position": "absolute",
+ "top": 2,
+ "left": 18,
+ "width": 18,
+ "height": 18,
+ "borderRadius": 9,
+ "backgroundColor": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Text size",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 2,
+ "borderRadius": 6,
+ "backgroundColor": "#2a2d35",
+ "padding": 2
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "size-S",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "transparent",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "S",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "size-M",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "transparent",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "M",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "size-L",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "#4b5563",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "L",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "button",
+ {
+ "data-testid": "save",
+ "disabled": false,
+ "style": {
+ "marginTop": 12,
+ "padding": 10,
+ "borderRadius": 8,
+ "backgroundColor": "#3b82f6",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Save",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 2,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":5,\"set\":{\"value\":\"Shane B\"}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 420,
+ "padding": 20,
+ "gap": 4,
+ "backgroundColor": "#16181d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 20,
+ "fontWeight": 600,
+ "color": "#fff",
+ "marginBottom": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Settings",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Name",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "editableText",
+ {
+ "data-testid": "name",
+ "style": {
+ "width": 180,
+ "padding": 6,
+ "borderRadius": 6,
+ "borderWidth": 1,
+ "borderColor": "#3f434c",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Shane B"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Sound",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "aria-checked": false,
+ "data-testid": "sound",
+ "role": "switch",
+ "style": {
+ "width": 38,
+ "height": 22,
+ "borderRadius": 11,
+ "backgroundColor": "#3f434c",
+ "position": "relative"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "position": "absolute",
+ "top": 2,
+ "left": 2,
+ "width": 18,
+ "height": 18,
+ "borderRadius": 9,
+ "backgroundColor": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Dark",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "aria-checked": true,
+ "data-testid": "dark",
+ "role": "switch",
+ "style": {
+ "width": 38,
+ "height": 22,
+ "borderRadius": 11,
+ "backgroundColor": "#3b82f6",
+ "position": "relative"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "position": "absolute",
+ "top": 2,
+ "left": 18,
+ "width": 18,
+ "height": 18,
+ "borderRadius": 9,
+ "backgroundColor": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Text size",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 2,
+ "borderRadius": 6,
+ "backgroundColor": "#2a2d35",
+ "padding": 2
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "size-S",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "transparent",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "S",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "size-M",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "transparent",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "M",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "size-L",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "#4b5563",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "L",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "button",
+ {
+ "data-testid": "save",
+ "disabled": false,
+ "style": {
+ "marginTop": 12,
+ "padding": 10,
+ "borderRadius": 8,
+ "backgroundColor": "#3b82f6",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Save",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 3,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":27,\"text\":\"Saved\"},{\"op\":\"update\",\"id\":28,\"unset\":[\"tabIndex\"],\"set\":{\"disabled\":true,\"style\":{\"marginTop\":12,\"padding\":10,\"borderRadius\":8,\"backgroundColor\":\"#2a2d35\",\"color\":\"#6b7280\",\"fontSize\":14}}},{\"op\":\"unlisten\",\"id\":28,\"events\":[\"pointerdown\",\"pointerup\"]}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 420,
+ "padding": 20,
+ "gap": 4,
+ "backgroundColor": "#16181d"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 20,
+ "fontWeight": 600,
+ "color": "#fff",
+ "marginBottom": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Settings",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Name",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "editableText",
+ {
+ "data-testid": "name",
+ "style": {
+ "width": 180,
+ "padding": 6,
+ "borderRadius": 6,
+ "borderWidth": 1,
+ "borderColor": "#3f434c",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Shane B"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Sound",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "aria-checked": false,
+ "data-testid": "sound",
+ "role": "switch",
+ "style": {
+ "width": 38,
+ "height": 22,
+ "borderRadius": 11,
+ "backgroundColor": "#3f434c",
+ "position": "relative"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "position": "absolute",
+ "top": 2,
+ "left": 2,
+ "width": 18,
+ "height": 18,
+ "borderRadius": 9,
+ "backgroundColor": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Dark",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "aria-checked": true,
+ "data-testid": "dark",
+ "role": "switch",
+ "style": {
+ "width": 38,
+ "height": 22,
+ "borderRadius": 11,
+ "backgroundColor": "#3b82f6",
+ "position": "relative"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "position": "absolute",
+ "top": 2,
+ "left": 18,
+ "width": 18,
+ "height": 18,
+ "borderRadius": 9,
+ "backgroundColor": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Text size",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 2,
+ "borderRadius": 6,
+ "backgroundColor": "#2a2d35",
+ "padding": 2
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "size-S",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "transparent",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "S",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "size-M",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "transparent",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "M",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "size-L",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "#4b5563",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "L",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "button",
+ {
+ "data-testid": "save",
+ "disabled": true,
+ "style": {
+ "marginTop": 12,
+ "padding": 10,
+ "borderRadius": 8,
+ "backgroundColor": "#2a2d35",
+ "color": "#6b7280",
+ "fontSize": 14
+ }
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Saved",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ },
+ {
+ "step": 4,
+ "batch": "{\"v\":1,\"ops\":[{\"op\":\"update\",\"id\":2,\"set\":{\"style\":{\"fontSize\":20,\"fontWeight\":600,\"color\":\"#111\",\"marginBottom\":8}}},{\"op\":\"update\",\"id\":14,\"set\":{\"style\":{\"position\":\"absolute\",\"top\":2,\"left\":2,\"width\":18,\"height\":18,\"borderRadius\":9,\"backgroundColor\":\"#fff\"}}},{\"op\":\"update\",\"id\":15,\"set\":{\"aria-checked\":false,\"style\":{\"width\":38,\"height\":22,\"borderRadius\":11,\"backgroundColor\":\"#3f434c\",\"position\":\"relative\"}}},{\"op\":\"update\",\"id\":27,\"text\":\"Save\"},{\"op\":\"update\",\"id\":28,\"set\":{\"disabled\":false,\"tabIndex\":0,\"style\":{\"marginTop\":12,\"padding\":10,\"borderRadius\":8,\"backgroundColor\":\"#3b82f6\",\"color\":\"#fff\",\"fontSize\":14}}},{\"op\":\"listen\",\"id\":28,\"events\":[\"pointerdown\",\"pointerup\"]},{\"op\":\"update\",\"id\":29,\"set\":{\"style\":{\"display\":\"flex\",\"flexDirection\":\"column\",\"width\":420,\"padding\":20,\"gap\":4,\"backgroundColor\":\"#f7f7f8\"}}}]}",
+ "shape": [
+ "#root",
+ {},
+ null,
+ [
+ "pointerdown",
+ "pointermove",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "root",
+ "style": {
+ "display": "flex",
+ "flexDirection": "column",
+ "width": 420,
+ "padding": 20,
+ "gap": 4,
+ "backgroundColor": "#f7f7f8"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 20,
+ "fontWeight": 600,
+ "color": "#111",
+ "marginBottom": 8
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Settings",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Name",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "editableText",
+ {
+ "data-testid": "name",
+ "style": {
+ "width": 180,
+ "padding": 6,
+ "borderRadius": 6,
+ "borderWidth": 1,
+ "borderColor": "#3f434c",
+ "fontSize": 14
+ },
+ "tabIndex": 0,
+ "value": "Shane B"
+ },
+ null,
+ [
+ "blur",
+ "change",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Sound",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "aria-checked": false,
+ "data-testid": "sound",
+ "role": "switch",
+ "style": {
+ "width": 38,
+ "height": 22,
+ "borderRadius": 11,
+ "backgroundColor": "#3f434c",
+ "position": "relative"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "position": "absolute",
+ "top": 2,
+ "left": 2,
+ "width": 18,
+ "height": 18,
+ "borderRadius": 9,
+ "backgroundColor": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Dark",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "aria-checked": false,
+ "data-testid": "dark",
+ "role": "switch",
+ "style": {
+ "width": 38,
+ "height": 22,
+ "borderRadius": 11,
+ "backgroundColor": "#3f434c",
+ "position": "relative"
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "div",
+ {
+ "style": {
+ "position": "absolute",
+ "top": 2,
+ "left": 2,
+ "width": 18,
+ "height": 18,
+ "borderRadius": 9,
+ "backgroundColor": "#fff"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ []
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "alignItems": "center",
+ "justifyContent": "space-between",
+ "paddingTop": 10,
+ "paddingBottom": 10
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "span",
+ {
+ "style": {
+ "fontSize": 14,
+ "color": "#e5e7eb"
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Text size",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "style": {
+ "display": "flex",
+ "flexDirection": "row",
+ "gap": 2,
+ "borderRadius": 6,
+ "backgroundColor": "#2a2d35",
+ "padding": 2
+ }
+ },
+ null,
+ [
+ "pointerenter",
+ "pointerleave"
+ ],
+ [
+ [
+ "div",
+ {
+ "data-testid": "size-S",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "transparent",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "S",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "size-M",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "transparent",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "M",
+ [],
+ []
+ ]
+ ]
+ ],
+ [
+ "div",
+ {
+ "data-testid": "size-L",
+ "style": {
+ "paddingLeft": 10,
+ "paddingRight": 10,
+ "paddingTop": 4,
+ "paddingBottom": 4,
+ "borderRadius": 4,
+ "backgroundColor": "#4b5563",
+ "color": "#fff",
+ "fontSize": 13
+ }
+ },
+ null,
+ [
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "L",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ "button",
+ {
+ "data-testid": "save",
+ "disabled": false,
+ "style": {
+ "marginTop": 12,
+ "padding": 10,
+ "borderRadius": 8,
+ "backgroundColor": "#3b82f6",
+ "color": "#fff",
+ "fontSize": 14
+ },
+ "tabIndex": 0
+ },
+ null,
+ [
+ "blur",
+ "focus",
+ "keydown",
+ "keyup",
+ "pointerdown",
+ "pointerenter",
+ "pointerleave",
+ "pointerup"
+ ],
+ [
+ [
+ "text",
+ {},
+ "Save",
+ [],
+ []
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/engine/rune/tests/runeprops.rs b/engine/rune/tests/runeprops.rs
new file mode 100644
index 00000000..e30073cb
--- /dev/null
+++ b/engine/rune/tests/runeprops.rs
@@ -0,0 +1,64 @@
+//! R6a: @raea/rune's props and components (sdk/rune) drawn by the host: sdk/rune/examples/motion.tsx bundled and run.
+//! A toast enters on its transition while everything without Rune motion lands at once; the kit's components stand
+//! in for their DOM stand-ins; the switch's press reaches React; nothing is left unmapped.
+
+
+use raea_rune_host::js::App;
+
+mod common;
+
+
+fn info(app: &App, id: u64) -> rune::ElementInfo {
+ let k = raea_rune_host::session::Session::key_of(id);
+ app.session.rt.elements().into_iter().find(|e| e.key.as_deref() == Some(&k)).unwrap()
+}
+
+#[test]
+fn a_toast_enters_on_its_spring_and_the_rest_lands_at_once() {
+ let mut app = common::example("motion.tsx");
+ app.frame().unwrap();
+ let add = app.session.tid("add").unwrap();
+ app.input(|s| { let _ = s.click_el(add); }).unwrap();
+ let toast = app.session.tid("toast-1").expect("a toast");
+ // the frame it mounts: entering (pushed in from the top, fading), where a plain element would show whole
+ let first = info(&app, toast);
+ assert!(first.opacity < 0.9 || first.rect[1] < first.target[1] - 0.5, "entering: {first:?}");
+ let panel = app.session.tid("panel").unwrap();
+ assert!(info(&app, panel).opacity > 0.999, "the panel (no motion) whole");
+ for _ in 0..90 {
+ app.frame().unwrap();
+ }
+ let rest = info(&app, toast);
+ assert!(rest.opacity > 0.999 && (rest.rect[1] - rest.target[1]).abs() < 0.5, "at rest: {rest:?}");
+ assert!(app.session.rt.state.report.borrow().is_empty(), "{:?}", app.session.rt.state.report.borrow().all().collect::<Vec<_>>());
+}
+
+#[test]
+fn kit_components_stand_in_and_the_switch_reaches_react() {
+ let mut app = common::example("motion.tsx");
+ app.frame().unwrap();
+ let texts = |app: &App| app.session.rt.elements().into_iter().filter_map(|e| e.text).collect::<Vec<_>>();
+ assert!(texts(&app).iter().any(|t| t == "normal"), "the badge: {:?}", texts(&app));
+ let sw = app.session.rt.elements().into_iter().find(|e| e.role == "switch").expect("rune-kit's switch");
+ let r = raea_rune_host::session::shown(&sw);
+ app.input(|s| s.click(r[0] + r[2] / 2.0, r[1] + r[3] / 2.0)).unwrap();
+ for _ in 0..5 {
+ app.frame().unwrap();
+ }
+ assert!(texts(&app).iter().any(|t| t == "urgent"), "the badge after the switch: {:?}", texts(&app));
+}
+
+#[test]
+fn rolling_text_keeps_its_edge_padding_so_resting_glyphs_are_never_faded() {
+ // the span's own style once overwrote the kit's padding, leaving the glyphs in the fade (R8b, a 108 px total)
+ let mut app = common::example("motion.tsx");
+ for _ in 0..30 {
+ app.frame().unwrap();
+ }
+ let els = app.session.rt.elements();
+ let cells: Vec<_> = els.iter().filter(|e| e.key.as_deref().is_some_and(|k| k.starts_with("rolling-") && k.contains('.'))).collect();
+ let row = els.iter().find(|e| e.key.as_deref().is_some_and(|k| k.starts_with("rolling-") && !k.contains('.'))).expect("the rolling row");
+ assert!(!cells.is_empty(), "rolling cells");
+ let side = row.rect[0] + 0.5;
+ assert!(cells.iter().all(|c| c.rect[0] >= side), "glyphs inside the row's padding: row {:?}, first cell {:?}", row.rect, cells[0].rect);
+}
diff --git a/engine/rune/tests/tailwind.rs b/engine/rune/tests/tailwind.rs
new file mode 100644
index 00000000..e098fe7d
--- /dev/null
+++ b/engine/rune/tests/tailwind.rs
@@ -0,0 +1,54 @@
+//! R2c: Tailwind utilities resolve with Tailwind's own theme into the style props css.rs reads; inline style wins;
+//! utilities the host doesn't know are reported.
+
+use raea_rune_host::css::{Len, parse};
+use raea_rune_host::page::{Page, headless};
+use raea_rune_host::tailwind::style_in;
+use raea_rune_host::variants::State;
+
+fn style(class: &str) -> (serde_json::Map<String, serde_json::Value>, Vec<String>) {
+ style_in(class, &State::default())
+}
+use serde_json::json;
+
+#[test]
+fn utilities_resolve_with_the_theme() {
+ let (s, unknown) = style("flex flex-col items-center justify-between gap-4 px-3 py-1.5 w-1/2 h-full max-w-sm rounded-lg shadow-md bg-blue-500/50 text-sm font-semibold text-white border-b-2 border-gray-200 flex-1 overflow-y-auto");
+ assert!(unknown.is_empty(), "{unknown:?}");
+ assert_eq!(s["gap"], json!(16.0));
+ assert_eq!((s["paddingLeft"].clone(), s["paddingTop"].clone()), (json!(12.0), json!(6.0)));
+ assert_eq!(s["width"], json!("50%"));
+ assert_eq!(s["maxWidth"], json!(384.0));
+ assert_eq!((s["fontSize"].clone(), s["fontWeight"].clone()), (json!(14.0), json!(600.0)));
+ assert_eq!(s["borderRadius"], json!(8.0));
+ assert_eq!(s["borderBottomWidth"], json!(2.0));
+ let (c, bad) = parse(&s);
+ assert!(bad.is_empty(), "every prop the classes set is one css.rs reads: {bad:?}");
+ assert!((c.background.unwrap().a - 0.5).abs() < 1e-6, "the /50 modifier");
+ assert_eq!(c.line_height, Some(Len::Pct(1.25 / 0.875 * 100.0)));
+ assert_eq!(c.shadows.len(), 2);
+}
+
+#[test]
+fn unknown_utilities_come_back() {
+ let (_, unknown) = style("group-hover:bg-red-500 first:flex -mt-2 !p-4 space-x-2 tracking-wide p-4");
+ assert_eq!(unknown, ["group-hover:bg-red-500", "first:flex", "-mt-2", "!p-4", "space-x-2", "tracking-wide"]);
+}
+
+#[test]
+fn inline_style_wins_and_the_rest_is_reported() {
+ let mut page = Page::default();
+ page.apply(
+ r#"{"v":1,"ops":[{"op":"create","id":1,"kind":"div","props":{"className":"flex pl-8 p-2 w-10 group-hover:bg-red-500","style":{"padding":4,"width":30}}},
+ {"op":"create","id":2,"kind":"div","props":{"className":"size-4"}},{"op":"append","parent":0,"child":1},{"op":"append","parent":1,"child":2}]}"#,
+ )
+ .unwrap();
+ let mut rt = headless(page, (400.0, 300.0));
+ rt.frame(0.0);
+ let rect = |k: &str| rt.elements().into_iter().find(|e| e.key.as_deref() == Some(k)).unwrap().target;
+ // the inline padding (4) overrides the classes' pl-8 and p-2; the inline width (30) the class's w-10
+ assert_eq!(rect("w2"), [4.0, 4.0, 16.0, 16.0]);
+ assert_eq!(rect("w1")[2], 30.0);
+ let r = rt.state.report.borrow();
+ assert!(r.all().any(|(p, s)| p == "className" && s.value == "group-hover:bg-red-500"));
+}
diff --git a/engine/rune/tests/view.rs b/engine/rune/tests/view.rs
new file mode 100644
index 00000000..29c57b67
--- /dev/null
+++ b/engine/rune/tests/view.rs
@@ -0,0 +1,71 @@
+//! R2: each app of the R5 set, at the end of its recorded session, drawn by Rune headless: every wire element is a
+//! Rune element with a box, and what couldn't be mapped is reported, not dropped.
+
+use raea_rune_host::page::{Page, headless};
+use raea_rune_host::view::key;
+use serde_json::Value;
+
+const APPS: [&str; 5] = ["counter", "settings", "list", "cards", "chat"];
+
+fn replayed(app: &str, upto: Option<usize>) -> Page {
+ let path = format!("{}/tests/recorded/{app}.json", env!("CARGO_MANIFEST_DIR"));
+ let rec: Value = serde_json::from_str(&std::fs::read_to_string(path).unwrap()).unwrap();
+ let mut page = Page::default();
+ for f in rec["frames"].as_array().unwrap().iter().take(upto.unwrap_or(usize::MAX)) {
+ page.apply(f["batch"].as_str().unwrap()).unwrap();
+ }
+ page
+}
+
+#[test]
+fn every_element_is_drawn_and_the_rest_reported() {
+ for app in APPS {
+ let mut rt = headless(replayed(app, None), (800.0, 600.0));
+ rt.frame(0.0);
+ let els = rt.elements();
+ let page = &rt.state;
+ let mut missing = Vec::new();
+ let mut ids: Vec<u64> = Vec::new();
+ collect(&page.tree, 0, &mut ids);
+ for id in &ids {
+ let n = page.tree.get(*id).unwrap();
+ if n.kind == "text" {
+ continue;
+ }
+ if !els.iter().any(|e| e.key.as_deref() == Some(key(*id).as_str())) {
+ missing.push(format!("{} {}", n.kind, id));
+ }
+ }
+ assert!(missing.is_empty(), "{app}: no Rune element for {missing:?}");
+ let texts = els.iter().filter(|e| e.role == "text").count();
+ eprintln!("{app}: {} wire elements, {} Rune elements ({texts} texts)", ids.len(), els.len());
+ for (prop, s) in page.report.borrow().all() {
+ eprintln!(" unmapped {prop}: {} at {} ({})", s.value, s.path, s.why);
+ }
+ }
+}
+
+fn collect(t: &raea_rune_host::tree::Tree, id: u64, out: &mut Vec<u64>) {
+ out.push(id);
+ for c in &t.get(id).unwrap().children {
+ collect(t, *c, out);
+ }
+}
+
+#[test]
+fn an_image_draws_its_pixels_at_its_aspect() {
+ const PNG: &str = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==";
+ let mut page = Page::default();
+ let batch = format!(
+ r#"{{"v":1,"ops":[{{"op":"create","id":1,"kind":"img","props":{{"src":"data:image/png;base64,{PNG}","style":{{"width":40}}}}}},
+ {{"op":"create","id":2,"kind":"img","props":{{"src":"https://example.com/a.png"}}}},{{"op":"append","parent":0,"child":1}},{{"op":"append","parent":0,"child":2}}]}}"#
+ );
+ page.apply(&batch).unwrap();
+ page.images.get(&format!("data:image/png;base64,{PNG}")).unwrap().wait().unwrap();
+ let mut rt = headless(page, (400.0, 300.0));
+ rt.frame(0.0);
+ rt.frame(1.0 / 60.0);
+ let r = rt.elements().into_iter().find(|e| e.key.as_deref() == Some("w1")).unwrap().target;
+ assert_eq!([r[2], r[3]], [40.0, 40.0], "the height from the image's 1:1 aspect");
+ assert!(rt.state.report.borrow().all().any(|(p, s)| p == "img src" && s.value.starts_with("https://")), "an http src is reported");
+}
diff --git a/engine/sandbox/wsx/Cargo.lock b/engine/sandbox/wsx/Cargo.lock
index 0eb0faa4..c0aa6d6f 100644
--- a/engine/sandbox/wsx/Cargo.lock
+++ b/engine/sandbox/wsx/Cargo.lock
@@ -171,27 +171,27 @@ dependencies = [
[[package]]
name = "cranelift-assembler-x64"
-version = "0.135.7"
+version = "0.135.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6071a4f1df4837aa03d1e4d53067784acafe270ffc7dad66a7f39832204da3f"
+checksum = "10c7459262c93a3c408bda96acaaa3d92868f166b33d445b20921f8378325038"
dependencies = [
"cranelift-assembler-x64-meta",
]
[[package]]
name = "cranelift-assembler-x64-meta"
-version = "0.135.7"
+version = "0.135.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e3b92a9cc90388fe70e63640af30b734387449445aef0176ab2028e9892d70e"
+checksum = "97a25bfba0da265ef1f98728358e9bb3ab7489913e7bd759c743108892288934"
dependencies = [
"cranelift-srcgen",
]
[[package]]
name = "cranelift-bforest"
-version = "0.135.7"
+version = "0.135.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f45c85646c4425cc85b868effaf20c302b437a3fb79bb27a64513dd522f07411"
+checksum = "32a9ad33269057337a70db66950f426fbdce436a66fe8071f55851a13a2e40cd"
dependencies = [
"cranelift-entity",
"wasmtime-internal-core",
@@ -199,9 +199,9 @@ dependencies = [
[[package]]
name = "cranelift-bitset"
-version = "0.135.7"
+version = "0.135.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94f56b5c7d564cfa03aa269a6b98c916cab4d545196a391d31403a23ef39333a"
+checksum = "d322e6584efe3b229b1164b49edf55aec561553426f7fe3e228a45e80a15a190"
dependencies = [
"serde",
"serde_derive",
@@ -210,9 +210,9 @@ dependencies = [
[[package]]
name = "cranelift-codegen"
-version = "0.135.7"
+version = "0.135.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c073641ce6e382814a8220331cc1ea2c782a9ea5d5da6d0f7f7c0541192693e"
+checksum = "6a7b9f73f97da69d6edc9adbfeec068cdb2649f0221be41abd3909267cb1cd53"
dependencies = [
"bumpalo",
"cranelift-assembler-x64",
@@ -241,9 +241,9 @@ dependencies = [
[[package]]
name = "cranelift-codegen-meta"
-version = "0.135.7"
+version = "0.135.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db226fafea5194921de10dccf35ac2863500313990f770cbe8b26c51eebec4d4"
+checksum = "e7015ef10993d7129e0bce933874b60dab8187239aca4ceca352987d9907d528"
dependencies = [
"cranelift-assembler-x64-meta",
"cranelift-codegen-shared",
@@ -254,24 +254,24 @@ dependencies = [
[[package]]
name = "cranelift-codegen-shared"
-version = "0.135.7"
+version = "0.135.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf8ac46b2c8e328ca979810426ea635ef90ecc8c54fd3296bde31ab470a48a1d"
+checksum = "37916b08a7b17e063bae743cb746da542df7df283ced961aae213620dc11e27a"
[[package]]
name = "cranelift-control"
-version = "0.135.7"
+version = "0.135.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6754e0ab97915209ea6ce6549f6443b018e1338142ada4c856cec213ee82e4b8"
+checksum = "8154d189f2cc2a84a95a8129773799ddcf2f4609f667047db30715db4be6aa0a"
dependencies = [
"arbitrary",
]
[[package]]
name = "cranelift-entity"
-version = "0.135.7"
+version = "0.135.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "774d25e36df18696f63a284e9c4ea43455e2ebcca6308e0e02301f18c8e777e2"
+checksum = "ccbd0c43e96db753f44a84e44f680f9423ed0a475b81f301ba7c44b5db52c37b"
dependencies = [
"cranelift-bitset",
"serde",
@@ -281,9 +281,9 @@ dependencies = [
[[package]]
name = "cranelift-frontend"
-version = "0.135.7"
+version = "0.135.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69cfcb31405e2de2a48e5a6de8e07a3d8b77f35caa3e944d627780734b36c138"
+checksum = "5b28ae2961cdda7a6814431b40e87bee46e57b7f92294467b32f447108e14674"
dependencies = [
"cranelift-codegen",
"hashbrown 0.17.1",
@@ -294,15 +294,15 @@ dependencies = [
[[package]]
name = "cranelift-isle"
-version = "0.135.7"
+version = "0.135.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f5a26df22db546ab92be6feaf21835ae91082af0a32bbb398b277df3765412f"
+checksum = "41eef45b50970e024d673e3fc4a0703e4fee75ca31d63b26566eb0f142300179"
[[package]]
name = "cranelift-native"
-version = "0.135.7"
+version = "0.135.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "19f258c08e590f90dcaf9904d25ba142ee2980c3aaeac4bb45f1452b1a407c2a"
+checksum = "649c7b9ad93d5d92287fee74608cacfb139602116293a46e2f25e6ea5402f05c"
dependencies = [
"cranelift-codegen",
"libc",
@@ -311,9 +311,9 @@ dependencies = [
[[package]]
name = "cranelift-srcgen"
-version = "0.135.7"
+version = "0.135.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67055b4f315e8f6af3e8eccec74ad38f7407f0fd854adbd49b4b3b27bdb2e3be"
+checksum = "da04416d8e400ad7ae6d9722db72bfbddfbf36d0ff528ec422c4cc336621a172"
[[package]]
name = "crc32fast"
@@ -875,9 +875,9 @@ dependencies = [
[[package]]
name = "pulley-interpreter"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b8187c8e7db87d085865fc106502e7b34d5c25f8ce4c272945b21503371f6a0"
+checksum = "4e6d73adcf2f76b98d3de7a31831b6d6436fd2b6518e0ad4f7cc722a12ad4133"
dependencies = [
"cranelift-bitset",
"log",
@@ -887,9 +887,9 @@ dependencies = [
[[package]]
name = "pulley-macros"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f98ce0e381d9e45e63ea1d20bba3cf131797086077f43af9203f1fb7de0ed6b"
+checksum = "5bde547f939ab9aa321a54c6694aef2e1e27741c2523c0627ff306677b3cbcff"
dependencies = [
"proc-macro2",
"quote",
@@ -1338,9 +1338,9 @@ dependencies = [
[[package]]
name = "wasmtime"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12300d040e8bea7e7ccde75b9919d27ebba47a217a64b09ba058ae8d3b4290b6"
+checksum = "a2afcadb2e7d0417cb8f3f322c66eff49338b288f22290c0ca0bd3e9570732aa"
dependencies = [
"addr2line",
"async-trait",
@@ -1379,9 +1379,9 @@ dependencies = [
[[package]]
name = "wasmtime-environ"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "805d6554eb6dd6e62891061a31383a89d69fd891f785e5ae68f0835a554b7a2a"
+checksum = "2de252f4aedfff6c2054ea5bea2454878a931c56e2553c6356b581e5e30a7e4e"
dependencies = [
"anyhow",
"cpp_demangle",
@@ -1410,9 +1410,9 @@ dependencies = [
[[package]]
name = "wasmtime-internal-component-macro"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b832b80853365d9d3a741681044554be291a4f977aae074b318b55c7a4835f83"
+checksum = "14127b0c5d6e543fa0b90747df60b3f96af499df8570f829acb7b8e2a98faa85"
dependencies = [
"anyhow",
"proc-macro2",
@@ -1425,15 +1425,15 @@ dependencies = [
[[package]]
name = "wasmtime-internal-component-util"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c8a11aaf68d8945991429d45950f32490a30ddcdcdb56629816cb41a255d8fe"
+checksum = "e5ad52499e6246d30bf8bf509506bd637248eee17c8dd623e0c7dbe43e7a1036"
[[package]]
name = "wasmtime-internal-core"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ea266d6cfb31c324c075c8432386654bcbb1559aa8d29be9d47eacf7dcc41012"
+checksum = "d8838d7debfc98a69342d260a990ea6f64adf498184915fccfdbd6718bb40a9b"
dependencies = [
"hashbrown 0.17.1",
"libm",
@@ -1442,9 +1442,9 @@ dependencies = [
[[package]]
name = "wasmtime-internal-cranelift"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d427759553b07c296c8ed7bff8ac930a94b9ba99e6a79243ea79bcc51aa58d96"
+checksum = "478c09af53c545d96227b349d35c70fc78e99816923f41428ffff00974bcd145"
dependencies = [
"cranelift-codegen",
"cranelift-control",
@@ -1468,9 +1468,9 @@ dependencies = [
[[package]]
name = "wasmtime-internal-fiber"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b54c8c5b02ea985149a90f917e1761af99734c6c27e6d7fdd5b6f69fc1db3950"
+checksum = "96dce7a8ea302c0f1eb4154eb1756525c90c595bbabbc590abad64d4c5ff8bbb"
dependencies = [
"cc",
"libc",
@@ -1482,9 +1482,9 @@ dependencies = [
[[package]]
name = "wasmtime-internal-jit-debug"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72bb10c94724f072b6eca515085033e61da9efae65d054545126df37a15530c3"
+checksum = "895f3231b24ce0c12c8a7bb129a9f6ddc6772ec78e59748e53af743dcdd733d1"
dependencies = [
"cc",
"wasmtime-internal-versioned-export-macros",
@@ -1492,9 +1492,9 @@ dependencies = [
[[package]]
name = "wasmtime-internal-jit-icache-coherence"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b781a27e8958fd07fd3135c0be216f77301efecd15cbf4f14ff210cdad5f169"
+checksum = "28b60a0c1f735da6b862679b763f8bab653caa477ccc603a25752488b795fec5"
dependencies = [
"libc",
"wasmtime-internal-core",
@@ -1503,9 +1503,9 @@ dependencies = [
[[package]]
name = "wasmtime-internal-unwinder"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "121188de1b2741b8e35530a9b0c8adf525b3aa5913a2ca3d4522509cfbc0494a"
+checksum = "b97b2c29c8f458bdf1b948058bfbb8141aad0f7abcf0f7cb3479866f4316bf3c"
dependencies = [
"cranelift-codegen",
"log",
@@ -1515,9 +1515,9 @@ dependencies = [
[[package]]
name = "wasmtime-internal-versioned-export-macros"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "933f1990e4e5177547a4abd51dcfa5cb7616fe42b9fb6f0f2b7423627758223c"
+checksum = "32766b38d56927eca9a65858ea8c7b1803424db82562aafd69727aa970057561"
dependencies = [
"proc-macro2",
"quote",
@@ -1526,9 +1526,9 @@ dependencies = [
[[package]]
name = "wasmtime-internal-wit-bindgen"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "417ebd61d2581d86d65413517f3a41294a9ad105da26f0dc7039912a0d97e1ed"
+checksum = "407a8c055545e5c4c6c942237d934c9906cd995639a17af89f3368f0a05534eb"
dependencies = [
"anyhow",
"bitflags",
@@ -1540,9 +1540,9 @@ dependencies = [
[[package]]
name = "wasmtime-wasi"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ef0d3ec88f9406bc5e498848489c49ff515577500acc9f03fa93d0883dce435"
+checksum = "a678afa77874a2d6eed071852f7777ccd77495e0bfbc30f7b8089e1d00b2485f"
dependencies = [
"async-trait",
"bitflags",
@@ -1565,9 +1565,9 @@ dependencies = [
[[package]]
name = "wasmtime-wasi-io"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe7dfc924e222e15455bd6d445ff7065a4595fffc7698c7bbc01acc0ed6c0421"
+checksum = "0879bd441bddd61e1c15cc5f39ec297de8ee34ffc12f5459aad3b7ab6afcf510"
dependencies = [
"async-trait",
"bytes",
@@ -1587,9 +1587,9 @@ dependencies = [
[[package]]
name = "wiggle"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f25221922f042ed78c7857a29f2e54d45d02a73891bcc3a046f2c3c0400cfd3"
+checksum = "17e5cc50b6407d17fdf61e3d4801ea3420356a6892b7cac3a99def3448d5bda9"
dependencies = [
"bitflags",
"thiserror 2.0.21",
@@ -1601,9 +1601,9 @@ dependencies = [
[[package]]
name = "wiggle-generate"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e9ad83cd72263fd94189bdbf3bf37dc131f6a293ff639cebfbb00ed3f21f05f2"
+checksum = "3de41de3f5e1b312a71580b9004eff11ba0a99138aa9e29933b6b5598ebb157d"
dependencies = [
"heck",
"proc-macro2",
@@ -1615,9 +1615,9 @@ dependencies = [
[[package]]
name = "wiggle-macro"
-version = "48.0.7"
+version = "48.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96820f65b0f61bad3e6dd073f670db9a6da537dc71f848fee715f692b19dfd9a"
+checksum = "7ad3b2bd32e9c3066a3fd6da46fc408113edebecc265690ad4653383f728fab9"
dependencies = [
"proc-macro2",
"quote",
diff --git a/engine/sandbox/wsx/Cargo.toml b/engine/sandbox/wsx/Cargo.toml
index eb104878..44d106cf 100644
--- a/engine/sandbox/wsx/Cargo.toml
+++ b/engine/sandbox/wsx/Cargo.toml
@@ -14,8 +14,8 @@ name = "wsx-suite"
# the Mac's compiler: modules compiled ahead of time for Pulley (the phone has no compiler and no JIT)
compile = ["wasmtime/cranelift"]
[dependencies]
-wasmtime = { version = "48.0.5", default-features = false, features = ["runtime", "pulley", "std"] }
-wasmtime-wasi = { version = "48.0.5", default-features = false, features = ["p1"] }
+wasmtime = { version = "48.0.8", default-features = false, features = ["runtime", "pulley", "std"] }
+wasmtime-wasi = { version = "48.0.8", default-features = false, features = ["p1"] }
serde_json = "1"
# the one native-call layer (its registry; no V8 here): the sandbox's commands as wsx.* calls
raea-core-calls = { path = "../../../core/calls" }
diff --git a/engine/shape-web/Cargo.toml b/engine/shape-web/Cargo.toml
new file mode 100644
index 00000000..73e0546d
--- /dev/null
+++ b/engine/shape-web/Cargo.toml
@@ -0,0 +1,14 @@
+[package]
+name = "raea-shape-web"
+version = "0.1.0"
+edition = "2024"
+license = "FSL-1.1-ALv2"
+publish = false
+description = "raea's shapes in a browser (docs/r3f.feature R3F5): core/shape's CSG expressions meshed by the same code the native engine runs, for three.js and React Three Fiber"
+
+[lib]
+crate-type = ["cdylib", "rlib"]
+
+[dependencies]
+raea-core-shape = { path = "../../core/shape" }
+wasm-bindgen = "0.2.129"
diff --git a/engine/shape-web/src/lib.rs b/engine/shape-web/src/lib.rs
new file mode 100644
index 00000000..67ae3ce4
--- /dev/null
+++ b/engine/shape-web/src/lib.rs
@@ -0,0 +1,33 @@
+//! raea's shapes for a browser (docs/r3f.feature R3F5): a part's `data-shape` (a CSG expression of core/shape's
+//! language: box, sphere, minus, hull, extrude, text3d ...) meshed by core/shape itself, so three.js draws the triangles
+//! raea's engine draws. The answer is one Float32Array: the vertex count, then x, y, z of each vertex (three a
+//! triangle), then each vertex's normal.
+use wasm_bindgen::prelude::*;
+
+/// The mesh of a shape expression: [n, positions (3n), normals (3n)]
+#[wasm_bindgen]
+pub fn mesh(expr: &str) -> Result<Vec<f32>, JsValue> {
+ let t = raea_core_shape::cached(expr).map_err(|e| JsValue::from_str(&e))?;
+ Ok(pack(&t.positions, &t.normals))
+}
+
+fn pack(positions: &[[f32; 3]], normals: &[[f32; 3]]) -> Vec<f32> {
+ let mut out = Vec::with_capacity(1 + 6 * positions.len());
+ out.push(positions.len() as f32);
+ out.extend(positions.iter().flatten());
+ out.extend(normals.iter().flatten());
+ out
+}
+
+#[cfg(test)]
+mod tests {
+ #[test]
+ fn a_box_is_twelve_triangles_with_its_normals_after_its_positions() {
+ let t = raea_core_shape::cached("box(1, 2, 3)").unwrap();
+ let out = super::pack(&t.positions, &t.normals);
+ assert_eq!(out[0] as usize, 36);
+ assert_eq!(out.len(), 1 + 36 * 6);
+ let ys: Vec<f32> = out[1..1 + 108].chunks(3).map(|p| p[1]).collect();
+ assert!(ys.iter().all(|y| (y.abs() - 1.0).abs() < 1e-5), "{ys:?}");
+ }
+}
diff --git a/io/assets/Cargo.toml b/io/assets/Cargo.toml
index 96e01281..94b1b054 100644
--- a/io/assets/Cargo.toml
+++ b/io/assets/Cargo.toml
@@ -12,4 +12,4 @@ serde_json = "1"
sha2 = "0.10"
image = { version = "0.25", default-features = false, features = ["png"] }
# mesh sequences' frames (meshseq.rs): zstd, the decoder Bevy's ktx2 already links
-ruzstd = "0.8"
+ruzstd = "0.9"
diff --git a/io/home/src/lib.rs b/io/home/src/lib.rs
index c5851281..93a6d12e 100644
--- a/io/home/src/lib.rs
+++ b/io/home/src/lib.rs
@@ -13,7 +13,7 @@ pub fn home() -> std::path::PathBuf {
if let Some(h) = std::env::var_os("RAEA_HOME").filter(|v| !v.is_empty()) {
return std::path::PathBuf::from(h);
}
- let installed = std::env::current_exe().ok().and_then(|e| e.canonicalize().ok()).and_then(|e| e.parent()?.parent().map(|p| p.join("share/raea")));
+ let installed = std::env::current_exe().ok().and_then(|e| e.canonicalize().ok()).map(plain).and_then(|e| e.parent()?.parent().map(|p| p.join("share/raea")));
if let Some(d) = installed.filter(|d| d.join("sdk/raea/src").is_dir()) {
return d;
}
@@ -22,11 +22,27 @@ pub fn home() -> std::path::PathBuf {
return std::path::PathBuf::from("/nonexistent/raea");
}
let tree = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../..");
- tree.canonicalize().unwrap_or(tree)
+ tree.canonicalize().map(plain).unwrap_or(tree)
})
.clone()
}
+/// A path without the verbatim `\\?\` prefix Windows' canonicalize() puts before a drive path: Rolldown's resolver
+/// can't open an import that starts with it, so `raea play` couldn't bundle a game (the lite entry imports bevy-react's
+/// bridge.ts by its path under home()), and raea-bundle's resolver names modules without it (engine/bundle/src/edit.rs). Any
+/// other path, a `\\?\UNC\` one included, is kept as it is.
+pub fn plain(p: std::path::PathBuf) -> std::path::PathBuf {
+ match p.to_str().and_then(drive) {
+ Some(r) => r.into(),
+ None => p,
+ }
+}
+
+/// a verbatim drive path's plain form (`\\?\C:\x` is `C:\x`); None for any other path
+fn drive(s: &str) -> Option<&str> {
+ s.strip_prefix(r"\\?\").filter(|r| r.as_bytes().get(1) == Some(&b':'))
+}
+
/// raea's per-user cache folder: ~/Library/Caches/raea on macOS, $XDG_CACHE_HOME/raea (~/.cache/raea by default)
/// elsewhere on Unix, %LOCALAPPDATA%\raea\cache on Windows. None when that platform's home isn't set.
pub fn caches() -> Option<std::path::PathBuf> {
@@ -86,7 +102,7 @@ fn src_on(s: &str, windows: bool) -> String {
if !windows {
return s.to_string();
}
- let s = s.strip_prefix(r"\\?\").filter(|r| r.as_bytes().get(1) == Some(&b':')).unwrap_or(s);
+ let s = drive(s).unwrap_or(s);
if s.as_bytes().get(1) == Some(&b':') { format!("file:///{}", s.replace('\\', "/")) } else { s.to_string() }
}
@@ -100,6 +116,19 @@ mod tests {
assert_eq!(super::src_on("assets/m.png", true), "assets/m.png");
}
+ #[test]
+ fn home_is_no_verbatim_path() {
+ use std::path::PathBuf;
+ assert_eq!(super::plain(PathBuf::from(r"\\?\C:\github\raea")), PathBuf::from(r"C:\github\raea"));
+ assert_eq!(super::plain(PathBuf::from(r"\\?\UNC\server\share")), PathBuf::from(r"\\?\UNC\server\share"));
+ assert_eq!(super::plain(PathBuf::from("/Users/a/raea")), PathBuf::from("/Users/a/raea"));
+ // the tree a test build came from, canonicalized: on Windows that added \\?\ before
+ if std::env::var_os("RAEA_HOME").is_none() {
+ let home = super::home().display().to_string();
+ assert!(!home.starts_with(r"\\?\"), "{home}");
+ }
+ }
+
#[test]
fn caches_and_logs_follow_the_platform() {
// one test, so nothing else reads these variables while it sets them
diff --git a/io/media/src/lib.rs b/io/media/src/lib.rs
index b24609d5..d6e6e839 100644
--- a/io/media/src/lib.rs
+++ b/io/media/src/lib.rs
@@ -56,6 +56,13 @@ pub fn backends() -> Vec<Box<dyn Backend>> {
v
}
+/// Whether this build's encoders sign what they write (Content Credentials): raea's own build does, the public engine
+/// doesn't, and a report says which (docs/targets.feature T1e)
+pub const SIGNS: bool = signs();
+const fn signs() -> bool {
+ false
+}
+
/// The backends to try for a file, in order: RAEA_MEDIA's, the platform's, the portable one, then the ffmpeg CLI
/// (which reads what the others don't: VP9 WebM).
diff --git a/io/net/calls/Cargo.toml b/io/net/calls/Cargo.toml
new file mode 100644
index 00000000..791cbb56
--- /dev/null
+++ b/io/net/calls/Cargo.toml
@@ -0,0 +1,18 @@
+[package]
+name = "raea-io-net-calls"
+version = "0.1.0"
+edition = "2024"
+license = "FSL-1.1-ALv2"
+publish = false
+description = "The net.* host calls (fetch, WebSockets, storage) both app targets answer: Bevy-free, keyed by the calling root"
+
+[dependencies]
+# the network under them, and the wire's host event a socket's news comes back as
+raea-io-net = { path = "..", features = ["ws"] }
+raea-core-wire = { path = "../../../core/wire" }
+serde_json = "1"
+# serve.rs: T2b's recorded calls and the local servers they're made against, for each target's test
+tungstenite = { version = "0.30", optional = true }
+
+[features]
+serve = ["dep:tungstenite"]
diff --git a/io/net/calls/recorded/net.js b/io/net/calls/recorded/net.js
new file mode 100644
index 00000000..fe94a88d
--- /dev/null
+++ b/io/net/calls/recorded/net.js
@@ -0,0 +1,41 @@
+// T2b's recorded calls (io/net/calls serve.rs): made in order, each answer and each socket event kept, then the
+// whole record logged as "recorded JSON" and emitted as `recorded`. Plain script, no wire.ts: it speaks the wire's
+// __ui_call and __ui_deliver itself, so both targets run exactly this.
+(() => {
+ const log = [];
+ const waiting = {};
+ let next = 1;
+ const call = (name, args, then) => {
+ const id = next++;
+ waiting[id] = (m) => {
+ log.push({ call: name, ok: m.ok, value: m.ok ? m.value : m.error });
+ if (then) then(m);
+ };
+ __ui_call(id, name, JSON.stringify(args));
+ };
+ const done = () => {
+ const s = JSON.stringify(log);
+ console.log("recorded " + s);
+ __ui_emit("recorded", s);
+ };
+ const ws = (e) => {
+ log.push({ event: "net.ws", value: e });
+ if (e.ev === "open") call("net.ws.send", { id: 1, data: "hi" });
+ else if (e.ev === "message") call("net.ws.close", { id: 1, code: 1000, reason: "bye" });
+ else if (e.ev === "close") done();
+ };
+ const before = globalThis.__ui_deliver;
+ globalThis.__ui_deliver = (json) => {
+ const m = JSON.parse(json);
+ if (m.t === "answer" && waiting[m.id]) {
+ const f = waiting[m.id];
+ delete waiting[m.id];
+ return f(m);
+ }
+ if (m.t === "named" && m.name === "net.ws") return ws(m.value);
+ if (before) before(json);
+ };
+ call("net.fetch", { url: "%HTTP%/hello", method: "GET", headers: [], body: null, redirect: "follow" }, () =>
+ call("net.storage.set", { area: "t2b", change: { k: "a", v: "1" } }, () =>
+ call("net.storage.get", { area: "t2b" }, () => call("net.ws.open", { id: 1, url: "%WS%", protocols: [] }))));
+})();
diff --git a/io/net/calls/recorded/net.json b/io/net/calls/recorded/net.json
new file mode 100644
index 00000000..b92723fe
--- /dev/null
+++ b/io/net/calls/recorded/net.json
@@ -0,0 +1,80 @@
+[
+ {
+ "call": "net.fetch",
+ "ok": true,
+ "value": {
+ "body": "aGVsbG8=",
+ "headers": [
+ [
+ "content-type",
+ "text/plain"
+ ],
+ [
+ "content-length",
+ "5"
+ ],
+ [
+ "connection",
+ "close"
+ ]
+ ],
+ "redirected": false,
+ "status": 200,
+ "statusText": "OK",
+ "url": "HTTP/hello"
+ }
+ },
+ {
+ "call": "net.storage.set",
+ "ok": true,
+ "value": null
+ },
+ {
+ "call": "net.storage.get",
+ "ok": true,
+ "value": {
+ "a": "1"
+ }
+ },
+ {
+ "call": "net.ws.open",
+ "ok": true,
+ "value": null
+ },
+ {
+ "event": "net.ws",
+ "value": {
+ "ev": "open",
+ "id": 1,
+ "protocol": ""
+ }
+ },
+ {
+ "call": "net.ws.send",
+ "ok": true,
+ "value": null
+ },
+ {
+ "event": "net.ws",
+ "value": {
+ "data": "hi",
+ "ev": "message",
+ "id": 1
+ }
+ },
+ {
+ "call": "net.ws.close",
+ "ok": true,
+ "value": null
+ },
+ {
+ "event": "net.ws",
+ "value": {
+ "clean": true,
+ "code": 1000,
+ "ev": "close",
+ "id": 1,
+ "reason": "bye"
+ }
+ }
+]
diff --git a/io/net/calls/src/lib.rs b/io/net/calls/src/lib.rs
new file mode 100644
index 00000000..96e8ae28
--- /dev/null
+++ b/io/net/calls/src/lib.rs
@@ -0,0 +1,121 @@
+//! The net.* host calls under @raea/ui's platform layer (fetch, WebSocket and localStorage, sdk/ui/src/platform.ts),
+//! answered the same on both app targets (docs/targets.feature T2a, whose call surface lists them): the web target's
+//! runtime/js net.rs and the native host's js.rs each hand a call here with the root that made it and how to answer.
+//! Nothing here knows Bevy or Rune: a root is whatever key its host gives it (an Entity on web, the page on native).
+//!
+//! net.fetch {url, method, headers: [[k, v]], body: base64 | null, redirect: "follow" | "error" | "manual"}
+//! -> {status, statusText, headers: [[k, v]], body: base64, url, redirected}; a network failure is refused
+//! net.ws.open {id, url, protocols} a socket on a thread of its own; what happens to it comes back as the host
+//! event `net.ws` {id, ev: "open" | "message" | "close", ...}
+//! net.ws.send {id, data, binary?} text, or base64 bytes
+//! net.ws.close {id, code, reason}
+//! net.storage.get {area} -> {k: v} localStorage kept across runs, in $BEVY_TSX_STORAGE/<area>.json; without
+//! net.storage.set {area, change} that variable these are refused and storage stays in the page's memory
+//!
+//! fetch and the sockets (raea-io-net's http and ws) block on threads of their own, never the caller's frame.
+
+use std::collections::HashMap;
+use std::hash::Hash;
+use std::path::PathBuf;
+use std::sync::mpsc::{Sender, channel};
+use std::sync::{Arc, Mutex};
+
+use raea_io_net::ws::Cmd;
+use serde_json::{Value, json};
+
+/// Every call this crate answers.
+pub const CALLS: [&str; 6] = ["net.fetch", "net.ws.open", "net.ws.send", "net.ws.close", "net.storage.get", "net.storage.set"];
+
+/// A call's answer, once, from any thread.
+pub type Done = Box<dyn FnOnce(Result<Value, String>) + Send>;
+/// A host event for a root (the wire's `named` message, `net.ws`).
+pub type Push<K> = Arc<dyn Fn(K, Value) + Send + Sync>;
+
+/// The calls' state, shared by every root of a host: the open sockets, by root and the page's id for each.
+pub struct Net<K> {
+ sockets: Arc<Mutex<HashMap<(K, u64), Sender<Cmd>>>>,
+ push: Push<K>,
+}
+
+impl<K> Clone for Net<K> {
+ fn clone(&self) -> Self {
+ Net { sockets: self.sockets.clone(), push: self.push.clone() }
+ }
+}
+
+impl<K: Copy + Eq + Hash + Send + 'static> Net<K> {
+ pub fn new(push: Push<K>) -> Net<K> {
+ Net { sockets: Arc::default(), push }
+ }
+
+ /// `name` (one of CALLS) from `root` with `args`, answered through `done`, now or from a thread of its own.
+ pub fn call(&self, root: K, name: &str, args: Value, done: Done) {
+ match name {
+ "net.fetch" => {
+ std::thread::spawn(move || done(raea_io_net::http::fetch(&args)));
+ }
+ "net.ws.open" => {
+ let id = args["id"].as_u64().unwrap_or(0);
+ let (tx, rx) = channel();
+ self.sockets.lock().unwrap().insert((root, id), tx);
+ let (push, sockets) = (self.push.clone(), self.sockets.clone());
+ std::thread::spawn(move || {
+ raea_io_net::ws::run(&args, rx, &|ev: Value| {
+ let mut m = ev;
+ m["id"] = json!(id);
+ push(root, raea_core_wire::named("net.ws", m));
+ });
+ sockets.lock().unwrap().remove(&(root, id));
+ });
+ done(Ok(Value::Null));
+ }
+ "net.ws.send" | "net.ws.close" => {
+ let cmd = if name == "net.ws.send" {
+ Cmd::Send { data: args["data"].as_str().unwrap_or("").to_string(), binary: args["binary"] == json!(true) }
+ } else {
+ Cmd::Close(args["code"].as_u64().unwrap_or(1000) as u16, args["reason"].as_str().unwrap_or("").to_string())
+ };
+ let key = (root, args["id"].as_u64().unwrap_or(0));
+ done(match self.sockets.lock().unwrap().get(&key) {
+ Some(tx) if tx.send(cmd).is_ok() => Ok(Value::Null),
+ _ => Err("no such socket".into()),
+ });
+ }
+ "net.storage.get" => done(get(&args)),
+ "net.storage.set" => done(set(&args)),
+ _ => done(Err(format!("{name} isn't a net call"))),
+ }
+ }
+}
+
+const NO_STORE: &str = "no storage (BEVY_TSX_STORAGE isn't set)";
+
+fn get(args: &Value) -> Result<Value, String> {
+ let p = store(args).ok_or(NO_STORE)?;
+ Ok(std::fs::read_to_string(p).ok().and_then(|t| serde_json::from_str(&t).ok()).unwrap_or(json!({})))
+}
+
+fn set(args: &Value) -> Result<Value, String> {
+ let p = store(args).ok_or(NO_STORE)?;
+ let mut m: serde_json::Map<String, Value> = std::fs::read_to_string(&p).ok().and_then(|t| serde_json::from_str(&t).ok()).unwrap_or_default();
+ let c = &args["change"];
+ if c["clear"] == json!(true) {
+ m.clear();
+ } else if let Some(k) = c["k"].as_str() {
+ match c["v"].as_str() {
+ Some(v) => m.insert(k.to_string(), json!(v)),
+ None => m.remove(k),
+ };
+ }
+ let _ = std::fs::create_dir_all(p.parent().unwrap_or(std::path::Path::new(".")));
+ std::fs::write(&p, Value::Object(m).to_string()).map(|()| Value::Null).map_err(|e| e.to_string())
+}
+
+fn store(args: &Value) -> Option<PathBuf> {
+ let dir = std::env::var_os("BEVY_TSX_STORAGE")?;
+ let area = args["area"].as_str().filter(|a| a.chars().all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '_'))?;
+ Some(PathBuf::from(dir).join(format!("{area}.json")))
+}
+
+#[cfg(feature = "serve")]
+pub mod serve;
diff --git a/io/net/calls/src/serve.rs b/io/net/calls/src/serve.rs
new file mode 100644
index 00000000..9d4c8ae7
--- /dev/null
+++ b/io/net/calls/src/serve.rs
@@ -0,0 +1,75 @@
+//! T2b's recorded set of calls (docs/targets.feature), for each target's test: a local HTTP server and WebSocket echo,
+//! the script that makes the calls (recorded/net.js: a fetch, storage set and get, a socket's open, send and close)
+//! and the answers both targets must give (recorded/net.json). A test runs `script` in its host, reads what it
+//! recorded (logged as `recorded JSON` and emitted as `recorded`) and checks it with `check`.
+
+use std::io::{Read, Write};
+use std::net::TcpListener;
+
+use serde_json::Value;
+
+/// The script, its servers' URLs in it.
+const SCRIPT: &str = include_str!("../recorded/net.js");
+/// What it records, with the servers' URLs as HTTP and WS.
+pub const RECORDED: &str = include_str!("../recorded/net.json");
+
+/// The servers: an HTTP one answering every request "hello", and a WebSocket one echoing each message (and a close).
+pub struct Servers {
+ pub http: String,
+ pub ws: String,
+}
+
+pub fn serve() -> Servers {
+ let h = TcpListener::bind("127.0.0.1:0").unwrap();
+ let w = TcpListener::bind("127.0.0.1:0").unwrap();
+ let s = Servers { http: format!("http://{}", h.local_addr().unwrap()), ws: format!("ws://{}", w.local_addr().unwrap()) };
+ std::thread::spawn(move || {
+ for mut c in h.incoming().flatten() {
+ let mut req = Vec::new();
+ let mut b = [0u8; 1024];
+ while !req.windows(4).any(|w| w == b"\r\n\r\n") {
+ match c.read(&mut b) {
+ Ok(0) | Err(_) => break,
+ Ok(n) => req.extend_from_slice(&b[..n]),
+ }
+ }
+ let _ = c.write_all(b"HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 5\r\nConnection: close\r\n\r\nhello");
+ }
+ });
+ std::thread::spawn(move || {
+ for c in w.incoming().flatten() {
+ std::thread::spawn(move || {
+ let Ok(mut ws) = tungstenite::accept(c) else { return };
+ while let Ok(m) = ws.read() {
+ if m.is_text() || m.is_binary() {
+ let _ = ws.send(m);
+ }
+ }
+ });
+ }
+ });
+ s
+}
+
+impl Servers {
+ /// The script, pointed at these servers.
+ pub fn script(&self) -> String {
+ SCRIPT.replace("%HTTP%", &self.http).replace("%WS%", &self.ws)
+ }
+
+ /// What a host recorded (the JSON the script logged), against RECORDED: Ok, or how they differ.
+ pub fn check(&self, recorded: &str) -> Result<(), String> {
+ let got: Value = serde_json::from_str(&recorded.replace(&self.http, "HTTP").replace(&self.ws, "WS")).map_err(|e| format!("recorded: {e}"))?;
+ let want: Value = serde_json::from_str(RECORDED).unwrap();
+ let (g, w) = (got.as_array().cloned().unwrap_or_default(), want.as_array().cloned().unwrap_or_default());
+ for (i, (g, w)) in g.iter().zip(&w).enumerate() {
+ if g != w {
+ return Err(format!("step {}: got {g}, recorded {w}", i + 1));
+ }
+ }
+ if g.len() != w.len() {
+ return Err(format!("{} steps, recorded {}: {}", g.len(), w.len(), got));
+ }
+ Ok(())
+ }
+}
diff --git a/io/os/Cargo.toml b/io/os/Cargo.toml
new file mode 100644
index 00000000..e008d050
--- /dev/null
+++ b/io/os/Cargo.toml
@@ -0,0 +1,22 @@
+[package]
+name = "raea-io-os"
+version = "0.1.0"
+edition = "2024"
+license = "FSL-1.1-ALv2"
+publish = false
+description = "The system's host calls both app targets answer (docs/targets.feature T2d): os.open, the clipboard, files the user picks or saves, and message dialogs; Bevy-free, scripted when headless"
+
+[dependencies]
+serde_json = "1"
+base64 = "0.22"
+# a URL in the system's handler
+opener = "0.9"
+# the system clipboard (text)
+arboard = { version = "3.7", default-features = false }
+# the system's file and message dialogs; on Linux the xdg portal, never GTK
+rfd = { version = "0.17", default-features = false, features = ["xdg-portal"] }
+pollster = "0.4"
+
+[features]
+# recorded.rs: T2d's recorded system calls, headless, for each target's test
+recorded = []
diff --git a/io/os/recorded/os.js b/io/os/recorded/os.js
new file mode 100644
index 00000000..a6bffc0c
--- /dev/null
+++ b/io/os/recorded/os.js
@@ -0,0 +1,47 @@
+// T2d's recorded calls (io/os recorded.rs), headless: each answer kept in order, then the whole record logged as
+// "recorded JSON" and emitted as `recorded`. Plain script, no wire.ts, so both targets run exactly this. The test
+// queued a pick (a.txt), a save (b.txt) and a dialog's second button before it ran.
+(() => {
+ const log = [];
+ const waiting = {};
+ let next = 1;
+ const steps = [
+ ["os.open", { url: "https://raea.io/" }],
+ ["os.open", { url: "file:///etc/hosts" }],
+ ["net.clipboard.write", { text: "copied" }],
+ ["net.clipboard.read", {}],
+ ["fs.pick", { accept: ["txt"] }],
+ ["fs.read", { id: 1 }],
+ ["fs.save", { name: "b.txt" }],
+ ["fs.write", { id: 2, data: "eHl6", binary: true }],
+ ["fs.read", { id: 2 }],
+ ["fs.read", { id: 99 }],
+ ["dialog.message", { title: "Discard?", text: "The draft goes.", kind: "warning", buttons: ["Keep", "Discard"] }],
+ ["dialog.message", { title: "Again?", text: "No step answers this one." }],
+ ];
+ const go = (i) => {
+ if (i === steps.length) {
+ const s = JSON.stringify(log);
+ console.log("recorded " + s);
+ return __ui_emit("recorded", s);
+ }
+ const [name, args] = steps[i];
+ const id = next++;
+ waiting[id] = (m) => {
+ log.push({ call: name, ok: m.ok, value: m.ok ? m.value : m.error });
+ go(i + 1);
+ };
+ __ui_call(id, name, JSON.stringify(args));
+ };
+ const before = globalThis.__ui_deliver;
+ globalThis.__ui_deliver = (json) => {
+ const m = JSON.parse(json);
+ if (m.t === "answer" && waiting[m.id]) {
+ const f = waiting[m.id];
+ delete waiting[m.id];
+ return f(m);
+ }
+ if (before) before(json);
+ };
+ go(0);
+})();
diff --git a/io/os/recorded/os.json b/io/os/recorded/os.json
new file mode 100644
index 00000000..abf2dd54
--- /dev/null
+++ b/io/os/recorded/os.json
@@ -0,0 +1,70 @@
+[
+ {
+ "call": "os.open",
+ "ok": true,
+ "value": null
+ },
+ {
+ "call": "os.open",
+ "ok": false,
+ "value": "os.open: the \"file\" scheme isn't opened (http, https or mailto only)"
+ },
+ {
+ "call": "net.clipboard.write",
+ "ok": true,
+ "value": null
+ },
+ {
+ "call": "net.clipboard.read",
+ "ok": true,
+ "value": "copied"
+ },
+ {
+ "call": "fs.pick",
+ "ok": true,
+ "value": [
+ {
+ "id": 1,
+ "name": "a.txt",
+ "size": 3
+ }
+ ]
+ },
+ {
+ "call": "fs.read",
+ "ok": true,
+ "value": "abc"
+ },
+ {
+ "call": "fs.save",
+ "ok": true,
+ "value": {
+ "id": 2
+ }
+ },
+ {
+ "call": "fs.write",
+ "ok": true,
+ "value": null
+ },
+ {
+ "call": "fs.read",
+ "ok": true,
+ "value": "xyz"
+ },
+ {
+ "call": "fs.read",
+ "ok": false,
+ "value": "no file 99 (pick or save one first)"
+ },
+ {
+ "call": "dialog.message",
+ "ok": true,
+ "value": 1
+ },
+ {
+ "call": "dialog.message",
+ "ok": false,
+ "value": "dialog.message: headless, and no dialog step answers it"
+ }
+]
diff --git a/io/os/src/dialog.rs b/io/os/src/dialog.rs
new file mode 100644
index 00000000..f6571ed4
--- /dev/null
+++ b/io/os/src/dialog.rs
@@ -0,0 +1,46 @@
+//! dialog.message: the system's message dialog (rfd), answered with the index of the button pressed; headless, the
+//! answer a dialog step queued.
+
+use rfd::{AsyncMessageDialog, MessageButtons, MessageDialogResult, MessageLevel};
+use serde_json::{Value, json};
+
+use crate::{Done, Scripted, headless, scripted};
+
+pub(crate) fn message(args: &Value, done: Done) {
+ let labels: Vec<String> = args["buttons"].as_array().map(|a| a.iter().filter_map(Value::as_str).map(str::to_string).collect()).unwrap_or_default();
+ if labels.len() > 3 {
+ return done(Err(format!("dialog.message: {} buttons, at most 3", labels.len())));
+ }
+ if headless() {
+ return done(match scripted(|s| if let Scripted::Dialog(i) = s { Some(*i) } else { None }) {
+ Some(i) if i < labels.len().max(1) => Ok(json!(i)),
+ Some(i) => Err(format!("dialog.message: the dialog step pressed button {i} of {}", labels.len().max(1))),
+ None => Err("dialog.message: headless, and no dialog step answers it".into()),
+ });
+ }
+ let level = match args["kind"].as_str() {
+ Some("warning") => MessageLevel::Warning,
+ Some("error") => MessageLevel::Error,
+ _ => MessageLevel::Info,
+ };
+ let buttons = match labels.as_slice() {
+ [] => MessageButtons::Ok,
+ [a] => MessageButtons::OkCustom(a.clone()),
+ [a, b] => MessageButtons::OkCancelCustom(a.clone(), b.clone()),
+ [a, b, c, ..] => MessageButtons::YesNoCancelCustom(a.clone(), b.clone(), c.clone()),
+ };
+ let d = AsyncMessageDialog::new()
+ .set_title(args["title"].as_str().unwrap_or(""))
+ .set_description(args["text"].as_str().unwrap_or(""))
+ .set_level(level)
+ .set_buttons(buttons);
+ std::thread::spawn(move || {
+ let r = pollster::block_on(d.show());
+ let i = match r {
+ MessageDialogResult::Custom(s) => labels.iter().position(|l| *l == s).unwrap_or(0),
+ MessageDialogResult::Cancel | MessageDialogResult::No => 1,
+ MessageDialogResult::Ok | MessageDialogResult::Yes => 0,
+ };
+ done(Ok(json!(i)));
+ });
+}
diff --git a/io/os/src/fs.rs b/io/os/src/fs.rs
new file mode 100644
index 00000000..790f9aaa
--- /dev/null
+++ b/io/os/src/fs.rs
@@ -0,0 +1,109 @@
+//! fs.pick, fs.save, fs.read and fs.write: files the user picked or saved this run, by opaque id (the browser's model,
+//! so the same app can run in a page). Ids last for the process and aren't kept; a file over CAP is refused both ways,
+//! so base64 over the wire can't blow up memory.
+
+use std::collections::HashMap;
+use std::path::{Path, PathBuf};
+use std::sync::Mutex;
+
+use base64::Engine as _;
+use base64::engine::general_purpose::STANDARD;
+use serde_json::{Value, json};
+
+use crate::{Done, Scripted, headless, scripted};
+
+/// The most fs.read and fs.write move: 64 MB.
+pub const CAP: u64 = 64 << 20;
+
+static FILES: Mutex<(u64, Option<HashMap<u64, PathBuf>>)> = Mutex::new((0, None));
+
+fn keep(p: PathBuf) -> u64 {
+ let mut f = FILES.lock().unwrap();
+ f.0 += 1;
+ let id = f.0;
+ f.1.get_or_insert_with(HashMap::new).insert(id, p);
+ id
+}
+
+fn path(args: &Value) -> Result<PathBuf, String> {
+ let id = args["id"].as_u64().ok_or("no id")?;
+ FILES.lock().unwrap().1.as_ref().and_then(|m| m.get(&id).cloned()).ok_or(format!("no file {id} (pick or save one first)"))
+}
+
+fn too_big(n: u64) -> Result<(), String> {
+ if n > CAP { Err(format!("the file is {n} bytes, over fs's 64 MB ({CAP} bytes)")) } else { Ok(()) }
+}
+
+fn described(p: &Path) -> Value {
+ let id = keep(p.to_path_buf());
+ json!({"id": id, "name": p.file_name().map(|n| n.to_string_lossy().into_owned()).unwrap_or_default(), "size": std::fs::metadata(p).map(|m| m.len()).unwrap_or(0)})
+}
+
+fn accept(args: &Value) -> Vec<String> {
+ args["accept"].as_array().map(|a| a.iter().filter_map(Value::as_str).map(|e| e.trim_start_matches('.').to_string()).collect()).unwrap_or_default()
+}
+
+fn dialog(args: &Value) -> rfd::AsyncFileDialog {
+ let exts = accept(args);
+ let d = rfd::AsyncFileDialog::new();
+ if exts.is_empty() { d } else { d.add_filter("files", &exts) }
+}
+
+pub(crate) fn call(name: &str, args: &Value, done: Done) {
+ match name {
+ "fs.pick" => pick(args, done),
+ "fs.save" => save(args, done),
+ "fs.read" => done(read(args)),
+ _ => done(write(args)),
+ }
+}
+
+fn pick(args: &Value, done: Done) {
+ if headless() {
+ return done(match scripted(|s| if let Scripted::Pick(f) = s { Some(f.clone()) } else { None }) {
+ Some(files) => Ok(Value::Array(files.iter().map(|p| described(&std::path::absolute(p).unwrap_or(p.clone()))).collect())),
+ None => Err("fs.pick: headless, and no pick step answers it".into()),
+ });
+ }
+ let (multiple, d) = (args["multiple"] == json!(true), dialog(args));
+ std::thread::spawn(move || {
+ let files: Vec<PathBuf> = if multiple {
+ pollster::block_on(d.pick_files()).unwrap_or_default().iter().map(|h| h.path().to_path_buf()).collect()
+ } else {
+ pollster::block_on(d.pick_file()).map(|h| vec![h.path().to_path_buf()]).unwrap_or_default()
+ };
+ done(Ok(Value::Array(files.iter().map(|p| described(p)).collect())));
+ });
+}
+
+fn save(args: &Value, done: Done) {
+ if headless() {
+ return done(match scripted(|s| if let Scripted::Save(f) = s { Some(f.clone()) } else { None }) {
+ Some(p) => Ok(json!({"id": keep(std::path::absolute(&p).unwrap_or(p))})),
+ None => Err("fs.save: headless, and no save step answers it".into()),
+ });
+ }
+ let d = dialog(args).set_file_name(args["name"].as_str().unwrap_or("untitled"));
+ std::thread::spawn(move || {
+ done(Ok(pollster::block_on(d.save_file()).map_or(Value::Null, |h| json!({"id": keep(h.path().to_path_buf())}))));
+ });
+}
+
+fn read(args: &Value) -> Result<Value, String> {
+ let p = path(args)?;
+ too_big(std::fs::metadata(&p).map_err(|e| format!("{}: {e}", p.display()))?.len())?;
+ let bytes = std::fs::read(&p).map_err(|e| format!("{}: {e}", p.display()))?;
+ if args["binary"] == json!(true) {
+ Ok(json!(STANDARD.encode(bytes)))
+ } else {
+ String::from_utf8(bytes).map(|t| json!(t)).map_err(|_| format!("{} isn't text (read it with binary: true)", p.display()))
+ }
+}
+
+fn write(args: &Value) -> Result<Value, String> {
+ let p = path(args)?;
+ let data = args["data"].as_str().unwrap_or("");
+ let bytes = if args["binary"] == json!(true) { STANDARD.decode(data).map_err(|e| format!("fs.write's data isn't base64: {e}"))? } else { data.as_bytes().to_vec() };
+ too_big(bytes.len() as u64)?;
+ std::fs::write(&p, bytes).map(|()| Value::Null).map_err(|e| format!("{}: {e}", p.display()))
+}
diff --git a/io/os/src/lib.rs b/io/os/src/lib.rs
new file mode 100644
index 00000000..58f50b70
--- /dev/null
+++ b/io/os/src/lib.rs
@@ -0,0 +1,163 @@
+//! The system's host calls (docs/targets.feature T2d, agreed with raea-59 for raea-3f on 11-06), answered the same on
+//! both app targets: runtime/js os.rs and engine/rune js.rs each hand a call here with how to answer.
+//!
+//! os.open {url} -> null http, https or mailto in the system's handler; any other scheme refused
+//! net.clipboard.read {} -> text the system clipboard, text only (under net because @raea/ui's platform layer
+//! net.clipboard.write {text} -> null has called them that since P17: navigator.clipboard)
+//! fs.pick {multiple?, accept?: [ext]} -> [{id, name, size}] the system's open dialog
+//! fs.save {name, accept?} -> {id} | null the save dialog
+//! fs.read {id, binary?} -> text | base64, fs.write {id, data, binary?} -> null
+//! only files picked or saved this run, by opaque id, at most 64 MB
+//! dialog.message {title, text, kind: "info" | "warning" | "error", buttons?: [label]} -> the pressed button's index
+//!
+//! Headless (a host's check, `set_headless`) touches nothing of the system's: the clipboard is the process's own,
+//! os.open is recorded (`opened`), and a pick, save or dialog takes the answer a check step queued (`script`) or is
+//! refused. Dialogs run on a thread of their own, never the caller's frame.
+
+mod dialog;
+mod fs;
+
+use std::collections::VecDeque;
+use std::path::PathBuf;
+use std::sync::atomic::{AtomicBool, Ordering};
+use std::sync::{Mutex, OnceLock};
+
+use serde_json::{Value, json};
+
+/// Every call this crate answers.
+pub const CALLS: [&str; 8] = ["os.open", "net.clipboard.read", "net.clipboard.write", "fs.pick", "fs.save", "fs.read", "fs.write", "dialog.message"];
+
+/// A call's answer, once, from any thread.
+pub type Done = Box<dyn FnOnce(Result<Value, String>) + Send>;
+
+static HEADLESS: AtomicBool = AtomicBool::new(false);
+
+/// This process is a headless check: nothing reaches the system (see the module's notes).
+pub fn set_headless() {
+ HEADLESS.store(true, Ordering::Relaxed);
+}
+
+fn headless() -> bool {
+ HEADLESS.load(Ordering::Relaxed)
+}
+
+/// A check step's answer for the next dialog of its kind.
+#[derive(Debug, Clone, PartialEq)]
+pub enum Scripted {
+ /// the files the next fs.pick picks
+ Pick(Vec<PathBuf>),
+ /// the file the next fs.save saves to
+ Save(PathBuf),
+ /// the button the next dialog.message's user presses
+ Dialog(usize),
+}
+
+fn queue() -> &'static Mutex<VecDeque<Scripted>> {
+ static Q: OnceLock<Mutex<VecDeque<Scripted>>> = OnceLock::new();
+ Q.get_or_init(Mutex::default)
+}
+
+/// Queue `s` for the next pick, save or dialog (a check's step).
+pub fn script(s: Scripted) {
+ queue().lock().unwrap().push_back(s);
+}
+
+/// The next queued answer `pick` takes, if any.
+pub(crate) fn scripted<T>(pick: impl Fn(&Scripted) -> Option<T>) -> Option<T> {
+ let mut q = queue().lock().unwrap();
+ let i = q.iter().position(|s| pick(s).is_some())?;
+ q.remove(i).and_then(|s| pick(&s))
+}
+
+fn opened_list() -> &'static Mutex<Vec<String>> {
+ static O: OnceLock<Mutex<Vec<String>>> = OnceLock::new();
+ O.get_or_init(Mutex::default)
+}
+
+/// Why `name` will be refused here, when it's a headless pick, save or dialog with no step queued for it: a host
+/// lists it with the calls it didn't answer.
+pub fn unscripted(name: &str) -> Option<String> {
+ let kind = match name {
+ "fs.pick" => "pick",
+ "fs.save" => "save",
+ "dialog.message" => "dialog",
+ _ => return None,
+ };
+ let queued = queue().lock().unwrap().iter().any(|s| matches!((s, kind), (Scripted::Pick(_), "pick") | (Scripted::Save(_), "save") | (Scripted::Dialog(_), "dialog")));
+ (headless() && !queued).then(|| format!("{name}: headless, and no {kind} step answers it"))
+}
+
+/// The URLs os.open was asked for while headless, in order.
+pub fn opened() -> Vec<String> {
+ opened_list().lock().unwrap().clone()
+}
+
+/// A check step as JSON (`{"pick": [file]}`, `{"save": file}`, `{"dialog": index}`), if it's one of these.
+pub fn step(s: &Value) -> Option<Scripted> {
+ if let Some(files) = s.get("pick").and_then(Value::as_array) {
+ return Some(Scripted::Pick(files.iter().filter_map(Value::as_str).map(PathBuf::from).collect()));
+ }
+ if let Some(f) = s.get("save").and_then(Value::as_str) {
+ return Some(Scripted::Save(PathBuf::from(f)));
+ }
+ s.get("dialog").and_then(Value::as_u64).map(|i| Scripted::Dialog(i as usize))
+}
+
+/// `name` (one of CALLS) with `args`, answered through `done`.
+pub fn call(name: &str, args: Value, done: Done) {
+ match name {
+ "os.open" => done(open(&args)),
+ "net.clipboard.read" => done(clipboard(None)),
+ "net.clipboard.write" => done(clipboard(Some(args["text"].as_str().unwrap_or("").to_string()))),
+ "fs.pick" | "fs.save" | "fs.read" | "fs.write" => fs::call(name, &args, done),
+ "dialog.message" => dialog::message(&args, done),
+ _ => done(Err(format!("{name} isn't an os call"))),
+ }
+}
+
+fn open(args: &Value) -> Result<Value, String> {
+ let url = args["url"].as_str().ok_or("os.open: no url")?;
+ let scheme = url.split_once(':').map_or("", |(s, _)| s).to_ascii_lowercase();
+ if !["http", "https", "mailto"].contains(&scheme.as_str()) {
+ return Err(format!("os.open: the {scheme:?} scheme isn't opened (http, https or mailto only)"));
+ }
+ if headless() {
+ opened_list().lock().unwrap().push(url.to_string());
+ return Ok(Value::Null);
+ }
+ opener::open(url).map(|()| Value::Null).map_err(|e| format!("os.open {url}: {e}"))
+}
+
+/// The clipboard's text, or `text` written to it: the process's own when headless.
+fn clipboard(text: Option<String>) -> Result<Value, String> {
+ static OWN: Mutex<String> = Mutex::new(String::new());
+ static SYSTEM: Mutex<Option<arboard::Clipboard>> = Mutex::new(None);
+ if headless() {
+ let mut own = OWN.lock().unwrap();
+ return Ok(match text {
+ Some(t) => {
+ *own = t;
+ Value::Null
+ }
+ None => json!(*own),
+ });
+ }
+ // kept open: on X11 a clipboard's text lives as long as the process that set it holds it
+ let mut sys = SYSTEM.lock().unwrap();
+ if sys.is_none() {
+ *sys = Some(arboard::Clipboard::new().map_err(|e| format!("the clipboard: {e}"))?);
+ }
+ let c = sys.as_mut().unwrap();
+ match text {
+ Some(t) => c.set_text(t).map(|()| Value::Null),
+ // an empty clipboard reads as "", as a browser's readText does
+ None => match c.get_text() {
+ Err(arboard::Error::ContentNotAvailable) => Ok(json!("")),
+ r => r.map(|t| json!(t)),
+ },
+ }
+ .map_err(|e| format!("the clipboard: {e}"))
+}
+
+#[cfg(feature = "recorded")]
+pub mod recorded;
diff --git a/io/os/src/recorded.rs b/io/os/src/recorded.rs
new file mode 100644
index 00000000..90aa1519
--- /dev/null
+++ b/io/os/src/recorded.rs
@@ -0,0 +1,58 @@
+//! T2d's recorded set of system calls, for each target's test (as io/net/calls serve.rs is for T2b): headless, with a
+//! pick, a save and a dialog's answer queued, the script (recorded/os.js) opens two URLs, writes and reads the
+//! clipboard, picks, reads, saves and writes files, and shows two dialogs; recorded/os.json is what both targets must
+//! answer. A test runs `script` in its host and checks what it recorded with `check`.
+
+use std::path::PathBuf;
+
+use serde_json::Value;
+
+use crate::{Scripted, opened, script, set_headless};
+
+const SCRIPT: &str = include_str!("../recorded/os.js");
+/// What the script records.
+pub const RECORDED: &str = include_str!("../recorded/os.json");
+
+/// The folder the picked and saved files are in.
+pub struct Setup {
+ pub dir: PathBuf,
+}
+
+/// Headless, a.txt ("abc") picked, b.txt saved, the dialog's second button pressed: all in `dir`.
+pub fn setup(dir: PathBuf) -> Setup {
+ set_headless();
+ std::fs::create_dir_all(&dir).unwrap();
+ std::fs::write(dir.join("a.txt"), "abc").unwrap();
+ script(Scripted::Pick(vec![dir.join("a.txt")]));
+ script(Scripted::Save(dir.join("b.txt")));
+ script(Scripted::Dialog(1));
+ Setup { dir }
+}
+
+impl Setup {
+ pub fn script(&self) -> &'static str {
+ SCRIPT
+ }
+
+ /// What a host recorded, against RECORDED, and what os.open was asked for and b.txt: Ok, or how they differ.
+ pub fn check(&self, recorded: &str) -> Result<(), String> {
+ let got: Value = serde_json::from_str(recorded).map_err(|e| format!("recorded: {e}"))?;
+ let want: Value = serde_json::from_str(RECORDED).unwrap();
+ let (g, w) = (got.as_array().cloned().unwrap_or_default(), want.as_array().cloned().unwrap_or_default());
+ for (i, (g, w)) in g.iter().zip(&w).enumerate() {
+ if g != w {
+ return Err(format!("step {}: got {g}, recorded {w}", i + 1));
+ }
+ }
+ if g.len() != w.len() {
+ return Err(format!("{} steps, recorded {}: {got}", g.len(), w.len()));
+ }
+ if opened() != ["https://raea.io/"] {
+ return Err(format!("os.open was asked for {:?}", opened()));
+ }
+ match std::fs::read_to_string(self.dir.join("b.txt")) {
+ Ok(t) if t == "xyz" => Ok(()),
+ r => Err(format!("b.txt after fs.write: {r:?}")),
+ }
+ }
+}
diff --git a/runtime/bundle/Cargo.toml b/runtime/bundle/Cargo.toml
index 4991a524..c3cba629 100644
--- a/runtime/bundle/Cargo.toml
+++ b/runtime/bundle/Cargo.toml
@@ -22,10 +22,14 @@ raea-native = { path = "../../engine/native", default-features = false }
raea-io-media = { path = "../../io/media", default-features = false, features = ["apple", "soft-audio"] }
serde_json = "1"
regex = "1"
-# raea-bundle's library (engine/bundle: Rolldown) loaded at run time (fresh.rs inproc). Never a Cargo dependency:
+# raea-bundle's library (engine/bundle: Rolldown) loaded at run time (fresh.rs inproc), never a Cargo dependency:
# Rolldown's crates turn on serde_json's preserve_order and arbitrary_precision, and features unify across a binary
# (f60e0b7: every JSON map an IndexMap, every number its text, pong's apply 87 -> 159 allocations)
-libloading = "0.8"
+raea-runtime-bundle-lib = { path = "lib" }
+
+# the work folder's node_modules link on Windows (fresh.rs link_node_modules), as raea-io-npm makes its links
+[target.'cfg(windows)'.dependencies]
+junction = "1"
[dev-dependencies]
# tests/mezz.rs writes its long-GOP clip with the soft backend's H.264
diff --git a/runtime/bundle/lib/Cargo.toml b/runtime/bundle/lib/Cargo.toml
new file mode 100644
index 00000000..6606f915
--- /dev/null
+++ b/runtime/bundle/lib/Cargo.toml
@@ -0,0 +1,13 @@
+[package]
+name = "raea-runtime-bundle-lib"
+version = "0.1.0"
+edition = "2024"
+license = "FSL-1.1-ALv2"
+publish = false
+description = "raea-bundle's library (engine/bundle: Rolldown) loaded at run time: an entry in, its script and CSS out"
+
+[dependencies]
+# never a Cargo dependency on raea-bundle itself: Rolldown's crates turn on serde_json's preserve_order and
+# arbitrary_precision, and features unify across a binary (f60e0b7)
+libloading = "0.8"
+serde_json = "1"
diff --git a/runtime/bundle/lib/src/app.rs b/runtime/bundle/lib/src/app.rs
new file mode 100644
index 00000000..e427e1b8
--- /dev/null
+++ b/runtime/bundle/lib/src/app.rs
@@ -0,0 +1,60 @@
+//! An app's script (docs/targets.feature T0b, T1c): its TSX with React, @raea/ui and @raea/rune from raea's home (the
+//! checkout's, or a release's share/raea), mounted in DOM mode, bundled in process. Both targets run the same script:
+//! the page host on a Blitz page, the native host (raea-rune-host) on Rune.
+
+use std::path::Path;
+
+/// The entry every app is mounted by: the DOM installed before the app's module runs, its default export mounted at
+/// the root (an app that mounts itself with createRoot needs no default export)
+fn entry(app: &Path) -> String {
+ format!(
+ "import \"@raea/ui/dom-globals\";\nimport {{ createElement }} from \"react\";\nimport {{ mount }} from \"@raea/ui/react\";\nimport * as M from {:?};\nconst App = (M as any).default;\nif (typeof App === \"function\") mount(createElement(App), 0, {{ dom: true }});\n",
+ app.display().to_string()
+ )
+}
+
+/// The work folder's tsconfig: JSX by React's automatic runtime, @raea/ui and @raea/rune from the SDK's source
+fn tsconfig(home: &Path) -> String {
+ let ui = home.join("sdk/ui/src");
+ let rune = home.join("sdk/rune/src/index.ts");
+ serde_json::json!({"compilerOptions": {"jsx": "react-jsx", "jsxImportSource": "react", "module": "esnext", "target": "es2022", "moduleResolution": "bundler",
+ "paths": {"@raea/ui/*": [format!("{}/*", ui.display())], "@raea/rune": [rune.display().to_string()]}}})
+ .to_string()
+}
+
+/// `@raea/ui/<module>` for each of sdk/ui/src's modules, by name: the work folder's tsconfig reaches only the entry,
+/// and an app outside it (anywhere on disk) imports @raea/ui/wire, @raea/ui/platform... as well
+fn ui(home: &Path) -> serde_json::Value {
+ let src = home.join("sdk/ui/src");
+ let mut m = serde_json::Map::new();
+ for e in std::fs::read_dir(&src).into_iter().flatten().flatten() {
+ let p = e.path();
+ if let (Some(stem), Some("ts" | "tsx")) = (p.file_stem().and_then(|s| s.to_str()), p.extension().and_then(|x| x.to_str())) {
+ m.insert(format!("@raea/ui/{stem}"), p.display().to_string().into());
+ }
+ }
+ m.into()
+}
+
+/// `app` bundled against `home`: its script and the CSS its modules import
+pub fn bundle(app: &Path, home: &Path) -> Result<(String, String), String> {
+ let app = app.canonicalize().map_err(|e| format!("{}: {e}", app.display()))?;
+ // one path per file: a module reached by two spellings of its path is bundled twice (two wires, two call ids)
+ let home = &home.canonicalize().map_err(|e| format!("{}: {e}", home.display()))?;
+ // one work folder per call: tests bundle on several threads of one process
+ static N: std::sync::atomic::AtomicU32 = std::sync::atomic::AtomicU32::new(0);
+ let work = std::env::temp_dir().join(format!("raea-app-{}-{}", std::process::id(), N.fetch_add(1, std::sync::atomic::Ordering::Relaxed)));
+ let _ = std::fs::remove_dir_all(&work);
+ std::fs::create_dir_all(&work).map_err(|e| format!("{}: {e}", work.display()))?;
+ let entry_file = work.join("entry.tsx");
+ let wrote = std::fs::write(&entry_file, entry(&app)).and_then(|_| std::fs::write(work.join("tsconfig.json"), tsconfig(home)));
+ let r = wrote.map_err(|e| e.to_string()).and_then(|_| {
+ let opts = serde_json::json!({
+ "script": {"js": home.join("sdk/react/js"), "motion": home.join("sdk/raea/src"), "shell": home.join("sdk/shell/src/index.ts"), "aliases": ui(home), "stubs": []},
+ "defines": {},
+ });
+ crate::bundle(&entry_file, opts)
+ });
+ let _ = std::fs::remove_dir_all(&work);
+ r.map_err(|e| format!("couldn't bundle {}: {}", app.display(), e.lines().filter(|l| !l.trim().is_empty()).take(8).collect::<Vec<_>>().join(" | ")))
+}
diff --git a/runtime/bundle/lib/src/lib.rs b/runtime/bundle/lib/src/lib.rs
new file mode 100644
index 00000000..325b0383
--- /dev/null
+++ b/runtime/bundle/lib/src/lib.rs
@@ -0,0 +1,70 @@
+//! raea-bundle (engine/bundle: Rolldown, lightningcss, the Z3 compile) as a library loaded at run time, never linked: its
+//! crates' Cargo features would reach raea's own (f60e0b7). Found at RAEA_BUNDLE_LIB or beside this binary. A crate of its own
+//! (libloading and serde_json, nothing of raea's) so a host that must not reach Bevy (the native target's tests,
+//! docs/targets.feature T1c) loads it as runtime/bundle does.
+
+/// An app's script, as both targets run it
+pub mod app;
+
+use std::ffi::{c_char, CStr, CString};
+use std::path::{Path, PathBuf};
+
+pub struct Lib {
+ pub path: PathBuf,
+ bundle: unsafe extern "C" fn(*const c_char, *const c_char) -> *mut c_char,
+ free: unsafe extern "C" fn(*mut c_char),
+ _lib: libloading::Library,
+}
+
+pub fn lib() -> Result<&'static Lib, String> {
+ static LIB: std::sync::OnceLock<Result<Lib, String>> = std::sync::OnceLock::new();
+ LIB.get_or_init(|| {
+ // libraea_bundle.dylib, .so on Linux, raea_bundle.dll on Windows
+ let name = libloading::library_filename("raea_bundle");
+ let mut at: Vec<PathBuf> = std::env::var_os("RAEA_BUNDLE_LIB").map(PathBuf::from).into_iter().collect();
+ // beside the binary (runtime/react/build.rs puts it there), or a folder up (test binaries run from deps/); the binary
+ // itself, not a link to it (an install links ~/.local/bin/raea to ~/.raea/bin)
+ if let Some(dir) = std::env::current_exe().ok().map(|e| e.canonicalize().unwrap_or(e)).and_then(|e| e.parent().map(Path::to_path_buf)) {
+ at.push(dir.join(&name));
+ at.extend(dir.parent().map(|d| d.join(&name)));
+ }
+ // no bundler at all when it isn't there: raea doesn't fall back to bun
+ let path = at.into_iter().find(|p| p.is_file()).ok_or(format!("raea can't bundle: no {} beside {} (runtime/react/build.rs builds it with raea-runtime-react's modules feature; RAEA_BUNDLE_LIB names another)", name.to_string_lossy(), std::env::current_exe().map(|e| e.display().to_string()).unwrap_or_default()))?;
+ // SAFETY: raea-bundle's own library, whose C API (engine/bundle/src/lib.rs ffi) is checked by its version first
+ unsafe {
+ let lib = libloading::Library::new(&path).map_err(|e| format!("{}: {e}", path.display()))?;
+ let api: libloading::Symbol<unsafe extern "C" fn() -> u32> = lib.get(b"raea_bundle_api").map_err(|e| format!("{}: {e}", path.display()))?;
+ if api() != 1 {
+ return Err(format!("{}: API {} (this raea wants 1): build bundle/ again", path.display(), api()));
+ }
+ let bundle = *lib.get(b"raea_bundle").map_err(|e| format!("{}: {e}", path.display()))?;
+ let free = *lib.get(b"raea_bundle_free").map_err(|e| format!("{}: {e}", path.display()))?;
+ Ok(Lib { path, bundle, free, _lib: lib })
+ }
+ })
+ .as_ref()
+ .map_err(|e| e.clone())
+}
+
+/// `entry` bundled with `opts` (raea-bundle's: {"z3"}, {"script", "defines"}): the script and the CSS its modules
+/// imported
+pub fn bundle(entry: &Path, opts: serde_json::Value) -> Result<(String, String), String> {
+ let lib = lib()?;
+ let e = CString::new(entry.to_string_lossy().as_bytes()).map_err(|e| e.to_string())?;
+ let o = CString::new(opts.to_string()).map_err(|e| e.to_string())?;
+ // SAFETY: NUL-terminated strings in; the reply is the library's, freed by it
+ let reply = unsafe {
+ let p = (lib.bundle)(e.as_ptr(), o.as_ptr());
+ if p.is_null() {
+ return Err("raea-bundle gave no reply".into());
+ }
+ let s = CStr::from_ptr(p).to_string_lossy().into_owned();
+ (lib.free)(p);
+ s
+ };
+ let v: serde_json::Value = serde_json::from_str(&reply).map_err(|e| format!("raea-bundle's reply: {e}"))?;
+ if let Some(err) = v["error"].as_str() {
+ return Err(err.to_string());
+ }
+ Ok((v["js"].as_str().unwrap_or_default().to_string(), v["css"].as_str().unwrap_or_default().to_string()))
+}
diff --git a/runtime/bundle/src/entry.rs b/runtime/bundle/src/entry.rs
index ec987d98..64938f6c 100644
--- a/runtime/bundle/src/entry.rs
+++ b/runtime/bundle/src/entry.rs
@@ -4,10 +4,15 @@ pub fn entry(file: &str, o: &CompOpts) -> String {
let (comp, w, h, fps, frames) = (o.composition.as_deref(), o.w, o.h, o.fps, o.frames);
let js = |v: &Option<Value>| v.as_ref().map(Value::to_string).unwrap_or("null".into());
let (words, perception, input) = (js(&o.words), js(&o.perception), js(&o.input));
+ // the composition's element made once, so a frame re-renders only what reads the frame (its clock, through
+ // useCurrentFrame), not every part (docs/control.feature FC1b). A frame is already pure (a still renders any
+ // frame alone), so a part drawing Math.random or Date in render without reading the frame breaks either way.
+ // RAEA_STILL_TREE=0 makes it each frame, as before. In the entry's text, so the bundle cache tells the two apart
+ let still = std::env::var("RAEA_STILL_TREE").map_or(true, |v| v != "0");
format!(
r#"import {{ pureAgain, pureFrame, pureSession, seedOf }} from "./motion/pure";
import {{ mount, addEventListener }} from "bevy-react";
-import {{ Component, useEffect, useState }} from "react";
+import {{ Component, useEffect, useMemo, useState }} from "react";
import * as M from "./src/{file}";
import {{ Clock, getCompositions }} from "./motion";
const want = {comp};
@@ -83,9 +88,6 @@ function Root() {{
// the stage's size, for a composition that lays out from useVideoConfig (raea-size)
const [size, setSize] = useState<{{ w: number; h: number }} | null>(null);
useEffect(() => addEventListener("raea-size", (v: any) => setSize(v)), []);
- // the frame is done when its commit and the effects it set off have run: a timer queued after them marks it, and
- // Rust takes the frame the moment that mark lands (settle), with no waiting for quiet
- const [done, setDone] = useState(-1);
useEffect(() => addEventListener("raea-frame", (v: any) => {{
if (typeof v === "number") return setF(v);
live = true;
@@ -95,16 +97,13 @@ function Root() {{
if (v.input) {{ LIVE[v.frame] = {{ ...v.input, live: true }}; delete LIVE[v.frame - 4096]; }}
setF(v.frame);
}}), []);
- useEffect(() => {{
- if (f >= 0) setDone(f);
- }}, [f]);
// a range of frames rendered back to back (raea-frames: the 3D's rows stepped as a bake steps, scene_frames_to):
// each frame's commit and its done mark as one raea-frame event makes them, the next frame set off by the mark
const [to, setTo] = useState(-1);
useEffect(() => addEventListener("raea-frames", (v: any) => {{ setTo(v.to); setF(v.from); }}), []);
- useEffect(() => {{
- if (f >= 0 && done === f && f + 1 < to) setF(f + 1);
- }}, [done]);
+ // the composition, made again only when what Root passes it changes (by default never, RAEA_STILL_TREE=0 each frame; its parts re-render
+ // when what they read changes, the frame through the Clock's context)
+ const body = useMemo(() => <Catch><C {{...cfg.defaultProps}} />{{(() => {{ const T = (globalThis as any).__raeaToneOut; return T ? <T /> : null; }})()}}</Catch>, {still} ? [] : [f, size, to]);
// the frame's Math.random and Date (motion/pure.ts): reseeded as the frame starts rendering, so every component
// under it draws the same numbers each time this frame is drawn
if (f >= 0) pureFrame(f, cfg.fps);
@@ -113,12 +112,26 @@ function Root() {{
return (
<>
<Clock frame={{f}} fps={{cfg.fps}} width={{size ? size.w : cfg.width}} height={{size ? size.h : cfg.height}} durationInFrames={{live || REPLAYS_LIVE ? 1000000000 : cfg.durationInFrames}} id={{cfg.id}} defaultProps={{cfg.defaultProps}} words={{WORDS}} perception={{percAt(f)}} input={{live ? LIVE : INPUT}}>
- <Catch><C {{...cfg.defaultProps}} />{{(() => {{ const T = (globalThis as any).__raeaToneOut; return T ? <T /> : null; }})()}}</Catch>
+ {{body}}
</Clock>
- <div data-raea-frame={{f}} data-raea-done={{done}} data-raea-config={{conf}} />
+ <Marker f={{f}} to={{to}} conf={{conf}} next={{setF}} />
</>
);
}}
+// the frame is done when its commit and the effects it set off have run: its own effect, after the composition's,
+// marks it, and Rust takes the frame the moment that mark lands (settle), with no waiting for quiet. The mark is this
+// component's state, not Root's: marking it in Root rendered the whole composition a second time each frame
+// (many_cubes' 10 000 parts, docs/control.feature FC1a)
+function Marker({{ f, to, conf, next }}: {{ f: number; to: number; conf: string; next: (f: number) => void }}) {{
+ const [done, setDone] = useState(-1);
+ useEffect(() => {{
+ if (f >= 0) setDone(f);
+ }}, [f]);
+ useEffect(() => {{
+ if (f >= 0 && done === f && f + 1 < to) next(f + 1);
+ }}, [done]);
+ return <div data-raea-frame={{f}} data-raea-done={{done}} data-raea-config={{conf}} />;
+}}
mount(<surface id="motion" w={{1}} px={{cfg.width}} pxH={{cfg.height}}><Root /></surface>);
"#,
comp = comp.map(|c| format!("{c:?}")).unwrap_or("null".into())
diff --git a/runtime/bundle/src/fresh.rs b/runtime/bundle/src/fresh.rs
index 6ba4dab0..d20cae8d 100644
--- a/runtime/bundle/src/fresh.rs
+++ b/runtime/bundle/src/fresh.rs
@@ -105,73 +105,8 @@ pub fn bundle_tests(files: &[PathBuf], out: &Path, filter: Option<&str>, extra:
bundle_entry(&entry, out, extra)
}
-/// raea-bundle (bundle/: Rolldown, lightningcss, the Z3 compile) as a library loaded at run time, never linked: its
-/// crates' Cargo features would reach raea's own (f60e0b7). Found at RAEA_BUNDLE_LIB, beside this binary, or in
-/// engine/bundle/target/release (`cargo build --release` in bundle/).
-pub mod inproc {
- use std::ffi::{c_char, CStr, CString};
- use std::path::{Path, PathBuf};
-
- pub struct Lib {
- pub path: PathBuf,
- bundle: unsafe extern "C" fn(*const c_char, *const c_char) -> *mut c_char,
- free: unsafe extern "C" fn(*mut c_char),
- _lib: libloading::Library,
- }
-
- pub fn lib() -> Result<&'static Lib, String> {
- static LIB: std::sync::OnceLock<Result<Lib, String>> = std::sync::OnceLock::new();
- LIB.get_or_init(|| {
- // libraea_bundle.dylib, .so on Linux, raea_bundle.dll on Windows
- let name = libloading::library_filename("raea_bundle");
- let mut at: Vec<PathBuf> = std::env::var_os("RAEA_BUNDLE_LIB").map(PathBuf::from).into_iter().collect();
- // beside the binary (runtime/react/build.rs puts it there), or a folder up (test binaries run from deps/); the binary
- // itself, not a link to it (an install links ~/.local/bin/raea to ~/.raea/bin)
- if let Some(dir) = std::env::current_exe().ok().map(|e| e.canonicalize().unwrap_or(e)).and_then(|e| e.parent().map(Path::to_path_buf)) {
- at.push(dir.join(&name));
- at.extend(dir.parent().map(|d| d.join(&name)));
- }
- // no bundler at all when it isn't there: raea doesn't fall back to bun
- let path = at.into_iter().find(|p| p.is_file()).ok_or(format!("raea can't bundle: no {} beside {} (runtime/react/build.rs builds it with raea-runtime-react's modules feature; RAEA_BUNDLE_LIB names another)", name.to_string_lossy(), std::env::current_exe().map(|e| e.display().to_string()).unwrap_or_default()))?;
- // SAFETY: raea-bundle's own library, whose C API (engine/bundle/src/lib.rs ffi) is checked by its version first
- unsafe {
- let lib = libloading::Library::new(&path).map_err(|e| format!("{}: {e}", path.display()))?;
- let api: libloading::Symbol<unsafe extern "C" fn() -> u32> = lib.get(b"raea_bundle_api").map_err(|e| format!("{}: {e}", path.display()))?;
- if api() != 1 {
- return Err(format!("{}: API {} (this raea wants 1): build bundle/ again", path.display(), api()));
- }
- let bundle = *lib.get(b"raea_bundle").map_err(|e| format!("{}: {e}", path.display()))?;
- let free = *lib.get(b"raea_bundle_free").map_err(|e| format!("{}: {e}", path.display()))?;
- Ok(Lib { path, bundle, free, _lib: lib })
- }
- })
- .as_ref()
- .map_err(|e| e.clone())
- }
-
- /// `entry` bundled with `opts` (raea-bundle's: {"z3"}, {"script", "defines"}): the script and the CSS its modules
- /// imported
- pub fn bundle(entry: &Path, opts: serde_json::Value) -> Result<(String, String), String> {
- let lib = lib()?;
- let e = CString::new(entry.to_string_lossy().as_bytes()).map_err(|e| e.to_string())?;
- let o = CString::new(opts.to_string()).map_err(|e| e.to_string())?;
- // SAFETY: NUL-terminated strings in; the reply is the library's, freed by it
- let reply = unsafe {
- let p = (lib.bundle)(e.as_ptr(), o.as_ptr());
- if p.is_null() {
- return Err("raea-bundle gave no reply".into());
- }
- let s = CStr::from_ptr(p).to_string_lossy().into_owned();
- (lib.free)(p);
- s
- };
- let v: serde_json::Value = serde_json::from_str(&reply).map_err(|e| format!("raea-bundle's reply: {e}"))?;
- if let Some(err) = v["error"].as_str() {
- return Err(err.to_string());
- }
- Ok((v["js"].as_str().unwrap_or_default().to_string(), v["css"].as_str().unwrap_or_default().to_string()))
- }
-}
+/// raea-bundle's library, loaded at run time (runtime/bundle/lib: raea-runtime-bundle-lib)
+pub use raea_runtime_bundle_lib as inproc;
pub fn bundle_fresh(tsx: &Path, out_js: &Path, o: &CompOpts, portable: Option<&Path>) -> R<()> {
let t0 = std::time::Instant::now();
@@ -180,7 +115,7 @@ pub fn bundle_fresh(tsx: &Path, out_js: &Path, o: &CompOpts, portable: Option<&P
static ONE: std::sync::Mutex<()> = std::sync::Mutex::new(());
let _one = ONE.lock().unwrap_or_else(|e| e.into_inner());
let work = std::env::temp_dir().join(format!("raea-cli-b{}", std::process::id()));
- let _ = std::fs::remove_dir_all(&work);
+ remove_work(&work);
copy_dir(&dir, &work.join("src"), 0)?;
let motion_src = raea_io_home::home().join("sdk/raea/src").canonicalize().map_err(|e| format!("raea/motion/src: {e}"))?;
copy_dir(&motion_src, &work.join("motion"), 0)?;
@@ -243,8 +178,7 @@ pub fn bundle_fresh(tsx: &Path, out_js: &Path, o: &CompOpts, portable: Option<&P
}
}
let js = raea_io_home::home().join("sdk/react/js");
- #[cfg(unix)]
- std::os::unix::fs::symlink(js.join("node_modules"), work.join("node_modules")).map_err(|e| format!("node_modules: {e}"))?;
+ link_node_modules(&js, &work)?;
if o.lite {
// the game's code and the SDK's resolve "react" to the live view runtime (tsconfig paths cover the files under
// the work folder; packages in node_modules keep their own React)
@@ -267,6 +201,45 @@ pub fn bundle_fresh(tsx: &Path, out_js: &Path, o: &CompOpts, portable: Option<&P
eprintln!("raea bundle: {} in {:.1} ms: the work folder {:.1} ms, Rolldown {:.1} ms", tsx.display(), t0.elapsed().as_secs_f64() * 1e3, t_work.as_secs_f64() * 1e3, (t0.elapsed() - t_work).as_secs_f64() * 1e3);
}
std::fs::write(out_js, code).map_err(|e| format!("{}: {e}", out_js.display()))?;
- let _ = std::fs::remove_dir_all(&work);
+ remove_work(&work);
+ Ok(())
+}
+
+/// The work folder's node_modules: the engine's (sdk/react/js's), linked. On Windows a junction, which needs none of the
+/// rights a symlink does (Developer Mode or an admin), as raea-io-npm links packages. Windows had no link at all, so the
+/// live runtime's `../../node_modules/bevy-react/src/bridge` resolved nothing and `raea play` couldn't bundle a game.
+fn link_node_modules(js: &Path, work: &Path) -> R<()> {
+ let (to, at) = (js.join("node_modules"), work.join("node_modules"));
+ #[cfg(unix)]
+ std::os::unix::fs::symlink(&to, &at).map_err(|e| format!("node_modules: {e}"))?;
+ #[cfg(windows)]
+ junction::create(&to, &at).map_err(|e| format!("node_modules: {e}"))?;
Ok(())
}
+
+/// The work folder removed: on Windows its node_modules junction first, by remove_dir, which takes the link and never
+/// the engine's packages it points at
+fn remove_work(work: &Path) {
+ #[cfg(windows)]
+ let _ = std::fs::remove_dir(work.join("node_modules"));
+ let _ = std::fs::remove_dir_all(work);
+}
+
+#[cfg(test)]
+mod link_tests {
+ #[test]
+ fn the_work_folder_reads_the_engines_packages_and_its_removal_keeps_them() {
+ let base = std::env::temp_dir().join(format!("raea-link-test-{}", std::process::id()));
+ let (js, work) = (base.join("js"), base.join("work"));
+ std::fs::create_dir_all(js.join("node_modules/bevy-react/src")).unwrap();
+ std::fs::write(js.join("node_modules/bevy-react/src/bridge.ts"), "export {};").unwrap();
+ std::fs::create_dir_all(work.join("lite/parts")).unwrap();
+ super::link_node_modules(&js, &work).unwrap();
+ // what lite/parts/root.ts imports, read through the link
+ assert_eq!(std::fs::read_to_string(work.join("lite/parts/../../node_modules/bevy-react/src/bridge.ts")).unwrap(), "export {};");
+ super::remove_work(&work);
+ assert!(!work.exists(), "the work folder is gone");
+ assert!(js.join("node_modules/bevy-react/src/bridge.ts").exists(), "the engine's packages are kept");
+ let _ = std::fs::remove_dir_all(&base);
+ }
+}
diff --git a/runtime/bundle/src/styles.rs b/runtime/bundle/src/styles.rs
index c8e724a9..05604b9b 100644
--- a/runtime/bundle/src/styles.rs
+++ b/runtime/bundle/src/styles.rs
@@ -84,36 +84,51 @@ pub fn ensure(dir: &Path) -> R<()> {
Ok(())
}
+/// An app's Tailwind (docs/targets.feature T0b): every class any .ts or .tsx in `dir` uses, with Tailwind's own default
+/// theme (not raea's brand theme), as plain CSS for a page. A folder with no code has no classes: no compile runs.
+pub fn tailwind(dir: &Path) -> R<String> {
+ let code = sources(dir);
+ if code.is_empty() {
+ return Ok(String::new());
+ }
+ compile(&code, "")
+}
+
+#[cfg(not(feature = "modules"))]
+fn compile(_: &[PathBuf], _: &str) -> R<String> {
+ Err("tailwind: this build leaves out the module runtime Tailwind's compiler runs on (the modules feature)".into())
+}
+
/// The project's CSS: its brand kit's variables, then its Tailwind.
-#[cfg(feature = "modules")]
fn css(space: &Path, code: &[PathBuf]) -> R<String> {
- let home = raea_io_home::home();
- let pkg = home.join("sdk/react/tw/node_modules/tailwindcss");
- let theme_file = home.join("engine/cli/template/theme.css");
+ let theme_file = raea_io_home::home().join("engine/cli/template/theme.css");
+ let theme = std::fs::read_to_string(&theme_file).map_err(|e| format!("styles.gen: {}: {e}", theme_file.display()))?;
+ let tw = compile(code, &theme).map_err(|e| format!("styles.gen: {e}"))?;
+ let brand = match std::fs::read_to_string(space.join("brand/brand.css")) {
+ Ok(b) => b.split('\n').filter(|l| !l.trim_start().starts_with("@import")).collect::<Vec<_>>().join("\n"),
+ Err(_) => String::new(),
+ };
+ Ok(format!("{brand}\n{tw}"))
+}
+
+/// Tailwind 4 for `code`'s candidates after `theme`, compiled on raea's JavaScriptCore
+#[cfg(feature = "modules")]
+fn compile(code: &[PathBuf], theme: &str) -> R<String> {
+ let pkg = raea_io_home::home().join("sdk/react/tw/node_modules/tailwindcss");
let mut files = BTreeMap::new();
- for e in std::fs::read_dir(&pkg).map_err(|e| format!("styles.gen: Tailwind's package isn't at {} ({e}; in a checkout: `bun install` in sdk/react/tw)", pkg.display()))?.flatten() {
+ for e in std::fs::read_dir(&pkg).map_err(|e| format!("Tailwind's package isn't at {} ({e}; in a checkout: `bun install` in sdk/react/tw)", pkg.display()))?.flatten() {
let p = e.path();
if p.extension().is_some_and(|x| x == "css") {
files.insert(p.file_name().unwrap().to_string_lossy().into_owned(), std::fs::read_to_string(&p).map_err(|e| e.to_string())?);
}
}
- let theme = std::fs::read_to_string(&theme_file).map_err(|e| format!("styles.gen: {}: {e}", theme_file.display()))?;
let input = json!({ "candidates": candidates(code), "theme": theme, "files": files }).to_string();
let entry = raea_native::js::Entry::Code { text: COMPILE.into(), ts: false, dir: pkg.clone() };
let run = raea_native::js::run(&pkg, &pkg, entry, Vec::new(), Default::default(), input, Vec::new(), std::time::Duration::from_secs(60));
if run.exit != 0 {
- return Err(format!("styles.gen: tailwind: {}", run.stderr.chars().take(400).collect::<String>()));
+ return Err(format!("tailwind: {}", run.stderr.chars().take(400).collect::<String>()));
}
- let brand = match std::fs::read_to_string(space.join("brand/brand.css")) {
- Ok(b) => b.split('\n').filter(|l| !l.trim_start().starts_with("@import")).collect::<Vec<_>>().join("\n"),
- Err(_) => String::new(),
- };
- Ok(format!("{brand}\n{}", run.stdout))
-}
-
-#[cfg(not(feature = "modules"))]
-fn css(_: &Path, _: &[PathBuf]) -> R<String> {
- Err("styles.gen: this build leaves out the module runtime Tailwind's compiler runs on (the modules feature)".into())
+ Ok(run.stdout)
}
/// Every whitespace-separated word inside a quoted string of `code`, first sighting first (void's project.ts order)
diff --git a/runtime/export/src/fed.rs b/runtime/export/src/fed.rs
index 34289607..b13aa9dd 100644
--- a/runtime/export/src/fed.rs
+++ b/runtime/export/src/fed.rs
@@ -49,6 +49,13 @@ pub(crate) fn frames_hold_3d(js: &Path, dir: &Path, frames: &[i64]) -> R<bool> {
/// each waited on the JS thread and back, took the Rome film's 8,064 frames 6 s on a quiet machine and 38 s at load
/// 50, before its engine could open. RAEA_BAKE_WORKERS sets how many runtimes (4; one for short timelines).
pub(crate) fn scene_frames_to(js: &Path, dir: &Path, upto: i64) -> R<Option<(Vec<(i64, Frame)>, u32, u32, f64)>> {
+ scene_frames(js, dir, upto, true)
+}
+
+/// `whole`: the whole composition at least (scene_frames_to); else only frames 0..upto, as a still at frame f needs
+/// (a frame-0 still of 10 000 cubes over 121 frames stepped all 121, 69 s for 2 frames' 12 s; docs/control.feature
+/// FC1a)
+pub(crate) fn scene_frames(js: &Path, dir: &Path, upto: i64, whole: bool) -> R<Option<(Vec<(i64, Frame)>, u32, u32, f64)>> {
edit_dir(dir);
let runtime = |js: &Path| {
let mut app = App::new();
@@ -60,7 +67,8 @@ pub(crate) fn scene_frames_to(js: &Path, dir: &Path, upto: i64) -> R<Option<(Vec
let conf = settle(&mut app, Some(-1), 20.0)?.ok_or("the composition's settings didn't arrive")?;
let (w, h) = (num(&conf, "width").unwrap_or(1080.0) as u32, num(&conf, "height").unwrap_or(1920.0) as u32);
let fps = num(&conf, "fps").unwrap_or(30.0);
- let total = (num(&conf, "frames").unwrap_or(60.0) as i64).max(upto);
+ let length = num(&conf, "frames").unwrap_or(60.0) as i64;
+ let total = if whole || upto <= 0 { length.max(upto) } else { upto };
type Scenes = Vec<(i64, Vec<Node3>, Option<String>)>;
let step = |app: &mut App, a: i64, b: i64| -> R<Scenes> {
let mut out: Scenes = Vec::with_capacity((b - a).max(0) as usize);
diff --git a/runtime/export/src/run.rs b/runtime/export/src/run.rs
index afffe72f..827dbd2c 100644
--- a/runtime/export/src/run.rs
+++ b/runtime/export/src/run.rs
@@ -71,8 +71,15 @@ pub(crate) fn scene_program_checked(js: &Path, dir: &Path, upto: i64, wanted: Op
}
}
raea_runtime_react::startup_mark("the 3D's rows: stepping React through the frames");
- let Some((frames, w, h, fps)) = scene_frames_to(js, dir, upto)? else { return Ok(None) };
- raea_runtime_react::startup_mark("the 3D's rows: frames stepped");
+ // a still steps only up to its frame, and one past it (what reads ahead, as a shutter might, has it); anything
+ // else steps the whole composition
+ let got = match wanted {
+ Some(&[f]) if f >= 0 => scene_frames(js, dir, upto.max(f + 1) + 1, false)?,
+ _ => scene_frames_to(js, dir, upto)?,
+ };
+ let Some((frames, w, h, fps)) = got else { return Ok(None) };
+ // the count too: tools/bevy-parity charges raea the time a frame takes to step (docs/control.feature FC0a)
+ raea_runtime_react::startup_mark(&format!("the 3D's rows: {} frames stepped", frames.len()));
let p = program(&frames, w, h, fps);
raea_runtime_react::startup_mark("the 3D's rows: program made");
// a still: its own frame (the frames are 0..upto in order)
diff --git a/runtime/js/Cargo.toml b/runtime/js/Cargo.toml
index f358e713..5b5e2767 100644
--- a/runtime/js/Cargo.toml
+++ b/runtime/js/Cargo.toml
@@ -22,6 +22,10 @@ bevy = { version = "=0.20.0", default-features = false, features = ["std", "defa
# the op wire to and from a page's script
raea-core-wire = { path = "../../core/wire" }
raea-io-net = { path = "../../io/net", features = ["ws"] }
+# the net.* calls, answered as the native target answers them (docs/targets.feature T2a)
+raea-io-net-calls = { path = "../../io/net/calls" }
+# os.open, the clipboard, files and dialogs, answered as the native target answers them (docs/targets.feature T2d)
+raea-io-os = { path = "../../io/os" }
# the world API: BRP's methods run in-process, watched reads (shared with every raea runtime)
raea-bevy-world = { path = "../../engine/bevy-world" }
serde = { version = "1", features = ["derive"] }
diff --git a/runtime/js/src/calls.rs b/runtime/js/src/calls.rs
index c7bcd33d..e882be4e 100644
--- a/runtime/js/src/calls.rs
+++ b/runtime/js/src/calls.rs
@@ -54,13 +54,15 @@ pub struct HostCalls {
}
impl Default for HostCalls {
- /// With the platform's built-in calls (src/net.rs: fetch, WebSocket, localStorage's persistence; src/webaudio.rs:
- /// decodeAudioData), which an app's own `on` under the same name replaces.
+ /// With the platform's built-in calls (src/net.rs: fetch, WebSocket, localStorage's persistence; src/os.rs: os.open,
+ /// the clipboard, files, dialogs; src/webaudio.rs: decodeAudioData), which an app's own `on` under the same name
+ /// replaces.
fn default() -> Self {
let (tx, rx) = channel();
let (push, pushed) = channel();
let mut c = HostCalls { fns: HashMap::new(), otherwise: None, tx, rx: Mutex::new(rx), pushed: Mutex::new(pushed) };
crate::net::install(&mut c, push);
+ crate::os::install(&mut c);
#[cfg(feature = "media")]
crate::webaudio::install(&mut c);
c
diff --git a/runtime/js/src/lib.rs b/runtime/js/src/lib.rs
index 10194c3a..ad8c7e93 100644
--- a/runtime/js/src/lib.rs
+++ b/runtime/js/src/lib.rs
@@ -15,6 +15,7 @@ pub mod media_html;
#[cfg(feature = "media")]
pub mod webaudio;
pub mod net;
+pub mod os;
pub mod world;
use bevy::prelude::*;
diff --git a/runtime/js/src/net.rs b/runtime/js/src/net.rs
index bb174297..bbea8a45 100644
--- a/runtime/js/src/net.rs
+++ b/runtime/js/src/net.rs
@@ -1,102 +1,31 @@
-//! The network and storage under the platform layer's fetch, WebSocket and localStorage (sdk/ui/src/platform.ts,
-//! docs/ts-native.feature P17), as host calls every root has unless the app registers its own under the same names:
-//!
-//! net.fetch {url, method, headers: [[k, v]], body: base64 | null, redirect: "follow" | "error" | "manual"}
-//! -> {status, statusText, headers: [[k, v]], body: base64, url, redirected}; a network failure is refused
-//! net.ws.open {id, url, protocols} a socket on a thread of its own; what happens to it comes back as the host
-//! event `net.ws` {id, ev: "open" | "message" | "close", ...}
-//! net.ws.send {id, data, binary?} text, or base64 bytes
-//! net.ws.close {id, code, reason}
-//! net.storage.get {area} -> {k: v} localStorage kept across runs, in $BEVY_TSX_STORAGE/<area>.json; without
-//! net.storage.set {area, change} that variable these are refused and storage stays in memory
-//!
-//! fetch and the sockets (raea-io-net's http and ws) block on threads of their own, never the frame. There's no clipboard call: the platform's
-//! navigator.clipboard is the process's own until an app registers `net.clipboard.read`/`write` (a headless test
-//! never touches the system's).
+//! The net.* host calls (fetch, WebSockets, localStorage under sdk/ui/src/platform.ts; docs/ts-native.feature P17),
+//! which every root has unless the app registers its own under the same names. raea-io-net-calls answers them, as it
+//! does for the native target (docs/targets.feature T2a lists the call surface); this hands it each call with the
+//! calling root's Entity. The clipboard's net.clipboard.* calls are src/os.rs's (raea-io-os): a headless host's
+//! clipboard is its process's own, so a test never touches the system's.
-use std::collections::HashMap;
-use std::sync::mpsc::{Sender, channel};
-use std::sync::{Arc, Mutex};
+use std::sync::Arc;
+use std::sync::mpsc::Sender;
use bevy::prelude::*;
-use raea_io_net::ws::Cmd;
-use serde_json::{Value, json};
+use raea_io_net_calls::{CALLS, Net};
+use serde_json::Value;
use crate::calls::HostCalls;
-type Sockets = Arc<Mutex<HashMap<(Entity, u64), Sender<Cmd>>>>;
-
/// The calls, onto `calls` (HostCalls's default has them); `push` carries a socket's events to its root.
pub fn install(calls: &mut HostCalls, push: Sender<(Entity, Value)>) {
- calls.on("net.fetch", |_w, args, answer| {
- std::thread::spawn(move || match raea_io_net::http::fetch(&args) {
- Ok(v) => answer.ok(v),
- Err(e) => answer.err(e),
- });
- });
- let sockets: Sockets = Arc::default();
- let s = sockets.clone();
- calls.on("net.ws.open", move |_w, args, answer| {
- let root = answer.root();
- let id = args["id"].as_u64().unwrap_or(0);
- let (tx, rx) = channel();
- s.lock().unwrap().insert((root, id), tx);
- let (push, s) = (push.clone(), s.clone());
- std::thread::spawn(move || {
- raea_io_net::ws::run(&args, rx, &|ev: Value| {
- let mut m = ev;
- m["id"] = json!(id);
- let _ = push.send((root, raea_core_wire::named("net.ws", m)));
- });
- s.lock().unwrap().remove(&(root, id));
+ let net: Net<Entity> = Net::new(Arc::new(move |root, ev| {
+ let _ = push.send((root, ev));
+ }));
+ for name in CALLS {
+ let net = net.clone();
+ calls.on(name, move |_w, args, answer| {
+ let root = answer.root();
+ net.call(root, name, args, Box::new(move |r| match r {
+ Ok(v) => answer.ok(v),
+ Err(e) => answer.err(e),
+ }));
});
- answer.ok(Value::Null);
- });
- let s = sockets.clone();
- calls.on("net.ws.send", move |_w, args, answer| {
- let key = (answer.root(), args["id"].as_u64().unwrap_or(0));
- let msg = Cmd::Send { data: args["data"].as_str().unwrap_or("").to_string(), binary: args["binary"] == json!(true) };
- match s.lock().unwrap().get(&key) {
- Some(tx) if tx.send(msg).is_ok() => answer.ok(Value::Null),
- _ => answer.err("no such socket"),
- }
- });
- let s = sockets;
- calls.on("net.ws.close", move |_w, args, answer| {
- let key = (answer.root(), args["id"].as_u64().unwrap_or(0));
- let code = args["code"].as_u64().unwrap_or(1000) as u16;
- let reason = args["reason"].as_str().unwrap_or("").to_string();
- match s.lock().unwrap().get(&key) {
- Some(tx) if tx.send(Cmd::Close(code, reason)).is_ok() => answer.ok(Value::Null),
- _ => answer.err("no such socket"),
- }
- });
- calls.on("net.storage.get", |_w, args, answer| match store(&args) {
- Some(p) => answer.ok(std::fs::read_to_string(p).ok().and_then(|t| serde_json::from_str(&t).ok()).unwrap_or(json!({}))),
- None => answer.err("no storage (BEVY_TSX_STORAGE isn't set)"),
- });
- calls.on("net.storage.set", |_w, args, answer| {
- let Some(p) = store(&args) else { return answer.err("no storage (BEVY_TSX_STORAGE isn't set)") };
- let mut m: serde_json::Map<String, Value> = std::fs::read_to_string(&p).ok().and_then(|t| serde_json::from_str(&t).ok()).unwrap_or_default();
- let c = &args["change"];
- if c["clear"] == json!(true) {
- m.clear();
- } else if let Some(k) = c["k"].as_str() {
- match c["v"].as_str() {
- Some(v) => m.insert(k.to_string(), json!(v)),
- None => m.remove(k),
- };
- }
- let _ = std::fs::create_dir_all(p.parent().unwrap_or(std::path::Path::new(".")));
- match std::fs::write(&p, Value::Object(m).to_string()) {
- Ok(()) => answer.ok(Value::Null),
- Err(e) => answer.err(e.to_string()),
- }
- });
-}
-
-fn store(args: &Value) -> Option<std::path::PathBuf> {
- let dir = std::env::var_os("BEVY_TSX_STORAGE")?;
- let area = args["area"].as_str().filter(|a| a.chars().all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '_'))?;
- Some(std::path::PathBuf::from(dir).join(format!("{area}.json")))
+ }
}
diff --git a/runtime/js/src/os.rs b/runtime/js/src/os.rs
new file mode 100644
index 00000000..b7bfd7d0
--- /dev/null
+++ b/runtime/js/src/os.rs
@@ -0,0 +1,19 @@
+//! The system's host calls (os.open, net.clipboard.*, fs.*, dialog.message; docs/targets.feature T2d), which every
+//! root has unless the app registers its own under the same names. raea-io-os answers them, as it does for the native
+//! target; a headless host (raea app check) calls raea_io_os::set_headless first, so nothing reaches the system.
+
+use raea_io_os::CALLS;
+
+use crate::calls::HostCalls;
+
+/// The calls, onto `calls` (HostCalls's default has them).
+pub fn install(calls: &mut HostCalls) {
+ for name in CALLS {
+ calls.on(name, move |_w, args, answer| {
+ raea_io_os::call(name, args, Box::new(move |r| match r {
+ Ok(v) => answer.ok(v),
+ Err(e) => answer.err(e),
+ }));
+ });
+ }
+}
diff --git a/runtime/look/Cargo.toml b/runtime/look/Cargo.toml
index 1b47ba4b..04ca5530 100644
--- a/runtime/look/Cargo.toml
+++ b/runtime/look/Cargo.toml
@@ -9,4 +9,5 @@ description = "A 3D composition's look as raea-render row columns: the camera, i
[dependencies]
raea-core-scene = { path = "../../core/scene" }
raea-core-program = { path = "../../core/program" }
+bevy = { version = "=0.20.0", default-features = false, features = ["std"] }
serde_json = "1"
diff --git a/runtime/look/src/camera.rs b/runtime/look/src/camera.rs
index 4f0809ca..6e0de2c5 100644
--- a/runtime/look/src/camera.rs
+++ b/runtime/look/src/camera.rs
@@ -54,7 +54,7 @@ pub fn camera(all: &[Vec<Item>], p: &mut Program, row: &mut BTreeMap<String, V>)
}
}
// ambient: every AmbientLight's intensity summed, per frame; its colour the first one's
- let amb: Vec<f64> = all.iter().map(|its| its.iter().filter(|i| i.kind == "ambient").map(|i| n(&i.props, "intensity", 1.0)).sum::<f64>() * AMBIENT).collect();
+ let amb: Vec<f64> = all.iter().map(|its| its.iter().filter(|i| i.kind == "ambient").map(|i| light_power("ambient", &i.props)).sum::<f64>()).collect();
if amb.iter().any(|a| *a > 0.0) {
column(p, row, id, "ambient", &amb);
if let Some(c) = all.iter().flatten().find(|i| i.kind == "ambient").and_then(|i| hex(i.props.get("color"))) {
diff --git a/runtime/look/src/instances.rs b/runtime/look/src/instances.rs
new file mode 100644
index 00000000..c6ccd837
--- /dev/null
+++ b/runtime/look/src/instances.rs
@@ -0,0 +1,46 @@
+//! <Instances> (sdk/render 3d/instances.tsx): a Mesh or Model whose props carry `at`, its placements 9 numbers a copy
+//! (position, XYZ euler radians, scale), written as the row's `inst` column: 10 numbers a copy (position, rotation as
+//! a quaternion xyzw, scale), space-separated. The engine draws one copy per placement, sharing the mesh and material
+//! (runtime/scene3d's instance.rs; rows from runtime/scene). The placements are the first frame's; a later frame's differing list is warned of.
+
+use super::*;
+use bevy::math::{EulerRot, Quat};
+
+fn packed(at: &[Value]) -> Option<String> {
+ if at.len() % 9 != 0 {
+ eprintln!("WARN Instances: placements are 9 numbers a copy, got {}", at.len());
+ return None;
+ }
+ let f = |v: &Value| v.as_f64().unwrap_or(0.0);
+ let nums: Vec<String> = at
+ .chunks(9)
+ .flat_map(|c| {
+ let q = Quat::from_euler(EulerRot::XYZ, f(&c[3]) as f32, f(&c[4]) as f32, f(&c[5]) as f32);
+ [f(&c[0]), f(&c[1]), f(&c[2]), q.x as f64, q.y as f64, q.z as f64, q.w as f64, f(&c[6]), f(&c[7]), f(&c[8])]
+ })
+ .map(|v| format!("{}", r6(v)))
+ .collect();
+ Some(nums.join(" "))
+}
+
+/// The `inst` column of a mesh or model row whose part is an <Instances>.
+pub fn instances_column(row: &mut BTreeMap<String, V>, its: &[Item]) {
+ let Some(Value::Array(at)) = its[0].props.get("at") else { return };
+ if its.iter().skip(1).any(|i| !matches!(i.props.get("at"), Some(Value::Array(a)) if std::ptr::eq(a, at) || a == at)) {
+ eprintln!("WARN Instances {}: its placements change over the shot; the first frame's are drawn", its[0].props.get("name").and_then(Value::as_str).unwrap_or("?"));
+ }
+ if let Some(s) = packed(at) {
+ row.insert("inst".into(), V::S(s));
+ }
+}
+
+/// A model row's shadows (a mesh row writes its own): `shadow={false}` casts none, `receiveShadow={false}` takes none
+/// (the engine marks each of its meshes, and an <Instances>' copies).
+pub fn model_shadows(row: &mut BTreeMap<String, V>, its: &[Item]) {
+ if its[0].props.get("shadow") == Some(&Value::Bool(false)) {
+ row.insert("shadow".into(), V::N(0.0));
+ }
+ if its[0].props.get("receiveShadow") == Some(&Value::Bool(false)) {
+ row.insert("receive".into(), V::N(0.0));
+ }
+}
diff --git a/runtime/look/src/lib.rs b/runtime/look/src/lib.rs
index e93d6ba1..9b6a00ed 100644
--- a/runtime/look/src/lib.rs
+++ b/runtime/look/src/lib.rs
@@ -9,6 +9,8 @@ use serde_json::{Map, Value};
mod camera;
pub use camera::*;
+mod instances;
+pub use instances::*;
/// Bloom of intensity 1: Bevy's natural preset.
pub const BLOOM: f64 = 0.15;
@@ -121,7 +123,12 @@ pub fn r6(x: f64) -> f64 {
/// A row's numeric column: its first frame's value, keyed on every frame when it changes.
pub fn column(p: &mut Program, row: &mut BTreeMap<String, V>, id: &str, name: &str, vals: &[f64]) {
- let vals: Vec<f64> = vals.iter().map(|v| r6(*v)).collect();
+ exact(p, row, id, name, &vals.iter().map(|v| r6(*v)).collect::<Vec<_>>());
+}
+
+/// `column` unrounded, for values that are already the World's f32 (a Transform's, docs/control.feature FC1d): 1e-6 is
+/// coarser than f32 below 8, so rounding would move a quaternion by up to 5e-7.
+pub fn exact(p: &mut Program, row: &mut BTreeMap<String, V>, id: &str, name: &str, vals: &[f64]) {
row.insert(name.into(), V::N(vals[0]));
if !vals.iter().all(|v| (*v - vals[0]).abs() < 1e-9) {
p.keys.insert((id.to_string(), name.to_string()), vals.iter().enumerate().map(|(f, v)| (f as i64, *v, "linear".to_string())).collect());
@@ -396,27 +403,60 @@ pub fn skip_list(props: &Map<String, Value>) -> Option<String> {
/// A part's Bevy components (runtime/plugins/src/lib.rs): each type's value from the first frame it's there, and
/// again from each frame its value changes (or from the frame its `from` names), as `component` rows on the part's row.
pub fn components(p: &mut Program, id: &str, its: &[Item]) {
+ let each = its.iter().enumerate().flat_map(|(f, it)| it.props.get("components").and_then(Value::as_array).into_iter().flatten().map(move |c| (f, c)));
+ keyed(p, "component", Some(id), "c", each);
+}
+
+/// A StandardMaterial's fields its `animate` names beyond the row columns' four (docs/control.feature FC1c): sampled each
+/// frame onto the material's props as `field:<name>` (runtime/react animate.rs), sent as keyed `material:` rows that
+/// patch the part's own material (runtime/plugins patch_material). A colour arrives as #rrggbb and goes as Bevy's Srgba.
+pub fn material_fields(p: &mut Program, id: &str, its: &[Item]) {
+ let each: Vec<(usize, Value)> = its.iter().enumerate().filter_map(|(f, it)| {
+ let m = it.material.as_ref()?;
+ let o: Map<String, Value> = m.props.iter().filter_map(|(k, v)| Some((k.strip_prefix("field:")?.to_string(), bevy_value(v)))).collect();
+ (!o.is_empty()).then(|| (f, serde_json::json!({ "type": "material:bevy_pbr::pbr_material::StandardMaterial", "value": o })))
+ }).collect();
+ keyed(p, "component", Some(id), "m", each.iter().map(|(f, v)| (*f, v)));
+}
+
+/// A sampled value as reflect's JSON takes it: `#rrggbb` (or `#rrggbbaa`) as a Color's Srgba, the rest as it is
+fn bevy_value(v: &Value) -> Value {
+ let Some(h) = v.as_str().and_then(|s| s.strip_prefix('#')).filter(|h| (h.len() == 6 || h.len() == 8) && h.chars().all(|c| c.is_ascii_hexdigit())) else { return v.clone() };
+ let c = |i: usize| u8::from_str_radix(&h[i..i + 2], 16).unwrap_or(0) as f64 / 255.0;
+ serde_json::json!({ "Srgba": { "red": c(0), "green": c(2), "blue": c(4), "alpha": if h.len() == 8 { c(6) } else { 1.0 } } })
+}
+
+/// Bevy's reflected resources and a plugin's (<BevyResource>, items of kind "resource"), keyed as a component's are
+/// (docs/control.feature FC1c: only frame 0's was kept)
+pub fn resources(p: &mut Program, all: &[Vec<Item>]) {
+ let each = all.iter().enumerate().flat_map(|(f, items)| items.iter().filter(|it| it.kind == "resource").map(move |it| (f, Value::Object((*it.props).clone()))));
+ let each: Vec<(usize, Value)> = each.collect();
+ keyed(p, "resource", None, "c", each.iter().map(|(f, v)| (*f, v)));
+}
+
+/// `kind` rows of each type's value from the frame it's first seen, and again from each frame it changes
+fn keyed<'a>(p: &mut Program, kind: &str, target: Option<&str>, tag: &str, each: impl Iterator<Item = (usize, &'a Value)>) {
let mut last: BTreeMap<String, String> = BTreeMap::new();
let mut n = 0;
- for (f, it) in its.iter().enumerate() {
- for c in it.props.get("components").and_then(Value::as_array).into_iter().flatten() {
- let Some(ty) = c.get("type").and_then(Value::as_str) else { continue };
- let value = c.get("value").cloned().unwrap_or(Value::Null).to_string();
- if last.get(ty) == Some(&value) {
- continue;
- }
- last.insert(ty.to_string(), value.clone());
- let from = c.get("from").and_then(Value::as_f64).unwrap_or(f as f64);
- let mut row = BTreeMap::new();
- row.insert("id".into(), V::S(format!("{id}-c{n}")));
+ for (f, c) in each {
+ let Some(ty) = c.get("type").and_then(Value::as_str) else { continue };
+ let value = c.get("value").cloned().unwrap_or(Value::Null).to_string();
+ if last.get(ty) == Some(&value) {
+ continue;
+ }
+ last.insert(ty.to_string(), value.clone());
+ let from = c.get("from").and_then(Value::as_f64).unwrap_or(f as f64);
+ let mut row = BTreeMap::new();
+ row.insert("id".into(), V::S(match target { Some(id) => format!("{id}-{tag}{n}"), None => format!("res{n}") }));
+ if let Some(id) = target {
row.insert("target".into(), V::S(id.to_string()));
- row.insert("type".into(), V::S(ty.to_string()));
- row.insert("value".into(), V::S(value));
- if from > 0.0 {
- row.insert("from".into(), V::N(from));
- }
- p.spawns.push(("component".into(), vec![row]));
- n += 1;
}
+ row.insert("type".into(), V::S(ty.to_string()));
+ row.insert("value".into(), V::S(value));
+ if from > 0.0 {
+ row.insert("from".into(), V::N(from));
+ }
+ p.spawns.push((kind.into(), vec![row]));
+ n += 1;
}
}
diff --git a/runtime/plugins/src/lib.rs b/runtime/plugins/src/lib.rs
index 7b688b34..6a813ad9 100644
--- a/runtime/plugins/src/lib.rs
+++ b/runtime/plugins/src/lib.rs
@@ -4,8 +4,9 @@
//!
//! component {target: a row's id, type: a reflected type path, value: JSON, from?: frame}
//! the value deserialized through Bevy's TypeRegistry (TypedReflectDeserializer) and inserted with
-//! ReflectComponent::insert on the target's entity: at load, or once frame `from` is drawn
-//! resource {type, value} the same for a reflected resource, at load
+//! ReflectComponent::insert on the target's entity: at load, or once frame `from` is drawn (each frame
+//! takes the last row from at or before it, in every build: docs/control.feature FC1c)
+//! resource {type, value, from?} the same for a reflected resource
//! mesh ... driven the mesh's Transform is the plugin's (a rigid body's), not the rows'
//!
//! Render equals play: with a plugin installed, Bevy's clock is the frame index. Every update that draws a new frame f
@@ -97,9 +98,14 @@ pub struct PluginClock {
#[derive(Component)]
pub struct Driven;
-/// Component rows that wait for a frame: (entity, type, value, from).
+/// The edit's component and resource rows keyed to frames (docs/control.feature FC1c): each one's target (None: a
+/// resource), type, value and first frame, and the frame of the row last applied for each target and type. A frame
+/// takes, for each, the last row from at or before it, so a seek (a still, live play's jump) lands on its value.
#[derive(Resource, Default)]
-struct TimedRows(Vec<(Entity, String, Value, i64)>);
+struct Keyed {
+ rows: Vec<(Option<Entity>, String, Value, i64)>,
+ applied: std::collections::HashMap<(Option<Entity>, String), i64>,
+}
/// Adds the registered plugins (all but the on-demand ones) and the frame clock, when there are any. An App without
/// plugins is left as it was.
@@ -121,6 +127,7 @@ pub fn install(app: &mut App, fps: f64) {
character::register(app);
// materials written in TypeScript (<ShaderMaterial>, shader_material.rs): the render Engine only
shader_material::install(app);
+ keyed(app);
let list: Vec<fn(&mut App)> = PLUGINS.lock().unwrap().iter().filter(|r| !r.on_demand).map(|r| r.install).collect();
install_list(app, fps, list);
}
@@ -139,10 +146,17 @@ pub fn install_named(app: &mut App, fps: f64, names: &[&str]) -> Result<(), Stri
}
world_methods(app);
character::register(app);
+ keyed(app);
install_list(app, fps, list);
Ok(())
}
+/// Keyed component and resource rows, in every build: with a plugin or without one (docs/control.feature FC1c)
+fn keyed(app: &mut App) {
+ app.init_resource::<Keyed>();
+ app.add_systems(Update, keyed_rows);
+}
+
/// A live game's component and resource rows (Engine::set_rows), each as its live values now stand: a component's
/// value set on the row it targets (patched over what the part has), a resource's on the World. A live frame's
/// <BevyComponent value> may change every frame, as a render's are set at load.
@@ -181,8 +195,6 @@ fn install_list(app: &mut App, fps: f64, list: Vec<fn(&mut App)>) {
app.insert_resource(TimeUpdateStrategy::ManualDuration(Duration::ZERO));
app.world_mut().resource_mut::<Time<Fixed>>().set_timestep(dt);
app.insert_resource(PluginClock { stepped: 0, dt, advancing: false, steps: 0 });
- app.init_resource::<TimedRows>();
- app.add_systems(Update, timed_rows);
}
pub fn active(world: &World) -> bool {
@@ -208,20 +220,41 @@ pub fn arm(world: &mut World) {
world.insert_resource(TimeUpdateStrategy::ManualDuration(dt));
}
-/// Component rows whose frame has come, inserted on the update that draws it (so the steps after it see them).
-fn timed_rows(world: &mut World) {
- let (advancing, f) = match world.get_resource::<PluginClock>() {
- Some(c) => (c.advancing, c.stepped),
- None => return,
- };
- if !advancing {
+/// Keyed rows whose frame has come, set on the update that draws it (so a plugin's steps after it see them): with a
+/// plugin, on the frame its clock steps to; without one, on the frame drawn, whichever way it was reached.
+fn keyed_rows(world: &mut World) {
+ // live play sets its rows from the game's state each frame (apply_live_rows), not from a timeline
+ if world.get_resource::<FrameRows>().is_some_and(|r| r.live.is_some()) {
return;
}
- let due: Vec<(Entity, String, Value)> = world.resource::<TimedRows>().0.iter().filter(|r| r.3 == f).map(|r| (r.0, r.1.clone(), r.2.clone())).collect();
- for (e, ty, v) in due {
- if let Err(err) = insert_reflect(world, e, &ty, &v) {
- world.resource_mut::<Error>().0 = Some(format!("component {ty}: {err}"));
+ let f = match world.get_resource::<PluginClock>() {
+ Some(c) if !c.advancing => return,
+ Some(c) => c.stepped,
+ None => match world.get_resource::<Clock>() {
+ Some(c) => c.0,
+ None => return,
+ },
+ };
+ let due: Vec<(Option<Entity>, String, Value, i64)> = {
+ let k = world.resource::<Keyed>();
+ let mut last: std::collections::HashMap<(Option<Entity>, &str), &(Option<Entity>, String, Value, i64)> = Default::default();
+ for r in k.rows.iter().filter(|r| r.3 <= f) {
+ let at = last.entry((r.0, r.1.as_str())).or_insert(r);
+ if r.3 >= at.3 {
+ *at = r;
+ }
}
+ last.into_values().filter(|r| k.applied.get(&(r.0, r.1.clone())) != Some(&r.3)).cloned().collect()
+ };
+ for (e, ty, v, from) in due {
+ let done = match e {
+ Some(e) => insert_reflect(world, e, &ty, &v).map_err(|err| format!("component {ty}: {err}")),
+ None => insert_reflect_resource(world, &ty, &v).map_err(|err| format!("resource {ty}: {err}")),
+ };
+ if let Err(err) = done {
+ world.resource_mut::<Error>().0 = Some(err);
+ }
+ world.resource_mut::<Keyed>().applied.insert((e, ty), from);
}
}
@@ -250,64 +283,43 @@ pub fn apply_rows(world: &mut World, inserted: &[Tup], ents: &[Entity], dir: &Pa
world.insert_resource(raea_bevy_world::EntityNames(row_names));
world.insert_resource(Loading::default());
world.insert_resource(RenderImages::default());
- if !active(world) {
- // no plugin, so no frame clock: Bevy's own reflected components and resources (a camera's Projection, a
- // mesh's NotShadowReceiver) still apply at load, but one timed to a frame needs the clock
- if inserted.iter().any(|t| t.kind == "component" && t.vals.get("from").is_some_and(|f| f.num() > 0.0)) {
- return Err(format!("a <BevyComponent from> waits for its frame on a Bevy plugin's frame clock, and this build has no plugin compiled in (registered: {:?})", names()));
- }
- return apply_static(world, inserted, ents);
- }
- {
+ if active(world) {
let mut c = world.resource_mut::<PluginClock>();
c.stepped = 0;
c.advancing = false;
}
- world.resource_mut::<TimedRows>().0.clear();
let by_id: BTreeMap<&str, Entity> = inserted.iter().zip(ents).map(|(t, e)| (t.id.as_str(), *e)).collect();
for (t, &e) in inserted.iter().zip(ents) {
if t.kind == "mesh" && t.vals.get("driven").is_some_and(V::truthy) {
world.entity_mut(e).insert(Driven);
}
}
- for t in inserted {
- let value = |t: &Tup| -> Result<Value, String> { serde_json::from_str(&s(&t.vals, "value").unwrap_or_else(|| "null".into())).map_err(|e| format!("{} {}: value isn't JSON: {e}", t.kind, t.id)) };
- match t.kind.as_str() {
- "component" => {
- let ty = s(&t.vals, "type").ok_or_else(|| format!("component {}: needs type", t.id))?;
- let target = s(&t.vals, "target").ok_or_else(|| format!("component {}: needs target (a row's id)", t.id))?;
- let &e = by_id.get(target.as_str()).ok_or_else(|| format!("component {}: no row {target}", t.id))?;
- let v = value(t)?;
- let from = t.vals.get("from").map(V::num).unwrap_or(0.0) as i64;
- if from > 0 {
- world.resource_mut::<TimedRows>().0.push((e, ty, v, from));
- } else {
- insert_reflect(world, e, &ty, &v).map_err(|err| format!("component {} ({ty}): {err}", t.id))?;
- }
- }
- "resource" => {
- let ty = s(&t.vals, "type").ok_or_else(|| format!("resource {}: needs type", t.id))?;
- insert_reflect_resource(world, &ty, &value(t)?).map_err(|err| format!("resource {} ({ty}): {err}", t.id))?;
- }
- _ => {}
- }
- }
- Ok(())
-}
-
-/// The component and resource rows of an edit in a build without plugins: each applied at load through the registry.
-fn apply_static(world: &mut World, inserted: &[Tup], ents: &[Entity]) -> Result<(), String> {
- let by_id: BTreeMap<&str, Entity> = inserted.iter().zip(ents).map(|(t, e)| (t.id.as_str(), *e)).collect();
+ // Bevy's own reflected components and resources (a camera's Projection, a mesh's NotShadowReceiver) and a plugin's:
+ // those from frame 0 now, the rest kept for their frame (keyed_rows), in every build
+ let mut keyed = Keyed::default();
for t in inserted.iter().filter(|t| t.kind == "component" || t.kind == "resource") {
let ty = s(&t.vals, "type").ok_or_else(|| format!("{} {}: needs type", t.kind, t.id))?;
let v: Value = serde_json::from_str(&s(&t.vals, "value").unwrap_or_else(|| "null".into())).map_err(|e| format!("{} {}: value isn't JSON: {e}", t.kind, t.id))?;
- if t.kind == "resource" {
- insert_reflect_resource(world, &ty, &v).map_err(|err| format!("resource {} ({ty}): {err}", t.id))?;
- continue;
+ let target = if t.kind == "resource" {
+ None
+ } else {
+ let target = s(&t.vals, "target").ok_or_else(|| format!("component {}: needs target (a row's id)", t.id))?;
+ Some(*by_id.get(target.as_str()).ok_or_else(|| format!("component {}: no row {target}", t.id))?)
+ };
+ let from = t.vals.get("from").map(V::num).unwrap_or(0.0) as i64;
+ if from <= 0 {
+ match target {
+ Some(e) => insert_reflect(world, e, &ty, &v).map_err(|err| format!("component {} ({ty}): {err}", t.id))?,
+ None => insert_reflect_resource(world, &ty, &v).map_err(|err| format!("resource {} ({ty}): {err}", t.id))?,
+ }
+ keyed.applied.insert((target, ty.clone()), 0);
}
- let target = s(&t.vals, "target").ok_or_else(|| format!("component {}: needs target (a row's id)", t.id))?;
- let &e = by_id.get(target.as_str()).ok_or_else(|| format!("component {}: no row {target}", t.id))?;
- insert_reflect(world, e, &ty, &v).map_err(|err| format!("component {} ({ty}): {err}", t.id))?;
+ keyed.rows.push((target, ty, v, from.max(0)));
+ }
+ // kept only when a row waits for a frame (a still edit's rows are all applied now)
+ if !keyed.rows.iter().any(|r| r.3 > 0) {
+ keyed = Keyed::default();
}
+ world.insert_resource(keyed);
Ok(())
}
diff --git a/runtime/plugins/src/reflect.rs b/runtime/plugins/src/reflect.rs
index 657fa02a..acd979c2 100644
--- a/runtime/plugins/src/reflect.rs
+++ b/runtime/plugins/src/reflect.rs
@@ -54,6 +54,9 @@ pub fn registration<'a>(reg: &'a TypeRegistry, path: &str) -> Result<&'a TypeReg
/// One component from JSON onto an entity, through the TypeRegistry: the generic path every plugin component takes.
pub fn insert_reflect(world: &mut World, e: Entity, path: &str, json: &Value) -> Result<(), String> {
+ if let Some(material) = path.strip_prefix("material:") {
+ return patch_material(world, e, material, json);
+ }
let registry = world.resource::<AppTypeRegistry>().clone();
let reg = registry.read();
let r = registration(&reg, path)?;
@@ -209,3 +212,35 @@ pub fn schema(world: &World, keep: &dyn Fn(&str) -> bool) -> Value {
}
json!({"roots": roots, "types": types})
}
+
+/// A part whose material a `material:` row patched has a copy of its own (its handle may be one other parts share,
+/// runtime/scene3d share.rs).
+#[derive(Component)]
+pub struct OwnMaterial;
+
+/// The fields given (a partial StandardMaterial in reflect's JSON) set on the part's own material asset: a
+/// StandardMaterial's `animate` of a field the row columns don't carry (docs/control.feature FC1c), keyed like a
+/// component. The first patch makes the part's copy of its material.
+pub fn patch_material(world: &mut World, e: Entity, path: &str, json: &Value) -> Result<(), String> {
+ if registration(&world.resource::<AppTypeRegistry>().read(), path)?.type_id() != std::any::TypeId::of::<StandardMaterial>() {
+ return Err(format!("material:{path}: only a StandardMaterial's fields animate this way"));
+ }
+ let registry = world.resource::<AppTypeRegistry>().clone();
+ let reg = registry.read();
+ let v = value_of(world, &reg, registration(&reg, path)?, path, json)?;
+ let Some(h) = world.get::<MeshMaterial3d<StandardMaterial>>(e).map(|m| m.0.clone()) else {
+ return Err(format!("material:{path}: the part has no StandardMaterial"));
+ };
+ let h = if world.get::<OwnMaterial>(e).is_some() {
+ h
+ } else {
+ let mut mats = world.resource_mut::<Assets<StandardMaterial>>();
+ let own = mats.get(&h).cloned().ok_or_else(|| format!("material:{path}: its material isn't loaded"))?;
+ let nh = mats.add(own);
+ world.entity_mut(e).insert((MeshMaterial3d(nh.clone()), OwnMaterial));
+ nh
+ };
+ let mut mats = world.resource_mut::<Assets<StandardMaterial>>();
+ let Some(mut m) = mats.get_mut(&h) else { return Err(format!("material:{path}: its material isn't loaded")) };
+ PartialReflect::try_apply(&mut *m, v.as_partial_reflect()).map_err(|err| format!("material:{path}: {err}"))
+}
diff --git a/runtime/react/src/commits.rs b/runtime/react/src/commits.rs
index 868b37c6..549b1934 100644
--- a/runtime/react/src/commits.rs
+++ b/runtime/react/src/commits.rs
@@ -77,6 +77,12 @@ pub(crate) fn apply_commits(
}
}
ents.by_id.insert(ROOT_ID, root);
+ // the next scene reads everything again (scene/read.rs Kept3d)
+ commands.queue(|world: &mut World| {
+ if let Some(mut k) = world.get_resource_mut::<crate::scene::Kept3d>() {
+ k.all = true;
+ }
+ });
}
"create" => {
let mut p = ReactProps::default();
@@ -96,6 +102,9 @@ pub(crate) fn apply_commits(
}
"append" => {
if let (Some(p), Some(c)) = (id("parent").and_then(|i| ents.by_id.get(&i)), id("child").and_then(|i| ents.by_id.get(&i))) {
+ // a move: the parent it leaves is read again (scene/read.rs touch_parent)
+ let moved = *c;
+ commands.queue(move |world: &mut World| crate::scene::touch_parent(world, moved));
commands.entity(*p).add_child(*c);
}
}
@@ -106,6 +115,7 @@ pub(crate) fn apply_commits(
id("before").and_then(|i| ents.by_id.get(&i)),
) {
commands.queue(move |world: &mut World| {
+ crate::scene::touch_parent(world, c);
let kids: Vec<Entity> = world.get::<Children>(p).map(|ks| ks.iter().filter(|e| *e != c).collect()).unwrap_or_default();
let at = kids.iter().position(|e| *e == b).unwrap_or(kids.len());
world.entity_mut(p).insert_children(at, &[c]);
@@ -127,6 +137,7 @@ pub(crate) fn apply_commits(
gone.push((n.0, e));
}
}
+ crate::scene::touch_parent(world, c);
let mut ents = world.resource_mut::<ReactEntities>();
for (i, e) in gone {
if ents.by_id.get(&i) == Some(&e) {
diff --git a/runtime/react/src/scene.rs b/runtime/react/src/scene.rs
index a772ed61..da9c956a 100644
--- a/runtime/react/src/scene.rs
+++ b/runtime/react/src/scene.rs
@@ -2,7 +2,6 @@
//! frame (settle.rs), the 3D drawn in an App (ScenePlugin in plugin.rs), and the native calls a
//! composition makes for its scene, physics and matchmove. raea-runtime-export renders the frames to files.
-use std::collections::HashMap;
use std::path::{Path, PathBuf};
use bevy::prelude::*;
@@ -40,9 +39,9 @@ pub mod track;
thread_local! {
/// each part's data-props as last parsed: its text and the props, and the scene it was last read in
- static PROPS3D: std::cell::RefCell<HashMap<Entity, (String, std::sync::Arc<Map<String, Value>>, u64)>> = std::cell::RefCell::new(HashMap::new());
+ static PROPS3D: std::cell::RefCell<bevy::ecs::entity::EntityHashMap<(String, std::sync::Arc<Map<String, Value>>, u64)>> = std::cell::RefCell::new(Default::default());
/// each part's data-3d and data-shape as last read, shared
- static NAMES3D: std::cell::RefCell<HashMap<Entity, (std::sync::Arc<str>, Option<std::sync::Arc<str>>)>> = std::cell::RefCell::new(HashMap::new());
+ static NAMES3D: std::cell::RefCell<bevy::ecs::entity::EntityHashMap<(std::sync::Arc<str>, Option<std::sync::Arc<str>>)>> = std::cell::RefCell::new(Default::default());
/// scenes read (scene_of): what's in PROPS3D but not read in the last two is let go
static SCENE3D: std::cell::Cell<u64> = const { std::cell::Cell::new(0) };
}
diff --git a/runtime/react/src/scene/holders.rs b/runtime/react/src/scene/holders.rs
index 9a2244b1..3fd778f4 100644
--- a/runtime/react/src/scene/holders.rs
+++ b/runtime/react/src/scene/holders.rs
@@ -10,25 +10,16 @@ pub fn scene_of(world: &mut World) -> Vec<Node3> {
});
if now % 120 == 0 {
PROPS3D.with(|c| c.borrow_mut().retain(|_, v| v.2 + 2 >= now));
+ if world.contains_resource::<Kept3d>() {
+ world.resource_scope(|w, mut k: Mut<Kept3d>| k.of.retain(|e, _| w.get_entity(*e).is_ok()));
+ }
}
let mut q = world.query::<(Entity, &ReactKind, Option<&ReactProps>)>();
let Some(surf) = q.iter(world).find(|(_, k, p)| k.0 == "surface" && p.and_then(|p| p.0.get("id")).and_then(|v| v.as_str()) == Some("motion")).map(|(e, _, _)| e) else { return Vec::new() };
- fn walk(world: &World, e: Entity, out: &mut Vec<Node3>) {
- if world.get::<ReactProps>(e).is_some_and(|p| p.0.contains_key("data-3d")) {
- if let Some(n) = read3d(world, e) {
- out.push(n);
- }
- return;
- }
- if let Some(c) = world.get::<Children>(e) {
- for k in c.iter() {
- walk(world, k, out);
- }
- }
- }
- let mut out = Vec::new();
- walk(world, surf, &mut out);
- out
+ // the 3D roots under the surface (a data-3d element stops the walk; its 3D is read3d's), each subtree no commit
+ // touched since the last scene handed on as it was (read.rs Kept3d)
+ let dirty = dirty3d(world);
+ world.resource_scope(|world, mut kept: Mut<Kept3d>| contrib3d(world, surf, &mut kept, &dirty).to_vec())
}
/// The page elements holding the frame's 3D (each 3D root's ancestors up to the surface, nearest first) with their
diff --git a/runtime/react/src/scene/read.rs b/runtime/react/src/scene/read.rs
index 3d75c682..e2fc4d35 100644
--- a/runtime/react/src/scene/read.rs
+++ b/runtime/react/src/scene/read.rs
@@ -44,7 +44,8 @@ pub(crate) fn names3d(e: Entity, kind: &str, shape: Option<&str>) -> (std::sync:
return (k.clone(), s.clone());
}
let v: (std::sync::Arc<str>, Option<std::sync::Arc<str>>) = (kind.into(), shape.map(Into::into));
- if c.len() > 8192 {
+ // bounded well past a big scene's parts (many_cubes has 10,000; at 8,192 it was cleared every frame)
+ if c.len() > 1 << 17 {
c.clear();
}
c.insert(e, v.clone());
@@ -71,7 +72,86 @@ pub(crate) fn props_in_place(m: &mut Map<String, Value>, text: &str) -> bool {
ok && n == m.len()
}
-pub(crate) fn read3d(world: &World, e: Entity) -> Option<Node3> {
+/// What each React entity puts into its 3D parent's kids, kept across scenes: a part is one node, a plain element the
+/// 3D under it. Only the entities touched since the last scene, and their ancestors, are read again; the rest are
+/// handed on for an Arc's count (docs/control.feature FC1b: many_cubes' 10,000 parts were re-read for a camera's move)
+#[derive(Resource, Default)]
+pub struct Kept3d {
+ pub(crate) of: bevy::ecs::entity::EntityHashMap<std::sync::Arc<[Node3]>>,
+ /// parents a commit took a child from (Bevy drops an empty Children, which no change filter sees)
+ pub(crate) touched: Vec<Entity>,
+ /// everything to be read again (a reset, the first scene)
+ pub(crate) all: bool,
+}
+
+/// The entities whose props or children changed since the last scene, by Bevy's change ticks
+#[derive(Resource)]
+pub(crate) struct Watch3d(bevy::ecs::system::SystemState<Query<'static, 'static, Entity, Or<(Changed<ReactProps>, Changed<Children>, Changed<ChildOf>)>>>);
+
+/// A commit's note that `e`'s parent loses it (a remove, or a move by append or insert)
+pub(crate) fn touch_parent(world: &mut World, e: Entity) {
+ if let Some(p) = world.get::<ChildOf>(e).map(|c| c.parent())
+ && let Some(mut k) = world.get_resource_mut::<Kept3d>()
+ {
+ k.touched.push(p);
+ }
+}
+
+/// The entities to read again: those changed since the last scene and every ancestor of each
+pub(crate) fn dirty3d(world: &mut World) -> bevy::ecs::entity::EntityHashSet {
+ if !world.contains_resource::<Watch3d>() {
+ let s = bevy::ecs::system::SystemState::new(world);
+ world.insert_resource(Watch3d(s));
+ world.insert_resource(Kept3d { all: true, ..default() });
+ }
+ // None: the watch couldn't be read, so everything is read again
+ let seen: Option<Vec<Entity>> = world.resource_scope(|world, mut w: Mut<Watch3d>| w.0.get(world).ok().map(|q| q.iter().collect()));
+ let all = seen.is_none();
+ let mut seeds = seen.unwrap_or_default();
+ // what's changed directly on the World after this (not by a system) has a newer tick than this read
+ world.increment_change_tick();
+ let mut kept = world.resource_mut::<Kept3d>();
+ seeds.append(&mut kept.touched);
+ if std::mem::take(&mut kept.all) || all {
+ kept.of.clear();
+ }
+ let mut dirty = bevy::ecs::entity::EntityHashSet::default();
+ for mut e in seeds {
+ while dirty.insert(e) {
+ match world.get::<ChildOf>(e) {
+ Some(c) => e = c.parent(),
+ None => break,
+ }
+ }
+ }
+ let mut kept = world.resource_mut::<Kept3d>();
+ // let go before reading, so a part's props can be updated in place where nothing else holds them
+ for e in &dirty {
+ kept.of.remove(e);
+ }
+ dirty
+}
+
+/// What `e` puts into its 3D parent's kids: kept from the last scene when it isn't dirty
+pub(crate) fn contrib3d(world: &World, e: Entity, kept: &mut Kept3d, dirty: &bevy::ecs::entity::EntityHashSet) -> std::sync::Arc<[Node3]> {
+ if !dirty.contains(&e)
+ && let Some(c) = kept.of.get(&e)
+ {
+ return c.clone();
+ }
+ let c: std::sync::Arc<[Node3]> = match read3d(world, e, kept, dirty) {
+ Some(n) => std::sync::Arc::new([n]),
+ None => {
+ let mut v = Vec::new();
+ kids3d(world, e, kept, dirty, &mut v);
+ v.into()
+ }
+ };
+ kept.of.insert(e, c.clone());
+ c
+}
+
+pub(crate) fn read3d(world: &World, e: Entity, kept: &mut Kept3d, dirty: &bevy::ecs::entity::EntityHashSet) -> Option<Node3> {
let p = world.get::<ReactProps>(e)?;
let (kind, shape) = names3d(e, p.0.get("data-3d")?.as_str()?, p.0.get("data-shape").and_then(|v| v.as_str()));
let props = props3d(e, p.0.get("data-props").and_then(|v| v.as_str()));
@@ -89,23 +169,20 @@ pub(crate) fn read3d(world: &World, e: Entity) -> Option<Node3> {
mat.insert(k.into(), x.clone());
}
}
- Node3 { kind: "Mesh".into(), props: std::sync::Arc::new(p), shape: mesh.get("shape").and_then(Value::as_str).map(Into::into), kids: vec![Node3 { kind: "MeshStandardMaterial".into(), props: std::sync::Arc::new(mat), shape: None, kids: Vec::new() }] }
- }).collect();
- return Some(Node3 { kind, props: std::sync::Arc::default(), shape: None, kids });
+ Node3 { kind: "Mesh".into(), props: std::sync::Arc::new(p), shape: mesh.get("shape").and_then(Value::as_str).map(Into::into), kids: std::sync::Arc::new([Node3 { kind: "MeshStandardMaterial".into(), props: std::sync::Arc::new(mat), shape: None, kids: Vec::new().into() }]) }
+ }).collect::<Vec<_>>();
+ return Some(Node3 { kind, props: std::sync::Arc::default(), shape: None, kids: kids.into() });
}
let mut kids = Vec::new();
- kids3d(world, e, &mut kids);
- Some(Node3 { kind, props, shape, kids })
+ kids3d(world, e, kept, dirty, &mut kids);
+ Some(Node3 { kind, props, shape, kids: kids.into() })
}
/// The 3D children of `e`, looking through plain elements between them (a Sequence's or a component's wrapper div
/// inside a Canvas3D), so 3D timed by a Sequence is still the scene's.
-pub(crate) fn kids3d(world: &World, e: Entity, out: &mut Vec<Node3>) {
+pub(crate) fn kids3d(world: &World, e: Entity, kept: &mut Kept3d, dirty: &bevy::ecs::entity::EntityHashSet, out: &mut Vec<Node3>) {
let Some(children) = world.get::<Children>(e) else { return };
for k in children.iter() {
- match read3d(world, k) {
- Some(n) => out.push(n),
- None => kids3d(world, k, out),
- }
+ out.extend(contrib3d(world, k, kept, dirty).iter().cloned());
}
}
diff --git a/runtime/scene/src/fast.rs b/runtime/scene/src/fast.rs
index 1b25094b..11b6fa33 100644
--- a/runtime/scene/src/fast.rs
+++ b/runtime/scene/src/fast.rs
@@ -4,6 +4,8 @@ use super::*;
/// the most values a part keys in a frame: placement (9), animation (1, 8 mixed, 32 graph), morphs (64) and a few more
const WANT: usize = 128;
+/// The placement columns, sent unrounded: they are already f32 (docs/control.feature FC1d).
+const PLACE: [&str; 10] = ["x", "y", "z", "q_x", "q_y", "q_z", "q_w", "scale_x", "scale_y", "scale_z"];
impl LiveScene {
/// `diff(current(f))` for a frame whose parts are all known, without the rows: each known part's changing values worked out into a fixed array and held
@@ -82,7 +84,7 @@ impl LiveScene {
}
}
}
- let amb = its.iter().filter(|i| i.kind == "ambient").map(|i| n(&i.props, "intensity", 1.0)).sum::<f64>() * AMBIENT;
+ let amb = its.iter().filter(|i| i.kind == "ambient").map(|i| light_power("ambient", &i.props)).sum::<f64>();
cam[7].1 = if amb > 0.0 { Some(r6(amb)) } else { self.cam.contains_key("ambient").then_some(0.0) };
let mut vals = BTreeMap::new();
for (k, v) in cam {
@@ -117,14 +119,15 @@ impl LiveScene {
let mut want: [(&str, Option<f64>); WANT] = [("", None); WANT];
let mut nw = 0usize;
let mut put = |k: &'static str, v: f64| {
- want[nw] = (k, Some(r6(v)));
+ // a Transform's columns as the World's f32 holds them (FC1d), the rest to 6 decimals
+ want[nw] = (k, Some(if PLACE.contains(&k) { v } else { r6(v) }));
nw += 1;
};
let mut color: Option<std::borrow::Cow<str>> = None;
let place = |put: &mut dyn FnMut(&'static str, f64)| {
let (s, q, t) = it.world.to_scale_rotation_translation();
- let (ry, rx, rz) = q.to_euler(EulerRot::YXZ);
- for (name, v) in [("x", t.x), ("y", t.y), ("z", t.z), ("rot_x", rx), ("rot_y", ry), ("rot_z", rz)] {
+ // Bevy's quaternion as it is (docs/control.feature FC1d)
+ for (name, v) in [("x", t.x), ("y", t.y), ("z", t.z), ("q_x", q.x), ("q_y", q.y), ("q_z", q.z), ("q_w", q.w)] {
put(name, v as f64);
}
let sc = [s.x as f64, s.y as f64, s.z as f64];
@@ -137,7 +140,7 @@ impl LiveScene {
let kind: &'static str = match it.kind {
"directional" | "point" | "spot" | "rect" => {
let dir = it.kind == "directional";
- put(if dir { "lux" } else { "lumens" }, n(&it.props, "intensity", 1.0) * if dir { LUX } else { LUMENS } * 1.0);
+ put(if dir { "lux" } else { "lumens" }, light_power(it.kind, &it.props));
let v = vec3(&it.props, "position", if dir { [0.0, 1.0, 0.0] } else { [0.0; 3] });
let w = it.world.transform_point3(Vec3::new(v[0] as f32, v[1] as f32, v[2] as f32));
let pos = [w.x as f64, w.y as f64, w.z as f64];
diff --git a/runtime/scene/src/lib.rs b/runtime/scene/src/lib.rs
index 9bee5271..517aee43 100644
--- a/runtime/scene/src/lib.rs
+++ b/runtime/scene/src/lib.rs
@@ -7,7 +7,7 @@
use std::collections::BTreeMap;
-use bevy::math::{EulerRot, Mat4, Vec3};
+use bevy::math::{Mat4, Vec3};
use raea_core_program::ir::{Program, V};
use serde_json::{Map, Value};
@@ -28,6 +28,7 @@ mod fast;
mod splat;
/// 2D parts' rows (<Sprite>, <Shape2D>).
mod sprite2d;
+/// <Instances>: a mesh or model row's placements (its `inst` column).
/// Baked simulations' and glitches' rows (<MeshSequence>, <Goo>, glitch props).
mod meshseq;
@@ -44,7 +45,7 @@ fn walk(n: &Node3, parent: Mat4, out: &mut Vec<Item>) {
out.push(it);
}
let start = out.len();
- for k in &n.kids {
+ for k in n.kids.iter() {
walk(k, w, out);
}
// a group's composition pass (`pass`) is every part's inside it that doesn't name its own
@@ -58,7 +59,7 @@ fn walk(n: &Node3, parent: Mat4, out: &mut Vec<Item>) {
// theirs more closely)
"Refinish" => {
let start = out.len();
- for k in &n.kids {
+ for k in n.kids.iter() {
walk(k, parent, out);
}
let Some(Value::Array(given)) = n.props.get("materials") else { return };
@@ -81,7 +82,7 @@ fn walk(n: &Node3, parent: Mat4, out: &mut Vec<Item>) {
bevy_parts(n, &mut it);
out.push(it);
// a mesh's children (three.js parents meshes to meshes) move with it
- for k in &n.kids {
+ for k in n.kids.iter() {
walk(k, w, out);
}
}
@@ -174,7 +175,7 @@ fn walk(n: &Node3, parent: Mat4, out: &mut Vec<Item>) {
// a compute shader run before the cameras draw (<Compute>, docs/shaders.feature SH10)
"Compute" => out.push(item("compute", parent, None)),
_ => {
- for k in &n.kids {
+ for k in n.kids.iter() {
walk(k, parent, out);
}
}
@@ -231,20 +232,22 @@ fn pass_column(p: &mut Program, row: &mut BTreeMap<String, V>, id: &str, its: &[
}
}
-/// World position, rotation (raea-render's rot_y, rot_x, rot_z: YXZ) and scale of each frame.
+/// World position, rotation (Bevy's quaternion, q_x q_y q_z q_w: no Euler round trip, docs/control.feature FC1d) and
+/// scale of each frame; each frame's quaternion takes the sign nearer the frame before's, so keys turn the short way.
fn placement(p: &mut Program, row: &mut BTreeMap<String, V>, id: &str, its: &[Item]) {
- let per: Vec<[f64; 9]> = its.iter().map(|it| {
+ let mut prev = bevy::math::Quat::IDENTITY;
+ let per: Vec<[f64; 10]> = its.iter().map(|it| {
let (s, q, t) = it.world.to_scale_rotation_translation();
- let (ry, rx, rz) = q.to_euler(EulerRot::YXZ);
- [t.x as f64, t.y as f64, t.z as f64, rx as f64, ry as f64, rz as f64, s.x as f64, s.y as f64, s.z as f64]
+ prev = if q.dot(prev) < 0.0 { -q } else { q };
+ [t.x as f64, t.y as f64, t.z as f64, prev.x as f64, prev.y as f64, prev.z as f64, prev.w as f64, s.x as f64, s.y as f64, s.z as f64]
}).collect();
- for (k, name) in ["x", "y", "z", "rot_x", "rot_y", "rot_z"].iter().enumerate() {
- column(p, row, id, name, &per.iter().map(|t| t[k]).collect::<Vec<_>>());
+ for (k, name) in ["x", "y", "z", "q_x", "q_y", "q_z", "q_w"].iter().enumerate() {
+ exact(p, row, id, name, &per.iter().map(|t| t[k]).collect::<Vec<_>>());
}
- let sc: Vec<[f64; 3]> = per.iter().map(|t| [t[6], t[7], t[8]]).collect();
+ let sc: Vec<[f64; 3]> = per.iter().map(|t| [t[7], t[8], t[9]]).collect();
if sc.iter().any(|s| s.iter().any(|v| (v - 1.0).abs() > 1e-9)) {
for (k, name) in ["scale_x", "scale_y", "scale_z"].iter().enumerate() {
- column(p, row, id, name, &sc.iter().map(|s| s[k]).collect::<Vec<_>>());
+ exact(p, row, id, name, &sc.iter().map(|s| s[k]).collect::<Vec<_>>());
}
}
}
@@ -330,7 +333,7 @@ impl Tracks {
fn rows_into_of(all: &[Vec<Item>], tr: &Tracks, p: &mut Program) {
let names = pass_names(all);
- resources_rows(all, p);
+ resources(p, all);
surface_shader_rows(all, p);
ordered_shader_rows(all, p, "frame_pass");
ordered_shader_rows(all, p, "compute");
diff --git a/runtime/scene/src/live.rs b/runtime/scene/src/live.rs
index 6c9f67ce..ab4cda63 100644
--- a/runtime/scene/src/live.rs
+++ b/runtime/scene/src/live.rs
@@ -56,10 +56,10 @@ pub(crate) const MORPH_COLS: [&str; 64] = ["morph0", "morph1", "morph2", "morph3
pub(crate) fn live_dynamic(kind: &str) -> &'static [&'static str] {
match kind {
"light" => &["lux", "lumens", "x", "y", "z", "dir_x", "dir_y", "dir_z"],
- "mesh" => &["x", "y", "z", "rot_x", "rot_y", "rot_z", "scale_x", "scale_y", "scale_z", "visible", "col_r", "col_g", "col_b", "rough", "metal", "emissive_k", "opacity", "sh_r", "sh_g", "sh_b", "rim_k", "spec_k", "outline_w", "pass"],
- "model" => &["x", "y", "z", "rot_x", "rot_y", "rot_z", "scale_x", "scale_y", "scale_z", "visible", "anim_t", "mix0_t", "mix0_w", "mix1_t", "mix1_w", "mix2_t", "mix2_w", "mix3_t", "mix3_w", "morph0", "morph1", "morph2", "morph3", "morph4", "morph5", "morph6", "morph7", "morph8", "morph9", "morph10", "morph11", "morph12", "morph13", "morph14", "morph15", "morph16", "morph17", "morph18", "morph19", "morph20", "morph21", "morph22", "morph23", "morph24", "morph25", "morph26", "morph27", "morph28", "morph29", "morph30", "morph31", "morph32", "morph33", "morph34", "morph35", "morph36", "morph37", "morph38", "morph39", "morph40", "morph41", "morph42", "morph43", "morph44", "morph45", "morph46", "morph47", "morph48", "morph49", "morph50", "morph51", "morph52", "morph53", "morph54", "morph55", "morph56", "morph57", "morph58", "morph59", "morph60", "morph61", "morph62", "morph63", "g0_w", "g0_t", "g1_w", "g1_t", "g2_w", "g2_t", "g3_w", "g3_t", "g4_w", "g4_t", "g5_w", "g5_t", "g6_w", "g6_t", "g7_w", "g7_t", "g8_w", "g8_t", "g9_w", "g9_t", "g10_w", "g10_t", "g11_w", "g11_t", "g12_w", "g12_t", "g13_w", "g13_t", "g14_w", "g14_t", "g15_w", "g15_t", "look", "glitch_explode", "glitch_scramble", "glitch_jitter", "glitch_snap", "glitch_smear_x", "glitch_smear_y", "glitch_smear_z", "glitch_seed", "cloth_frame", "screen_power", "pass"],
- "panel" => &["x", "y", "z", "rot_x", "rot_y", "rot_z", "scale_x", "scale_y", "scale_z", "visible", "screen_power", "screen_bright", "pass"],
- "decal" => &["x", "y", "z", "rot_x", "rot_y", "rot_z", "scale_x", "scale_y", "scale_z", "visible", "col_r", "col_g", "col_b", "opacity", "rough", "metal"],
+ "mesh" => &["x", "y", "z", "q_x", "q_y", "q_z", "q_w", "scale_x", "scale_y", "scale_z", "visible", "col_r", "col_g", "col_b", "rough", "metal", "emissive_k", "opacity", "sh_r", "sh_g", "sh_b", "rim_k", "spec_k", "outline_w", "pass"],
+ "model" => &["x", "y", "z", "q_x", "q_y", "q_z", "q_w", "scale_x", "scale_y", "scale_z", "visible", "anim_t", "mix0_t", "mix0_w", "mix1_t", "mix1_w", "mix2_t", "mix2_w", "mix3_t", "mix3_w", "morph0", "morph1", "morph2", "morph3", "morph4", "morph5", "morph6", "morph7", "morph8", "morph9", "morph10", "morph11", "morph12", "morph13", "morph14", "morph15", "morph16", "morph17", "morph18", "morph19", "morph20", "morph21", "morph22", "morph23", "morph24", "morph25", "morph26", "morph27", "morph28", "morph29", "morph30", "morph31", "morph32", "morph33", "morph34", "morph35", "morph36", "morph37", "morph38", "morph39", "morph40", "morph41", "morph42", "morph43", "morph44", "morph45", "morph46", "morph47", "morph48", "morph49", "morph50", "morph51", "morph52", "morph53", "morph54", "morph55", "morph56", "morph57", "morph58", "morph59", "morph60", "morph61", "morph62", "morph63", "g0_w", "g0_t", "g1_w", "g1_t", "g2_w", "g2_t", "g3_w", "g3_t", "g4_w", "g4_t", "g5_w", "g5_t", "g6_w", "g6_t", "g7_w", "g7_t", "g8_w", "g8_t", "g9_w", "g9_t", "g10_w", "g10_t", "g11_w", "g11_t", "g12_w", "g12_t", "g13_w", "g13_t", "g14_w", "g14_t", "g15_w", "g15_t", "look", "glitch_explode", "glitch_scramble", "glitch_jitter", "glitch_snap", "glitch_smear_x", "glitch_smear_y", "glitch_smear_z", "glitch_seed", "cloth_frame", "screen_power", "pass"],
+ "panel" => &["x", "y", "z", "q_x", "q_y", "q_z", "q_w", "scale_x", "scale_y", "scale_z", "visible", "screen_power", "screen_bright", "pass"],
+ "decal" => &["x", "y", "z", "q_x", "q_y", "q_z", "q_w", "scale_x", "scale_y", "scale_z", "visible", "col_r", "col_g", "col_b", "opacity", "rough", "metal"],
_ => &[],
}
}
@@ -331,7 +331,7 @@ mod tests {
use serde_json::json;
fn model(props: Value) -> Node3 {
- Node3 { kind: "Model".into(), props: std::sync::Arc::new(props.as_object().unwrap().clone()), shape: None, kids: vec![] }
+ Node3 { kind: "Model".into(), props: std::sync::Arc::new(props.as_object().unwrap().clone()), shape: None, kids: Vec::new().into() }
}
fn person(who: &str) -> Vec<Node3> {
diff --git a/runtime/scene/src/models.rs b/runtime/scene/src/models.rs
index 346789ab..c6717431 100644
--- a/runtime/scene/src/models.rs
+++ b/runtime/scene/src/models.rs
@@ -130,6 +130,8 @@ pub(crate) fn models_rows(tr: &Tracks, names: &[String], p: &mut Program) {
meshseq::cloth_columns(p, &mut row, &id, &its);
placement(p, &mut row, &id, &its);
visible(p, &mut row, &id, &track);
+ instances_column(&mut row, &its);
+ model_shadows(&mut row, &its);
pass_column(p, &mut row, &id, &its, &names);
p.spawns.push(("model".into(), vec![row]));
components(p, &id, &its);
diff --git a/runtime/scene/src/parts.rs b/runtime/scene/src/parts.rs
index e9db3e72..57a3786e 100644
--- a/runtime/scene/src/parts.rs
+++ b/runtime/scene/src/parts.rs
@@ -1,18 +1,5 @@
use super::*;
-/// a compiled-in Bevy plugin's resources (<BevyResource>), from the first frame
-pub(crate) fn resources_rows(all: &[Vec<Item>], p: &mut Program) {
- if let Some(f0) = all.first() {
- for (k, it) in f0.iter().filter(|it| it.kind == "resource").enumerate() {
- let mut row = BTreeMap::new();
- row.insert("id".into(), V::S(format!("res{k}")));
- row.insert("type".into(), V::S(it.props.get("type").and_then(Value::as_str).unwrap_or("").to_string()));
- row.insert("value".into(), V::S(it.props.get("value").cloned().unwrap_or(Value::Null).to_string()));
- p.spawns.push(("resource".into(), vec![row]));
- }
- }
-}
-
/// the scene's <SurfaceShader>, from the first frame: its spec as JSON (raea-runtime-scene3d's shaded.rs)
pub(crate) fn surface_shader_rows(all: &[Vec<Item>], p: &mut Program) {
let Some(f0) = all.first() else { return };
@@ -53,8 +40,7 @@ pub(crate) fn lights_rows(all: &[Vec<Item>], tr: &Tracks, p: &mut Program) {
}
// a missing frame is a dark one
let on: Vec<f64> = track.iter().map(|t| t.is_some() as u8 as f64).collect();
- let k = if kind == "directional" { LUX } else { LUMENS };
- let power: Vec<f64> = its.iter().zip(&on).map(|(i, o)| n(&i.props, "intensity", 1.0) * k * o).collect();
+ let power: Vec<f64> = its.iter().zip(&on).map(|(i, o)| light_power(kind, &i.props) * o).collect();
column(p, &mut row, &id, if kind == "directional" { "lux" } else { "lumens" }, &power);
let pos: Vec<[f64; 3]> = its.iter().map(|i| {
let v = vec3(&i.props, "position", if kind == "directional" { [0.0, 1.0, 0.0] } else { [0.0; 3] });
@@ -250,9 +236,11 @@ pub(crate) fn meshes_rows(tr: &Tracks, names: &[String], p: &mut Program) {
row.insert("receive".into(), V::N(0.0));
}
layers_column(&mut row, &its[0].props);
+ instances_column(&mut row, &its);
name_column(&mut row, &its[0].props);
p.spawns.push(("mesh".into(), vec![row]));
components(p, &id, &its);
+ material_fields(p, &id, &its);
}
}
diff --git a/runtime/scene3d/src/instance.rs b/runtime/scene3d/src/instance.rs
new file mode 100644
index 00000000..4b57c10b
--- /dev/null
+++ b/runtime/scene3d/src/instance.rs
@@ -0,0 +1,141 @@
+//! <Instances> drawn (sdk/render 3d/instances.tsx, the rows' `inst` column, runtime/scene's instances.rs): one child
+//! a copy, each sharing the mesh and material handles, which Bevy's automatic batching draws as one instanced call per
+//! mesh. A mesh row's own Mesh3d moves onto its copies at spawn; a model's scene is copied once it's settled (its
+//! surfaces on), then the scene it was copied from is despawned. The parent keeps its transform, visibility and (a
+//! mesh's) material, so sync_meshes still moves, hides and recolours the whole set.
+
+use super::*;
+use bevy::camera::visibility::RenderLayers;
+use bevy::light::{NotShadowCaster, NotShadowReceiver};
+use bevy::mesh::skinning::SkinnedMesh;
+
+/// A mesh or model entity drawn as instances: what sync_meshes moves in place of its Mesh3d.
+#[derive(Component)]
+pub struct Instanced;
+
+/// A row's `inst`: 10 numbers a copy (position, rotation xyzw, scale).
+pub fn placements(t: &Tup) -> Result<Option<Vec<Transform>>, String> {
+ let Some(V::S(s)) = t.vals.get("inst") else { return Ok(None) };
+ let n: Vec<f32> = s.split_ascii_whitespace().map(|x| x.parse::<f32>().map_err(|e| format!("{}: inst: {e}", t.id))).collect::<Result<_, _>>()?;
+ if n.len() % 10 != 0 {
+ return Err(format!("{}: inst is 10 numbers a copy, got {}", t.id, n.len()));
+ }
+ Ok(Some(n.chunks(10).map(|c| Transform { translation: Vec3::new(c[0], c[1], c[2]), rotation: Quat::from_xyzw(c[3], c[4], c[5], c[6]).normalize(), scale: Vec3::new(c[7], c[8], c[9]) }).collect()))
+}
+
+/// The markers a copy takes from its parent: shadows cast and received, render layers.
+fn markers(world: &World, e: Entity) -> (bool, bool, Option<RenderLayers>) {
+ (world.get::<NotShadowCaster>(e).is_some(), world.get::<NotShadowReceiver>(e).is_some(), world.get::<RenderLayers>(e).cloned())
+}
+
+fn spawn_copy(world: &mut World, parent: Entity, mesh: Mesh3d, mat: MeshMaterial3d<StandardMaterial>, at: Transform, (no_cast, no_receive, layers): &(bool, bool, Option<RenderLayers>)) {
+ let mut c = world.spawn((mesh, mat, at, ChildOf(parent)));
+ if *no_cast {
+ c.insert(NotShadowCaster);
+ }
+ if *no_receive {
+ c.insert(NotShadowReceiver);
+ }
+ if let Some(l) = layers {
+ c.insert(l.clone());
+ }
+}
+
+/// A mesh row with `inst`, after its spawn (shadows and layers on): its Mesh3d onto one child a copy.
+pub fn instance_mesh(world: &mut World, e: Entity, t: &Tup) -> Result<(), String> {
+ let Some(at) = placements(t)? else { return Ok(()) };
+ if t.vals.contains_key("shader") {
+ return Err(format!("mesh {}: instances take a standard surface (a shader over them isn't instanced yet)", t.id));
+ }
+ let Some(mat) = world.get::<MeshMaterial3d<StandardMaterial>>(e).cloned() else {
+ return Err(format!("mesh {}: instances take a MeshStandardMaterial, MeshPhysicalMaterial or MeshBasicMaterial (not toon, grid, wear or shadow-only)", t.id));
+ };
+ let Some(mesh) = world.entity_mut(e).take::<Mesh3d>() else { return Err(format!("mesh {}: no mesh to instance", t.id)) };
+ let m = markers(world, e);
+ world.entity_mut(e).insert(Instanced);
+ for tr in at {
+ spawn_copy(world, e, mesh.clone(), mat.clone(), tr, &m);
+ }
+ Ok(())
+}
+
+/// A model row's placements, kept on its Model3d until its scene is copied (`instance_models`).
+pub fn model_placements(t: &Tup) -> Result<Option<Vec<Transform>>, String> {
+ let at = placements(t)?;
+ if at.is_some() && ["anim", "mix", "graph", "morph_names"].iter().any(|k| t.vals.contains_key(*k)) {
+ return Err(format!("model {}: instances can't play a clip or set morphs", t.id));
+ }
+ Ok(at)
+}
+
+/// Each instanced model whose scene is settled: its meshes (with their places in the model) copied to every placement,
+/// then the scene despawned. Before then the model isn't settled, so await_models holds the first frame for it.
+pub fn instance_models(world: &mut World) {
+ let mut q = world.query::<(Entity, &Model3d)>();
+ let todo: Vec<Entity> = q.iter(world).filter(|(_, m)| m.inst.is_some() && m.ready() && m.surfaces.is_empty() && m.toon.is_empty() && m.shaders.is_empty()).map(|(e, _)| e).collect();
+ for e in todo {
+ let at = world.get_mut::<Model3d>(e).and_then(|mut m| m.inst.take()).unwrap_or_default();
+ let src = world.get::<Model3d>(e).map(|m| m.src.clone()).unwrap_or_default();
+ let roots: Vec<Entity> = world.get::<Children>(e).map(|c| c.iter().collect()).unwrap_or_default();
+ // every mesh under the scene, with its place in the model (its transforms multiplied up to the model)
+ let mut parts: Vec<(Mesh3d, MeshMaterial3d<StandardMaterial>, Mat4)> = vec![];
+ let mut stack: Vec<(Entity, Mat4)> = roots.iter().map(|r| (*r, Mat4::IDENTITY)).collect();
+ let mut failed = None;
+ while let Some((d, above)) = stack.pop() {
+ let here = above * world.get::<Transform>(d).map(Transform::to_matrix).unwrap_or(Mat4::IDENTITY);
+ if let Some(mesh) = world.get::<Mesh3d>(d) {
+ if world.get::<SkinnedMesh>(d).is_some() {
+ failed = Some(format!("model {src}: a skinned mesh can't be instanced; use a <Model>"));
+ break;
+ }
+ match world.get::<MeshMaterial3d<StandardMaterial>>(d) {
+ Some(mat) => parts.push((mesh.clone(), mat.clone(), here)),
+ None => {
+ failed = Some(format!("model {src}: instances take its standard (glTF) materials; a toon, look or shader surface isn't instanced yet"));
+ break;
+ }
+ }
+ }
+ if let Some(kids) = world.get::<Children>(d) {
+ stack.extend(kids.iter().map(|k| (k, here)));
+ }
+ }
+ if let Some(f) = failed {
+ world.resource_mut::<Error>().0.get_or_insert(f);
+ continue;
+ }
+ let m = markers(world, e);
+ for tr in &at {
+ let place = tr.to_matrix();
+ for (mesh, mat, local) in &parts {
+ spawn_copy(world, e, mesh.clone(), mat.clone(), Transform::from_matrix(place * *local), &m);
+ }
+ }
+ for r in roots {
+ world.entity_mut(r).despawn();
+ }
+ world.entity_mut(e).insert(Instanced);
+ }
+}
+
+/// A ready model with `shadow={false}` or `receiveShadow={false}`: each of its meshes given the marker the model has
+/// (Bevy reads them per mesh entity, not from a parent), whenever one lacks it.
+#[allow(clippy::type_complexity)]
+pub fn model_shadow_markers(
+ mut commands: Commands,
+ models: Query<(Entity, Has<NotShadowCaster>, Has<NotShadowReceiver>), (With<ModelReady>, Or<(With<NotShadowCaster>, With<NotShadowReceiver>)>)>,
+ kids: Query<&Children>,
+ meshes: Query<(Has<NotShadowCaster>, Has<NotShadowReceiver>), With<Mesh3d>>,
+) {
+ for (e, no_cast, no_receive) in &models {
+ for d in descendants(e, &kids) {
+ let Ok((c, r)) = meshes.get(d) else { continue };
+ if no_cast && !c {
+ commands.entity(d).insert(NotShadowCaster);
+ }
+ if no_receive && !r {
+ commands.entity(d).insert(NotShadowReceiver);
+ }
+ }
+ }
+}
diff --git a/runtime/scene3d/src/lib.rs b/runtime/scene3d/src/lib.rs
index f510cc8e..b92ef321 100644
--- a/runtime/scene3d/src/lib.rs
+++ b/runtime/scene3d/src/lib.rs
@@ -61,6 +61,10 @@ mod sync;
pub use sync::*;
mod shaded;
pub use shaded::*;
+mod instance;
+pub use instance::*;
+mod share;
+pub use share::*;
/// A model row's glTF: loaded by the asset server, then its scene spawned under the row's entity and its clip set up.
#[derive(Component)]
@@ -94,6 +98,8 @@ pub struct Model3d {
graph: Vec<GraphPart>,
/// the graph built: its handle and each node's index (and clip)
built: Option<(Handle<AnimationGraph>, Vec<(AnimationNodeIndex, Option<Handle<bevy::animation::AnimationClip>>)>)>,
+ /// <Instances>: its placements, until its scene is copied to them (instance.rs's instance_models)
+ inst: Option<Vec<Transform>>,
}
/// One node of a <Model graph>: a clip (by name or index), a blend (weights normalised) or an additive blend, under
@@ -153,7 +159,7 @@ impl Model3d {
/// Ready, with its own surfaces, toon and shaders on (or given up on): what a scene's <SurfaceShader> waits for.
pub fn settled(&self) -> bool {
- self.ready() && self.surfaces.is_empty() && self.toon.is_empty() && self.shaders.is_empty()
+ self.ready() && self.surfaces.is_empty() && self.toon.is_empty() && self.shaders.is_empty() && self.inst.is_none()
}
}
diff --git a/runtime/scene3d/src/model.rs b/runtime/scene3d/src/model.rs
index c3d974f1..4f390341 100644
--- a/runtime/scene3d/src/model.rs
+++ b/runtime/scene3d/src/model.rs
@@ -13,11 +13,19 @@ pub fn model(world: &mut World, e: Entity, t: &Tup, inserted: &[Tup], dir: &Path
let surfaces = super::surface::of(world, t, inserted, dir)?;
let shaders = super::model_shaders(t)?;
let sampler = raea_sys_sampler::Sampling::col(&t.vals, "sampler").map_err(|e| format!("model {}: {e}", t.id))?;
+ let inst = model_placements(t)?;
+ // `shadow={false}`, `receiveShadow={false}`: on the model, then on each of its meshes once spawned (model_shadow_markers)
+ if t.vals.get("shadow").is_some_and(|v| !v.truthy()) {
+ world.entity_mut(e).insert(bevy::light::NotShadowCaster);
+ }
+ if t.vals.get("receive").is_some_and(|v| !v.truthy()) {
+ world.entity_mut(e).insert(bevy::light::NotShadowReceiver);
+ }
// a model that keeps its own surfaces (drawn flat, in a look, or toon) isn't given a scene's <SurfaceShader>
if ["flat", "look", "toon"].iter().any(|k| t.vals.get(*k).is_some_and(V::truthy)) {
world.entity_mut(e).insert(raea_sys_shader::OwnSurface);
}
- world.entity_mut(e).insert((Model3d { gltf, scene: num(&t.vals, "scene", 0.0) as usize, anim, state: ModelState::Loading, src, id: t.id.clone(), toon, toon_wait: 0, surfaces, shaders, sampler, mix: names_col(&t.vals, "mix"), mixer: vec![], morphs: names_col(&t.vals, "morph_names"), graph: graph_col(&t.vals).map_err(|e| format!("model {}: {e}", t.id))?, built: None }, transform_of(&t.vals), Visibility::default()));
+ world.entity_mut(e).insert((Model3d { gltf, scene: num(&t.vals, "scene", 0.0) as usize, anim, state: ModelState::Loading, src, id: t.id.clone(), toon, toon_wait: 0, surfaces, shaders, sampler, mix: names_col(&t.vals, "mix"), mixer: vec![], morphs: names_col(&t.vals, "morph_names"), graph: graph_col(&t.vals).map_err(|e| format!("model {}: {e}", t.id))?, built: None, inst }, transform_of(&t.vals), Visibility::default()));
Ok(())
}
diff --git a/runtime/scene3d/src/share.rs b/runtime/scene3d/src/share.rs
new file mode 100644
index 00000000..d41b073d
--- /dev/null
+++ b/runtime/scene3d/src/share.rs
@@ -0,0 +1,58 @@
+//! Equal parts share their assets (docs/control.feature FC1a, closing C1): a mesh row's Mesh is made once per shape and
+//! a plain StandardMaterial once per value, so N equal parts hold one Handle<Mesh> and one Handle<StandardMaterial>
+//! and Bevy's automatic batching draws them as one, as it does for an example that shares its handles.
+//! A shared material a frame changes (a part's colour animating) is first copied to that part alone (sync_meshes),
+//! so one part's change never shows on another. RAEA_SHARE_ASSETS=0 makes every part its own again.
+
+use std::collections::HashMap;
+use std::hash::{Hash, Hasher};
+
+use bevy::prelude::*;
+
+/// A part whose StandardMaterial other parts hold too: sync_meshes copies it before changing it.
+#[derive(Component)]
+pub struct SharedMaterial;
+
+#[derive(Resource, Default)]
+struct Shared {
+ meshes: HashMap<u64, Handle<Mesh>>,
+ materials: HashMap<String, Handle<StandardMaterial>>,
+}
+
+/// Whether parts share (on unless RAEA_SHARE_ASSETS=0).
+pub fn sharing() -> bool {
+ std::env::var("RAEA_SHARE_ASSETS").map_or(true, |v| v != "0")
+}
+
+/// The mesh for `key` (everything that decides its vertices), made by `make` the first time.
+pub fn shared_mesh(world: &mut World, key: &str, make: impl FnOnce() -> Result<Mesh, String>) -> Result<Handle<Mesh>, String> {
+ if !sharing() {
+ let m = make()?;
+ return Ok(world.resource_mut::<Assets<Mesh>>().add(m));
+ }
+ let mut h = std::collections::hash_map::DefaultHasher::new();
+ key.hash(&mut h);
+ let k = h.finish();
+ if let Some(m) = world.get_resource::<Shared>().and_then(|s| s.meshes.get(&k)).cloned() {
+ return Ok(m);
+ }
+ let m = make()?;
+ let m = world.resource_mut::<Assets<Mesh>>().add(m);
+ world.get_resource_or_insert_with(Shared::default).meshes.insert(k, m.clone());
+ Ok(m)
+}
+
+/// The material equal to `m`, field for field (its Debug form is the key: every field, a texture by its handle), made
+/// the first time; and whether it's shared (to mark the part SharedMaterial).
+pub fn shared_material(world: &mut World, m: StandardMaterial) -> (Handle<StandardMaterial>, bool) {
+ if !sharing() {
+ return (world.resource_mut::<Assets<StandardMaterial>>().add(m), false);
+ }
+ let key = format!("{m:?}");
+ if let Some(h) = world.get_resource::<Shared>().and_then(|s| s.materials.get(&key)).cloned() {
+ return (h, true);
+ }
+ let h = world.resource_mut::<Assets<StandardMaterial>>().add(m);
+ world.get_resource_or_insert_with(Shared::default).materials.insert(key, h.clone());
+ (h, true)
+}
diff --git a/runtime/scene3d/src/sync.rs b/runtime/scene3d/src/sync.rs
index 04f9276f..3d70d988 100644
--- a/runtime/scene3d/src/sync.rs
+++ b/runtime/scene3d/src/sync.rs
@@ -47,22 +47,24 @@ pub fn sync_meshes(
frame: Res<FrameRows>,
mut mats: ResMut<Assets<StandardMaterial>>,
mut glasses: ResMut<Assets<super::froxel_glass::GlassMaterial>>,
+ mut commands: Commands,
mut q: Query<
(
Entity,
&mut Transform,
&mut Visibility,
- Option<&MeshMaterial3d<StandardMaterial>>,
- Option<(&super::froxel_glass::Fogged, &MeshMaterial3d<super::froxel_glass::GlassMaterial>)>,
+ Option<&mut MeshMaterial3d<StandardMaterial>>,
+ Option<(&mut super::froxel_glass::Fogged, &MeshMaterial3d<super::froxel_glass::GlassMaterial>)>,
Has<super::plugins::Driven>,
- Option<&super::paint::Painted>,
+ Option<&mut super::paint::Painted>,
Option<&super::decal::DecalStd>,
Option<&raea_sys_shader::Shaded>,
+ Has<super::SharedMaterial>,
),
- Or<(With<Mesh3d>, With<Model3d>)>,
+ Or<(With<Mesh3d>, With<Model3d>, With<Instanced>)>,
>,
) {
- for (e, mut t, mut vis, mat, fogged, driven, painted, decal, shaded) in &mut q {
+ for (e, mut t, mut vis, mut mat, mut fogged, driven, mut painted, decal, shaded, shared) in &mut q {
let Some(v) = frame.vals(e) else { continue };
let v = &v;
// a mesh a Bevy plugin moves (a rigid body) keeps the plugin's transform (engine/plugins.rs)
@@ -79,7 +81,8 @@ pub fn sync_meshes(
// a painted mesh's standard material is kept aside for this (paint.rs), and a see-through mesh drawn with its froxel
// fog copy (froxel_glass.rs) follows its standard material
// (and a decal's, decal.rs, and a shaded one's, raea-sys-shader)
- let Some(h) = mat.map(|m| &m.0).or(painted.map(|p| &p.std)).or(fogged.map(|(f, _)| &f.std)).or(decal.map(|d| &d.0)).or(shaded.map(|s| &s.std)) else { continue };
+ let Some(h) = mat.as_ref().map(|m| m.0.clone()).or(painted.as_ref().map(|p| p.std.clone())).or(fogged.as_ref().map(|(f, _)| f.std.clone())).or(decal.map(|d| d.0.clone())).or(shaded.map(|s| s.std.clone())) else { continue };
+ let h = &h;
// a sprite sheet's cell (an ImagePlane's `frame` of its `grid`)
if let Some(fr) = v.get("sheet_frame") {
let want = sheet_uv(fr.num() as f32, num(v, "sheet_cols", 1.0), num(v, "sheet_rows", 1.0));
@@ -115,6 +118,28 @@ pub fn sync_meshes(
// as a render's, which knew from its load (material: an opacity column is a blended surface)
let blend = v.contains_key("opacity") && cur.alpha_mode == AlphaMode::Opaque;
if cur.base_color != base || cur.perceptual_roughness != rough || cur.metallic != metal || cur.emissive != emissive || blend {
+ // a material other parts hold too (share.rs): this part's change goes on a copy of its own, put where its
+ // handle is kept; a fog copy follows the new handle a frame later (froxel_glass.rs)
+ if shared {
+ let mut own = cur.clone();
+ own.base_color = base;
+ own.perceptual_roughness = rough;
+ own.metallic = metal;
+ own.emissive = emissive;
+ if blend {
+ own.alpha_mode = AlphaMode::Blend;
+ }
+ let nh = mats.add(own);
+ if let Some(m) = mat.as_mut() {
+ m.0 = nh;
+ } else if let Some(p) = painted.as_mut() {
+ p.std = nh;
+ } else if let Some((f, _)) = fogged.as_mut() {
+ f.std = nh;
+ }
+ commands.entity(e).remove::<super::SharedMaterial>();
+ continue;
+ }
if let Some(mut m) = mats.get_mut(h) {
m.base_color = base;
m.perceptual_roughness = rough;
@@ -124,7 +149,7 @@ pub fn sync_meshes(
m.alpha_mode = AlphaMode::Blend;
}
// and its fog copy, this frame (froxel_glass.rs's own follow is a frame behind)
- if let Some(mut g) = fogged.and_then(|(_, g)| glasses.get_mut(&g.0)) {
+ if let Some(mut g) = fogged.as_ref().and_then(|(_, g)| glasses.get_mut(&g.0)) {
g.base = m.clone();
}
}
diff --git a/sdk/guides/craft/floor.md b/sdk/guides/craft/floor.md
index e092c889..c23ebb92 100644
--- a/sdk/guides/craft/floor.md
+++ b/sdk/guides/craft/floor.md
@@ -18,6 +18,8 @@ Before you say a piece is done, every line here is true of the last render, not
right 84; Shorts: top 120, bottom 300, right 96). A 4:5 feed frame needs top 110, bottom 170, sides 60; a 1:1 frame
top 70, bottom 120, sides 60; 16:9 top and bottom 120, sides 60. These zones are only where text can't go. Where it
should go is a design choice.
+- **Nothing flashes past the limit.** No more than three flashes in any one second over a sizable part of the frame
+ (WCAG 2.3.1): past that, flashing can cause seizures. A strobe or a fast flicker needs slowing, shrinking or less contrast.
- **Cues land on their words.** A cut, a move or a caption tied to speech starts on the word, timed from the
transcript's word times. Never place one by eye or at a fixed tempo.
- **Every name the voice says is on screen when it says it.** If the narration says "the brief", the brief is visible.
diff --git a/sdk/guides/craft/motion/rendering.md b/sdk/guides/craft/motion/rendering.md
index e79e3d60..5a0300b8 100644
--- a/sdk/guides/craft/motion/rendering.md
+++ b/sdk/guides/craft/motion/rendering.md
@@ -6,7 +6,7 @@
`raea render edit.tsx -o final.mp4 --manifest render.json` and
`raea check final.mp4 --manifest render.json --words words.json --perception perception.json [--platform tiktok]`.
It measures clipped text, text under a platform's buttons, text over the face, captions on too briefly to read,
- caption contrast against the pixels behind them, frozen stretches, cues that miss their word, loudness, a sound that
+ caption contrast against the pixels behind them, frozen stretches, flashing past the limit, cues that miss their word, loudness, a sound that
stops dead or (with `--words`) fights the voice, and encoder blotching in the darks. Each finding is ranked P0 to P3
with its fix; it exits 1 while a P0 or P1 stands, and `-o check.json` writes them for the critique. An
exception in the composition (an unclamped value going NaN, keyframes out of order, a phrase `word()` can't find, a
diff --git a/sdk/guides/craft/rubric.md b/sdk/guides/craft/rubric.md
index 8e64dc7b..eef3827a 100644
--- a/sdk/guides/craft/rubric.md
+++ b/sdk/guides/craft/rubric.md
@@ -3,7 +3,7 @@
A critique has three parts, and the person sees all three on one test item in the feed:
1. **Measured.** `raea check` on the export: clipped text, text under a platform's buttons, captions too brief to
- read, caption contrast, frozen stretches, cues off their words, loudness, blotching in the darks. These are facts;
+ read, caption contrast, frozen stretches, flashing past the limit, cues off their words, loudness, blotching in the darks. These are facts;
a P0 or P1 among them is never argued with.
2. **Judged.** The decision model watches the export (its first minute, with sound) and rates it on the questions
below, each on five levels: poor, weak, acceptable, strong, excellent. It reads the brief's facts and the
diff --git a/sdk/r3f/.gitignore b/sdk/r3f/.gitignore
new file mode 100644
index 00000000..48127633
--- /dev/null
+++ b/sdk/r3f/.gitignore
@@ -0,0 +1,2 @@
+node_modules/
+wasm/
diff --git a/sdk/r3f/README.md b/sdk/r3f/README.md
new file mode 100644
index 00000000..fc61a7b4
--- /dev/null
+++ b/sdk/r3f/README.md
@@ -0,0 +1,37 @@
+# raea/r3f
+
+React Three Fiber both ways (docs/r3f.feature).
+
+**R3F in raea.** Put an R3F scene in a composition and raea's engine draws it, frame by frame:
+
+```tsx
+import { R3F } from "raea/r3f";
+
+export const Edit = () => (
+ <R3F camera={{ position: [3, 2.5, 4], fov: 45 }} shadows>
+ <ambientLight intensity={0.4} />
+ <directionalLight position={[3, 5, 2]} intensity={2.5} castShadow />
+ <Spinner /> {/* useFrame steps 1/fps a frame */}
+ </R3F>
+);
+```
+
+In a project, three and @react-three/fiber are its own: `raea add [email protected] @react-three/[email protected]`.
+
+**raea in R3F.** Draw a raea composition inside any R3F `<Canvas>`:
+
+```tsx
+import { Canvas } from "@react-three/fiber";
+import { Raea, loadShapes } from "@raea/r3f";
+
+loadShapes(await import("./raea_shape_web.js")); // solids, Text3D: tools/shape-wasm.sh builds it
+<Canvas shadows><Raea component={Edit} fps={30} /></Canvas>
+```
+
+Its camera, tone mapping, fog, environment and effects become the canvas's. Without React, `Scene3d` (`@raea/r3f/three`)
+draws a raea page into any three.js scene.
+
+**Measured.** `bun test` checks that every raea kind and every three.js class has a row in `src/three/kinds.ts` and
+`src/input/kinds.ts`, which say what is drawn exactly, near (and what differs) or left to raea's engine.
+`tools/parity.sh` renders each case in `test/parity` with raea and with three.js in Chrome and compares them by SSIM
+(at least 0.92).
diff --git a/sdk/r3f/bun.lock b/sdk/r3f/bun.lock
new file mode 100644
index 00000000..2110b896
--- /dev/null
+++ b/sdk/r3f/bun.lock
@@ -0,0 +1,90 @@
+{
+ "lockfileVersion": 2,
+ "configVersion": 1,
+ "workspaces": {
+ "": {
+ "name": "@raea/r3f",
+ "devDependencies": {
+ "@react-three/fiber": "9.8.2",
+ "@types/bun": "1.4.3",
+ "@types/react-dom": "19.2.0",
+ "@types/three": "0.180.0",
+ "react": "file:../raea/node_modules/react",
+ "react-dom": "file:../raea/node_modules/react-dom",
+ "scheduler": "file:../raea/node_modules/scheduler",
+ "three": "0.180.0",
+ },
+ "peerDependencies": {
+ "@react-three/fiber": ">=9.0.0",
+ "three": ">=0.170.0",
+ },
+ },
+ },
+ "packages": {
+ "@babel/runtime": ["@babel/[email protected]", "", {}, "sha512-v+oN26xP4YIlQsbQ/CbTH1WG5m/l/DjKKZNy/Kp3f/AFvbgt7Em/D0FeMM3O2hX0YzeN2M16W8lOpyhIkfCBcQ=="],
+
+ "@dimforge/rapier3d-compat": ["@dimforge/[email protected]", "", {}, "sha512-uekIGetywIgopfD97oDL5PfeezkFpNhwlzlaEYNOA0N6ghdsOvh/HYjSMek5Q2O1PYvRSDFcqFVJl4r4ZBwOow=="],
+
+ "@react-three/fiber": ["@react-three/[email protected]", "", { "dependencies": { "@babel/runtime": "^7.17.8", "@types/webxr": "*", "base64-js": "^1.5.1", "buffer": "^6.0.3", "its-fine": "^2.1.1", "react-use-measure": "^2.1.7", "scheduler": "^0.28.0", "suspend-react": "^0.1.3", "use-sync-external-store": "^1.4.0", "zustand": "^5.0.3" }, "peerDependencies": { "expo": ">=43.0", "expo-asset": ">=8.4", "expo-file-system": ">=11.0", "expo-gl": ">=11.0", "react": ">=19 <19.4", "react-dom": ">=19 <19.4", "react-native": ">=0.78", "three": ">=0.156" }, "optionalPeers": ["expo", "expo-asset", "expo-file-system", "expo-gl", "react-dom", "react-native"] }, "sha512-6s0ejw0bT1myQ/aLLugcil8/zBmNnnHw/AISWF1yfDLOxfX3yYaTS+0IkpJITEnm/SSMLtxje6CJDt0i5Wu1Sw=="],
+
+ "@tweenjs/tween.js": ["@tweenjs/[email protected]", "", {}, "sha512-vJmvvwFxYuGnF2axRtPYocag6Clbb5YS7kLL+SO/TeVFzHqDIWrNKYtcsPMibjDx9O+bu+psAy9NKfWklassUA=="],
+
+ "@types/bun": ["@types/[email protected]", "", { "dependencies": { "bun-types": "1.4.3" } }, "sha512-N67Pqy8JXbAY/j0tNraS3V5mubGvc6rrrNDmDCtZLlFzccbUJPDb0tvgUBC5q4m8ybkP93Jcn1QB+RYQ6PvBhw=="],
+
+ "@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~8.9.0" } }, "sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog=="],
+
+ "@types/react": ["@types/[email protected]", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg=="],
+
+ "@types/react-dom": ["@types/[email protected]", "", { "peerDependencies": { "@types/react": "^19.2.0" } }, "sha512-brtBs0MnE9SMx7px208g39lRmC5uHZs96caOJfTjFcYSLHNamvaSMfJNagChVNkup2SdtOxKX1FDBkRSJe1ZAg=="],
+
+ "@types/react-reconciler": ["@types/[email protected]", "", { "peerDependencies": { "@types/react": "*" } }, "sha512-HHM3nxyUZ3zAylX8ZEyrDNd2XZOnQ0D5XfunJF5FLQnZbHHYq4UWvW1QfelQNXv1ICNkwYhfxjwfnqivYB6bFg=="],
+
+ "@types/stats.js": ["@types/[email protected]", "", {}, "sha512-jIBvWWShCvlBqBNIZt0KAshWpvSjhkwkEu4ZUcASoAvhmrgAUI2t1dXrjSL4xXVLB4FznPrIsX3nKXFl/Dt4vA=="],
+
+ "@types/three": ["@types/[email protected]", "", { "dependencies": { "@dimforge/rapier3d-compat": "~0.12.0", "@tweenjs/tween.js": "~23.1.3", "@types/stats.js": "*", "@types/webxr": "*", "@webgpu/types": "*", "fflate": "~0.8.2", "meshoptimizer": "~0.22.0" } }, "sha512-ykFtgCqNnY0IPvDro7h+9ZeLY+qjgUWv+qEvUt84grhenO60Hqd4hScHE7VTB9nOQ/3QM8lkbNE+4vKjEpUxKg=="],
+
+ "@types/webxr": ["@types/[email protected]", "", {}, "sha512-h8fgEd/DpoS9CBrjEQXR+dIDraopAEfu4wYVNY2tEPwk60stPWhvZMf4Foo5FakuQ7HFZoa8WceaWFervK2Ovg=="],
+
+ "@webgpu/types": ["@webgpu/[email protected]", "", {}, "sha512-lgiI4hbuLcI9unnm2cL/tvCaQU45dp0xcLWJh5uB/9MBGvIA4F8XIk7nSiBeg+K4xWGYwgZKn80LmERI5CxoTA=="],
+
+ "base64-js": ["[email protected]", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="],
+
+ "buffer": ["[email protected]", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" } }, "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA=="],
+
+ "bun-types": ["[email protected]", "", { "dependencies": { "@types/node": "*", "undici-types": "*" } }, "sha512-tinRJNGOmUN+tEAsn2y2e942n9JHRHR42iUYzDH75NmhJqVBokGSQkkfSFdNWwsANIdrK6ACH9t01M452YyTwg=="],
+
+ "csstype": ["[email protected]", "", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="],
+
+ "fflate": ["[email protected]", "", {}, "sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA=="],
+
+ "ieee754": ["[email protected]", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="],
+
+ "its-fine": ["[email protected]", "", { "dependencies": { "@types/react-reconciler": "^0.28.9" }, "peerDependencies": { "react": "^19.0.0" } }, "sha512-C5ZoVkeqSt0Aje0tzESO+iT/EQpNFNL39GkP7mCACtoZUFD6GcyerFCr6kp0ZtiII4W9HoYkY48Soy5xE/uHKw=="],
+
+ "meshoptimizer": ["[email protected]", "", {}, "sha512-IebiK79sqIy+E4EgOr+CAw+Ke8hAspXKzBd0JdgEmPHiAwmvEj2S4h1rfvo+o/BnfEYd/jAOg5IeeIjzlzSnDg=="],
+
+ "react": ["react@file:../raea/node_modules/react", {}],
+
+ "react-dom": ["react-dom@file:../raea/node_modules/react-dom", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.0" } }],
+
+ "react-use-measure": ["[email protected]", "", { "peerDependencies": { "react": ">=16.13", "react-dom": ">=16.13" }, "optionalPeers": ["react-dom"] }, "sha512-KrvcAo13I/60HpwGO5jpW7E9DfusKyLPLvuHlUyP5zqnmAPhNc6qTRjUQrdTADl0lpPpDVU2/Gg51UlOGHXbdg=="],
+
+ "scheduler": ["scheduler@file:../raea/node_modules/scheduler", {}],
+
+ "suspend-react": ["[email protected]", "", { "peerDependencies": { "react": ">=17.0" } }, "sha512-aqldKgX9aZqpoDp3e8/BZ8Dm7x1pJl+qI3ZKxDN0i/IQTWUwBx/ManmlVJ3wowqbno6c2bmiIfs+Um6LbsjJyQ=="],
+
+ "three": ["[email protected]", "", {}, "sha512-o+qycAMZrh+TsE01GqWUxUIKR1AL0S8pq7zDkYOQw8GqfX8b8VoCKYUoHbhiX5j+7hr8XsuHDVU6+gkQJQKg9w=="],
+
+ "undici-types": ["[email protected]", "", {}, "sha512-GNCQH3MbVGB8OAVAoTiLH8pu4wx5Ni3DWKpnBzGj3WDsi8EwmK0aOVBooNEt+g5YL1eHPxcS9XUTouwFU6j1kQ=="],
+
+ "use-sync-external-store": ["[email protected]", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-6L+EeigHMQhdaIPNIFUKwfWJSwWFQ8gJbJ2DLOs5sDIegTwR9fRxvnM3uciHKjIZhFz+KAv2emhWMRvDmMcY8A=="],
+
+ "zustand": ["[email protected]", "", { "peerDependencies": { "@types/react": ">=18.0.0", "immer": ">=9.0.6", "react": ">=18.0.0", "use-sync-external-store": ">=1.2.0" }, "optionalPeers": ["@types/react", "immer", "react", "use-sync-external-store"] }, "sha512-ciJZlP48M1PTQbVQq81CGVFxHTLpZNrFjKqwjtCU34AWuXTZT/jrF3p9+fI84Cf1eSCMLapxqBy/SNTfwOBuqA=="],
+
+ "@react-three/fiber/scheduler": ["[email protected]", "", {}, "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw=="],
+
+ "@types/node/undici-types": ["[email protected]", "", {}, "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg=="],
+
+ "react-dom/scheduler": ["[email protected]", "", {}, "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q=="],
+ }
+}
diff --git a/sdk/r3f/bunfig.toml b/sdk/r3f/bunfig.toml
new file mode 100644
index 00000000..b2620f25
--- /dev/null
+++ b/sdk/r3f/bunfig.toml
@@ -0,0 +1,2 @@
+[test]
+preload = ["./test/esm.ts"]
diff --git a/sdk/r3f/package.json b/sdk/r3f/package.json
new file mode 100644
index 00000000..9853b54d
--- /dev/null
+++ b/sdk/r3f/package.json
@@ -0,0 +1,28 @@
+{
+ "name": "@raea/r3f",
+ "license": "FSL-1.1-ALv2",
+ "private": true,
+ "version": "0.1.0",
+ "description": "React Three Fiber both ways (docs/r3f.feature): <R3F> draws an R3F scene with raea, <Raea> and the three.js host (src/three) draw raea's 3D in R3F or any three.js app, loadShapes meshes raea's solids for them (tools/shape-wasm.sh).",
+ "type": "module",
+ "main": "src/index.ts",
+ "exports": {
+ ".": "./src/index.ts",
+ "./three": "./src/three/index.ts"
+ },
+ "//": "In a project, three and @react-three/fiber are its own (raea add [email protected] @react-three/[email protected]): the bundler resolves them from the project, so a scene and raea share one copy. Here, for the package's tests and tsc, React is the SDK's own (sdk/raea), linked; sdk/playable's bundler resolves three to its own copy, so a playable carries one.",
+ "peerDependencies": {
+ "@react-three/fiber": ">=9.0.0",
+ "three": ">=0.170.0"
+ },
+ "devDependencies": {
+ "@react-three/fiber": "9.8.2",
+ "@types/bun": "1.4.3",
+ "@types/react-dom": "19.2.0",
+ "@types/three": "0.180.0",
+ "react": "file:../raea/node_modules/react",
+ "react-dom": "file:../raea/node_modules/react-dom",
+ "scheduler": "file:../raea/node_modules/scheduler",
+ "three": "0.180.0"
+ }
+}
diff --git a/sdk/r3f/src/index.ts b/sdk/r3f/src/index.ts
new file mode 100644
index 00000000..e781390a
--- /dev/null
+++ b/sdk/r3f/src/index.ts
@@ -0,0 +1,12 @@
+// raea/r3f: React Three Fiber both ways (docs/r3f.feature). <R3F> draws an R3F scene with raea (R3F as raea's input);
+// <Raea> draws a raea composition's 3D inside an R3F <Canvas>, and Scene3d (the three.js host) draws raea's parts for
+// any three.js app (raea as R3F's input). loadShapes brings in raea's solids (minus, hull, extrude, Text3D) for both.
+export { R3F, type R3FProps } from "./input/R3F";
+export { convert, type Converted } from "./input/scene";
+export { Raea, type RaeaProps } from "./output/Raea";
+export { Scene3d, type Settings } from "./three/scene";
+export { KINDS, PRIMITIVES, type Status } from "./three/kinds";
+export { CLASSES, type InputStatus } from "./input/kinds";
+export { loadShapes, shapesReady } from "./three/geometry";
+export { elementsOf, COMPONENTS, type Part, type Props } from "./parts";
+export { toThree, toRaea, relativeOf, EXPOSURE } from "./units";
diff --git a/sdk/r3f/src/input/R3F.tsx b/sdk/r3f/src/input/R3F.tsx
new file mode 100644
index 00000000..f824807a
--- /dev/null
+++ b/sdk/r3f/src/input/R3F.tsx
@@ -0,0 +1,52 @@
+// <R3F>: React Three Fiber's scene drawn by raea. Its children are R3F's JSX (<mesh>, <boxGeometry>,
+// <meshStandardMaterial>, useFrame, useThree, any three.js object by <primitive>), run by R3F's own reconciler headless
+// (session.ts), and each frame its three.js scene becomes raea's parts (scene.ts), which raea's engine draws: Bevy in
+// a render, a live play and the web export alike. It takes <Canvas>'s settings (camera, orthographic, shadows, flat,
+// linear, scene); raea's hooks work inside it (bridge.tsx), and useFrame steps 1/fps a frame, from the composition's
+// frame, never the wall clock.
+import { useContext, useId, type ReactNode } from "react";
+import { AbsoluteFill, useCurrentFrame, useVideoConfig } from "raea";
+import { ClockContext, LocalTimeContext } from "@raea/app/clock";
+import type * as THREE from "three";
+import { FiberOf, useBridge } from "./bridge";
+import { stepTo, type Config } from "./session";
+import { convert } from "./scene";
+import { standInImages } from "./texture";
+import { elementsOf } from "../parts";
+
+standInImages();
+
+export interface R3FProps extends Config {
+ children?: ReactNode;
+ /** a name of its own when one composition has more than one R3F scene that come and go */
+ name?: string;
+}
+
+function Inner({ fiber, children, name, ...config }: R3FProps & { fiber: Parameters<typeof useBridge>[0] }) {
+ const frame = useCurrentFrame();
+ const { fps, width, height } = useVideoConfig();
+ const clock = useContext(ClockContext);
+ const local = useContext(LocalTimeContext);
+ const bridge = useBridge(fiber);
+ const id = useId();
+ // the scene at local frame i: raea's clock as it was then, inside every context from outside
+ const at = (i: number) => {
+ const c = clock ? { ...clock, frame: clock.frame - frame + i } : null;
+ const l = local ? { ...local, frame: i } : null;
+ return bridge(
+ <ClockContext value={c}>
+ <LocalTimeContext value={l}>{children}</LocalTimeContext>
+ </ClockContext>,
+ );
+ };
+ const s = stepTo(name ?? id, frame, fps, width, height, config, at);
+ const { scene, camera, gl } = s.state as unknown as { scene: THREE.Scene; camera: THREE.Camera; gl: THREE.WebGLRenderer };
+ const out = convert(scene, camera, gl, height);
+ const drawn = elementsOf(out.parts, "r3f.");
+ return out.background ? <AbsoluteFill style={{ background: out.background }}>{drawn}</AbsoluteFill> : <>{drawn}</>;
+}
+
+/** React Three Fiber's <Canvas>, drawn by raea */
+export function R3F(props: R3FProps) {
+ return <FiberOf>{(fiber) => <Inner fiber={fiber} {...props} />}</FiberOf>;
+}
diff --git a/sdk/r3f/src/input/bridge.tsx b/sdk/r3f/src/input/bridge.tsx
new file mode 100644
index 00000000..3edc7e7c
--- /dev/null
+++ b/sdk/r3f/src/input/bridge.tsx
@@ -0,0 +1,45 @@
+// React contexts carried across into React Three Fiber's own root (its reconciler is a second React renderer, and a
+// context doesn't cross from one renderer to another): every context provided above the <R3F> is found on its fiber's
+// ancestors, read, and provided again inside, as R3F's <Canvas> does with its-fine. So raea's hooks (useCurrentFrame,
+// useGameState, a theme) work in the R3F scene's components as they do around it.
+import { Component, use, type Context, type ReactNode } from "react";
+
+interface Fiber {
+ return: Fiber | null;
+ type: unknown;
+ memoizedProps: unknown;
+}
+
+const CONTEXT = Symbol.for("react.context");
+const PROVIDER = Symbol.for("react.provider");
+
+/** the contexts provided above a fiber, outermost first */
+function contextsAbove(fiber: Fiber | null): Context<unknown>[] {
+ const out: Context<unknown>[] = [];
+ const seen = new Set<unknown>();
+ for (let f = fiber?.return ?? null; f; f = f.return) {
+ const t = f.type as { $$typeof?: symbol; _context?: Context<unknown> } | null;
+ if (!t || typeof t !== "object") continue;
+ // React 19: <Ctx value> is the context itself; React 18: Ctx.Provider points at it
+ const ctx = t.$$typeof === CONTEXT ? (t as unknown as Context<unknown>) : t.$$typeof === PROVIDER ? t._context : undefined;
+ if (ctx && !seen.has(ctx)) {
+ seen.add(ctx);
+ out.unshift(ctx);
+ }
+ }
+ return out;
+}
+
+/** hands its child its own fiber, the place the context walk starts from */
+export class FiberOf extends Component<{ children: (fiber: Fiber | null) => ReactNode }> {
+ render() {
+ return this.props.children((this as unknown as { _reactInternals?: Fiber })._reactInternals ?? null);
+ }
+}
+
+/** a function that wraps a node in every context above `fiber`, each with the value it has here; call it in render */
+export function useBridge(fiber: Fiber | null): (node: ReactNode) => ReactNode {
+ const ctxs = contextsAbove(fiber);
+ const values = ctxs.map((c) => use(c));
+ return (node) => ctxs.reduceRight<ReactNode>((inner, C, i) => <C value={values[i]}>{inner}</C>, node);
+}
diff --git a/sdk/r3f/src/input/geometry.ts b/sdk/r3f/src/input/geometry.ts
new file mode 100644
index 00000000..c19aa78e
--- /dev/null
+++ b/sdk/r3f/src/input/geometry.ts
@@ -0,0 +1,111 @@
+// A three.js BufferGeometry as raea's <BufferMesh> arrays: positions, indices, normals, uvs and vertex colours, read
+// through each attribute's accessors (so interleaved, normalized and typed buffers all read the same). Kept per
+// geometry and its attributes' versions, so the same arrays (the same objects) go to raea every frame and raea's own
+// shape cache, keyed by the positions array, writes the shape once. A skinned or morphed mesh is posed on the CPU each
+// frame (three's getVertexPosition applies its morph targets and bones), its normals made again from the posed shape.
+import * as THREE from "three";
+
+export interface Arrays {
+ positions: number[];
+ indices?: number[];
+ normals?: number[];
+ uvs?: number[];
+ colors?: number[];
+}
+
+type Attr = THREE.BufferAttribute | THREE.InterleavedBufferAttribute;
+
+function read(a: Attr | undefined, per: number, flipV = false): number[] | undefined {
+ if (!a) return undefined;
+ const out = new Array<number>(a.count * per);
+ for (let i = 0; i < a.count; i++) {
+ out[i * per] = a.getX(i);
+ if (per > 1) out[i * per + 1] = flipV ? 1 - a.getY(i) : a.getY(i);
+ if (per > 2) out[i * per + 2] = a.getZ(i);
+ if (per > 3) out[i * per + 3] = a.itemSize > 3 ? a.getW(i) : 1;
+ }
+ return out;
+}
+
+/** the triangles' vertex indices, of one group (a range of a multi-material mesh) or the draw range */
+function triangles(g: THREE.BufferGeometry, start: number, count: number): number[] | undefined {
+ const n = g.attributes.position.count;
+ const total = g.index ? g.index.count : n;
+ const from = Math.max(0, start), to = Math.min(total, start + count);
+ if (from === 0 && to === total && !g.index) return undefined;
+ const out: number[] = [];
+ for (let i = from; i + 3 <= to; i += 3) {
+ for (let k = 0; k < 3; k++) out.push(g.index ? g.index.getX(i + k) : i + k);
+ }
+ return out;
+}
+
+const versions = (g: THREE.BufferGeometry) =>
+ [g.index?.version ?? -1, ...Object.values(g.attributes).map((a) => ("version" in a ? a.version : (a as THREE.InterleavedBufferAttribute).data.version)), g.drawRange.start, g.drawRange.count].join(",");
+
+const kept = new WeakMap<THREE.BufferGeometry, Map<string, { v: string; arrays: Arrays }>>();
+
+export interface ReadOptions {
+ /** the range of triangles (a geometry group), by index; the draw range by default */
+ start?: number;
+ count?: number;
+ /** v turned upside down: three's texture coordinates count v from the bottom of a picture (flipY), Bevy's from the top */
+ flipV: boolean;
+ /** the vertex colours, when the material uses them */
+ colors: boolean;
+}
+
+/** A geometry's arrays for raea, the same objects while it hasn't changed. */
+export function arraysOf(g: THREE.BufferGeometry, o: ReadOptions): Arrays | undefined {
+ const pos = g.attributes.position;
+ if (!pos || pos.count < 3) return undefined;
+ const start = Math.max(o.start ?? 0, g.drawRange.start);
+ const end = Math.min(o.count === undefined ? Infinity : (o.start ?? 0) + o.count, g.drawRange.count === Infinity ? Infinity : g.drawRange.start + g.drawRange.count);
+ const key = `${start}:${end}:${o.flipV}:${o.colors}`;
+ const v = versions(g);
+ let m = kept.get(g);
+ if (!m) kept.set(g, (m = new Map()));
+ const had = m.get(key);
+ if (had && had.v === v) return had.arrays;
+ const indices = triangles(g, start, end - start);
+ const arrays: Arrays = {
+ positions: read(pos, 3)!,
+ indices,
+ normals: read(g.attributes.normal, 3),
+ uvs: read(g.attributes.uv, 2, o.flipV),
+ colors: o.colors ? read(g.attributes.color, 4) : undefined,
+ };
+ if (indices && indices.length < 3) return undefined;
+ m.set(key, { v, arrays });
+ return arrays;
+}
+
+/** whether a mesh's shape moves from frame to frame: bones, or morph targets with any weight */
+export function posed(mesh: THREE.Mesh): boolean {
+ return (mesh as THREE.SkinnedMesh).isSkinnedMesh === true || (mesh.morphTargetInfluences?.some((w) => w !== 0) ?? false);
+}
+
+/** A skinned or morphed mesh's shape as it stands this frame, in the mesh's own space: new arrays each frame. */
+export function posedArrays(mesh: THREE.Mesh, o: ReadOptions): Arrays | undefined {
+ const base = arraysOf(mesh.geometry, o);
+ if (!base) return undefined;
+ const g = mesh.geometry;
+ if ((mesh as THREE.SkinnedMesh).isSkinnedMesh) (mesh as THREE.SkinnedMesh).skeleton.update();
+ const v = new THREE.Vector3();
+ const n = g.attributes.position.count;
+ const positions = new Array<number>(n * 3);
+ for (let i = 0; i < n; i++) {
+ mesh.getVertexPosition(i, v);
+ positions[i * 3] = v.x;
+ positions[i * 3 + 1] = v.y;
+ positions[i * 3 + 2] = v.z;
+ }
+ // the posed shape's own normals, smooth over shared vertices as the geometry's were
+ const shaped = new THREE.BufferGeometry();
+ shaped.setAttribute("position", new THREE.Float32BufferAttribute(positions, 3));
+ if (g.index) shaped.setIndex(g.index);
+ shaped.computeVertexNormals();
+ const normals = base.normals ? read(shaped.attributes.normal, 3) : undefined;
+ shaped.dispose();
+ return { ...base, positions, normals };
+}
diff --git a/sdk/r3f/src/input/kinds.ts b/sdk/r3f/src/input/kinds.ts
new file mode 100644
index 00000000..fe881fd5
--- /dev/null
+++ b/sdk/r3f/src/input/kinds.ts
@@ -0,0 +1,66 @@
+// Every three.js class an R3F scene can hold that puts something on screen (every Object3D and Material in three's
+// core), and what raea draws for it: the coverage of R3F as raea's input. test/coverage.test.ts walks three's exports
+// and fails on one missing here, so a class added to three (or one the version raea is tested on gains) is decided
+// here. Statuses as the three host's (../three/kinds.ts): drawn, near (note says what differs), setting, engine; and
+// none nothing to draw (a bone, an audio source, a camera that isn't the one drawn with)
+export type InputStatus = "drawn" | "near" | "none";
+
+export const CLASSES: Record<string, { status: InputStatus; raea: string; note?: string }> = {
+ // the scene graph
+ Object3D: { status: "drawn", raea: "Group (with children), its transform composed as three does" },
+ Group: { status: "drawn", raea: "Group" },
+ Scene: { status: "drawn", raea: "the composition's 3D; background colour behind it, environment, fog" },
+ LOD: { status: "drawn", raea: "the level three would draw from the camera this frame" },
+ Bone: { status: "none", raea: "a skinned mesh's pose (baked into its vertices)" },
+ // drawn things
+ Mesh: { status: "drawn", raea: "Mesh + BufferMesh (its triangles, normals, uvs, vertex colours; a range per geometry group)" },
+ SkinnedMesh: { status: "drawn", raea: "Mesh + BufferMesh posed on the CPU each frame (bones and morph targets)" },
+ InstancedMesh: { status: "drawn", raea: "Instances while its copies hold still; a Mesh a copy when they move or have colours" },
+ BatchedMesh: { status: "drawn", raea: "a Mesh per instance: its geometry's range, matrix and colour" },
+ Points: { status: "drawn", raea: "one Mesh of quads facing the camera, three's point size (attenuated or in pixels), vertex colours" },
+ Line: { status: "drawn", raea: "Gizmo strip in world space (vertex colours)", note: "lines are drawn 1 pixel wide in WebGL whatever linewidth says; raea draws linewidth" },
+ LineSegments: { status: "drawn", raea: "Gizmo lines (helpers too: AxesHelper, GridHelper, BoxHelper ...)" },
+ LineLoop: { status: "drawn", raea: "Gizmo strip, closed" },
+ Sprite: { status: "drawn", raea: "a Mesh quad facing the camera, its centre and rotation" },
+ ClippingGroup: { status: "near", raea: "Group", note: "its clipping planes are WebGPU-renderer only in three; raea draws the whole group" },
+ // lights
+ AmbientLight: { status: "drawn", raea: "AmbientLight (units.ts)" },
+ DirectionalLight: { status: "drawn", raea: "DirectionalLight with its target, shadows when the canvas has them" },
+ PointLight: { status: "drawn", raea: "PointLight, its reach where three's falls under half a level", note: "decay other than 2 falls off as the inverse square" },
+ SpotLight: { status: "drawn", raea: "SpotLight with its target, angle and penumbra", note: "decay other than 2 falls off as the inverse square; a `map` (projected picture) isn't drawn" },
+ RectAreaLight: { status: "drawn", raea: "RectAreaLight facing its -z, its size times its scale" },
+ HemisphereLight: { status: "near", raea: "AmbientLight of its two colours' average", note: "raea has no sky-and-ground light" },
+ LightProbe: { status: "near", raea: "AmbientLight of its average colour", note: "its directional bands are left out" },
+ Light: { status: "none", raea: "the base class: its subclasses are drawn" },
+ // cameras
+ Camera: { status: "none", raea: "the base class" },
+ PerspectiveCamera: { status: "drawn", raea: "PerspectiveCamera (zoom as field of view, view offset as `view`)" },
+ OrthographicCamera: { status: "drawn", raea: "OrthographicCamera (height over zoom)" },
+ ArrayCamera: { status: "drawn", raea: "PerspectiveCamera (the array's own view)" },
+ CubeCamera: { status: "none", raea: "a render to a cube texture (raea makes its own reflections)" },
+ // sound
+ AudioListener: { status: "none", raea: "sound: raea/tone and <Sound3D>" },
+ Audio: { status: "none", raea: "sound: raea/tone" },
+ PositionalAudio: { status: "none", raea: "sound: <Sound3D>" },
+ // materials
+ MeshStandardMaterial: { status: "drawn", raea: "MeshStandardMaterial (maps, alpha test and blending, sides, uv placement, samplers)" },
+ MeshPhysicalMaterial: { status: "drawn", raea: "MeshPhysicalMaterial (clearcoat, transmission, ior, thickness, attenuation, anisotropy, specular)", note: "sheen and iridescence are three's" },
+ MeshBasicMaterial: { status: "drawn", raea: "MeshBasicMaterial" },
+ MeshLambertMaterial: { status: "drawn", raea: "MeshStandardMaterial, roughness 1, metalness 0" },
+ MeshPhongMaterial: { status: "near", raea: "MeshStandardMaterial with its shininess as a roughness", note: "its specular colour is left out" },
+ MeshToonMaterial: { status: "near", raea: "MeshToonMaterial, a band per texel of its gradient map" },
+ MeshNormalMaterial: { status: "near", raea: "MeshBasicMaterial coloured by its normals per vertex", note: "three colours per pixel" },
+ MeshMatcapMaterial: { status: "near", raea: "MeshBasicMaterial in its colour", note: "the matcap's lighting is left out" },
+ MeshDepthMaterial: { status: "near", raea: "MeshBasicMaterial grey", note: "three's depth pass, not a surface" },
+ MeshDistanceMaterial: { status: "near", raea: "MeshBasicMaterial grey", note: "three's shadow pass, not a surface" },
+ ShadowMaterial: { status: "none", raea: "not drawn", note: "raea has no surface that only catches shadows" },
+ SpriteMaterial: { status: "drawn", raea: "MeshBasicMaterial on the sprite's quad" },
+ PointsMaterial: { status: "drawn", raea: "MeshBasicMaterial on the points' quads" },
+ LineBasicMaterial: { status: "drawn", raea: "the Gizmo's colours" },
+ LineDashedMaterial: { status: "near", raea: "the Gizmo's colours", note: "drawn solid" },
+ ShaderMaterial: { status: "near", raea: "MeshBasicMaterial in its colour uniform", note: "GLSL doesn't run in Bevy: port it to <SurfaceShader> (WESL)" },
+ RawShaderMaterial: { status: "near", raea: "MeshBasicMaterial in its colour uniform", note: "GLSL doesn't run in Bevy: port it to <SurfaceShader> (WESL)" },
+ Material: { status: "none", raea: "the base class" },
+ // helpers: lines (and a plane's mesh), drawn as any lines are
+ ...Object.fromEntries(["ArrowHelper", "AxesHelper", "Box3Helper", "BoxHelper", "CameraHelper", "DirectionalLightHelper", "GridHelper", "HemisphereLightHelper", "PlaneHelper", "PointLightHelper", "PolarGridHelper", "SkeletonHelper", "SpotLightHelper"].map((k) => [k, { status: "drawn" as const, raea: "its lines as Gizmo lines (an arrow's head and a plane's face as meshes)" }])),
+};
diff --git a/sdk/r3f/src/input/lights.ts b/sdk/r3f/src/input/lights.ts
new file mode 100644
index 00000000..52289cb0
--- /dev/null
+++ b/sdk/r3f/src/input/lights.ts
@@ -0,0 +1,153 @@
+// three.js's lights, cameras, fog and environment as raea's parts, in world space (raea places a light and the camera
+// by position and target, not inside a group). Intensities go through units.ts: a three light and the raea light it
+// becomes put the same light on screen.
+import * as THREE from "three";
+import { toRaea, stopsOf } from "../units";
+import type { Part, Props } from "./material";
+import { srcOf } from "./texture";
+
+const hex = (c: THREE.Color) => "#" + c.getHexString();
+const at = (o: THREE.Object3D) => o.getWorldPosition(new THREE.Vector3()).toArray() as [number, number, number];
+/** a point one unit along the object's -z: where a camera, a light and an area light face (three's lookAt turns their
+ * -z to the target; a camera's getWorldDirection already gives -z, a light's +z, so the axis is read directly) */
+const ahead = (o: THREE.Object3D) => {
+ const p = o.getWorldPosition(new THREE.Vector3());
+ return p.add(new THREE.Vector3(0, 0, -1).applyQuaternion(o.getWorldQuaternion(new THREE.Quaternion()))).toArray() as [number, number, number];
+};
+
+const warned = new Set<string>();
+const warnOnce = (k: string, why: string) => {
+ if (warned.has(k)) return;
+ warned.add(k);
+ console.warn(`raea/r3f: ${k} ${why}`);
+};
+
+/** how far a three point light reaches (its `distance`, or where inverse-square falloff leaves under half a level of
+ * 8-bit colour: raea's lights end at a range, three's with distance 0 never do) */
+export const reachOf = (intensity: number, distance: number) => (distance > 0 ? distance : Math.max(20, Math.sqrt(intensity * 512)));
+
+/** a light as raea's lights (a hemisphere light is two) */
+export function lightsOf(l: THREE.Light, shadows: boolean, name: string): Part[] {
+ const p = lightOf(l, shadows, name);
+ return p === undefined ? [] : Array.isArray(p) ? p : [p];
+}
+
+/** a light as raea's, or undefined for one raea has no light for */
+function lightOf(l: THREE.Light, shadows: boolean, name: string): Part | Part[] | undefined {
+ const color = hex(l.color);
+ const cast = shadows && l.castShadow;
+ if ((l as THREE.DirectionalLight).isDirectionalLight) {
+ const d = l as THREE.DirectionalLight;
+ return { type: "DirectionalLight", props: { name, position: at(d), target: at(d.target), color, intensity: toRaea("DirectionalLight", d.intensity), castShadow: cast } };
+ }
+ if ((l as THREE.SpotLight).isSpotLight) {
+ const s = l as THREE.SpotLight;
+ if (s.decay !== 2) warnOnce("SpotLight decay", `${s.decay} falls off as the inverse square in raea (Bevy's lights are physical)`);
+ return { type: "SpotLight", props: { name, position: at(s), target: at(s.target), color, intensity: toRaea("SpotLight", s.intensity), distance: reachOf(s.intensity, s.distance), angle: Math.min(Math.PI / 2, s.angle), penumbra: s.penumbra, castShadow: cast } };
+ }
+ if ((l as THREE.PointLight).isPointLight) {
+ const p = l as THREE.PointLight;
+ if (p.decay !== 2) warnOnce("PointLight decay", `${p.decay} falls off as the inverse square in raea (Bevy's lights are physical)`);
+ return { type: "PointLight", props: { name, position: at(p), color, intensity: toRaea("PointLight", p.intensity), distance: reachOf(p.intensity, p.distance), castShadow: cast } };
+ }
+ if ((l as THREE.RectAreaLight).isRectAreaLight) {
+ const r = l as THREE.RectAreaLight;
+ const s = r.getWorldScale(new THREE.Vector3());
+ const width = r.width * Math.abs(s.x), height = r.height * Math.abs(s.y);
+ return { type: "RectAreaLight", props: { position: at(r), target: ahead(r), width, height, color, intensity: toRaea("RectAreaLight", r.intensity, width * height) } };
+ }
+ if ((l as THREE.HemisphereLight).isHemisphereLight) {
+ // three lights a surface with mix(ground, sky, (1 + n.up) / 2): their average from everywhere, plus half their
+ // difference as a light from straight up (or down, when the ground is the brighter). Exact for surfaces facing that
+ // light or sideways; one facing away gets the average where three gives it less.
+ const h = l as THREE.HemisphereLight;
+ warnOnce("HemisphereLight", "is lit as an ambient light of its colours' average and a light from above of half their difference (exact but for surfaces facing away from it)");
+ const avg = h.color.clone().lerp(h.groundColor, 0.5);
+ const lum = (c: THREE.Color) => 0.2126 * c.r + 0.7152 * c.g + 0.0722 * c.b;
+ const up = lum(h.color) >= lum(h.groundColor);
+ const [hi, lo] = up ? [h.color, h.groundColor] : [h.groundColor, h.color];
+ const d = new THREE.Color(Math.max(0, hi.r - lo.r) / 2, Math.max(0, hi.g - lo.g) / 2, Math.max(0, hi.b - lo.b) / 2);
+ const m = Math.max(d.r, d.g, d.b);
+ const amb: Part = { type: "AmbientLight", props: { name, color: hex(avg), intensity: toRaea("AmbientLight", h.intensity) } };
+ if (m < 1e-4) return amb;
+ // three's hemisphere axis is the light's own up (its position, normalised, as three reads it)
+ const axis = h.getWorldPosition(new THREE.Vector3()).normalize();
+ if (axis.lengthSq() === 0) axis.set(0, 1, 0);
+ if (!up) axis.negate();
+ const dir: Part = { type: "DirectionalLight", props: { name: `${name}~sky`, position: axis.toArray(), target: [0, 0, 0], color: hex(new THREE.Color(d.r / m, d.g / m, d.b / m)), intensity: toRaea("DirectionalLight", h.intensity * m) } };
+ return [amb, dir];
+ }
+ if ((l as THREE.LightProbe).isLightProbe) {
+ // its spherical harmonics' constant band: the light it gives from every way on average
+ const p = l as THREE.LightProbe;
+ const c = p.sh.coefficients[0].clone().multiplyScalar(0.282095 * p.intensity);
+ const m = Math.max(c.x, c.y, c.z, 1e-6);
+ warnOnce("LightProbe", "is lit as an ambient light of its average colour");
+ return { type: "AmbientLight", props: { name, color: hex(new THREE.Color(c.x / m, c.y / m, c.z / m)), intensity: toRaea("AmbientLight", m) } };
+ }
+ if ((l as THREE.AmbientLight).isAmbientLight) return { type: "AmbientLight", props: { name, color, intensity: toRaea("AmbientLight", l.intensity) } };
+ return undefined;
+}
+
+/** the camera R3F draws with, as raea's */
+export function cameraOf(c: THREE.Camera): Part | undefined {
+ c.updateMatrixWorld();
+ const position = at(c);
+ const lookAt = ahead(c);
+ const up = new THREE.Vector3(0, 1, 0).applyQuaternion(c.getWorldQuaternion(new THREE.Quaternion())).toArray() as [number, number, number];
+ if ((c as THREE.PerspectiveCamera).isPerspectiveCamera) {
+ const p = c as THREE.PerspectiveCamera;
+ // zoom narrows the field of view as three's projection does
+ const fov = (2 * Math.atan(Math.tan((p.fov * Math.PI) / 360) / p.zoom) * 180) / Math.PI;
+ const props: Props = { position, lookAt, up, fov, near: p.near, far: p.far };
+ if (p.view?.enabled) props.view = { width: p.view.fullWidth, height: p.view.fullHeight, x: p.view.offsetX, y: p.view.offsetY };
+ return { type: "PerspectiveCamera", props };
+ }
+ if ((c as THREE.OrthographicCamera).isOrthographicCamera) {
+ const o = c as THREE.OrthographicCamera;
+ return { type: "OrthographicCamera", props: { position, lookAt, up, height: (o.top - o.bottom) / o.zoom, near: o.near, far: o.far } };
+ }
+ return undefined;
+}
+
+/** three's fog as raea's */
+export function fogOf(f: THREE.Fog | THREE.FogExp2 | null): Part | undefined {
+ if (!f) return undefined;
+ if ((f as THREE.FogExp2).isFogExp2) return { type: "Fog", props: { color: hex(f.color), density: (f as THREE.FogExp2).density } };
+ const l = f as THREE.Fog;
+ return { type: "Fog", props: { color: hex(l.color), near: l.near, far: l.far } };
+}
+
+const PANORAMA = /\.(hdr|exr|png|jpe?g)(\?.*)?$/i;
+
+/** the scene's environment (and a panorama behind it) as raea's <Environment>, or the background colour */
+export function skyOf(scene: THREE.Scene): { parts: Part[]; background?: string } {
+ const parts: Part[] = [];
+ let background: string | undefined;
+ const bg = scene.background;
+ if (bg instanceof THREE.Color) background = hex(bg);
+ const env = srcOf(scene.environment);
+ const sky = bg instanceof THREE.Texture ? srcOf(bg) : undefined;
+ if (scene.environment && !(env && PANORAMA.test(env))) warnOnce("scene.environment", "isn't a panorama file raea can load (.hdr, .exr, .png, .jpg): left out");
+ if (bg instanceof THREE.Texture && !(sky && PANORAMA.test(sky))) warnOnce("scene.background", "texture isn't a panorama file raea can load: left out");
+ const rotation = scene.environmentRotation?.y ?? 0;
+ if (env && PANORAMA.test(env)) {
+ const props: Props = { src: env, intensity: scene.environmentIntensity, rotation };
+ if (sky === env) Object.assign(props, { background: true, backgroundIntensity: scene.backgroundIntensity });
+ parts.push({ type: "Environment", props });
+ } else if (sky && PANORAMA.test(sky)) {
+ // a panorama behind the scene that doesn't light it
+ parts.push({ type: "Environment", props: { src: sky, intensity: 0, rotation: scene.backgroundRotation?.y ?? 0, background: true, backgroundIntensity: scene.backgroundIntensity } });
+ }
+ return { parts, background };
+}
+
+/** three's renderer settings (R3F sets them from <Canvas flat linear>) as raea's tone mapping */
+export function toneOf(gl: THREE.WebGLRenderer): Part {
+ const modes: Record<number, string> = { [THREE.ACESFilmicToneMapping]: "aces", [THREE.AgXToneMapping]: "agx", [THREE.NeutralToneMapping]: "neutral", [THREE.ReinhardToneMapping]: "reinhard", [THREE.CineonToneMapping]: "aces", [THREE.LinearToneMapping]: "none", [THREE.NoToneMapping]: "none" };
+ const props: Props = { mode: modes[gl.toneMapping] ?? "none" };
+ // three's ACES scales its input by 1/0.6 where Bevy's ACESFitted doesn't: the same picture is 0.74 stops up in raea
+ const stops = stopsOf(gl.toneMappingExposure / (gl.toneMapping === THREE.ACESFilmicToneMapping ? 0.6 : 1));
+ if (stops !== 0) props.exposure = stops;
+ return { type: "ToneMapping", props };
+}
diff --git a/sdk/r3f/src/input/material.ts b/sdk/r3f/src/input/material.ts
new file mode 100644
index 00000000..76240467
--- /dev/null
+++ b/sdk/r3f/src/input/material.ts
@@ -0,0 +1,175 @@
+// A three.js material as raea's: the component that draws it the same way and its props. Standard and physical are
+// Bevy's StandardMaterial on both sides; basic is unlit; Lambert is the standard surface with no gloss; Phong's
+// shininess becomes a roughness (Blinn-Phong's exponent as a GGX roughness); toon is raea's toon surface with a band per
+// step of its gradient map; normal, matcap, depth and distance materials are drawn as the unlit colour each puts on
+// screen most (their per-pixel looks need three's shaders). A ShaderMaterial's GLSL doesn't run in Bevy: it is drawn
+// with its `color` (or diffuse) uniform, unlit, and named once, with raea's <SurfaceShader> (WESL) as its port.
+import * as THREE from "three";
+import { placementOf, srcOf } from "./texture";
+
+export type Props = Record<string, unknown>;
+export interface Part {
+ /** the raea/3d component that draws it */
+ type: string;
+ props: Props;
+ children?: Part[];
+ /** a MeshNormalMaterial: the mesh's normals become its vertex colours */
+ normals?: boolean;
+}
+
+const hex = (c: THREE.Color) => "#" + c.getHexString();
+const side = (s: THREE.Side) => (s === THREE.BackSide ? "back" : s === THREE.DoubleSide ? "double" : undefined);
+
+/** the props every surface shares: colour, opacity and blending, side, fog */
+function drawn(m: THREE.Material & { color?: THREE.Color; map?: THREE.Texture | null }, p: Props) {
+ if (m.color) p.color = hex(m.color);
+ if (m.opacity < 1 || m.transparent) {
+ p.opacity = m.opacity;
+ p.transparent = true;
+ }
+ if (m.blending === THREE.AdditiveBlending) p.alphaMode = "add";
+ else if (m.blending === THREE.MultiplyBlending) p.alphaMode = "multiply";
+ else if (m.alphaTest > 0) {
+ p.alphaMode = "mask";
+ p.alphaCutoff = m.alphaTest;
+ }
+ const s = side(m.side);
+ if (s) p.side = s;
+ if ((m as { fog?: boolean }).fog === false) p.fog = false;
+ const map = srcOf(m.map);
+ if (map) {
+ p.map = map;
+ Object.assign(p, placementOf(m.map!));
+ }
+}
+
+type Std = THREE.MeshStandardMaterial;
+function standard(m: Std, p: Props) {
+ drawn(m, p);
+ p.roughness = m.roughness;
+ p.metalness = m.metalness;
+ if (m.emissive && (m.emissive.r || m.emissive.g || m.emissive.b)) {
+ p.emissive = hex(m.emissive);
+ p.emissiveIntensity = m.emissiveIntensity;
+ }
+ const maps: [keyof Std, string][] = [["normalMap", "normalMap"], ["roughnessMap", "roughnessMap"], ["metalnessMap", "metalnessMap"], ["aoMap", "aoMap"], ["emissiveMap", "emissiveMap"], ["displacementMap", "depthMap"]];
+ for (const [from, to] of maps) {
+ const s = srcOf(m[from] as THREE.Texture | null);
+ if (s) p[to] = s;
+ }
+ // three keeps metalness and roughness in one glTF texture's blue and green when both maps are the same one
+ if (m.roughnessMap && m.roughnessMap === m.metalnessMap) {
+ p.metallicRoughnessMap = p.roughnessMap;
+ delete p.roughnessMap;
+ delete p.metalnessMap;
+ }
+}
+
+function physical(m: THREE.MeshPhysicalMaterial, p: Props) {
+ standard(m, p);
+ if (m.clearcoat) {
+ p.clearcoat = m.clearcoat;
+ p.clearcoatRoughness = m.clearcoatRoughness;
+ }
+ if (m.transmission) {
+ p.transmission = m.transmission;
+ p.thickness = m.thickness;
+ }
+ if (m.ior !== 1.5) p.ior = m.ior;
+ // three's specularIntensity scales the 4% a dielectric reflects at ior 1.5: Bevy's reflectance is 0.5 at 4%
+ if (m.specularIntensity !== 1) p.reflectance = Math.min(1, 0.5 * m.specularIntensity);
+ if (m.specularColor && hex(m.specularColor) !== "#ffffff") p.specularTint = hex(m.specularColor);
+ if (m.anisotropy) p.anisotropy = { strength: m.anisotropy, rotation: m.anisotropyRotation };
+ if (m.attenuationDistance !== Infinity) p.attenuation = { distance: m.attenuationDistance, color: hex(m.attenuationColor) };
+}
+
+/** Blinn-Phong's specular exponent as a GGX roughness (α² = 2 / (n + 2)) */
+export const roughnessOfShininess = (n: number) => Math.min(1, Math.sqrt(Math.sqrt(2 / (Math.max(0, n) + 2))));
+
+/** the toon steps a gradient map holds: its texels, one band each */
+function toonBands(m: THREE.MeshToonMaterial): number {
+ const g = m.gradientMap?.image as { width?: number } | undefined;
+ return Math.max(1, Math.min(8, g?.width ?? 2));
+}
+
+/** the materials named once a session (their look isn't Bevy's) */
+const warned = new Set<string>();
+function warnOnce(type: string, why: string) {
+ if (warned.has(type)) return;
+ warned.add(type);
+ console.warn(`raea/r3f: ${type} ${why}`);
+}
+
+/** a material as raea's: its component and props */
+export function materialOf(m: THREE.Material, vertexColors: boolean): Part {
+ const p: Props = {};
+ const t = m.type;
+ switch (t) {
+ case "MeshPhysicalMaterial":
+ physical(m as THREE.MeshPhysicalMaterial, p);
+ return { type: "MeshPhysicalMaterial", props: p };
+ case "MeshStandardMaterial":
+ standard(m as Std, p);
+ return { type: "MeshStandardMaterial", props: p };
+ case "MeshLambertMaterial": {
+ const l = m as THREE.MeshLambertMaterial;
+ drawn(l, p);
+ p.roughness = 1;
+ p.metalness = 0;
+ if (l.emissive.r || l.emissive.g || l.emissive.b) Object.assign(p, { emissive: hex(l.emissive), emissiveIntensity: l.emissiveIntensity });
+ return { type: "MeshStandardMaterial", props: p };
+ }
+ case "MeshPhongMaterial": {
+ const ph = m as THREE.MeshPhongMaterial;
+ drawn(ph, p);
+ p.roughness = roughnessOfShininess(ph.shininess);
+ p.metalness = 0;
+ if (ph.emissive.r || ph.emissive.g || ph.emissive.b) Object.assign(p, { emissive: hex(ph.emissive), emissiveIntensity: ph.emissiveIntensity });
+ const n = srcOf(ph.normalMap);
+ if (n) p.normalMap = n;
+ return { type: "MeshStandardMaterial", props: p };
+ }
+ case "MeshToonMaterial": {
+ const tm = m as THREE.MeshToonMaterial;
+ drawn(tm, p);
+ for (const k of ["alphaMode", "alphaCutoff", "side", "fog", "repeat", "uvTransform", "sampler"]) delete p[k];
+ p.steps = toonBands(tm);
+ p.rim = false;
+ p.highlight = false;
+ p.outline = false;
+ if (tm.emissive.r || tm.emissive.g || tm.emissive.b) Object.assign(p, { emissive: hex(tm.emissive), emissiveIntensity: tm.emissiveIntensity });
+ return { type: "MeshToonMaterial", props: p };
+ }
+ case "MeshBasicMaterial":
+ case "SpriteMaterial":
+ case "PointsMaterial":
+ case "LineBasicMaterial":
+ case "LineDashedMaterial":
+ case "MeshMatcapMaterial":
+ drawn(m as THREE.MeshBasicMaterial, p);
+ if (t === "MeshMatcapMaterial") warnOnce(t, "is drawn unlit in its colour (a matcap's lighting is three's shader)");
+ return { type: "MeshBasicMaterial", props: p };
+ case "MeshNormalMaterial":
+ warnOnce(t, "is drawn as each vertex's normal in colour, unlit (three shades it per pixel, in view space)");
+ return { type: "MeshBasicMaterial", props: { color: "#ffffff" }, normals: true } as Part;
+ case "MeshDepthMaterial":
+ case "MeshDistanceMaterial":
+ warnOnce(t, "is drawn unlit grey (it is three's shadow and depth pass, not a surface)");
+ return { type: "MeshBasicMaterial", props: { color: "#808080" } };
+ case "ShadowMaterial": {
+ const s = m as THREE.ShadowMaterial;
+ warnOnce(m.type, "only catches shadows, which raea has no surface for: it isn't drawn");
+ return { type: "", props: { color: hex(s.color), opacity: s.opacity } };
+ }
+ default: {
+ // ShaderMaterial, RawShaderMaterial, a NodeMaterial, a library's own
+ const u = (m as THREE.ShaderMaterial).uniforms ?? {};
+ const c = (u.color ?? u.diffuse ?? u.uColor)?.value;
+ warnOnce(t, "runs GLSL that Bevy doesn't: drawn unlit in its colour uniform; port its shader to raea's <SurfaceShader> (WESL)");
+ drawn(m as THREE.MeshBasicMaterial, p);
+ if (c instanceof THREE.Color) p.color = hex(c);
+ return { type: "MeshBasicMaterial", props: p };
+ }
+ }
+ void vertexColors;
+}
diff --git a/sdk/r3f/src/input/scene.ts b/sdk/r3f/src/input/scene.ts
new file mode 100644
index 00000000..9e19de96
--- /dev/null
+++ b/sdk/r3f/src/input/scene.ts
@@ -0,0 +1,272 @@
+// A three.js scene as raea's parts. The scene graph keeps its shape: an object with children is a <Group> at its own
+// transform (raea composes them as three does, shear included), a mesh a <Mesh> with its <BufferMesh> and material.
+// An InstancedMesh is <Instances> while its copies hold still and one mesh a copy when they move or each has its own
+// colour; Points are one mesh of quads facing the camera; lines are a <Gizmo>; a Sprite is a quad facing the camera.
+// Lights, the camera, fog and the environment come out in world space (lights.ts). Each part is named by its place in
+// the tree (and its own name), so raea matches it across frames.
+import * as THREE from "three";
+import { arraysOf, posed, posedArrays, type Arrays } from "./geometry";
+import { cameraOf, fogOf, lightsOf, skyOf, toneOf } from "./lights";
+import { materialOf, type Part, type Props } from "./material";
+
+type V3 = [number, number, number];
+type Q = [number, number, number, number];
+
+/** an object's own transform, from its matrix (so matrixAutoUpdate={false} objects come out as three draws them) */
+function place(o: THREE.Object3D): Props {
+ const p = new THREE.Vector3(), q = new THREE.Quaternion(), s = new THREE.Vector3();
+ o.matrix.decompose(p, q, s);
+ const out: Props = { position: p.toArray() as V3, quaternion: q.toArray() as Q };
+ out.scale = s.x === s.y && s.y === s.z && s.x > 0 ? s.x : (s.toArray() as V3);
+ return out;
+}
+
+const hex = (c: THREE.Color) => "#" + c.getHexString();
+
+export interface Walk {
+ camera: THREE.Camera;
+ /** the renderer's shadow map is on (<Canvas shadows>) */
+ shadows: boolean;
+ /** lights and the camera, gathered in world space */
+ world: Part[];
+ /** the drawing's height in pixels (a point's size without attenuation is in pixels) */
+ height: number;
+}
+
+function flipped(m: THREE.Material | THREE.Material[]): boolean {
+ const map = ((Array.isArray(m) ? m[0] : m) as THREE.MeshBasicMaterial | undefined)?.map;
+ return map ? map.flipY : true;
+}
+
+function colouredByVertex(m: THREE.Material) {
+ return m.vertexColors === true;
+}
+
+/** normals as colours (MeshNormalMaterial, in the camera's space as three draws them) */
+function normalColours(a: Arrays, mesh: THREE.Object3D, camera: THREE.Camera): Arrays {
+ if (!a.normals) return a;
+ const toView = new THREE.Matrix3().getNormalMatrix(new THREE.Matrix4().multiplyMatrices(camera.matrixWorldInverse, mesh.matrixWorld));
+ const v = new THREE.Vector3();
+ const colors: number[] = [];
+ for (let i = 0; i < a.normals.length; i += 3) {
+ v.fromArray(a.normals, i).applyMatrix3(toView).normalize();
+ // three writes the normal's 0.5 + 0.5n as the screen value (sRGB), raea's vertex colours are linear
+ const c = new THREE.Color().setRGB(0.5 + 0.5 * v.x, 0.5 + 0.5 * v.y, 0.5 + 0.5 * v.z, THREE.SRGBColorSpace);
+ colors.push(c.r, c.g, c.b, 1);
+ }
+ return { ...a, colors };
+}
+
+function meshParts(mesh: THREE.Mesh, name: string, w: Walk, at: Props): Part[] {
+ const mats = Array.isArray(mesh.material) ? mesh.material : [mesh.material];
+ const g = mesh.geometry;
+ const ranges = Array.isArray(mesh.material) && g.groups.length ? g.groups.map((r) => ({ start: r.start, count: r.count, material: mats[r.materialIndex ?? 0] })) : [{ start: undefined, count: undefined, material: mats[0] }];
+ const out: Part[] = [];
+ ranges.forEach((r, i) => {
+ if (!r.material || !r.material.visible) return;
+ const o = { start: r.start, count: r.count, flipV: flipped(r.material), colors: colouredByVertex(r.material) };
+ let arrays = posed(mesh) ? posedArrays(mesh, o) : arraysOf(g, o);
+ if (!arrays) return;
+ const surface = materialOf(r.material, o.colors);
+ if (!surface.type) return;
+ if (surface.normals) arrays = normalColours(arrays, mesh, w.camera);
+ const props: Props = { name: ranges.length > 1 ? `${name}#${i}` : name, ...at, castShadow: w.shadows && mesh.castShadow, receiveShadow: mesh.receiveShadow };
+ out.push({ type: "Mesh", props, children: [{ type: "BufferMesh", props: { ...arrays } }, surface] });
+ });
+ return out;
+}
+
+/** whose copies have moved since the first frame: those are drawn one mesh a copy */
+const firstPlacement = new WeakMap<THREE.InstancedMesh, number>();
+
+function instancedParts(m: THREE.InstancedMesh, name: string, w: Walk, at: Props): Part[] {
+ const v = m.instanceMatrix.version;
+ if (!firstPlacement.has(m)) firstPlacement.set(m, v);
+ const moving = firstPlacement.get(m) !== v || m.instanceColor !== null || Array.isArray(m.material);
+ const one = new THREE.Matrix4();
+ const p = new THREE.Vector3(), q = new THREE.Quaternion(), s = new THREE.Vector3(), e = new THREE.Euler();
+ const copies: { position: V3; quaternion: Q; rotation: V3; scale: V3 }[] = [];
+ for (let i = 0; i < m.count; i++) {
+ m.getMatrixAt(i, one);
+ one.decompose(p, q, s);
+ copies.push({ position: p.toArray() as V3, quaternion: q.toArray() as Q, rotation: e.setFromQuaternion(q, "XYZ").toArray().slice(0, 3) as V3, scale: s.toArray() as V3 });
+ }
+ if (!moving) {
+ const material = m.material as THREE.Material;
+ const arrays = arraysOf(m.geometry, { flipV: flipped(material), colors: colouredByVertex(material) });
+ const surface = materialOf(material, false);
+ if (!arrays || !surface.type) return [];
+ return [{ type: "Instances", props: { name, ...at, at: copies.map(({ position, rotation, scale }) => ({ position, rotation, scale })), shadow: w.shadows && m.castShadow, receiveShadow: m.receiveShadow }, children: [{ type: "BufferMesh", props: { ...arrays } }, surface] }];
+ }
+ const kids: Part[] = [];
+ const c = new THREE.Color();
+ copies.forEach((k, i) => {
+ for (const part of meshParts(m, `${name}.${i}`, w, { position: k.position, quaternion: k.quaternion, scale: k.scale })) {
+ if (m.instanceColor) {
+ m.getColorAt(i, c);
+ const surface = part.children![1];
+ const base = new THREE.Color((surface.props.color as string) ?? "#ffffff");
+ surface.props = { ...surface.props, color: hex(base.multiply(c)) };
+ }
+ kids.push(part);
+ }
+ });
+ return [{ type: "Group", props: { name, ...at }, children: kids }];
+}
+
+/** a BatchedMesh: each of its instances a mesh of its own geometry's range, at its matrix, in its colour */
+function batchedParts(b: THREE.BatchedMesh, name: string, w: Walk): Part[] {
+ const info = (b as unknown as { _instanceInfo: { active: boolean; visible: boolean }[] })._instanceInfo;
+ const material = b.material as THREE.Material;
+ if (!material.visible) return [];
+ const surface = materialOf(material, false);
+ if (!surface.type) return [];
+ const one = new THREE.Matrix4(), p = new THREE.Vector3(), q = new THREE.Quaternion(), s = new THREE.Vector3(), c = new THREE.Color();
+ const colours = (b as unknown as { _colorsTexture: unknown })._colorsTexture !== null;
+ const out: Part[] = [];
+ info.forEach((k, i) => {
+ if (!k.active || !k.visible) return;
+ const range = b.getGeometryRangeAt(b.getGeometryIdAt(i));
+ if (!range) return;
+ const arrays = arraysOf(b.geometry, { start: range.start, count: range.count, flipV: flipped(material), colors: false });
+ if (!arrays) return;
+ b.getMatrixAt(i, one);
+ one.decompose(p, q, s);
+ let own = surface;
+ if (colours) {
+ b.getColorAt(i, c);
+ own = { ...surface, props: { ...surface.props, color: hex(new THREE.Color((surface.props.color as string) ?? "#ffffff").multiply(c)) } };
+ }
+ out.push({ type: "Mesh", props: { name: `${name}.${i}`, position: p.toArray(), quaternion: q.toArray(), scale: s.toArray(), castShadow: w.shadows && b.castShadow, receiveShadow: b.receiveShadow }, children: [{ type: "BufferMesh", props: { ...arrays } }, own] });
+ });
+ return out;
+}
+
+/** a quad facing the camera at each point: one mesh, its vertex colours the points' */
+function pointParts(pts: THREE.Points, name: string, w: Walk): Part[] {
+ const g = pts.geometry, mat = pts.material as THREE.PointsMaterial;
+ const pos = g.attributes.position;
+ if (!pos || !mat.visible) return [];
+ const cam = w.camera;
+ const right = new THREE.Vector3(1, 0, 0).applyQuaternion(cam.getWorldQuaternion(new THREE.Quaternion()));
+ const up = new THREE.Vector3(0, 1, 0).applyQuaternion(cam.getWorldQuaternion(new THREE.Quaternion()));
+ const camAt = cam.getWorldPosition(new THREE.Vector3());
+ const persp = (cam as THREE.PerspectiveCamera).isPerspectiveCamera ? (cam as THREE.PerspectiveCamera) : undefined;
+ const tanHalf = persp ? Math.tan((persp.fov * Math.PI) / 360) / persp.zoom : 1;
+ const height = persp ? 0 : ((cam as THREE.OrthographicCamera).top - (cam as THREE.OrthographicCamera).bottom) / (cam as THREE.OrthographicCamera).zoom;
+ const px = w.height;
+ const colours = mat.vertexColors && g.attributes.color;
+ const positions: number[] = [], uvs: number[] = [], colors: number[] = [], indices: number[] = [];
+ const v = new THREE.Vector3();
+ const from = g.drawRange.start, to = Math.min(pos.count, g.drawRange.start + g.drawRange.count);
+ for (let i = from; i < to; i++) {
+ v.fromBufferAttribute(pos, i).applyMatrix4(pts.matrixWorld);
+ // three's point size: with attenuation, `size` scaled as a world-space object of size·tan(fov/2); without, pixels
+ const dist = v.distanceTo(camAt);
+ const side = persp ? (mat.sizeAttenuation ? mat.size * tanHalf : (mat.size * 2 * dist * tanHalf) / px) : mat.sizeAttenuation ? mat.size : (mat.size * height) / px;
+ const h = side / 2;
+ const base = positions.length / 3;
+ for (const [sx, sy, u, vv] of [[-1, -1, 0, 1], [1, -1, 1, 1], [1, 1, 1, 0], [-1, 1, 0, 0]]) {
+ positions.push(v.x + (right.x * sx + up.x * sy) * h, v.y + (right.y * sx + up.y * sy) * h, v.z + (right.z * sx + up.z * sy) * h);
+ uvs.push(u, vv);
+ if (colours) colors.push(colours.getX(i), colours.getY(i), colours.getZ(i), colours.itemSize > 3 ? colours.getW(i) : 1);
+ }
+ indices.push(base, base + 1, base + 2, base, base + 2, base + 3);
+ }
+ if (!indices.length) return [];
+ const surface = materialOf(mat, !!colours);
+ const arrays: Arrays = { positions, indices, uvs, colors: colours ? colors : undefined };
+ return [{ type: "Mesh", props: { name, castShadow: false, receiveShadow: false }, children: [{ type: "BufferMesh", props: arrays as unknown as Props }, surface] }];
+}
+
+/** lines as raea's gizmo lines, in world space */
+function lineParts(l: THREE.Line, name: string): Part[] {
+ const g = l.geometry, mat = l.material as THREE.LineBasicMaterial;
+ const pos = g.attributes.position;
+ if (!pos || !mat.visible) return [];
+ const idx = g.index;
+ const n = idx ? idx.count : pos.count;
+ const point = (i: number) => new THREE.Vector3().fromBufferAttribute(pos, idx ? idx.getX(i) : i).applyMatrix4(l.matrixWorld).toArray() as V3;
+ const colour = (i: number) => {
+ const c = mat.vertexColors && g.attributes.color ? new THREE.Color().fromBufferAttribute(g.attributes.color as THREE.BufferAttribute, idx ? idx.getX(i) : i).multiply(mat.color) : mat.color;
+ return hex(c);
+ };
+ const width = mat.linewidth > 0 ? mat.linewidth : 1;
+ if ((l as THREE.LineSegments).isLineSegments) {
+ const lines: [V3, V3][] = [], cs: string[] = [];
+ for (let i = 0; i + 1 < n; i += 2) {
+ lines.push([point(i), point(i + 1)]);
+ cs.push(colour(i), colour(i + 1));
+ }
+ return lines.length ? [{ type: "Gizmo", props: { name, lines, color: mat.vertexColors ? cs : hex(mat.color), width, depthBias: 0 } }] : [];
+ }
+ const strip: V3[] = [], cs: string[] = [];
+ for (let i = 0; i < n; i++) {
+ strip.push(point(i));
+ cs.push(colour(i));
+ }
+ if ((l as THREE.LineLoop).isLineLoop && n > 2) {
+ strip.push(point(0));
+ cs.push(colour(0));
+ }
+ return strip.length > 1 ? [{ type: "Gizmo", props: { name, strip, color: mat.vertexColors ? cs : hex(mat.color), width, depthBias: 0 } }] : [];
+}
+
+/** a sprite: a quad at its place facing the camera, turned by its material's rotation, its centre where `center` says */
+function spriteParts(s: THREE.Sprite, name: string, w: Walk): Part[] {
+ const mat = s.material;
+ if (!mat.visible) return [];
+ const pos = s.getWorldPosition(new THREE.Vector3());
+ const scale = s.getWorldScale(new THREE.Vector3());
+ const q = w.camera.getWorldQuaternion(new THREE.Quaternion()).multiply(new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 0, 1), mat.rotation));
+ const [cx, cy] = [s.center.x, s.center.y];
+ const positions = [-cx, -cy, 0, 1 - cx, -cy, 0, 1 - cx, 1 - cy, 0, -cx, 1 - cy, 0];
+ const flip = mat.map ? mat.map.flipY : true;
+ const uvs = flip ? [0, 1, 1, 1, 1, 0, 0, 0] : [0, 0, 1, 0, 1, 1, 0, 1];
+ const surface = materialOf(mat, false);
+ return [{ type: "Mesh", props: { name, position: pos.toArray(), quaternion: q.toArray(), scale: [scale.x, scale.y, 1], castShadow: false, receiveShadow: false }, children: [{ type: "BufferMesh", props: { positions, uvs, normals: [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1], indices: [0, 1, 2, 0, 2, 3] } }, surface] }];
+}
+
+/** one object and what hangs from it */
+function walk(o: THREE.Object3D, path: string, w: Walk): Part[] {
+ if (!o.visible || !o.layers.test(w.camera.layers)) return [];
+ const name = o.name ? `${path}:${o.name}` : path;
+ if ((o as THREE.LOD).isLOD) (o as THREE.LOD).update(w.camera);
+ if ((o as THREE.Light).isLight) {
+ w.world.push(...lightsOf(o as THREE.Light, w.shadows, name));
+ }
+ const kids = o.children.flatMap((c, i) => walk(c, `${path}/${i}`, w));
+ const at = place(o);
+ let own: Part[] = [];
+ if ((o as THREE.BatchedMesh).isBatchedMesh) own = batchedParts(o as THREE.BatchedMesh, name, w);
+ else if ((o as THREE.InstancedMesh).isInstancedMesh) own = instancedParts(o as THREE.InstancedMesh, name, w, {});
+ else if ((o as THREE.Mesh).isMesh) own = meshParts(o as THREE.Mesh, name, w, {});
+ else if ((o as THREE.Points).isPoints) return [...pointParts(o as THREE.Points, name, w), ...kids.length ? [{ type: "Group", props: { name: `${name}/`, ...at }, children: kids }] : []];
+ else if ((o as THREE.Line).isLine) return [...lineParts(o as THREE.Line, name), ...kids.length ? [{ type: "Group", props: { name: `${name}/`, ...at }, children: kids }] : []];
+ else if ((o as THREE.Sprite).isSprite) return [...spriteParts(o as THREE.Sprite, name, w), ...kids.length ? [{ type: "Group", props: { name: `${name}/`, ...at }, children: kids }] : []];
+ // a mesh alone keeps its transform on itself; with children (or a group) the transform goes on a group around both
+ if (own.length === 1 && !kids.length && own[0].type === "Mesh" && !(o as THREE.BatchedMesh).isBatchedMesh) return [{ ...own[0], props: { ...own[0].props, ...at } }];
+ const inside = [...own, ...kids];
+ return inside.length ? [{ type: "Group", props: { name: `${name}/`, ...at }, children: inside }] : [];
+}
+
+export interface Converted {
+ parts: Part[];
+ /** the scene's background colour, the page's behind the 3D */
+ background?: string;
+}
+
+/** R3F's scene, camera and renderer settings as raea's parts, this frame */
+export function convert(scene: THREE.Scene, camera: THREE.Camera, gl: THREE.WebGLRenderer, height: number): Converted {
+ scene.updateMatrixWorld();
+ camera.updateMatrixWorld();
+ if (camera.parent === null) camera.matrixWorldInverse.copy(camera.matrixWorld).invert();
+ const w: Walk = { camera, shadows: gl.shadowMap.enabled, world: [], height };
+ let drawn = scene.children.flatMap((c, i) => walk(c, `r3f/${i}`, w));
+ // a scene moved, turned or scaled as a whole (rare, but three allows it)
+ if (!scene.matrix.equals(new THREE.Matrix4()) && drawn.length) drawn = [{ type: "Group", props: { name: "r3f", ...place(scene) }, children: drawn }];
+ const sky = skyOf(scene);
+ const cam = cameraOf(camera);
+ const fog = fogOf(scene.fog as THREE.Fog | THREE.FogExp2 | null);
+ return { parts: [...(cam ? [cam] : []), toneOf(gl), ...(fog ? [fog] : []), ...sky.parts, ...w.world, ...drawn], background: sky.background };
+}
diff --git a/sdk/r3f/src/input/session.ts b/sdk/r3f/src/input/session.ts
new file mode 100644
index 00000000..c729ad26
--- /dev/null
+++ b/sdk/r3f/src/input/session.ts
@@ -0,0 +1,83 @@
+// React Three Fiber run headless, a frame at a time: its own root on a stand-in canvas and renderer (raea draws; three
+// never does), with frameloop "never" so nothing ticks on its own. Frame f of the composition is R3F's clock at f/fps
+// seconds: the scene is rendered with frame f's children, then advance() runs its useFrame callbacks once with the
+// step since the last frame. Going backwards (a seek, a scrub) starts the root again from frame 0 and steps forward, so
+// a frame's scene is the same whichever frame came before it: a render equals its play (raea's first rule).
+import * as THREE from "three";
+import { advance, createRoot, extend, flushSync, type ReconcilerRoot, type RenderProps, type RootState } from "@react-three/fiber";
+import type { ReactNode } from "react";
+
+extend(THREE as unknown as Parameters<typeof extend>[0]);
+
+/** the renderer R3F configures and never draws with: what it sets on it (shadows, tone mapping) is read back */
+export function standInRenderer(): THREE.WebGLRenderer {
+ const noop = () => {};
+ return {
+ render: noop, setSize: noop, setPixelRatio: noop, getPixelRatio: () => 1, dispose: noop, setClearColor: noop, compile: noop,
+ domElement: { style: {}, addEventListener: noop, removeEventListener: noop },
+ xr: { enabled: false, isPresenting: false, addEventListener: noop, removeEventListener: noop, setAnimationLoop: noop },
+ shadowMap: { enabled: false, type: THREE.PCFShadowMap },
+ outputColorSpace: THREE.SRGBColorSpace, toneMapping: THREE.NoToneMapping, toneMappingExposure: 1,
+ capabilities: { isWebGL2: true, maxTextureSize: 16384 }, info: { autoReset: true, reset: noop }, properties: { get: () => ({}) },
+ } as unknown as THREE.WebGLRenderer;
+}
+
+function standInCanvas(width: number, height: number): HTMLCanvasElement {
+ const noop = () => {};
+ return { style: {}, width, height, addEventListener: noop, removeEventListener: noop, getBoundingClientRect: () => ({ left: 0, top: 0, width, height, x: 0, y: 0, right: width, bottom: height }) } as unknown as HTMLCanvasElement;
+}
+
+export interface Session {
+ root: ReconcilerRoot<HTMLCanvasElement>;
+ state: RootState;
+ /** the last frame stepped */
+ frame: number;
+ /** the settings it was configured with, as JSON: a change starts it again */
+ config: string;
+}
+
+const sessions = new Map<string, Session>();
+
+export type Config = Omit<RenderProps<HTMLCanvasElement>, "gl" | "frameloop" | "size" | "events" | "dpr">;
+
+function start(key: string, width: number, height: number, config: Config, json: string): Session {
+ const root = createRoot(standInCanvas(width, height));
+ let state: RootState | undefined;
+ void root.configure({ ...config, gl: standInRenderer(), frameloop: "never", dpr: 1, size: { width, height, top: 0, left: 0 }, events: undefined, onCreated: (s) => { state = s; config.onCreated?.(s); } });
+ const s: Session = { root, state: state as unknown as RootState, frame: -1, config: json };
+ sessions.set(key, s);
+ return s;
+}
+
+/** The root `key` at local frame `frame` (fps a second), each step rendering `scene(i)` first. */
+export function stepTo(key: string, frame: number, fps: number, width: number, height: number, config: Config, scene: (i: number) => ReactNode): Session {
+ const json = JSON.stringify({ width, height, config }, (_k, v) => (typeof v === "function" ? String(v) : v instanceof THREE.Object3D ? v.uuid : v));
+ let s = sessions.get(key);
+ if (s && (frame < s.frame || s.config !== json)) {
+ end(key);
+ s = undefined;
+ }
+ s ??= start(key, width, height, config, json);
+ const live = s;
+ const render = (i: number) => {
+ let store: ReturnType<typeof live.root.render> | undefined;
+ flushSync(() => { store = live.root.render(scene(i)); });
+ if (store) live.state = store.getState();
+ };
+ // the same frame drawn again (a live replay): its children may have changed, its clock hasn't
+ if (frame === s.frame) render(frame);
+ for (let i = s.frame + 1; i <= frame; i++) {
+ render(i);
+ advance(i / fps, true, live.state);
+ live.frame = i;
+ }
+ return live;
+}
+
+/** the root `key` unmounted (the <R3F> left the tree, or starts again) */
+export function end(key: string) {
+ const s = sessions.get(key);
+ if (!s) return;
+ s.root.unmount();
+ sessions.delete(key);
+}
diff --git a/sdk/r3f/src/input/texture.ts b/sdk/r3f/src/input/texture.ts
new file mode 100644
index 00000000..6580078d
--- /dev/null
+++ b/sdk/r3f/src/input/texture.ts
@@ -0,0 +1,170 @@
+// A three.js texture as the picture raea loads: its src (an <img>'s, a loader's url) when it came from a file, a PNG
+// data URL when its pixels were made in code (a DataTexture, a canvas). raea's engine loads pictures itself, so in a
+// native render, where there's no DOM to load an <img> into, three's ImageLoader is stood in for by one that hands
+// back the url (with the picture's size unknown) and the engine loads that file.
+import * as THREE from "three";
+
+const urls = new WeakMap<object, string>();
+
+/** three's ImageLoader without a DOM: the image is a stand-in carrying its url (raea loads the file) */
+export function standInImages() {
+ const doc = (globalThis as { document?: { createElementNS?: unknown } }).document;
+ if (doc && typeof doc.createElementNS === "function") return;
+ const load = function (this: THREE.ImageLoader, url: string, onLoad?: (img: HTMLImageElement) => void) {
+ const src = this.manager.resolveURL((this.path ?? "") + url);
+ const img = { src, width: 1, height: 1, naturalWidth: 1, naturalHeight: 1, complete: true } as unknown as HTMLImageElement;
+ urls.set(img, src);
+ this.manager.itemStart(src);
+ queueMicrotask(() => {
+ onLoad?.(img);
+ this.manager.itemEnd(src);
+ });
+ return img;
+ };
+ THREE.ImageLoader.prototype.load = load as unknown as THREE.ImageLoader["load"];
+}
+
+// ---- PNG, uncompressed (stored deflate blocks): small code, and the pictures made in code are small ----
+const CRC = (() => {
+ const t = new Uint32Array(256);
+ for (let n = 0; n < 256; n++) {
+ let c = n;
+ for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
+ t[n] = c >>> 0;
+ }
+ return t;
+})();
+
+function crc(bytes: Uint8Array): number {
+ let c = 0xffffffff;
+ for (const b of bytes) c = CRC[(c ^ b) & 0xff] ^ (c >>> 8);
+ return (c ^ 0xffffffff) >>> 0;
+}
+
+function chunk(type: string, data: Uint8Array): Uint8Array {
+ const out = new Uint8Array(12 + data.length);
+ const dv = new DataView(out.buffer);
+ dv.setUint32(0, data.length);
+ for (let i = 0; i < 4; i++) out[4 + i] = type.charCodeAt(i);
+ out.set(data, 8);
+ dv.setUint32(8 + data.length, crc(out.subarray(4, 8 + data.length)));
+ return out;
+}
+
+function zlibStored(raw: Uint8Array): Uint8Array {
+ const blocks = Math.max(1, Math.ceil(raw.length / 65535));
+ const out = new Uint8Array(2 + raw.length + blocks * 5 + 4);
+ out[0] = 0x78;
+ out[1] = 0x01;
+ let o = 2;
+ for (let b = 0; b < blocks; b++) {
+ const part = raw.subarray(b * 65535, Math.min(raw.length, (b + 1) * 65535));
+ out[o++] = b === blocks - 1 ? 1 : 0;
+ out[o++] = part.length & 0xff;
+ out[o++] = part.length >>> 8;
+ out[o++] = ~part.length & 0xff;
+ out[o++] = (~part.length >>> 8) & 0xff;
+ out.set(part, o);
+ o += part.length;
+ }
+ let a = 1, s = 0;
+ for (const x of raw) {
+ a = (a + x) % 65521;
+ s = (s + a) % 65521;
+ }
+ new DataView(out.buffer).setUint32(o, ((s << 16) | a) >>> 0);
+ return out;
+}
+
+const B64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+function base64(bytes: Uint8Array): string {
+ let s = "";
+ for (let i = 0; i < bytes.length; i += 3) {
+ const [a, b = 0, c = 0] = [bytes[i], bytes[i + 1], bytes[i + 2]];
+ s += B64[a >> 2] + B64[((a & 3) << 4) | (b >> 4)] + (i + 1 < bytes.length ? B64[((b & 15) << 2) | (c >> 6)] : "=") + (i + 2 < bytes.length ? B64[c & 63] : "=");
+ }
+ return s;
+}
+
+/** RGBA bytes, rows from the top, as a PNG data URL */
+export function pngOf(rgba: Uint8Array, width: number, height: number): string {
+ const raw = new Uint8Array((width * 4 + 1) * height);
+ for (let y = 0; y < height; y++) raw.set(rgba.subarray(y * width * 4, (y + 1) * width * 4), y * (width * 4 + 1) + 1);
+ const head = new Uint8Array(13);
+ const dv = new DataView(head.buffer);
+ dv.setUint32(0, width);
+ dv.setUint32(4, height);
+ head.set([8, 6, 0, 0, 0], 8);
+ const sig = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]);
+ const parts = [sig, chunk("IHDR", head), chunk("IDAT", zlibStored(raw)), chunk("IEND", new Uint8Array())];
+ const all = new Uint8Array(parts.reduce((n, p) => n + p.length, 0));
+ let o = 0;
+ for (const p of parts) {
+ all.set(p, o);
+ o += p.length;
+ }
+ return "data:image/png;base64," + base64(all);
+}
+
+/** a DataTexture's pixels as RGBA bytes, top row first (three's flipY puts its first row at the bottom) */
+function bytesOf(t: THREE.DataTexture): Uint8Array | undefined {
+ const { data, width, height } = t.image as { data: ArrayLike<number> | null; width: number; height: number };
+ if (!data || !width || !height) return undefined;
+ const per = t.format === THREE.RGBAFormat ? 4 : t.format === THREE.RGFormat ? 2 : t.format === THREE.RedFormat ? 1 : 0;
+ if (!per) return undefined;
+ const float = t.type === THREE.FloatType || t.type === THREE.HalfFloatType;
+ const half = t.type === THREE.HalfFloatType;
+ const out = new Uint8Array(width * height * 4);
+ for (let y = 0; y < height; y++) {
+ const from = t.flipY ? y : height - 1 - y;
+ for (let x = 0; x < width; x++) {
+ const i = (from * width + x) * per, o = (y * width + x) * 4;
+ for (let c = 0; c < 4; c++) {
+ let v = c < per ? Number(data[i + c]) : c === 3 ? (float ? 1 : 255) : per === 1 ? Number(data[i]) : 0;
+ if (half && c < per) v = THREE.DataUtils.fromHalfFloat(v);
+ out[o + c] = float ? Math.round(Math.min(1, Math.max(0, v)) * 255) : v;
+ }
+ }
+ }
+ return out;
+}
+
+/** a texture's picture for raea, or undefined when it has none raea can load (a render target, a video) */
+export function srcOf(t: THREE.Texture | null | undefined): string | undefined {
+ if (!t) return undefined;
+ const given = t.userData?.src;
+ if (typeof given === "string") return given;
+ const img = t.image as { src?: string; toDataURL?: () => string; data?: unknown } | undefined;
+ if (!img) return undefined;
+ if (urls.has(img)) return urls.get(img);
+ if (typeof img.src === "string" && img.src !== "") return img.src;
+ if (typeof img.toDataURL === "function") {
+ const s = img.toDataURL();
+ urls.set(img, s);
+ return s;
+ }
+ if ((t as THREE.DataTexture).isDataTexture) {
+ const bytes = bytesOf(t as THREE.DataTexture);
+ if (!bytes) return undefined;
+ const { width, height } = t.image as { width: number; height: number };
+ const s = pngOf(bytes, width, height);
+ urls.set(img, s);
+ return s;
+ }
+ return undefined;
+}
+
+/** a texture's repeat and offset, rotation, wrap and filter as raea's material props */
+export function placementOf(t: THREE.Texture): { repeat?: [number, number]; uvTransform?: { offset?: [number, number]; rotation?: number; scale?: [number, number] }; sampler?: Record<string, unknown> } {
+ const out: ReturnType<typeof placementOf> = {};
+ const moved = t.offset.x !== 0 || t.offset.y !== 0 || t.rotation !== 0;
+ if (moved) out.uvTransform = { offset: [t.offset.x, t.offset.y], rotation: t.rotation, scale: [t.repeat.x, t.repeat.y] };
+ else if (t.repeat.x !== 1 || t.repeat.y !== 1) out.repeat = [t.repeat.x, t.repeat.y];
+ const wrap = (w: number) => (w === THREE.RepeatWrapping ? "repeat" : w === THREE.MirroredRepeatWrapping ? "mirror" : "clamp");
+ const nearest = t.magFilter === THREE.NearestFilter;
+ const wrapS = wrap(t.wrapS), wrapT = wrap(t.wrapT);
+ if (nearest || wrapS !== "clamp" || wrapT !== "clamp" || t.anisotropy > 1) {
+ out.sampler = { filter: nearest ? "nearest" : "linear", wrap: wrapS === wrapT ? wrapS : [wrapS, wrapT], ...(t.anisotropy > 1 ? { anisotropy: t.anisotropy } : {}) };
+ }
+ return out;
+}
diff --git a/sdk/r3f/src/output/Raea.tsx b/sdk/r3f/src/output/Raea.tsx
new file mode 100644
index 00000000..567ab778
--- /dev/null
+++ b/sdk/r3f/src/output/Raea.tsx
@@ -0,0 +1,115 @@
+// <Raea>: a raea composition's 3D inside React Three Fiber. Its component renders as it does under raea (into a page
+// of its own, off screen, at its frame), and the three.js host (../three) draws that page's parts into R3F's scene: its
+// meshes, materials, lights, models and camera, the same units and shapes raea's engine draws. Its frame follows R3F's
+// clock (`fps` frames a second from mount) unless `frame` is given; `camera` makes its camera R3F's, `settings` its
+// tone mapping, shadows, fog and environment the canvas's.
+import { useFrame, useThree } from "@react-three/fiber";
+import { useEffect, useMemo, useRef, type ComponentType } from "react";
+import { flushSync } from "react-dom";
+import { createRoot, type Root } from "react-dom/client";
+import * as THREE from "three";
+import { Clock } from "@raea/app/clock";
+import { Scene3d } from "../three/scene";
+import { backgroundUnder3d } from "../three/page";
+import { Effects } from "../three/effects";
+
+export interface RaeaProps<P extends object = Record<string, never>> {
+ /** the composition's component (what <Composition component> takes) */
+ component: ComponentType<P>;
+ /** its props */
+ props?: P;
+ /** its size, frame rate and length (a <Composition>'s): the size its camera's aspect and 2D parts follow */
+ width?: number;
+ height?: number;
+ fps?: number;
+ durationInFrames?: number;
+ /** the frame to show; by default it plays from 0 at `fps`, looping over `durationInFrames` */
+ frame?: number;
+ /** make its camera R3F's camera (true by default) */
+ camera?: boolean;
+ /** put its tone mapping, exposure, shadows, fog and environment on the canvas (true by default) */
+ settings?: boolean;
+ /** draw the frame effects it asks for (Bloom, DepthOfField, Grade, Look, a lens ...) with three's EffectComposer,
+ * which then draws the canvas (true by default); false leaves them to your own composer through onEffects */
+ effects?: boolean;
+ /** the frame effects it asks for, each time they change */
+ onEffects?: (effects: Scene3d["effects"]) => void;
+}
+
+export function Raea<P extends object>({ component: C, props, width, height, fps = 30, durationInFrames = 300, frame, camera = true, settings = true, effects: drawEffects = true, onEffects }: RaeaProps<P>) {
+ const { gl, size, set, scene: canvasScene, invalidate } = useThree();
+ const host = useMemo(() => new Scene3d(), []);
+ const page = useMemo(() => document.createElement("div"), []);
+ const root = useRef<Root | null>(null);
+ const shown = useRef(-1);
+ const time = useRef(0);
+ const effects = useRef("");
+ const composer = useMemo(() => new Effects(gl), [gl]);
+ useEffect(() => () => composer.dispose(), [composer]);
+ const under = useRef<string | undefined>(undefined);
+
+ useEffect(() => {
+ root.current = createRoot(page);
+ host.onLoad = () => invalidate();
+ return () => {
+ const r = root.current;
+ root.current = null;
+ // unmounted after this commit, not inside it
+ queueMicrotask(() => r?.unmount());
+ };
+ }, [page, host, invalidate]);
+
+ const w = width ?? size.width, h = height ?? size.height;
+
+ useFrame((_state, dt) => {
+ if (!root.current) return;
+ time.current += dt;
+ const f = frame ?? Math.floor(time.current * fps) % durationInFrames;
+ if (f !== shown.current) {
+ shown.current = f;
+ flushSync(() =>
+ root.current!.render(
+ <Clock frame={f} fps={fps} width={w} height={h} durationInFrames={durationInFrames}>
+ <C {...(props as P)} />
+ </Clock>,
+ ),
+ );
+ host.sync(page, f / fps);
+ under.current = backgroundUnder3d(page);
+ const e = JSON.stringify(host.effects);
+ if (onEffects && e !== effects.current) {
+ effects.current = e;
+ onEffects(host.effects);
+ }
+ }
+ host.fit(size.width, size.height);
+ if (camera && host.camera !== _state.camera) set({ camera: host.camera as THREE.PerspectiveCamera });
+ if (settings) {
+ host.apply(gl);
+ canvasScene.fog = host.scene.fog;
+ canvasScene.environment = host.scene.environment;
+ canvasScene.environmentIntensity = host.scene.environmentIntensity;
+ canvasScene.environmentRotation.copy(host.scene.environmentRotation);
+ if (host.scene.background) {
+ canvasScene.background = host.scene.background;
+ canvasScene.backgroundIntensity = host.scene.backgroundIntensity;
+ canvasScene.backgroundRotation.copy(host.scene.backgroundRotation);
+ } else if (under.current) {
+ // the page's background behind its 3D, as raea clears to it
+ if (!(canvasScene.background instanceof THREE.Color)) canvasScene.background = new THREE.Color();
+ canvasScene.background.setStyle(under.current);
+ }
+ }
+ });
+
+ // after the frame's updates: through the composer when there are effects to draw, else as R3F would (a useFrame with
+ // a priority makes the canvas this one's to draw)
+ useFrame((state, dt) => {
+ const cam = state.camera;
+ const on = drawEffects && composer.set(host.effects, state.scene, cam, size.width, size.height, (cam.userData.focus as number) ?? 10);
+ if (on) composer.render(state.scene, dt);
+ else state.gl.render(state.scene, cam);
+ }, 1);
+
+ return <primitive object={host.scene} />;
+}
diff --git a/sdk/r3f/src/parts.tsx b/sdk/r3f/src/parts.tsx
new file mode 100644
index 00000000..f1cf2429
--- /dev/null
+++ b/sdk/r3f/src/parts.tsx
@@ -0,0 +1,30 @@
+// raea's parts as React elements: each Part (a raea/3d component's name and its props, what the R3F input makes and
+// the source export writes) drawn by that component. One table, so the input, the export and the tests name the same
+// components.
+import type { ReactNode } from "react";
+import {
+ AmbientLight, BufferMesh, DirectionalLight, Environment, Fog, Gizmo, Group, Instances, Mesh, MeshBasicMaterial,
+ MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, OrthographicCamera, PerspectiveCamera, PointLight,
+ RectAreaLight, SpotLight, ToneMapping,
+} from "raea/3d";
+import type { Part } from "./input/material";
+
+export type { Part, Props } from "./input/material";
+
+/** every component a Part may name */
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+export const COMPONENTS: Record<string, (p: any) => ReactNode> = {
+ AmbientLight, BufferMesh, DirectionalLight, Environment, Fog, Gizmo, Group, Instances, Mesh, MeshBasicMaterial,
+ MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, OrthographicCamera, PerspectiveCamera, PointLight,
+ RectAreaLight, SpotLight, ToneMapping,
+};
+
+/** parts as elements, keyed by their place */
+export function elementsOf(parts: Part[], at = ""): ReactNode[] {
+ return parts.map((p, i) => {
+ const C = COMPONENTS[p.type];
+ if (!C) throw new TypeError(`raea/r3f: no raea component ${p.type}`);
+ const key = `${at}${i}`;
+ return p.children ? <C key={key} {...p.props}>{elementsOf(p.children, `${key}.`)}</C> : <C key={key} {...p.props} />;
+ });
+}
diff --git a/sdk/r3f/src/three/effects.ts b/sdk/r3f/src/three/effects.ts
new file mode 100644
index 00000000..07e9cf6a
--- /dev/null
+++ b/sdk/r3f/src/three/effects.ts
@@ -0,0 +1,329 @@
+// raea's frame effects drawn by three.js (docs/r3f.feature R3F6): the effects a raea page asks for (Scene3d.effects)
+// as an EffectComposer's passes, in Bevy's order: ambient occlusion, outlines, depth of field, bloom and motion blur on
+// the scene's light; then tone mapping (OutputPass, the renderer's tone mapping and exposure); then the grade, the look
+// and the lens on the picture. kinds.ts says where each differs from raea's engine.
+import * as THREE from "three";
+import { EffectComposer } from "three/examples/jsm/postprocessing/EffectComposer.js";
+import { RenderPass } from "three/examples/jsm/postprocessing/RenderPass.js";
+import { OutputPass } from "three/examples/jsm/postprocessing/OutputPass.js";
+import { UnrealBloomPass } from "three/examples/jsm/postprocessing/UnrealBloomPass.js";
+import { BokehPass } from "three/examples/jsm/postprocessing/BokehPass.js";
+import { OutlinePass } from "three/examples/jsm/postprocessing/OutlinePass.js";
+import { GTAOPass } from "three/examples/jsm/postprocessing/GTAOPass.js";
+import { AfterimagePass } from "three/examples/jsm/postprocessing/AfterimagePass.js";
+import { ShaderPass } from "three/examples/jsm/postprocessing/ShaderPass.js";
+import type { Pass } from "three/examples/jsm/postprocessing/Pass.js";
+
+export interface Effect {
+ kind: string;
+ props: Record<string, unknown>;
+}
+
+/** the effects three.js draws (the rest are listed by Scene3d.effects and named in kinds.ts) */
+export const DRAWN_EFFECTS = ["AmbientOcclusion", "Outline", "DepthOfField", "Bloom", "MotionBlur", "Grade", "Look", "Fisheye", "LensDistortion"];
+
+const num = (v: unknown, d: number) => (typeof v === "number" && Number.isFinite(v) ? v : d);
+const VERT = "varying vec2 vUv; void main() { vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }";
+
+/** <Grade> in the scene's light, before tone mapping, as Bevy draws it: its effect stack (colour fringes, the
+ * vignette: bevy_post_process effect_stack), then the tone mapper's grading (white balance; saturation, contrast, gain,
+ * lift and gamma per level of light, shadows below 0.2, highlights above 0.7, blended 0.1 either side:
+ * bevy_core_pipeline tonemapping_shared.wgsl). `scale` takes three's linear colour to Bevy's (the exposure). */
+const GRADE = `
+uniform sampler2D tDiffuse; uniform float temperature, tint, aberration, scale;
+uniform vec4 vig; uniform vec3 vigColor; uniform vec2 aspect;
+uniform vec3 sat, con, gam, gai, lif;
+varying vec2 vUv;
+float luma(vec3 c) { return dot(c, vec3(0.2126, 0.7152, 0.0722)); }
+void main() {
+ vec2 d = vUv - 0.5;
+ vec4 src = texture2D(tDiffuse, vUv);
+ vec3 c = aberration > 0.0
+ ? vec3(texture2D(tDiffuse, vUv - d * aberration).r, src.g, texture2D(tDiffuse, vUv + d * aberration).b)
+ : src.rgb;
+ c *= scale;
+ vec2 sc = aspect / min(aspect.x, aspect.y);
+ if (aspect.x >= aspect.y) sc.x *= aspect.y / aspect.x; else sc.y *= aspect.x / aspect.y;
+ float dist = length(d * sc) / vig.y;
+ float factor = pow(clamp(1.0 - dist * dist, 0.0, 1.0), vig.z);
+ c = mix(c, vigColor * scale, (1.0 - factor) * vig.x);
+ c = max(c * vec3(1.0 + temperature, 1.0 - tint * 0.5, 1.0 - temperature) / max(1.0, 1.0 + abs(temperature)), 0.0);
+ float level = (c.r + c.g + c.b) / 3.0;
+ vec3 lv = vec3(0.0);
+ if (level < 0.1) lv.x = 1.0;
+ else if (level < 0.3) { lv.y = (level - 0.2) * 5.0 + 0.5; lv.x = 1.0 - lv.y; }
+ else if (level < 0.6) lv.y = 1.0;
+ else if (level < 0.8) { lv.z = (level - 0.7) * 5.0 + 0.5; lv.y = 1.0 - lv.z; }
+ else lv.z = 1.0;
+ float l = luma(c);
+ c = l + dot(lv, sat) * (c - l);
+ c = 0.5 + (c - 0.5) * dot(lv, con);
+ vec3 b = max(c * dot(lv, gai) + dot(lv, lif), 0.0);
+ c = pow(b, vec3(1.0 / max(dot(lv, gam), 1e-3)));
+ gl_FragColor = vec4(max(c, 0.0) / scale, src.a);
+}`;
+
+/** <Grade>'s saturation after tone mapping (Bevy's post_saturation) */
+const SATURATE = `
+uniform sampler2D tDiffuse; uniform float saturation;
+varying vec2 vUv;
+void main() {
+ vec4 c = texture2D(tDiffuse, vUv);
+ float l = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722));
+ gl_FragColor = vec4(mix(vec3(l), c.rgb, saturation), c.a);
+}`;
+
+/** the background colour under the frame, as raea clears to it: not through the bloom, grade or tone mapping (the
+ * frame is drawn over a clear of nothing, its colours premultiplied) */
+const UNDER = `
+uniform sampler2D tDiffuse; uniform vec3 under;
+varying vec2 vUv;
+void main() {
+ vec4 c = texture2D(tDiffuse, vUv);
+ gl_FragColor = vec4(c.rgb + under * (1.0 - clamp(c.a, 0.0, 1.0)), 1.0);
+}`;
+
+/** Bevy's bloom is energy-conserving: the frame is mixed toward its blur by the intensity, not added to (this keeps
+ * 1 - k of the frame; UnrealBloomPass adds k of the blur) */
+const KEEP = `
+uniform sampler2D tDiffuse; uniform float keep;
+varying vec2 vUv;
+void main() { vec4 c = texture2D(tDiffuse, vUv); gl_FragColor = vec4(c.rgb * keep, c.a); }`;
+
+/** <Look>: cells of `pixelSize`; pixel keeps each cell's colour, site dithers it into six greys (keeping `color` of
+ * its hue), ink into ink and paper with lines where the light steps; paint and cartoon are `bands` flat tones */
+const LOOK = `
+uniform sampler2D tDiffuse; uniform vec2 size; uniform float cell, mode, keep, lift, gain, line, threshold, band, bands;
+uniform vec3 ink, paper; uniform float light;
+varying vec2 vUv;
+float luma(vec3 c) { return dot(c, vec3(0.2126, 0.7152, 0.0722)); }
+float bayer2(vec2 a) { a = floor(a); return fract(a.x / 2.0 + a.y * a.y * 0.75); }
+float bayer(vec2 a) { return (bayer2(0.25 * a) * 0.25 + bayer2(0.5 * a)) * 0.25 + bayer2(a); }
+vec3 at(vec2 c) { return texture2D(tDiffuse, (c + 0.5) * cell / size).rgb; }
+void main() {
+ vec2 c = floor(vUv * size / cell);
+ vec3 col = at(c);
+ float l = luma(col), t = bayer(c);
+ if (mode < 0.5) { gl_FragColor = vec4(col, 1.0); return; }
+ if (mode < 1.5) {
+ float g = floor(clamp(lift + l * gain, 0.0, 1.0) * 5.0 + t) / 5.0;
+ vec3 grey = (light > 0.5 ? mix(vec3(0.55), vec3(0.98), g) : mix(vec3(0.04), vec3(0.85), g));
+ gl_FragColor = vec4(mix(grey, grey * col / max(l, 1e-3), keep), 1.0); return;
+ }
+ if (mode < 2.5) {
+ float edge = max(abs(l - luma(at(c + vec2(1.0, 0.0)))), abs(l - luma(at(c + vec2(0.0, 1.0)))));
+ float lit = clamp((l - threshold) / max(band, 1e-3) + 0.5, 0.0, 1.0);
+ bool on = lit > t && !(line > 0.0 && edge > line);
+ gl_FragColor = vec4(on ? paper : ink, 1.0); return;
+ }
+ gl_FragColor = vec4(floor(col * bands + 0.5) / bands, 1.0);
+}`;
+
+/** <Fisheye> and <LensDistortion>: the picture remapped radially, after tone mapping */
+const LENS = `
+uniform sampler2D tDiffuse; uniform float kind, strength, k1, k2, zoom, fov, own, black; uniform vec2 aspect;
+varying vec2 vUv;
+void main() {
+ vec2 d = (vUv - 0.5) * aspect;
+ float half_ = length(aspect * 0.5);
+ float r = length(d) / half_;
+ float s;
+ if (kind < 0.5) {
+ // equidistant (or stereographic) fisheye: the angle off axis grows with r, at the widened fov's rate
+ float wide = radians(fov) * 0.5, base = radians(own) * 0.5;
+ float th = kind < 0.25 ? r * wide : 2.0 * atan(r * tan(wide * 0.5));
+ float rr = tan(th) / tan(base) * 0.5 / half_ * aspect.y;
+ s = mix(1.0, rr / max(r, 1e-5), strength);
+ } else {
+ s = 1.0 + k1 * r * r + k2 * r * r * r * r;
+ }
+ vec2 uv = d * s / zoom / aspect + 0.5;
+ bool out_ = any(lessThan(uv, vec2(0.0))) || any(greaterThan(uv, vec2(1.0)));
+ gl_FragColor = out_ && black > 0.5 ? vec4(0.0, 0.0, 0.0, 1.0) : texture2D(tDiffuse, clamp(uv, 0.0, 1.0));
+}`;
+
+/** a grade field across shadows, midtones and highlights */
+function levels(p: Record<string, unknown>, k: string, d: number): THREE.Vector3 {
+ const at = (s: string) => num((p[s] as Record<string, unknown> | undefined)?.[k], d);
+ return new THREE.Vector3(at("shadows"), at("midtones"), at("highlights"));
+}
+
+const shader = (frag: string, uniforms: Record<string, unknown>) =>
+ new ShaderPass({ uniforms: { tDiffuse: { value: null }, ...Object.fromEntries(Object.entries(uniforms).map(([k, v]) => [k, { value: v }])) }, vertexShader: VERT, fragmentShader: frag });
+
+/** a composer for a renderer, rebuilt when the list of effects changes and updated each frame from their props */
+export class Effects {
+ composer: EffectComposer;
+ private key = "";
+ private passes = new Map<string, Pass>();
+ constructor(readonly gl: THREE.WebGLRenderer) {
+ // multisampled, as the canvas is: without it the composer's frame is aliased where the plain one isn't
+ const size = gl.getDrawingBufferSize(new THREE.Vector2());
+ this.composer = new EffectComposer(gl, new THREE.WebGLRenderTarget(Math.max(1, size.x), Math.max(1, size.y), { type: THREE.HalfFloatType, samples: 4 }));
+ }
+
+ /** set the effects for this frame; false when there are none to draw (the renderer draws as it would) */
+ set(effects: Effect[], scene: THREE.Scene, camera: THREE.Camera, width: number, height: number, focus = 10): boolean {
+ const list = effects.filter((e) => DRAWN_EFFECTS.includes(e.kind));
+ if (!list.length) return false;
+ const key = list.map((e) => e.kind).join(",");
+ if (key !== this.key) this.build(list, scene, camera, width, height);
+ this.composer.setPixelRatio(this.gl.getPixelRatio());
+ this.composer.setSize(width, height);
+ for (const p of this.composer.passes) {
+ if ((p as RenderPass).camera !== undefined && "scene" in p) Object.assign(p, { scene, camera });
+ }
+ const aspect = new THREE.Vector2(width / Math.max(width, height), height / Math.max(width, height));
+ for (const e of list) this.update(e, scene, camera, width, height, aspect, focus);
+ return true;
+ }
+
+ /** draw the frame: a colour background goes under it after the effects (an environment or picture stays the
+ * scene's, drawn through them) */
+ render(scene: THREE.Scene, dt?: number) {
+ const bg = scene.background;
+ const under = (this.passes.get("under") as ShaderPass).uniforms.under.value as THREE.Color;
+ if (bg instanceof THREE.Color) {
+ under.copy(bg).convertLinearToSRGB();
+ scene.background = null;
+ } else under.setRGB(0, 0, 0);
+ try {
+ this.composer.render(dt);
+ } finally {
+ scene.background = bg;
+ }
+ }
+
+ private build(list: Effect[], scene: THREE.Scene, camera: THREE.Camera, w: number, h: number) {
+ for (const p of this.composer.passes) p.dispose();
+ this.composer.passes.length = 0;
+ this.passes.clear();
+ this.key = list.map((e) => e.kind).join(",");
+ const has = (k: string) => list.some((e) => e.kind === k);
+ const add = (k: string, p: Pass) => {
+ this.passes.set(k, p);
+ this.composer.addPass(p);
+ };
+ const render = new RenderPass(scene, camera, undefined, new THREE.Color(0, 0, 0), 0);
+ this.composer.addPass(render);
+ if (has("AmbientOcclusion")) add("AmbientOcclusion", new GTAOPass(scene, camera, w, h));
+ if (has("Outline")) add("Outline", new OutlinePass(new THREE.Vector2(w, h), scene, camera));
+ if (has("DepthOfField")) add("DepthOfField", new BokehPass(scene, camera, { focus: 10, aperture: 0.002, maxblur: 0.01 }));
+ if (has("Bloom")) {
+ add("Bloom:keep", shader(KEEP, { keep: 1 }));
+ add("Bloom", new UnrealBloomPass(new THREE.Vector2(w, h), 1, 0.4, 0.8));
+ }
+ if (has("MotionBlur")) add("MotionBlur", new AfterimagePass(0.5));
+ if (has("Grade")) add("Grade", shader(GRADE, { temperature: 0, tint: 0, aberration: 0, scale: 1, vig: new THREE.Vector4(), vigColor: new THREE.Color(), aspect: new THREE.Vector2(1, 1), sat: new THREE.Vector3(1, 1, 1), con: new THREE.Vector3(1, 1, 1), gam: new THREE.Vector3(1, 1, 1), gai: new THREE.Vector3(1, 1, 1), lif: new THREE.Vector3() }));
+ this.composer.addPass(new OutputPass());
+ add("under", shader(UNDER, { under: new THREE.Color() }));
+ if (has("Grade")) add("Grade:post", shader(SATURATE, { saturation: 1 }));
+ if (has("Look")) add("Look", new ShaderPass({ uniforms: { tDiffuse: { value: null }, size: { value: new THREE.Vector2(w, h) }, cell: { value: 6 }, mode: { value: 0 }, keep: { value: 1 }, lift: { value: 0 }, gain: { value: 1 }, line: { value: 0 }, threshold: { value: 0.5 }, band: { value: 1 }, bands: { value: 3 }, ink: { value: new THREE.Color() }, paper: { value: new THREE.Color() }, light: { value: 0 } }, vertexShader: VERT, fragmentShader: LOOK }));
+ for (const k of ["Fisheye", "LensDistortion"]) if (has(k)) add(k, new ShaderPass({ uniforms: { tDiffuse: { value: null }, kind: { value: 0 }, strength: { value: 1 }, k1: { value: 0 }, k2: { value: 0 }, zoom: { value: 1 }, fov: { value: 120 }, own: { value: 50 }, black: { value: 0 }, aspect: { value: new THREE.Vector2(1, 1) } }, vertexShader: VERT, fragmentShader: LENS }));
+ }
+
+ private update(e: Effect, scene: THREE.Scene, camera: THREE.Camera, w: number, h: number, aspect: THREE.Vector2, focus: number) {
+ const p = e.props, pass = this.passes.get(e.kind);
+ if (!pass) return;
+ const u = (pass as ShaderPass).uniforms;
+ switch (e.kind) {
+ case "AmbientOcclusion": {
+ const ao = pass as GTAOPass;
+ const samples = { low: 4, medium: 8, high: 18, ultra: 54 }[String(p.quality ?? "medium")] ?? 8;
+ ao.updateGtaoMaterial({ radius: num(p.thickness, 0.25) * 2, samples, thickness: num(p.thickness, 0.25) });
+ break;
+ }
+ case "Outline": {
+ const o = pass as OutlinePass;
+ const meshes: THREE.Object3D[] = [];
+ scene.traverse((m) => (m as THREE.Mesh).isMesh && meshes.push(m));
+ o.selectedObjects = meshes;
+ o.visibleEdgeColor.set(String(p.color ?? "#000000"));
+ o.hiddenEdgeColor.set(String(p.color ?? "#000000"));
+ o.edgeStrength = 10;
+ o.edgeThickness = num(p.width, 1);
+ break;
+ }
+ case "DepthOfField": {
+ const u2 = (pass as BokehPass).uniforms as Record<string, THREE.IUniform>;
+ const f = num(p.aperture, 2.8);
+ u2.focus.value = focus;
+ // three's aperture is a blur per unit of depth: f/2.8 is three's example's 0.025 scaled by 1/f
+ u2.aperture.value = (0.025 * 2.8) / f / 100;
+ u2.maxblur.value = num(p.maxBlur, 64) / Math.max(w, h);
+ break;
+ }
+ case "Bloom": {
+ const b = pass as UnrealBloomPass;
+ // raea's 1 is Bevy's 0.15 (runtime/look BLOOM)
+ const k = Math.min(1, num(p.intensity, 1) * 0.15);
+ b.strength = k;
+ (this.passes.get("Bloom:keep") as ShaderPass).uniforms.keep.value = 1 - k;
+ b.threshold = num(p.threshold, 0.8);
+ b.radius = 0.4;
+ break;
+ }
+ case "MotionBlur":
+ (pass as AfterimagePass).damp = Math.min(0.95, 0.5 * num(p.shutterAngle, 0.5) * 2);
+ break;
+ case "Grade": {
+ u.temperature.value = num(p.temperature, 0);
+ u.tint.value = num(p.tint, 0);
+ u.aberration.value = num(p.aberration, 0) * 2;
+ // three's linear colour times its exposure is Bevy's (three's ACES' 1/0.6 aside: Scene3d.apply)
+ u.scale.value = this.gl.toneMappingExposure / (this.gl.toneMapping === THREE.ACESFilmicToneMapping ? 0.6 : 1);
+ const v = p.vignette;
+ const vo = typeof v === "object" && v ? (v as Record<string, unknown>) : { intensity: num(v, 0) };
+ u.vig.value.set(num(vo.intensity, 0), num(vo.radius, 0.75), num(vo.smoothness, 5), 0);
+ u.vigColor.value.set(String(vo.color ?? "#000000"));
+ u.aspect.value.copy(aspect);
+ u.sat.value = levels(p, "saturation", 1);
+ u.con.value = levels(p, "contrast", 1);
+ u.gam.value = levels(p, "gamma", 1);
+ u.gai.value = levels(p, "gain", 1);
+ u.lif.value = levels(p, "lift", 0);
+ (this.passes.get("Grade:post") as ShaderPass).uniforms.saturation.value = num(p.saturation, 1);
+ break;
+ }
+ case "Look": {
+ const mode = String(p.mode ?? "site");
+ u.size.value.set(w, h);
+ u.cell.value = num(p.pixelSize, 6);
+ u.mode.value = { pixel: 0, site: 1, ink: 2, paint: 3, cartoon: 3 }[mode] ?? 1;
+ u.keep.value = num(p.color, 1);
+ u.lift.value = num(p.lift, 0);
+ u.gain.value = num(p.gain, 1);
+ u.line.value = num(p.line, 0);
+ u.threshold.value = num(p.threshold, 0.5);
+ u.band.value = num(p.band, 1);
+ u.bands.value = num(p.bands, mode === "cartoon" ? 2 : 3);
+ u.ink.value.set(String(p.ink ?? "#1a1410"));
+ u.paper.value.set(String(p.paper ?? "#efe6d2"));
+ u.light.value = p.theme === "light" ? 1 : 0;
+ if (mode === "paint" || mode === "cartoon") u.cell.value = 1;
+ break;
+ }
+ case "Fisheye":
+ case "LensDistortion": {
+ const fish = e.kind === "Fisheye";
+ const own = camera instanceof THREE.PerspectiveCamera ? camera.fov : 50;
+ u.kind.value = fish ? (p.mode === "stereographic" ? 0.3 : 0) : 1;
+ u.strength.value = num(p.strength, 1);
+ u.k1.value = num(p.k1, 0);
+ u.k2.value = num(p.k2, 0);
+ // by default a barrel's corners stay inside the picture
+ u.zoom.value = num(p.zoom, fish ? 1 : Math.max(1, 1 + num(p.k1, 0) + num(p.k2, 0)));
+ u.fov.value = num(p.fov, own);
+ u.own.value = own;
+ u.black.value = p.edges === "black" ? 1 : 0;
+ u.aspect.value.copy(aspect);
+ break;
+ }
+ }
+ }
+
+ dispose() {
+ for (const p of this.composer.passes) p.dispose();
+ this.composer.dispose();
+ }
+}
diff --git a/sdk/r3f/src/three/extras.ts b/sdk/r3f/src/three/extras.ts
new file mode 100644
index 00000000..7f19b71b
--- /dev/null
+++ b/sdk/r3f/src/three/extras.ts
@@ -0,0 +1,247 @@
+// raea's parts that three.js draws by the nearest thing it has (kinds.ts says what differs): the sky, fire, grass,
+// gaussian splats (their centres), 2D sprites and shapes over the 3D, rich text, a background plate and a page screen.
+import * as THREE from "three";
+import { Sky } from "three/examples/jsm/objects/Sky.js";
+import { texture } from "./materials";
+import { place } from "./things";
+import { vec } from "./lights";
+
+type Props = Record<string, unknown>;
+
+/** seeded numbers: the same each time */
+export function rng(seed: number) {
+ let s = seed >>> 0 || 1;
+ return () => ((s = (s * 1664525 + 1013904223) >>> 0) / 4294967296);
+}
+
+// ---- Atmosphere: three's Sky, its sun where the first DirectionalLight shines from ----
+export function sky(had: Sky | undefined, sunFrom: THREE.Vector3 | undefined, p: Props): Sky {
+ const s = had ?? new Sky();
+ s.scale.setScalar(4.5e5);
+ const u = s.material.uniforms;
+ u.turbidity.value = 2;
+ u.rayleigh.value = 1;
+ u.mieCoefficient.value = 0.005;
+ u.mieDirectionalG.value = 0.8;
+ u.sunPosition.value.copy(sunFrom ?? new THREE.Vector3(0, 1, 0.3)).normalize();
+ void p;
+ return s;
+}
+
+// ---- Fire: additive soft sprites rising, flickering with `time` and `seed` ----
+let flame: THREE.DataTexture | undefined;
+function flameTexture() {
+ if (flame) return flame;
+ const n = 64, d = new Uint8Array(n * n * 4);
+ for (let y = 0; y < n; y++)
+ for (let x = 0; x < n; x++) {
+ const dx = (x + 0.5) / n - 0.5, dy = (y + 0.5) / n - 0.5;
+ const a = Math.max(0, 1 - Math.hypot(dx, dy) * 2) ** 2;
+ d.set([255, 255, 255, Math.round(a * 255)], (y * n + x) * 4);
+ }
+ flame = new THREE.DataTexture(d, n, n);
+ flame.needsUpdate = true;
+ return flame;
+}
+
+export function fire(had: THREE.Group | undefined, p: Props, seconds: number): THREE.Group {
+ const g = had ?? new THREE.Group();
+ const count = 24;
+ if (!had) {
+ const mat = new THREE.SpriteMaterial({ map: flameTexture(), blending: THREE.AdditiveBlending, depthWrite: false, transparent: true });
+ for (let i = 0; i < count; i++) g.add(new THREE.Sprite(mat.clone()));
+ }
+ place(g, p);
+ const t = (typeof p.time === "number" ? p.time : seconds) * ((p.speed as number) ?? 1);
+ const r = rng((p.seed as number) ?? 1);
+ const colour = new THREE.Color((p.color as string) ?? "#ff8a2a");
+ const k = ((p.intensity as number) ?? 1) * ((p.opacity as number) ?? 1);
+ g.children.forEach((c, i) => {
+ const s = c as THREE.Sprite;
+ const phase = (t * (0.8 + r() * 0.6) + i / count) % 1;
+ const x = (r() - 0.5) * 0.5 * (1 - phase), z = (r() - 0.5) * 0.5 * (1 - phase);
+ s.position.set(x, phase * 1.2, z);
+ const size = 0.6 * (1 - phase) + 0.15;
+ s.scale.set(size, size * 1.4, 1);
+ const m = s.material as THREE.SpriteMaterial;
+ m.color.copy(colour).lerp(new THREE.Color("#fff2b0"), 1 - phase).multiplyScalar(k);
+ m.opacity = (1 - phase) * 0.7;
+ });
+ return g;
+}
+
+// ---- Grass: blades scattered over the sampled ground, one instanced mesh ----
+export function grass(spec: Props): THREE.InstancedMesh | undefined {
+ const s = spec.spec as { area: number[]; grid: [number, number]; height: number[]; density: number[]; tints?: [string, string][]; bladeHeight?: number; width?: [number, number]; seed?: number } | undefined;
+ if (!s) return undefined;
+ const [x0, z0, x1, z1] = s.area, [nx, nz] = s.grid;
+ const at = (gx: number, gz: number) => {
+ const i = Math.min(nx - 2, Math.max(0, Math.floor(gx))), k = Math.min(nz - 2, Math.max(0, Math.floor(gz)));
+ const fx = gx - i, fz = gz - k;
+ const v = (a: number[], ii: number, kk: number) => a[kk * nx + ii];
+ const lerp = (a: number[]) => (v(a, i, k) * (1 - fx) + v(a, i + 1, k) * fx) * (1 - fz) + (v(a, i, k + 1) * (1 - fx) + v(a, i + 1, k + 1) * fx) * fz;
+ return { h: lerp(s.height), d: lerp(s.density) };
+ };
+ const r = rng(s.seed ?? 7);
+ const area = (x1 - x0) * (z1 - z0);
+ const blades: [number, number, number, number][] = [];
+ const tries = Math.min(60000, Math.round(area * Math.max(...s.density)));
+ for (let i = 0; i < tries; i++) {
+ const u = r(), w = r();
+ const x = x0 + u * (x1 - x0), z = z0 + w * (z1 - z0);
+ const g = at(u * (nx - 1), w * (nz - 1));
+ if (r() * Math.max(...s.density) <= g.d) blades.push([x, g.h, z, r()]);
+ }
+ if (!blades.length) return undefined;
+ const h = s.bladeHeight ?? 0.35, [w0] = s.width ?? [0.03, 0.01];
+ const geo = new THREE.BufferGeometry();
+ geo.setAttribute("position", new THREE.Float32BufferAttribute([-w0, 0, 0, w0, 0, 0, 0, h, 0], 3));
+ geo.computeVertexNormals();
+ const [base, tip] = s.tints?.[0] ?? ["#3f6b2a", "#9cc25a"];
+ const mat = new THREE.MeshStandardMaterial({ color: new THREE.Color(base).lerp(new THREE.Color(tip), 0.5), side: THREE.DoubleSide, roughness: 0.9 });
+ const m = new THREE.InstancedMesh(geo, mat, blades.length);
+ const o = new THREE.Object3D();
+ blades.forEach(([x, y, z, k], i) => {
+ o.position.set(x, y, z);
+ o.rotation.set((k - 0.5) * 0.4, k * Math.PI * 2, 0);
+ o.scale.setScalar(0.7 + k * 0.6);
+ o.updateMatrix();
+ m.setMatrixAt(i, o.matrix);
+ });
+ m.receiveShadow = true;
+ return m;
+}
+
+// ---- Splat: the splats' centres in their colours (a .ply of 3DGS, or antimatter's .splat) ----
+export async function splatPoints(src: string): Promise<THREE.Points> {
+ const buf = await (await fetch(src)).arrayBuffer();
+ const positions: number[] = [], colors: number[] = [];
+ const bytes = new Uint8Array(buf);
+ const head = new TextDecoder().decode(bytes.subarray(0, Math.min(bytes.length, 4096)));
+ if (head.startsWith("ply")) {
+ const end = head.indexOf("end_header\n") + "end_header\n".length;
+ const props = [...head.slice(0, end).matchAll(/property (\w+) (\w+)/g)].map((m) => ({ type: m[1], name: m[2] }));
+ const size = (t: string) => (t === "double" ? 8 : t === "float" || t === "int" || t === "uint" ? 4 : t === "short" || t === "ushort" ? 2 : 1);
+ const stride = props.reduce((n, p) => n + size(p.type), 0);
+ const off: Record<string, number> = {};
+ props.reduce((n, p) => ((off[p.name] = n), n + size(p.type)), 0);
+ const count = Number(/element vertex (\d+)/.exec(head)?.[1] ?? 0);
+ const dv = new DataView(buf, end);
+ const SH = 0.28209479;
+ for (let i = 0; i < count; i++) {
+ const b = i * stride, f = (k: string) => dv.getFloat32(b + off[k], true);
+ positions.push(f("x"), f("y"), f("z"));
+ if ("f_dc_0" in off) colors.push(0.5 + SH * f("f_dc_0"), 0.5 + SH * f("f_dc_1"), 0.5 + SH * f("f_dc_2"));
+ else colors.push(1, 1, 1);
+ }
+ } else {
+ const dv = new DataView(buf);
+ for (let b = 0; b + 32 <= buf.byteLength; b += 32) {
+ positions.push(dv.getFloat32(b, true), dv.getFloat32(b + 4, true), dv.getFloat32(b + 8, true));
+ colors.push(bytes[b + 24] / 255, bytes[b + 25] / 255, bytes[b + 26] / 255);
+ }
+ }
+ const g = new THREE.BufferGeometry();
+ g.setAttribute("position", new THREE.Float32BufferAttribute(positions, 3));
+ g.setAttribute("color", new THREE.Float32BufferAttribute(colors.map((c) => Math.min(1, Math.max(0, c))), 3));
+ return new THREE.Points(g, new THREE.PointsMaterial({ size: 0.01, vertexColors: true }));
+}
+
+// ---- 2D over the 3D (Sprite, Shape2D): a flat card just in front of the camera, sized in pixels ----
+export function flat(had: THREE.Mesh | undefined, kind: string, p: Props): THREE.Mesh {
+ let geo: THREE.BufferGeometry;
+ const [w, h] = (p.size as [number, number] | undefined) ?? [(p.width as number) ?? 100, (p.height as number) ?? 100];
+ const shape = (p.shape as string) ?? "rect";
+ if (kind === "Shape2D" && shape !== "rect") {
+ const sides = shape === "triangle" ? 3 : shape === "polygon" ? ((p.sides as number) ?? 6) : 64;
+ geo = new THREE.CircleGeometry(0.5, sides);
+ geo.scale(w, h, 1);
+ } else geo = new THREE.PlaneGeometry(w, h);
+ const mat = new THREE.MeshBasicMaterial({ color: (p.color as string) ?? "#ffffff", transparent: true, opacity: (p.opacity as number) ?? 1, depthTest: false, toneMapped: false });
+ if (kind === "Sprite" && typeof p.src === "string") mat.map = texture(p.src, true);
+ if (had) {
+ had.geometry.dispose();
+ (had.material as THREE.Material).dispose();
+ }
+ const m = had ?? new THREE.Mesh();
+ m.geometry = geo;
+ m.material = mat;
+ m.renderOrder = 1000 + ((p.z as number) ?? 0);
+ m.userData.flat = { x: (p.x as number) ?? 0, y: (p.y as number) ?? 0, rotation: (p.rotation as number) ?? 0, scale: p.scale ?? 1, flipX: p.flipX, flipY: p.flipY };
+ return m;
+}
+
+/** the 2D cards placed in front of the camera, a pixel of the drawing a pixel of the card */
+export function placeFlat(m: THREE.Mesh, camera: THREE.Camera, width: number, height: number) {
+ const f = m.userData.flat as { x: number; y: number; rotation: number; scale: number | [number, number]; flipX?: boolean; flipY?: boolean };
+ const persp = camera instanceof THREE.PerspectiveCamera;
+ const d = persp ? camera.near * 1.5 : 1;
+ const worldPerPx = persp ? (2 * d * Math.tan((camera.fov * Math.PI) / 360)) / height : ((camera as THREE.OrthographicCamera).top - (camera as THREE.OrthographicCamera).bottom) / height;
+ const [sx, sy] = Array.isArray(f.scale) ? f.scale : [f.scale, f.scale];
+ const q = camera.getWorldQuaternion(new THREE.Quaternion());
+ const off = new THREE.Vector3((f.x - width / 2) * worldPerPx, (height / 2 - f.y) * worldPerPx, -d).applyQuaternion(q);
+ m.position.copy(camera.getWorldPosition(new THREE.Vector3())).add(off);
+ m.quaternion.copy(q).multiply(new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 0, 1), -f.rotation));
+ m.scale.set(sx * worldPerPx * (f.flipX ? -1 : 1), sy * worldPerPx * (f.flipY ? -1 : 1), 1);
+}
+
+// ---- RichText: its text drawn to a canvas on a plane (in a browser; elsewhere a blank card) ----
+export function richText(had: THREE.Mesh | undefined, p: Props): THREE.Mesh {
+ const spans = (p.spans as { text?: string }[] | undefined)?.map((s) => s.text ?? "").join("") ?? (p.text as string) ?? "";
+ const size = (p.size as number) ?? 0.3;
+ const doc = (globalThis as { document?: Document }).document;
+ const mat = new THREE.MeshBasicMaterial({ transparent: true, side: THREE.DoubleSide, toneMapped: false });
+ let aspect = Math.max(1, spans.length * 0.55);
+ if (doc?.createElement) {
+ const c = doc.createElement("canvas");
+ const ctx = c.getContext("2d");
+ if (ctx) {
+ const px = 128;
+ ctx.font = `${(p.weight as number) ?? 400} ${px}px ${(p.font as string) ?? "sans-serif"}`;
+ c.width = Math.ceil(ctx.measureText(spans).width) + 8;
+ c.height = Math.ceil(px * 1.3);
+ ctx.font = `${(p.weight as number) ?? 400} ${px}px ${(p.font as string) ?? "sans-serif"}`;
+ ctx.fillStyle = (p.color as string) ?? "#ffffff";
+ ctx.textBaseline = "middle";
+ ctx.fillText(spans, 4, c.height / 2);
+ mat.map = new THREE.CanvasTexture(c);
+ mat.map.colorSpace = THREE.SRGBColorSpace;
+ aspect = c.width / c.height;
+ }
+ }
+ const m = had ?? new THREE.Mesh();
+ m.geometry?.dispose();
+ m.geometry = new THREE.PlaneGeometry(size * 1.3 * aspect, size * 1.3);
+ m.material = mat;
+ place(m, p);
+ return m;
+}
+
+// ---- Plate: footage behind the scene (a video in a browser) ----
+const videos = new Map<string, THREE.VideoTexture>();
+export function plateTexture(src: string, time: number): THREE.Texture | undefined {
+ const doc = (globalThis as { document?: Document }).document;
+ if (!doc?.createElement) return undefined;
+ let t = videos.get(src);
+ if (!t) {
+ const v = doc.createElement("video");
+ Object.assign(v, { src, muted: true, playsInline: true, crossOrigin: "anonymous", preload: "auto" });
+ t = new THREE.VideoTexture(v);
+ t.colorSpace = THREE.SRGBColorSpace;
+ videos.set(src, t);
+ }
+ const v = t.image as HTMLVideoElement;
+ if (Math.abs(v.currentTime - time) > 1 / 120) v.currentTime = time;
+ return t;
+}
+
+// ---- Screen: the card a page is shown on ----
+export function screenCard(had: THREE.Mesh | undefined, p: Props): THREE.Mesh {
+ const [w, h] = [(p.width as number) ?? 1, (p.height as number) ?? 0.5625];
+ const m = had ?? new THREE.Mesh(new THREE.PlaneGeometry(1, 1), new THREE.MeshBasicMaterial({ color: "#101418", toneMapped: false }));
+ m.geometry.dispose();
+ m.geometry = new THREE.PlaneGeometry(w, h);
+ place(m, p);
+ void vec;
+ return m;
+}
diff --git a/sdk/r3f/src/three/geometry.ts b/sdk/r3f/src/three/geometry.ts
new file mode 100644
index 00000000..a5126259
--- /dev/null
+++ b/sdk/r3f/src/three/geometry.ts
@@ -0,0 +1,105 @@
+// A raea mesh's shape as a three.js BufferGeometry. The primitives (Box, Sphere ... `args` in three's own order) are
+// three's geometries; a <BufferMesh>'s arrays (the Mesh's data-shape "buffer:{...}") become attributes, its v turned
+// back to three's (raea's uvs count v from a picture's top, as Bevy's do); any other shape is core/shape's language
+// (minus, hull, extrude, text3d ...), meshed by raea's own shape module in wasm (engine/shape-web) once it is loaded.
+import * as THREE from "three";
+
+export const GEOMETRY: Record<string, (a: number[]) => THREE.BufferGeometry> = {
+ Box: (a) => new THREE.BoxGeometry(a[0] ?? 1, a[1] ?? 1, a[2] ?? 1),
+ Sphere: (a) => new THREE.SphereGeometry(a[0] ?? 1, 48, 24),
+ Plane: (a) => new THREE.PlaneGeometry(a[0] ?? 1, a[1] ?? 1),
+ Cylinder: (a) => new THREE.CylinderGeometry(a[0] ?? 1, a[1] ?? 1, a[2] ?? 1, 48),
+ Cone: (a) => new THREE.ConeGeometry(a[0] ?? 1, a[1] ?? 1, 48),
+ Torus: (a) => new THREE.TorusGeometry(a[0] ?? 1, a[1] ?? 0.4, 24, 64),
+ Capsule: (a) => new THREE.CapsuleGeometry(a[0] ?? 1, a[1] ?? 1, 12, 24),
+ Circle: (a) => new THREE.CircleGeometry(a[0] ?? 1, 48),
+ Ring: (a) => new THREE.RingGeometry(a[0] ?? 0.5, a[1] ?? 1, 48),
+};
+
+interface BufferSpec {
+ positions: number[];
+ indices?: number[];
+ normals?: number[];
+ uvs?: number[];
+ colors?: number[] | string[];
+}
+
+/** a <BufferMesh>'s arrays as a geometry */
+export function bufferGeometry(b: BufferSpec): THREE.BufferGeometry {
+ const g = new THREE.BufferGeometry();
+ g.setAttribute("position", new THREE.Float32BufferAttribute(b.positions, 3));
+ if (b.indices) g.setIndex(b.indices);
+ if (b.normals) g.setAttribute("normal", new THREE.Float32BufferAttribute(b.normals, 3));
+ else g.computeVertexNormals();
+ if (b.uvs) g.setAttribute("uv", new THREE.Float32BufferAttribute(b.uvs.map((v, i) => (i % 2 ? 1 - v : v)), 2));
+ if (b.colors) {
+ const c = b.colors as unknown[];
+ const rgba = typeof c[0] === "string" ? (c as string[]).flatMap((h) => { const k = new THREE.Color(h); return [k.r, k.g, k.b, 1]; }) : (c as number[]);
+ g.setAttribute("color", new THREE.Float32BufferAttribute(rgba, 4));
+ }
+ return g;
+}
+
+// ---- core/shape in wasm ----
+interface ShapeModule {
+ mesh(expr: string): Float32Array;
+}
+let shapes: ShapeModule | undefined;
+let loading: Promise<ShapeModule> | undefined;
+
+/** raea's shape module: the glue wasm-bindgen wrote for engine/shape-web (sdk/r3f/tools/shape-wasm.sh), by its url or
+ * as the module itself. Call once; until it resolves, shapes other than the primitives aren't drawn. */
+export function loadShapes(from: string | { default: (url?: unknown) => Promise<unknown>; mesh: ShapeModule["mesh"] }): Promise<ShapeModule> {
+ loading ??= (async () => {
+ const m = typeof from === "string" ? ((await import(/* @vite-ignore */ from)) as { default: () => Promise<unknown>; mesh: ShapeModule["mesh"] }) : from;
+ await m.default();
+ shapes = { mesh: m.mesh };
+ return shapes;
+ })();
+ return loading;
+}
+
+/** whether solids can be meshed now */
+export const shapesReady = () => shapes !== undefined;
+
+const meshed = new Map<string, THREE.BufferGeometry>();
+
+/** a shape expression's geometry (shared: don't dispose it), or undefined while the shape module isn't loaded */
+export function shapeGeometry(expr: string): THREE.BufferGeometry | undefined {
+ const had = meshed.get(expr);
+ if (had) return had;
+ if (!shapes) return undefined;
+ const out = shapes.mesh(expr);
+ const n = out[0];
+ const g = new THREE.BufferGeometry();
+ g.setAttribute("position", new THREE.BufferAttribute(out.slice(1, 1 + n * 3), 3));
+ g.setAttribute("normal", new THREE.BufferAttribute(out.slice(1 + n * 3, 1 + n * 6), 3));
+ meshed.set(expr, g);
+ return g;
+}
+
+const buffers = new Map<string, THREE.BufferGeometry>();
+
+/** a Mesh's geometry from its data-shape: its buffer, or its solid; undefined for a primitive (its child says) */
+export function geometryOfShape(shape: string | null): THREE.BufferGeometry | undefined {
+ if (!shape) return undefined;
+ if (shape.startsWith("buffer:")) {
+ let g = buffers.get(shape);
+ // newest last: a hit moves it to the end, so what's still drawn is never the one let go
+ if (g) {
+ buffers.delete(shape);
+ buffers.set(shape, g);
+ } else {
+ g = bufferGeometry(JSON.parse(shape.slice(7)) as BufferSpec);
+ buffers.set(shape, g);
+ // the newest few hundred kept: a mesh whose arrays change each frame makes a new one each frame
+ if (buffers.size > 256) {
+ const [first] = buffers.keys();
+ buffers.get(first)?.dispose();
+ buffers.delete(first);
+ }
+ }
+ return g;
+ }
+ return shapeGeometry(shape);
+}
diff --git a/sdk/r3f/src/three/index.ts b/sdk/r3f/src/three/index.ts
new file mode 100644
index 00000000..a03844f7
--- /dev/null
+++ b/sdk/r3f/src/three/index.ts
@@ -0,0 +1,5 @@
+// raea's 3D in three.js (docs/r3f.feature): Scene3d draws the parts a raea page renders (its `data-3d` elements) into
+// a three.js scene, for any three.js app, React Three Fiber's <Raea> and sdk/playable's host; kinds.ts is its coverage.
+export { Scene3d, type Settings } from "./scene";
+export { KINDS, PRIMITIVES, type Status } from "./kinds";
+export { loadShapes, shapesReady } from "./geometry";
diff --git a/sdk/r3f/src/three/kinds.ts b/sdk/r3f/src/three/kinds.ts
new file mode 100644
index 00000000..79cd6855
--- /dev/null
+++ b/sdk/r3f/src/three/kinds.ts
@@ -0,0 +1,74 @@
+// Every kind of part raea's SDK renders (a `data-3d` element) and what three.js does with it: the coverage of raea's
+// 3D in three.js and React Three Fiber, one row a kind. test/coverage.test.ts reads the SDK's sources for every kind it
+// can render and fails when one is missing here, so a kind added to raea is a decision made here too.
+// drawn three.js draws it as raea's engine does (same shape, surface, light units, transform)
+// near drawn by the nearest thing three.js has; `note` says what differs
+// setting a setting of the renderer or the scene, not an object (tone mapping, shadows, fog)
+// effect a frame effect, drawn by effects.ts with three's EffectComposer (<Raea> runs it; a three app calls
+// Effects.set and render); `note` says where it differs from raea's engine
+// engine Bevy's own (a component, a resource, a WESL shader, a compute pass): it runs in raea's engine only
+export type Status = "drawn" | "near" | "setting" | "effect" | "engine";
+
+export const KINDS: Record<string, { status: Status; three: string; note?: string }> = {
+ Canvas3D: { status: "drawn", three: "the Scene the parts hang from" },
+ Group: { status: "drawn", three: "Group" },
+ Entity: { status: "drawn", three: "Group (an ECS entity's transform); a Gizmo component in it is drawn as lines" },
+ Mesh: { status: "drawn", three: "Mesh, or InstancedMesh when it has `at`" },
+ Box: { status: "drawn", three: "three's BoxGeometry with the same args (the same surface; three's own segment counts)" },
+ Sphere: { status: "drawn", three: "three's SphereGeometry with the same args (the same surface; three's own segment counts)" },
+ Plane: { status: "drawn", three: "three's PlaneGeometry with the same args (the same surface; three's own segment counts)" },
+ Cylinder: { status: "drawn", three: "three's CylinderGeometry with the same args (the same surface; three's own segment counts)" },
+ Cone: { status: "drawn", three: "three's ConeGeometry with the same args (the same surface; three's own segment counts)" },
+ Torus: { status: "drawn", three: "three's TorusGeometry with the same args (the same surface; three's own segment counts)" },
+ Capsule: { status: "drawn", three: "three's CapsuleGeometry with the same args (the same surface; three's own segment counts)" },
+ BufferMesh: { status: "drawn", three: "BufferGeometry from its arrays" },
+ Text3D: { status: "drawn", three: "the shape module's text3d triangles (raea's own glyphs)" },
+ MeshStandardMaterial: { status: "drawn", three: "MeshStandardMaterial (maps, alpha modes, sides, uv transform, samplers)" },
+ MeshPhysicalMaterial: { status: "drawn", three: "MeshPhysicalMaterial (clearcoat, transmission, ior, thickness, attenuation, anisotropy, specular)" },
+ MeshBasicMaterial: { status: "drawn", three: "MeshBasicMaterial" },
+ MeshToonMaterial: { status: "near", three: "MeshToonMaterial with a gradient of its steps or bands", note: "raea's rim, highlight and ink outline are its own shader's: three's toon shades the bands only" },
+ PerspectiveCamera: { status: "drawn", three: "PerspectiveCamera, or OrthographicCamera when `ortho`" },
+ AmbientLight: { status: "drawn", three: "AmbientLight (units.ts)" },
+ DirectionalLight: { status: "drawn", three: "DirectionalLight with its target and shadow (units.ts)" },
+ PointLight: { status: "drawn", three: "PointLight (units.ts)" },
+ SpotLight: { status: "drawn", three: "SpotLight with its target (units.ts)" },
+ RectAreaLight: { status: "drawn", three: "RectAreaLight facing its target (units.ts; RectAreaLightUniformsLib)" },
+ Environment: { status: "drawn", three: "the panorama as scene.environment (and background), RGBE/EXR/picture loaders" },
+ Model: { status: "drawn", three: "GLTFLoader's scene: its clip at `time` (or blended `animations`), morphs, hidden nodes, re-covered materials", note: "a cloth bake, `attach`, `bones` and an authored `graph` are raea's engine's" },
+ Refinish: { status: "drawn", three: "the models inside it re-covered (MeshStandardMaterial props on each glTF material)" },
+ ImagePlane: { status: "drawn", three: "a plane with the picture (grid cells, cutout)" },
+ Fog: { status: "setting", three: "scene.fog: Fog (near, far) or FogExp2 (density)" },
+ ToneMapping: { status: "setting", three: "renderer.toneMapping and toneMappingExposure" },
+ Shadows: { status: "setting", three: "renderer.shadowMap on, the sun's map size" },
+ AntiAliasing: { status: "setting", three: "a WebGLRenderer's antialias is fixed when made: the app's <Canvas gl={{ antialias }}>" },
+ Atmosphere: { status: "near", three: "three's Sky (Preetham) lit by the first DirectionalLight", note: "Bevy's atmosphere is a physically based scattering model; Sky is the analytic one" },
+ Decal: { status: "near", three: "a quad at its place facing out of the surface, polygon-offset", note: "raea projects it onto whatever it covers; the quad lies flat" },
+ Sprite: { status: "near", three: "a quad in the scene facing the camera, its size in pixels at the camera's distance", note: "raea draws it in 2D over the 3D" },
+ Shape2D: { status: "near", three: "a flat shape facing the camera", note: "raea draws it in 2D over the 3D" },
+ RichText: { status: "near", three: "text drawn to a canvas on a plane", note: "raea lays text out with its own fonts and shapes" },
+ Plate: { status: "near", three: "a video texture on a plane behind the scene", note: "raea composites a plate under the 3D in linear light" },
+ Screen: { status: "near", three: "a plane where its page is shown", note: "raea renders the page into the texture each frame; three shows the plane in the page's background colour" },
+ Fire: { status: "near", three: "additive flame sprites rising and flickering by `time`", note: "raea's fire is a raymarched volume" },
+ Grass: { status: "near", three: "its blades as one instanced mesh", note: "raea's wind sway and LOD are its shader's" },
+ Splat: { status: "near", three: "the splats' centres as coloured points (.ply)", note: "three.js core has no gaussian splatting" },
+ Bloom: { status: "effect", three: "UnrealBloomPass mixed energy-conserving as Bevy's (the frame kept 1 - k, k of its blur; raea's 1 is Bevy's 0.15), threshold", note: "three's blur is its own mip chain, so a halo's shape differs; skip and passes aren't drawn" },
+ DepthOfField: { status: "effect", three: "BokehPass focused at the camera's focus, its f-number as the aperture, maxBlur in pixels", note: "three's bokeh is a single gather; the gaussian mode draws as bokeh" },
+ Outline: { status: "effect", three: "OutlinePass round every mesh in its colour and width", note: "three's outline is a silhouette round objects, not raea's depth-step and crease lines; depth, normal and far aren't read" },
+ Grade: { status: "effect", three: "Bevy's grade ported: fringes and vignette, white balance, saturation, contrast, gain, lift and gamma per level of light before tone mapping, saturation after", note: "white balance is a channel scale where Bevy's is a CIE matrix; skip and passes aren't drawn" },
+ Look: { status: "effect", three: "a look pass: pixel, site and ink as raea draws them (cells, Bayer dither, ink lines); paint and cartoon as flat bands", note: "paint and cartoon's lit bands, ragged edges and grain are raea's material shader" },
+ MotionBlur: { status: "effect", three: "AfterimagePass, its shutter angle as the trail", note: "a trail of the frames drawn before, not each part's velocity: it holds only while frames play in order" },
+ Fisheye: { status: "effect", three: "a lens pass: equidistant or stereographic to its fov, strength, zoom, edges" },
+ LensDistortion: { status: "effect", three: "a lens pass: Brown-Conrady k1, k2, zoom, edges" },
+ AmbientOcclusion: { status: "effect", three: "GTAOPass, its quality as samples and thickness as the radius", note: "it darkens all light, where Bevy's darkens only ambient and environment light" },
+ VolumetricFog: { status: "engine", three: "the scene's distance fog stays; light shafts are raymarched in Bevy" },
+ FogVolume: { status: "engine", three: "not drawn: a volume of fog lit by the lights through it, raymarched in Bevy" },
+ FramePass: { status: "engine", three: "a WESL frame pass runs in Bevy" },
+ SurfaceShader: { status: "engine", three: "WESL runs in Bevy; the mesh keeps its material's colour" },
+ Compute: { status: "engine", three: "a WGSL compute pass runs in Bevy" },
+ BevyComponent: { status: "engine", three: "a Bevy component (a gizmo's is drawn as lines)" },
+ BevyResource: { status: "engine", three: "a Bevy resource" },
+ Entities: { status: "engine", three: "an ECS world's entities, read from the engine's tables (World.scene() needs them); <Scene world> draws a world's rows as parts the host draws" },
+};
+
+/** the geometry kinds, each a primitive three.js has too */
+export const PRIMITIVES = ["Box", "Sphere", "Plane", "Cylinder", "Cone", "Torus", "Capsule", "Circle", "Ring"];
diff --git a/sdk/r3f/src/three/lights.ts b/sdk/r3f/src/three/lights.ts
new file mode 100644
index 00000000..bdd8b8f7
--- /dev/null
+++ b/sdk/r3f/src/three/lights.ts
@@ -0,0 +1,122 @@
+// raea's lights and camera as three.js's, in three's physical units through units.ts (a light puts the same light on
+// screen as raea's engine does at its default exposure).
+import * as THREE from "three";
+import { RectAreaLightUniformsLib } from "three/examples/jsm/lights/RectAreaLightUniformsLib.js";
+import { relativeOf, toThree, type LightKind } from "../units";
+
+type Props = Record<string, unknown>;
+type V3 = [number, number, number];
+
+export const vec = (v: unknown): V3 | undefined =>
+ Array.isArray(v) && v.length === 3 && v.every((n) => typeof n === "number") ? (v as V3) : undefined;
+
+let areaReady = false;
+
+export function makeLight(kind: string): THREE.Light | undefined {
+ switch (kind) {
+ case "AmbientLight": return new THREE.AmbientLight();
+ case "DirectionalLight": return new THREE.DirectionalLight();
+ case "PointLight": return new THREE.PointLight();
+ case "SpotLight": return new THREE.SpotLight();
+ case "RectAreaLight":
+ if (!areaReady) {
+ RectAreaLightUniformsLib.init();
+ areaReady = true;
+ }
+ return new THREE.RectAreaLight();
+ default: return undefined;
+ }
+}
+
+/** a light's props set: colour, intensity (units.ts), place and aim, reach, cone, shadows */
+export function setLight(l: THREE.Light, kind: string, p: Props, scene: THREE.Scene, shadowMap: number) {
+ if (typeof p.color === "string") l.color.set(p.color);
+ const i = relativeOf(kind, p);
+ const pos = vec(p.position);
+ if (pos) l.position.set(...pos);
+ if (l instanceof THREE.RectAreaLight) {
+ l.width = (p.width as number) ?? 1;
+ l.height = (p.height as number) ?? 1;
+ l.intensity = toThree("RectAreaLight", i, l.width * l.height);
+ l.lookAt(...(vec(p.target) ?? [0, 0, 0]));
+ return;
+ }
+ l.intensity = toThree(kind as LightKind, i);
+ if (l instanceof THREE.PointLight || l instanceof THREE.SpotLight) {
+ l.distance = typeof p.distance === "number" ? p.distance : 20;
+ l.decay = 2;
+ }
+ if (l instanceof THREE.SpotLight) {
+ l.angle = typeof p.angle === "number" ? p.angle : Math.PI / 3;
+ l.penumbra = typeof p.penumbra === "number" ? p.penumbra : 0;
+ }
+ if (l instanceof THREE.DirectionalLight || l instanceof THREE.SpotLight || l instanceof THREE.PointLight) {
+ // raea's sun casts shadows unless told not to; a bulb and a spot only when told to
+ l.castShadow = l instanceof THREE.DirectionalLight ? p.castShadow !== false : p.castShadow === true;
+ if (l.castShadow) l.shadow.mapSize.set(shadowMap, shadowMap);
+ }
+ if (l instanceof THREE.DirectionalLight || l instanceof THREE.SpotLight) {
+ l.target.position.set(...(vec(p.target) ?? [0, 0, 0]));
+ if (!l.target.parent) scene.add(l.target);
+ if (l instanceof THREE.DirectionalLight && l.castShadow) {
+ // the shadow's box: around what the light aims at, as Bevy's cascades cover the view
+ const c = l.shadow.camera;
+ c.left = c.bottom = -15;
+ c.right = c.top = 15;
+ c.near = 0.1;
+ c.far = Math.max(50, l.position.distanceTo(l.target.position) * 2 + 30);
+ c.updateProjectionMatrix();
+ l.shadow.bias = -0.0005;
+ l.shadow.normalBias = 0.02;
+ }
+ }
+}
+
+/** raea's camera (a PerspectiveCamera part; with `ortho`, its height in metres, an orthographic one) */
+export function setCamera(had: THREE.Camera | undefined, p: Props): THREE.PerspectiveCamera | THREE.OrthographicCamera {
+ const ortho = typeof p.ortho === "number";
+ const cam = ortho
+ ? had instanceof THREE.OrthographicCamera ? had : new THREE.OrthographicCamera()
+ : had instanceof THREE.PerspectiveCamera ? had : new THREE.PerspectiveCamera();
+ cam.position.set(...(vec(p.position) ?? [0, 0, 5]));
+ cam.up.set(...(vec(p.up) ?? [0, 1, 0]));
+ cam.lookAt(...(vec(p.lookAt) ?? [0, 0, 0]));
+ cam.near = typeof p.near === "number" ? p.near : 0.1;
+ cam.far = typeof p.far === "number" ? p.far : 1000;
+ if (cam instanceof THREE.PerspectiveCamera) {
+ cam.fov = typeof p.fov === "number" ? p.fov : 50;
+ const v = p.view as { width: number; height: number; x: number; y: number } | undefined;
+ if (v) cam.userData.view = v;
+ else delete cam.userData.view;
+ } else cam.userData.height = p.ortho as number;
+ if (typeof p.focus === "number") cam.userData.focus = p.focus;
+ else delete cam.userData.focus;
+ cam.updateMatrixWorld();
+ return cam;
+}
+
+/** the camera fitted to a drawing of this size */
+export function fitCamera(c: THREE.Camera, width: number, height: number) {
+ const aspect = width / height;
+ if (c instanceof THREE.PerspectiveCamera) {
+ c.aspect = aspect;
+ const v = c.userData.view as { width: number; height: number; x: number; y: number } | undefined;
+ if (v) c.setViewOffset(v.width, v.height, v.x, v.y, width, height);
+ else c.clearViewOffset();
+ c.updateProjectionMatrix();
+ } else if (c instanceof THREE.OrthographicCamera) {
+ const h = (c.userData.height as number) ?? 10;
+ c.top = h / 2;
+ c.bottom = -h / 2;
+ c.left = (-h * aspect) / 2;
+ c.right = (h * aspect) / 2;
+ c.updateProjectionMatrix();
+ }
+}
+
+/** raea's tone mapping names as three's */
+export const TONE: Record<string, THREE.ToneMapping> = {
+ // TonyMcMapface (Bevy's default) isn't one of three's: AgX is the nearest (sdk/playable's host draws Tony itself)
+ tony: THREE.AgXToneMapping, aces: THREE.ACESFilmicToneMapping, agx: THREE.AgXToneMapping, neutral: THREE.NeutralToneMapping,
+ reinhard: THREE.ReinhardToneMapping, none: THREE.NoToneMapping,
+};
diff --git a/sdk/r3f/src/three/materials.ts b/sdk/r3f/src/three/materials.ts
new file mode 100644
index 00000000..73ed061e
--- /dev/null
+++ b/sdk/r3f/src/three/materials.ts
@@ -0,0 +1,128 @@
+// raea's surfaces as three.js materials. The SDK already speaks three's names (color, roughness, metalness, emissive,
+// clearcoat, transmission ...), so a prop of the same name is set as it is; raea's own (alphaMode, side as a word, map
+// paths, repeat, uvTransform, samplers, attenuation, anisotropy, toon steps) are translated here.
+import * as THREE from "three";
+
+type Props = Record<string, unknown>;
+
+export const MATERIAL: Record<string, () => THREE.Material> = {
+ MeshStandardMaterial: () => new THREE.MeshStandardMaterial(),
+ MeshPhysicalMaterial: () => new THREE.MeshPhysicalMaterial(),
+ MeshBasicMaterial: () => new THREE.MeshBasicMaterial(),
+ MeshToonMaterial: () => new THREE.MeshToonMaterial(),
+};
+
+const loader = new THREE.TextureLoader();
+const textures = new Map<string, THREE.Texture>();
+
+/** a picture as a texture, loaded once a path; colour pictures are sRGB, data (normals, roughness) linear */
+export function texture(src: string, colour: boolean): THREE.Texture {
+ const key = `${colour ? "c" : "d"}:${src}`;
+ let t = textures.get(key);
+ if (!t) {
+ t = loader.load(src);
+ t.colorSpace = colour ? THREE.SRGBColorSpace : THREE.NoColorSpace;
+ textures.set(key, t);
+ }
+ return t;
+}
+
+const WRAP: Record<string, THREE.Wrapping> = { repeat: THREE.RepeatWrapping, clamp: THREE.ClampToEdgeWrapping, mirror: THREE.MirroredRepeatWrapping };
+
+/** a map's placement and sampler from the material's props: a texture per placement, so two meshes sharing a picture
+ * at different repeats each get their own */
+function placed(base: THREE.Texture, p: Props, which: string): THREE.Texture {
+ const r = p.repeat as [number, number] | undefined;
+ const uvt = p.uvTransform as { offset?: [number, number]; rotation?: number; scale?: [number, number] } | undefined;
+ const s = ((p.samplers as Record<string, Props> | undefined)?.[which] ?? p.sampler) as { filter?: string; wrap?: string | [string, string]; anisotropy?: number } | undefined;
+ if (!r && !uvt && !s) return base;
+ const t = base.clone();
+ t.source = base.source;
+ const [ws, wt] = Array.isArray(s?.wrap) ? s.wrap : [s?.wrap ?? (r ? "repeat" : "clamp"), s?.wrap ?? (r ? "repeat" : "clamp")];
+ t.wrapS = WRAP[ws] ?? THREE.ClampToEdgeWrapping;
+ t.wrapT = WRAP[wt] ?? THREE.ClampToEdgeWrapping;
+ if (s?.filter === "nearest") t.magFilter = t.minFilter = THREE.NearestFilter;
+ if (s?.anisotropy) t.anisotropy = s.anisotropy;
+ if (uvt) {
+ t.offset.set(...(uvt.offset ?? [0, 0]));
+ t.rotation = uvt.rotation ?? 0;
+ t.repeat.set(...(uvt.scale ?? [1, 1]));
+ } else if (r) t.repeat.set(r[0], r[1]);
+ t.needsUpdate = true;
+ return t;
+}
+
+const MAPS: [string, string, boolean][] = [
+ ["map", "map", true], ["emissiveMap", "emissiveMap", true], ["normalMap", "normalMap", false], ["roughnessMap", "roughnessMap", false],
+ ["metalnessMap", "metalnessMap", false], ["aoMap", "aoMap", false], ["depthMap", "displacementMap", false],
+];
+
+const SIDE: Record<string, THREE.Side> = { front: THREE.FrontSide, back: THREE.BackSide, double: THREE.DoubleSide };
+
+/** a gradient of `steps` even bands, or raea's explicit bands, for MeshToonMaterial */
+function toonGradient(p: Props): THREE.DataTexture {
+ const bands = p.bands as { at: number }[] | undefined;
+ const n = bands?.length ?? Math.max(1, Math.min(8, (p.steps as number) ?? 2));
+ const data = new Uint8Array(n);
+ for (let i = 0; i < n; i++) data[i] = Math.round(((bands ? bands[i].at : n === 1 ? 1 : i / (n - 1)) || 0.05) * 255);
+ const t = new THREE.DataTexture(data, n, 1, THREE.RedFormat);
+ t.magFilter = t.minFilter = THREE.NearestFilter;
+ t.needsUpdate = true;
+ return t;
+}
+
+/** raea's material props set on a three material; `over` (a model re-covered) changes only what the props name, so
+ * a glTF material keeps its own pictures unless one is given (or `map: null` takes it off) */
+export function paint(m: THREE.Material, p: Props, over = false) {
+ const target = m as unknown as Record<string, unknown>;
+ for (const [k, v] of Object.entries(p)) {
+ const have = target[k];
+ if (have instanceof THREE.Color && typeof v === "string") have.set(v);
+ else if ((typeof v === "number" || typeof v === "boolean") && (typeof have === "number" || typeof have === "boolean")) target[k] = v;
+ }
+ for (const [from, to, colour] of MAPS) {
+ if (!(to in target) || (over && !(from in p))) continue;
+ const src = p[from];
+ target[to] = typeof src === "string" ? placed(texture(src, colour), p, from) : null;
+ }
+ if (typeof p.metallicRoughnessMap === "string" && "roughnessMap" in target) {
+ const t = placed(texture(p.metallicRoughnessMap, false), p, "metallicRoughnessMap");
+ target.roughnessMap = target.metalnessMap = t;
+ }
+ if (over) {
+ m.needsUpdate = true;
+ return;
+ }
+ m.side = SIDE[p.side as string] ?? THREE.FrontSide;
+ const mode = p.alphaMode as string | undefined;
+ m.transparent = p.transparent === true || (typeof p.opacity === "number" && p.opacity < 1) || mode === "blend" || mode === "add" || mode === "multiply" || mode === "premultiplied";
+ m.alphaTest = mode === "mask" ? ((p.alphaCutoff as number) ?? 0.5) : 0;
+ m.alphaToCoverage = mode === "coverage";
+ m.blending = mode === "add" ? THREE.AdditiveBlending : mode === "multiply" ? THREE.MultiplyBlending : THREE.NormalBlending;
+ m.premultipliedAlpha = mode === "premultiplied" || mode === "multiply";
+ if ("fog" in target) target.fog = p.fog !== false;
+ if (m instanceof THREE.MeshPhysicalMaterial) {
+ const att = p.attenuation as { distance?: number; color?: string } | undefined;
+ m.attenuationDistance = att?.distance ?? Infinity;
+ if (att?.color) m.attenuationColor.set(att.color);
+ const an = p.anisotropy as number | { strength?: number; rotation?: number } | undefined;
+ m.anisotropy = typeof an === "number" ? an : an?.strength ?? 0;
+ m.anisotropyRotation = typeof an === "object" ? an.rotation ?? 0 : 0;
+ // Bevy's reflectance 0.5 is three's specularIntensity 1 (4% at normal incidence)
+ m.specularIntensity = typeof p.reflectance === "number" ? Math.min(1, p.reflectance / 0.5) : 1;
+ if (typeof p.specularTint === "string") m.specularColor.set(p.specularTint);
+ }
+ if (m instanceof THREE.MeshToonMaterial) {
+ m.gradientMap?.dispose();
+ m.gradientMap = toonGradient(p);
+ }
+ m.needsUpdate = true;
+}
+
+/** whether a material's vertex colours should show (its mesh has them) */
+export function vertexColoured(m: THREE.Material, has: boolean) {
+ if (m.vertexColors !== has) {
+ m.vertexColors = has;
+ m.needsUpdate = true;
+ }
+}
diff --git a/sdk/r3f/src/three/page.ts b/sdk/r3f/src/three/page.ts
new file mode 100644
index 00000000..d8b1b563
--- /dev/null
+++ b/sdk/r3f/src/three/page.ts
@@ -0,0 +1,21 @@
+// The page's own background behind its 3D: the first painted background among the 3D's enclosing elements, which
+// raea's engine clears to (the AbsoluteFill a scene sits in). Read once an element (computed style is slow), and from
+// its inline style when the page isn't in the document (<Raea>'s page is off screen).
+/** set on each element read; a host hides those backgrounds so the 3D shows through (sdk/playable's stylesheet) */
+export const UNDER = "data-raea-under3d";
+
+export function backgroundUnder3d(page: Element): string | undefined {
+ const first = page.querySelector("[data-3d]");
+ if (!first) return undefined;
+ let clear: string | undefined;
+ for (let el = first.parentElement; el && el !== page; el = el.parentElement) {
+ if (!el.hasAttribute(UNDER)) {
+ const style = (el as HTMLElement).style;
+ const bg = el.isConnected && typeof getComputedStyle === "function" ? getComputedStyle(el).backgroundColor : style?.backgroundColor || style?.background;
+ if (bg && bg !== "transparent" && !bg.endsWith(", 0)")) el.setAttribute(UNDER, bg);
+ else continue;
+ }
+ clear ??= el.getAttribute(UNDER)!;
+ }
+ return clear;
+}
diff --git a/sdk/r3f/src/three/scene.ts b/sdk/r3f/src/three/scene.ts
new file mode 100644
index 00000000..6885fcb8
--- /dev/null
+++ b/sdk/r3f/src/three/scene.ts
@@ -0,0 +1,356 @@
+// raea's 3D drawn by three.js: every `data-3d` element the SDK's components render (kind and JSON props, as raea's
+// engine reads them) becomes a three.js object, kept per element and changed only when its props do. sdk/playable's
+// host and <Raea> (in React Three Fiber) both draw with this. kinds.ts lists what each kind becomes; frame effects are
+// listed in `effects` for the app's own composer and kinds only raea's engine runs are named once.
+import * as THREE from "three";
+import { EXRLoader } from "three/examples/jsm/loaders/EXRLoader.js";
+import { HDRLoader } from "three/examples/jsm/loaders/HDRLoader.js";
+import type { Sky } from "three/examples/jsm/objects/Sky.js";
+import { fire, flat, grass, placeFlat, plateTexture, richText, screenCard, sky, splatPoints } from "./extras";
+import { GEOMETRY, geometryOfShape, shapesReady } from "./geometry";
+import { KINDS, PRIMITIVES } from "./kinds";
+import { TONE, fitCamera, makeLight, setCamera, setLight, vec } from "./lights";
+import { MATERIAL, paint, texture, vertexColoured } from "./materials";
+import { ModelPart, decal, gizmoLines, imagePlane, instanced, place } from "./things";
+import { EXPOSURE } from "../units";
+
+type Props = Record<string, unknown>;
+
+interface Kept {
+ kind: string;
+ json: string;
+ obj?: THREE.Object3D;
+ geometry?: THREE.BufferGeometry;
+ material?: THREE.Material;
+ model?: ModelPart;
+ /** a solid waiting for the shape module */
+ waiting?: boolean;
+}
+
+/** what raea's settings make of the renderer: apply() sets them */
+export interface Settings {
+ toneMapping: THREE.ToneMapping;
+ exposure: number;
+ shadows: boolean;
+ shadowMap: number;
+}
+
+const CONTAINERS = new Set(["Group", "Entity", "Mesh"]);
+const GIZMO = "bevy_gizmos::retained::Gizmo";
+const envLoaders = { hdr: new HDRLoader(), exr: new EXRLoader() };
+const envs = new Map<string, THREE.Texture>();
+
+function panorama(src: string, done: () => void): THREE.Texture {
+ let t = envs.get(src);
+ if (t) return t;
+ const ext = src.split("?")[0].split(".").pop()!.toLowerCase();
+ try {
+ t = ext === "hdr" || ext === "exr" ? envLoaders[ext].load(src, done) : texture(src, true);
+ } catch (e) {
+ console.warn(`raea/r3f: Environment ${src} couldn't be loaded: ${String(e)}`);
+ t = new THREE.Texture();
+ }
+ t.mapping = THREE.EquirectangularReflectionMapping;
+ envs.set(src, t);
+ return t;
+}
+
+/** The three.js side of one page: call sync(root, seconds) after each React commit, then apply() and draw. */
+export class Scene3d {
+ readonly scene = new THREE.Scene();
+ camera: THREE.Camera = new THREE.PerspectiveCamera(50, 1, 0.1, 1000);
+ settings: Settings = { toneMapping: THREE.AgXToneMapping, exposure: 1, shadows: true, shadowMap: 2048 };
+ /** the frame effects on the page (Bloom, DepthOfField, Outline ...), each kind's props: the app's composer draws them */
+ effects: { kind: string; props: Props }[] = [];
+ /** whether the page drew any 3D at the last sync */
+ any = false;
+ /** called when something loaded later (a model, a panorama): draw again */
+ onLoad: () => void = () => {};
+ private kept = new Map<Element, Kept>();
+ private warned = new Set<string>();
+ private flats = new Set<THREE.Mesh>();
+ private width = 1;
+ private height = 1;
+ private seconds = 0;
+ private cameraEl?: Element;
+
+ sync(root: Element, seconds = this.seconds) {
+ this.seconds = seconds;
+ const seen = new Set<Element>();
+ const nodes = root.querySelectorAll("[data-3d]");
+ this.any = nodes.length > 0;
+ this.effects = [];
+ this.cameraEl = undefined;
+ for (const el of nodes) {
+ seen.add(el);
+ const kind = el.getAttribute("data-3d")!;
+ const json = (el.getAttribute("data-props") ?? "{}") + "|" + (el.getAttribute("data-shape") ?? "");
+ const status = KINDS[kind]?.status;
+ if (status === "effect") this.effects.push({ kind, props: JSON.parse(el.getAttribute("data-props") ?? "{}") as Props });
+ let k = this.kept.get(el);
+ // a model's clip and a fire's flicker move with time though their props don't
+ const timed = kind === "Model" || kind === "Fire" || kind === "Plate";
+ if (k && k.kind === kind && k.json === json && !timed && !(k.waiting && shapesReady())) continue;
+ if (k && k.kind !== kind) {
+ this.drop(k);
+ k = undefined;
+ }
+ k = this.update(el, kind, JSON.parse(el.getAttribute("data-props") ?? "{}") as Props, k);
+ k.json = json;
+ this.kept.set(el, k);
+ }
+ for (const [el, k] of this.kept) {
+ if (!seen.has(el)) {
+ this.drop(k);
+ this.kept.delete(el);
+ }
+ }
+ this.fit(this.width, this.height);
+ }
+
+ private warnOnce(kind: string, why: string) {
+ if (this.warned.has(kind)) return;
+ this.warned.add(kind);
+ console.warn(`raea/r3f: ${kind} ${why}`);
+ }
+
+ /** the object a part hangs from: the nearest enclosing Group, Entity or Mesh, else the scene */
+ private parentOf(el: Element): THREE.Object3D {
+ for (let a = el.parentElement?.closest("[data-3d]"); a; a = a.parentElement?.closest("[data-3d]")) {
+ const k = this.kept.get(a);
+ if (k?.obj && CONTAINERS.has(k.kind)) return k.obj;
+ }
+ return this.scene;
+ }
+
+ /** the nearest enclosing part, of any kind */
+ private ownerOf(el: Element): Kept | undefined {
+ const a = el.parentElement?.closest("[data-3d]");
+ return a ? this.kept.get(a) : undefined;
+ }
+
+ private hang(k: Kept, el: Element, o: THREE.Object3D) {
+ if (k.obj !== o) {
+ k.obj?.removeFromParent();
+ k.obj = o;
+ }
+ if (!o.parent) this.parentOf(el).add(o);
+ }
+
+ private update(el: Element, kind: string, p: Props, k: Kept | undefined): Kept {
+ k ??= { kind, json: "" };
+ const owner = this.ownerOf(el);
+ switch (kind) {
+ case "Group":
+ case "Entity": {
+ const g = (k.obj as THREE.Group | undefined) ?? new THREE.Group();
+ const t = p.transform as { translation?: number[]; rotation?: number[]; scale?: number[] } | undefined;
+ place(g, t ? { position: t.translation, quaternion: t.rotation, scale: t.scale } : p);
+ this.hang(k, el, g);
+ return k;
+ }
+ case "Mesh": {
+ // its shape: a primitive child (three's own), else its data-shape (a buffer, or a solid for the shape module)
+ const shape = el.getAttribute("data-shape");
+ const primitive = [...el.children].some((c) => PRIMITIVES.includes(c.getAttribute("data-3d") ?? ""));
+ const fromShape = primitive ? undefined : geometryOfShape(shape);
+ k.waiting = !primitive && !!shape && !fromShape;
+ if (k.waiting) this.warnOnce("Mesh shape", "is a solid: load raea's shape module (loadShapes) to draw it");
+ const at = p.at as number[] | undefined;
+ const had = k.obj as THREE.Mesh | undefined;
+ const geometry = fromShape ?? had?.geometry ?? new THREE.BufferGeometry();
+ const material = (had?.material as THREE.Material | undefined) ?? new THREE.MeshStandardMaterial();
+ const m = at ? instanced(had instanceof THREE.InstancedMesh ? had : undefined, geometry, material, at) : had && !(had instanceof THREE.InstancedMesh) ? had : new THREE.Mesh(geometry, material);
+ m.geometry = geometry;
+ place(m, p);
+ // shadow="only": it casts its shadow and isn't seen
+ const only = p.shadow === "only";
+ m.castShadow = only || (p.shadow !== false && p.castShadow !== false);
+ m.receiveShadow = !only && p.receiveShadow !== false;
+ material.colorWrite = material.depthWrite = !only;
+ vertexColoured(material, !!geometry.attributes.color);
+ this.hang(k, el, m);
+ return k;
+ }
+ case "BufferMesh":
+ case "Text3D":
+ return k; // the Mesh's data-shape carries them
+ case "Model": {
+ if (!k.model) {
+ k.model = new ModelPart(p.src as string, () => this.onLoad());
+ this.parentOf(el).add(k.model.root);
+ k.obj = k.model.root;
+ }
+ const own = [...el.querySelectorAll(":scope > [data-3d$='Material']")].map((m) => JSON.parse(m.getAttribute("data-props") ?? "{}") as Props);
+ const re = el.closest("[data-3d='Refinish']");
+ const outer = re ? ((JSON.parse(re.getAttribute("data-props") ?? "{}") as Props).materials as Props[]) : [];
+ k.model.set(p, this.seconds, [...own, ...outer]);
+ if (Array.isArray(p.at)) this.warnOnce("Model at", "copies are drawn as one model at the first placement");
+ return k;
+ }
+ case "Refinish":
+ return k; // read by the models inside it
+ case "ImagePlane":
+ this.hang(k, el, imagePlane(k.obj as THREE.Mesh | undefined, p));
+ return k;
+ case "Decal":
+ this.hang(k, el, decal(k.obj as THREE.Mesh | undefined, p));
+ return k;
+ case "PerspectiveCamera":
+ // one camera: the first
+ if (this.cameraEl) return k;
+ this.cameraEl = el;
+ this.camera = setCamera(this.camera, p);
+ return k;
+ case "Fog": {
+ const color = typeof p.color === "string" ? p.color : "#000000";
+ this.scene.fog = typeof p.density === "number" ? new THREE.FogExp2(color, p.density) : new THREE.Fog(color, typeof p.near === "number" ? p.near : 5, typeof p.far === "number" ? p.far : 20);
+ return k;
+ }
+ case "ToneMapping":
+ this.settings.toneMapping = TONE[(p.mode as string) ?? "tony"] ?? THREE.AgXToneMapping;
+ this.settings.exposure = 2 ** ((p.exposure as number) ?? 0);
+ return k;
+ case "Shadows":
+ this.settings.shadows = true;
+ if (typeof p.mapSize === "number") this.settings.shadowMap = p.mapSize;
+ return k;
+ case "AntiAliasing":
+ case "Canvas3D":
+ return k;
+ case "Environment": {
+ const src = p.src as string;
+ const t = panorama(src, () => this.onLoad());
+ const intensity = ((p.intensity as number) ?? 1) * 1000 * EXPOSURE;
+ this.scene.environment = intensity > 0 ? t : null;
+ this.scene.environmentIntensity = intensity;
+ this.scene.environmentRotation.set(0, (p.rotation as number) ?? 0, 0);
+ if (p.background) {
+ this.scene.background = t;
+ this.scene.backgroundIntensity = ((p.backgroundIntensity as number) ?? (p.intensity as number) ?? 1) * 1000 * EXPOSURE;
+ this.scene.backgroundRotation.set(0, (p.rotation as number) ?? 0, 0);
+ }
+ return k;
+ }
+ case "Atmosphere": {
+ const sun = [...this.kept.values()].find((x) => x.obj instanceof THREE.DirectionalLight)?.obj as THREE.DirectionalLight | undefined;
+ const from = sun ? sun.position.clone().sub(sun.target.position) : undefined;
+ this.hang(k, el, sky(k.obj as Sky | undefined, from, p));
+ return k;
+ }
+ case "Fire":
+ this.hang(k, el, fire(k.obj as THREE.Group | undefined, p, this.seconds));
+ return k;
+ case "Grass": {
+ k.obj?.removeFromParent();
+ const g = grass(p);
+ if (g) this.hang(k, el, g);
+ return k;
+ }
+ case "Splat": {
+ if (!k.obj) {
+ const holder = new THREE.Group();
+ this.hang(k, el, holder);
+ void splatPoints(p.src as string).then((pts) => { holder.add(pts); this.onLoad(); }, () => this.warnOnce("Splat", `couldn't load ${String(p.src)}`));
+ }
+ place(k.obj!, p);
+ return k;
+ }
+ case "Sprite":
+ case "Shape2D": {
+ const m = flat(k.obj as THREE.Mesh | undefined, kind, p);
+ this.flats.add(m);
+ if (!m.parent) this.scene.add(m);
+ k.obj = m;
+ return k;
+ }
+ case "RichText":
+ this.hang(k, el, richText(k.obj as THREE.Mesh | undefined, p));
+ return k;
+ case "Plate": {
+ const t = plateTexture(p.src as string, typeof p.time === "number" ? p.time : this.seconds);
+ if (t) this.scene.background = t;
+ return k;
+ }
+ case "Screen":
+ this.hang(k, el, screenCard(k.obj as THREE.Mesh | undefined, p));
+ return k;
+ case "BevyComponent":
+ if (p.type === GIZMO && owner?.obj) {
+ k.obj?.removeFromParent();
+ k.obj = gizmoLines(p.value as Props);
+ owner.obj.add(k.obj);
+ } else this.warnOnce(`BevyComponent ${String(p.type)}`, "is Bevy's: it runs in raea's engine only");
+ return k;
+ }
+ if (kind in GEOMETRY) {
+ const mesh = owner?.obj instanceof THREE.Mesh ? owner.obj : undefined;
+ if (mesh) {
+ k.geometry?.dispose();
+ k.geometry = GEOMETRY[kind](Array.isArray(p.args) ? (p.args as number[]) : []);
+ mesh.geometry = k.geometry;
+ }
+ return k;
+ }
+ if (kind in MATERIAL) {
+ // a material inside a Model re-covers it (read there)
+ if (owner?.kind === "Model") return k;
+ const mesh = owner?.obj instanceof THREE.Mesh ? owner.obj : undefined;
+ if (!k.material || k.material.type !== MATERIAL[kind]().type) {
+ k.material?.dispose();
+ k.material = MATERIAL[kind]();
+ }
+ if (mesh) {
+ mesh.material = k.material;
+ vertexColoured(k.material, !!mesh.geometry.attributes.color);
+ }
+ paint(k.material, p);
+ return k;
+ }
+ if (kind.endsWith("Light")) {
+ const l = (k.obj as THREE.Light | undefined) ?? makeLight(kind);
+ if (!l) return k;
+ if (!k.obj) {
+ k.obj = l;
+ this.scene.add(l);
+ }
+ setLight(l, kind, p, this.scene, this.settings.shadowMap);
+ return k;
+ }
+ const status = KINDS[kind]?.status;
+ if (status === "engine") this.warnOnce(kind, "is Bevy's (WESL, compute, ECS): it runs in raea's engine only");
+ else if (status !== "effect") this.warnOnce(kind, "isn't a kind three.js draws");
+ return k;
+ }
+
+ private drop(k: Kept) {
+ k.obj?.removeFromParent();
+ if (k.obj instanceof THREE.DirectionalLight || k.obj instanceof THREE.SpotLight) k.obj.target.removeFromParent();
+ if (k.obj instanceof THREE.Mesh) this.flats.delete(k.obj);
+ k.model?.dispose();
+ k.geometry?.dispose();
+ k.material?.dispose();
+ if (k.kind === "Fog") this.scene.fog = null;
+ if (k.kind === "Environment") this.scene.environment = this.scene.background = null;
+ }
+
+ /** the camera (and the 2D cards in front of it) fitted to a drawing of this size in pixels */
+ fit(width: number, height: number) {
+ this.width = width;
+ this.height = height;
+ fitCamera(this.camera, width, height);
+ this.camera.updateMatrixWorld();
+ for (const m of this.flats) placeFlat(m, this.camera, width, height);
+ }
+
+ /** raea's settings on a renderer: tone mapping, exposure, shadows */
+ apply(renderer: THREE.WebGLRenderer) {
+ renderer.toneMapping = this.settings.toneMapping;
+ // three's ACES scales its input by 1/0.6 (tonemapping_pars_fragment); Bevy's ACESFitted doesn't
+ renderer.toneMappingExposure = this.settings.exposure * (this.settings.toneMapping === THREE.ACESFilmicToneMapping ? 0.6 : 1);
+ renderer.shadowMap.enabled = this.settings.shadows;
+ renderer.shadowMap.type = THREE.PCFSoftShadowMap;
+ }
+}
+
+export { vec };
diff --git a/sdk/r3f/src/three/things.ts b/sdk/r3f/src/three/things.ts
new file mode 100644
index 00000000..28bb98e7
--- /dev/null
+++ b/sdk/r3f/src/three/things.ts
@@ -0,0 +1,229 @@
+// raea's parts that are more than a shape and a surface: glTF models (their clips, morphs, hidden nodes and re-covered
+// materials), pictures on cards, instanced copies, gizmo lines and decals.
+import * as THREE from "three";
+import { GLTFLoader, type GLTF } from "three/examples/jsm/loaders/GLTFLoader.js";
+import { paint, texture } from "./materials";
+import { vec } from "./lights";
+
+type Props = Record<string, unknown>;
+
+/** position, rotation (Euler XYZ, radians, as raea composes it), quaternion and scale */
+export function place(o: THREE.Object3D, p: Props) {
+ const pos = vec(p.position), rot = vec(p.rotation), sc = vec(p.scale);
+ const q = p.quaternion as number[] | undefined;
+ if (pos) o.position.set(...pos);
+ if (Array.isArray(q) && q.length === 4) o.quaternion.set(q[0], q[1], q[2], q[3]);
+ else if (rot) o.rotation.set(rot[0], rot[1], rot[2], "XYZ");
+ if (sc) o.scale.set(...sc);
+ else if (typeof p.scale === "number") o.scale.setScalar(p.scale);
+ if (typeof p.visible === "boolean") o.visible = p.visible;
+ if (typeof p.name === "string") o.name = p.name;
+}
+
+// ---- glTF ----
+const gltfLoader = new GLTFLoader();
+const gltfs = new Map<string, Promise<GLTF>>();
+export const loadGltf = (src: string) => {
+ let g = gltfs.get(src);
+ if (!g) gltfs.set(src, (g = gltfLoader.loadAsync(src)));
+ return g;
+};
+
+/** A <Model>: its glTF's scene, cloned for this part (skinned meshes keep their own skeletons), posed each sync. */
+export class ModelPart {
+ readonly root = new THREE.Group();
+ private model?: THREE.Object3D;
+ private clips: THREE.AnimationClip[] = [];
+ private mixer?: THREE.AnimationMixer;
+ private props: Props = {};
+ private refinish: Props[] = [];
+ private seconds = 0;
+
+ constructor(src: string, done: () => void) {
+ void loadGltf(src).then(async (g) => {
+ const { clone } = await import("three/examples/jsm/utils/SkeletonUtils.js");
+ this.model = clone(g.scene);
+ this.clips = g.animations;
+ this.mixer = new THREE.AnimationMixer(this.model);
+ this.root.add(this.model);
+ this.model.traverse((o) => {
+ if ((o as THREE.Mesh).isMesh) o.castShadow = o.receiveShadow = true;
+ });
+ this.apply();
+ done();
+ }, (e: unknown) => console.warn(`raea/r3f: Model ${src} couldn't be loaded: ${String(e)}`));
+ }
+
+ set(p: Props, seconds: number, refinish: Props[]) {
+ place(this.root, p);
+ this.props = p;
+ this.seconds = seconds;
+ this.refinish = refinish;
+ this.apply();
+ }
+
+ private clip(c: string | number | undefined) {
+ return typeof c === "number" ? this.clips[c] : this.clips.find((k) => k.name === c);
+ }
+
+ private apply() {
+ const m = this.model, p = this.props;
+ if (!m || !this.mixer) return;
+ const hide = new Set((p.hide as string[] | undefined) ?? []);
+ m.traverse((o) => {
+ if (o !== m && o.name && (hide.size || o.userData.raeaHidden)) {
+ o.visible = !hide.has(o.name);
+ o.userData.raeaHidden = hide.has(o.name);
+ }
+ });
+ // the clip (or a blend of clips) at its time: `time` seconds, or the composition's time, looping unless told not to
+ this.mixer.stopAllAction();
+ const t = typeof p.time === "number" ? p.time : this.seconds;
+ const loop = p.loop !== false;
+ const play = (c: THREE.AnimationClip | undefined, at: number, weight: number) => {
+ if (!c) return;
+ const a = this.mixer!.clipAction(c);
+ a.play();
+ a.setEffectiveWeight(weight);
+ a.time = loop ? ((at % c.duration) + c.duration) % c.duration : Math.min(at, c.duration);
+ };
+ const blend = p.animations as { clip: string | number; time?: number; weight?: number }[] | undefined;
+ if (blend) for (const b of blend) play(this.clip(b.clip), b.time ?? t, b.weight ?? 1);
+ else if (p.animation !== undefined) play(this.clip(p.animation as string | number), t, 1);
+ this.mixer.update(0);
+ // morph weights by target name or index, on every mesh that has them
+ const morphs = p.morphs as Record<string, number> | number[] | undefined;
+ if (morphs) {
+ m.traverse((o) => {
+ const mesh = o as THREE.Mesh;
+ if (!mesh.morphTargetInfluences) return;
+ if (Array.isArray(morphs)) morphs.forEach((w, i) => { if (i < mesh.morphTargetInfluences!.length) mesh.morphTargetInfluences![i] = w; });
+ else for (const [k, w] of Object.entries(morphs)) {
+ const i = mesh.morphTargetDictionary?.[k];
+ if (i !== undefined) mesh.morphTargetInfluences[i] = w;
+ }
+ });
+ }
+ // re-covered: a material child (or <Refinish>) on every glTF material, or on the one it names
+ if (this.refinish.length) {
+ m.traverse((o) => {
+ const mesh = o as THREE.Mesh;
+ if (!mesh.isMesh) return;
+ const mats = Array.isArray(mesh.material) ? mesh.material : [mesh.material];
+ mats.forEach((mat) => {
+ const spec = this.refinish.find((r) => r.material === mat.name) ?? this.refinish.find((r) => r.material === undefined);
+ if (!spec) return;
+ if (mat.userData.raeaOwn) return paint(mat, spec, true);
+ const own = mat.clone();
+ own.userData.raeaOwn = true;
+ if (Array.isArray(mesh.material)) mesh.material[mesh.material.indexOf(mat)] = own;
+ else mesh.material = own;
+ paint(own, spec, true);
+ });
+ });
+ }
+ }
+
+ dispose() {
+ this.mixer?.stopAllAction();
+ this.root.removeFromParent();
+ }
+}
+
+// ---- a picture on a card (ImagePlane), unlit ----
+export function imagePlane(had: THREE.Mesh | undefined, p: Props): THREE.Mesh {
+ const src = p.src as string;
+ const mat = (had?.material as THREE.MeshBasicMaterial | undefined) ?? new THREE.MeshBasicMaterial({ transparent: true, side: THREE.DoubleSide, toneMapped: false });
+ const mesh = had ?? new THREE.Mesh(new THREE.PlaneGeometry(1, 1), mat);
+ const base = texture(src, true);
+ const grid = p.grid as [number, number] | undefined;
+ let map = base;
+ if (grid) {
+ map = base.clone();
+ map.source = base.source;
+ const n = grid[0] * grid[1];
+ const cell = ((Math.round((p.frame as number) ?? 0) % n) + n) % n;
+ map.repeat.set(1 / grid[0], 1 / grid[1]);
+ map.offset.set((cell % grid[0]) / grid[0], 1 - (Math.floor(cell / grid[0]) + 1) / grid[1]);
+ map.needsUpdate = true;
+ }
+ if (mat.map !== map) mat.map = map;
+ if (p.cutout) {
+ mat.alphaTest = 0.5;
+ mat.transparent = false;
+ }
+ // its height follows the picture (one cell's) unless given
+ const w = (p.width as number) ?? 1;
+ const img = base.image as { width?: number; height?: number } | undefined;
+ const aspect = img?.width && img.height ? (img.height * (grid ? grid[0] : 1)) / (img.width * (grid ? grid[1] : 1)) : 1;
+ const h = (p.height as number) ?? w * aspect;
+ mesh.geometry.dispose();
+ mesh.geometry = new THREE.PlaneGeometry(w, h);
+ mesh.castShadow = p.shadow !== false;
+ place(mesh, p);
+ mat.needsUpdate = true;
+ return mesh;
+}
+
+// ---- instanced copies: `at` packs 9 numbers a copy (position, rotation XYZ, scale) ----
+export function instanced(had: THREE.InstancedMesh | undefined, geometry: THREE.BufferGeometry, material: THREE.Material, at: number[]): THREE.InstancedMesh {
+ const n = Math.floor(at.length / 9);
+ const m = had && had.count === n ? had : new THREE.InstancedMesh(geometry, material, n);
+ m.geometry = geometry;
+ m.material = material;
+ const o = new THREE.Object3D();
+ for (let i = 0; i < n; i++) {
+ const k = i * 9;
+ o.position.set(at[k], at[k + 1], at[k + 2]);
+ o.rotation.set(at[k + 3], at[k + 4], at[k + 5], "XYZ");
+ o.scale.set(at[k + 6], at[k + 7], at[k + 8]);
+ o.updateMatrix();
+ m.setMatrixAt(i, o.matrix);
+ }
+ m.instanceMatrix.needsUpdate = true;
+ m.castShadow = m.receiveShadow = true;
+ return m;
+}
+
+// ---- a Gizmo (an Entity with Bevy's retained gizmo component): its lines ----
+export function gizmoLines(value: Props): THREE.Group {
+ const handle = (value.handle ?? {}) as { list_positions?: number[][]; strip_positions?: (number[] | null)[]; color?: string; list_colors?: string[]; strip_colors?: string[] };
+ const g = new THREE.Group();
+ const depthTest = ((value.depth_bias as number) ?? 0) > -1;
+ const line = (pts: number[][], colours: string[] | undefined, segments: boolean) => {
+ const geo = new THREE.BufferGeometry().setFromPoints(pts.map((p) => new THREE.Vector3(...p)));
+ if (colours) geo.setAttribute("color", new THREE.Float32BufferAttribute(colours.flatMap((c) => new THREE.Color(c).toArray()), 3));
+ const mat = new THREE.LineBasicMaterial({ color: colours ? "#ffffff" : handle.color ?? "#ffffff", vertexColors: !!colours, depthTest });
+ g.add(segments ? new THREE.LineSegments(geo, mat) : new THREE.Line(geo, mat));
+ };
+ if (handle.list_positions?.length) line(handle.list_positions, handle.list_colors, true);
+ // a strip broken at each null
+ let run: number[][] = [], cs: string[] = [];
+ (handle.strip_positions ?? []).forEach((p, i) => {
+ if (p === null) {
+ if (run.length > 1) line(run, handle.strip_colors ? cs : undefined, false);
+ run = [];
+ cs = [];
+ } else {
+ run.push(p);
+ if (handle.strip_colors) cs.push(handle.strip_colors[i]);
+ }
+ });
+ if (run.length > 1) line(run, handle.strip_colors ? cs : undefined, false);
+ return g;
+}
+
+// ---- a Decal: a card lying on the surface at its place, facing out along `normal` ----
+export function decal(had: THREE.Mesh | undefined, p: Props): THREE.Mesh {
+ const mat = (had?.material as THREE.MeshStandardMaterial | undefined) ?? new THREE.MeshStandardMaterial({ transparent: true, polygonOffset: true, polygonOffsetFactor: -4, depthWrite: false });
+ const size = p.size;
+ const [w, h] = Array.isArray(size) ? size : [(size as number) ?? 1, (size as number) ?? 1];
+ const mesh = had ?? new THREE.Mesh(new THREE.PlaneGeometry(1, 1), mat);
+ mesh.geometry.dispose();
+ mesh.geometry = new THREE.PlaneGeometry(w, h);
+ paint(mat, { map: p.src, normalMap: p.normalMap, color: p.color ?? "#ffffff", opacity: p.opacity ?? 1, roughness: p.roughness ?? 0.6, metalness: p.metalness ?? 0, transparent: true });
+ const n = new THREE.Vector3(...(vec(p.normal) ?? [0, 0, 1])).normalize();
+ mesh.position.set(...(vec(p.position) ?? [0, 0, 0]));
+ mesh.quaternion.setFromUnitVectors(new THREE.Vector3(0, 0, 1), n).multiply(new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 0, 1), (p.spin as number) ?? 0));
+ return mesh;
+}
diff --git a/sdk/r3f/src/units.ts b/sdk/r3f/src/units.ts
new file mode 100644
index 00000000..7005fc42
--- /dev/null
+++ b/sdk/r3f/src/units.ts
@@ -0,0 +1,42 @@
+// Light in raea's units and in three.js's, both ways. The SDK's lights take an intensity of 1 as a sun of 8000 lux, a
+// bulb of 900,000 lumens and an ambient of 400 cd/m² (core/scene/src/props.rs), and Bevy draws them through the camera's
+// exposure, EV100 9.7 by default. three.js lights are in its physical units with no exposure (React Three Fiber's
+// default since v8), so a three light is what Bevy puts on screen: lux and candela (lumens over 4π) times the exposure,
+// and ambient times π (three's ambient is irradiance, lit by the Lambert 1/π; Bevy's is the radiance itself). The
+// playable host's parity check measured this mapping (docs/playables.feature PA9).
+export const LUX = 8000;
+export const LUMENS = 9.0e5;
+export const AMBIENT = 400;
+/** Bevy's default exposure, EV100 9.7, as a multiplier */
+export const EXPOSURE = 1 / (1.2 * 2 ** 9.7);
+
+export type LightKind = "DirectionalLight" | "PointLight" | "SpotLight" | "AmbientLight" | "HemisphereLight" | "RectAreaLight";
+
+/** a raea light's intensity as three.js's for the same light on screen */
+export function toThree(kind: LightKind, raea: number, area = 1): number {
+ switch (kind) {
+ case "DirectionalLight": return raea * LUX * EXPOSURE;
+ case "PointLight":
+ case "SpotLight": return (raea * LUMENS * EXPOSURE) / (4 * Math.PI);
+ // three's RectAreaLight is luminance (nits) over its face: its flux is intensity × area × π
+ case "RectAreaLight": return (raea * LUMENS * EXPOSURE) / (Math.PI * area);
+ default: return raea * AMBIENT * EXPOSURE * Math.PI;
+ }
+}
+
+/** a three.js light's intensity as raea's (toThree's inverse) */
+export function toRaea(kind: LightKind, three: number, area = 1): number {
+ return three / toThree(kind, 1, area);
+}
+
+/** three's tone mapping exposure (a multiplier) as raea's ToneMapping exposure (stops) */
+export const stopsOf = (multiplier: number) => (multiplier > 0 ? Math.log2(multiplier) : 0);
+
+/** a light's props as raea's relative intensity: a Bevy light's own `lux` (directional), `lumens` (point, spot, rect) or
+ * `nits` (ambient) over the scale above, else its 3d.tsx `intensity` (docs/control.feature FC1f) */
+export function relativeOf(kind: string, p: Record<string, unknown>): number {
+ const [field, k] = kind === "DirectionalLight" ? ["lux", LUX] : kind === "AmbientLight" || kind === "HemisphereLight" ? ["nits", AMBIENT] : ["lumens", LUMENS];
+ const own = p[field as string];
+ if (typeof own === "number") return own / (k as number);
+ return typeof p.intensity === "number" ? p.intensity : 1;
+}
diff --git a/sdk/r3f/test/coverage.test.tsx b/sdk/r3f/test/coverage.test.tsx
new file mode 100644
index 00000000..07f29c98
--- /dev/null
+++ b/sdk/r3f/test/coverage.test.tsx
@@ -0,0 +1,111 @@
+// The coverage, measured (docs/r3f.feature R3F7): every kind raea's SDK renders has a row in the three host's table and
+// is drawn by it (or named as an effect or engine-only); every three.js class an R3F scene can hold has a row in the
+// input's table and is read by the input.
+import { describe, expect, test } from "bun:test";
+import { readdirSync, readFileSync, statSync } from "node:fs";
+import { join, resolve } from "node:path";
+import * as THREE from "three";
+import { KINDS } from "../src/three/kinds";
+import { DRAWN_EFFECTS } from "../src/three/effects";
+import { CLASSES } from "../src/input/kinds";
+import { Scene3d } from "../src/three/scene";
+import { parse } from "./dom";
+import { standInImages } from "../src/input/texture";
+
+// no DOM here: pictures are stand-ins carrying their url, as in a native render
+standInImages();
+
+const SDK = resolve(import.meta.dir, "../..");
+
+/** every kind the SDK's components can render: node3d("Kind"), lensNode("Kind"), data-3d="Kind", geometry("Kind") */
+function sdkKinds(): Set<string> {
+ const out = new Set<string>();
+ const walk = (d: string) => {
+ for (const f of readdirSync(d)) {
+ const p = join(d, f);
+ if (f === "node_modules" || f === "test" || f === "tests" || f === "conformance" || f === "bench") continue;
+ if (statSync(p).isDirectory()) walk(p);
+ else if (/\.(tsx?|ts)$/.test(f)) {
+ const src = readFileSync(p, "utf8");
+ for (const m of src.matchAll(/(?:node3d|lensNode)\("([A-Z][A-Za-z0-9]+)"|data-3d="([A-Z][A-Za-z0-9]+)"|geometry<[A-Za-z0-9 &{}?:[\],]+>\("([A-Z][A-Za-z0-9]+)"/g)) out.add(m[1] ?? m[2] ?? m[3]);
+ }
+ }
+ };
+ for (const pkg of ["render", "raea", "physics", "character", "room", "video", "app"]) walk(join(SDK, pkg, "src"));
+ // the kinds named through a variable: the toon material (node3d(owner)) and motion blur (node3d(owner))
+ for (const k of ["MeshToonMaterial", "MotionBlur"]) out.add(k);
+ return out;
+}
+
+describe("raea → three.js coverage", () => {
+ const kinds = sdkKinds();
+
+ test("the SDK's kinds were found (the scan works)", () => {
+ for (const k of ["Mesh", "MeshStandardMaterial", "DirectionalLight", "Model", "Bloom", "Splat", "Grass", "Fisheye"]) expect(kinds.has(k), k).toBe(true);
+ expect(kinds.size).toBeGreaterThan(50);
+ });
+
+ test("every kind raea renders has a row in three/kinds.ts", () => {
+ const missing = [...kinds].filter((k) => !(k in KINDS));
+ expect(missing).toEqual([]);
+ });
+
+ test("every kind the host draws is drawn without a warning", () => {
+ const warned: string[] = [];
+ const warn = console.warn;
+ console.warn = (m: string) => warned.push(String(m));
+ try {
+ for (const [kind, row] of Object.entries(KINDS)) {
+ if (row.status === "effect" || row.status === "engine") continue;
+ const host = new Scene3d();
+ const props = SAMPLE[kind] ?? {};
+ const inner = INSIDE[kind];
+ const html = inner ? inner(kind, props) : `<div data-3d="${kind}" data-props="${esc(JSON.stringify(props))}"></div>`;
+ host.sync(parse(html) as unknown as Element);
+ const drawnBy = warned.filter((w) => w.includes(kind) && /isn't a kind|runs in raea's engine/.test(w));
+ expect(drawnBy, kind).toEqual([]);
+ }
+ } finally {
+ console.warn = warn;
+ }
+ });
+
+ test("effects are listed for the app's composer, engine kinds named", () => {
+ const host = new Scene3d();
+ host.sync(parse(`<div data-3d="Bloom" data-props="${esc(JSON.stringify({ intensity: 0.3 }))}"></div><div data-3d="Fisheye" data-props="{}"></div>`) as unknown as Element);
+ expect(host.effects.map((e) => e.kind)).toEqual(["Bloom", "Fisheye"]);
+ expect(host.effects[0].props).toEqual({ intensity: 0.3 });
+ });
+
+ test("every effect row is one the composer draws", () => {
+ const effects = Object.entries(KINDS).filter(([, r]) => r.status === "effect").map(([k]) => k).sort();
+ expect(effects).toEqual([...DRAWN_EFFECTS].sort());
+ });
+});
+
+const esc = (s: string) => s.replace(/&/g, "&amp;").replace(/"/g, "&quot;");
+const div = (kind: string, props: object, inner = "", shape?: string) => `<div data-3d="${kind}" data-props="${esc(JSON.stringify(props))}"${shape ? ` data-shape="${esc(shape)}"` : ""}>${inner}</div>`;
+
+/** props a kind needs to be drawn at all */
+const SAMPLE: Record<string, object> = {
+ ImagePlane: { src: "x.png" }, Decal: { src: "x.png" }, Model: { src: "x.glb" }, Environment: { src: "sky.hdr" },
+ Plate: { src: "x.mp4" }, Splat: { src: "x.ply" }, Sprite: { src: "x.png" }, Refinish: { materials: [{ color: "#ff0000" }] },
+ Grass: { spec: { area: [0, 0, 1, 1], grid: [2, 2], height: [0, 0, 0, 0], density: [10, 10, 10, 10] } },
+};
+/** kinds that live inside another part */
+const INSIDE: Record<string, (kind: string, props: object) => string> = {
+ ...Object.fromEntries(["Box", "Sphere", "Plane", "Cylinder", "Cone", "Torus", "Capsule", "BufferMesh", "Text3D", "MeshStandardMaterial", "MeshPhysicalMaterial", "MeshBasicMaterial", "MeshToonMaterial"].map((k) => [k, (kind: string, props: object) => div("Mesh", {}, div(kind, props))])),
+};
+
+describe("R3F → raea coverage", () => {
+ const classes = Object.entries(THREE).filter(([, v]) => typeof v === "function" && v.prototype && (v.prototype instanceof THREE.Object3D || v === THREE.Object3D || v.prototype instanceof THREE.Material || v === THREE.Material));
+
+ test("three's scene classes were found (the scan works)", () => {
+ expect(classes.map(([k]) => k)).toEqual(expect.arrayContaining(["Mesh", "Points", "SpotLight", "MeshPhysicalMaterial", "BatchedMesh"]));
+ });
+
+ test("every Object3D and Material class in three has a row in input/kinds.ts", () => {
+ const missing = classes.map(([k]) => k).filter((k) => !(k in CLASSES));
+ expect(missing).toEqual([]);
+ });
+});
diff --git a/sdk/r3f/test/dom.tsx b/sdk/r3f/test/dom.tsx
new file mode 100644
index 00000000..24f7c7d1
--- /dev/null
+++ b/sdk/r3f/test/dom.tsx
@@ -0,0 +1,86 @@
+// Just enough DOM for the three.js host in a test: raea's components rendered to HTML (react-dom/server) and parsed
+// into elements Scene3d reads (querySelectorAll, closest, children, attributes, inline style).
+import type { ReactNode } from "react";
+import { renderToStaticMarkup } from "react-dom/server";
+import { Clock } from "@raea/app/clock";
+
+const ENTITY: Record<string, string> = { quot: '"', amp: "&", lt: "<", gt: ">", apos: "'", "#x27": "'", "#39": "'" };
+const decode = (s: string) => s.replace(/&(#x?[0-9a-f]+|[a-z]+);/gi, (m, e: string) => ENTITY[e.toLowerCase()] ?? (e.startsWith("#x") ? String.fromCodePoint(parseInt(e.slice(2), 16)) : e.startsWith("#") ? String.fromCodePoint(Number(e.slice(1))) : m));
+
+export class El {
+ attrs = new Map<string, string>();
+ kids: El[] = [];
+ parentElement: El | null = null;
+ isConnected = false;
+ style: Record<string, string> = {};
+ constructor(public tagName: string) {}
+ getAttribute(k: string) { return this.attrs.get(k) ?? null; }
+ hasAttribute(k: string) { return this.attrs.has(k); }
+ setAttribute(k: string, v: string) { this.attrs.set(k, v); }
+ get children() { return this.kids; }
+ private matches(sel: string): boolean {
+ // [data-3d], [data-3d="Kind"], [data-3d$='Material']
+ const m = /^\[([\w-]+)(?:([$^]?=)["']([^"']*)["'])?\]$/.exec(sel.trim());
+ if (!m) throw new Error(`fake DOM: selector ${sel}`);
+ const v = this.attrs.get(m[1]);
+ if (v === undefined) return false;
+ if (!m[2]) return true;
+ return m[2] === "=" ? v === m[3] : m[2] === "$=" ? v.endsWith(m[3]) : v.startsWith(m[3]);
+ }
+ querySelectorAll(sel: string): El[] {
+ const scope = sel.startsWith(":scope > ");
+ const s = scope ? sel.slice(9) : sel;
+ const out: El[] = [];
+ const walk = (e: El) => {
+ for (const k of e.kids) {
+ if (k.matches(s)) out.push(k);
+ if (!scope) walk(k);
+ }
+ };
+ walk(this);
+ return out;
+ }
+ querySelector(sel: string) { return this.querySelectorAll(sel)[0] ?? null; }
+ closest(sel: string): El | null {
+ for (let e: El | null = this; e; e = e.parentElement) if (e.matches(sel)) return e;
+ return null;
+ }
+}
+
+/** HTML (react-dom/server's: well formed, quoted attributes) as elements under a root */
+export function parse(html: string): El {
+ const root = new El("root");
+ let at = root;
+ const tag = /<(\/?)([a-zA-Z0-9]+)((?:\s+[\w-]+(?:="[^"]*")?)*)\s*(\/?)>/g;
+ let m: RegExpExecArray | null;
+ while ((m = tag.exec(html))) {
+ if (m[1]) {
+ at = at.parentElement ?? root;
+ continue;
+ }
+ const e = new El(m[2]);
+ for (const a of m[3].matchAll(/([\w-]+)(?:="([^"]*)")?/g)) {
+ const v = decode(a[2] ?? "");
+ e.attrs.set(a[1], v);
+ if (a[1] === "style") for (const d of v.split(";")) {
+ const [k, ...rest] = d.split(":");
+ if (k?.trim()) e.style[k.trim().replace(/-(\w)/g, (_x, c: string) => c.toUpperCase())] = rest.join(":").trim();
+ }
+ }
+ e.parentElement = at === root ? null : at;
+ at.kids.push(e);
+ const voids = /^(img|br|hr|input|meta|link)$/i.test(m[2]);
+ if (!m[4] && !voids) at = e;
+ }
+ return root;
+}
+
+/** a raea tree rendered at a frame, as the elements a host reads */
+export function page(node: ReactNode, frame = 0, size: [number, number] = [640, 360], fps = 24): El {
+ const html = renderToStaticMarkup(
+ <Clock frame={frame} fps={fps} width={size[0]} height={size[1]} durationInFrames={Math.max(1, frame + 1)}>
+ {node}
+ </Clock>,
+ );
+ return parse(html);
+}
diff --git a/sdk/r3f/test/esm.ts b/sdk/r3f/test/esm.ts
new file mode 100644
index 00000000..65ce9230
--- /dev/null
+++ b/sdk/r3f/test/esm.ts
@@ -0,0 +1,15 @@
+// bun reads @react-three/fiber's `main` (its CommonJS build), which requires three's CommonJS build: a second three
+// beside the ES one, whose classes R3F's checks (instanceof THREE.Color) then don't know. raea's bundler takes R3F's
+// `module` (ES) build, as Vite does; here the CommonJS file is loaded as the ES build's source, so the tests do too.
+import { plugin } from "bun";
+import { readFileSync } from "node:fs";
+
+plugin({
+ name: "r3f-es",
+ setup(b) {
+ b.onLoad({ filter: /@react-three\/fiber\/dist\/react-three-fiber\.cjs\.js$/ }, (a) => ({
+ contents: readFileSync(a.path.replace(/\.cjs\.js$/, ".esm.js"), "utf8"),
+ loader: "js",
+ }));
+ },
+});
diff --git a/sdk/r3f/test/input.test.tsx b/sdk/r3f/test/input.test.tsx
new file mode 100644
index 00000000..79e72e16
--- /dev/null
+++ b/sdk/r3f/test/input.test.tsx
@@ -0,0 +1,181 @@
+// R3F as raea's input (docs/r3f.feature R3F1-R3F3): the clock, the scene graph's harder parts, textures and units.
+import { describe, expect, test } from "bun:test";
+import { useFrame } from "@react-three/fiber";
+import { createContext, useContext, useRef } from "react";
+import { renderToStaticMarkup } from "react-dom/server";
+import * as THREE from "three";
+import { Clock, useCurrentFrame } from "@raea/app/clock";
+import { convert } from "../src/input/scene";
+import { end, stepTo } from "../src/input/session";
+import { pngOf, srcOf } from "../src/input/texture";
+import { roughnessOfShininess } from "../src/input/material";
+import { FiberOf, useBridge } from "../src/input/bridge";
+import { EXPOSURE, relativeOf, toRaea, toThree } from "../src/units";
+import type { Part } from "../src/parts";
+import type { ReactNode } from "react";
+
+const flat = (parts: Part[]): Part[] => parts.flatMap((p) => [p, ...flat(p.children ?? [])]);
+let n = 0;
+function partsOf(scene: (i: number) => ReactNode, frame = 0, config = {}) {
+ const key = `t${n++}`;
+ const s = stepTo(key, frame, 24, 640, 360, config, scene);
+ const st = s.state as unknown as { scene: THREE.Scene; camera: THREE.Camera; gl: THREE.WebGLRenderer };
+ const out = convert(st.scene, st.camera, st.gl, 360);
+ return { ...out, key, st, s };
+}
+
+describe("units", () => {
+ test("raea's units and three's are each other's inverse, and Bevy's exposure", () => {
+ expect(EXPOSURE).toBeCloseTo(1 / (1.2 * 2 ** 9.7), 12);
+ for (const k of ["DirectionalLight", "PointLight", "SpotLight", "AmbientLight", "RectAreaLight"] as const) expect(toRaea(k, toThree(k, 3.7, 2), 2)).toBeCloseTo(3.7, 9);
+ // a sun of raea's 1 (8000 lux at EV 9.7) is three's 8000 / (1.2 · 2^9.7)
+ expect(toThree("DirectionalLight", 1)).toBeCloseTo(8000 * EXPOSURE, 9);
+ // raea/light's Bevy-shaped lights carry their own units: lux, lumens, nits
+ expect(relativeOf("DirectionalLight", { lux: 16000, intensity: 1 })).toBe(2);
+ expect(relativeOf("PointLight", { lumens: 450000 })).toBe(0.5);
+ expect(relativeOf("AmbientLight", { nits: 800 })).toBe(2);
+ expect(relativeOf("SpotLight", { intensity: 3 })).toBe(3);
+ });
+ test("Phong's shininess as a roughness: glossy is smooth, matte is rough", () => {
+ expect(roughnessOfShininess(30)).toBeCloseTo(Math.sqrt(Math.sqrt(2 / 32)), 9);
+ expect(roughnessOfShininess(1000)).toBeLessThan(0.25);
+ expect(roughnessOfShininess(0)).toBe(1);
+ });
+});
+
+function Spin() {
+ const ref = useRef<THREE.Mesh>(null!);
+ useFrame((_s, dt) => { ref.current.rotation.y += dt; });
+ return <mesh ref={ref} name="spin"><boxGeometry /><meshBasicMaterial /></mesh>;
+}
+
+describe("the clock", () => {
+ test("useFrame steps 1/fps a frame, and a seek back gives the same frame", () => {
+ const key = "clock";
+ const ry = (f: number) => {
+ const s = stepTo(key, f, 24, 640, 360, {}, () => <Spin />);
+ return (s.state.scene.getObjectByName("spin") as THREE.Mesh).rotation.y;
+ };
+ expect(ry(0)).toBeCloseTo(0, 9);
+ expect(ry(24)).toBeCloseTo(1, 9);
+ expect(ry(48)).toBeCloseTo(2, 9);
+ // backwards: started again from 0 and stepped, the same as before
+ expect(ry(24)).toBeCloseTo(1, 9);
+ end(key);
+ });
+
+ test("raea's own hooks work inside the R3F scene (the context bridge), at each stepped frame", () => {
+ const Theme = createContext("none");
+ let seen: string[] = [];
+ function Reader() {
+ const f = useCurrentFrame();
+ seen.push(`${useContext(Theme)}@${f}`);
+ return null;
+ }
+ function Outer() {
+ return (
+ <FiberOf>
+ {(fiber) => {
+ const Inner = () => {
+ const bridge = useBridge(fiber);
+ seen = [];
+ stepTo("bridge", 2, 24, 64, 64, {}, (i) => bridge(<Clock frame={i} fps={24} width={64} height={64} durationInFrames={10}><Reader /></Clock>));
+ return null;
+ };
+ return <Inner />;
+ }}
+ </FiberOf>
+ );
+ }
+ renderToStaticMarkup(<Theme value="dark"><Outer /></Theme>);
+ expect(seen).toEqual(["dark@0", "dark@1", "dark@2"]);
+ end("bridge");
+ });
+});
+
+describe("the scene graph", () => {
+ test("an InstancedMesh holding still is Instances; moving, a mesh a copy", () => {
+ const geo = new THREE.BoxGeometry(), mat = new THREE.MeshStandardMaterial({ color: "#336699" });
+ const im = new THREE.InstancedMesh(geo, mat, 3);
+ const m = new THREE.Matrix4();
+ for (let i = 0; i < 3; i++) im.setMatrixAt(i, m.makeTranslation(i * 2, 0, 0));
+ const a = partsOf(() => <primitive object={im} />);
+ const inst = flat(a.parts).find((p) => p.type === "Instances")!;
+ expect((inst.props.at as unknown[]).length).toBe(3);
+ expect((inst.props.at as { position: number[] }[])[2].position).toEqual([4, 0, 0]);
+ im.setMatrixAt(1, m.makeTranslation(0, 5, 0));
+ im.instanceMatrix.needsUpdate = true;
+ const b = convert(a.st.scene, a.st.camera, a.st.gl, 360);
+ const meshes = flat(b.parts).filter((p) => p.type === "Mesh");
+ expect(meshes.length).toBe(3);
+ expect(meshes[1].props.position).toEqual([0, 5, 0]);
+ end(a.key);
+ });
+
+ test("Points are quads facing the camera with three's size, lines are gizmo lines, a sprite a quad", () => {
+ const pts = new THREE.BufferGeometry().setAttribute("position", new THREE.Float32BufferAttribute([0, 0, 0, 1, 0, 0], 3));
+ const line = new THREE.BufferGeometry().setFromPoints([new THREE.Vector3(0, 0, 0), new THREE.Vector3(0, 1, 0), new THREE.Vector3(1, 1, 0)]);
+ const r = partsOf(() => (
+ <>
+ <points geometry={pts}><pointsMaterial size={0.2} color="#ff0000" /></points>
+ <lineSegments geometry={line}><lineBasicMaterial color="#00ff00" /></lineSegments>
+ <primitive object={new THREE.Line(line, new THREE.LineBasicMaterial({ color: "#0000ff" }))} position={[0, 0, 1]} />
+ <sprite position={[0, 2, 0]} scale={[2, 1, 1]}><spriteMaterial color="#ffffff" /></sprite>
+ </>
+ ), 0, { camera: { position: [0, 0, 5], fov: 50 } });
+ const all = flat(r.parts);
+ const quads = all.find((p) => p.type === "Mesh" && (p.children![0].props.positions as number[]).length === 24)!;
+ expect(quads).toBeDefined();
+ const pos = quads.children![0].props.positions as number[];
+ // with attenuation, a point is size · tan(fov/2) across
+ expect(pos[3] - pos[0]).toBeCloseTo(0.2 * Math.tan((50 * Math.PI) / 360), 6);
+ const gizmos = all.filter((p) => p.type === "Gizmo");
+ expect(gizmos[0].props.lines).toEqual([[[0, 0, 0], [0, 1, 0]]]);
+ expect(gizmos[1].props.strip).toEqual([[0, 0, 1], [0, 1, 1], [1, 1, 1]]);
+ expect(gizmos[1].props.color).toBe("#0000ff");
+ const sprite = all.find((p) => p.type === "Mesh" && (p.children![0].props.positions as number[]).length === 12)!;
+ expect(sprite.props.position).toEqual([0, 2, 0]);
+ expect(sprite.props.scale).toEqual([2, 1, 1]);
+ end(r.key);
+ });
+
+ test("a skinned mesh is posed on the CPU: its vertices follow its bones", () => {
+ const geo = new THREE.BufferGeometry();
+ geo.setAttribute("position", new THREE.Float32BufferAttribute([0, 0, 0, 1, 0, 0, 0, 1, 0], 3));
+ geo.setAttribute("skinIndex", new THREE.Uint16BufferAttribute([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 4));
+ geo.setAttribute("skinWeight", new THREE.Float32BufferAttribute([1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0], 4));
+ geo.computeVertexNormals();
+ const bone = new THREE.Bone();
+ const mesh = new THREE.SkinnedMesh(geo, new THREE.MeshStandardMaterial());
+ mesh.add(bone);
+ mesh.bind(new THREE.Skeleton([bone]));
+ bone.position.set(0, 3, 0);
+ const r = partsOf(() => <primitive object={mesh} />);
+ const b = flat(r.parts).find((p) => p.type === "BufferMesh")!;
+ expect((b.props.positions as number[]).slice(0, 3).map((x) => Math.round(x * 1e6) / 1e6)).toEqual([0, 3, 0]);
+ end(r.key);
+ });
+
+ test("a multi-material mesh is a mesh per geometry group", () => {
+ const geo = new THREE.BoxGeometry();
+ const r = partsOf(() => <mesh geometry={geo} material={[0, 1, 2, 3, 4, 5].map((i) => new THREE.MeshBasicMaterial({ color: i % 2 ? "#ff0000" : "#0000ff" }))} />);
+ const meshes = flat(r.parts).filter((p) => p.type === "Mesh");
+ expect(meshes.length).toBe(6);
+ expect(meshes.map((m) => (m.children![0].props.indices as number[]).length)).toEqual([6, 6, 6, 6, 6, 6]);
+ end(r.key);
+ });
+});
+
+describe("textures", () => {
+ test("a DataTexture is a PNG raea loads; a loaded picture keeps its url", () => {
+ const t = new THREE.DataTexture(new Uint8Array([255, 0, 0, 255, 0, 255, 0, 255]), 2, 1);
+ t.needsUpdate = true;
+ const src = srcOf(t)!;
+ expect(src.startsWith("data:image/png;base64,")).toBe(true);
+ const bytes = Uint8Array.from(atob(src.split(",")[1]), (c) => c.charCodeAt(0));
+ expect([...bytes.subarray(0, 8)]).toEqual([137, 80, 78, 71, 13, 10, 26, 10]);
+ const img = new THREE.Texture({ src: "media/wood.jpg", width: 4, height: 4 } as unknown as HTMLImageElement);
+ expect(srcOf(img)).toBe("media/wood.jpg");
+ expect(pngOf(new Uint8Array(4), 1, 1).length).toBeGreaterThan(40);
+ });
+});
diff --git a/sdk/r3f/test/parity/fixtures.tsx b/sdk/r3f/test/parity/fixtures.tsx
new file mode 100644
index 00000000..7828972a
--- /dev/null
+++ b/sdk/r3f/test/parity/fixtures.tsx
@@ -0,0 +1,217 @@
+// The parity cases (docs/r3f.feature R3F8): each drawn by raea's engine (native.tsx, `raea render`) and by three.js in
+// Chrome (the harness page), and the two compared by SSIM (tools/parity.sh). `in-*` are R3F scenes, raea's input;
+// `out-*` are raea compositions, drawn in React Three Fiber by <Raea>.
+import { useFrame } from "@react-three/fiber";
+import { useRef, type ReactNode } from "react";
+import * as THREE from "three";
+import { useCurrentFrame } from "raea";
+import {
+ AmbientLight, Bloom, Cuboid, Grade, LensDistortion, DirectionalLight, Fog, Group, Mesh, MeshBasicMaterial, MeshPhysicalMaterial, MeshStandardMaterial,
+ PerspectiveCamera, PointLight, RectAreaLight, Sphere, SpotLight, Text3D, ToneMapping, Torus,
+} from "raea/3d";
+import { AbsoluteFill } from "raea";
+
+export const SIZE = { width: 640, height: 360, fps: 24 };
+
+// ---- R3F scenes ----
+function Spinner() {
+ const ref = useRef<THREE.Mesh>(null!);
+ useFrame((_s, dt) => {
+ ref.current.rotation.y += dt;
+ ref.current.rotation.x += dt * 0.5;
+ });
+ return (
+ <mesh ref={ref} position={[0, 0.8, 0]} castShadow receiveShadow>
+ <boxGeometry args={[1, 1, 1]} />
+ <meshStandardMaterial color="#e05a2b" roughness={0.4} />
+ </mesh>
+ );
+}
+
+const ground = (
+ <mesh rotation={[-Math.PI / 2, 0, 0]} receiveShadow>
+ <planeGeometry args={[12, 12]} />
+ <meshStandardMaterial color="#cfd6e0" roughness={0.9} />
+ </mesh>
+);
+
+const instanced = (() => {
+ const m = new THREE.InstancedMesh(new THREE.SphereGeometry(0.18, 24, 12), new THREE.MeshStandardMaterial({ color: "#f2cc60", roughness: 0.3 }), 9);
+ const o = new THREE.Object3D();
+ for (let i = 0; i < 9; i++) {
+ o.position.set(-2 + (i % 3) * 0.5, 0.2, 1 + Math.floor(i / 3) * 0.5);
+ o.updateMatrix();
+ m.setMatrixAt(i, o.matrix);
+ }
+ m.castShadow = true;
+ return m;
+})();
+
+export interface InputCase {
+ canvas: Record<string, unknown>;
+ scene: () => ReactNode;
+ frame: number;
+}
+
+export const INPUTS: Record<string, InputCase> = {
+ basic: {
+ canvas: { camera: { position: [3, 2.5, 4], fov: 45 }, shadows: true },
+ frame: 24,
+ scene: () => (
+ <>
+ <color attach="background" args={["#1d2330"]} />
+ <ambientLight intensity={0.4} />
+ <directionalLight position={[3, 5, 2]} intensity={2.5} castShadow />
+ <pointLight position={[-2, 1.5, 1]} intensity={6} color="#58a6ff" />
+ <Spinner />
+ {ground}
+ <mesh position={[-1.6, 0.5, -0.5]} castShadow>
+ <sphereGeometry args={[0.5, 48, 24]} />
+ <meshPhysicalMaterial color="#3fb950" clearcoat={1} roughness={0.2} />
+ </mesh>
+ <mesh position={[1.6, 0.6, -0.4]} castShadow>
+ <torusKnotGeometry args={[0.35, 0.12, 128, 16]} />
+ <meshStandardMaterial color="#d2a8ff" metalness={0.7} roughness={0.25} />
+ </mesh>
+ </>
+ ),
+ },
+ lights: {
+ canvas: { camera: { position: [0, 3, 6], fov: 50 }, shadows: true },
+ frame: 0,
+ scene: () => (
+ <>
+ <color attach="background" args={["#0b0e14"]} />
+ <fog attach="fog" args={["#0b0e14", 6, 14]} />
+ <spotLight position={[0, 4, 1]} angle={0.6} penumbra={0.4} intensity={40} castShadow />
+ <hemisphereLight args={["#bcd3ff", "#3a2a1a", 0.6]} />
+ <rectAreaLight position={[-2, 1, 2]} width={1.5} height={1} intensity={6} color="#ff6040" onUpdate={(l) => l.lookAt(0, 0.5, 0)} />
+ {ground}
+ <mesh position={[0, 0.6, 0]} castShadow>
+ <cylinderGeometry args={[0.4, 0.6, 1.2, 48]} />
+ <meshLambertMaterial color="#e6e6e6" />
+ </mesh>
+ <mesh position={[1.5, 0.5, 0.5]} castShadow>
+ <icosahedronGeometry args={[0.5, 1]} />
+ <meshPhongMaterial color="#4ea1ff" shininess={60} flatShading />
+ </mesh>
+ </>
+ ),
+ },
+ things: {
+ canvas: { camera: { position: [0, 2.2, 5], fov: 45 }, shadows: true },
+ frame: 0,
+ scene: () => (
+ <>
+ <color attach="background" args={["#202830"]} />
+ <ambientLight intensity={0.5} />
+ <directionalLight position={[2, 4, 3]} intensity={2} castShadow />
+ {ground}
+ <primitive object={instanced} />
+ <mesh position={[0.6, 0.5, 0]} castShadow>
+ <boxGeometry args={[0.8, 0.8, 0.8]} />
+ {["#e05a2b", "#3fb950", "#58a6ff", "#d2a8ff", "#f2cc60", "#ffffff"].map((c, i) => <meshStandardMaterial key={i} attach={`material-${i}`} color={c} />)}
+ </mesh>
+ <lineSegments position={[2, 0.01, 0]}>
+ <edgesGeometry args={[new THREE.BoxGeometry(1, 1, 1)]} />
+ <lineBasicMaterial color="#ffffff" />
+ </lineSegments>
+ <sprite position={[-0.8, 1.6, 0]} scale={[0.6, 0.6, 1]}>
+ <spriteMaterial color="#ff4fa3" />
+ </sprite>
+ </>
+ ),
+ },
+};
+
+// ---- raea compositions ----
+function OutBasic() {
+ const f = useCurrentFrame();
+ return (
+ <AbsoluteFill style={{ background: "#1d2330" }}>
+ <PerspectiveCamera position={[3, 2.5, 4]} lookAt={[0, 0.5, 0]} fov={45} />
+ <ToneMapping mode="aces" />
+ <AmbientLight intensity={0.4} />
+ <DirectionalLight position={[3, 5, 2]} target={[0, 0, 0]} intensity={2.5} />
+ <PointLight position={[-2, 1.5, 1]} intensity={6} color="#58a6ff" />
+ <Mesh name="ground" rotation={[-Math.PI / 2, 0, 0]}>
+ <Cuboid args={[12, 12, 0.001]} />
+ <MeshStandardMaterial color="#cfd6e0" roughness={0.9} />
+ </Mesh>
+ <Mesh name="box" position={[0, 0.8, 0]} rotation={[f / 48, f / 24, 0]}>
+ <Cuboid args={[1, 1, 1]} />
+ <MeshStandardMaterial color="#e05a2b" roughness={0.4} />
+ </Mesh>
+ <Mesh name="ball" position={[-1.6, 0.5, -0.5]}>
+ <Sphere args={[0.5]} />
+ <MeshPhysicalMaterial color="#3fb950" clearcoat={1} roughness={0.2} />
+ </Mesh>
+ <Group position={[1.6, 0.6, -0.4]} rotation={[0.4, 0, 0]}>
+ <Mesh name="ring">
+ <Torus args={[0.4, 0.15]} />
+ <MeshStandardMaterial color="#d2a8ff" metalness={0.7} roughness={0.25} />
+ </Mesh>
+ </Group>
+ </AbsoluteFill>
+ );
+}
+
+function OutLights() {
+ return (
+ <AbsoluteFill style={{ background: "#0b0e14" }}>
+ <PerspectiveCamera position={[0, 3, 6]} lookAt={[0, 0.5, 0]} fov={50} />
+ <ToneMapping mode="aces" />
+ <Fog color="#0b0e14" near={6} far={14} />
+ <SpotLight position={[0, 4, 1]} target={[0, 0, 0]} angle={0.6} penumbra={0.4} intensity={1.5} castShadow />
+ <RectAreaLight position={[-2, 1, 2]} target={[0, 0.5, 0]} width={1.5} height={1} intensity={1} color="#ff6040" />
+ <AmbientLight intensity={0.2} />
+ <Mesh name="ground" rotation={[-Math.PI / 2, 0, 0]}>
+ <Cuboid args={[12, 12, 0.001]} />
+ <MeshStandardMaterial color="#cfd6e0" roughness={0.9} />
+ </Mesh>
+ <Mesh name="glow" position={[1.5, 0.5, 0.5]}>
+ <Sphere args={[0.4]} />
+ <MeshBasicMaterial color="#4ea1ff" />
+ </Mesh>
+ <Mesh name="sign" position={[-0.9, 0.3, 0]}>
+ <Text3D size={0.5} depth={0.15}>R3F</Text3D>
+ <MeshStandardMaterial color="#f2cc60" roughness={0.5} />
+ </Mesh>
+ </AbsoluteFill>
+ );
+}
+
+function OutEffects({ fx }: { fx: "bloom" | "grade" | "lens" }) {
+ return (
+ <AbsoluteFill style={{ background: "#0b0e14" }}>
+ <PerspectiveCamera position={[0, 1.5, 5]} lookAt={[0, 0.5, 0]} fov={45} />
+ <ToneMapping mode="aces" />
+ {fx === "bloom" && <Bloom intensity={2} threshold={0.6} />}
+ {fx === "grade" && <Grade saturation={1.3} vignette={0.5} midtones={{ contrast: 1.1 }} />}
+ {fx === "lens" && <LensDistortion k1={0.15} />}
+ <AmbientLight intensity={0.3} />
+ <DirectionalLight position={[2, 4, 3]} target={[0, 0, 0]} intensity={1.5} />
+ <Mesh name="ground" rotation={[-Math.PI / 2, 0, 0]}>
+ <Cuboid args={[12, 12, 0.001]} />
+ <MeshStandardMaterial color="#8090a0" roughness={0.9} />
+ </Mesh>
+ <Mesh name="lamp" position={[-1, 0.6, 0]}>
+ <Sphere args={[0.5]} />
+ <MeshStandardMaterial color="#000000" emissive="#ffb050" emissiveIntensity={4} />
+ </Mesh>
+ <Mesh name="box" position={[1, 0.5, 0]} rotation={[0, 0.6, 0]}>
+ <Cuboid args={[1, 1, 1]} />
+ <MeshStandardMaterial color="#58a6ff" roughness={0.4} />
+ </Mesh>
+ </AbsoluteFill>
+ );
+}
+
+export const OUTPUTS: Record<string, { component: () => ReactNode; frame: number }> = {
+ basic: { component: OutBasic, frame: 24 },
+ lights: { component: OutLights, frame: 0 },
+ // one effect a case: each pass measured on its own
+ bloom: { component: () => <OutEffects fx="bloom" />, frame: 0 },
+ grade: { component: () => <OutEffects fx="grade" />, frame: 0 },
+ lens: { component: () => <OutEffects fx="lens" />, frame: 0 },
+};
diff --git a/sdk/r3f/test/parity/native.tsx b/sdk/r3f/test/parity/native.tsx
new file mode 100644
index 00000000..b9765001
--- /dev/null
+++ b/sdk/r3f/test/parity/native.tsx
@@ -0,0 +1,16 @@
+// The parity cases as raea compositions, for `raea render native.tsx --composition in-basic --frame 24`: an R3F scene
+// through <R3F>, a raea scene as it is.
+import { Composition, registerRoot } from "raea";
+import { R3F } from "raea/r3f";
+import { INPUTS, OUTPUTS, SIZE } from "./fixtures";
+
+registerRoot(() => (
+ <>
+ {Object.entries(INPUTS).map(([k, c]) => (
+ <Composition key={`in-${k}`} id={`in-${k}`} component={() => <R3F {...c.canvas}>{c.scene()}</R3F>} width={SIZE.width} height={SIZE.height} fps={SIZE.fps} durationInFrames={c.frame + 1} />
+ ))}
+ {Object.entries(OUTPUTS).map(([k, c]) => (
+ <Composition key={`out-${k}`} id={`out-${k}`} component={c.component} width={SIZE.width} height={SIZE.height} fps={SIZE.fps} durationInFrames={c.frame + 1} />
+ ))}
+ </>
+));
diff --git a/sdk/r3f/test/parity/page.tsx b/sdk/r3f/test/parity/page.tsx
new file mode 100644
index 00000000..28451678
--- /dev/null
+++ b/sdk/r3f/test/parity/page.tsx
@@ -0,0 +1,68 @@
+// sdk/r3f's parity cases drawn by three.js (docs/r3f.feature R3F8): #/r3f?dir=in&case=basic draws an R3F scene in R3F's
+// own <Canvas>; #/r3f?dir=out&case=basic draws a raea composition in a <Canvas> through <Raea>. Each steps its clock to
+// the case's frame (1/fps a step, as raea's <R3F> does), waits for what it loads, draws once and says "drawn".
+import { Canvas, advance } from "@react-three/fiber"
+import { useEffect, useState } from "react"
+import * as THREE from "three"
+import { INPUTS, OUTPUTS, SIZE } from "./fixtures"
+import { Raea } from "@raea/r3f/output/Raea"
+import { loadShapes } from "@raea/r3f/three/geometry"
+// the shape module, built by tools/shape-wasm.sh (the page's host aliases it)
+import * as shapeWasm from "@raea-shape-web"
+
+function Stepper({ frame, onDone }: { frame: number; onDone: () => void }) {
+ useEffect(() => {
+ let live = true
+ void (async () => {
+ // out of React's commit: <Raea> renders its composition with flushSync inside useFrame
+ await new Promise((r) => setTimeout(r, 0))
+ for (let i = 0; i <= frame; i++) advance(i / SIZE.fps, true)
+ // what loads later (models, pictures, the shape module): wait for it, then draw that frame again
+ const m = THREE.DefaultLoadingManager as unknown as { itemsLoaded?: number; itemsTotal?: number }
+ for (let k = 0; k < 40 && live; k++) {
+ await new Promise((r) => setTimeout(r, 100))
+ if ((m.itemsLoaded ?? 0) >= (m.itemsTotal ?? 0) && k > 5) break
+ }
+ advance(frame / SIZE.fps + 1e-6, true)
+ if (live) onDone()
+ })()
+ return () => { live = false }
+ }, [])
+ return null
+}
+
+export default function R3FParityPage() {
+ const q = new URLSearchParams(location.hash.split("?")[1] ?? "")
+ const dir = q.get("dir") ?? "in", name = q.get("case") ?? "basic"
+ const [note, setNote] = useState("drawing")
+ const [ready, setReady] = useState(dir === "in")
+ useEffect(() => {
+ if (dir === "out") void loadShapes(shapeWasm as never).then(() => setReady(true), (e) => setNote(`error: ${e}`))
+ }, [])
+ const done = () => setNote("drawn")
+ const style = { width: SIZE.width, height: SIZE.height }
+ if (dir === "in") {
+ const c = INPUTS[name]
+ return (
+ <div style={{ background: "#000", ...style }}>
+ <Canvas frameloop="never" dpr={1} gl={{ preserveDrawingBuffer: true }} style={style} {...(c.canvas as object)}>
+ {c.scene()}
+ <Stepper frame={c.frame} onDone={done} />
+ </Canvas>
+ <div className="font-mono" style={{ position: "fixed", left: 0, top: SIZE.height + 4, color: "#fff" }}>{note}</div>
+ </div>
+ )
+ }
+ const c = OUTPUTS[name]
+ return (
+ <div style={{ background: "#000", ...style }}>
+ {ready && (
+ <Canvas frameloop="never" dpr={1} shadows gl={{ preserveDrawingBuffer: true }} style={style}>
+ <Raea component={c.component} frame={c.frame} width={SIZE.width} height={SIZE.height} fps={SIZE.fps} durationInFrames={c.frame + 1} />
+ <Stepper frame={c.frame} onDone={done} />
+ </Canvas>
+ )}
+ <div className="font-mono" style={{ position: "fixed", left: 0, top: SIZE.height + 4, color: "#fff" }}>{note}</div>
+ </div>
+ )
+}
diff --git a/sdk/r3f/test/parity/shape-web.d.ts b/sdk/r3f/test/parity/shape-web.d.ts
new file mode 100644
index 00000000..58f9887d
--- /dev/null
+++ b/sdk/r3f/test/parity/shape-web.d.ts
@@ -0,0 +1,5 @@
+// the shape module tools/shape-wasm.sh builds (wasm/, not in git), aliased by the page's host
+declare module "@raea-shape-web" {
+ export default function init(input?: unknown): Promise<unknown>;
+ export function mesh(expr: string): Float32Array;
+}
diff --git a/sdk/r3f/test/roundtrip.test.tsx b/sdk/r3f/test/roundtrip.test.tsx
new file mode 100644
index 00000000..ba95b9b7
--- /dev/null
+++ b/sdk/r3f/test/roundtrip.test.tsx
@@ -0,0 +1,189 @@
+// Both ways at once (docs/r3f.feature R3F8): a raea scene drawn by the three.js host and read back by the R3F input
+// gives the same scene (places, surfaces, lights in raea's units, the camera); an R3F scene read by the input and drawn
+// by the host gives three.js objects equal to R3F's own.
+import { describe, expect, test } from "bun:test";
+import * as THREE from "three";
+import {
+ AmbientLight, BufferMesh, Cuboid, DirectionalLight, Fog, Group, Mesh, MeshBasicMaterial, MeshPhysicalMaterial,
+ MeshStandardMaterial, PerspectiveCamera, PointLight, RectAreaLight, Sphere, SpotLight, ToneMapping, Torus,
+} from "raea/3d";
+import { Scene3d } from "../src/three/scene";
+import { convert } from "../src/input/scene";
+import { stepTo, end, standInRenderer } from "../src/input/session";
+import { elementsOf, type Part } from "../src/parts";
+import { page } from "./dom";
+
+const near = (a: number, b: number, eps = 1e-4) => Math.abs(a - b) <= eps * Math.max(1, Math.abs(a), Math.abs(b));
+const nearAll = (a: number[], b: number[], eps = 1e-4) => a.length === b.length && a.every((x, i) => near(x, b[i], eps));
+
+function hostOf(node: React.ReactNode) {
+ const host = new Scene3d();
+ host.sync(page(node) as unknown as Element);
+ host.fit(640, 360);
+ return host;
+}
+
+function readBack(host: Scene3d) {
+ const gl = standInRenderer();
+ host.apply(gl);
+ return convert(host.scene, host.camera, gl, 360).parts;
+}
+
+const flat = (parts: Part[]): Part[] => parts.flatMap((p) => [p, ...flat(p.children ?? [])]);
+const ofType = (parts: Part[], t: string) => flat(parts).filter((p) => p.type === t);
+
+const SCENE = (
+ <>
+ <PerspectiveCamera position={[4, 3, 6]} lookAt={[0, 0.5, 0]} fov={40} />
+ <ToneMapping mode="aces" exposure={0.5} />
+ <Fog color="#203040" near={4} far={30} />
+ <AmbientLight intensity={0.6} color="#c8d4ff" />
+ <DirectionalLight position={[3, 6, 2]} target={[0, 0, 0]} intensity={2} color="#fff4e4" />
+ <PointLight position={[-2, 2, 1]} intensity={3} color="#58a6ff" distance={12} />
+ <SpotLight position={[0, 5, 0]} target={[0, 0, 0]} intensity={4} angle={0.5} penumbra={0.3} />
+ <RectAreaLight position={[0, 2, -3]} target={[0, 1, 0]} width={2} height={1} intensity={2} />
+ <Mesh name="box" position={[0, 0.5, 0]} rotation={[0.1, 0.7, 0]}>
+ <Cuboid args={[1, 1, 1]} />
+ <MeshStandardMaterial color="#e05a2b" roughness={0.35} metalness={0.2} emissive="#220000" emissiveIntensity={2} />
+ </Mesh>
+ <Group position={[2, 0, 0]} rotation={[0, 0.5, 0]} scale={[1, 2, 1]}>
+ <Mesh name="ball" position={[0, 0.5, 0]}>
+ <Sphere args={[0.5]} />
+ <MeshPhysicalMaterial color="#3fb950" clearcoat={1} clearcoatRoughness={0.1} roughness={0.2} transmission={0.5} ior={1.4} thickness={0.2} />
+ </Mesh>
+ </Group>
+ <Mesh name="ring" position={[-2, 0.5, 0]}>
+ <Torus args={[0.5, 0.2]} />
+ <MeshBasicMaterial color="#d2a8ff" opacity={0.5} transparent side="double" />
+ </Mesh>
+ <Mesh name="tri" position={[0, 0, 2]}>
+ <BufferMesh positions={[0, 0, 0, 1, 0, 0, 0, 1, 0]} uvs={[0, 1, 1, 1, 0, 0]} normals={[0, 0, 1, 0, 0, 1, 0, 0, 1]} />
+ <MeshStandardMaterial color="#ffffff" />
+ </Mesh>
+ </>
+);
+
+describe("raea → three.js → raea", () => {
+ const host = hostOf(SCENE);
+ const back = readBack(host);
+
+ test("every light comes back in raea's units, colour and place", () => {
+ const want: Record<string, { intensity: number; color: string; position?: number[] }> = {
+ AmbientLight: { intensity: 0.6, color: "#c8d4ff" },
+ DirectionalLight: { intensity: 2, color: "#fff4e4", position: [3, 6, 2] },
+ PointLight: { intensity: 3, color: "#58a6ff", position: [-2, 2, 1] },
+ SpotLight: { intensity: 4, color: "#ffffff", position: [0, 5, 0] },
+ RectAreaLight: { intensity: 2, color: "#ffffff", position: [0, 2, -3] },
+ };
+ for (const [type, w] of Object.entries(want)) {
+ const [l] = ofType(back, type);
+ expect(l, type).toBeDefined();
+ expect(near(l.props.intensity as number, w.intensity), `${type} intensity ${l.props.intensity}`).toBe(true);
+ expect(l.props.color).toBe(w.color);
+ if (w.position) expect(nearAll(l.props.position as number[], w.position)).toBe(true);
+ }
+ const [spot] = ofType(back, "SpotLight");
+ expect(near(spot.props.angle as number, 0.5)).toBe(true);
+ expect(near(spot.props.penumbra as number, 0.3)).toBe(true);
+ expect(ofType(back, "PointLight")[0].props.distance).toBe(12);
+ const [rect] = ofType(back, "RectAreaLight");
+ expect(nearAll([rect.props.width as number, rect.props.height as number], [2, 1])).toBe(true);
+ });
+
+ test("the camera, tone mapping and fog come back", () => {
+ const [cam] = ofType(back, "PerspectiveCamera");
+ expect(nearAll(cam.props.position as number[], [4, 3, 6])).toBe(true);
+ expect(near(cam.props.fov as number, 40)).toBe(true);
+ // its look: one unit from the eye toward [0, 0.5, 0]
+ const dir = new THREE.Vector3(...(cam.props.lookAt as [number, number, number])).sub(new THREE.Vector3(4, 3, 6));
+ expect(dir.normalize().dot(new THREE.Vector3(-4, -2.5, -6).normalize())).toBeGreaterThan(0.99999);
+ const tone = ofType(back, "ToneMapping")[0].props;
+ expect(tone.mode).toBe("aces");
+ expect(near(tone.exposure as number, 0.5)).toBe(true);
+ expect(ofType(back, "Fog")[0].props).toEqual({ color: "#203040", near: 4, far: 30 });
+ });
+
+ test("meshes come back where they were, with their surfaces", () => {
+ const meshes = ofType(back, "Mesh");
+ expect(meshes.length).toBe(4);
+ const byName = (n: string) => meshes.find((m) => String(m.props.name).endsWith(`:${n}`))!;
+ const box = byName("box");
+ expect(nearAll(box.props.position as number[], [0, 0.5, 0])).toBe(true);
+ const q = new THREE.Quaternion().setFromEuler(new THREE.Euler(0.1, 0.7, 0, "XYZ"));
+ expect(nearAll(box.props.quaternion as number[], q.toArray())).toBe(true);
+ const std = box.children![1];
+ expect(std.type).toBe("MeshStandardMaterial");
+ expect(std.props).toMatchObject({ color: "#e05a2b", roughness: 0.35, metalness: 0.2, emissive: "#220000", emissiveIntensity: 2 });
+ const phys = byName("ball").children![1];
+ expect(phys.type).toBe("MeshPhysicalMaterial");
+ expect(phys.props).toMatchObject({ color: "#3fb950", clearcoat: 1, clearcoatRoughness: 0.1, transmission: 0.5, ior: 1.4, thickness: 0.2 });
+ const basic = byName("ring").children![1];
+ expect(basic.props).toMatchObject({ color: "#d2a8ff", opacity: 0.5, transparent: true, side: "double" });
+ // the triangle's arrays, its uvs as raea counts them (v from the top)
+ const tri = byName("tri").children![0];
+ expect(tri.props.positions).toEqual([0, 0, 0, 1, 0, 0, 0, 1, 0]);
+ expect(nearAll(tri.props.uvs as number[], [0, 1, 1, 1, 0, 0])).toBe(true);
+ });
+
+ test("a group's transform stays a group's (its child's world place is three's)", () => {
+ const groups = ofType(back, "Group");
+ const g = groups.find((x) => nearAll(x.props.position as number[], [2, 0, 0]))!;
+ expect(g).toBeDefined();
+ expect(g.props.scale).toEqual([1, 2, 1]);
+ const ball = host.scene.getObjectByName("ball")!;
+ expect(nearAll(ball.getWorldPosition(new THREE.Vector3()).toArray(), [2, 1, 0])).toBe(true);
+ });
+
+ test("drawn again from what came back, the scene is the same", () => {
+ const again = hostOf(<>{elementsOf(back)}</>);
+ const twice = readBack(again);
+ const strip = (ps: Part[]) => JSON.stringify(flat(ps).map((p) => ({ type: p.type, props: Object.fromEntries(Object.entries(p.props).filter(([k]) => k !== "name").map(([k, v]) => [k, typeof v === "number" ? Number(v.toPrecision(5)) : Array.isArray(v) && typeof v[0] === "number" ? (v as number[]).map((x) => Number(x.toPrecision(5))) : v])) })));
+ expect(strip(twice)).toBe(strip(back));
+ });
+});
+
+describe("R3F → raea → three.js", () => {
+ test("an R3F scene drawn by the host is R3F's own scene", () => {
+ const s = stepTo("rt", 0, 24, 640, 360, { camera: { position: [3, 2, 5], fov: 45 }, shadows: true }, () => (
+ <>
+ <ambientLight intensity={0.5} />
+ <directionalLight position={[3, 5, 2]} intensity={2.5} castShadow />
+ <pointLight position={[-1, 2, 0]} intensity={8} distance={10} color="#ff8800" />
+ <group position={[1, 0, 0]} rotation={[0, 0.3, 0]}>
+ <mesh name="k" position={[0, 1, 0]} scale={[1, 0.5, 2]} castShadow>
+ <boxGeometry args={[1, 1, 1]} />
+ <meshStandardMaterial color="#e05a2b" roughness={0.4} metalness={0.1} />
+ </mesh>
+ </group>
+ </>
+ ));
+ const st = s.state as unknown as { scene: THREE.Scene; camera: THREE.Camera; gl: THREE.WebGLRenderer };
+ const parts = convert(st.scene, st.camera, st.gl, 360).parts;
+ const host = hostOf(<>{elementsOf(parts)}</>);
+ // lights: the same three.js intensity and place
+ const lights = (s: THREE.Object3D) => { const out: THREE.Light[] = []; s.traverse((o) => { if ((o as THREE.Light).isLight) out.push(o as THREE.Light); }); return out; };
+ const a = lights(st.scene), b = lights(host.scene);
+ for (const l of a) {
+ const m = b.find((x) => x.type === l.type)!;
+ expect(m, l.type).toBeDefined();
+ expect(near(m.intensity, l.intensity), `${l.type} ${m.intensity} vs ${l.intensity}`).toBe(true);
+ expect(m.color.getHex()).toBe(l.color.getHex());
+ expect(nearAll(m.getWorldPosition(new THREE.Vector3()).toArray(), l.getWorldPosition(new THREE.Vector3()).toArray())).toBe(true);
+ }
+ // the box: the same world matrix and surface, its triangles the same
+ const ours = st.scene.getObjectByName("k") as THREE.Mesh;
+ let theirs: THREE.Mesh | undefined;
+ host.scene.traverse((o) => { if ((o as THREE.Mesh).isMesh && o.name.endsWith(":k")) theirs = o as THREE.Mesh; });
+ expect(theirs).toBeDefined();
+ st.scene.updateMatrixWorld();
+ host.scene.updateMatrixWorld();
+ expect(nearAll(theirs!.matrixWorld.toArray(), ours.matrixWorld.toArray())).toBe(true);
+ const mt = theirs!.material as THREE.MeshStandardMaterial, mo = ours.material as THREE.MeshStandardMaterial;
+ expect([mt.color.getHex(), mt.roughness, mt.metalness]).toEqual([mo.color.getHex(), mo.roughness, mo.metalness]);
+ expect(theirs!.geometry.attributes.position.count).toBe(ours.geometry.index ? ours.geometry.attributes.position.count : ours.geometry.attributes.position.count);
+ // the camera
+ expect(nearAll(host.camera.position.toArray(), st.camera.position.toArray())).toBe(true);
+ expect(nearAll(host.camera.quaternion.toArray(), st.camera.quaternion.toArray(), 1e-3)).toBe(true);
+ end("rt");
+ });
+});
diff --git a/sdk/r3f/tools/parity.sh b/sdk/r3f/tools/parity.sh
new file mode 100755
index 00000000..875ecc59
--- /dev/null
+++ b/sdk/r3f/tools/parity.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# R3F parity (docs/r3f.feature R3F8): each case in test/parity/fixtures.tsx drawn by raea's engine (`raea render`) and
+# by three.js in headless Chrome (test/parity/page.tsx, served by a Vite host at $R3F_PARITY_URL with @r3f-parity and
+# @raea-shape-web aliased), compared by SSIM. Fails under $MIN (0.92).
+# tools/parity.sh [OUT_DIR]
+set -euo pipefail
+cd "$(dirname "$0")/.."
+OUT=${1:-$(mktemp -d)}
+URL=${R3F_PARITY_URL:-http://127.0.0.1:5190}
+MIN=${MIN:-0.92}
+CASES=(in-basic:24 in-lights:0 in-things:0 out-basic:24 out-lights:0 out-bloom:0 out-grade:0 out-lens:0)
+mkdir -p "$OUT"
+for c in "${CASES[@]}"; do
+ (cd test/parity && raea render native.tsx --composition "${c%%:*}" --frame "${c##*:}" -o "$OUT/${c%%:*}-native.png" >/dev/null)
+done
+bun tools/shoot.ts "$URL" "$OUT" ../playable/tools/chrome.ts
+fail=0
+for c in "${CASES[@]}"; do
+ id=${c%%:*}
+ magick "$OUT/$id-three.png" -crop 640x360+0+0 +repage "$OUT/$id-three.png"
+ # ImageMagick 7.1.2 reports SSIM's distance (1 - SSIM)
+ d=$(magick compare -metric SSIM "$OUT/$id-native.png" "$OUT/$id-three.png" null: 2>&1 | sed -E 's/.*\(([0-9.e-]+)\).*/\1/' || true)
+ s=$(echo "1 - $d" | bc -l)
+ ok=$(echo "$s >= $MIN" | bc -l)
+ printf '%-11s SSIM %.4f %s\n' "$id" "$s" "$([ "$ok" = 1 ] && echo ok || echo LOW)"
+ [ "$ok" = 1 ] || fail=1
+done
+exit $fail
diff --git a/sdk/r3f/tools/shape-wasm.sh b/sdk/r3f/tools/shape-wasm.sh
new file mode 100755
index 00000000..c3310836
--- /dev/null
+++ b/sdk/r3f/tools/shape-wasm.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+# Builds raea's solid shapes for the web (engine/shape-web, core/shape compiled to wasm) into sdk/r3f/wasm: what
+# <Raea> and the three host mesh solids, minus, hull, extrude and Text3D with (loadShapes). Not in git; built here.
+set -euo pipefail
+R=$(cd "$(dirname "$0")/../../.." && pwd)
+OUT="$R/sdk/r3f/wasm"
+export CARGO_TARGET_DIR="$R/target/web"
+lane build -- cargo build -p raea-shape-web --target wasm32-unknown-unknown --profile web -j 6
+wasm-bindgen --target web --out-dir "$OUT" "$CARGO_TARGET_DIR/wasm32-unknown-unknown/web/raea_shape_web.wasm"
+ls -la "$OUT"
diff --git a/sdk/r3f/tools/shoot.ts b/sdk/r3f/tools/shoot.ts
new file mode 100644
index 00000000..c7bd03ce
--- /dev/null
+++ b/sdk/r3f/tools/shoot.ts
@@ -0,0 +1,27 @@
+// Shoots each parity case drawn by three.js in headless Chrome (docs/r3f.feature R3F8): the lab's #/r3f page, for
+// `bun tools/shoot.ts BASE_URL OUT_DIR CHROME_TS [dir-case ...]` (defaults to every case in test/parity/fixtures.tsx).
+import { resolve } from "node:path";
+const [base, out, chromeTs, ...only] = process.argv.slice(2);
+if (!base || !out || !chromeTs) throw new Error("usage: bun tools/shoot.ts BASE_URL OUT_DIR CHROME_TS [in-basic ...]");
+const { openChrome } = await import(resolve(chromeTs));
+const cases = only.length ? only : ["in-basic", "in-lights", "in-things", "out-basic", "out-lights", "out-bloom", "out-grade", "out-lens"];
+let failed = 0;
+for (const c of cases) {
+ const [dir, name] = c.split("-");
+ const page = await openChrome(`${base}/#/r3f?dir=${dir}&case=${name}`, 640, 400, { scale: 1, mobile: false });
+ try {
+ let note = "";
+ for (let i = 0; i < 300 && note !== "drawn" && !note.startsWith("error"); i++) {
+ await Bun.sleep(100);
+ note = String(await page.value(`[...document.querySelectorAll(".font-mono")].map(e=>e.textContent).join("")`));
+ }
+ await page.shot(resolve(out, `${c}-three.png`));
+ const bad = page.problems.filter((p: string) => !/favicon/.test(p));
+ if (process.env.LOGS) console.log(page.logs.join("\n"));
+ console.log(`${c}: ${note}${bad.length ? `; problems: ${bad.join(" | ")}` : ""}`);
+ if (note !== "drawn") failed++;
+ } finally {
+ page.close();
+ }
+}
+process.exit(failed ? 1 : 0);
diff --git a/sdk/r3f/tsconfig.json b/sdk/r3f/tsconfig.json
new file mode 100644
index 00000000..1d958edb
--- /dev/null
+++ b/sdk/r3f/tsconfig.json
@@ -0,0 +1 @@
+{ "extends": "../tsconfig.base.json", "compilerOptions": { "types": ["bun"], "skipLibCheck": true }, "include": ["src", "test", "tools"] }
diff --git a/sdk/raea/bench/bevy-parity/3d/3d_scene.tsx b/sdk/raea/bench/bevy-parity/3d/3d_scene.tsx
new file mode 100644
index 00000000..074c8269
--- /dev/null
+++ b/sdk/raea/bench/bevy-parity/3d/3d_scene.tsx
@@ -0,0 +1,30 @@
+// Bevy v0.20.0 examples/3d/3d_scene.rs in raea's TSX (docs/control.feature FC0a): a white circle of radius 4 lying
+// flat, a 1 m cube of srgb(124, 144, 255) on it, a shadow-casting PointLight at (4, 8, 4) with Bevy's default
+// 1 000 000 lm, and the camera at (-2.5, 4.5, 9) looking at the origin, in Bevy's default 1280 x 720 window.
+import { Composition, registerRoot } from "raea";
+import { BevyComponent, Canvas3D, Entity } from "raea/3d";
+import { Transform, Quat, eulerOf } from "raea/transform";
+import { Camera3d } from "raea/camera";
+import { Cuboid, Mesh3d } from "raea/mesh";
+import { StandardMaterial } from "raea/pbr";
+import { PointLight } from "raea/light";
+
+function Shot() {
+ return (
+ <Canvas3D>
+ {/* a Circle in 3D: raea's typed Circle only goes in a Mesh2d (conventions C15), so through reflection */}
+ <Entity rotation={eulerOf(Quat.fromRotationX(-Math.PI / 2))}>
+ <BevyComponent type="bevy_mesh::components::Mesh3d" value={{ primitive: "Circle", radius: 4 }} />
+ <BevyComponent type="bevy_pbr::mesh_material::MeshMaterial3d<bevy_pbr::pbr_material::StandardMaterial>" value={{ base_color: { Srgba: { red: 1, green: 1, blue: 1, alpha: 1 } } }} />
+ </Entity>
+ <Mesh3d transform={Transform.fromXyz(0, 0.5, 0)}>
+ <Cuboid half_size={[0.5, 0.5, 0.5]} />
+ <StandardMaterial base_color="rgb(124, 144, 255)" />
+ </Mesh3d>
+ <PointLight shadow_maps_enabled transform={Transform.fromXyz(4, 8, 4)} />
+ <Camera3d transform={Transform.fromXyz(-2.5, 4.5, 9).lookingAt([0, 0, 0])} />
+ </Canvas3D>
+ );
+}
+
+registerRoot(() => <Composition id="main" component={Shot} durationInFrames={11} fps={60} width={1280} height={720} />);
diff --git a/sdk/raea/bench/bevy-parity/defaults/parts.tsx b/sdk/raea/bench/bevy-parity/defaults/parts.tsx
new file mode 100644
index 00000000..28552188
--- /dev/null
+++ b/sdk/raea/bench/bevy-parity/defaults/parts.tsx
@@ -0,0 +1,26 @@
+// The defaults test's scene (docs/control.feature FC0c): each Bevy-named part written with no props but what it can't
+// go without, so the components raea gives them can be held against Bevy's own Default (tools/bevy-defaults).
+import { Composition, registerRoot } from "raea";
+import { Canvas3D } from "raea/3d";
+import { Camera3d } from "raea/camera";
+import { Cuboid, Mesh3d } from "raea/mesh";
+import { StandardMaterial } from "raea/pbr";
+import { AmbientLight, DirectionalLight, PointLight, SpotLight } from "raea/light";
+
+function Shot() {
+ return (
+ <Canvas3D>
+ <Camera3d />
+ <AmbientLight />
+ <DirectionalLight />
+ <PointLight />
+ <SpotLight />
+ <Mesh3d>
+ <Cuboid />
+ <StandardMaterial />
+ </Mesh3d>
+ </Canvas3D>
+ );
+}
+
+registerRoot(() => <Composition id="main" component={Shot} durationInFrames={1} fps={30} width={320} height={180} />);
diff --git a/sdk/raea/bench/bevy-parity/stress_tests/many_cubes.tsx b/sdk/raea/bench/bevy-parity/stress_tests/many_cubes.tsx
new file mode 100644
index 00000000..1e6b4c97
--- /dev/null
+++ b/sdk/raea/bench/bevy-parity/stress_tests/many_cubes.tsx
@@ -0,0 +1,52 @@
+// Bevy v0.20.0 examples/stress_tests/many_cubes.rs, written in raea's TSX the way an author would (docs/control.feature
+// FC0a), run by tools/bevy-parity beside the Rust example with `--benchmark --instance-count N`: the sphere layout, one
+// mesh (a cube of half-size H, the first of the example's seeded radii) and one white material shared by every cube,
+// a camera at the centre turning 0.15 rad a frame-second about Z then X, an inside-out white box around it all and
+// Bevy's default DirectionalLight (10 000 lux) facing (0, -1, -1). Frame n here is the example's update n.
+import { Composition, registerRoot, useCurrentFrame } from "raea";
+import { Canvas3D } from "raea/3d";
+import { Transform, Quat } from "raea/transform";
+import { Camera3d } from "raea/camera";
+import { Cuboid, Mesh3d } from "raea/mesh";
+import { StandardMaterial } from "raea/pbr";
+import { DirectionalLight } from "raea/light";
+
+// the run's size (tools/bevy-parity writes N and H into a copy; these are its defaults)
+const N = 10_000;
+const H = 0.362; // the example's first seeded radius, as the probe reads its bounds (0.3620)
+const RADIUS = 200 * 2.5;
+const GOLDEN = 0.5 * (1 + Math.sqrt(5));
+const EPS = 1e-10;
+
+const places: [number, number, number][] = Array.from({ length: N }, (_, i) => {
+ const theta = Math.PI * 2 * (i / GOLDEN);
+ const phi = Math.acos(1 - (2 * (i + EPS)) / (N - 1 + 2 * EPS));
+ return [Math.cos(theta) * Math.sin(phi) * RADIUS, Math.sin(theta) * Math.sin(phi) * RADIUS, Math.cos(phi) * RADIUS];
+});
+
+function Shot() {
+ const f = useCurrentFrame();
+ // rotate_z then rotate_x each update, about the world's axes: q = (Rx(d) * Rz(d))^(f + 1)
+ const d = 0.15 / 60;
+ const step = Quat.mul(Quat.fromRotationX(d), Quat.fromRotationZ(d));
+ let q = Quat.IDENTITY;
+ for (let k = 0; k <= f; k++) q = Quat.mul(step, q);
+ return (
+ <Canvas3D>
+ <Camera3d transform={{ translation: [0, 0, 0], rotation: q }} />
+ <DirectionalLight transform={Transform.fromXyz(0, 0, 0).lookingAt([0, -1, -1])} />
+ {places.map((p, i) => (
+ <Mesh3d key={i} transform={Transform.fromXyz(p[0], p[1], p[2]).lookingAt([0, 0, 0])}>
+ <Cuboid half_size={[H, H, H]} />
+ <StandardMaterial base_color="#ffffff" />
+ </Mesh3d>
+ ))}
+ <Mesh3d transform={{ translation: [0, 0, 0], scale: [-1, -1, -1] }}>
+ <Cuboid half_size={[RADIUS * 1.1, RADIUS * 1.1, RADIUS * 1.1]} />
+ <StandardMaterial base_color="#ffffff" />
+ </Mesh3d>
+ </Canvas3D>
+ );
+}
+
+registerRoot(() => <Composition id="main" component={Shot} durationInFrames={121} fps={60} width={1920} height={1080} />);
diff --git a/sdk/raea/bench/bevy-ts/cases/kept-mount.tsx b/sdk/raea/bench/bevy-ts/cases/kept-mount.tsx
new file mode 100644
index 00000000..3e92f92f
--- /dev/null
+++ b/sdk/raea/bench/bevy-ts/cases/kept-mount.tsx
@@ -0,0 +1,29 @@
+// gap: FC1b
+// The 3D kept across frames (docs/control.feature FC1b: a subtree no commit touched is the last frame's): a red cube,
+// the only child of a plain wrapper inside the Canvas3D, there for frames 10 to 19 alone, played live (one World, so
+// a stale subtree would show): at 0.5 s (frame 15) it has mounted and shows.
+// play: live-world.json 0.5
+// probe: 32 32 r>150 g<80
+import { AbsoluteFill, Composition, registerRoot, useCurrentFrame } from "raea";
+import { Canvas3D } from "raea/3d";
+import { StandardMaterial } from "raea/pbr";
+import { Cuboid, Mesh3d } from "raea/mesh";
+import { Transform } from "raea/transform";
+import { Camera3d } from "raea/camera";
+
+function Blink() {
+ const f = useCurrentFrame();
+ return <div>{f >= 10 && f < 20 ? <Mesh3d transform={Transform.fromXyz(0, 0, 0)}><Cuboid half_size={[0.6, 0.6, 0.6]} /><StandardMaterial base_color="#ff0000" unlit /></Mesh3d> : null}</div>;
+}
+
+function Shot() {
+ return (
+ <AbsoluteFill style={{ background: "#000" }}>
+ <Canvas3D layered>
+ <Camera3d transform={Transform.fromXyz(0, 0, 5).lookingAt([0, 0, 0])} />
+ <Blink />
+ </Canvas3D>
+ </AbsoluteFill>
+ );
+}
+registerRoot(() => <Composition id="main" component={Shot} durationInFrames={30} fps={30} width={64} height={64} />);
diff --git a/sdk/raea/bench/bevy-ts/cases/kept-unmount.tsx b/sdk/raea/bench/bevy-ts/cases/kept-unmount.tsx
new file mode 100644
index 00000000..1980d3d8
--- /dev/null
+++ b/sdk/raea/bench/bevy-ts/cases/kept-unmount.tsx
@@ -0,0 +1,30 @@
+// gap: FC1b
+// The 3D kept across frames (docs/control.feature FC1b: a subtree no commit touched is the last frame's): a red cube,
+// the only child of a plain wrapper inside the Canvas3D, there for frames 10 to 19 alone, played live (one World, so
+// a stale subtree would show): at 0.85 s (frame 25) it is gone, its wrapper left with no children (Bevy then drops
+// the wrapper's Children, which no change filter sees).
+// play: live-world.json 0.85
+// probe: 32 32 r<30 g<30
+import { AbsoluteFill, Composition, registerRoot, useCurrentFrame } from "raea";
+import { Canvas3D } from "raea/3d";
+import { StandardMaterial } from "raea/pbr";
+import { Cuboid, Mesh3d } from "raea/mesh";
+import { Transform } from "raea/transform";
+import { Camera3d } from "raea/camera";
+
+function Blink() {
+ const f = useCurrentFrame();
+ return <div>{f >= 10 && f < 20 ? <Mesh3d transform={Transform.fromXyz(0, 0, 0)}><Cuboid half_size={[0.6, 0.6, 0.6]} /><StandardMaterial base_color="#ff0000" unlit /></Mesh3d> : null}</div>;
+}
+
+function Shot() {
+ return (
+ <AbsoluteFill style={{ background: "#000" }}>
+ <Canvas3D layered>
+ <Camera3d transform={Transform.fromXyz(0, 0, 5).lookingAt([0, 0, 0])} />
+ <Blink />
+ </Canvas3D>
+ </AbsoluteFill>
+ );
+}
+registerRoot(() => <Composition id="main" component={Shot} durationInFrames={30} fps={30} width={64} height={64} />);
diff --git a/sdk/raea/bench/bevy-ts/cases/material-field-0.tsx b/sdk/raea/bench/bevy-ts/cases/material-field-0.tsx
new file mode 100644
index 00000000..409d55a5
--- /dev/null
+++ b/sdk/raea/bench/bevy-ts/cases/material-field-0.tsx
@@ -0,0 +1,28 @@
+// gap: FC1c
+// A StandardMaterial field past the row columns' four, animated (docs/control.feature FC1c): a black cube glowing red
+// whose emissive_exposure_weight runs from 0 at frame 0 to 1 at frame 20, set by reflection on its own material each
+// frame. At frame 0 it is bright red: its emissive unexposed.
+// frame: 0
+// probe: 32 32 r>150
+import { AbsoluteFill, Composition, registerRoot } from "raea";
+import { Canvas3D } from "raea/3d";
+import { StandardMaterial } from "raea/pbr";
+import { Cuboid, Mesh3d } from "raea/mesh";
+import { Transform } from "raea/transform";
+import { Camera3d } from "raea/camera";
+import { track } from "raea";
+
+function Shot() {
+ return (
+ <AbsoluteFill style={{ background: "#000" }}>
+ <Canvas3D layered>
+ <Camera3d transform={Transform.fromXyz(0, 0, 5).lookingAt([0, 0, 0])} />
+ <Mesh3d transform={Transform.fromXyz(0, 0, 0)}>
+ <Cuboid half_size={[0.8, 0.8, 0.8]} />
+ <StandardMaterial base_color="#000000" emissive="#ff0000" animate={{ emissive_exposure_weight: track({ 0: 0, 20: 1 }) }} />
+ </Mesh3d>
+ </Canvas3D>
+ </AbsoluteFill>
+ );
+}
+registerRoot(() => <Composition id="main" component={Shot} durationInFrames={30} fps={30} width={64} height={64} />);
diff --git a/sdk/raea/bench/bevy-ts/cases/material-field-20.tsx b/sdk/raea/bench/bevy-ts/cases/material-field-20.tsx
new file mode 100644
index 00000000..7a75cf34
--- /dev/null
+++ b/sdk/raea/bench/bevy-ts/cases/material-field-20.tsx
@@ -0,0 +1,28 @@
+// gap: FC1c
+// A StandardMaterial field past the row columns' four, animated (docs/control.feature FC1c): a black cube glowing red
+// whose emissive_exposure_weight runs from 0 at frame 0 to 1 at frame 20, set by reflection on its own material each
+// frame. At frame 20 it is grey, not red: the emissive under the camera's exposure leaves only the black base's specular.
+// frame: 20
+// probe: 32 32 r<80
+import { AbsoluteFill, Composition, registerRoot } from "raea";
+import { Canvas3D } from "raea/3d";
+import { StandardMaterial } from "raea/pbr";
+import { Cuboid, Mesh3d } from "raea/mesh";
+import { Transform } from "raea/transform";
+import { Camera3d } from "raea/camera";
+import { track } from "raea";
+
+function Shot() {
+ return (
+ <AbsoluteFill style={{ background: "#000" }}>
+ <Canvas3D layered>
+ <Camera3d transform={Transform.fromXyz(0, 0, 5).lookingAt([0, 0, 0])} />
+ <Mesh3d transform={Transform.fromXyz(0, 0, 0)}>
+ <Cuboid half_size={[0.8, 0.8, 0.8]} />
+ <StandardMaterial base_color="#000000" emissive="#ff0000" animate={{ emissive_exposure_weight: track({ 0: 0, 20: 1 }) }} />
+ </Mesh3d>
+ </Canvas3D>
+ </AbsoluteFill>
+ );
+}
+registerRoot(() => <Composition id="main" component={Shot} durationInFrames={30} fps={30} width={64} height={64} />);
diff --git a/sdk/raea/bench/bevy-ts/cases/material-field-live.tsx b/sdk/raea/bench/bevy-ts/cases/material-field-live.tsx
new file mode 100644
index 00000000..e854a16f
--- /dev/null
+++ b/sdk/raea/bench/bevy-ts/cases/material-field-live.tsx
@@ -0,0 +1,28 @@
+// gap: FC1c
+// A StandardMaterial field past the row columns' four, animated (docs/control.feature FC1c): a black cube glowing red
+// whose emissive_exposure_weight runs from 0 at frame 0 to 1 at frame 20, set by reflection on its own material each
+// frame. Played live (0.85 s, frame 25, past the track's end) it is grey, not red: the emissive under the camera's exposure leaves only the black base's specular.
+// play: live-world.json 0.85
+// probe: 32 32 r<80
+import { AbsoluteFill, Composition, registerRoot } from "raea";
+import { Canvas3D } from "raea/3d";
+import { StandardMaterial } from "raea/pbr";
+import { Cuboid, Mesh3d } from "raea/mesh";
+import { Transform } from "raea/transform";
+import { Camera3d } from "raea/camera";
+import { track } from "raea";
+
+function Shot() {
+ return (
+ <AbsoluteFill style={{ background: "#000" }}>
+ <Canvas3D layered>
+ <Camera3d transform={Transform.fromXyz(0, 0, 5).lookingAt([0, 0, 0])} />
+ <Mesh3d transform={Transform.fromXyz(0, 0, 0)}>
+ <Cuboid half_size={[0.8, 0.8, 0.8]} />
+ <StandardMaterial base_color="#000000" emissive="#ff0000" animate={{ emissive_exposure_weight: track({ 0: 0, 20: 1 }) }} />
+ </Mesh3d>
+ </Canvas3D>
+ </AbsoluteFill>
+ );
+}
+registerRoot(() => <Composition id="main" component={Shot} durationInFrames={30} fps={30} width={64} height={64} />);
diff --git a/sdk/raea/bench/bevy-ts/cases/reflect-keyed-live.tsx b/sdk/raea/bench/bevy-ts/cases/reflect-keyed-live.tsx
new file mode 100644
index 00000000..93b4c173
--- /dev/null
+++ b/sdk/raea/bench/bevy-ts/cases/reflect-keyed-live.tsx
@@ -0,0 +1,34 @@
+// gap: FC1c
+// A reflected value keyed per frame in the plain build (docs/control.feature FC1c): a bare <Entity> whose
+// MeshMaterial3d<StandardMaterial>, given as a <BevyComponent>, turns from red to green at frame 10. At frame 15 it is
+// green (live: played live, one World across the change).
+// play: live-world.json 0.5
+// probe: 32 32 g>150 r<100
+import { AbsoluteFill, Composition, registerRoot, useCurrentFrame } from "raea";
+import { BevyComponent, Canvas3D, Entity } from "raea/3d";
+import { Camera3d } from "raea/camera";
+import { Transform } from "raea/transform";
+
+const rgb = (r: number, g: number) => ({ Srgba: { red: r, green: g, blue: 0, alpha: 1 } });
+
+function Cube() {
+ const f = useCurrentFrame();
+ return (
+ <Entity name="cube">
+ <BevyComponent type="bevy_mesh::components::Mesh3d" value="shape:box(1.2, 1.2, 1.2)" />
+ <BevyComponent type="bevy_pbr::mesh_material::MeshMaterial3d<bevy_pbr::pbr_material::StandardMaterial>" value={{ base_color: f < 10 ? rgb(1, 0) : rgb(0, 1), unlit: true }} />
+ </Entity>
+ );
+}
+
+function Shot() {
+ return (
+ <AbsoluteFill style={{ background: "#000" }}>
+ <Canvas3D layered>
+ <Camera3d transform={Transform.fromXyz(0, 0, 5).lookingAt([0, 0, 0])} />
+ <Cube />
+ </Canvas3D>
+ </AbsoluteFill>
+ );
+}
+registerRoot(() => <Composition id="main" component={Shot} durationInFrames={30} fps={30} width={64} height={64} />);
diff --git a/sdk/raea/bench/bevy-ts/cases/reflect-keyed-resource-live.tsx b/sdk/raea/bench/bevy-ts/cases/reflect-keyed-resource-live.tsx
new file mode 100644
index 00000000..7dbe6fda
--- /dev/null
+++ b/sdk/raea/bench/bevy-ts/cases/reflect-keyed-resource-live.tsx
@@ -0,0 +1,29 @@
+// gap: FC1c
+// A reflected resource keyed per frame (docs/control.feature FC1c): Bevy's GlobalAmbientLight, given as a
+// <BevyResource>, at brightness 0 before frame 10 and 20000 from it, the only light on a white cube. At frame 15 the
+// cube is lit (live: played live, one World across the change).
+// play: live-world.json 0.5
+// probe: 32 32 r>200 g>200 b>200
+import { AbsoluteFill, Composition, registerRoot, useCurrentFrame } from "raea";
+import { BevyResource, Canvas3D } from "raea/3d";
+import { StandardMaterial } from "raea/pbr";
+import { Cuboid, Mesh3d } from "raea/mesh";
+import { Transform } from "raea/transform";
+import { Camera3d } from "raea/camera";
+
+function Ambient() {
+ const f = useCurrentFrame();
+ return <BevyResource type="bevy_light::ambient_light::GlobalAmbientLight" value={{ color: { Srgba: { red: 1, green: 1, blue: 1, alpha: 1 } }, brightness: f < 10 ? 0 : 20000, affects_lightmapped_meshes: true }} />;
+}
+function Shot() {
+ return (
+ <AbsoluteFill style={{ background: "#000" }}>
+ <Canvas3D layered>
+ <Camera3d transform={Transform.fromXyz(0, 0, 5).lookingAt([0, 0, 0])} />
+ <Mesh3d transform={Transform.fromXyz(0, 0, 0)}><Cuboid half_size={[0.6, 0.6, 0.6]} /><StandardMaterial base_color="#ffffff" /></Mesh3d>
+ <Ambient />
+ </Canvas3D>
+ </AbsoluteFill>
+ );
+}
+registerRoot(() => <Composition id="main" component={Shot} durationInFrames={30} fps={30} width={64} height={64} />);
diff --git a/sdk/raea/bench/bevy-ts/cases/reflect-keyed-resource-still.tsx b/sdk/raea/bench/bevy-ts/cases/reflect-keyed-resource-still.tsx
new file mode 100644
index 00000000..9b160850
--- /dev/null
+++ b/sdk/raea/bench/bevy-ts/cases/reflect-keyed-resource-still.tsx
@@ -0,0 +1,29 @@
+// gap: FC1c
+// A reflected resource keyed per frame (docs/control.feature FC1c): Bevy's GlobalAmbientLight, given as a
+// <BevyResource>, at brightness 0 before frame 10 and 20000 from it, the only light on a white cube. At frame 15 the
+// cube is lit (still: a render stepped from frame 0, which kept only frame 0's resource before FC1c).
+// frame: 15
+// probe: 32 32 r>200 g>200 b>200
+import { AbsoluteFill, Composition, registerRoot, useCurrentFrame } from "raea";
+import { BevyResource, Canvas3D } from "raea/3d";
+import { StandardMaterial } from "raea/pbr";
+import { Cuboid, Mesh3d } from "raea/mesh";
+import { Transform } from "raea/transform";
+import { Camera3d } from "raea/camera";
+
+function Ambient() {
+ const f = useCurrentFrame();
+ return <BevyResource type="bevy_light::ambient_light::GlobalAmbientLight" value={{ color: { Srgba: { red: 1, green: 1, blue: 1, alpha: 1 } }, brightness: f < 10 ? 0 : 20000, affects_lightmapped_meshes: true }} />;
+}
+function Shot() {
+ return (
+ <AbsoluteFill style={{ background: "#000" }}>
+ <Canvas3D layered>
+ <Camera3d transform={Transform.fromXyz(0, 0, 5).lookingAt([0, 0, 0])} />
+ <Mesh3d transform={Transform.fromXyz(0, 0, 0)}><Cuboid half_size={[0.6, 0.6, 0.6]} /><StandardMaterial base_color="#ffffff" /></Mesh3d>
+ <Ambient />
+ </Canvas3D>
+ </AbsoluteFill>
+ );
+}
+registerRoot(() => <Composition id="main" component={Shot} durationInFrames={30} fps={30} width={64} height={64} />);
diff --git a/sdk/raea/bench/bevy-ts/cases/reflect-keyed-still.tsx b/sdk/raea/bench/bevy-ts/cases/reflect-keyed-still.tsx
new file mode 100644
index 00000000..a4a0a5af
--- /dev/null
+++ b/sdk/raea/bench/bevy-ts/cases/reflect-keyed-still.tsx
@@ -0,0 +1,34 @@
+// gap: FC1c
+// A reflected value keyed per frame in the plain build (docs/control.feature FC1c): a bare <Entity> whose
+// MeshMaterial3d<StandardMaterial>, given as a <BevyComponent>, turns from red to green at frame 10. At frame 15 it is
+// green (still: a render stepped from frame 0, so the value is the keyed one).
+// frame: 15
+// probe: 32 32 g>150 r<100
+import { AbsoluteFill, Composition, registerRoot, useCurrentFrame } from "raea";
+import { BevyComponent, Canvas3D, Entity } from "raea/3d";
+import { Camera3d } from "raea/camera";
+import { Transform } from "raea/transform";
+
+const rgb = (r: number, g: number) => ({ Srgba: { red: r, green: g, blue: 0, alpha: 1 } });
+
+function Cube() {
+ const f = useCurrentFrame();
+ return (
+ <Entity name="cube">
+ <BevyComponent type="bevy_mesh::components::Mesh3d" value="shape:box(1.2, 1.2, 1.2)" />
+ <BevyComponent type="bevy_pbr::mesh_material::MeshMaterial3d<bevy_pbr::pbr_material::StandardMaterial>" value={{ base_color: f < 10 ? rgb(1, 0) : rgb(0, 1), unlit: true }} />
+ </Entity>
+ );
+}
+
+function Shot() {
+ return (
+ <AbsoluteFill style={{ background: "#000" }}>
+ <Canvas3D layered>
+ <Camera3d transform={Transform.fromXyz(0, 0, 5).lookingAt([0, 0, 0])} />
+ <Cube />
+ </Canvas3D>
+ </AbsoluteFill>
+ );
+}
+registerRoot(() => <Composition id="main" component={Shot} durationInFrames={30} fps={30} width={64} height={64} />);
diff --git a/sdk/raea/conformance/bevy3d.test.tsx b/sdk/raea/conformance/bevy3d.test.tsx
index e1f95728..5af15212 100644
--- a/sdk/raea/conformance/bevy3d.test.tsx
+++ b/sdk/raea/conformance/bevy3d.test.tsx
@@ -5,8 +5,7 @@ import * as three from "../src/3d";
import { Capsule, Cuboid, Capsule3d, Cylinder, DepthOfField, Entity, Group, Mesh, Model, MeshBasicMaterial, MeshStandardMaterial, MeshToonMaterial, PerspectiveCamera, Plane3d, Screen, Sphere, Torus } from "../src/3d";
// the retired three.js shapes, compared against (M5: no longer exported from raea)
import { Box, Plane } from "@raea/render/3d/shapes";
-import { Affine2, AmbientLight, Camera3d, DirectionalLight, ExtendedMaterial, GridExtension, LinearRgba, PaintExtension, ToonExtension, WearExtension, Mesh3d, PointLight, Quat, RectLight, SpotLight, Srgba, StandardMaterial, Transform, eulerOf } from "@raea/render/bevy3d";
-import { UNITS } from "raea/daylight";
+import { Affine2, AmbientLight, Camera3d, DirectionalLight, ExtendedMaterial, GridExtension, LinearRgba, PaintExtension, ToonExtension, WearExtension, Mesh3d, PointLight, Quat, RectLight, SpotLight, Srgba, StandardMaterial, Transform, eulerOf, light_consts } from "@raea/render/bevy3d";
import { Circle, ColorMaterial, Ellipse, Mesh2d, Rectangle, RegularPolygon, Shape2D } from "raea/sprite";
import { ToonMaterial } from "raea/pbr";
import { ConicalFrustum } from "raea/mesh";
@@ -52,7 +51,8 @@ describe("Quat and Transform", () => {
expect(close(f, want, 1e-9)).toBe(true);
expect(Quat.mulVec3(t.rotation, [0, 1, 0])[1]).toBeGreaterThan(0.9);
expect(Math.hypot(...t.rotation)).toBeCloseTo(1, 12);
- expect(() => Transform.fromXyz(0, 0, 0).lookingAt([0, 0, 0])).toThrow(/at the eye/);
+ // Bevy's fallback, not a throw: a target at the eye looks down -Z (the identity)
+ expect(Transform.fromXyz(0, 0, 0).lookingAt([0, 0, 0]).rotation.map((v) => v + 0)).toEqual([0, 0, 0, 1]);
});
test("Transform is also the component's handle, so a program can `with(Transform, value)`", () => {
@@ -121,8 +121,14 @@ describe("Mesh3d, Camera3d and StandardMaterial", () => {
test("Mesh3d's transform is the Mesh's place; Hidden draws nothing", () => {
const q = Quat.fromRotationY(0.5);
+ // the rotation stays Bevy's quaternion (docs/control.feature FC1d); one an `animate` turns keeps the Euler angles
+ // its tracks patch
expect(html(<Mesh3d transform={Transform.fromXyz(1, 2, 3).withRotation(q)}><Sphere radius={0.5} /></Mesh3d>)).toBe(
- html(<Mesh position={[1, 2, 3]} rotation={eulerOf(q)} scale={[1, 1, 1]}><Sphere args={[0.5]} /></Mesh>),
+ html(<Mesh position={[1, 2, 3]} quaternion={q} scale={[1, 1, 1]}><Sphere args={[0.5]} /></Mesh>),
+ );
+ const spin = { rotateY: track({ 0: 0, 10: 1 }) };
+ expect(html(<Mesh3d transform={Transform.fromXyz(1, 2, 3).withRotation(q)} animate={spin}><Sphere radius={0.5} /></Mesh3d>)).toBe(
+ html(<Mesh position={[1, 2, 3]} rotation={eulerOf(q)} scale={[1, 1, 1]} animate={spin}><Sphere args={[0.5]} /></Mesh>),
);
expect(html(<Mesh3d visibility="Hidden"><Sphere /></Mesh3d>)).toBe("");
});
@@ -202,6 +208,20 @@ describe("Mesh3d, Camera3d and StandardMaterial", () => {
expect(() => html(<ExtendedMaterial base={<StandardMaterial animate={{ metallic: track({ 0: 0, 30: 1 }) }} />} extension={<ToonExtension />} />)).toThrow(/takes base_color, emissive/);
});
+ test("animate: any other field that interpolates goes by its Bevy name, set on the part's own material (FC1c)", () => {
+ const coat = track({ 0: 0, 30: 1 });
+ const tint = track({ 0: "#ffffff", 30: "#ff0000" });
+ const h = html(<StandardMaterial animate={{ clearcoat: coat, specular_tint: tint, metallic: coat }} />);
+ const attr = (name: string) => JSON.parse(new RegExp(`${name}="([^"]*)"`).exec(h)![1].replace(/&quot;/g, '"'));
+ // the engine samples them (runtime/react animate.rs) onto the props, which start at frame 0's value
+ expect(attr("data-raea-anim").tracks.map((t: { prop: string }) => t.prop).sort()).toEqual(["field:clearcoat", "field:specular_tint", "metalness"]);
+ expect(attr("data-props")["field:clearcoat"]).toBe(0);
+ expect(() => html(<StandardMaterial animate={{ clearcoat: tint as never }} />)).toThrow(/clearcoat keys are numbers/);
+ expect(() => html(<StandardMaterial animate={{ attenuation_color: coat as never }} />)).toThrow(/attenuation_color keys are colours/);
+ expect(() => html(<StandardMaterial animate={{ unlit: coat } as never} />)).toThrow(/not unlit/);
+ expect(() => html(<ExtendedMaterial base={<StandardMaterial animate={{ clearcoat: coat }} />} extension={<GridExtension cell={1} />} />)).toThrow(/an ExtendedMaterial takes/);
+ });
+
test("uv_transform: a scale is the old repeat, a turn or a move its uvTransform too", () => {
expect(html(<StandardMaterial base_color_texture="a.jpg" uv_transform={Affine2.fromScale([2, 3])} />)).toBe(html(<MeshStandardMaterial color="#ffffff" roughness={0.5} metalness={0} map="a.jpg" repeat={[2, 3]} />));
expect(html(<StandardMaterial uv_transform={Affine2.IDENTITY} />)).toBe(html(<StandardMaterial />));
@@ -267,10 +287,13 @@ describe("Mesh3d, Camera3d and StandardMaterial", () => {
describe("Bevy's lights, in Bevy's units", () => {
const props = (h: string) => JSON.parse(h.match(/data-props="([^"]*)"/)![1].replace(/&quot;/g, '"'));
- test("the units are the rows' (daylight.tsx's UNITS): lux, lumens and cd/m² come back as written", () => {
- expect(UNITS.lux * props(html(<DirectionalLight illuminance={100_000} />)).intensity).toBeCloseTo(100_000, 6);
- expect(UNITS.lumens * props(html(<PointLight intensity={800} />)).intensity).toBeCloseTo(800, 6);
- expect(UNITS.ambientNits * props(html(<AmbientLight brightness={80} />)).intensity).toBeCloseTo(80, 6);
+ test("the units go to the rows as written (docs/control.feature FC1f): lux, lumens and cd/m², no hidden scale", () => {
+ expect(props(html(<DirectionalLight illuminance={light_consts.lux.DIRECT_SUNLIGHT} />)).lux).toBe(100_000);
+ expect(props(html(<PointLight intensity={800} />)).lumens).toBe(800);
+ expect(props(html(<SpotLight intensity={light_consts.lumens.VERY_LARGE_CINEMA_LIGHT} />)).lumens).toBe(1_000_000);
+ expect(props(html(<RectLight intensity={900} />)).lumens).toBe(900);
+ expect(props(html(<AmbientLight brightness={80} />)).nits).toBe(80);
+ expect(() => html(<three.PointLight lumens={-1} />)).toThrow(/lumens must be 0 or more/);
});
test("an AmbientLight on a Camera3d is the camera's own (Bevy 0.20), beside it and marked so the scene's others give way", () => {
@@ -278,15 +301,15 @@ describe("Bevy's lights, in Bevy's units", () => {
const lights = [...h.matchAll(/data-3d="AmbientLight" data-props="([^"]*)"/g)].map((m) => JSON.parse(m[1].replace(/&quot;/g, '"')));
expect(lights).toHaveLength(1);
expect(lights[0].camera).toBe(true);
- expect(UNITS.ambientNits * lights[0].intensity).toBeCloseTo(200, 6);
+ expect(lights[0].nits).toBe(200);
expect(props(html(<AmbientLight />)).camera).toBeUndefined();
expect(() => html(<Camera3d><AmbientLight {...({ intensity: 1 } as object)} /></Camera3d>)).toThrow(/`intensity` is 3d.tsx/);
});
test("PointLight sits at its translation, with Bevy's defaults (1e6 lm, range 20, no shadows)", () => {
- expect(html(<PointLight transform={Transform.fromXyz(1, 3, 2)} />)).toBe(html(<three.PointLight position={[1, 3, 2]} intensity={1_000_000 / 9e5} distance={20} castShadow={false} />));
+ expect(html(<PointLight transform={Transform.fromXyz(1, 3, 2)} />)).toBe(html(<three.PointLight position={[1, 3, 2]} lumens={1_000_000} distance={20} castShadow={false} />));
expect(html(<PointLight shadow_maps_enabled soft_shadows_enabled radius={0.1} color="#ffaa66" />)).toBe(
- html(<three.PointLight position={[0, 0, 0]} intensity={1_000_000 / 9e5} distance={20} castShadow softShadow={0.1} color="#ffaa66" />),
+ html(<three.PointLight position={[0, 0, 0]} lumens={1_000_000} distance={20} castShadow softShadow={0.1} color="#ffaa66" />),
);
});
@@ -298,12 +321,12 @@ describe("Bevy's lights, in Bevy's units", () => {
expect(spot.penumbra).toBeCloseTo(0.5, 12);
const sun = props(html(<DirectionalLight transform={Transform.fromRotation(Quat.fromRotationX(-Math.PI / 2))} shadow_maps_enabled />));
expect(close(sun.target.map((v: number, i: number) => v - sun.position[i]), [0, -1, 0], 1e-9)).toBe(true);
- expect(sun.intensity).toBeCloseTo(10_000 / UNITS.lux, 12);
+ expect(sun.lux).toBe(10_000);
expect(sun.castShadow).toBe(true);
});
test("RectLight faces its -Z in lumens; Hidden lights nothing; 3d.tsx's props are refused", () => {
- expect(props(html(<RectLight intensity={9e5} width={2} />))).toMatchObject({ intensity: 1, width: 2, height: 1, distance: 20 });
+ expect(props(html(<RectLight intensity={9e5} width={2} />))).toMatchObject({ lumens: 9e5, width: 2, height: 1, distance: 20 });
expect(html(<PointLight visibility="Hidden" />)).toBe("");
expect(() => html(<PointLight {...({ position: [0, 1, 0] } as object)} />)).toThrow(/`position` is 3d.tsx's/);
expect(() => html(<DirectionalLight {...({ intensity: 1 } as object)} />)).toThrow(/`intensity` is 3d.tsx's/);
diff --git a/sdk/raea/conformance/glam.json b/sdk/raea/conformance/glam.json
new file mode 100644
index 00000000..8e568f86
--- /dev/null
+++ b/sdk/raea/conformance/glam.json
@@ -0,0 +1 @@
+[{"op":"x","a":0,"q":[0,0,0,1]},{"op":"y","a":0,"q":[0,0,0,1]},{"op":"z","a":0,"q":[0,0,0,1]},{"op":"x","a":0.5,"q":[0.24740396,0,0,0.9689124]},{"op":"y","a":0.5,"q":[0,0.24740396,0,0.9689124]},{"op":"z","a":0.5,"q":[0,0,0.24740396,0.9689124]},{"op":"x","a":-1.25,"q":[-0.58509725,0,0,0.8109631]},{"op":"y","a":-1.25,"q":[0,-0.58509725,0,0.8109631]},{"op":"z","a":-1.25,"q":[0,0,-0.58509725,0.8109631]},{"op":"x","a":1.5707964,"q":[0.70710677,0,0,0.70710677]},{"op":"y","a":1.5707964,"q":[0,0.70710677,0,0.70710677]},{"op":"z","a":1.5707964,"q":[0,0,0.70710677,0.70710677]},{"op":"x","a":3,"q":[0.997495,0,0,0.0707372]},{"op":"y","a":3,"q":[0,0.997495,0,0.0707372]},{"op":"z","a":3,"q":[0,0,0.997495,0.0707372]},{"op":"axis","axis":[0.26726124,0.5345225,0.8017837],"a":1,"q":[0.12813187,0.25626373,0.38439557,0.87758255]},{"op":"euler","order":"XYZ","abc":[0.3,-0.7,1.1],"q":[-0.057539985,-0.3624201,0.4417997,0.81862926]},{"op":"euler","order":"XYZ","abc":[0.5,1.5707964,0.3],"q":[0.27536035,0.6512885,0.27536035,0.6512885]},{"op":"euler","order":"XZY","abc":[0.3,-0.7,1.1],"q":[0.29689157,0.52916986,-0.2156724,0.7650622]},{"op":"euler","order":"XZY","abc":[0.5,1.5707964,0.3],"q":[0.07059288,-0.07059288,0.7035742,0.7035742]},{"op":"euler","order":"YXZ","abc":[0.3,-0.7,1.1],"q":[-0.2156724,0.29689157,0.52916986,0.7650622]},{"op":"euler","order":"YXZ","abc":[0.5,1.5707964,0.3],"q":[0.7035742,0.07059288,-0.07059288,0.7035742]},{"op":"euler","order":"YZX","abc":[0.3,-0.7,1.1],"q":[0.4417997,-0.057539985,-0.3624201,0.81862926]},{"op":"euler","order":"YZX","abc":[0.5,1.5707964,0.3],"q":[0.27536035,0.27536035,0.6512885,0.6512885]},{"op":"euler","order":"ZXY","abc":[0.3,-0.7,1.1],"q":[-0.3624201,0.4417997,-0.057539985,0.81862926]},{"op":"euler","order":"ZXY","abc":[0.5,1.5707964,0.3],"q":[0.6512885,0.27536035,0.27536035,0.6512885]},{"op":"euler","order":"ZYX","abc":[0.3,-0.7,1.1],"q":[0.52916986,-0.2156724,0.29689157,0.7650622]},{"op":"euler","order":"ZYX","abc":[0.5,1.5707964,0.3],"q":[-0.07059288,0.7035742,0.07059288,0.7035742]},{"op":"mul","a":[0,0.19866933,0,0.9800666],"b":[-0.43496552,0,0,0.90044713],"q":[-0.4262952,0.17889123,0.08641431,0.88249815]},{"op":"mulVec3","q":[0,0.19866933,0,0.9800666],"v":[1,2,3],"out":[2.0893161,2,2.3737648]},{"op":"lookingAt","eye":[0.0, 2.0, 7.0],"target":[0.0, 0.5, 0.0],"up":[0.0, 1.0, 0.0],"q":[-0.10535081,-0,-0,0.99443513]},{"op":"lookingAt","eye":[3.0, -1.0, 2.0],"target":[0.0, 0.0, 0.0],"up":[0.0, 0.0, 1.0],"q":[0.39136764,0.2820818,0.512168,0.710595]},{"op":"lookingAt","eye":[0.0, 5.0, 0.0],"target":[0.0, 0.0, 0.0],"up":[0.0, 1.0, 0.0],"q":[0.5,-0.5,-0.5,-0.5]}]
diff --git a/sdk/raea/conformance/glam.test.ts b/sdk/raea/conformance/glam.test.ts
new file mode 100644
index 00000000..392b79d5
--- /dev/null
+++ b/sdk/raea/conformance/glam.test.ts
@@ -0,0 +1,33 @@
+// The TS Transform/Quat helpers against glam's answers for the same inputs (docs/control.feature FC1d). glam.json comes
+// from core/scene/tests/glam_fixture.rs: `cargo test --release -p raea-core-scene --test glam_fixture -- --ignored --nocapture`.
+import { expect, test } from "bun:test";
+import { Quat, Transform } from "@raea/render/bevy3d";
+import fixture from "./glam.json";
+
+type Q = [number, number, number, number];
+type V = [number, number, number];
+// q and -q are the same turn
+const near = (got: number[], want: number[]) => {
+ const sign = got.reduce((s, g, i) => s + g * want[i], 0) < 0 && got.length === 4 ? -1 : 1;
+ for (let i = 0; i < want.length; i++) expect(Math.abs(sign * got[i] - want[i])).toBeLessThan(1e-6);
+};
+
+for (const [n, row] of (fixture as any[]).entries()) {
+ test(`${n} ${row.op}${row.order ? " " + row.order : ""}`, () => {
+ switch (row.op) {
+ case "x": return near(Quat.fromRotationX(row.a), row.q);
+ case "y": return near(Quat.fromRotationY(row.a), row.q);
+ case "z": return near(Quat.fromRotationZ(row.a), row.q);
+ case "axis": return near(Quat.fromAxisAngle(row.axis as V, row.a), row.q);
+ case "euler": return near(Quat.fromEuler(row.order, ...(row.abc as V)), row.q);
+ case "mul": return near(Quat.mul(row.a as Q, row.b as Q), row.q);
+ case "mulVec3": return near(Quat.mulVec3(row.q as Q, row.v as V), row.out);
+ case "lookingAt": return near(Transform.fromTranslation(row.eye as V).lookingAt(row.target as V, row.up as V).rotation, row.q);
+ default: throw new Error(`unknown op ${row.op}`);
+ }
+ });
+}
+
+test("the fixture covers every op", () => {
+ expect(new Set((fixture as any[]).map((r) => r.op))).toEqual(new Set(["x", "y", "z", "axis", "euler", "mul", "mulVec3", "lookingAt"]));
+});
diff --git a/sdk/raea/conformance/instances.test.tsx b/sdk/raea/conformance/instances.test.tsx
new file mode 100644
index 00000000..23100f7e
--- /dev/null
+++ b/sdk/raea/conformance/instances.test.tsx
@@ -0,0 +1,78 @@
+// <Instances> and scatter(): placements packed 9 numbers a copy onto a Mesh or Model node, the errors, and scatter's
+// determinism, spacing, avoid, clearOf, ground height and density.
+import { describe, expect, test } from "bun:test";
+import { BufferMesh, Cuboid, Instances, MeshStandardMaterial, MeshToonMaterial, scatter } from "raea/3d";
+import { renderFrame } from "../src/test";
+
+const html = (el: React.ReactElement) => renderFrame(el, { frame: 0, width: 320, height: 240, fps: 30, durationInFrames: 30 });
+const props = (h: string, kind: string) => {
+ const m = h.match(new RegExp(`data-3d="${kind}"[^>]*data-props="([^"]*)"`));
+ if (!m) throw new Error(`no ${kind} in ${h.slice(0, 300)}`);
+ return JSON.parse(m[1].replace(/&quot;/g, '"').replace(/&amp;/g, "&"));
+};
+
+describe("Instances", () => {
+ test("the mesh form: a Mesh node with its shape and the placements, 9 numbers a copy", () => {
+ const at = [{ position: [1, 0, 2] as [number, number, number] }, { position: [0, 0, 0] as [number, number, number], rotation: [0, 1.5, 0] as [number, number, number], scale: 2 }];
+ const h = html(<Instances at={at} shadow={false}><Cuboid args={[1, 1, 1]} /><MeshStandardMaterial color="#336633" /></Instances>);
+ expect(h).toContain('data-shape="');
+ const p = props(h, "Mesh");
+ expect(p.at).toEqual([1, 0, 2, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1.5, 0, 2, 2, 2]);
+ expect(p.shadow).toBe(false);
+ });
+ test("the glTF form: a Model node", () => {
+ const p = props(html(<Instances src="daisy.glb" at={[{ position: [0, 0, 0] }]} />), "Model");
+ expect(p.src).toBe("daisy.glb");
+ expect(p.at).toHaveLength(9);
+ });
+ test("a buffer mesh is a shape", () => {
+ const h = html(<Instances at={[{ position: [0, 0, 0] }]}><BufferMesh positions={[0, 0, 0, 1, 0, 0, 0, 1, 0]} /><MeshStandardMaterial /></Instances>);
+ expect(h).toContain("buffer:");
+ });
+ test("the same list is packed once", () => {
+ const at = scatter({ area: { min: [0, 0], max: [4, 4] }, count: 50 });
+ const a = props(html(<Instances src="a.glb" at={at} />), "Model").at;
+ const b = props(html(<Instances src="a.glb" at={at} />), "Model").at;
+ expect(a).toEqual(b);
+ });
+ test("errors say what's wrong", () => {
+ expect(() => html(<Instances src="a.png" at={[]} />)).toThrow(/\.glb or \.gltf/);
+ expect(() => html(<Instances at={[]} />)).toThrow(/geometry child/);
+ expect(() => html(<Instances src="a.glb" at={{} as never} />)).toThrow(/at must be a list/);
+ expect(() => html(<Instances src="a.glb" at={[{ position: [0, 0] as never }]} />)).toThrow(/at\[0\]\.position/);
+ expect(() => html(<Instances src="a.glb" at={[{ position: [0, 0, 0], scale: 0 }]} />)).toThrow(/positive/);
+ expect(() => html(<Instances src="a.glb" at={[]} {...({ animation: "Walk" } as object)} />)).toThrow(/can't play a clip/);
+ expect(() => html(<Instances at={[{ position: [0, 0, 0] }]}><Cuboid /><MeshToonMaterial color="#fff" /></Instances>)).toThrow(/toon/);
+ });
+});
+
+describe("scatter", () => {
+ const area = { min: [-10, -10] as [number, number], max: [10, 10] as [number, number] };
+ test("the same seed, the same points; another seed, others", () => {
+ expect(scatter({ area, count: 200, seed: 3 })).toEqual(scatter({ area, count: 200, seed: 3 }));
+ expect(scatter({ area, count: 200, seed: 4 })).not.toEqual(scatter({ area, count: 200, seed: 3 }));
+ });
+ test("spacing holds between every pair", () => {
+ const pts = scatter({ area, count: 300, spacing: 0.8 });
+ for (let i = 0; i < pts.length; i++) for (let j = i + 1; j < pts.length; j++) {
+ const [a, b] = [pts[i].position, pts[j].position];
+ expect(Math.hypot(a[0] - b[0], a[2] - b[2])).toBeGreaterThanOrEqual(0.8);
+ }
+ });
+ test("avoid and clearOf keep points off", () => {
+ const road = { min: [-2, -10] as [number, number], max: [2, 10] as [number, number] };
+ for (const p of scatter({ area, count: 300, avoid: [road], margin: 0.5 })) expect(Math.abs(p.position[0])).toBeGreaterThan(2.5);
+ const first = scatter({ area, count: 40, spacing: 2, seed: 9 });
+ for (const p of scatter({ area, count: 40, spacing: 2, clearOf: first, seed: 10 })) for (const q of first) {
+ expect(Math.hypot(p.position[0] - q.position[0], p.position[2] - q.position[2])).toBeGreaterThanOrEqual(2);
+ }
+ });
+ test("the ground's height and a density map", () => {
+ const pts = scatter({ area, count: 100, y: (x, z) => x + z, density: (x) => (x > 0 ? 1 : 0), tilt: 0.2 });
+ for (const p of pts) {
+ expect(p.position[1]).toBeCloseTo(p.position[0] + p.position[2], 9);
+ expect(p.position[0]).toBeGreaterThan(0);
+ expect(Math.hypot(p.rotation![0], p.rotation![2])).toBeLessThanOrEqual(0.2 + 1e-9);
+ }
+ });
+});
diff --git a/sdk/raea/src/light.ts b/sdk/raea/src/light.ts
index 18b7b22e..3b58492c 100644
--- a/sdk/raea/src/light.ts
+++ b/sdk/raea/src/light.ts
@@ -2,7 +2,7 @@
// into it at M5; until then the old subpaths and this one export the same values.
// raea/light (bevy_light): Bevy's lights in Bevy's units (lux, lumens, cd/m²; bevy3d.tsx), environments and
// daylight. 3d.tsx's lights, in raea's relative units, stay under /3d.
-export { AmbientLight, GlobalAmbientLight, DirectionalLight, PointLight, SpotLight, RectLight, type AmbientLightProps, type DirectionalLightProps, type PointLightProps, type SpotLightProps, type RectLightProps } from "@raea/render/bevy3d";
+export { AmbientLight, GlobalAmbientLight, DirectionalLight, PointLight, SpotLight, RectLight, light_consts, type AmbientLightProps, type DirectionalLightProps, type PointLightProps, type SpotLightProps, type RectLightProps } from "@raea/render/bevy3d";
export { Atmosphere, Environment, Shadows, type AtmosphereProps, type EnvironmentProps, type ShadowsProps } from "./3d";
export * from "@raea/render/daylight";
// ray-traced lighting (Bevy's Solari, docs/raytracing.feature RT3)
diff --git a/sdk/raea/src/mesh.ts b/sdk/raea/src/mesh.ts
index 5c3878ff..e49c7881 100644
--- a/sdk/raea/src/mesh.ts
+++ b/sdk/raea/src/mesh.ts
@@ -7,3 +7,5 @@ export { Mesh3d, ConicalFrustum, type Mesh3dProps, type ConicalFrustumProps } fr
export { Cuboid, Capsule3d, Plane3d, type CuboidProps, type Capsule3dProps, type Plane3dProps } from "./3d";
export { MeshSequence, type MeshSequenceProps } from "@raea/physics/physics";
export { Mesh2d, type Mesh2dProps } from "@raea/render/bevy3d";
+// one mesh or glTF drawn at many placements, batched by the GPU, and the seeded placements for it
+export { Instances, scatter, type Instance, type InstancesProps, type PlanBox, type ScatterOptions } from "./3d";
diff --git a/sdk/raea/tools/motion-check.ts b/sdk/raea/tools/motion-check.ts
deleted file mode 100644
index 1d11b64d..00000000
--- a/sdk/raea/tools/motion-check.ts
+++ /dev/null
@@ -1,204 +0,0 @@
-// Motion check: a body's performances on the fixed suite (tools/motion-suite.ts) measured against the motion goal's bars.
-//
-// bun sdk/raea/tools/motion-check.ts SKELETON.json [--only NAME,NAME] [--out FILE]
-//
-// Every measure reads the delivered poses and the library's own clips, never the pipeline's internals, so a new
-// pipeline is judged the same way as the old:
-// slide a foot's contact point (the sole under the ankle, the heel, and under the ball, each turned with its joint;
-// down = within 1.5 cm of the floor) moving over the floor during one contact: the most over any contact, cm (bar < 1)
-// pops frames where a down foot moves more than 2 cm in a frame (bar 0)
-// switch at each switch (the played clip changes, or skips more than 2 frames) and 3 frames round it, the most any
-// joint turns in a frame beyond what the source turns it: the faster of the clip showing (at the rate it
-// plays) and the clip before the switch carried on at its rate (bar < 10 degrees)
-// inside frames with a hand or forearm more than 1.5 cm into the trunk, % (bar under 1%)
-// kinks frames where a joint turns more than 4 degrees further than the mean of the frames either side, % (bar < 2)
-// grip a held thing's place in its hand's frame drifting from where it was taken, cm and degrees (bar < 0.5 cm)
-import { readFileSync, writeFileSync } from "node:fs";
-import { B, SIDES, joint, mirrorName, palmAt, pose, qinv, qmul, qrot, surface, type Pose, type Quat, type Skeleton } from "raea/character";
-import { clipFrame } from "raea/clip";
-import { perform, type MotionLibrary } from "raea/matching";
-import { interact } from "raea/items";
-import { locoClips, suiteCases, suiteLibrary } from "./motion-suite";
-import { faults, reference } from "./motion-faults";
-import { sceneFaults } from "./scene-faults";
-import { buildDb, perform as performBody } from "raea/body";
-
-const BARS = { slide: 1, pops: 0, switch: 10, inside: 1, kinks: 2, grip: 0.5 };
-const DEG = 180 / Math.PI;
-const ang = (q: Quat) => 2 * Math.acos(Math.min(1, Math.abs(q[3]))) * DEG;
-const sub = (a: number[], b: number[]) => a.map((x, i) => x - b[i]), dot = (a: number[], b: number[]) => a.reduce((s, x, i) => s + x * b[i], 0);
-const TRUNK = /^(hips|waist|torso|chest)$/, ARM = /^(palm|foreArm)$/;
-
-type World = ReturnType<typeof pose>;
-
-/** each joint's turn from the frame before, degrees */
-const speeds = (W: World[]) => W.map((w, f) => (f ? w.rot.map((q, i) => ang(qmul(q, qinv(W[f - 1].rot[i])))) : w.rot.map(() => 0)));
-
-function feet(skel: Skeleton, W: World[]) {
- const J = skel.joints, z = (n: string) => J[joint(skel, n)].head[1];
- let slide = 0, pops = 0, where = "";
- for (const s of SIDES) {
- for (const n of [B.foot(s), B.ball(s)]) {
- // (the sole under the joint: the heel under the ankle, the tread under the ball, turned as the joint turns)
- const i = joint(skel, n), drop = [0, -z(n), 0] as any, sole = (w: World) => sub(w.pos[i], [0, 0, 0]).map((x, k) => x + (qrot(w.rot[i], drop) as number[])[k]);
- let start: number[] | null = null, far = 0;
- for (let f = 0; f < W.length; f++) {
- const p = sole(W[f]), down = p[1] < 0.015;
- if (!down) { start = null; continue; }
- if (!start) { start = p; continue; }
- const d = Math.hypot(p[0] - start[0], p[2] - start[2]);
- if (d > far) { far = d; if (far > slide) where = `${n}@${f}`; }
- const q = sole(W[f - 1]);
- if (Math.hypot(p[0] - q[0], p[2] - q[2]) > 0.02) pops++;
- }
- slide = Math.max(slide, far);
- }
- }
- return { slide: slide * 100, pops, slideAt: where };
-}
-
-function switches(skel: Skeleton, lib: MotionLibrary, played: { clip: string; f: number }[], W: World[], sp: number[][]) {
- // what the source does through a switch is both clips at the rate they play: the clip played before it, carried on at
- // its rate (what the blend fades out of), and the one after; a joint's turn in a frame beyond the faster of the two
- // is what the switch added (measured against one-frame steps of the new clip alone, a body slowing out of a clip
- // played at 1.5x read as a jump)
- const byName = new Map(lib.clips.map((c) => [c.name + (c.mirrored ? "~" : ""), c]));
- const swap = skel.joints.map((j) => joint(skel, mirrorName(j.name)));
- const worlds = new Map<string, World[]>();
- const worldOf = (name: string) => {
- const c = byName.get(name);
- if (!c) return null;
- let w = worlds.get(name);
- if (!w) {
- const nj = c.clip.turns.length / (c.clip.frames * 4);
- w = Array.from({ length: c.clip.frames }, (_, k) => pose(skel, clipFrame(c.clip, k, nj)));
- worlds.set(name, w);
- }
- return w;
- };
- /** each joint's turn in the named clip from frame a to frame b (clamped), degrees */
- const step = (name: string, a: number, b: number) => {
- const w = worldOf(name), c = byName.get(name);
- if (!w || !c) return null;
- const A = w[Math.max(0, Math.min(w.length - 1, Math.round(a)))], Bf = w[Math.max(0, Math.min(w.length - 1, Math.round(b)))];
- const row = A.rot.map((q, i) => ang(qmul(Bf.rot[i], qinv(q))));
- return c.mirrored ? row.map((_, i) => row[swap[i]]) : row;
- };
- const at: number[] = [];
- for (let f = 1; f < played.length; f++) if (played[f].clip !== played[f - 1].clip || Math.abs(played[f].f - played[f - 1].f) > 2) at.push(f);
- let worst = 0, where = "", detail = "";
- for (const s of at) {
- const o = played[s - 1], r = s >= 2 && played[s - 2].clip === o.clip ? o.f - played[s - 2].f : 1;
- for (let f = Math.max(1, s - 3); f <= Math.min(W.length - 1, s + 3); f++) {
- const p = played[f], q = played[f - 1];
- // the clip showing now, at the rate it plays (one frame at its switch, which has no frame before in it)
- // (a clip played below 1x shows a frame twice: it is between frames, not still, so the step is the frame before's)
- const now = step(p.clip, q.clip === p.clip && f !== s && q.f !== p.f ? q.f : p.f - 1, p.f);
- // the clip before the switch carried on at its rate
- const was = f >= s ? step(o.clip, o.f + r * (f - s), o.f + r * (f - s + 1)) : null;
- if (!now) continue;
- sp[f].forEach((v, i) => { const d = v - Math.max(now[i], was ? was[i] : 0); if (d > worst) { worst = d; where = `${skel.joints[i].name}@${f}`; detail = `${v.toFixed(0)} vs ${now[i].toFixed(0)}/${was ? was[i].toFixed(0) : "-"}`; } });
- }
- }
- return { switch: worst, switchAt: where, switchDetail: detail, switches: at.length };
-}
-
-function inside(skel: Skeleton, W: World[]) {
- let bad = 0, n = 0;
- for (let f = 0; f < W.length; f += 2) {
- n++;
- const trunk = surface(skel, W[f], TRUNK), arms = surface(skel, W[f], ARM);
- for (const a of arms) {
- let best = Infinity, depth = 0;
- for (const x of trunk) { const d = sub(a.at, x.at), dd = dot(d, d); if (dd < best) { best = dd; depth = -dot(d, x.normal); } }
- if (depth > 0.015 && best < 0.05 * 0.05) { bad++; break; }
- }
- }
- return (100 * bad) / Math.max(1, n);
-}
-
-function kinks(sp: number[][]) {
- let k = 0;
- for (let f = 1; f + 1 < sp.length; f++) if (sp[f].some((v, i) => v - (sp[f - 1][i] + sp[f + 1][i]) / 2 > 4)) k++;
- return (100 * k) / Math.max(1, sp.length);
-}
-
-/** each held stretch: the thing's place and turn in the nearer palm's frame (the hand joint's turn), its most drift
- * from six frames after it is taken (the hand settled) to its release */
-function grips(skel: Skeleton, W: World[], live: ReturnType<typeof interact>, ids: string[]) {
- let cm = 0, deg = 0;
- for (const id of ids) {
- let ref: { s: (typeof SIDES)[number]; p: number[]; q: Quat } | null = null, since = 0;
- for (let f = 0; f < W.length; f++) {
- if (!live.held(id, f)) { ref = null; since = 0; continue; }
- if (++since < 6) continue;
- const it = live.item(id, f);
- const local = (s: (typeof SIDES)[number]) => {
- const h = W[f].rot[joint(skel, B.hand(s))], inv = qinv(h);
- return { p: qrot(inv, sub(it.at, palmAt(skel, W[f], s)) as any) as number[], q: qmul(inv, it.rot) };
- };
- if (!ref) {
- const s = SIDES.reduce((a, b) => (Math.hypot(...sub(it.at, palmAt(skel, W[f], a))) <= Math.hypot(...sub(it.at, palmAt(skel, W[f], b))) ? a : b));
- ref = { s, ...local(s) };
- continue;
- }
- const now = local(ref.s);
- cm = Math.max(cm, Math.hypot(...sub(now.p, ref.p)) * 100);
- deg = Math.max(deg, ang(qmul(now.q, qinv(ref.q))));
- }
- }
- return { grip: cm, gripDeg: deg };
-}
-
-const args = process.argv.slice(2), flag = (k: string) => { const i = args.indexOf(k); return i >= 0 ? args[i + 1] : undefined; };
-const skel = JSON.parse(readFileSync(args[0], "utf8")) as Skeleton;
-const only = flag("--only")?.split(",");
-const lib = suiteLibrary(skel);
-const rows: Record<string, any>[] = [];
-console.log("case frames slide cm pops switch° (where) inside% kinks% grip cm/° pass");
-// --body: the new layer (sdk/body's locomotion, docs/character.md C3) on the body library; errands wait for C5/C6
-const body = args.includes("--body") ? buildDb(skel as any, process.env.RAEA_MOTION_LIB ?? `${process.env.HOME}/.cache/raea-mocap/lib/turbo`) : null;
-const performNew = (spec: any) => {
- const p = performBody(body!, spec, JSON.parse(process.env.RAEA_BODY_OPTS ?? "{}"));
- return { ...p, guide: p.guide.map((g) => ({ ...g, moving: g.want > 0.05 || g.speed > 0.05 })) } as any;
-};
-for (const c of suiteCases(lib, skel)) {
- if (only && !only.includes(c.name)) continue;
- if (body && c.plan) continue;
- const perf = body ? performNew(c.spec) : c.plan ? perform(lib, c.plan.spec) : perform(lib, c.spec);
- const live = c.plan ? interact(skel, perf, c.plan) : null;
- const poses: Pose[] = Array.from({ length: perf.frames }, (_, f) => (live ? live.pose(f) : perf.pose(f)));
- const W = poses.map((p) => pose(skel, p)), sp = speeds(W);
- const r: Record<string, any> = { name: c.name, frames: perf.frames, ...feet(skel, W), ...switches(skel, lib, perf.played, W, sp), inside: inside(skel, W), kinks: kinks(sp) };
- if (live && c.plan) Object.assign(r, grips(skel, W, live, Object.keys((c.plan as any).items ?? { ball: 0, cup: 0 })));
- if (live && c.plan) { const P = c.plan as any; r.scene = sceneFaults(skel, perf, live, P.things ?? {}, P.items ?? {}, c.seat); }
- const fails = Object.entries(BARS).filter(([k, bar]) => r[k] !== undefined && (k === "pops" ? r[k] > bar : r[k] >= bar)).map(([k]) => k);
- r.pass = fails.length === 0; r.fails = fails;
- r.faults = faults(skel, lib, perf, W);
- rows.push(r);
- const g = r.grip !== undefined ? `${r.grip.toFixed(1)}/${r.gripDeg.toFixed(0)}` : "-";
- console.log(`${c.name.padEnd(16)} [slide ${r.slideAt}] ${String(r.frames).padStart(6)} ${r.slide.toFixed(1).padStart(9)} ${String(r.pops).padStart(5)} ${r.switch.toFixed(0).padStart(8)} ${r.switchAt.padEnd(16)} ${r.inside.toFixed(1).padStart(7)} ${r.kinks.toFixed(1).padStart(7)} ${g.padStart(10)} ${r.pass ? "yes" : "no: " + fails.join(", ")}`);
-}
-// --stages: the same measures at each of the pipeline's stages (perform's trace), to find which stage brings a fault in
-if (args.includes("--stages")) for (const c of suiteCases(lib, skel)) {
- if (c.plan || (only && !only.includes(c.name))) continue;
- const perf = perform(lib, c.spec, { trace: true });
- for (const [stage, poses] of Object.entries(perf.trace!.stages)) {
- const W = poses.map((p) => pose(skel, p)), sp = speeds(W), ft = feet(skel, W), sw = switches(skel, lib, perf.played, W, sp);
- console.log(` ${c.name.padEnd(16)} ${stage.padEnd(7)} slide ${ft.slide.toFixed(1).padStart(5)} [${ft.slideAt}] pops ${String(ft.pops).padStart(3)} switch ${sw.switch.toFixed(0).padStart(3)} [${sw.switchAt}] kinks ${kinks(sp).toFixed(1)}`);
- }
-}
-// the taxonomy's faults (tools/motion-faults.ts, docs/locomotion.md), the library's own clips first as the reference
-{
- const ref = reference(skel, lib, [...locoClips().keys()]);
- const cols = ["skate", "float", "sink", "reach", "drift", "driftMax", "crab", "spin", "overrun", "switchesPerS", "returns", "flips", "stall", "armPhase", "armBack", "headPitch", "headRoll", "trunk", "jitter", "froude", "cadence"];
- console.log("\nfaults " + cols.map((c) => c.slice(0, 7).padStart(8)).join(""));
- console.log("library " + cols.map((c) => (c in ref ? (ref as any)[c].toFixed(2) : "").padStart(8)).join(""));
- for (const r of rows) console.log(r.name.padEnd(17) + cols.map((c) => (r.faults[c] ?? 0).toFixed(c === "returns" || c === "flips" ? 0 : 2).padStart(8)).join(""));
- // the scene's faults (plan cases): tools/scene-faults.ts
- for (const r of rows) if (r.scene) { const x = r.scene; console.log(`scene ${r.name}: clip ${x.clip.toFixed(1)}% (deepest ${x.clipDeep.toFixed(1)} cm, ${x.clipAt}) inThing ${x.inThing.toFixed(1)}% (deepest ${x.inDeep.toFixed(1)} cm, ${x.inAt}) gripGap ${x.gripGap.toFixed(1)}% sitLoop ${x.sitLoop.toFixed(2)}/s\n hands in things by item: ${JSON.stringify(x.inBy)} grip gaps: ${JSON.stringify(x.gapBy)} widest ${JSON.stringify(x.gapMax)}\n clip frames by thing/stage: ${JSON.stringify(x.clipBy)}\n deepest by thing: ${JSON.stringify(x.deepBy)}`); }
-}
-const passed = rows.filter((r) => r.pass).length;
-console.log(`${passed}/${rows.length} cases pass`);
-const out = flag("--out");
-if (out) writeFileSync(out, JSON.stringify({ bars: BARS, rows }, null, 1));
diff --git a/sdk/raea/tsconfig.check.json b/sdk/raea/tsconfig.check.json
index a1f6cceb..665303be 100644
--- a/sdk/raea/tsconfig.check.json
+++ b/sdk/raea/tsconfig.check.json
@@ -8,5 +8,6 @@
"types": ["bun-types", "react"]
},
"include": ["../*/src/**/*.ts", "../*/src/**/*.tsx", "../../content/**/*.ts", "../../content/**/*.tsx", "../../examples/**/*.ts", "../../examples/**/*.tsx"],
- "exclude": ["../../content/**/target/**", "../../content/**/node_modules/**"]
+ "//r3f": "sdk/r3f types against its own three and @react-three/fiber (its own install, its own tsconfig and bun test)",
+ "exclude": ["../../content/**/target/**", "../../content/**/node_modules/**", "../r3f/**"]
}
diff --git a/sdk/render/src/3d.tsx b/sdk/render/src/3d.tsx
index 36fb5d13..a5b7ee93 100644
--- a/sdk/render/src/3d.tsx
+++ b/sdk/render/src/3d.tsx
@@ -2,8 +2,8 @@
// carries its name (data-3d) and props (data-props, JSON) for Bevy to draw; a Mesh also carries its Manifold
// expression (data-shape). Engine-safe: this module imports nothing beyond React.
import { toHex } from "./colour";
-export { Canvas3D, Cuboid, Sphere, Plane3d, Cylinder, Torus, Cone, Capsule, Capsule3d, BufferMesh, Text3D, Mesh, MeshStandardMaterial, MeshPhysicalMaterial, MeshBasicMaterial, MeshToonMaterial, SurfaceShader, surfaceShader, samplerSpec, FramePass, Compute, AmbientLight, DirectionalLight, PointLight, SpotLight, RectAreaLight, Atmosphere, PerspectiveCamera, OrthographicCamera, eulerOf, Entity, Refinish, Group, clipEvents, Model, ImagePlane, surfaceTurn, Decal, Plate, Bloom, Fog, ToneMapping, Grade, Environment, AmbientOcclusion, AntiAliasing, Shadows, VolumetricFog, FogVolume, Fire, dofOf, DepthOfField, Outline, Fisheye, LensDistortion, MotionBlur, checkPass, Look, Scene, Entities, BevyComponent, Gizmo, ShaderMesh, BevyResource, Span, RichText } from "./3d/all";
-export type { Vec3, Canvas3DProps, CuboidProps, SphereProps, CylinderProps, TorusProps, Plane3dProps, ConeProps, CapsuleProps, Capsule3dProps, BufferMeshProps, Text3DProps, MeshProps, Animate3d, SurfaceDrawProps, MeshStandardMaterialProps, MeshPhysicalMaterialProps, MeshBasicMaterialProps, ToonBand, ToonRim, ToonHighlight, ToonOutline, MeshToonMaterialProps, SurfaceShaderSpec, SamplerSpec, SamplerWrap, FramePassProps, ComputeProps, AmbientLightProps, DirectionalLightProps, PointLightProps, SpotLightProps, RectAreaLightProps, AtmosphereProps, PerspectiveCameraProps, BevyParts, OrthographicCameraProps, EntityProps, GroupProps, ModelProps, AnimGraphNode, ImagePlaneProps, DecalProps, PlateProps, BloomProps, FogProps, ToneMappingProps, GradeSection, GradeProps, EnvironmentProps, AmbientOcclusionProps, AntiAliasingProps, ShadowsProps, VolumetricFogProps, FogVolumeProps, FireProps, DepthOfFieldProps, OutlineProps, LensCommon, FisheyeProps, LensDistortionProps, MotionBlurProps, LookProps, LookPass, SceneProps, BevyComponentProps, GizmoProps, ShaderMeshProps, SpanProps, GlyphInfo, GlyphStyle, RichTextProps } from "./3d/all";
+export { Canvas3D, Cuboid, Sphere, Plane3d, Cylinder, Torus, Cone, Capsule, Capsule3d, BufferMesh, Text3D, Mesh, MeshStandardMaterial, MeshPhysicalMaterial, MeshBasicMaterial, MeshToonMaterial, SurfaceShader, surfaceShader, samplerSpec, FramePass, Compute, AmbientLight, DirectionalLight, PointLight, SpotLight, RectAreaLight, Atmosphere, PerspectiveCamera, OrthographicCamera, eulerOf, Entity, Refinish, Group, clipEvents, Model, ImagePlane, surfaceTurn, Decal, Plate, Bloom, Fog, ToneMapping, Grade, Environment, AmbientOcclusion, AntiAliasing, Shadows, VolumetricFog, FogVolume, Fire, dofOf, DepthOfField, Outline, Fisheye, LensDistortion, MotionBlur, checkPass, Look, Scene, Entities, BevyComponent, Gizmo, ShaderMesh, BevyResource, Span, RichText, Instances, scatter } from "./3d/all";
+export type { Vec3, Canvas3DProps, CuboidProps, SphereProps, CylinderProps, TorusProps, Plane3dProps, ConeProps, CapsuleProps, Capsule3dProps, BufferMeshProps, Text3DProps, MeshProps, Animate3d, SurfaceDrawProps, MeshStandardMaterialProps, MeshPhysicalMaterialProps, MeshBasicMaterialProps, ToonBand, ToonRim, ToonHighlight, ToonOutline, MeshToonMaterialProps, SurfaceShaderSpec, SamplerSpec, SamplerWrap, FramePassProps, ComputeProps, AmbientLightProps, DirectionalLightProps, PointLightProps, SpotLightProps, RectAreaLightProps, AtmosphereProps, PerspectiveCameraProps, BevyParts, OrthographicCameraProps, EntityProps, GroupProps, ModelProps, AnimGraphNode, ImagePlaneProps, DecalProps, PlateProps, BloomProps, FogProps, ToneMappingProps, GradeSection, GradeProps, EnvironmentProps, AmbientOcclusionProps, AntiAliasingProps, ShadowsProps, VolumetricFogProps, FogVolumeProps, FireProps, DepthOfFieldProps, OutlineProps, LensCommon, FisheyeProps, LensDistortionProps, MotionBlurProps, LookProps, LookPass, SceneProps, BevyComponentProps, GizmoProps, ShaderMeshProps, SpanProps, GlyphInfo, GlyphStyle, RichTextProps, Instance, InstancesProps, PlanBox, ScatterOptions } from "./3d/all";
export { CrossSection, crossSection, manifold, outline, Solid, type Bounds, type Polygons, type Section } from "./solid";
diff --git a/sdk/render/src/3d/all.ts b/sdk/render/src/3d/all.ts
index 34262f5a..67a2131d 100644
--- a/sdk/render/src/3d/all.ts
+++ b/sdk/render/src/3d/all.ts
@@ -12,3 +12,4 @@ export * from "./compute";
export * from "./text";
export * from "./shapes";
export * from "./sprite";
+export * from "./instances";
diff --git a/sdk/render/src/3d/instances.tsx b/sdk/render/src/3d/instances.tsx
new file mode 100644
index 00000000..7f150719
--- /dev/null
+++ b/sdk/render/src/3d/instances.tsx
@@ -0,0 +1,179 @@
+// <Instances>: one glTF or one mesh drawn at many placements, loaded once and drawn by the GPU as instances (Bevy
+// batches entities sharing a mesh and a material into one draw), and scatter(), the seeded placements for it.
+import { Children, isValidElement, type ReactNode } from "react";
+import { Solid } from "../solid";
+import { MeshToonMaterial, Vec3, checkPass, checkVec, node3d, shapeFromChildren } from "./all";
+
+/** One copy's placement in an <Instances>, in the Instances' own space (its position, rotation and scale move every
+ * copy together). Rotation in radians, XYZ order, as everywhere. */
+export interface Instance {
+ position: Vec3;
+ rotation?: Vec3;
+ scale?: number | Vec3;
+}
+
+export interface InstancesProps {
+ /** a glTF file drawn at every placement: staticFile("models/house.glb"). Without it, a geometry child (or `shape`)
+ * and a material child draw a mesh at every placement */
+ src?: string;
+ /** where each copy stands. Fixed for the shot: the first frame's list is drawn on every frame (move, turn, scale,
+ * hide or recolour the whole set by the Instances' own props) */
+ at: Instance[];
+ name?: string;
+ position?: Vec3;
+ /** radians */
+ rotation?: Vec3;
+ scale?: number | Vec3;
+ /** of a glTF: which of its scenes (0 by default) */
+ scene?: number;
+ /** a Manifold solid or its expression for the mesh form; wins over the geometry child */
+ shape?: string | Solid;
+ /** false: the copies cast no shadow (true by default). Grass and flowers by the thousand usually want false */
+ shadow?: boolean;
+ /** false: no shadow falls on the copies */
+ receiveShadow?: boolean;
+ pass?: string;
+ /** the mesh form: a geometry and a material (MeshStandardMaterial, MeshPhysicalMaterial or MeshBasicMaterial).
+ * The glTF form: MeshStandardMaterial children re-covering its materials, as on a Model */
+ children?: ReactNode;
+}
+
+/** The packed placements, 9 numbers a copy (position, rotation, scale), cached by the list, so a list made once (a
+ * module's `scatter`) is packed once however many frames draw it. */
+const PACKED = new WeakMap<Instance[], number[]>();
+const r5 = (x: number) => Math.round(x * 1e5) / 1e5;
+export function packInstances(owner: string, at: Instance[]): number[] {
+ const hit = PACKED.get(at);
+ if (hit) return hit;
+ const out: number[] = new Array(at.length * 9);
+ at.forEach((it, i) => {
+ if (it === null || typeof it !== "object") throw new TypeError(`${owner}: at[${i}] must be { position, rotation?, scale? }, got ${JSON.stringify(it)}`);
+ const { position, rotation = [0, 0, 0], scale = 1 } = it;
+ checkVec(owner, `at[${i}].position`, position);
+ checkVec(owner, `at[${i}].rotation`, rotation);
+ const s: Vec3 = typeof scale === "number" ? [scale, scale, scale] : scale;
+ checkVec(owner, `at[${i}].scale`, s);
+ if (!s.every((v) => v > 0)) throw new RangeError(`${owner}: at[${i}].scale must be positive, got ${JSON.stringify(scale)}`);
+ const o = i * 9;
+ for (let k = 0; k < 3; k++) {
+ out[o + k] = r5(position[k]);
+ out[o + 3 + k] = r5(rotation[k]);
+ out[o + 6 + k] = r5(s[k]);
+ }
+ });
+ PACKED.set(at, out);
+ return out;
+}
+
+/** One glTF (or one mesh) drawn at many placements, loaded once and drawn by the GPU as instances: a meadow's grass
+ * and flowers, a forest, a suburb's houses. `<Instances src={staticFile("daisy.glb")} at={scatter({...})} />`. The
+ * copies share one surface and can't play a clip.
+ * @bevy bevy_pbr::render::mesh::MeshPipeline (automatic batching of entities sharing a mesh and material) */
+export function Instances(props: InstancesProps) {
+ const owner = props.src !== undefined ? `Instances(${props.src})` : "Instances";
+ if (props.src !== undefined && (typeof props.src !== "string" || !/\.(glb|gltf)$/i.test(props.src))) throw new TypeError(`Instances: src must be a .glb or .gltf file (staticFile("x.glb")), got ${JSON.stringify(props.src)}`);
+ if (!Array.isArray(props.at)) throw new TypeError(`${owner}: at must be a list of { position, rotation?, scale? }, got ${JSON.stringify(props.at)}`);
+ for (const k of ["position", "rotation"] as const) if (props[k] !== undefined) checkVec(owner, k, props[k]);
+ if (props.scale !== undefined && typeof props.scale !== "number") checkVec(owner, "scale", props.scale);
+ for (const k of ["animation", "animations", "graph", "morphs"]) if (k in (props as object)) throw new TypeError(`${owner}: instances can't play a clip or set morphs; use a <Model> for an animated one`);
+ checkPass(owner, props.pass);
+ const at = packInstances(owner, props.at);
+ const { position = [0, 0, 0], rotation = [0, 0, 0], scale = 1 } = props;
+ if (props.src !== undefined) return node3d("Model", { ...props, shape: undefined, at, position, rotation, scale }, props.children);
+ const manifold = props.shape instanceof Solid ? props.shape.expr : props.shape ?? shapeFromChildren(props.children);
+ if (manifold === undefined) throw new TypeError("Instances: give a glTF `src`, or a geometry child (<Cuboid />, <BufferMesh />, ...) or `shape`");
+ let toon = false;
+ Children.forEach(props.children, (c) => { if (isValidElement(c) && c.type === MeshToonMaterial) toon = true; });
+ if (toon) throw new TypeError("Instances: the copies take a MeshStandardMaterial, MeshPhysicalMaterial or MeshBasicMaterial (a toon surface isn't instanced)");
+ return node3d("Mesh", { ...props, shape: undefined, at, position, rotation, scale }, props.children, { "data-shape": manifold as string });
+}
+
+/** A box on the plan (x, z, metres): the room SDK's Footprint, or any { min, max }. */
+export interface PlanBox {
+ min: [number, number];
+ max: [number, number];
+}
+
+export interface ScatterOptions {
+ /** where the points fall: a box on the plan (x, z) */
+ area: PlanBox;
+ /** how many (fewer when the area fills up: spacing and avoid leave no room) */
+ count: number;
+ /** the least distance between two points, metres (0: none) */
+ spacing?: number;
+ /** boxes on the plan to keep clear of, grown by `margin` */
+ avoid?: PlanBox[];
+ /** how far to stay off each avoided box (spacing / 2 by default) */
+ margin?: number;
+ /** points kept off already-placed ones too: a second scatter (flowers) clear of the first (stones) by `spacing` */
+ clearOf?: Instance[];
+ /** 1 by default; the same seed gives the same points, every frame, render and play */
+ seed?: number;
+ /** each point's turn about y (radians): true (the default) any, false none, a number that one, [lo, hi] between */
+ yaw?: boolean | number | [number, number];
+ /** a lean off upright, radians: each point tipped by up to this much in a random direction (0 by default) */
+ tilt?: number;
+ /** a scale, or [lo, hi] between (uniform) */
+ scale?: number | [number, number];
+ /** the ground's height: a number (0), or the terrain's height at (x, z) */
+ y?: number | ((x: number, z: number) => number);
+ /** how likely a point is kept at (x, z), 0 to 1: a density map (a path worn bare, a patch thicker by the chair) */
+ density?: (x: number, z: number) => number;
+}
+
+/** A seeded stream in [0, 1) (mulberry32), as the room SDK's `seeded`. */
+function mulberry(seed: number): () => number {
+ let a = seed >>> 0;
+ return () => {
+ a = (a + 0x6d2b79f5) >>> 0;
+ let t = a;
+ t = Math.imul(t ^ (t >>> 15), t | 1);
+ t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
+ return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
+ };
+}
+
+/** Points scattered over an area for an <Instances>: seeded (the same layout every frame and every run), at least
+ * `spacing` apart, clear of `avoid` and `clearOf`, on the ground `y` gives, kept by `density`. A spatial hash keeps
+ * thousands quick. Call it once at module level, not per frame. */
+export function scatter(o: ScatterOptions): Instance[] {
+ const { area, count, spacing = 0, avoid = [], seed = 1, yaw = true, tilt = 0, scale = 1, y = 0, clearOf = [], density } = o;
+ const margin = o.margin ?? spacing / 2;
+ if (!area || !Array.isArray(area.min) || !Array.isArray(area.max)) throw new TypeError(`scatter: area must be { min: [x, z], max: [x, z] }, got ${JSON.stringify(area)}`);
+ if (!(count >= 0) || !Number.isFinite(count)) throw new RangeError(`scatter: count must be a number of points, got ${count}`);
+ if (!(spacing >= 0)) throw new RangeError(`scatter: spacing must be 0 or more metres, got ${spacing}`);
+ const [x0, z0] = area.min, [x1, z1] = area.max;
+ const rnd = mulberry(seed);
+ const cell = spacing > 0 ? spacing : 1;
+ const grid = new Map<string, [number, number][]>();
+ const add = (x: number, z: number) => {
+ const k = `${Math.floor(x / cell)},${Math.floor(z / cell)}`;
+ const l = grid.get(k);
+ if (l) l.push([x, z]);
+ else grid.set(k, [[x, z]]);
+ };
+ const crowded = (x: number, z: number) => {
+ if (spacing <= 0) return false;
+ const cx = Math.floor(x / cell), cz = Math.floor(z / cell);
+ for (let i = -1; i <= 1; i++) for (let j = -1; j <= 1; j++) {
+ for (const [px, pz] of grid.get(`${cx + i},${cz + j}`) ?? []) if ((px - x) ** 2 + (pz - z) ** 2 < spacing * spacing) return true;
+ }
+ return false;
+ };
+ for (const c of clearOf) add(c.position[0], c.position[2]);
+ const blocked = (x: number, z: number) => avoid.some((f) => x > f.min[0] - margin && x < f.max[0] + margin && z > f.min[1] - margin && z < f.max[1] + margin);
+ const turn = (): number => (yaw === true ? rnd() * Math.PI * 2 : yaw === false ? 0 : typeof yaw === "number" ? yaw : yaw[0] + rnd() * (yaw[1] - yaw[0]));
+ const size = (): number => (typeof scale === "number" ? scale : scale[0] + rnd() * (scale[1] - scale[0]));
+ const out: Instance[] = [];
+ for (let tries = 0; out.length < count && tries < count * 60 + 100; tries++) {
+ const x = x0 + rnd() * (x1 - x0), z = z0 + rnd() * (z1 - z0);
+ // every draw made whether the point is kept or not, so one rejected point doesn't shift the rest
+ const r = turn(), s = size(), keep = rnd(), ta = rnd() * Math.PI * 2, tm = rnd() * tilt;
+ if (density && keep >= density(x, z)) continue;
+ if (blocked(x, z) || crowded(x, z)) continue;
+ add(x, z);
+ const h = typeof y === "number" ? y : y(x, z);
+ out.push({ position: [x, h, z], rotation: [Math.cos(ta) * tm, r, Math.sin(ta) * tm], scale: s });
+ }
+ return out;
+}
diff --git a/sdk/render/src/3d/lights.tsx b/sdk/render/src/3d/lights.tsx
index 590666be..78a0cd2e 100644
--- a/sdk/render/src/3d/lights.tsx
+++ b/sdk/render/src/3d/lights.tsx
@@ -15,7 +15,7 @@ export interface AmbientLightProps {
/** Light from everywhere at once.
* @bevy bevy_light::ambient_light::AmbientLight */
-export function AmbientLight({ intensity = 1, color = "#ffffff", ...rest }: AmbientLightProps) {
+export function AmbientLight({ intensity = 1, color = "#ffffff", ...rest }: AmbientLightProps & Pick<BevyUnits, "nits">) {
return node3d("AmbientLight", { ...rest, intensity, color: toHex("AmbientLight", "color", color) });
}
@@ -39,7 +39,17 @@ export interface DirectionalLightProps {
softness?: number;
}
-function checkLight(owner: string, p: { position?: Vec3; target?: Vec3; intensity?: number; color?: string; softShadow?: unknown; softness?: number }) {
+/** A Bevy light's power in its own units, which the rows take as written over `intensity` (bevy3d lights.tsx sends
+ * them; docs/control.feature FC1f): a directional light's lux, a point, spot or rect light's lumens, an ambient's nits
+ * (cd/m²). */
+export interface BevyUnits {
+ lux?: number;
+ lumens?: number;
+ nits?: number;
+}
+
+function checkLight(owner: string, p: { position?: Vec3; target?: Vec3; intensity?: number; color?: string; softShadow?: unknown; softness?: number } & BevyUnits) {
+ for (const k of ["lux", "lumens", "nits"] as const) if (p[k] !== undefined && !(p[k]! >= 0 && Number.isFinite(p[k]))) throw new RangeError(`${owner}: ${k} must be 0 or more, got ${p[k]}`);
if (p.softness !== undefined && !(p.softness >= 0 && Number.isFinite(p.softness))) throw new RangeError(`${owner}: softness must be 0 or more, got ${p.softness}`);
if (p.softShadow !== undefined && !(typeof p.softShadow === "boolean" || (typeof p.softShadow === "number" && p.softShadow >= 0 && Number.isFinite(p.softShadow)))) throw new RangeError(`${owner}: softShadow is true, false or a size in metres (0 or more), got ${JSON.stringify(p.softShadow)}`);
if (p.position !== undefined) checkVec(owner, "position", p.position);
@@ -50,7 +60,7 @@ function checkLight(owner: string, p: { position?: Vec3; target?: Vec3; intensit
/** Parallel light (the sun) shining from `position` towards `target`.
* @bevy bevy_light::directional_light::DirectionalLight */
-export function DirectionalLight({ intensity = 1, color = "#ffffff", children, ...rest }: DirectionalLightProps & BevyParts) {
+export function DirectionalLight({ intensity = 1, color = "#ffffff", children, ...rest }: DirectionalLightProps & BevyParts & Pick<BevyUnits, "lux">) {
checkLight("DirectionalLight", { ...rest, intensity, color });
return node3d("DirectionalLight", { ...rest, intensity, color: toHex("DirectionalLight", "color", color) }, children);
}
@@ -87,7 +97,7 @@ export interface PointLightProps {
/** A bulb: light from a point, every way.
* @bevy bevy_light::point_light::PointLight */
-export function PointLight({ intensity = 1, color = "#ffffff", children, ...rest }: PointLightProps & BevyParts) {
+export function PointLight({ intensity = 1, color = "#ffffff", children, ...rest }: PointLightProps & BevyParts & Pick<BevyUnits, "lumens">) {
checkLight("PointLight", { ...rest, intensity, color });
return node3d("PointLight", { ...rest, intensity, color: toHex("PointLight", "color", color) }, children);
}
@@ -103,7 +113,7 @@ export interface SpotLightProps extends PointLightProps {
/** A cone of light from `position` towards `target`: a stage spot, a product hero light.
* @bevy bevy_light::spot_light::SpotLight */
-export function SpotLight({ intensity = 1, color = "#ffffff", children, ...rest }: SpotLightProps & BevyParts) {
+export function SpotLight({ intensity = 1, color = "#ffffff", children, ...rest }: SpotLightProps & BevyParts & Pick<BevyUnits, "lumens">) {
checkLight("SpotLight", { ...rest, intensity, color });
if (rest.angle !== undefined && !(rest.angle > 0 && rest.angle <= Math.PI / 2)) throw new RangeError(`SpotLight: angle is a half-angle in radians, in (0, π/2], got ${rest.angle}`);
if (rest.penumbra !== undefined && !(rest.penumbra >= 0 && rest.penumbra <= 1)) throw new RangeError(`SpotLight: penumbra must be in [0, 1], got ${rest.penumbra}`);
@@ -129,7 +139,7 @@ export interface RectAreaLightProps {
* soft and wide from the whole face, not a point; it casts no shadows (Bevy 0.20 doesn't shadow area lights).
* @bevy bevy_light::rect_light::RectLight
* @deprecated <RectLight> (lumens, width, height), raea/light */
-export function RectAreaLight({ intensity = 1, color = "#ffffff", width = 1, height = 1, ...rest }: RectAreaLightProps) {
+export function RectAreaLight({ intensity = 1, color = "#ffffff", width = 1, height = 1, ...rest }: RectAreaLightProps & Pick<BevyUnits, "lumens">) {
checkLight("RectAreaLight", { ...rest, intensity, color });
for (const [k, v] of [["width", width], ["height", height]] as const) if (!(v > 0) || !Number.isFinite(v)) throw new RangeError(`RectAreaLight: ${k} must be a positive number of metres, got ${v}`);
return node3d("RectAreaLight", { ...rest, intensity, width, height, color: toHex("RectAreaLight", "color", color) });
diff --git a/sdk/render/src/3d/model.tsx b/sdk/render/src/3d/model.tsx
index aa603318..cef19a51 100644
--- a/sdk/render/src/3d/model.tsx
+++ b/sdk/render/src/3d/model.tsx
@@ -203,6 +203,11 @@ export interface ModelProps {
/** its surfaces without light: shape and colour alone, like a drawing (the site look keeps the light: its grain
* is made of it) */
flat?: boolean;
+ /** false: its meshes cast no shadow (true by default) */
+ shadow?: boolean;
+ /** false: no shadow falls on its meshes, its own included (true by default): a furry coat of many cards that would
+ * otherwise speckle itself in the shadow maps */
+ receiveShadow?: boolean;
/** a cell's size in frame pixels for the pixel and site looks (6 by default) */
pixelSize?: number;
/** the pixel look's one-cell outline, a hex colour ("#000000" by default), or "none" */
diff --git a/sdk/render/src/3d/shapes.tsx b/sdk/render/src/3d/shapes.tsx
index ae93fec0..bd61dd82 100644
--- a/sdk/render/src/3d/shapes.tsx
+++ b/sdk/render/src/3d/shapes.tsx
@@ -253,6 +253,8 @@ export interface MeshProps extends PointerHandlers3d {
* <Outline skip>, <Bloom skip>, <Grade skip>) leaves its pixels as drawn, and <Look passes> gives one its own paint;
* a piece names at most three passes besides "scene"; keyed per frame */
pass?: string;
+ /** a rotation as a quaternion [x, y, z, w], Bevy's Transform.rotation, in place of `rotation` (<Mesh3d transform> sends it) */
+ quaternion?: [number, number, number, number];
position?: Vec3;
/** radians */
rotation?: Vec3;
@@ -304,7 +306,7 @@ export function apply3d<T extends object>(props: T, v: Record<string, number | s
return out as T;
}
-function shapeFromChildren(children: ReactNode): string | undefined {
+export function shapeFromChildren(children: ReactNode): string | undefined {
let found: string | undefined;
Children.forEach(children, (child) => {
if (found !== undefined || !isValidElement(child)) return;
@@ -360,7 +362,7 @@ export function Mesh(props: MeshProps) {
if (manifold !== undefined) extra["data-shape"] = manifold as string;
if (anim.attr) extra["data-raea-anim"] = anim.attr;
const id = useId();
- const m = usePlace3d(position, rotation, scale);
+ const m = usePlace3d(position, rotation, scale, props.quaternion);
usePointer3d(props.name ?? id, m, shape === undefined ? boundsFromChildren(props.children) : undefined, props as Record<string, unknown>);
return node3d("Mesh", { ...props, animate: undefined, shape: undefined, position, rotation, scale }, <Place3d.Provider value={m}>{props.children}</Place3d.Provider>, Object.keys(extra).length ? extra : undefined);
}
diff --git a/sdk/render/src/bevy3d.tsx b/sdk/render/src/bevy3d.tsx
index 6aab686f..77bedb16 100644
--- a/sdk/render/src/bevy3d.tsx
+++ b/sdk/render/src/bevy3d.tsx
@@ -8,7 +8,7 @@
// <StandardMaterial base_color="#c84" perceptual_roughness={0.4} />
// </Mesh3d>
import { eulerOf } from "./3d";
-export { Quat, Affine2, Transform, Mesh3d, Camera3d, Srgba, LinearRgba, StandardMaterial, GridExtension, PaintExtension, WearExtension, ToonExtension, ShaderExtension, ExtendedMaterial, ToonMaterial, Mesh2d, Circle, Rectangle, Ellipse, RegularPolygon, ColorMaterial, PointLight, SpotLight, DirectionalLight, AmbientLight, GlobalAmbientLight, RectLight } from "./bevy3d/all";
+export { Quat, Affine2, Transform, Mesh3d, Camera3d, Srgba, LinearRgba, StandardMaterial, GridExtension, PaintExtension, WearExtension, ToonExtension, ShaderExtension, ExtendedMaterial, ToonMaterial, Mesh2d, Circle, Rectangle, Ellipse, RegularPolygon, ColorMaterial, PointLight, SpotLight, DirectionalLight, AmbientLight, GlobalAmbientLight, RectLight, light_consts } from "./bevy3d/all";
export type { EulerRot, TransformValue, TransformBuilt, Mesh3dProps, Projection, Camera3dProps, AlphaMode, StandardMaterialProps, StandardMaterialAnimate, ToonExtensionAnimate, SampledImage, MetallicRoughnessMaps, GridExtensionProps, PaintExtensionProps, WearExtensionProps, ToonExtensionProps, ShaderExtensionProps, ExtendedMaterialProps, ToonMaterialProps, Mesh2dProps, CircleProps, RectangleProps, EllipseProps, RegularPolygonProps, ColorMaterialProps, PointLightProps, SpotLightProps, DirectionalLightProps, AmbientLightProps, RectLightProps } from "./bevy3d/all";
export { eulerOf };
diff --git a/sdk/render/src/bevy3d/core.tsx b/sdk/render/src/bevy3d/core.tsx
index 1bb230c1..f6f00aa5 100644
--- a/sdk/render/src/bevy3d/core.tsx
+++ b/sdk/render/src/bevy3d/core.tsx
@@ -68,13 +68,19 @@ export const Affine2 = {
function lookingAt(eye: Vec3, target: Vec3, up: Vec3): Quat {
const sub = (a: Vec3, b: Vec3): Vec3 => [a[0] - b[0], a[1] - b[1], a[2] - b[2]];
const cross = (a: Vec3, b: Vec3): Vec3 => [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];
- const norm = (a: Vec3): Vec3 => {
+ // Bevy's fallbacks (look_to): a target at the eye looks down -Z, a zero up is +Y, and an up along the view takes glam's
+ // any_orthonormal_vector of up
+ const norm = (a: Vec3, or: () => Vec3): Vec3 => {
const n = Math.hypot(...a);
- if (!(n > 1e-9)) throw new RangeError(`Transform.lookingAt: the target is at the eye, or up is along the view`);
- return [a[0] / n, a[1] / n, a[2] / n];
+ return n > 0 && Number.isFinite(n) ? [a[0] / n, a[1] / n, a[2] / n] : or();
};
- const back = norm(sub(eye, target));
- const right = norm(cross(up, back));
+ const back = norm(sub(eye, target), () => [0, 0, 1]);
+ const up1 = norm(up, () => [0, 1, 0]);
+ const right = norm(cross(up1, back), () => {
+ const sign = up1[2] < 0 || Object.is(up1[2], -0) ? -1 : 1;
+ const a = -1 / (sign + up1[2]);
+ return [up1[0] * up1[1] * a, sign + up1[1] * up1[1] * a, -up1[1]];
+ });
const u = cross(back, right);
// the rotation matrix's columns are right, u, back; its quaternion (Shepperd's method)
const [m00, m10, m20, m01, m11, m21, m02, m12, m22] = [right[0], right[1], right[2], u[0], u[1], u[2], back[0], back[1], back[2]];
@@ -132,11 +138,13 @@ export const Transform = /* @__PURE__ */ Object.assign({}, TransformComponent, {
fromScale: (s: Vec3) => built([0, 0, 0], [0, 0, 0, 1], s),
});
-function place(t: TransformValue | undefined): Pick<MeshProps, "position" | "rotation" | "scale"> {
+// the rotation goes as Bevy's quaternion, end to end (docs/control.feature FC1d); a part whose `animate` turns it
+// keeps the Euler angles its tracks patch
+function place(t: TransformValue | undefined, animated = false): Pick<MeshProps, "position" | "rotation" | "quaternion" | "scale"> {
if (!t) return {};
return {
...(t.translation ? { position: t.translation } : {}),
- ...(t.rotation ? { rotation: eulerOf(t.rotation) } : {}),
+ ...(t.rotation ? (animated ? { rotation: eulerOf(t.rotation) } : { quaternion: t.rotation }) : {}),
...(t.scale ? { scale: t.scale } : {}),
};
}
@@ -154,10 +162,11 @@ export function Mesh3d({ transform, visibility, children, ...rest }: Mesh3dProps
const id = useId();
if (visibility === "Hidden") return null;
const layers = meshLayers("Mesh3d", rest.name ?? `layer${id}`, children, true);
- if (!layers.surface) return <Mesh {...rest} {...place(transform)}>{layers.children}</Mesh>;
+ const at = place(transform, rest.animate !== undefined);
+ if (!layers.surface) return <Mesh {...rest} {...at}>{layers.children}</Mesh>;
return (
<>
- <Mesh {...rest} {...place(transform)} surface={layers.surface}>{layers.children}</Mesh>
+ <Mesh {...rest} {...at} surface={layers.surface}>{layers.children}</Mesh>
{layers.part}
</>
);
diff --git a/sdk/render/src/bevy3d/lights.tsx b/sdk/render/src/bevy3d/lights.tsx
index cc9bae13..a02c7d70 100644
--- a/sdk/render/src/bevy3d/lights.tsx
+++ b/sdk/render/src/bevy3d/lights.tsx
@@ -1,7 +1,7 @@
// Lights.
import { type ReactNode } from "react";
import { AmbientLight as AmbientLight3, DirectionalLight as DirectionalLight3, PointLight as PointLight3, RectAreaLight, SpotLight as SpotLight3, type Vec3 } from "../3d";
-import { AMBIENT_NITS, LUMENS, LUX, OLD_LIGHT_PROPS, Quat, TransformValue } from "./all";
+import { OLD_LIGHT_PROPS, Quat, TransformValue } from "./all";
function refuseOld(owner: string, props: Record<string, unknown>, allowed: readonly string[] = []) {
for (const k of OLD_LIGHT_PROPS) {
@@ -50,7 +50,7 @@ export function PointLight(p: PointLightProps) {
const { transform, visibility, intensity = 1_000_000, range = 20, radius, shadow_maps_enabled = false, soft_shadows_enabled, ...rest } = p;
if (visibility === "Hidden") return null;
const s = soft({ radius, soft_shadows_enabled });
- return <PointLight3 {...rest} position={forward(transform).position} intensity={intensity / LUMENS} distance={range} castShadow={shadow_maps_enabled} {...(s !== undefined ? { softShadow: s } : {})} />;
+ return <PointLight3 {...rest} position={forward(transform).position} lumens={intensity} distance={range} castShadow={shadow_maps_enabled} {...(s !== undefined ? { softShadow: s } : {})} />;
}
export interface SpotLightProps extends PointLightProps {
@@ -68,7 +68,7 @@ export function SpotLight(p: SpotLightProps) {
const s = soft({ radius, soft_shadows_enabled });
// the rows take a penumbra: inner = outer * (1 - penumbra) (scene3d.rs)
const penumbra = 1 - Math.min(inner_angle, outer_angle) / outer_angle;
- return <SpotLight3 {...rest} {...forward(transform)} intensity={intensity / LUMENS} distance={range} castShadow={shadow_maps_enabled} angle={outer_angle} penumbra={penumbra} {...(s !== undefined ? { softShadow: s } : {})} />;
+ return <SpotLight3 {...rest} {...forward(transform)} lumens={intensity} distance={range} castShadow={shadow_maps_enabled} angle={outer_angle} penumbra={penumbra} {...(s !== undefined ? { softShadow: s } : {})} />;
}
export interface DirectionalLightProps extends Omit<LightCommon, "children"> {
@@ -86,7 +86,7 @@ export function DirectionalLight(p: DirectionalLightProps) {
const { transform, visibility, illuminance = 10_000, shadow_maps_enabled = false, soft_shadow_size, ...rest } = p;
if (visibility === "Hidden") return null;
// 3d.tsx's sun shines from position to target; a direction needs only a point ahead of where it is
- return <DirectionalLight3 {...rest} {...forward(transform)} intensity={illuminance / LUX} castShadow={shadow_maps_enabled} {...(soft_shadow_size ? { softShadow: soft_shadow_size } : {})} />;
+ return <DirectionalLight3 {...rest} {...forward(transform)} lux={illuminance} castShadow={shadow_maps_enabled} {...(soft_shadow_size ? { softShadow: soft_shadow_size } : {})} />;
}
export interface AmbientLightProps {
@@ -102,11 +102,11 @@ export function AmbientLight(p: AmbientLightProps) {
return <AmbientLight3 {...ambientOf(p)} />;
}
-/** An AmbientLight's props as 3d.tsx's light takes them (relative to AMBIENT_NITS). */
-export function ambientOf(p: AmbientLightProps): { name?: string; color?: string; intensity: number } {
+/** An AmbientLight's props as 3d.tsx's light takes them: its brightness as `nits`, which the rows take as written. */
+export function ambientOf(p: AmbientLightProps): { name?: string; color?: string; nits: number } {
refuseOld("AmbientLight", p as Record<string, unknown>);
const { brightness = 80, ...rest } = p;
- return { ...rest, intensity: brightness / AMBIENT_NITS };
+ return { ...rest, nits: brightness };
}
/** The same light as a resource, as Bevy 0.20 names it. (A function, not a const alias: an alias would keep 3D code in
@@ -129,5 +129,5 @@ export function RectLight(p: RectLightProps) {
refuseOld("RectLight", p as Record<string, unknown>, ["intensity"]);
const { transform, visibility, intensity = 1_000_000, range = 20, width = 1, height = 1, ...rest } = p;
if (visibility === "Hidden") return null;
- return <RectAreaLight {...rest} {...forward(transform)} intensity={intensity / LUMENS} distance={range} width={width} height={height} />;
+ return <RectAreaLight {...rest} {...forward(transform)} lumens={intensity} distance={range} width={width} height={height} />;
}
diff --git a/sdk/render/src/bevy3d/materials.tsx b/sdk/render/src/bevy3d/materials.tsx
index 7dc747c7..ddc89feb 100644
--- a/sdk/render/src/bevy3d/materials.tsx
+++ b/sdk/render/src/bevy3d/materials.tsx
@@ -93,8 +93,34 @@ export interface StandardMaterialAnimate {
emissive?: TrackSpec<string> | TrackSpec<LinearRgba>;
perceptual_roughness?: TrackSpec<number>;
metallic?: TrackSpec<number>;
+ // the rest of the fields that interpolate, each set on the part's own material frame by frame (docs/control.feature FC1c)
+ emissive_exposure_weight?: TrackSpec<number>;
+ reflectance?: TrackSpec<number>;
+ specular_tint?: TrackSpec<string>;
+ diffuse_transmission?: TrackSpec<number>;
+ specular_transmission?: TrackSpec<number>;
+ thickness?: TrackSpec<number>;
+ ior?: TrackSpec<number>;
+ attenuation_distance?: TrackSpec<number>;
+ attenuation_color?: TrackSpec<string>;
+ clearcoat?: TrackSpec<number>;
+ clearcoat_perceptual_roughness?: TrackSpec<number>;
+ anisotropy_strength?: TrackSpec<number>;
+ anisotropy_rotation?: TrackSpec<number>;
+ depth_bias?: TrackSpec<number>;
+ parallax_depth_scale?: TrackSpec<number>;
+ max_parallax_layer_count?: TrackSpec<number>;
+ lightmap_exposure?: TrackSpec<number>;
}
+// the StandardMaterialAnimate fields past the four columns, by kind: sampled as `field:<name>` and set by reflection
+const STANDARD_FIELDS: Record<string, "number" | "string"> = {
+ emissive_exposure_weight: "number", reflectance: "number", specular_tint: "string", diffuse_transmission: "number", specular_transmission: "number",
+ thickness: "number", ior: "number", attenuation_distance: "number", attenuation_color: "string", clearcoat: "number",
+ clearcoat_perceptual_roughness: "number", anisotropy_strength: "number", anisotropy_rotation: "number", depth_bias: "number",
+ parallax_depth_scale: "number", max_parallax_layer_count: "number", lightmap_exposure: "number",
+};
+
// A fixes an `animate` to the fields T names: any other key is never, so a typo fails in tsc, not at render
type Only<A, T> = { [K in keyof A]: K extends keyof T ? T[K] : never };
@@ -105,16 +131,21 @@ const COLOUR_FIELDS = new Set(["color", "emissive", "shadowColor"]);
// an `animate` as the old material's: its keys renamed; an emissive's LinearRgba keys as their colour and an
// emissiveIntensity track (a colour track's emissive is at strength 1, as Bevy's emissive is the whole colour)
-function animateOf(owner: string, a: object | undefined, names: Record<string, string>): { animate?: Record<string, TrackSpec>; emissive?: Record<string, unknown> } {
+function animateOf(owner: string, a: object | undefined, names: Record<string, string>, fields: Record<string, "number" | "string"> = {}): { animate?: Record<string, TrackSpec>; emissive?: Record<string, unknown> } {
if (!a) return {};
const animate: Record<string, TrackSpec> = {};
let emissive: Record<string, unknown> | undefined;
for (const [k, t] of Object.entries(a)) {
if (t === undefined) continue;
const name = names[k];
- if (!name) throw new TypeError(`${owner}: animate takes ${Object.keys(names).join(", ")}, not ${k}`);
+ if (!name && !fields[k]) throw new TypeError(`${owner}: animate takes ${[...Object.keys(names), ...Object.keys(fields)].join(", ")}, not ${k}`);
const spec = t as TrackSpec<unknown>;
if (typeof spec !== "object" || spec === null || !Array.isArray(spec.keys)) throw new TypeError(`${owner}: animate's ${k} is a track(...)`);
+ if (!name) {
+ if (!spec.keys.every(([, v]) => typeof v === fields[k])) throw new TypeError(`${owner}: animate's ${k} keys are ${fields[k] === "string" ? "colours" : "numbers"}`);
+ animate[`field:${k}`] = spec as TrackSpec;
+ continue;
+ }
if (name === "emissive" && spec.keys.every(([, v]) => v instanceof LinearRgba)) {
const from = spec.keys.map(([, v]) => (v as LinearRgba)[MADE_FROM]);
if (from.some((f) => !f || f.hex !== from[0]!.hex)) throw new TypeError(`${owner}: an emissive track's LinearRgba keys are one colour, LinearRgba.from(Srgba.hex(c)).mul(k) each`);
@@ -226,7 +257,9 @@ function standard(p: StandardMaterialProps, ext: Extended) {
if (p.unlit) return <MeshBasicMaterial color={color} {...(m.maps.map ? { map: m.maps.map } : {})} {...(m.samplers?.map ? { sampler: m.samplers.map } : {})} {...draw(p)} />;
// inside a Model only the fields given re-cover its material; on a Mesh3d the rest are Bevy's defaults
const own = useContext(InModel);
- const anim = animateOf("StandardMaterial", p.animate, STANDARD_ANIMATE);
+ const anim = animateOf("StandardMaterial", p.animate, STANDARD_ANIMATE, STANDARD_FIELDS);
+ const byField = Object.keys(anim.animate ?? {}).filter((k) => k.startsWith("field:")).map((k) => k.slice(6));
+ if (byField.length && (own || ext.grid || ext.paint || ext.wear || ext.shader)) throw new TypeError(`StandardMaterial: animate's ${byField.join(", ")} set a plain StandardMaterial on a Mesh3d; ${own ? "a Model's material" : "an ExtendedMaterial"} takes base_color, emissive, perceptual_roughness and metallic`);
const common = {
...(own && p.base_color === undefined ? {} : { color }),
...(own && p.perceptual_roughness === undefined ? {} : { roughness: p.perceptual_roughness ?? 0.5 }),
@@ -441,14 +474,15 @@ export function ExtendedMaterial(p: ExtendedMaterialProps) {
}
}
-// The lights in Bevy's units. 3d.tsx's lights take a relative intensity, which the rows scale by these (LUX, LUMENS and
-// AMBIENT in runtime/scene; daylight.tsx's UNITS), so a Bevy light divides by them and the engine
-// gets back the lux, lumens or cd/m² it was written with.
-export const LUX = 8000;
-
-export const LUMENS = 9e5;
-
-export const AMBIENT_NITS = 400;
+/** Bevy's named light values (bevy_light light_consts), for a light's own units: `illuminance={light_consts.lux.DIRECT_SUNLIGHT}`,
+ * `intensity={light_consts.lumens.VERY_LARGE_CINEMA_LIGHT}`. */
+export const light_consts = {
+ lumens: { LUMENS_PER_LED_WATTS: 90, LUMENS_PER_INCANDESCENT_WATTS: 13.8, LUMENS_PER_HALOGEN_WATTS: 19.8, VERY_LARGE_CINEMA_LIGHT: 1_000_000 },
+ lux: {
+ MOONLESS_NIGHT: 0.0001, FULL_MOON_NIGHT: 0.05, CIVIL_TWILIGHT: 3.4, LIVING_ROOM: 50, HALLWAY: 80, DARK_OVERCAST_DAY: 100, OFFICE: 320,
+ CLEAR_SUNRISE: 400, OVERCAST_DAY: 1000, AMBIENT_DAYLIGHT: 10_000, FULL_DAYLIGHT: 20_000, DIRECT_SUNLIGHT: 100_000, RAW_SUNLIGHT: 130_000,
+ },
+} as const;
/** What a Bevy light's fields don't name: 3d.tsx's placement and shadow props, refused so a light is written one way. */
export const OLD_LIGHT_PROPS = ["position", "target", "castShadow", "softShadow", "softness", "distance", "angle", "penumbra", "intensity"] as const;
diff --git a/sdk/render/src/daylight.tsx b/sdk/render/src/daylight.tsx
index bccc1679..1c9da2c8 100644
--- a/sdk/render/src/daylight.tsx
+++ b/sdk/render/src/daylight.tsx
@@ -11,10 +11,9 @@ import { AmbientLight, DirectionalLight, Environment, SpotLight, type Vec3 } fro
import { hasNative, native } from "@raea/app/native";
import { onWall, type Opening, type Room } from "@raea/room/room";
-/** The engine's light units (core/scene props.rs): a DirectionalLight of 1 is 8000 lux; a spot or point
- * light of 1 is 9e5 lumens, its candela a lumen over 4π; an Environment of 1 is its panorama times 1000 cd/m²; an
- * AmbientLight of 1 is 400 cd/m². */
-export const UNITS = { lux: 8000, lumens: 9e5, envNits: 1000, ambientNits: 400 };
+/** The engine's one relative unit left (core/scene props.rs ENV): an Environment of 1 is its panorama times 1000 cd/m².
+ * Lights are given in Bevy's own units (lux, lumens, nits: docs/control.feature FC1f). */
+export const UNITS = { envNits: 1000 };
const rad = Math.PI / 180;
@@ -140,9 +139,9 @@ export function Daylight({ day, indoor = 0.02, softShadow = 0.6 }: { day: Day; i
const b = bounce(day, indoor);
return (
<>
- {day.sunLux > 0 && <DirectionalLight name="sun" position={at} target={[0, 0, 0]} intensity={day.sunLux / UNITS.lux} color={kelvin(day.sunK)} castShadow softShadow={softShadow} />}
+ {day.sunLux > 0 && <DirectionalLight name="sun" position={at} target={[0, 0, 0]} lux={day.sunLux} color={kelvin(day.sunK)} castShadow softShadow={softShadow} />}
<Environment src={day.sky} rotation={day.rotation} intensity={0} background backgroundIntensity={day.scale / UNITS.envNits} />
- <AmbientLight name="bounce" intensity={b.nits / UNITS.ambientNits} color={kelvin(b.kelvin)} />
+ <AmbientLight name="bounce" nits={b.nits} color={kelvin(b.kelvin)} />
</>
);
}
@@ -160,7 +159,7 @@ export function windowLight(day: Day, room: Room, o: Opening, { transmit = 0.75,
return {
position: onWall(f, o.at, o.kind === "bay" ? 0.05 : -0.02, y),
target: onWall(f, o.at, 3, Math.max(0.3, y - 1.2)),
- intensity: (candela * 4 * Math.PI) / UNITS.lumens,
+ lumens: candela * 4 * Math.PI,
color: kelvin((day.skyK + day.sunK) / 2),
candela,
};
@@ -169,7 +168,7 @@ export function windowLight(day: Day, room: Room, o: Opening, { transmit = 0.75,
/** A window's light as a lamp (windowLight), wide and soft, shadowed. */
export function WindowLight({ day, room, opening, transmit, ground, name }: { day: Day; room: Room; opening: Opening; transmit?: number; ground?: number; name?: string }) {
const w = windowLight(day, room, opening, { transmit, ground });
- return <SpotLight name={name ?? `window-${opening.wall}-${opening.at.toFixed(2)}`} position={w.position} target={w.target} intensity={w.intensity} color={w.color} angle={Math.PI / 2} penumbra={1} castShadow />;
+ return <SpotLight name={name ?? `window-${opening.wall}-${opening.at.toFixed(2)}`} position={w.position} target={w.target} lumens={w.lumens} color={w.color} angle={Math.PI / 2} penumbra={1} castShadow />;
}
/** The exposure a camera sets for the room, as <ToneMapping exposure>: an incident meter's EV100 (log2 E·100/250, as
diff --git a/sdk/render/src/events3d.tsx b/sdk/render/src/events3d.tsx
index 09cd0d96..bdd39c36 100644
--- a/sdk/render/src/events3d.tsx
+++ b/sdk/render/src/events3d.tsx
@@ -265,16 +265,22 @@ export function usePointer2d(id: string, flat: Flat, props: Record<string, unkno
}
function usePart(id: string, part: ((handlers: Record<string, Handler>) => Part) | undefined, props: Record<string, unknown>) {
- const frame = useCurrentFrame();
- const input = useInput();
- const { width, height } = useVideoConfig();
const handlers: Record<string, Handler> = {};
for (const [type, prop] of Object.entries(POINTER_PROPS)) if (typeof props[prop] === "function") handlers[type] = props[prop] as Handler;
const any = Object.keys(handlers).length > 0 && part !== undefined;
- begin(frame);
- if (any) scene.parts.set(id, part(handlers));
+ // only a part with handlers follows the clock: reading it re-renders the part every frame, and every part reading
+ // it made 10 000 still cubes re-render every frame (docs/control.feature FC1b). The three are context reads only,
+ // which hold no hook slot in React (readContext) or in the live runtime (lite's useContext logs the read), so a
+ // part whose handlers come and go keeps its hook order
+ const frame = any ? useCurrentFrame() : -1;
+ const input = any ? useInput() : undefined;
+ const { width, height } = any ? useVideoConfig() : { width: 0, height: 0 };
+ if (any) {
+ begin(frame);
+ scene.parts.set(id, part(handlers));
+ }
useEffect(() => {
- if (!any) return;
+ if (!any || !input) return;
if (scene.done !== frame) {
scene.done = frame;
const p = input.pointer;
diff --git a/sdk/rune/examples/motion.tsx b/sdk/rune/examples/motion.tsx
new file mode 100644
index 00000000..5afa44bd
--- /dev/null
+++ b/sdk/rune/examples/motion.tsx
@@ -0,0 +1,37 @@
+// R6a's example: a toast list that springs in Rune and renders as a plain page anywhere else. A press adds a toast
+// that slides in on "pop"; a badge counts them with rolling digits; the panel behind has glass; a switch toggles
+// whether new toasts are urgent.
+import { useState } from "react";
+import { Badge, RollingText, Spring, Switch, rune } from "../src/index.ts";
+
+export default function Toasts() {
+ const [toasts, setToasts] = useState<{ id: number; urgent: boolean }[]>([]);
+ const [urgent, setUrgent] = useState(false);
+ const add = () => setToasts((t) => [...t, { id: t.length + 1, urgent }]);
+ return (
+ <div data-testid="panel" style={{ display: "flex", flexDirection: "column", gap: 8, width: 320, padding: 16, backgroundColor: "#15171c" }} {...rune({ glass: true })}>
+ <div style={{ display: "flex", flexDirection: "row", gap: 8, alignItems: "center" }}>
+ <button data-testid="add" onClick={add} style={{ padding: 8, borderRadius: 8, backgroundColor: "#2563eb", color: "#fff" }} {...rune({ motion: "snap" })}>
+ Add
+ </button>
+ <span style={{ color: "#f9fafb" }}>
+ <RollingText text={`${toasts.length}`} motion="snap" />
+ </span>
+ <Badge label={urgent ? "urgent" : "normal"} variant={urgent ? "accent" : "subtle"} dark />
+ <Switch checked={urgent} onChange={setUrgent} label="Urgent" dark />
+ </div>
+ {toasts.map((t) => (
+ <div
+ key={t.id}
+ data-testid={`toast-${t.id}`}
+ style={{ padding: 12, borderRadius: 10, backgroundColor: t.urgent ? "#7f1d1d" : "#23262d", color: "#f9fafb" }}
+ {...rune({ transition: { effect: { push: "top" }, enter: "pop", exit: Spring(0.2) }, lead: { lead: "snap", trail: "settle" } })}
+ >
+ {`Toast ${t.id}`}
+ </div>
+ ))}
+ </div>
+ );
+}
+
+export const steps = [{ press: "add" }, { press: "add" }, { press: "add" }];
diff --git a/sdk/rune/package.json b/sdk/rune/package.json
new file mode 100644
index 00000000..03ba4f62
--- /dev/null
+++ b/sdk/rune/package.json
@@ -0,0 +1,13 @@
+{
+ "name": "@raea/rune",
+ "version": "0.1.0",
+ "private": true,
+ "description": "Rune-only behaviour as typed TSX props and components (docs/rune.feature R6a, docs/targets.feature T1b): drawn by the native target (raea-rune-host), ignored by Blitz and browsers",
+ "type": "module",
+ "exports": {
+ ".": "./src/index.ts"
+ },
+ "peerDependencies": {
+ "react": "^19.2.0"
+ }
+}
diff --git a/sdk/rune/src/index.ts b/sdk/rune/src/index.ts
new file mode 100644
index 00000000..6bf85778
--- /dev/null
+++ b/sdk/rune/src/index.ts
@@ -0,0 +1,85 @@
+// @raea/rune: what Rune can do that CSS can't, as typed props on any element (docs/rune.feature R6a). They travel as
+// one `data-rune` attribute, so React DOM, Blitz and a browser ignore them and the same TSX renders there unchanged;
+// raea-rune-host reads it (engine/rune/style/src/runeprops.rs) and maps each field to Rune's builder.
+//
+// <div {...rune({ motion: "pop", transition: { effect: "slide" } })}>...</div>
+//
+// Everything not marked with motion lands at once in the Rune host, as the DOM does; an element that asks for motion,
+// a transition or lead and trail animates as Rune does.
+
+export * from "./kit.tsx";
+
+/** A spring as Rune has it: how long it takes to settle, in seconds, and how much it overshoots (0 none, 1 a lot). */
+export type Spring = { duration: number; bounce?: number };
+
+/** A spring by duration and bounce. */
+export const Spring = (duration: number, bounce = 0): Spring => ({ duration, bounce });
+
+/** Rune's motion tokens (rune-motion tokens.rs), by what they're for. */
+export type SpringPreset =
+ /** pointer-tied: takes the edge off a jump */
+ | "instant"
+ /** small controls answering a click */
+ | "snap"
+ /** the default state change */
+ | "settle"
+ /** layout moving out of the way */
+ | "reflow"
+ /** big surfaces travelling: drawers, sheets */
+ | "glide"
+ /** one shape becoming another */
+ | "morph"
+ /** a release with a little life: presses, confirmations */
+ | "pop"
+ /** slow reveals the eye should follow */
+ | "drift";
+
+/** A spring: a preset's name or one of your own. */
+export type Motion = SpringPreset | Spring;
+
+/** The edge a transition moves through. */
+export type Edge = "leading" | "trailing" | "top" | "bottom";
+
+/** How an element enters when it mounts and leaves when it's removed (Rune keeps it on screen while it leaves). */
+export type Effect =
+ /** no motion: whole the frame it mounts, gone the frame it's removed */
+ | "none"
+ | "opacity"
+ /** in from the leading edge, out through the trailing edge */
+ | "slide"
+ /** an in-place replacement: a little blur, scale and fade */
+ | "blurReplace"
+ | { scale: number }
+ | { offset: [number, number] }
+ /** in from and out to an edge, by the element's size */
+ | { move: Edge }
+ /** in from an edge, out through the opposite one, fading */
+ | { push: Edge }
+ /** a Gaussian blur (sigma in points) and a fade */
+ | { blur: number };
+
+/** A transition: its effect, and the springs it enters and exits on (Rune's defaults when left out). */
+export type Transition = { effect: Effect; enter?: Motion; exit?: Motion };
+
+/** Rune-only behaviour for one element. */
+export type RuneProps = {
+ /** the spring this element's layout changes move on (place, size, opacity) */
+ motion?: Motion;
+ /** its entrance and exit */
+ transition?: Transition | Effect;
+ /** when it travels, its leading edge moves on `lead` and its trailing edge on `trail` */
+ lead?: { lead: Motion; trail: Motion };
+ /** every change inside it lands at once, even where a parent animates */
+ instant?: boolean;
+ /** a Gaussian blur of the element itself, sigma in points */
+ blur?: number;
+ /** a blur of what's behind the element, sigma in points */
+ backdropBlur?: number;
+ /** the system's glass material behind the element (Liquid Glass on macOS; a blur elsewhere) */
+ glass?: boolean;
+};
+
+/** The prop that carries `p`: spread it onto any element. */
+export function rune(p: RuneProps): { "data-rune": string } {
+ return { "data-rune": JSON.stringify(p) };
+}
diff --git a/sdk/rune/src/kit.tsx b/sdk/rune/src/kit.tsx
new file mode 100644
index 00000000..ea4dfc7b
--- /dev/null
+++ b/sdk/rune/src/kit.tsx
@@ -0,0 +1,39 @@
+// rune-kit's components in TSX (R6a). Each renders a plain DOM stand-in that a browser or Blitz draws as it is, and
+// carries `data-rune-kit` with what the Rune host needs to build the real component in its place (host/src/kit.rs).
+// Presses on an interactive one still reach React: the host sends them to the page as the browser would.
+import type { ReactElement } from "react";
+
+type Kit = { kit: string } & Record<string, unknown>;
+const kit = (k: Kit) => ({ "data-rune-kit": JSON.stringify(k) });
+
+/** Which neutral kit draws the component in the Rune host: the light one (default) or the dark one, for dark surfaces. */
+type Theme = { dark?: boolean };
+
+/** A small label: neutral, accent or subtle. */
+export function Badge({ label, variant = "neutral", dark }: { label: string; variant?: "neutral" | "accent" | "subtle" } & Theme): ReactElement {
+ return <span {...kit({ kit: "badge", label, variant, dark })}>{label}</span>;
+}
+
+/** An indeterminate spinner. */
+export function Spinner({ dark }: Theme = {}): ReactElement {
+ return <span role="progressbar" aria-busy="true" {...kit({ kit: "spinner", dark })} />;
+}
+
+/** A progress bar: `value` from 0 to 1, or none for indeterminate. */
+export function Progress({ value, dark }: { value?: number } & Theme): ReactElement {
+ return <progress value={value} max={1} {...kit({ kit: "progress", value: value ?? null, dark })} />;
+}
+
+/** Text whose characters roll to their new values when it changes (a counter, a price). */
+export function RollingText({ text, motion }: { text: string; motion?: import("./index.ts").Motion }): ReactElement {
+ return <span {...kit({ kit: "rolling", text, motion: motion ?? null })}>{text}</span>;
+}
+
+/** An on/off switch; `onChange` hears the new value. */
+export function Switch({ checked, onChange, label, dark }: { checked: boolean; onChange: (next: boolean) => void; label?: string } & Theme): ReactElement {
+ return (
+ <button role="switch" aria-checked={checked} aria-label={label} onClick={() => onChange(!checked)} {...kit({ kit: "switch", checked, label: label ?? null, dark })}>
+ {label}
+ </button>
+ );
+}
diff --git a/sdk/rune/tsconfig.json b/sdk/rune/tsconfig.json
new file mode 100644
index 00000000..452b01ec
--- /dev/null
+++ b/sdk/rune/tsconfig.json
@@ -0,0 +1,5 @@
+{
+ "extends": "../tsconfig.base.json",
+ "compilerOptions": { "allowImportingTsExtensions": true },
+ "include": ["src", "examples"]
+}
diff --git a/sdk/shell/bun.lock b/sdk/shell/bun.lock
index 488d4182..0aacd4c0 100644
--- a/sdk/shell/bun.lock
+++ b/sdk/shell/bun.lock
@@ -9,6 +9,9 @@
},
},
},
+ "overrides": {
+ "undici": "7.30.1",
+ },
"packages": {
"@borewit/text-codec": ["@borewit/[email protected]", "", {}, "sha512-DDaRehssg1aNrH4+2hnj1B7vnUGEjU6OIlyRdkMd0aUdIUvKXrJfXsy8LVtXAy7DRvYVluWbMspsRhz2lcW0mQ=="],
@@ -148,7 +151,7 @@
"uint8array-extras": ["[email protected]", "", {}, "sha512-8iAasVS4wUx0gPLjH8Xtz2PeDzTSiy8QiLGu2DT3X5GU+egFEQhpnbtkehbAwjvDcxIERmCYcysiODFmE3Ud0Q=="],
- "undici": ["[email protected]", "", {}, "sha512-IDxfleLmmbSskfWSUATiN1nfn2rDuvnMOqb5CWR92iIfojA0Ud+ulOAAEQ57LPr9rWmsreUyf5lwyao+7GNNVw=="],
+ "undici": ["[email protected]", "", {}, "sha512-03KrMbjIFDWQR5RNPrSw3bd1r12JpyFQl9/yxjUbJtqkjmllqC5lFjZh6ujeuJCKr8EOQvRW872Oy/az+nLYxg=="],
"util-deprecate": ["[email protected]", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="],
diff --git a/sdk/shell/package.json b/sdk/shell/package.json
index 34d5bb4b..7ffb0a7e 100644
--- a/sdk/shell/package.json
+++ b/sdk/shell/package.json
@@ -6,5 +6,8 @@
"type": "module",
"dependencies": {
"just-bash": "3.6.0"
+ },
+ "overrides": {
+ "undici": "7.30.1"
}
}
diff --git a/sdk/skills/raea/SKILL.md b/sdk/skills/raea/SKILL.md
index fa016b37..cc8468e5 100644
--- a/sdk/skills/raea/SKILL.md
+++ b/sdk/skills/raea/SKILL.md
@@ -148,6 +148,32 @@ raea check out/piece.mp4 --manifest out/render.json --taste ~/.raea/taste/taste.
`ffmpeg -i film.mp4 -c:v libx264 -preset slow -crf 23 -maxrate 2600k -bufsize 5200k -pix_fmt yuv420p -c:a aac -b:a 128k -movflags +faststart film-share.mp4`.
- Deliver to the controllers' specs (sizes, platforms, loudness) when the workspace sets them.
+## Native apps with Rune — HEADLESS (a checkout with projects/rune)
+<!-- sources: docs/rune.feature engine/cli/src/cli.rs -->
+
+The same TSX that renders on Bevy can be drawn by Rune, a native GPU UI framework, through `raea rune`. Target it for
+three things: a desktop app (a window of its own, packaged as a signed Mac app), UI rendered to video (product-UI ads:
+springs and presence on the virtual clock), and a Rune layer inside a Bevy scene (a HUD). A composition or a game
+stays on Bevy; reach for Rune when the thing is an application's interface.
+
+- Write it as a React app: a default export, DOM elements, inline `style` or Tailwind `className`. Rune draws the
+ subset in projects/rune/README.md's table (size, min/max, padding, margin, gap, flex, absolute insets, scroll,
+ colours and gradients, border, radius, shadow, opacity, font size, weight and family). Anything else is reported in
+ `unmapped.json`, never dropped: an empty one means the page maps whole.
+- Rune-only behaviour is typed props from `@raea/rune` (sdk/rune), ignored by every other host:
+ `<div {...rune({ motion: "pop", transition: { effect: { push: "top" }, enter: "pop" } })}>`, plus `lead`,
+ `instant`, `blur`, `backdropBlur` and `glass`, and rune-kit's `Badge`, `Spinner`, `Progress`, `RollingText` and
+ `Switch`. Without them an element lands at once, as it does in a browser.
+- Check your work headless before you show it: write the input as steps.json (`[{"press": "inc"}, {"type": "Ada", "into": "name"}, {"key": "Enter"}]`,
+ elements by `data-testid`) and run `raea rune --headless app.tsx --script steps.json --png out/`. It writes a PNG after the
+ mount and after each step (00-mount.png, 01-press-inc.png, ...), tree.json (each element's role, label, text and
+ box) and unmapped.json, the same bytes every run. Read the PNGs and the tree; fix what's unmapped.
+- Film it: add `--video out/app.mp4 [--audio music.wav]` to the headless run. Every frame on the virtual clock at 60 fps,
+ a cursor gliding to each element it presses, through `raea media encode` (signed like every export). The same app
+ and script give the same frames (out/video.json has their hashes).
+- Open it: `raea rune run app.tsx`. Package it: `raea rune bundle app.tsx -o App.app --notarize` (signed with raea's
+ Developer ID, notarized, accepted by Gatekeeper).
+
## Go further
- The guides: `raea guide` lists them; `raea guide NAME` prints one (`motion` first; `bevy` and `bevy/NAME` for 3D).
diff --git a/sdk/skills/raea/reference/cli.md b/sdk/skills/raea/reference/cli.md
index ee7b5513..39e1406d 100644
--- a/sdk/skills/raea/reference/cli.md
+++ b/sdk/skills/raea/reference/cli.md
@@ -162,7 +162,7 @@ Access: HEADLESS. Arguments besides flags: 1.
```
raea check EDIT.tsx --quick [--shape S] [--platform P] [--taste T] [-o check.json] (three stills of a composition checked for text: clipped, cramped, safe areas, sizes; about a second)
-raea check VIDEO.mp4 [--manifest render.json] [--words W.json] [--perception P.json] [--shape 16:9|9:16|4:5|1:1] [--platform tiktok|reels|shorts] [--taste taste.ts|DIR] [-o check.json] (an export against the floor: clipped text, contrast, safe areas, freezes, cues, loudness, blotching, a placeholder brand kit; P0-P3)
+raea check VIDEO.mp4 [--manifest render.json] [--words W.json] [--perception P.json] [--shape 16:9|9:16|4:5|1:1] [--platform tiktok|reels|shorts] [--taste taste.ts|DIR] [-o check.json] (an export against the floor: clipped text, contrast, safe areas, freezes, flashing, cues, loudness, blotching, a placeholder brand kit; P0-P3)
```
Flags: `--manifest` (1), `--perception` (1), `--platform` (1), `--quick`, `--shape` (1), `--taste` (1), `--words` (1), `-o` (1).
@@ -193,6 +193,16 @@ raea doctor [--fix] [DIR] (what doesn't match this raea: old brief files, an o
Flags: `--fix`.
+## raea app
+
+Access: HEADLESS. Arguments besides flags: 2.
+
+```
+raea app run|check|bundle APP.tsx [--target web|native] [--size WxH] [--script steps.json] [--png DIR] [-o App.app] (a TSX app on @raea/ui: its window, the headless check, a Mac app; web is Blitz on Bevy, native is Rune; the app's `export const app` sets the target, web when it doesn't; raea rune ... is --target native)
+```
+
+Flags: `--png` (1), `--script` (1), `--size` (1), `--target` (1), `-o` (1).
+
## raea skill
Access: HEADLESS. Arguments besides flags: 1.
diff --git a/sdk/skills/raea/reference/files.md b/sdk/skills/raea/reference/files.md
index ee1b7e5d..140b316b 100644
--- a/sdk/skills/raea/reference/files.md
+++ b/sdk/skills/raea/reference/files.md
@@ -40,9 +40,9 @@ that moves each (when there is one) and the files that name them.
| `~/.raea/Library/Caches` | | apps/app/host/acp/fence.ts |
| `~/.raea/account.json` | `RAEA_ACCOUNT` | apps/app/host/auth.ts |
| `~/.raea/actions.jsonl` | | io/shell/src/fs/mod.rs |
-| `~/.raea/bin` | | io/assets/src/lib.rs, runtime/bundle/src/fresh.rs, runtime/page/src/faces.rs |
+| `~/.raea/bin` | | io/assets/src/lib.rs, runtime/bundle/lib/src/lib.rs, runtime/page/src/faces.rs |
| `~/.raea/cache` | | apps/app/host/take.ts |
-| `~/.raea/env` | `RAEA_ENV_FILE` | apps/app/host/director.ts, io/gen-core/src/fal.rs, io/gen-core/src/fish.rs, io/gen-core/src/made.rs, io/gen-core/src/modal.rs, io/gen-core/src/openrouter.rs, io/gen-core/src/replicate.rs, io/home/src/lib.rs |
+| `~/.raea/env` | `RAEA_ENV_FILE` | apps/app/host/director.ts, io/gen-core/src/fal.rs, io/gen-core/src/fish.rs, io/gen-core/src/made.rs, io/gen-core/src/modal.rs, io/gen-core/src/openrouter.rs, io/gen-core/src/replicate.rs, io/gen-core/src/tripo.rs, io/home/src/lib.rs |
| `~/.raea/evals/skills` | | apps/app/host/evals/skills.ts |
| `~/.raea/feed/media` | | apps/app/host/paths.ts |
| `~/.raea/library` | `RAEA_LIBRARY_HOME` | apps/app/host/library/local.ts |
diff --git a/sdk/skills/raea/reference/sdk.md b/sdk/skills/raea/reference/sdk.md
index e7c3529c..be11e7d9 100644
--- a/sdk/skills/raea/reference/sdk.md
+++ b/sdk/skills/raea/reference/sdk.md
@@ -55,7 +55,7 @@ with a capital, hooks with `use`. A component's props are in its file.
## `raea/light` (sdk/raea/src/light.ts)
-`AmbientLight`, `Atmosphere`, `DirectionalLight`, `Environment`, `GlobalAmbientLight`, `Pathtracer`, `PointLight`, `RectLight`, `Shadows`, `SolariLighting`, `SpotLight`
+`AmbientLight`, `Atmosphere`, `DirectionalLight`, `Environment`, `GlobalAmbientLight`, `Pathtracer`, `PointLight`, `RectLight`, `Shadows`, `SolariLighting`, `SpotLight`, `light_consts`
## `raea/math` (sdk/raea/src/math.ts)
@@ -63,7 +63,7 @@ with a capital, hooks with `use`. A component's props are in its file.
## `raea/mesh` (sdk/raea/src/mesh.ts)
-`BufferMesh`, `Capsule`, `Capsule3d`, `Cone`, `ConicalFrustum`, `Cuboid`, `Cylinder`, `Mesh`, `Mesh2d`, `Mesh3d`, `MeshSequence`, `Plane3d`, `Sphere`, `Torus`
+`BufferMesh`, `Capsule`, `Capsule3d`, `Cone`, `ConicalFrustum`, `Cuboid`, `Cylinder`, `Instances`, `Mesh`, `Mesh2d`, `Mesh3d`, `MeshSequence`, `Plane3d`, `Sphere`, `Torus`, `scatter`
## `raea/pbr` (sdk/raea/src/pbr.ts)
diff --git a/sdk/tsconfig.base.json b/sdk/tsconfig.base.json
index fe4b07f0..34446da2 100644
--- a/sdk/tsconfig.base.json
+++ b/sdk/tsconfig.base.json
@@ -16,7 +16,6 @@
"raea/bevy": ["./app/src/bevy.ts"],
"raea/bevy-own": ["./render/src/bevy-own.gen.tsx"],
"raea/bevy3d": ["./render/src/bevy3d.tsx"],
- "raea/body": ["./body/src/index.ts"],
"raea/character": ["./character/src/character.tsx"],
"raea/clip": ["./character/src/clip.ts"],
"raea/clock": ["./app/src/clock.tsx"],
@@ -29,7 +28,6 @@
"raea/feet": ["./character/src/feet.ts"],
"raea/glb": ["./asset/src/glb.ts"],
"raea/games": ["./app/src/games.ts"],
- "raea/gen": ["./gen/src/index.ts"],
"raea/grasp": ["./character/src/grasp.ts"],
"raea/interpolate": ["./math/src/interpolate.ts"],
"raea/items": ["./character/src/items.ts"],
@@ -47,7 +45,7 @@
"raea/paint": ["./render/src/paint.tsx"],
"raea/panel": ["./video/src/panel.ts"],
"raea/physics": ["./physics/src/physics.tsx"],
- "raea/playable": ["./playable/src/index.ts"],
+ "raea/r3f": ["./r3f/src/index.ts"],
"raea/pick": ["./render/src/pick.ts"],
"raea/playtest": ["./app/src/playtest.ts"],
"raea/ragdoll": ["./character/src/ragdoll.ts"],
@@ -76,16 +74,15 @@
"@raea/app/*": ["./app/src/*"],
"@raea/math": ["./math/src/index.ts"],
"@raea/math/*": ["./math/src/*"],
+ "@raea/r3f": ["./r3f/src/index.ts"],
+ "@raea/r3f/*": ["./r3f/src/*"],
"@raea/audio": ["./audio/src/index.ts"],
"@raea/audio/*": ["./audio/src/*"],
"@raea/video": ["./video/src/index.ts"],
"@raea/video/*": ["./video/src/*"],
- "@raea/body": ["./body/src/index.ts"],
- "@raea/body/*": ["./body/src/*"],
"@raea/character": ["./character/src/index.ts"],
"@raea/character/*": ["./character/src/*"],
"@raea/asset": ["./asset/src/index.ts"],
- "@raea/gen": ["./gen/src/index.ts"],
"@raea/asset/*": ["./asset/src/*"],
"@raea/dev_tools": ["./dev_tools/src/index.ts"],
"@raea/dev_tools/*": ["./dev_tools/src/*"],
@@ -98,10 +95,9 @@
"@raea/ui/plugin": ["./ui/src/plugin.ts"],
"@raea/physics": ["./physics/src/index.ts"],
"@raea/physics/*": ["./physics/src/*"],
- "@raea/playable": ["./playable/src/index.ts"],
- "@raea/playable/*": ["./playable/src/*"],
"@raea/room": ["./room/src/index.ts"],
"@raea/room/*": ["./room/src/*"],
+ "@raea/rune": ["./rune/src/index.ts"],
"@raea/plugins": ["./plugins/src/index.ts"],
"@raea/plugins/*": ["./plugins/src/*"]
}
diff --git a/sdk/ui/package.json b/sdk/ui/package.json
index 339c7bb0..ebc8fdbf 100644
--- a/sdk/ui/package.json
+++ b/sdk/ui/package.json
@@ -10,7 +10,8 @@
"./react-dom": "./src/react-dom.ts",
"./platform": "./src/platform.ts",
"./wire": "./src/wire.ts",
- "./plugin": "./src/plugin.ts"
+ "./plugin": "./src/plugin.ts",
+ "./app": "./src/app.ts"
},
"scripts": {
"test": "bun test test"
diff --git a/sdk/ui/src/app.ts b/sdk/ui/src/app.ts
new file mode 100644
index 00000000..96e377f2
--- /dev/null
+++ b/sdk/ui/src/app.ts
@@ -0,0 +1,24 @@
+// An app's target and window (docs/targets.feature T0a). An app file may export one, as a literal:
+//
+// import type { AppConfig } from "@raea/ui/app";
+// export const app: AppConfig = { target: "native", title: "Tally", size: [1080, 1920] };
+//
+// raea reads it from the file before bundling, without running it (apps/targets), so it must be a literal: objects,
+// arrays, strings, numbers. A variable, a call or a spread there is refused with its file and line. The default is
+// written down: with no `app` export, or no `target` in it, an app is "web". `--target` on the command line wins over
+// the file. Nothing here crosses the wire; it's types only.
+
+/** Where an app runs: "web" (Blitz on Bevy, raea's page, the default) or "native" (Rune: native windows, springs). */
+export type AppTarget = "web" | "native";
+
+/** An app's `export const app`: its target and its window. */
+export type AppConfig = {
+ /** the host: "web" when left out */
+ target?: AppTarget;
+ /** the window's title (the file's name when left out) */
+ title?: string;
+ /** the window's size in points, [width, height] */
+ size?: [number, number];
+ /** the smallest the window may be made, [width, height] */
+ minSize?: [number, number];
+};
diff --git a/systems/frame/src/lib.rs b/systems/frame/src/lib.rs
index 6e5c40c2..8968adf6 100644
--- a/systems/frame/src/lib.rs
+++ b/systems/frame/src/lib.rs
@@ -254,7 +254,12 @@ pub fn scale_of(vals: &BTreeMap<String, V>) -> Vec3 {
Vec3::new(num(vals, "scale_x", s), num(vals, "scale_y", s), num(vals, "scale_z", s))
}
+/// A row's rotation: its quaternion (q_x q_y q_z q_w, what runtime/scene writes: docs/control.feature FC1d), or
+/// rot_x rot_y rot_z (radians, YXZ) where a row was written that way
pub fn rot_of(vals: &BTreeMap<String, V>) -> Quat {
+ if vals.contains_key("q_w") {
+ return Quat::from_xyzw(num(vals, "q_x", 0.0), num(vals, "q_y", 0.0), num(vals, "q_z", 0.0), num(vals, "q_w", 1.0)).normalize();
+ }
Quat::from_euler(EulerRot::YXZ, num(vals, "rot_y", 0.0), num(vals, "rot_x", 0.0), num(vals, "rot_z", 0.0))
}
diff --git a/systems/light-meter/src/lib.rs b/systems/light-meter/src/lib.rs
index 77d7c99a..ace5ee18 100644
--- a/systems/light-meter/src/lib.rs
+++ b/systems/light-meter/src/lib.rs
@@ -19,7 +19,7 @@ use std::sync::{Arc, Mutex, OnceLock};
use bevy::math::{Quat, Vec3};
use serde_json::{json, Value};
-use raea_core_scene::{AMBIENT, ENV, EV100, Item, LUMENS, LUX, Part, hex, num, parts_of, ray_tri, rgb, src_path, vec3};
+use raea_core_scene::{ENV, EV100, Item, Part, light_power, hex, num, parts_of, ray_tri, rgb, src_path, vec3};
/// An incident meter's calibration (ISO 2720, a flat receptor): EV100 = log2(E x 100 / C).
const C: f32 = 250.0;
@@ -255,7 +255,8 @@ fn sources(its: &[Item], parts: &[&Part], at: Vec3, n: Vec3) -> Vec<Got> {
let pr = &it.props;
let shadows = pr.get("castShadow").and_then(Value::as_bool) == Some(true);
let colour = linear(pr.get("color"));
- let power = num(pr, "intensity").unwrap_or(1.0) as f32;
+ // an <Environment>'s intensity is relative to ENV, not a light's power
+ let power = if it.kind == "environment" { num(pr, "intensity").unwrap_or(1.0) } else { light_power(it.kind, pr) } as f32;
let world = |key: &str, d: [f64; 3]| {
let v = vec3(pr, key, d);
it.world.transform_point3(Vec3::new(v[0] as f32, v[1] as f32, v[2] as f32))
@@ -268,7 +269,7 @@ fn sources(its: &[Item], parts: &[&Part], at: Vec3, n: Vec3) -> Vec<Got> {
let l = (world("position", [0.0, 1.0, 0.0]) - Vec3::new(t[0] as f32, t[1] as f32, t[2] as f32)).normalize();
let cos = n.dot(l).max(0.0);
let blocked = if shadows && cos > 0.0 { seen_by(l, 1e4) } else { None };
- let lux = if blocked.is_some() { 0.0 } else { power * LUX as f32 * cos };
+ let lux = if blocked.is_some() { 0.0 } else { power * cos };
out.push(Got { name, kind: "sun", lux, colour, blocked, shadows });
}
"point" | "spot" => {
@@ -277,7 +278,7 @@ fn sources(its: &[Item], parts: &[&Part], at: Vec3, n: Vec3) -> Vec<Got> {
let r = to.length().max(1e-4);
let l = to / r;
let cos = n.dot(l).max(0.0);
- let candela = power * LUMENS as f32 / (4.0 * PI);
+ let candela = power / (4.0 * PI);
// Bevy's range window: (1 - (d/range)^4)^2, the light gone at its range
let range = num(pr, "distance").filter(|d| *d > 0.0).unwrap_or(20.0) as f32;
let window = (1.0 - (r / range).powi(4)).clamp(0.0, 1.0).powi(2);
@@ -297,7 +298,7 @@ fn sources(its: &[Item], parts: &[&Part], at: Vec3, n: Vec3) -> Vec<Got> {
}
out.push(Got { name, kind: if it.kind == "spot" { "spot" } else { "point" }, lux, colour, blocked, shadows });
}
- "ambient" => out.push(Got { name, kind: "ambient", lux: PI * power * AMBIENT as f32, colour, blocked: None, shadows: false }),
+ "ambient" => out.push(Got { name, kind: "ambient", lux: PI * power, colour, blocked: None, shadows: false }),
"environment" => {
let Some(src) = pr.get("src").and_then(Value::as_str) else { continue };
let Ok(pano) = pano(&src_path(src)) else { continue };
diff --git a/systems/parity/Cargo.toml b/systems/parity/Cargo.toml
new file mode 100644
index 00000000..344654b9
--- /dev/null
+++ b/systems/parity/Cargo.toml
@@ -0,0 +1,11 @@
+[package]
+name = "raea-sys-parity"
+version = "0.1.0"
+edition = "2024"
+license = "FSL-1.1-ALv2"
+publish = false
+description = "The parity probe (docs/control.feature FC0a): what a frame cost and what the World held, written as JSON lines at chosen frames, the same plugin in a Bevy example and in raea, off unless RAEA_PARITY is set"
+
+[dependencies]
+bevy = { version = "=0.20.0", default-features = false, features = ["std", "default_app", "3d_bevy_render"] }
+serde_json = "1"
diff --git a/systems/parity/src/lib.rs b/systems/parity/src/lib.rs
new file mode 100644
index 00000000..1947fa53
--- /dev/null
+++ b/systems/parity/src/lib.rs
@@ -0,0 +1,178 @@
+//! The parity probe (docs/control.feature FC0a). The same plugin goes into a Bevy example's App (bench/bevy-parity's
+//! host) and into raea's (raea_plugins.rs), so the two runs of a scene are measured by one piece of code. Off unless
+//! RAEA_PARITY is set:
+//!
+//! RAEA_PARITY=FILE.jsonl one JSON line per probed frame (below)
+//! RAEA_PARITY_FRAMES=30,60 the frames probed, counted from the App's first update ("all": every frame; default all)
+//! RAEA_PARITY_PNG=DIR also the primary window's picture at each probed frame, as DIR/FRAME.png
+//! RAEA_PARITY_EXIT=1 exit a few frames after the last probed frame (the screenshot's readback lands first)
+//! RAEA_PARITY_TYPES=A,B also each listed Bevy type's value on every entity that has it, reflected as Bevy
+//! serializes it, one line a probed frame in FILE.world.jsonl (FC0c's defaults test)
+//!
+//! A line holds what decides a frame's cost, read from the main World:
+//! entities every entity
+//! mesh_entities entities with a Mesh3d; `visible` those whose ViewVisibility is set this frame
+//! meshes, materials the Mesh and StandardMaterial assets held
+//! batch_keys distinct (mesh, standard material) handle pairs among the visible: with Bevy's automatic batching
+//! (and GPU preprocessing) a pair is about one draw, so this stands in for the draw-call count Bevy
+//! doesn't report; `other_material` counts visible meshes drawn by another material type
+//! extents the distinct half-extents of the visible meshes' bounds (up to 8), a check on what was drawn
+//! frame_ms real time per frame, the mean since the line before
+//! Wall time is the machine's, so compare it between runs of one machine only.
+
+use std::collections::{BTreeSet, HashSet};
+use std::io::Write;
+use std::path::PathBuf;
+use std::time::{Duration, Instant};
+
+use bevy::app::AppExit;
+use bevy::camera::primitives::Aabb;
+use bevy::camera::visibility::ViewVisibility;
+use bevy::prelude::*;
+use bevy::render::view::window::screenshot::{Screenshot, save_to_disk};
+use bevy::time::TimeUpdateStrategy;
+
+#[derive(Resource)]
+struct Probe {
+ out: PathBuf,
+ frames: Option<BTreeSet<u64>>,
+ png: Option<PathBuf>,
+ exit: bool,
+ types: Vec<String>,
+ frame: u64,
+ since: Instant,
+ ticks: u32,
+}
+
+/// Adds the probe when RAEA_PARITY is set: the example host's entry and RaeaPlugins' (raea_plugins.rs).
+pub fn install(app: &mut App) {
+ let Ok(out) = std::env::var("RAEA_PARITY") else { return };
+ let frames = match std::env::var("RAEA_PARITY_FRAMES").ok().as_deref() {
+ None | Some("all") | Some("") => None,
+ Some(s) => Some(s.split(',').filter_map(|f| f.trim().parse().ok()).collect()),
+ };
+ let png = std::env::var("RAEA_PARITY_PNG").ok().map(PathBuf::from);
+ if let Some(d) = &png {
+ let _ = std::fs::create_dir_all(d);
+ }
+ let exit = std::env::var("RAEA_PARITY_EXIT").is_ok_and(|v| v == "1");
+ let types: Vec<String> = std::env::var("RAEA_PARITY_TYPES")
+ .map(|t| t.split(',').map(|s| s.trim().to_string()).filter(|s| !s.is_empty()).collect())
+ .unwrap_or_default();
+ if !types.is_empty() {
+ let _ = std::fs::write(world_file(&out), "");
+ }
+ let _ = std::fs::write(&out, "");
+ app.insert_resource(Probe { out: out.into(), frames, png, exit, types, frame: 0, since: Instant::now(), ticks: 0 });
+ app.add_systems(Last, (probe, dump).chain());
+}
+
+/// A fixed clock of `fps` frames a second (Bevy's TimeUpdateStrategy::ManualDuration), for a run that must repeat.
+pub fn fixed_clock(app: &mut App, fps: f64) {
+ app.insert_resource(TimeUpdateStrategy::ManualDuration(Duration::from_secs_f64(1.0 / fps)));
+}
+
+#[allow(clippy::type_complexity)]
+fn probe(
+ mut p: ResMut<Probe>,
+ all: Query<Entity>,
+ meshes_q: Query<(&Mesh3d, Option<&MeshMaterial3d<StandardMaterial>>, Option<&ViewVisibility>, Option<&Aabb>)>,
+ meshes: Option<Res<Assets<Mesh>>>,
+ materials: Option<Res<Assets<StandardMaterial>>>,
+ mut commands: Commands,
+ mut exit: MessageWriter<AppExit>,
+) {
+ let f = p.frame;
+ p.frame += 1;
+ p.ticks += 1;
+ let last = p.frames.as_ref().and_then(|s| s.last().copied());
+ if p.exit && last.is_some_and(|l| f >= l + 4) {
+ exit.write(AppExit::Success);
+ return;
+ }
+ if p.frames.as_ref().is_some_and(|s| !s.contains(&f)) {
+ return;
+ }
+ let frame_ms = p.since.elapsed().as_secs_f64() * 1000.0 / p.ticks.max(1) as f64;
+ p.since = Instant::now();
+ p.ticks = 0;
+ let (mut mesh_entities, mut visible, mut other) = (0u64, 0u64, 0u64);
+ let mut keys = HashSet::new();
+ let mut extents = BTreeSet::new();
+ for (mesh, mat, vis, aabb) in &meshes_q {
+ mesh_entities += 1;
+ if !vis.is_some_and(|v| v.get()) {
+ continue;
+ }
+ visible += 1;
+ match mat {
+ Some(m) => {
+ keys.insert((mesh.0.id(), m.0.id()));
+ }
+ None => other += 1,
+ }
+ if let Some(a) = aabb
+ && extents.len() < 8
+ {
+ let h = a.half_extents;
+ extents.insert(format!("{:.4} {:.4} {:.4}", h.x, h.y, h.z));
+ }
+ }
+ let line = serde_json::json!({
+ "frame": f,
+ "entities": all.iter().count(),
+ "mesh_entities": mesh_entities,
+ "visible": visible,
+ "meshes": meshes.map_or(0, |m| m.len()),
+ "materials": materials.map_or(0, |m| m.len()),
+ "batch_keys": keys.len(),
+ "other_material": other,
+ "extents": extents.into_iter().collect::<Vec<_>>(),
+ "frame_ms": (frame_ms * 1000.0).round() / 1000.0,
+ });
+ if let Ok(mut file) = std::fs::OpenOptions::new().append(true).open(&p.out) {
+ let _ = writeln!(file, "{line}");
+ }
+ if let Some(d) = &p.png {
+ commands.spawn(Screenshot::primary_window()).observe(save_to_disk(d.join(format!("{f}.png"))));
+ }
+}
+
+fn world_file(out: &str) -> PathBuf {
+ PathBuf::from(format!("{}.world.jsonl", out.strip_suffix(".jsonl").unwrap_or(out)))
+}
+
+/// The listed types' values on the frame `probe` just wrote, reflected as Bevy serializes them (TypedReflectSerializer).
+fn dump(world: &mut World) {
+ let Some(p) = world.get_resource::<Probe>() else { return };
+ let f = p.frame.saturating_sub(1);
+ if p.types.is_empty() || p.frames.as_ref().is_some_and(|s| !s.contains(&f)) {
+ return;
+ }
+ let (types, out) = (p.types.clone(), world_file(&p.out.to_string_lossy()));
+ let registry = world.resource::<AppTypeRegistry>().clone();
+ let registry = registry.read();
+ let mut by_type = serde_json::Map::new();
+ for path in &types {
+ let Some(reg) = registry.get_with_type_path(path) else {
+ by_type.insert(path.clone(), serde_json::json!({"error": "not in the type registry"}));
+ continue;
+ };
+ // a resource too: Bevy 0.20 keeps each on an entity of its own, as a component
+ let Some(rc) = reg.data::<bevy::ecs::reflect::ReflectComponent>() else {
+ by_type.insert(path.clone(), serde_json::json!({"error": "not a reflected component or resource"}));
+ continue;
+ };
+ let mut values = vec![];
+ for e in world.iter_entities() {
+ if let Some(v) = rc.reflect(e) {
+ let ser = bevy::reflect::serde::TypedReflectSerializer::new(v.as_partial_reflect(), &registry);
+ values.push(serde_json::to_value(&ser).unwrap_or_else(|err| serde_json::json!({"error": err.to_string()})));
+ }
+ }
+ by_type.insert(path.clone(), serde_json::Value::Array(values));
+ }
+ if let Ok(mut file) = std::fs::OpenOptions::new().append(true).open(&out) {
+ let _ = writeln!(file, "{}", serde_json::json!({"frame": f, "world": by_type}));
+ }
+}
diff --git a/systems/tone/src/tonegraph.rs b/systems/tone/src/tonegraph.rs
index 5f01e51d..f34f7745 100644
--- a/systems/tone/src/tonegraph.rs
+++ b/systems/tone/src/tonegraph.rs
@@ -36,6 +36,8 @@ pub struct Built {
from_voices: Vec<NodeID>,
}
+/// FNV-1a over the JSON's bytes. engine/rune/src/video.rs `fnv` is the same hash (the native host can't depend on
+/// systems/): a fix to one goes to the other.
pub fn hash(json: &str) -> u64 {
json.bytes().fold(0xcbf29ce484222325u64, |h, b| (h ^ b as u64).wrapping_mul(0x100000001b3))
}
diff --git a/tools/release.sh b/tools/release.sh
index 24da3458..c4776254 100755
--- a/tools/release.sh
+++ b/tools/release.sh
@@ -10,7 +10,11 @@
# tools/release.sh VERSION BIN_DIR [REF] BIN_DIR holds a release build's raea and its bundler
# (libraea_bundle.dylib, .so, or raea.exe and raea_bundle.dll), and on
# macOS raea-perceive (`raea song` runs it; it isn't ported, so Linux's
-# and Windows's archives have no `raea song`)
+# and Windows's archives have no `raea song`), and the app targets' two
+# hosts (docs/targets.feature T1f): raea-rune-host (native) and
+# raea-page-host's window build (web), each built in a cargo call of its
+# own, as they ship: `cargo build --profile dist -p raea-rune-host` and
+# `cargo build --profile dist -p raea-page-host --features window`
#
# The public engine is free and needs no raea account: its raea is built without raea's API (engine/cli's service
# feature) and with the plugin catalog (raea/plugins' 56 Bevy plugins and raea/input's gamepad and picking):
@@ -62,28 +66,32 @@ since=${RAEA_SINCE:-$(git describe --tags --abbrev=0 --match 'v*' "$ref" 2>/dev/
} > "$out/raea-$version-skills.md"
case $platform in
linux-x86_64)
- cp "$bin/raea" "$bin/libraea_bundle.so" "$stage/bin/"
+ cp "$bin/raea" "$bin/libraea_bundle.so" "$bin/raea-rune-host" "$bin/raea-page-host" "$stage/bin/"
# what a Linux machine needs beside it: the bundled Noto Sans JP is a Latin subset, so kanji and kana come from the
# system, as on a Mac (raea warns once a character when no font has it)
printf '%s\n' "raea $version for Linux x86_64 (glibc 2.39 or newer, Vulkan: a GPU driver or Mesa's llvmpipe).
Install a CJK font for Japanese, Chinese and Korean text (Debian and Ubuntu: apt install fonts-noto-cjk).
+An app on the native target (raea app ... --target native, raea-rune-host) needs libxkbcommon-x11 and the Vulkan
+loader (Debian and Ubuntu: apt install libxkbcommon-x11-0 libvulkan1).
Not in this build: raea song (its beat model's runner is macOS only so far)." > "$stage/README" ;;
windows-x86_64)
- cp "$bin/raea.exe" "$bin/raea_bundle.dll" "$stage/bin/"
+ cp "$bin/raea.exe" "$bin/raea_bundle.dll" "$bin/raea-rune-host.exe" "$bin/raea-page-host.exe" "$stage/bin/"
# the C runtime isn't in the zip (ort's ONNX Runtime needs its DLLs, and they're Microsoft's to ship): the VC++
# redistributable, which most Windows machines already have, provides it
printf '%s\r\n' "raea $version for Windows x86_64 (Windows 10 or 11, a DirectX 12 or Vulkan GPU driver; with no GPU, Mesa's lavapipe and WGPU_BACKEND=vulkan)." \
"It needs the Microsoft Visual C++ Redistributable (x64), which most machines already have:" \
"https://aka.ms/vs/17/release/vc_redist.x64.exe" \
"Not in this build: raea song (its beat model's runner is macOS only so far)." > "$stage/README.txt" ;;
- *) cp "$bin/raea" "$bin/libraea_bundle.dylib" "$bin/raea-perceive" "$stage/bin/" ;;
+ *) cp "$bin/raea" "$bin/libraea_bundle.dylib" "$bin/raea-perceive" "$bin/raea-rune-host" "$bin/raea-page-host" "$stage/bin/" ;;
esac
# the packages sdk/tsconfig.base.json lists (@raea/<name>: its sources and package.json), which the bundlers resolve by it
pkgs=()
# and its bevy/ (a package's plugin handles, generated from the plugin build: its src/plugin.ts imports ../bevy/)
+# and its examples/ (@raea/rune's, docs/targets.feature T1b: what a release's check runs)
for p in $(git show "$ref:sdk/tsconfig.base.json" | jq -r '.compilerOptions.paths | to_entries[] | select(.key | test("^@raea/[a-z_]+$")) | .value[0] | ltrimstr("./") | split("/")[0]' | tr -d '\r'); do
pkgs+=("sdk/$p/src" "sdk/$p/package.json")
git cat-file -e "$ref:sdk/$p/bevy" 2>/dev/null && pkgs+=("sdk/$p/bevy")
+ git cat-file -e "$ref:sdk/$p/examples" 2>/dev/null && pkgs+=("sdk/$p/examples")
done
[ ${#pkgs[@]} -gt 0 ] || { echo "release: no @raea packages in sdk/tsconfig.base.json at $ref" >&2; exit 1; }
# the committed files raea reads at run time
diff --git a/tools/sdk-props/src/reads.rs b/tools/sdk-props/src/reads.rs
index 7304c140..28fb29f3 100644
--- a/tools/sdk-props/src/reads.rs
+++ b/tools/sdk-props/src/reads.rs
@@ -1,12 +1,12 @@
//! The engine's readers scanned: every string literal that could be a prop's name in the Rust that turns a part's
-//! data-props into rows and entities (the runtime crates, engine/render and the systems crates; runtime/look reads
+//! data-props into rows and entities (the runtime crates, engine/render, the systems crates and core/scene's helpers such as light_power; runtime/look reads
//! <Look>'s by name). A prop whose name is one of them is read; one whose name is none of them can't be.
use std::collections::BTreeSet;
use std::path::Path;
/// Where data-props are read, from the repo's root
-pub const READERS: &[&str] = &["runtime", "engine/render/src", "systems"];
+pub const READERS: &[&str] = &["runtime", "engine/render/src", "systems", "core/scene/src"];
/// The identifier-shaped string literals (`"castShadow"`, `"x"`) in the readers' .rs files
pub fn literals(root: &Path) -> BTreeSet<String> {