pagemaster-editor 0.3.0 → 0.3.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/README.md +49 -32
- package/dist/{html2canvas-C14FkWKb.js → html2canvas-DlG3m2SO.js} +1 -1
- package/dist/{index-u7lSscc-.js → index-BEovP1jN.js} +20657 -19472
- package/dist/{index.es-4m-VFHDs.js → index.es-BbHiw86e.js} +1 -1
- package/dist/pagemaster-editor.js +1 -1
- package/dist/pagemaster-editor.umd.cjs +293 -235
- package/dist/style.css +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Aditily
|
|
2
2
|
|
|
3
|
-
A powerful, DOCX-style rich text editor and PDF viewer for React applications. Built with Tiptap, React PDF, and
|
|
3
|
+
A powerful, DOCX-style rich text editor and PDF viewer for React applications. Built with Tiptap, React PDF, and modern styling libraries.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/aditily)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
7
|
|
|
5
8
|
## Features
|
|
6
9
|
|
|
@@ -24,14 +27,14 @@ A powerful, DOCX-style rich text editor and PDF viewer for React applications. B
|
|
|
24
27
|
|
|
25
28
|
### 📄 PDF Integration
|
|
26
29
|
- **Integrated Viewer**: Built-in tabbed interface to switch between Editor and PDF viewing modes.
|
|
27
|
-
- **PDF Upload**: Upload PDF files directly from the toolbar.
|
|
28
|
-
- **Advanced Controls**: Zoom (50%-300%), page navigation, and responsive rendering.
|
|
30
|
+
- **PDF Upload**: Upload PDF files directly from the toolbar for convenient viewing and reference.
|
|
31
|
+
- **Advanced Controls**: Zoom (50%-300%), page navigation, sidebars for thumbnails, and responsive rendering.
|
|
29
32
|
|
|
30
33
|
### 💾 Import & Export
|
|
31
34
|
- **DOCX Support**:
|
|
32
35
|
- **Import**: Load existing DOCX files for editing.
|
|
33
|
-
- **Export**: Generate
|
|
34
|
-
- **PDF Export**: Export your document content directly to PDF format.
|
|
36
|
+
- **Export**: Generate high-fidelity DOCX files compatible with Microsoft Word and Google Docs.
|
|
37
|
+
- **PDF Export**: Export your document content directly to PDF format with a single click.
|
|
35
38
|
|
|
36
39
|
### ⌨️ Keyboard Shortcuts
|
|
37
40
|
|
|
@@ -51,23 +54,25 @@ A powerful, DOCX-style rich text editor and PDF viewer for React applications. B
|
|
|
51
54
|
## Installation
|
|
52
55
|
|
|
53
56
|
```bash
|
|
54
|
-
npm install
|
|
57
|
+
npm install aditily
|
|
55
58
|
```
|
|
56
59
|
|
|
57
60
|
## Usage
|
|
58
61
|
|
|
59
62
|
### Basic Usage
|
|
60
63
|
|
|
64
|
+
Import the component and its baseline styles. Ensure the parent container has a height.
|
|
65
|
+
|
|
61
66
|
```tsx
|
|
62
|
-
import { DocumentEditor } from '
|
|
63
|
-
import '
|
|
67
|
+
import { DocumentEditor } from 'aditily';
|
|
68
|
+
import 'aditily/dist/style.css';
|
|
64
69
|
|
|
65
70
|
function App() {
|
|
66
71
|
return (
|
|
67
|
-
<div style={{ height: '100vh' }}>
|
|
72
|
+
<div style={{ height: '100vh', width: '100vw' }}>
|
|
68
73
|
<DocumentEditor
|
|
69
|
-
initialContent="<h1>
|
|
70
|
-
onChange={(html) => console.log(html)}
|
|
74
|
+
initialContent="<h1>Welcome to Aditily</h1>"
|
|
75
|
+
onChange={(html) => console.log('Content updated:', html)}
|
|
71
76
|
/>
|
|
72
77
|
</div>
|
|
73
78
|
);
|
|
@@ -76,15 +81,20 @@ function App() {
|
|
|
76
81
|
|
|
77
82
|
### Next.js Integration (SSR)
|
|
78
83
|
|
|
79
|
-
Since
|
|
84
|
+
Since Aditily uses browser-specific APIs (Canvas, DOM), it must be imported dynamically.
|
|
80
85
|
|
|
81
86
|
```tsx
|
|
87
|
+
"use client";
|
|
88
|
+
|
|
82
89
|
import dynamic from 'next/dynamic';
|
|
83
|
-
import '
|
|
90
|
+
import 'aditily/dist/style.css';
|
|
84
91
|
|
|
85
92
|
const DocumentEditor = dynamic(
|
|
86
|
-
() => import('
|
|
87
|
-
{
|
|
93
|
+
() => import('aditily').then((mod) => mod.DocumentEditor),
|
|
94
|
+
{
|
|
95
|
+
ssr: false,
|
|
96
|
+
loading: () => <div>Loading Editor...</div>
|
|
97
|
+
}
|
|
88
98
|
);
|
|
89
99
|
|
|
90
100
|
export default function Page() {
|
|
@@ -92,44 +102,51 @@ export default function Page() {
|
|
|
92
102
|
}
|
|
93
103
|
```
|
|
94
104
|
|
|
95
|
-
### Tailwind CSS
|
|
105
|
+
### Tailwind CSS Configuration
|
|
96
106
|
|
|
97
|
-
|
|
107
|
+
Aditily uses Tailwind for styling. To ensure all library styles are properly purged/generated in your project:
|
|
98
108
|
|
|
99
109
|
#### Tailwind v3 (tailwind.config.js)
|
|
100
110
|
```javascript
|
|
101
111
|
module.exports = {
|
|
102
112
|
content: [
|
|
103
|
-
|
|
104
|
-
"./node_modules/
|
|
113
|
+
"./src/**/*.{js,ts,jsx,tsx}",
|
|
114
|
+
"./node_modules/aditily/dist/**/*.{js,ts,jsx,tsx}",
|
|
105
115
|
],
|
|
106
|
-
|
|
116
|
+
theme: {
|
|
117
|
+
extend: {},
|
|
118
|
+
},
|
|
119
|
+
plugins: [],
|
|
107
120
|
}
|
|
108
121
|
```
|
|
109
122
|
|
|
110
123
|
#### Tailwind v4 (globals.css)
|
|
111
124
|
```css
|
|
112
125
|
@import "tailwindcss";
|
|
113
|
-
@
|
|
114
|
-
|
|
126
|
+
@import "aditily/style";
|
|
127
|
+
|
|
128
|
+
/* Ensure Tailwind scans the library for utility classes */
|
|
129
|
+
@source "../../node_modules/aditily/dist/**/*.{js,ts,jsx,tsx}";
|
|
115
130
|
```
|
|
116
131
|
|
|
117
132
|
## Props
|
|
118
133
|
|
|
134
|
+
The `DocumentEditor` component accepts the following props:
|
|
135
|
+
|
|
119
136
|
| Prop | Type | Default | Description |
|
|
120
137
|
|------|------|---------|-------------|
|
|
121
|
-
| `initialContent` | `string` | `""` | Initial HTML
|
|
122
|
-
| `className` | `string` | `""` | Additional CSS classes for the container |
|
|
123
|
-
| `onChange` | `(html: string) => void` | `undefined` | Callback
|
|
124
|
-
| `readOnly` | `boolean` | `false` |
|
|
125
|
-
| `placeholder` | `string` | `"Enter your content here..."` |
|
|
138
|
+
| `initialContent` | `string` | `""` | Initial HTML string to load into the editor. |
|
|
139
|
+
| `className` | `string` | `""` | Additional CSS classes for the outer container. |
|
|
140
|
+
| `onChange` | `(html: string) => void` | `undefined` | Callback function triggered on every content change. |
|
|
141
|
+
| `readOnly` | `boolean` | `false` | If true, the editor is disabled and toolbars are hidden. |
|
|
142
|
+
| `placeholder` | `string` | `"Enter your content here..."` | Text to show when the editor is empty. |
|
|
126
143
|
|
|
127
144
|
## Peer Dependencies
|
|
128
145
|
|
|
129
|
-
Ensure
|
|
130
|
-
- `react`
|
|
131
|
-
- `react-dom`
|
|
146
|
+
Ensure your project has these dependencies:
|
|
147
|
+
- `react` >= 18.0.0
|
|
148
|
+
- `react-dom` >= 18.0.0
|
|
132
149
|
|
|
133
150
|
## License
|
|
134
151
|
|
|
135
|
-
MIT
|
|
152
|
+
MIT © [Surendra Singh](https://github.com/surendrasinghc80)
|