Skip to content

Commit

Permalink
Merge pull request #30 from OnedocLabs/ffo-118-migrate-to-fileforgere…
Browse files Browse the repository at this point in the history
…act-print

Migrates @onedoc/react-print to @fileforge/react-print
  • Loading branch information
Titou325 authored May 28, 2024
2 parents 279f77f + fc4fa49 commit cb84157
Show file tree
Hide file tree
Showing 52 changed files with 683 additions and 459 deletions.
366 changes: 183 additions & 183 deletions LICENSE.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,27 @@ Get the _react-print_ component library.
### With npm

```sh npm
npm install @onedoc/react-print
npm install @fileforge/react-print
```

### With yarn

```sh yarn
yarn add @onedoc/react-print
yarn add @fileforge/react-print
```

### With pnpm

```sh pnpm
pnpm add @onedoc/react-print
pnpm add @fileforge/react-print
```

## 2. Import component ↪️

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

```javascript
import { PageTop, PageBottom, PageBreak } from "@onedoc/react-print";
import { PageTop, PageBottom, PageBreak } from "@fileforge/react-print";
```

## 3. Integrate in your document 📄
Expand Down
2 changes: 1 addition & 1 deletion docgen/buildExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const buildExample = async (
\`\`\`jsx template.tsx
import { ${component}${
example.imports ? `, ${example.imports.join(", ")}` : ""
} } from "@onedoc/react-print";${
} } from "@fileforge/react-print";${
example.externalImports ? `\n${example.externalImports.join("\n")}` : ""
}
Expand Down
2 changes: 1 addition & 1 deletion docgen/buildFileMarkdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ ${docConfig.description ? `description: "${docConfig.description}"` : ""}
}
}
} else {
markdown += `\`\`\`jsx\nimport { ${componentName} } from "@onedoc/react-print";\n\`\`\`\n\n`;
markdown += `\`\`\`jsx\nimport { ${componentName} } from "@fileforge/react-print";\n\`\`\`\n\n`;
}

if (
Expand Down
2 changes: 1 addition & 1 deletion docgen/buildTemplates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function buildTemplates() {
esbuildPlugins: [
mdx({
remarkPlugins: [remarkFrontmatter],
providerImportSource: "@onedoc/react-print/mdx",
providerImportSource: "@fileforge/react-print/mdx",
}),
RawPlugin(),
],
Expand Down
2 changes: 1 addition & 1 deletion docs/components/compile.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const html = await compile(<Component />, { emotion: true });

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

<>
Expand Down
6 changes: 3 additions & 3 deletions docs/components/css.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Use a simple CSS print property to set the page size.

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

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

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

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

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

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

<React.Fragment>
<CSS>{`@page {size: A4;margin-top:1cm;margin-right:1cm;margin-left:1cm;margin-bottom:1cm;`}</CSS>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/footnote.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Creates an automatically numbered footnote. This will remove the footnote conten

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

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

Expand Down
4 changes: 2 additions & 2 deletions docs/components/latex.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Support

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

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

Expand All @@ -57,7 +57,7 @@ body {

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

<Latex>{String.raw`% \f is defined as #1f(#2) using the macro
\f\relax{x} = \int_{-\infty}^\infty
Expand Down
4 changes: 2 additions & 2 deletions docs/components/markdown.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Support

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

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

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

<Markdown
options={{
Expand Down
12 changes: 6 additions & 6 deletions docs/components/shell.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This component should be placed as early as possible in the document and will ap

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

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

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

```jsx
import { CurrentPageTop } from "@onedoc/react-print";
import { CurrentPageTop } from "@fileforge/react-print";
```

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

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

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

Expand Down Expand Up @@ -119,7 +119,7 @@ Support
Forces a page break.

```jsx
import { PageBreak } from "@onedoc/react-print";
import { PageBreak } from "@fileforge/react-print";
```

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

```jsx
import { NoBreak } from "@onedoc/react-print";
import { NoBreak } from "@fileforge/react-print";
```

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/components/signature.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Supported fields:

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

<>
<Tailwind>
Expand Down
4 changes: 2 additions & 2 deletions docs/components/tailwind.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Support

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

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

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

<Tailwind
config={{
Expand Down
18 changes: 9 additions & 9 deletions docs/components/variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Returns the current page number.

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

<PageNumber counterStyle="decimal" />;

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

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

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

Expand Down Expand Up @@ -106,7 +106,7 @@ Returns the total number of pages.

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

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

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

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

```jsx
import { RunningH2 } from "@onedoc/react-print";
import { RunningH2 } from "@fileforge/react-print";
```

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

```jsx
import { RunningH3 } from "@onedoc/react-print";
import { RunningH3 } from "@fileforge/react-print";
```

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

```jsx
import { RunningH4 } from "@onedoc/react-print";
import { RunningH4 } from "@fileforge/react-print";
```

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

```jsx
import { RunningH5 } from "@onedoc/react-print";
import { RunningH5 } from "@fileforge/react-print";
```

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

```jsx
import { RunningH6 } from "@onedoc/react-print";
import { RunningH6 } from "@fileforge/react-print";
```

10 changes: 5 additions & 5 deletions docs/getting-started/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ Get the react-print package locally
<CodeGroup>

```sh npm
npm install @onedoc/react-print
npm install @fileforge/react-print
```

```sh yarn
yarn add @onedoc/react-print
yarn add @fileforge/react-print
```

```sh pnpm
pnpm add @onedoc/react-print
pnpm add @fileforge/react-print
```

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

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

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

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

const html = await compile(<Document />);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/integrations/onedoc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ import React from "react";
import { PDFTemplate } from "./components/pdf-template";
import { Onedoc } from "@onedoc/client";
import { readFileSync, writeFileSync } from "fs";
import { compile } from "@onedoc/react-print";
import { compile } from "@fileforge/react-print";
import { join } from "path";

const ONEDOC_API_KEY = "####-####-####-####"; // replace with your api key
Expand Down
2 changes: 1 addition & 1 deletion docs/troubleshooting/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ title: "FAQ"

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

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`.
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`.
6 changes: 3 additions & 3 deletions docs/ui/templates.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ icon: list
<CardGroup>
<Card title="Scientific" href="../../../ui/templates/scientific-report">
<div style={{ marginTop: "1rem", borderRadius: "0.25rem", overflow: "hidden" }}>
<img src="../images/previews/ui-templates-scientific-report-01382231/document.1.jpg"/>
<img src="../images/previews/ui-templates-scientific-report-d26af32f/document.1.jpg"/>
</div>
</Card>
<Card title="With charts" href="../../../ui/templates/report-charts">
<div style={{ marginTop: "1rem", borderRadius: "0.25rem", overflow: "hidden" }}>
<img src="../images/previews/ui-templates-report-charts-568a756b/document.1.jpg"/>
<img src="../images/previews/ui-templates-report-charts-7d5e23ad/document.1.jpg"/>
</div>
</Card>
</CardGroup>
Expand All @@ -33,7 +33,7 @@ icon: list
<CardGroup>
<Card title="NDA Markdown" href="../../../ui/templates/nda-markdown">
<div style={{ marginTop: "1rem", borderRadius: "0.25rem", overflow: "hidden" }}>
<img src="../images/previews/ui-templates-nda-markdown-555147ca/document.1.jpg"/>
<img src="../images/previews/ui-templates-nda-markdown-0c872119/document.1.jpg"/>
</div>
</Card>
</CardGroup>
Expand Down
2 changes: 1 addition & 1 deletion docs/ui/templates/invoice-advanced.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ category: Invoices
<Frame type="glass"><img src="../../images/previews/ui-templates-invoice-advanced-4497fe25/document.1.jpg" style={{ maxHeight: '600px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>

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

Expand Down
2 changes: 1 addition & 1 deletion docs/ui/templates/invoice.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ category: Invoices
<Frame type="glass"><img src="../../images/previews/ui-templates-invoice-b87296fc/document.1.jpg" style={{ maxHeight: '600px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>

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

<Tailwind>
<div>
Expand Down
Loading

0 comments on commit cb84157

Please sign in to comment.