----------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} ----------------------------------------------------------------------------- -- | -- Module : Miso.Native.X.Element.Webview.Property -- Copyright : (C) 2016-2026 David M. Johnson -- License : BSD3-style (see the file LICENSE) -- Maintainer : David M. Johnson <code@dmj.io> -- Stability : experimental -- Portability : non-portable -- -- @since 1.13.0.0 ---------------------------------------------------------------------------- module Miso.Native.X.Element.Webview.Property ( -- *** Property bounces_ , cookies_ , enableDebug_ , html_ , initjs_ , params_ , scrollBarEnable_ , src_ , useOsr_ , webviewType_ ) where ----------------------------------------------------------------------------- import Miso.JSON (Value) import Miso.String (MisoString) import Miso.Types (Attribute) import Miso.Property ----------------------------------------------------------------------------- -- | https://lynxjs.org/api/elements/built-in/webview.html#bounces -- -- *iOS* only. Enables the bounce effect. -- -- Default Value: @False@ -- bounces_ :: Bool -> Attribute model action bounces_ :: forall model action. Bool -> Attribute model action bounces_ = Text -> Bool -> Attribute model action forall model action. Text -> Bool -> Attribute model action boolProp Text "bounces" ----------------------------------------------------------------------------- -- | https://lynxjs.org/api/elements/built-in/webview.html#cookies -- -- *Desktop, Lynx 3.5+*. Preset cookies. -- cookies_ :: Value -> Attribute model action = Text -> Value -> Attribute model action forall a model action. ToJSON a => Text -> a -> Attribute model action prop Text "cookies" ----------------------------------------------------------------------------- -- | https://lynxjs.org/api/elements/built-in/webview.html#enable-debug -- -- Enables WebView debugging on Android so it can be debugged in Chrome DevTools. -- -- Default Value: @False@ -- enableDebug_ :: Bool -> Attribute model action enableDebug_ :: forall model action. Bool -> Attribute model action enableDebug_ = Text -> Bool -> Attribute model action forall model action. Text -> Bool -> Attribute model action boolProp Text "enable-debug" ----------------------------------------------------------------------------- -- | https://lynxjs.org/api/elements/built-in/webview.html#html -- -- *Lynx 3.6+*. A string of HTML content to load. Automatically refreshes when -- the HTML changes. Lower priority than @src_@. -- html_ :: MisoString -> Attribute model action html_ :: forall model action. Text -> Attribute model action html_ = Text -> Text -> Attribute model action forall model action. Text -> Text -> Attribute model action textProp Text "html" ----------------------------------------------------------------------------- -- | https://lynxjs.org/api/elements/built-in/webview.html#initjs -- -- *Desktop, Lynx 3.5+*. Executes JavaScript when the document is ready. -- initjs_ :: MisoString -> Attribute model action initjs_ :: forall model action. Text -> Attribute model action initjs_ = Text -> Text -> Attribute model action forall model action. Text -> Text -> Attribute model action textProp Text "initjs" ----------------------------------------------------------------------------- -- | https://lynxjs.org/api/elements/built-in/webview.html#params -- -- Params for the external webview implementation. -- params_ :: Value -> Attribute model action params_ :: forall model action. Value -> Attribute model action params_ = Text -> Value -> Attribute model action forall a model action. ToJSON a => Text -> a -> Attribute model action prop Text "params" ----------------------------------------------------------------------------- -- | https://lynxjs.org/api/elements/built-in/webview.html#scroll-bar-enable -- -- *iOS* only. Enables the scrollbar. -- -- Default Value: @False@ -- scrollBarEnable_ :: Bool -> Attribute model action scrollBarEnable_ :: forall model action. Bool -> Attribute model action scrollBarEnable_ = Text -> Bool -> Attribute model action forall model action. Text -> Bool -> Attribute model action boolProp Text "scroll-bar-enable" ----------------------------------------------------------------------------- -- | https://lynxjs.org/api/elements/built-in/webview.html#src -- -- The location of a resource on a remote server. -- -- > src_ "https://url.com" -- src_ :: MisoString -> Attribute model action src_ :: forall model action. Text -> Attribute model action src_ = Text -> Text -> Attribute model action forall model action. Text -> Text -> Attribute model action textProp Text "src" ----------------------------------------------------------------------------- -- | https://lynxjs.org/api/elements/built-in/webview.html#use-osr -- -- *Desktop, Lynx 3.5+*. Whether to enable offscreen rendering mode. -- -- Default Value: @False@ -- useOsr_ :: Bool -> Attribute model action useOsr_ :: forall model action. Bool -> Attribute model action useOsr_ = Text -> Bool -> Attribute model action forall model action. Text -> Bool -> Attribute model action boolProp Text "use-osr" ----------------------------------------------------------------------------- -- | https://lynxjs.org/api/elements/built-in/webview.html#webview-type -- -- Specifies the type of webview; it can be an implementation of a webview -- injected from @LynxService@. -- -- Default Value: @\"default\"@ -- webviewType_ :: MisoString -> Attribute model action webviewType_ :: forall model action. Text -> Attribute model action webviewType_ = Text -> Text -> Attribute model action forall model action. Text -> Text -> Attribute model action textProp Text "webview-type" -----------------------------------------------------------------------------