"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.isSupportedInParent = void 0;
/**
 * Checks if a particular node fragment is supported in the parent
 * @param state EditorState
 * @param fragment The fragment to be checked for
 */
var isSupportedInParent = exports.isSupportedInParent = function isSupportedInParent(state, fragment, currentAppearance) {
  var depth = currentAppearance === 'embed' || currentAppearance === 'block' ? undefined : -1;
  var parent = state.selection.$from.node(depth);
  return parent && parent.type.validContent(fragment);
};