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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,14 @@ export function getContainerUIInfo(
)) {
const draggable = spec.implementation?.meta?.draggable !== false;

// Legacy: `@blocknote/xl-multi-column`'s hand-written specs, which have
// no `children` config. Removed once multi-column is migrated onto the
// container API.
const isLegacyColumnType = type === "columnList" || type === "column";

if (!isContainerType(spec.config) && !isLegacyColumnType) {
if (!isContainerType(spec.config)) {
if (!draggable) {
nonDraggableBlockTypes.add(type);
}
continue;
}
containerTypes.add(type);
// Legacy column nodes are never draggable themselves; only the blocks
// inside them are (matching the pre-container side menu behavior).
if (draggable && !isLegacyColumnType) {
if (draggable) {
draggableContainerTypes.add(type);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
import type { ResolvedChildren } from "../../../schema/blocks/children.js";
import { seedRefillChildren } from "../../nodeConversions/blockToNode.js";
import { getNodeById } from "../../nodeUtil.js";
import { fixColumnList } from "../commands/replaceBlocks/util/fixColumnList.js";

// Defined in `children.ts` (it answers a schema-level question); re-exported
// here because the public root export (`index.ts`) imports it from this
Expand Down Expand Up @@ -149,12 +148,6 @@ export function fixContainer(tr: Transaction, containerPos: number) {
const config = childrenConfig ? resolveChildren(childrenConfig) : undefined;

if (!config) {
// Legacy repair for `@blocknote/xl-multi-column`'s hand-written PM nodes,
// which have no `children` config but sit in the `childContainer` group.
// Removed once multi-column is migrated onto the container API.
if (target.blockNode.type.name === "columnList") {
fixColumnList(tr, target.blockPos);
}
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,20 +256,6 @@ function serializeBlock<
return ret.dom;
}

// Legacy path for `@blocknote/xl-multi-column`'s hand-written PM nodes,
// which sit in the `bnBlock` group but have no `children` config. They own
// their outer DOM and hold their children directly in their `contentDOM`.
// Removed once multi-column is migrated onto the container API.
const pmType = editor.pmSchema.nodes[block.type!];
if (pmType?.isInGroup("bnBlock")) {
if (block.children && block.children.length > 0) {
ret.contentDOM?.append(
serializeBlocks(editor, block.children, serializer, options),
);
}
return ret.dom;
}

// wrap the block in a blockContainer
const bc = BC_NODE.spec?.toDOM?.(
BC_NODE.create({
Expand Down
16 changes: 0 additions & 16 deletions packages/core/src/api/nodeConversions/blockToNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,22 +601,6 @@ export function blockToNode(
childrenNode,
]),
);
} else if (
schema.nodes[block.type].isInGroup("bnBlock") &&
!getChildrenConfig(schema.nodes[block.type].spec.blockConfig ?? {})
) {
// Legacy path for `@blocknote/xl-multi-column`'s hand-written PM nodes,
// which sit in the `bnBlock` group but have no `children` config. Plain
// `create` (not `createChecked` and no fill), so invalid structures
// surface via `node.check()` when the caller mutates the doc. Removed
// once multi-column is migrated onto the container API.
return schema.nodes[block.type].create(
{
id: id,
...block.props,
},
children,
);
} else if (isContainerNode(schema.nodes[block.type])) {
const type = schema.nodes[block.type];
const attrs = { id: id, ...block.props };
Expand Down
17 changes: 0 additions & 17 deletions packages/core/src/api/nodeConversions/fragmentToBlocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,6 @@ export function fragmentToBlocks<
}

if (node.type.isInGroup("bnBlock")) {
// Legacy path for `@blocknote/xl-multi-column`'s hand-written PM nodes,
// which have no `children` config: flatten only a single-column
// columnList (not the entire column list has been selected), and keep
// every other column list intact, as before. Removed once multi-column
// is migrated onto the container API.
const blockConfig = getBlockSchema(node.type.schema)[node.type.name];
if (isContainerNode(node.type) && !getChildrenConfig(blockConfig ?? {})) {
if (node.type.name === "columnList" && node.childCount === 1) {
node.firstChild?.forEach((child) => {
blocks.push(nodeToBlock(child, node));
});
return false;
}
blocks.push(nodeToBlock(node, node));
return false;
}

pushFlattened(node, node);
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ export function getDefaultTiptapExtensions(
// everything from bnBlock group (nodes that represent a BlockNote block should have an id)
types: [
"blockContainer",
// Legacy: `@blocknote/xl-multi-column`'s hand-written PM nodes, which
// have no `children` config and so aren't picked up below. Removed
// once multi-column is migrated onto the container API.
"columnList",
"column",
// Container block specs whose PM node is itself in the `bnBlock`
// group (column, columnList, callout, etc.). The bnBlock node is the
// block itself, so the id lives on its attrs rather than on a
Expand Down
6 changes: 0 additions & 6 deletions packages/core/src/exporter/Exporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@ export abstract class Exporter<
* after the container's own output.
*/
public isContainerBlock(blockType: string): boolean {
// Legacy: `@blocknote/xl-multi-column`'s hand-written specs, which have
// no `children` config. Removed once multi-column is migrated onto the
// container API.
if (blockType === "columnList" || blockType === "column") {
return true;
}
const spec = (this.blockNoteSchema.blockSpecs as Record<string, any>)[
blockType
];
Expand Down
3 changes: 0 additions & 3 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ export * from "./api/blockManipulation/commands/replaceBlocks/replaceBlocks.js";
// node type a container?") that integrations legitimately ask. It is defined
// in `children.ts` and re-exported via `fixContainer.ts`.
export { isContainerNode } from "./api/blockManipulation/containers/fixContainer.js";
// Legacy column repair for `@blocknote/xl-multi-column`'s hand-written PM
// nodes. Removed once multi-column is migrated onto the container API.
export * from "./api/blockManipulation/commands/replaceBlocks/util/fixColumnList.js";
export * from "./api/blockManipulation/commands/updateBlock/updateBlock.js";
export * from "./api/exporters/html/externalHTMLExporter.js";
export * from "./api/exporters/html/internalHTMLSerializer.js";
Expand Down
Loading
Loading