@wavy/react-pdf 0.0.3 → 0.0.5

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/main.d.ts CHANGED
@@ -3,7 +3,11 @@ import { ComputedStyleProps } from '@wavy/react-ui';
3
3
  import { SafeOmit } from '@wavy/types';
4
4
  import { JSX } from 'react';
5
5
  import { DocumentProps } from '@react-pdf/renderer';
6
- export { BlobProvider, Document, DocumentProps, Image, ImageProps, PDFViewer, PDFViewerProps, Page, PageProps, Text, TextProps, View, ViewProps, pdf, usePDF } from '@react-pdf/renderer';
6
+ export { BlobProvider, Image, ImageProps, PDFViewer, PDFViewerProps, Page, PageProps, Text, TextProps, View, ViewProps, pdf, usePDF } from '@react-pdf/renderer';
7
+
8
+ type PDFStyle = ViewProps["style"] extends object[]
9
+ ? never
10
+ : ViewProps["style"];
7
11
 
8
12
  declare function usePDFDocument(): {
9
13
  renderedAsPdf: boolean;
@@ -45,4 +49,4 @@ interface PDFDocumentProps extends DocumentProps {
45
49
  }
46
50
  declare function PDFDocument(props: PDFDocumentProps): react_jsx_runtime.JSX.Element;
47
51
 
48
- export { Div, type DivProps, Img, type ImgProps, PDFDocument, type PDFDocumentProps, Span, usePDFDocument };
52
+ export { Div, type DivProps, Img, type ImgProps, PDFDocument, type PDFDocumentProps, type PDFStyle, Span, usePDFDocument };
package/dist/main.js CHANGED
@@ -1 +1 @@
1
- import {createContext,useContext}from'react';import {View,Text,Image,Document}from'@react-pdf/renderer';export{BlobProvider,Document,Image,PDFViewer,Page,Text,View,pdf,usePDF}from'@react-pdf/renderer';import {useComputedStyle,restrictLineCount,nativeEllipsis,ellipsis}from'@wavy/react-ui';import {jsx,Fragment}from'react/jsx-runtime';var o=createContext({asPdf:false});function J(){return {renderedAsPdf:useContext(o).asPdf}}function q(e){let{style:t}=useComputedStyle("div",e,{inject:()=>({display:e.style?.display||e.display||"flex",flexDirection:e.style?.flexDirection||(e.row?"row":"column")})}),{asPdf:r}=useContext(o);return r?jsx(View,{style:t,children:e.children}):jsx("div",{style:t,children:e.children})}function W(e){let t=e.text||e.children,{style:r}=useComputedStyle("span",{...e,children:t},{inject:()=>({textDecoration:e.style?.textDecoration||[e.underline?"underline":"",e.strikeThrough?"line-through":""].join(" "),fontStyle:e.style?.fontStyle||e.italic?"italic":void 0,...e.ellipsis==="native"?nativeEllipsis():e.ellipsis?ellipsis():{},...e.lineLimit?restrictLineCount(e.lineLimit):{}})}),{asPdf:p}=useContext(o);return p?jsx(Text,{style:r,children:t}):jsx("span",{style:r,children:t})}function oe(e){let{asPdf:t}=useContext(o),{style:r}=useComputedStyle("img",e);return t?jsx(Image,{style:r,src:e.src}):jsx("img",{style:r,src:e.src})}function le(e){let t=e.asPdf??false;return jsx(o.Provider,{value:{asPdf:t},children:t?jsx(Document,{...e}):jsx(Fragment,{children:e.children})})}export{q as Div,oe as Img,le as PDFDocument,W as Span,J as usePDFDocument};
1
+ import {createContext,useContext}from'react';import {View,Text,Image,Document}from'@react-pdf/renderer';export{BlobProvider,Image,PDFViewer,Page,Text,View,pdf,usePDF}from'@react-pdf/renderer';import {useComputedStyle,restrictLineCount,nativeEllipsis,ellipsis}from'@wavy/react-ui';import {jsx,Fragment}from'react/jsx-runtime';import'@wavy/fn';var o=createContext({asPdf:false});function G(){return {renderedAsPdf:useContext(o).asPdf}}function j(e){let{style:n}=useComputedStyle("div",e,{inject:()=>({display:e.style?.display||e.display||"flex",flexDirection:e.style?.flexDirection||(e.row?"row":"column")})}),{asPdf:r}=useContext(o);return r?jsx(View,{style:n,children:e.children}):jsx("div",{style:n,children:e.children})}function M(e){let n=e.text||e.children,{style:r}=useComputedStyle("span",{...e,children:n},{inject:()=>({textDecoration:e.style?.textDecoration||[e.underline?"underline":"",e.strikeThrough?"line-through":""].join(" "),fontStyle:e.style?.fontStyle||e.italic?"italic":void 0,...e.ellipsis==="native"?nativeEllipsis():e.ellipsis?ellipsis():{},...e.lineLimit?restrictLineCount(e.lineLimit):{}})}),{asPdf:c}=useContext(o);return c?jsx(Text,{style:r,children:n}):jsx("span",{style:r,children:n})}function oe(e){let{asPdf:n}=useContext(o),{style:r}=useComputedStyle("img",e);return n?jsx(Image,{style:r,src:e.src}):jsx("img",{style:r,src:e.src})}function ce(e){let n=e.asPdf??false;return jsx(o.Provider,{value:{asPdf:n},children:n?jsx(Document,{...e}):jsx(Fragment,{children:e.children})})}createContext(null);export{j as Div,oe as Img,ce as PDFDocument,M as Span,G as usePDFDocument};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavy/react-pdf",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "scripts": {
@@ -22,6 +22,7 @@
22
22
  "typescript": "^5.9.3"
23
23
  },
24
24
  "dependencies": {
25
- "@react-pdf/renderer": "^4.3.1"
25
+ "@react-pdf/renderer": "^4.3.1",
26
+ "@wavy/fn": "^0.0.20"
26
27
  }
27
28
  }