dvadf
File manager - Edit - /home/centroca/public_html/wp/wp-content/plugins/elementor/assets/js/packages/editor-documents/editor-documents.min.js
Back
!function(){"use strict";var t={5527:function(t){t.exports=window.elementorV2.editorV1Adapters},22444:function(t){t.exports=window.elementorV2.utils},22504:function(t){t.exports=window.elementorV2.editor},23887:function(t,e,n){var i,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.prototype.hasOwnProperty,r={};((t,e)=>{for(var n in e)o(t,n,{get:e[n],enumerable:!0})})(r,{COMPONENT_DOCUMENT_TYPE:()=>b,__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:()=>f,switchToDocument:()=>switchToDocument}),t.exports=(i=r,((t,e,n,i)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let r of s(e))c.call(t,r)||r===n||o(t,r,{get:()=>e[r],enumerable:!(i=a(e,r))||i.enumerable});return t})(o({},"__esModule",{value:!0}),i));var u=n(22504),d=n(56384),m=n(97557),l=n(27723),v=n(56384),g=n(56384),selectEntities=t=>t.documents.entities,_=(0,g.__createSelector)(selectEntities,t=>t.documents.activeId,(t,e)=>e&&t[e]?t[e]:null),p=(0,g.__createSelector)(selectEntities,t=>t.documents.hostId,(t,e)=>e&&t[e]?t[e]:null);function useActiveDocument(){return(0,v.__useSelector)(_)}var D=n(56384);function useHostDocument(){return(0,D.__useSelector)(p)}function LogicHooks(){return function useSyncDocumentTitle(){const t=useActiveDocument(),e=useHostDocument(),n=t&&"kit"!==t.type.value?t:e;(0,m.useEffect)(()=>{if(void 0===n?.title)return;const t=(0,l.__)('Edit "%s" with Elementor',"elementor").replace("%s",n.title);window.document.title=t},[n?.title])}(),null}function hasActiveEntity(t){return!(!t.activeId||!t.entities[t.activeId])}var f=(0,n(56384).__createSlice)({name:"documents",initialState:{entities:{},activeId:null,hostId:null},reducers:{init(t,{payload:e}){t.entities=e.entities,t.hostId=e.hostId,t.activeId=e.activeId},activateDocument(t,e){t.entities[e.payload.id]=e.payload,t.activeId=e.payload.id},setAsHost(t,e){t.hostId=e.payload},updateActiveDocument(t,e){hasActiveEntity(t)&&(t.entities[t.activeId]={...t.entities[t.activeId],...e.payload})},startSaving(t){hasActiveEntity(t)&&(t.entities[t.activeId].isSaving=!0)},endSaving(t,e){hasActiveEntity(t)&&(t.entities[t.activeId]={...e.payload,isSaving:!1})},startSavingDraft:t=>{hasActiveEntity(t)&&(t.entities[t.activeId].isSavingDraft=!0)},endSavingDraft(t,e){hasActiveEntity(t)&&(t.entities[t.activeId]={...e.payload,isSavingDraft:!1})},markAsDirty(t){hasActiveEntity(t)&&(t.entities[t.activeId].isDirty=!0)},markAsPristine(t){hasActiveEntity(t)&&(t.entities[t.activeId].isDirty=!1)}}}),w=n(5527),h=n(56384),y=n(22444),S=n(5527),C=n(56384);function getCurrentDocument(){return _((0,C.__getState)())}function getV1DocumentsManager(){const t=window.elementor?.documents;if(!t)throw new Error("Elementor Editor V1 documents manager not found");return t}function getV1DocumentsExitTo(t){switch(window.elementor?.getPreferences?.("exit_to")||"this_post"){case"dashboard":return t.config.urls.main_dashboard;case"all_posts":return t.config.urls.all_post_type;default:return t.config.urls.exit_to_dashboard}}function getV1DocumentShowCopyAndShare(t){return t?.config?.panel?.show_copy_and_share??!1}function getV1DocumentPermalink(t){return t.config.urls.permalink??""}function getV1DocumentWpPreview(t){return t.config.urls.wp_preview??""}function normalizeV1Document(t){const e=t.config.revisions.current_id!==t.id,n=getV1DocumentsExitTo(t);return{id:t.id,title:t.container.settings.get("post_title"),type:{value:t.config.type,label:t.config.panel.title},status:{value:t.config.status.value,label:t.config.status.label},links:{permalink:getV1DocumentPermalink(t),wpPreview:getV1DocumentWpPreview(t),platformEdit:n},isDirty:t.editor.isChanged||e,isSaving:t.editor.isSaving,isSavingDraft:!1,permissions:{allowAddingWidgets:t.config.panel?.allow_adding_widgets??!0,showCopyAndShare:getV1DocumentShowCopyAndShare(t)},userCan:{publish:t.config.user.can_publish}}}function setDocumentModifiedStatus(t){(0,S.__privateRunCommandSync)("document/save/set-is-modified",{status:t},{internal:!0})}function getV1CurrentDocument(){return window.elementor?.documents?.getCurrent()}function isDocumentDirty(t){const e="draft"===t.status.value,n=t.revisions?.current_id!==t.id;return e||n}function invalidateDocumentData(t){getV1DocumentsManager().invalidateCache(t)}function reloadCurrentDocument(){const t=getCurrentDocument();return t?.id?(getV1DocumentsManager().invalidateCache(),(0,S.__privateRunCommand)("editor/documents/switch",{id:t.id,shouldScroll:!1,shouldNavigateToDefaultRoute:!1})):Promise.resolve()}function switchToDocument(t,e){return(0,S.__privateRunCommand)("editor/documents/switch",{id:t,...e})}function syncStore(){!function syncInitialization(){const{init:t}=f.actions;(0,w.__privateListenTo)((0,w.v1ReadyEvent)(),()=>{const e=getV1DocumentsManager(),n=Object.entries(e.documents).reduce((t,[e,n])=>(t[e]=normalizeV1Document(n),t),{});(0,h.__dispatch)(t({entities:n,hostId:e.getInitialId(),activeId:e.getCurrentId()}))})}(),function syncActiveDocument(){const{activateDocument:t,setAsHost:e}=f.actions;(0,w.__privateListenTo)((0,w.commandEndEvent)("editor/documents/open"),()=>{const n=getV1DocumentsManager(),i=normalizeV1Document(n.getCurrent());(0,h.__dispatch)(t(i)),n.getInitialId()===i.id&&(0,h.__dispatch)(e(i.id))})}(),function syncOnDocumentSave(){const{startSaving:t,endSaving:e,startSavingDraft:n,endSavingDraft:i}=f.actions,isDraft=t=>{const e=t;return"autosave"===e.args?.status};(0,w.__privateListenTo)((0,w.commandStartEvent)("document/save/save"),e=>{isDraft(e)?(0,h.__dispatch)(n()):(0,h.__dispatch)(t())}),(0,w.__privateListenTo)((0,w.commandEndEvent)("document/save/save"),t=>{const n=normalizeV1Document(getV1DocumentsManager().getCurrent());isDraft(t)?(0,h.__dispatch)(i(n)):(0,h.__dispatch)(e(n))})}(),function syncOnTitleChange(){const{updateActiveDocument:t}=f.actions,e=(0,y.debounce)(e=>{const n=e;if(!("post_title"in n.args?.settings))return;const i=getV1DocumentsManager().getCurrent().container.settings.get("post_title");(0,h.__dispatch)(t({title:i}))},400);(0,w.__privateListenTo)((0,w.commandEndEvent)("document/elements/settings"),e)}(),function syncOnDocumentChange(){const{markAsDirty:t,markAsPristine:e}=f.actions;(0,w.__privateListenTo)((0,w.commandEndEvent)("document/save/set-is-modified"),()=>{const n=_((0,h.__getState)())?.isSaving;if(n)return;getV1DocumentsManager().getCurrent().editor.isChanged?(0,h.__dispatch)(t()):(0,h.__dispatch)(e())})}(),function syncOnExitToChange(){const{updateActiveDocument:t}=f.actions,e=(0,y.debounce)(e=>{const n=e;if(!("exit_to"in n.args?.settings))return;const i=getV1DocumentsManager().getCurrent(),o=getV1DocumentsExitTo(i),a=getV1DocumentPermalink(i),s=getV1DocumentWpPreview(i);(0,h.__dispatch)(t({links:{platformEdit:o,permalink:a,wpPreview:s}}))},400);(0,w.__privateListenTo)((0,w.commandEndEvent)("document/elements/settings"),e)}()}function init(){!function initStore(){(0,d.__registerSlice)(f),syncStore()}(),(0,u.injectIntoLogic)({id:"documents-hooks",component:LogicHooks})}var V=n(97557),A=n(5527);function useActiveDocumentActions(){const t=useActiveDocument(),e=t?.links?.permalink??"";return{save:(0,V.useCallback)(()=>(0,A.__privateRunCommand)("document/save/default"),[]),saveDraft:(0,V.useCallback)(()=>(0,A.__privateRunCommand)("document/save/draft"),[]),saveTemplate:(0,V.useCallback)(()=>(0,A.__privateOpenRoute)("library/save-template"),[]),copyAndShare:(0,V.useCallback)(()=>{navigator.clipboard.writeText(e)},[e])}}var E=n(97557),getUpdateUrl=t=>{const e=new URL(window.location.href);return e.searchParams.set("post",t.toString()),e.searchParams.delete("active-document"),e};function useNavigateToDocument(){return(0,E.useCallback)(async t=>{const e=getUpdateUrl(t);await switchToDocument(t,{setAsInitial:!0}),history.replaceState({},"",e)},[])}var I=n(97557);function useOpenDocumentInNewTab(){return(0,I.useCallback)(t=>{const e=getUpdateUrl(t);window.open(e.href)},[])}var b="elementor_component"},27723:function(t){t.exports=window.wp.i18n},56384:function(t){t.exports=window.elementorV2.store},97557:function(t){t.exports=window.React}},e={};var n=function __webpack_require__(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,__webpack_require__),o.exports}(23887);(window.elementorV2=window.elementorV2||{}).editorDocuments=n}(),window.elementorV2.editorDocuments?.init?.();
dvadf
dvadf
| ver. 1.4 |
Github
|
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings