@wavy/react-pdf 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/inter_black-LJR676MV.ttf +0 -0
- package/dist/inter_black-OGQ2PUQD.ttf +0 -0
- package/dist/inter_bold-K2QR2KD5.ttf +0 -0
- package/dist/inter_bold-P52POTAJ.ttf +0 -0
- package/dist/inter_extraBold-BNP5WZ26.ttf +0 -0
- package/dist/inter_extraBold-FNRNNRUB.ttf +0 -0
- package/dist/inter_extraLight-47YA7K4G.ttf +0 -0
- package/dist/inter_extraLight-HRHM3B6L.ttf +0 -0
- package/dist/inter_light-DLROSCK5.ttf +0 -0
- package/dist/inter_light-Q3WLF3TH.ttf +0 -0
- package/dist/inter_medium-N3BJDZQ5.ttf +0 -0
- package/dist/inter_medium-VXC6SNUD.ttf +0 -0
- package/dist/inter_normal-NW62PDBA.ttf +0 -0
- package/dist/inter_normal-UHNXEOLW.ttf +0 -0
- package/dist/inter_semiBold-GVMOABA4.ttf +0 -0
- package/dist/inter_semiBold-RWEOEKYJ.ttf +0 -0
- package/dist/inter_thin-DLSLX7ZK.ttf +0 -0
- package/dist/inter_thin-WZZMREQH.ttf +0 -0
- package/dist/main.d.ts +5 -3
- package/dist/main.js +1 -1
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/main.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ViewProps, Styles } from '@react-pdf/renderer';
|
|
2
|
-
export { BlobProvider, BlobProviderProps,
|
|
1
|
+
import { ViewProps, Styles, DocumentProps } from '@react-pdf/renderer';
|
|
2
|
+
export { BlobProvider, BlobProviderProps, DocumentProps, Font, Image, ImageProps, PDFViewer, PDFViewerProps, Page, PageProps, Text, TextProps, View, ViewProps, pdf, usePDF } from '@react-pdf/renderer';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { JSX, PropsWithChildren } from 'react';
|
|
5
5
|
|
|
@@ -160,4 +160,6 @@ declare enum ColorResources {
|
|
|
160
160
|
declare const remAsPx: (value: number) => string;
|
|
161
161
|
declare const hexToRgba: (hex: string, alpha?: number) => string;
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
declare function Document(props: DocumentProps): react_jsx_runtime.JSX.Element;
|
|
164
|
+
|
|
165
|
+
export { BasicImage, type BasicImageProps, BasicPDFListItem, type BasicPDFListItemProps, BasicText, type BasicTextProps, BasicView, type BasicViewProps, ColorResources, Document, type PDFStyle, TableView, TableViewProps, hexToRgba, remAsPx };
|
package/dist/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {View,Text,Image}from'@react-pdf/renderer';export{BlobProvider,
|
|
1
|
+
import {Font,View,Text,Image,Document}from'@react-pdf/renderer';export{BlobProvider,Font,Image,PDFViewer,Page,Text,View,pdf,usePDF}from'@react-pdf/renderer';import {camelCaseToLetter}from'@wavy/fn';import {createContext,useContext}from'react';import {jsx,jsxs}from'react/jsx-runtime';var p=(u=>(u.paper="#ffffff",u.onPaper="#28282B",u))(p||{}),$=i=>`${i*16}px`,i6=i=>/^#([A-Fa-f0-9]{3,4}){1,2}$/.test(i),n6=i=>parseInt(i.repeat(2/i.length),16),D=(i,n=1)=>{let u=(F,P)=>F.match(new RegExp(`.{${P}}`,"g")),E=F=>typeof F<"u"?F/255:typeof n!="number"||n<0||n>1?1:n;if(!i6(i))throw new Error(`Invalid HEX: ${i}`);let s=Math.floor((i.length-1)/3),e=u(i.slice(1),s),[r,A,c,b]=e.map(n6);return `rgba(${r}, ${A}, ${c}, ${E(b)})`};var y=createContext(null);function E6(i){let n=()=>i.columns.map(E=>{let s=typeof E=="object"?E:{},e={textAlign:"left",width:"100%"};return typeof E=="string"?s={name:E,...e}:["textAlign","width"].forEach(r=>{r in s&&s[r]||(s[r]=e[r]);}),s}),u=i.gap??".25rem";return jsx(y.Provider,{value:{entries:i.entries,columns:n(),rowGap:i.rowGap??u,columnGap:i.columnGap??u,padding:i.contentPadding||$(.25)},children:jsx(View,{style:{width:i.width||"100%",padding:i.padding},children:i.children})})}function e6(i){let n=useContext(y);return jsx(View,{style:{width:"100%",flexDirection:"row",fontWeight:i.fontWeight,color:i.color||D("#28282B",.5),backgroundColor:D("#28282B",.1),fontSize:i.fontSize||".55rem",borderRadius:i.borderRadius??".25rem",padding:i.padding??n.padding,columnGap:n.columnGap},children:n.columns.map(u=>jsx(Text,{style:{width:u.width,textAlign:u.textAlign,overflow:"hidden"},children:i.formatColName?.(u.name)||camelCaseToLetter(u.name)},u.name))})}function r6(i){let n=useContext(y);return jsx(View,{style:{width:"100%",padding:i.padding||n.padding,rowGap:i.rowGap??n.rowGap,marginTop:i.marginTop,marginBottom:i.marginBottom},children:n.entries.map((u,E)=>jsx(View,{style:{flexDirection:"row",fontSize:i.fontSize||".5rem",...i.styleRow?.(E,n.entries)||{},alignItems:"center",width:"100%",overflow:"hidden",columnGap:n.columnGap},children:n.columns.map((s,e)=>jsx(Text,{style:{textAlign:s.textAlign,opacity:s.opacity??1,...i.styleCell?.({cellIndex:n.columns.length*E+e,rowIndex:E,columnName:s.name,siblingData:{previous:u?.[n.columns[e-1]?.name||""]||null,next:u?.[n.columns[e+1]?.name||""]||null},data:u?.[s.name]})||{},width:s.width},children:u?.[s.name]||s.placeholder||"-"},s.name+e))}))})}var K6={Root:E6,Header:e6,Body:r6};var Q=i=>{let{fullWidth:n,fullHeight:u,height:E,width:s,backgroundColor:e,color:r,fontWeight:A,fontSize:c,gap:b,halfFade:F,quarterFade:P,opacity:N,flex:M,corners:O,padding:U}=i,h="auto";return {width:n?"100%":s||h,height:u?"100%":E||h,backgroundColor:e,color:r,fontWeight:A,fontSize:c,gap:b,flex:M,padding:U,borderRadius:O,opacity:F?.5:P?.25:N}};var t6=i=>{let{underline:n,lineThrough:u,upperFirst:E,uppercase:s,lowercase:e,caps:r,bold:A}=i;return {...Q(i),fontWeight:A&&"bold",textDecoration:n&&u?"underline line-through":n?"underline":u?"line-through":"none",textTransform:E?"upperfirst":s?"uppercase":e?"lowercase":r?"capitalize":"none"}},z=t6;var A6=z;function d(i){let n=()=>i.text||i.children;return jsx(Text,{style:[A6({...i}),i.style],children:jsx(n,{})})}var o6=i=>{let{row:n,stretch:u,alignCenter:E,alignEnd:s,justifyCenter:e,justifySpaceBetween:r,justifySpaceEvenly:A,justifyEnd:c}=i;return {...Q(i),flexDirection:n?"row":"column",alignItems:u?"stretch":E?"center":s?"flex-end":"flex-start",justifyContent:e?"center":c?"flex-end":r?"space-between":A?"space-evenly":"flex-start"}},C=o6;var c6=C;function f(i){let n=Array.isArray(i.style)?i.style:[i.style];return jsx(View,{style:[c6({...i}),...n],children:i.children})}var Q6=i=>{let{size:n,padding:u,backgroundColor:E,objectFit:s,circle:e,corners:r}=i;return {height:n,width:n,borderRadius:e?n:r,padding:u||(e?1:0),backgroundColor:E,objectFit:s}},x=Q6;var P6=x;function gi(i){return jsx(Image,{src:{uri:i.src,method:"GET",headers:{"Cache-Control":"no-cache"}},style:[P6(i),i.style]})}function Li(i){return jsxs(f,{...i,children:[jsx(d,{...i.slotProps?.primary?.quickStyle,fontSize:i.primaryFontSize,text:i.primary,style:i.slotProps?.primary?.style}),i.secondary&&jsx(d,{...i.slotProps?.secondary?.quickStyle,halfFade:true,fontSize:i.secondaryFontSize||12,text:i.secondary,style:i.slotProps?.secondary?.style})]})}var S="./inter_black-OGQ2PUQD.ttf";var L="./inter_bold-K2QR2KD5.ttf";var v="./inter_extraBold-BNP5WZ26.ttf";var H="./inter_extraLight-47YA7K4G.ttf";var X="./inter_light-DLROSCK5.ttf";var R="./inter_medium-VXC6SNUD.ttf";var T="./inter_normal-UHNXEOLW.ttf";var J="./inter_semiBold-GVMOABA4.ttf";var G="./inter_thin-WZZMREQH.ttf";var Z="./inter_black-LJR676MV.ttf";var j="./inter_bold-P52POTAJ.ttf";var V="./inter_extraBold-FNRNNRUB.ttf";var I="./inter_extraLight-HRHM3B6L.ttf";var W="./inter_light-Q3WLF3TH.ttf";var _="./inter_medium-N3BJDZQ5.ttf";var K="./inter_normal-NW62PDBA.ttf";var q="./inter_semiBold-RWEOEKYJ.ttf";var Y="./inter_thin-DLSLX7ZK.ttf";Font.register({family:"Inter",fonts:[{src:T},{src:G,fontWeight:"thin"},{src:X,fontWeight:"light"},{src:H,fontWeight:"ultralight"},{src:R,fontWeight:"medium"},{src:J,fontWeight:"semibold"},{src:L,fontWeight:"bold"},{src:v,fontWeight:"ultrabold"},{src:S,fontWeight:"heavy"},{src:K,fontStyle:"italic"},{src:Y,fontStyle:"italic",fontWeight:"thin"},{src:W,fontStyle:"italic",fontWeight:"light"},{src:I,fontStyle:"italic",fontWeight:"ultralight"},{src:_,fontStyle:"italic",fontWeight:"medium"},{src:q,fontStyle:"italic",fontWeight:"semibold"},{src:j,fontStyle:"italic",fontWeight:"bold"},{src:V,fontStyle:"italic",fontWeight:"ultrabold"},{src:Z,fontStyle:"italic",fontWeight:"heavy"}]});function J6(i){let n=Array.isArray(i.style)?i.style:i.style?[i.style]:[];return jsx(Document,{...i,style:[{fontFamily:"Inter"},...n]})}export{gi as BasicImage,Li as BasicPDFListItem,d as BasicText,f as BasicView,p as ColorResources,J6 as Document,K6 as TableView,D as hexToRgba,$ as remAsPx};
|