"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isListOrItemNode = exports.isListItemNode = exports.isListNode = exports.isIntoListOfType = exports.findAnyParentList = exports.olType = exports.blType = exports.liType = void 0;
// @ts-ignore // TODO: fix cjs build
const prosemirror_utils_1 = require("prosemirror-utils");
const ListsSpecs_1 = require("./ListsSpecs/index.js");
var ListsSpecs_2 = require("./ListsSpecs/index.js");
Object.defineProperty(exports, "liType", { enumerable: true, get: function () { return ListsSpecs_2.liType; } });
Object.defineProperty(exports, "blType", { enumerable: true, get: function () { return ListsSpecs_2.blType; } });
Object.defineProperty(exports, "olType", { enumerable: true, get: function () { return ListsSpecs_2.olType; } });
const findAnyParentList = (schema) => (0, prosemirror_utils_1.findParentNodeOfType)([(0, ListsSpecs_1.blType)(schema), (0, ListsSpecs_1.olType)(schema)]);
exports.findAnyParentList = findAnyParentList;
const isIntoListOfType = (nodeName) => (state) => (0, exports.findAnyParentList)(state.schema)(state.selection)?.node.type.name === nodeName;
exports.isIntoListOfType = isIntoListOfType;
const isListNode = ({ type }) => type === (0, ListsSpecs_1.blType)(type.schema) || type === (0, ListsSpecs_1.olType)(type.schema);
exports.isListNode = isListNode;
const isListItemNode = (node) => node.type === (0, ListsSpecs_1.liType)(node.type.schema);
exports.isListItemNode = isListItemNode;
const isListOrItemNode = (node) => (0, exports.isListNode)(node) || (0, exports.isListItemNode)(node);
exports.isListOrItemNode = isListOrItemNode;
//# sourceMappingURL=utils.js.map
