diff --git a/packages/core/package.json b/packages/core/package.json index 96f60de1e8..cc64472ade 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -94,7 +94,7 @@ "hast-util-from-dom": "^5.0.1", "prosemirror-dropcursor": "^1.8.1", "prosemirror-highlight": "^0.13.0", - "prosemirror-model": "^1.24.1", + "prosemirror-model": "^1.25.1", "prosemirror-state": "^1.4.3", "prosemirror-tables": "^1.6.4", "prosemirror-transform": "^1.10.2", diff --git a/packages/core/src/blocks/AudioBlockContent/AudioBlockContent.ts b/packages/core/src/blocks/AudioBlockContent/AudioBlockContent.ts index 4357755bea..b00771d947 100644 --- a/packages/core/src/blocks/AudioBlockContent/AudioBlockContent.ts +++ b/packages/core/src/blocks/AudioBlockContent/AudioBlockContent.ts @@ -78,6 +78,11 @@ export const audioParse = ( element: HTMLElement ): Partial> | undefined => { if (element.tagName === "AUDIO") { + // Ignore if parent figure has already been parsed. + if (element.closest("figure")) { + return undefined; + } + return parseAudioElement(element as HTMLAudioElement); } diff --git a/packages/core/src/blocks/CodeBlockContent/CodeBlockContent.ts b/packages/core/src/blocks/CodeBlockContent/CodeBlockContent.ts index 4733fc88d5..c1e775d234 100644 --- a/packages/core/src/blocks/CodeBlockContent/CodeBlockContent.ts +++ b/packages/core/src/blocks/CodeBlockContent/CodeBlockContent.ts @@ -144,10 +144,12 @@ const CodeBlockContent = createStronglyTypedTiptapNode({ }, parseHTML() { return [ + // Parse from internal HTML. { tag: "div[data-content-type=" + this.name + "]", - contentElement: "code", + contentElement: ".bn-inline-content", }, + // Parse from external HTML. { tag: "pre", contentElement: "code", diff --git a/packages/core/src/blocks/FileBlockContent/FileBlockContent.ts b/packages/core/src/blocks/FileBlockContent/FileBlockContent.ts index 80ba39b012..ad861393ca 100644 --- a/packages/core/src/blocks/FileBlockContent/FileBlockContent.ts +++ b/packages/core/src/blocks/FileBlockContent/FileBlockContent.ts @@ -43,6 +43,11 @@ export const fileRender = ( export const fileParse = (element: HTMLElement) => { if (element.tagName === "EMBED") { + // Ignore if parent figure has already been parsed. + if (element.closest("figure")) { + return undefined; + } + return parseEmbedElement(element as HTMLEmbedElement); } diff --git a/packages/core/src/blocks/HeadingBlockContent/HeadingBlockContent.ts b/packages/core/src/blocks/HeadingBlockContent/HeadingBlockContent.ts index 2b95fbf5ab..22ef291623 100644 --- a/packages/core/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +++ b/packages/core/src/blocks/HeadingBlockContent/HeadingBlockContent.ts @@ -118,9 +118,12 @@ const HeadingBlockContent = createStronglyTypedTiptapNode({ }, parseHTML() { return [ + // Parse from internal HTML. { tag: "div[data-content-type=" + this.name + "]", + contentElement: ".bn-inline-content", }, + // Parse from external HTML. { tag: "h1", attrs: { level: 1 }, diff --git a/packages/core/src/blocks/ImageBlockContent/ImageBlockContent.ts b/packages/core/src/blocks/ImageBlockContent/ImageBlockContent.ts index 8de45dca10..d9468523a3 100644 --- a/packages/core/src/blocks/ImageBlockContent/ImageBlockContent.ts +++ b/packages/core/src/blocks/ImageBlockContent/ImageBlockContent.ts @@ -88,6 +88,11 @@ export const imageParse = ( element: HTMLElement ): Partial> | undefined => { if (element.tagName === "IMG") { + // Ignore if parent figure has already been parsed. + if (element.closest("figure")) { + return undefined; + } + return parseImageElement(element as HTMLImageElement); } diff --git a/packages/core/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts b/packages/core/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts index 15e2ae8cdd..5bc867809b 100644 --- a/packages/core/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +++ b/packages/core/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts @@ -8,6 +8,7 @@ import { } from "../../../schema/index.js"; import { createDefaultBlockDOMOutputSpec } from "../../defaultBlockHelpers.js"; import { defaultProps } from "../../defaultProps.js"; +import { getListItemContent } from "../getListItemContent.js"; import { handleEnter } from "../ListItemKeyboardShortcuts.js"; export const bulletListItemPropSchema = { @@ -73,10 +74,12 @@ const BulletListItemBlockContent = createStronglyTypedTiptapNode({ parseHTML() { return [ - // Case for regular HTML list structure. + // Parse from internal HTML. { tag: "div[data-content-type=" + this.name + "]", + contentElement: ".bn-inline-content", }, + // Parse from external HTML. { tag: "li", getAttrs: (element) => { @@ -92,36 +95,17 @@ const BulletListItemBlockContent = createStronglyTypedTiptapNode({ if ( parent.tagName === "UL" || - (parent.tagName === "DIV" && parent.parentElement!.tagName === "UL") + (parent.tagName === "DIV" && parent.parentElement?.tagName === "UL") ) { return {}; } return false; }, - node: "bulletListItem", - }, - // Case for BlockNote list structure. - { - tag: "p", - getAttrs: (element) => { - if (typeof element === "string") { - return false; - } - - const parent = element.parentElement; - - if (parent === null) { - return false; - } - - if (parent.getAttribute("data-content-type") === "bulletListItem") { - return {}; - } - - return false; - }, - priority: 300, + // As `li` elements can contain multiple paragraphs, we need to merge their contents + // into a single one so that ProseMirror can parse everything correctly. + getContent: (node, schema) => + getListItemContent(node, schema, this.name), node: "bulletListItem", }, ]; diff --git a/packages/core/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts b/packages/core/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts index 1938388cb3..056c6e3256 100644 --- a/packages/core/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +++ b/packages/core/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts @@ -12,6 +12,7 @@ import { } from "../../../schema/index.js"; import { createDefaultBlockDOMOutputSpec } from "../../defaultBlockHelpers.js"; import { defaultProps } from "../../defaultProps.js"; +import { getListItemContent } from "../getListItemContent.js"; import { handleEnter } from "../ListItemKeyboardShortcuts.js"; export const checkListItemPropSchema = { @@ -109,10 +110,12 @@ const checkListItemBlockContent = createStronglyTypedTiptapNode({ parseHTML() { return [ + // Parse from internal HTML. { tag: "div[data-content-type=" + this.name + "]", + contentElement: ".bn-inline-content", }, - // Checkbox only. + // Parse from external HTML. { tag: "input", getAttrs: (element) => { @@ -120,6 +123,11 @@ const checkListItemBlockContent = createStronglyTypedTiptapNode({ return false; } + // Ignore if we already parsed an ancestor list item to avoid double-parsing. + if (element.closest("[data-content-type]") || element.closest("li")) { + return false; + } + if ((element as HTMLInputElement).type === "checkbox") { return { checked: (element as HTMLInputElement).checked }; } @@ -128,7 +136,6 @@ const checkListItemBlockContent = createStronglyTypedTiptapNode({ }, node: "checkListItem", }, - // Container element for checkbox + label. { tag: "li", getAttrs: (element) => { @@ -144,7 +151,7 @@ const checkListItemBlockContent = createStronglyTypedTiptapNode({ if ( parent.tagName === "UL" || - (parent.tagName === "DIV" && parent.parentElement!.tagName === "UL") + (parent.tagName === "DIV" && parent.parentElement?.tagName === "UL") ) { const checkbox = (element.querySelector( @@ -160,6 +167,10 @@ const checkListItemBlockContent = createStronglyTypedTiptapNode({ return false; }, + // As `li` elements can contain multiple paragraphs, we need to merge their contents + // into a single one so that ProseMirror can parse everything correctly. + getContent: (node, schema) => + getListItemContent(node, schema, this.name), node: "checkListItem", }, ]; diff --git a/packages/core/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts b/packages/core/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts index 6c0f72a0a0..fd837ca7b4 100644 --- a/packages/core/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +++ b/packages/core/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts @@ -9,6 +9,7 @@ import { } from "../../../schema/index.js"; import { createDefaultBlockDOMOutputSpec } from "../../defaultBlockHelpers.js"; import { defaultProps } from "../../defaultProps.js"; +import { getListItemContent } from "../getListItemContent.js"; import { handleEnter } from "../ListItemKeyboardShortcuts.js"; import { NumberedListIndexingPlugin } from "./NumberedListIndexingPlugin.js"; @@ -101,11 +102,12 @@ const NumberedListItemBlockContent = createStronglyTypedTiptapNode({ parseHTML() { return [ + // Parse from internal HTML. { tag: "div[data-content-type=" + this.name + "]", + contentElement: ".bn-inline-content", }, - // Case for regular HTML list structure. - // (e.g.: when pasting from other apps) + // Parse from external HTML. { tag: "li", getAttrs: (element) => { @@ -121,7 +123,7 @@ const NumberedListItemBlockContent = createStronglyTypedTiptapNode({ if ( parent.tagName === "OL" || - (parent.tagName === "DIV" && parent.parentElement!.tagName === "OL") + (parent.tagName === "DIV" && parent.parentElement?.tagName === "OL") ) { const startIndex = parseInt(parent.getAttribute("start") || "1") || 1; @@ -137,29 +139,10 @@ const NumberedListItemBlockContent = createStronglyTypedTiptapNode({ return false; }, - node: "numberedListItem", - }, - // Case for BlockNote list structure. - // (e.g.: when pasting from blocknote) - { - tag: "p", - getAttrs: (element) => { - if (typeof element === "string") { - return false; - } - - const parent = element.parentElement; - - if (parent === null) { - return false; - } - - if (parent.getAttribute("data-content-type") === "numberedListItem") { - return {}; - } - - return false; - }, + // As `li` elements can contain multiple paragraphs, we need to merge their contents + // into a single one so that ProseMirror can parse everything correctly. + getContent: (node, schema) => + getListItemContent(node, schema, this.name), priority: 300, node: "numberedListItem", }, diff --git a/packages/core/src/blocks/ListItemBlockContent/getListItemContent.ts b/packages/core/src/blocks/ListItemBlockContent/getListItemContent.ts new file mode 100644 index 0000000000..15e5da68f6 --- /dev/null +++ b/packages/core/src/blocks/ListItemBlockContent/getListItemContent.ts @@ -0,0 +1,115 @@ +import { DOMParser, Fragment, Schema } from "prosemirror-model"; + +/** + * This function is used to parse the content of a list item external HTML node. + * + * Due to a change in how prosemirror-model handles parsing elements, we have additional flexibility in how we can "fit" content into a list item. + * + * We've decided to take an approach that is similar to Notion. The core rules of the algorithm are: + * + * - If the first child of an `li` has ONLY text content, take the text content, and flatten it into the list item. Subsequent siblings are carried over as is, as children of the list item. + * - e.g. `
  • Hello

    World

  • ->
  • Hello

    World

  • ` + * - Else, take the content and insert it as children instead. + * - e.g. `
  • ->
  • ` + * + * This ensures that a list item's content is always valid ProseMirror content. Smoothing over differences between how external HTML may be rendered, and how ProseMirror expects content to be structured. + */ +export function getListItemContent( + /** + * The `li` element to parse. + */ + _node: Node, + /** + * The schema to use for parsing. + */ + schema: Schema, + /** + * The name of the list item node. + */ + name: string +): Fragment { + /** + * To actually implement this algorithm, we need to leverage ProseMirror's "fitting" algorithm. + * Where, if content is parsed which doesn't fit into the current node, it will be moved into the parent node. + * + * This allows us to parse multiple pieces of content from within the list item (even though it normally would not match the list item's schema) and "throw" the excess content into the list item's children. + * + * The expected return value is a `Fragment` which contains the list item's content as the first element, and the children wrapped in a blockGroup node. Like so: + * ``` + * Fragment<[Node, Node>>>]> + * ``` + */ + const parser = DOMParser.fromSchema(schema); + + // TODO: This will be unnecessary in the future: https://github.com/ProseMirror/prosemirror-model/commit/166188d4f9db96eb86fb7de62e72049c86c9dd79 + const node = _node as HTMLElement; + + // Move the `li` element's content into a new `div` element + // This is a hacky workaround to not re-trigger list item parsing, + // when we are looking to understand what the list item's content actually is, in terms of the schema. + const clonedNodeDiv = document.createElement("div"); + // Mark the `div` element as a `blockGroup` to make the parsing easier. + clonedNodeDiv.setAttribute("data-node-type", "blockGroup"); + // Clone all children of the `li` element into the new `div` element + for (const child of Array.from(node.childNodes)) { + clonedNodeDiv.appendChild(child.cloneNode(true)); + } + + // Parses children of the `li` element into a `blockGroup` with `blockContainer` node children + // This is the structure of list item children, so parsing into this structure allows for + // easy separation of list item content from child list item content. + let blockGroupNode = parser.parse(clonedNodeDiv, { + topNode: schema.nodes.blockGroup.create(), + }); + + // There is an edge case where a list item's content may contain a `` element. + // Causing it to be recognized as a `checkListItem`. + // We want to skip this, and just parse the list item's content as is. + if (blockGroupNode.firstChild?.firstChild?.type.name === "checkListItem") { + // We skip the first child, by cutting it out of the `blockGroup` node. + // and continuing with the rest of the algorithm. + blockGroupNode = blockGroupNode.copy( + blockGroupNode.content.cut( + blockGroupNode.firstChild.firstChild.nodeSize + 2 + ) + ); + } + + // Structure above is `blockGroup[]>` + // We want to extract the first `blockContainer` node's content, and see if it is a text block. + const listItemsFirstChild = blockGroupNode.firstChild?.firstChild; + + // If the first node is not a text block, then it's first child is not compatible with the list item node. + if (!listItemsFirstChild?.isTextblock) { + // So, we do not try inserting anything into the list item, and instead return anything we found as children for the list item. + return Fragment.from(blockGroupNode); + } + + // If it is a text block, then we know it only contains text content. + // So, we extract it, and insert its content into the `listItemNode`. + // The remaining nodes in the `blockGroup` stay in-place. + const listItemNode = schema.nodes[name].create( + {}, + listItemsFirstChild.content + ); + + // We have `blockGroup[]>` + // We want to extract out the rest of the nodes as `<...blockContainer[]>` + const remainingListItemChildren = blockGroupNode.content.cut( + // +2 for the `blockGroup` node's start and end markers + listItemsFirstChild.nodeSize + 2 + ); + const hasRemainingListItemChildren = remainingListItemChildren.size > 0; + + if (hasRemainingListItemChildren) { + // Copy the remaining list item children back into the `blockGroup` node. + // This will make it back into: `blockGroup<...blockContainer[]>` + const listItemsChildren = blockGroupNode.copy(remainingListItemChildren); + + // Return the `listItem` node's content, then add the parsed children after to be lifted out by ProseMirror "fitting" algorithm. + return listItemNode.content.addToEnd(listItemsChildren); + } + + // Otherwise, just return the `listItem` node's content. + return listItemNode.content; +} diff --git a/packages/core/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts b/packages/core/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts index 8d291d7f5e..ba86d9efa8 100644 --- a/packages/core/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +++ b/packages/core/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts @@ -39,10 +39,14 @@ export const ParagraphBlockContent = createStronglyTypedTiptapNode({ parseHTML() { return [ - { tag: "div[data-content-type=" + this.name + "]" }, + // Parse from internal HTML. + { + tag: "div[data-content-type=" + this.name + "]", + contentElement: ".bn-inline-content", + }, + // Parse from external HTML. { tag: "p", - priority: 200, getAttrs: (element) => { if (typeof element === "string" || !element.textContent?.trim()) { return false; diff --git a/packages/core/src/blocks/QuoteBlockContent/QuoteBlockContent.ts b/packages/core/src/blocks/QuoteBlockContent/QuoteBlockContent.ts index a321576be0..7c89f2e2bc 100644 --- a/packages/core/src/blocks/QuoteBlockContent/QuoteBlockContent.ts +++ b/packages/core/src/blocks/QuoteBlockContent/QuoteBlockContent.ts @@ -67,7 +67,12 @@ export const QuoteBlockContent = createStronglyTypedTiptapNode({ parseHTML() { return [ - { tag: "div[data-content-type=" + this.name + "]" }, + // Parse from internal HTML. + { + tag: "div[data-content-type=" + this.name + "]", + contentElement: ".bn-inline-content", + }, + // Parse from external HTML. { tag: "blockquote", node: "quote", diff --git a/packages/core/src/blocks/TableBlockContent/TableBlockContent.ts b/packages/core/src/blocks/TableBlockContent/TableBlockContent.ts index 1375a528f3..1062f303ca 100644 --- a/packages/core/src/blocks/TableBlockContent/TableBlockContent.ts +++ b/packages/core/src/blocks/TableBlockContent/TableBlockContent.ts @@ -1,7 +1,7 @@ import { TableCell } from "@tiptap/extension-table-cell"; import { TableHeader } from "@tiptap/extension-table-header"; import { TableRow } from "@tiptap/extension-table-row"; -import { Node as PMNode } from "prosemirror-model"; +import { DOMParser, Fragment, Node as PMNode, Schema } from "prosemirror-model"; import { TableView } from "prosemirror-tables"; import { NodeView } from "prosemirror-view"; @@ -27,7 +27,11 @@ export const TableBlockContent = createStronglyTypedTiptapNode({ isolating: true, parseHTML() { - return [{ tag: "table" }]; + return [ + { + tag: "table", + }, + ]; }, renderHTML({ HTMLAttributes }) { @@ -113,17 +117,6 @@ const TableParagraph = createStronglyTypedTiptapNode({ parseHTML() { return [ - { - preserveWhitespace: "full", - // set this rule as high priority so it takes precedence over the default paragraph rule, - // but only if we're in the tableContent context - priority: 210, - context: "tableContent", - tag: "p", - getAttrs: (_element) => { - return {}; - }, - }, { tag: "p", getAttrs: (element) => { @@ -131,18 +124,24 @@ const TableParagraph = createStronglyTypedTiptapNode({ return false; } + // Only parse in internal HTML. + if (!element.closest("[data-content-type]")) { + return false; + } + const parent = element.parentElement; if (parent === null) { return false; } - if (parent.tagName === "TD") { + if (parent.tagName === "TD" || parent.tagName === "TH") { return {}; } return false; }, + node: "tableParagraph", }, ]; }, @@ -152,6 +151,42 @@ const TableParagraph = createStronglyTypedTiptapNode({ }, }); +/** + * This will flatten a node's content to fit into a table cell's paragraph. + */ +function parseTableContent(node: HTMLElement, schema: Schema) { + const parser = DOMParser.fromSchema(schema); + + // This will parse the content of the table paragraph as though it were a blockGroup. + // Resulting in a structure like: + // + // + //

    Hello

    + //
    + // + //

    Hello

    + //
    + //
    + const parsedContent = parser.parse(node, { + topNode: schema.nodes.blockGroup.create(), + }); + const extractedContent: PMNode[] = []; + + // Try to extract any content within the blockContainer. + parsedContent.content.descendants((child) => { + // As long as the child is an inline node, we can append it to the fragment. + if (child.isInline) { + // And append it to the fragment + extractedContent.push(child); + return false; + } + + return undefined; + }); + + return Fragment.fromArray(extractedContent); +} + export const Table = createBlockSpecFromStronglyTypedTiptapNode( TableBlockContent, tablePropSchema, @@ -167,9 +202,31 @@ export const Table = createBlockSpecFromStronglyTypedTiptapNode( * So, we manually fix this up when reading back in the `nodeToBlock` and only ever place a single tableContent back into the cell. */ content: "tableContent+", + parseHTML() { + return [ + { + tag: "th", + // As `th` elements can contain multiple paragraphs, we need to merge their contents + // into a single one so that ProseMirror can parse everything correctly. + getContent: (node, schema) => + parseTableContent(node as HTMLElement, schema), + }, + ]; + }, }), TableCell.extend({ content: "tableContent+", + parseHTML() { + return [ + { + tag: "td", + // As `td` elements can contain multiple paragraphs, we need to merge their contents + // into a single one so that ProseMirror can parse everything correctly. + getContent: (node, schema) => + parseTableContent(node as HTMLElement, schema), + }, + ]; + }, }), TableRow, ] diff --git a/packages/core/src/blocks/VideoBlockContent/VideoBlockContent.ts b/packages/core/src/blocks/VideoBlockContent/VideoBlockContent.ts index 619bea0734..e5e109ce99 100644 --- a/packages/core/src/blocks/VideoBlockContent/VideoBlockContent.ts +++ b/packages/core/src/blocks/VideoBlockContent/VideoBlockContent.ts @@ -88,6 +88,11 @@ export const videoParse = ( element: HTMLElement ): Partial> | undefined => { if (element.tagName === "VIDEO") { + // Ignore if parent figure has already been parsed. + if (element.closest("figure")) { + return undefined; + } + return parseVideoElement(element as HTMLVideoElement); } diff --git a/packages/core/src/blocks/defaultBlockHelpers.ts b/packages/core/src/blocks/defaultBlockHelpers.ts index fbba956c8d..056587a79f 100644 --- a/packages/core/src/blocks/defaultBlockHelpers.ts +++ b/packages/core/src/blocks/defaultBlockHelpers.ts @@ -95,3 +95,19 @@ export const defaultBlockToHTML = < contentDOM?: HTMLElement; }; }; + +// Function that merges all paragraphs into a single one separated by line breaks. +// This is used when parsing blocks like list items and table cells, as they may +// contain multiple paragraphs that ProseMirror will not be able to handle +// properly. +export function mergeParagraphs(element: HTMLElement) { + const paragraphs = element.querySelectorAll("p"); + if (paragraphs.length > 1) { + const firstParagraph = paragraphs[0]; + for (let i = 1; i < paragraphs.length; i++) { + const paragraph = paragraphs[i]; + firstParagraph.innerHTML += "
    " + paragraph.innerHTML; + paragraph.remove(); + } + } +} diff --git a/packages/core/src/pm-nodes/BlockContainer.ts b/packages/core/src/pm-nodes/BlockContainer.ts index ecd7f8068f..d779abe415 100644 --- a/packages/core/src/pm-nodes/BlockContainer.ts +++ b/packages/core/src/pm-nodes/BlockContainer.ts @@ -31,7 +31,7 @@ export const BlockContainer = Node.create<{ parseHTML() { return [ { - tag: "div", + tag: "div[data-node-type=" + this.name + "]", getAttrs: (element) => { if (typeof element === "string") { return false; @@ -44,13 +44,14 @@ export const BlockContainer = Node.create<{ } } - if (element.getAttribute("data-node-type") === "blockContainer") { - return attrs; - } - - return false; + return attrs; }, }, + // Ignore `blockOuter` divs, but parse the `blockContainer` divs inside them. + { + tag: `div[data-node-type="blockOuter"]`, + skip: true, + }, ]; }, diff --git a/packages/core/src/schema/blocks/createSpec.ts b/packages/core/src/schema/blocks/createSpec.ts index f6d9c4ae45..ac1bc4328d 100644 --- a/packages/core/src/schema/blocks/createSpec.ts +++ b/packages/core/src/schema/blocks/createSpec.ts @@ -90,7 +90,7 @@ export function getParseRules( const rules: TagParseRule[] = [ { tag: "[data-content-type=" + config.type + "]", - contentElement: "[data-editable]", + contentElement: ".bn-inline-content", }, ]; diff --git a/packages/core/src/schema/blocks/internal.ts b/packages/core/src/schema/blocks/internal.ts index 8dd816b654..740e3867d5 100644 --- a/packages/core/src/schema/blocks/internal.ts +++ b/packages/core/src/schema/blocks/internal.ts @@ -199,7 +199,6 @@ export function wrapInBlockStructure< "bn-inline-content", element.contentDOM.className ); - element.contentDOM.setAttribute("data-editable", ""); } return { diff --git a/packages/react/src/schema/ReactBlockSpec.tsx b/packages/react/src/schema/ReactBlockSpec.tsx index a64c873697..407b12dafb 100644 --- a/packages/react/src/schema/ReactBlockSpec.tsx +++ b/packages/react/src/schema/ReactBlockSpec.tsx @@ -185,7 +185,15 @@ export function createReactBlockSpec< { + ref(element); + if (element) { + element.className = mergeCSSClasses( + "bn-inline-content", + element.className + ); + } + }} /> ); @@ -221,13 +229,20 @@ export function createReactBlockSpec< { + refCB(element); + if (element) { + element.className = mergeCSSClasses( + "bn-inline-content", + element.className + ); + } + }} /> ), editor ); - output.contentDOM?.setAttribute("data-editable", ""); return output; }, @@ -247,12 +262,19 @@ export function createReactBlockSpec< { + refCB(element); + if (element) { + element.className = mergeCSSClasses( + "bn-inline-content", + element.className + ); + } + }} /> ); }, editor); - output.contentDOM?.setAttribute("data-editable", ""); return output; }, diff --git a/packages/server-util/src/context/react/__snapshots__/ReactServer.test.tsx.snap b/packages/server-util/src/context/react/__snapshots__/ReactServer.test.tsx.snap index 9ed0b88e8c..85f5cceb37 100644 --- a/packages/server-util/src/context/react/__snapshots__/ReactServer.test.tsx.snap +++ b/packages/server-util/src/context/react/__snapshots__/ReactServer.test.tsx.snap @@ -1,5 +1,5 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Test ServerBlockNoteEditor with React blocks > works for blocks with context 1`] = `"
    React Context Paragraph
    "`; +exports[`Test ServerBlockNoteEditor with React blocks > works for blocks with context 1`] = `"
    React Context Paragraph
    "`; -exports[`Test ServerBlockNoteEditor with React blocks > works for simple blocks 1`] = `"

    React Custom Paragraph

    "`; +exports[`Test ServerBlockNoteEditor with React blocks > works for simple blocks 1`] = `"

    React Custom Paragraph

    "`; diff --git a/packages/xl-multi-column/package.json b/packages/xl-multi-column/package.json index a711a6252a..ca8ce8e835 100644 --- a/packages/xl-multi-column/package.json +++ b/packages/xl-multi-column/package.json @@ -54,7 +54,7 @@ "@blocknote/core": "0.29.1", "@blocknote/react": "0.29.1", "@tiptap/core": "^2.7.1", - "prosemirror-model": "^1.23.0", + "prosemirror-model": "^1.25.1", "prosemirror-state": "^1.4.3", "prosemirror-tables": "^1.3.7", "prosemirror-transform": "^1.9.0", @@ -67,14 +67,15 @@ "@vitest/ui": "^2.1.4", "eslint": "^8.10.0", "jsdom": "^21.1.0", + "prettier": "^2.7.1", + "react": "^18.3.1", + "react-dom": "^18.3.1", "rimraf": "^5.0.5", "rollup-plugin-webpack-stats": "^0.2.2", "typescript": "^5.3.3", "vite": "^5.3.4", "vite-plugin-eslint": "^1.8.1", - "vitest": "^2.0.3", - "react": "^18.3.1", - "react-dom": "^18.3.1" + "vitest": "^2.0.3" }, "peerDependencies": { "react": "^18.0 || ^19.0 || >= 19.0.0-rc", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 643070b55d..d68f2eb034 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2489,10 +2489,10 @@ importers: version: 2.23.1(react@18.3.1) '@liveblocks/react-blocknote': specifier: ^2.23.1 - version: 2.23.1(a9fafa167a137f224b16cac05e678ac8) + version: 2.23.1(1dcb48210094f6b40042d5901eb98d40) '@liveblocks/react-tiptap': specifier: ^2.23.1 - version: 2.23.1(@tiptap/extension-collaboration-cursor@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(y-prosemirror@1.3.4(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)))(@tiptap/extension-collaboration@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(y-prosemirror@1.3.4(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)))(@tiptap/pm@2.11.5)(@tiptap/react@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@tiptap/suggestion@2.11.7(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5))(@types/react-dom@18.3.5(@types/react@18.3.20))(@types/react@18.3.20)(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(y-protocols@1.0.6(yjs@13.6.24)) + version: 2.23.1(@tiptap/extension-collaboration-cursor@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(y-prosemirror@1.3.4(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)))(@tiptap/extension-collaboration@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(y-prosemirror@1.3.4(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)))(@tiptap/pm@2.11.5)(@tiptap/react@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@tiptap/suggestion@2.11.7(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5))(@types/react-dom@18.3.5(@types/react@18.3.20))(@types/react@18.3.20)(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(y-protocols@1.0.6(yjs@13.6.24)) '@liveblocks/react-ui': specifier: ^2.23.1 version: 2.23.1(@types/react-dom@18.3.5(@types/react@18.3.20))(@types/react@18.3.20)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -2958,10 +2958,10 @@ importers: version: 1.8.1 prosemirror-highlight: specifier: ^0.13.0 - version: 0.13.0(@shikijs/types@3.2.1)(@types/hast@3.0.4)(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-transform@1.10.3)(prosemirror-view@1.38.1) + version: 0.13.0(@shikijs/types@3.2.1)(@types/hast@3.0.4)(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-transform@1.10.3)(prosemirror-view@1.38.1) prosemirror-model: - specifier: ^1.24.1 - version: 1.25.0 + specifier: ^1.25.1 + version: 1.25.1 prosemirror-state: specifier: ^1.4.3 version: 1.4.3 @@ -3006,7 +3006,7 @@ importers: version: 8.3.2 y-prosemirror: specifier: ^1.3.4 - version: 1.3.4(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24) + version: 1.3.4(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24) y-protocols: specifier: ^1.0.6 version: 1.0.6(yjs@13.6.24) @@ -3247,7 +3247,7 @@ importers: version: 18.3.1(react@18.3.1) y-prosemirror: specifier: ^1.3.4 - version: 1.3.4(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24) + version: 1.3.4(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24) y-protocols: specifier: ^1.0.6 version: 1.0.6(yjs@13.6.24) @@ -3459,8 +3459,8 @@ importers: specifier: ^2.7.1 version: 2.11.5(@tiptap/pm@2.11.5) prosemirror-model: - specifier: ^1.23.0 - version: 1.25.0 + specifier: ^1.25.1 + version: 1.25.1 prosemirror-state: specifier: ^1.4.3 version: 1.4.3 @@ -3492,6 +3492,9 @@ importers: jsdom: specifier: ^21.1.0 version: 21.1.2(canvas@2.11.2(encoding@0.1.13)) + prettier: + specifier: ^2.7.1 + version: 2.8.8 react: specifier: ^18.3.1 version: 18.3.1 @@ -3688,10 +3691,10 @@ importers: version: 2.23.1(react@18.3.1) '@liveblocks/react-blocknote': specifier: ^2.23.1 - version: 2.23.1(a9fafa167a137f224b16cac05e678ac8) + version: 2.23.1(1dcb48210094f6b40042d5901eb98d40) '@liveblocks/react-tiptap': specifier: ^2.23.1 - version: 2.23.1(@tiptap/extension-collaboration-cursor@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(y-prosemirror@1.3.4(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)))(@tiptap/extension-collaboration@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(y-prosemirror@1.3.4(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)))(@tiptap/pm@2.11.5)(@tiptap/react@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@tiptap/suggestion@2.11.7(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5))(@types/react-dom@18.3.5(@types/react@18.3.20))(@types/react@18.3.20)(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(y-protocols@1.0.6(yjs@13.6.24)) + version: 2.23.1(@tiptap/extension-collaboration-cursor@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(y-prosemirror@1.3.4(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)))(@tiptap/extension-collaboration@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(y-prosemirror@1.3.4(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)))(@tiptap/pm@2.11.5)(@tiptap/react@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@tiptap/suggestion@2.11.7(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5))(@types/react-dom@18.3.5(@types/react@18.3.20))(@types/react@18.3.20)(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(y-protocols@1.0.6(yjs@13.6.24)) '@liveblocks/react-ui': specifier: ^2.23.1 version: 2.23.1(@types/react-dom@18.3.5(@types/react@18.3.20))(@types/react@18.3.20)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -4060,6 +4063,10 @@ packages: resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} engines: {node: '>=6.9.0'} + '@babel/code-frame@7.27.1': + resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} + engines: {node: '>=6.9.0'} + '@babel/compat-data@7.26.8': resolution: {integrity: sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==} engines: {node: '>=6.9.0'} @@ -4150,6 +4157,10 @@ packages: resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} engines: {node: '>=6.9.0'} + '@babel/helper-validator-identifier@7.27.1': + resolution: {integrity: sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==} + engines: {node: '>=6.9.0'} + '@babel/helper-validator-option@7.25.9': resolution: {integrity: sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==} engines: {node: '>=6.9.0'} @@ -4700,6 +4711,10 @@ packages: resolution: {integrity: sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw==} engines: {node: '>=6.9.0'} + '@babel/runtime@7.27.1': + resolution: {integrity: sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog==} + engines: {node: '>=6.9.0'} + '@babel/template@7.27.0': resolution: {integrity: sha512-2ncevenBqXI6qRMukPlXwHKHchC7RyMuu4xv5JBXRfOGVcTy1mXCD12qrp7Jsoxll1EV3+9sE4GugBVRjT2jFA==} engines: {node: '>=6.9.0'} @@ -7918,8 +7933,8 @@ packages: '@types/node@20.17.28': resolution: {integrity: sha512-DHlH/fNL6Mho38jTy7/JT7sn2wnXI+wULR6PV4gy4VHLVvnrV/d3pHAMQHhc4gjdLmK2ZiPoMxzp6B3yRajLSQ==} - '@types/node@20.17.30': - resolution: {integrity: sha512-7zf4YyHA+jvBNfVrk2Gtvs6x7E8V+YDW05bNfG2XkWDJfYRXrTiP/DsB2zSYTaHX0bGIujTBQdMVAhb+j7mwpg==} + '@types/node@20.17.45': + resolution: {integrity: sha512-vO9+E1smq+149wsmmLdM8SKVW7gRzLjfo0mU7kiykhV6rL+GEUhUmW7VywJNSxJHQzt9QBIHEo+3SG4MrFTqbA==} '@types/node@22.13.13': resolution: {integrity: sha512-ClsL5nMwKaBRwPcCvH8E7+nU4GxHVx1axNvMZTFHMEfNI7oahimt26P5zjVCRrjiIWj6YFXfE1v3dEp94wLcGQ==} @@ -8736,6 +8751,11 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true + browserslist@4.24.5: + resolution: {integrity: sha512-FDToo4Wo82hIdgc1CQ+NQD0hEhmpPjrZ3hiUgwgOG6IuTdlpr8jdjyG24P6cNP1yJpTLzS5OcGgSw0xmDU1/Tw==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} @@ -8787,6 +8807,9 @@ packages: caniuse-lite@1.0.30001707: resolution: {integrity: sha512-3qtRjw/HQSMlDWf+X79N206fepf4SOOU6SQLMaq/0KkZLmSjPxAkBOQQ+FxbHKfHmYLZFfdWsO3KA90ceHPSnw==} + caniuse-lite@1.0.30001717: + resolution: {integrity: sha512-auPpttCq6BDEG8ZAuHJIplGw6GODhjw+/11e7IjpnYCxZcW/ONgPs0KVBJ0d1bY3e2+7PRe5RCLyP+PfwVgkYw==} + canvas@2.11.2: resolution: {integrity: sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==} engines: {node: '>=6'} @@ -9475,6 +9498,9 @@ packages: electron-to-chromium@1.5.126: resolution: {integrity: sha512-AtH1uLcTC72LA4vfYcEJJkrMk/MY/X0ub8Hv7QGAePW2JkeUFHEL/QfS4J77R6M87Sss8O0OcqReSaN1bpyA+Q==} + electron-to-chromium@1.5.151: + resolution: {integrity: sha512-Rl6uugut2l9sLojjS4H4SAr3A4IgACMLgpuEMPYCVcKydzfyPrn5absNRju38IhQOf/NwjJY8OGWjlteqYeBCA==} + elkjs@0.9.3: resolution: {integrity: sha512-f/ZeWvW/BCXbhGEf1Ujp29EASo/lk1FDnETgNKwJrsVvGZhUWCZyg3xLJjAsxfOmt8KjswHmI5EwCQcPMpOYhQ==} @@ -12019,6 +12045,11 @@ packages: prettier-plugin-svelte: optional: true + prettier@2.8.8: + resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} + engines: {node: '>=10.13.0'} + hasBin: true + prettier@3.5.3: resolution: {integrity: sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==} engines: {node: '>=14'} @@ -12124,8 +12155,8 @@ packages: prosemirror-menu@1.2.4: resolution: {integrity: sha512-S/bXlc0ODQup6aiBbWVsX/eM+xJgCTAfMq/nLqaO5ID/am4wS0tTCIkzwytmao7ypEtjj39i7YbJjAgO20mIqA==} - prosemirror-model@1.25.0: - resolution: {integrity: sha512-/8XUmxWf0pkj2BmtqZHYJipTBMHIdVjuvFzMvEoxrtyGNmfvdhBiRwYt/eFwy2wA9DtBW3RLqvZnjurEkHaFCw==} + prosemirror-model@1.25.1: + resolution: {integrity: sha512-AUvbm7qqmpZa5d9fPKMvH1Q5bqYQvAZWOGRvxsB6iFLyycvC9MwNemNVjHVrWgjaoxAfY8XVg7DbvQ/qxvI9Eg==} prosemirror-schema-basic@1.2.4: resolution: {integrity: sha512-ELxP4TlX3yr2v5rM7Sb70SqStq5NvI15c0j9j/gjsrO5vaw+fnnpovCLEGIcpeGfifkuqJwl4fon6b+KdrODYQ==} @@ -14346,6 +14377,12 @@ snapshots: js-tokens: 4.0.0 picocolors: 1.1.1 + '@babel/code-frame@7.27.1': + dependencies: + '@babel/helper-validator-identifier': 7.27.1 + js-tokens: 4.0.0 + picocolors: 1.1.1 + '@babel/compat-data@7.26.8': {} '@babel/core@7.26.10': @@ -14485,6 +14522,8 @@ snapshots: '@babel/helper-validator-identifier@7.25.9': {} + '@babel/helper-validator-identifier@7.27.1': {} + '@babel/helper-validator-option@7.25.9': {} '@babel/helper-wrap-function@7.25.9': @@ -15155,6 +15194,8 @@ snapshots: dependencies: regenerator-runtime: 0.14.1 + '@babel/runtime@7.27.1': {} + '@babel/template@7.27.0': dependencies: '@babel/code-frame': 7.26.2 @@ -15921,7 +15962,7 @@ snapshots: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 20.17.30 + '@types/node': 20.17.45 '@types/yargs': 17.0.33 chalk: 4.1.2 @@ -15964,14 +16005,14 @@ snapshots: '@liveblocks/core@2.23.1': {} - '@liveblocks/react-blocknote@2.23.1(a9fafa167a137f224b16cac05e678ac8)': + '@liveblocks/react-blocknote@2.23.1(1dcb48210094f6b40042d5901eb98d40)': dependencies: '@blocknote/core': link:packages/core '@blocknote/react': link:packages/react '@liveblocks/client': 2.23.1 '@liveblocks/core': 2.23.1 '@liveblocks/react': 2.23.1(react@18.3.1) - '@liveblocks/react-tiptap': 2.23.1(@tiptap/extension-collaboration-cursor@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(y-prosemirror@1.3.4(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)))(@tiptap/extension-collaboration@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(y-prosemirror@1.3.4(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)))(@tiptap/pm@2.11.5)(@tiptap/react@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@tiptap/suggestion@2.11.7(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5))(@types/react-dom@18.3.5(@types/react@18.3.20))(@types/react@18.3.20)(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(y-protocols@1.0.6(yjs@13.6.24)) + '@liveblocks/react-tiptap': 2.23.1(@tiptap/extension-collaboration-cursor@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(y-prosemirror@1.3.4(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)))(@tiptap/extension-collaboration@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(y-prosemirror@1.3.4(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)))(@tiptap/pm@2.11.5)(@tiptap/react@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@tiptap/suggestion@2.11.7(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5))(@types/react-dom@18.3.5(@types/react@18.3.20))(@types/react@18.3.20)(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(y-protocols@1.0.6(yjs@13.6.24)) '@liveblocks/react-ui': 2.23.1(@types/react-dom@18.3.5(@types/react@18.3.20))(@types/react@18.3.20)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@liveblocks/yjs': 2.23.1(yjs@13.6.24) '@tiptap/core': 2.11.5(@tiptap/pm@2.11.5) @@ -15993,7 +16034,7 @@ snapshots: - y-protocols - yjs - '@liveblocks/react-tiptap@2.23.1(@tiptap/extension-collaboration-cursor@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(y-prosemirror@1.3.4(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)))(@tiptap/extension-collaboration@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(y-prosemirror@1.3.4(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)))(@tiptap/pm@2.11.5)(@tiptap/react@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@tiptap/suggestion@2.11.7(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5))(@types/react-dom@18.3.5(@types/react@18.3.20))(@types/react@18.3.20)(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(y-protocols@1.0.6(yjs@13.6.24))': + '@liveblocks/react-tiptap@2.23.1(@tiptap/extension-collaboration-cursor@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(y-prosemirror@1.3.4(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)))(@tiptap/extension-collaboration@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(y-prosemirror@1.3.4(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)))(@tiptap/pm@2.11.5)(@tiptap/react@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@tiptap/suggestion@2.11.7(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5))(@types/react-dom@18.3.5(@types/react@18.3.20))(@types/react@18.3.20)(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(y-protocols@1.0.6(yjs@13.6.24))': dependencies: '@floating-ui/react-dom': 2.1.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@liveblocks/client': 2.23.1 @@ -16004,15 +16045,15 @@ snapshots: '@radix-ui/react-select': 2.1.6(@types/react-dom@18.3.5(@types/react@18.3.20))(@types/react@18.3.20)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-toggle': 1.1.2(@types/react-dom@18.3.5(@types/react@18.3.20))(@types/react@18.3.20)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@tiptap/core': 2.11.5(@tiptap/pm@2.11.5) - '@tiptap/extension-collaboration': 2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(y-prosemirror@1.3.4(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)) - '@tiptap/extension-collaboration-cursor': 2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(y-prosemirror@1.3.4(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)) + '@tiptap/extension-collaboration': 2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(y-prosemirror@1.3.4(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)) + '@tiptap/extension-collaboration-cursor': 2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(y-prosemirror@1.3.4(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24)) '@tiptap/pm': 2.11.5 '@tiptap/react': 2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@tiptap/suggestion': 2.11.7(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5) cmdk: 1.1.1(@types/react-dom@18.3.5(@types/react@18.3.20))(@types/react@18.3.20)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - y-prosemirror: 1.3.4(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24) + y-prosemirror: 1.3.4(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24) yjs: 13.6.24 transitivePeerDependencies: - '@types/react' @@ -18119,8 +18160,8 @@ snapshots: '@testing-library/dom@10.4.0': dependencies: - '@babel/code-frame': 7.26.2 - '@babel/runtime': 7.27.0 + '@babel/code-frame': 7.27.1 + '@babel/runtime': 7.27.1 '@types/aria-query': 5.0.4 aria-query: 5.3.0 chalk: 4.1.2 @@ -18169,16 +18210,16 @@ snapshots: dependencies: '@tiptap/core': 2.11.5(@tiptap/pm@2.11.5) - '@tiptap/extension-collaboration-cursor@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(y-prosemirror@1.3.4(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24))': + '@tiptap/extension-collaboration-cursor@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(y-prosemirror@1.3.4(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24))': dependencies: '@tiptap/core': 2.11.5(@tiptap/pm@2.11.5) - y-prosemirror: 1.3.4(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24) + y-prosemirror: 1.3.4(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24) - '@tiptap/extension-collaboration@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(y-prosemirror@1.3.4(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24))': + '@tiptap/extension-collaboration@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)(y-prosemirror@1.3.4(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24))': dependencies: '@tiptap/core': 2.11.5(@tiptap/pm@2.11.5) '@tiptap/pm': 2.11.5 - y-prosemirror: 1.3.4(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24) + y-prosemirror: 1.3.4(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24) '@tiptap/extension-floating-menu@2.11.5(@tiptap/core@2.11.5(@tiptap/pm@2.11.5))(@tiptap/pm@2.11.5)': dependencies: @@ -18251,12 +18292,12 @@ snapshots: prosemirror-keymap: 1.2.2 prosemirror-markdown: 1.13.2 prosemirror-menu: 1.2.4 - prosemirror-model: 1.25.0 + prosemirror-model: 1.25.1 prosemirror-schema-basic: 1.2.4 prosemirror-schema-list: 1.5.1 prosemirror-state: 1.4.3 prosemirror-tables: 1.6.4 - prosemirror-trailing-node: 3.0.0(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1) + prosemirror-trailing-node: 3.0.0(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1) prosemirror-transform: 1.10.3 prosemirror-view: 1.38.1 @@ -18314,15 +18355,15 @@ snapshots: '@types/better-sqlite3@7.6.13': dependencies: - '@types/node': 20.17.30 + '@types/node': 20.17.45 '@types/connect@3.4.38': dependencies: - '@types/node': 20.17.30 + '@types/node': 20.17.45 '@types/cors@2.8.17': dependencies: - '@types/node': 20.17.30 + '@types/node': 20.17.45 '@types/d3-scale-chromatic@3.1.0': {} @@ -18443,13 +18484,13 @@ snapshots: '@types/mysql@2.15.26': dependencies: - '@types/node': 20.17.30 + '@types/node': 20.17.45 '@types/node@20.17.28': dependencies: undici-types: 6.19.8 - '@types/node@20.17.30': + '@types/node@20.17.45': dependencies: undici-types: 6.19.8 @@ -18464,7 +18505,7 @@ snapshots: '@types/nodemailer@6.4.17': dependencies: - '@types/node': 20.17.30 + '@types/node': 20.17.45 '@types/parse-json@4.0.2': {} @@ -18474,19 +18515,19 @@ snapshots: '@types/pg@8.11.14': dependencies: - '@types/node': 20.17.30 + '@types/node': 20.17.45 pg-protocol: 1.9.5 pg-types: 4.0.2 '@types/pg@8.6.1': dependencies: - '@types/node': 20.17.30 + '@types/node': 20.17.45 pg-protocol: 1.9.5 pg-types: 2.2.0 '@types/pixelmatch@5.2.6': dependencies: - '@types/node': 20.17.30 + '@types/node': 20.17.45 '@types/prop-types@15.7.14': {} @@ -18517,7 +18558,7 @@ snapshots: '@types/tedious@4.0.14': dependencies: - '@types/node': 20.17.30 + '@types/node': 20.17.45 '@types/tough-cookie@4.0.5': {} @@ -18991,7 +19032,7 @@ snapshots: '@y-sweet/sdk@0.6.4': dependencies: - '@types/node': 20.17.28 + '@types/node': 20.17.45 '@yarnpkg/lockfile@1.1.0': {} @@ -19426,6 +19467,13 @@ snapshots: node-releases: 2.0.19 update-browserslist-db: 1.1.3(browserslist@4.24.4) + browserslist@4.24.5: + dependencies: + caniuse-lite: 1.0.30001717 + electron-to-chromium: 1.5.151 + node-releases: 2.0.19 + update-browserslist-db: 1.1.3(browserslist@4.24.5) + buffer-from@1.1.2: {} buffer@5.7.1: @@ -19473,6 +19521,8 @@ snapshots: caniuse-lite@1.0.30001707: {} + caniuse-lite@1.0.30001717: {} + canvas@2.11.2(encoding@0.1.13): dependencies: '@mapbox/node-pre-gyp': 1.0.11(encoding@0.1.13) @@ -20172,6 +20222,8 @@ snapshots: electron-to-chromium@1.5.126: {} + electron-to-chromium@1.5.151: {} + elkjs@0.9.3: {} emoji-mart@5.6.0: {} @@ -20200,7 +20252,7 @@ snapshots: engine.io@6.6.4: dependencies: '@types/cors': 2.8.17 - '@types/node': 20.17.30 + '@types/node': 20.17.45 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.7.2 @@ -20465,7 +20517,7 @@ snapshots: '@typescript-eslint/parser': 5.62.0(eslint@8.57.1)(typescript@5.8.2) eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.10.0(eslint-plugin-import@2.31.0)(eslint@8.57.1) + eslint-import-resolver-typescript: 3.10.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1))(eslint@8.57.1) eslint-plugin-import: 2.31.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-typescript@3.10.0)(eslint@8.57.1) eslint-plugin-jsx-a11y: 6.10.2(eslint@8.57.1) eslint-plugin-react: 7.37.4(eslint@8.57.1) @@ -20512,7 +20564,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.10.0(eslint-plugin-import@2.31.0)(eslint@8.57.1): + eslint-import-resolver-typescript@3.10.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1))(eslint@8.57.1): dependencies: '@nolyfill/is-core-module': 1.0.39 debug: 4.4.0 @@ -20527,14 +20579,14 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.0)(eslint@8.57.1): + eslint-module-utils@2.12.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 5.62.0(eslint@8.57.1)(typescript@5.8.2) eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.10.0(eslint-plugin-import@2.31.0)(eslint@8.57.1) + eslint-import-resolver-typescript: 3.10.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1))(eslint@8.57.1) transitivePeerDependencies: - supports-color @@ -20557,7 +20609,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.0)(eslint@8.57.1) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -21767,7 +21819,7 @@ snapshots: jest-util@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 20.17.30 + '@types/node': 20.17.45 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -21775,7 +21827,7 @@ snapshots: jest-worker@27.5.1: dependencies: - '@types/node': 20.17.30 + '@types/node': 20.17.45 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -23633,6 +23685,8 @@ snapshots: dependencies: prettier: 3.5.3 + prettier@2.8.8: {} + prettier@3.5.3: {} pretty-format@27.5.1: @@ -23677,7 +23731,7 @@ snapshots: prosemirror-commands@1.7.0: dependencies: - prosemirror-model: 1.25.0 + prosemirror-model: 1.25.1 prosemirror-state: 1.4.3 prosemirror-transform: 1.10.3 @@ -23690,15 +23744,15 @@ snapshots: prosemirror-gapcursor@1.3.2: dependencies: prosemirror-keymap: 1.2.2 - prosemirror-model: 1.25.0 + prosemirror-model: 1.25.1 prosemirror-state: 1.4.3 prosemirror-view: 1.38.1 - prosemirror-highlight@0.13.0(@shikijs/types@3.2.1)(@types/hast@3.0.4)(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-transform@1.10.3)(prosemirror-view@1.38.1): + prosemirror-highlight@0.13.0(@shikijs/types@3.2.1)(@types/hast@3.0.4)(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-transform@1.10.3)(prosemirror-view@1.38.1): optionalDependencies: '@shikijs/types': 3.2.1 '@types/hast': 3.0.4 - prosemirror-model: 1.25.0 + prosemirror-model: 1.25.1 prosemirror-state: 1.4.3 prosemirror-transform: 1.10.3 prosemirror-view: 1.38.1 @@ -23724,7 +23778,7 @@ snapshots: dependencies: '@types/markdown-it': 14.1.2 markdown-it: 14.1.0 - prosemirror-model: 1.25.0 + prosemirror-model: 1.25.1 prosemirror-menu@1.2.4: dependencies: @@ -23733,49 +23787,49 @@ snapshots: prosemirror-history: 1.4.1 prosemirror-state: 1.4.3 - prosemirror-model@1.25.0: + prosemirror-model@1.25.1: dependencies: orderedmap: 2.1.1 prosemirror-schema-basic@1.2.4: dependencies: - prosemirror-model: 1.25.0 + prosemirror-model: 1.25.1 prosemirror-schema-list@1.5.1: dependencies: - prosemirror-model: 1.25.0 + prosemirror-model: 1.25.1 prosemirror-state: 1.4.3 prosemirror-transform: 1.10.3 prosemirror-state@1.4.3: dependencies: - prosemirror-model: 1.25.0 + prosemirror-model: 1.25.1 prosemirror-transform: 1.10.3 prosemirror-view: 1.38.1 prosemirror-tables@1.6.4: dependencies: prosemirror-keymap: 1.2.2 - prosemirror-model: 1.25.0 + prosemirror-model: 1.25.1 prosemirror-state: 1.4.3 prosemirror-transform: 1.10.3 prosemirror-view: 1.38.1 - prosemirror-trailing-node@3.0.0(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1): + prosemirror-trailing-node@3.0.0(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1): dependencies: '@remirror/core-constants': 3.0.0 escape-string-regexp: 4.0.0 - prosemirror-model: 1.25.0 + prosemirror-model: 1.25.1 prosemirror-state: 1.4.3 prosemirror-view: 1.38.1 prosemirror-transform@1.10.3: dependencies: - prosemirror-model: 1.25.0 + prosemirror-model: 1.25.1 prosemirror-view@1.38.1: dependencies: - prosemirror-model: 1.25.0 + prosemirror-model: 1.25.1 prosemirror-state: 1.4.3 prosemirror-transform: 1.10.3 @@ -25311,6 +25365,12 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.1 + update-browserslist-db@1.1.3(browserslist@4.24.5): + dependencies: + browserslist: 4.24.5 + escalade: 3.2.0 + picocolors: 1.1.1 + update-check@1.5.4: dependencies: registry-auth-token: 3.3.2 @@ -25691,7 +25751,7 @@ snapshots: '@webassemblyjs/wasm-edit': 1.14.1 '@webassemblyjs/wasm-parser': 1.14.1 acorn: 8.14.1 - browserslist: 4.24.4 + browserslist: 4.24.5 chrome-trace-event: 1.0.4 enhanced-resolve: 5.18.1 es-module-lexer: 1.7.0 @@ -25868,10 +25928,10 @@ snapshots: y-protocols: 1.0.6(yjs@13.6.24) yjs: 13.6.24 - y-prosemirror@1.3.4(prosemirror-model@1.25.0)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24): + y-prosemirror@1.3.4(prosemirror-model@1.25.1)(prosemirror-state@1.4.3)(prosemirror-view@1.38.1)(y-protocols@1.0.6(yjs@13.6.24))(yjs@13.6.24): dependencies: lib0: 0.2.101 - prosemirror-model: 1.25.0 + prosemirror-model: 1.25.1 prosemirror-state: 1.4.3 prosemirror-view: 1.38.1 y-protocols: 1.0.6(yjs@13.6.24) diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/checkListItem.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/checkListItem.json new file mode 100644 index 0000000000..37b953e21e --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/checkListItem.json @@ -0,0 +1,31 @@ +[ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Paragraph", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "checked": false, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, + { + "children": [], + "content": [], + "id": "2", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/emptyNestedCheckListItem.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/emptyNestedCheckListItem.json new file mode 100644 index 0000000000..f98bf7027f --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/emptyNestedCheckListItem.json @@ -0,0 +1,43 @@ +[ + { + "children": [ + { + "children": [], + "content": [], + "id": "2", + "props": { + "backgroundColor": "default", + "checked": false, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, + ], + "content": [], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Paragraph", + "type": "text", + }, + ], + "id": "3", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/flattenedListItem.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/flattenedListItem.json new file mode 100644 index 0000000000..1ba16ea858 --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/flattenedListItem.json @@ -0,0 +1,48 @@ +[ + { + "children": [ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Numbered List Item", + "type": "text", + }, + ], + "id": "2", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + ], + "content": [], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "3", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/googleDocs.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/googleDocs.json index 5a7912dcd1..99d97889c5 100644 --- a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/googleDocs.json +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/googleDocs.json @@ -194,7 +194,7 @@ Hard Break", "content": [ { "styles": {}, - "text": " Nested Numbered List Item 1", + "text": "Nested Numbered List Item 1", "type": "text", }, ], @@ -211,7 +211,7 @@ Hard Break", "content": [ { "styles": {}, - "text": " Nested Numbered List Item 2", + "text": "Nested Numbered List Item 2", "type": "text", }, ], @@ -227,7 +227,7 @@ Hard Break", "content": [ { "styles": {}, - "text": " Nested Bullet List Item 1", + "text": "Nested Bullet List Item 1", "type": "text", }, ], @@ -244,7 +244,7 @@ Hard Break", "content": [ { "styles": {}, - "text": " Nested Bullet List Item 2", + "text": "Nested Bullet List Item 2", "type": "text", }, ], @@ -260,7 +260,7 @@ Hard Break", "content": [ { "styles": {}, - "text": " Bullet List Item 1", + "text": "Bullet List Item 1", "type": "text", }, ], @@ -277,7 +277,7 @@ Hard Break", "content": [ { "styles": {}, - "text": " Bullet List Item 2", + "text": "Bullet List Item 2", "type": "text", }, ], @@ -294,7 +294,7 @@ Hard Break", "content": [ { "styles": {}, - "text": " Numbered List Item 1", + "text": "Numbered List Item 1", "type": "text", }, ], @@ -311,7 +311,7 @@ Hard Break", "content": [ { "styles": {}, - "text": " Numbered List Item 2", + "text": "Numbered List Item 2", "type": "text", }, ], diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/headingParagraphListItem.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/headingParagraphListItem.json new file mode 100644 index 0000000000..360bf1a698 --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/headingParagraphListItem.json @@ -0,0 +1,54 @@ +[ + { + "children": [ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "2", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + ], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "3", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/headingTableCell.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/headingTableCell.json new file mode 100644 index 0000000000..4fea15bf5b --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/headingTableCell.json @@ -0,0 +1,41 @@ +[ + { + "children": [], + "content": { + "columnWidths": [ + undefined, + ], + "headerCols": undefined, + "headerRows": undefined, + "rows": [ + { + "cells": [ + { + "content": [ + { + "styles": {}, + "text": "Table Cell", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + ], + }, + ], + "type": "tableContent", + }, + "id": "1", + "props": { + "textColor": "default", + }, + "type": "table", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/imageBetweenParagraphsTableCell.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/imageBetweenParagraphsTableCell.json new file mode 100644 index 0000000000..a7e9220784 --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/imageBetweenParagraphsTableCell.json @@ -0,0 +1,41 @@ +[ + { + "children": [], + "content": { + "columnWidths": [ + undefined, + ], + "headerCols": undefined, + "headerRows": undefined, + "rows": [ + { + "cells": [ + { + "content": [ + { + "styles": {}, + "text": "Table CellTable Cell", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + ], + }, + ], + "type": "tableContent", + }, + "id": "1", + "props": { + "textColor": "default", + }, + "type": "table", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/imageWithParagraphListItem.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/imageWithParagraphListItem.json new file mode 100644 index 0000000000..1d7a4e82bc --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/imageWithParagraphListItem.json @@ -0,0 +1,63 @@ +[ + { + "children": [ + { + "children": [], + "content": undefined, + "id": "2", + "props": { + "backgroundColor": "default", + "caption": "", + "name": "", + "previewWidth": 512, + "showPreview": true, + "textAlignment": "left", + "url": "http://localhost:3000/exampleURL", + }, + "type": "image", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "3", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + ], + "content": [], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "4", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/imageWithTextListItem.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/imageWithTextListItem.json new file mode 100644 index 0000000000..5927721f20 --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/imageWithTextListItem.json @@ -0,0 +1,63 @@ +[ + { + "children": [ + { + "children": [], + "content": undefined, + "id": "2", + "props": { + "backgroundColor": "default", + "caption": "", + "name": "", + "previewWidth": 512, + "showPreview": true, + "textAlignment": "left", + "url": "http://localhost:3000/exampleURL", + }, + "type": "image", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": " Bullet List Item", + "type": "text", + }, + ], + "id": "3", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + ], + "content": [], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "4", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/lists.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/lists.json index cdd50b6d47..fcb6604539 100644 --- a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/lists.json +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/lists.json @@ -55,7 +55,7 @@ "content": [ { "styles": {}, - "text": "Fourth", + "text": " Fourth", "type": "text", }, ], @@ -73,7 +73,7 @@ "content": [ { "styles": {}, - "text": "Fifth", + "text": " Fifth", "type": "text", }, ], @@ -127,7 +127,7 @@ "content": [ { "styles": {}, - "text": "Child 3", + "text": " Child 3", "type": "text", }, ], @@ -145,7 +145,7 @@ "content": [ { "styles": {}, - "text": "Child 4", + "text": " Child 4", "type": "text", }, ], diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/mixedContentTableCell.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/mixedContentTableCell.json new file mode 100644 index 0000000000..ba9afc2c7d --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/mixedContentTableCell.json @@ -0,0 +1,42 @@ +[ + { + "children": [], + "content": { + "columnWidths": [ + undefined, + ], + "headerCols": undefined, + "headerRows": undefined, + "rows": [ + { + "cells": [ + { + "content": [ + { + "styles": {}, + "text": "Table Cell Table Cell +Table CellTable CellTable Cell", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + ], + }, + ], + "type": "tableContent", + }, + "id": "1", + "props": { + "textColor": "default", + }, + "type": "table", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/mixedNestedLists.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/mixedNestedLists.json index 5b79ba865f..5e2e3ae89f 100644 --- a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/mixedNestedLists.json +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/mixedNestedLists.json @@ -109,7 +109,7 @@ "content": [ { "styles": {}, - "text": "Nested Check List Item", + "text": " Nested Check List Item", "type": "text", }, ], @@ -127,7 +127,7 @@ "content": [ { "styles": {}, - "text": "Nested Check List Item", + "text": " Nested Check List Item", "type": "text", }, ], @@ -178,7 +178,7 @@ "content": [ { "styles": {}, - "text": "Check List Item", + "text": " Check List Item", "type": "text", }, ], @@ -231,7 +231,7 @@ "content": [ { "styles": {}, - "text": "Check List Item", + "text": " Check List Item", "type": "text", }, ], @@ -249,7 +249,7 @@ "content": [ { "styles": {}, - "text": "Nested Check List Item", + "text": " Nested Check List Item", "type": "text", }, ], diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/mixedTextTableCell.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/mixedTextTableCell.json new file mode 100644 index 0000000000..361564dd17 --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/mixedTextTableCell.json @@ -0,0 +1,41 @@ +[ + { + "children": [], + "content": { + "columnWidths": [ + undefined, + ], + "headerCols": undefined, + "headerRows": undefined, + "rows": [ + { + "cells": [ + { + "content": [ + { + "styles": {}, + "text": "Table CellTable Cell Table Cell", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + ], + }, + ], + "type": "tableContent", + }, + "id": "1", + "props": { + "textColor": "default", + }, + "type": "table", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/multipleParagraphListItem.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/multipleParagraphListItem.json new file mode 100644 index 0000000000..360bf1a698 --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/multipleParagraphListItem.json @@ -0,0 +1,54 @@ +[ + { + "children": [ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "2", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + ], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "3", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/multipleParagraphTableCell.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/multipleParagraphTableCell.json new file mode 100644 index 0000000000..a7e9220784 --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/multipleParagraphTableCell.json @@ -0,0 +1,41 @@ +[ + { + "children": [], + "content": { + "columnWidths": [ + undefined, + ], + "headerCols": undefined, + "headerRows": undefined, + "rows": [ + { + "cells": [ + { + "content": [ + { + "styles": {}, + "text": "Table CellTable Cell", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + ], + }, + ], + "type": "tableContent", + }, + "id": "1", + "props": { + "textColor": "default", + }, + "type": "table", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/nestedLists.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/nestedLists.json index 061ca1c5bc..fbd1c1f412 100644 --- a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/nestedLists.json +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/nestedLists.json @@ -176,7 +176,7 @@ "content": [ { "styles": {}, - "text": "Check List Item", + "text": " Check List Item", "type": "text", }, ], @@ -196,7 +196,7 @@ "content": [ { "styles": {}, - "text": "Nested Check List Item", + "text": " Nested Check List Item", "type": "text", }, ], @@ -214,7 +214,7 @@ "content": [ { "styles": {}, - "text": "Nested Check List Item", + "text": " Nested Check List Item", "type": "text", }, ], @@ -231,7 +231,7 @@ "content": [ { "styles": {}, - "text": "Check List Item", + "text": " Check List Item", "type": "text", }, ], @@ -249,7 +249,7 @@ "content": [ { "styles": {}, - "text": "Nested Check List Item", + "text": " Nested Check List Item", "type": "text", }, ], diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/paragraphHeadingListItem.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/paragraphHeadingListItem.json new file mode 100644 index 0000000000..c113edba4c --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/paragraphHeadingListItem.json @@ -0,0 +1,55 @@ +[ + { + "children": [ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "2", + "props": { + "backgroundColor": "default", + "level": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "heading", + }, + ], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "3", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/paragraphImageTableCell.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/paragraphImageTableCell.json new file mode 100644 index 0000000000..4fea15bf5b --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/paragraphImageTableCell.json @@ -0,0 +1,41 @@ +[ + { + "children": [], + "content": { + "columnWidths": [ + undefined, + ], + "headerCols": undefined, + "headerRows": undefined, + "rows": [ + { + "cells": [ + { + "content": [ + { + "styles": {}, + "text": "Table Cell", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + ], + }, + ], + "type": "tableContent", + }, + "id": "1", + "props": { + "textColor": "default", + }, + "type": "table", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/paragraphTableCell.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/paragraphTableCell.json new file mode 100644 index 0000000000..4fea15bf5b --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/paragraphTableCell.json @@ -0,0 +1,41 @@ +[ + { + "children": [], + "content": { + "columnWidths": [ + undefined, + ], + "headerCols": undefined, + "headerRows": undefined, + "rows": [ + { + "cells": [ + { + "content": [ + { + "styles": {}, + "text": "Table Cell", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + ], + }, + ], + "type": "tableContent", + }, + "id": "1", + "props": { + "textColor": "default", + }, + "type": "table", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/paragraphWithImageListItem.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/paragraphWithImageListItem.json new file mode 100644 index 0000000000..e8b029911c --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/paragraphWithImageListItem.json @@ -0,0 +1,52 @@ +[ + { + "children": [ + { + "children": [], + "content": undefined, + "id": "2", + "props": { + "backgroundColor": "default", + "caption": "", + "name": "", + "previewWidth": 512, + "showPreview": true, + "textAlignment": "left", + "url": "http://localhost:3000/exampleURL", + }, + "type": "image", + }, + ], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "3", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/styledTextListItem.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/styledTextListItem.json new file mode 100644 index 0000000000..f7c8a2953f --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/styledTextListItem.json @@ -0,0 +1,43 @@ +[ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item ", + "type": "text", + }, + { + "styles": { + "bold": true, + }, + "text": "Bold", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "2", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/styledTextWithImageListItem.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/styledTextWithImageListItem.json new file mode 100644 index 0000000000..4d5c688ada --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/styledTextWithImageListItem.json @@ -0,0 +1,59 @@ +[ + { + "children": [ + { + "children": [], + "content": undefined, + "id": "2", + "props": { + "backgroundColor": "default", + "caption": "", + "name": "", + "previewWidth": 512, + "showPreview": true, + "textAlignment": "left", + "url": "http://localhost:3000/exampleURL", + }, + "type": "image", + }, + ], + "content": [ + { + "styles": { + "bold": true, + }, + "text": "Bold", + "type": "text", + }, + { + "styles": {}, + "text": " Bullet List Item", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "3", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/textTableCell.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/textTableCell.json new file mode 100644 index 0000000000..4fea15bf5b --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/textTableCell.json @@ -0,0 +1,41 @@ +[ + { + "children": [], + "content": { + "columnWidths": [ + undefined, + ], + "headerCols": undefined, + "headerRows": undefined, + "rows": [ + { + "cells": [ + { + "content": [ + { + "styles": {}, + "text": "Table Cell", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + ], + }, + ], + "type": "tableContent", + }, + "id": "1", + "props": { + "textColor": "default", + }, + "type": "table", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/textWithImageListItem.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/textWithImageListItem.json new file mode 100644 index 0000000000..e8b029911c --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/textWithImageListItem.json @@ -0,0 +1,52 @@ +[ + { + "children": [ + { + "children": [], + "content": undefined, + "id": "2", + "props": { + "backgroundColor": "default", + "caption": "", + "name": "", + "previewWidth": 512, + "showPreview": true, + "textAlignment": "left", + "url": "http://localhost:3000/exampleURL", + }, + "type": "image", + }, + ], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "3", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/twoTables.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/twoTables.json index 3ffbb3ead1..0a7ab43a46 100644 --- a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/twoTables.json +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/twoTables.json @@ -44,10 +44,7 @@ }, { "styles": {}, - "text": " - -Name: [Company Representative] -Title: Chief Executive Officer", + "text": "Name: [Company Representative]Title: Chief Executive Officer", "type": "text", }, ], diff --git a/tests/src/unit/core/formatConversion/parse/parseTestInstances.ts b/tests/src/unit/core/formatConversion/parse/parseTestInstances.ts index 1953d1ca75..db65f162f9 100644 --- a/tests/src/unit/core/formatConversion/parse/parseTestInstances.ts +++ b/tests/src/unit/core/formatConversion/parse/parseTestInstances.ts @@ -57,6 +57,35 @@ export const parseTestInstancesHTML: TestInstance< +`, + }, + executeTest: testParseHTML, + }, + { + // TODO this test's result not exactly right, but it's close enough for now. + testCase: { + name: "emptyNestedCheckListItem", + content: `
      +
    • +
        +
      • + +
      • +
      +

      Paragraph

      +
    • +
    `, + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "checkListItem", + content: `
      +
    • + +

      Paragraph

      +
    `, }, executeTest: testParseHTML, @@ -229,6 +258,267 @@ export const parseTestInstancesHTML: TestInstance< }, executeTest: testParseHTML, }, + { + testCase: { + name: "multipleParagraphListItem", + content: `
      +
    • +

      Bullet List Item

      +

      Bullet List Item

      +
    • +
    • Bullet List Item
    • +
    `, + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "textWithImageListItem", + content: `
      +
    • + Bullet List Item + +
    • +
    • Bullet List Item
    • +
    `, + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "paragraphWithImageListItem", + content: `
      +
    • +

      Bullet List Item

      + +
    • +
    • Bullet List Item
    • +
    `, + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "imageWithTextListItem", + content: `
      +
    • + + Bullet List Item +
    • +
    • Bullet List Item
    • +
    `, + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "imageWithParagraphListItem", + content: `
      +
    • + +

      Bullet List Item

      +
    • +
    • Bullet List Item
    • +
    `, + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "styledTextListItem", + content: `
      +
    • Bullet List Item Bold
    • +
    • Bullet List Item
    • +
    `, + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "styledTextWithImageListItem", + content: `
      +
    • + Bold Bullet List Item + +
    • +
    • Bullet List Item
    • +
    `, + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "flattenedListItem", + content: `
      +
    • +
        +
      1. Nested Numbered List Item
      2. +
      +
    • +
    • Bullet List Item
    • +
    `, + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "headingParagraphListItem", + content: `
      +
    • +

      Bullet List Item

      +

      Bullet List Item

      +
    • +
    • Bullet List Item
    • +
    `, + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "paragraphHeadingListItem", + content: `
      +
    • +

      Bullet List Item

      +

      Bullet List Item

      +
    • +
    • Bullet List Item
    • +
    `, + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "textTableCell", + content: ` + + + + + +
    Table Cell
    `, + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "paragraphTableCell", + content: ` + + + + + +
    +

    Table Cell

    +
    `, + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "headingTableCell", + content: ` + + + + + +
    +

    Table Cell

    +
    `, + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "multipleParagraphTableCell", + content: ` + + + + + +
    +

    Table Cell

    +

    Table Cell

    +
    `, + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "mixedTextTableCell", + content: ` + + + + + +
    +

    Table Cell

    +

    Table Cell

    + Table Cell +

    `, + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "paragraphImageTableCell", + content: ` + + + + + +
    +

    Table Cell

    + +
    `, + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "imageBetweenParagraphsTableCell", + content: ` + + + + + +
    +

    Table Cell

    + +

    Table Cell

    +
    `, + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "mixedContentTableCell", + content: ` + + + + + +
    +

    Table Cell

    + + Table Cell +
    + +

    Table Cell

    +
      +
    • Table Cell
    • +
    • Table Cell
    • +
    +
    `, + }, + executeTest: testParseHTML, + }, { testCase: { name: "divs", diff --git a/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/contextParagraph/basic.html b/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/contextParagraph/basic.html index be4542743b..af796236f6 100644 --- a/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/contextParagraph/basic.html +++ b/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/contextParagraph/basic.html @@ -7,7 +7,7 @@ data-node-view-wrapper="" style="white-space: normal;" > -
    React Context Paragraph
    +
    React Context Paragraph
    diff --git a/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/basic.html b/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/basic.html index 150ceb1216..8b4c461a7b 100644 --- a/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/basic.html +++ b/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/basic.html @@ -7,7 +7,7 @@ data-node-view-wrapper="" style="white-space: normal;" > -

    React Custom Paragraph

    +

    React Custom Paragraph

    diff --git a/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/lineBreaks.html b/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/lineBreaks.html index 52a1aa140a..d26f517577 100644 --- a/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/lineBreaks.html +++ b/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/lineBreaks.html @@ -7,7 +7,7 @@ data-node-view-wrapper="" style="white-space: normal;" > -

    +

    Line 1
    Line 2 diff --git a/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/nested.html b/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/nested.html index d839341713..92745a5ecc 100644 --- a/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/nested.html +++ b/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/nested.html @@ -7,7 +7,7 @@ data-node-view-wrapper="" style="white-space: normal;" > -

    React Custom Paragraph

    +

    React Custom Paragraph

    @@ -18,7 +18,7 @@ data-node-view-wrapper="" style="white-space: normal;" > -

    Nested React Custom Paragraph 1

    +

    Nested React Custom Paragraph 1

    @@ -30,7 +30,7 @@ data-node-view-wrapper="" style="white-space: normal;" > -

    Nested React Custom Paragraph 2

    +

    Nested React Custom Paragraph 2

    diff --git a/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/styled.html b/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/styled.html index 29d66a7d8e..eac21153e9 100644 --- a/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/styled.html +++ b/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/styled.html @@ -20,7 +20,7 @@ data-node-view-wrapper="" style="white-space: normal;" > -

    +

    Plain Red Text Blue Background diff --git a/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/basic.html b/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/basic.html index 1b1d65bad0..7491dda1d0 100644 --- a/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/basic.html +++ b/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/basic.html @@ -7,7 +7,7 @@ data-node-view-wrapper="" style="white-space: normal;" > -

    React Custom Paragraph

    +

    React Custom Paragraph

    diff --git a/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/nested.html b/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/nested.html index a393455366..8c2652a4e9 100644 --- a/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/nested.html +++ b/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/nested.html @@ -7,7 +7,7 @@ data-node-view-wrapper="" style="white-space: normal;" > -

    Custom React Paragraph

    +

    Custom React Paragraph

    @@ -18,7 +18,7 @@ data-node-view-wrapper="" style="white-space: normal;" > -

    Nested React Custom Paragraph 1

    +

    Nested React Custom Paragraph 1

    @@ -30,7 +30,7 @@ data-node-view-wrapper="" style="white-space: normal;" > -

    Nested React Custom Paragraph 2

    +

    Nested React Custom Paragraph 2

    diff --git a/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/styled.html b/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/styled.html index 077d8d0898..1e27d73e98 100644 --- a/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/styled.html +++ b/tests/src/unit/react/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/styled.html @@ -20,7 +20,7 @@ data-node-view-wrapper="" style="white-space: normal;" > -

    +

    Plain Red Text Blue Background diff --git a/tests/src/unit/react/formatConversion/export/__snapshots__/html/contextParagraph/basic.html b/tests/src/unit/react/formatConversion/export/__snapshots__/html/contextParagraph/basic.html index ca43744a1e..ab7b9626c9 100644 --- a/tests/src/unit/react/formatConversion/export/__snapshots__/html/contextParagraph/basic.html +++ b/tests/src/unit/react/formatConversion/export/__snapshots__/html/contextParagraph/basic.html @@ -1 +1 @@ -

    React Context Paragraph
    \ No newline at end of file +
    React Context Paragraph
    \ No newline at end of file diff --git a/tests/src/unit/react/formatConversion/export/__snapshots__/html/simpleCustomParagraph/basic.html b/tests/src/unit/react/formatConversion/export/__snapshots__/html/simpleCustomParagraph/basic.html index e60c23faa1..a12e18e1e3 100644 --- a/tests/src/unit/react/formatConversion/export/__snapshots__/html/simpleCustomParagraph/basic.html +++ b/tests/src/unit/react/formatConversion/export/__snapshots__/html/simpleCustomParagraph/basic.html @@ -1 +1 @@ -

    React Custom Paragraph

    \ No newline at end of file +

    React Custom Paragraph

    \ No newline at end of file diff --git a/tests/src/unit/react/formatConversion/export/__snapshots__/html/simpleCustomParagraph/nested.html b/tests/src/unit/react/formatConversion/export/__snapshots__/html/simpleCustomParagraph/nested.html index 68e209191a..1fa764aff8 100644 --- a/tests/src/unit/react/formatConversion/export/__snapshots__/html/simpleCustomParagraph/nested.html +++ b/tests/src/unit/react/formatConversion/export/__snapshots__/html/simpleCustomParagraph/nested.html @@ -1,3 +1,3 @@ -

    Custom React Paragraph

    -

    Nested React Custom Paragraph 1

    -

    Nested React Custom Paragraph 2

    \ No newline at end of file +

    Custom React Paragraph

    +

    Nested React Custom Paragraph 1

    +

    Nested React Custom Paragraph 2

    \ No newline at end of file diff --git a/tests/src/unit/react/formatConversion/export/__snapshots__/html/simpleCustomParagraph/styled.html b/tests/src/unit/react/formatConversion/export/__snapshots__/html/simpleCustomParagraph/styled.html index d50c890bfb..6d94787359 100644 --- a/tests/src/unit/react/formatConversion/export/__snapshots__/html/simpleCustomParagraph/styled.html +++ b/tests/src/unit/react/formatConversion/export/__snapshots__/html/simpleCustomParagraph/styled.html @@ -1,6 +1,5 @@