@ai-matrx/rich-editor 0.2.5 → 0.2.6

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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.6
4
+
5
+ - Source view: where the toolbar row cannot hold the format buttons AND the tools (an in-place editor in a chat column, under 980px), the tools fold into the one "More tools" menu — nothing scrolls off the row (2026-10-07: Outline, Focus and Shortcuts had slid out of view).
6
+
7
+ ### Consumer action
8
+
9
+ - None required.
10
+
3
11
  ## 0.2.5
4
12
 
5
13
  - The selection toolbar's formatting reaches a focused plain-text editor even when its zone's host half never reached the toolbar's target (2026-10-07 live: notes Split's textarea answered ⌘B and the header buttons, yet its selection toolbar showed no Bold). `focusedFormatTarget()` (format-target) is the fallback for an editable selection.
@@ -426,6 +426,16 @@ function RichEditorImpl({
426
426
  // Desktop shows the count in the toolbar; a phone reads it from the tools menu.
427
427
  ...isMobile ? [{ id: "count", label: `${formatCount(metrics.words)} words \xB7 ${saveStatus}`, icon: Hash, run: () => toast.info(documentFacts) }] : []
428
428
  ];
429
+ const toolbarRowRef = useRef(null);
430
+ const [toolbarRowWidth, setToolbarRowWidth] = useState(0);
431
+ useEffect(() => {
432
+ const row = toolbarRowRef.current;
433
+ if (!row || typeof ResizeObserver === "undefined") return;
434
+ const ro = new ResizeObserver(() => setToolbarRowWidth(row.getBoundingClientRect().width));
435
+ ro.observe(row);
436
+ return () => ro.disconnect();
437
+ }, [focusMode, chrome]);
438
+ const compactTools = isMobile || view === "source" && !readOnly && toolbarRowWidth > 0 && toolbarRowWidth < 980;
429
439
  const formatButtons = view === "source" && !readOnly ? /* @__PURE__ */ jsxs(Fragment, { children: [
430
440
  /* @__PURE__ */ jsx("span", { className: "mx-1 h-5 w-px shrink-0 bg-border" }),
431
441
  /* @__PURE__ */ jsx(FormatButtons, { resolve: () => handle.current?.formatTarget?.() ?? null })
@@ -498,7 +508,7 @@ function RichEditorImpl({
498
508
  saveButton
499
509
  ] }),
500
510
  /* @__PURE__ */ jsxs("div", { className: "relative z-20 shrink-0", children: [
501
- !focusMode && chrome === "full" && /* @__PURE__ */ jsxs("div", { 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: [
511
+ !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: [
502
512
  /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-1 overflow-x-auto", children: [
503
513
  isMobile ? (
504
514
  // A phone gets the view as one compact menu, so every control fits.
@@ -548,15 +558,15 @@ function RichEditorImpl({
548
558
  );
549
559
  }) }),
550
560
  formatButtons,
551
- !isMobile && /* @__PURE__ */ jsxs(Fragment, { children: [
561
+ !compactTools && /* @__PURE__ */ jsxs(Fragment, { children: [
552
562
  /* @__PURE__ */ jsx("span", { className: "mx-1 h-5 w-px shrink-0 bg-border" }),
553
563
  tools.map((tool) => /* @__PURE__ */ jsx(ToolbarButton, { label: tool.label, active: tool.active, onClick: tool.run, disabled: tool.disabled, children: /* @__PURE__ */ jsx(tool.icon, { className: "h-4 w-4" }) }, tool.id)),
554
564
  micButton
555
565
  ] })
556
566
  ] }),
557
567
  /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [
558
- isMobile && micButton,
559
- isMobile && /* @__PURE__ */ jsxs(DropdownMenu, { children: [
568
+ compactTools && micButton,
569
+ compactTools && /* @__PURE__ */ jsxs(DropdownMenu, { children: [
560
570
  /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
561
571
  "button",
562
572
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/rich-editor",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
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",
@@ -88,13 +88,13 @@
88
88
  "@tiptap/suggestion": "^3.31.3",
89
89
  "github-slugger": "^2.0.0",
90
90
  "lucide-react": "^1.48.0",
91
- "@ai-matrx/agents": "latest",
92
91
  "@ai-matrx/alchemy": "latest",
93
92
  "@ai-matrx/content-ir": "latest",
94
93
  "@ai-matrx/design-system": "latest",
95
94
  "@ai-matrx/kit": "latest",
96
95
  "@ai-matrx/print": "latest",
97
- "@ai-matrx/rich-content": "latest"
96
+ "@ai-matrx/rich-content": "latest",
97
+ "@ai-matrx/agents": "latest"
98
98
  },
99
99
  "peerDependencies": {
100
100
  "react": ">=19.0.0",