# elementor/4.3.2/assets/js/packages/editor-documents/editor-documents.min.js

Elementor Website Builder – more than just a page builder, version 4.3.2. 1 lines.

- Page: https://pluginprobe.com/plugins/elementor/4.3.2/code/assets/js/packages/editor-documents/editor-documents.min.js
- Raw: https://pluginprobe.com/plugins/elementor/4.3.2/raw/assets/js/packages/editor-documents/editor-documents.min.js
- Modified: 2026-09-01T11:47:36+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/elementor/4.3.2/code/assets/js/packages/editor-documents/editor-documents.min.js#L10-L20`.

```javascript
(function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,__commonJSMin=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),__copyProps=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},__toESM=(n,r,a)=>(a=n==null?{}:e(i(n)),__copyProps(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),o=__toESM(__commonJSMin(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},__copyProps=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},__toCommonJS=e=>__copyProps(n({},`__esModule`,{value:!0}),e),o={};__export(o,{COMPONENT_DOCUMENT_TYPE:()=>O,__useActiveDocument:()=>useActiveDocument,__useActiveDocumentActions:()=>useActiveDocumentActions,__useHostDocument:()=>useHostDocument,__useNavigateToDocument:()=>useNavigateToDocument,__useOpenDocumentInNewTab:()=>useOpenDocumentInNewTab,getCurrentDocument:()=>getCurrentDocument,getV1CurrentDocument:()=>getV1CurrentDocument,getV1DocumentsManager:()=>getV1DocumentsManager,init:()=>init,invalidateDocumentData:()=>invalidateDocumentData,isDocumentDirty:()=>isDocumentDirty,reloadCurrentDocument:()=>reloadCurrentDocument,setDocumentModifiedStatus:()=>setDocumentModifiedStatus,slice:()=>v,switchToDocument:()=>switchToDocument}),t.exports=__toCommonJS(o);var s=globalThis.elementorV2.editor,c=globalThis.elementorV2.store,l=globalThis.React,u=globalThis.wp.i18n,d=globalThis.elementorV2.store,f=globalThis.elementorV2.store,selectEntities=e=>e.documents.entities,selectActiveId=e=>e.documents.activeId,selectHostId=e=>e.documents.hostId,p=(0,f.__createSelector)(selectEntities,selectActiveId,(e,t)=>t&&e[t]?e[t]:null),m=(0,f.__createSelector)(selectEntities,selectHostId,(e,t)=>t&&e[t]?e[t]:null);function useActiveDocument(){return(0,d.__useSelector)(p)}var h=globalThis.elementorV2.store;function useHostDocument(){return(0,h.__useSelector)(m)}function useSyncDocumentTitle(){let e=useActiveDocument(),t=useHostDocument(),n=e&&e.type.value!==`kit`?e:t;(0,l.useEffect)(()=>{if(n?.title===void 0)return;let e=(0,u.__)(`Edit "%s" with Elementor`,`elementor`).replace(`%s`,n.title);window.document.title=e},[n?.title])}function LogicHooks(){return useSyncDocumentTitle(),null}var g=globalThis.elementorV2.store,_={entities:{},activeId:null,hostId:null};function hasActiveEntity(e){return!!(e.activeId&&e.entities[e.activeId])}var v=(0,g.__createSlice)({name:`documents`,initialState:_,reducers:{init(e,{payload:t}){e.entities=t.entities,e.hostId=t.hostId,e.activeId=t.activeId},activateDocument(e,t){e.entities[t.payload.id]=t.payload,e.activeId=t.payload.id},setAsHost(e,t){e.hostId=t.payload},updateActiveDocument(e,t){hasActiveEntity(e)&&(e.entities[e.activeId]={...e.entities[e.activeId],...t.payload})},startSaving(e){hasActiveEntity(e)&&(e.entities[e.activeId].isSaving=!0)},endSaving(e,t){hasActiveEntity(e)&&(e.entities[e.activeId]={...t.payload,isSaving:!1})},startSavingDraft:e=>{hasActiveEntity(e)&&(e.entities[e.activeId].isSavingDraft=!0)},endSavingDraft(e,t){hasActiveEntity(e)&&(e.entities[e.activeId]={...t.payload,isSavingDraft:!1})},markAsDirty(e){hasActiveEntity(e)&&(e.entities[e.activeId].isDirty=!0)},markAsPristine(e){hasActiveEntity(e)&&(e.entities[e.activeId].isDirty=!1)}}}),y=globalThis.elementorV2.editorV1Adapters,b=globalThis.elementorV2.store,x=globalThis.elementorV2.utils,S=globalThis.elementorV2.editorV1Adapters,C=globalThis.elementorV2.store;function getCurrentDocument(){return p((0,C.__getState)())}function getV1DocumentsManager(){let e=window.elementor?.documents;if(!e)throw Error(`Elementor Editor V1 documents manager not found`);return e}function getV1DocumentsExitTo(e){switch(window.elementor?.getPreferences?.(`exit_to`)||`this_post`){case`dashboard`:return e.config.urls.main_dashboard;case`all_posts`:return e.config.urls.all_post_type;default:return e.config.urls.exit_to_dashboard}}function getV1DocumentShowCopyAndShare(e){return e?.config?.panel?.show_copy_and_share??!1}function getV1DocumentPermalink(e){return e.config.urls.permalink??``}function getV1DocumentWpPreview(e){return e.config.urls.wp_preview??``}function normalizeV1Document(e){let t=e.config.revisions.current_id!==e.id,n=getV1DocumentsExitTo(e);return{id:e.id,title:e.container.settings.get(`post_title`),type:{value:e.config.type,label:e.config.panel.title},status:{value:e.config.status.value,label:e.config.status.label},links:{permalink:getV1DocumentPermalink(e),wpPreview:getV1DocumentWpPreview(e),platformEdit:n},isDirty:e.editor.isChanged||t,isSaving:e.editor.isSaving,isSavingDraft:!1,permissions:{allowAddingWidgets:e.config.panel?.allow_adding_widgets??!0,showCopyAndShare:getV1DocumentShowCopyAndShare(e)},userCan:{publish:e.config.user.can_publish}}}function setDocumentModifiedStatus(e){(0,S.__privateRunCommandSync)(`document/save/set-is-modified`,{status:e},{internal:!0})}function getV1CurrentDocument(){return window.elementor?.documents?.getCurrent()}function isDocumentDirty(e){let t=e.status.value===`draft`,n=e.revisions?.current_id!==e.id;return t||n}function invalidateDocumentData(e){getV1DocumentsManager().invalidateCache(e)}function reloadCurrentDocument(){let e=getCurrentDocument();return e?.id?(getV1DocumentsManager().invalidateCache(),(0,S.__privateRunCommand)(`editor/documents/switch`,{id:e.id,shouldScroll:!1,shouldNavigateToDefaultRoute:!1})):Promise.resolve()}function switchToDocument(e,t){return(0,S.__privateRunCommand)(`editor/documents/switch`,{id:e,...t})}function syncStore(){syncInitialization(),syncActiveDocument(),syncOnDocumentSave(),syncOnTitleChange(),syncOnDocumentChange(),syncOnExitToChange()}function syncInitialization(){let{init:e}=v.actions;(0,y.__privateListenTo)((0,y.v1ReadyEvent)(),()=>{let t=getV1DocumentsManager(),n=Object.entries(t.documents).reduce((e,[t,n])=>(e[t]=normalizeV1Document(n),e),{});(0,b.__dispatch)(e({entities:n,hostId:t.getInitialId(),activeId:t.getCurrentId()}))})}function syncActiveDocument(){let{activateDocument:e,setAsHost:t}=v.actions;(0,y.__privateListenTo)((0,y.commandEndEvent)(`editor/documents/open`),()=>{let n=getV1DocumentsManager(),r=normalizeV1Document(n.getCurrent());(0,b.__dispatch)(e(r)),n.getInitialId()===r.id&&(0,b.__dispatch)(t(r.id))})}function syncOnDocumentSave(){let{startSaving:e,endSaving:t,startSavingDraft:n,endSavingDraft:r}=v.actions,isDraft=e=>e.args?.status===`autosave`;(0,y.__privateListenTo)((0,y.commandStartEvent)(`document/save/save`),t=>{if(isDraft(t)){(0,b.__dispatch)(n());return}(0,b.__dispatch)(e())}),(0,y.__privateListenTo)((0,y.commandEndEvent)(`document/save/save`),e=>{let n=normalizeV1Document(getV1DocumentsManager().getCurrent());isDraft(e)?(0,b.__dispatch)(r(n)):(0,b.__dispatch)(t(n))})}function syncOnTitleChange(){let{updateActiveDocument:e}=v.actions,t=(0,x.debounce)(t=>{if(!(`post_title`in t.args?.settings))return;let n=getV1DocumentsManager().getCurrent().container.settings.get(`post_title`);(0,b.__dispatch)(e({title:n}))},400);(0,y.__privateListenTo)((0,y.commandEndEvent)(`document/elements/settings`),t)}function syncOnExitToChange(){let{updateActiveDocument:e}=v.actions,t=(0,x.debounce)(t=>{if(!(`exit_to`in t.args?.settings))return;let n=getV1DocumentsManager().getCurrent(),r=getV1DocumentsExitTo(n),i=getV1DocumentPermalink(n),a=getV1DocumentWpPreview(n);(0,b.__dispatch)(e({links:{platformEdit:r,permalink:i,wpPreview:a}}))},400);(0,y.__privateListenTo)((0,y.commandEndEvent)(`document/elements/settings`),t)}function syncOnDocumentChange(){let{markAsDirty:e,markAsPristine:t}=v.actions;(0,y.__privateListenTo)((0,y.commandEndEvent)(`document/save/set-is-modified`),()=>{if(!p((0,b.__getState)())?.isSaving){if(getV1DocumentsManager().getCurrent().editor.isChanged){(0,b.__dispatch)(e());return}(0,b.__dispatch)(t())}})}function init(){initStore(),(0,s.injectIntoLogic)({id:`documents-hooks`,component:LogicHooks})}function initStore(){(0,c.__registerSlice)(v),syncStore()}var w=globalThis.React,T=globalThis.elementorV2.editorV1Adapters;function useActiveDocumentActions(){let e=useActiveDocument()?.links?.permalink??``;return{save:(0,w.useCallback)(()=>(0,T.__privateRunCommand)(`document/save/default`),[]),saveDraft:(0,w.useCallback)(()=>(0,T.__privateRunCommand)(`document/save/draft`),[]),saveTemplate:(0,w.useCallback)(()=>(0,T.__privateOpenRoute)(`library/save-template`),[]),copyAndShare:(0,w.useCallback)(()=>{navigator.clipboard.writeText(e)},[e])}}var E=globalThis.React,getUpdateUrl=e=>{let t=new URL(window.location.href);return t.searchParams.set(`post`,e.toString()),t.searchParams.delete(`active-document`),t};function useNavigateToDocument(){return(0,E.useCallback)(async e=>{let t=getUpdateUrl(e);await switchToDocument(e,{setAsInitial:!0}),history.replaceState({},``,t)},[])}var D=globalThis.React;function useOpenDocumentInNewTab(){return(0,D.useCallback)(e=>{let t=getUpdateUrl(e);window.open(t.href)},[])}var O=`elementor_component`;0&&(t.exports={COMPONENT_DOCUMENT_TYPE:O,__useActiveDocument,__useActiveDocumentActions,__useHostDocument,__useNavigateToDocument,__useOpenDocumentInNewTab,getCurrentDocument,getV1CurrentDocument,getV1DocumentsManager,init,invalidateDocumentData,isDocumentDirty,reloadCurrentDocument,setDocumentModifiedStatus,slice:v,switchToDocument})}))());(window.elementorV2=window.elementorV2||{}).editorDocuments=o})(),window.elementorV2.editorDocuments?.init?.();
```
