diff --git a/previews/PR284/.documenter-siteinfo.json b/previews/PR284/.documenter-siteinfo.json index 425fad33..2a25eaa4 100644 --- a/previews/PR284/.documenter-siteinfo.json +++ b/previews/PR284/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.11.3","generation_timestamp":"2025-01-24T12:33:49","documenter_version":"1.8.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.11.3","generation_timestamp":"2025-01-24T16:40:08","documenter_version":"1.8.0"}} \ No newline at end of file diff --git a/previews/PR284/api.html b/previews/PR284/api.html index 47763a3c..4df71b45 100644 --- a/previews/PR284/api.html +++ b/previews/PR284/api.html @@ -11,7 +11,7 @@ App() do session::Session bound_global = bind_global(session, some_observable) return DOM.div(bound_global) -endsource
Bonito.AssetType

Represent an asset stored at an URL. We try to always have online & local files for assets

source
Bonito.CodeEditorMethod
CodeEditor(language::String; initial_source="", theme="chrome", editor_options...)

Defaults for editor_options:

(
+end
source
Bonito.AssetType

Represent an asset stored at an URL. We try to always have online & local files for assets

source
Bonito.CodeEditorMethod
CodeEditor(language::String; initial_source="", theme="chrome", editor_options...)

Defaults for editor_options:

(
     autoScrollEditorIntoView = true,
     copyWithEmptySelection = true,
     wrapBehavioursEnabled = true,
@@ -21,7 +21,7 @@
     fontSize = 16,
     wrap = 80,
     mergeUndoDeltas = "always"
-)
source
Bonito.DropdownType
Dropdown(options; index=1, option_to_string=string, style=Styles(), dom_attributes...)

A simple Dropdown, which can be styled via the style::Styles attribute.

Example

App() do
+)
source
Bonito.DropdownType
Dropdown(options; index=1, option_to_string=string, style=Styles(), dom_attributes...)

A simple Dropdown, which can be styled via the style::Styles attribute.

Example

App() do
     style = Styles(
         CSS("font-weight" => "500"),
         CSS(":hover", "background-color" => "silver"),
@@ -33,7 +33,7 @@
     end
     return dropdown
 end
-
source
Bonito.NoServerType

We don't serve files and include anything directly as raw bytes. Interpolating the same asset many times, will only upload the file to JS one time though.

source
Bonito.SessionType

A web session with a user

source
Bonito.StylableSliderMethod
StylableSlider(
+
source
Bonito.NoServerType

We don't serve files and include anything directly as raw bytes. Interpolating the same asset many times, will only upload the file to JS one time though.

source
Bonito.SessionType

A web session with a user

source
Bonito.StylableSliderMethod
StylableSlider(
     range::AbstractVector;
     value=first(range),
     slider_height=15,
@@ -71,10 +71,10 @@
         ),
     )
 end
-
source
Bonito.StylesType
Styles(css::CSS...)

Creates a Styles object, which represents a Set of CSS objects. You can insert the Styles object into a DOM node, and it will be rendered as a <style> node. If you assign it directly to DOM.div(style=Style(...)), the styling will be applied to the specific div. Note, that per Session, each unique css object in all Styles across the session will only be rendered once. This makes it easy to create Styling inside of components, while not worrying about creating lots of Style nodes on the page. There are a two more convenience constructors to make Styles a bit easier to use:

Styles(pairs::Pair...) = Styles(CSS(pairs...))
+
source
Bonito.StylesType
Styles(css::CSS...)

Creates a Styles object, which represents a Set of CSS objects. You can insert the Styles object into a DOM node, and it will be rendered as a <style> node. If you assign it directly to DOM.div(style=Style(...)), the styling will be applied to the specific div. Note, that per Session, each unique css object in all Styles across the session will only be rendered once. This makes it easy to create Styling inside of components, while not worrying about creating lots of Style nodes on the page. There are a two more convenience constructors to make Styles a bit easier to use:

Styles(pairs::Pair...) = Styles(CSS(pairs...))
 Styles(priority::Styles, defaults...) = merge(Styles(defaults...), priority)

For styling components, it's recommended, to always allow user to merge in customizations of a Style, like this:

function MyComponent(; style=Styles())
     return DOM.div(style=Styles(style, "color" => "red"))
-end

All Bonito components are stylable this way.

Info

Why not Hyperscript.Style? While the scoped styling via Hyperscript.Style is great, it makes it harder to create stylable components, since it doesn't allow the deduplication of CSS objects across the session. It's also significantly slower, since it's not as specialized on the deduplication and the camelcase keyword to css attribute conversion is pretty costly. That's also why CSS uses pairs of strings instead of keyword arguments.

source
Bonito.WebSocketConnectionMethod
handles a new websocket connection to a session
source
WidgetsBase.ButtonType
Button(name; style=Styles(), dom_attributes...)

A simple button, which can be styled a style::Styles.

Example

App() do
+end

All Bonito components are stylable this way.

Info

Why not Hyperscript.Style? While the scoped styling via Hyperscript.Style is great, it makes it harder to create stylable components, since it doesn't allow the deduplication of CSS objects across the session. It's also significantly slower, since it's not as specialized on the deduplication and the camelcase keyword to css attribute conversion is pretty costly. That's also why CSS uses pairs of strings instead of keyword arguments.

source
Bonito.WebSocketConnectionMethod
handles a new websocket connection to a session
source
WidgetsBase.ButtonType
Button(name; style=Styles(), dom_attributes...)

A simple button, which can be styled a style::Styles.

Example

App() do
     style = Styles(
         CSS("font-weight" => "500"),
         CSS(":hover", "background-color" => "silver"),
@@ -86,7 +86,7 @@
     end
     return button
 end
-
source
WidgetsBase.CheckboxType
Checkbox(default_value; style=Styles(), dom_attributes...)

A simple Checkbox, which can be styled via the style::Styles attribute.

source
WidgetsBase.NumberInputType
NumberInput(default_value; style=Styles(), dom_attributes...)

A simple NumberInput, which can be styled via the style::Styles attribute.

Example

App() do
+
source
WidgetsBase.CheckboxType
Checkbox(default_value; style=Styles(), dom_attributes...)

A simple Checkbox, which can be styled via the style::Styles attribute.

source
WidgetsBase.NumberInputType
NumberInput(default_value; style=Styles(), dom_attributes...)

A simple NumberInput, which can be styled via the style::Styles attribute.

Example

App() do
     style = Styles(
         CSS("font-weight" => "500"),
         CSS(":hover", "background-color" => "silver"),
@@ -98,7 +98,7 @@
     end
     return numberinput
 end
-
source
WidgetsBase.TextFieldType
TextField(default_text; style=Styles(), dom_attributes...)

A simple TextField, which can be styled via the style::Styles attribute.

Example

App() do
+
source
WidgetsBase.TextFieldType
TextField(default_text; style=Styles(), dom_attributes...)

A simple TextField, which can be styled via the style::Styles attribute.

Example

App() do
     style = Styles(
         CSS("font-weight" => "500"),
         CSS(":hover", "background-color" => "silver"),
@@ -110,7 +110,7 @@
     end
     return textfield
 end
-
source
Bonito.CardMethod
Card(
+
source
Bonito.CardMethod
Card(
     content;
     style::Styles=Styles(),
     backgroundcolor=RGBA(1, 1, 1, 0.2),
@@ -138,7 +138,7 @@
             )
         )
     end
-
source
Bonito.CenteredMethod
Centered(content; style=Styles(), grid_attributes...)

Creates an element where the content is centered via Grid.

source
Bonito.ColMethod
Col(elems...; grid_attributes...)

Places objects in a column, based on Grid.

source
Bonito.GridMethod
Grid(
+
source
Bonito.CenteredMethod
Centered(content; style=Styles(), grid_attributes...)

Creates an element where the content is centered via Grid.

source
Bonito.ColMethod
Col(elems...; grid_attributes...)

Places objects in a column, based on Grid.

source
Bonito.GridMethod
Grid(
     elems...;
     gap="10px",
     width="100%",
@@ -153,7 +153,7 @@
     align_items="legacy",
     style::Styles=Styles(),
     div_attributes...,
-)

A Grid is a container that lays out its children in a grid, based on the powerful css display: grid property.

source
Bonito.LabeledMethod
Labeled(object, label; label_style=Styles(), attributes...)

A Labeled container with a simople layout to put a label next to an object.

App() do
+)

A Grid is a container that lays out its children in a grid, based on the powerful css display: grid property.

source
Bonito.LabeledMethod
Labeled(object, label; label_style=Styles(), attributes...)

A Labeled container with a simople layout to put a label next to an object.

App() do
     label_style = Styles(
         "color" => "white",
         "padding" => "3px",
@@ -162,11 +162,11 @@
     slider = StylableSlider(1:10)
     Card(Labeled(slider, slider.value; label_style=label_style, width="auto"); backgroundcolor="gray")
 end
-
source
Bonito.PageMethod
Page(;
+
source
Bonito.PageMethod
Page(;
     offline=false, exportable=true,
     connection::Union{Nothing, FrontendConnection}=nothing,
     server_config...
-)

A Page can be used for resetting the Bonito state in a multi page display outputs, like it's the case for Pluto/IJulia/Documenter. For Documenter, the page needs to be set to exportable=true, offline=true, but doesn't need to, since Page defaults to the most common parameters for known Packages. Exportable has the effect of inlining all data & js dependencies, so that everything can be loaded in a single HTML object. offline=true will make the Page not even try to connect to a running Julia process, which makes sense for the kind of static export we do in Documenter. For convenience, one can also pass additional server configurations, which will directly get put into configure_server!(;server_config...). Have a look at the docs for configure_server! to see the parameters.

source
Bonito.RowMethod
Row(elems...; grid_attributes...)

Places objects in a row, based on Grid.

source
Bonito.configure_server!Method
configure_server!(;
+)

A Page can be used for resetting the Bonito state in a multi page display outputs, like it's the case for Pluto/IJulia/Documenter. For Documenter, the page needs to be set to exportable=true, offline=true, but doesn't need to, since Page defaults to the most common parameters for known Packages. Exportable has the effect of inlining all data & js dependencies, so that everything can be loaded in a single HTML object. offline=true will make the Page not even try to connect to a running Julia process, which makes sense for the kind of static export we do in Documenter. For convenience, one can also pass additional server configurations, which will directly get put into configure_server!(;server_config...). Have a look at the docs for configure_server! to see the parameters.

source
Bonito.RowMethod
Row(elems...; grid_attributes...)

Places objects in a row, based on Grid.

source
Bonito.configure_server!Method
configure_server!(;
         listen_url::String=SERVER_CONFIGURATION.listen_url[],
         listen_port::Integer=SERVER_CONFIGURATION.listen_port[],
         forwarded_port::Integer=listen_port,
@@ -192,8 +192,8 @@
     if listen_url is "0.0.0.0", this will default to http://$(Sockets.getipaddr()):forwarded_port
     so that the server is reachable inside the local network.
     If the server should be reachable from some external dns server,
-    this needs to be set here.
source
Bonito.evaljsMethod
evaljs(session::Session, jss::JSCode)

Evaluate a javascript script in session.

source
Bonito.evaljs_valueMethod
evaljs_value(session::Session, js::JSCode)

Evals js code and returns the jsonified value. Blocks until value is returned. May block indefinitely, when called with a session that doesn't have a connection to the browser.

source
Bonito.export_staticMethod
export_static(html_file::Union{IO, String}, app::App)
-export_static(folder::String, routes::Routes)

Exports the app defined by app with all its assets a single HTML file. Or exports all routes defined by routes to folder.

source
Bonito.interactive_serverFunction
interactive_server(f, paths, modules=[]; url="127.0.0.1", port=8081, all=true)

Revise base server that will serve a static side based on Bonito and will update on any code change!

Usage:

using Revise, Website
+    this needs to be set here.
source
Bonito.evaljsMethod
evaljs(session::Session, jss::JSCode)

Evaluate a javascript script in session.

source
Bonito.evaljs_valueMethod
evaljs_value(session::Session, js::JSCode)

Evals js code and returns the jsonified value. Blocks until value is returned. May block indefinitely, when called with a session that doesn't have a connection to the browser.

source
Bonito.export_staticMethod
export_static(html_file::Union{IO, String}, app::App)
+export_static(folder::String, routes::Routes)

Exports the app defined by app with all its assets a single HTML file. Or exports all routes defined by routes to folder.

source
Bonito.interactive_serverFunction
interactive_server(f, paths, modules=[]; url="127.0.0.1", port=8081, all=true)

Revise base server that will serve a static side based on Bonito and will update on any code change!

Usage:

using Revise, Website
 using Website.Bonito
 
 # Start the interactive server and develop your website!
@@ -210,25 +210,25 @@
 dir = joinpath(@__DIR__, "docs")
 # only delete the bonito generated files
 rm(joinpath(dir, "bonito"); recursive=true, force=true)
-Bonito.export_static(dir, routes)

For the complete code, visit the Makie website repository which is using Bonito: MakieOrg/Website

source
Bonito.linkjsMethod
linkjs(session::Session, a::Observable, b::Observable)

for an open session, link a and b on the javascript side. This will also Link the observables in Julia, but only as long as the session is active.

source
Bonito.onjsMethod
onjs(session::Session, obs::Observable, func::JSCode)

Register a javascript function with session, that get's called when obs gets a new value. If the observable gets updated from the JS side, the calling of func will be triggered entirely in javascript, without any communication with the Julia session.

source

Private Functions

Bonito.AbstractWebsocketConnectionType

Websocket based connection type

source
Bonito.CleanupPolicyType
abstract type CleanupPolicy end

You can create a custom cleanup policy by subclassing this type. Implementing the should_cleanup and allow_soft_close methods is required. You can also implement set_cleanup_time!if it makes sense for your policy.

function should_cleanup(policy::MyCleanupPolicy, session::Session)
+Bonito.export_static(dir, routes)

For the complete code, visit the Makie website repository which is using Bonito: MakieOrg/Website

source
Bonito.linkjsMethod
linkjs(session::Session, a::Observable, b::Observable)

for an open session, link a and b on the javascript side. This will also Link the observables in Julia, but only as long as the session is active.

source
Bonito.onjsMethod
onjs(session::Session, obs::Observable, func::JSCode)

Register a javascript function with session, that get's called when obs gets a new value. If the observable gets updated from the JS side, the calling of func will be triggered entirely in javascript, without any communication with the Julia session.

source

Private Functions

Bonito.AbstractWebsocketConnectionType

Websocket based connection type

source
Bonito.CleanupPolicyType
abstract type CleanupPolicy end

You can create a custom cleanup policy by subclassing this type. Implementing the should_cleanup and allow_soft_close methods is required. You can also implement set_cleanup_time!if it makes sense for your policy.

function should_cleanup(policy::MyCleanupPolicy, session::Session)
 
 function allow_soft_close(policy::MyCleanupPolicy)
 
-function set_cleanup_time!(policy::MyCleanupPolicy, time_in_hrs::Real)

This is quite low level, and you implementaiton should probably start by copying DefaultCleanupPolicy.

source
Bonito.DefaultCleanupPolicyType
mutable struct DefaultCleanupPolicy <: CleanupPolicy
+function set_cleanup_time!(policy::MyCleanupPolicy, time_in_hrs::Real)

This is quite low level, and you implementaiton should probably start by copying DefaultCleanupPolicy.

source
Bonito.DefaultCleanupPolicyType
mutable struct DefaultCleanupPolicy <: CleanupPolicy
     session_open_wait_time=30
     cleanup_time=0.0
-end

This is the default cleanup policy. It closes sessions after session_open_wait_time seconds (default 30) if the browser didn't connect back to the displayed session. It also closes sessions after cleanup_time hours (default 0) if the session closes cleanly, indicating that the browser may reconnect if a tab is later restored. It returns true for allowsoftclose(...) when cleanup_time is non-zero.

source
Bonito.DualWebsocketMethod
handles a new websocket connection to a session
source
Bonito.FrontendConnectionType

Inteface for FrontendConnection

struct MyConnection <: FrontendConnection
-end

Needs to have a constructor with 0 arguments:

MyConnection()

Needs to overload Base.write for sending binary data

Base.write(connection::MyConnection, bytes::AbstractVector{UInt8})

Needs to implement isopen to indicate status of connection

Base.isopen(c::MyConnection)

Setup connection will be called before rendering any dom with session. The return value will be inserted into the DOM of the rendered App and can be used to do the JS part of opening the connection.

Bonito.setup_connection(session::Session{IJuliaConnection})::Union{JSCode, Nothing}

One can overload use_parent_session, to turn on rendering dom objects inside sub-sessions while keeping one parent session managing the connection alive. This is handy for IJulia/Pluto, since the parent session just needs to be initialized one time and can stay active and globally store objects used multiple times across doms.

Bonito.use_parent_session(::Session{MyConnection}) = false/false
source
Bonito.JSCodeType

Javascript code that supports interpolation of Julia Objects. Construction of JSCode via string macro:

jsc = js"console.log($(some_julia_variable))"

This will decompose into:

jsc.source == [JSString("console.log("), some_julia_variable, JSString(""")]
source
Bonito.JSExceptionMethod

Creates a Julia exception from data passed to us by the frondend!

source
Bonito.JSStringType

The string part of JSCode.

source
Bonito.JSUpdateObservableType

Functor to update JS part when an observable changes. We make this a Functor, so we can clearly identify it and don't sent any updates, if the JS side requires to update an Observable (so we don't get an endless update cycle)

source
Bonito.TableType

A simple wrapper for types that conform to the Tables.jl Table interface, which gets rendered nicely!

source
Bonito.LabelMethod
Label(value; style=Styles(), attributes...)

A Label is a simple text element, with a bold font and a font size of 1rem.

source
Bonito.add_cached!Method
add_cached!(create_cached_object::Function, session::Session, message_cache::Dict{String, Any}, key::String)

Checks if key is already cached by the session or it's root session (we skip any child session between root -> this session). If not cached already, we call create_cached_object to create a serialized form of the object corresponding to key and cache it. We return nothing if already cached, or the serialized object if not cached. We also handle the part of adding things to the message_cache from the serialization context.

source
Bonito.dependency_pathMethod
dependency_path(paths...)

Path to serve downloaded dependencies

source
Bonito.export_standaloneMethod
export_standaloneexport_standalone(
+end

This is the default cleanup policy. It closes sessions after session_open_wait_time seconds (default 30) if the browser didn't connect back to the displayed session. It also closes sessions after cleanup_time hours (default 0) if the session closes cleanly, indicating that the browser may reconnect if a tab is later restored. It returns true for allowsoftclose(...) when cleanup_time is non-zero.

source
Bonito.DualWebsocketMethod
handles a new websocket connection to a session
source
Bonito.FrontendConnectionType

Inteface for FrontendConnection

struct MyConnection <: FrontendConnection
+end

Needs to have a constructor with 0 arguments:

MyConnection()

Needs to overload Base.write for sending binary data

Base.write(connection::MyConnection, bytes::AbstractVector{UInt8})

Needs to implement isopen to indicate status of connection

Base.isopen(c::MyConnection)

Setup connection will be called before rendering any dom with session. The return value will be inserted into the DOM of the rendered App and can be used to do the JS part of opening the connection.

Bonito.setup_connection(session::Session{IJuliaConnection})::Union{JSCode, Nothing}

One can overload use_parent_session, to turn on rendering dom objects inside sub-sessions while keeping one parent session managing the connection alive. This is handy for IJulia/Pluto, since the parent session just needs to be initialized one time and can stay active and globally store objects used multiple times across doms.

Bonito.use_parent_session(::Session{MyConnection}) = false/false
source
Bonito.JSCodeType

Javascript code that supports interpolation of Julia Objects. Construction of JSCode via string macro:

jsc = js"console.log($(some_julia_variable))"

This will decompose into:

jsc.source == [JSString("console.log("), some_julia_variable, JSString(""")]
source
Bonito.JSExceptionMethod

Creates a Julia exception from data passed to us by the frondend!

source
Bonito.JSStringType

The string part of JSCode.

source
Bonito.JSUpdateObservableType

Functor to update JS part when an observable changes. We make this a Functor, so we can clearly identify it and don't sent any updates, if the JS side requires to update an Observable (so we don't get an endless update cycle)

source
Bonito.TableType

A simple wrapper for types that conform to the Tables.jl Table interface, which gets rendered nicely!

source
Bonito.LabelMethod
Label(value; style=Styles(), attributes...)

A Label is a simple text element, with a bold font and a font size of 1rem.

source
Bonito.add_cached!Method
add_cached!(create_cached_object::Function, session::Session, message_cache::Dict{String, Any}, key::String)

Checks if key is already cached by the session or it's root session (we skip any child session between root -> this session). If not cached already, we call create_cached_object to create a serialized form of the object corresponding to key and cache it. We return nothing if already cached, or the serialized object if not cached. We also handle the part of adding things to the message_cache from the serialization context.

source
Bonito.dependency_pathMethod
dependency_path(paths...)

Path to serve downloaded dependencies

source
Bonito.export_standaloneMethod
export_standaloneexport_standalone(
     app::App, folder::String;
     clear_folder=false, write_index_html=true,
     absolute_urls=false, content_delivery_url="file://" * folder * "/",
-    single_html=false)

Exports the app defined by app::Application with all its assets to folder. Will write the main html out into folder/index.html. Overwrites all existing files! If this gets served behind a proxy, set absolute_urls=true and set content_delivery_url to your proxy url. If clear_folder=true all files in folder will get deleted before exporting again! single_html=true will write out a single html instead of writing out JS depencies as separate files.

source
Bonito.getextensionMethod
getextension(path)

Get the file extension of the path. The extension is defined to be the bit after the last dot, excluding any query string.

Examples

julia> Bonito.getextension("foo.bar.js")
+    single_html=false)

Exports the app defined by app::Application with all its assets to folder. Will write the main html out into folder/index.html. Overwrites all existing files! If this gets served behind a proxy, set absolute_urls=true and set content_delivery_url to your proxy url. If clear_folder=true all files in folder will get deleted before exporting again! single_html=true will write out a single html instead of writing out JS depencies as separate files.

source
Bonito.getextensionMethod
getextension(path)

Get the file extension of the path. The extension is defined to be the bit after the last dot, excluding any query string.

Examples

julia> Bonito.getextension("foo.bar.js")
 "js"
 julia> Bonito.getextension("https://my-cdn.net/foo.bar.css?version=1")
-"css"

Taken from WebIO.jl

source
Bonito.is_onlineMethod
is_online(path)

Determine whether or not the specified path is a local filesystem path (and not a remote resource that is hosted on, for example, a CDN).

source
Bonito.jsrenderMethod
jsrender([::Session], x::Any)

Internal render method to create a valid dom. Registers used observables with a session And makes sure the dom only contains valid elements. Overload jsrender(::YourType) To enable putting YourType into a dom element/div. You can also overload it to take a session as first argument, to register messages with the current web session (e.g. via onjs).

source
Bonito.on_document_loadMethod
on_document_load(session::Session, js::JSCode)

executes javascript after document is loaded

source
Bonito.onloadMethod
onload(session::Session, node::Node, func::JSCode)

calls javascript func with node, once node has been displayed.

source
Bonito.page_htmlMethod
page_html(session::Session, html_body)

Embeds the html_body in a standalone html document!

source
Bonito.process_messageMethod
process_message(session::Session, bytes::AbstractVector{UInt8})

Handles the incoming websocket messages from the frontend. Messages are expected to be gzip compressed and packed via MsgPack.

source
Bonito.record_statesMethod
record_states(session::Session, dom::Hyperscript.Node)

Records the states of all widgets in the dom. Any widget that implements the following interface will be found in the DOM and can be recorded:

# Implementing interface for Bonito.Slider!
+"css"

Taken from WebIO.jl

source
Bonito.is_onlineMethod
is_online(path)

Determine whether or not the specified path is a local filesystem path (and not a remote resource that is hosted on, for example, a CDN).

source
Bonito.jsrenderMethod
jsrender([::Session], x::Any)

Internal render method to create a valid dom. Registers used observables with a session And makes sure the dom only contains valid elements. Overload jsrender(::YourType) To enable putting YourType into a dom element/div. You can also overload it to take a session as first argument, to register messages with the current web session (e.g. via onjs).

source
Bonito.on_document_loadMethod
on_document_load(session::Session, js::JSCode)

executes javascript after document is loaded

source
Bonito.onloadMethod
onload(session::Session, node::Node, func::JSCode)

calls javascript func with node, once node has been displayed.

source
Bonito.page_htmlMethod
page_html(session::Session, html_body)

Embeds the html_body in a standalone html document!

source
Bonito.process_messageMethod
process_message(session::Session, bytes::AbstractVector{UInt8})

Handles the incoming websocket messages from the frontend. Messages are expected to be gzip compressed and packed via MsgPack.

source
Bonito.record_statesMethod
record_states(session::Session, dom::Hyperscript.Node)

Records the states of all widgets in the dom. Any widget that implements the following interface will be found in the DOM and can be recorded:

# Implementing interface for Bonito.Slider!
 is_widget(::Slider) = true
 value_range(slider::Slider) = 1:length(slider.values[])
-to_watch(slider::Slider) = slider.index # the observable that will trigger JS state change
Warn

This is experimental and might change in the future! It can also create really large HTML files, since it needs to record all combinations of widget states. It's also not well optimized yet and may create a lot of duplicated messages.

source
Bonito.register_asset_server!Method
register_asset_server!(condition::Function, ::Type{<: AbstractAssetServer})

Registers a new asset server type. condition is a function that should return nothing, if the asset server type shouldn't be used, and an initialized asset server object, if the conditions are right. E.g. The Bonito.NoServer be used inside an IJulia notebook so it's registered like this:

register_asset_server!(NoServer) do
+to_watch(slider::Slider) = slider.index # the observable that will trigger JS state change
Warn

This is experimental and might change in the future! It can also create really large HTML files, since it needs to record all combinations of widget states. It's also not well optimized yet and may create a lot of duplicated messages.

source
Bonito.register_asset_server!Method
register_asset_server!(condition::Function, ::Type{<: AbstractAssetServer})

Registers a new asset server type. condition is a function that should return nothing, if the asset server type shouldn't be used, and an initialized asset server object, if the conditions are right. E.g. The Bonito.NoServer be used inside an IJulia notebook so it's registered like this:

register_asset_server!(NoServer) do
     if isdefined(Main, :IJulia)
         return NoServer()
     end
@@ -239,7 +239,7 @@
 # which is the same as:
 force_asset_server!(YourAssetServer)
 ...
-force_asset_server!()
source
Bonito.register_connection!Method
register_connection!(condition::Function, ::Type{<: FrontendConnection})

Registers a new Connection type.

condition is a function that should return nothing, if the connection type shouldn't be used, and an initialized Connection, if the conditions are right. E.g. The IJulia connection should only be used inside an IJulia notebook so it's registered like this:

register_connection!(IJuliaConnection) do
+force_asset_server!()
source
Bonito.register_connection!Method
register_connection!(condition::Function, ::Type{<: FrontendConnection})

Registers a new Connection type.

condition is a function that should return nothing, if the connection type shouldn't be used, and an initialized Connection, if the conditions are right. E.g. The IJulia connection should only be used inside an IJulia notebook so it's registered like this:

register_connection!(IJuliaConnection) do
     if isdefined(Main, :IJulia)
         return IJuliaConnection()
     end
@@ -250,4 +250,4 @@
 # which is the same as:
 force_connection!(YourConnectionType)
 ...
-force_connection!()
source
Bonito.replace_expressionsMethod
replace_expressions(markdown, context)

Replaces all expressions inside markdown savely, by only supporting getindex/getfield expression that will index into context

source
Bonito.run_connection_loopMethod
runs the main connection loop for the websocket
source
Bonito.set_cleanup_policy!Method
set_cleanup_policy!(policy::CleanupPolicy)

You can set a custom cleanup policy by calling this function.

source
Bonito.set_cleanup_time!Method
set_cleanup_time!(time_in_hrs::Real)

Sets the time that sessions remain open after the browser tab is closed. This allows reconnecting to the same session. Only works for Websocket connection inside VSCode right now, and will display the same App again from first display. State that isn't stored in Observables inside that app is lost.

source
Bonito.setup_websocket_connection_jsMethod
returns the javascript snippet to setup the connection
source
Bonito.string_to_markdownFunction
string_to_markdown(session::Session, source::String; eval_julia_code=false)

Replaces all interpolation expressions inside markdown savely, by only supporting getindex/getfield expression that will index into context. You can eval Julia code blocks by setting eval_julia_code to a Module, into which the code gets evaluated!

source
Bonito.update_nocycle!Method

Update the value of an observable, without sending changes to the JS frontend. This will be used to update updates from the forntend.

source
Sockets.sendMethod
send(session::Session; attributes...)

Send values to the frontend via MsgPack for now

source
Bonito.HTTPServer.ServerType

HTTP server with websocket & http routes

source
Bonito.HTTPServer.ServerMethod

Server( dom, url::String, port::Int; verbose = -1 )

Creates an application that manages the global server state!

source
Base.waitMethod
wait(server::Server)

Wait on the server task, i.e. block execution by bringing the server event loop to the foreground.

source
Bonito.HTTPServer.browser_displayMethod
browser_display()

Forces Bonito.App to be displayed in a browser window that gets opened.

source
Bonito.HTTPServer.local_urlMethod
local_url(server::Server, url)

The local url to reach the server, on the server

source
Bonito.HTTPServer.online_urlMethod
online_url(server::Server, url)

The url to connect to the server from the internet. Needs to have server.proxy_url set to the IP or dns route of the server

source
Bonito.HTTPServer.tryrunMethod
tryrun(cmd::Cmd)

Try to run a command. Return true if cmd runs and is successful (exits with a code of 0). Return false otherwise.

source
+force_connection!()source
Bonito.replace_expressionsMethod
replace_expressions(markdown, context)

Replaces all expressions inside markdown savely, by only supporting getindex/getfield expression that will index into context

source
Bonito.run_connection_loopMethod
runs the main connection loop for the websocket
source
Bonito.set_cleanup_policy!Method
set_cleanup_policy!(policy::CleanupPolicy)

You can set a custom cleanup policy by calling this function.

source
Bonito.set_cleanup_time!Method
set_cleanup_time!(time_in_hrs::Real)

Sets the time that sessions remain open after the browser tab is closed. This allows reconnecting to the same session. Only works for Websocket connection inside VSCode right now, and will display the same App again from first display. State that isn't stored in Observables inside that app is lost.

source
Bonito.setup_websocket_connection_jsMethod
returns the javascript snippet to setup the connection
source
Bonito.string_to_markdownFunction
string_to_markdown(session::Session, source::String; eval_julia_code=false)

Replaces all interpolation expressions inside markdown savely, by only supporting getindex/getfield expression that will index into context. You can eval Julia code blocks by setting eval_julia_code to a Module, into which the code gets evaluated!

source
Bonito.update_nocycle!Method

Update the value of an observable, without sending changes to the JS frontend. This will be used to update updates from the forntend.

source
Sockets.sendMethod
send(session::Session; attributes...)

Send values to the frontend via MsgPack for now

source
Bonito.HTTPServer.ServerType

HTTP server with websocket & http routes

source
Bonito.HTTPServer.ServerMethod

Server( dom, url::String, port::Int; verbose = -1 )

Creates an application that manages the global server state!

source
Base.waitMethod
wait(server::Server)

Wait on the server task, i.e. block execution by bringing the server event loop to the foreground.

source
Bonito.HTTPServer.browser_displayMethod
browser_display()

Forces Bonito.App to be displayed in a browser window that gets opened.

source
Bonito.HTTPServer.local_urlMethod
local_url(server::Server, url)

The local url to reach the server, on the server

source
Bonito.HTTPServer.online_urlMethod
online_url(server::Server, url)

The url to connect to the server from the internet. Needs to have server.proxy_url set to the IP or dns route of the server

source
Bonito.HTTPServer.tryrunMethod
tryrun(cmd::Cmd)

Try to run a command. Return true if cmd runs and is successful (exits with a code of 0). Return false otherwise.

source
diff --git a/previews/PR284/assets.html b/previews/PR284/assets.html index 2d09fc88..c9c224e0 100644 --- a/previews/PR284/assets.html +++ b/previews/PR284/assets.html @@ -60,28 +60,28 @@ """) return dom end
-
+
- +
-
+
-
+ diff --git a/previews/PR284/bonito/bin/04aa8ccbebf6b36857f1207d241c5934257e30d0-7532967597200963595.bin b/previews/PR284/bonito/bin/04aa8ccbebf6b36857f1207d241c5934257e30d0-7532967597200963595.bin new file mode 100644 index 00000000..82736a8a --- /dev/null +++ b/previews/PR284/bonito/bin/04aa8ccbebf6b36857f1207d241c5934257e30d0-7532967597200963595.bin @@ -0,0 +1,3 @@ +,j$388f9ffc-a0de-4e57-adce-bc39cde999a8subpayload3kJj$388f9ffc-a0de-4e57-adce-bc39cde999a81512e1512write somethingsubobsh1512payloadfkreturn value=> Bonito.update_node_attribute(document.querySelector('[data-jscall-id="2"]'), 'value', value)Q/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/hyperscript_integration.jl:92msg_type1mkJj$388f9ffc-a0de-4e57-adce-bc39cde999a81511e1511write somethingsubpayloadf3280306308982305031h1511٭((node) => { + node['onchange'] = event => __lookup_interpolated('3280306308982305031').notify(event.srcElement.value); +})(document.querySelector('[data-jscall-id="2"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:109msg_type2msg_type9 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/06b4a74ef7f6d8a7ecc35c4b9542c87eab54c6d5-11095551538686531324.bin b/previews/PR284/bonito/bin/06b4a74ef7f6d8a7ecc35c4b9542c87eab54c6d5-11095551538686531324.bin new file mode 100644 index 00000000..4949b67b --- /dev/null +++ b/previews/PR284/bonito/bin/06b4a74ef7f6d8a7ecc35c4b9542c87eab54c6d5-11095551538686531324.bin @@ -0,0 +1 @@ +,j$e3cc266c-0b02-4fa2-9cf4-4c8e088eff50subh34 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/0dae168d15548b83a447291c64d42517073bfe4e-17704011269016399161.bin b/previews/PR284/bonito/bin/0dae168d15548b83a447291c64d42517073bfe4e-17704011269016399161.bin new file mode 100644 index 00000000..83fd84f9 --- /dev/null +++ b/previews/PR284/bonito/bin/0dae168d15548b83a447291c64d42517073bfe4e-17704011269016399161.bin @@ -0,0 +1,3 @@ +,j$fba886d5-2631-45a9-8c90-f831007c7dd7subpayloadkCj$fba886d5-2631-45a9-8c90-f831007c7dd71499e1499Click mesubobsh1499payloadDŽfGreturn x=> document.querySelector('[data-jscall-id="3"]').innerText = x7/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:69msg_type1Jk;j$fba886d5-2631-45a9-8c90-f831007c7dd71500e1500£subpayloadf12298256300585285316h1500ٚ((node) => { + node['onclick'] = event=> __lookup_interpolated('12298256300585285316').notify(true); +})(document.querySelector('[data-jscall-id="3"]'));7/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:65msg_type2msg_type9 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/0e63c25683fe0a5424ae9848fd0391d462e998a2-10566414904420344058.bin b/previews/PR284/bonito/bin/0e63c25683fe0a5424ae9848fd0391d462e998a2-10566414904420344058.bin new file mode 100644 index 00000000..bfe43ff9 --- /dev/null +++ b/previews/PR284/bonito/bin/0e63c25683fe0a5424ae9848fd0391d462e998a2-10566414904420344058.bin @@ -0,0 +1,29 @@ +,j$18dccda0-805f-4aeb-b705-c85d55f24d2csubpayloadk,j$18dccda0-805f-4aeb-b705-c85d55f24d2csubpayloadkOj$18dccda0-805f-4aeb-b705-c85d55f24d2c24e2425e2523e23subobsh24payloadf4627338960045866262h2311909536549746738174h25٨return (index) => { + const values = __lookup_interpolated('4627338960045866262').value + __lookup_interpolated('11909536549746738174').notify(values[index - 1]) +} +8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:272msg_type1k8j$18dccda0-805f-4aeb-b705-c85d55f24d2c28e283subobsh28payloadfireturn value=> Bonito.update_node_attribute(document.querySelector('[data-jscall-id="2"]'), 'max', value)Q/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/hyperscript_integration.jl:92msg_type1k8j$18dccda0-805f-4aeb-b705-c85d55f24d2c29e291subobsh29payloadfkreturn value=> Bonito.update_node_attribute(document.querySelector('[data-jscall-id="2"]'), 'value', value)Q/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/hyperscript_integration.jl:92msg_type1k8j$18dccda0-805f-4aeb-b705-c85d55f24d2c30e301subobsh30payloadǠfUreturn (val)=> { + document.querySelector('[data-jscall-id="3"]').innerText = val +}E/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/observables.jl:98msg_type1k,j$18dccda0-805f-4aeb-b705-c85d55f24d2csubpayloadzf5722650889843324777h24!((node) => { + node['oninput'] = (event)=> { + const idx = event.srcElement.valueAsNumber; + if (idx !== __lookup_interpolated('5722650889843324777').value) { + __lookup_interpolated('5722650889843324777').notify(idx) + } +} +})(document.querySelector('[data-jscall-id="2"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:287msg_type2msg_type9k,j$18dccda0-805f-4aeb-b705-c85d55f24d2csubpayloadf25877497931528744791Mk-j$6fa8ea08-7a37-4417-b1e5-88709aa30415rootpayload1id29msg_type02Mk-j$6fa8ea08-7a37-4417-b1e5-88709aa30415rootpayload2id29msg_type03Mk-j$6fa8ea08-7a37-4417-b1e5-88709aa30415rootpayload3id29msg_type0Bonito.fetch_binary('bonito/bin/7f8b62a069a7183b89ea24f03461a946e39d0c86-17716393200097520481.bin').then(binary => { + const statemap = __lookup_interpolated('2587749793152874479') + console.log(statemap) + const observables = Bonito.decode_binary(binary, false); + Bonito.onany(observables, (states) => { + console.log(states) + // messages to send for this state of that observable + const messages = statemap[states] + // not all states trigger events + // so some states won't have any messages recorded + if (messages){ + messages.forEach(Bonito.process_message) + } + }) +}) +7/home/runner/work/Bonito.jl/Bonito.jl/src/export.jl:144msg_type2Fk-j$6fa8ea08-7a37-4417-b1e5-88709aa30415rootpayloadmsg_type9msg_type9 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/152c3458da1252396810dac4ecdcae14cd590825-7174321744983736303.bin b/previews/PR284/bonito/bin/152c3458da1252396810dac4ecdcae14cd590825-7174321744983736303.bin new file mode 100644 index 00000000..54df3fa7 --- /dev/null +++ b/previews/PR284/bonito/bin/152c3458da1252396810dac4ecdcae14cd590825-7174321744983736303.bin @@ -0,0 +1 @@ +,j$9e855e5a-2793-4c56-9420-f6127d3b836bsubh47h45h48 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/98c39542ae6d00c5e5a0fef55c8e4c220ecc5c4d-11825984104904150059.bin b/previews/PR284/bonito/bin/1aa9230cf16488786d836104fcb03f350963bad6-13254656099906997411.bin similarity index 64% rename from previews/PR284/bonito/bin/98c39542ae6d00c5e5a0fef55c8e4c220ecc5c4d-11825984104904150059.bin rename to previews/PR284/bonito/bin/1aa9230cf16488786d836104fcb03f350963bad6-13254656099906997411.bin index a91dee67..e4552eea 100644 --- a/previews/PR284/bonito/bin/98c39542ae6d00c5e5a0fef55c8e4c220ecc5c4d-11825984104904150059.bin +++ b/previews/PR284/bonito/bin/1aa9230cf16488786d836104fcb03f350963bad6-13254656099906997411.bin @@ -1,10 +1,10 @@ -,j$a20ca784-f014-4d31-a8bb-0c4b87526998subpayloadsk9j$a20ca784-f014-4d31-a8bb-0c4b87526998322e322subobsh322payloadf10865314609589633331space-evenlycenterendspace-betweenspace-aroundspace-evenly٩return (idx) => { +,j$89a8d873-cd10-4d02-ba1f-c1127452fc1fsubpayloadsk9j$89a8d873-cd10-4d02-ba1f-c1127452fc1f322e322subobsh322payloadf10865314609589633331space-evenlycenterendspace-betweenspace-aroundspace-evenly٩return (idx) => { grid = document.querySelector('[data-jscall-id="240"]') grid.style["justify-content"] = __lookup_interpolated('10865314609589633331')[idx-1] -}layouting.md:393msg_type1kyj$a20ca784-f014-4d31-a8bb-0c4b87526998325Fe325space-evenlycenterendspace-betweenspace-aroundspace-evenlysubpayloadf12131588929529448244h3259001033630623335415h322(function onload(element) { +}layouting.md:393msg_type1kyj$89a8d873-cd10-4d02-ba1f-c1127452fc1f325Fe325space-evenlycenterendspace-betweenspace-aroundspace-evenlysubpayloadf2450589261083907944h3257127979156332508505h322(function onload(element) { function onchange(e) { if (element === e.srcElement) { - (__lookup_interpolated('9001033630623335415')).notify(element.selectedIndex + 1); + (__lookup_interpolated('7127979156332508505')).notify(element.selectedIndex + 1); } } element.addEventListener("change", onchange); @@ -15,13 +15,13 @@ } element.selectedIndex = index - 1; } - __lookup_interpolated('9001033630623335415').on(set_option_index); + __lookup_interpolated('7127979156332508505').on(set_option_index); function set_options(opts) { element.selectedIndex = 0; // https://stackoverflow.com/questions/3364493/how-do-i-clear-all-options-in-a-dropdown-box element.options.length = 0; opts.forEach((opt, i) => element.options.add(new Option(opts[i], i))); } - __lookup_interpolated('12131588929529448244').on(set_options); + __lookup_interpolated('2450589261083907944').on(set_options); } )(document.querySelector('[data-jscall-id="242"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:214msg_type2msg_type9 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/2895a243e49837032cf17e7d37c3bdab5f84f3b1-14475580806904402270.bin b/previews/PR284/bonito/bin/2895a243e49837032cf17e7d37c3bdab5f84f3b1-14475580806904402270.bin deleted file mode 100644 index b071da9c..00000000 --- a/previews/PR284/bonito/bin/2895a243e49837032cf17e7d37c3bdab5f84f3b1-14475580806904402270.bin +++ /dev/null @@ -1,3 +0,0 @@ -,j$85cfc5d3-9e6f-4509-9fae-cd5d1241a23fsubpayloadkCj$85cfc5d3-9e6f-4509-9fae-cd5d1241a23f1507e1507Click mesubobsh1507payloadDŽfGreturn x=> document.querySelector('[data-jscall-id="1"]').innerText = x7/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:69msg_type1Jk;j$85cfc5d3-9e6f-4509-9fae-cd5d1241a23f1508e1508£subpayloadf14502401091304425411h1508ٚ((node) => { - node['onclick'] = event=> __lookup_interpolated('14502401091304425411').notify(true); -})(document.querySelector('[data-jscall-id="1"]'));7/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:65msg_type2msg_type9 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/c260e3a9ee385a4e5cb7855e46ad54b09220247e-13716467743093393527.bin b/previews/PR284/bonito/bin/2c622ced46f50fcaaf72374c9de9abd3c4c278f0-12961723885558059217.bin similarity index 70% rename from previews/PR284/bonito/bin/c260e3a9ee385a4e5cb7855e46ad54b09220247e-13716467743093393527.bin rename to previews/PR284/bonito/bin/2c622ced46f50fcaaf72374c9de9abd3c4c278f0-12961723885558059217.bin index 6a170c0d..e270b524 100644 Binary files a/previews/PR284/bonito/bin/c260e3a9ee385a4e5cb7855e46ad54b09220247e-13716467743093393527.bin and b/previews/PR284/bonito/bin/2c622ced46f50fcaaf72374c9de9abd3c4c278f0-12961723885558059217.bin differ diff --git a/previews/PR284/bonito/bin/32324f0aa3d30735eac0e6389fb0f2c3b642370d-9427313120187818584.bin b/previews/PR284/bonito/bin/32324f0aa3d30735eac0e6389fb0f2c3b642370d-9427313120187818584.bin deleted file mode 100644 index 9490bb06..00000000 --- a/previews/PR284/bonito/bin/32324f0aa3d30735eac0e6389fb0f2c3b642370d-9427313120187818584.bin +++ /dev/null @@ -1,3 +0,0 @@ -,j$197e5762-94db-40b0-8467-9158d0f6d5fesub1931559942742559920@I -=q˿ -=p diff --git a/previews/PR284/bonito/bin/e092674369552c5d0761919d9f3ca1de745e22a3-8843210695536988368.bin b/previews/PR284/bonito/bin/3bf25b11be196efb8e1daf833ccc22d179dee1f5-13974676435453375636.bin similarity index 71% rename from previews/PR284/bonito/bin/e092674369552c5d0761919d9f3ca1de745e22a3-8843210695536988368.bin rename to previews/PR284/bonito/bin/3bf25b11be196efb8e1daf833ccc22d179dee1f5-13974676435453375636.bin index 64985327..de7ba26f 100644 Binary files a/previews/PR284/bonito/bin/e092674369552c5d0761919d9f3ca1de745e22a3-8843210695536988368.bin and b/previews/PR284/bonito/bin/3bf25b11be196efb8e1daf833ccc22d179dee1f5-13974676435453375636.bin differ diff --git a/previews/PR284/bonito/bin/4730c1261101cd2494bb09450a91d363757f1835-3525157811451700469.bin b/previews/PR284/bonito/bin/4730c1261101cd2494bb09450a91d363757f1835-3525157811451700469.bin new file mode 100644 index 00000000..0f0647af --- /dev/null +++ b/previews/PR284/bonito/bin/4730c1261101cd2494bb09450a91d363757f1835-3525157811451700469.bin @@ -0,0 +1 @@ +,j$07848651-1e53-4715-96c0-7e928304f04fsubh277 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/493890f464d2e424f0b138d87007e0e2edce9931-16464083807394136222.bin b/previews/PR284/bonito/bin/493890f464d2e424f0b138d87007e0e2edce9931-16464083807394136222.bin new file mode 100644 index 00000000..997fd437 Binary files /dev/null and b/previews/PR284/bonito/bin/493890f464d2e424f0b138d87007e0e2edce9931-16464083807394136222.bin differ diff --git a/previews/PR284/bonito/bin/51be05dfae8fc5bc41973e7e39a924de3ffd4f3c-6895819006059976344.bin b/previews/PR284/bonito/bin/51be05dfae8fc5bc41973e7e39a924de3ffd4f3c-6895819006059976344.bin new file mode 100644 index 00000000..12593f79 --- /dev/null +++ b/previews/PR284/bonito/bin/51be05dfae8fc5bc41973e7e39a924de3ffd4f3c-6895819006059976344.bin @@ -0,0 +1,27 @@ +,j$07848651-1e53-4715-96c0-7e928304f04fsubpayloadk,j$07848651-1e53-4715-96c0-7e928304f04fsubpayloadkXj$07848651-1e53-4715-96c0-7e928304f04f278e278277e277276 e276subobsh277payloadf5429679659115795232h2768931733985301966180h278٧return (index) => { + const values = __lookup_interpolated('5429679659115795232').value + __lookup_interpolated('8931733985301966180').notify(values[index - 1]) +} +8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:272msg_type1k:j$07848651-1e53-4715-96c0-7e928304f04f281e2815subobsh281payloadfireturn value=> Bonito.update_node_attribute(document.querySelector('[data-jscall-id="2"]'), 'max', value)Q/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/hyperscript_integration.jl:92msg_type1!k:j$07848651-1e53-4715-96c0-7e928304f04f282e2821subobsh282payloadfkreturn value=> Bonito.update_node_attribute(document.querySelector('[data-jscall-id="2"]'), 'value', value)Q/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/hyperscript_integration.jl:92msg_type1k,j$07848651-1e53-4715-96c0-7e928304f04fsubpayloadzf8984507126173667072h277!((node) => { + node['oninput'] = (event)=> { + const idx = event.srcElement.valueAsNumber; + if (idx !== __lookup_interpolated('8984507126173667072').value) { + __lookup_interpolated('8984507126173667072').notify(idx) + } +} +})(document.querySelector('[data-jscall-id="2"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:287msg_type2msg_type9k,j$07848651-1e53-4715-96c0-7e928304f04fsubpayloadxf91698121045136852854Nk-j$014e8f65-fc84-4c19-9231-03f1307e0792rootpayload4id282msg_type01Nk-j$014e8f65-fc84-4c19-9231-03f1307e0792rootpayload1id282msg_type05Nk-j$014e8f65-fc84-4c19-9231-03f1307e0792rootpayload5id282msg_type02Nk-j$014e8f65-fc84-4c19-9231-03f1307e0792rootpayload2id282msg_type03Nk-j$014e8f65-fc84-4c19-9231-03f1307e0792rootpayload3id282msg_type0Bonito.fetch_binary('bonito/bin/4730c1261101cd2494bb09450a91d363757f1835-3525157811451700469.bin').then(binary => { + const statemap = __lookup_interpolated('9169812104513685285') + console.log(statemap) + const observables = Bonito.decode_binary(binary, false); + Bonito.onany(observables, (states) => { + console.log(states) + // messages to send for this state of that observable + const messages = statemap[states] + // not all states trigger events + // so some states won't have any messages recorded + if (messages){ + messages.forEach(Bonito.process_message) + } + }) +}) +7/home/runner/work/Bonito.jl/Bonito.jl/src/export.jl:144msg_type2Fk-j$014e8f65-fc84-4c19-9231-03f1307e0792rootpayloadmsg_type9msg_type9 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/5418c7879e7e8a4520a109f7616bc430d5c4ad22-12574744411705770182.bin b/previews/PR284/bonito/bin/5418c7879e7e8a4520a109f7616bc430d5c4ad22-12574744411705770182.bin deleted file mode 100644 index ea64f7e7..00000000 --- a/previews/PR284/bonito/bin/5418c7879e7e8a4520a109f7616bc430d5c4ad22-12574744411705770182.bin +++ /dev/null @@ -1 +0,0 @@ -,j$594520d4-15e0-46d6-b243-26776cffb7e9subh288 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/5dda4666796525922fd0d6a3108544b2cd3cb4fb-3433951955464970335.bin b/previews/PR284/bonito/bin/5dda4666796525922fd0d6a3108544b2cd3cb4fb-3433951955464970335.bin deleted file mode 100644 index 2d15a930..00000000 --- a/previews/PR284/bonito/bin/5dda4666796525922fd0d6a3108544b2cd3cb4fb-3433951955464970335.bin +++ /dev/null @@ -1 +0,0 @@ -,j$72fd5ab5-ef45-4b45-bf61-299dfa2b71fasubh24 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/643599dbba543cdd207bfe5695d5ba1532fe1f14-6650144536987148262.bin b/previews/PR284/bonito/bin/643599dbba543cdd207bfe5695d5ba1532fe1f14-6650144536987148262.bin deleted file mode 100644 index 14e800a1..00000000 --- a/previews/PR284/bonito/bin/643599dbba543cdd207bfe5695d5ba1532fe1f14-6650144536987148262.bin +++ /dev/null @@ -1,30 +0,0 @@ -,j$72fd5ab5-ef45-4b45-bf61-299dfa2b71fasubpayload3k,j$72fd5ab5-ef45-4b45-bf61-299dfa2b71fasubpayloadkOj$72fd5ab5-ef45-4b45-bf61-299dfa2b71fa24e2425e2523e23subobsh24payloadf5199236325227492831h231862988738627526234h25٧return (index) => { - const values = __lookup_interpolated('5199236325227492831').value - __lookup_interpolated('1862988738627526234').notify(values[index - 1]) -} -8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:272msg_type1k8j$72fd5ab5-ef45-4b45-bf61-299dfa2b71fa28e283subobsh28payloadfireturn value=> Bonito.update_node_attribute(document.querySelector('[data-jscall-id="2"]'), 'max', value)Q/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/hyperscript_integration.jl:92msg_type1k8j$72fd5ab5-ef45-4b45-bf61-299dfa2b71fa29e291subobsh29payloadfkreturn value=> Bonito.update_node_attribute(document.querySelector('[data-jscall-id="2"]'), 'value', value)Q/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/hyperscript_integration.jl:92msg_type1k8j$72fd5ab5-ef45-4b45-bf61-299dfa2b71fa30e301subobsh30payloadǠfUreturn (val)=> { - document.querySelector('[data-jscall-id="3"]').innerText = val -}E/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/observables.jl:98msg_type1k,j$72fd5ab5-ef45-4b45-bf61-299dfa2b71fasubpayloadf13638180424695705133h24r((node) => { - node['oninput'] = (event)=> { - const idx = event.srcElement.valueAsNumber; - console.log(idx, " ", __lookup_interpolated('13638180424695705133').value) - if (idx !== __lookup_interpolated('13638180424695705133').value) { - __lookup_interpolated('13638180424695705133').notify(idx) - } -} -})(document.querySelector('[data-jscall-id="2"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:287msg_type2msg_type9k,j$72fd5ab5-ef45-4b45-bf61-299dfa2b71fasubpayloadf151702144243165796641Mk-j$3149b941-6a43-4445-bd83-76f40d897a28rootpayload1id29msg_type02Mk-j$3149b941-6a43-4445-bd83-76f40d897a28rootpayload2id29msg_type03Mk-j$3149b941-6a43-4445-bd83-76f40d897a28rootpayload3id29msg_type0Bonito.fetch_binary('bonito/bin/5dda4666796525922fd0d6a3108544b2cd3cb4fb-3433951955464970335.bin').then(binary => { - const statemap = __lookup_interpolated('15170214424316579664') - console.log(statemap) - const observables = Bonito.decode_binary(binary, false); - Bonito.onany(observables, (states) => { - console.log(states) - // messages to send for this state of that observable - const messages = statemap[states] - // not all states trigger events - // so some states won't have any messages recorded - if (messages){ - messages.forEach(Bonito.process_message) - } - }) -}) -7/home/runner/work/Bonito.jl/Bonito.jl/src/export.jl:144msg_type2Fk-j$3149b941-6a43-4445-bd83-76f40d897a28rootpayloadmsg_type9msg_type9 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/68cdebf09a2d53fabe5dec3a2b263f09841f9bd0-13035008568958644772.bin b/previews/PR284/bonito/bin/68cdebf09a2d53fabe5dec3a2b263f09841f9bd0-13035008568958644772.bin deleted file mode 100644 index 2a15dbe1..00000000 --- a/previews/PR284/bonito/bin/68cdebf09a2d53fabe5dec3a2b263f09841f9bd0-13035008568958644772.bin +++ /dev/null @@ -1 +0,0 @@ -,j$b1f44f79-b346-45ae-9c76-a9cc50a32a94subh47h45h48 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/429db09b9f83db687077f8e28149ced8af77bf41-6733457465772335058.bin b/previews/PR284/bonito/bin/6a58a6c42397bbc51944fc1ed5a44cd1eba85e02-13416964006524403361.bin similarity index 66% rename from previews/PR284/bonito/bin/429db09b9f83db687077f8e28149ced8af77bf41-6733457465772335058.bin rename to previews/PR284/bonito/bin/6a58a6c42397bbc51944fc1ed5a44cd1eba85e02-13416964006524403361.bin index b2bca944..e303253f 100644 Binary files a/previews/PR284/bonito/bin/429db09b9f83db687077f8e28149ced8af77bf41-6733457465772335058.bin and b/previews/PR284/bonito/bin/6a58a6c42397bbc51944fc1ed5a44cd1eba85e02-13416964006524403361.bin differ diff --git a/previews/PR284/bonito/bin/725d5a9e94a13139f6792bcc6b5da235397522ec-1549086771247878839.bin b/previews/PR284/bonito/bin/725d5a9e94a13139f6792bcc6b5da235397522ec-1549086771247878839.bin new file mode 100644 index 00000000..9aec94ec --- /dev/null +++ b/previews/PR284/bonito/bin/725d5a9e94a13139f6792bcc6b5da235397522ec-1549086771247878839.bin @@ -0,0 +1,27 @@ +,j$e3cc266c-0b02-4fa2-9cf4-4c8e088eff50subpayloadk,j$e3cc266c-0b02-4fa2-9cf4-4c8e088eff50subpayloadkOj$e3cc266c-0b02-4fa2-9cf4-4c8e088eff5034e3433e3335e35subobsh34payloadf17797165885585079815h351584731251402993461h33٨return (index) => { + const values = __lookup_interpolated('1584731251402993461').value + __lookup_interpolated('17797165885585079815').notify(values[index - 1]) +} +8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:272msg_type1k8j$e3cc266c-0b02-4fa2-9cf4-4c8e088eff5038e383subobsh38payloadfireturn value=> Bonito.update_node_attribute(document.querySelector('[data-jscall-id="5"]'), 'max', value)Q/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/hyperscript_integration.jl:92msg_type1k8j$e3cc266c-0b02-4fa2-9cf4-4c8e088eff5039e391subobsh39payloadfkreturn value=> Bonito.update_node_attribute(document.querySelector('[data-jscall-id="5"]'), 'value', value)Q/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/hyperscript_integration.jl:92msg_type1k,j$e3cc266c-0b02-4fa2-9cf4-4c8e088eff50subpayload}f13756173027838112473h34#((node) => { + node['oninput'] = (event)=> { + const idx = event.srcElement.valueAsNumber; + if (idx !== __lookup_interpolated('13756173027838112473').value) { + __lookup_interpolated('13756173027838112473').notify(idx) + } +} +})(document.querySelector('[data-jscall-id="5"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:287msg_type2msg_type9k,j$e3cc266c-0b02-4fa2-9cf4-4c8e088eff50subpayloadf138113747177017326971Mk-j$6fa8ea08-7a37-4417-b1e5-88709aa30415rootpayload1id39msg_type02Mk-j$6fa8ea08-7a37-4417-b1e5-88709aa30415rootpayload2id39msg_type03Mk-j$6fa8ea08-7a37-4417-b1e5-88709aa30415rootpayload3id39msg_type0Bonito.fetch_binary('bonito/bin/06b4a74ef7f6d8a7ecc35c4b9542c87eab54c6d5-11095551538686531324.bin').then(binary => { + const statemap = __lookup_interpolated('13811374717701732697') + console.log(statemap) + const observables = Bonito.decode_binary(binary, false); + Bonito.onany(observables, (states) => { + console.log(states) + // messages to send for this state of that observable + const messages = statemap[states] + // not all states trigger events + // so some states won't have any messages recorded + if (messages){ + messages.forEach(Bonito.process_message) + } + }) +}) +7/home/runner/work/Bonito.jl/Bonito.jl/src/export.jl:144msg_type2Fk-j$6fa8ea08-7a37-4417-b1e5-88709aa30415rootpayloadmsg_type9msg_type9 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/7ae7424ee579b02e3602e79872079524608c2f28-1261390824142156375.bin b/previews/PR284/bonito/bin/7ae7424ee579b02e3602e79872079524608c2f28-1261390824142156375.bin deleted file mode 100644 index 424db4a1..00000000 Binary files a/previews/PR284/bonito/bin/7ae7424ee579b02e3602e79872079524608c2f28-1261390824142156375.bin and /dev/null differ diff --git a/previews/PR284/bonito/bin/7f7285351a3045058e64d46a7f3e7680cab98b61-58815392241644019.bin b/previews/PR284/bonito/bin/7f7285351a3045058e64d46a7f3e7680cab98b61-58815392241644019.bin new file mode 100644 index 00000000..a55a60b2 --- /dev/null +++ b/previews/PR284/bonito/bin/7f7285351a3045058e64d46a7f3e7680cab98b61-58815392241644019.bin @@ -0,0 +1,3 @@ +,j$f91f6c01-33ec-4450-99a0-16163152c012sub1931559942742559920@I +=q˿ +=p diff --git a/previews/PR284/bonito/bin/7f8b62a069a7183b89ea24f03461a946e39d0c86-17716393200097520481.bin b/previews/PR284/bonito/bin/7f8b62a069a7183b89ea24f03461a946e39d0c86-17716393200097520481.bin new file mode 100644 index 00000000..81bfd02a --- /dev/null +++ b/previews/PR284/bonito/bin/7f8b62a069a7183b89ea24f03461a946e39d0c86-17716393200097520481.bin @@ -0,0 +1 @@ +,j$18dccda0-805f-4aeb-b705-c85d55f24d2csubh24 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/877239f6cb931a3b666d97c4122179ef81d85968-15581563410891632268.bin b/previews/PR284/bonito/bin/877239f6cb931a3b666d97c4122179ef81d85968-15581563410891632268.bin deleted file mode 100644 index 30d3aa27..00000000 --- a/previews/PR284/bonito/bin/877239f6cb931a3b666d97c4122179ef81d85968-15581563410891632268.bin +++ /dev/null @@ -1,3 +0,0 @@ -,j$9ebb8971-aad8-4134-a01a-e350812b7291subpayloadkCj$9ebb8971-aad8-4134-a01a-e350812b72911499e1499Click mesubobsh1499payloadDŽfGreturn x=> document.querySelector('[data-jscall-id="3"]').innerText = x7/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:69msg_type1Hk;j$9ebb8971-aad8-4134-a01a-e350812b72911500e1500£subpayloadf5319278199887661374h1500ٙ((node) => { - node['onclick'] = event=> __lookup_interpolated('5319278199887661374').notify(true); -})(document.querySelector('[data-jscall-id="3"]'));7/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:65msg_type2msg_type9 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/82afcbb9b89823358932cc28a1c4d2c825b34f7f-16590486947196412657.bin b/previews/PR284/bonito/bin/8f12863df6dd56c76a0f49b4534a57cf95a80c98-9776599952620972449.bin similarity index 66% rename from previews/PR284/bonito/bin/82afcbb9b89823358932cc28a1c4d2c825b34f7f-16590486947196412657.bin rename to previews/PR284/bonito/bin/8f12863df6dd56c76a0f49b4534a57cf95a80c98-9776599952620972449.bin index 53e861f5..193d8e91 100644 Binary files a/previews/PR284/bonito/bin/82afcbb9b89823358932cc28a1c4d2c825b34f7f-16590486947196412657.bin and b/previews/PR284/bonito/bin/8f12863df6dd56c76a0f49b4534a57cf95a80c98-9776599952620972449.bin differ diff --git a/previews/PR284/bonito/bin/87d0d341734034bad6db0624068d7737c0a68f21-4921648111975458458.bin b/previews/PR284/bonito/bin/93f6523c8f02a8b5e199cdf9e18d9e6e6a2b19e5-12781359513158825293.bin similarity index 54% rename from previews/PR284/bonito/bin/87d0d341734034bad6db0624068d7737c0a68f21-4921648111975458458.bin rename to previews/PR284/bonito/bin/93f6523c8f02a8b5e199cdf9e18d9e6e6a2b19e5-12781359513158825293.bin index 1911afca..26254986 100644 Binary files a/previews/PR284/bonito/bin/87d0d341734034bad6db0624068d7737c0a68f21-4921648111975458458.bin and b/previews/PR284/bonito/bin/93f6523c8f02a8b5e199cdf9e18d9e6e6a2b19e5-12781359513158825293.bin differ diff --git a/previews/PR284/bonito/bin/bf052474aeea306982933ae5c88fc6dfded92e28-6584634386686223629.bin b/previews/PR284/bonito/bin/9757ec9f32c5c801ec02b25ce08ca2b79b4cff1b-13583919704935599621.bin similarity index 64% rename from previews/PR284/bonito/bin/bf052474aeea306982933ae5c88fc6dfded92e28-6584634386686223629.bin rename to previews/PR284/bonito/bin/9757ec9f32c5c801ec02b25ce08ca2b79b4cff1b-13583919704935599621.bin index 66e5d501..87401e2c 100644 --- a/previews/PR284/bonito/bin/bf052474aeea306982933ae5c88fc6dfded92e28-6584634386686223629.bin +++ b/previews/PR284/bonito/bin/9757ec9f32c5c801ec02b25ce08ca2b79b4cff1b-13583919704935599621.bin @@ -1,7 +1,7 @@ -,j$f6fb4434-ee1a-45e4-ab52-6b30a93b1694subpayloadkPj$f6fb4434-ee1a-45e4-ab52-6b30a93b16941522 e1522abc1519e1519subpayloadf1250347454742489116h15222860087259791284893h1519(function onload(element) { +,j$3fde82ba-56b3-442d-a350-449acc401299subpayloadkPj$3fde82ba-56b3-442d-a350-449acc4012991522 e1522abc1519e1519subpayloadf7536268765074968409h15197188503021896784016h1522(function onload(element) { function onchange(e) { if (element === e.srcElement) { - (__lookup_interpolated('2860087259791284893')).notify(element.selectedIndex + 1); + (__lookup_interpolated('7536268765074968409')).notify(element.selectedIndex + 1); } } element.addEventListener("change", onchange); @@ -12,13 +12,13 @@ } element.selectedIndex = index - 1; } - __lookup_interpolated('2860087259791284893').on(set_option_index); + __lookup_interpolated('7536268765074968409').on(set_option_index); function set_options(opts) { element.selectedIndex = 0; // https://stackoverflow.com/questions/3364493/how-do-i-clear-all-options-in-a-dropdown-box element.options.length = 0; opts.forEach((opt, i) => element.options.add(new Option(opts[i], i))); } - __lookup_interpolated('1250347454742489116').on(set_options); + __lookup_interpolated('7188503021896784016').on(set_options); } )(document.querySelector('[data-jscall-id="4"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:214msg_type2msg_type9 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/aa5904d7c704b673e419a9cbfe9d23f76531bb72-885770761277259351.bin b/previews/PR284/bonito/bin/9a3c3db79623b26fbedcf0a4d805869e80ff20a1-15848089438024816166.bin similarity index 66% rename from previews/PR284/bonito/bin/aa5904d7c704b673e419a9cbfe9d23f76531bb72-885770761277259351.bin rename to previews/PR284/bonito/bin/9a3c3db79623b26fbedcf0a4d805869e80ff20a1-15848089438024816166.bin index 84c02dc5..de4b310a 100644 --- a/previews/PR284/bonito/bin/aa5904d7c704b673e419a9cbfe9d23f76531bb72-885770761277259351.bin +++ b/previews/PR284/bonito/bin/9a3c3db79623b26fbedcf0a4d805869e80ff20a1-15848089438024816166.bin @@ -1,15 +1,15 @@ -,j$782c402d-89fe-43b9-9f83-92f43bb1a71fsubpayloadxk9j$782c402d-89fe-43b9-9f83-92f43bb1a71f329e329subobsh329payloadf6974211987395400070space-evenlycenterendspace-betweenspace-aroundټreturn (idx) => { +,j$432a39b7-53dd-4630-8cf3-1e56211d821asubpayloadxk9j$432a39b7-53dd-4630-8cf3-1e56211d821a329e329subobsh329payloadf6974211987395400070space-evenlycenterendspace-betweenspace-aroundټreturn (idx) => { grid = document.querySelector('[data-jscall-id="254"]') const val = __lookup_interpolated('6974211987395400070')[idx-1] grid.style["justify-content"] = val -}layouting.md:412msg_type1[k9j$782c402d-89fe-43b9-9f83-92f43bb1a71f332e332subobsh332payloadf6512101515035149028stretchstartcenterendٺreturn (idx) => { +}layouting.md:412msg_type1[k9j$432a39b7-53dd-4630-8cf3-1e56211d821a332e332subobsh332payloadf6512101515035149028stretchstartcenterendٺreturn (idx) => { grid = document.querySelector('[data-jscall-id="254"]') const val = __lookup_interpolated('6512101515035149028')[idx-1] grid.style["justify-items"] = val -}layouting.md:417msg_type1klj$782c402d-89fe-43b9-9f83-92f43bb1a71f3359e335space-evenlycenterendspace-betweenspace-aroundsubpayloadf10954204731549754376h33516665715799778783306h329(function onload(element) { +}layouting.md:417msg_type1klj$432a39b7-53dd-4630-8cf3-1e56211d821a3359e335space-evenlycenterendspace-betweenspace-aroundsubpayloadf2002802904399758986h33515413705872283191895h329(function onload(element) { function onchange(e) { if (element === e.srcElement) { - (__lookup_interpolated('16665715799778783306')).notify(element.selectedIndex + 1); + (__lookup_interpolated('15413705872283191895')).notify(element.selectedIndex + 1); } } element.addEventListener("change", onchange); @@ -20,19 +20,19 @@ } element.selectedIndex = index - 1; } - __lookup_interpolated('16665715799778783306').on(set_option_index); + __lookup_interpolated('15413705872283191895').on(set_option_index); function set_options(opts) { element.selectedIndex = 0; // https://stackoverflow.com/questions/3364493/how-do-i-clear-all-options-in-a-dropdown-box element.options.length = 0; opts.forEach((opt, i) => element.options.add(new Option(opts[i], i))); } - __lookup_interpolated('10954204731549754376').on(set_options); + __lookup_interpolated('2002802904399758986').on(set_options); } -)(document.querySelector('[data-jscall-id="256"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:214msg_type2kRj$782c402d-89fe-43b9-9f83-92f43bb1a71f337e337stretchstartcenterendsubpayloadf8763073029390383870h3372524596905511543016h332(function onload(element) { +)(document.querySelector('[data-jscall-id="256"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:214msg_type2kRj$432a39b7-53dd-4630-8cf3-1e56211d821a337e337stretchstartcenterendsubpayloadf9870180311671306645h3377093197590892819748h332(function onload(element) { function onchange(e) { if (element === e.srcElement) { - (__lookup_interpolated('2524596905511543016')).notify(element.selectedIndex + 1); + (__lookup_interpolated('7093197590892819748')).notify(element.selectedIndex + 1); } } element.addEventListener("change", onchange); @@ -43,13 +43,13 @@ } element.selectedIndex = index - 1; } - __lookup_interpolated('2524596905511543016').on(set_option_index); + __lookup_interpolated('7093197590892819748').on(set_option_index); function set_options(opts) { element.selectedIndex = 0; // https://stackoverflow.com/questions/3364493/how-do-i-clear-all-options-in-a-dropdown-box element.options.length = 0; opts.forEach((opt, i) => element.options.add(new Option(opts[i], i))); } - __lookup_interpolated('8763073029390383870').on(set_options); + __lookup_interpolated('9870180311671306645').on(set_options); } )(document.querySelector('[data-jscall-id="262"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:214msg_type2msg_type9 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/e625f891cad5e141fbd559c650cd323029bc3276-16685782068967984842.bin b/previews/PR284/bonito/bin/9acfa7f4092235d7d1dec41210b986fcd7040652-1071976967750724513.bin similarity index 79% rename from previews/PR284/bonito/bin/e625f891cad5e141fbd559c650cd323029bc3276-16685782068967984842.bin rename to previews/PR284/bonito/bin/9acfa7f4092235d7d1dec41210b986fcd7040652-1071976967750724513.bin index e5435dde..cccf2d97 100644 --- a/previews/PR284/bonito/bin/e625f891cad5e141fbd559c650cd323029bc3276-16685782068967984842.bin +++ b/previews/PR284/bonito/bin/9acfa7f4092235d7d1dec41210b986fcd7040652-1071976967750724513.bin @@ -1,13 +1,13 @@ -,j$26b4223c-91ac-4efa-9177-7d848230e4d3subpayloadk;j$26b4223c-91ac-4efa-9177-7d848230e4d31538e15381subobsh1538payloadǡfVreturn (val)=> { +,j$bba81911-10c1-4597-9088-f68f17ae73b2subpayloadk;j$bba81911-10c1-4597-9088-f68f17ae73b21538e15381subobsh1538payloadǡfVreturn (val)=> { document.querySelector('[data-jscall-id="21"]').innerText = val -}E/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/observables.jl:98msg_type1 kJj$26b4223c-91ac-4efa-9177-7d848230e4d31537e1537 -1535e1535subpayload \f9728851735036494351h15371558916569592083880h1535 -((container)=> { +}E/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/observables.jl:98msg_type1 kJj$bba81911-10c1-4597-9088-f68f17ae73b21537e1537 +1535e1535subpayload af16564187716410235518h15351151650307328711900h1537 +((container)=> { const thumb = document.querySelector('[data-jscall-id="19"]'); const track_active = document.querySelector('[data-jscall-id="18"]'); const track = document.querySelector('[data-jscall-id="17"]'); let isDragging = false; - const nsteps_obs = __lookup_interpolated('9728851735036494351') + const nsteps_obs = __lookup_interpolated('1151650307328711900') let last_index = -1; function set_thumb_index(index) { if (index === last_index) { @@ -21,7 +21,7 @@ thumb.style.left = (new_left - thumb_width) + 'px'; // Update the left position of the thumb track_active.style.width = new_left + 'px'; // Update the active track } - __lookup_interpolated('1558916569592083880').on(idx=> set_thumb_index(idx)); + __lookup_interpolated('16564187716410235518').on(idx=> set_thumb_index(idx)); function set_thumb(e) { const nsteps = nsteps_obs.value; const thumb_width = thumb.offsetWidth / 2; @@ -35,8 +35,8 @@ track_active.style.width = new_left + 'px'; // Update the active track const index = Math.round((new_left / width) * (nsteps - 1)); last_index = index; - if (index !== __lookup_interpolated('1558916569592083880').value) { - __lookup_interpolated('1558916569592083880').notify(index + 1); + if (index !== __lookup_interpolated('16564187716410235518').value) { + __lookup_interpolated('16564187716410235518').notify(index + 1); } } const set_thumb_throttled = Bonito.throttle_function(set_thumb, 100); @@ -59,6 +59,6 @@ set_thumb(e); } }, { signal: controller.signal }); - set_thumb_index(__lookup_interpolated('1558916569592083880').value) + set_thumb_index(__lookup_interpolated('16564187716410235518').value) } )(document.querySelector('[data-jscall-id="16"]'));;/home/runner/work/Bonito.jl/Bonito.jl/src/components.jl:338msg_type2msg_type9 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/9d5d611b93a2cfbd749126dccd34db76d2b65827-15850719534113658102.bin b/previews/PR284/bonito/bin/9d5d611b93a2cfbd749126dccd34db76d2b65827-15850719534113658102.bin deleted file mode 100644 index 862f7322..00000000 --- a/previews/PR284/bonito/bin/9d5d611b93a2cfbd749126dccd34db76d2b65827-15850719534113658102.bin +++ /dev/null @@ -1,3 +0,0 @@ -,j$3391d82e-1e2e-4c8e-89da-bd0bb1f28270subpayload3kJj$3391d82e-1e2e-4c8e-89da-bd0bb1f282701512e1512write somethingsubobsh1512payloadfkreturn value=> Bonito.update_node_attribute(document.querySelector('[data-jscall-id="2"]'), 'value', value)Q/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/hyperscript_integration.jl:92msg_type1mkJj$3391d82e-1e2e-4c8e-89da-bd0bb1f282701511e1511write somethingsubpayloadf9905887054023953465h1511٭((node) => { - node['onchange'] = event => __lookup_interpolated('9905887054023953465').notify(event.srcElement.value); -})(document.querySelector('[data-jscall-id="2"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:109msg_type2msg_type9 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/797e36c6ebb845853f8b56622c07b8f34c80b762-4262830043020938932.bin b/previews/PR284/bonito/bin/9fa0b2567f6904e5ed36121b04b3b1d58bdb29bc-12779981151154224006.bin similarity index 88% rename from previews/PR284/bonito/bin/797e36c6ebb845853f8b56622c07b8f34c80b762-4262830043020938932.bin rename to previews/PR284/bonito/bin/9fa0b2567f6904e5ed36121b04b3b1d58bdb29bc-12779981151154224006.bin index 76af3203..6878efe0 100644 Binary files a/previews/PR284/bonito/bin/797e36c6ebb845853f8b56622c07b8f34c80b762-4262830043020938932.bin and b/previews/PR284/bonito/bin/9fa0b2567f6904e5ed36121b04b3b1d58bdb29bc-12779981151154224006.bin differ diff --git a/previews/PR284/bonito/bin/a65f6a75653aaabd57bcc685b42c36c5246e9002-5061563877486008583.bin b/previews/PR284/bonito/bin/a65f6a75653aaabd57bcc685b42c36c5246e9002-5061563877486008583.bin deleted file mode 100644 index 1e9f5551..00000000 --- a/previews/PR284/bonito/bin/a65f6a75653aaabd57bcc685b42c36c5246e9002-5061563877486008583.bin +++ /dev/null @@ -1,28 +0,0 @@ -,j$d4b63d87-82fb-43db-bdfc-9d9da9bd30a2subpayload@k,j$d4b63d87-82fb-43db-bdfc-9d9da9bd30a2subpayloadkXj$d4b63d87-82fb-43db-bdfc-9d9da9bd30a2278e278277e277276 e276subobsh277payloadf16414608270482111309h27613192571179338142910h278٩return (index) => { - const values = __lookup_interpolated('16414608270482111309').value - __lookup_interpolated('13192571179338142910').notify(values[index - 1]) -} -8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:272msg_type1k:j$d4b63d87-82fb-43db-bdfc-9d9da9bd30a2281e2815subobsh281payloadfireturn value=> Bonito.update_node_attribute(document.querySelector('[data-jscall-id="2"]'), 'max', value)Q/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/hyperscript_integration.jl:92msg_type1!k:j$d4b63d87-82fb-43db-bdfc-9d9da9bd30a2282e2821subobsh282payloadfkreturn value=> Bonito.update_node_attribute(document.querySelector('[data-jscall-id="2"]'), 'value', value)Q/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/hyperscript_integration.jl:92msg_type1k,j$d4b63d87-82fb-43db-bdfc-9d9da9bd30a2subpayloadf4367741645863461131h277o((node) => { - node['oninput'] = (event)=> { - const idx = event.srcElement.valueAsNumber; - console.log(idx, " ", __lookup_interpolated('4367741645863461131').value) - if (idx !== __lookup_interpolated('4367741645863461131').value) { - __lookup_interpolated('4367741645863461131').notify(idx) - } -} -})(document.querySelector('[data-jscall-id="2"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:287msg_type2msg_type9k,j$d4b63d87-82fb-43db-bdfc-9d9da9bd30a2subpayloadzf111568414784967987354Nk-j$05a595e9-2148-4163-aa03-2b7d436ae652rootpayload4id282msg_type01Nk-j$05a595e9-2148-4163-aa03-2b7d436ae652rootpayload1id282msg_type05Nk-j$05a595e9-2148-4163-aa03-2b7d436ae652rootpayload5id282msg_type02Nk-j$05a595e9-2148-4163-aa03-2b7d436ae652rootpayload2id282msg_type03Nk-j$05a595e9-2148-4163-aa03-2b7d436ae652rootpayload3id282msg_type0Bonito.fetch_binary('bonito/bin/d633b82f33a77be6bb91b5abd92abf5c98820c20-5157927191964245535.bin').then(binary => { - const statemap = __lookup_interpolated('11156841478496798735') - console.log(statemap) - const observables = Bonito.decode_binary(binary, false); - Bonito.onany(observables, (states) => { - console.log(states) - // messages to send for this state of that observable - const messages = statemap[states] - // not all states trigger events - // so some states won't have any messages recorded - if (messages){ - messages.forEach(Bonito.process_message) - } - }) -}) -7/home/runner/work/Bonito.jl/Bonito.jl/src/export.jl:144msg_type2Fk-j$05a595e9-2148-4163-aa03-2b7d436ae652rootpayloadmsg_type9msg_type9 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/a73787bc129a19a9fbde191ab5eedc783f49ef39-12059955826838210462.bin b/previews/PR284/bonito/bin/a73787bc129a19a9fbde191ab5eedc783f49ef39-12059955826838210462.bin deleted file mode 100644 index 5b31561e..00000000 Binary files a/previews/PR284/bonito/bin/a73787bc129a19a9fbde191ab5eedc783f49ef39-12059955826838210462.bin and /dev/null differ diff --git a/previews/PR284/bonito/bin/a7ef4106530cfdcd76a4fd42957dd13922a50a2d-11607981930641215662.bin b/previews/PR284/bonito/bin/a7ef4106530cfdcd76a4fd42957dd13922a50a2d-11607981930641215662.bin deleted file mode 100644 index 87a405d9..00000000 --- a/previews/PR284/bonito/bin/a7ef4106530cfdcd76a4fd42957dd13922a50a2d-11607981930641215662.bin +++ /dev/null @@ -1,28 +0,0 @@ -,j$e14f6ecf-9e8d-4083-806c-e2938d1e933fsubpayload/k,j$e14f6ecf-9e8d-4083-806c-e2938d1e933fsubpayloadkOj$e14f6ecf-9e8d-4083-806c-e2938d1e933f34e3433e3335e35subobsh34payloadf8494594638106380694h352441843994696908608h33٧return (index) => { - const values = __lookup_interpolated('2441843994696908608').value - __lookup_interpolated('8494594638106380694').notify(values[index - 1]) -} -8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:272msg_type1k8j$e14f6ecf-9e8d-4083-806c-e2938d1e933f38e383subobsh38payloadfireturn value=> Bonito.update_node_attribute(document.querySelector('[data-jscall-id="5"]'), 'max', value)Q/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/hyperscript_integration.jl:92msg_type1k8j$e14f6ecf-9e8d-4083-806c-e2938d1e933f39e391subobsh39payloadfkreturn value=> Bonito.update_node_attribute(document.querySelector('[data-jscall-id="5"]'), 'value', value)Q/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/hyperscript_integration.jl:92msg_type1k,j$e14f6ecf-9e8d-4083-806c-e2938d1e933fsubpayloadf5585322867081359044h34o((node) => { - node['oninput'] = (event)=> { - const idx = event.srcElement.valueAsNumber; - console.log(idx, " ", __lookup_interpolated('5585322867081359044').value) - if (idx !== __lookup_interpolated('5585322867081359044').value) { - __lookup_interpolated('5585322867081359044').notify(idx) - } -} -})(document.querySelector('[data-jscall-id="5"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:287msg_type2msg_type9k,j$e14f6ecf-9e8d-4083-806c-e2938d1e933fsubpayloadf6942655552651495981Mk-j$3149b941-6a43-4445-bd83-76f40d897a28rootpayload1id39msg_type02Mk-j$3149b941-6a43-4445-bd83-76f40d897a28rootpayload2id39msg_type03Mk-j$3149b941-6a43-4445-bd83-76f40d897a28rootpayload3id39msg_type0Bonito.fetch_binary('bonito/bin/ac5749c03be05e563fb389d3443c5f437eb4dfd2-15238682044225126391.bin').then(binary => { - const statemap = __lookup_interpolated('694265555265149598') - console.log(statemap) - const observables = Bonito.decode_binary(binary, false); - Bonito.onany(observables, (states) => { - console.log(states) - // messages to send for this state of that observable - const messages = statemap[states] - // not all states trigger events - // so some states won't have any messages recorded - if (messages){ - messages.forEach(Bonito.process_message) - } - }) -}) -7/home/runner/work/Bonito.jl/Bonito.jl/src/export.jl:144msg_type2Fk-j$3149b941-6a43-4445-bd83-76f40d897a28rootpayloadmsg_type9msg_type9 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/ac5749c03be05e563fb389d3443c5f437eb4dfd2-15238682044225126391.bin b/previews/PR284/bonito/bin/ac5749c03be05e563fb389d3443c5f437eb4dfd2-15238682044225126391.bin deleted file mode 100644 index 30575316..00000000 --- a/previews/PR284/bonito/bin/ac5749c03be05e563fb389d3443c5f437eb4dfd2-15238682044225126391.bin +++ /dev/null @@ -1 +0,0 @@ -,j$e14f6ecf-9e8d-4083-806c-e2938d1e933fsubh34 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/acf357eca11b89cf921ff1b98f0f70760c3ed812-1812032636583735845.bin b/previews/PR284/bonito/bin/acf357eca11b89cf921ff1b98f0f70760c3ed812-1812032636583735845.bin new file mode 100644 index 00000000..57685f2c --- /dev/null +++ b/previews/PR284/bonito/bin/acf357eca11b89cf921ff1b98f0f70760c3ed812-1812032636583735845.bin @@ -0,0 +1,27 @@ +,j$a4e8f9cf-f2d6-4f2c-a86d-bae5f9102095subpayloadk,j$a4e8f9cf-f2d6-4f2c-a86d-bae5f9102095subpayloadkXj$a4e8f9cf-f2d6-4f2c-a86d-bae5f9102095288e288287 e287289e289subobsh288payloadf10512805510566594623h28717014549107842462854h289٩return (index) => { + const values = __lookup_interpolated('10512805510566594623').value + __lookup_interpolated('17014549107842462854').notify(values[index - 1]) +} +8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:272msg_type1 k:j$a4e8f9cf-f2d6-4f2c-a86d-bae5f9102095292e2925subobsh292payloadfjreturn value=> Bonito.update_node_attribute(document.querySelector('[data-jscall-id="13"]'), 'max', value)Q/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/hyperscript_integration.jl:92msg_type1"k:j$a4e8f9cf-f2d6-4f2c-a86d-bae5f9102095293e2931subobsh293payloadflreturn value=> Bonito.update_node_attribute(document.querySelector('[data-jscall-id="13"]'), 'value', value)Q/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/hyperscript_integration.jl:92msg_type1k,j$a4e8f9cf-f2d6-4f2c-a86d-bae5f9102095subpayload{f9074336409857681578h288"((node) => { + node['oninput'] = (event)=> { + const idx = event.srcElement.valueAsNumber; + if (idx !== __lookup_interpolated('9074336409857681578').value) { + __lookup_interpolated('9074336409857681578').notify(idx) + } +} +})(document.querySelector('[data-jscall-id="13"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:287msg_type2msg_type9k,j$a4e8f9cf-f2d6-4f2c-a86d-bae5f9102095subpayload{f157931766443870283294Nk-j$014e8f65-fc84-4c19-9231-03f1307e0792rootpayload4id293msg_type01Nk-j$014e8f65-fc84-4c19-9231-03f1307e0792rootpayload1id293msg_type05Nk-j$014e8f65-fc84-4c19-9231-03f1307e0792rootpayload5id293msg_type02Nk-j$014e8f65-fc84-4c19-9231-03f1307e0792rootpayload2id293msg_type03Nk-j$014e8f65-fc84-4c19-9231-03f1307e0792rootpayload3id293msg_type0Bonito.fetch_binary('bonito/bin/bf90b24ddc3a7afc68ae24e14af8f38a6ac66d85-15028031395698885447.bin').then(binary => { + const statemap = __lookup_interpolated('15793176644387028329') + console.log(statemap) + const observables = Bonito.decode_binary(binary, false); + Bonito.onany(observables, (states) => { + console.log(states) + // messages to send for this state of that observable + const messages = statemap[states] + // not all states trigger events + // so some states won't have any messages recorded + if (messages){ + messages.forEach(Bonito.process_message) + } + }) +}) +7/home/runner/work/Bonito.jl/Bonito.jl/src/export.jl:144msg_type2Fk-j$014e8f65-fc84-4c19-9231-03f1307e0792rootpayloadmsg_type9msg_type9 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/ada39e40b5dc4c8cb699c00b3c69c5e6272a7086-4791482042446237306.bin b/previews/PR284/bonito/bin/ada39e40b5dc4c8cb699c00b3c69c5e6272a7086-4791482042446237306.bin new file mode 100644 index 00000000..bbac7a02 Binary files /dev/null and b/previews/PR284/bonito/bin/ada39e40b5dc4c8cb699c00b3c69c5e6272a7086-4791482042446237306.bin differ diff --git a/previews/PR284/bonito/bin/bf90b24ddc3a7afc68ae24e14af8f38a6ac66d85-15028031395698885447.bin b/previews/PR284/bonito/bin/bf90b24ddc3a7afc68ae24e14af8f38a6ac66d85-15028031395698885447.bin new file mode 100644 index 00000000..89b767d0 --- /dev/null +++ b/previews/PR284/bonito/bin/bf90b24ddc3a7afc68ae24e14af8f38a6ac66d85-15028031395698885447.bin @@ -0,0 +1 @@ +,j$a4e8f9cf-f2d6-4f2c-a86d-bae5f9102095subh288 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/c51467b9883369c020614d5b883def1f7ffafc63-11955250222834450177.bin b/previews/PR284/bonito/bin/c51467b9883369c020614d5b883def1f7ffafc63-11955250222834450177.bin deleted file mode 100644 index 813a69f5..00000000 --- a/previews/PR284/bonito/bin/c51467b9883369c020614d5b883def1f7ffafc63-11955250222834450177.bin +++ /dev/null @@ -1,28 +0,0 @@ -,j$594520d4-15e0-46d6-b243-26776cffb7e9subpayloadEk,j$594520d4-15e0-46d6-b243-26776cffb7e9subpayloadkXj$594520d4-15e0-46d6-b243-26776cffb7e9288e288287 e287289e289subobsh288payloadf5247746586384967272h28912138509702877634516h287٨return (index) => { - const values = __lookup_interpolated('12138509702877634516').value - __lookup_interpolated('5247746586384967272').notify(values[index - 1]) -} -8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:272msg_type1 k:j$594520d4-15e0-46d6-b243-26776cffb7e9292e2925subobsh292payloadfjreturn value=> Bonito.update_node_attribute(document.querySelector('[data-jscall-id="13"]'), 'max', value)Q/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/hyperscript_integration.jl:92msg_type1"k:j$594520d4-15e0-46d6-b243-26776cffb7e9293e2931subobsh293payloadflreturn value=> Bonito.update_node_attribute(document.querySelector('[data-jscall-id="13"]'), 'value', value)Q/home/runner/work/Bonito.jl/Bonito.jl/src/rendering/hyperscript_integration.jl:92msg_type1k,j$594520d4-15e0-46d6-b243-26776cffb7e9subpayloadf12522405952944460865h288s((node) => { - node['oninput'] = (event)=> { - const idx = event.srcElement.valueAsNumber; - console.log(idx, " ", __lookup_interpolated('12522405952944460865').value) - if (idx !== __lookup_interpolated('12522405952944460865').value) { - __lookup_interpolated('12522405952944460865').notify(idx) - } -} -})(document.querySelector('[data-jscall-id="13"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:287msg_type2msg_type9k,j$594520d4-15e0-46d6-b243-26776cffb7e9subpayloadwf8726390546720112894Nk-j$05a595e9-2148-4163-aa03-2b7d436ae652rootpayload4id293msg_type01Nk-j$05a595e9-2148-4163-aa03-2b7d436ae652rootpayload1id293msg_type05Nk-j$05a595e9-2148-4163-aa03-2b7d436ae652rootpayload5id293msg_type02Nk-j$05a595e9-2148-4163-aa03-2b7d436ae652rootpayload2id293msg_type03Nk-j$05a595e9-2148-4163-aa03-2b7d436ae652rootpayload3id293msg_type0Bonito.fetch_binary('bonito/bin/5418c7879e7e8a4520a109f7616bc430d5c4ad22-12574744411705770182.bin').then(binary => { - const statemap = __lookup_interpolated('872639054672011289') - console.log(statemap) - const observables = Bonito.decode_binary(binary, false); - Bonito.onany(observables, (states) => { - console.log(states) - // messages to send for this state of that observable - const messages = statemap[states] - // not all states trigger events - // so some states won't have any messages recorded - if (messages){ - messages.forEach(Bonito.process_message) - } - }) -}) -7/home/runner/work/Bonito.jl/Bonito.jl/src/export.jl:144msg_type2Fk-j$05a595e9-2148-4163-aa03-2b7d436ae652rootpayloadmsg_type9msg_type9 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/c5a956d1afe28103590bdd26a24515e04aac4ab2-9130762109960203761.bin b/previews/PR284/bonito/bin/c5a956d1afe28103590bdd26a24515e04aac4ab2-9130762109960203761.bin new file mode 100644 index 00000000..90732008 --- /dev/null +++ b/previews/PR284/bonito/bin/c5a956d1afe28103590bdd26a24515e04aac4ab2-9130762109960203761.bin @@ -0,0 +1,3 @@ +,j$ae9d62c5-5f56-473a-9ce0-a7ed54325f8csubpayloadkCj$ae9d62c5-5f56-473a-9ce0-a7ed54325f8c1507e1507Click mesubobsh1507payloadDŽfGreturn x=> document.querySelector('[data-jscall-id="1"]').innerText = x7/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:69msg_type1Jk;j$ae9d62c5-5f56-473a-9ce0-a7ed54325f8c1508e1508£subpayloadf14210328653339926226h1508ٚ((node) => { + node['onclick'] = event=> __lookup_interpolated('14210328653339926226').notify(true); +})(document.querySelector('[data-jscall-id="1"]'));7/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:65msg_type2msg_type9 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/c835de023aa87db15c28d95a1ae109e815d1d813-6012171686631683244.bin b/previews/PR284/bonito/bin/c835de023aa87db15c28d95a1ae109e815d1d813-6012171686631683244.bin new file mode 100644 index 00000000..cc0ae3d9 Binary files /dev/null and b/previews/PR284/bonito/bin/c835de023aa87db15c28d95a1ae109e815d1d813-6012171686631683244.bin differ diff --git a/previews/PR284/bonito/bin/9ee051554f96f29706632b88cdd0e2f39080d87f-17207137409238733025.bin b/previews/PR284/bonito/bin/c890907c14bc4f14dd34ce42f33bad132ea47790-18199466418008834987.bin similarity index 99% rename from previews/PR284/bonito/bin/9ee051554f96f29706632b88cdd0e2f39080d87f-17207137409238733025.bin rename to previews/PR284/bonito/bin/c890907c14bc4f14dd34ce42f33bad132ea47790-18199466418008834987.bin index b3a67137..cf71eeeb 100644 Binary files a/previews/PR284/bonito/bin/9ee051554f96f29706632b88cdd0e2f39080d87f-17207137409238733025.bin and b/previews/PR284/bonito/bin/c890907c14bc4f14dd34ce42f33bad132ea47790-18199466418008834987.bin differ diff --git a/previews/PR284/bonito/bin/5bb9c7330645545aad7c386f8e59d72101f55b7e-10050091365315909060.bin b/previews/PR284/bonito/bin/c9cc021966c7475cc85a9d684b4a4e9f476fab35-13419165115372478745.bin similarity index 65% rename from previews/PR284/bonito/bin/5bb9c7330645545aad7c386f8e59d72101f55b7e-10050091365315909060.bin rename to previews/PR284/bonito/bin/c9cc021966c7475cc85a9d684b4a4e9f476fab35-13419165115372478745.bin index 86439bd7..1feb38b0 100644 --- a/previews/PR284/bonito/bin/5bb9c7330645545aad7c386f8e59d72101f55b7e-10050091365315909060.bin +++ b/previews/PR284/bonito/bin/c9cc021966c7475cc85a9d684b4a4e9f476fab35-13419165115372478745.bin @@ -1,23 +1,23 @@ -,j$0f634a74-f9ae-43e5-8f89-97fca866fd98subpayloadk9j$0f634a74-f9ae-43e5-8f89-97fca866fd98341e341subobsh341payloadef6974211987395400070space-evenlycenterendspace-betweenspace-aroundreturn (idx) => { +,j$f6bca62b-13f9-4510-aba8-88e2215f0b31subpayloadk9j$f6bca62b-13f9-4510-aba8-88e2215f0b31341e341subobsh341payloadef6974211987395400070space-evenlycenterendspace-betweenspace-aroundreturn (idx) => { const grids = [document.querySelector('[data-jscall-id="276"]'), document.querySelector('[data-jscall-id="277"]')] const val = __lookup_interpolated('6974211987395400070')[idx-1] grids.forEach(x=> x.style["justify-content"] = val) -}layouting.md:460msg_type1k9j$0f634a74-f9ae-43e5-8f89-97fca866fd98344e344subobsh344payloadIf6512101515035149028stretchstartcenterendreturn (idx) => { +}layouting.md:460msg_type1k9j$f6bca62b-13f9-4510-aba8-88e2215f0b31344e344subobsh344payloadIf6512101515035149028stretchstartcenterendreturn (idx) => { const grids = [document.querySelector('[data-jscall-id="276"]'), document.querySelector('[data-jscall-id="277"]')] const val = __lookup_interpolated('6512101515035149028')[idx-1] grids.forEach(x=> x.style["justify-items"] = val) -}layouting.md:467msg_type1k9j$0f634a74-f9ae-43e5-8f89-97fca866fd98347e347subobsh347payloadcf6974211987395400070space-evenlycenterendspace-betweenspace-aroundreturn (idx) => { +}layouting.md:467msg_type1k9j$f6bca62b-13f9-4510-aba8-88e2215f0b31347e347subobsh347payloadcf6974211987395400070space-evenlycenterendspace-betweenspace-aroundreturn (idx) => { const grids = [document.querySelector('[data-jscall-id="276"]'), document.querySelector('[data-jscall-id="278"]')] const val = __lookup_interpolated('6974211987395400070')[idx-1] grids.forEach(x=> x.style["align-content"] = val) -}layouting.md:474msg_type1k9j$0f634a74-f9ae-43e5-8f89-97fca866fd98350e350subobsh350payloadGf6512101515035149028stretchstartcenterendreturn (idx) => { +}layouting.md:474msg_type1k9j$f6bca62b-13f9-4510-aba8-88e2215f0b31350e350subobsh350payloadGf6512101515035149028stretchstartcenterendreturn (idx) => { const grids = [document.querySelector('[data-jscall-id="276"]'), document.querySelector('[data-jscall-id="278"]')] const val = __lookup_interpolated('6512101515035149028')[idx-1] grids.forEach(x=> x.style["align-items"] = val) -}layouting.md:481msg_type1klj$0f634a74-f9ae-43e5-8f89-97fca866fd983539e353space-evenlycenterendspace-betweenspace-aroundsubpayloadf17426695247709564668h34716478068904453047489h353(function onload(element) { +}layouting.md:481msg_type1klj$f6bca62b-13f9-4510-aba8-88e2215f0b313539e353space-evenlycenterendspace-betweenspace-aroundsubpayloadf16305670912832253330h3537170264973443214924h347(function onload(element) { function onchange(e) { if (element === e.srcElement) { - (__lookup_interpolated('17426695247709564668')).notify(element.selectedIndex + 1); + (__lookup_interpolated('7170264973443214924')).notify(element.selectedIndex + 1); } } element.addEventListener("change", onchange); @@ -28,19 +28,19 @@ } element.selectedIndex = index - 1; } - __lookup_interpolated('17426695247709564668').on(set_option_index); + __lookup_interpolated('7170264973443214924').on(set_option_index); function set_options(opts) { element.selectedIndex = 0; // https://stackoverflow.com/questions/3364493/how-do-i-clear-all-options-in-a-dropdown-box element.options.length = 0; opts.forEach((opt, i) => element.options.add(new Option(opts[i], i))); } - __lookup_interpolated('16478068904453047489').on(set_options); + __lookup_interpolated('16305670912832253330').on(set_options); } -)(document.querySelector('[data-jscall-id="283"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:214msg_type2klj$0f634a74-f9ae-43e5-8f89-97fca866fd983559e355space-evenlycenterendspace-betweenspace-aroundsubpayloadf11647343664781302444h34154894529399289747h355(function onload(element) { +)(document.querySelector('[data-jscall-id="283"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:214msg_type2klj$f6bca62b-13f9-4510-aba8-88e2215f0b313559e355space-evenlycenterendspace-betweenspace-aroundsubpayloadf12587525368671322052h35515340057444994022028h341(function onload(element) { function onchange(e) { if (element === e.srcElement) { - (__lookup_interpolated('11647343664781302444')).notify(element.selectedIndex + 1); + (__lookup_interpolated('15340057444994022028')).notify(element.selectedIndex + 1); } } element.addEventListener("change", onchange); @@ -51,19 +51,19 @@ } element.selectedIndex = index - 1; } - __lookup_interpolated('11647343664781302444').on(set_option_index); + __lookup_interpolated('15340057444994022028').on(set_option_index); function set_options(opts) { element.selectedIndex = 0; // https://stackoverflow.com/questions/3364493/how-do-i-clear-all-options-in-a-dropdown-box element.options.length = 0; opts.forEach((opt, i) => element.options.add(new Option(opts[i], i))); } - __lookup_interpolated('54894529399289747').on(set_options); + __lookup_interpolated('12587525368671322052').on(set_options); } -)(document.querySelector('[data-jscall-id="289"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:214msg_type2kRj$0f634a74-f9ae-43e5-8f89-97fca866fd98357e357stretchstartcenterendsubpayloadf124015950048464589h3502109821411207548788h357(function onload(element) { +)(document.querySelector('[data-jscall-id="289"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:214msg_type2kRj$f6bca62b-13f9-4510-aba8-88e2215f0b31357e357stretchstartcenterendsubpayloadf12162900436836635169h35018436147041267864226h357(function onload(element) { function onchange(e) { if (element === e.srcElement) { - (__lookup_interpolated('124015950048464589')).notify(element.selectedIndex + 1); + (__lookup_interpolated('12162900436836635169')).notify(element.selectedIndex + 1); } } element.addEventListener("change", onchange); @@ -74,19 +74,19 @@ } element.selectedIndex = index - 1; } - __lookup_interpolated('124015950048464589').on(set_option_index); + __lookup_interpolated('12162900436836635169').on(set_option_index); function set_options(opts) { element.selectedIndex = 0; // https://stackoverflow.com/questions/3364493/how-do-i-clear-all-options-in-a-dropdown-box element.options.length = 0; opts.forEach((opt, i) => element.options.add(new Option(opts[i], i))); } - __lookup_interpolated('2109821411207548788').on(set_options); + __lookup_interpolated('18436147041267864226').on(set_options); } -)(document.querySelector('[data-jscall-id="295"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:214msg_type2kRj$0f634a74-f9ae-43e5-8f89-97fca866fd98359e359stretchstartcenterendsubpayloadf13290218407378356242h35911197385033720423621h344(function onload(element) { +)(document.querySelector('[data-jscall-id="295"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:214msg_type2kRj$f6bca62b-13f9-4510-aba8-88e2215f0b31359e359stretchstartcenterendsubpayloadf10563222455333177627h35917008908278435181729h344(function onload(element) { function onchange(e) { if (element === e.srcElement) { - (__lookup_interpolated('11197385033720423621')).notify(element.selectedIndex + 1); + (__lookup_interpolated('17008908278435181729')).notify(element.selectedIndex + 1); } } element.addEventListener("change", onchange); @@ -97,13 +97,13 @@ } element.selectedIndex = index - 1; } - __lookup_interpolated('11197385033720423621').on(set_option_index); + __lookup_interpolated('17008908278435181729').on(set_option_index); function set_options(opts) { element.selectedIndex = 0; // https://stackoverflow.com/questions/3364493/how-do-i-clear-all-options-in-a-dropdown-box element.options.length = 0; opts.forEach((opt, i) => element.options.add(new Option(opts[i], i))); } - __lookup_interpolated('13290218407378356242').on(set_options); + __lookup_interpolated('10563222455333177627').on(set_options); } )(document.querySelector('[data-jscall-id="300"]'));8/home/runner/work/Bonito.jl/Bonito.jl/src/widgets.jl:214msg_type2msg_type9 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/caef7f5587279c0359f55c600fadb11f63362842-11867354927401190924.bin b/previews/PR284/bonito/bin/caef7f5587279c0359f55c600fadb11f63362842-11867354927401190924.bin deleted file mode 100644 index c78ccc8f..00000000 Binary files a/previews/PR284/bonito/bin/caef7f5587279c0359f55c600fadb11f63362842-11867354927401190924.bin and /dev/null differ diff --git a/previews/PR284/bonito/bin/d633b82f33a77be6bb91b5abd92abf5c98820c20-5157927191964245535.bin b/previews/PR284/bonito/bin/d633b82f33a77be6bb91b5abd92abf5c98820c20-5157927191964245535.bin deleted file mode 100644 index 8980fc57..00000000 --- a/previews/PR284/bonito/bin/d633b82f33a77be6bb91b5abd92abf5c98820c20-5157927191964245535.bin +++ /dev/null @@ -1 +0,0 @@ -,j$d4b63d87-82fb-43db-bdfc-9d9da9bd30a2subh277 \ No newline at end of file diff --git a/previews/PR284/bonito/bin/474044b9f4a60eb88f742baaf55760744a2513bd-7798846669783688488.bin b/previews/PR284/bonito/bin/e1032de5ab28635826a480feaf95254fb6c1ddb2-8234177580960299876.bin similarity index 89% rename from previews/PR284/bonito/bin/474044b9f4a60eb88f742baaf55760744a2513bd-7798846669783688488.bin rename to previews/PR284/bonito/bin/e1032de5ab28635826a480feaf95254fb6c1ddb2-8234177580960299876.bin index 28e7e42e..e2d4fe2e 100644 --- a/previews/PR284/bonito/bin/474044b9f4a60eb88f742baaf55760744a2513bd-7798846669783688488.bin +++ b/previews/PR284/bonito/bin/e1032de5ab28635826a480feaf95254fb6c1ddb2-8234177580960299876.bin @@ -1,4 +1,4 @@ -,j$5eb5c715-e749-4f98-bb08-e37db2b2dd15subpayloadk,j$5eb5c715-e749-4f98-bb08-e37db2b2dd15subpayload=f+( function (container){ +,j$e7e04444-fe5d-4d0f-969f-061d744346f1subpayloadk,j$e7e04444-fe5d-4d0f-969f-061d744346f1subpayload=f+( function (container){ import('https://cdn.esm.sh/v66/three@0.136/es2021/three.js').then(THREE=> { var renderer = new THREE.WebGLRenderer({antialias: true}); renderer.setSize(500, 500); diff --git a/previews/PR284/bonito/bin/76212d4eefaa2c92b86e807dc8fc368bbd2e6a65-16403393466849749616.bin b/previews/PR284/bonito/bin/f221303ace9f1daab69ebbcb9c0f6381d7b6fabe-15956584573050885778.bin similarity index 80% rename from previews/PR284/bonito/bin/76212d4eefaa2c92b86e807dc8fc368bbd2e6a65-16403393466849749616.bin rename to previews/PR284/bonito/bin/f221303ace9f1daab69ebbcb9c0f6381d7b6fabe-15956584573050885778.bin index 61b08ca7..44a2230f 100644 --- a/previews/PR284/bonito/bin/76212d4eefaa2c92b86e807dc8fc368bbd2e6a65-16403393466849749616.bin +++ b/previews/PR284/bonito/bin/f221303ace9f1daab69ebbcb9c0f6381d7b6fabe-15956584573050885778.bin @@ -1,11 +1,11 @@ -,j$78cf3746-dd3a-442a-bf0e-0c80779298cdsubpayload kJj$78cf3746-dd3a-442a-bf0e-0c80779298cd1531e1531 -1529e1529subpayload Yf622568483854949449h152917793299895884901585h1531 -((container)=> { +,j$7fb22a6a-c29b-45ce-a09d-f09709e141c6subpayload kJj$7fb22a6a-c29b-45ce-a09d-f09709e141c61531e1531 +1529e1529subpayload cf13944176683731259584h153116117264071166763503h1529 +((container)=> { const thumb = document.querySelector('[data-jscall-id="13"]'); const track_active = document.querySelector('[data-jscall-id="12"]'); const track = document.querySelector('[data-jscall-id="11"]'); let isDragging = false; - const nsteps_obs = __lookup_interpolated('17793299895884901585') + const nsteps_obs = __lookup_interpolated('13944176683731259584') let last_index = -1; function set_thumb_index(index) { if (index === last_index) { @@ -19,7 +19,7 @@ thumb.style.left = (new_left - thumb_width) + 'px'; // Update the left position of the thumb track_active.style.width = new_left + 'px'; // Update the active track } - __lookup_interpolated('622568483854949449').on(idx=> set_thumb_index(idx)); + __lookup_interpolated('16117264071166763503').on(idx=> set_thumb_index(idx)); function set_thumb(e) { const nsteps = nsteps_obs.value; const thumb_width = thumb.offsetWidth / 2; @@ -33,8 +33,8 @@ track_active.style.width = new_left + 'px'; // Update the active track const index = Math.round((new_left / width) * (nsteps - 1)); last_index = index; - if (index !== __lookup_interpolated('622568483854949449').value) { - __lookup_interpolated('622568483854949449').notify(index + 1); + if (index !== __lookup_interpolated('16117264071166763503').value) { + __lookup_interpolated('16117264071166763503').notify(index + 1); } } const set_thumb_throttled = Bonito.throttle_function(set_thumb, 100); @@ -57,6 +57,6 @@ set_thumb(e); } }, { signal: controller.signal }); - set_thumb_index(__lookup_interpolated('622568483854949449').value) + set_thumb_index(__lookup_interpolated('16117264071166763503').value) } )(document.querySelector('[data-jscall-id="10"]'));;/home/runner/work/Bonito.jl/Bonito.jl/src/components.jl:338msg_type2msg_type9 \ No newline at end of file diff --git a/previews/PR284/components.html b/previews/PR284/components.html index 06e999f7..093fef85 100644 --- a/previews/PR284/components.html +++ b/previews/PR284/components.html @@ -18,18 +18,18 @@ App(()-> CurrentMonth())
-
+
- +
-
+
- +
hello world

Server

# Depending on your servers setup, you may need to listen on another port or URL
@@ -71,4 +71,4 @@
     "/contact" => App(contact_func, title="Contact"),
     "/support" => App(support_func, title="Support")
 )
-Bonito.export_static("html/folder", routes)

Please visit Static Sites for more details.

Anything else

Bonito overloads the display/show stack for the mime "text/html" so any other Software which is able to display html in Julia should work with Bonito. If a use case is not supported, please open an issue. One can also always directly call:

html_source = sprint(io-> show(io, MIME"text/html"(), example_app))

Do get the html source code as a string (or just write it to the io).

+Bonito.export_static("html/folder", routes)

Please visit Static Sites for more details.

Anything else

Bonito overloads the display/show stack for the mime "text/html" so any other Software which is able to display html in Julia should work with Bonito. If a use case is not supported, please open an issue. One can also always directly call:

html_source = sprint(io-> show(io, MIME"text/html"(), example_app))

Do get the html source code as a string (or just write it to the io).

diff --git a/previews/PR284/extending.html b/previews/PR284/extending.html index 649d0f14..0365106a 100644 --- a/previews/PR284/extending.html +++ b/previews/PR284/extending.html @@ -117,4 +117,4 @@ ... end -Bonito.set_cleanup_policy!(MyCleanupPolicy())

You can also make use of cleanup policies including DefaultCleanupPolicy() if you manage your own websocket server as outlined in the previous section.

You can get further details to guide your implementation by looking at Bonito's own implementation in Bonito/src/connections/websocket.jl.

+Bonito.set_cleanup_policy!(MyCleanupPolicy())

You can also make use of cleanup policies including DefaultCleanupPolicy() if you manage your own websocket server as outlined in the previous section.

You can get further details to guide your implementation by looking at Bonito's own implementation in Bonito/src/connections/websocket.jl.

diff --git a/previews/PR284/index.html b/previews/PR284/index.html index e545aa37..97e1f47d 100644 --- a/previews/PR284/index.html +++ b/previews/PR284/index.html @@ -3,24 +3,24 @@ app = App() do return DOM.div(DOM.h1("hello world"), js"""console.log('hello world')""") end
-
+
- +
-
+
- +

hello world

@@ -52,7 +52,7 @@

hello world

}) """ ) -end
+end
@@ -60,7 +60,7 @@

hello world

- +
-

Read more about wrapping libraries in Javascript.

Deploying

Bonito.jl wants to run everywhere, from Notebooks, IDEs, Electron, to being directly inserted into existing web pages.

Bonito-wales

Find out more about the different ways to serve your apps in Deployment.

+

Read more about wrapping libraries in Javascript.

Deploying

Bonito.jl wants to run everywhere, from Notebooks, IDEs, Electron, to being directly inserted into existing web pages.

Bonito-wales

Find out more about the different ways to serve your apps in Deployment.

diff --git a/previews/PR284/interactions.html b/previews/PR284/interactions.html index 76b38e00..531568c0 100644 --- a/previews/PR284/interactions.html +++ b/previews/PR284/interactions.html @@ -7,25 +7,25 @@ # Record states is an experimental feature to record all states generated in the Julia session and allow the slider to stay interactive in the statically hosted docs! return Bonito.record_states(session, DOM.div(s, value)) end
-
+
- +
-
+
@@ -49,26 +49,26 @@ end end return Bonito.record_states(session, DOM.div(s, value)) -end
+end
-
+
- +

hello from slider: 1

@@ -87,7 +87,7 @@

hello from slider: 1

D.Card(D.FlexCol(checkbox, s, menu)), D.Card(app) )) -end
+end
- +
true1

sin (generic function with 14 methods)

@@ -210,7 +210,7 @@

Menu:

sl_radii = D.Slider("radii", 0.1:0.1:60, value=10.0) svg = map(create_svg, sl_nsamples.value, sl_sample_step.value, sl_phase.value, sl_radii.value, color) return DOM.div(D.FlexRow(D.FlexCol(sl_nsamples, sl_sample_step, sl_phase, sl_radii), svg)) -end
+end
@@ -219,7 +219,7 @@

Menu:

@@ -267,13 +267,13 @@

-
+
- + @@ -422,7 +422,7 @@

update_svg(observables.map(x=> x.value)) """) return DOM.div(D.FlexRow(D.FlexCol(nsamples, sample_step, phase, radii), svg)) -end
+end
@@ -431,7 +431,7 @@

@@ -482,4 +482,4 @@

-

This works, because the Javascript side of Bonito, will still update the observables in Javascript (which are mirrored from Julia), and therefore keep working without a running Julia process. You can use js_observable.on(value=> ....) and Bonito.onany(array_of_js_observables, values=> ...) to create interactions, pretty similar to how you would work with Observables in Julia.

+

This works, because the Javascript side of Bonito, will still update the observables in Javascript (which are mirrored from Julia), and therefore keep working without a running Julia process. You can use js_observable.on(value=> ....) and Bonito.onany(array_of_js_observables, values=> ...) to create interactions, pretty similar to how you would work with Observables in Julia.

diff --git a/previews/PR284/javascript-libraries.html b/previews/PR284/javascript-libraries.html index 20da546e..58fcf07e 100644 --- a/previews/PR284/javascript-libraries.html +++ b/previews/PR284/javascript-libraries.html @@ -32,31 +32,31 @@ App() do return LeafletMap((51.505, -0.09), 13) end
-
+
- +
-
+
- +
- +
- +
-
+
- -
+ +
-
+
-
+
@@ -1409,7 +1409,7 @@

Styles(...)

area_style = Styles("height" => "200px", "width" => "600px", "margin" => "20px", "position" => :relative, "background-color" => "#F88379", "padding" => "5px") grid_area = DOM.div(grid; style=area_style) return Grid(justification, grid_area; justify_items="center") -end
+end
- +
-
+
- +
-
+
- +
- +
-
+
- + a
@@ -659,7 +659,7 @@

This is a card

""") notify(eval_button.value) return DOM.div(editor, eval_button, output) -end
+end
+ -
@@ -853,7 +853,7 @@

chose

- +

Test @@ -929,4 +929,4 @@

check this

-
+