@editorcn/editor 0.4.2 → 0.5.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,40 @@
1
+ # @editorcn/editor
2
+
3
+ ## 0.5.1
4
+
5
+ ### Fixes
6
+
7
+ - Dialog controls opened from the toolbar (for example the YouTube embed) get the trigger's ref, `aria-*` attributes and click event, so focus returns to the button when the dialog closes.
8
+ - The toggle used by toolbar controls forwards its ref on React 18.
9
+
10
+ ### Dependencies
11
+
12
+ - `@tiptap/react` peer range is now `>=3.0.1 <4`. The bubble menu imports `@tiptap/react/menus`, which 3.0.0 doesn't export.
13
+ - `lucide-react` range is now `>=0.400.0 <2.0.0`, so projects on lucide-react 1.x don't get a second copy.
14
+
15
+ ### Changes
16
+
17
+ - No visible change to the icons. `icons.tsx` is now shared with the shadcn registry (where it follows the project's `iconLibrary`), and the npm build still renders lucide icons.
18
+
19
+ ## 0.5.0
20
+
21
+ The editor chrome is now styled with Tailwind classes instead of a hand-written stylesheet. It looks the same, but npm installs need two lines of Tailwind setup.
22
+
23
+ ### Upgrading
24
+
25
+ In the CSS file that imports `tailwindcss`, import the editor theme and add the package to Tailwind's sources (the path is relative to that file):
26
+
27
+ ```css
28
+ @import "@editorcn/editor/theme.css";
29
+ @source "../node_modules/@editorcn/editor/dist";
30
+ ```
31
+
32
+ Keep importing `@editorcn/editor/style.css` as before. Without `@source`, the toolbar, menus and popovers are unstyled. Without the theme import, the build still passes, but menus and the toolbar fade don't animate.
33
+
34
+ ### Changes
35
+
36
+ - The toolbar, controls, bubble menu, dropdowns, link editor, embed toolbar and footer use Tailwind utility classes. The old class names (`.rte-toolbar`, `.rte-bubble-menu` and so on) stay on the elements, so your CSS that targets them keeps working. Because the utilities live in Tailwind's `utilities` layer, plain CSS now overrides them without `!important`.
37
+ - `className` on `Toolbar`, `Footer`, `ControlsGroup` and `Content` is merged last, so it now wins over the variant styles. Before, rules like `.rte-root[data-variant="default"] .rte-toolbar[data-sticky]` beat it.
38
+ - New `preset` prop on `RichTextEditor`: `"document"` (default, the current look) or `"block"` (the block editor's typography). The content element gets `editorcn-content` and `data-preset`.
39
+ - Animations are Tailwind theme variables (`--animate-rte-bubble-pop-in`, `--animate-rte-toolbar-fade`) in the new `theme.css` export. Override one by setting it again in your own `@theme` block.
40
+ - The embed loading state uses Tailwind's `animate-pulse`.
package/README.md CHANGED
@@ -19,6 +19,15 @@ A **toolbar-style** rich text editor built on [Tiptap](https://tiptap.dev/) with
19
19
  npm install @editorcn/editor @tiptap/react @tiptap/pm @tiptap/starter-kit @tiptap/extension-link
20
20
  ```
21
21
 
22
+ Then, in the CSS file that imports `tailwindcss`, import the theme and add the package to Tailwind's sources (the path is relative to that file):
23
+
24
+ ```css
25
+ @import "@editorcn/editor/theme.css";
26
+ @source "../node_modules/@editorcn/editor/dist";
27
+ ```
28
+
29
+ The chrome is styled with Tailwind classes, which Tailwind doesn't scan in `node_modules` by default, and the theme holds the menu and toolbar animations.
30
+
22
31
  > **Tiptap v3 required.** `@editorcn/editor` is built against Tiptap **v3**. Make sure your `@tiptap/*` packages are on v3, and import `BubbleMenu`/`FloatingMenu` from `@tiptap/react/menus` (not the `@tiptap/react` root) if you use them directly.
23
32
 
24
33
  ### shadcn registry