From 12cc426327de615614a86925ced5cd2c303e05ed Mon Sep 17 00:00:00 2001 From: Kirill Kuznetsov Date: Mon, 3 Apr 2023 18:29:55 +0300 Subject: [PATCH 1/4] Fix type of defaultChecked property (#52) --- codegen/consts.js | 1 + src/React/Basic/DOM/Generated.purs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/codegen/consts.js b/codegen/consts.js index 9021ffa..3614672 100644 --- a/codegen/consts.js +++ b/codegen/consts.js @@ -44,6 +44,7 @@ module.exports.types = { "controls": "Boolean", "dangerouslySetInnerHTML": "{ __html :: String }", "default": "Boolean", + "defaultChecked": "Boolean", "defer": "Boolean", "disabled": "Boolean", "draggable": "Boolean", diff --git a/src/React/Basic/DOM/Generated.purs b/src/React/Basic/DOM/Generated.purs index 3f6113b..1ac3f4c 100644 --- a/src/React/Basic/DOM/Generated.purs +++ b/src/React/Basic/DOM/Generated.purs @@ -8180,7 +8180,7 @@ type Props_input = , dangerouslySetInnerHTML :: { __html :: String } , datatype :: String , dateTime :: String - , defaultChecked :: String + , defaultChecked :: Boolean , defaultValue :: String , dir :: String , disabled :: Boolean From 5480bcf853bd551afbfb65db724b9ab8db3beba5 Mon Sep 17 00:00:00 2001 From: Peter Murphy <26548438+ptrfrncsmrph@users.noreply.github.com> Date: Thu, 18 May 2023 14:21:49 -0400 Subject: [PATCH 2/4] Add flushSync --- src/React/Basic/DOM.js | 4 ++++ src/React/Basic/DOM.purs | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/React/Basic/DOM.js b/src/React/Basic/DOM.js index de26467..257f887 100644 --- a/src/React/Basic/DOM.js +++ b/src/React/Basic/DOM.js @@ -19,3 +19,7 @@ export function unmount(node) { export function createPortal(jsx) { return (node) => ReactDOM.createPortal(jsx, node); } + +export function flushSync(callback) { + return () => ReactDOM.flushSync(callback); +} diff --git a/src/React/Basic/DOM.purs b/src/React/Basic/DOM.purs index fc20ffb..0acb058 100644 --- a/src/React/Basic/DOM.purs +++ b/src/React/Basic/DOM.purs @@ -13,6 +13,7 @@ module React.Basic.DOM , unmount , createPortal , text + , flushSync , module Generated ) where @@ -100,4 +101,15 @@ foreign import createPortal :: JSX -> Element -> JSX -- | Create a text node. text :: String -> JSX -text = unsafeCoerce \ No newline at end of file +text = unsafeCoerce + +-- | `flushSync` lets you force React to flush any updates inside the provided +-- | callback synchronously. This ensures that the DOM is updated immediately. +-- | +-- | ```purs +-- | let +-- | handleNewChatMessage msg = do +-- | flushSync (setMessages (_ <> [msg])) +-- | scrollToLastMessage +-- | ``` +foreign import flushSync :: forall a. Effect a -> Effect a From bee08c7c7f3e330d39a6819c0e1a27a5532a586d Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Fri, 8 Nov 2024 19:23:15 +0300 Subject: [PATCH 3/4] Support `onClose` event in `dialog` element See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/close_event --- codegen/consts.js | 1 + codegen/react-html-attributes.json | 1 + src/React/Basic/DOM/Generated.purs | 1 + src/React/Basic/DOM/Simplified/Generated.purs | 1 + 4 files changed, 4 insertions(+) diff --git a/codegen/consts.js b/codegen/consts.js index 3614672..69f9396 100644 --- a/codegen/consts.js +++ b/codegen/consts.js @@ -67,6 +67,7 @@ module.exports.types = { "onCanPlayThrough": "EventHandler", "onChange": "EventHandler", "onClick": "EventHandler", + "onClose": "EventHandler", "onCompositionEnd": "EventHandler", "onCompositionStart": "EventHandler", "onCompositionUpdate": "EventHandler", diff --git a/codegen/react-html-attributes.json b/codegen/react-html-attributes.json index be7bf9a..1f3e89d 100644 --- a/codegen/react-html-attributes.json +++ b/codegen/react-html-attributes.json @@ -233,6 +233,7 @@ "title" ], "dialog": [ + "onClose", "open" ], "embed": [ diff --git a/src/React/Basic/DOM/Generated.purs b/src/React/Basic/DOM/Generated.purs index 1ac3f4c..0733415 100644 --- a/src/React/Basic/DOM/Generated.purs +++ b/src/React/Basic/DOM/Generated.purs @@ -4310,6 +4310,7 @@ type Props_dialog = , onAnimationStart :: EventHandler , onBlur :: EventHandler , onClick :: EventHandler + , onClose :: EventHandler , onCompositionEnd :: EventHandler , onCompositionStart :: EventHandler , onCompositionUpdate :: EventHandler diff --git a/src/React/Basic/DOM/Simplified/Generated.purs b/src/React/Basic/DOM/Simplified/Generated.purs index 775c396..c2c5279 100644 --- a/src/React/Basic/DOM/Simplified/Generated.purs +++ b/src/React/Basic/DOM/Simplified/Generated.purs @@ -3884,6 +3884,7 @@ type Props_dialog = , onAnimationStart :: EventHandler , onBlur :: EventHandler , onClick :: EventHandler + , onClose :: EventHandler , onCompositionEnd :: EventHandler , onCompositionStart :: EventHandler , onCompositionUpdate :: EventHandler From 19b00828d80508fc8a80ec2ad04fb4e5af1c4253 Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Fri, 8 Nov 2024 19:33:06 +0300 Subject: [PATCH 4/4] Add explanation on how to modify the generated files --- codegen/index.js | 19 +++++++++---------- src/React/Basic/DOM/Generated.purs | 7 +++++-- src/React/Basic/DOM/SVG.purs | 7 +++++-- src/React/Basic/DOM/Simplified/Generated.purs | 7 +++++-- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/codegen/index.js b/codegen/index.js index 7dda1b4..4015eaf 100644 --- a/codegen/index.js +++ b/codegen/index.js @@ -5,10 +5,15 @@ const htmlGenFile = "../src/React/Basic/DOM/Generated.purs"; const htmlSimplifiedGenFile = "../src/React/Basic/DOM/Simplified/Generated.purs"; const svgGenFile = "../src/React/Basic/DOM/SVG.purs"; -const htmlHeader = `-- | ---------------------------------------- +const warningHeader = `-- | ------------------------------------------------------------ -- | THIS FILE IS GENERATED -- DO NOT EDIT IT --- | ---------------------------------------- +-- | Instead edit files under 'codegen/' dir and regenerate with: +-- | npm install +-- | node ./index.js +-- | ------------------------------------------------------------ +`; +const htmlHeader = `${warningHeader} module React.Basic.DOM.Generated where import Data.Nullable (Nullable) @@ -23,10 +28,7 @@ import Web.DOM (Node) `; -const simplifiedHtmlHeader = `-- | ---------------------------------------- --- | THIS FILE IS GENERATED -- DO NOT EDIT IT --- | ---------------------------------------- - +const simplifiedHtmlHeader = `${warningHeader} module React.Basic.DOM.Simplified.Generated where import Data.Nullable (Nullable) @@ -55,10 +57,7 @@ const propType = (e, p) => { } } -const svgHeader = `-- | ---------------------------------------- --- | THIS FILE IS GENERATED -- DO NOT EDIT IT --- | ---------------------------------------- - +const svgHeader = `${warningHeader} module React.Basic.DOM.SVG where import Data.Nullable (Nullable) diff --git a/src/React/Basic/DOM/Generated.purs b/src/React/Basic/DOM/Generated.purs index 0733415..03cd1c1 100644 --- a/src/React/Basic/DOM/Generated.purs +++ b/src/React/Basic/DOM/Generated.purs @@ -1,6 +1,9 @@ --- | ---------------------------------------- +-- | ------------------------------------------------------------ -- | THIS FILE IS GENERATED -- DO NOT EDIT IT --- | ---------------------------------------- +-- | Instead edit files under 'codegen/' dir and regenerate with: +-- | npm install +-- | node ./index.js +-- | ------------------------------------------------------------ module React.Basic.DOM.Generated where diff --git a/src/React/Basic/DOM/SVG.purs b/src/React/Basic/DOM/SVG.purs index c5ec0dc..2082bb1 100644 --- a/src/React/Basic/DOM/SVG.purs +++ b/src/React/Basic/DOM/SVG.purs @@ -1,6 +1,9 @@ --- | ---------------------------------------- +-- | ------------------------------------------------------------ -- | THIS FILE IS GENERATED -- DO NOT EDIT IT --- | ---------------------------------------- +-- | Instead edit files under 'codegen/' dir and regenerate with: +-- | npm install +-- | node ./index.js +-- | ------------------------------------------------------------ module React.Basic.DOM.SVG where diff --git a/src/React/Basic/DOM/Simplified/Generated.purs b/src/React/Basic/DOM/Simplified/Generated.purs index c2c5279..6209ec4 100644 --- a/src/React/Basic/DOM/Simplified/Generated.purs +++ b/src/React/Basic/DOM/Simplified/Generated.purs @@ -1,6 +1,9 @@ --- | ---------------------------------------- +-- | ------------------------------------------------------------ -- | THIS FILE IS GENERATED -- DO NOT EDIT IT --- | ---------------------------------------- +-- | Instead edit files under 'codegen/' dir and regenerate with: +-- | npm install +-- | node ./index.js +-- | ------------------------------------------------------------ module React.Basic.DOM.Simplified.Generated where pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy