@wordpress/editor 13.12.0 → 13.12.1
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/build/components/deprecated.js +4 -5
- package/build/components/deprecated.js.map +1 -1
- package/build/components/editor-help/help-detail-navigation-screen.native.js +2 -4
- package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build/components/editor-help/index.native.js +2 -4
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/editor-history/redo.js +2 -6
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js +2 -6
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js +3 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build/components/entities-saved-states/index.js +8 -9
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/index.js +9 -0
- package/build/components/index.js.map +1 -1
- package/build/components/page-attributes/order.js +2 -1
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/post-excerpt/check.js +2 -4
- package/build/components/post-excerpt/check.js.map +1 -1
- package/build/components/post-featured-image/check.js +2 -4
- package/build/components/post-featured-image/check.js.map +1 -1
- package/build/components/post-format/check.js +2 -4
- package/build/components/post-format/check.js.map +1 -1
- package/build/components/post-publish-button/index.js +4 -6
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-panel/index.js +4 -5
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +150 -0
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -0
- package/build/components/post-publish-panel/prepublish.js +3 -1
- package/build/components/post-publish-panel/prepublish.js.map +1 -1
- package/build/components/post-sync-status/index.js +67 -0
- package/build/components/post-sync-status/index.js.map +1 -0
- package/build/components/post-taxonomies/flat-term-selector.js +25 -34
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-title/index.js +8 -1
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-visibility/index.js +4 -7
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/provider/index.js +3 -5
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +5 -10
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/with-registry-provider.js +4 -2
- package/build/components/provider/with-registry-provider.js.map +1 -1
- package/build/components/table-of-contents/index.js +2 -4
- package/build/components/table-of-contents/index.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js +4 -7
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/{lockUnlock.js → lock-unlock.js} +1 -1
- package/build/lock-unlock.js.map +1 -0
- package/build/private-apis.js +1 -1
- package/build/private-apis.js.map +1 -1
- package/build-module/components/deprecated.js +4 -4
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js +2 -3
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +2 -3
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-history/redo.js +2 -3
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js +2 -3
- package/build-module/components/editor-history/undo.js.map +1 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +3 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +8 -8
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/index.js +1 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/page-attributes/order.js +2 -1
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/post-excerpt/check.js +2 -3
- package/build-module/components/post-excerpt/check.js.map +1 -1
- package/build-module/components/post-featured-image/check.js +2 -3
- package/build-module/components/post-featured-image/check.js.map +1 -1
- package/build-module/components/post-format/check.js +2 -3
- package/build-module/components/post-format/check.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +4 -5
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +4 -4
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js +138 -0
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -0
- package/build-module/components/post-publish-panel/prepublish.js +2 -1
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-sync-status/index.js +56 -0
- package/build-module/components/post-sync-status/index.js.map +1 -0
- package/build-module/components/post-taxonomies/flat-term-selector.js +25 -32
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-title/index.js +8 -1
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-visibility/index.js +4 -4
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/provider/index.js +3 -4
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +5 -9
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/with-registry-provider.js +4 -2
- package/build-module/components/provider/with-registry-provider.js.map +1 -1
- package/build-module/components/table-of-contents/index.js +2 -3
- package/build-module/components/table-of-contents/index.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js +4 -4
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/{lockUnlock.js → lock-unlock.js} +1 -1
- package/build-module/lock-unlock.js.map +1 -0
- package/build-module/private-apis.js +1 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-style/style-rtl.css +15 -1
- package/build-style/style.css +15 -1
- package/package.json +30 -31
- package/src/components/editor-help/test/index.native.js +3 -2
- package/src/components/entities-saved-states/hooks/use-is-dirty.js +2 -0
- package/src/components/index.js +1 -0
- package/src/components/post-publish-panel/maybe-upload-media.js +167 -0
- package/src/components/post-publish-panel/prepublish.js +2 -0
- package/src/components/post-publish-panel/style.scss +1 -1
- package/src/components/post-sync-status/index.js +55 -0
- package/src/components/post-sync-status/style.scss +16 -0
- package/src/components/post-taxonomies/flat-term-selector.js +20 -30
- package/src/components/post-title/index.js +3 -1
- package/src/components/provider/index.js +1 -1
- package/src/components/provider/index.native.js +2 -9
- package/src/private-apis.js +1 -1
- package/src/style.scss +1 -0
- package/build/lockUnlock.js.map +0 -1
- package/build-module/lockUnlock.js.map +0 -1
- /package/src/{lockUnlock.js → lock-unlock.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/provider/index.native.js"],"names":["memize","SafeAreaProvider","RNReactNativeGutenbergBridge","requestBlockTypeImpressions","setBlockTypeImpressions","subscribeParentGetHtml","subscribeParentToggleHTMLMode","subscribeUpdateHtml","subscribeSetTitle","subscribeMediaAppend","subscribeReplaceBlock","subscribeUpdateEditorSettings","subscribeUpdateCapabilities","subscribeShowNotice","subscribeShowEditorHelp","Component","count","wordCount","parse","serialize","getUnregisteredTypeHandlerName","createBlock","withDispatch","withSelect","compose","applyFilters","store","blockEditorStore","getGlobalStyles","getColorsAndGradients","NEW_BLOCK_TYPES","postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","EditorHelpTopics","editorStore","noticesStore","coreStore","editPostStore","EditorProvider","NativeEditorProvider","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","getEditorSettings","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","locale","hostAppNamespace","updateEditorSettings","updateBlockEditorSettings","getThemeColors","subscriptionParentGetHtml","serializeToNativeAction","subscriptionParentToggleHTMLMode","toggleMode","subscriptionParentSetTitle","payload","editTitle","title","subscriptionParentUpdateHtml","updateHtmlAction","html","subscriptionParentReplaceBlock","replaceBlockAction","clientId","subscriptionParentMediaAppend","blockName","mediaType","newBlock","id","mediaId","mediaUrl","indexAfterSelected","selectedBlockIndex","insertionIndex","blockCount","insertBlock","subscriptionParentUpdateEditorSettings","galleryWithImageBlocks","editorSettings","window","wp","galleryBlockV2Enabled","subscriptionParentUpdateCapabilities","updateCapabilitiesAction","subscriptionParentShowNotice","createSuccessNotice","message","subscriptionParentShowEditorHelp","setState","storedImpressions","impressions","storedImpressionKeys","Object","keys","storedImpressionsCurrent","every","newKey","includes","componentWillUnmount","remove","rawStyles","rawFeatures","defaultEditorColors","defaultEditorGradients","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","unsupportedBlockNames","filter","block","attributes","originalName","editorDidMount","mode","hasChanges","raw","content","contentInfo","characterCount","paragraphCount","provideToNative_Html","parsed","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","clearSelectedBlock","render","children","supportSection","ComposedNativeProvider","select","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","getEditorMode","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","colors","gradients","selectedBlockClientId","dispatch","editPost","resetEditorBlocks","updateSettings","switchEditorMode","__unstableShouldCreateUndoLevel","ExperimentalEditorProvider"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,MAAP,MAAmB,QAAnB;AACA,SAASC,gBAAT,QAAiC,gCAAjC;AAEA;AACA;AACA;;AACA,OAAOC,4BAAP,IACCC,2BADD,EAECC,uBAFD,EAGCC,sBAHD,EAICC,6BAJD,EAKCC,mBALD,EAMCC,iBAND,EAOCC,oBAPD,EAQCC,qBARD,EASCC,6BATD,EAUCC,2BAVD,EAWCC,mBAXD,EAYCC,uBAZD,QAaO,gCAbP;AAcA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SACCC,KADD,EAECC,SAFD,EAGCC,8BAHD,EAICC,WAJD,QAKO,mBALP;AAMA,SAASC,YAAT,EAAuBC,UAAvB,QAAyC,iBAAzC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,YAAT,QAA6B,kBAA7B;AACA,SA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/B,MACLkG,QAAQ,CAAExH,WAAF,CADT;AAEA,QAAM;AACL2H,IAAAA,cADK;AAELrB,IAAAA,kBAFK;AAGLpD,IAAAA,WAHK;AAILkD,IAAAA;AAJK,MAKFoB,QAAQ,CAAEzI,gBAAF,CALZ;AAMA,QAAM;AAAE6I,IAAAA;AAAF,MAAuBJ,QAAQ,CAAErH,aAAF,CAArC;AACA,QAAM;AAAEO,IAAAA,WAAF;AAAeC,IAAAA;AAAf,MAAwC6G,QAAQ,CAAEtH,SAAF,CAAtD;AACA,QAAM;AAAE0D,IAAAA;AAAF,MAA0B4D,QAAQ,CAAEvH,YAAF,CAAxC;AAEA,SAAO;AACNsB,IAAAA,yBAAyB,EAAEoG,cADrB;AAENrG,IAAAA,oBAFM;AAGNZ,IAAAA,WAHM;AAIN4F,IAAAA,kBAJM;AAKNpD,IAAAA,WALM;AAMNU,IAAAA,mBANM;;AAON7B,IAAAA,SAAS,CAAEC,KAAF,EAAU;AAClByF,MAAAA,QAAQ,CAAE;AAAEzF,QAAAA;AAAF,OAAF,CAAR;AACA,KATK;;AAUNrB,IAAAA,oBAVM;;AAWNuF,IAAAA,iCAAiC,CAAExG,MAAF,EAAW;AAC3CgI,MAAAA,iBAAiB,CAAEhI,MAAF,EAAU;AAC1BmI,QAAAA,+BAA+B,EAAE;AADP,OAAV,CAAjB;AAGA,KAfK;;AAgBNxB,IAAAA,UAAU,CAAEZ,IAAF,EAAS;AAClBmC,MAAAA,gBAAgB,CAAEnC,IAAF,CAAhB;AACA,KAlBK;;AAmBNW,IAAAA;AAnBM,GAAP;AAqBA,CAlCW,CAhC2B,CAAF,CAAP,CAmE1B/F,oBAnE0B,CAA/B;AAqEA,eAAeqG,sBAAf;AACA,SAASA,sBAAsB,IAAIoB,0BAAnC","sourcesContent":["/**\n * External dependencies\n */\nimport memize from 'memize';\nimport { SafeAreaProvider } from 'react-native-safe-area-context';\n\n/**\n * WordPress dependencies\n */\nimport RNReactNativeGutenbergBridge, {\n\trequestBlockTypeImpressions,\n\tsetBlockTypeImpressions,\n\tsubscribeParentGetHtml,\n\tsubscribeParentToggleHTMLMode,\n\tsubscribeUpdateHtml,\n\tsubscribeSetTitle,\n\tsubscribeMediaAppend,\n\tsubscribeReplaceBlock,\n\tsubscribeUpdateEditorSettings,\n\tsubscribeUpdateCapabilities,\n\tsubscribeShowNotice,\n\tsubscribeShowEditorHelp,\n} from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport {\n\tparse,\n\tserialize,\n\tgetUnregisteredTypeHandlerName,\n\tcreateBlock,\n} from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { applyFilters } from '@wordpress/hooks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { getGlobalStyles, getColorsAndGradients } from '@wordpress/components';\nimport { NEW_BLOCK_TYPES } from '@wordpress/block-library';\n\nconst postTypeEntities = [\n\t{ name: 'post', baseURL: '/wp/v2/posts' },\n\t{ name: 'page', baseURL: '/wp/v2/pages' },\n\t{ name: 'attachment', baseURL: '/wp/v2/media' },\n\t{ name: 'wp_block', baseURL: '/wp/v2/blocks' },\n].map( ( postTypeEntity ) => ( {\n\tkind: 'postType',\n\t...postTypeEntity,\n\ttransientEdits: {\n\t\tblocks: true,\n\t\tselection: true,\n\t},\n\tmergedEdits: {\n\t\tmeta: true,\n\t},\n\trawAttributes: [ 'title', 'excerpt', 'content' ],\n} ) );\nimport { EditorHelpTopics, store as editorStore } from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n// eslint-disable-next-line no-restricted-imports\nimport { store as editPostStore } from '@wordpress/edit-post';\n\n/**\n * Internal dependencies\n */\nimport EditorProvider from './index.js';\n\nclass NativeEditorProvider extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\t// Keep a local reference to `post` to detect changes.\n\t\tthis.post = this.props.post;\n\t\tthis.props.addEntities( postTypeEntities );\n\t\tthis.props.receiveEntityRecords(\n\t\t\t'postType',\n\t\t\tthis.post.type,\n\t\t\tthis.post\n\t\t);\n\n\t\tthis.getEditorSettings = memize(\n\t\t\t( settings, capabilities ) => ( {\n\t\t\t\t...settings,\n\t\t\t\tcapabilities,\n\t\t\t} ),\n\t\t\t{\n\t\t\t\tmaxSize: 1,\n\t\t\t}\n\t\t);\n\t\tthis.state = {\n\t\t\tisHelpVisible: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst {\n\t\t\tcapabilities,\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t\tupdateEditorSettings,\n\t\t\tupdateBlockEditorSettings,\n\t\t} = this.props;\n\n\t\tupdateEditorSettings( {\n\t\t\tcapabilities,\n\t\t\t...this.getThemeColors( this.props ),\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t} );\n\n\t\tthis.subscriptionParentGetHtml = subscribeParentGetHtml( () => {\n\t\t\tthis.serializeToNativeAction();\n\t\t} );\n\n\t\tthis.subscriptionParentToggleHTMLMode = subscribeParentToggleHTMLMode(\n\t\t\t() => {\n\t\t\t\tthis.toggleMode();\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentSetTitle = subscribeSetTitle( ( payload ) => {\n\t\t\tthis.props.editTitle( payload.title );\n\t\t} );\n\n\t\tthis.subscriptionParentUpdateHtml = subscribeUpdateHtml(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateHtmlAction( payload.html );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentReplaceBlock = subscribeReplaceBlock(\n\t\t\t( payload ) => {\n\t\t\t\tthis.replaceBlockAction( payload.html, payload.clientId );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentMediaAppend = subscribeMediaAppend(\n\t\t\t( payload ) => {\n\t\t\t\tconst blockName = 'core/' + payload.mediaType;\n\t\t\t\tconst newBlock = createBlock( blockName, {\n\t\t\t\t\tid: payload.mediaId,\n\t\t\t\t\t[ payload.mediaType === 'image' ? 'url' : 'src' ]:\n\t\t\t\t\t\tpayload.mediaUrl,\n\t\t\t\t} );\n\n\t\t\t\tconst indexAfterSelected = this.props.selectedBlockIndex + 1;\n\t\t\t\tconst insertionIndex =\n\t\t\t\t\tindexAfterSelected || this.props.blockCount;\n\n\t\t\t\tthis.props.insertBlock( newBlock, insertionIndex );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateEditorSettings =\n\t\t\tsubscribeUpdateEditorSettings(\n\t\t\t\t( { galleryWithImageBlocks, ...editorSettings } ) => {\n\t\t\t\t\tif ( typeof galleryWithImageBlocks === 'boolean' ) {\n\t\t\t\t\t\twindow.wp.galleryBlockV2Enabled =\n\t\t\t\t\t\t\tgalleryWithImageBlocks;\n\t\t\t\t\t}\n\t\t\t\t\tupdateEditorSettings(\n\t\t\t\t\t\tthis.getThemeColors( editorSettings )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\tthis.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateCapabilitiesAction( payload );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowNotice = subscribeShowNotice(\n\t\t\t( payload ) => {\n\t\t\t\tthis.props.createSuccessNotice( payload.message );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowEditorHelp = subscribeShowEditorHelp( () => {\n\t\t\tthis.setState( { isHelpVisible: true } );\n\t\t} );\n\n\t\t// Request current block impressions from native app.\n\t\trequestBlockTypeImpressions( ( storedImpressions ) => {\n\t\t\tconst impressions = { ...NEW_BLOCK_TYPES, ...storedImpressions };\n\n\t\t\t// Persist impressions to JavaScript store.\n\t\t\tupdateBlockEditorSettings( { impressions } );\n\n\t\t\t// Persist impressions to native store if they do not include latest\n\t\t\t// `NEW_BLOCK_TYPES` configuration.\n\t\t\tconst storedImpressionKeys = Object.keys( storedImpressions );\n\t\t\tconst storedImpressionsCurrent = Object.keys(\n\t\t\t\tNEW_BLOCK_TYPES\n\t\t\t).every( ( newKey ) => storedImpressionKeys.includes( newKey ) );\n\t\t\tif ( ! storedImpressionsCurrent ) {\n\t\t\t\tsetBlockTypeImpressions( impressions );\n\t\t\t}\n\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentGetHtml ) {\n\t\t\tthis.subscriptionParentGetHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentToggleHTMLMode ) {\n\t\t\tthis.subscriptionParentToggleHTMLMode.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentSetTitle ) {\n\t\t\tthis.subscriptionParentSetTitle.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateHtml ) {\n\t\t\tthis.subscriptionParentUpdateHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentReplaceBlock ) {\n\t\t\tthis.subscriptionParentReplaceBlock.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentMediaAppend ) {\n\t\t\tthis.subscriptionParentMediaAppend.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateEditorSettings ) {\n\t\t\tthis.subscriptionParentUpdateEditorSettings.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateCapabilities ) {\n\t\t\tthis.subscriptionParentUpdateCapabilities.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowNotice ) {\n\t\t\tthis.subscriptionParentShowNotice.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowEditorHelp ) {\n\t\t\tthis.subscriptionParentShowEditorHelp.remove();\n\t\t}\n\t}\n\n\tgetThemeColors( { rawStyles, rawFeatures } ) {\n\t\tconst { defaultEditorColors, defaultEditorGradients } = this.props;\n\n\t\tif ( rawStyles && rawFeatures ) {\n\t\t\treturn getGlobalStyles( rawStyles, rawFeatures );\n\t\t}\n\n\t\treturn getColorsAndGradients(\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\trawFeatures\n\t\t);\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( ! prevProps.isReady && this.props.isReady ) {\n\t\t\tconst blocks = this.props.blocks;\n\t\t\tconst isUnsupportedBlock = ( { name } ) =>\n\t\t\t\tname === getUnregisteredTypeHandlerName();\n\t\t\tconst unsupportedBlockNames = blocks\n\t\t\t\t.filter( isUnsupportedBlock )\n\t\t\t\t.map( ( block ) => block.attributes.originalName );\n\t\t\tRNReactNativeGutenbergBridge.editorDidMount(\n\t\t\t\tunsupportedBlockNames\n\t\t\t);\n\t\t}\n\t}\n\n\tserializeToNativeAction() {\n\t\tconst title = this.props.title;\n\t\tlet html;\n\n\t\tif ( this.props.mode === 'text' ) {\n\t\t\t// The HTMLTextInput component does not update the store when user is doing changes\n\t\t\t// Let's request the HTML from the component's state directly.\n\t\t\thtml = applyFilters( 'native.persist-html' );\n\t\t} else {\n\t\t\thtml = serialize( this.props.blocks );\n\t\t}\n\n\t\tconst hasChanges =\n\t\t\ttitle !== this.post.title.raw || html !== this.post.content.raw;\n\n\t\t// Variable to store the content structure metrics.\n\t\tconst contentInfo = {};\n\t\tcontentInfo.characterCount = wordCount(\n\t\t\thtml,\n\t\t\t'characters_including_spaces'\n\t\t);\n\t\tcontentInfo.wordCount = wordCount( html, 'words' );\n\t\tcontentInfo.paragraphCount = this.props.paragraphCount;\n\t\tcontentInfo.blockCount = this.props.blockCount;\n\t\tRNReactNativeGutenbergBridge.provideToNative_Html(\n\t\t\thtml,\n\t\t\ttitle,\n\t\t\thasChanges,\n\t\t\tcontentInfo\n\t\t);\n\n\t\tif ( hasChanges ) {\n\t\t\tthis.post.title.raw = title;\n\t\t\tthis.post.content.raw = html;\n\t\t}\n\t}\n\n\tupdateHtmlAction( html ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.resetEditorBlocksWithoutUndoLevel( parsed );\n\t}\n\n\treplaceBlockAction( html, blockClientId ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.replaceBlock( blockClientId, parsed );\n\t}\n\n\ttoggleMode() {\n\t\tconst { mode, switchMode } = this.props;\n\t\t// Refresh html content first.\n\t\tthis.serializeToNativeAction();\n\t\t// Make sure to blur the selected block and dismiss the keyboard.\n\t\tthis.props.clearSelectedBlock();\n\t\tswitchMode( mode === 'visual' ? 'text' : 'visual' );\n\t}\n\n\tupdateCapabilitiesAction( capabilities ) {\n\t\tthis.props.updateEditorSettings( { capabilities } );\n\t}\n\n\trender() {\n\t\tconst { children, post, capabilities, settings, ...props } = this.props;\n\t\tconst editorSettings = this.getEditorSettings( settings, capabilities );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ this.post }\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t<SafeAreaProvider>{ children }</SafeAreaProvider>\n\t\t\t\t</EditorProvider>\n\t\t\t\t<EditorHelpTopics\n\t\t\t\t\tisVisible={ this.state.isHelpVisible }\n\t\t\t\t\tonClose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tclose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tshowSupport={ capabilities?.supportSection === true }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nconst ComposedNativeProvider = compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\t__unstableIsEditorReady: isEditorReady,\n\t\t\tgetEditorBlocks,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostContent,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\t\tconst { getEditorMode } = select( editPostStore );\n\n\t\tconst { getBlockIndex, getSelectedBlockClientId, getGlobalBlockCount } =\n\t\t\tselect( blockEditorStore );\n\n\t\tconst settings = getEditorSettings();\n\t\tconst defaultEditorColors = settings?.colors ?? [];\n\t\tconst defaultEditorGradients = settings?.gradients ?? [];\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t\tisReady: isEditorReady(),\n\t\t\tblocks: getEditorBlocks(),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tgetEditedPostContent,\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\tselectedBlockIndex: getBlockIndex( selectedBlockClientId ),\n\t\t\tblockCount: getGlobalBlockCount(),\n\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, resetEditorBlocks, updateEditorSettings } =\n\t\t\tdispatch( editorStore );\n\t\tconst {\n\t\t\tupdateSettings,\n\t\t\tclearSelectedBlock,\n\t\t\tinsertBlock,\n\t\t\treplaceBlock,\n\t\t} = dispatch( blockEditorStore );\n\t\tconst { switchEditorMode } = dispatch( editPostStore );\n\t\tconst { addEntities, receiveEntityRecords } = dispatch( coreStore );\n\t\tconst { createSuccessNotice } = dispatch( noticesStore );\n\n\t\treturn {\n\t\t\tupdateBlockEditorSettings: updateSettings,\n\t\t\tupdateEditorSettings,\n\t\t\taddEntities,\n\t\t\tclearSelectedBlock,\n\t\t\tinsertBlock,\n\t\t\tcreateSuccessNotice,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\treceiveEntityRecords,\n\t\t\tresetEditorBlocksWithoutUndoLevel( blocks ) {\n\t\t\t\tresetEditorBlocks( blocks, {\n\t\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tswitchMode( mode ) {\n\t\t\t\tswitchEditorMode( mode );\n\t\t\t},\n\t\t\treplaceBlock,\n\t\t};\n\t} ),\n] )( NativeEditorProvider );\n\nexport default ComposedNativeProvider;\nexport { ComposedNativeProvider as ExperimentalEditorProvider };\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/provider/index.native.js"],"names":["memize","SafeAreaProvider","RNReactNativeGutenbergBridge","requestBlockTypeImpressions","setBlockTypeImpressions","subscribeParentGetHtml","subscribeParentToggleHTMLMode","subscribeUpdateHtml","subscribeSetTitle","subscribeMediaAppend","subscribeReplaceBlock","subscribeUpdateEditorSettings","subscribeUpdateCapabilities","subscribeShowNotice","subscribeShowEditorHelp","Component","count","wordCount","parse","serialize","getUnregisteredTypeHandlerName","createBlock","withDispatch","withSelect","compose","applyFilters","store","blockEditorStore","getGlobalStyles","getColorsAndGradients","NEW_BLOCK_TYPES","postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","EditorHelpTopics","editorStore","noticesStore","coreStore","editPostStore","EditorProvider","NativeEditorProvider","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","getEditorSettings","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","locale","hostAppNamespace","updateEditorSettings","updateBlockEditorSettings","getThemeColors","subscriptionParentGetHtml","serializeToNativeAction","subscriptionParentToggleHTMLMode","toggleMode","subscriptionParentSetTitle","payload","editTitle","title","subscriptionParentUpdateHtml","updateHtmlAction","html","subscriptionParentReplaceBlock","replaceBlockAction","clientId","subscriptionParentMediaAppend","blockName","mediaType","newBlock","id","mediaId","mediaUrl","indexAfterSelected","selectedBlockIndex","insertionIndex","blockCount","insertBlock","subscriptionParentUpdateEditorSettings","galleryWithImageBlocks","editorSettings","window","wp","galleryBlockV2Enabled","subscriptionParentUpdateCapabilities","updateCapabilitiesAction","subscriptionParentShowNotice","createSuccessNotice","message","subscriptionParentShowEditorHelp","setState","storedImpressions","impressions","storedImpressionKeys","Object","keys","storedImpressionsCurrent","every","newKey","includes","componentWillUnmount","remove","rawStyles","rawFeatures","defaultEditorColors","defaultEditorGradients","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","unsupportedBlockNames","filter","block","attributes","originalName","editorDidMount","mode","hasChanges","raw","content","contentInfo","characterCount","paragraphCount","provideToNative_Html","parsed","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","render","children","supportSection","ComposedNativeProvider","select","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","getEditorMode","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","colors","gradients","selectedBlockClientId","dispatch","editPost","resetEditorBlocks","updateSettings","switchEditorMode","__unstableShouldCreateUndoLevel","ExperimentalEditorProvider"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,MAAP,MAAmB,QAAnB;AACA,SAASC,gBAAT,QAAiC,gCAAjC;AAEA;AACA;AACA;;AACA,OAAOC,4BAAP,IACCC,2BADD,EAECC,uBAFD,EAGCC,sBAHD,EAICC,6BAJD,EAKCC,mBALD,EAMCC,iBAND,EAOCC,oBAPD,EAQCC,qBARD,EASCC,6BATD,EAUCC,2BAVD,EAWCC,mBAXD,EAYCC,uBAZD,QAaO,gCAbP;AAcA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SACCC,KADD,EAECC,SAFD,EAGCC,8BAHD,EAICC,WAJD,QAKO,mBALP;AAMA,SAASC,YAAT,EAAuBC,UAAvB,QAAyC,iBAAzC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,YAAT,QAA6B,kBAA7B;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;AACA,SAASC,eAAT,EAA0BC,qBAA1B,QAAuD,uBAAvD;AACA,SAASC,eAAT,QAAgC,0BAAhC;AAEA,MAAMC,gBAAgB,GAAG,CACxB;AAAEC,EAAAA,IAAI,EAAE,MAAR;AAAgBC,EAAAA,OAAO,EAAE;AAAzB,CADwB,EAExB;AAAED,EAAAA,IAAI,EAAE,MAAR;AAAgBC,EAAAA,OAAO,EAAE;AAAzB,CAFwB,EAGxB;AAAED,EAAAA,IAAI,EAAE,YAAR;AAAsBC,EAAAA,OAAO,EAAE;AAA/B,CAHwB,E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B;AAENpG,IAAAA,oBAFM;AAGNZ,IAAAA,WAHM;AAINwC,IAAAA,WAJM;AAKNU,IAAAA,mBALM;;AAMN7B,IAAAA,SAAS,CAAEC,KAAF,EAAU;AAClBwF,MAAAA,QAAQ,CAAE;AAAExF,QAAAA;AAAF,OAAF,CAAR;AACA,KARK;;AASNrB,IAAAA,oBATM;;AAUNuF,IAAAA,iCAAiC,CAAExG,MAAF,EAAW;AAC3C+H,MAAAA,iBAAiB,CAAE/H,MAAF,EAAU;AAC1BkI,QAAAA,+BAA+B,EAAE;AADP,OAAV,CAAjB;AAGA,KAdK;;AAeNvB,IAAAA,UAAU,CAAEZ,IAAF,EAAS;AAClBkC,MAAAA,gBAAgB,CAAElC,IAAF,CAAhB;AACA,KAjBK;;AAkBNW,IAAAA;AAlBM,GAAP;AAoBA,CA7BW,CAhC2B,CAAF,CAAP,CA8D1B/F,oBA9D0B,CAA/B;AAgEA,eAAeoG,sBAAf;AACA,SAASA,sBAAsB,IAAIoB,0BAAnC","sourcesContent":["/**\n * External dependencies\n */\nimport memize from 'memize';\nimport { SafeAreaProvider } from 'react-native-safe-area-context';\n\n/**\n * WordPress dependencies\n */\nimport RNReactNativeGutenbergBridge, {\n\trequestBlockTypeImpressions,\n\tsetBlockTypeImpressions,\n\tsubscribeParentGetHtml,\n\tsubscribeParentToggleHTMLMode,\n\tsubscribeUpdateHtml,\n\tsubscribeSetTitle,\n\tsubscribeMediaAppend,\n\tsubscribeReplaceBlock,\n\tsubscribeUpdateEditorSettings,\n\tsubscribeUpdateCapabilities,\n\tsubscribeShowNotice,\n\tsubscribeShowEditorHelp,\n} from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport {\n\tparse,\n\tserialize,\n\tgetUnregisteredTypeHandlerName,\n\tcreateBlock,\n} from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { applyFilters } from '@wordpress/hooks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { getGlobalStyles, getColorsAndGradients } from '@wordpress/components';\nimport { NEW_BLOCK_TYPES } from '@wordpress/block-library';\n\nconst postTypeEntities = [\n\t{ name: 'post', baseURL: '/wp/v2/posts' },\n\t{ name: 'page', baseURL: '/wp/v2/pages' },\n\t{ name: 'attachment', baseURL: '/wp/v2/media' },\n\t{ name: 'wp_block', baseURL: '/wp/v2/blocks' },\n].map( ( postTypeEntity ) => ( {\n\tkind: 'postType',\n\t...postTypeEntity,\n\ttransientEdits: {\n\t\tblocks: true,\n\t\tselection: true,\n\t},\n\tmergedEdits: {\n\t\tmeta: true,\n\t},\n\trawAttributes: [ 'title', 'excerpt', 'content' ],\n} ) );\nimport { EditorHelpTopics, store as editorStore } from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n// eslint-disable-next-line no-restricted-imports\nimport { store as editPostStore } from '@wordpress/edit-post';\n\n/**\n * Internal dependencies\n */\nimport EditorProvider from './index.js';\n\nclass NativeEditorProvider extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\t// Keep a local reference to `post` to detect changes.\n\t\tthis.post = this.props.post;\n\t\tthis.props.addEntities( postTypeEntities );\n\t\tthis.props.receiveEntityRecords(\n\t\t\t'postType',\n\t\t\tthis.post.type,\n\t\t\tthis.post\n\t\t);\n\n\t\tthis.getEditorSettings = memize(\n\t\t\t( settings, capabilities ) => ( {\n\t\t\t\t...settings,\n\t\t\t\tcapabilities,\n\t\t\t} ),\n\t\t\t{\n\t\t\t\tmaxSize: 1,\n\t\t\t}\n\t\t);\n\t\tthis.state = {\n\t\t\tisHelpVisible: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst {\n\t\t\tcapabilities,\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t\tupdateEditorSettings,\n\t\t\tupdateBlockEditorSettings,\n\t\t} = this.props;\n\n\t\tupdateEditorSettings( {\n\t\t\tcapabilities,\n\t\t\t...this.getThemeColors( this.props ),\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t} );\n\n\t\tthis.subscriptionParentGetHtml = subscribeParentGetHtml( () => {\n\t\t\tthis.serializeToNativeAction();\n\t\t} );\n\n\t\tthis.subscriptionParentToggleHTMLMode = subscribeParentToggleHTMLMode(\n\t\t\t() => {\n\t\t\t\tthis.toggleMode();\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentSetTitle = subscribeSetTitle( ( payload ) => {\n\t\t\tthis.props.editTitle( payload.title );\n\t\t} );\n\n\t\tthis.subscriptionParentUpdateHtml = subscribeUpdateHtml(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateHtmlAction( payload.html );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentReplaceBlock = subscribeReplaceBlock(\n\t\t\t( payload ) => {\n\t\t\t\tthis.replaceBlockAction( payload.html, payload.clientId );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentMediaAppend = subscribeMediaAppend(\n\t\t\t( payload ) => {\n\t\t\t\tconst blockName = 'core/' + payload.mediaType;\n\t\t\t\tconst newBlock = createBlock( blockName, {\n\t\t\t\t\tid: payload.mediaId,\n\t\t\t\t\t[ payload.mediaType === 'image' ? 'url' : 'src' ]:\n\t\t\t\t\t\tpayload.mediaUrl,\n\t\t\t\t} );\n\n\t\t\t\tconst indexAfterSelected = this.props.selectedBlockIndex + 1;\n\t\t\t\tconst insertionIndex =\n\t\t\t\t\tindexAfterSelected || this.props.blockCount;\n\n\t\t\t\tthis.props.insertBlock( newBlock, insertionIndex );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateEditorSettings =\n\t\t\tsubscribeUpdateEditorSettings(\n\t\t\t\t( { galleryWithImageBlocks, ...editorSettings } ) => {\n\t\t\t\t\tif ( typeof galleryWithImageBlocks === 'boolean' ) {\n\t\t\t\t\t\twindow.wp.galleryBlockV2Enabled =\n\t\t\t\t\t\t\tgalleryWithImageBlocks;\n\t\t\t\t\t}\n\t\t\t\t\tupdateEditorSettings(\n\t\t\t\t\t\tthis.getThemeColors( editorSettings )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\tthis.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateCapabilitiesAction( payload );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowNotice = subscribeShowNotice(\n\t\t\t( payload ) => {\n\t\t\t\tthis.props.createSuccessNotice( payload.message );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowEditorHelp = subscribeShowEditorHelp( () => {\n\t\t\tthis.setState( { isHelpVisible: true } );\n\t\t} );\n\n\t\t// Request current block impressions from native app.\n\t\trequestBlockTypeImpressions( ( storedImpressions ) => {\n\t\t\tconst impressions = { ...NEW_BLOCK_TYPES, ...storedImpressions };\n\n\t\t\t// Persist impressions to JavaScript store.\n\t\t\tupdateBlockEditorSettings( { impressions } );\n\n\t\t\t// Persist impressions to native store if they do not include latest\n\t\t\t// `NEW_BLOCK_TYPES` configuration.\n\t\t\tconst storedImpressionKeys = Object.keys( storedImpressions );\n\t\t\tconst storedImpressionsCurrent = Object.keys(\n\t\t\t\tNEW_BLOCK_TYPES\n\t\t\t).every( ( newKey ) => storedImpressionKeys.includes( newKey ) );\n\t\t\tif ( ! storedImpressionsCurrent ) {\n\t\t\t\tsetBlockTypeImpressions( impressions );\n\t\t\t}\n\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentGetHtml ) {\n\t\t\tthis.subscriptionParentGetHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentToggleHTMLMode ) {\n\t\t\tthis.subscriptionParentToggleHTMLMode.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentSetTitle ) {\n\t\t\tthis.subscriptionParentSetTitle.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateHtml ) {\n\t\t\tthis.subscriptionParentUpdateHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentReplaceBlock ) {\n\t\t\tthis.subscriptionParentReplaceBlock.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentMediaAppend ) {\n\t\t\tthis.subscriptionParentMediaAppend.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateEditorSettings ) {\n\t\t\tthis.subscriptionParentUpdateEditorSettings.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateCapabilities ) {\n\t\t\tthis.subscriptionParentUpdateCapabilities.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowNotice ) {\n\t\t\tthis.subscriptionParentShowNotice.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowEditorHelp ) {\n\t\t\tthis.subscriptionParentShowEditorHelp.remove();\n\t\t}\n\t}\n\n\tgetThemeColors( { rawStyles, rawFeatures } ) {\n\t\tconst { defaultEditorColors, defaultEditorGradients } = this.props;\n\n\t\tif ( rawStyles && rawFeatures ) {\n\t\t\treturn getGlobalStyles( rawStyles, rawFeatures );\n\t\t}\n\n\t\treturn getColorsAndGradients(\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\trawFeatures\n\t\t);\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( ! prevProps.isReady && this.props.isReady ) {\n\t\t\tconst blocks = this.props.blocks;\n\t\t\tconst isUnsupportedBlock = ( { name } ) =>\n\t\t\t\tname === getUnregisteredTypeHandlerName();\n\t\t\tconst unsupportedBlockNames = blocks\n\t\t\t\t.filter( isUnsupportedBlock )\n\t\t\t\t.map( ( block ) => block.attributes.originalName );\n\t\t\tRNReactNativeGutenbergBridge.editorDidMount(\n\t\t\t\tunsupportedBlockNames\n\t\t\t);\n\t\t}\n\t}\n\n\tserializeToNativeAction() {\n\t\tconst title = this.props.title;\n\t\tlet html;\n\n\t\tif ( this.props.mode === 'text' ) {\n\t\t\t// The HTMLTextInput component does not update the store when user is doing changes\n\t\t\t// Let's request the HTML from the component's state directly.\n\t\t\thtml = applyFilters( 'native.persist-html' );\n\t\t} else {\n\t\t\thtml = serialize( this.props.blocks );\n\t\t}\n\n\t\tconst hasChanges =\n\t\t\ttitle !== this.post.title.raw || html !== this.post.content.raw;\n\n\t\t// Variable to store the content structure metrics.\n\t\tconst contentInfo = {};\n\t\tcontentInfo.characterCount = wordCount(\n\t\t\thtml,\n\t\t\t'characters_including_spaces'\n\t\t);\n\t\tcontentInfo.wordCount = wordCount( html, 'words' );\n\t\tcontentInfo.paragraphCount = this.props.paragraphCount;\n\t\tcontentInfo.blockCount = this.props.blockCount;\n\t\tRNReactNativeGutenbergBridge.provideToNative_Html(\n\t\t\thtml,\n\t\t\ttitle,\n\t\t\thasChanges,\n\t\t\tcontentInfo\n\t\t);\n\n\t\tif ( hasChanges ) {\n\t\t\tthis.post.title.raw = title;\n\t\t\tthis.post.content.raw = html;\n\t\t}\n\t}\n\n\tupdateHtmlAction( html ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.resetEditorBlocksWithoutUndoLevel( parsed );\n\t}\n\n\treplaceBlockAction( html, blockClientId ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.replaceBlock( blockClientId, parsed );\n\t}\n\n\ttoggleMode() {\n\t\tconst { mode, switchMode } = this.props;\n\t\t// Refresh html content first.\n\t\tthis.serializeToNativeAction();\n\t\tswitchMode( mode === 'visual' ? 'text' : 'visual' );\n\t}\n\n\tupdateCapabilitiesAction( capabilities ) {\n\t\tthis.props.updateEditorSettings( { capabilities } );\n\t}\n\n\trender() {\n\t\tconst { children, post, capabilities, settings, ...props } = this.props;\n\t\tconst editorSettings = this.getEditorSettings( settings, capabilities );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ this.post }\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t<SafeAreaProvider>{ children }</SafeAreaProvider>\n\t\t\t\t</EditorProvider>\n\t\t\t\t<EditorHelpTopics\n\t\t\t\t\tisVisible={ this.state.isHelpVisible }\n\t\t\t\t\tonClose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tclose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tshowSupport={ capabilities?.supportSection === true }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nconst ComposedNativeProvider = compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\t__unstableIsEditorReady: isEditorReady,\n\t\t\tgetEditorBlocks,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostContent,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\t\tconst { getEditorMode } = select( editPostStore );\n\n\t\tconst { getBlockIndex, getSelectedBlockClientId, getGlobalBlockCount } =\n\t\t\tselect( blockEditorStore );\n\n\t\tconst settings = getEditorSettings();\n\t\tconst defaultEditorColors = settings?.colors ?? [];\n\t\tconst defaultEditorGradients = settings?.gradients ?? [];\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t\tisReady: isEditorReady(),\n\t\t\tblocks: getEditorBlocks(),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tgetEditedPostContent,\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\tselectedBlockIndex: getBlockIndex( selectedBlockClientId ),\n\t\t\tblockCount: getGlobalBlockCount(),\n\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, resetEditorBlocks, updateEditorSettings } =\n\t\t\tdispatch( editorStore );\n\t\tconst { updateSettings, insertBlock, replaceBlock } =\n\t\t\tdispatch( blockEditorStore );\n\t\tconst { switchEditorMode } = dispatch( editPostStore );\n\t\tconst { addEntities, receiveEntityRecords } = dispatch( coreStore );\n\t\tconst { createSuccessNotice } = dispatch( noticesStore );\n\n\t\treturn {\n\t\t\tupdateBlockEditorSettings: updateSettings,\n\t\t\tupdateEditorSettings,\n\t\t\taddEntities,\n\t\t\tinsertBlock,\n\t\t\tcreateSuccessNotice,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\treceiveEntityRecords,\n\t\t\tresetEditorBlocksWithoutUndoLevel( blocks ) {\n\t\t\t\tresetEditorBlocks( blocks, {\n\t\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tswitchMode( mode ) {\n\t\t\t\tswitchEditorMode( mode );\n\t\t\t},\n\t\t\treplaceBlock,\n\t\t};\n\t} ),\n] )( NativeEditorProvider );\n\nexport default ComposedNativeProvider;\nexport { ComposedNativeProvider as ExperimentalEditorProvider };\n"]}
|
|
@@ -20,7 +20,8 @@ const withRegistryProvider = createHigherOrderComponent(WrappedComponent => with
|
|
|
20
20
|
} = props;
|
|
21
21
|
|
|
22
22
|
if (!useSubRegistry) {
|
|
23
|
-
return createElement(WrappedComponent, additionalProps
|
|
23
|
+
return createElement(WrappedComponent, { ...additionalProps
|
|
24
|
+
});
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
const [subRegistry, setSubRegistry] = useState(null);
|
|
@@ -38,7 +39,8 @@ const withRegistryProvider = createHigherOrderComponent(WrappedComponent => with
|
|
|
38
39
|
|
|
39
40
|
return createElement(RegistryProvider, {
|
|
40
41
|
value: subRegistry
|
|
41
|
-
}, createElement(WrappedComponent, additionalProps
|
|
42
|
+
}, createElement(WrappedComponent, { ...additionalProps
|
|
43
|
+
}));
|
|
42
44
|
}), 'withRegistryProvider');
|
|
43
45
|
export default withRegistryProvider;
|
|
44
46
|
//# sourceMappingURL=with-registry-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/provider/with-registry-provider.js"],"names":["useState","useEffect","withRegistry","createRegistry","RegistryProvider","createHigherOrderComponent","storeConfig","blockEditorStoreConfig","withRegistryProvider","WrappedComponent","props","useSubRegistry","registry","additionalProps","subRegistry","setSubRegistry","newRegistry","registerStore"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,SAAnB,QAAoC,oBAApC;AACA,SACCC,YADD,EAECC,cAFD,EAGCC,gBAHD,QAIO,iBAJP;AAKA,SAASC,0BAAT,QAA2C,oBAA3C;AACA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,SAASD,WAAT,QAA4B,aAA5B;AAEA,MAAME,oBAAoB,GAAGH,0BAA0B,CACpDI,gBAAF,IACCP,YAAY,CAAIQ,KAAF,IAAa;AAC1B,QAAM;AACLC,IAAAA,cAAc,GAAG,IADZ;AAELC,IAAAA,QAFK;AAGL,OAAGC;AAHE,MAIFH,KAJJ;;AAKA,MAAK,CAAEC,cAAP,EAAwB;AACvB,WAAO,cAAC,gBAAD,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/provider/with-registry-provider.js"],"names":["useState","useEffect","withRegistry","createRegistry","RegistryProvider","createHigherOrderComponent","storeConfig","blockEditorStoreConfig","withRegistryProvider","WrappedComponent","props","useSubRegistry","registry","additionalProps","subRegistry","setSubRegistry","newRegistry","registerStore"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,SAAnB,QAAoC,oBAApC;AACA,SACCC,YADD,EAECC,cAFD,EAGCC,gBAHD,QAIO,iBAJP;AAKA,SAASC,0BAAT,QAA2C,oBAA3C;AACA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,SAASD,WAAT,QAA4B,aAA5B;AAEA,MAAME,oBAAoB,GAAGH,0BAA0B,CACpDI,gBAAF,IACCP,YAAY,CAAIQ,KAAF,IAAa;AAC1B,QAAM;AACLC,IAAAA,cAAc,GAAG,IADZ;AAELC,IAAAA,QAFK;AAGL,OAAGC;AAHE,MAIFH,KAJJ;;AAKA,MAAK,CAAEC,cAAP,EAAwB;AACvB,WAAO,cAAC,gBAAD,OAAuBE;AAAvB,MAAP;AACA;;AAED,QAAM,CAAEC,WAAF,EAAeC,cAAf,IAAkCf,QAAQ,CAAE,IAAF,CAAhD;AACAC,EAAAA,SAAS,CAAE,MAAM;AAChB,UAAMe,WAAW,GAAGb,cAAc,CACjC;AACC,2BAAqBI;AADtB,KADiC,EAIjCK,QAJiC,CAAlC;AAMAI,IAAAA,WAAW,CAACC,aAAZ,CAA2B,aAA3B,EAA0CX,WAA1C;AACAS,IAAAA,cAAc,CAAEC,WAAF,CAAd;AACA,GATQ,EASN,CAAEJ,QAAF,CATM,CAAT;;AAWA,MAAK,CAAEE,WAAP,EAAqB;AACpB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,gBAAD;AAAkB,IAAA,KAAK,EAAGA;AAA1B,KACC,cAAC,gBAAD,OAAuBD;AAAvB,IADD,CADD;AAKA,CA/BW,CAFyC,EAkCtD,sBAlCsD,CAAvD;AAqCA,eAAeL,oBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\nimport {\n\twithRegistry,\n\tcreateRegistry,\n\tRegistryProvider,\n} from '@wordpress/data';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { storeConfig as blockEditorStoreConfig } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { storeConfig } from '../../store';\n\nconst withRegistryProvider = createHigherOrderComponent(\n\t( WrappedComponent ) =>\n\t\twithRegistry( ( props ) => {\n\t\t\tconst {\n\t\t\t\tuseSubRegistry = true,\n\t\t\t\tregistry,\n\t\t\t\t...additionalProps\n\t\t\t} = props;\n\t\t\tif ( ! useSubRegistry ) {\n\t\t\t\treturn <WrappedComponent { ...additionalProps } />;\n\t\t\t}\n\n\t\t\tconst [ subRegistry, setSubRegistry ] = useState( null );\n\t\t\tuseEffect( () => {\n\t\t\t\tconst newRegistry = createRegistry(\n\t\t\t\t\t{\n\t\t\t\t\t\t'core/block-editor': blockEditorStoreConfig,\n\t\t\t\t\t},\n\t\t\t\t\tregistry\n\t\t\t\t);\n\t\t\t\tnewRegistry.registerStore( 'core/editor', storeConfig );\n\t\t\t\tsetSubRegistry( newRegistry );\n\t\t\t}, [ registry ] );\n\n\t\t\tif ( ! subRegistry ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<RegistryProvider value={ subRegistry }>\n\t\t\t\t\t<WrappedComponent { ...additionalProps } />\n\t\t\t\t</RegistryProvider>\n\t\t\t);\n\t\t} ),\n\t'withRegistryProvider'\n);\n\nexport default withRegistryProvider;\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import { createElement } from "@wordpress/element";
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -31,7 +30,7 @@ function TableOfContents({
|
|
|
31
30
|
renderToggle: ({
|
|
32
31
|
isOpen,
|
|
33
32
|
onToggle
|
|
34
|
-
}) => createElement(Button,
|
|
33
|
+
}) => createElement(Button, { ...props,
|
|
35
34
|
ref: ref,
|
|
36
35
|
onClick: hasBlocks ? onToggle : undefined,
|
|
37
36
|
icon: info,
|
|
@@ -42,7 +41,7 @@ function TableOfContents({
|
|
|
42
41
|
label: __('Details'),
|
|
43
42
|
tooltipPosition: "bottom",
|
|
44
43
|
"aria-disabled": !hasBlocks
|
|
45
|
-
})
|
|
44
|
+
}),
|
|
46
45
|
renderContent: ({
|
|
47
46
|
onClose
|
|
48
47
|
}) => createElement(TableOfContentsPanel, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/table-of-contents/index.js"],"names":["__","Dropdown","Button","useSelect","info","forwardRef","store","blockEditorStore","TableOfContentsPanel","TableOfContents","hasOutlineItemsDisabled","repositionDropdown","props","ref","hasBlocks","select","getBlockCount","placement","isOpen","onToggle","undefined","onClose"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/table-of-contents/index.js"],"names":["__","Dropdown","Button","useSelect","info","forwardRef","store","blockEditorStore","TableOfContentsPanel","TableOfContents","hasOutlineItemsDisabled","repositionDropdown","props","ref","hasBlocks","select","getBlockCount","placement","isOpen","onToggle","undefined","onClose"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,uBAAjC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,IAAT,QAAqB,kBAArB;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;AAEA;AACA;AACA;;AACA,OAAOC,oBAAP,MAAiC,SAAjC;;AAEA,SAASC,eAAT,CACC;AAAEC,EAAAA,uBAAF;AAA2BC,EAAAA,kBAA3B;AAA+C,KAAGC;AAAlD,CADD,EAECC,GAFD,EAGE;AACD,QAAMC,SAAS,GAAGX,SAAS,CACxBY,MAAF,IAAc,CAAC,CAAEA,MAAM,CAAER,gBAAF,CAAN,CAA2BS,aAA3B,EADS,EAE1B,EAF0B,CAA3B;AAIA,SACC,cAAC,QAAD;AACC,IAAA,YAAY,EAAG;AACdC,MAAAA,SAAS,EAAEN,kBAAkB,GAAG,OAAH,GAAa;AAD5B,KADhB;AAIC,IAAA,SAAS,EAAC,mBAJX;AAKC,IAAA,gBAAgB,EAAC,4BALlB;AAMC,IAAA,YAAY,EAAG,CAAE;AAAEO,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAF,KACd,cAAC,MAAD,OACMP,KADN;AAEC,MAAA,GAAG,EAAGC,GAFP;AAGC,MAAA,OAAO,EAAGC,SAAS,GAAGK,QAAH,GAAcC,SAHlC;AAIC,MAAA,IAAI,EAAGhB,IAJR;AAKC,uBAAgBc,MALjB;AAMC,uBAAc;AACd;AAPD;AAQC,MAAA,KAAK,EAAGlB,EAAE,CAAE,SAAF,CARX;AASC,MAAA,eAAe,EAAC,QATjB;AAUC,uBAAgB,CAAEc;AAVnB,MAPF;AAoBC,IAAA,aAAa,EAAG,CAAE;AAAEO,MAAAA;AAAF,KAAF,KACf,cAAC,oBAAD;AACC,MAAA,cAAc,EAAGA,OADlB;AAEC,MAAA,uBAAuB,EAAGX;AAF3B;AArBF,IADD;AA6BA;;AAED,eAAeL,UAAU,CAAEI,eAAF,CAAzB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { info } from '@wordpress/icons';\nimport { forwardRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsPanel from './panel';\n\nfunction TableOfContents(\n\t{ hasOutlineItemsDisabled, repositionDropdown, ...props },\n\tref\n) {\n\tconst hasBlocks = useSelect(\n\t\t( select ) => !! select( blockEditorStore ).getBlockCount(),\n\t\t[]\n\t);\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ {\n\t\t\t\tplacement: repositionDropdown ? 'right' : 'bottom',\n\t\t\t} }\n\t\t\tclassName=\"table-of-contents\"\n\t\t\tcontentClassName=\"table-of-contents__popover\"\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tonClick={ hasBlocks ? onToggle : undefined }\n\t\t\t\t\ticon={ info }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\tlabel={ __( 'Details' ) }\n\t\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t\t\taria-disabled={ ! hasBlocks }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<TableOfContentsPanel\n\t\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t\thasOutlineItemsDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t/>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( TableOfContents );\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import { createElement } from "@wordpress/element";
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -49,7 +48,7 @@ const createWithMetaAttributeSource = metaAttributes => createHigherOrderCompone
|
|
|
49
48
|
const mergedAttributes = useMemo(() => ({ ...attributes,
|
|
50
49
|
...Object.fromEntries(Object.entries(metaAttributes).map(([attributeKey, metaKey]) => [attributeKey, meta[metaKey]]))
|
|
51
50
|
}), [attributes, meta]);
|
|
52
|
-
return createElement(BlockEdit,
|
|
51
|
+
return createElement(BlockEdit, {
|
|
53
52
|
attributes: mergedAttributes,
|
|
54
53
|
setAttributes: nextAttributes => {
|
|
55
54
|
const nextMeta = Object.fromEntries(Object.entries(nextAttributes !== null && nextAttributes !== void 0 ? nextAttributes : {}).filter( // Filter to intersection of keys between the updated
|
|
@@ -62,8 +61,9 @@ const createWithMetaAttributeSource = metaAttributes => createHigherOrderCompone
|
|
|
62
61
|
}
|
|
63
62
|
|
|
64
63
|
setAttributes(nextAttributes);
|
|
65
|
-
}
|
|
66
|
-
|
|
64
|
+
},
|
|
65
|
+
...props
|
|
66
|
+
});
|
|
67
67
|
}, 'withMetaAttributeSource');
|
|
68
68
|
/**
|
|
69
69
|
* Filters a registered block's settings to enhance a block's `edit` component
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/hooks/custom-sources-backwards-compatibility.js"],"names":["store","blocksStore","select","globalSelect","useSelect","useEntityProp","useMemo","createHigherOrderComponent","addFilter","editorStore","createWithMetaAttributeSource","metaAttributes","BlockEdit","attributes","setAttributes","props","postType","getCurrentPostType","meta","setMeta","mergedAttributes","Object","fromEntries","entries","map","attributeKey","metaKey","nextAttributes","nextMeta","filter","key","value","length","shimAttributeSource","settings","source","edit","getBlockTypes","name","getBlockType","forEach"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/hooks/custom-sources-backwards-compatibility.js"],"names":["store","blocksStore","select","globalSelect","useSelect","useEntityProp","useMemo","createHigherOrderComponent","addFilter","editorStore","createWithMetaAttributeSource","metaAttributes","BlockEdit","attributes","setAttributes","props","postType","getCurrentPostType","meta","setMeta","mergedAttributes","Object","fromEntries","entries","map","attributeKey","metaKey","nextAttributes","nextMeta","filter","key","value","length","shimAttributeSource","settings","source","edit","getBlockTypes","name","getBlockType","forEach"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASC,MAAM,IAAIC,YAAnB,EAAiCC,SAAjC,QAAkD,iBAAlD;AACA,SAASC,aAAT,QAA8B,sBAA9B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,0BAAT,QAA2C,oBAA3C;AACA,SAASC,SAAT,QAA0B,kBAA1B;AAEA;AACA;AACA;;AACA,SAASR,KAAK,IAAIS,WAAlB,QAAqC,UAArC;AAEA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,6BAA6B,GAAKC,cAAF,IACrCJ,0BAA0B,CACvBK,SAAF,IACC,CAAE;AAAEC,EAAAA,UAAF;AAAcC,EAAAA,aAAd;AAA6B,KAAGC;AAAhC,CAAF,KAA+C;AAC9C,QAAMC,QAAQ,GAAGZ,SAAS,CACvBF,MAAF,IAAcA,MAAM,CAAEO,WAAF,CAAN,CAAsBQ,kBAAtB,EADW,EAEzB,EAFyB,CAA1B;AAIA,QAAM,CAAEC,IAAF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CAACC,WAAP,CACtBD,MAAM,CAACE,OAAP,yBAAgBW,QAAQ,CAACrB,UAAzB,uEAAuC,EAAvC,EACEgB,MADF,CACU,CAAE,GAAI;AAAEM,IAAAA;AAAF,GAAJ,CAAF,KAAwBA,MAAM,KAAK,MAD7C,EAEEX,GAFF,CAEO,CAAE,CAAEC,YAAF,EAAgB;AAAEP,IAAAA;AAAF,GAAhB,CAAF,KAAkC,CAAEO,YAAF,EAAgBP,IAAhB,CAFzC,CADsB,CAAvB;;AAKA,MAAKG,MAAM,CAACE,OAAP,CAAgBZ,cAAhB,EAAiCqB,MAAtC,EAA+C;AAC9CE,IAAAA,QAAQ,CAACE,IAAT,GAAgB1B,6BAA6B,CAAEC,cAAF,CAA7B,CACfuB,QAAQ,CAACE,IADM,CAAhB;AAGA;;AAED,SAAOF,QAAP;AACA;;AAED1B,SAAS,CACR,0BADQ,EAER,0EAFQ,EAGRyB,mBAHQ,CAAT,C,CAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA9B,YAAY,CAAEF,WAAF,CAAZ,CACEoC,aADF,GAEEb,GAFF,CAEO,CAAE;AAAEc,EAAAA;AAAF,CAAF,KAAgBnC,YAAY,CAAEF,WAAF,CAAZ,CAA4BsC,YAA5B,CAA0CD,IAA1C,CAFvB,EAGEE,OAHF,CAGWP,mBAHX","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { select as globalSelect, useSelect } from '@wordpress/data';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\n\n/** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */\n/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */\n\n/**\n * Object whose keys are the names of block attributes, where each value\n * represents the meta key to which the block attribute is intended to save.\n *\n * @see https://developer.wordpress.org/reference/functions/register_meta/\n *\n * @typedef {Object<string,string>} WPMetaAttributeMapping\n */\n\n/**\n * Given a mapping of attribute names (meta source attributes) to their\n * associated meta key, returns a higher order component that overrides its\n * `attributes` and `setAttributes` props to sync any changes with the edited\n * post's meta keys.\n *\n * @param {WPMetaAttributeMapping} metaAttributes Meta attribute mapping.\n *\n * @return {WPHigherOrderComponent} Higher-order component.\n */\nconst createWithMetaAttributeSource = ( metaAttributes ) =>\n\tcreateHigherOrderComponent(\n\t\t( BlockEdit ) =>\n\t\t\t( { attributes, setAttributes, ...props } ) => {\n\t\t\t\tconst postType = useSelect(\n\t\t\t\t\t( select ) => select( editorStore ).getCurrentPostType(),\n\t\t\t\t\t[]\n\t\t\t\t);\n\t\t\t\tconst [ meta, setMeta ] = useEntityProp(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\t'meta'\n\t\t\t\t);\n\n\t\t\t\tconst mergedAttributes = useMemo(\n\t\t\t\t\t() => ( {\n\t\t\t\t\t\t...attributes,\n\t\t\t\t\t\t...Object.fromEntries(\n\t\t\t\t\t\t\tObject.entries( metaAttributes ).map(\n\t\t\t\t\t\t\t\t( [ attributeKey, metaKey ] ) => [\n\t\t\t\t\t\t\t\t\tattributeKey,\n\t\t\t\t\t\t\t\t\tmeta[ metaKey ],\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t} ),\n\t\t\t\t\t[ attributes, meta ]\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<BlockEdit\n\t\t\t\t\t\tattributes={ mergedAttributes }\n\t\t\t\t\t\tsetAttributes={ ( nextAttributes ) => {\n\t\t\t\t\t\t\tconst nextMeta = Object.fromEntries(\n\t\t\t\t\t\t\t\tObject.entries( nextAttributes ?? {} )\n\t\t\t\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t\t\t\t// Filter to intersection of keys between the updated\n\t\t\t\t\t\t\t\t\t\t// attributes and those with an associated meta key.\n\t\t\t\t\t\t\t\t\t\t( [ key ] ) => key in metaAttributes\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t.map( ( [ attributeKey, value ] ) => [\n\t\t\t\t\t\t\t\t\t\t// Rename the keys to the expected meta key name.\n\t\t\t\t\t\t\t\t\t\tmetaAttributes[ attributeKey ],\n\t\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\t] )\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( Object.entries( nextMeta ).length ) {\n\t\t\t\t\t\t\t\tsetMeta( nextMeta );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsetAttributes( nextAttributes );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t},\n\t\t'withMetaAttributeSource'\n\t);\n\n/**\n * Filters a registered block's settings to enhance a block's `edit` component\n * to upgrade meta-sourced attributes to use the post's meta entity property.\n *\n * @param {WPBlockSettings} settings Registered block settings.\n *\n * @return {WPBlockSettings} Filtered block settings.\n */\nfunction shimAttributeSource( settings ) {\n\t/** @type {WPMetaAttributeMapping} */\n\tconst metaAttributes = Object.fromEntries(\n\t\tObject.entries( settings.attributes ?? {} )\n\t\t\t.filter( ( [ , { source } ] ) => source === 'meta' )\n\t\t\t.map( ( [ attributeKey, { meta } ] ) => [ attributeKey, meta ] )\n\t);\n\tif ( Object.entries( metaAttributes ).length ) {\n\t\tsettings.edit = createWithMetaAttributeSource( metaAttributes )(\n\t\t\tsettings.edit\n\t\t);\n\t}\n\n\treturn settings;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/custom-sources-backwards-compatibility/shim-attribute-source',\n\tshimAttributeSource\n);\n\n// The above filter will only capture blocks registered after the filter was\n// added. There may already be blocks registered by this point, and those must\n// be updated to apply the shim.\n//\n// The following implementation achieves this, albeit with a couple caveats:\n// - Only blocks registered on the global store will be modified.\n// - The block settings are directly mutated, since there is currently no\n// mechanism to update an existing block registration. This is the reason for\n// `getBlockType` separate from `getBlockTypes`, since the latter returns a\n// _copy_ of the block registration (i.e. the mutation would not affect the\n// actual registered block settings).\n//\n// `getBlockTypes` or `getBlockType` implementation could change in the future\n// in regards to creating settings clones, but the corresponding end-to-end\n// tests for meta blocks should cover against any potential regressions.\n//\n// In the future, we could support updating block settings, at which point this\n// implementation could use that mechanism instead.\nglobalSelect( blocksStore )\n\t.getBlockTypes()\n\t.map( ( { name } ) => globalSelect( blocksStore ).getBlockType( name ) )\n\t.forEach( shimAttributeSource );\n"]}
|
|
@@ -6,4 +6,4 @@ export const {
|
|
|
6
6
|
lock,
|
|
7
7
|
unlock
|
|
8
8
|
} = __dangerousOptInToUnstableAPIsOnlyForCoreModules('I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.', '@wordpress/editor');
|
|
9
|
-
//# sourceMappingURL=
|
|
9
|
+
//# sourceMappingURL=lock-unlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/lock-unlock.js"],"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAT,QAAiE,yBAAjE;AACA,OAAO,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IACZF,gDAAgD,CAC/C,8GAD+C,EAE/C,mBAF+C,CAD1C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',\n\t\t'@wordpress/editor'\n\t);\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { ExperimentalEditorProvider } from './components/provider';
|
|
5
|
-
import { lock } from './
|
|
5
|
+
import { lock } from './lock-unlock';
|
|
6
6
|
import { EntitiesSavedStatesExtensible } from './components/entities-saved-states';
|
|
7
7
|
export const privateApis = {};
|
|
8
8
|
lock(privateApis, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/private-apis.js"],"names":["ExperimentalEditorProvider","lock","EntitiesSavedStatesExtensible","privateApis"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,0BAAT,QAA2C,uBAA3C;AACA,SAASC,IAAT,QAAqB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/private-apis.js"],"names":["ExperimentalEditorProvider","lock","EntitiesSavedStatesExtensible","privateApis"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,0BAAT,QAA2C,uBAA3C;AACA,SAASC,IAAT,QAAqB,eAArB;AACA,SAASC,6BAAT,QAA8C,oCAA9C;AAEA,OAAO,MAAMC,WAAW,GAAG,EAApB;AACPF,IAAI,CAAEE,WAAF,EAAe;AAClBH,EAAAA,0BADkB;AAElBE,EAAAA;AAFkB,CAAf,CAAJ","sourcesContent":["/**\n * Internal dependencies\n */\nimport { ExperimentalEditorProvider } from './components/provider';\nimport { lock } from './lock-unlock';\nimport { EntitiesSavedStatesExtensible } from './components/entities-saved-states';\n\nexport const privateApis = {};\nlock( privateApis, {\n\tExperimentalEditorProvider,\n\tEntitiesSavedStatesExtensible,\n} );\n"]}
|
|
@@ -418,7 +418,7 @@
|
|
|
418
418
|
.editor-post-publish-panel__content {
|
|
419
419
|
min-height: calc(100% - 144px);
|
|
420
420
|
}
|
|
421
|
-
.editor-post-publish-panel__content .components-spinner {
|
|
421
|
+
.editor-post-publish-panel__content > .components-spinner {
|
|
422
422
|
display: block;
|
|
423
423
|
margin: 100px auto 0;
|
|
424
424
|
}
|
|
@@ -627,6 +627,20 @@
|
|
|
627
627
|
margin-left: 0;
|
|
628
628
|
}
|
|
629
629
|
|
|
630
|
+
.edit-post-sync-status {
|
|
631
|
+
width: 100%;
|
|
632
|
+
position: relative;
|
|
633
|
+
justify-content: flex-start;
|
|
634
|
+
}
|
|
635
|
+
.edit-post-sync-status > span {
|
|
636
|
+
display: block;
|
|
637
|
+
width: 45%;
|
|
638
|
+
flex-shrink: 0;
|
|
639
|
+
}
|
|
640
|
+
.edit-post-sync-status .components-base-control {
|
|
641
|
+
padding-right: 6px;
|
|
642
|
+
}
|
|
643
|
+
|
|
630
644
|
.editor-post-taxonomies__hierarchical-terms-list {
|
|
631
645
|
max-height: 14em;
|
|
632
646
|
overflow: auto;
|
package/build-style/style.css
CHANGED
|
@@ -418,7 +418,7 @@
|
|
|
418
418
|
.editor-post-publish-panel__content {
|
|
419
419
|
min-height: calc(100% - 144px);
|
|
420
420
|
}
|
|
421
|
-
.editor-post-publish-panel__content .components-spinner {
|
|
421
|
+
.editor-post-publish-panel__content > .components-spinner {
|
|
422
422
|
display: block;
|
|
423
423
|
margin: 100px auto 0;
|
|
424
424
|
}
|
|
@@ -627,6 +627,20 @@
|
|
|
627
627
|
margin-right: 0;
|
|
628
628
|
}
|
|
629
629
|
|
|
630
|
+
.edit-post-sync-status {
|
|
631
|
+
width: 100%;
|
|
632
|
+
position: relative;
|
|
633
|
+
justify-content: flex-start;
|
|
634
|
+
}
|
|
635
|
+
.edit-post-sync-status > span {
|
|
636
|
+
display: block;
|
|
637
|
+
width: 45%;
|
|
638
|
+
flex-shrink: 0;
|
|
639
|
+
}
|
|
640
|
+
.edit-post-sync-status .components-base-control {
|
|
641
|
+
padding-left: 6px;
|
|
642
|
+
}
|
|
643
|
+
|
|
630
644
|
.editor-post-taxonomies__hierarchical-terms-list {
|
|
631
645
|
max-height: 14em;
|
|
632
646
|
overflow: auto;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "13.12.
|
|
3
|
+
"version": "13.12.1",
|
|
4
4
|
"description": "Enhanced block editor for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -31,37 +31,36 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@wordpress/a11y": "^3.35.
|
|
35
|
-
"@wordpress/api-fetch": "^6.32.
|
|
36
|
-
"@wordpress/blob": "^3.35.
|
|
37
|
-
"@wordpress/block-editor": "^12.3.
|
|
38
|
-
"@wordpress/blocks": "^12.12.
|
|
39
|
-
"@wordpress/components": "^25.1.
|
|
40
|
-
"@wordpress/compose": "^6.12.
|
|
41
|
-
"@wordpress/core-data": "^6.12.
|
|
42
|
-
"@wordpress/data": "^9.5.
|
|
43
|
-
"@wordpress/date": "^4.35.
|
|
44
|
-
"@wordpress/deprecated": "^3.35.
|
|
45
|
-
"@wordpress/dom": "^3.35.
|
|
46
|
-
"@wordpress/element": "^5.12.
|
|
47
|
-
"@wordpress/hooks": "^3.35.
|
|
48
|
-
"@wordpress/html-entities": "^3.35.
|
|
49
|
-
"@wordpress/i18n": "^4.35.
|
|
50
|
-
"@wordpress/icons": "^9.26.
|
|
51
|
-
"@wordpress/keyboard-shortcuts": "^4.12.
|
|
52
|
-
"@wordpress/keycodes": "^3.35.
|
|
53
|
-
"@wordpress/media-utils": "^4.26.
|
|
54
|
-
"@wordpress/notices": "^4.3.
|
|
55
|
-
"@wordpress/preferences": "^3.12.
|
|
56
|
-
"@wordpress/private-apis": "^0.17.
|
|
57
|
-
"@wordpress/reusable-blocks": "^4.12.
|
|
58
|
-
"@wordpress/rich-text": "^6.12.
|
|
59
|
-
"@wordpress/server-side-render": "^4.12.
|
|
60
|
-
"@wordpress/url": "^3.36.
|
|
61
|
-
"@wordpress/wordcount": "^3.35.
|
|
34
|
+
"@wordpress/a11y": "^3.35.1",
|
|
35
|
+
"@wordpress/api-fetch": "^6.32.1",
|
|
36
|
+
"@wordpress/blob": "^3.35.1",
|
|
37
|
+
"@wordpress/block-editor": "^12.3.1",
|
|
38
|
+
"@wordpress/blocks": "^12.12.1",
|
|
39
|
+
"@wordpress/components": "^25.1.1",
|
|
40
|
+
"@wordpress/compose": "^6.12.1",
|
|
41
|
+
"@wordpress/core-data": "^6.12.1",
|
|
42
|
+
"@wordpress/data": "^9.5.1",
|
|
43
|
+
"@wordpress/date": "^4.35.1",
|
|
44
|
+
"@wordpress/deprecated": "^3.35.1",
|
|
45
|
+
"@wordpress/dom": "^3.35.1",
|
|
46
|
+
"@wordpress/element": "^5.12.1",
|
|
47
|
+
"@wordpress/hooks": "^3.35.1",
|
|
48
|
+
"@wordpress/html-entities": "^3.35.1",
|
|
49
|
+
"@wordpress/i18n": "^4.35.1",
|
|
50
|
+
"@wordpress/icons": "^9.26.1",
|
|
51
|
+
"@wordpress/keyboard-shortcuts": "^4.12.1",
|
|
52
|
+
"@wordpress/keycodes": "^3.35.1",
|
|
53
|
+
"@wordpress/media-utils": "^4.26.1",
|
|
54
|
+
"@wordpress/notices": "^4.3.1",
|
|
55
|
+
"@wordpress/preferences": "^3.12.1",
|
|
56
|
+
"@wordpress/private-apis": "^0.17.1",
|
|
57
|
+
"@wordpress/reusable-blocks": "^4.12.1",
|
|
58
|
+
"@wordpress/rich-text": "^6.12.1",
|
|
59
|
+
"@wordpress/server-side-render": "^4.12.1",
|
|
60
|
+
"@wordpress/url": "^3.36.1",
|
|
61
|
+
"@wordpress/wordcount": "^3.35.1",
|
|
62
62
|
"classnames": "^2.3.1",
|
|
63
63
|
"date-fns": "^2.28.0",
|
|
64
|
-
"escape-html": "^1.0.3",
|
|
65
64
|
"memize": "^2.1.0",
|
|
66
65
|
"react-autosize-textarea": "^7.1.0",
|
|
67
66
|
"rememo": "^4.0.2",
|
|
@@ -74,5 +73,5 @@
|
|
|
74
73
|
"publishConfig": {
|
|
75
74
|
"access": "public"
|
|
76
75
|
},
|
|
77
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "ce5639111c30763dbdf07f40eeb136ea6030ecf1"
|
|
78
77
|
}
|
|
@@ -35,10 +35,11 @@ it( 'navigates back from help topic detail screen', async () => {
|
|
|
35
35
|
const backButton = screen.getAllByLabelText( 'Go back' );
|
|
36
36
|
fireEvent.press( backButton[ backButton.length - 1 ] );
|
|
37
37
|
|
|
38
|
-
// Currently logs `act` warning due to https://github.com/callstack/react-native-testing-library/issues/379
|
|
39
38
|
const text =
|
|
40
39
|
'Each block has its own settings. To find them, tap on a block. Its settings will appear on the toolbar at the bottom of the screen.';
|
|
41
|
-
await waitForElementToBeRemoved( () =>
|
|
40
|
+
await waitForElementToBeRemoved( () =>
|
|
41
|
+
screen.getByText( text, { hidden: true } )
|
|
42
|
+
);
|
|
42
43
|
|
|
43
44
|
expect( screen.queryByText( text ) ).toBeNull();
|
|
44
45
|
} );
|
|
@@ -13,6 +13,8 @@ const TRANSLATED_SITE_PROPERTIES = {
|
|
|
13
13
|
site_icon: __( 'Icon' ),
|
|
14
14
|
show_on_front: __( 'Show on front' ),
|
|
15
15
|
page_on_front: __( 'Page on front' ),
|
|
16
|
+
posts_per_page: __( 'Maximum posts per page' ),
|
|
17
|
+
default_comment_status: __( 'Allow comments on new posts' ),
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
export const useIsDirty = () => {
|
package/src/components/index.js
CHANGED
|
@@ -51,6 +51,7 @@ export { default as PostSlugCheck } from './post-slug/check';
|
|
|
51
51
|
export { default as PostSticky } from './post-sticky';
|
|
52
52
|
export { default as PostStickyCheck } from './post-sticky/check';
|
|
53
53
|
export { default as PostSwitchToDraftButton } from './post-switch-to-draft-button';
|
|
54
|
+
export { default as PostSyncStatus } from './post-sync-status';
|
|
54
55
|
export { default as PostTaxonomies } from './post-taxonomies';
|
|
55
56
|
export { FlatTermSelector as PostTaxonomiesFlatTermSelector } from './post-taxonomies/flat-term-selector';
|
|
56
57
|
export { HierarchicalTermSelector as PostTaxonomiesHierarchicalTermSelector } from './post-taxonomies/hierarchical-term-selector';
|