Skip to content

Commit cb84157

Browse files
authored
Merge pull request #30 from OnedocLabs/ffo-118-migrate-to-fileforgereact-print
Migrates @onedoc/react-print to @fileforge/react-print
2 parents 279f77f + fc4fa49 commit cb84157

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+683
-459
lines changed

LICENSE.md

+183-183
Large diffs are not rendered by default.

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -61,27 +61,27 @@ Get the _react-print_ component library.
6161
### With npm
6262

6363
```sh npm
64-
npm install @onedoc/react-print
64+
npm install @fileforge/react-print
6565
```
6666

6767
### With yarn
6868

6969
```sh yarn
70-
yarn add @onedoc/react-print
70+
yarn add @fileforge/react-print
7171
```
7272

7373
### With pnpm
7474

7575
```sh pnpm
76-
pnpm add @onedoc/react-print
76+
pnpm add @fileforge/react-print
7777
```
7878

7979
## 2. Import component ↪️
8080

8181
Import the components you need to your PDF template from our list of pre-build components :
8282

8383
```javascript
84-
import { PageTop, PageBottom, PageBreak } from "@onedoc/react-print";
84+
import { PageTop, PageBottom, PageBreak } from "@fileforge/react-print";
8585
```
8686

8787
## 3. Integrate in your document 📄

docgen/buildExample.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const buildExample = async (
3333
\`\`\`jsx template.tsx
3434
import { ${component}${
3535
example.imports ? `, ${example.imports.join(", ")}` : ""
36-
} } from "@onedoc/react-print";${
36+
} } from "@fileforge/react-print";${
3737
example.externalImports ? `\n${example.externalImports.join("\n")}` : ""
3838
}
3939

docgen/buildFileMarkdown.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ ${docConfig.description ? `description: "${docConfig.description}"` : ""}
105105
}
106106
}
107107
} else {
108-
markdown += `\`\`\`jsx\nimport { ${componentName} } from "@onedoc/react-print";\n\`\`\`\n\n`;
108+
markdown += `\`\`\`jsx\nimport { ${componentName} } from "@fileforge/react-print";\n\`\`\`\n\n`;
109109
}
110110

111111
if (

docgen/buildTemplates.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export async function buildTemplates() {
3838
esbuildPlugins: [
3939
mdx({
4040
remarkPlugins: [remarkFrontmatter],
41-
providerImportSource: "@onedoc/react-print/mdx",
41+
providerImportSource: "@fileforge/react-print/mdx",
4242
}),
4343
RawPlugin(),
4444
],

docs/components/compile.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const html = await compile(<Component />, { emotion: true });
2828

2929
<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
3030
```jsx template.tsx
31-
import { compile } from "@onedoc/react-print";
31+
import { compile } from "@fileforge/react-print";
3232
import { Button, ChakraProvider, extendTheme } from "@chakra-ui/react";
3333

3434
<>

docs/components/css.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Use a simple CSS print property to set the page size.
2626

2727
<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
2828
```jsx template.tsx
29-
import { CSS } from "@onedoc/react-print";
29+
import { CSS } from "@fileforge/react-print";
3030

3131
<CSS>{`@page { size: a4 landscape; }`}</CSS>;
3232

@@ -55,7 +55,7 @@ Load a Google Font using the `@import` rule.
5555

5656
<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
5757
```jsx template.tsx
58-
import { CSS } from "@onedoc/react-print";
58+
import { CSS } from "@fileforge/react-print";
5959

6060
<React.Fragment>
6161
<CSS>
@@ -91,7 +91,7 @@ You can use the `@page` at-rule in CSS to manage all aspects of printed pages. M
9191

9292
<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
9393
```jsx template.tsx
94-
import { CSS } from "@onedoc/react-print";
94+
import { CSS } from "@fileforge/react-print";
9595

9696
<React.Fragment>
9797
<CSS>{`@page {size: A4;margin-top:1cm;margin-right:1cm;margin-left:1cm;margin-bottom:1cm;`}</CSS>

docs/components/footnote.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Creates an automatically numbered footnote. This will remove the footnote conten
2424

2525
<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
2626
```jsx template.tsx
27-
import { Footnote } from "@onedoc/react-print";
27+
import { Footnote } from "@fileforge/react-print";
2828

2929
<Footnote>This is a sample footnote.</Footnote>;
3030

docs/components/latex.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Support
3030

3131
<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
3232
```jsx template.tsx
33-
import { Latex } from "@onedoc/react-print";
33+
import { Latex } from "@fileforge/react-print";
3434

3535
<Latex>{String.raw`\frac{1}{2}`}</Latex>;
3636

@@ -57,7 +57,7 @@ body {
5757

5858
<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
5959
```jsx template.tsx
60-
import { Latex } from "@onedoc/react-print";
60+
import { Latex } from "@fileforge/react-print";
6161

6262
<Latex>{String.raw`% \f is defined as #1f(#2) using the macro
6363
\f\relax{x} = \int_{-\infty}^\infty

docs/components/markdown.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Support
2626

2727
<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
2828
```jsx template.tsx
29-
import { Markdown } from "@onedoc/react-print";
29+
import { Markdown } from "@fileforge/react-print";
3030

3131
<Markdown>{`# Hello, world!
3232
@@ -61,7 +61,7 @@ You can leverage the `overrides` prop to replace Markdown components with your o
6161

6262
<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
6363
```jsx template.tsx
64-
import { Markdown } from "@onedoc/react-print";
64+
import { Markdown } from "@fileforge/react-print";
6565

6666
<Markdown
6767
options={{

docs/components/shell.mdx

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This component should be placed as early as possible in the document and will ap
2626

2727
<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
2828
```jsx template.tsx
29-
import { PageTop } from "@onedoc/react-print";
29+
import { PageTop } from "@fileforge/react-print";
3030

3131
<PageTop style={{ backgroundColor: "#bfdbfe" }} />;
3232

@@ -62,7 +62,7 @@ Displays content in the top of the current page.
6262
This component will override the content of the `PageTop` component for the current page.
6363

6464
```jsx
65-
import { CurrentPageTop } from "@onedoc/react-print";
65+
import { CurrentPageTop } from "@fileforge/react-print";
6666
```
6767

6868
## PageBottom
@@ -85,7 +85,7 @@ Displays content in the bottom of all the pages.
8585

8686
<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
8787
```jsx template.tsx
88-
import { PageBottom } from "@onedoc/react-print";
88+
import { PageBottom } from "@fileforge/react-print";
8989

9090
<PageBottom style={{ backgroundColor: "#bfdbfe" }} />;
9191

@@ -119,7 +119,7 @@ Support
119119
Forces a page break.
120120

121121
```jsx
122-
import { PageBreak } from "@onedoc/react-print";
122+
import { PageBreak } from "@fileforge/react-print";
123123
```
124124

125125
## NoBreak
@@ -135,7 +135,7 @@ Support
135135
Prevents a page break. Wrap this component around content that should not be broken across pages.
136136

137137
```jsx
138-
import { NoBreak } from "@onedoc/react-print";
138+
import { NoBreak } from "@fileforge/react-print";
139139
```
140140

141141
## FloatBottom
@@ -158,7 +158,7 @@ Floats the content to the bottom of the page.
158158

159159
<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
160160
```jsx template.tsx
161-
import { FloatBottom } from "@onedoc/react-print";
161+
import { FloatBottom } from "@fileforge/react-print";
162162

163163
<FloatBottom>Here are some floated contents</FloatBottom>;
164164

docs/components/signature.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Supported fields:
5959

6060
<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
6161
```jsx template.tsx
62-
import { Field } from "@onedoc/react-print";
62+
import { Field } from "@fileforge/react-print";
6363

6464
<>
6565
<Tailwind>

docs/components/tailwind.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Support
2626

2727
<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
2828
```jsx template.tsx
29-
import { Tailwind } from "@onedoc/react-print";
29+
import { Tailwind } from "@fileforge/react-print";
3030

3131
<Tailwind>
3232
<div className="bg-gradient-to-tr from-blue-500 to-blue-700 rounded-2xl p-12"></div>
@@ -61,7 +61,7 @@ You can also pass a custom Tailwind config to the Tailwind component.
6161

6262
<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
6363
```jsx template.tsx
64-
import { Tailwind } from "@onedoc/react-print";
64+
import { Tailwind } from "@fileforge/react-print";
6565

6666
<Tailwind
6767
config={{

docs/components/variables.mdx

+9-9
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Returns the current page number.
2424

2525
<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
2626
```jsx template.tsx
27-
import { PageNumber } from "@onedoc/react-print";
27+
import { PageNumber } from "@fileforge/react-print";
2828

2929
<PageNumber counterStyle="decimal" />;
3030

@@ -53,7 +53,7 @@ You can use a custom CSS counter-style, by passing a known name or a custom coun
5353

5454
<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
5555
```jsx template.tsx
56-
import { PageNumber } from "@onedoc/react-print";
56+
import { PageNumber } from "@fileforge/react-print";
5757

5858
<PageNumber counterStyle="lower-roman" />;
5959

@@ -106,7 +106,7 @@ Returns the total number of pages.
106106

107107
<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
108108
```jsx template.tsx
109-
import { PagesNumber, PageNumber } from "@onedoc/react-print";
109+
import { PagesNumber, PageNumber } from "@fileforge/react-print";
110110

111111
<>
112112
<PageNumber counterStyle="decimal" />
@@ -165,7 +165,7 @@ Show the current running header of level 1 in the page header. All running heade
165165

166166
<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
167167
```jsx template.tsx
168-
import { RunningH1 } from "@onedoc/react-print";
168+
import { RunningH1 } from "@fileforge/react-print";
169169

170170
<React.Fragment>
171171
<PageTop style={{ paddingTop: "1rem" }}>
@@ -204,7 +204,7 @@ Support
204204
Returns the current page's running header of level 2.
205205

206206
```jsx
207-
import { RunningH2 } from "@onedoc/react-print";
207+
import { RunningH2 } from "@fileforge/react-print";
208208
```
209209

210210
## RunningH3
@@ -220,7 +220,7 @@ Support
220220
Returns the current page's running header of level 3.
221221

222222
```jsx
223-
import { RunningH3 } from "@onedoc/react-print";
223+
import { RunningH3 } from "@fileforge/react-print";
224224
```
225225

226226
## RunningH4
@@ -236,7 +236,7 @@ Support
236236
Returns the current page's running header of level 4.
237237

238238
```jsx
239-
import { RunningH4 } from "@onedoc/react-print";
239+
import { RunningH4 } from "@fileforge/react-print";
240240
```
241241

242242
## RunningH5
@@ -252,7 +252,7 @@ Support
252252
Returns the current page's running header of level 5.
253253

254254
```jsx
255-
import { RunningH5 } from "@onedoc/react-print";
255+
import { RunningH5 } from "@fileforge/react-print";
256256
```
257257

258258
## RunningH6
@@ -268,6 +268,6 @@ Support
268268
Returns the current page's running header of level 6.
269269

270270
```jsx
271-
import { RunningH6 } from "@onedoc/react-print";
271+
import { RunningH6 } from "@fileforge/react-print";
272272
```
273273

docs/getting-started/setup.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ Get the react-print package locally
2222
<CodeGroup>
2323

2424
```sh npm
25-
npm install @onedoc/react-print
25+
npm install @fileforge/react-print
2626
```
2727

2828
```sh yarn
29-
yarn add @onedoc/react-print
29+
yarn add @fileforge/react-print
3030
```
3131

3232
```sh pnpm
33-
pnpm add @onedoc/react-print
33+
pnpm add @fileforge/react-print
3434
```
3535

3636
</CodeGroup>
@@ -40,7 +40,7 @@ pnpm add @onedoc/react-print
4040
Create a new folder call `documents`, then create a new file inside call `index.tsx` and copy the following code:
4141

4242
```jsx document/index.tsx
43-
import { PageTop, PageBottom, PageBreak } from "@onedoc/react-print";
43+
import { PageTop, PageBottom, PageBreak } from "@fileforge/react-print";
4444
import * as React from "react";
4545

4646
export const Document = ({ props }) => {
@@ -63,7 +63,7 @@ export const Document = ({ props }) => {
6363
## 4. Compile your document to HTML
6464

6565
```js index.tsx
66-
import { compile } from "@onedoc/react-print";
66+
import { compile } from "@fileforge/react-print";
6767
import { Document } from "./document";
6868

6969
const html = await compile(<Document />);
Loading
Loading
Loading
Loading
Loading
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Binary file not shown.
Binary file not shown.
Loading

docs/integrations/onedoc.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ import React from "react";
8989
import { PDFTemplate } from "./components/pdf-template";
9090
import { Onedoc } from "@onedoc/client";
9191
import { readFileSync, writeFileSync } from "fs";
92-
import { compile } from "@onedoc/react-print";
92+
import { compile } from "@fileforge/react-print";
9393
import { join } from "path";
9494

9595
const ONEDOC_API_KEY = "####-####-####-####"; // replace with your api key

docs/troubleshooting/faq.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ title: "FAQ"
66

77
`react-print` ships both for server and client side. Some components are only available for the server side such as `Tailwind`.
88

9-
If you plan to use `react-print` on the client side, you should import your components from `@onedoc/react-print/client` instead of `@onedoc/react-print` or `@onedoc/react-print/server`.
9+
If you plan to use `react-print` on the client side, you should import your components from `@fileforge/react-print/client` instead of `@fileforge/react-print` or `@fileforge/react-print/server`.

docs/ui/templates.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ icon: list
88
<CardGroup>
99
<Card title="Scientific" href="../../../ui/templates/scientific-report">
1010
<div style={{ marginTop: "1rem", borderRadius: "0.25rem", overflow: "hidden" }}>
11-
<img src="../images/previews/ui-templates-scientific-report-01382231/document.1.jpg"/>
11+
<img src="../images/previews/ui-templates-scientific-report-d26af32f/document.1.jpg"/>
1212
</div>
1313
</Card>
1414
<Card title="With charts" href="../../../ui/templates/report-charts">
1515
<div style={{ marginTop: "1rem", borderRadius: "0.25rem", overflow: "hidden" }}>
16-
<img src="../images/previews/ui-templates-report-charts-568a756b/document.1.jpg"/>
16+
<img src="../images/previews/ui-templates-report-charts-7d5e23ad/document.1.jpg"/>
1717
</div>
1818
</Card>
1919
</CardGroup>
@@ -33,7 +33,7 @@ icon: list
3333
<CardGroup>
3434
<Card title="NDA Markdown" href="../../../ui/templates/nda-markdown">
3535
<div style={{ marginTop: "1rem", borderRadius: "0.25rem", overflow: "hidden" }}>
36-
<img src="../images/previews/ui-templates-nda-markdown-555147ca/document.1.jpg"/>
36+
<img src="../images/previews/ui-templates-nda-markdown-0c872119/document.1.jpg"/>
3737
</div>
3838
</Card>
3939
</CardGroup>

docs/ui/templates/invoice-advanced.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ category: Invoices
77
<Frame type="glass"><img src="../../images/previews/ui-templates-invoice-advanced-4497fe25/document.1.jpg" style={{ maxHeight: '600px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>
88

99
```jsx
10-
import { Footnote, PageBottom, Tailwind, CSS } from "@onedoc/react-print";
10+
import { Footnote, PageBottom, Tailwind, CSS } from "@fileforge/react-print";
1111
import { QRCodeSVG } from "qrcode.react";
1212
import { ArrowRightIcon } from "@heroicons/react/20/solid";
1313

docs/ui/templates/invoice.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ category: Invoices
77
<Frame type="glass"><img src="../../images/previews/ui-templates-invoice-b87296fc/document.1.jpg" style={{ maxHeight: '600px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>
88

99
```jsx
10-
import { Footnote, PageBottom, Tailwind } from "@onedoc/react-print";
10+
import { Footnote, PageBottom, Tailwind } from "@fileforge/react-print";
1111

1212
<Tailwind>
1313
<div>

0 commit comments

Comments
 (0)