-----------------------------------------------------------------------------
{-# 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
----------------------------------------------------------------------------
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_ = MisoString -> Bool -> Attribute model action
forall model action. MisoString -> Bool -> Attribute model action
boolProp MisoString
"bounces"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/webview.html#cookies
--
-- *Desktop, Lynx 3.5+*. Preset cookies.
--
cookies_ :: Value -> Attribute model action
cookies_ :: forall model action. Value -> Attribute model action
cookies_ = MisoString -> Value -> Attribute model action
forall a model action.
ToJSON a =>
MisoString -> a -> Attribute model action
prop MisoString
"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_ = MisoString -> Bool -> Attribute model action
forall model action. MisoString -> Bool -> Attribute model action
boolProp MisoString
"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. MisoString -> Attribute model action
html_ = MisoString -> MisoString -> Attribute model action
forall model action.
MisoString -> MisoString -> Attribute model action
textProp MisoString
"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. MisoString -> Attribute model action
initjs_ = MisoString -> MisoString -> Attribute model action
forall model action.
MisoString -> MisoString -> Attribute model action
textProp MisoString
"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_ = MisoString -> Value -> Attribute model action
forall a model action.
ToJSON a =>
MisoString -> a -> Attribute model action
prop MisoString
"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_ = MisoString -> Bool -> Attribute model action
forall model action. MisoString -> Bool -> Attribute model action
boolProp MisoString
"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. MisoString -> Attribute model action
src_ = MisoString -> MisoString -> Attribute model action
forall model action.
MisoString -> MisoString -> Attribute model action
textProp MisoString
"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_ = MisoString -> Bool -> Attribute model action
forall model action. MisoString -> Bool -> Attribute model action
boolProp MisoString
"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. MisoString -> Attribute model action
webviewType_ = MisoString -> MisoString -> Attribute model action
forall model action.
MisoString -> MisoString -> Attribute model action
textProp MisoString
"webview-type"
-----------------------------------------------------------------------------