@zuilib/text-editor 0.11.0 → 0.11.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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog — @zuilib/text-editor
2
2
 
3
+ ## 0.11.1
4
+
5
+ - Fix: mounting an editor no longer steals focus and scrolls to its first
6
+ code block. The initial markdown import and the one-off re-highlight of
7
+ existing code blocks now run with Lexical's `skip-dom-selection` tag, so
8
+ their selection stays internal until the user clicks in
9
+
3
10
  ## 0.11.0
4
11
 
5
12
  - Depends on **`@zuilib/tokens`** (optional peer) instead of `@zuilib/core`:
package/README.md CHANGED
@@ -416,7 +416,7 @@ host theme in light and dark mode. Override any of them on
416
416
  | `--zui-drawing-chrome` | `var(--background)` | Header and property row background |
417
417
  | `--zui-drawing-popover` / `-foreground` | `var(--popover)` / `var(--popover-foreground)` | "More shapes" menu |
418
418
  | `--zui-drawing-danger` / `--zui-drawing-success` | `var(--destructive)` / `var(--success)` | Delete button, "copied" state |
419
- | `--zui-drawing-radius` / `--zui-drawing-control-radius` | `var(--radius-lg)` / `var(--radius)` | Block corners / buttons and menus |
419
+ | `--zui-drawing-radius` / `--zui-drawing-control-radius` | `var(--radius-lg)` / `var(--radius-sm)` | Block corners / buttons and menus |
420
420
  | `--zui-drawing-shadow` | `var(--shadow-medium)` | Popover |
421
421
  | `--zui-drawing-font` | system sans | Shape text and the inline editor |
422
422
  | `--zui-drawing-surface` / `--zui-drawing-grid` / `--zui-drawing-grid-size` | white / 9% black / `20px` | Drawing area and its dot grid, before the dark filter |
package/dist/index.js CHANGED
@@ -1,3 +1,6 @@
1
+ 'use client';
2
+ "use client";
3
+
1
4
  // src/EditorRoot.tsx
2
5
  import {
3
6
  useCallback as useCallback2,
@@ -1534,7 +1537,7 @@ function registerCodeBlockHighlighting(editor) {
1534
1537
  () => {
1535
1538
  for (const node of $nodesOfType(CodeNode)) node.markDirty();
1536
1539
  },
1537
- { tag: "history-merge" }
1540
+ { tag: ["history-merge", "skip-dom-selection"] }
1538
1541
  );
1539
1542
  return unregister;
1540
1543
  }
@@ -1589,7 +1592,7 @@ function MarkdownSyncPlugin({
1589
1592
  lastMarkdownRef.current = initialMarkdown;
1590
1593
  editor.update(() => {
1591
1594
  $convertFromMarkdownString(initialMarkdown, transformers);
1592
- }, { tag: "initial-load" });
1595
+ }, { tag: ["initial-load", "skip-dom-selection"] });
1593
1596
  }
1594
1597
  }, [editor, initialMarkdown]);
1595
1598
  useEffect4(() => {
@@ -6114,7 +6117,7 @@ var editorTheme = {
6114
6117
  link: "text-primary underline hover:opacity-80 cursor-pointer",
6115
6118
  text: {
6116
6119
  bold: "font-bold",
6117
- code: "bg-muted px-1.5 py-0.5 rounded font-mono text-sm",
6120
+ code: "bg-muted px-1.5 py-0.5 rounded-sm font-mono text-sm",
6118
6121
  italic: "italic",
6119
6122
  strikethrough: "line-through",
6120
6123
  subscript: "text-xs align-sub",
package/dist/styles.css CHANGED
@@ -552,17 +552,17 @@
552
552
  }
553
553
 
554
554
  .zui-drawing-canvas {
555
- --zui-drawing-accent: var(--primary, #3b82f6);
555
+ --zui-drawing-accent: var(--primary, #2563eb);
556
556
  --zui-drawing-foreground: var(--foreground, #0a0a0a);
557
- --zui-drawing-muted-foreground: var(--muted-foreground, #71717a);
557
+ --zui-drawing-muted-foreground: var(--muted-foreground, #65656d);
558
558
  --zui-drawing-border: var(--border, #e4e4e7);
559
559
  --zui-drawing-chrome: var(--background, #ffffff);
560
560
  --zui-drawing-popover: var(--popover, #ffffff);
561
561
  --zui-drawing-popover-foreground: var(--popover-foreground, var(--zui-drawing-foreground));
562
- --zui-drawing-danger: var(--destructive, #ef4444);
563
- --zui-drawing-success: var(--success, #22c55e);
562
+ --zui-drawing-danger: var(--destructive, #dc2626);
563
+ --zui-drawing-success: var(--success, #15803d);
564
564
  --zui-drawing-radius: var(--radius-lg, 0.75rem);
565
- --zui-drawing-control-radius: var(--radius, 0.375rem);
565
+ --zui-drawing-control-radius: var(--radius-sm, 0.375rem);
566
566
  --zui-drawing-shadow: var(--shadow-medium, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
567
567
  --zui-drawing-font: ui-sans-serif, system-ui, sans-serif;
568
568
  --zui-drawing-surface: #ffffff;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuilib/text-editor",
3
- "version": "0.11.0",
4
- "description": "ZUI \u2014 A markdown editor component wrapping Lexical",
3
+ "version": "0.11.1",
4
+ "description": "ZUI A markdown editor component wrapping Lexical",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -13,10 +13,6 @@
13
13
  "DRAWING_FORMAT.md",
14
14
  "CHANGELOG.md"
15
15
  ],
16
- "scripts": {
17
- "build": "tsup",
18
- "test": "node tests/roundtrip.mjs && node --test tests/*.test.mjs"
19
- },
20
16
  "exports": {
21
17
  ".": {
22
18
  "types": "./dist/index.d.ts",
@@ -59,7 +55,7 @@
59
55
  "lexical": "^0.35.0",
60
56
  "react": "^18.0.0 || ^19.0.0",
61
57
  "react-dom": "^18.0.0 || ^19.0.0",
62
- "@zuilib/tokens": "workspace:^"
58
+ "@zuilib/tokens": "^0.1.0"
63
59
  },
64
60
  "keywords": [
65
61
  "lexical",
@@ -69,5 +65,9 @@
69
65
  "design-system",
70
66
  "react",
71
67
  "typescript"
72
- ]
73
- }
68
+ ],
69
+ "scripts": {
70
+ "build": "tsup",
71
+ "test": "node tests/roundtrip.mjs && node --test tests/*.test.mjs"
72
+ }
73
+ }