"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useHighlight = exports.default = void 0;
var _slate = require("slate");
var _elementTypes = require("../constants/element-types");
const useHighlight = editor => _ref => {
  let [node, path] = _ref;
  let ranges = [];
  if (_slate.Element.isElement(node) && node.type === _elementTypes.CODE_LINE) {
    var _editor$nodeToDecorat;
    ranges = (editor === null || editor === void 0 ? void 0 : (_editor$nodeToDecorat = editor.nodeToDecorations) === null || _editor$nodeToDecorat === void 0 ? void 0 : _editor$nodeToDecorat.get(node)) || [];
    return ranges;
  }
  return ranges;
};
exports.useHighlight = useHighlight;
var _default = exports.default = useHighlight;