react-native-render-html

iOS/Android pure javascript react-native component that renders your HTML into 100% native views

BSD-2-CLAUSE License

Downloads
967.5K
Stars
3.4K
Committers
55

Bot releases are visible (Hide)

react-native-render-html - Release 6.0.0-alpha.16

Published by jsamr over 3 years ago

6.0.0-alpha.16 (2021-02-12)

Code Refactoring

  • accurate typings for RenderHTMLSharedProps, useSharedProps (7f57318)
  • discontinue listPrefixRenderers prop (98a04ca)

BREAKING CHANGES

  • (typescript users) renamed RenderHTMLPassedProps to RenderHTMLSharedProps for consistency. In addition, changed signature of useSharedProps and userRendererProps. These hooks now take as first generic type arugment the shape of renderersProps.
  • listPrefixRenderers prop has been discontinuated. You should use a custom renderer for lists instead.
react-native-render-html - v5.1.0

Published by jsamr over 3 years ago

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)
react-native-render-html - Release 6.0.0-alpha.15

Published by jsamr over 3 years ago

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 to useIMGelementState hook (eaca370)
  • new TRenderEngineProvider and RenderHTMLFragment 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)
react-native-render-html - Release 6.0.0-alpha.14

Published by jsamr over 3 years ago

6.0.0-alpha.14 (2021-02-09)

Features

  • graceful handling of missing source prop (4a41dff)
react-native-render-html - Release 6.0.0-alpha.13

Published by jsamr over 3 years ago

6.0.0-alpha.13 (2021-02-08)

Bug Fixes

  • don't peer-depend on prop-types, instead depend directly (e346dca)
  • use urijs instead of URL API (c27c8c1), closes #460
react-native-render-html - Release 6.0.0-alpha.12

Published by jsamr over 3 years ago

6.0.0-alpha.12 (2021-02-03)

Bug Fixes

  • missing onPress handling in TPhrasingRenderer (718d8a3)

Features

  • add defaultViewProps prop (d78a74b)
  • add target argument to onLinkPress 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 and useNormalizedUrl hooks + source.baseUrl prop for inline sources) (22220d4)
react-native-render-html - Release 6.0.0-alpha.11

Published by jsamr over 3 years ago

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

  • drop ignoreNodesFunction (97ffc8d)
  • remove containerStyle and customContainer props (dab1d25)

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 [email protected] (9ee8475)
  • nesting ol and ul will result in disinct bullet style types (a18016f), closes #312
  • port alterData, alterChildren and alterNode (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 renamed ignoreDOMNode.

  • the names of hooks to alter DOM content have been changed for clarity:

    • alterData becomes alterDOMData
    • alterChildren becomes alterDOMChildren
    • alterNode becomes alterDOMElement
  • 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 and customContainer props have been dropped. Use baseStyle prop instead to style the root component.

  • drop textSelectable and allowFontScaling. Use defaultTextProps.selectable and defaultTextProps.allowFontScaling instead.

  • uri and html props have been dropped. Replace uri with source={{ uri: 'http://...' }} and html with source={{ html: '<div> ...' }}. The former now allows body, headers and method fields.

  • decodeEntities prop has been dropped. Pass this option to htmlParserOptions prop instead.

  • computeImagesMaxWidth has been replaced with computeEmbeddedMaxWidth. 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 and otherStyle.

  • extendRenderer has been renamed to extendDefaultRenderer. Also note:

    • The first argument can be the name of the tag to extend;
    • The second argument is now a partial model;
react-native-render-html - v5.0.1

Published by jsamr almost 4 years ago

v5.0.1

Bugfixes

  • Accurate typescript typings for onParsed, alterData, alterChildren (thanks @SPWizard01)
react-native-render-html - v5.0.0

Published by jsamr almost 4 years ago

Give us feedback on this release in the official thread

Enhancements

  • New source prop which deprecates html and uri props. This prop supports method, body and headers fields 🚀
  • Brand new HTMLImage component which should be much better at adapting its size to available width. For this to happen, you must pass contentWidth prop. We recommend using useWindowDimensions().width to handle screen rotation gracefully. If you don't want your images to grow after a certain size, you could use computeEmbeddedMaxWidth. 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 with Linking 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 for WebView-based plugins (tables, iframes...).
  • Export constructStyles, getParentsTagsRecursively,
    getClosestNodeParentByTag and IGNORED_TAGS from index.js.
  • New domNode field in passProps.
  • New domNodeToHTMLString util to get the HTML representation of a DOM node.
  • The internal pre-render tree structure is now typed (TransientNode) as well as onParsed.

Bugfixes

  • Image getting blur on iOS, #141;
  • img's tag resizeMode property not modifiable through tagStyles, #172;
  • imagesMaxWidth not working, #412

DEPRECATED PROPS (removed in v6)

  • allowFontScaling, use defaultTextProps.allowFontScaling instead;
  • textSelectable, use defaultTextProps.selectable instead;
  • decodeEntities, use htmlParserOptions.decodeEntities instead.
  • html, use source.html instead.
  • uri, use source.uri instead.

BREAKING CHANGES

  • (TypeScript users), requires minimum TypeScript version 3.5 (was 2.0)
  • iframe tag element is not rendered anymore, and react-native-webview has been removed from peer dependencies; use @native-html/iframe-plugin instead, which supports onLinkPress and scales to content width 🚀.
  • imagesMaxWidth and staticContentMaxWidth have been discontinued in favor of computeEmbeddedMaxWidth. This function takes the provided contentWidth 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 field rawChildren has been renamed to transientChildren.
react-native-render-html - Release 6.0.0-alpha.10

Published by jsamr almost 4 years ago

6.0.0-alpha.10 (2020-12-03)

Bug Fixes

  • use unicode escape sequences inside regex literal instead of string (1299514)
react-native-render-html - v5.0.0-alpha.7

Published by jsamr almost 4 years ago

Features

  • New domNode field in passProps.
  • New domNodeToHTMLString util to get the HTML representation of a DOM node.
react-native-render-html - v5.0.0-alpha.6

Published by jsamr almost 4 years ago

Features

  • New defaultWebViewProps for WebView-based plugins (tables, iframes...).
react-native-render-html - v5.0.0-alpha.5

Published by jsamr almost 4 years ago

Bugfixes

  • More accurate types for PassProps (Typescript)
react-native-render-html - v5.0.0-alpha.4

Published by jsamr almost 4 years ago

Bugfixes

  • Add missing exported types (Typescript)
react-native-render-html - v5.0.0-alpha.3

Published by jsamr almost 4 years ago

Enhancements

  • New source prop which deprecates html and uri props. This prop supports method, body and headers fields 🚀
  • Brand new HTMLImage component which should be much better at adapting its size to available width. For this to happen, you must pass contentWidth prop. We recommend using useWindowDimensions().width to handle screen rotation gracefully. If you don't want your images to grow after a certain size, you could use computeEmbeddedMaxWidth. 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 with Linking 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
  • Export constructStyles, getParentsTagsRecursively, getClosestNodeParentByTag and IGNORED_TAGS from index.js.

Bugfixes

  • Image getting blur on iOS, #141;
  • img's tag resizeMode property not modifiable through tagStyles, #172;
  • imagesMaxWidth not working, #412

DEPRECATED PROPS (removed in v6)

  • allowFontScaling, use defaultTextProps.allowFontScaling instead;
  • textSelectable, use defaultTextProps.selectable instead;
  • decodeEntities, use htmlParserOptions.decodeEntities instead.
  • html, use source.html instead.
  • uri, use source.uri instead.

BREAKING CHANGES

  • (TypeScript users), requires minimum TypeScript version 3.5 (was 2.8)
  • iframe tag element is not rendered anymore, and react-native-webview has
    been removed from peer dependencies; use @native-html/iframe-plugin instead, which supports onLinkPress and scales to content width 🚀.
  • imagesMaxWidth had been discontinued in favor of computeEmbeddedMaxWidth. This function takes the provided contentWidth as an argument, and returns the space the image should take.
react-native-render-html - Release 6.0.0-alpha.9

Published by jsamr almost 4 years ago

6.0.0-alpha.9 (2020-12-01)

Features

react-native-render-html - Release 6.0.0-alpha.8

Published by jsamr almost 4 years ago

6.0.0-alpha.8 (2020-11-30)

Bug Fixes

  • discard unsupported CSS inline methods (calc, var) (b722a78)
  • prettier, consistant and scalable list rendering (af826a3)
  • regression #172 (passing Image-specific styles to img component) (916d977)
  • whitespace collapsing, collapse the penultimate child (TPhrasing) (223cef2)
  • whitespace collapsing, handling of form feed characters (\n) (e5d20c6)

Features

  • new renderChild prop to TChildrenRenderer (274355e)
react-native-render-html - Release 6.0.0-alpha.7

Published by jsamr almost 4 years ago

6.0.0-alpha.7 (2020-11-28)

Track progress: https://github.com/archriss/react-native-render-html/pull/434#issue-527747509 and https://github.com/archriss/react-native-render-html/issues/430

Bug Fixes

  • splitBoxModelStyle, avoid picking undefined props in style (e5f58bb)

BREAKING CHANGES

  • the object returned by splitBoxModelStyle has more
    legible field names, boxModelStyle and otherStyle.
react-native-render-html - Release 6.0.0-alpha.6

Published by jsamr almost 4 years ago

6.0.0-alpha.6 (2020-11-27)

Track progress: https://github.com/archriss/react-native-render-html/pull/434#issue-527747509 and https://github.com/archriss/react-native-render-html/issues/430

Features

  • polished API for extendDefaultRenderer (bb1fbeb)

BREAKING CHANGES

  • extendRenderer has been renamed to
    extendDefaultRenderer. Also note:
    • The first argument can be the name of the tag to extend;
    • The second argument is now a partial model;
react-native-render-html - Release 6.0.0-alpha.5

Published by jsamr almost 4 years ago

6.0.0-alpha.5 (2020-11-27)

See https://github.com/archriss/react-native-render-html/pull/434#issue-527747509 and https://github.com/archriss/react-native-render-html/issues/430

Bug Fixes

  • inject textProps in TText renderers (5453f95)

Features

  • support TText tnode in TNodeChildrenRenderer (00183cc)
Package Rankings
Top 0.88% on Npmjs.org
Badges
Extracted from project README
npm npm npm npm
Related Projects