@ai-matrx/rich-editor 0.5.2 → 0.5.4
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,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.4
|
|
4
|
+
### Images in Write survive a reload (2026-10-08)
|
|
5
|
+
|
|
6
|
+
- Write's image island draws through rich-content's `DurableMarkdownImg` — the same image Read and Split draw: an uploaded platform file loads through the authenticated blob lane, a remote image obeys the image policy. It used to set the raw `files.matrxserver.com` URL, which drew right after upload and broke after a reload (live, notes).
|
|
7
|
+
|
|
8
|
+
Consumer action: none.
|
|
9
|
+
|
|
10
|
+
## 0.5.3
|
|
11
|
+
### The toolbar keeps more buttons in a short row (2026-10-08)
|
|
12
|
+
|
|
13
|
+
- `FormatButtons`: when the row cannot hold the full toolbar, the text-style menu shrinks to its icon (about 45px) BEFORE any button folds into More; and the group dividers are 4px narrower each (`mx-0.5`). A narrow notes header keeps Bold, Italic, text style, bulleted, numbered, checklist and Link.
|
|
14
|
+
|
|
15
|
+
Consumer action: none.
|
|
16
|
+
|
|
3
17
|
## 0.5.2
|
|
4
18
|
### A typed link keeps the space after it (2026-10-08)
|
|
5
19
|
|
|
@@ -151,17 +151,21 @@ function FormatButtons({ resolve, disabled = false, className, size = "sm", vari
|
|
|
151
151
|
resolve()?.run(command);
|
|
152
152
|
};
|
|
153
153
|
const button = size === "xs" ? 26 : 30;
|
|
154
|
-
const
|
|
155
|
-
const widthOf = (slot) => slot.kind === "button" ? button : slot.kind === "style" ? styleWidth : 11;
|
|
154
|
+
const styleWidthFor = (compact) => variant === "essential" || compact ? size === "xs" ? 40 : 45 : 90;
|
|
156
155
|
const all = slotsOf(variant);
|
|
156
|
+
const foldedByDefault = variant === "essential" ? slotsOf("full").filter((s) => s.kind === "button" && !ESSENTIAL_COMMANDS.includes(s.spec.command)) : [];
|
|
157
|
+
const widthOfWith = (styleWidth) => (slot) => slot.kind === "button" ? button : slot.kind === "style" ? styleWidth : 7;
|
|
158
|
+
const rowWidthWith = (styleWidth) => (slots) => withDividers(slots).reduce((sum, s) => sum + widthOfWith(styleWidth)(s), 0) + button;
|
|
157
159
|
let kept = all;
|
|
158
|
-
let folded =
|
|
159
|
-
|
|
160
|
-
if (width > 0 &&
|
|
160
|
+
let folded = foldedByDefault;
|
|
161
|
+
let compactStyle = false;
|
|
162
|
+
if (width > 0 && variant === "full" && rowWidthWith(styleWidthFor(false))(all) > width + 4) compactStyle = true;
|
|
163
|
+
const rowWidth = rowWidthWith(styleWidthFor(compactStyle));
|
|
164
|
+
if (width > 0 && rowWidth(kept) > width + 4) {
|
|
161
165
|
const byKeep = [...all].sort((x, y) => keepOf(x) - keepOf(y));
|
|
162
166
|
const dropped = /* @__PURE__ */ new Set();
|
|
163
167
|
for (const slot of byKeep) {
|
|
164
|
-
if (rowWidth(all.filter((s) => !dropped.has(s))
|
|
168
|
+
if (rowWidth(all.filter((s) => !dropped.has(s))) <= width + 4) break;
|
|
165
169
|
dropped.add(slot);
|
|
166
170
|
}
|
|
167
171
|
kept = all.filter((s) => !dropped.has(s));
|
|
@@ -187,7 +191,7 @@ function FormatButtons({ resolve, disabled = false, className, size = "sm", vari
|
|
|
187
191
|
className: cn("flex min-w-0 flex-nowrap items-center gap-0.5 overflow-hidden", className),
|
|
188
192
|
children: [
|
|
189
193
|
shown.map((slot, index) => {
|
|
190
|
-
if (slot.kind === "divider") return /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "mx-
|
|
194
|
+
if (slot.kind === "divider") return /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "mx-0.5 h-5 w-px shrink-0 bg-border" }, `d${index}`);
|
|
191
195
|
if (slot.kind === "style") {
|
|
192
196
|
const StyleIcon = currentStyle.icon;
|
|
193
197
|
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
@@ -202,10 +206,10 @@ function FormatButtons({ resolve, disabled = false, className, size = "sm", vari
|
|
|
202
206
|
className: cn(
|
|
203
207
|
"inline-flex shrink-0 items-center gap-1 rounded-md px-1.5 text-xs font-medium text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
204
208
|
size === "xs" ? "h-6" : "h-7",
|
|
205
|
-
variant === "full" && "w-[88px] justify-between"
|
|
209
|
+
variant === "full" && !compactStyle && "w-[88px] justify-between"
|
|
206
210
|
),
|
|
207
211
|
children: [
|
|
208
|
-
variant === "essential" ? /* @__PURE__ */ jsx(StyleIcon, { className: iconClass }) : /* @__PURE__ */ jsx("span", { className: "truncate", children: BLOCK_SHORT[currentStyle.command] }),
|
|
212
|
+
variant === "essential" || compactStyle ? /* @__PURE__ */ jsx(StyleIcon, { className: iconClass }) : /* @__PURE__ */ jsx("span", { className: "truncate", children: BLOCK_SHORT[currentStyle.command] }),
|
|
209
213
|
/* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3 shrink-0" })
|
|
210
214
|
]
|
|
211
215
|
}
|
|
@@ -6,6 +6,7 @@ import { NodeViewWrapper } from "@tiptap/react";
|
|
|
6
6
|
import { Popover, PopoverContent, PopoverTrigger } from "@ai-matrx/design-system";
|
|
7
7
|
import { Braces, Sigma } from "lucide-react";
|
|
8
8
|
import { cn } from "@ai-matrx/design-system";
|
|
9
|
+
import { DurableMarkdownImg } from "@ai-matrx/rich-content/display/chat-markdown/ConfigurableMarkdownContent";
|
|
9
10
|
import { useRichEditorContext } from "../../editor/RichEditorContext.js";
|
|
10
11
|
import { IslandCodeEditor } from "../../islands/IslandCodeEditor.js";
|
|
11
12
|
import { IslandPreview } from "../../islands/IslandPreview.js";
|
|
@@ -148,7 +149,7 @@ $$`, islandType: "math_block" }) })
|
|
|
148
149
|
const image = islandType === "md_image" ? imageParts(raw) : null;
|
|
149
150
|
if (image) {
|
|
150
151
|
return /* @__PURE__ */ jsx(NodeViewWrapper, { as: "span", className: "rich-editor-inline-island", contentEditable: false, children: /* @__PURE__ */ jsx(
|
|
151
|
-
|
|
152
|
+
DurableMarkdownImg,
|
|
152
153
|
{
|
|
153
154
|
src: image.src,
|
|
154
155
|
alt: image.alt,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-matrx/rich-editor",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
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,12 +90,12 @@
|
|
|
90
90
|
"@tiptap/suggestion": "^3.31.3",
|
|
91
91
|
"github-slugger": "^2.0.0",
|
|
92
92
|
"lucide-react": "^1.48.0",
|
|
93
|
-
"@ai-matrx/agents": "latest",
|
|
94
93
|
"@ai-matrx/alchemy": "latest",
|
|
94
|
+
"@ai-matrx/agents": "latest",
|
|
95
95
|
"@ai-matrx/content-ir": "latest",
|
|
96
96
|
"@ai-matrx/design-system": "latest",
|
|
97
|
-
"@ai-matrx/kit": "latest",
|
|
98
97
|
"@ai-matrx/print": "latest",
|
|
98
|
+
"@ai-matrx/kit": "latest",
|
|
99
99
|
"@ai-matrx/rich-content": "latest"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|