@wordpress/edit-post 7.4.0 → 7.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/device-preview/index.js +3 -7
- package/build/components/device-preview/index.js.map +1 -1
- package/build/components/header/fullscreen-mode-close/index.js +3 -3
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.native.js +5 -0
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/post-publish-button-or-toggle.js +13 -15
- package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/header/template-title/edit-template-title.js +6 -8
- package/build/components/header/template-title/edit-template-title.js.map +1 -1
- package/build/components/header/tools-more-menu-group/index.js +1 -7
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +11 -11
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/index.js +13 -13
- package/build/components/layout/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +1 -7
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/sidebar/featured-image/index.js +3 -7
- package/build/components/sidebar/featured-image/index.js.map +1 -1
- package/build/components/sidebar/page-attributes/index.js +3 -7
- package/build/components/sidebar/page-attributes/index.js.map +1 -1
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +6 -8
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
- package/build/components/sidebar/post-template/create-modal.js +1 -1
- package/build/components/sidebar/post-template/create-modal.js.map +1 -1
- package/build/components/visual-editor/index.js +29 -24
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/welcome-guide/default.js +1 -1
- package/build/components/welcome-guide/default.js.map +1 -1
- package/build/index.js +3 -0
- package/build/index.js.map +1 -1
- package/build-module/components/device-preview/index.js +3 -6
- package/build-module/components/device-preview/index.js.map +1 -1
- package/build-module/components/header/fullscreen-mode-close/index.js +3 -2
- package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.native.js +6 -0
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/post-publish-button-or-toggle.js +13 -14
- package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build-module/components/header/template-title/edit-template-title.js +6 -7
- package/build-module/components/header/template-title/edit-template-title.js.map +1 -1
- package/build-module/components/header/tools-more-menu-group/index.js +1 -6
- package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +11 -11
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/index.js +13 -13
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -6
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/sidebar/featured-image/index.js +3 -6
- package/build-module/components/sidebar/featured-image/index.js.map +1 -1
- package/build-module/components/sidebar/page-attributes/index.js +3 -6
- package/build-module/components/sidebar/page-attributes/index.js.map +1 -1
- package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +6 -7
- package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
- package/build-module/components/sidebar/post-template/create-modal.js +1 -1
- package/build-module/components/sidebar/post-template/create-modal.js.map +1 -1
- package/build-module/components/visual-editor/index.js +28 -24
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/welcome-guide/default.js +1 -1
- package/build-module/components/welcome-guide/default.js.map +1 -1
- package/build-module/index.js +4 -1
- package/build-module/index.js.map +1 -1
- package/build-style/style-rtl.css +10 -3
- package/build-style/style.css +10 -3
- package/package.json +30 -31
- package/src/components/device-preview/index.js +1 -6
- package/src/components/header/fullscreen-mode-close/index.js +1 -6
- package/src/components/header/header-toolbar/index.native.js +5 -0
- package/src/components/header/post-publish-button-or-toggle.js +4 -10
- package/src/components/header/template-title/edit-template-title.js +8 -12
- package/src/components/header/tools-more-menu-group/index.js +1 -6
- package/src/components/keyboard-shortcuts/index.js +13 -11
- package/src/components/layout/index.js +14 -14
- package/src/components/preferences-modal/index.js +1 -9
- package/src/components/preferences-modal/test/__snapshots__/index.js.snap +1 -1
- package/src/components/sidebar/featured-image/index.js +3 -10
- package/src/components/sidebar/page-attributes/index.js +3 -10
- package/src/components/sidebar/post-taxonomies/taxonomy-panel.js +2 -7
- package/src/components/sidebar/post-template/create-modal.js +1 -1
- package/src/components/visual-editor/index.js +36 -22
- package/src/components/welcome-guide/default.js +1 -1
- package/src/index.js +5 -1
- package/src/test/editor.native.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-taxonomies/taxonomy-panel.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-taxonomies/taxonomy-panel.js"],"names":["compose","PanelBody","withSelect","withDispatch","store","editPostStore","TaxonomyPanel","isEnabled","taxonomy","isOpened","onTogglePanel","children","taxonomyMenuName","labels","menu_name","select","ownProps","slug","panelName","isEditorPanelEnabled","isEditorPanelOpened","dispatch","toggleEditorPanelOpened"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;AACA,SAASC,SAAT,QAA0B,uBAA1B;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,gBAAvC;;AAEA,SAASC,aAAT,OAMI;AAAA;;AAAA,MANoB;AACvBC,IAAAA,SADuB;AAEvBC,IAAAA,QAFuB;AAGvBC,IAAAA,QAHuB;AAIvBC,IAAAA,aAJuB;AAKvBC,IAAAA;AALuB,GAMpB;;AACH,MAAK,CAAEJ,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,QAAMK,gBAAgB,GAAGJ,QAAH,aAAGA,QAAH,2CAAGA,QAAQ,CAAEK,MAAb,qDAAG,iBAAkBC,SAA3C;;AACA,MAAK,CAAEF,gBAAP,EAA0B;AACzB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,SAAD;AACC,IAAA,KAAK,EAAGA,gBADT;AAEC,IAAA,MAAM,EAAGH,QAFV;AAGC,IAAA,QAAQ,EAAGC;AAHZ,KAKGC,QALH,CADD;AASA;;AAED,eAAeX,OAAO,CACrBE,UAAU,CAAE,CAAEa,MAAF,EAAUC,QAAV,KAAwB;AAAA;;AACnC,QAAMC,IAAI,yBAAGD,QAAQ,CAACR,QAAZ,uDAAG,mBAAmBS,IAAhC;AACA,QAAMC,SAAS,GAAGD,IAAI,GAAI,kBAAkBA,IAAM,EAA5B,GAAgC,EAAtD;AACA,SAAO;AACNC,IAAAA,SADM;AAENX,IAAAA,SAAS,EAAEU,IAAI,GACZF,MAAM,CAAEV,aAAF,CAAN,CAAwBc,oBAAxB,CAA8CD,SAA9C,CADY,GAEZ,KAJG;AAKNT,IAAAA,QAAQ,EAAEQ,IAAI,GACXF,MAAM,CAAEV,aAAF,CAAN,CAAwBe,mBAAxB,CAA6CF,SAA7C,CADW,GAEX;AAPG,GAAP;AASA,CAZS,CADW,EAcrBf,YAAY,CAAE,CAAEkB,QAAF,EAAYL,QAAZ,MAA4B;AACzCN,EAAAA,aAAa,EAAE,MAAM;AACpBW,IAAAA,QAAQ,CAAEhB,aAAF,CAAR,CAA0BiB,uBAA1B,CACCN,QAAQ,CAACE,SADV;AAGA;AALwC,CAA5B,CAAF,CAdS,CAAP,CAqBZZ,aArBY,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { PanelBody } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction TaxonomyPanel( {\n\tisEnabled,\n\ttaxonomy,\n\tisOpened,\n\tonTogglePanel,\n\tchildren,\n} ) {\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst taxonomyMenuName = taxonomy?.labels?.menu_name;\n\tif ( ! taxonomyMenuName ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={ taxonomyMenuName }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ onTogglePanel }\n\t\t>\n\t\t\t{ children }\n\t\t</PanelBody>\n\t);\n}\n\nexport default compose(\n\twithSelect( ( select, ownProps ) => {\n\t\tconst slug = ownProps.taxonomy?.slug;\n\t\tconst panelName = slug ? `taxonomy-panel-${ slug }` : '';\n\t\treturn {\n\t\t\tpanelName,\n\t\t\tisEnabled: slug\n\t\t\t\t? select( editPostStore ).isEditorPanelEnabled( panelName )\n\t\t\t\t: false,\n\t\t\tisOpened: slug\n\t\t\t\t? select( editPostStore ).isEditorPanelOpened( panelName )\n\t\t\t\t: false,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, ownProps ) => ( {\n\t\tonTogglePanel: () => {\n\t\t\tdispatch( editPostStore ).toggleEditorPanelOpened(\n\t\t\t\townProps.panelName\n\t\t\t);\n\t\t},\n\t} ) )\n)( TaxonomyPanel );\n"]}
|
|
@@ -86,7 +86,7 @@ export default function PostTemplateCreateModal(_ref) {
|
|
|
86
86
|
onChange: setTitle,
|
|
87
87
|
placeholder: DEFAULT_TITLE,
|
|
88
88
|
disabled: isBusy,
|
|
89
|
-
help: __('Describe the template, e.g. "Post with sidebar".
|
|
89
|
+
help: __('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')
|
|
90
90
|
}), createElement(HStack, {
|
|
91
91
|
justify: "right"
|
|
92
92
|
}, createElement(Button, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-template/create-modal.js"],"names":["useSelect","useDispatch","store","editorStore","useState","serialize","createBlock","Modal","TextControl","Button","__experimentalHStack","HStack","__experimentalVStack","VStack","__","cleanForSlug","editPostStore","DEFAULT_TITLE","PostTemplateCreateModal","onClose","defaultBlockTemplate","select","getEditorSettings","__unstableCreateTemplate","__unstableSwitchToTemplateMode","title","setTitle","isBusy","setIsBusy","cancel","submit","event","preventDefault","newTemplateContent","tagName","layout","inherit","slug","content"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,mBAAvC;AACA,SACCC,KADD,EAECC,WAFD,EAGCC,MAHD,EAICC,oBAAoB,IAAIC,MAJzB,EAKCC,oBAAoB,IAAIC,MALzB,QAMO,uBANP;AAOA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,YAAT,QAA6B,gBAA7B;AAEA;AACA;AACA;;AACA,SAASb,KAAK,IAAIc,aAAlB,QAAuC,gBAAvC;;AAEA,MAAMC,aAAa,GAAGH,EAAE,CAAE,iBAAF,CAAxB;;AAEA,eAAe,SAASI,uBAAT,OAAgD;AAAA,MAAd;AAAEC,IAAAA;AAAF,GAAc;AAC9D,QAAMC,oBAAoB,GAAGpB,SAAS,CACnCqB,MAAF,IACCA,MAAM,CAAElB,WAAF,CAAN,CAAsBmB,iBAAtB,GAA0CF,oBAFN,EAGrC,EAHqC,CAAtC;AAMA,QAAM;AAAEG,IAAAA,wBAAF;AAA4BC,IAAAA;AAA5B,MACLvB,WAAW,CAAEe,aAAF,CADZ;AAGA,QAAM,CAAES,KAAF,EAASC,QAAT,IAAsBtB,QAAQ,CAAE,EAAF,CAApC;AAEA,QAAM,CAAEuB,MAAF,EAAUC,SAAV,IAAwBxB,QAAQ,CAAE,KAAF,CAAtC;;AAEA,QAAMyB,MAAM,GAAG,MAAM;AACpBH,IAAAA,QAAQ,CAAE,EAAF,CAAR;AACAP,IAAAA,OAAO;AACP,GAHD;;AAKA,QAAMW,MAAM,GAAG,MAAQC,KAAR,IAAmB;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AAHX,KAKC;AACC,IAAA,SAAS,EAAC,sCADX;AAEC,IAAA,QAAQ,EAAGC;AAFZ,KAIC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,cAAC,WAAD;AACC,IAAA,uBAAuB,MADxB;AAEC,IAAA,KAAK,EAAGhB,EAAE,CAAE,MAAF,CAFX;AAGC,IAAA,KAAK,EAAGW,KAHT;AAIC,IAAA,QAAQ,EAAGC,QAJZ;AAKC,IAAA,WAAW,EAAGT,aALf;AAMC,IAAA,QAAQ,EAAGU,MANZ;AAOC,IAAA,IAAI,EAAGb,EAAE,CACR,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-template/create-modal.js"],"names":["useSelect","useDispatch","store","editorStore","useState","serialize","createBlock","Modal","TextControl","Button","__experimentalHStack","HStack","__experimentalVStack","VStack","__","cleanForSlug","editPostStore","DEFAULT_TITLE","PostTemplateCreateModal","onClose","defaultBlockTemplate","select","getEditorSettings","__unstableCreateTemplate","__unstableSwitchToTemplateMode","title","setTitle","isBusy","setIsBusy","cancel","submit","event","preventDefault","newTemplateContent","tagName","layout","inherit","slug","content"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,mBAAvC;AACA,SACCC,KADD,EAECC,WAFD,EAGCC,MAHD,EAICC,oBAAoB,IAAIC,MAJzB,EAKCC,oBAAoB,IAAIC,MALzB,QAMO,uBANP;AAOA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,YAAT,QAA6B,gBAA7B;AAEA;AACA;AACA;;AACA,SAASb,KAAK,IAAIc,aAAlB,QAAuC,gBAAvC;;AAEA,MAAMC,aAAa,GAAGH,EAAE,CAAE,iBAAF,CAAxB;;AAEA,eAAe,SAASI,uBAAT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AAGa,MAHV;AAIC,qBAAgBA;AAJjB,KAMGb,EAAE,CAAE,QAAF,CANL,CALD,CAZD,CAJD,CALD,CADD;AAwCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useState } from '@wordpress/element';\nimport { serialize, createBlock } from '@wordpress/blocks';\nimport {\n\tModal,\n\tTextControl,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { cleanForSlug } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nconst DEFAULT_TITLE = __( 'Custom Template' );\n\nexport default function PostTemplateCreateModal( { onClose } ) {\n\tconst defaultBlockTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditorSettings().defaultBlockTemplate,\n\t\t[]\n\t);\n\n\tconst { __unstableCreateTemplate, __unstableSwitchToTemplateMode } =\n\t\tuseDispatch( editPostStore );\n\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst [ isBusy, setIsBusy ] = useState( false );\n\n\tconst cancel = () => {\n\t\tsetTitle( '' );\n\t\tonClose();\n\t};\n\n\tconst submit = async ( event ) => {\n\t\tevent.preventDefault();\n\n\t\tif ( isBusy ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsBusy( true );\n\n\t\tconst newTemplateContent =\n\t\t\tdefaultBlockTemplate ??\n\t\t\tserialize( [\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/group',\n\t\t\t\t\t{\n\t\t\t\t\t\ttagName: 'header',\n\t\t\t\t\t\tlayout: { inherit: true },\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\tcreateBlock( 'core/site-title' ),\n\t\t\t\t\t\tcreateBlock( 'core/site-tagline' ),\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t\t\tcreateBlock( 'core/separator' ),\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/group',\n\t\t\t\t\t{\n\t\t\t\t\t\ttagName: 'main',\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t'core/group',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlayout: { inherit: true },\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t[ createBlock( 'core/post-title' ) ]\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcreateBlock( 'core/post-content', {\n\t\t\t\t\t\t\tlayout: { inherit: true },\n\t\t\t\t\t\t} ),\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t\t] );\n\n\t\tawait __unstableCreateTemplate( {\n\t\t\tslug: cleanForSlug( title || DEFAULT_TITLE ),\n\t\t\tcontent: newTemplateContent,\n\t\t\ttitle: title || DEFAULT_TITLE,\n\t\t} );\n\n\t\tsetIsBusy( false );\n\t\tcancel();\n\n\t\t__unstableSwitchToTemplateMode( true );\n\t};\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Create custom template' ) }\n\t\t\tonRequestClose={ cancel }\n\t\t\tclassName=\"edit-post-post-template__create-modal\"\n\t\t>\n\t\t\t<form\n\t\t\t\tclassName=\"edit-post-post-template__create-form\"\n\t\t\t\tonSubmit={ submit }\n\t\t\t>\n\t\t\t\t<VStack spacing=\"3\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\tplaceholder={ DEFAULT_TITLE }\n\t\t\t\t\t\tdisabled={ isBusy }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Describe the template, e.g. \"Post with sidebar\". A custom template can be manually applied to any post or page.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button variant=\"tertiary\" onClick={ cancel }>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tisBusy={ isBusy }\n\t\t\t\t\t\t\taria-disabled={ isBusy }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"]}
|
|
@@ -23,6 +23,7 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import { store as editPostStore } from '../../store';
|
|
26
|
+
const isGutenbergPlugin = process.env.IS_GUTENBERG_PLUGIN ? true : false;
|
|
26
27
|
|
|
27
28
|
function MaybeIframe(_ref) {
|
|
28
29
|
let {
|
|
@@ -64,7 +65,8 @@ function MaybeIframe(_ref) {
|
|
|
64
65
|
}
|
|
65
66
|
/**
|
|
66
67
|
* Given an array of nested blocks, find the first Post Content
|
|
67
|
-
* block inside it, recursing through any nesting levels
|
|
68
|
+
* block inside it, recursing through any nesting levels,
|
|
69
|
+
* and return its attributes.
|
|
68
70
|
*
|
|
69
71
|
* @param {Array} blocks A list of blocks.
|
|
70
72
|
*
|
|
@@ -72,14 +74,14 @@ function MaybeIframe(_ref) {
|
|
|
72
74
|
*/
|
|
73
75
|
|
|
74
76
|
|
|
75
|
-
function
|
|
77
|
+
function getPostContentAttributes(blocks) {
|
|
76
78
|
for (let i = 0; i < blocks.length; i++) {
|
|
77
79
|
if (blocks[i].name === 'core/post-content') {
|
|
78
|
-
return blocks[i];
|
|
80
|
+
return blocks[i].attributes;
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
if (blocks[i].innerBlocks.length) {
|
|
82
|
-
const nestedPostContent =
|
|
84
|
+
const nestedPostContent = getPostContentAttributes(blocks[i].innerBlocks);
|
|
83
85
|
|
|
84
86
|
if (nestedPostContent) {
|
|
85
87
|
return nestedPostContent;
|
|
@@ -89,8 +91,6 @@ function findPostContent(blocks) {
|
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
export default function VisualEditor(_ref2) {
|
|
92
|
-
var _postContentBlock$att;
|
|
93
|
-
|
|
94
94
|
let {
|
|
95
95
|
styles
|
|
96
96
|
} = _ref2;
|
|
@@ -98,6 +98,7 @@ export default function VisualEditor(_ref2) {
|
|
|
98
98
|
deviceType,
|
|
99
99
|
isWelcomeGuideVisible,
|
|
100
100
|
isTemplateMode,
|
|
101
|
+
postContentAttributes,
|
|
101
102
|
editedPostTemplate = {},
|
|
102
103
|
wrapperBlockName,
|
|
103
104
|
wrapperUniqueId,
|
|
@@ -106,8 +107,8 @@ export default function VisualEditor(_ref2) {
|
|
|
106
107
|
const {
|
|
107
108
|
isFeatureActive,
|
|
108
109
|
isEditingTemplate,
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
getEditedPostTemplate,
|
|
111
|
+
__experimentalGetPreviewDeviceType
|
|
111
112
|
} = select(editPostStore);
|
|
112
113
|
const {
|
|
113
114
|
getCurrentPostId,
|
|
@@ -132,8 +133,9 @@ export default function VisualEditor(_ref2) {
|
|
|
132
133
|
deviceType: __experimentalGetPreviewDeviceType(),
|
|
133
134
|
isWelcomeGuideVisible: isFeatureActive('welcomeGuide'),
|
|
134
135
|
isTemplateMode: _isTemplateMode,
|
|
136
|
+
postContentAttributes: getEditorSettings().postContentAttributes,
|
|
135
137
|
// Post template fetch returns a 404 on classic themes, which
|
|
136
|
-
// messes with e2e tests, so
|
|
138
|
+
// messes with e2e tests, so check it's a block theme first.
|
|
137
139
|
editedPostTemplate: supportsTemplateMode && canEditTemplate ? getEditedPostTemplate() : undefined,
|
|
138
140
|
wrapperBlockName: _wrapperBlockName,
|
|
139
141
|
wrapperUniqueId: getCurrentPostId(),
|
|
@@ -219,23 +221,27 @@ export default function VisualEditor(_ref2) {
|
|
|
219
221
|
type: 'default'
|
|
220
222
|
};
|
|
221
223
|
}, [isTemplateMode, themeSupportsLayout, globalLayoutSettings]);
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
+
const newestPostContentAttributes = useMemo(() => {
|
|
225
|
+
if (!(editedPostTemplate !== null && editedPostTemplate !== void 0 && editedPostTemplate.content) && !(editedPostTemplate !== null && editedPostTemplate !== void 0 && editedPostTemplate.blocks)) {
|
|
226
|
+
return postContentAttributes;
|
|
227
|
+
} // When in template editing mode, we can access the blocks directly.
|
|
228
|
+
|
|
229
|
+
|
|
224
230
|
if (editedPostTemplate !== null && editedPostTemplate !== void 0 && editedPostTemplate.blocks) {
|
|
225
|
-
return
|
|
231
|
+
return getPostContentAttributes(editedPostTemplate === null || editedPostTemplate === void 0 ? void 0 : editedPostTemplate.blocks);
|
|
226
232
|
} // If there are no blocks, we have to parse the content string.
|
|
227
233
|
// Best double-check it's a string otherwise the parse function gets unhappy.
|
|
228
234
|
|
|
229
235
|
|
|
230
236
|
const parseableContent = typeof (editedPostTemplate === null || editedPostTemplate === void 0 ? void 0 : editedPostTemplate.content) === 'string' ? editedPostTemplate === null || editedPostTemplate === void 0 ? void 0 : editedPostTemplate.content : '';
|
|
231
|
-
return
|
|
232
|
-
}, [editedPostTemplate === null || editedPostTemplate === void 0 ? void 0 : editedPostTemplate.content, editedPostTemplate === null || editedPostTemplate === void 0 ? void 0 : editedPostTemplate.blocks]);
|
|
233
|
-
const
|
|
237
|
+
return getPostContentAttributes(parse(parseableContent)) || {};
|
|
238
|
+
}, [editedPostTemplate === null || editedPostTemplate === void 0 ? void 0 : editedPostTemplate.content, editedPostTemplate === null || editedPostTemplate === void 0 ? void 0 : editedPostTemplate.blocks, postContentAttributes]);
|
|
239
|
+
const layout = (newestPostContentAttributes === null || newestPostContentAttributes === void 0 ? void 0 : newestPostContentAttributes.layout) || {};
|
|
240
|
+
const postContentLayoutClasses = useLayoutClasses(newestPostContentAttributes, 'core/post-content');
|
|
234
241
|
const blockListLayoutClass = classnames({
|
|
235
242
|
'is-layout-flow': !themeSupportsLayout
|
|
236
243
|
}, themeSupportsLayout && postContentLayoutClasses);
|
|
237
|
-
const postContentLayoutStyles = useLayoutStyles(
|
|
238
|
-
const layout = (postContentBlock === null || postContentBlock === void 0 ? void 0 : (_postContentBlock$att = postContentBlock.attributes) === null || _postContentBlock$att === void 0 ? void 0 : _postContentBlock$att.layout) || {}; // Update type for blocks using legacy layouts.
|
|
244
|
+
const postContentLayoutStyles = useLayoutStyles(newestPostContentAttributes, 'core/post-content', '.block-editor-block-list__layout.is-root-container'); // Update type for blocks using legacy layouts.
|
|
239
245
|
|
|
240
246
|
const postContentLayout = useMemo(() => {
|
|
241
247
|
return layout && ((layout === null || layout === void 0 ? void 0 : layout.type) === 'constrained' || layout !== null && layout !== void 0 && layout.inherit || layout !== null && layout !== void 0 && layout.contentSize || layout !== null && layout !== void 0 && layout.wideSize) ? { ...globalLayoutSettings,
|
|
@@ -248,7 +254,7 @@ export default function VisualEditor(_ref2) {
|
|
|
248
254
|
}, [layout === null || layout === void 0 ? void 0 : layout.type, layout === null || layout === void 0 ? void 0 : layout.inherit, layout === null || layout === void 0 ? void 0 : layout.contentSize, layout === null || layout === void 0 ? void 0 : layout.wideSize, globalLayoutSettings]); // If there is a Post Content block we use its layout for the block list;
|
|
249
255
|
// if not, this must be a classic theme, in which case we use the fallback layout.
|
|
250
256
|
|
|
251
|
-
const blockListLayout =
|
|
257
|
+
const blockListLayout = postContentAttributes ? postContentLayout : fallbackLayout;
|
|
252
258
|
const titleRef = useRef();
|
|
253
259
|
useEffect(() => {
|
|
254
260
|
var _titleRef$current;
|
|
@@ -271,7 +277,7 @@ export default function VisualEditor(_ref2) {
|
|
|
271
277
|
}, createElement(VisualEditorGlobalKeyboardShortcuts, null), createElement(motion.div, {
|
|
272
278
|
className: "edit-post-visual-editor__content-area",
|
|
273
279
|
animate: {
|
|
274
|
-
padding: isTemplateMode ? '48px 48px 0' :
|
|
280
|
+
padding: isTemplateMode ? '48px 48px 0' : 0
|
|
275
281
|
},
|
|
276
282
|
ref: blockSelectionClearerRef
|
|
277
283
|
}, isTemplateMode && createElement(Button, {
|
|
@@ -286,7 +292,7 @@ export default function VisualEditor(_ref2) {
|
|
|
286
292
|
initial: desktopCanvasStyles,
|
|
287
293
|
className: previewMode
|
|
288
294
|
}, createElement(MaybeIframe, {
|
|
289
|
-
shouldIframe: isBlockBasedTheme && !hasMetaBoxes || isTemplateMode || deviceType === 'Tablet' || deviceType === 'Mobile',
|
|
295
|
+
shouldIframe: isGutenbergPlugin && isBlockBasedTheme && !hasMetaBoxes || isTemplateMode || deviceType === 'Tablet' || deviceType === 'Mobile',
|
|
290
296
|
contentRef: contentRef,
|
|
291
297
|
styles: styles
|
|
292
298
|
}, themeSupportsLayout && !themeHasDisabledLayoutStyles && !isTemplateMode && createElement(Fragment, null, createElement(LayoutStyle, {
|
|
@@ -298,11 +304,9 @@ export default function VisualEditor(_ref2) {
|
|
|
298
304
|
css: postContentLayoutStyles,
|
|
299
305
|
layoutDefinitions: globalLayoutSettings === null || globalLayoutSettings === void 0 ? void 0 : globalLayoutSettings.definitions
|
|
300
306
|
})), !isTemplateMode && createElement("div", {
|
|
301
|
-
className: classnames(
|
|
302
|
-
// classes as the block list beneath.
|
|
303
|
-
'is-root-container', 'block-editor-block-list__layout', 'edit-post-visual-editor__post-title-wrapper', {
|
|
307
|
+
className: classnames('edit-post-visual-editor__post-title-wrapper', {
|
|
304
308
|
'is-focus-mode': isFocusMode
|
|
305
|
-
},
|
|
309
|
+
}, 'is-layout-flow'),
|
|
306
310
|
contentEditable: false
|
|
307
311
|
}, createElement(PostTitle, {
|
|
308
312
|
ref: titleRef
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/visual-editor/index.js"],"names":["classnames","VisualEditorGlobalKeyboardShortcuts","PostTitle","store","editorStore","WritingFlow","BlockList","BlockTools","blockEditorStore","__unstableUseBlockSelectionClearer","useBlockSelectionClearer","__unstableUseTypewriter","useTypewriter","__unstableUseClipboardHandler","useClipboardHandler","__unstableUseTypingObserver","useTypingObserver","__experimentalUseResizeCanvas","useResizeCanvas","__unstableEditorStyles","EditorStyles","useSetting","__experimentalLayoutStyle","LayoutStyle","__unstableUseMouseMoveTypingReset","useMouseMoveTypingReset","__unstableIframe","Iframe","__experimentalRecursionProvider","RecursionProvider","__experimentaluseLayoutClasses","useLayoutClasses","__experimentaluseLayoutStyles","useLayoutStyles","useEffect","useRef","useMemo","Button","__unstableMotion","motion","useSelect","useDispatch","useMergeRefs","arrowLeft","__","parse","coreStore","editPostStore","MaybeIframe","children","contentRef","shouldIframe","styles","style","ref","flex","width","height","display","findPostContent","blocks","i","length","name","innerBlocks","nestedPostContent","VisualEditor","deviceType","isWelcomeGuideVisible","isTemplateMode","editedPostTemplate","wrapperBlockName","wrapperUniqueId","isBlockBasedTheme","select","isFeatureActive","isEditingTemplate","__experimentalGetPreviewDeviceType","getEditedPostTemplate","getCurrentPostId","getCurrentPostType","getEditorSettings","_isTemplateMode","_wrapperBlockName","editorSettings","supportsTemplateMode","canEditTemplate","canUser","undefined","__unstableIsBlockBasedTheme","isCleanNewPost","hasMetaBoxes","themeHasDisabledLayoutStyles","themeSupportsLayout","isFocusMode","_settings","getSettings","disableLayoutStyles","supportsLayout","focusMode","clearSelectedBlock","setIsEditingTemplate","desktopCanvasStyles","margin","flexFlow","background","templateModeStyles","borderRadius","border","borderBottom","resizedCanvasStyles","globalLayoutSettings","previewMode","toLowerCase","animatedStyles","paddingBottom","blockSelectionClearerRef","fallbackLayout","type","postContentBlock","parseableContent","content","postContentLayoutClasses","blockListLayoutClass","postContentLayoutStyles","layout","attributes","postContentLayout","inherit","contentSize","wideSize","blockListLayout","titleRef","current","focus","css","padding","definitions"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,Y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A,uBAHqB,EAIrB,iCAJqB,EAKrB,6CALqB,EAMrB;AACC,uBAAiB8F;AADlB,KANqB,EASrB6B,oBATqB,CADvB;AAYC,IAAA,eAAe,EAAG;AAZnB,KAcC,cAAC,SAAD;AAAW,IAAA,GAAG,EAAGS;AAAjB,IAdD,CAjCF,EAkDC,cAAC,iBAAD;AACC,IAAA,SAAS,EAAG7D,gBADb;AAEC,IAAA,QAAQ,EAAGC;AAFZ,KAIC,cAAC,SAAD;AACC,IAAA,SAAS,EACRH,cAAc,GACX,gBADW,GAEV,GAAGsD,oBAAsB,wBAHrB,CAG6C;AAJvD;AAMC,IAAA,oBAAoB,EAAGQ;AANxB,IAJD,CAlDD,CALD,CAnBD,CAPD,CADD;AAoGA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tVisualEditorGlobalKeyboardShortcuts,\n\tPostTitle,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport {\n\tWritingFlow,\n\tBlockList,\n\tBlockTools,\n\tstore as blockEditorStore,\n\t__unstableUseBlockSelectionClearer as useBlockSelectionClearer,\n\t__unstableUseTypewriter as useTypewriter,\n\t__unstableUseClipboardHandler as useClipboardHandler,\n\t__unstableUseTypingObserver as useTypingObserver,\n\t__experimentalUseResizeCanvas as useResizeCanvas,\n\t__unstableEditorStyles as EditorStyles,\n\tuseSetting,\n\t__experimentalLayoutStyle as LayoutStyle,\n\t__unstableUseMouseMoveTypingReset as useMouseMoveTypingReset,\n\t__unstableIframe as Iframe,\n\t__experimentalRecursionProvider as RecursionProvider,\n\t__experimentaluseLayoutClasses as useLayoutClasses,\n\t__experimentaluseLayoutStyles as useLayoutStyles,\n} from '@wordpress/block-editor';\nimport { useEffect, useRef, useMemo } from '@wordpress/element';\nimport { Button, __unstableMotion as motion } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { arrowLeft } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { parse } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction MaybeIframe( { children, contentRef, shouldIframe, styles, style } ) {\n\tconst ref = useMouseMoveTypingReset();\n\n\tif ( ! shouldIframe ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<EditorStyles styles={ styles } />\n\t\t\t\t<WritingFlow\n\t\t\t\t\tref={ contentRef }\n\t\t\t\t\tclassName=\"editor-styles-wrapper\"\n\t\t\t\t\tstyle={ { flex: '1', ...style } }\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</WritingFlow>\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Iframe\n\t\t\thead={ <EditorStyles styles={ styles } /> }\n\t\t\tref={ ref }\n\t\t\tcontentRef={ contentRef }\n\t\t\tstyle={ { width: '100%', height: '100%', display: 'block' } }\n\t\t\tname=\"editor-canvas\"\n\t\t>\n\t\t\t{ children }\n\t\t</Iframe>\n\t);\n}\n\n/**\n * Given an array of nested blocks, find the first Post Content\n * block inside it, recursing through any nesting levels.\n *\n * @param {Array} blocks A list of blocks.\n *\n * @return {Object | undefined} The Post Content block.\n */\nfunction findPostContent( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn blocks[ i ];\n\t\t}\n\t\tif ( blocks[ i ].innerBlocks.length ) {\n\t\t\tconst nestedPostContent = findPostContent(\n\t\t\t\tblocks[ i ].innerBlocks\n\t\t\t);\n\n\t\t\tif ( nestedPostContent ) {\n\t\t\t\treturn nestedPostContent;\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport default function VisualEditor( { styles } ) {\n\tconst {\n\t\tdeviceType,\n\t\tisWelcomeGuideVisible,\n\t\tisTemplateMode,\n\t\teditedPostTemplate = {},\n\t\twrapperBlockName,\n\t\twrapperUniqueId,\n\t\tisBlockBasedTheme,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisFeatureActive,\n\t\t\tisEditingTemplate,\n\t\t\t__experimentalGetPreviewDeviceType,\n\t\t\tgetEditedPostTemplate,\n\t\t} = select( editPostStore );\n\t\tconst { getCurrentPostId, getCurrentPostType, getEditorSettings } =\n\t\t\tselect( editorStore );\n\t\tconst _isTemplateMode = isEditingTemplate();\n\t\tlet _wrapperBlockName;\n\n\t\tif ( getCurrentPostType() === 'wp_block' ) {\n\t\t\t_wrapperBlockName = 'core/block';\n\t\t} else if ( ! _isTemplateMode ) {\n\t\t\t_wrapperBlockName = 'core/post-content';\n\t\t}\n\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst supportsTemplateMode = editorSettings.supportsTemplateMode;\n\t\tconst canEditTemplate = select( coreStore ).canUser(\n\t\t\t'create',\n\t\t\t'templates'\n\t\t);\n\n\t\treturn {\n\t\t\tdeviceType: __experimentalGetPreviewDeviceType(),\n\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t\tisTemplateMode: _isTemplateMode,\n\t\t\t// Post template fetch returns a 404 on classic themes, which\n\t\t\t// messes with e2e tests, so we check it's a block theme first.\n\t\t\teditedPostTemplate:\n\t\t\t\tsupportsTemplateMode && canEditTemplate\n\t\t\t\t\t? getEditedPostTemplate()\n\t\t\t\t\t: undefined,\n\t\t\twrapperBlockName: _wrapperBlockName,\n\t\t\twrapperUniqueId: getCurrentPostId(),\n\t\t\tisBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme,\n\t\t};\n\t}, [] );\n\tconst { isCleanNewPost } = useSelect( editorStore );\n\tconst hasMetaBoxes = useSelect(\n\t\t( select ) => select( editPostStore ).hasMetaBoxes(),\n\t\t[]\n\t);\n\tconst { themeHasDisabledLayoutStyles, themeSupportsLayout, isFocusMode } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst _settings = select( blockEditorStore ).getSettings();\n\t\t\treturn {\n\t\t\t\tthemeHasDisabledLayoutStyles: _settings.disableLayoutStyles,\n\t\t\t\tthemeSupportsLayout: _settings.supportsLayout,\n\t\t\t\tisFocusMode: _settings.focusMode,\n\t\t\t};\n\t\t}, [] );\n\tconst { clearSelectedBlock } = useDispatch( blockEditorStore );\n\tconst { setIsEditingTemplate } = useDispatch( editPostStore );\n\tconst desktopCanvasStyles = {\n\t\theight: '100%',\n\t\twidth: '100%',\n\t\tmargin: 0,\n\t\tdisplay: 'flex',\n\t\tflexFlow: 'column',\n\t\t// Default background color so that grey\n\t\t// .edit-post-editor-regions__content color doesn't show through.\n\t\tbackground: 'white',\n\t};\n\tconst templateModeStyles = {\n\t\t...desktopCanvasStyles,\n\t\tborderRadius: '2px 2px 0 0',\n\t\tborder: '1px solid #ddd',\n\t\tborderBottom: 0,\n\t};\n\tconst resizedCanvasStyles = useResizeCanvas( deviceType, isTemplateMode );\n\tconst globalLayoutSettings = useSetting( 'layout' );\n\tconst previewMode = 'is-' + deviceType.toLowerCase() + '-preview';\n\n\tlet animatedStyles = isTemplateMode\n\t\t? templateModeStyles\n\t\t: desktopCanvasStyles;\n\tif ( resizedCanvasStyles ) {\n\t\tanimatedStyles = resizedCanvasStyles;\n\t}\n\n\tlet paddingBottom;\n\n\t// Add a constant padding for the typewritter effect. When typing at the\n\t// bottom, there needs to be room to scroll up.\n\tif ( ! hasMetaBoxes && ! resizedCanvasStyles && ! isTemplateMode ) {\n\t\tpaddingBottom = '40vh';\n\t}\n\n\tconst ref = useRef();\n\tconst contentRef = useMergeRefs( [\n\t\tref,\n\t\tuseClipboardHandler(),\n\t\tuseTypewriter(),\n\t\tuseTypingObserver(),\n\t\tuseBlockSelectionClearer(),\n\t] );\n\n\tconst blockSelectionClearerRef = useBlockSelectionClearer();\n\n\t// fallbackLayout is used if there is no Post Content,\n\t// and for Post Title.\n\tconst fallbackLayout = useMemo( () => {\n\t\tif ( isTemplateMode ) {\n\t\t\treturn { type: 'default' };\n\t\t}\n\n\t\tif ( themeSupportsLayout ) {\n\t\t\t// We need to ensure support for wide and full alignments,\n\t\t\t// so we add the constrained type.\n\t\t\treturn { ...globalLayoutSettings, type: 'constrained' };\n\t\t}\n\t\t// Set default layout for classic themes so all alignments are supported.\n\t\treturn { type: 'default' };\n\t}, [ isTemplateMode, themeSupportsLayout, globalLayoutSettings ] );\n\n\tconst postContentBlock = useMemo( () => {\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn findPostContent( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn findPostContent( parse( parseableContent ) ) || {};\n\t}, [ editedPostTemplate?.content, editedPostTemplate?.blocks ] );\n\n\tconst postContentLayoutClasses = useLayoutClasses( postContentBlock );\n\n\tconst blockListLayoutClass = classnames(\n\t\t{\n\t\t\t'is-layout-flow': ! themeSupportsLayout,\n\t\t},\n\t\tthemeSupportsLayout && postContentLayoutClasses\n\t);\n\n\tconst postContentLayoutStyles = useLayoutStyles(\n\t\tpostContentBlock,\n\t\t'.block-editor-block-list__layout.is-root-container'\n\t);\n\n\tconst layout = postContentBlock?.attributes?.layout || {};\n\n\t// Update type for blocks using legacy layouts.\n\tconst postContentLayout = useMemo( () => {\n\t\treturn layout &&\n\t\t\t( layout?.type === 'constrained' ||\n\t\t\t\tlayout?.inherit ||\n\t\t\t\tlayout?.contentSize ||\n\t\t\t\tlayout?.wideSize )\n\t\t\t? { ...globalLayoutSettings, ...layout, type: 'constrained' }\n\t\t\t: { ...globalLayoutSettings, ...layout, type: 'default' };\n\t}, [\n\t\tlayout?.type,\n\t\tlayout?.inherit,\n\t\tlayout?.contentSize,\n\t\tlayout?.wideSize,\n\t\tglobalLayoutSettings,\n\t] );\n\n\t// If there is a Post Content block we use its layout for the block list;\n\t// if not, this must be a classic theme, in which case we use the fallback layout.\n\tconst blockListLayout = postContentBlock\n\t\t? postContentLayout\n\t\t: fallbackLayout;\n\n\tconst titleRef = useRef();\n\tuseEffect( () => {\n\t\tif ( isWelcomeGuideVisible || ! isCleanNewPost() ) {\n\t\t\treturn;\n\t\t}\n\t\ttitleRef?.current?.focus();\n\t}, [ isWelcomeGuideVisible, isCleanNewPost ] );\n\n\tstyles = useMemo(\n\t\t() => [\n\t\t\t...styles,\n\t\t\t{\n\t\t\t\t// We should move this in to future to the body.\n\t\t\t\tcss:\n\t\t\t\t\t`.edit-post-visual-editor__post-title-wrapper{margin-top:4rem}` +\n\t\t\t\t\t( paddingBottom\n\t\t\t\t\t\t? `body{padding-bottom:${ paddingBottom }}`\n\t\t\t\t\t\t: '' ),\n\t\t\t},\n\t\t],\n\t\t[ styles ]\n\t);\n\n\treturn (\n\t\t<BlockTools\n\t\t\t__unstableContentRef={ ref }\n\t\t\tclassName={ classnames( 'edit-post-visual-editor', {\n\t\t\t\t'is-template-mode': isTemplateMode,\n\t\t\t} ) }\n\t\t>\n\t\t\t<VisualEditorGlobalKeyboardShortcuts />\n\t\t\t<motion.div\n\t\t\t\tclassName=\"edit-post-visual-editor__content-area\"\n\t\t\t\tanimate={ {\n\t\t\t\t\tpadding: isTemplateMode ? '48px 48px 0' : '0',\n\t\t\t\t} }\n\t\t\t\tref={ blockSelectionClearerRef }\n\t\t\t>\n\t\t\t\t{ isTemplateMode && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"edit-post-visual-editor__exit-template-mode\"\n\t\t\t\t\t\ticon={ arrowLeft }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tclearSelectedBlock();\n\t\t\t\t\t\t\tsetIsEditingTemplate( false );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\t<motion.div\n\t\t\t\t\tanimate={ animatedStyles }\n\t\t\t\t\tinitial={ desktopCanvasStyles }\n\t\t\t\t\tclassName={ previewMode }\n\t\t\t\t>\n\t\t\t\t\t<MaybeIframe\n\t\t\t\t\t\tshouldIframe={\n\t\t\t\t\t\t\t( isBlockBasedTheme && ! hasMetaBoxes ) ||\n\t\t\t\t\t\t\tisTemplateMode ||\n\t\t\t\t\t\t\tdeviceType === 'Tablet' ||\n\t\t\t\t\t\t\tdeviceType === 'Mobile'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\t\tstyles={ styles }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ themeSupportsLayout &&\n\t\t\t\t\t\t\t! themeHasDisabledLayoutStyles &&\n\t\t\t\t\t\t\t! isTemplateMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\tselector=\".edit-post-visual-editor__post-title-wrapper, .block-editor-block-list__layout.is-root-container\"\n\t\t\t\t\t\t\t\t\t\tlayout={ fallbackLayout }\n\t\t\t\t\t\t\t\t\t\tlayoutDefinitions={\n\t\t\t\t\t\t\t\t\t\t\tglobalLayoutSettings?.definitions\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{ postContentLayoutStyles && (\n\t\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\t\tlayout={ postContentLayout }\n\t\t\t\t\t\t\t\t\t\t\tcss={ postContentLayoutStyles }\n\t\t\t\t\t\t\t\t\t\t\tlayoutDefinitions={\n\t\t\t\t\t\t\t\t\t\t\t\tglobalLayoutSettings?.definitions\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isTemplateMode && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t// This wrapper div should have the same\n\t\t\t\t\t\t\t\t\t// classes as the block list beneath.\n\t\t\t\t\t\t\t\t\t'is-root-container',\n\t\t\t\t\t\t\t\t\t'block-editor-block-list__layout',\n\t\t\t\t\t\t\t\t\t'edit-post-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t'is-focus-mode': isFocusMode,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tblockListLayoutClass\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tcontentEditable={ false }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PostTitle ref={ titleRef } />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<RecursionProvider\n\t\t\t\t\t\t\tblockName={ wrapperBlockName }\n\t\t\t\t\t\t\tuniqueId={ wrapperUniqueId }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockList\n\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\tisTemplateMode\n\t\t\t\t\t\t\t\t\t\t? 'wp-site-blocks'\n\t\t\t\t\t\t\t\t\t\t: `${ blockListLayoutClass } wp-block-post-content` // Ensure root level blocks receive default/flow blockGap styling rules.\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t__experimentalLayout={ blockListLayout }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</RecursionProvider>\n\t\t\t\t\t</MaybeIframe>\n\t\t\t\t</motion.div>\n\t\t\t</motion.div>\n\t\t</BlockTools>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/visual-editor/index.js"],"names":["classnames","VisualEditorGlobalKeyboardShortcuts","PostTitle","store","editorStore","WritingFlow","BlockList","BlockTools","blockEditorStore","__unstableUseBlockSelectionClearer","useBlockSelectionClearer","__unstableUseTypewriter","useTypewriter","__unstableUseClipboardHandler","useClipboardHandler","__unstableUseTypingObserver","useTypingObserver","__experimentalUseResizeCanvas","useResizeCanvas","__unstableEditorStyles","EditorStyles","useSetting","__experimentalLayoutStyle","LayoutStyle","__unstableUseMouseMoveTypingReset","useMouseMoveTypingReset","__unstableIframe","Iframe","__experimentalRecursionProvider","RecursionProvider","__experimentaluseLayoutClasses","useLayoutClasses","__experimentaluseLayoutStyles","useLayoutStyles","useEffect","useRef","useMemo","Button","__unstableMotion","motion","useSelect","useDispatch","useMergeRefs","arrowLeft","__","parse","coreStore","editPostStore","isGutenbergPlugin","process","env","IS_GUTENBERG_PLUGIN","MaybeIframe","children","contentRef","shouldIframe","styles","style","ref","flex","width","height","display","getPostContentAttributes","blocks","i","length","name","attributes","innerBlocks","nestedPostContent","VisualEditor","deviceType","isWelcomeGuideVisible","isTemplateMode","postContentAttributes","editedPostTemplate","wrapperBlockName","wrapperUniqueId","isBlockBasedTheme","select","isFeatureActive","isEditingTemplate","getEditedPostTemplate","__experimentalGetPreviewDeviceType","getCurrentPostId","getCurrentPostType","getEditorSettings","_isTemplateMode","_wrapperBlockName","editorSettings","supportsTemplateMode","canEditTemplate","canUser","undefined","__unstableIsBlockBasedTheme","isCleanNewPost","hasMetaBoxes","themeHasDisabledLayoutStyles","themeSupportsLayout","isFocusMode","_settings","getSettings","disableLayoutStyles","supportsLayout","focusMode","clearSelectedBlock","setIsEditingTemplate","desktopCanvasStyles","margin","flexFlow","background","templateModeStyles","borderRadius","border","borderBottom","resizedCanvasStyles","globalLayoutSettings","previewMode","toLowerCase","animatedStyles","paddingBottom","blockSelectionClearerRef","fallbackLayout","type","newestPostContentAttributes","content","parseableContent","layout","postContentLayoutClasses","blockListLayoutClass","postContentLayoutStyles","postContentLayout","inherit","contentSize","wideSize","blockListLayout","titleRef","current","focus","css","padding","definitions"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BAAmB,IACpB,CAAED,4BADD,IAED,CAAExB,cAFD,IAGA,8BACC,cAAC,WAAD;AACC,IAAA,QAAQ,EAAC,kGADV;AAEC,IAAA,MAAM,EAAGiD,cAFV;AAGC,IAAA,iBAAiB,EAChBN,oBADgB,aAChBA,oBADgB,uBAChBA,oBAAoB,CAAEyB;AAJxB,IADD,EAQGX,uBAAuB,IACxB,cAAC,WAAD;AACC,IAAA,MAAM,EAAGC,iBADV;AAEC,IAAA,GAAG,EAAGD,uBAFP;AAGC,IAAA,iBAAiB,EAChBd,oBADgB,aAChBA,oBADgB,uBAChBA,oBAAoB,CAAEyB;AAJxB,IATF,CAfH,EAkCG,CAAEpE,cAAF,IACD;AACC,IAAA,SAAS,EAAG1E,UAAU,CACrB,6CADqB,EAErB;AACC,uBAAiBoG;AADlB,KAFqB,EAKrB,gBALqB,CADvB;AAQC,IAAA,eAAe,EAAG;AARnB,KAUC,cAAC,SAAD;AAAW,IAAA,GAAG,EAAGqC;AAAjB,IAVD,CAnCF,EAgDC,cAAC,iBAAD;AACC,IAAA,SAAS,EAAG5D,gBADb;AAEC,IAAA,QAAQ,EAAGC;AAFZ,KAIC,cAAC,SAAD;AACC,IAAA,SAAS,EACRJ,cAAc,GACX,gBADW,GAEV,GAAGwD,oBAAsB,wBAHrB,CAG6C;AAJvD;AAMC,IAAA,oBAAoB,EAAGM;AANxB,IAJD,CAhDD,CALD,CAnBD,CAPD,CADD;AAkGA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tVisualEditorGlobalKeyboardShortcuts,\n\tPostTitle,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport {\n\tWritingFlow,\n\tBlockList,\n\tBlockTools,\n\tstore as blockEditorStore,\n\t__unstableUseBlockSelectionClearer as useBlockSelectionClearer,\n\t__unstableUseTypewriter as useTypewriter,\n\t__unstableUseClipboardHandler as useClipboardHandler,\n\t__unstableUseTypingObserver as useTypingObserver,\n\t__experimentalUseResizeCanvas as useResizeCanvas,\n\t__unstableEditorStyles as EditorStyles,\n\tuseSetting,\n\t__experimentalLayoutStyle as LayoutStyle,\n\t__unstableUseMouseMoveTypingReset as useMouseMoveTypingReset,\n\t__unstableIframe as Iframe,\n\t__experimentalRecursionProvider as RecursionProvider,\n\t__experimentaluseLayoutClasses as useLayoutClasses,\n\t__experimentaluseLayoutStyles as useLayoutStyles,\n} from '@wordpress/block-editor';\nimport { useEffect, useRef, useMemo } from '@wordpress/element';\nimport { Button, __unstableMotion as motion } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { arrowLeft } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { parse } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nconst isGutenbergPlugin = process.env.IS_GUTENBERG_PLUGIN ? true : false;\n\nfunction MaybeIframe( { children, contentRef, shouldIframe, styles, style } ) {\n\tconst ref = useMouseMoveTypingReset();\n\n\tif ( ! shouldIframe ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<EditorStyles styles={ styles } />\n\t\t\t\t<WritingFlow\n\t\t\t\t\tref={ contentRef }\n\t\t\t\t\tclassName=\"editor-styles-wrapper\"\n\t\t\t\t\tstyle={ { flex: '1', ...style } }\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</WritingFlow>\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Iframe\n\t\t\thead={ <EditorStyles styles={ styles } /> }\n\t\t\tref={ ref }\n\t\t\tcontentRef={ contentRef }\n\t\t\tstyle={ { width: '100%', height: '100%', display: 'block' } }\n\t\t\tname=\"editor-canvas\"\n\t\t>\n\t\t\t{ children }\n\t\t</Iframe>\n\t);\n}\n\n/**\n * Given an array of nested blocks, find the first Post Content\n * block inside it, recursing through any nesting levels,\n * and return its attributes.\n *\n * @param {Array} blocks A list of blocks.\n *\n * @return {Object | undefined} The Post Content block.\n */\nfunction getPostContentAttributes( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn blocks[ i ].attributes;\n\t\t}\n\t\tif ( blocks[ i ].innerBlocks.length ) {\n\t\t\tconst nestedPostContent = getPostContentAttributes(\n\t\t\t\tblocks[ i ].innerBlocks\n\t\t\t);\n\n\t\t\tif ( nestedPostContent ) {\n\t\t\t\treturn nestedPostContent;\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport default function VisualEditor( { styles } ) {\n\tconst {\n\t\tdeviceType,\n\t\tisWelcomeGuideVisible,\n\t\tisTemplateMode,\n\t\tpostContentAttributes,\n\t\teditedPostTemplate = {},\n\t\twrapperBlockName,\n\t\twrapperUniqueId,\n\t\tisBlockBasedTheme,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisFeatureActive,\n\t\t\tisEditingTemplate,\n\t\t\tgetEditedPostTemplate,\n\t\t\t__experimentalGetPreviewDeviceType,\n\t\t} = select( editPostStore );\n\t\tconst { getCurrentPostId, getCurrentPostType, getEditorSettings } =\n\t\t\tselect( editorStore );\n\t\tconst _isTemplateMode = isEditingTemplate();\n\t\tlet _wrapperBlockName;\n\n\t\tif ( getCurrentPostType() === 'wp_block' ) {\n\t\t\t_wrapperBlockName = 'core/block';\n\t\t} else if ( ! _isTemplateMode ) {\n\t\t\t_wrapperBlockName = 'core/post-content';\n\t\t}\n\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst supportsTemplateMode = editorSettings.supportsTemplateMode;\n\t\tconst canEditTemplate = select( coreStore ).canUser(\n\t\t\t'create',\n\t\t\t'templates'\n\t\t);\n\n\t\treturn {\n\t\t\tdeviceType: __experimentalGetPreviewDeviceType(),\n\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t\tisTemplateMode: _isTemplateMode,\n\t\t\tpostContentAttributes: getEditorSettings().postContentAttributes,\n\t\t\t// Post template fetch returns a 404 on classic themes, which\n\t\t\t// messes with e2e tests, so check it's a block theme first.\n\t\t\teditedPostTemplate:\n\t\t\t\tsupportsTemplateMode && canEditTemplate\n\t\t\t\t\t? getEditedPostTemplate()\n\t\t\t\t\t: undefined,\n\t\t\twrapperBlockName: _wrapperBlockName,\n\t\t\twrapperUniqueId: getCurrentPostId(),\n\t\t\tisBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme,\n\t\t};\n\t}, [] );\n\tconst { isCleanNewPost } = useSelect( editorStore );\n\tconst hasMetaBoxes = useSelect(\n\t\t( select ) => select( editPostStore ).hasMetaBoxes(),\n\t\t[]\n\t);\n\tconst { themeHasDisabledLayoutStyles, themeSupportsLayout, isFocusMode } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst _settings = select( blockEditorStore ).getSettings();\n\t\t\treturn {\n\t\t\t\tthemeHasDisabledLayoutStyles: _settings.disableLayoutStyles,\n\t\t\t\tthemeSupportsLayout: _settings.supportsLayout,\n\t\t\t\tisFocusMode: _settings.focusMode,\n\t\t\t};\n\t\t}, [] );\n\tconst { clearSelectedBlock } = useDispatch( blockEditorStore );\n\tconst { setIsEditingTemplate } = useDispatch( editPostStore );\n\tconst desktopCanvasStyles = {\n\t\theight: '100%',\n\t\twidth: '100%',\n\t\tmargin: 0,\n\t\tdisplay: 'flex',\n\t\tflexFlow: 'column',\n\t\t// Default background color so that grey\n\t\t// .edit-post-editor-regions__content color doesn't show through.\n\t\tbackground: 'white',\n\t};\n\tconst templateModeStyles = {\n\t\t...desktopCanvasStyles,\n\t\tborderRadius: '2px 2px 0 0',\n\t\tborder: '1px solid #ddd',\n\t\tborderBottom: 0,\n\t};\n\tconst resizedCanvasStyles = useResizeCanvas( deviceType, isTemplateMode );\n\tconst globalLayoutSettings = useSetting( 'layout' );\n\tconst previewMode = 'is-' + deviceType.toLowerCase() + '-preview';\n\n\tlet animatedStyles = isTemplateMode\n\t\t? templateModeStyles\n\t\t: desktopCanvasStyles;\n\tif ( resizedCanvasStyles ) {\n\t\tanimatedStyles = resizedCanvasStyles;\n\t}\n\n\tlet paddingBottom;\n\n\t// Add a constant padding for the typewritter effect. When typing at the\n\t// bottom, there needs to be room to scroll up.\n\tif ( ! hasMetaBoxes && ! resizedCanvasStyles && ! isTemplateMode ) {\n\t\tpaddingBottom = '40vh';\n\t}\n\n\tconst ref = useRef();\n\tconst contentRef = useMergeRefs( [\n\t\tref,\n\t\tuseClipboardHandler(),\n\t\tuseTypewriter(),\n\t\tuseTypingObserver(),\n\t\tuseBlockSelectionClearer(),\n\t] );\n\n\tconst blockSelectionClearerRef = useBlockSelectionClearer();\n\n\t// fallbackLayout is used if there is no Post Content,\n\t// and for Post Title.\n\tconst fallbackLayout = useMemo( () => {\n\t\tif ( isTemplateMode ) {\n\t\t\treturn { type: 'default' };\n\t\t}\n\n\t\tif ( themeSupportsLayout ) {\n\t\t\t// We need to ensure support for wide and full alignments,\n\t\t\t// so we add the constrained type.\n\t\t\treturn { ...globalLayoutSettings, type: 'constrained' };\n\t\t}\n\t\t// Set default layout for classic themes so all alignments are supported.\n\t\treturn { type: 'default' };\n\t}, [ isTemplateMode, themeSupportsLayout, globalLayoutSettings ] );\n\n\tconst newestPostContentAttributes = useMemo( () => {\n\t\tif ( ! editedPostTemplate?.content && ! editedPostTemplate?.blocks ) {\n\t\t\treturn postContentAttributes;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn getPostContentAttributes( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn getPostContentAttributes( parse( parseableContent ) ) || {};\n\t}, [\n\t\teditedPostTemplate?.content,\n\t\teditedPostTemplate?.blocks,\n\t\tpostContentAttributes,\n\t] );\n\n\tconst layout = newestPostContentAttributes?.layout || {};\n\n\tconst postContentLayoutClasses = useLayoutClasses(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content'\n\t);\n\n\tconst blockListLayoutClass = classnames(\n\t\t{\n\t\t\t'is-layout-flow': ! themeSupportsLayout,\n\t\t},\n\t\tthemeSupportsLayout && postContentLayoutClasses\n\t);\n\n\tconst postContentLayoutStyles = useLayoutStyles(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content',\n\t\t'.block-editor-block-list__layout.is-root-container'\n\t);\n\n\t// Update type for blocks using legacy layouts.\n\tconst postContentLayout = useMemo( () => {\n\t\treturn layout &&\n\t\t\t( layout?.type === 'constrained' ||\n\t\t\t\tlayout?.inherit ||\n\t\t\t\tlayout?.contentSize ||\n\t\t\t\tlayout?.wideSize )\n\t\t\t? { ...globalLayoutSettings, ...layout, type: 'constrained' }\n\t\t\t: { ...globalLayoutSettings, ...layout, type: 'default' };\n\t}, [\n\t\tlayout?.type,\n\t\tlayout?.inherit,\n\t\tlayout?.contentSize,\n\t\tlayout?.wideSize,\n\t\tglobalLayoutSettings,\n\t] );\n\n\t// If there is a Post Content block we use its layout for the block list;\n\t// if not, this must be a classic theme, in which case we use the fallback layout.\n\tconst blockListLayout = postContentAttributes\n\t\t? postContentLayout\n\t\t: fallbackLayout;\n\n\tconst titleRef = useRef();\n\tuseEffect( () => {\n\t\tif ( isWelcomeGuideVisible || ! isCleanNewPost() ) {\n\t\t\treturn;\n\t\t}\n\t\ttitleRef?.current?.focus();\n\t}, [ isWelcomeGuideVisible, isCleanNewPost ] );\n\n\tstyles = useMemo(\n\t\t() => [\n\t\t\t...styles,\n\t\t\t{\n\t\t\t\t// We should move this in to future to the body.\n\t\t\t\tcss:\n\t\t\t\t\t`.edit-post-visual-editor__post-title-wrapper{margin-top:4rem}` +\n\t\t\t\t\t( paddingBottom\n\t\t\t\t\t\t? `body{padding-bottom:${ paddingBottom }}`\n\t\t\t\t\t\t: '' ),\n\t\t\t},\n\t\t],\n\t\t[ styles ]\n\t);\n\n\treturn (\n\t\t<BlockTools\n\t\t\t__unstableContentRef={ ref }\n\t\t\tclassName={ classnames( 'edit-post-visual-editor', {\n\t\t\t\t'is-template-mode': isTemplateMode,\n\t\t\t} ) }\n\t\t>\n\t\t\t<VisualEditorGlobalKeyboardShortcuts />\n\t\t\t<motion.div\n\t\t\t\tclassName=\"edit-post-visual-editor__content-area\"\n\t\t\t\tanimate={ {\n\t\t\t\t\tpadding: isTemplateMode ? '48px 48px 0' : 0,\n\t\t\t\t} }\n\t\t\t\tref={ blockSelectionClearerRef }\n\t\t\t>\n\t\t\t\t{ isTemplateMode && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"edit-post-visual-editor__exit-template-mode\"\n\t\t\t\t\t\ticon={ arrowLeft }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tclearSelectedBlock();\n\t\t\t\t\t\t\tsetIsEditingTemplate( false );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\t<motion.div\n\t\t\t\t\tanimate={ animatedStyles }\n\t\t\t\t\tinitial={ desktopCanvasStyles }\n\t\t\t\t\tclassName={ previewMode }\n\t\t\t\t>\n\t\t\t\t\t<MaybeIframe\n\t\t\t\t\t\tshouldIframe={\n\t\t\t\t\t\t\t( isGutenbergPlugin &&\n\t\t\t\t\t\t\t\tisBlockBasedTheme &&\n\t\t\t\t\t\t\t\t! hasMetaBoxes ) ||\n\t\t\t\t\t\t\tisTemplateMode ||\n\t\t\t\t\t\t\tdeviceType === 'Tablet' ||\n\t\t\t\t\t\t\tdeviceType === 'Mobile'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\t\tstyles={ styles }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ themeSupportsLayout &&\n\t\t\t\t\t\t\t! themeHasDisabledLayoutStyles &&\n\t\t\t\t\t\t\t! isTemplateMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\tselector=\".edit-post-visual-editor__post-title-wrapper, .block-editor-block-list__layout.is-root-container\"\n\t\t\t\t\t\t\t\t\t\tlayout={ fallbackLayout }\n\t\t\t\t\t\t\t\t\t\tlayoutDefinitions={\n\t\t\t\t\t\t\t\t\t\t\tglobalLayoutSettings?.definitions\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{ postContentLayoutStyles && (\n\t\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\t\tlayout={ postContentLayout }\n\t\t\t\t\t\t\t\t\t\t\tcss={ postContentLayoutStyles }\n\t\t\t\t\t\t\t\t\t\t\tlayoutDefinitions={\n\t\t\t\t\t\t\t\t\t\t\t\tglobalLayoutSettings?.definitions\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isTemplateMode && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t'edit-post-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t'is-focus-mode': isFocusMode,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t'is-layout-flow'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tcontentEditable={ false }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PostTitle ref={ titleRef } />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<RecursionProvider\n\t\t\t\t\t\t\tblockName={ wrapperBlockName }\n\t\t\t\t\t\t\tuniqueId={ wrapperUniqueId }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockList\n\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\tisTemplateMode\n\t\t\t\t\t\t\t\t\t\t? 'wp-site-blocks'\n\t\t\t\t\t\t\t\t\t\t: `${ blockListLayoutClass } wp-block-post-content` // Ensure root level blocks receive default/flow blockGap styling rules.\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t__experimentalLayout={ blockListLayout }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</RecursionProvider>\n\t\t\t\t\t</MaybeIframe>\n\t\t\t\t</motion.div>\n\t\t\t</motion.div>\n\t\t</BlockTools>\n\t);\n}\n"]}
|
|
@@ -67,7 +67,7 @@ export default function WelcomeGuideDefault() {
|
|
|
67
67
|
}, __('Learn how to use the block editor')), createElement("p", {
|
|
68
68
|
className: "edit-post-welcome-guide__text"
|
|
69
69
|
}, __('New to the block editor? Want to learn more about using it? '), createElement(ExternalLink, {
|
|
70
|
-
href: __('https://wordpress.org/
|
|
70
|
+
href: __('https://wordpress.org/documentation/article/wordpress-block-editor/')
|
|
71
71
|
}, __("Here's a detailed guide."))))
|
|
72
72
|
}]
|
|
73
73
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/welcome-guide/default.js"],"names":["useDispatch","ExternalLink","Guide","__","createInterpolateElement","WelcomeGuideImage","store","editPostStore","WelcomeGuideDefault","toggleFeature","image","content","InserterIconImage"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,iBAA5B;AACA,SAASC,YAAT,EAAuBC,KAAvB,QAAoC,uBAApC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,wBAAT,QAAyC,oBAAzC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QAAA,SAAS,EAAC;AAAb,SACGC,wBAAwB,CACzBD,EAAE,CACD,+HADC,CADuB,EAIzB;AACCS,QAAAA,iBAAiB,EAChB;AACC,UAAA,GAAG,EAAGT,EAAE,CAAE,UAAF,CADT;AAEC,UAAA,GAAG,EAAC;AAFL;AAFF,OAJyB,CAD3B,CAJD;AARF,KAzCO,EAuEP;AACCO,MAAAA,KAAK,EACJ,cAAC,iBAAD;AACC,QAAA,cAAc,EAAC,+DADhB;AAEC,QAAA,WAAW,EAAC;AAFb,QAFF;AAOCC,MAAAA,OAAO,EACN,8BACC;AAAI,QAAA,SAAS,EAAC;AAAd,SACGR,EAAE,CAAE,mCAAF,CADL,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACGA,EAAE,CACH,8DADG,CADL,EAIC,cAAC,YAAD;AACC,QAAA,IAAI,EAAGA,EAAE,CACR,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/welcome-guide/default.js"],"names":["useDispatch","ExternalLink","Guide","__","createInterpolateElement","WelcomeGuideImage","store","editPostStore","WelcomeGuideDefault","toggleFeature","image","content","InserterIconImage"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,iBAA5B;AACA,SAASC,YAAT,EAAuBC,KAAvB,QAAoC,uBAApC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,wBAAT,QAAyC,oBAAzC;AAEA;AACA;AACA;;AACA,OAAOC,iBAAP,MAA8B,SAA9B;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AAEA,eAAe,SAASC,mBAAT,GAA+B;AAC7C,QAAM;AAAEC,IAAAA;AAAF,MAAoBT,WAAW,CAAEO,aAAF,CAArC;AAEA,SACC,cAAC,KAAD;AACC,IAAA,SAAS,EAAC,yBADX;AAEC,IAAA,YAAY,EAAGJ,EAAE,CAAE,6BAAF,CAFlB;AAGC,IAAA,gBAAgB,EAAGA,EAAE,CAAE,aAAF,CAHtB;AAIC,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;AAAI,QAAA,SAAS,EAAC;AAAd,SACGR,EAAE,CAAE,mCAAF,CADL,CADD,EAIC;AAAG,QAAA,SAAS,EAAC;AAAb,SACGA,EAAE,CACH,8DADG,CADL,EAIC,cAAC,YAAD;AACC,QAAA,IAAI,EAAGA,EAAE,CACR,qEADQ;AADV,SAKGA,EAAE,CAAE,0BAAF,CALL,CAJD,CAJD;AARF,KAvEO;AALT,IADD;AA2GA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { ExternalLink, Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\nimport { store as editPostStore } from '../../store';\n\nexport default function WelcomeGuideDefault() {\n\tconst { toggleFeature } = useDispatch( editPostStore );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-post-welcome-guide\"\n\t\t\tcontentLabel={ __( 'Welcome to the block editor' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggleFeature( 'welcomeGuide' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Welcome to the block editor' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Make each block your own' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Get to know the block library' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tInserterIconImage: (\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\talt={ __( 'inserter' ) }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Learn how to use the block editor' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'New to the block editor? Want to learn more about using it? '\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( \"Here's a detailed guide.\" ) }\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"]}
|
package/build-module/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { createRoot } from '@wordpress/element';
|
|
|
10
10
|
import { dispatch, select } from '@wordpress/data';
|
|
11
11
|
import { addFilter } from '@wordpress/hooks';
|
|
12
12
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
13
|
-
import { registerLegacyWidgetBlock } from '@wordpress/widgets';
|
|
13
|
+
import { registerLegacyWidgetBlock, registerWidgetGroupBlock } from '@wordpress/widgets';
|
|
14
14
|
/**
|
|
15
15
|
* Internal dependencies
|
|
16
16
|
*/
|
|
@@ -62,6 +62,9 @@ export function initializeEditor(id, postType, postId, settings, initialEdits) {
|
|
|
62
62
|
registerLegacyWidgetBlock({
|
|
63
63
|
inserter: false
|
|
64
64
|
});
|
|
65
|
+
registerWidgetGroupBlock({
|
|
66
|
+
inserter: false
|
|
67
|
+
});
|
|
65
68
|
|
|
66
69
|
if (process.env.IS_GUTENBERG_PLUGIN) {
|
|
67
70
|
__experimentalRegisterExperimentalCoreBlocks({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","deprecated","createRoot","dispatch","select","addFilter","preferencesStore","registerLegacyWidgetBlock","Editor","editPostStore","initializeEditor","id","postType","postId","settings","initialEdits","target","document","getElementById","root","setDefaults","editorMode","fixedToolbar","fullscreenMode","hiddenBlockTypes","inactivePanels","isPublishSidebarEnabled","openPanels","preferredStyleVariations","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","themeStyles","welcomeGuide","welcomeGuideTemplate","__experimentalReapplyBlockTypeFilters","isFeatureActive","setIsListViewOpened","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","canInsert","blockType","isEditingTemplate","name","documentMode","compatMode","console","warn","isIphone","window","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","reinitializeEditor","since","version","default","PluginBlockSettingsMenuItem","PluginDocumentSettingPanel","PluginMoreMenuItem","PluginPostPublishPanel","PluginPostStatusInfo","PluginPrePublishPanel","PluginSidebar","PluginSidebarMoreMenuItem","__experimentalFullscreenModeClose","__experimentalMainDashboardButton"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SACCC,kBADD,EAECC,4CAFD,QAGO,0BAHP;AAIA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,iBAAjC;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASR,KAAK,IAAIS,gBAAlB,QAA0C,wBAA1C;AACA,SAASC,yBAAT,QAA0C,oBAA1C;AAEA;AACA;AACA;;AACA,OAAO,SAAP;AACA,OAAO,WAAP;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,SAASX,KAAK,IAAIY,aAAlB,QAAuC,SAAvC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,gBAAT,CACNC,EADM,EAENC,QAFM,EAGNC,MAHM,EAINC,QAJM,EAKNC,YALM,EAML;AACD,QAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAT,CAAyBP,EAAzB,CAAf;AACA,QAAMQ,IAAI,GAAGjB,UAAU,CAAEc,MAAF,CAAvB;AAEAb,EAAAA,QAAQ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,gBAAP,CAAyB,MAAzB,EAAmCO,CAAF,IAASA,CAAC,CAACC,cAAF,EAA1C,EAA8D,KAA9D;AAEA9C,EAAAA,IAAI,CAAC+C,MAAL,CACC,cAAC,MAAD;AACC,IAAA,QAAQ,EAAGpD,QADZ;AAEC,IAAA,MAAM,EAAGD,MAFV;AAGC,IAAA,QAAQ,EAAGD,QAHZ;AAIC,IAAA,YAAY,EAAGG;AAJhB,IADD;AASA,SAAOI,IAAP;AACA;AAED;AACA;AACA;;AACA,OAAO,SAASgD,kBAAT,GAA8B;AACpClE,EAAAA,UAAU,CAAE,gCAAF,EAAoC;AAC7CmE,IAAAA,KAAK,EAAE,KADsC;AAE7CC,IAAAA,OAAO,EAAE;AAFoC,GAApC,CAAV;AAIA;AAED,SAASC,OAAO,IAAIC,2BAApB,QAAuD,kEAAvD;AACA,SAASD,OAAO,IAAIE,0BAApB,QAAsD,oDAAtD;AACA,SAASF,OAAO,IAAIG,kBAApB,QAA8C,2CAA9C;AACA,SAASH,OAAO,IAAII,sBAApB,QAAkD,gDAAlD;AACA,SAASJ,OAAO,IAAIK,oBAApB,QAAgD,8CAAhD;AACA,SAASL,OAAO,IAAIM,qBAApB,QAAiD,+CAAjD;AACA,SAASN,OAAO,IAAIO,aAApB,QAAyC,qCAAzC;AACA,SAASP,OAAO,IAAIQ,yBAApB,QAAqD,mDAArD;AACA,SAASR,OAAO,IAAIS,iCAApB,QAA6D,2CAA7D;AACA,SAAST,OAAO,IAAIU,iCAApB,QAA6D,2CAA7D;AACA,SAASnF,KAAT,QAAsB,SAAtB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { registerLegacyWidgetBlock } from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { store as editPostStore } from './store';\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} 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(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfullscreenMode: true,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\tisPublishSidebarEnabled: true,\n\t\topenPanels: [ 'post-status' ],\n\t\tpreferredStyleVariations: {},\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\tif ( select( editPostStore ).isFeatureActive( 'showListViewByDefault' ) ) {\n\t\tdispatch( editPostStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t/*\n\t * Prevent adding template part in the post editor.\n\t * Only add the filter when the post editor is initialized, not imported.\n\t * Also only add the filter(s) after registerCoreBlocks()\n\t * so that common filters in the block library are not overwritten.\n\t */\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeTemplatePartsFromInserter',\n\t\t( canInsert, blockType ) => {\n\t\t\tif (\n\t\t\t\t! select( editPostStore ).isEditingTemplate() &&\n\t\t\t\tblockType.name === 'core/template-part'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn canInsert;\n\t\t}\n\t);\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"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\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item';\nexport { default as PluginDocumentSettingPanel } from './components/sidebar/plugin-document-setting-panel';\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';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { store } from './store';\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","deprecated","createRoot","dispatch","select","addFilter","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","Editor","editPostStore","initializeEditor","id","postType","postId","settings","initialEdits","target","document","getElementById","root","setDefaults","editorMode","fixedToolbar","fullscreenMode","hiddenBlockTypes","inactivePanels","isPublishSidebarEnabled","openPanels","preferredStyleVariations","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","themeStyles","welcomeGuide","welcomeGuideTemplate","__experimentalReapplyBlockTypeFilters","isFeatureActive","setIsListViewOpened","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","canInsert","blockType","isEditingTemplate","name","documentMode","compatMode","console","warn","isIphone","window","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","reinitializeEditor","since","version","default","PluginBlockSettingsMenuItem","PluginDocumentSettingPanel","PluginMoreMenuItem","PluginPostPublishPanel","PluginPostStatusInfo","PluginPrePublishPanel","PluginSidebar","PluginSidebarMoreMenuItem","__experimentalFullscreenModeClose","__experimentalMainDashboardButton"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SACCC,kBADD,EAECC,4CAFD,QAGO,0BAHP;AAIA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,iBAAjC;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASR,KAAK,IAAIS,gBAAlB,QAA0C,wBAA1C;AACA,SACCC,yBADD,EAECC,wBAFD,QAGO,oBAHP;AAKA;AACA;AACA;;AACA,OAAO,SAAP;AACA,OAAO,WAAP;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,SAASZ,KAAK,IAAIa,aAAlB,QAAuC,SAAvC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA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2CAA7D;AACA,SAASpF,KAAT,QAAsB,SAAtB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { store as editPostStore } from './store';\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} 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(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfullscreenMode: true,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\tisPublishSidebarEnabled: true,\n\t\topenPanels: [ 'post-status' ],\n\t\tpreferredStyleVariations: {},\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\tif ( select( editPostStore ).isFeatureActive( 'showListViewByDefault' ) ) {\n\t\tdispatch( editPostStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t/*\n\t * Prevent adding template part in the post editor.\n\t * Only add the filter when the post editor is initialized, not imported.\n\t * Also only add the filter(s) after registerCoreBlocks()\n\t * so that common filters in the block library are not overwritten.\n\t */\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeTemplatePartsFromInserter',\n\t\t( canInsert, blockType ) => {\n\t\t\tif (\n\t\t\t\t! select( editPostStore ).isEditingTemplate() &&\n\t\t\t\tblockType.name === 'core/template-part'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn canInsert;\n\t\t}\n\t);\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"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\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item';\nexport { default as PluginDocumentSettingPanel } from './components/sidebar/plugin-document-setting-panel';\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';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { store } from './store';\n"]}
|
|
@@ -413,15 +413,18 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
415
|
.interface-interface-skeleton__actions:focus, .interface-interface-skeleton__actions:focus-within {
|
|
416
|
-
top:
|
|
416
|
+
top: auto;
|
|
417
417
|
bottom: 0;
|
|
418
418
|
}
|
|
419
|
+
.is-entity-save-view-open .interface-interface-skeleton__actions:focus, .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
|
|
420
|
+
top: 46px;
|
|
421
|
+
}
|
|
419
422
|
@media (min-width: 782px) {
|
|
420
|
-
.interface-interface-skeleton__actions:focus, .interface-interface-skeleton__actions:focus-within {
|
|
423
|
+
.is-entity-save-view-open .interface-interface-skeleton__actions:focus, .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
|
|
421
424
|
border-right: 1px solid #ddd;
|
|
422
425
|
top: 32px;
|
|
423
426
|
}
|
|
424
|
-
.is-fullscreen-mode .interface-interface-skeleton__actions:focus, .is-fullscreen-mode .interface-interface-skeleton__actions:focus-within {
|
|
427
|
+
.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus, .is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
|
|
425
428
|
top: 0;
|
|
426
429
|
}
|
|
427
430
|
}
|
|
@@ -521,6 +524,10 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
521
524
|
}
|
|
522
525
|
.interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus:not(:disabled) {
|
|
523
526
|
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
527
|
+
outline: 2px solid transparent;
|
|
528
|
+
}
|
|
529
|
+
.interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus-visible::before {
|
|
530
|
+
content: none;
|
|
524
531
|
}
|
|
525
532
|
.interface-preferences__tabs .components-tab-panel__tab-content {
|
|
526
533
|
padding-right: 24px;
|
package/build-style/style.css
CHANGED
|
@@ -413,15 +413,18 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
415
|
.interface-interface-skeleton__actions:focus, .interface-interface-skeleton__actions:focus-within {
|
|
416
|
-
top:
|
|
416
|
+
top: auto;
|
|
417
417
|
bottom: 0;
|
|
418
418
|
}
|
|
419
|
+
.is-entity-save-view-open .interface-interface-skeleton__actions:focus, .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
|
|
420
|
+
top: 46px;
|
|
421
|
+
}
|
|
419
422
|
@media (min-width: 782px) {
|
|
420
|
-
.interface-interface-skeleton__actions:focus, .interface-interface-skeleton__actions:focus-within {
|
|
423
|
+
.is-entity-save-view-open .interface-interface-skeleton__actions:focus, .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
|
|
421
424
|
border-left: 1px solid #ddd;
|
|
422
425
|
top: 32px;
|
|
423
426
|
}
|
|
424
|
-
.is-fullscreen-mode .interface-interface-skeleton__actions:focus, .is-fullscreen-mode .interface-interface-skeleton__actions:focus-within {
|
|
427
|
+
.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus, .is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
|
|
425
428
|
top: 0;
|
|
426
429
|
}
|
|
427
430
|
}
|
|
@@ -521,6 +524,10 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
521
524
|
}
|
|
522
525
|
.interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus:not(:disabled) {
|
|
523
526
|
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
527
|
+
outline: 2px solid transparent;
|
|
528
|
+
}
|
|
529
|
+
.interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus-visible::before {
|
|
530
|
+
content: none;
|
|
524
531
|
}
|
|
525
532
|
.interface-preferences__tabs .components-tab-panel__tab-content {
|
|
526
533
|
padding-left: 24px;
|