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 CHANGED
@@ -1,6 +1,9 @@
1
- # PageMaster Editor
1
+ # Aditily
2
2
 
3
- A powerful, DOCX-style rich text editor and PDF viewer for React applications. Built with Tiptap, React PDF, and generic document handling libraries.
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
+ [![NPM Version](https://img.shields.io/npm/v/aditily.svg)](https://www.npmjs.com/package/aditily)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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 distinct, browser-compatible DOCX files with improved formatting.
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 pagemaster-editor
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 'pagemaster-editor';
63
- import 'pagemaster-editor/dist/style.css';
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>Hello World</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 PageMaster Editor uses browser-only APIs (like Canvas and DOM), you should import it dynamically when using Next.js to avoid hydration mismatches.
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 'pagemaster-editor/dist/style.css';
90
+ import 'aditily/dist/style.css';
84
91
 
85
92
  const DocumentEditor = dynamic(
86
- () => import('pagemaster-editor').then((mod) => mod.DocumentEditor),
87
- { ssr: false }
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 Setup
105
+ ### Tailwind CSS Configuration
96
106
 
97
- If your project uses Tailwind CSS, ensure you include the library components in your content path so the styles are generated:
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
- // ... your project paths
104
- "./node_modules/pagemaster-editor/dist/**/*.{js,ts,jsx,tsx}",
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
- @source "../../node_modules/pagemaster-editor/src/**/*.{ts,tsx}"; /* or dist if published */
114
- @import "pagemaster-editor/style";
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 content of the editor |
122
- | `className` | `string` | `""` | Additional CSS classes for the container |
123
- | `onChange` | `(html: string) => void` | `undefined` | Callback called when content changes |
124
- | `readOnly` | `boolean` | `false` | Disable editing and hide toolbars |
125
- | `placeholder` | `string` | `"Enter your content here..."` | Placeholder text when empty |
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 you have the following installed in your project:
130
- - `react` (>= 18)
131
- - `react-dom` (>= 18)
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)
@@ -1,4 +1,4 @@
1
- import { g as c, r as f } from "./index-u7lSscc-.js";
1
+ import { g as c, r as f } from "./index-BEovP1jN.js";
2
2
  function l(r, n) {
3
3
  for (var o = 0; o < n.length; o++) {
4
4
  const e = n[o];