/* eslint-disable @typescript-eslint/no-unused-vars */ import React from 'react'; import Page from '../Page'; import useToolkit from '../toolkit/useToolkit'; import paragraphsConfig from './cards/paragraphsConfig'; import whiteSpaceNormalConfig from './cards/whiteSpaceNormalConfig'; import whiteSpacePreConfig from './cards/whiteSpacePreConfig'; import preformattedConfig from './cards/preformattedConfig'; import fontSelectionArial from './cards/fontSelectionArial'; import fontSelectionCourierNewConfig from './cards/fontSelectionCourierNewConfig'; import fontSelectionSpaceMonoConfig from './cards/fontSelectionSpaceMonoConfig'; import lineBreakBugConfig from './cards/lineBreakBugConfig'; import lineBreakFixConfig from './cards/lineBreakFixConfig'; import ghostLineOddityConfig from './cards/ghostLineOddityConfig'; import ghostLineFixConfig from './cards/ghostLineFixConfig'; export default function PageContentTextual() { const { Acronym, Admonition, Bold, Header, Paragraph, Chapter, SourceDisplay, RefLibrary, RefRNSymbol, RefHtmlElement, RefCssProperty, RefRenderHtmlProp, RefTRE, RefHtmlAttr, RefDoc, RenderHtmlCard, Section, InlineCode, Hyperlink, List, ListItem, SvgFigure } = useToolkit(); return ( {/*
*/} Paragraphs have a default top and bottom margin. If you use{' '} prop, margins of adjacents blocks will collapse{' '} as per the CSS standard . is considered experimental because the doesn't support CSS property yet. However, margin collapsing should not apply to flex layouts while this prop will apply margin collapsing indiscriminately. White space collasping occurs in the eponym phase of the{' '} {' '} processing step. Insignificant whitespaces are removed from the tree, as per the algorithm depicted in{' '} CSS Text Module Level 3 . The strictly complies with this standard, although only white-space: normal; and{' '} white-space: pre; are supported at the moment.
This is the default behavior, with the exception of a handful of tags such as .
You can set the CSS property with inline styles or with classes, id and tags styles.
The default font for the tag is monospace and property is "pre". These default styles are set via the{' '} associated with this tag element model. See{' '} Element Models . CSS and{' '} properties allow a comma-separated list of fonts, but React Native styles fontFamily{' '} allows only one font name. With the , you can instruct which fonts are available in the system (or fonts you have added), and it will pick the first match! The prop to achieve that is{' '} . By default, a handful of fonts supported by the current platform are pre-registered (Android, iOS, MacOS and Windows). If you are using expo, just set this prop to{' '} Constants.systemFonts . You can also define how{' '} generic font names {' '} are resolved with the prop.
Fonts registered in should not be surrounded with quotes; however you can surround the font name with quotes in inline and mixed styles, as per CSS standard.
Line breaks work seemlessly with the {' '} element. There is a known bug though in the Foundry release, where line breaks closing an inline formatting context will be printed while they should be ignored. Below is an example for illustration purposes: Hopefully, the bug has been identified and since version 6.1.1 there is a workaround. You just need to pass{' '} prop:
React Native has a weird behavior whereby empty{' '} elements span vertically on iOS and Android.{' '} I called this "ghost lines" . For example: Since version 6.1.1, a new prop,{' '} , prevent this behavior from happening. It will also handle multiple ghost elements:
); }