@zuilib/text-editor 0.10.1 → 0.11.0

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 (3) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +17 -4
  3. package/package.json +9 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog — @zuilib/text-editor
2
2
 
3
+ ## 0.11.0
4
+
5
+ - Depends on **`@zuilib/tokens`** (optional peer) instead of `@zuilib/core`:
6
+ the editor only ever consumed the design tokens, never a component.
7
+ Load `@zuilib/tokens/styles.css` (or `tokens.css` without Tailwind) where
8
+ you previously loaded `@zuilib/core/styles.css`; without it the editor
9
+ falls back to its built-in defaults
10
+ - Documented that a Tailwind host must `@source` this package for the
11
+ document-content classes (headings, lists, code) to be generated
12
+
3
13
  ## 0.10.1
4
14
 
5
15
  - **Table columns** get the same rail as rows: a strip along the table's
package/README.md CHANGED
@@ -36,7 +36,7 @@ frontmatter as `---` blocks. Feature history: [CHANGELOG](./CHANGELOG.md).
36
36
  ## Installation
37
37
 
38
38
  ```bash
39
- pnpm add @zuilib/text-editor @zuilib/core \
39
+ pnpm add @zuilib/text-editor @zuilib/tokens \
40
40
  lexical @lexical/react @lexical/markdown @lexical/rich-text \
41
41
  @lexical/code @lexical/list @lexical/link @lexical/table @lexical/utils
42
42
  ```
@@ -48,7 +48,7 @@ All `lexical`/`@lexical/*` packages are peer dependencies at `^0.35.0`;
48
48
 
49
49
  ```tsx
50
50
  import { useState } from 'react'
51
- import '@zuilib/core/styles.css'
51
+ import '@zuilib/tokens/styles.css'
52
52
  import '@zuilib/text-editor/styles.css'
53
53
  import { MarkdownEditor } from '@zuilib/text-editor'
54
54
 
@@ -488,10 +488,22 @@ diagrams:
488
488
  </FormField>
489
489
  ```
490
490
 
491
- Load both CSS entry points (`@zuilib/core/styles.css`,
491
+ Load both CSS entry points (`@zuilib/tokens/styles.css`,
492
492
  `@zuilib/text-editor/styles.css`) in the app layout. Dark mode follows the
493
493
  ZUI convention: a `dark` class on `<html>`.
494
494
 
495
+ `@zuilib/tokens` is an optional peer: the editor's chrome reads the ZUI
496
+ custom properties (`--primary`, `--popover`, `--border`, …) and falls back
497
+ to its own defaults when they are unset. Document content (headings,
498
+ lists, code blocks) is styled with Tailwind utility classes, so a Tailwind
499
+ v4 host must scan this package for them to be generated:
500
+
501
+ ```css
502
+ @import "@zuilib/tokens/styles.css";
503
+ @source "../node_modules/@zuilib/text-editor/dist";
504
+ @import "@zuilib/text-editor/styles.css";
505
+ ```
506
+
495
507
  ## Architecture notes (for extenders)
496
508
 
497
509
  - Source: `src/EditorRoot.tsx` (composer + plugins), `src/EditorContent.tsx`,
@@ -511,7 +523,8 @@ ZUI convention: a `dark` class on `<html>`.
511
523
 
512
524
  ## Related packages
513
525
 
514
- - `@zuilib/core` — design tokens and base styles
526
+ - `@zuilib/tokens` — design tokens and base styles
527
+ - `@zuilib/components` — the UI primitives (Button, Input, …)
515
528
  - `@zuilib/form` — react-hook-form wiring
516
529
 
517
530
  ## Build & release (maintainers)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuilib/text-editor",
3
- "version": "0.10.1",
4
- "description": "ZUI A markdown editor component wrapping Lexical",
3
+ "version": "0.11.0",
4
+ "description": "ZUI \u2014 A markdown editor component wrapping Lexical",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -34,12 +34,15 @@
34
34
  "@lexical/rich-text": "^0.35.0",
35
35
  "@lexical/table": "^0.35.0",
36
36
  "@lexical/utils": "^0.35.0",
37
+ "@zuilib/tokens": "^0.0.1",
37
38
  "lexical": "^0.35.0",
38
39
  "react": "^18.0.0 || ^19.0.0",
39
40
  "react-dom": "^18.0.0 || ^19.0.0"
40
41
  },
41
- "dependencies": {
42
- "@zuilib/core": "^0.0.0"
42
+ "peerDependenciesMeta": {
43
+ "@zuilib/tokens": {
44
+ "optional": true
45
+ }
43
46
  },
44
47
  "devDependencies": {
45
48
  "@lexical/code": "^0.35.0",
@@ -55,7 +58,8 @@
55
58
  "@types/react-dom": "^18.0.0 || ^19.0.0",
56
59
  "lexical": "^0.35.0",
57
60
  "react": "^18.0.0 || ^19.0.0",
58
- "react-dom": "^18.0.0 || ^19.0.0"
61
+ "react-dom": "^18.0.0 || ^19.0.0",
62
+ "@zuilib/tokens": "workspace:^"
59
63
  },
60
64
  "keywords": [
61
65
  "lexical",