-----------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  Miso.Native.Element.Frame.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.Element.Frame.Property
  ( -- *** Property
    src_
  , autoHeight_
  , autoWidth_
  , data_
  , enableMultiAsyncThread_
  , globalProps_
  , presetHeight_
  , presetWidth_
  ) where
----------------------------------------------------------------------------
import           Miso.JSON (Value)
import           Miso.Property
import           Miso.Types
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/frame.html#src
--
-- Sets the loading path for the \<frame\> resource. Supports @http@ / @https@.
--
-- > src_ "http://url-goes-here.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/frame.html#auto-height
--
-- When enabled, the \<frame\> adjusts its height to match the embedded page.
--
-- > autoHeight_ True
--
-- Default Value: 'False'
--
autoHeight_ :: Bool -> Attribute model action
autoHeight_ :: forall model action. Bool -> Attribute model action
autoHeight_ = MisoString -> Bool -> Attribute model action
forall model action. MisoString -> Bool -> Attribute model action
boolProp MisoString
"auto-height"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/frame.html#auto-width
--
-- When enabled, the \<frame\> adjusts its width to match the embedded page.
--
-- > autoWidth_ True
--
-- Default Value: 'False'
--
autoWidth_ :: Bool -> Attribute model action
autoWidth_ :: forall model action. Bool -> Attribute model action
autoWidth_ = MisoString -> Bool -> Attribute model action
forall model action. MisoString -> Bool -> Attribute model action
boolProp MisoString
"auto-width"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/frame.html#data
--
-- Initial data (a JSON object) passed to the embedded \<frame\> page.
--
-- > data_ (object [ "key" .= "value" ])
--
data_ :: Value -> Attribute model action
data_ :: forall model action. Value -> Attribute model action
data_ = MisoString -> Value -> Attribute model action
forall a model action.
ToJSON a =>
MisoString -> a -> Attribute model action
prop MisoString
"data"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/frame.html#enable-multi-async-thread
--
-- Whether the embedded page runs on its own async thread.
--
-- > enableMultiAsyncThread_ True
--
-- Default Value: 'False'
--
enableMultiAsyncThread_ :: Bool -> Attribute model action
enableMultiAsyncThread_ :: forall model action. Bool -> Attribute model action
enableMultiAsyncThread_ = MisoString -> Bool -> Attribute model action
forall model action. MisoString -> Bool -> Attribute model action
boolProp MisoString
"enable-multi-async-thread"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/frame.html#global-props
--
-- Global properties (a JSON object) injected into the embedded \<frame\> page.
--
-- > globalProps_ (object [ "theme" .= "dark" ])
--
globalProps_ :: Value -> Attribute model action
globalProps_ :: forall model action. Value -> Attribute model action
globalProps_ = MisoString -> Value -> Attribute model action
forall a model action.
ToJSON a =>
MisoString -> a -> Attribute model action
prop MisoString
"global-props"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/frame.html#preset-height
--
-- Preset height of the \<frame\> before the embedded page loads, e.g. @\"100px\"@
-- or @\"100rpx\"@.
--
-- > presetHeight_ "100px"
--
presetHeight_ :: MisoString -> Attribute model action
presetHeight_ :: forall model action. MisoString -> Attribute model action
presetHeight_ = MisoString -> MisoString -> Attribute model action
forall model action.
MisoString -> MisoString -> Attribute model action
textProp MisoString
"preset-height"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/frame.html#preset-width
--
-- Preset width of the \<frame\> before the embedded page loads, e.g. @\"100px\"@
-- or @\"100rpx\"@.
--
-- > presetWidth_ "100px"
--
presetWidth_ :: MisoString -> Attribute model action
presetWidth_ :: forall model action. MisoString -> Attribute model action
presetWidth_ = MisoString -> MisoString -> Attribute model action
forall model action.
MisoString -> MisoString -> Attribute model action
textProp MisoString
"preset-width"
-----------------------------------------------------------------------------