@portabletext/react-pdf
Version:
Serialize Portable Text to ReactPDF
1 lines • 36.5 kB
Source Map (JSON)
{"version":3,"file":"index.cjs","sources":["../src/utils/mergeStyles.ts","../src/components/styles.ts","../src/components/list.tsx","../src/components/misc.tsx","../src/components/block.tsx","../src/components/custom.tsx","../src/components/marks.tsx","../src/components/defaults.tsx","../src/fonts.ts","../src/pdf-portabletext.tsx"],"sourcesContent":["import merge from \"lodash.merge\"\nimport type { PortableTextStyles } from \"../types\"\n\nexport function mergeStyles(defaultStyles: PortableTextStyles, userStyles?: PortableTextStyles) {\n\tif (!userStyles) return defaultStyles\n\treturn merge({}, defaultStyles, userStyles)\n}\n","import type { Style } from \"@react-pdf/types\"\nimport type { ListStyles, MarksStyles, PortableTextStyles, TypographyStyles } from \"../types\"\n\nconst rem = (baseFontSizePt = 12, units = 1) => units * baseFontSizePt\n\nconst normalFontSizing = (baseFontSizePt: number = 12) => ({\n\tfontSize: rem(baseFontSizePt, 1),\n\tlineHeight: 1.3\n})\n\nconst blockStylesFactory = (baseFontSizePt: number = 12): TypographyStyles => ({\n\tnormal: {\n\t\tmarginBottom: rem(baseFontSizePt, 0.25)\n\t},\n\tblockquote: {\n\t\tmarginHorizontal: rem(baseFontSizePt, 1),\n\t\tmarginTop: rem(baseFontSizePt, 0.5),\n\t\tmarginBottom: rem(baseFontSizePt, 1),\n\t\tpaddingLeft: rem(baseFontSizePt, 0.5),\n\t\tborderLeft: \"2px solid gray\"\n\t},\n\th1: {\n\t\tmarginTop: rem(baseFontSizePt, 1.5),\n\t\tmarginBottom: rem(baseFontSizePt, 1)\n\t},\n\th2: {\n\t\tmarginTop: rem(baseFontSizePt, 1.25),\n\t\tmarginBottom: rem(baseFontSizePt, 0.75)\n\t},\n\th3: {\n\t\tmarginTop: rem(baseFontSizePt, 1.25),\n\t\tmarginBottom: rem(baseFontSizePt, 0.75)\n\t},\n\th4: {\n\t\tmarginTop: rem(baseFontSizePt, 1),\n\t\tmarginBottom: rem(baseFontSizePt, 0.5)\n\t},\n\th5: {\n\t\tmarginTop: rem(baseFontSizePt, 0.75),\n\t\tmarginBottom: rem(baseFontSizePt, 0.5)\n\t},\n\th6: {\n\t\tmarginTop: rem(baseFontSizePt, 0.75),\n\t\tmarginBottom: rem(baseFontSizePt, 0.5)\n\t}\n})\n\nconst textStylesFactory = (baseFontSizePt: number = 12): TypographyStyles => ({\n\tnormal: {\n\t\t...normalFontSizing(baseFontSizePt)\n\t},\n\tblockquote: {\n\t\t...normalFontSizing(baseFontSizePt)\n\t},\n\th1: {\n\t\tfontSize: rem(baseFontSizePt, 2.5),\n\t\tlineHeight: 1.1,\n\t\tfontWeight: 700\n\t},\n\th2: {\n\t\tfontSize: rem(baseFontSizePt, 2),\n\t\tlineHeight: 1.2,\n\t\tfontWeight: 600\n\t},\n\th3: {\n\t\tfontSize: rem(baseFontSizePt, 1.75),\n\t\tlineHeight: 1.2,\n\t\tfontWeight: 600\n\t},\n\th4: {\n\t\tfontSize: rem(baseFontSizePt, 1.5),\n\t\tlineHeight: 1.2,\n\t\tfontWeight: 600\n\t},\n\th5: {\n\t\tfontSize: rem(baseFontSizePt, 1.25),\n\t\tlineHeight: 1.2,\n\t\tfontWeight: 600\n\t},\n\th6: {\n\t\tfontSize: rem(baseFontSizePt, 1),\n\t\tlineHeight: 1.2,\n\t\tfontWeight: 600\n\t}\n})\n\nconst marksStylesFactory = (baseFontSizePt: number = 12): MarksStyles => ({\n\tstrong: {\n\t\tfontWeight: \"bold\"\n\t},\n\n\thighlight: {\n\t\tbackgroundColor: \"lightyellow\"\n\t},\n\n\tem: {\n\t\tfontStyle: \"italic\"\n\t},\n\n\tlink: {\n\t\ttextDecoration: \"underline\",\n\t\tcolor: \"blue\"\n\t},\n\n\tunderline: {\n\t\ttextDecoration: \"underline\"\n\t},\n\n\t\"strike-through\": {\n\t\ttextDecoration: \"line-through\"\n\t},\n\n\tcode: {\n\t\tlineHeight: 1,\n\t\tbackgroundColor: \"rgba(27, 31, 35, 0.05)\",\n\t\tfontFamily: \"Courier Prime\"\n\t},\n\n\tsuperscript: {\n\t\tverticalAlign: \"super\",\n\t\tfontSize: rem(baseFontSizePt, 0.75)\n\t},\n\n\tsubscript: {\n\t\tverticalAlign: \"sub\",\n\t\tfontSize: rem(baseFontSizePt, 0.75)\n\t}\n})\n\nconst imageStylesFactory = (baseFontSizePt: number = 12): Style => ({\n\tmaxWidth: \"100%\",\n\theight: \"auto\",\n\tobjectFit: \"contain\",\n\tmarginBottom: rem(baseFontSizePt, 0.5)\n})\n\nconst listStylesFactory = (baseFontSizePt: number = 12): ListStyles => ({\n\tlist: {\n\t\t...normalFontSizing(baseFontSizePt),\n\t\tmarginTop: rem(baseFontSizePt, 0.5),\n\t\tmarginBottom: rem(baseFontSizePt, 0.5)\n\t},\n\tlistDeep: {\n\t\t...normalFontSizing(baseFontSizePt),\n\t\tmarginTop: 0,\n\t\tmarginBottom: 0\n\t},\n\tlistItemWrapper: {\n\t\tmarginVertical: rem(baseFontSizePt, 0.1),\n\t\tflexDirection: \"row\"\n\t},\n\tlistItemDecorator: {\n\t\tmarginRight: rem(baseFontSizePt, 0.5),\n\t\tfontFamily: \"Dejavu Mono\"\n\t},\n\tlistItemNumber: {\n\t\tmarginRight: rem(baseFontSizePt, 0.5)\n\t}\n})\n\nexport const defaultStylesFactory = (baseFontSizePt: number = 12): PortableTextStyles => ({\n\tblock: blockStylesFactory(baseFontSizePt),\n\ttext: textStylesFactory(baseFontSizePt),\n\tmarks: marksStylesFactory(baseFontSizePt),\n\tlist: listStylesFactory(baseFontSizePt),\n\timage: imageStylesFactory()\n})\n","import type { PortableTextComponentProps } from \"@portabletext/react\"\nimport type { ToolkitPortableTextList } from \"@portabletext/toolkit\"\nimport type { PortableTextListItemBlock } from \"@portabletext/types\"\nimport { Text, View } from \"@react-pdf/renderer\"\nimport type { PortableTextStyles } from \"../types\"\nimport { mergeStyles } from \"../utils/mergeStyles\"\nimport { defaultStylesFactory } from \"./styles\"\n\n// Helper function to convert number to lowercase roman numerals\nconst toRomanNumeral = (num: number): string => {\n\tconst romanNumerals = [\n\t\t{ value: 50, numeral: \"l\" },\n\t\t{ value: 40, numeral: \"xl\" },\n\t\t{ value: 10, numeral: \"x\" },\n\t\t{ value: 9, numeral: \"ix\" },\n\t\t{ value: 5, numeral: \"v\" },\n\t\t{ value: 4, numeral: \"iv\" },\n\t\t{ value: 1, numeral: \"i\" }\n\t]\n\n\tlet result = \"\"\n\tlet remaining = num\n\n\tfor (const { value, numeral } of romanNumerals) {\n\t\twhile (remaining >= value) {\n\t\t\tresult += numeral\n\t\t\tremaining -= value\n\t\t}\n\t}\n\n\treturn result\n}\n\n// Helper function to convert number to alphabetic sequence (a, b, c, ..., z, aa, ab, ...)\nconst toAlphabetic = (num: number) => {\n\tlet result = \"\"\n\twhile (num >= 0) {\n\t\tresult = String.fromCharCode((num % 26) + 97) + result\n\t\tnum = Math.floor(num / 26) - 1\n\t}\n\treturn result\n}\n\n// Helper function to get the appropriate decorator based on level and item index\nconst getLevelDecorator = (level: number, itemIndex: number): string => {\n\tlet cycleLevel = 0\n\tswitch (level) {\n\t\tcase 1:\n\t\t\t// Level 1: numbers (1, 2, 3, 4, etc.)\n\t\t\treturn (itemIndex + 1).toString()\n\t\tcase 2:\n\t\t\t// Level 2: alphabetic (a, b, c, ..., z, aa, ab, ...)\n\t\t\treturn toAlphabetic(itemIndex + 1)\n\t\tcase 3:\n\t\t\t// Level 3: lowercase roman numerals (i, ii, iii, iv, v, ...)\n\t\t\treturn toRomanNumeral(itemIndex + 1)\n\t\tdefault:\n\t\t\t// For levels beyond 3, cycle through the patterns\n\t\t\tcycleLevel = ((level - 1) % 3) + 1\n\t\t\treturn getLevelDecorator(cycleLevel, itemIndex)\n\t}\n}\n\nexport const defaultListFactory = (styles: PortableTextStyles, baseFontSizePt: number) => {\n\tconst mergedStyles = mergeStyles(defaultStylesFactory(baseFontSizePt), styles)\n\n\treturn (props: PortableTextComponentProps<ToolkitPortableTextList>) => {\n\t\tconst { children, value: list } = props\n\t\tconst listStyles = mergedStyles.list || {}\n\t\tconst isDeep = list.level && list.level > 1\n\t\tconst styleKey = isDeep ? \"listDeep\" : \"list\"\n\t\tconst listStyle = listStyles[styleKey] || {}\n\n\t\treturn (\n\t\t\t<View key={list._key} style={listStyle}>\n\t\t\t\t{children}\n\t\t\t</View>\n\t\t)\n\t}\n}\n\nconst unicodeBullets = [`\\u2022`, `\\u25E6`, `\\u25AA\\uFE0E`]\nconst getDecorator = (level: number, itemType: \"bullet\" | \"number\", itemIndex: number = 0, styles: PortableTextStyles, baseFontSizePt: number) => {\n\tif (itemType === \"number\") {\n\t\t// For numbered lists, use the level-appropriate decorator\n\t\tconst decorator = getLevelDecorator(level, itemIndex)\n\t\treturn <Text style={{ ...styles.list?.listItemNumber, fontSize: 0.9 * baseFontSizePt }}>{decorator}.</Text>\n\t} else {\n\t\tconst bulletCharIndex = (level - 1) % unicodeBullets.length\n\t\tconst bulletStyles = bulletCharIndex === 2 ? { ...styles.list?.listItemDecorator, fontSize: 0.8 * baseFontSizePt, paddingTop: baseFontSizePt * 0.05 } : styles.list?.listItemDecorator\n\t\treturn <Text style={bulletStyles}>{unicodeBullets[bulletCharIndex]}</Text>\n\t}\n}\n\nexport const defaultListItemFactory = (styles: PortableTextStyles, baseFontSizePt: number, itemType: \"bullet\" | \"number\") => {\n\tconst mergedStyles = mergeStyles(defaultStylesFactory(baseFontSizePt), styles)\n\n\treturn (props: PortableTextComponentProps<PortableTextListItemBlock>) => {\n\t\tconst { children, value: listItem, index } = props\n\t\tconst level = listItem.level || 1\n\t\tconst bulletIndex = level - 1\n\t\tconst paddingLeft = bulletIndex * baseFontSizePt\n\t\tconst listItemWrapperStyle = mergedStyles?.list?.listItemWrapper || {}\n\t\tconst key = `${listItem._key}__${level}`\n\n\t\treturn (\n\t\t\t<View key={key} style={{ ...listItemWrapperStyle, paddingLeft }}>\n\t\t\t\t<View style={{ display: \"flex\", flexDirection: \"row\", alignItems: \"flex-start\" }}>\n\t\t\t\t\t{getDecorator(level, itemType, level === 2 ? index - 1 : index, mergedStyles, baseFontSizePt)}\n\t\t\t\t\t<Text>{children}</Text>\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t)\n\t}\n}\n","import type { PortableTextBlock, PortableTextComponentProps, PortableTextMarkComponentProps, UnknownNodeType } from \"@portabletext/react\"\nimport type { ToolkitPortableTextList } from \"@portabletext/toolkit\"\nimport type { PortableTextListItemBlock } from \"@portabletext/types\"\nimport { Text, View } from \"@react-pdf/renderer\"\nimport type { PortableTextStyles } from \"../types\"\nimport { defaultBlockFactory } from \"./block\"\nimport { defaultListItemFactory } from \"./list\"\n\nexport const hardBreak = () => <Text>{\"\\n\"}</Text>\n\nexport const defaultUnknownMarkFactory = () => {\n\treturn (props: PortableTextMarkComponentProps<PortableTextBlock>) => {\n\t\tconst { children, value: mark, markType } = props\n\t\tconsole.warn(`Unknown mark type \"${markType || \"undefined\"}\", please specify a component for it in the \\`components.marks\\` prop`)\n\n\t\treturn <Text key={mark?._key}>{children}</Text>\n\t}\n}\n\nexport const defaultUnknownTypeFactory = () => {\n\treturn (props: PortableTextComponentProps<UnknownNodeType>) => {\n\t\tconst { value } = props\n\t\tconsole.warn(`Unknown block type \"${value._type || \"undefined\"}\", specify a component for it in the \\`components.types\\` prop`)\n\n\t\treturn <View />\n\t}\n}\n\nexport const defaultUnknownBlockStyleFactory = (styles: PortableTextStyles, baseFontSizePt: number) => {\n\treturn (props: PortableTextComponentProps<PortableTextBlock>) => {\n\t\tconst { value: block } = props\n\t\tconsole.warn(`Unknown block style \"${block.style || \"undefined\"}\", please specify a component for it in the \\`components.block\\` prop`)\n\t\tprops.value.style = \"normal\"\n\n\t\treturn defaultBlockFactory(styles, baseFontSizePt)(props)\n\t}\n}\n\nexport const defaultUnknownListFactory = () => {\n\treturn (props: PortableTextComponentProps<ToolkitPortableTextList>) => {\n\t\tconst { children, value: block } = props\n\n\t\tconsole.warn(`Unknown list style \"${block.listItem || \"undefined\"}\", please specify a component for it in the \\`components.list\\` prop`)\n\n\t\treturn <View key={block._key}>{children}</View>\n\t}\n}\n\nexport const defaultUnknownListItemFactory = (baseFontSizePt: number) => {\n\treturn (props: PortableTextComponentProps<PortableTextListItemBlock>) => {\n\t\tconst { value: block } = props\n\n\t\tconsole.warn(`Unknown list item style \"${block?.listItem || \"undefined\"}\", please specify a component for it in the \\`components.list\\` prop`)\n\n\t\tconst listItemFunction = defaultListItemFactory({}, baseFontSizePt, \"bullet\")\n\t\treturn listItemFunction(props)\n\t}\n}\n","import type { PortableTextBlock, PortableTextComponentProps } from \"@portabletext/react\"\nimport { Text, View } from \"@react-pdf/renderer\"\nimport type { PortableTextStyles } from \"../types\"\nimport { mergeStyles } from \"../utils/mergeStyles\"\nimport { hardBreak } from \"./misc\"\nimport { defaultStylesFactory } from \"./styles\"\n\nexport const defaultBlockFactory = (styles: PortableTextStyles, baseFontSizePt: number) => {\n\tconst mergedStyles = mergeStyles(defaultStylesFactory(baseFontSizePt), styles)\n\n\treturn (props: PortableTextComponentProps<PortableTextBlock>) => {\n\t\tconst { children, value: block } = props\n\t\ttype StyleKey = keyof typeof mergedStyles.block\n\t\tconst styleKey = (block.style || \"normal\") as StyleKey\n\t\tconst blockStyles = mergedStyles.block || {}\n\t\tconst textStyles = mergedStyles.text || {}\n\n\t\tif (block?.children?.length === 1 && block?.children?.[0]?.text === \"\") {\n\t\t\treturn hardBreak()\n\t\t}\n\n\t\treturn (\n\t\t\t<View key={block._key} style={blockStyles[styleKey]}>\n\t\t\t\t<Text style={textStyles[styleKey]}>{children}</Text>\n\t\t\t</View>\n\t\t)\n\t}\n}\n","import type { PortableTextTypeComponentProps } from \"@portabletext/react\"\nimport { Image, View } from \"@react-pdf/renderer\"\nimport type { PortableTextStyles } from \"../types\"\nimport { mergeStyles } from \"../utils/mergeStyles\"\nimport { defaultStylesFactory } from \"./styles\"\n\nexport type ImageDefinition = {\n\t_key: string\n\t_type: string\n\turl: string\n\tsrc: string\n\talt: string\n}\n\nexport const defaultImageFactory = (styles: PortableTextStyles, baseFontSizePt: number) => {\n\tconst mergedStyles = mergeStyles(defaultStylesFactory(baseFontSizePt), styles)\n\treturn (props: PortableTextTypeComponentProps<ImageDefinition>) => {\n\t\tconst { value } = props\n\t\tconst image = value?.url || value?.src || \"\"\n\n\t\treturn <Image key={value?._key} src={image} style={mergedStyles.image} />\n\t}\n}\n\nexport const defaultPageBreakFactory = () => {\n\treturn () => {\n\t\treturn <View break={true} />\n\t}\n}\n","import type { PortableTextMarkComponentProps } from \"@portabletext/react\"\nimport { Link, Text } from \"@react-pdf/renderer\"\nimport type { PortableTextStyles } from \"../types\"\nimport { mergeStyles } from \"../utils/mergeStyles\"\nimport { defaultStylesFactory } from \"./styles\"\n\nexport type DefaultMarkTypesKey = \"em\" | \"strong\" | \"code\" | \"underline\" | \"strike-through\" | \"highlight\" | \"link\" | \"superscript\" | \"subscript\"\n\nexport const defaultLinkFactory = (styles: PortableTextStyles, baseFontSizePt: number, itemType: DefaultMarkTypesKey) => {\n\tconst mergedStyles = mergeStyles(defaultStylesFactory(baseFontSizePt), styles)\n\treturn (props: PortableTextMarkComponentProps) => {\n\t\tconst { children, value: link } = props\n\t\tconst marksStyles = mergedStyles?.marks || {}\n\t\treturn (\n\t\t\t<Link style={marksStyles[itemType]} href={link?.href}>\n\t\t\t\t{children}\n\t\t\t</Link>\n\t\t)\n\t}\n}\n\nexport const defaultMarksFactory = (styles: PortableTextStyles, baseFontSizePt: number, itemType: DefaultMarkTypesKey) => {\n\tconst mergedStyles = mergeStyles(defaultStylesFactory(baseFontSizePt), styles)\n\treturn (props: PortableTextMarkComponentProps) => {\n\t\tconst { children } = props\n\t\tconst marksStyles = mergedStyles?.marks || {}\n\t\treturn <Text style={marksStyles[itemType]}>{children}</Text>\n\t}\n}\n","import { mergeComponents, type PortableTextReactComponents } from \"@portabletext/react\"\nimport type { PortableTextStyles } from \"../types\"\nimport { defaultBlockFactory } from \"./block\"\nimport { defaultImageFactory, defaultPageBreakFactory } from \"./custom\"\nimport { defaultListFactory, defaultListItemFactory } from \"./list\"\nimport { defaultMarksFactory } from \"./marks\"\nimport { defaultUnknownBlockStyleFactory, defaultUnknownListFactory, defaultUnknownListItemFactory, defaultUnknownMarkFactory, defaultUnknownTypeFactory, hardBreak } from \"./misc\"\n\n/**\n * This function takes the styles provided as args and merges them into the default styles (in the case of overlapping styles, the user-defined styles will take precedence).\n * It also uses the baseFontSizePt to calculate values for the default styles (e.g. line-height, font-size, etc.).\n * The result of this factory function is a map of default components whose styles are modified/extended using the user-defined styles.\n * That map will be consumed by the mergeAndStyleComponents function.\n * @public\n */\nexport const generateStyledDefaultComponentsMap = (styles: PortableTextStyles, baseFontSizePt: number): PortableTextReactComponents => {\n\treturn {\n\t\ttypes: {\n\t\t\tbreak: defaultPageBreakFactory(),\n\t\t\timage: defaultImageFactory(styles, baseFontSizePt)\n\t\t},\n\t\tblock: {\n\t\t\tnormal: defaultBlockFactory(styles, baseFontSizePt),\n\t\t\tblockquote: defaultBlockFactory(styles, baseFontSizePt),\n\t\t\th1: defaultBlockFactory(styles, baseFontSizePt),\n\t\t\th2: defaultBlockFactory(styles, baseFontSizePt),\n\t\t\th3: defaultBlockFactory(styles, baseFontSizePt),\n\t\t\th4: defaultBlockFactory(styles, baseFontSizePt),\n\t\t\th5: defaultBlockFactory(styles, baseFontSizePt),\n\t\t\th6: defaultBlockFactory(styles, baseFontSizePt)\n\t\t},\n\t\tmarks: {\n\t\t\tem: defaultMarksFactory(styles, baseFontSizePt, \"em\"),\n\t\t\tstrong: defaultMarksFactory(styles, baseFontSizePt, \"strong\"),\n\t\t\tcode: defaultMarksFactory(styles, baseFontSizePt, \"code\"),\n\t\t\tunderline: defaultMarksFactory(styles, baseFontSizePt, \"underline\"),\n\t\t\t\"strike-through\": defaultMarksFactory(styles, baseFontSizePt, \"strike-through\"),\n\t\t\tsuperscript: defaultMarksFactory(styles, baseFontSizePt, \"superscript\"),\n\t\t\tsubscript: defaultMarksFactory(styles, baseFontSizePt, \"subscript\"),\n\t\t\tlink: defaultMarksFactory(styles, baseFontSizePt, \"link\"),\n\t\t\thighlight: defaultMarksFactory(styles, baseFontSizePt, \"highlight\")\n\t\t},\n\t\tlist: {\n\t\t\tbullet: defaultListFactory(styles, baseFontSizePt),\n\t\t\tnumber: defaultListFactory(styles, baseFontSizePt)\n\t\t},\n\t\tlistItem: {\n\t\t\tbullet: defaultListItemFactory(styles, baseFontSizePt, \"bullet\"),\n\t\t\tnumber: defaultListItemFactory(styles, baseFontSizePt, \"number\")\n\t\t},\n\t\thardBreak: hardBreak,\n\t\tunknownType: defaultUnknownTypeFactory(),\n\t\tunknownMark: defaultUnknownMarkFactory(),\n\t\tunknownList: defaultUnknownListFactory(),\n\t\tunknownListItem: defaultUnknownListItemFactory(baseFontSizePt),\n\t\tunknownBlockStyle: defaultUnknownBlockStyleFactory(styles, baseFontSizePt)\n\t}\n}\n\n/**\n * This function takes the styles provided as args and merges them into the default styles (in the case of overlapping styles, the user-defined styles will take precedence).\n * The result of this style-merge is a set of default components whose styles are modified/extended with the user-defined styles.\n * This function then takes the components provided as args and merges them into the default components (in the case of overlapping components, the user-defined components will take precedence).\n * The overall result returned is a components map which includes the user-defined components and any user-defined styles for the default components -- this map is\n * consumed by the PortableText component.\n * @public\n */\nexport const mergeAndStyleComponents = (components: Partial<PortableTextReactComponents> | undefined, styles: PortableTextStyles, baseFontSizePt: number) => {\n\tconst styledDefaultComponentsMap = generateStyledDefaultComponentsMap(styles, baseFontSizePt)\n\n\tif (components) {\n\t\treturn mergeComponents(styledDefaultComponentsMap, components)\n\t}\n\treturn styledDefaultComponentsMap\n}\n","import { Font } from \"@react-pdf/renderer\"\n\nFont.register({\n\tfamily: \"Source Sans Pro\",\n\tfonts: [\n\t\t{\n\t\t\tsrc: \"https://cdn.jsdelivr.net/fontsource/fonts/source-sans-pro@latest/latin-400-normal.ttf\",\n\t\t\tfontWeight: \"normal\",\n\t\t\tfontStyle: \"normal\"\n\t\t},\n\t\t{\n\t\t\tsrc: \"https://cdn.jsdelivr.net/fontsource/fonts/source-sans-pro@latest/latin-400-italic.ttf\",\n\t\t\tfontWeight: \"normal\",\n\t\t\tfontStyle: \"italic\"\n\t\t},\n\t\t{\n\t\t\tsrc: \"https://cdn.jsdelivr.net/fontsource/fonts/source-sans-pro@latest/latin-700-normal.ttf\",\n\t\t\tfontWeight: \"bold\",\n\t\t\tfontStyle: \"normal\"\n\t\t},\n\t\t{\n\t\t\tsrc: \"https://cdn.jsdelivr.net/fontsource/fonts/source-sans-pro@latest/latin-700-italic.ttf\",\n\t\t\tfontWeight: \"bold\",\n\t\t\tfontStyle: \"italic\"\n\t\t}\n\t]\n})\n\nFont.register({\n\tfamily: \"Courier Prime\",\n\tfonts: [\n\t\t{\n\t\t\tsrc: \"https://cdn.jsdelivr.net/fontsource/fonts/courier-prime@latest/latin-400-normal.ttf\",\n\t\t\tfontWeight: \"normal\",\n\t\t\tfontStyle: \"normal\"\n\t\t},\n\t\t{\n\t\t\tsrc: \"https://cdn.jsdelivr.net/fontsource/fonts/courier-prime@latest/latin-400-italic.ttf\",\n\t\t\tfontWeight: \"normal\",\n\t\t\tfontStyle: \"italic\"\n\t\t},\n\t\t{\n\t\t\tsrc: \"https://cdn.jsdelivr.net/fontsource/fonts/courier-prime@latest/latin-700-normal.ttf\",\n\t\t\tfontWeight: \"bold\",\n\t\t\tfontStyle: \"normal\"\n\t\t},\n\t\t{\n\t\t\tsrc: \"https://cdn.jsdelivr.net/fontsource/fonts/courier-prime@latest/latin-700-italic.ttf\",\n\t\t\tfontWeight: \"bold\",\n\t\t\tfontStyle: \"italic\"\n\t\t}\n\t]\n})\n\nFont.register({\n\tfamily: \"Dejavu Mono\",\n\tfonts: [\n\t\t{\n\t\t\tsrc: \"https://cdn.jsdelivr.net/fontsource/fonts/dejavu-mono@latest/latin-400-normal.ttf\",\n\t\t\tfontWeight: \"normal\",\n\t\t\tfontStyle: \"normal\"\n\t\t},\n\t\t{\n\t\t\tsrc: \"https://cdn.jsdelivr.net/fontsource/fonts/dejavu-mono@latest/latin-400-italic.ttf\",\n\t\t\tfontWeight: \"normal\",\n\t\t\tfontStyle: \"italic\"\n\t\t},\n\t\t{\n\t\t\tsrc: \"https://cdn.jsdelivr.net/fontsource/fonts/dejavu-mono@latest/latin-700-normal.ttf\",\n\t\t\tfontWeight: \"bold\",\n\t\t\tfontStyle: \"normal\"\n\t\t},\n\t\t{\n\t\t\tsrc: \"https://cdn.jsdelivr.net/fontsource/fonts/dejavu-mono@latest/latin-700-italic.ttf\",\n\t\t\tfontWeight: \"bold\",\n\t\t\tfontStyle: \"italic\"\n\t\t}\n\t]\n})\n","import { PortableText as BasePortableText, type PortableTextBlock } from \"@portabletext/react\"\nimport type { TypedObject } from \"@portabletext/types\"\nimport { flatten } from \"flat\"\nimport omitBy from \"lodash.omitby\"\nimport type { JSX } from \"react\"\nimport { mergeAndStyleComponents } from \"./components/defaults\"\nimport \"./fonts\"\nimport type { ReactPdfPortableTextProps } from \"./types\"\n\nconst isNil = (value: unknown): value is null | undefined => {\n\treturn value === null || value === undefined\n}\n\nconst checkPropsOverlap = (props: ReactPdfPortableTextProps<TypedObject>) => {\n\tconst { components = {}, defaultComponentStyles = {} } = props\n\tif (components && defaultComponentStyles) {\n\t\t// Check for overlap between the paths to components in \"components\" and the paths to style definitions in \"defaultComponentStyles\".\n\t\tconst defaultStyleKeys = Object.keys(defaultComponentStyles)\n\t\tconst typeKeys = Object.keys(components?.types || {})\n\t\tconst overlappingTypeKeys = defaultStyleKeys.filter((key: string) => {\n\t\t\treturn typeKeys.indexOf(key) !== -1\n\t\t})\n\n\t\t// Check for overlapping paths\n\t\tconst defaultComponentStylesPaths = Object.keys(omitBy(flatten(defaultComponentStyles, { maxDepth: 2 }) || {}, isNil))\n\t\tconst componentPaths = Object.keys(omitBy(flatten(components, { maxDepth: 2 }) || {}, isNil))\n\t\tconst overlappingPaths = defaultComponentStylesPaths.filter((key: string) => {\n\t\t\treturn componentPaths.indexOf(key) !== -1\n\t\t})\n\n\t\tif (overlappingPaths?.length > 0) {\n\t\t\tconst errorMessage = `\n \n OVERLAPPING PROPS: Paths with a component defined in \"components\" and paths with a style defined in \"defaultComponentStyles\" may not overlap. \n \n You've specified both a component and a style for the following path(s) in those objects: ${overlappingPaths.map((elem) => `\"${elem}\"`).join(\", \")}. \n \n You may specify both props, as long as there are not matching paths in the two objects resulting in both a component and a style being defined for that path (would lead to confusing behavior). \n \n For example, you MAY specify a value for \"block.h1\" in one of those prop objects and a value for \"block.h2\" in the other, but you may NOT specify both a component and a style for \"block.h1\".`\n\t\t\tconsole.error(errorMessage)\n\t\t\tthrow new Error(errorMessage)\n\t\t} else if (overlappingTypeKeys?.length > 0) {\n\t\t\tconst errorMessage = `\n \n OVERLAPPING PROPS: Keys with a component defined in \"components.types\" and keys with a style defined in \"defaultComponentStyles\" may not overlap. \n \n You've specified both a component and a style for the following key(s) in those objects: ${overlappingTypeKeys.map((elem) => `\"${elem}\"`).join(\", \")}. \n \n You may specify both props, as long there are not matching keys in \"component.types\" and \"defaultComponentStyles\" resulting in both a component and a style being defined for that same key (would lead to confusing behavior). \n \n For example, you MAY specify a component for \"components.types.block\" and a style for \"defaultComponentStyles.list\", but you may NOT specify an value for both \"components.types.block\" and \"defaultComponentStyles.block\".`\n\t\t\tconsole.error(errorMessage)\n\t\t\tthrow new Error(errorMessage)\n\t\t}\n\t}\n}\n\n/**\n * PortableText component serializes PortableTextBlock objects to ReactPDF components.\n * PortableText component expects to be wrapped a Page(s) wrapped in a Document (Document and Page are components from \\@react-pdf/renderer)\n * @public\n */\nexport function PortableText<B extends TypedObject = PortableTextBlock>(props: ReactPdfPortableTextProps<B>): JSX.Element {\n\tconst { baseFontSizePt = 12, defaultComponentStyles = {}, components, ...portableTextProps } = props\n\tconst mergedAndStyledComponents = mergeAndStyleComponents(components, defaultComponentStyles, baseFontSizePt)\n\n\tcheckPropsOverlap(props)\n\n\treturn <BasePortableText listNestingMode='direct' {...portableTextProps} components={mergedAndStyledComponents} />\n}\n"],"names":["merge","View","jsxs","Text","jsx","Image","mergeComponents","Font","omitBy","flatten","BasePortableText"],"mappings":";;;;;;;AAGO,SAAS,YAAY,eAAmC,YAAiC;AAC/F,SAAK,aACEA,eAAAA,QAAM,CAAA,GAAI,eAAe,UAAU,IADlB;AAEzB;ACHA,MAAM,MAAM,CAAC,iBAAiB,IAAI,QAAQ,MAAM,QAAQ,gBAElD,mBAAmB,CAAC,iBAAyB,QAAQ;AAAA,EAC1D,UAAU,IAAI,gBAAgB,CAAC;AAAA,EAC/B,YAAY;AACb,IAEM,qBAAqB,CAAC,iBAAyB,QAA0B;AAAA,EAC9E,QAAQ;AAAA,IACP,cAAc,IAAI,gBAAgB,IAAI;AAAA,EAAA;AAAA,EAEvC,YAAY;AAAA,IACX,kBAAkB,IAAI,gBAAgB,CAAC;AAAA,IACvC,WAAW,IAAI,gBAAgB,GAAG;AAAA,IAClC,cAAc,IAAI,gBAAgB,CAAC;AAAA,IACnC,aAAa,IAAI,gBAAgB,GAAG;AAAA,IACpC,YAAY;AAAA,EAAA;AAAA,EAEb,IAAI;AAAA,IACH,WAAW,IAAI,gBAAgB,GAAG;AAAA,IAClC,cAAc,IAAI,gBAAgB,CAAC;AAAA,EAAA;AAAA,EAEpC,IAAI;AAAA,IACH,WAAW,IAAI,gBAAgB,IAAI;AAAA,IACnC,cAAc,IAAI,gBAAgB,IAAI;AAAA,EAAA;AAAA,EAEvC,IAAI;AAAA,IACH,WAAW,IAAI,gBAAgB,IAAI;AAAA,IACnC,cAAc,IAAI,gBAAgB,IAAI;AAAA,EAAA;AAAA,EAEvC,IAAI;AAAA,IACH,WAAW,IAAI,gBAAgB,CAAC;AAAA,IAChC,cAAc,IAAI,gBAAgB,GAAG;AAAA,EAAA;AAAA,EAEtC,IAAI;AAAA,IACH,WAAW,IAAI,gBAAgB,IAAI;AAAA,IACnC,cAAc,IAAI,gBAAgB,GAAG;AAAA,EAAA;AAAA,EAEtC,IAAI;AAAA,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