Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/09-ai/02-playground/src/data/aimodels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const AI_MODELS = [
"mistral.chat/mistral-medium-latest",
"mistral.chat/ministral-3b-latest",
"mistral.chat/ministral-8b-latest",
"anthropic.chat/claude-opus-4-1",
"anthropic.chat/claude-sonnet-4-0",
"anthropic.chat/claude-opus-4-5",
"anthropic.chat/claude-sonnet-4-5",
"anthropic.chat/claude-3-7-sonnet-latest",
"anthropic.chat/claude-3-5-haiku-latest",
"albert-etalab.chat/albert-large",
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/api/parsers/html/parseHTML.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export function HTMLToBlocks<

const parentNode = parser.parse(htmlNode, {
topNode: pmSchema.nodes["blockGroup"].create(),
preserveWhitespace: true
});

const blocks: Block<BSchema, I, S>[] = [];
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/schema/blocks/createSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export function getParseRules<
const parser = DOMParser.fromSchema(schema);
const parsed = parser.parse(clone, {
topNode: schema.nodes.paragraph.create(),
preserveWhitespace: true,
});

return parsed.content;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,13 @@ export function createUpdateBlockTool<T>(config: {
const block = editor.getBlock(id);

if (!block) {
// eslint-disable-next-line no-console
console.error("BLOCK NOT FOUND", id);
return {
ok: false,
error: "block not found",
error: new Error("Block not found (update)", {
cause: {
blockId: id,
},
}),
};
}

Expand Down
6 changes: 5 additions & 1 deletion packages/xl-ai/src/api/formats/base-tools/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ export const deleteBlockTool = (
if (!block) {
return {
ok: false,
error: "block not found",
error: new Error("Block not found (delete)", {
cause: {
blockId: id,
},
}),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ export async function createHTMLRebaseTool(
);

if (steps.length) {
// console.error("html diff", steps);
throw new Error("html diff");
throw new Error("html diff", {
cause: {
html,
htmlBlock
}
});
}

return rebaseTool(editor, tr);
Expand Down
Loading