jodit-pro
Version:
PRO Version of Jodit Editor
2 lines (1 loc) • 814 B
JavaScript
var u=Object.defineProperty;var d=(s,i)=>u(s,"name",{value:i,configurable:!0});import{throwIfAborted as g}from"../../core/abort-utils.js";import{Dom as x}from"jodit/esm/core/dom/index.js";async function w(s,i,m){const{offset:f,limit:e,query:l}=i;g(m);const n=[];Array.from(s.editor.children).forEach((o,a)=>{if(x.isElement(o)){const r=o;n.push({blockIndex:a,tagName:r.tagName.toLowerCase(),content:r.innerHTML,textContent:r.textContent||"",classList:Array.from(r.classList)})}});let t=n;if(l&&typeof l=="string"){const o=l.toLowerCase();t=n.filter(a=>a.textContent.toLowerCase().includes(o))}const c=Math.max(0,Math.min(typeof f=="number"?f:0,t.length)),h=e!==void 0?Math.min(c+e,t.length):t.length;return{blocks:t.slice(c,h),total:n.length,offset:c,limit:e!==void 0?e:void 0}}d(w,"execute");export{w as execute};