@wavy/react-pdf 0.0.1 → 0.0.2
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/README.md +2 -0
- package/dist/main.d.ts +4 -0
- package/dist/main.js +1 -1
- package/package.json +3 -2
package/README.md
ADDED
package/dist/main.d.ts
CHANGED
|
@@ -10,6 +10,10 @@ declare function usePDFDocument(): {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
interface DivProps extends ComputedStyleProps {
|
|
13
|
+
/**@default "flex" */
|
|
14
|
+
display?: React.CSSProperties["display"];
|
|
15
|
+
/**Sets the flexDirection to `row`
|
|
16
|
+
* @default false */
|
|
13
17
|
row?: boolean;
|
|
14
18
|
}
|
|
15
19
|
declare function Div(props: DivProps): react_jsx_runtime.JSX.Element;
|
package/dist/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {createContext,useContext}from'react';import {View,Text,Image,Document}from'@react-pdf/renderer';export{Image,PDFViewer,Page,Text,View,pdf}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
|
|
1
|
+
import {createContext,useContext}from'react';import {View,Text,Image,Document}from'@react-pdf/renderer';export{Image,PDFViewer,Page,Text,View,pdf}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 z(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{z as Div,oe as Img,le as PDFDocument,W as Span,J as usePDFDocument};
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wavy/react-pdf",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "tsup"
|
|
7
|
+
"build": "tsup",
|
|
8
|
+
"publisher": "npm run build && npm version patch && npm publish"
|
|
8
9
|
},
|
|
9
10
|
"keywords": [],
|
|
10
11
|
"author": "",
|