@ai-matrx/rich-editor 0.4.2 → 0.4.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.3
4
+ ### `chrome="format"`: the toolbar for hosts with no row of their own (2026-10-08)
5
+
6
+ - `RichEditor` `chrome="format"` renders ONE slim row carrying only the formatting toolbar (no view switch, tools or Save) in every editable view — for hosts like a record's body that had `chrome="bare"` and so no formatting buttons. Editable text always has the toolbar (Arman, 2026-10-08).
7
+
8
+ Consumer action: a `chrome="bare"` host with no toolbar row of its own switches to `chrome="format"`.
9
+
3
10
  ## 0.4.2
4
11
  ### A short toolbar keeps what people reach for (2026-10-08)
5
12
 
@@ -86,9 +86,11 @@ export interface RichEditorProps {
86
86
  * "full" (default): the editor's toolbar row — views, tools, dictation, Save.
87
87
  * "bare": no row of its own; the host's chrome carries the view switch, find,
88
88
  * outline and dictation (a host that saves by itself — autosave — has no Save).
89
+ * "format": a host with no row of its own (a record's body): ONE slim row
90
+ * carrying only the formatting toolbar (2026-10-08: editable text always has it).
89
91
  * Shortcuts (⌘F, ⌘⌥H, ⌘⇧F, ⌘/) keep working either way.
90
92
  */
91
- chrome?: "full" | "bare";
93
+ chrome?: "full" | "bare" | "format";
92
94
  /**
93
95
  * The host wraps the editor in its OWN right-click menu (its surface, scope and
94
96
  * record rows) — the editor then mounts none, so one menu answers. Drive text
@@ -123,7 +123,7 @@ function RichEditorImpl({
123
123
  const [mountKey, setMountKey] = useState(0);
124
124
  const [findMode, setFindMode] = useState(null);
125
125
  const [outlineChoice, setOutlineChoice] = useState(
126
- defaultOutlineOpen ?? (chrome === "bare" ? false : null)
126
+ defaultOutlineOpen ?? (chrome !== "full" ? false : null)
127
127
  );
128
128
  const outlineOpen = outlineChoice ?? !isMobile;
129
129
  const setOutlineOpen = (next) => setOutlineChoice(typeof next === "function" ? next(outlineOpen) : next);
@@ -538,6 +538,7 @@ function RichEditorImpl({
538
538
  saveButton
539
539
  ] }),
540
540
  /* @__PURE__ */ jsxs("div", { className: "relative z-20 shrink-0", children: [
541
+ !focusMode && chrome === "format" && editable && /* @__PURE__ */ jsx("div", { className: "matrx-touch-targets flex min-h-9 items-center border-b border-border bg-card/80 px-1.5 py-0.5 backdrop-blur", "data-rich-editor-format-row": "", children: /* @__PURE__ */ jsx(FormatButtons, { className: "flex-1", resolve: () => handle.current?.formatTarget?.() ?? null }) }),
541
542
  !focusMode && chrome === "full" && /* @__PURE__ */ jsxs("div", { ref: toolbarRowRef, className: "matrx-touch-targets flex min-h-10 items-center gap-1 border-b border-border bg-card/80 px-2 py-1 backdrop-blur", children: [
542
543
  /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-1 overflow-x-auto", children: [
543
544
  isMobile ? (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/rich-editor",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "The AI Matrx editor: Visual (Tiptap), Source (CodeMirror), Preview, the markdown formatting command layer, and edit-in-place — over @ai-matrx/rich-content. Consumers that only render never install it.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -90,13 +90,13 @@
90
90
  "@tiptap/suggestion": "^3.31.3",
91
91
  "github-slugger": "^2.0.0",
92
92
  "lucide-react": "^1.48.0",
93
- "@ai-matrx/content-ir": "latest",
94
93
  "@ai-matrx/agents": "latest",
94
+ "@ai-matrx/alchemy": "latest",
95
+ "@ai-matrx/content-ir": "latest",
95
96
  "@ai-matrx/design-system": "latest",
96
97
  "@ai-matrx/kit": "latest",
97
98
  "@ai-matrx/print": "latest",
98
- "@ai-matrx/rich-content": "latest",
99
- "@ai-matrx/alchemy": "latest"
99
+ "@ai-matrx/rich-content": "latest"
100
100
  },
101
101
  "peerDependencies": {
102
102
  "react": ">=19.0.0",