Releases: meliorence/react-native-render-html
v5.1.0
Bugfixes
- prop
source.uri
failing to cause HTML to load
Features
allowWhitespaceNodes
prop to avoid removal of whitespace-filled text nodes (thanks @mysport12)- re-renders on
baseFontStyle
updates (port from dev/4.x branch)
Release 6.0.0-alpha.15
6.0.0-alpha.15 (2021-02-11)
Bug Fixes
- pressable block elements should receive
viewProps
(3134be1)
Features
- accessibility for images with role and label (02b5232)
- new
cachedNaturalDimensions
prop touseIMGelementState
hook (eaca370) - new
TRenderEngineProvider
andRenderHTMLFragment
components (38176ed) - new
useIMGElementStateWithCache
hook for images (7958f43) - reexport useful types from css-processor (78c5a93)
- reexport useful variables and types from transient-render-engine (7043e0c)
- reuse 'img' renderer internal logic w/t
useIMGElementState
hook (79e9158), closes #424 - support accessibility for
a
elements (69623c8), closes #285 - support source.headers in
useIMGElementState
hook (e4a0877) - warn user of API misusage even when
debug
is set to false (f5dd83c)
Release 6.0.0-alpha.14
Release 6.0.0-alpha.13
6.0.0-alpha.13 (2021-02-08)
Bug Fixes
Release 6.0.0-alpha.12
6.0.0-alpha.12 (2021-02-03)
Bug Fixes
- missing
onPress
handling in TPhrasingRenderer (718d8a3)
Features
- add
defaultViewProps
prop (d78a74b) - add
target
argument toonLinkPress
handler (ae035f4) - distinguish between rendered embedded and others (f7693b3)
- new
onDocumentMetadataLoaded
prop (14db262) - port
domNodeToHTMLString
(54a100c) - support a minimal table renderer (46d6d0c)
- support relative URLs and document metadata (
useDocumentMetadata
anduseNormalizedUrl
hooks +source.baseUrl
prop for inline sources) (22220d4)
Release 6.0.0-alpha.11
6.0.0-alpha.11 (2021-01-27)
Bug Fixes
- inject textProps in TText renderers (29ea34c)
- missing proptype (onHTMLLoaded) (74a56ae)
- prettier, consistant and scalable list rendering (7c2e26a)
Code Refactoring
Features
- add getStyleFromNetstLevel prop to HTMLListElement (5695fea)
- expose default renderers logic for extensibility (691f9cf), closes #424
- implement
defaultTextProps
prop (13d7abf) - implement
useInternalRenderer
hook to reuse internal rendering logic (add307c) - implement computeEmbeddedMaxWidth prop as per RFC001@2.0.0 (9ee8475)
- nesting ol and ul will result in disinct bullet style types (a18016f), closes #312
- port
alterData
,alterChildren
andalterNode
(1e0002b) - port
ignoreDOMNode
hook (8a0d14f) - port
ignoredTags
prop (9d2f5d5) - port
emSize
prop (f567532) - safe typeguards in
extendDefaultRenderer
(eb565df) - support
htmlParserOptions
prop (3e5de96) - support
source
prop, identical to react-native-webview (ed74eb9) - support WebView and defaultWebViewProps (fe177d7)
BREAKING CHANGES
-
ignoreNodesFunction
has been renamedignoreDOMNode
. -
the names of hooks to alter DOM content have been changed for clarity:
alterData
becomesalterDOMData
alterChildren
becomesalterDOMChildren
alterNode
becomesalterDOMElement
-
dropped ptSize prop. Point is supposed to be an absolute (pixel independant) size and unfit for display devices. It will be translated by the CSS processor to an absolute unit.
-
containerStyle
andcustomContainer
props have been dropped. UsebaseStyle
prop instead to style the root component. -
drop
textSelectable
andallowFontScaling
. UsedefaultTextProps.selectable
anddefaultTextProps.allowFontScaling
instead. -
uri
andhtml
props have been dropped. Replaceuri
withsource={{ uri: 'http://...' }}
andhtml
withsource={{ html: '<div> ...' }}
. The former now allowsbody
,headers
andmethod
fields. -
decodeEntities
prop has been dropped. Pass this option tohtmlParserOptions
prop instead. -
computeImagesMaxWidth
has been replaced withcomputeEmbeddedMaxWidth
. The two props are very similar, but the latest takes an extra argument, "tagName", which is the tag for which a width constrain should be enforced. It is planned to work with the @native-html/iframe-plugin extension. -
the object returned by
splitBoxModelStyle
has more legible field names,boxModelStyle
andotherStyle
. -
extendRenderer
has been renamed toextendDefaultRenderer
. Also note:- The first argument can be the name of the tag to extend;
- The second argument is now a partial model;
v5.0.1
v5.0.1
Bugfixes
- Accurate typescript typings for
onParsed
,alterData
,alterChildren
(thanks @SPWizard01)
v5.0.0
Give us feedback on this release in the official thread
Enhancements
- New
source
prop which deprecateshtml
anduri
props. This prop supportsmethod
,body
andheaders
fields 🚀 - Brand new
HTMLImage
component which should be much better at adapting its size to available width. For this to happen, you must passcontentWidth
prop. We recommend usinguseWindowDimensions().width
to handle screen rotation gracefully. If you don't want your images to grow after a certain size, you could usecomputeEmbeddedMaxWidth
. Read the RFC document “A
Deterministic Approach to Embedded Content Scaling” for more details. - New prop
computeEmbeddedMaxWidth
(see usage above). - New prop
contentWidth
(see usage above). - New prop
htmlParserOptions
to override htmlparser2 ParserOptions object, thanks @fabianlee1211. onLinkPress
has now a default value: open links withLinking
API (recommended).- Add Podspec file, thanks @systemride
- New
WebView
optional prop for plugins which requires it, see @native-html/plugins, thanks
@IjzerenHein - New
defaultTextProps
, thanks @Peretz30 - New
defaultWebViewProps
forWebView
-based plugins (tables, iframes...). - Export
constructStyles
,getParentsTagsRecursively
,
getClosestNodeParentByTag
andIGNORED_TAGS
from index.js. - New
domNode
field inpassProps
. - New
domNodeToHTMLString
util to get the HTML representation of a DOM node. - The internal pre-render tree structure is now typed (
TransientNode
) as well asonParsed
.
Bugfixes
- Image getting blur on iOS, #141;
img
's tagresizeMode
property not modifiable throughtagStyles
, #172;imagesMaxWidth
not working, #412
DEPRECATED PROPS (removed in v6)
allowFontScaling
, usedefaultTextProps.allowFontScaling
instead;textSelectable
, usedefaultTextProps.selectable
instead;decodeEntities
, usehtmlParserOptions.decodeEntities
instead.html
, usesource.html
instead.uri
, usesource.uri
instead.
BREAKING CHANGES
- (TypeScript users), requires minimum TypeScript version 3.5 (was 2.0)
iframe
tag element is not rendered anymore, andreact-native-webview
has been removed from peer dependencies; use@native-html/iframe-plugin
instead, which supportsonLinkPress
and scales to content width 🚀.imagesMaxWidth
andstaticContentMaxWidth
have been discontinued in favor ofcomputeEmbeddedMaxWidth
. This function takes the providedcontentWidth
as 1st argument, tag name as 2d argument and returns the max width of the embedded (iframe, image...).- In the
passProps
4th argument of renderer functions, the fieldrawChildren
has been renamed totransientChildren
.
Release 6.0.0-alpha.10
6.0.0-alpha.10 (2020-12-03)
Bug Fixes
- use unicode escape sequences inside regex literal instead of string (1299514)
v5.0.0-alpha.7
Features
- New
domNode
field inpassProps
. - New
domNodeToHTMLString
util to get the HTML representation of a DOM node.