UNPKG

6.75 kBSource Map (JSON)View Raw
1{"version":3,"sources":["@wordpress/edit-post/src/index.js"],"names":["registerCoreBlocks","render","unmountComponentAtNode","dispatch","Editor","reinitializeEditor","postType","postId","target","settings","initialEdits","reboot","bind","initializeEditor","id","document","getElementById","documentMode","compatMode","console","warn","triggerGuide","default","PluginBlockSettingsMenuItem","PluginMoreMenuItem","PluginPostPublishPanel","PluginPostStatusInfo","PluginPrePublishPanel","PluginSidebar","PluginSidebarMoreMenuItem"],"mappings":";;AAAA;;;AAGA,OAAO,sBAAP;AACA,OAAO,yBAAP;AACA,OAAO,mBAAP;AACA,OAAO,gBAAP;AACA,OAAO,qBAAP;AACA,OAAO,oBAAP;AACA,SAASA,kBAAT,QAAmC,0BAAnC;AACA,SAASC,MAAT,EAAiBC,sBAAjB,QAA+C,oBAA/C;AACA,SAASC,QAAT,QAAyB,iBAAzB;AAEA;;;;AAGA,OAAO,SAAP;AACA,OAAO,WAAP;AACA,OAAO,SAAP;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAEA;;;;;;;;;;;;;;AAaA,OAAO,SAASC,kBAAT,CAA6BC,QAA7B,EAAuCC,MAAvC,EAA+CC,MAA/C,EAAuDC,QAAvD,EAAiEC,YAAjE,EAAgF;AACtFR,EAAAA,sBAAsB,CAAEM,MAAF,CAAtB;AACA,MAAMG,MAAM,GAAGN,kBAAkB,CAACO,IAAnB,CAAyB,IAAzB,EAA+BN,QAA/B,EAAyCC,MAAzC,EAAiDC,MAAjD,EAAyDC,QAAzD,EAAmEC,YAAnE,CAAf;AAEAT,EAAAA,MAAM,CACL,cAAC,MAAD;AACC,IAAA,QAAQ,EAAGQ,QADZ;AAEC,IAAA,OAAO,EAAGE,MAFX;AAGC,IAAA,MAAM,EAAGJ,MAHV;AAIC,IAAA,QAAQ,EAAGD,QAJZ;AAKC,IAAA,YAAY,EAAGI,YALhB;AAMC,IAAA,QAAQ;AANT,IADK,EASLF,MATK,CAAN;AAWA;AAED;;;;;;;;;;;;;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ArD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport '@wordpress/core-data';\nimport '@wordpress/block-editor';\nimport '@wordpress/editor';\nimport '@wordpress/nux';\nimport '@wordpress/viewport';\nimport '@wordpress/notices';\nimport { registerCoreBlocks } from '@wordpress/block-library';\nimport { render, unmountComponentAtNode } from '@wordpress/element';\nimport { dispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport './store';\nimport Editor from './editor';\n\n/**\n * Reinitializes the editor after the user chooses to reboot the editor after\n * an unhandled error occurs, replacing previously mounted editor element using\n * an initial state from prior to the crash.\n *\n * @param {Object} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {Element} target DOM node in which editor is rendered.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function reinitializeEditor( postType, postId, target, settings, initialEdits ) {\n\tunmountComponentAtNode( target );\n\tconst reboot = reinitializeEditor.bind( null, postType, postId, target, settings, initialEdits );\n\n\trender(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tonError={ reboot }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t\trecovery\n\t\t/>,\n\t\ttarget\n\t);\n}\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * The return value of this function is not necessary if we change where we\n * call initializeEditor(). This is due to metaBox timing.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {Object} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor( id, postType, postId, settings, initialEdits ) {\n\tconst target = document.getElementById( id );\n\tconst reboot = reinitializeEditor.bind( null, postType, postId, target, settings, initialEdits );\n\n\tregisterCoreBlocks();\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode = document.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn( \"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\" );\n\t}\n\n\tdispatch( 'core/nux' ).triggerGuide( [\n\t\t'core/editor.inserter',\n\t\t'core/editor.settings',\n\t\t'core/editor.preview',\n\t\t'core/editor.publish',\n\t] );\n\n\trender(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tonError={ reboot }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>,\n\t\ttarget\n\t);\n}\n\nexport { default as PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item';\nexport { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';\nexport { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';\nexport { default as PluginPostStatusInfo } from './components/sidebar/plugin-post-status-info';\nexport { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';\nexport { default as PluginSidebar } from './components/sidebar/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';\n"]}
\No newline at end of file