"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var is_inline_text_only_exports = {};
__export(is_inline_text_only_exports, {
  isInlineTextOnly: () => isInlineTextOnly
});
module.exports = __toCommonJS(is_inline_text_only_exports);
var import_transform = require("./../../tiptap/pm/transform.js");
const isInlineTextOnly = (tr) => {
  if (tr.steps.length === 0) {
    return false;
  }
  return tr.steps.every((step, stepIndex) => {
    if (!(step instanceof import_transform.ReplaceStep)) {
      return false;
    }
    let onlyInline = true;
    step.slice.content.descendants((node) => {
      if (!node.isInline) {
        onlyInline = false;
        return false;
      }
      return onlyInline;
    });
    if (!onlyInline) {
      return false;
    }
    const docBeforeStep = tr.docs[stepIndex];
    const $from = docBeforeStep.resolve(step.from);
    const $to = docBeforeStep.resolve(step.to);
    if ($from.parent !== $to.parent) {
      return false;
    }
    if (!$from.parent.isTextblock) {
      return false;
    }
    return true;
  });
};
//# sourceMappingURL=is-inline-text-only.js.map
