2000
  6   ˆl–Ü4ý('ÜZÔâ€vã,ÜÅ£�þD)YÆÈÜ’<ÓÎH'¿ŸÂƒyð»ÁÀ¿ "Õ    {"version":3,"file":"index.cjs","names":["Slice","TextSelection","Node","mergeAttributes","wrappingInputRule"],"sources":["../src/handleBackspace.ts","../src/blockquote.tsx","../src/index.ts"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport { Slice, type NodeType } from '@tiptap/pm/model'\nimport { TextSelection } from '@tiptap/pm/state'\n\n/**\n * Restructure the blockquote boundary at the caret.\n *\n * Two cases are handled in a single backspace:\n *\n * 1. Caret at the start of a non-first child of a blockquote â€” lift the\n *    current child out, splitting the blockquote around it.\n * 2. Caret at the start of a top-level textblock whose previous sibling is\n *    a blockquote with a textblock last child â€” merge the current\n *    textblock's inline content into the blockquote's last textblock\n *    instead of letting joinBackward pull the paragraph back inside.\n *\n * Returns true when the backspace was consumed.\n */\nexport const handleBackspace = (editor: Editor, type: NodeType): boolean => {\n  const { state } = editor\n  const { selection } = state\n  if (!selection.empty) return false\n\n  const { $from } = selection\n  if ($from.parentOffset !== 0) return false\n\n  const parentDepth = $from.depth - 1\n  // At the very start of the document the caret can resolve to the top (doc)\n  // level â€” for example a gap cursor before a leading image â€” where there is\n  // no parent block. Bail out so backspace is a no-op instead of dereferencing\n  // an undefined parent at a negative depth. (#7973)\n  if (parentDepth < 0) return false\n\n  const parent = $from.node(parentDepth)\n  const index = $from.index(parentDepth)\n  if (index === 0) return false\n\n  // Non-first child of a blockquote: lift to split the blockquote around it.\n  if (parent.type === type) {\n    return editor.commands.lift(type.name)\n  }\n\n  // Previous sibling is a blockquote whose last child is a textblock:\n  // merge the inline content in instead of letting joinBackward pull the\n  // paragraph back inside the blockquote.\n  const previous = parent.child(index - 1)\n  if (previous.type !== type || !previous.lastChild?.isTextblock) {\n    return false\n  }\n\n  const blockStart = $from.before()\n  // `blockStart` sits in the shared parent at the position right after\n  // the previous blockquote. In ProseMirror coordinates, each closing\n  // token costs one position: step one back to land inside the blockquote\n  // right after its last child, then one more to land inside that last\n  // child at the end of its inline content.\n  const insideBlockquoteEnd = blockStart - 1\n  const targetPos = insideBlockquoteEnd - 1\n\n  return editor.commands.command(({ tr, dispatch }) => {\n    if (!dispatch) {\n      return true\n    }\n\n    const content = $from.parent.content\n    const slice = new Slice(content, 0, 0)\n\n    tr.replace(targetPos, $from.after(), slice)\n    tr.setSelection(TextSelection.create(tr.doc, targetPos + content.size))\n    tr.scrollIntoView()\n    dispatch(tr)\n\n    return true\n  })\n}\n","/** @jsxImportSource @tiptap/core */\nimport { mergeAttributes, Node, wrappingInputRule } from '@tiptap/core'\n\nimport { handleBackspace } from './handleBackspace.js'\n\nexport interface BlockquoteOptions {\n  /**\n   * HTML attributes to add to the blockquote element\n   * @default {}\n   * @example { class: 'foo' }\n   */\n  HTMLAttributes: Record<string, any>\n}\n\ndeclare module '@tiptap/core' {\n  interface Commands<ReturnType> {\n    blockQuote: {\n      /**\n       * Set a blockquote node\n       */\n      setBlockquote: () => ReturnType\n      /**\n       * Toggle a blockquote node\n       */\n      toggleBlockquote: () => ReturnType\n      /**\n       * Unset a blockquote node\n       */\n      unsetBlockquote: () => ReturnType\n    }\n  }\n}\n\n/**\n * Matches a blockquote to a `>` as input.\n */\nexport const inputRegex = /^\\s*>\\s$/\n\n/**\n * This extension allows you to create blockquotes.\n * @see https://tiptap.d