draftify-react 0.1.2 → 0.1.3

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.
Files changed (2) hide show
  1. package/README.md +190 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,190 @@
1
+ # Draftify React ✨
2
+
3
+ **A ready-to-use React editor built on top of Draftify**
4
+
5
+ `draftify-react` is a **fully styled, production-ready React editor** powered by the `draftify` core engine. It provides an out-of-the-box editing experience while preserving the structured, schema-driven philosophy of Draftify.
6
+
7
+ This package focuses purely on **UI and interaction**.
8
+ All document logic lives in `draftify`.
9
+
10
+ ---
11
+
12
+ ## ⚠️ Important Dependency Notice
13
+
14
+ `draftify-react` **does not work on its own**.
15
+
16
+ It requires the core engine:
17
+
18
+ ```bash
19
+ npm install draftify
20
+ npm install draftify-react
21
+ ```
22
+
23
+ `draftify-react` consumes and manipulates Draftify documents internally, so both packages must be installed.
24
+
25
+ ---
26
+
27
+ ## Features
28
+
29
+ - ✅ Ready-to-use rich editor
30
+ - ✅ Built on top of `draftify`
31
+ - ✅ Precompiled CSS (no Tailwind setup required)
32
+ - ✅ Tailwind v4 compatible
33
+ - ✅ Drag & drop block reordering
34
+ - ✅ Document metadata handling
35
+ - ✅ Preview & editor modes
36
+ - ✅ Clipboard, export & formatting support
37
+ - ✅ Zero configuration required to start
38
+
39
+ ---
40
+
41
+ ## Installation
42
+
43
+ ```bash
44
+ npm install draftify draftify-react
45
+ ```
46
+
47
+ ---
48
+
49
+ ## Basic Usage
50
+
51
+ ```jsx
52
+ import DraftifyReact from "draftify-react";
53
+ import "draftify-react/styles.css";
54
+
55
+ export default function App() {
56
+ return (
57
+ <div>
58
+ <DraftifyReact />
59
+ </div>
60
+ );
61
+ }
62
+ ```
63
+
64
+ That’s all you need for a working editor.
65
+
66
+ ---
67
+
68
+ ## Styling (Required)
69
+
70
+ `draftify-react` ships with **precompiled CSS**.
71
+
72
+ You must import it **once** in your app:
73
+
74
+ ```css
75
+ @import "draftify-react/styles.css";
76
+ ```
77
+
78
+ ### Tailwind v4 Users
79
+
80
+ If your project uses Tailwind v4, no extra configuration is required.
81
+ All Draftify styles are already compiled and scoped.
82
+
83
+ ---
84
+
85
+ ## Editor Behavior
86
+
87
+ The editor supports:
88
+
89
+ - Multiple block types
90
+ - Inline editing
91
+ - Drag & drop ordering
92
+ - Preview vs edit mode
93
+ - Copy / export helpers
94
+ - Metadata prompts (title, description, author)
95
+
96
+ All content is internally represented using Draftify’s schema.
97
+
98
+ ---
99
+
100
+ ## Hooks API
101
+
102
+ ### `useDraftifyReact`
103
+
104
+ ```ts
105
+ import { useDraftifyReact } from "draftify-react";
106
+ ```
107
+
108
+ This hook powers the editor internally and exposes:
109
+
110
+ - Document state
111
+ - Block data
112
+ - Block creation & modification helpers
113
+ - Drag & drop handlers
114
+ - UI state helpers
115
+
116
+ > Advanced users can build **custom editors or wrappers** using this hook.
117
+
118
+ ---
119
+
120
+ ## Project Structure
121
+
122
+ ```
123
+ draftify-react/
124
+ ├─ dist/
125
+ │ ├─ draftify-react.es.js
126
+ │ ├─ draftify-react.umd.js
127
+ │ └─ draftify-react.css
128
+
129
+ ├─ index.d.ts
130
+ ├─ package.json
131
+ └─ README.md
132
+ ```
133
+
134
+ The distributed package contains only what is required at runtime.
135
+
136
+ ---
137
+
138
+ ## Exports
139
+
140
+ ```ts
141
+ import DraftifyReact from "draftify-react";
142
+ import { useDraftifyReact } from "draftify-react";
143
+ ```
144
+
145
+ Styles:
146
+
147
+ ```css
148
+ @import "draftify-react/styles.css";
149
+ ```
150
+
151
+ ---
152
+
153
+ ## Why This Package Exists
154
+
155
+ Draftify was designed with separation of concerns in mind.
156
+
157
+ - `draftify` → **logic, schema, validation, export**
158
+ - `draftify-react` → **UI, interactions, visuals**
159
+
160
+ This allows:
161
+
162
+ - Custom editors without UI constraints
163
+ - Backend usage of Draftify
164
+ - Independent evolution of UI and logic
165
+
166
+ ---
167
+
168
+ ## When to Use `draftify-react`
169
+
170
+ Use this package if you want:
171
+
172
+ - A complete editor without building UI
173
+ - Fast integration into a React project
174
+ - A clean abstraction over Draftify’s internals
175
+
176
+ If you want to build your own editor UI, use `draftify` directly.
177
+
178
+ ---
179
+
180
+ ## Compatibility
181
+
182
+ - React ≥ 18
183
+ - Tailwind v4 supported
184
+ - ESM & UMD builds included
185
+
186
+ ---
187
+
188
+ ## License
189
+
190
+ MIT © 2025 Draftify Team
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "draftify-react",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "main": "dist/draftify-react.umd.js",
6
6
  "module": "dist/draftify-react.es.js",
@@ -40,7 +40,7 @@
40
40
  "@fortawesome/react-fontawesome": "^3.1.0",
41
41
  "@tailwindcss/vite": "^4.1.18",
42
42
  "browser-image-compression": "^2.0.2",
43
- "draftify": "*",
43
+ "draftify": "^0.1.1",
44
44
  "framer-motion": "^12.23.24",
45
45
  "react": ">=18",
46
46
  "react-dom": ">=18"