From e3ff5045e98a61f9800641746ba4341a3fe89811 Mon Sep 17 00:00:00 2001 From: Anupam Jain Date: Thu, 2 May 2024 16:50:41 +0530 Subject: [PATCH] Add an example of remote widgets --- examples/src/Test/Calc.purs | 65 +- stark/spago.dhall | 25 - stark/src/Concur/Stark.purs | 9 - stark/src/Concur/Stark/DOM.purs | 1038 --------------------------- stark/src/Concur/Stark/Props.purs | 1004 -------------------------- stark/src/Concur/Stark/Run.purs | 14 - stark/src/Concur/Stark/SVG.purs | 118 --- stark/src/Stark.purs | 24 - stark/src/Stark/DOM.purs | 691 ------------------ stark/src/Stark/DOM/Props.purs | 945 ------------------------ stark/src/Stark/DOM/SVG.purs | 116 --- stark/src/Stark/Ref.purs | 53 -- stark/src/Stark/SyntheticEvent.purs | 404 ----------- 13 files changed, 51 insertions(+), 4455 deletions(-) delete mode 100644 stark/spago.dhall delete mode 100644 stark/src/Concur/Stark.purs delete mode 100644 stark/src/Concur/Stark/DOM.purs delete mode 100644 stark/src/Concur/Stark/Props.purs delete mode 100644 stark/src/Concur/Stark/Run.purs delete mode 100644 stark/src/Concur/Stark/SVG.purs delete mode 100644 stark/src/Stark.purs delete mode 100644 stark/src/Stark/DOM.purs delete mode 100644 stark/src/Stark/DOM/Props.purs delete mode 100644 stark/src/Stark/DOM/SVG.purs delete mode 100644 stark/src/Stark/Ref.purs delete mode 100644 stark/src/Stark/SyntheticEvent.purs diff --git a/examples/src/Test/Calc.purs b/examples/src/Test/Calc.purs index 2ce0812..774c127 100644 --- a/examples/src/Test/Calc.purs +++ b/examples/src/Test/Calc.purs @@ -3,9 +3,12 @@ module Test.Calc where import Prelude import Concur.Core (Widget) +import Concur.Core.Patterns (remoteWidget) import Concur.React (HTML) -import Concur.React.DOM (button, text, table', tr', td', tbody') -import Concur.React.Props (onClick) +import Concur.React.DOM as D +import Concur.React.Props as P +import Control.Alt ((<|>)) +import Control.Monad.Rec.Class (forever) import Control.MultiAlternative (orr) import Data.List (List(..), uncons, (:)) import Data.Maybe (Maybe(..)) @@ -16,11 +19,11 @@ data CalculatorAction = Plus | Minus | Times | Div | Enter | Clear | Digit Int -- Button pad widget calcButtonsWidget :: Widget HTML CalculatorAction -calcButtonsWidget = table' $ pure $ tbody' $ - [ tr' [d 7, d 8, d 9, opDiv] - , tr' [d 4, d 5, d 6, opTimes] - , tr' [d 1, d 2, d 3, opMinus] - , tr' [d 0, ent, cls, opPlus] +calcButtonsWidget = D.table' $ pure $ D.tbody' $ + [ D.tr' [d 7, d 8, d 9, opDiv] + , D.tr' [d 4, d 5, d 6, opTimes] + , D.tr' [d 1, d 2, d 3, opMinus] + , D.tr' [d 0, ent, cls, opPlus] ] where d n = but (Digit n) (show n) @@ -30,7 +33,7 @@ calcButtonsWidget = table' $ pure $ tbody' $ opTimes = but Times "*" opMinus = but Minus "-" opPlus = but Plus "+" - but x s = x <$ td' [button [onClick] [text s]] + but x s = x <$ D.td' [D.button [P.onClick] [D.text s]] -- Postfix calculation calc :: List Int -> CalculatorAction -> Tuple (List Int) Int @@ -50,11 +53,45 @@ calc arr axn = case uncons arr, axn of err = Tuple arr 0 new n s = Tuple (n:s) n --- Put everything together +-- We create a display widget that wires everything up +-- It renders the buttons and display in parallel +-- And then handles button input, performs the calculation, and recurses +calcDisplay :: forall a. List Int -> Widget HTML CalculatorAction -> Widget HTML CalculatorAction -> Widget HTML a +calcDisplay st display buttons = do + a <- display <|> buttons + let Tuple st' n = calc st a + calcDisplay st' (D.text (show n)) buttons + +-- Using calcDisplay is pretty easy as can be seen in `calcWidgetStandard` +calcWidgetStandard :: forall a. Widget HTML a +calcWidgetStandard = calcDisplay Nil defaultDisplay calcButtonsWidget + where + defaultDisplay = D.text "Press a button" + +-- But in this example we don't use this "standard" way of doing things + +-- Instead, we show off remote widgets to drive the display +-- This code may seem longer, but it's *sometimes* cleaner to use "action at a distance". +-- It's also very useful to avoid having to rework complex logic. + +-- For example, what if want the buttons to render in a different place, and not right next to the display? +-- By passing the Buttons widget off to calc, we cede control of where it is rendered +-- But remote widgets can help us recover that control calcWidget :: forall a. Widget HTML a -calcWidget = go 0 Nil +calcWidget = do + -- First create a remote widget for the buttons + remoteButtons <- remoteWidget calcButtonsWidget + orr + -- Then we pass only the yield part of the remote buttons to calcDisplay + [ calcDisplay Nil defaultDisplay remoteButtons.yield + -- Meanwhile we render the buttons in a potentially different place + -- Let's give the buttons a subtle background + , D.div [ P.style {background: "beige", width: "fit-content"} ] + -- Note we don't care WHERE or HOW the events from the buttons are being handled + -- We only have to forever keep emmitting events + -- It's a never ending widget that can get information out! + [ forever remoteButtons.render ] + ] where - go n s = do - a <- orr [text (show n), calcButtonsWidget] - let Tuple s' n' = calc s a - go n' s' + defaultDisplay = D.text "This display is controlled by other widgets. GO AHEAD. PRESS A BUTTON." + diff --git a/stark/spago.dhall b/stark/spago.dhall deleted file mode 100644 index 10b5fd2..0000000 --- a/stark/spago.dhall +++ /dev/null @@ -1,25 +0,0 @@ -{- -Welcome to a Spago project! -You can edit this file as you like. --} -{ name = - "concur-stark" -, dependencies = - [ "aff" - , "arrays" - , "avar" - , "console" - , "concur-core" - , "foldable-traversable" - , "free" - , "nonempty" - , "profunctor-lenses" - , "tailrec" - , "web-dom" - , "web-html" - ] -, packages = - ../packages.dhall -, sources = - [ "src/**/*.purs", "test/**/*.purs" ] -} diff --git a/stark/src/Concur/Stark.purs b/stark/src/Concur/Stark.purs deleted file mode 100644 index 275230b..0000000 --- a/stark/src/Concur/Stark.purs +++ /dev/null @@ -1,9 +0,0 @@ -module Concur.Stark where - -import Stark (StarkElement) - -type HTML - = Array StarkElement - --- renderComponent :: forall a. Widget HTML a -> R.StarkElement --- renderComponent init = diff --git a/stark/src/Concur/Stark/DOM.purs b/stark/src/Concur/Stark/DOM.purs deleted file mode 100644 index e6ac695..0000000 --- a/stark/src/Concur/Stark/DOM.purs +++ /dev/null @@ -1,1038 +0,0 @@ -module Concur.Stark.DOM where - -import Prelude hiding (div,map,sub) - -import Concur.Core.DOM (el, el', elLeaf) as CD -import Concur.Core.LiftWidget (class LiftWidget, liftWidget) -import Concur.Core.Props (Props) -import Concur.Core.Types (Widget, display) -import Concur.Stark (HTML) -import Concur.Stark.Props (StarkProps) -import Control.MultiAlternative (class MultiAlternative) -import Control.ShiftMap (class ShiftMap) -import Stark.DOM as D - --- | The Stark backend uses Array to make view monoidal --- | We use this view adapter to derive our specialised `el` functions -viewAdapter - :: forall ps vs res - . (ps -> vs -> res) - -> (ps -> vs -> Array res) -viewAdapter f = \ps vs -> [f ps vs] - -el - :: forall m a p v - . ShiftMap (Widget (Array v)) m - => (Array p -> Array v -> v) - -> Array (Props p a) - -> m a - -> m a -el f = CD.el (viewAdapter f) - -el' - :: forall m a p v - . ShiftMap (Widget (Array v)) m - => MultiAlternative m - => (Array p -> Array v -> v) - -> Array (Props p a) - -> Array (m a) - -> m a -el' f = CD.el' (viewAdapter f) - -elLeaf - :: forall p v m a - . LiftWidget (Array v) m - => (Array p -> v) - -> Array (Props p a) - -> m a -elLeaf f = CD.elLeaf (\ps -> [f ps]) - --- Wrappers for all DOM elements from purescript-react --- TODO: Generate these mechanically somehow -type El1 - = forall m a. ShiftMap (Widget HTML) m => Array (StarkProps a) -> m a -> m a - -type El - = forall m a. MultiAlternative m => ShiftMap (Widget HTML) m => Array (StarkProps a) -> Array (m a) -> m a - -type El' - = forall m a. MultiAlternative m => ShiftMap (Widget HTML) m => Array (m a) -> m a - -type ElLeaf - = forall m a. LiftWidget HTML m => Array (StarkProps a) -> m a - -type ElLeaf' - = forall m a. LiftWidget HTML m => m a - -type ElLeafFunc' x - = forall m a. LiftWidget HTML m => x -> m a - -------------------------------------------------------------------------------------------------------------------- -text :: ElLeafFunc' String -text str = liftWidget $ display [D.text str] - -int :: ElLeafFunc' Int -int x = liftWidget $ display [D.int x] - -number :: ElLeafFunc' Number -number x = liftWidget $ display [D.number x] - -a_ :: El1 -a_ = el D.a - -a :: El -a = el' D.a - -a' :: El' -a' = a [] - -abbr_ :: El1 -abbr_ = el D.abbr - -abbr :: El -abbr = el' D.abbr - -abbr' :: El' -abbr' = abbr [] - -address_ :: El1 -address_ = el D.address - -address :: El -address = el' D.address - -address' :: El' -address' = address [] - -area :: ElLeaf -area = elLeaf D.area - -area' :: ElLeaf' -area' = area [] - -article_ :: El1 -article_ = el D.article - -article :: El -article = el' D.article - -article' :: El' -article' = article [] - -aside_ :: El1 -aside_ = el D.aside - -aside :: El -aside = el' D.aside - -aside' :: El' -aside' = aside [] - -audio_ :: El1 -audio_ = el D.audio - -audio :: El -audio = el' D.audio - -audio' :: El' -audio' = audio [] - -b_ :: El1 -b_ = el D.b - -b :: El -b = el' D.b - -b' :: El' -b' = b [] - -base :: ElLeaf -base = elLeaf D.base - -base' :: ElLeaf' -base' = base [] - -bdi_ :: El1 -bdi_ = el D.bdi - -bdi :: El -bdi = el' D.bdi - -bdi' :: El' -bdi' = bdi [] - -bdo_ :: El1 -bdo_ = el D.bdo - -bdo :: El -bdo = el' D.bdo - -bdo' :: El' -bdo' = bdo [] - -big_ :: El1 -big_ = el D.big - -big :: El -big = el' D.big - -big' :: El' -big' = big [] - -blockquote_ :: El1 -blockquote_ = el D.blockquote - -blockquote :: El -blockquote = el' D.blockquote - -blockquote' :: El' -blockquote' = blockquote [] - -body_ :: El1 -body_ = el D.body - -body :: El -body = el' D.body - -body' :: El' -body' = body [] - -br :: ElLeaf -br = elLeaf D.br - -br' :: ElLeaf' -br' = br [] - -button_ :: El1 -button_ = el D.button - -button :: El -button = el' D.button - -button' :: El' -button' = button [] - -canvas_ :: El1 -canvas_ = el D.canvas - -canvas :: El -canvas = el' D.canvas - -canvas' :: El' -canvas' = canvas [] - -caption_ :: El1 -caption_ = el D.caption - -caption :: El -caption = el' D.caption - -caption' :: El' -caption' = caption [] - -cite_ :: El1 -cite_ = el D.cite - -cite :: El -cite = el' D.cite - -cite' :: El' -cite' = cite [] - -code_ :: El1 -code_ = el D.code - -code :: El -code = el' D.code - -code' :: El' -code' = code [] - -col :: ElLeaf -col = elLeaf D.col - -col' :: ElLeaf' -col' = col [] - -colgroup_ :: El1 -colgroup_ = el D.colgroup - -colgroup :: El -colgroup = el' D.colgroup - -colgroup' :: El' -colgroup' = colgroup [] - -_data_ :: El1 -_data_ = el D._data - -_data :: El -_data = el' D._data - -_data' :: El' -_data' = _data [] - -datalist_ :: El1 -datalist_ = el D.datalist - -datalist :: El -datalist = el' D.datalist - -datalist' :: El' -datalist' = datalist [] - -dd_ :: El1 -dd_ = el D.dd - -dd :: El -dd = el' D.dd - -dd' :: El' -dd' = dd [] - -del_ :: El1 -del_ = el D.del - -del :: El -del = el' D.del - -del' :: El' -del' = del [] - -details_ :: El1 -details_ = el D.details - -details :: El -details = el' D.details - -details' :: El' -details' = details [] - -dfn_ :: El1 -dfn_ = el D.dfn - -dfn :: El -dfn = el' D.dfn - -dfn' :: El' -dfn' = dfn [] - -dialog_ :: El1 -dialog_ = el D.dialog - -dialog :: El -dialog = el' D.dialog - -dialog' :: El' -dialog' = dialog [] - -div_ :: El1 -div_ = el D.div - -div :: El -div = el' D.div - -div' :: El' -div' = div [] - -dl_ :: El1 -dl_ = el D.dl - -dl :: El -dl = el' D.dl - -dl' :: El' -dl' = dl [] - -dt_ :: El1 -dt_ = el D.dt - -dt :: El -dt = el' D.dt - -dt' :: El' -dt' = dt [] - -em_ :: El1 -em_ = el D.em - -em :: El -em = el' D.em - -em' :: El' -em' = em [] - -embed :: ElLeaf -embed = elLeaf D.embed - -embed' :: ElLeaf' -embed' = embed [] - -fieldset_ :: El1 -fieldset_ = el D.fieldset - -fieldset :: El -fieldset = el' D.fieldset - -fieldset' :: El' -fieldset' = fieldset [] - -figcaption_ :: El1 -figcaption_ = el D.figcaption - -figcaption :: El -figcaption = el' D.figcaption - -figcaption' :: El' -figcaption' = figcaption [] - -figure_ :: El1 -figure_ = el D.figure - -figure :: El -figure = el' D.figure - -figure' :: El' -figure' = figure [] - -footer_ :: El1 -footer_ = el D.footer - -footer :: El -footer = el' D.footer - -footer' :: El' -footer' = footer [] - -form_ :: El1 -form_ = el D.form - -form :: El -form = el' D.form - -form' :: El' -form' = form [] - -h1_ :: El1 -h1_ = el D.h1 - -h1 :: El -h1 = el' D.h1 - -h1' :: El' -h1' = h1 [] - -h2_ :: El1 -h2_ = el D.h2 - -h2 :: El -h2 = el' D.h2 - -h2' :: El' -h2' = h2 [] - -h3_ :: El1 -h3_ = el D.h3 - -h3 :: El -h3 = el' D.h3 - -h3' :: El' -h3' = h3 [] - -h4_ :: El1 -h4_ = el D.h4 - -h4 :: El -h4 = el' D.h4 - -h4' :: El' -h4' = h4 [] - -h5_ :: El1 -h5_ = el D.h5 - -h5 :: El -h5 = el' D.h5 - -h5' :: El' -h5' = h5 [] - -h6_ :: El1 -h6_ = el D.h6 - -h6 :: El -h6 = el' D.h6 - -h6' :: El' -h6' = h6 [] - -head_ :: El1 -head_ = el D.head - -head :: El -head = el' D.head - -head' :: El' -head' = head [] - -header_ :: El1 -header_ = el D.header - -header :: El -header = el' D.header - -header' :: El' -header' = header [] - -hr :: ElLeaf -hr = elLeaf D.hr - -hr' :: ElLeaf' -hr' = hr [] - -html_ :: El1 -html_ = el D.html - -html :: El -html = el' D.html - -html' :: El' -html' = html [] - -i_ :: El1 -i_ = el D.i - -i :: El -i = el' D.i - -i' :: El' -i' = i [] - -iframe_ :: El1 -iframe_ = el D.iframe - -iframe :: El -iframe = el' D.iframe - -iframe' :: El' -iframe' = iframe [] - -img :: ElLeaf -img = elLeaf D.img - -img' :: ElLeaf' -img' = img [] - -input :: ElLeaf -input = elLeaf D.input - -input' :: ElLeaf' -input' = input [] - -ins_ :: El1 -ins_ = el D.ins - -ins :: El -ins = el' D.ins - -ins' :: El' -ins' = ins [] - -kbd_ :: El1 -kbd_ = el D.kbd - -kbd :: El -kbd = el' D.kbd - -kbd' :: El' -kbd' = kbd [] - -keygen :: ElLeaf -keygen = elLeaf D.keygen - -keygen' :: ElLeaf' -keygen' = keygen [] - -label_ :: El1 -label_ = el D.label - -label :: El -label = el' D.label - -label' :: El' -label' = label [] - -legend_ :: El1 -legend_ = el D.legend - -legend :: El -legend = el' D.legend - -legend' :: El' -legend' = legend [] - -li_ :: El1 -li_ = el D.li - -li :: El -li = el' D.li - -li' :: El' -li' = li [] - -link :: ElLeaf -link = elLeaf D.link - -link' :: ElLeaf' -link' = link [] - -main_ :: El1 -main_ = el D.main - -main :: El -main = el' D.main - -main' :: El' -main' = main [] - -_map_ :: El1 -_map_ = el D.map - -_map :: El -_map = el' D.map - -_map' :: El' -_map' = _map [] - -mark_ :: El1 -mark_ = el D.mark - -mark :: El -mark = el' D.mark - -mark' :: El' -mark' = mark [] - -menu_ :: El1 -menu_ = el D.menu - -menu :: El -menu = el' D.menu - -menu' :: El' -menu' = menu [] - -menuitem :: ElLeaf -menuitem = elLeaf D.menuitem - -menuitem' :: ElLeaf' -menuitem' = menuitem [] - -meta :: ElLeaf -meta = elLeaf D.meta - -meta' :: ElLeaf' -meta' = meta [] - -meter_ :: El1 -meter_ = el D.meter - -meter :: El -meter = el' D.meter - -meter' :: El' -meter' = meter [] - -nav_ :: El1 -nav_ = el D.nav - -nav :: El -nav = el' D.nav - -nav' :: El' -nav' = nav [] - -noscript_ :: El1 -noscript_ = el D.noscript - -noscript :: El -noscript = el' D.noscript - -noscript' :: El' -noscript' = noscript [] - -object_ :: El1 -object_ = el D.object - -object :: El -object = el' D.object - -object' :: El' -object' = object [] - -ol_ :: El1 -ol_ = el D.ol - -ol :: El -ol = el' D.ol - -ol' :: El' -ol' = ol [] - -optgroup_ :: El1 -optgroup_ = el D.optgroup - -optgroup :: El -optgroup = el' D.optgroup - -optgroup' :: El' -optgroup' = optgroup [] - -option_ :: El1 -option_ = el D.option - -option :: El -option = el' D.option - -option' :: El' -option' = option [] - -output_ :: El1 -output_ = el D.output - -output :: El -output = el' D.output - -output' :: El' -output' = output [] - -p_ :: El1 -p_ = el D.p - -p :: El -p = el' D.p - -p' :: El' -p' = p [] - -param :: ElLeaf -param = elLeaf D.param - -param' :: ElLeaf' -param' = param [] - -picture_ :: El1 -picture_ = el D.picture - -picture :: El -picture = el' D.picture - -picture' :: El' -picture' = picture [] - -pre_ :: El1 -pre_ = el D.pre - -pre :: El -pre = el' D.pre - -pre' :: El' -pre' = pre [] - -progress_ :: El1 -progress_ = el D.progress - -progress :: El -progress = el' D.progress - -progress' :: El' -progress' = progress [] - -q_ :: El1 -q_ = el D.q - -q :: El -q = el' D.q - -q' :: El' -q' = q [] - -rp_ :: El1 -rp_ = el D.rp - -rp :: El -rp = el' D.rp - -rp' :: El' -rp' = rp [] - -rt_ :: El1 -rt_ = el D.rt - -rt :: El -rt = el' D.rt - -rt' :: El' -rt' = rt [] - -ruby_ :: El1 -ruby_ = el D.ruby - -ruby :: El -ruby = el' D.ruby - -ruby' :: El' -ruby' = ruby [] - -s_ :: El1 -s_ = el D.s - -s :: El -s = el' D.s - -s' :: El' -s' = s [] - -samp_ :: El1 -samp_ = el D.samp - -samp :: El -samp = el' D.samp - -samp' :: El' -samp' = samp [] - -script_ :: El1 -script_ = el D.script - -script :: El -script = el' D.script - -script' :: El' -script' = script [] - -section_ :: El1 -section_ = el D.section - -section :: El -section = el' D.section - -section' :: El' -section' = section [] - -select_ :: El1 -select_ = el D.select - -select :: El -select = el' D.select - -select' :: El' -select' = select [] - -small_ :: El1 -small_ = el D.small - -small :: El -small = el' D.small - -small' :: El' -small' = small [] - -source :: ElLeaf -source = elLeaf D.source - -source' :: ElLeaf' -source' = source [] - -span_ :: El1 -span_ = el D.span - -span :: El -span = el' D.span - -span' :: El' -span' = span [] - -strong_ :: El1 -strong_ = el D.strong - -strong :: El -strong = el' D.strong - -strong' :: El' -strong' = strong [] - -style_ :: El1 -style_ = el D.style - -style :: El -style = el' D.style - -style' :: El' -style' = style [] - -sub_ :: El1 -sub_ = el D.sub - -sub :: El -sub = el' D.sub - -sub' :: El' -sub' = sub [] - -summary_ :: El1 -summary_ = el D.summary - -summary :: El -summary = el' D.summary - -summary' :: El' -summary' = summary [] - -sup_ :: El1 -sup_ = el D.sup - -sup :: El -sup = el' D.sup - -sup' :: El' -sup' = sup [] - -table_ :: El1 -table_ = el D.table - -table :: El -table = el' D.table - -table' :: El' -table' = table [] - -tbody_ :: El1 -tbody_ = el D.tbody - -tbody :: El -tbody = el' D.tbody - -tbody' :: El' -tbody' = tbody [] - -td_ :: El1 -td_ = el D.td - -td :: El -td = el' D.td - -td' :: El' -td' = td [] - -textarea_ :: El1 -textarea_ = el D.textarea - -textarea :: El -textarea = el' D.textarea - -textarea' :: El' -textarea' = textarea [] - -tfoot_ :: El1 -tfoot_ = el D.tfoot - -tfoot :: El -tfoot = el' D.tfoot - -tfoot' :: El' -tfoot' = tfoot [] - -th_ :: El1 -th_ = el D.th - -th :: El -th = el' D.th - -th' :: El' -th' = th [] - -thead_ :: El1 -thead_ = el D.thead - -thead :: El -thead = el' D.thead - -thead' :: El' -thead' = thead [] - -time_ :: El1 -time_ = el D.time - -time :: El -time = el' D.time - -time' :: El' -time' = time [] - -title_ :: El1 -title_ = el D.title - -title :: El -title = el' D.title - -title' :: El' -title' = title [] - -tr_ :: El1 -tr_ = el D.tr - -tr :: El -tr = el' D.tr - -tr' :: El' -tr' = tr [] - -track :: ElLeaf -track = elLeaf D.track - -track' :: ElLeaf' -track' = track [] - -u_ :: El1 -u_ = el D.u - -u :: El -u = el' D.u - -u' :: El' -u' = u [] - -ul_ :: El1 -ul_ = el D.ul - -ul :: El -ul = el' D.ul - -ul' :: El' -ul' = ul [] - -var_ :: El1 -var_ = el D.var - -var :: El -var = el' D.var - -var' :: El' -var' = var [] - -video_ :: El1 -video_ = el D.video - -video :: El -video = el' D.video - -video' :: El' -video' = video [] - -wbr :: ElLeaf -wbr = elLeaf D.wbr - -wbr' :: ElLeaf' -wbr' = wbr [] diff --git a/stark/src/Concur/Stark/Props.purs b/stark/src/Concur/Stark/Props.purs deleted file mode 100644 index e29c3e7..0000000 --- a/stark/src/Concur/Stark/Props.purs +++ /dev/null @@ -1,1004 +0,0 @@ -module Concur.Stark.Props where - -import Prelude - -import Concur.Core.Props (Props(..), filterProp) -import Data.Array (concatMap, intercalate) -import Data.Maybe (Maybe, maybe) -import Effect.Uncurried (mkEffectFn1) -import Stark.Ref as Ref -import Stark.DOM.Props as P -import Stark.SyntheticEvent - ( SyntheticAnimationEvent - , SyntheticClipboardEvent - , SyntheticCompositionEvent - , SyntheticEvent - , SyntheticEvent_ - , SyntheticFocusEvent - , SyntheticInputEvent - , SyntheticKeyboardEvent - , SyntheticMouseEvent - , SyntheticTouchEvent - , SyntheticTransitionEvent - , SyntheticUIEvent - , SyntheticWheelEvent - ) -import Unsafe.Coerce (unsafeCoerce) - --- emptyProp_ :: P.Props --- emptyProp_ = P.Props - -type StarkProps a = Props P.Props a - --- emptyProp :: forall a. StarkProps a --- emptyProp = PrimProp emptyProp_ - --- | Construct a custom prop handler -unsafeMkPropHandler :: - forall a. - String -> - StarkProps a -unsafeMkPropHandler s = Handler \f -> - P.unsafeMkProps s (mkEffectFn1 f) - --- | Construct a custom key value prop -unsafeMkProp :: - forall a b. - String -> - a -> - StarkProps b -unsafeMkProp s v = PrimProp (P.unsafeMkProps s v) - --- | Shortcut for the common case of a list of classes -classList :: - forall a. - Array (Maybe String) -> - StarkProps a -classList = className <<< intercalate " " <<< concatMap (maybe [] (\s -> - [s])) - --- FFI + Util stuff --- | Get the event target's current value --- | HACK: This is brittle thanks to Stark's event object reuse! --- | Safest is to use it directly on the prop like `unsafeTargetValue <$> onKeyDown` -unsafeTargetValue :: - forall r. - SyntheticEvent_ r -> - String -unsafeTargetValue e = (unsafeCoerce e).target.value - --- | Check if a keyboard event was Enter -isEnterEvent :: - SyntheticKeyboardEvent -> - Boolean -isEnterEvent e = e'.which == 13 || e'.keyCode == 13 - where - e' = unsafeCoerce e - --- | IMPORTANT: UNSAFE: It's unsafe to use this outside this module --- foreign import resetTargetValue :: forall event. String -> event -> Effect Unit - --- The Standard Set of Props -aria :: - forall ariaAttrs a. - { | ariaAttrs} -> - StarkProps a -aria = PrimProp <<< P.aria - -_data :: forall dataAttrs a. { | dataAttrs} -> StarkProps a -_data = PrimProp <<< P._data - -style :: forall style a. { | style} -> StarkProps a -style = PrimProp <<< P.style - -dangerouslySetInnerHTML :: forall a. {__html :: String} -> StarkProps a -dangerouslySetInnerHTML = PrimProp <<< P.dangerouslySetInnerHTML - -accept :: forall a. String -> StarkProps a -accept = PrimProp <<< P.accept - -acceptCharset :: forall a. String -> StarkProps a -acceptCharset = PrimProp <<< P.acceptCharset - -accessKey :: forall a. String -> StarkProps a -accessKey = PrimProp <<< P.accessKey - -action :: forall a. String -> StarkProps a -action = PrimProp <<< P.action - -allowFullScreen :: forall a. Boolean -> StarkProps a -allowFullScreen = PrimProp <<< P.allowFullScreen - -allowTransparency :: forall a. Boolean -> StarkProps a -allowTransparency = PrimProp <<< P.allowTransparency - -alt :: forall a. String -> StarkProps a -alt = PrimProp <<< P.alt - -async :: forall a. Boolean -> StarkProps a -async = PrimProp <<< P.async - -autoComplete :: forall a. String -> StarkProps a -autoComplete = PrimProp <<< P.autoComplete - -autoFocus :: forall a. Boolean -> StarkProps a -autoFocus = PrimProp <<< P.autoFocus - -autoPlay :: forall a. Boolean -> StarkProps a -autoPlay = PrimProp <<< P.autoPlay - -capture :: forall a. Boolean -> StarkProps a -capture = PrimProp <<< P.capture - -cellPadding :: forall a. String -> StarkProps a -cellPadding = PrimProp <<< P.cellPadding - -cellSpacing :: forall a. String -> StarkProps a -cellSpacing = PrimProp <<< P.cellSpacing - -charSet :: forall a. String -> StarkProps a -charSet = PrimProp <<< P.charSet - -challenge :: forall a. String -> StarkProps a -challenge = PrimProp <<< P.challenge - -checked :: forall a. Boolean -> StarkProps a -checked = PrimProp <<< P.checked - -cite :: forall a. String -> StarkProps a -cite = PrimProp <<< P.cite - -classID :: forall a. String -> StarkProps a -classID = PrimProp <<< P.classID - -className :: forall a. String -> StarkProps a -className = PrimProp <<< P.className - -cols :: forall a. Int -> StarkProps a -cols = PrimProp <<< P.cols - -colSpan :: forall a. Int -> StarkProps a -colSpan = PrimProp <<< P.colSpan - -content :: forall a. String -> StarkProps a -content = PrimProp <<< P.content - -contentEditable :: forall a. Boolean -> StarkProps a -contentEditable = PrimProp <<< P.contentEditable - -contextMenu :: forall a. String -> StarkProps a -contextMenu = PrimProp <<< P.contextMenu - -controls :: forall a. Boolean -> StarkProps a -controls = PrimProp <<< P.controls - -coords :: forall a. String -> StarkProps a -coords = PrimProp <<< P.coords - -crossOrigin :: forall a. String -> StarkProps a -crossOrigin = PrimProp <<< P.crossOrigin - -dateTime :: forall a. String -> StarkProps a -dateTime = PrimProp <<< P.dateTime - -default :: forall a. Boolean -> StarkProps a -default = PrimProp <<< P.default - -defaultChecked :: forall a. Boolean -> StarkProps a -defaultChecked = PrimProp <<< P.defaultChecked - -defaultValue :: forall a. String -> StarkProps a -defaultValue = PrimProp <<< P.defaultValue - -defer :: forall a. Boolean -> StarkProps a -defer = PrimProp <<< P.defer - -dir :: forall a. String -> StarkProps a -dir = PrimProp <<< P.dir - -disabled :: forall a. Boolean -> StarkProps a -disabled = PrimProp <<< P.disabled - -download :: forall a. String -> StarkProps a -download = PrimProp <<< P.download - -draggable :: forall a. Boolean -> StarkProps a -draggable = PrimProp <<< P.draggable - -encType :: forall a. String -> StarkProps a -encType = PrimProp <<< P.encType - -form :: forall a. String -> StarkProps a -form = PrimProp <<< P.form - -formAction :: forall a. String -> StarkProps a -formAction = PrimProp <<< P.formAction - -formEncType :: forall a. String -> StarkProps a -formEncType = PrimProp <<< P.formEncType - -formMethod :: forall a. String -> StarkProps a -formMethod = PrimProp <<< P.formMethod - -formNoValidate :: forall a. Boolean -> StarkProps a -formNoValidate = PrimProp <<< P.formNoValidate - -formTarget :: forall a. String -> StarkProps a -formTarget = PrimProp <<< P.formTarget - -frameBorder :: forall a. String -> StarkProps a -frameBorder = PrimProp <<< P.frameBorder - -headers :: forall a. String -> StarkProps a -headers = PrimProp <<< P.headers - -height :: forall a. String -> StarkProps a -height = PrimProp <<< P.height - -hidden :: forall a. Boolean -> StarkProps a -hidden = PrimProp <<< P.hidden - -high :: forall a. String -> StarkProps a -high = PrimProp <<< P.high - -href :: forall a. String -> StarkProps a -href = PrimProp <<< P.href - -hrefLang :: forall a. String -> StarkProps a -hrefLang = PrimProp <<< P.hrefLang - -htmlFor :: forall a. String -> StarkProps a -htmlFor = PrimProp <<< P.htmlFor - -httpEquiv :: forall a. String -> StarkProps a -httpEquiv = PrimProp <<< P.httpEquiv - -icon :: forall a. String -> StarkProps a -icon = PrimProp <<< P.icon - -_id :: forall a. String -> StarkProps a -_id = PrimProp <<< P._id - -inputMode :: forall a. String -> StarkProps a -inputMode = PrimProp <<< P.inputMode - -integrity :: forall a. String -> StarkProps a -integrity = PrimProp <<< P.integrity - -is :: forall a. String -> StarkProps a -is = PrimProp <<< P.is - -key :: forall a. String -> StarkProps a -key = PrimProp <<< P.key - -keyParams :: forall a. String -> StarkProps a -keyParams = PrimProp <<< P.keyParams - -keyType :: forall a. String -> StarkProps a -keyType = PrimProp <<< P.keyType - -kind :: forall a. String -> StarkProps a -kind = PrimProp <<< P.kind - -label :: forall a. String -> StarkProps a -label = PrimProp <<< P.label - -lang :: forall a. String -> StarkProps a -lang = PrimProp <<< P.lang - -list :: forall a. String -> StarkProps a -list = PrimProp <<< P.list - -loop :: forall a. Boolean -> StarkProps a -loop = PrimProp <<< P.loop - -low :: forall a. String -> StarkProps a -low = PrimProp <<< P.low - -manifest :: forall a. String -> StarkProps a -manifest = PrimProp <<< P.manifest - -marginHeight :: forall a. String -> StarkProps a -marginHeight = PrimProp <<< P.marginHeight - -marginWidth :: forall a. String -> StarkProps a -marginWidth = PrimProp <<< P.marginWidth - -max :: forall a. String -> StarkProps a -max = PrimProp <<< P.max - -maxLength :: forall a. String -> StarkProps a -maxLength = PrimProp <<< P.maxLength - -media :: forall a. String -> StarkProps a -media = PrimProp <<< P.media - -mediaGroup :: forall a. String -> StarkProps a -mediaGroup = PrimProp <<< P.mediaGroup - -method :: forall a. String -> StarkProps a -method = PrimProp <<< P.method - -min :: forall a. String -> StarkProps a -min = PrimProp <<< P.min - -minLength :: forall a. String -> StarkProps a -minLength = PrimProp <<< P.minLength - -multiple :: forall a. Boolean -> StarkProps a -multiple = PrimProp <<< P.multiple - -muted :: forall a. Boolean -> StarkProps a -muted = PrimProp <<< P.muted - -name :: forall a. String -> StarkProps a -name = PrimProp <<< P.name - -nonce :: forall a. String -> StarkProps a -nonce = PrimProp <<< P.nonce - -noValidate :: forall a. Boolean -> StarkProps a -noValidate = PrimProp <<< P.noValidate - -open :: forall a. Boolean -> StarkProps a -open = PrimProp <<< P.open - -optimum :: forall a. String -> StarkProps a -optimum = PrimProp <<< P.optimum - -pattern :: forall a. String -> StarkProps a -pattern = PrimProp <<< P.pattern - -placeholder :: forall a. String -> StarkProps a -placeholder = PrimProp <<< P.placeholder - -poster :: forall a. String -> StarkProps a -poster = PrimProp <<< P.poster - -preload :: forall a. String -> StarkProps a -preload = PrimProp <<< P.preload - -profile :: forall a. String -> StarkProps a -profile = PrimProp <<< P.profile - -radioGroup :: forall a. String -> StarkProps a -radioGroup = PrimProp <<< P.radioGroup - -readOnly :: forall a. Boolean -> StarkProps a -readOnly = PrimProp <<< P.readOnly - -rel :: forall a. String -> StarkProps a -rel = PrimProp <<< P.rel - -required :: forall a. Boolean -> StarkProps a -required = PrimProp <<< P.required - -reversed :: forall a. Boolean -> StarkProps a -reversed = PrimProp <<< P.reversed - -role :: forall a. String -> StarkProps a -role = PrimProp <<< P.role - -rows :: forall a. Int -> StarkProps a -rows = PrimProp <<< P.rows - -rowSpan :: forall a. Int -> StarkProps a -rowSpan = PrimProp <<< P.rowSpan - -sandbox :: forall a. String -> StarkProps a -sandbox = PrimProp <<< P.sandbox - -scope :: forall a. String -> StarkProps a -scope = PrimProp <<< P.scope - -scoped :: forall a. Boolean -> StarkProps a -scoped = PrimProp <<< P.scoped - -scrolling :: forall a. String -> StarkProps a -scrolling = PrimProp <<< P.scrolling - -seamless :: forall a. Boolean -> StarkProps a -seamless = PrimProp <<< P.seamless - -selected :: forall a. Boolean -> StarkProps a -selected = PrimProp <<< P.selected - -shape :: forall a. String -> StarkProps a -shape = PrimProp <<< P.shape - -size :: forall a. Int -> StarkProps a -size = PrimProp <<< P.size - -sizes :: forall a. String -> StarkProps a -sizes = PrimProp <<< P.sizes - -span :: forall a. Int -> StarkProps a -span = PrimProp <<< P.span - -spellCheck :: forall a. Boolean -> StarkProps a -spellCheck = PrimProp <<< P.spellCheck - -src :: forall a. String -> StarkProps a -src = PrimProp <<< P.src - -srcDoc :: forall a. String -> StarkProps a -srcDoc = PrimProp <<< P.srcDoc - -srcLang :: forall a. String -> StarkProps a -srcLang = PrimProp <<< P.srcLang - -srcSet :: forall a. String -> StarkProps a -srcSet = PrimProp <<< P.srcSet - -start :: forall a. Int -> StarkProps a -start = PrimProp <<< P.start - -step :: forall a. String -> StarkProps a -step = PrimProp <<< P.step - -summary :: forall a. String -> StarkProps a -summary = PrimProp <<< P.summary - -tabIndex :: forall a. Int -> StarkProps a -tabIndex = PrimProp <<< P.tabIndex - -target :: forall a. String -> StarkProps a -target = PrimProp <<< P.target - -title :: forall a. String -> StarkProps a -title = PrimProp <<< P.title - -_type :: forall a. String -> StarkProps a -_type = PrimProp <<< P._type - -useMap :: forall a. String -> StarkProps a -useMap = PrimProp <<< P.useMap - -value :: forall a. String -> StarkProps a -value = PrimProp <<< P.value - -valueArray :: forall a. Array String -> StarkProps a -valueArray = PrimProp <<< P.valueArray - -width :: forall a. String -> StarkProps a -width = PrimProp <<< P.width - -wmode :: forall a. String -> StarkProps a -wmode = PrimProp <<< P.wmode - -wrap :: forall a. String -> StarkProps a -wrap = PrimProp <<< P.wrap - --- RDFa Attributes -about :: - forall a. - String -> - StarkProps a -about = PrimProp <<< P.about - -datatype :: forall a. String -> StarkProps a -datatype = PrimProp <<< P.datatype - -inlist :: forall a. String -> StarkProps a -inlist = PrimProp <<< P.inlist - -prefix :: forall a. String -> StarkProps a -prefix = PrimProp <<< P.prefix - -property :: forall a. String -> StarkProps a -property = PrimProp <<< P.property - -resource :: forall a. String -> StarkProps a -resource = PrimProp <<< P.resource - -typeof :: forall a. String -> StarkProps a -typeof = PrimProp <<< P.typeof - -vocab :: forall a. String -> StarkProps a -vocab = PrimProp <<< P.vocab - --- Non-standard Attributes -autoCapitalize :: - forall a. - String -> - StarkProps a -autoCapitalize = PrimProp <<< P.autoCapitalize - -autoCorrect :: forall a. String -> StarkProps a -autoCorrect = PrimProp <<< P.autoCorrect - -autoSave :: forall a. String -> StarkProps a -autoSave = PrimProp <<< P.autoSave - -color :: forall a. String -> StarkProps a -color = PrimProp <<< P.color - -itemProp :: forall a. String -> StarkProps a -itemProp = PrimProp <<< P.itemProp - -itemScope :: forall a. Boolean -> StarkProps a -itemScope = PrimProp <<< P.itemScope - -itemType :: forall a. String -> StarkProps a -itemType = PrimProp <<< P.itemType - -itemID :: forall a. String -> StarkProps a -itemID = PrimProp <<< P.itemID - -itemRef :: forall a. String -> StarkProps a -itemRef = PrimProp <<< P.itemRef - -results :: forall a. Int -> StarkProps a -results = PrimProp <<< P.results - -security :: forall a. String -> StarkProps a -security = PrimProp <<< P.security - -unselectable :: forall a. Boolean -> StarkProps a -unselectable = PrimProp <<< P.unselectable - -onAnimationStart :: StarkProps SyntheticAnimationEvent -onAnimationStart = Handler P.onAnimationStart - -onAnimationEnd :: StarkProps SyntheticAnimationEvent -onAnimationEnd = Handler P.onAnimationEnd - -onAnimationIteration :: StarkProps SyntheticAnimationEvent -onAnimationIteration = Handler P.onAnimationIteration - -onTransitionEnd :: StarkProps SyntheticTransitionEvent -onTransitionEnd = Handler P.onTransitionEnd - -onToggle :: StarkProps SyntheticEvent -onToggle = Handler P.onToggle - -onError :: StarkProps SyntheticEvent -onError = Handler P.onError - -onLoad :: StarkProps SyntheticEvent -onLoad = Handler P.onLoad - -onAbort :: StarkProps SyntheticEvent -onAbort = Handler P.onAbort - -onCanPlay :: StarkProps SyntheticEvent -onCanPlay = Handler P.onCanPlay - -onCanPlayThrough :: StarkProps SyntheticEvent -onCanPlayThrough = Handler P.onCanPlayThrough - -onDurationChange :: StarkProps SyntheticEvent -onDurationChange = Handler P.onDurationChange - -onEmptied :: StarkProps SyntheticEvent -onEmptied = Handler P.onEmptied - -onEncrypted :: StarkProps SyntheticEvent -onEncrypted = Handler P.onEncrypted - -onEnded :: StarkProps SyntheticEvent -onEnded = Handler P.onEnded - -onLoadedData :: StarkProps SyntheticEvent -onLoadedData = Handler P.onLoadedData - -onLoadedMetadata :: StarkProps SyntheticEvent -onLoadedMetadata = Handler P.onLoadedMetadata - -onLoadStart :: StarkProps SyntheticEvent -onLoadStart = Handler P.onLoadStart - -onPause :: StarkProps SyntheticEvent -onPause = Handler P.onPause - -onPlay :: StarkProps SyntheticEvent -onPlay = Handler P.onPlay - -onPlaying :: StarkProps SyntheticEvent -onPlaying = Handler P.onPlaying - -onProgress :: StarkProps SyntheticEvent -onProgress = Handler P.onProgress - -onRateChange :: StarkProps SyntheticEvent -onRateChange = Handler P.onRateChange - -onSeeked :: StarkProps SyntheticEvent -onSeeked = Handler P.onSeeked - -onSeeking :: StarkProps SyntheticEvent -onSeeking = Handler P.onSeeking - -onStalled :: StarkProps SyntheticEvent -onStalled = Handler P.onStalled - -onSuspend :: StarkProps SyntheticEvent -onSuspend = Handler P.onSuspend - -onTimeUpdate :: StarkProps SyntheticEvent -onTimeUpdate = Handler P.onTimeUpdate - -onVolumeChange :: StarkProps SyntheticEvent -onVolumeChange = Handler P.onVolumeChange - -onWaiting :: StarkProps SyntheticEvent -onWaiting = Handler P.onWaiting - -onCopy :: StarkProps SyntheticClipboardEvent -onCopy = Handler P.onCopy - -onCut :: StarkProps SyntheticClipboardEvent -onCut = Handler P.onCut - -onPaste :: StarkProps SyntheticClipboardEvent -onPaste = Handler P.onPaste - -onCompositionEnd :: StarkProps SyntheticCompositionEvent -onCompositionEnd = Handler P.onCompositionEnd - -onCompositionStart :: StarkProps SyntheticCompositionEvent -onCompositionStart = Handler P.onCompositionStart - -onCompositionUpdate :: StarkProps SyntheticCompositionEvent -onCompositionUpdate = Handler P.onCompositionUpdate - -onKeyDown :: StarkProps SyntheticKeyboardEvent -onKeyDown = Handler P.onKeyDown - -onKeyPress :: StarkProps SyntheticKeyboardEvent -onKeyPress = Handler P.onKeyPress - -onKeyUp :: StarkProps SyntheticKeyboardEvent -onKeyUp = Handler P.onKeyUp - -onKeyEnter :: StarkProps SyntheticKeyboardEvent -onKeyEnter = filterProp isEnterEvent onKeyDown - -onFocus :: StarkProps SyntheticFocusEvent -onFocus = Handler P.onFocus - -onBlur :: StarkProps SyntheticFocusEvent -onBlur = Handler P.onBlur - -onChange :: StarkProps SyntheticInputEvent -onChange = Handler P.onChange - -onInput :: StarkProps SyntheticInputEvent -onInput = Handler P.onInput - -onInvalid :: StarkProps SyntheticInputEvent -onInvalid = Handler P.onInvalid - -onSubmit :: StarkProps SyntheticInputEvent -onSubmit = Handler P.onSubmit - -onClick :: StarkProps SyntheticMouseEvent -onClick = Handler P.onClick - -onContextMenu :: StarkProps SyntheticMouseEvent -onContextMenu = Handler P.onContextMenu - -onDoubleClick :: StarkProps SyntheticMouseEvent -onDoubleClick = Handler P.onDoubleClick - -onDrag :: StarkProps SyntheticMouseEvent -onDrag = Handler P.onDrag - -onDragEnd :: StarkProps SyntheticMouseEvent -onDragEnd = Handler P.onDragEnd - -onDragEnter :: StarkProps SyntheticMouseEvent -onDragEnter = Handler P.onDragEnter - -onDragExit :: StarkProps SyntheticMouseEvent -onDragExit = Handler P.onDragExit - -onDragLeave :: StarkProps SyntheticMouseEvent -onDragLeave = Handler P.onDragLeave - -onDragOver :: StarkProps SyntheticMouseEvent -onDragOver = Handler P.onDragOver - -onDragStart :: StarkProps SyntheticMouseEvent -onDragStart = Handler P.onDragStart - -onDrop :: StarkProps SyntheticMouseEvent -onDrop = Handler P.onDrop - -onMouseDown :: StarkProps SyntheticMouseEvent -onMouseDown = Handler P.onMouseDown - -onMouseEnter :: StarkProps SyntheticMouseEvent -onMouseEnter = Handler P.onMouseEnter - -onMouseLeave :: StarkProps SyntheticMouseEvent -onMouseLeave = Handler P.onMouseLeave - -onMouseMove :: StarkProps SyntheticMouseEvent -onMouseMove = Handler P.onMouseMove - -onMouseOut :: StarkProps SyntheticMouseEvent -onMouseOut = Handler P.onMouseOut - -onMouseOver :: StarkProps SyntheticMouseEvent -onMouseOver = Handler P.onMouseOver - -onMouseUp :: StarkProps SyntheticMouseEvent -onMouseUp = Handler P.onMouseUp - -onSelect :: StarkProps SyntheticEvent -onSelect = Handler P.onSelect - -onTouchCancel :: StarkProps SyntheticTouchEvent -onTouchCancel = Handler P.onTouchCancel - -onTouchEnd :: StarkProps SyntheticTouchEvent -onTouchEnd = Handler P.onTouchEnd - -onTouchMove :: StarkProps SyntheticTouchEvent -onTouchMove = Handler P.onTouchMove - -onTouchStart :: StarkProps SyntheticTouchEvent -onTouchStart = Handler P.onTouchStart - -onScroll :: StarkProps SyntheticUIEvent -onScroll = Handler P.onScroll - -onWheel :: StarkProps SyntheticWheelEvent -onWheel = Handler P.onWheel - -onAnimationStartCapture :: StarkProps SyntheticAnimationEvent -onAnimationStartCapture = Handler P.onAnimationStartCapture - -onAnimationEndCapture :: StarkProps SyntheticAnimationEvent -onAnimationEndCapture = Handler P.onAnimationEndCapture - -onAnimationIterationCapture :: StarkProps SyntheticAnimationEvent -onAnimationIterationCapture = Handler P.onAnimationIterationCapture - -onTransitionEndCapture :: StarkProps SyntheticTransitionEvent -onTransitionEndCapture = Handler P.onTransitionEndCapture - -onToggleCapture :: StarkProps SyntheticEvent -onToggleCapture = Handler P.onToggleCapture - -onErrorCapture :: StarkProps SyntheticEvent -onErrorCapture = Handler P.onErrorCapture - -onLoadCapture :: StarkProps SyntheticEvent -onLoadCapture = Handler P.onLoadCapture - -onAbortCapture :: StarkProps SyntheticEvent -onAbortCapture = Handler P.onAbortCapture - -onCanPlayCapture :: StarkProps SyntheticEvent -onCanPlayCapture = Handler P.onCanPlayCapture - -onCanPlayThroughCapture :: StarkProps SyntheticEvent -onCanPlayThroughCapture = Handler P.onCanPlayThroughCapture - -onDurationChangeCapture :: StarkProps SyntheticEvent -onDurationChangeCapture = Handler P.onDurationChangeCapture - -onEmptiedCapture :: StarkProps SyntheticEvent -onEmptiedCapture = Handler P.onEmptiedCapture - -onEncryptedCapture :: StarkProps SyntheticEvent -onEncryptedCapture = Handler P.onEncryptedCapture - -onEndedCapture :: StarkProps SyntheticEvent -onEndedCapture = Handler P.onEndedCapture - -onLoadedDataCapture :: StarkProps SyntheticEvent -onLoadedDataCapture = Handler P.onLoadedDataCapture - -onLoadedMetadataCapture :: StarkProps SyntheticEvent -onLoadedMetadataCapture = Handler P.onLoadedMetadataCapture - -onLoadStartCapture :: StarkProps SyntheticEvent -onLoadStartCapture = Handler P.onLoadStartCapture - -onPauseCapture :: StarkProps SyntheticEvent -onPauseCapture = Handler P.onPauseCapture - -onPlayCapture :: StarkProps SyntheticEvent -onPlayCapture = Handler P.onPlayCapture - -onPlayingCapture :: StarkProps SyntheticEvent -onPlayingCapture = Handler P.onPlayingCapture - -onProgressCapture :: StarkProps SyntheticEvent -onProgressCapture = Handler P.onProgressCapture - -onRateChangeCapture :: StarkProps SyntheticEvent -onRateChangeCapture = Handler P.onRateChangeCapture - -onSeekedCapture :: StarkProps SyntheticEvent -onSeekedCapture = Handler P.onSeekedCapture - -onSeekingCapture :: StarkProps SyntheticEvent -onSeekingCapture = Handler P.onSeekingCapture - -onStalledCapture :: StarkProps SyntheticEvent -onStalledCapture = Handler P.onStalledCapture - -onSuspendCapture :: StarkProps SyntheticEvent -onSuspendCapture = Handler P.onSuspendCapture - -onTimeUpdateCapture :: StarkProps SyntheticEvent -onTimeUpdateCapture = Handler P.onTimeUpdateCapture - -onVolumeChangeCapture :: StarkProps SyntheticEvent -onVolumeChangeCapture = Handler P.onVolumeChangeCapture - -onWaitingCapture :: StarkProps SyntheticEvent -onWaitingCapture = Handler P.onWaitingCapture - -onCopyCapture :: StarkProps SyntheticClipboardEvent -onCopyCapture = Handler P.onCopyCapture - -onCutCapture :: StarkProps SyntheticClipboardEvent -onCutCapture = Handler P.onCutCapture - -onPasteCapture :: StarkProps SyntheticClipboardEvent -onPasteCapture = Handler P.onPasteCapture - -onCompositionEndCapture :: StarkProps SyntheticCompositionEvent -onCompositionEndCapture = Handler P.onCompositionEndCapture - -onCompositionStartCapture :: StarkProps SyntheticCompositionEvent -onCompositionStartCapture = Handler P.onCompositionStartCapture - -onCompositionUpdateCapture :: StarkProps SyntheticCompositionEvent -onCompositionUpdateCapture = Handler P.onCompositionUpdateCapture - -onKeyDownCapture :: StarkProps SyntheticKeyboardEvent -onKeyDownCapture = Handler P.onKeyDownCapture - -onKeyPressCapture :: StarkProps SyntheticKeyboardEvent -onKeyPressCapture = Handler P.onKeyPressCapture - -onKeyUpCapture :: StarkProps SyntheticKeyboardEvent -onKeyUpCapture = Handler P.onKeyUpCapture - -onFocusCapture :: StarkProps SyntheticFocusEvent -onFocusCapture = Handler P.onFocusCapture - -onBlurCapture :: StarkProps SyntheticFocusEvent -onBlurCapture = Handler P.onBlurCapture - -onChangeCapture :: StarkProps SyntheticInputEvent -onChangeCapture = Handler P.onChangeCapture - -onInputCapture :: StarkProps SyntheticInputEvent -onInputCapture = Handler P.onInputCapture - -onInvalidCapture :: StarkProps SyntheticInputEvent -onInvalidCapture = Handler P.onInvalidCapture - -onSubmitCapture :: StarkProps SyntheticInputEvent -onSubmitCapture = Handler P.onSubmitCapture - -onClickCapture :: StarkProps SyntheticMouseEvent -onClickCapture = Handler P.onClickCapture - -onContextMenuCapture :: StarkProps SyntheticMouseEvent -onContextMenuCapture = Handler P.onContextMenuCapture - -onDoubleClickCapture :: StarkProps SyntheticMouseEvent -onDoubleClickCapture = Handler P.onDoubleClickCapture - -onDragCapture :: StarkProps SyntheticMouseEvent -onDragCapture = Handler P.onDragCapture - -onDragEndCapture :: StarkProps SyntheticMouseEvent -onDragEndCapture = Handler P.onDragEndCapture - -onDragEnterCapture :: StarkProps SyntheticMouseEvent -onDragEnterCapture = Handler P.onDragEnterCapture - -onDragExitCapture :: StarkProps SyntheticMouseEvent -onDragExitCapture = Handler P.onDragExitCapture - -onDragLeaveCapture :: StarkProps SyntheticMouseEvent -onDragLeaveCapture = Handler P.onDragLeaveCapture - -onDragOverCapture :: StarkProps SyntheticMouseEvent -onDragOverCapture = Handler P.onDragOverCapture - -onDragStartCapture :: StarkProps SyntheticMouseEvent -onDragStartCapture = Handler P.onDragStartCapture - -onDropCapture :: StarkProps SyntheticMouseEvent -onDropCapture = Handler P.onDropCapture - -onMouseDownCapture :: StarkProps SyntheticMouseEvent -onMouseDownCapture = Handler P.onMouseDownCapture - -onMouseEnterCapture :: StarkProps SyntheticMouseEvent -onMouseEnterCapture = Handler P.onMouseEnterCapture - -onMouseLeaveCapture :: StarkProps SyntheticMouseEvent -onMouseLeaveCapture = Handler P.onMouseLeaveCapture - -onMouseMoveCapture :: StarkProps SyntheticMouseEvent -onMouseMoveCapture = Handler P.onMouseMoveCapture - -onMouseOutCapture :: StarkProps SyntheticMouseEvent -onMouseOutCapture = Handler P.onMouseOutCapture - -onMouseOverCapture :: StarkProps SyntheticMouseEvent -onMouseOverCapture = Handler P.onMouseOverCapture - -onMouseUpCapture :: StarkProps SyntheticMouseEvent -onMouseUpCapture = Handler P.onMouseUpCapture - -onSelectCapture :: StarkProps SyntheticEvent -onSelectCapture = Handler P.onSelectCapture - -onTouchCancelCapture :: StarkProps SyntheticTouchEvent -onTouchCancelCapture = Handler P.onTouchCancelCapture - -onTouchEndCapture :: StarkProps SyntheticTouchEvent -onTouchEndCapture = Handler P.onTouchEndCapture - -onTouchMoveCapture :: StarkProps SyntheticTouchEvent -onTouchMoveCapture = Handler P.onTouchMoveCapture - -onTouchStartCapture :: StarkProps SyntheticTouchEvent -onTouchStartCapture = Handler P.onTouchStartCapture - -onScrollCapture :: StarkProps SyntheticUIEvent -onScrollCapture = Handler P.onScrollCapture - -onWheelCapture :: StarkProps SyntheticWheelEvent -onWheelCapture = Handler P.onWheelCapture - -ref :: forall a. Ref.RefHandler Ref.NativeNode -> StarkProps a -ref = PrimProp <<< P.ref - -suppressContentEditableWarning :: forall a. Boolean -> StarkProps a -suppressContentEditableWarning = PrimProp <<< P.suppressContentEditableWarning - --- SVG attributes -x :: - forall a. - Int -> - StarkProps a -x = PrimProp <<< P.x - -y :: forall a. Int -> StarkProps a -y = PrimProp <<< P.y - -cx :: forall a. Int -> StarkProps a -cx = PrimProp <<< P.cx - -cy :: forall a. Int -> StarkProps a -cy = PrimProp <<< P.cy - -r :: forall a. Int -> StarkProps a -r = PrimProp <<< P.r - -fill :: forall a. String -> StarkProps a -fill = PrimProp <<< P.fill - -opacity :: forall a. Int -> StarkProps a -opacity = PrimProp <<< P.opacity - -fillOpacity :: forall a. Int -> StarkProps a -fillOpacity = PrimProp <<< P.fillOpacity - -stroke :: forall a. String -> StarkProps a -stroke = PrimProp <<< P.stroke - -strokeWidth :: forall a. Int -> StarkProps a -strokeWidth = PrimProp <<< P.strokeWidth - -points :: forall a. String -> StarkProps a -points = PrimProp <<< P.points - -d :: forall a. String -> StarkProps a -d = PrimProp <<< P.d - -viewBox :: forall a. String -> StarkProps a -viewBox = PrimProp <<< P.viewBox diff --git a/stark/src/Concur/Stark/Run.purs b/stark/src/Concur/Stark/Run.purs deleted file mode 100644 index 752583c..0000000 --- a/stark/src/Concur/Stark/Run.purs +++ /dev/null @@ -1,14 +0,0 @@ -module Concur.Stark.Run where - --- import StarkDOM as StarkDOM - --- runWidgetInDom :: forall a. String -> Widget HTML a -> Effect Unit --- runWidgetInDom elemId w = do --- win <- DOM.window --- doc <- DOM.document win --- let node = DOM.toNonElementParentNode doc --- mroot <- DOM.getElementById elemId node --- -- mroot <- getElementById (ElementId elemId) (documentToNonElementParentNode (htmlDocumentToDocument doc)) --- case mroot of --- Nothing -> pure unit --- Just root -> void (StarkDOM.render (renderComponent w) root) diff --git a/stark/src/Concur/Stark/SVG.purs b/stark/src/Concur/Stark/SVG.purs deleted file mode 100644 index 9898446..0000000 --- a/stark/src/Concur/Stark/SVG.purs +++ /dev/null @@ -1,118 +0,0 @@ -module Concur.Stark.SVG where - -import Prelude hiding (div,map,sub) - -import Concur.Stark.DOM (El, El', el') -import Stark.DOM.SVG as S - -------------------------------------------------------------------------------------------------------------------- -circle :: El -circle = el' S.circle - -circle' :: El' -circle' = circle [] - -clipPath :: El -clipPath = el' S.clipPath - -clipPath' :: El' -clipPath' = clipPath [] - -defs :: El -defs = el' S.defs - -defs' :: El' -defs' = defs [] - -ellipse :: El -ellipse = el' S.ellipse - -ellipse' :: El' -ellipse' = ellipse [] - -foreignObject :: El -foreignObject = el' S.foreignObject - -g :: El -g = el' S.g - -g' :: El' -g' = g [] - -line :: El -line = el' S.line - -line' :: El' -line' = line [] - -linearGradient :: El -linearGradient = el' S.linearGradient - -linearGradient' :: El' -linearGradient' = linearGradient [] - -mask :: El -mask = el' S.mask - -mask' :: El' -mask' = mask [] - -path :: El -path = el' S.path - -path' :: El' -path' = path [] - -pattern :: El -pattern = el' S.pattern - -pattern' :: El' -pattern' = pattern [] - -polygon :: El -polygon = el' S.polygon - -polygon' :: El' -polygon' = polygon [] - -polyline :: El -polyline = el' S.polyline - -polyline' :: El' -polyline' = polyline [] - -radialGradient :: El -radialGradient = el' S.radialGradient - -radialGradient' :: El' -radialGradient' = radialGradient [] - -rect :: El -rect = el' S.rect - -rect' :: El' -rect' = rect [] - -stop :: El -stop = el' S.stop - -stop' :: El' -stop' = stop [] - -svg :: El -svg = el' S.svg - -svg' :: El' -svg' = svg [] - -text :: El -text = el' S.text - -text' :: El' -text' = text [] - -tspan :: El -tspan = el' S.tspan - -tspan' :: El' -tspan' = tspan [] diff --git a/stark/src/Stark.purs b/stark/src/Stark.purs deleted file mode 100644 index 9d395e6..0000000 --- a/stark/src/Stark.purs +++ /dev/null @@ -1,24 +0,0 @@ -module Stark - ( TagName - , StarkElement(..) - ) where - -import Data.Foldable (fold) -import Data.Functor (map) -import Data.Monoid ((<>)) -import Data.Show (class Show, show) -import Stark.DOM.Props (Props(..)) - -type TagName = String -data StarkElement - = StarkNode TagName (Array Props) (Array StarkElement) - | StarkText String - | StarkInt Int - | StarkNumber Number - -instance showStarkElement :: Show StarkElement where - show (StarkNode tname props children) = - "<" <> tname <> " " <> fold (map show props) <> ">" <> fold (map show children) <> " tname <> ">" - show (StarkText t) = show t - show (StarkInt i) = show i - show (StarkNumber n) = show n diff --git a/stark/src/Stark/DOM.purs b/stark/src/Stark/DOM.purs deleted file mode 100644 index 900c9c3..0000000 --- a/stark/src/Stark/DOM.purs +++ /dev/null @@ -1,691 +0,0 @@ -module Stark.DOM where - -import Stark (StarkElement(..), TagName) -import Stark.DOM.Props (Props) - -newtype IsDynamic = IsDynamic Boolean - -mkDOM :: - IsDynamic -> TagName -> Array Props -> Array StarkElement -> StarkElement -mkDOM _ tag props = StarkNode tag props - -text :: String -> StarkElement -text = StarkText - -int :: Int -> StarkElement -int = StarkInt - -number :: Number -> StarkElement -number = StarkNumber - -a :: Array Props -> Array StarkElement -> StarkElement -a = mkDOM (IsDynamic false) "a" - -a' :: Array StarkElement -> StarkElement -a' = a [] - -abbr :: Array Props -> Array StarkElement -> StarkElement -abbr = mkDOM (IsDynamic false) "abbr" - -abbr' :: Array StarkElement -> StarkElement -abbr' = abbr [] - -address :: Array Props -> Array StarkElement -> StarkElement -address = mkDOM (IsDynamic false) "address" - -address' :: Array StarkElement -> StarkElement -address' = address [] - -area :: Array Props -> StarkElement -area props = mkDOM (IsDynamic false) "area" props [] - -area' :: StarkElement -area' = area [] - -article :: Array Props -> Array StarkElement -> StarkElement -article = mkDOM (IsDynamic false) "article" - -article' :: Array StarkElement -> StarkElement -article' = article [] - -aside :: Array Props -> Array StarkElement -> StarkElement -aside = mkDOM (IsDynamic false) "aside" - -aside' :: Array StarkElement -> StarkElement -aside' = aside [] - -audio :: Array Props -> Array StarkElement -> StarkElement -audio = mkDOM (IsDynamic false) "audio" - -audio' :: Array StarkElement -> StarkElement -audio' = audio [] - -b :: Array Props -> Array StarkElement -> StarkElement -b = mkDOM (IsDynamic false) "b" - -b' :: Array StarkElement -> StarkElement -b' = b [] - -base :: Array Props -> StarkElement -base props = mkDOM (IsDynamic false) "base" props [] - -base' :: StarkElement -base' = base [] - -bdi :: Array Props -> Array StarkElement -> StarkElement -bdi = mkDOM (IsDynamic false) "bdi" - -bdi' :: Array StarkElement -> StarkElement -bdi' = bdi [] - -bdo :: Array Props -> Array StarkElement -> StarkElement -bdo = mkDOM (IsDynamic false) "bdo" - -bdo' :: Array StarkElement -> StarkElement -bdo' = bdo [] - -big :: Array Props -> Array StarkElement -> StarkElement -big = mkDOM (IsDynamic false) "big" - -big' :: Array StarkElement -> StarkElement -big' = big [] - -blockquote :: Array Props -> Array StarkElement -> StarkElement -blockquote = mkDOM (IsDynamic false) "blockquote" - -blockquote' :: Array StarkElement -> StarkElement -blockquote' = blockquote [] - -body :: Array Props -> Array StarkElement -> StarkElement -body = mkDOM (IsDynamic false) "body" - -body' :: Array StarkElement -> StarkElement -body' = body [] - -br :: Array Props -> StarkElement -br props = mkDOM (IsDynamic false) "br" props [] - -br' :: StarkElement -br' = br [] - -button :: Array Props -> Array StarkElement -> StarkElement -button = mkDOM (IsDynamic false) "button" - -button' :: Array StarkElement -> StarkElement -button' = button [] - -canvas :: Array Props -> Array StarkElement -> StarkElement -canvas = mkDOM (IsDynamic false) "canvas" - -canvas' :: Array StarkElement -> StarkElement -canvas' = canvas [] - -caption :: Array Props -> Array StarkElement -> StarkElement -caption = mkDOM (IsDynamic false) "caption" - -caption' :: Array StarkElement -> StarkElement -caption' = caption [] - -cite :: Array Props -> Array StarkElement -> StarkElement -cite = mkDOM (IsDynamic false) "cite" - -cite' :: Array StarkElement -> StarkElement -cite' = cite [] - -code :: Array Props -> Array StarkElement -> StarkElement -code = mkDOM (IsDynamic false) "code" - -code' :: Array StarkElement -> StarkElement -code' = code [] - -col :: Array Props -> StarkElement -col props = mkDOM (IsDynamic false) "col" props [] - -col' :: StarkElement -col' = col [] - -colgroup :: Array Props -> Array StarkElement -> StarkElement -colgroup = mkDOM (IsDynamic false) "colgroup" - -colgroup' :: Array StarkElement -> StarkElement -colgroup' = colgroup [] - -_data :: Array Props -> Array StarkElement -> StarkElement -_data = mkDOM (IsDynamic false) "data" - -_data' :: Array StarkElement -> StarkElement -_data' = _data [] - -datalist :: Array Props -> Array StarkElement -> StarkElement -datalist = mkDOM (IsDynamic false) "datalist" - -datalist' :: Array StarkElement -> StarkElement -datalist' = datalist [] - -dd :: Array Props -> Array StarkElement -> StarkElement -dd = mkDOM (IsDynamic false) "dd" - -dd' :: Array StarkElement -> StarkElement -dd' = dd [] - -del :: Array Props -> Array StarkElement -> StarkElement -del = mkDOM (IsDynamic false) "del" - -del' :: Array StarkElement -> StarkElement -del' = del [] - -details :: Array Props -> Array StarkElement -> StarkElement -details = mkDOM (IsDynamic false) "details" - -details' :: Array StarkElement -> StarkElement -details' = details [] - -dfn :: Array Props -> Array StarkElement -> StarkElement -dfn = mkDOM (IsDynamic false) "dfn" - -dfn' :: Array StarkElement -> StarkElement -dfn' = dfn [] - -dialog :: Array Props -> Array StarkElement -> StarkElement -dialog = mkDOM (IsDynamic false) "dialog" - -dialog' :: Array StarkElement -> StarkElement -dialog' = dialog [] - -div :: Array Props -> Array StarkElement -> StarkElement -div = mkDOM (IsDynamic false) "div" - -div' :: Array StarkElement -> StarkElement -div' = div [] - -dl :: Array Props -> Array StarkElement -> StarkElement -dl = mkDOM (IsDynamic false) "dl" - -dl' :: Array StarkElement -> StarkElement -dl' = dl [] - -dt :: Array Props -> Array StarkElement -> StarkElement -dt = mkDOM (IsDynamic false) "dt" - -dt' :: Array StarkElement -> StarkElement -dt' = dt [] - -em :: Array Props -> Array StarkElement -> StarkElement -em = mkDOM (IsDynamic false) "em" - -em' :: Array StarkElement -> StarkElement -em' = em [] - -embed :: Array Props -> StarkElement -embed props = mkDOM (IsDynamic false) "embed" props [] - -embed' :: StarkElement -embed' = embed [] - -fieldset :: Array Props -> Array StarkElement -> StarkElement -fieldset = mkDOM (IsDynamic false) "fieldset" - -fieldset' :: Array StarkElement -> StarkElement -fieldset' = fieldset [] - -figcaption :: Array Props -> Array StarkElement -> StarkElement -figcaption = mkDOM (IsDynamic false) "figcaption" - -figcaption' :: Array StarkElement -> StarkElement -figcaption' = figcaption [] - -figure :: Array Props -> Array StarkElement -> StarkElement -figure = mkDOM (IsDynamic false) "figure" - -figure' :: Array StarkElement -> StarkElement -figure' = figure [] - -footer :: Array Props -> Array StarkElement -> StarkElement -footer = mkDOM (IsDynamic false) "footer" - -footer' :: Array StarkElement -> StarkElement -footer' = footer [] - -form :: Array Props -> Array StarkElement -> StarkElement -form = mkDOM (IsDynamic false) "form" - -form' :: Array StarkElement -> StarkElement -form' = form [] - -h1 :: Array Props -> Array StarkElement -> StarkElement -h1 = mkDOM (IsDynamic false) "h1" - -h1' :: Array StarkElement -> StarkElement -h1' = h1 [] - -h2 :: Array Props -> Array StarkElement -> StarkElement -h2 = mkDOM (IsDynamic false) "h2" - -h2' :: Array StarkElement -> StarkElement -h2' = h2 [] - -h3 :: Array Props -> Array StarkElement -> StarkElement -h3 = mkDOM (IsDynamic false) "h3" - -h3' :: Array StarkElement -> StarkElement -h3' = h3 [] - -h4 :: Array Props -> Array StarkElement -> StarkElement -h4 = mkDOM (IsDynamic false) "h4" - -h4' :: Array StarkElement -> StarkElement -h4' = h4 [] - -h5 :: Array Props -> Array StarkElement -> StarkElement -h5 = mkDOM (IsDynamic false) "h5" - -h5' :: Array StarkElement -> StarkElement -h5' = h5 [] - -h6 :: Array Props -> Array StarkElement -> StarkElement -h6 = mkDOM (IsDynamic false) "h6" - -h6' :: Array StarkElement -> StarkElement -h6' = h6 [] - -head :: Array Props -> Array StarkElement -> StarkElement -head = mkDOM (IsDynamic false) "head" - -head' :: Array StarkElement -> StarkElement -head' = head [] - -header :: Array Props -> Array StarkElement -> StarkElement -header = mkDOM (IsDynamic false) "header" - -header' :: Array StarkElement -> StarkElement -header' = header [] - -hr :: Array Props -> StarkElement -hr props = mkDOM (IsDynamic false) "hr" props [] - -hr' :: StarkElement -hr' = hr [] - -html :: Array Props -> Array StarkElement -> StarkElement -html = mkDOM (IsDynamic false) "html" - -html' :: Array StarkElement -> StarkElement -html' = html [] - -i :: Array Props -> Array StarkElement -> StarkElement -i = mkDOM (IsDynamic false) "i" - -i' :: Array StarkElement -> StarkElement -i' = i [] - -iframe :: Array Props -> Array StarkElement -> StarkElement -iframe = mkDOM (IsDynamic false) "iframe" - -iframe' :: Array StarkElement -> StarkElement -iframe' = iframe [] - -img :: Array Props -> StarkElement -img props = mkDOM (IsDynamic false) "img" props [] - -img' :: StarkElement -img' = img [] - -input :: Array Props -> StarkElement -input props = mkDOM (IsDynamic false) "input" props [] - -input' :: StarkElement -input' = input [] - -ins :: Array Props -> Array StarkElement -> StarkElement -ins = mkDOM (IsDynamic false) "ins" - -ins' :: Array StarkElement -> StarkElement -ins' = ins [] - -kbd :: Array Props -> Array StarkElement -> StarkElement -kbd = mkDOM (IsDynamic false) "kbd" - -kbd' :: Array StarkElement -> StarkElement -kbd' = kbd [] - -keygen :: Array Props -> StarkElement -keygen props = mkDOM (IsDynamic false) "keygen" props [] - -keygen' :: StarkElement -keygen' = keygen [] - -label :: Array Props -> Array StarkElement -> StarkElement -label = mkDOM (IsDynamic false) "label" - -label' :: Array StarkElement -> StarkElement -label' = label [] - -legend :: Array Props -> Array StarkElement -> StarkElement -legend = mkDOM (IsDynamic false) "legend" - -legend' :: Array StarkElement -> StarkElement -legend' = legend [] - -li :: Array Props -> Array StarkElement -> StarkElement -li = mkDOM (IsDynamic false) "li" - -li' :: Array StarkElement -> StarkElement -li' = li [] - -link :: Array Props -> StarkElement -link props = mkDOM (IsDynamic false) "link" props [] - -link' :: StarkElement -link' = link [] - -main :: Array Props -> Array StarkElement -> StarkElement -main = mkDOM (IsDynamic false) "main" - -main' :: Array StarkElement -> StarkElement -main' = main [] - -map :: Array Props -> Array StarkElement -> StarkElement -map = mkDOM (IsDynamic false) "map" - -map' :: Array StarkElement -> StarkElement -map' = map [] - -mark :: Array Props -> Array StarkElement -> StarkElement -mark = mkDOM (IsDynamic false) "mark" - -mark' :: Array StarkElement -> StarkElement -mark' = mark [] - -menu :: Array Props -> Array StarkElement -> StarkElement -menu = mkDOM (IsDynamic false) "menu" - -menu' :: Array StarkElement -> StarkElement -menu' = menu [] - -menuitem :: Array Props -> StarkElement -menuitem props = mkDOM (IsDynamic false) "menuitem" props [] - -menuitem' :: StarkElement -menuitem' = menuitem [] - -meta :: Array Props -> StarkElement -meta props = mkDOM (IsDynamic false) "meta" props [] - -meta' :: StarkElement -meta' = meta [] - -meter :: Array Props -> Array StarkElement -> StarkElement -meter = mkDOM (IsDynamic false) "meter" - -meter' :: Array StarkElement -> StarkElement -meter' = meter [] - -nav :: Array Props -> Array StarkElement -> StarkElement -nav = mkDOM (IsDynamic false) "nav" - -nav' :: Array StarkElement -> StarkElement -nav' = nav [] - -noscript :: Array Props -> Array StarkElement -> StarkElement -noscript = mkDOM (IsDynamic false) "noscript" - -noscript' :: Array StarkElement -> StarkElement -noscript' = noscript [] - -object :: Array Props -> Array StarkElement -> StarkElement -object = mkDOM (IsDynamic false) "object" - -object' :: Array StarkElement -> StarkElement -object' = object [] - -ol :: Array Props -> Array StarkElement -> StarkElement -ol = mkDOM (IsDynamic false) "ol" - -ol' :: Array StarkElement -> StarkElement -ol' = ol [] - -optgroup :: Array Props -> Array StarkElement -> StarkElement -optgroup = mkDOM (IsDynamic false) "optgroup" - -optgroup' :: Array StarkElement -> StarkElement -optgroup' = optgroup [] - -option :: Array Props -> Array StarkElement -> StarkElement -option = mkDOM (IsDynamic false) "option" - -option' :: Array StarkElement -> StarkElement -option' = option [] - -output :: Array Props -> Array StarkElement -> StarkElement -output = mkDOM (IsDynamic false) "output" - -output' :: Array StarkElement -> StarkElement -output' = output [] - -p :: Array Props -> Array StarkElement -> StarkElement -p = mkDOM (IsDynamic false) "p" - -p' :: Array StarkElement -> StarkElement -p' = p [] - -param :: Array Props -> StarkElement -param props = mkDOM (IsDynamic false) "param" props [] - -param' :: StarkElement -param' = param [] - -picture :: Array Props -> Array StarkElement -> StarkElement -picture = mkDOM (IsDynamic false) "picture" - -picture' :: Array StarkElement -> StarkElement -picture' = picture [] - -pre :: Array Props -> Array StarkElement -> StarkElement -pre = mkDOM (IsDynamic false) "pre" - -pre' :: Array StarkElement -> StarkElement -pre' = pre [] - -progress :: Array Props -> Array StarkElement -> StarkElement -progress = mkDOM (IsDynamic false) "progress" - -progress' :: Array StarkElement -> StarkElement -progress' = progress [] - -q :: Array Props -> Array StarkElement -> StarkElement -q = mkDOM (IsDynamic false) "q" - -q' :: Array StarkElement -> StarkElement -q' = q [] - -rp :: Array Props -> Array StarkElement -> StarkElement -rp = mkDOM (IsDynamic false) "rp" - -rp' :: Array StarkElement -> StarkElement -rp' = rp [] - -rt :: Array Props -> Array StarkElement -> StarkElement -rt = mkDOM (IsDynamic false) "rt" - -rt' :: Array StarkElement -> StarkElement -rt' = rt [] - -ruby :: Array Props -> Array StarkElement -> StarkElement -ruby = mkDOM (IsDynamic false) "ruby" - -ruby' :: Array StarkElement -> StarkElement -ruby' = ruby [] - -s :: Array Props -> Array StarkElement -> StarkElement -s = mkDOM (IsDynamic false) "s" - -s' :: Array StarkElement -> StarkElement -s' = s [] - -samp :: Array Props -> Array StarkElement -> StarkElement -samp = mkDOM (IsDynamic false) "samp" - -samp' :: Array StarkElement -> StarkElement -samp' = samp [] - -script :: Array Props -> Array StarkElement -> StarkElement -script = mkDOM (IsDynamic false) "script" - -script' :: Array StarkElement -> StarkElement -script' = script [] - -section :: Array Props -> Array StarkElement -> StarkElement -section = mkDOM (IsDynamic false) "section" - -section' :: Array StarkElement -> StarkElement -section' = section [] - -select :: Array Props -> Array StarkElement -> StarkElement -select = mkDOM (IsDynamic false) "select" - -select' :: Array StarkElement -> StarkElement -select' = select [] - -small :: Array Props -> Array StarkElement -> StarkElement -small = mkDOM (IsDynamic false) "small" - -small' :: Array StarkElement -> StarkElement -small' = small [] - -source :: Array Props -> StarkElement -source props = mkDOM (IsDynamic false) "source" props [] - -source' :: StarkElement -source' = source [] - -span :: Array Props -> Array StarkElement -> StarkElement -span = mkDOM (IsDynamic false) "span" - -span' :: Array StarkElement -> StarkElement -span' = span [] - -strong :: Array Props -> Array StarkElement -> StarkElement -strong = mkDOM (IsDynamic false) "strong" - -strong' :: Array StarkElement -> StarkElement -strong' = strong [] - -style :: Array Props -> Array StarkElement -> StarkElement -style = mkDOM (IsDynamic false) "style" - -style' :: Array StarkElement -> StarkElement -style' = style [] - -sub :: Array Props -> Array StarkElement -> StarkElement -sub = mkDOM (IsDynamic false) "sub" - -sub' :: Array StarkElement -> StarkElement -sub' = sub [] - -summary :: Array Props -> Array StarkElement -> StarkElement -summary = mkDOM (IsDynamic false) "summary" - -summary' :: Array StarkElement -> StarkElement -summary' = summary [] - -sup :: Array Props -> Array StarkElement -> StarkElement -sup = mkDOM (IsDynamic false) "sup" - -sup' :: Array StarkElement -> StarkElement -sup' = sup [] - -table :: Array Props -> Array StarkElement -> StarkElement -table = mkDOM (IsDynamic false) "table" - -table' :: Array StarkElement -> StarkElement -table' = table [] - -tbody :: Array Props -> Array StarkElement -> StarkElement -tbody = mkDOM (IsDynamic false) "tbody" - -tbody' :: Array StarkElement -> StarkElement -tbody' = tbody [] - -td :: Array Props -> Array StarkElement -> StarkElement -td = mkDOM (IsDynamic false) "td" - -td' :: Array StarkElement -> StarkElement -td' = td [] - -textarea :: Array Props -> Array StarkElement -> StarkElement -textarea = mkDOM (IsDynamic false) "textarea" - -textarea' :: Array StarkElement -> StarkElement -textarea' = textarea [] - -tfoot :: Array Props -> Array StarkElement -> StarkElement -tfoot = mkDOM (IsDynamic false) "tfoot" - -tfoot' :: Array StarkElement -> StarkElement -tfoot' = tfoot [] - -th :: Array Props -> Array StarkElement -> StarkElement -th = mkDOM (IsDynamic false) "th" - -th' :: Array StarkElement -> StarkElement -th' = th [] - -thead :: Array Props -> Array StarkElement -> StarkElement -thead = mkDOM (IsDynamic false) "thead" - -thead' :: Array StarkElement -> StarkElement -thead' = thead [] - -time :: Array Props -> Array StarkElement -> StarkElement -time = mkDOM (IsDynamic false) "time" - -time' :: Array StarkElement -> StarkElement -time' = time [] - -title :: Array Props -> Array StarkElement -> StarkElement -title = mkDOM (IsDynamic false) "title" - -title' :: Array StarkElement -> StarkElement -title' = title [] - -tr :: Array Props -> Array StarkElement -> StarkElement -tr = mkDOM (IsDynamic false) "tr" - -tr' :: Array StarkElement -> StarkElement -tr' = tr [] - -track :: Array Props -> StarkElement -track props = mkDOM (IsDynamic false) "track" props [] - -track' :: StarkElement -track' = track [] - -u :: Array Props -> Array StarkElement -> StarkElement -u = mkDOM (IsDynamic false) "u" - -u' :: Array StarkElement -> StarkElement -u' = u [] - -ul :: Array Props -> Array StarkElement -> StarkElement -ul = mkDOM (IsDynamic false) "ul" - -ul' :: Array StarkElement -> StarkElement -ul' = ul [] - -var :: Array Props -> Array StarkElement -> StarkElement -var = mkDOM (IsDynamic false) "var" - -var' :: Array StarkElement -> StarkElement -var' = var [] - -video :: Array Props -> Array StarkElement -> StarkElement -video = mkDOM (IsDynamic false) "video" - -video' :: Array StarkElement -> StarkElement -video' = video [] - -wbr :: Array Props -> StarkElement -wbr props = mkDOM (IsDynamic false) "wbr" props [] - -wbr' :: StarkElement -wbr' = wbr [] diff --git a/stark/src/Stark/DOM/Props.purs b/stark/src/Stark/DOM/Props.purs deleted file mode 100644 index 393b710..0000000 --- a/stark/src/Stark/DOM/Props.purs +++ /dev/null @@ -1,945 +0,0 @@ -module Stark.DOM.Props where - -import Prelude - -import Effect (Effect) -import Effect.Uncurried (mkEffectFn1) -import Stark.Ref as Ref -import Stark.SyntheticEvent - ( SyntheticEvent - , SyntheticAnimationEvent - , SyntheticClipboardEvent - , SyntheticCompositionEvent - , SyntheticInputEvent - , SyntheticKeyboardEvent - , SyntheticFocusEvent - , SyntheticMouseEvent - , SyntheticTouchEvent - , SyntheticTransitionEvent - , SyntheticUIEvent - , SyntheticWheelEvent - ) - -data Props = Props String - -instance showProp :: Show Props where - show :: Props -> String - show (Props n) = "[" <> n <> "]" - -unsafeMkProps :: forall val. String -> val -> Props -unsafeMkProps n _ = Props n - -unsafeUnfoldProps :: forall vals. String -> { | vals } -> Props -unsafeUnfoldProps n _ = Props n - -unsafePrefixProps :: forall vals. String -> { | vals } -> Props -unsafePrefixProps n _ = Props n - -aria :: forall ariaAttrs. { | ariaAttrs } -> Props -aria = unsafePrefixProps "aria-" - -_data :: forall dataAttrs. { | dataAttrs } -> Props -_data = unsafePrefixProps "data-" - -style :: forall style. { | style } -> Props -style = unsafeUnfoldProps "style" - -dangerouslySetInnerHTML :: { __html :: String } -> Props -dangerouslySetInnerHTML = unsafeMkProps "dangerouslySetInnerHTML" - -accept :: String -> Props -accept = unsafeMkProps "accept" - -acceptCharset :: String -> Props -acceptCharset = unsafeMkProps "acceptCharset" - -accessKey :: String -> Props -accessKey = unsafeMkProps "accessKey" - -action :: String -> Props -action = unsafeMkProps "action" - -allowFullScreen :: Boolean -> Props -allowFullScreen = unsafeMkProps "allowFullScreen" - -allowTransparency :: Boolean -> Props -allowTransparency = unsafeMkProps "allowTransparency" - -alt :: String -> Props -alt = unsafeMkProps "alt" - -async :: Boolean -> Props -async = unsafeMkProps "async" - -autoComplete :: String -> Props -autoComplete = unsafeMkProps "autoComplete" - -autoFocus :: Boolean -> Props -autoFocus = unsafeMkProps "autoFocus" - -autoPlay :: Boolean -> Props -autoPlay = unsafeMkProps "autoPlay" - -capture :: Boolean -> Props -capture = unsafeMkProps "capture" - -cellPadding :: String -> Props -cellPadding = unsafeMkProps "cellPadding" - -cellSpacing :: String -> Props -cellSpacing = unsafeMkProps "cellSpacing" - -charSet :: String -> Props -charSet = unsafeMkProps "charSet" - -challenge :: String -> Props -challenge = unsafeMkProps "checked" - -checked :: Boolean -> Props -checked = unsafeMkProps "checked" - -cite :: String -> Props -cite = unsafeMkProps "cite" - -classID :: String -> Props -classID = unsafeMkProps "classID" - -className :: String -> Props -className = unsafeMkProps "className" - -cols :: Int -> Props -cols = unsafeMkProps "cols" - -colSpan :: Int -> Props -colSpan = unsafeMkProps "colSpan" - -content :: String -> Props -content = unsafeMkProps "content" - -contentEditable :: Boolean -> Props -contentEditable = unsafeMkProps "contentEditable" - -contextMenu :: String -> Props -contextMenu = unsafeMkProps "contextMenu" - -controls :: Boolean -> Props -controls = unsafeMkProps "controls" - -coords :: String -> Props -coords = unsafeMkProps "coords" - -crossOrigin :: String -> Props -crossOrigin = unsafeMkProps "crossOrigin" - -dateTime :: String -> Props -dateTime = unsafeMkProps "dateTime" - -default :: Boolean -> Props -default = unsafeMkProps "default" - -defaultChecked :: Boolean -> Props -defaultChecked = unsafeMkProps "defaultChecked" - -defaultValue :: String -> Props -defaultValue = unsafeMkProps "defaultValue" - -defer :: Boolean -> Props -defer = unsafeMkProps "defer" - -dir :: String -> Props -dir = unsafeMkProps "dir" - -disabled :: Boolean -> Props -disabled = unsafeMkProps "disabled" - -download :: String -> Props -download = unsafeMkProps "download" - -draggable :: Boolean -> Props -draggable = unsafeMkProps "draggable" - -encType :: String -> Props -encType = unsafeMkProps "encType" - -form :: String -> Props -form = unsafeMkProps "form" - -formAction :: String -> Props -formAction = unsafeMkProps "formAction" - -formEncType :: String -> Props -formEncType = unsafeMkProps "formEncType" - -formMethod :: String -> Props -formMethod = unsafeMkProps "formMethod" - -formNoValidate :: Boolean -> Props -formNoValidate = unsafeMkProps "formNoValidate" - -formTarget :: String -> Props -formTarget = unsafeMkProps "formTarget" - -frameBorder :: String -> Props -frameBorder = unsafeMkProps "frameBorder" - -headers :: String -> Props -headers = unsafeMkProps "headers" - -height :: String -> Props -height = unsafeMkProps "height" - -hidden :: Boolean -> Props -hidden = unsafeMkProps "hidden" - -high :: String -> Props -high = unsafeMkProps "high" - -href :: String -> Props -href = unsafeMkProps "href" - -hrefLang :: String -> Props -hrefLang = unsafeMkProps "hrefLang" - -htmlFor :: String -> Props -htmlFor = unsafeMkProps "htmlFor" - -httpEquiv :: String -> Props -httpEquiv = unsafeMkProps "httpEquiv" - -icon :: String -> Props -icon = unsafeMkProps "icon" - -_id :: String -> Props -_id = unsafeMkProps "id" - -inputMode :: String -> Props -inputMode = unsafeMkProps "inputMode" - -integrity :: String -> Props -integrity = unsafeMkProps "integrity" - -is :: String -> Props -is = unsafeMkProps "is" - -key :: String -> Props -key = unsafeMkProps "key" - -keyParams :: String -> Props -keyParams = unsafeMkProps "keyParams" - -keyType :: String -> Props -keyType = unsafeMkProps "keyType" - -kind :: String -> Props -kind = unsafeMkProps "kind" - -label :: String -> Props -label = unsafeMkProps "label" - -lang :: String -> Props -lang = unsafeMkProps "lang" - -list :: String -> Props -list = unsafeMkProps "list" - -loop :: Boolean -> Props -loop = unsafeMkProps "loop" - -low :: String -> Props -low = unsafeMkProps "low" - -manifest :: String -> Props -manifest = unsafeMkProps "manifest" - -marginHeight :: String -> Props -marginHeight = unsafeMkProps "marginHeight" - -marginWidth :: String -> Props -marginWidth = unsafeMkProps "marginWidth" - -max :: String -> Props -max = unsafeMkProps "max" - -maxLength :: String -> Props -maxLength = unsafeMkProps "maxLength" - -media :: String -> Props -media = unsafeMkProps "media" - -mediaGroup :: String -> Props -mediaGroup = unsafeMkProps "mediaGroup" - -method :: String -> Props -method = unsafeMkProps "method" - -min :: String -> Props -min = unsafeMkProps "min" - -minLength :: String -> Props -minLength = unsafeMkProps "minLength" - -multiple :: Boolean -> Props -multiple = unsafeMkProps "multiple" - -muted :: Boolean -> Props -muted = unsafeMkProps "muted" - -name :: String -> Props -name = unsafeMkProps "name" - -nonce :: String -> Props -nonce = unsafeMkProps "nonce" - -noValidate :: Boolean -> Props -noValidate = unsafeMkProps "noValidate" - -open :: Boolean -> Props -open = unsafeMkProps "open" - -optimum :: String -> Props -optimum = unsafeMkProps "optimum" - -pattern :: String -> Props -pattern = unsafeMkProps "pattern" - -placeholder :: String -> Props -placeholder = unsafeMkProps "placeholder" - -poster :: String -> Props -poster = unsafeMkProps "poster" - -preload :: String -> Props -preload = unsafeMkProps "preload" - -profile :: String -> Props -profile = unsafeMkProps "profile" - -radioGroup :: String -> Props -radioGroup = unsafeMkProps "radioGroup" - -readOnly :: Boolean -> Props -readOnly = unsafeMkProps "readOnly" - -rel :: String -> Props -rel = unsafeMkProps "rel" - -required :: Boolean -> Props -required = unsafeMkProps "required" - -reversed :: Boolean -> Props -reversed = unsafeMkProps "reversed" - -role :: String -> Props -role = unsafeMkProps "role" - -rows :: Int -> Props -rows = unsafeMkProps "rows" - -rowSpan :: Int -> Props -rowSpan = unsafeMkProps "rowSpan" - -sandbox :: String -> Props -sandbox = unsafeMkProps "sandbox" - -scope :: String -> Props -scope = unsafeMkProps "scope" - -scoped :: Boolean -> Props -scoped = unsafeMkProps "scoped" - -scrolling :: String -> Props -scrolling = unsafeMkProps "scrolling" - -seamless :: Boolean -> Props -seamless = unsafeMkProps "seamless" - -selected :: Boolean -> Props -selected = unsafeMkProps "selected" - -shape :: String -> Props -shape = unsafeMkProps "shape" - -size :: Int -> Props -size = unsafeMkProps "size" - -sizes :: String -> Props -sizes = unsafeMkProps "sizes" - -span :: Int -> Props -span = unsafeMkProps "span" - -spellCheck :: Boolean -> Props -spellCheck = unsafeMkProps "spellCheck" - -src :: String -> Props -src = unsafeMkProps "src" - -srcDoc :: String -> Props -srcDoc = unsafeMkProps "srcDoc" - -srcLang :: String -> Props -srcLang = unsafeMkProps "srcLang" - -srcSet :: String -> Props -srcSet = unsafeMkProps "srcSet" - -start :: Int -> Props -start = unsafeMkProps "start" - -step :: String -> Props -step = unsafeMkProps "step" - -summary :: String -> Props -summary = unsafeMkProps "summary" - -tabIndex :: Int -> Props -tabIndex = unsafeMkProps "tabIndex" - -target :: String -> Props -target = unsafeMkProps "target" - -title :: String -> Props -title = unsafeMkProps "title" - -_type :: String -> Props -_type = unsafeMkProps "type" - -useMap :: String -> Props -useMap = unsafeMkProps "useMap" - -value :: String -> Props -value = unsafeMkProps "value" - -valueArray :: Array String -> Props -valueArray = unsafeMkProps "value" - -width :: String -> Props -width = unsafeMkProps "width" - -wmode :: String -> Props -wmode = unsafeMkProps "wmode" - -wrap :: String -> Props -wrap = unsafeMkProps "wrap" - --- RDFa Attributes -about :: String -> Props -about = unsafeMkProps "about" - -datatype :: String -> Props -datatype = unsafeMkProps "datatype" - -inlist :: String -> Props -inlist = unsafeMkProps "inlist" - -prefix :: String -> Props -prefix = unsafeMkProps "prefix" - -property :: String -> Props -property = unsafeMkProps "property" - -resource :: String -> Props -resource = unsafeMkProps "resource" - -typeof :: String -> Props -typeof = unsafeMkProps "typeof" - -vocab :: String -> Props -vocab = unsafeMkProps "vocab" - --- Non-standard Attributes -autoCapitalize :: String -> Props -autoCapitalize = unsafeMkProps "autoCapitalize" - -autoCorrect :: String -> Props -autoCorrect = unsafeMkProps "autoCorrect" - -autoSave :: String -> Props -autoSave = unsafeMkProps "autoSave" - -color :: String -> Props -color = unsafeMkProps "color" - -itemProp :: String -> Props -itemProp = unsafeMkProps "itemProp" - -itemScope :: Boolean -> Props -itemScope = unsafeMkProps "itemScope" - -itemType :: String -> Props -itemType = unsafeMkProps "itemType" - -itemID :: String -> Props -itemID = unsafeMkProps "itemID" - -itemRef :: String -> Props -itemRef = unsafeMkProps "itemRef" - -results :: Int -> Props -results = unsafeMkProps "results" - -security :: String -> Props -security = unsafeMkProps "security" - -unselectable :: Boolean -> Props -unselectable = unsafeMkProps "unselectable" - -onAnimationStart :: (SyntheticAnimationEvent -> Effect Unit) -> Props -onAnimationStart f = unsafeMkProps "onAnimationStart" (mkEffectFn1 f) - -onAnimationEnd :: (SyntheticAnimationEvent -> Effect Unit) -> Props -onAnimationEnd f = unsafeMkProps "onAnimationEnd" (mkEffectFn1 f) - -onAnimationIteration :: (SyntheticAnimationEvent -> Effect Unit) -> Props -onAnimationIteration f = unsafeMkProps "onAnimationIteration" (mkEffectFn1 f) - -onTransitionEnd :: (SyntheticTransitionEvent -> Effect Unit) -> Props -onTransitionEnd f = unsafeMkProps "onTransitionEnd" (mkEffectFn1 f) - -onToggle :: (SyntheticEvent -> Effect Unit) -> Props -onToggle f = unsafeMkProps "onToggle" (mkEffectFn1 f) - -onError :: (SyntheticEvent -> Effect Unit) -> Props -onError f = unsafeMkProps "onError" (mkEffectFn1 f) - -onLoad :: (SyntheticEvent -> Effect Unit) -> Props -onLoad f = unsafeMkProps "onLoad" (mkEffectFn1 f) - -onAbort :: (SyntheticEvent -> Effect Unit) -> Props -onAbort f = unsafeMkProps "onAbort" (mkEffectFn1 f) - -onCanPlay :: (SyntheticEvent -> Effect Unit) -> Props -onCanPlay f = unsafeMkProps "onCanPlay" (mkEffectFn1 f) - -onCanPlayThrough :: (SyntheticEvent -> Effect Unit) -> Props -onCanPlayThrough f = unsafeMkProps "onCanPlayThrough" (mkEffectFn1 f) - -onDurationChange :: (SyntheticEvent -> Effect Unit) -> Props -onDurationChange f = unsafeMkProps "onDurationChange" (mkEffectFn1 f) - -onEmptied :: (SyntheticEvent -> Effect Unit) -> Props -onEmptied f = unsafeMkProps "onEmptied" (mkEffectFn1 f) - -onEncrypted :: (SyntheticEvent -> Effect Unit) -> Props -onEncrypted f = unsafeMkProps "onEncrypted" (mkEffectFn1 f) - -onEnded :: (SyntheticEvent -> Effect Unit) -> Props -onEnded f = unsafeMkProps "onEnded" (mkEffectFn1 f) - -onLoadedData :: (SyntheticEvent -> Effect Unit) -> Props -onLoadedData f = unsafeMkProps "onLoadedData" (mkEffectFn1 f) - -onLoadedMetadata :: (SyntheticEvent -> Effect Unit) -> Props -onLoadedMetadata f = unsafeMkProps "onLoadedMetadata" (mkEffectFn1 f) - -onLoadStart :: (SyntheticEvent -> Effect Unit) -> Props -onLoadStart f = unsafeMkProps "onLoadStart" (mkEffectFn1 f) - -onPause :: (SyntheticEvent -> Effect Unit) -> Props -onPause f = unsafeMkProps "onPause" (mkEffectFn1 f) - -onPlay :: (SyntheticEvent -> Effect Unit) -> Props -onPlay f = unsafeMkProps "onPlay" (mkEffectFn1 f) - -onPlaying :: (SyntheticEvent -> Effect Unit) -> Props -onPlaying f = unsafeMkProps "onPlaying" (mkEffectFn1 f) - -onProgress :: (SyntheticEvent -> Effect Unit) -> Props -onProgress f = unsafeMkProps "onProgress" (mkEffectFn1 f) - -onRateChange :: (SyntheticEvent -> Effect Unit) -> Props -onRateChange f = unsafeMkProps "onRateChange" (mkEffectFn1 f) - -onSeeked :: (SyntheticEvent -> Effect Unit) -> Props -onSeeked f = unsafeMkProps "onSeeked" (mkEffectFn1 f) - -onSeeking :: (SyntheticEvent -> Effect Unit) -> Props -onSeeking f = unsafeMkProps "onSeeking" (mkEffectFn1 f) - -onStalled :: (SyntheticEvent -> Effect Unit) -> Props -onStalled f = unsafeMkProps "onStalled" (mkEffectFn1 f) - -onSuspend :: (SyntheticEvent -> Effect Unit) -> Props -onSuspend f = unsafeMkProps "onSuspend" (mkEffectFn1 f) - -onTimeUpdate :: (SyntheticEvent -> Effect Unit) -> Props -onTimeUpdate f = unsafeMkProps "onTimeUpdate" (mkEffectFn1 f) - -onVolumeChange :: (SyntheticEvent -> Effect Unit) -> Props -onVolumeChange f = unsafeMkProps "onVolumeChange" (mkEffectFn1 f) - -onWaiting :: (SyntheticEvent -> Effect Unit) -> Props -onWaiting f = unsafeMkProps "onWaiting" (mkEffectFn1 f) - -onCopy :: (SyntheticClipboardEvent -> Effect Unit) -> Props -onCopy f = unsafeMkProps "onCopy" (mkEffectFn1 f) - -onCut :: (SyntheticClipboardEvent -> Effect Unit) -> Props -onCut f = unsafeMkProps "onCut" (mkEffectFn1 f) - -onPaste :: (SyntheticClipboardEvent -> Effect Unit) -> Props -onPaste f = unsafeMkProps "onPaste" (mkEffectFn1 f) - -onCompositionEnd :: (SyntheticCompositionEvent -> Effect Unit) -> Props -onCompositionEnd f = unsafeMkProps "onCompositionEnd" (mkEffectFn1 f) - -onCompositionStart :: (SyntheticCompositionEvent -> Effect Unit) -> Props -onCompositionStart f = unsafeMkProps "onCompositionStart" (mkEffectFn1 f) - -onCompositionUpdate :: (SyntheticCompositionEvent -> Effect Unit) -> Props -onCompositionUpdate f = unsafeMkProps "onCompositionUpdate" (mkEffectFn1 f) - -onKeyDown :: (SyntheticKeyboardEvent -> Effect Unit) -> Props -onKeyDown f = unsafeMkProps "onKeyDown" (mkEffectFn1 f) - -onKeyPress :: (SyntheticKeyboardEvent -> Effect Unit) -> Props -onKeyPress f = unsafeMkProps "onKeyPress" (mkEffectFn1 f) - -onKeyUp :: (SyntheticKeyboardEvent -> Effect Unit) -> Props -onKeyUp f = unsafeMkProps "onKeyUp" (mkEffectFn1 f) - -onFocus :: (SyntheticFocusEvent -> Effect Unit) -> Props -onFocus f = unsafeMkProps "onFocus" (mkEffectFn1 f) - -onBlur :: (SyntheticFocusEvent -> Effect Unit) -> Props -onBlur f = unsafeMkProps "onBlur" (mkEffectFn1 f) - -onChange :: (SyntheticInputEvent -> Effect Unit) -> Props -onChange f = unsafeMkProps "onChange" (mkEffectFn1 f) - -onInput :: (SyntheticInputEvent -> Effect Unit) -> Props -onInput f = unsafeMkProps "onInput" (mkEffectFn1 f) - -onInvalid :: (SyntheticInputEvent -> Effect Unit) -> Props -onInvalid f = unsafeMkProps "onInvalid" (mkEffectFn1 f) - -onSubmit :: (SyntheticInputEvent -> Effect Unit) -> Props -onSubmit f = unsafeMkProps "onSubmit" (mkEffectFn1 f) - -onClick :: (SyntheticMouseEvent -> Effect Unit) -> Props -onClick f = unsafeMkProps "onClick" (mkEffectFn1 f) - -onContextMenu :: (SyntheticMouseEvent -> Effect Unit) -> Props -onContextMenu f = unsafeMkProps "onContextMenu" (mkEffectFn1 f) - -onDoubleClick :: (SyntheticMouseEvent -> Effect Unit) -> Props -onDoubleClick f = unsafeMkProps "onDoubleClick" (mkEffectFn1 f) - -onDrag :: (SyntheticMouseEvent -> Effect Unit) -> Props -onDrag f = unsafeMkProps "onDrag" (mkEffectFn1 f) - -onDragEnd :: (SyntheticMouseEvent -> Effect Unit) -> Props -onDragEnd f = unsafeMkProps "onDragEnd" (mkEffectFn1 f) - -onDragEnter :: (SyntheticMouseEvent -> Effect Unit) -> Props -onDragEnter f = unsafeMkProps "onDragEnter" (mkEffectFn1 f) - -onDragExit :: (SyntheticMouseEvent -> Effect Unit) -> Props -onDragExit f = unsafeMkProps "onDragExit" (mkEffectFn1 f) - -onDragLeave :: (SyntheticMouseEvent -> Effect Unit) -> Props -onDragLeave f = unsafeMkProps "onDragLeave" (mkEffectFn1 f) - -onDragOver :: (SyntheticMouseEvent -> Effect Unit) -> Props -onDragOver f = unsafeMkProps "onDragOver" (mkEffectFn1 f) - -onDragStart :: (SyntheticMouseEvent -> Effect Unit) -> Props -onDragStart f = unsafeMkProps "onDragStart" (mkEffectFn1 f) - -onDrop :: (SyntheticMouseEvent -> Effect Unit) -> Props -onDrop f = unsafeMkProps "onDrop" (mkEffectFn1 f) - -onMouseDown :: (SyntheticMouseEvent -> Effect Unit) -> Props -onMouseDown f = unsafeMkProps "onMouseDown" (mkEffectFn1 f) - -onMouseEnter :: (SyntheticMouseEvent -> Effect Unit) -> Props -onMouseEnter f = unsafeMkProps "onMouseEnter" (mkEffectFn1 f) - -onMouseLeave :: (SyntheticMouseEvent -> Effect Unit) -> Props -onMouseLeave f = unsafeMkProps "onMouseLeave" (mkEffectFn1 f) - -onMouseMove :: (SyntheticMouseEvent -> Effect Unit) -> Props -onMouseMove f = unsafeMkProps "onMouseMove" (mkEffectFn1 f) - -onMouseOut :: (SyntheticMouseEvent -> Effect Unit) -> Props -onMouseOut f = unsafeMkProps "onMouseOut" (mkEffectFn1 f) - -onMouseOver :: (SyntheticMouseEvent -> Effect Unit) -> Props -onMouseOver f = unsafeMkProps "onMouseOver" (mkEffectFn1 f) - -onMouseUp :: (SyntheticMouseEvent -> Effect Unit) -> Props -onMouseUp f = unsafeMkProps "onMouseUp" (mkEffectFn1 f) - -onSelect :: (SyntheticEvent -> Effect Unit) -> Props -onSelect f = unsafeMkProps "onSelect" (mkEffectFn1 f) - -onTouchCancel :: (SyntheticTouchEvent -> Effect Unit) -> Props -onTouchCancel f = unsafeMkProps "onTouchCancel" (mkEffectFn1 f) - -onTouchEnd :: (SyntheticTouchEvent -> Effect Unit) -> Props -onTouchEnd f = unsafeMkProps "onTouchEnd" (mkEffectFn1 f) - -onTouchMove :: (SyntheticTouchEvent -> Effect Unit) -> Props -onTouchMove f = unsafeMkProps "onTouchMove" (mkEffectFn1 f) - -onTouchStart :: (SyntheticTouchEvent -> Effect Unit) -> Props -onTouchStart f = unsafeMkProps "onTouchStart" (mkEffectFn1 f) - -onScroll :: (SyntheticUIEvent -> Effect Unit) -> Props -onScroll f = unsafeMkProps "onScroll" (mkEffectFn1 f) - -onWheel :: (SyntheticWheelEvent -> Effect Unit) -> Props -onWheel f = unsafeMkProps "onWheel" (mkEffectFn1 f) - -onAnimationStartCapture :: (SyntheticAnimationEvent -> Effect Unit) -> Props -onAnimationStartCapture f = unsafeMkProps "onAnimationStartCapture" (mkEffectFn1 f) - -onAnimationEndCapture :: (SyntheticAnimationEvent -> Effect Unit) -> Props -onAnimationEndCapture f = unsafeMkProps "onAnimationEndCapture" (mkEffectFn1 f) - -onAnimationIterationCapture :: (SyntheticAnimationEvent -> Effect Unit) -> Props -onAnimationIterationCapture f = unsafeMkProps "onAnimationIterationCapture" (mkEffectFn1 f) - -onTransitionEndCapture :: (SyntheticTransitionEvent -> Effect Unit) -> Props -onTransitionEndCapture f = unsafeMkProps "onTransitionEndCapture" (mkEffectFn1 f) - -onToggleCapture :: (SyntheticEvent -> Effect Unit) -> Props -onToggleCapture f = unsafeMkProps "onToggleCapture" (mkEffectFn1 f) - -onErrorCapture :: (SyntheticEvent -> Effect Unit) -> Props -onErrorCapture f = unsafeMkProps "onErrorCapture" (mkEffectFn1 f) - -onLoadCapture :: (SyntheticEvent -> Effect Unit) -> Props -onLoadCapture f = unsafeMkProps "onLoadCapture" (mkEffectFn1 f) - -onAbortCapture :: (SyntheticEvent -> Effect Unit) -> Props -onAbortCapture f = unsafeMkProps "onAbortCapture" (mkEffectFn1 f) - -onCanPlayCapture :: (SyntheticEvent -> Effect Unit) -> Props -onCanPlayCapture f = unsafeMkProps "onCanPlayCapture" (mkEffectFn1 f) - -onCanPlayThroughCapture :: (SyntheticEvent -> Effect Unit) -> Props -onCanPlayThroughCapture f = unsafeMkProps "onCanPlayThroughCapture" (mkEffectFn1 f) - -onDurationChangeCapture :: (SyntheticEvent -> Effect Unit) -> Props -onDurationChangeCapture f = unsafeMkProps "onDurationChangeCapture" (mkEffectFn1 f) - -onEmptiedCapture :: (SyntheticEvent -> Effect Unit) -> Props -onEmptiedCapture f = unsafeMkProps "onEmptiedCapture" (mkEffectFn1 f) - -onEncryptedCapture :: (SyntheticEvent -> Effect Unit) -> Props -onEncryptedCapture f = unsafeMkProps "onEncryptedCapture" (mkEffectFn1 f) - -onEndedCapture :: (SyntheticEvent -> Effect Unit) -> Props -onEndedCapture f = unsafeMkProps "onEndedCapture" (mkEffectFn1 f) - -onLoadedDataCapture :: (SyntheticEvent -> Effect Unit) -> Props -onLoadedDataCapture f = unsafeMkProps "onLoadedDataCapture" (mkEffectFn1 f) - -onLoadedMetadataCapture :: (SyntheticEvent -> Effect Unit) -> Props -onLoadedMetadataCapture f = unsafeMkProps "onLoadedMetadataCapture" (mkEffectFn1 f) - -onLoadStartCapture :: (SyntheticEvent -> Effect Unit) -> Props -onLoadStartCapture f = unsafeMkProps "onLoadStartCapture" (mkEffectFn1 f) - -onPauseCapture :: (SyntheticEvent -> Effect Unit) -> Props -onPauseCapture f = unsafeMkProps "onPauseCapture" (mkEffectFn1 f) - -onPlayCapture :: (SyntheticEvent -> Effect Unit) -> Props -onPlayCapture f = unsafeMkProps "onPlayCapture" (mkEffectFn1 f) - -onPlayingCapture :: (SyntheticEvent -> Effect Unit) -> Props -onPlayingCapture f = unsafeMkProps "onPlayingCapture" (mkEffectFn1 f) - -onProgressCapture :: (SyntheticEvent -> Effect Unit) -> Props -onProgressCapture f = unsafeMkProps "onProgressCapture" (mkEffectFn1 f) - -onRateChangeCapture :: (SyntheticEvent -> Effect Unit) -> Props -onRateChangeCapture f = unsafeMkProps "onRateChangeCapture" (mkEffectFn1 f) - -onSeekedCapture :: (SyntheticEvent -> Effect Unit) -> Props -onSeekedCapture f = unsafeMkProps "onSeekedCapture" (mkEffectFn1 f) - -onSeekingCapture :: (SyntheticEvent -> Effect Unit) -> Props -onSeekingCapture f = unsafeMkProps "onSeekingCapture" (mkEffectFn1 f) - -onStalledCapture :: (SyntheticEvent -> Effect Unit) -> Props -onStalledCapture f = unsafeMkProps "onStalledCapture" (mkEffectFn1 f) - -onSuspendCapture :: (SyntheticEvent -> Effect Unit) -> Props -onSuspendCapture f = unsafeMkProps "onSuspendCapture" (mkEffectFn1 f) - -onTimeUpdateCapture :: (SyntheticEvent -> Effect Unit) -> Props -onTimeUpdateCapture f = unsafeMkProps "onTimeUpdateCapture" (mkEffectFn1 f) - -onVolumeChangeCapture :: (SyntheticEvent -> Effect Unit) -> Props -onVolumeChangeCapture f = unsafeMkProps "onVolumeChangeCapture" (mkEffectFn1 f) - -onWaitingCapture :: (SyntheticEvent -> Effect Unit) -> Props -onWaitingCapture f = unsafeMkProps "onWaitingCapture" (mkEffectFn1 f) - -onCopyCapture :: (SyntheticClipboardEvent -> Effect Unit) -> Props -onCopyCapture f = unsafeMkProps "onCopyCapture" (mkEffectFn1 f) - -onCutCapture :: (SyntheticClipboardEvent -> Effect Unit) -> Props -onCutCapture f = unsafeMkProps "onCutCapture" (mkEffectFn1 f) - -onPasteCapture :: (SyntheticClipboardEvent -> Effect Unit) -> Props -onPasteCapture f = unsafeMkProps "onPasteCapture" (mkEffectFn1 f) - -onCompositionEndCapture :: (SyntheticCompositionEvent -> Effect Unit) -> Props -onCompositionEndCapture f = unsafeMkProps "onCompositionEndCapture" (mkEffectFn1 f) - -onCompositionStartCapture :: (SyntheticCompositionEvent -> Effect Unit) -> Props -onCompositionStartCapture f = unsafeMkProps "onCompositionStartCapture" (mkEffectFn1 f) - -onCompositionUpdateCapture :: (SyntheticCompositionEvent -> Effect Unit) -> Props -onCompositionUpdateCapture f = unsafeMkProps "onCompositionUpdateCapture" (mkEffectFn1 f) - -onKeyDownCapture :: (SyntheticKeyboardEvent -> Effect Unit) -> Props -onKeyDownCapture f = unsafeMkProps "onKeyDownCapture" (mkEffectFn1 f) - -onKeyPressCapture :: (SyntheticKeyboardEvent -> Effect Unit) -> Props -onKeyPressCapture f = unsafeMkProps "onKeyPressCapture" (mkEffectFn1 f) - -onKeyUpCapture :: (SyntheticKeyboardEvent -> Effect Unit) -> Props -onKeyUpCapture f = unsafeMkProps "onKeyUpCapture" (mkEffectFn1 f) - -onFocusCapture :: (SyntheticFocusEvent -> Effect Unit) -> Props -onFocusCapture f = unsafeMkProps "onFocusCapture" (mkEffectFn1 f) - -onBlurCapture :: (SyntheticFocusEvent -> Effect Unit) -> Props -onBlurCapture f = unsafeMkProps "onBlurCapture" (mkEffectFn1 f) - -onChangeCapture :: (SyntheticInputEvent -> Effect Unit) -> Props -onChangeCapture f = unsafeMkProps "onChangeCapture" (mkEffectFn1 f) - -onInputCapture :: (SyntheticInputEvent -> Effect Unit) -> Props -onInputCapture f = unsafeMkProps "onInputCapture" (mkEffectFn1 f) - -onInvalidCapture :: (SyntheticInputEvent -> Effect Unit) -> Props -onInvalidCapture f = unsafeMkProps "onInvalidCapture" (mkEffectFn1 f) - -onSubmitCapture :: (SyntheticInputEvent -> Effect Unit) -> Props -onSubmitCapture f = unsafeMkProps "onSubmitCapture" (mkEffectFn1 f) - -onClickCapture :: (SyntheticMouseEvent -> Effect Unit) -> Props -onClickCapture f = unsafeMkProps "onClickCapture" (mkEffectFn1 f) - -onContextMenuCapture :: (SyntheticMouseEvent -> Effect Unit) -> Props -onContextMenuCapture f = unsafeMkProps "onContextMenuCapture" (mkEffectFn1 f) - -onDoubleClickCapture :: (SyntheticMouseEvent -> Effect Unit) -> Props -onDoubleClickCapture f = unsafeMkProps "onDoubleClickCapture" (mkEffectFn1 f) - -onDragCapture :: (SyntheticMouseEvent -> Effect Unit) -> Props -onDragCapture f = unsafeMkProps "onDragCapture" (mkEffectFn1 f) - -onDragEndCapture :: (SyntheticMouseEvent -> Effect Unit) -> Props -onDragEndCapture f = unsafeMkProps "onDragEndCapture" (mkEffectFn1 f) - -onDragEnterCapture :: (SyntheticMouseEvent -> Effect Unit) -> Props -onDragEnterCapture f = unsafeMkProps "onDragEnterCapture" (mkEffectFn1 f) - -onDragExitCapture :: (SyntheticMouseEvent -> Effect Unit) -> Props -onDragExitCapture f = unsafeMkProps "onDragExitCapture" (mkEffectFn1 f) - -onDragLeaveCapture :: (SyntheticMouseEvent -> Effect Unit) -> Props -onDragLeaveCapture f = unsafeMkProps "onDragLeaveCapture" (mkEffectFn1 f) - -onDragOverCapture :: (SyntheticMouseEvent -> Effect Unit) -> Props -onDragOverCapture f = unsafeMkProps "onDragOverCapture" (mkEffectFn1 f) - -onDragStartCapture :: (SyntheticMouseEvent -> Effect Unit) -> Props -onDragStartCapture f = unsafeMkProps "onDragStartCapture" (mkEffectFn1 f) - -onDropCapture :: (SyntheticMouseEvent -> Effect Unit) -> Props -onDropCapture f = unsafeMkProps "onDropCapture" (mkEffectFn1 f) - -onMouseDownCapture :: (SyntheticMouseEvent -> Effect Unit) -> Props -onMouseDownCapture f = unsafeMkProps "onMouseDownCapture" (mkEffectFn1 f) - -onMouseEnterCapture :: (SyntheticMouseEvent -> Effect Unit) -> Props -onMouseEnterCapture f = unsafeMkProps "onMouseEnterCapture" (mkEffectFn1 f) - -onMouseLeaveCapture :: (SyntheticMouseEvent -> Effect Unit) -> Props -onMouseLeaveCapture f = unsafeMkProps "onMouseLeaveCapture" (mkEffectFn1 f) - -onMouseMoveCapture :: (SyntheticMouseEvent -> Effect Unit) -> Props -onMouseMoveCapture f = unsafeMkProps "onMouseMoveCapture" (mkEffectFn1 f) - -onMouseOutCapture :: (SyntheticMouseEvent -> Effect Unit) -> Props -onMouseOutCapture f = unsafeMkProps "onMouseOutCapture" (mkEffectFn1 f) - -onMouseOverCapture :: (SyntheticMouseEvent -> Effect Unit) -> Props -onMouseOverCapture f = unsafeMkProps "onMouseOverCapture" (mkEffectFn1 f) - -onMouseUpCapture :: (SyntheticMouseEvent -> Effect Unit) -> Props -onMouseUpCapture f = unsafeMkProps "onMouseUpCapture" (mkEffectFn1 f) - -onSelectCapture :: (SyntheticEvent -> Effect Unit) -> Props -onSelectCapture f = unsafeMkProps "onSelectCapture" (mkEffectFn1 f) - -onTouchCancelCapture :: (SyntheticTouchEvent -> Effect Unit) -> Props -onTouchCancelCapture f = unsafeMkProps "onTouchCancelCapture" (mkEffectFn1 f) - -onTouchEndCapture :: (SyntheticTouchEvent -> Effect Unit) -> Props -onTouchEndCapture f = unsafeMkProps "onTouchEndCapture" (mkEffectFn1 f) - -onTouchMoveCapture :: (SyntheticTouchEvent -> Effect Unit) -> Props -onTouchMoveCapture f = unsafeMkProps "onTouchMoveCapture" (mkEffectFn1 f) - -onTouchStartCapture :: (SyntheticTouchEvent -> Effect Unit) -> Props -onTouchStartCapture f = unsafeMkProps "onTouchStartCapture" (mkEffectFn1 f) - -onScrollCapture :: (SyntheticUIEvent -> Effect Unit) -> Props -onScrollCapture f = unsafeMkProps "onScrollCapture" (mkEffectFn1 f) - -onWheelCapture :: (SyntheticWheelEvent -> Effect Unit) -> Props -onWheelCapture f = unsafeMkProps "onWheelCapture" (mkEffectFn1 f) - -ref :: Ref.RefHandler Ref.NativeNode -> Props -ref = unsafeMkProps "ref" - -suppressContentEditableWarning :: Boolean -> Props -suppressContentEditableWarning = unsafeMkProps "suppressContentEditableWarning" - --- SVG attributes -x :: Int -> Props -x = unsafeMkProps "x" - -y :: Int -> Props -y = unsafeMkProps "y" - -cx :: Int -> Props -cx = unsafeMkProps "cx" - -cy :: Int -> Props -cy = unsafeMkProps "cy" - -r :: Int -> Props -r = unsafeMkProps "r" - -fill :: String -> Props -fill = unsafeMkProps "fill" - -opacity :: Int -> Props -opacity = unsafeMkProps "opacity" - -fillOpacity :: Int -> Props -fillOpacity = unsafeMkProps "fillOpacity" - -stroke :: String -> Props -stroke = unsafeMkProps "stroke" - -strokeWidth :: Int -> Props -strokeWidth = unsafeMkProps "strokeWidth" - -points :: String -> Props -points = unsafeMkProps "points" - -d :: String -> Props -d = unsafeMkProps "d" - -viewBox :: String -> Props -viewBox = unsafeMkProps "viewBox" diff --git a/stark/src/Stark/DOM/SVG.purs b/stark/src/Stark/DOM/SVG.purs deleted file mode 100644 index 1c57570..0000000 --- a/stark/src/Stark/DOM/SVG.purs +++ /dev/null @@ -1,116 +0,0 @@ -module Stark.DOM.SVG where - -import Stark (StarkElement) -import Stark.DOM (IsDynamic(..), mkDOM) -import Stark.DOM.Props (Props) - -circle :: Array Props -> Array StarkElement -> StarkElement -circle = mkDOM (IsDynamic false) "circle" - -circle' :: Array StarkElement -> StarkElement -circle' = circle [] - -clipPath :: Array Props -> Array StarkElement -> StarkElement -clipPath = mkDOM (IsDynamic false) "clipPath" - -clipPath' :: Array StarkElement -> StarkElement -clipPath' = clipPath [] - -defs :: Array Props -> Array StarkElement -> StarkElement -defs = mkDOM (IsDynamic false) "defs" - -defs' :: Array StarkElement -> StarkElement -defs' = defs [] - -ellipse :: Array Props -> Array StarkElement -> StarkElement -ellipse = mkDOM (IsDynamic false) "ellipse" - -ellipse' :: Array StarkElement -> StarkElement -ellipse' = ellipse [] - -foreignObject :: Array Props -> Array StarkElement -> StarkElement -foreignObject = mkDOM (IsDynamic false) "foreignObject" - -g :: Array Props -> Array StarkElement -> StarkElement -g = mkDOM (IsDynamic false) "g" - -g' :: Array StarkElement -> StarkElement -g' = g [] - -line :: Array Props -> Array StarkElement -> StarkElement -line = mkDOM (IsDynamic false) "line" - -line' :: Array StarkElement -> StarkElement -line' = line [] - -linearGradient :: Array Props -> Array StarkElement -> StarkElement -linearGradient = mkDOM (IsDynamic false) "linearGradient" - -linearGradient' :: Array StarkElement -> StarkElement -linearGradient' = linearGradient [] - -mask :: Array Props -> Array StarkElement -> StarkElement -mask = mkDOM (IsDynamic false) "mask" - -mask' :: Array StarkElement -> StarkElement -mask' = mask [] - -path :: Array Props -> Array StarkElement -> StarkElement -path = mkDOM (IsDynamic false) "path" - -path' :: Array StarkElement -> StarkElement -path' = path [] - -pattern :: Array Props -> Array StarkElement -> StarkElement -pattern = mkDOM (IsDynamic false) "pattern" - -pattern' :: Array StarkElement -> StarkElement -pattern' = pattern [] - -polygon :: Array Props -> Array StarkElement -> StarkElement -polygon = mkDOM (IsDynamic false) "polygon" - -polygon' :: Array StarkElement -> StarkElement -polygon' = polygon [] - -polyline :: Array Props -> Array StarkElement -> StarkElement -polyline = mkDOM (IsDynamic false) "polyline" - -polyline' :: Array StarkElement -> StarkElement -polyline' = polyline [] - -radialGradient :: Array Props -> Array StarkElement -> StarkElement -radialGradient = mkDOM (IsDynamic false) "radialGradient" - -radialGradient' :: Array StarkElement -> StarkElement -radialGradient' = radialGradient [] - -rect :: Array Props -> Array StarkElement -> StarkElement -rect = mkDOM (IsDynamic false) "rect" - -rect' :: Array StarkElement -> StarkElement -rect' = rect [] - -stop :: Array Props -> Array StarkElement -> StarkElement -stop = mkDOM (IsDynamic false) "stop" - -stop' :: Array StarkElement -> StarkElement -stop' = stop [] - -svg :: Array Props -> Array StarkElement -> StarkElement -svg = mkDOM (IsDynamic false) "svg" - -svg' :: Array StarkElement -> StarkElement -svg' = svg [] - -text :: Array Props -> Array StarkElement -> StarkElement -text = mkDOM (IsDynamic false) "text" - -text' :: Array StarkElement -> StarkElement -text' = text [] - -tspan :: Array Props -> Array StarkElement -> StarkElement -tspan = mkDOM (IsDynamic false) "tspan" - -tspan' :: Array StarkElement -> StarkElement -tspan' = tspan [] diff --git a/stark/src/Stark/Ref.purs b/stark/src/Stark/Ref.purs deleted file mode 100644 index eb81ac6..0000000 --- a/stark/src/Stark/Ref.purs +++ /dev/null @@ -1,53 +0,0 @@ -module Stark.Ref - ( Ref - , RefHandler - , StarkInstance - , NativeNode - , fromRef - , fromEffect - , getCurrentRef - , createNodeRef - , createInstanceRef - ) where - -import Prelude - -import Data.Maybe (Maybe(..)) -import Effect (Effect) - ---- | An instance of a Stark class. -data StarkInstance = StarkInstance - ---- | A platform-specific native layout node. On the web this will be a DOM ---- | element (see `Web.HTML.HTMLElement`). -data NativeNode = NativeNode -data Ref a = Ref -data RefHandler a = RefHandler - - -createRef :: forall a. Effect (Ref a) -createRef = pure Ref - - -liftCallbackRef :: forall a. Ref a -> Ref a -liftCallbackRef r = r - - -createNodeRef :: Effect (Ref NativeNode) -createNodeRef = createRef - - -createInstanceRef :: Effect (Ref StarkInstance) -createInstanceRef = createRef - - -fromRef :: forall a. Ref a -> RefHandler a -fromRef _ = RefHandler - - -fromEffect :: forall a. (Ref a -> Effect Unit) -> RefHandler a -fromEffect _ = RefHandler - - -getCurrentRef :: forall a. Ref a -> Effect (Maybe a) -getCurrentRef _ = pure Nothing diff --git a/stark/src/Stark/SyntheticEvent.purs b/stark/src/Stark/SyntheticEvent.purs deleted file mode 100644 index 006ea27..0000000 --- a/stark/src/Stark/SyntheticEvent.purs +++ /dev/null @@ -1,404 +0,0 @@ --- | Synthethic event representation for Stark. -module Stark.SyntheticEvent - ( SyntheticEvent - , SyntheticAnimationEvent - , SyntheticClipboardEvent - , SyntheticCompositionEvent - , SyntheticInputEvent - , SyntheticKeyboardEvent - , SyntheticFocusEvent - , SyntheticMouseEvent - , SyntheticTouchEvent - , SyntheticTransitionEvent - , SyntheticUIEvent - , SyntheticWheelEvent - - , SyntheticEvent' - , SyntheticAnimationEvent' - , SyntheticClipboardEvent' - , SyntheticCompositionEvent' - , SyntheticFocusEvent' - , SyntheticKeyboardEvent' - , SyntheticMouseEvent' - , SyntheticTouchEvent' - , SyntheticTransitionEvent' - , SyntheticUIEvent' - , SyntheticWheelEvent' - - , SyntheticEvent_ - - , NativeEventTarget - , NativeEvent - , NativeDataTransfer - , NativeAbstractView - , NativeTouchList - - , bubbles - , cancelable - , currentTarget - , defaultPrevented - , eventPhase - , isTrusted - , nativeEvent - , preventDefault - , isDefaultPrevented - , stopPropagation - , isPropagationStopped - , target - , timeStamp - , type_ - , persist - , animationName - , clipboardData - , data_ - , relatedTarget - , charCode - , key - , keyCode - , locale - , location - , repeat - , which - , button - , buttons - , clientX - , clientY - , pageX - , pageY - , screenX - , screenY - , changedTouches - , targetTouches - , touches - , altKey - , ctrlKey - , getModifierState - , metaKey - , shiftKey - , propertyName - , pseudoElement - , elapsedTime - , detail - , view - , deltaMode - , deltaX - , deltaY - , deltaZ - ) where - -import Prelude - -import Data.Symbol (class IsSymbol, SProxy(..)) -import Effect (Effect) -import Prim.Row (class Cons) -import Record as R - --- import Prim.Row as Row - -type SyntheticEvent - = SyntheticEvent_ (SyntheticEvent' ()) - -type SyntheticAnimationEvent - = SyntheticEvent_ (SyntheticAnimationEvent' (SyntheticEvent' ())) - -type SyntheticClipboardEvent - = SyntheticEvent_ (SyntheticClipboardEvent' (SyntheticEvent' ())) - -type SyntheticCompositionEvent - = SyntheticEvent_ (SyntheticCompositionEvent' (SyntheticUIEvent' (SyntheticEvent' ()))) - -type SyntheticInputEvent - = SyntheticEvent_ (SyntheticUIEvent' (SyntheticEvent' ())) - -type SyntheticKeyboardEvent - = SyntheticEvent_ (SyntheticKeyboardEvent' (SyntheticUIEvent' (SyntheticEvent' ()))) - -type SyntheticFocusEvent - = SyntheticEvent_ (SyntheticFocusEvent' (SyntheticUIEvent' (SyntheticEvent' ()))) - -type SyntheticMouseEvent - = SyntheticEvent_ (SyntheticMouseEvent' (SyntheticUIEvent' (SyntheticEvent' ()))) - -type SyntheticTouchEvent - = SyntheticEvent_ (SyntheticTouchEvent' (SyntheticUIEvent' (SyntheticEvent' ()))) - -type SyntheticTransitionEvent - = SyntheticEvent_ (SyntheticTransitionEvent' (SyntheticEvent' ())) - -type SyntheticUIEvent - = SyntheticEvent_ (SyntheticUIEvent' (SyntheticEvent' ())) - -type SyntheticWheelEvent - = SyntheticEvent_ (SyntheticWheelEvent' (SyntheticMouseEvent' (SyntheticEvent' ()))) - -type SyntheticEvent_ (r :: # Type) = Record r - -data NativeEventTarget = NativeEventTarget - -data NativeEvent = NativeEvent - -data NativeDataTransfer = NativeDataTransfer - -data NativeAbstractView = NativeAbstractView - -data NativeTouchList = NativeTouchList - -type SyntheticEvent' r - = ( bubbles :: Boolean - , cancelable :: Boolean - , currentTarget :: NativeEventTarget - , defaultPrevented :: Boolean - , eventPhase :: Number - , isTrusted :: Boolean - , nativeEvent :: NativeEvent - , target :: NativeEventTarget - , timeStamp :: Number - , type :: String - | r - ) - -type SyntheticAnimationEvent' r - = ( animationName :: String - , pseudoElement :: String - , elapsedTime :: Number - | r - ) - -type SyntheticClipboardEvent' r - = ( clipboardData :: NativeDataTransfer - | r - ) - -type SyntheticCompositionEvent' r - = ( data :: String - | r - ) - -type SyntheticFocusEvent' r - = ( relatedTarget :: NativeEventTarget - | r - ) - -type SyntheticKeyboardEvent' r - = ( altKey :: Boolean - , ctrlKey :: Boolean - , getModifierState :: String -> Boolean - , charCode :: Int - , key :: String - , keyCode :: Number - , locale :: String - , location :: Number - , metaKey :: Boolean - , repeat :: Boolean - , shiftKey :: Boolean - , which :: Number - | r - ) - -type SyntheticMouseEvent' r - = ( altKey :: Boolean - , button :: Number - , buttons :: Number - , clientX :: Number - , clientY :: Number - , ctrlKey :: Boolean - , getModifierState :: String -> Boolean - , metaKey :: Boolean - , pageX :: Number - , pageY :: Number - , relatedTarget :: NativeEventTarget - , screenX :: Number - , screenY :: Number - , shiftKey :: Boolean - | r - ) - -type SyntheticTouchEvent' r - = ( altKey :: Boolean - , changedTouches :: NativeTouchList - , ctrlKey :: Boolean - , getModifierState :: String -> Boolean - , metaKey :: Boolean - , targetTouches :: NativeTouchList - , shiftKey :: Boolean - , touches :: NativeTouchList - | r - ) - -type SyntheticTransitionEvent' r - = ( propertyName :: String - , pseudoElement :: String - , elapsedTime :: Number - | r - ) - -type SyntheticUIEvent' r - = ( detail :: Number - , view :: NativeAbstractView - | r - ) - -type SyntheticWheelEvent' r - = ( deltaMode :: Number - , deltaX :: Number - , deltaY :: Number - , deltaZ :: Number - | r - ) - -bubbles :: forall r. SyntheticEvent_ (bubbles :: Boolean | r) -> Effect Boolean -bubbles = get (SProxy :: SProxy "bubbles") - -cancelable :: forall r. SyntheticEvent_ (cancelable :: Boolean | r) -> Effect Boolean -cancelable = get (SProxy :: SProxy "cancelable") - -currentTarget :: forall r. SyntheticEvent_ (currentTarget :: NativeEventTarget | r) -> Effect NativeEventTarget -currentTarget = get (SProxy :: SProxy "currentTarget") - -defaultPrevented :: forall r. SyntheticEvent_ (defaultPrevented :: Boolean | r) -> Effect Boolean -defaultPrevented = get (SProxy :: SProxy "defaultPrevented") - -eventPhase :: forall r. SyntheticEvent_ (eventPhase :: Number | r) -> Effect Number -eventPhase = get (SProxy :: SProxy "eventPhase") - -isTrusted :: forall r. SyntheticEvent_ (isTrusted :: Boolean | r) -> Effect Boolean -isTrusted = get (SProxy :: SProxy "isTrusted") - -nativeEvent :: forall r. SyntheticEvent_ (nativeEvent :: NativeEvent | r) -> Effect NativeEvent -nativeEvent = get (SProxy :: SProxy "nativeEvent") - -target :: forall r. SyntheticEvent_ (target :: NativeEventTarget | r) -> Effect NativeEventTarget -target = get (SProxy :: SProxy "target") - -timeStamp :: forall r. SyntheticEvent_ (timeStamp :: Number | r) -> Effect Number -timeStamp = get (SProxy :: SProxy "timeStamp") - -type_ :: forall r. SyntheticEvent_ (type :: String | r) -> Effect String -type_ = get (SProxy :: SProxy "type") - -animationName :: forall r. SyntheticEvent_ (animationName :: String | r) -> Effect String -animationName = get (SProxy :: SProxy "animationName") - -clipboardData :: forall r. SyntheticEvent_ (clipboardData :: NativeDataTransfer | r) -> Effect NativeDataTransfer -clipboardData = get (SProxy :: SProxy "clipboardData") - -data_ :: forall r. SyntheticEvent_ (data :: String | r) -> Effect String -data_ = get (SProxy :: SProxy "data") - -relatedTarget :: forall r. SyntheticEvent_ (relatedTarget :: NativeEventTarget | r) -> Effect NativeEventTarget -relatedTarget = get (SProxy :: SProxy "relatedTarget") - -charCode :: forall r. SyntheticEvent_ (charCode :: Int | r) -> Effect Int -charCode = get (SProxy :: SProxy "charCode") - -key :: forall r. SyntheticEvent_ (key :: String | r) -> Effect String -key = get (SProxy :: SProxy "key") - -keyCode :: forall r. SyntheticEvent_ (keyCode :: Number | r) -> Effect Number -keyCode = get (SProxy :: SProxy "keyCode") - -locale :: forall r. SyntheticEvent_ (locale :: String | r) -> Effect String -locale = get (SProxy :: SProxy "locale") - -location :: forall r. SyntheticEvent_ (location :: Number | r) -> Effect Number -location = get (SProxy :: SProxy "location") - -repeat :: forall r. SyntheticEvent_ (repeat :: Boolean | r) -> Effect Boolean -repeat = get (SProxy :: SProxy "repeat") - -which :: forall r. SyntheticEvent_ (which :: Number | r) -> Effect Number -which = get (SProxy :: SProxy "which") - -button :: forall r. SyntheticEvent_ (button :: Number | r) -> Effect Number -button = get (SProxy :: SProxy "button") - -buttons :: forall r. SyntheticEvent_ (buttons :: Number | r) -> Effect Number -buttons = get (SProxy :: SProxy "buttons") - -clientX :: forall r. SyntheticEvent_ (clientX :: Number | r) -> Effect Number -clientX = get (SProxy :: SProxy "clientX") - -clientY :: forall r. SyntheticEvent_ (clientY :: Number | r) -> Effect Number -clientY = get (SProxy :: SProxy "clientY") - -pageX :: forall r. SyntheticEvent_ (pageX :: Number | r) -> Effect Number -pageX = get (SProxy :: SProxy "pageX") - -pageY :: forall r. SyntheticEvent_ (pageY :: Number | r) -> Effect Number -pageY = get (SProxy :: SProxy "pageY") - -screenX :: forall r. SyntheticEvent_ (screenX :: Number | r) -> Effect Number -screenX = get (SProxy :: SProxy "screenX") - -screenY :: forall r. SyntheticEvent_ (screenY :: Number | r) -> Effect Number -screenY = get (SProxy :: SProxy "screenY") - -changedTouches :: forall r. SyntheticEvent_ (changedTouches :: NativeTouchList | r) -> Effect NativeTouchList -changedTouches = get (SProxy :: SProxy "changedTouches") - -targetTouches :: forall r. SyntheticEvent_ (targetTouches :: NativeTouchList | r) -> Effect NativeTouchList -targetTouches = get (SProxy :: SProxy "targetTouches") - -touches :: forall r. SyntheticEvent_ (touches :: NativeTouchList | r) -> Effect NativeTouchList -touches = get (SProxy :: SProxy "touches") - -altKey :: forall r. SyntheticEvent_ (altKey :: Boolean | r) -> Effect Boolean -altKey = get (SProxy :: SProxy "altKey") - -ctrlKey :: forall r. SyntheticEvent_ (ctrlKey :: Boolean | r) -> Effect Boolean -ctrlKey = get (SProxy :: SProxy "ctrlKey") - -metaKey :: forall r. SyntheticEvent_ (metaKey :: Boolean | r) -> Effect Boolean -metaKey = get (SProxy :: SProxy "metaKey") - -shiftKey :: forall r. SyntheticEvent_ (shiftKey :: Boolean | r) -> Effect Boolean -shiftKey = get (SProxy :: SProxy "shiftKey") - -propertyName :: forall r. SyntheticEvent_ (propertyName :: String | r) -> Effect String -propertyName = get (SProxy :: SProxy "propertyName") - -pseudoElement :: forall r. SyntheticEvent_ (pseudoElement :: String | r) -> Effect String -pseudoElement = get (SProxy :: SProxy "pseudoElement") - -elapsedTime :: forall r. SyntheticEvent_ (elapsedTime :: Number | r) -> Effect Number -elapsedTime = get (SProxy :: SProxy "elapsedTime") - -detail :: forall r. SyntheticEvent_ (detail :: Number | r) -> Effect Number -detail = get (SProxy :: SProxy "detail") - -view :: forall r. SyntheticEvent_ (view :: NativeAbstractView | r) -> Effect NativeAbstractView -view = get (SProxy :: SProxy "view") - -deltaMode :: forall r. SyntheticEvent_ (deltaMode :: Number | r) -> Effect Number -deltaMode = get (SProxy :: SProxy "deltaMode") - -deltaX :: forall r. SyntheticEvent_ (deltaX :: Number | r) -> Effect Number -deltaX = get (SProxy :: SProxy "deltaX") - -deltaY :: forall r. SyntheticEvent_ (deltaY :: Number | r) -> Effect Number -deltaY = get (SProxy :: SProxy "deltaY") - -deltaZ :: forall r. SyntheticEvent_ (deltaZ :: Number | r) -> Effect Number -deltaZ = get (SProxy :: SProxy "deltaZ") - -preventDefault :: forall r. SyntheticEvent_ r -> Effect Unit -preventDefault _ = pure unit - -isDefaultPrevented :: forall r. SyntheticEvent_ r -> Effect Boolean -isDefaultPrevented _ = pure true - -stopPropagation :: forall r. SyntheticEvent_ r -> Effect Unit -stopPropagation _ = pure unit - -isPropagationStopped :: forall r. SyntheticEvent_ r -> Effect Boolean -isPropagationStopped _ = pure true - -persist :: forall r. SyntheticEvent_ r -> Effect Unit -persist _ = pure unit - -getModifierState :: forall r. String -> SyntheticEvent_ (getModifierState :: String -> Boolean | r) -> Effect Boolean -getModifierState _ _ = pure false - --- GET a field out of a record -get :: forall a s x r. IsSymbol s => Cons s a x r => SProxy s -> Record r -> Effect a -get s l = pure $ R.get s l