@wordpress/block-library 9.21.0 → 9.23.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/calendar/index.js +1 -0
- package/build/calendar/index.js.map +1 -1
- package/build/comments/edit/comments-inspector-controls.js +13 -13
- package/build/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build/comments/edit/index.js +4 -2
- package/build/comments/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +9 -12
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/index.js +1 -1
- package/build/cover/index.js.map +1 -1
- package/build/details/edit.js +1 -5
- package/build/details/edit.js.map +1 -1
- package/build/details/index.js +1 -1
- package/build/details/index.js.map +1 -1
- package/build/group/edit.js +17 -13
- package/build/group/edit.js.map +1 -1
- package/build/image/edit.js +0 -6
- package/build/image/edit.js.map +1 -1
- package/build/latest-posts/edit.js +100 -54
- package/build/latest-posts/edit.js.map +1 -1
- package/build/navigation/view.js +2 -1
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-link/edit.js +0 -21
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/index.js +0 -3
- package/build/navigation-link/index.js.map +1 -1
- package/build/navigation-link/transforms.js +0 -2
- package/build/navigation-link/transforms.js.map +1 -1
- package/build/navigation-link/update-attributes.js +0 -1
- package/build/navigation-link/update-attributes.js.map +1 -1
- package/build/navigation-submenu/edit.js +1 -24
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/navigation-submenu/index.js +0 -3
- package/build/navigation-submenu/index.js.map +1 -1
- package/build/post-comments-count/index.js +0 -1
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-link/index.js +0 -1
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-featured-image/edit.js +15 -5
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +47 -59
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/parent-control.js +2 -2
- package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js +2 -2
- package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build/query/edit/query-content.js +15 -29
- package/build/query/edit/query-content.js.map +1 -1
- package/build/quote/index.js +1 -1
- package/build/quote/index.js.map +1 -1
- package/build/separator/edit.js +13 -12
- package/build/separator/edit.js.map +1 -1
- package/build/social-links/edit.js +29 -31
- package/build/social-links/edit.js.map +1 -1
- package/build/table/index.js +3 -3
- package/build/table/index.js.map +1 -1
- package/build/table/transforms.js +11 -3
- package/build/table/transforms.js.map +1 -1
- package/build/table-of-contents/edit.js +1 -1
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/hooks.js +6 -3
- package/build/table-of-contents/hooks.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +14 -12
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/index.js +2 -1
- package/build/template-part/edit/index.js.map +1 -1
- package/build-module/calendar/index.js +1 -0
- package/build-module/calendar/index.js.map +1 -1
- package/build-module/comments/edit/comments-inspector-controls.js +14 -14
- package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build-module/comments/edit/index.js +4 -2
- package/build-module/comments/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +10 -13
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/index.js +1 -1
- package/build-module/cover/index.js.map +1 -1
- package/build-module/details/edit.js +1 -5
- package/build-module/details/edit.js.map +1 -1
- package/build-module/details/index.js +1 -1
- package/build-module/details/index.js.map +1 -1
- package/build-module/group/edit.js +16 -14
- package/build-module/group/edit.js.map +1 -1
- package/build-module/image/edit.js +0 -6
- package/build-module/image/edit.js.map +1 -1
- package/build-module/latest-posts/edit.js +100 -54
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/navigation/view.js +2 -1
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-link/edit.js +0 -21
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/index.js +0 -3
- package/build-module/navigation-link/index.js.map +1 -1
- package/build-module/navigation-link/transforms.js +0 -2
- package/build-module/navigation-link/transforms.js.map +1 -1
- package/build-module/navigation-link/update-attributes.js +0 -1
- package/build-module/navigation-link/update-attributes.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +1 -24
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/navigation-submenu/index.js +0 -3
- package/build-module/navigation-submenu/index.js.map +1 -1
- package/build-module/post-comments-count/index.js +0 -1
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-link/index.js +0 -1
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-featured-image/edit.js +15 -5
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +49 -61
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/parent-control.js +2 -2
- package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js +2 -2
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build-module/query/edit/query-content.js +16 -30
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/quote/index.js +1 -1
- package/build-module/quote/index.js.map +1 -1
- package/build-module/separator/edit.js +15 -14
- package/build-module/separator/edit.js.map +1 -1
- package/build-module/social-links/edit.js +30 -32
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/table/index.js +3 -3
- package/build-module/table/index.js.map +1 -1
- package/build-module/table/transforms.js +11 -3
- package/build-module/table/transforms.js.map +1 -1
- package/build-module/table-of-contents/edit.js +1 -1
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/hooks.js +6 -3
- package/build-module/table-of-contents/hooks.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +14 -12
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/index.js +2 -1
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-style/editor-rtl.css +1 -50
- package/build-style/editor.css +1 -50
- package/build-style/media-text/style-rtl.css +0 -2
- package/build-style/media-text/style.css +0 -2
- package/build-style/search/style-rtl.css +1 -0
- package/build-style/search/style.css +1 -0
- package/build-style/social-links/editor-rtl.css +1 -50
- package/build-style/social-links/editor.css +1 -50
- package/build-style/style-rtl.css +1 -6
- package/build-style/style.css +1 -6
- package/build-style/tag-cloud/style-rtl.css +0 -4
- package/build-style/tag-cloud/style.css +0 -4
- package/package.json +35 -35
- package/src/button/index.php +2 -3
- package/src/calendar/block.json +1 -0
- package/src/comments/edit/comments-inspector-controls.js +14 -12
- package/src/comments/edit/index.js +2 -1
- package/src/cover/edit/inspector-controls.js +9 -12
- package/src/cover/index.js +1 -1
- package/src/details/edit.js +6 -8
- package/src/details/index.js +1 -1
- package/src/file/index.php +2 -3
- package/src/group/edit.js +11 -10
- package/src/image/edit.js +0 -4
- package/src/latest-comments/index.php +1 -1
- package/src/latest-posts/edit.js +113 -81
- package/src/latest-posts/index.php +3 -0
- package/src/loginout/index.php +5 -1
- package/src/media-text/style.scss +0 -2
- package/src/navigation/index.php +1 -2
- package/src/navigation/view.js +2 -1
- package/src/navigation-link/block.json +0 -3
- package/src/navigation-link/edit.js +1 -22
- package/src/navigation-link/index.php +2 -6
- package/src/navigation-link/transforms.js +1 -2
- package/src/navigation-link/update-attributes.js +0 -1
- package/src/navigation-submenu/block.json +0 -3
- package/src/navigation-submenu/edit.js +1 -24
- package/src/navigation-submenu/index.php +1 -5
- package/src/post-author/index.php +1 -1
- package/src/post-author-name/index.php +1 -1
- package/src/post-comments-count/block.json +0 -1
- package/src/post-comments-count/index.php +4 -0
- package/src/post-comments-link/block.json +0 -1
- package/src/post-comments-link/index.php +4 -0
- package/src/post-featured-image/edit.js +94 -77
- package/src/query/edit/inspector-controls/index.js +66 -91
- package/src/query/edit/inspector-controls/parent-control.js +2 -2
- package/src/query/edit/inspector-controls/taxonomy-controls.js +2 -2
- package/src/query/edit/query-content.js +17 -27
- package/src/quote/index.js +1 -1
- package/src/search/index.php +12 -9
- package/src/search/style.scss +1 -0
- package/src/separator/edit.js +16 -12
- package/src/social-links/edit.js +29 -30
- package/src/social-links/editor.scss +1 -59
- package/src/table/index.js +3 -3
- package/src/table/transforms.js +14 -2
- package/src/table-of-contents/edit.js +1 -1
- package/src/table-of-contents/hooks.js +5 -2
- package/src/tag-cloud/style.scss +0 -5
- package/src/template-part/edit/advanced-controls.js +9 -8
- package/src/template-part/edit/index.js +1 -0
- package/build/utils/messages.js +0 -22
- package/build/utils/messages.js.map +0 -1
- package/build-module/utils/messages.js +0 -15
- package/build-module/utils/messages.js.map +0 -1
- package/src/utils/messages.js +0 -31
|
@@ -129,9 +129,12 @@ function observeCallback(select, dispatch, clientId) {
|
|
|
129
129
|
}
|
|
130
130
|
const headings = getLatestHeadings(select, clientId);
|
|
131
131
|
if (!fastDeepEqual(headings, attributes.headings)) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
// Executing the update in a microtask ensures that the non-persistent marker doesn't affect an attribute triggering the change.
|
|
133
|
+
window.queueMicrotask(() => {
|
|
134
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
135
|
+
updateBlockAttributes(clientId, {
|
|
136
|
+
headings
|
|
137
|
+
});
|
|
135
138
|
});
|
|
136
139
|
}
|
|
137
140
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["fastDeepEqual","useRegistry","__unstableStripHTML","stripHTML","useEffect","addQueryArgs","removeQueryArgs","store","blockEditorStore","getLatestHeadings","select","clientId","_select$getPermalink","_getBlockAttributes","getBlockAttributes","getBlockName","getBlocksByName","getClientIdsOfDescendants","permalink","getPermalink","isPaginated","length","onlyIncludeCurrentPage","maxLevel","postContentClientId","allBlockClientIds","tocPage","tocIndex","indexOf","blockIndex","blockClientId","entries","latestHeadings","headingPage","headingPageLink","page","blockName","headingAttributes","level","canBeLinked","anchor","push","content","replace","link","observeCallback","dispatch","updateBlockAttributes","__unstableMarkNextChangeAsNotPersistent","attributes","headings","useObserveHeadings","registry","subscribe"],"sources":["@wordpress/block-library/src/table-of-contents/hooks.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6';\n\n/**\n * WordPress dependencies\n */\nimport { useRegistry } from '@wordpress/data';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { useEffect } from '@wordpress/element';\nimport { addQueryArgs, removeQueryArgs } from '@wordpress/url';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction getLatestHeadings( select, clientId ) {\n\tconst {\n\t\tgetBlockAttributes,\n\t\tgetBlockName,\n\t\tgetBlocksByName,\n\t\tgetClientIdsOfDescendants,\n\t} = select( blockEditorStore );\n\n\t// FIXME: @wordpress/block-library should not depend on @wordpress/editor.\n\t// Blocks can be loaded into a *non-post* block editor, so to avoid\n\t// declaring @wordpress/editor as a dependency, we must access its\n\t// store by string. When the store is not available, editorSelectors\n\t// will be null, and the block's saved markup will lack permalinks.\n\t// eslint-disable-next-line @wordpress/data-no-store-string-literals\n\tconst permalink = select( 'core/editor' ).getPermalink() ?? null;\n\n\tconst isPaginated = getBlocksByName( 'core/nextpage' ).length !== 0;\n\tconst { onlyIncludeCurrentPage, maxLevel } =\n\t\tgetBlockAttributes( clientId ) ?? {};\n\n\t// Get post-content block client ID.\n\tconst [ postContentClientId = '' ] = getBlocksByName( 'core/post-content' );\n\n\t// Get the client ids of all blocks in the editor.\n\tconst allBlockClientIds = getClientIdsOfDescendants( postContentClientId );\n\n\t// If onlyIncludeCurrentPage is true, calculate the page (of a paginated post) this block is part of, so we know which headings to include; otherwise, skip the calculation.\n\tlet tocPage = 1;\n\n\tif ( isPaginated && onlyIncludeCurrentPage ) {\n\t\t// We can't use getBlockIndex because it only returns the index\n\t\t// relative to sibling blocks.\n\t\tconst tocIndex = allBlockClientIds.indexOf( clientId );\n\n\t\tfor ( const [\n\t\t\tblockIndex,\n\t\t\tblockClientId,\n\t\t] of allBlockClientIds.entries() ) {\n\t\t\t// If we've reached blocks after the Table of Contents, we've\n\t\t\t// finished calculating which page the block is on.\n\t\t\tif ( blockIndex >= tocIndex ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( getBlockName( blockClientId ) === 'core/nextpage' ) {\n\t\t\t\ttocPage++;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst latestHeadings = [];\n\n\t/** The page (of a paginated post) a heading will be part of. */\n\tlet headingPage = 1;\n\tlet headingPageLink = null;\n\n\t// If the core/editor store is available, we can add permalinks to the\n\t// generated table of contents.\n\tif ( typeof permalink === 'string' ) {\n\t\theadingPageLink = isPaginated\n\t\t\t? addQueryArgs( permalink, { page: headingPage } )\n\t\t\t: permalink;\n\t}\n\n\tfor ( const blockClientId of allBlockClientIds ) {\n\t\tconst blockName = getBlockName( blockClientId );\n\t\tif ( blockName === 'core/nextpage' ) {\n\t\t\theadingPage++;\n\n\t\t\t// If we're only including headings from the current page (of\n\t\t\t// a paginated post), then exit the loop if we've reached the\n\t\t\t// pages after the one with the Table of Contents block.\n\t\t\tif ( onlyIncludeCurrentPage && headingPage > tocPage ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( typeof permalink === 'string' ) {\n\t\t\t\theadingPageLink = addQueryArgs(\n\t\t\t\t\tremoveQueryArgs( permalink, [ 'page' ] ),\n\t\t\t\t\t{ page: headingPage }\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t// If we're including all headings or we've reached headings on\n\t\t// the same page as the Table of Contents block, add them to the\n\t\t// list.\n\t\telse if ( ! onlyIncludeCurrentPage || headingPage === tocPage ) {\n\t\t\tif ( blockName === 'core/heading' ) {\n\t\t\t\tconst headingAttributes = getBlockAttributes( blockClientId );\n\n\t\t\t\t// Skip headings that are deeper than maxLevel\n\t\t\t\tif ( maxLevel && headingAttributes.level > maxLevel ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst canBeLinked =\n\t\t\t\t\ttypeof headingPageLink === 'string' &&\n\t\t\t\t\ttypeof headingAttributes.anchor === 'string' &&\n\t\t\t\t\theadingAttributes.anchor !== '';\n\n\t\t\t\tlatestHeadings.push( {\n\t\t\t\t\t// Convert line breaks to spaces, and get rid of HTML tags in the headings.\n\t\t\t\t\tcontent: stripHTML(\n\t\t\t\t\t\theadingAttributes.content.replace(\n\t\t\t\t\t\t\t/(<br *\\/?>)+/g,\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\tlevel: headingAttributes.level,\n\t\t\t\t\tlink: canBeLinked\n\t\t\t\t\t\t? `${ headingPageLink }#${ headingAttributes.anchor }`\n\t\t\t\t\t\t: null,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn latestHeadings;\n}\n\nfunction observeCallback( select, dispatch, clientId ) {\n\tconst { getBlockAttributes } = select( blockEditorStore );\n\tconst { updateBlockAttributes, __unstableMarkNextChangeAsNotPersistent } =\n\t\tdispatch( blockEditorStore );\n\n\t/**\n\t * If the block no longer exists in the store, skip the update.\n\t * The \"undo\" action recreates the block and provides a new `clientId`.\n\t * The hook still might be observing the changes while the old block unmounts.\n\t */\n\tconst attributes = getBlockAttributes( clientId );\n\tif ( attributes === null ) {\n\t\treturn;\n\t}\n\n\tconst headings = getLatestHeadings( select, clientId );\n\tif ( ! fastDeepEqual( headings, attributes.headings ) ) {\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\tupdateBlockAttributes( clientId, { headings } );\n\t}\n}\n\nexport function useObserveHeadings( clientId ) {\n\tconst registry = useRegistry();\n\tuseEffect( () => {\n\t\t// Todo: Limit subscription to block editor store when data no longer depends on `getPermalink`.\n\t\t// See: https://github.com/WordPress/gutenberg/pull/45513\n\t\treturn registry.subscribe( () =>\n\t\t\tobserveCallback( registry.select, registry.dispatch, clientId )\n\t\t);\n\t}, [ registry, clientId ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,qBAAqB;;AAE/C;AACA;AACA;AACA,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,mBAAmB,IAAIC,SAAS,QAAQ,gBAAgB;AACjE,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,YAAY,EAAEC,eAAe,QAAQ,gBAAgB;AAC9D,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AAEnE,SAASC,iBAAiBA,CAAEC,MAAM,EAAEC,QAAQ,EAAG;EAAA,IAAAC,oBAAA,EAAAC,mBAAA;EAC9C,MAAM;IACLC,kBAAkB;IAClBC,YAAY;IACZC,eAAe;IACfC;EACD,CAAC,GAAGP,MAAM,CAAEF,gBAAiB,CAAC;;EAE9B;EACA;EACA;EACA;EACA;EACA;EACA,MAAMU,SAAS,IAAAN,oBAAA,GAAGF,MAAM,CAAE,aAAc,CAAC,CAACS,YAAY,CAAC,CAAC,cAAAP,oBAAA,cAAAA,oBAAA,GAAI,IAAI;EAEhE,MAAMQ,WAAW,GAAGJ,eAAe,CAAE,eAAgB,CAAC,CAACK,MAAM,KAAK,CAAC;EACnE,MAAM;IAAEC,sBAAsB;IAAEC;EAAS,CAAC,IAAAV,mBAAA,GACzCC,kBAAkB,CAAEH,QAAS,CAAC,cAAAE,mBAAA,cAAAA,mBAAA,GAAI,CAAC,CAAC;;EAErC;EACA,MAAM,CAAEW,mBAAmB,GAAG,EAAE,CAAE,GAAGR,eAAe,CAAE,mBAAoB,CAAC;;EAE3E;EACA,MAAMS,iBAAiB,GAAGR,yBAAyB,CAAEO,mBAAoB,CAAC;;EAE1E;EACA,IAAIE,OAAO,GAAG,CAAC;EAEf,IAAKN,WAAW,IAAIE,sBAAsB,EAAG;IAC5C;IACA;IACA,MAAMK,QAAQ,GAA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;IACA,OAAOgD,QAAQ,CAACC,SAAS,CAAE,MAC1BR,eAAe,CAAEO,QAAQ,CAAC1C,MAAM,EAAE0C,QAAQ,CAACN,QAAQ,EAAEnC,QAAS,CAC/D,CAAC;EACF,CAAC,EAAE,CAAEyC,QAAQ,EAAEzC,QAAQ,CAAG,CAAC;AAC5B","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["fastDeepEqual","useRegistry","__unstableStripHTML","stripHTML","useEffect","addQueryArgs","removeQueryArgs","store","blockEditorStore","getLatestHeadings","select","clientId","_select$getPermalink","_getBlockAttributes","getBlockAttributes","getBlockName","getBlocksByName","getClientIdsOfDescendants","permalink","getPermalink","isPaginated","length","onlyIncludeCurrentPage","maxLevel","postContentClientId","allBlockClientIds","tocPage","tocIndex","indexOf","blockIndex","blockClientId","entries","latestHeadings","headingPage","headingPageLink","page","blockName","headingAttributes","level","canBeLinked","anchor","push","content","replace","link","observeCallback","dispatch","updateBlockAttributes","__unstableMarkNextChangeAsNotPersistent","attributes","headings","window","queueMicrotask","useObserveHeadings","registry","subscribe"],"sources":["@wordpress/block-library/src/table-of-contents/hooks.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6';\n\n/**\n * WordPress dependencies\n */\nimport { useRegistry } from '@wordpress/data';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { useEffect } from '@wordpress/element';\nimport { addQueryArgs, removeQueryArgs } from '@wordpress/url';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction getLatestHeadings( select, clientId ) {\n\tconst {\n\t\tgetBlockAttributes,\n\t\tgetBlockName,\n\t\tgetBlocksByName,\n\t\tgetClientIdsOfDescendants,\n\t} = select( blockEditorStore );\n\n\t// FIXME: @wordpress/block-library should not depend on @wordpress/editor.\n\t// Blocks can be loaded into a *non-post* block editor, so to avoid\n\t// declaring @wordpress/editor as a dependency, we must access its\n\t// store by string. When the store is not available, editorSelectors\n\t// will be null, and the block's saved markup will lack permalinks.\n\t// eslint-disable-next-line @wordpress/data-no-store-string-literals\n\tconst permalink = select( 'core/editor' ).getPermalink() ?? null;\n\n\tconst isPaginated = getBlocksByName( 'core/nextpage' ).length !== 0;\n\tconst { onlyIncludeCurrentPage, maxLevel } =\n\t\tgetBlockAttributes( clientId ) ?? {};\n\n\t// Get post-content block client ID.\n\tconst [ postContentClientId = '' ] = getBlocksByName( 'core/post-content' );\n\n\t// Get the client ids of all blocks in the editor.\n\tconst allBlockClientIds = getClientIdsOfDescendants( postContentClientId );\n\n\t// If onlyIncludeCurrentPage is true, calculate the page (of a paginated post) this block is part of, so we know which headings to include; otherwise, skip the calculation.\n\tlet tocPage = 1;\n\n\tif ( isPaginated && onlyIncludeCurrentPage ) {\n\t\t// We can't use getBlockIndex because it only returns the index\n\t\t// relative to sibling blocks.\n\t\tconst tocIndex = allBlockClientIds.indexOf( clientId );\n\n\t\tfor ( const [\n\t\t\tblockIndex,\n\t\t\tblockClientId,\n\t\t] of allBlockClientIds.entries() ) {\n\t\t\t// If we've reached blocks after the Table of Contents, we've\n\t\t\t// finished calculating which page the block is on.\n\t\t\tif ( blockIndex >= tocIndex ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( getBlockName( blockClientId ) === 'core/nextpage' ) {\n\t\t\t\ttocPage++;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst latestHeadings = [];\n\n\t/** The page (of a paginated post) a heading will be part of. */\n\tlet headingPage = 1;\n\tlet headingPageLink = null;\n\n\t// If the core/editor store is available, we can add permalinks to the\n\t// generated table of contents.\n\tif ( typeof permalink === 'string' ) {\n\t\theadingPageLink = isPaginated\n\t\t\t? addQueryArgs( permalink, { page: headingPage } )\n\t\t\t: permalink;\n\t}\n\n\tfor ( const blockClientId of allBlockClientIds ) {\n\t\tconst blockName = getBlockName( blockClientId );\n\t\tif ( blockName === 'core/nextpage' ) {\n\t\t\theadingPage++;\n\n\t\t\t// If we're only including headings from the current page (of\n\t\t\t// a paginated post), then exit the loop if we've reached the\n\t\t\t// pages after the one with the Table of Contents block.\n\t\t\tif ( onlyIncludeCurrentPage && headingPage > tocPage ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( typeof permalink === 'string' ) {\n\t\t\t\theadingPageLink = addQueryArgs(\n\t\t\t\t\tremoveQueryArgs( permalink, [ 'page' ] ),\n\t\t\t\t\t{ page: headingPage }\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t// If we're including all headings or we've reached headings on\n\t\t// the same page as the Table of Contents block, add them to the\n\t\t// list.\n\t\telse if ( ! onlyIncludeCurrentPage || headingPage === tocPage ) {\n\t\t\tif ( blockName === 'core/heading' ) {\n\t\t\t\tconst headingAttributes = getBlockAttributes( blockClientId );\n\n\t\t\t\t// Skip headings that are deeper than maxLevel\n\t\t\t\tif ( maxLevel && headingAttributes.level > maxLevel ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst canBeLinked =\n\t\t\t\t\ttypeof headingPageLink === 'string' &&\n\t\t\t\t\ttypeof headingAttributes.anchor === 'string' &&\n\t\t\t\t\theadingAttributes.anchor !== '';\n\n\t\t\t\tlatestHeadings.push( {\n\t\t\t\t\t// Convert line breaks to spaces, and get rid of HTML tags in the headings.\n\t\t\t\t\tcontent: stripHTML(\n\t\t\t\t\t\theadingAttributes.content.replace(\n\t\t\t\t\t\t\t/(<br *\\/?>)+/g,\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\tlevel: headingAttributes.level,\n\t\t\t\t\tlink: canBeLinked\n\t\t\t\t\t\t? `${ headingPageLink }#${ headingAttributes.anchor }`\n\t\t\t\t\t\t: null,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn latestHeadings;\n}\n\nfunction observeCallback( select, dispatch, clientId ) {\n\tconst { getBlockAttributes } = select( blockEditorStore );\n\tconst { updateBlockAttributes, __unstableMarkNextChangeAsNotPersistent } =\n\t\tdispatch( blockEditorStore );\n\n\t/**\n\t * If the block no longer exists in the store, skip the update.\n\t * The \"undo\" action recreates the block and provides a new `clientId`.\n\t * The hook still might be observing the changes while the old block unmounts.\n\t */\n\tconst attributes = getBlockAttributes( clientId );\n\tif ( attributes === null ) {\n\t\treturn;\n\t}\n\n\tconst headings = getLatestHeadings( select, clientId );\n\tif ( ! fastDeepEqual( headings, attributes.headings ) ) {\n\t\t// Executing the update in a microtask ensures that the non-persistent marker doesn't affect an attribute triggering the change.\n\t\twindow.queueMicrotask( () => {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tupdateBlockAttributes( clientId, { headings } );\n\t\t} );\n\t}\n}\n\nexport function useObserveHeadings( clientId ) {\n\tconst registry = useRegistry();\n\tuseEffect( () => {\n\t\t// Todo: Limit subscription to block editor store when data no longer depends on `getPermalink`.\n\t\t// See: https://github.com/WordPress/gutenberg/pull/45513\n\t\treturn registry.subscribe( () =>\n\t\t\tobserveCallback( registry.select, registry.dispatch, clientId )\n\t\t);\n\t}, [ registry, clientId ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,qBAAqB;;AAE/C;AACA;AACA;AACA,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,mBAAmB,IAAIC,SAAS,QAAQ,gBAAgB;AACjE,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,YAAY,EAAEC,eAAe,QAAQ,gBAAgB;AAC9D,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AAEnE,SAASC,iBAAiBA,CAAEC,MAAM,EAAEC,QAAQ,EAAG;EAAA,IAAAC,oBAAA,EAAAC,mBAAA;EAC9C,MAAM;IACLC,kBAAkB;IAClBC,YAAY;IACZC,eAAe;IACfC;EACD,CAAC,GAAGP,MAAM,CAAEF,gBAAiB,CAAC;;EAE9B;EACA;EACA;EACA;EACA;EACA;EACA,MAAMU,SAAS,IAAAN,oBAAA,GAAGF,MAAM,CA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C;EAAwC,CAAC,GACvEF,QAAQ,CAAEtC,gBAAiB,CAAC;;EAE7B;AACD;AACA;AACA;AACA;EACC,MAAMyC,UAAU,GAAGnC,kBAAkB,CAAEH,QAAS,CAAC;EACjD,IAAKsC,UAAU,KAAK,IAAI,EAAG;IAC1B;EACD;EAEA,MAAMC,QAAQ,GAAGzC,iBAAiB,CAAEC,MAAM,EAAEC,QAAS,CAAC;EACtD,IAAK,CAAEX,aAAa,CAAEkD,QAAQ,EAAED,UAAU,CAACC,QAAS,CAAC,EAAG;IACvD;IACAC,MAAM,CAACC,cAAc,CAAE,MAAM;MAC5BJ,uCAAuC,CAAC,CAAC;MACzCD,qBAAqB,CAAEpC,QAAQ,EAAE;QAAEuC;MAAS,CAAE,CAAC;IAChD,CAAE,CAAC;EACJ;AACD;AAEA,OAAO,SAASG,kBAAkBA,CAAE1C,QAAQ,EAAG;EAC9C,MAAM2C,QAAQ,GAAGrD,WAAW,CAAC,CAAC;EAC9BG,SAAS,CAAE,MAAM;IAChB;IACA;IACA,OAAOkD,QAAQ,CAACC,SAAS,CAAE,MAC1BV,eAAe,CAAES,QAAQ,CAAC5C,MAAM,EAAE4C,QAAQ,CAACR,QAAQ,EAAEnC,QAAS,CAC/D,CAAC;EACF,CAAC,EAAE,CAAE2C,QAAQ,EAAE3C,QAAQ,CAAG,CAAC;AAC5B","ignoreList":[]}
|
|
@@ -5,20 +5,25 @@ import { useEntityProp, store as coreStore } from '@wordpress/core-data';
|
|
|
5
5
|
import { SelectControl, TextControl } from '@wordpress/components';
|
|
6
6
|
import { sprintf, __ } from '@wordpress/i18n';
|
|
7
7
|
import { useSelect } from '@wordpress/data';
|
|
8
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Internal dependencies
|
|
11
12
|
*/
|
|
12
13
|
import { TemplatePartImportControls } from './import-controls';
|
|
13
|
-
import {
|
|
14
|
+
import { unlock } from '../../lock-unlock';
|
|
14
15
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
const {
|
|
17
|
+
HTMLElementControl
|
|
18
|
+
} = unlock(blockEditorPrivateApis);
|
|
15
19
|
export function TemplatePartAdvancedControls({
|
|
16
20
|
tagName,
|
|
17
21
|
setAttributes,
|
|
18
22
|
isEntityAvailable,
|
|
19
23
|
templatePartId,
|
|
20
24
|
defaultWrapper,
|
|
21
|
-
hasInnerBlocks
|
|
25
|
+
hasInnerBlocks,
|
|
26
|
+
clientId
|
|
22
27
|
}) {
|
|
23
28
|
const [area, setArea] = useEntityProp('postType', 'wp_template_part', 'area', templatePartId);
|
|
24
29
|
const [title, setTitle] = useEntityProp('postType', 'wp_template_part', 'title', templatePartId);
|
|
@@ -50,10 +55,12 @@ export function TemplatePartAdvancedControls({
|
|
|
50
55
|
value: area,
|
|
51
56
|
onChange: setArea
|
|
52
57
|
})]
|
|
53
|
-
}), /*#__PURE__*/_jsx(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
}), /*#__PURE__*/_jsx(HTMLElementControl, {
|
|
59
|
+
tagName: tagName || '',
|
|
60
|
+
onChange: value => setAttributes({
|
|
61
|
+
tagName: value
|
|
62
|
+
}),
|
|
63
|
+
clientId: clientId,
|
|
57
64
|
options: [{
|
|
58
65
|
label: sprintf(/* translators: %s: HTML tag based on area. */
|
|
59
66
|
__('Default based on area (%s)'), `<${defaultWrapper}>`),
|
|
@@ -79,12 +86,7 @@ export function TemplatePartAdvancedControls({
|
|
|
79
86
|
}, {
|
|
80
87
|
label: '<div>',
|
|
81
88
|
value: 'div'
|
|
82
|
-
}]
|
|
83
|
-
value: tagName || '',
|
|
84
|
-
onChange: value => setAttributes({
|
|
85
|
-
tagName: value
|
|
86
|
-
}),
|
|
87
|
-
help: htmlElementMessages[tagName]
|
|
89
|
+
}]
|
|
88
90
|
}), !hasInnerBlocks && /*#__PURE__*/_jsx(TemplatePartImportControls, {
|
|
89
91
|
area: area,
|
|
90
92
|
setAttributes: setAttributes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEntityProp","store","coreStore","SelectControl","TextControl","sprintf","__","useSelect","TemplatePartImportControls","
|
|
1
|
+
{"version":3,"names":["useEntityProp","store","coreStore","SelectControl","TextControl","sprintf","__","useSelect","privateApis","blockEditorPrivateApis","TemplatePartImportControls","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","HTMLElementControl","TemplatePartAdvancedControls","tagName","setAttributes","isEntityAvailable","templatePartId","defaultWrapper","hasInnerBlocks","clientId","area","setArea","title","setTitle","defaultTemplatePartAreas","select","getCurrentTheme","default_template_part_areas","areaOptions","map","label","_area","value","children","__next40pxDefaultSize","__nextHasNoMarginBottom","onChange","onFocus","event","target","labelPosition","options"],"sources":["@wordpress/block-library/src/template-part/edit/advanced-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { SelectControl, TextControl } from '@wordpress/components';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { TemplatePartImportControls } from './import-controls';\nimport { unlock } from '../../lock-unlock';\n\nconst { HTMLElementControl } = unlock( blockEditorPrivateApis );\n\nexport function TemplatePartAdvancedControls( {\n\ttagName,\n\tsetAttributes,\n\tisEntityAvailable,\n\ttemplatePartId,\n\tdefaultWrapper,\n\thasInnerBlocks,\n\tclientId,\n} ) {\n\tconst [ area, setArea ] = useEntityProp(\n\t\t'postType',\n\t\t'wp_template_part',\n\t\t'area',\n\t\ttemplatePartId\n\t);\n\n\tconst [ title, setTitle ] = useEntityProp(\n\t\t'postType',\n\t\t'wp_template_part',\n\t\t'title',\n\t\ttemplatePartId\n\t);\n\n\tconst defaultTemplatePartAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getCurrentTheme()\n\t\t\t\t?.default_template_part_areas || [],\n\t\t[]\n\t);\n\n\tconst areaOptions = defaultTemplatePartAreas.map(\n\t\t( { label, area: _area } ) => ( {\n\t\t\tlabel,\n\t\t\tvalue: _area,\n\t\t} )\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ isEntityAvailable && (\n\t\t\t\t<>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Title' ) }\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\tsetTitle( value );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonFocus={ ( event ) => event.target.select() }\n\t\t\t\t\t/>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Area' ) }\n\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\toptions={ areaOptions }\n\t\t\t\t\t\tvalue={ area }\n\t\t\t\t\t\tonChange={ setArea }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<HTMLElementControl\n\t\t\t\ttagName={ tagName || '' }\n\t\t\t\tonChange={ ( value ) => setAttributes( { tagName: value } ) }\n\t\t\t\tclientId={ clientId }\n\t\t\t\toptions={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: sprintf(\n\t\t\t\t\t\t\t/* translators: %s: HTML tag based on area. */\n\t\t\t\t\t\t\t__( 'Default based on area (%s)' ),\n\t\t\t\t\t\t\t`<${ defaultWrapper }>`\n\t\t\t\t\t\t),\n\t\t\t\t\t\tvalue: '',\n\t\t\t\t\t},\n\t\t\t\t\t{ label: '<header>', value: 'header' },\n\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t{ label: '<article>', value: 'article' },\n\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t{ label: '<footer>', value: 'footer' },\n\t\t\t\t\t{ label: '<div>', value: 'div' },\n\t\t\t\t] }\n\t\t\t/>\n\t\t\t{ ! hasInnerBlocks && (\n\t\t\t\t<TemplatePartImportControls\n\t\t\t\t\tarea={ area }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACxE,SAASC,aAAa,EAAEC,WAAW,QAAQ,uBAAuB;AAClE,SAASC,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASC,0BAA0B,QAAQ,mBAAmB;AAC9D,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE3C,MAAM;EAAEC;AAAmB,CAAC,GAAGP,MAAM,CAAEF,sBAAuB,CAAC;AAE/D,OAAO,SAASU,4BAA4BA,CAAE;EAC7CC,OAAO;EACPC,aAAa;EACbC,iBAAiB;EACjBC,cAAc;EACdC,cAAc;EACdC,cAAc;EACdC;AACD,CAAC,EAAG;EACH,MAAM,CAAEC,IAAI,EAAEC,OAAO,CAAE,GAAG5B,aAAa,CACtC,UAAU,EACV,kBAAkB,EAClB,MAAM,EACNuB,cACD,CAAC;EAED,MAAM,CAAEM,KAAK,EAAEC,QAAQ,CAAE,GAAG9B,aAAa,CACxC,UAAU,EACV,kBAAkB,EAClB,OAAO,EACPuB,cACD,CAAC;EAED,MAAMQ,wBAAwB,GAAGxB,SAAS,CACvCyB,M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EAAE;MACR,CAAC,EACD;QAAEF,KAAK,EAAE,UAAU;QAAEE,KAAK,EAAE;MAAS,CAAC,EACtC;QAAEF,KAAK,EAAE,QAAQ;QAAEE,KAAK,EAAE;MAAO,CAAC,EAClC;QAAEF,KAAK,EAAE,WAAW;QAAEE,KAAK,EAAE;MAAU,CAAC,EACxC;QAAEF,KAAK,EAAE,WAAW;QAAEE,KAAK,EAAE;MAAU,CAAC,EACxC;QAAEF,KAAK,EAAE,SAAS;QAAEE,KAAK,EAAE;MAAQ,CAAC,EACpC;QAAEF,KAAK,EAAE,UAAU;QAAEE,KAAK,EAAE;MAAS,CAAC,EACtC;QAAEF,KAAK,EAAE,OAAO;QAAEE,KAAK,EAAE;MAAM,CAAC;IAC9B,CACH,CAAC,EACA,CAAEd,cAAc,iBACjBZ,IAAA,CAACH,0BAA0B;MAC1BiB,IAAI,EAAGA,IAAM;MACbN,aAAa,EAAGA;IAAe,CAC/B,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -181,7 +181,8 @@ export default function TemplatePartEdit({
|
|
|
181
181
|
isEntityAvailable: isEntityAvailable,
|
|
182
182
|
templatePartId: templatePartId,
|
|
183
183
|
defaultWrapper: areaObject.tagName,
|
|
184
|
-
hasInnerBlocks: hasInnerBlocks
|
|
184
|
+
hasInnerBlocks: hasInnerBlocks,
|
|
185
|
+
clientId: clientId
|
|
185
186
|
})
|
|
186
187
|
}), isPlaceholder && /*#__PURE__*/_jsx(TagName, {
|
|
187
188
|
...blockProps,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["serialize","useSelect","useDispatch","BlockSettingsMenuControls","useBlockProps","Warning","store","blockEditorStore","RecursionProvider","useHasRecursion","InspectorControls","__experimentalBlockPatternsList","BlockPatternsList","BlockControls","PanelBody","Spinner","Modal","MenuItem","ToolbarButton","__","sprintf","coreStore","useState","noticesStore","TemplatePartPlaceholder","TemplatePartSelectionModal","TemplatePartAdvancedControls","TemplatePartInnerBlocks","createTemplatePartId","useAlternativeBlockPatterns","useAlternativeTemplateParts","useTemplatePartArea","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","ReplaceButton","isEntityAvailable","area","templatePartId","isTemplatePartSelectionOpen","setIsTemplatePartSelectionOpen","templateParts","hasReplacements","length","canReplace","onClick","children","TemplatesList","clientId","onSelect","blockPatterns","title","label","onClickPattern","showTitlesAsTooltip","TemplatePartEdit","attributes","setAttributes","createSuccessNotice","editEntityRecord","currentTheme","select","getCurrentTheme","stylesheet","slug","theme","tagName","layout","hasAlreadyRendered","isResolved","hasInnerBlocks","isMissing","onNavigateToEntityRecord","canUserEdit","getEditedEntityRecord","hasFinishedResolution","getBlockCount","getSettings","getEntityArgs","entityRecord","_area","hasResolvedEntity","_canUserEdit","canUser","kind","name","id","Object","keys","areaObject","blockProps","isPlaceholder","TagName","onPatternSelect","pattern","blocks","content","type","uniqueId","group","postId","postType","defaultWrapper","onOpenSelectionModal","selectedClientIds","overlayClassName","toLowerCase","onRequestClose","isFullScreen","onClose"],"sources":["@wordpress/block-library/src/template-part/edit/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { serialize } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockSettingsMenuControls,\n\tuseBlockProps,\n\tWarning,\n\tstore as blockEditorStore,\n\tRecursionProvider,\n\tuseHasRecursion,\n\tInspectorControls,\n\t__experimentalBlockPatternsList as BlockPatternsList,\n\tBlockControls,\n} from '@wordpress/block-editor';\nimport {\n\tPanelBody,\n\tSpinner,\n\tModal,\n\tMenuItem,\n\tToolbarButton,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TemplatePartPlaceholder from './placeholder';\nimport TemplatePartSelectionModal from './selection-modal';\nimport { TemplatePartAdvancedControls } from './advanced-controls';\nimport TemplatePartInnerBlocks from './inner-blocks';\nimport { createTemplatePartId } from './utils/create-template-part-id';\nimport {\n\tuseAlternativeBlockPatterns,\n\tuseAlternativeTemplateParts,\n\tuseTemplatePartArea,\n} from './utils/hooks';\n\nfunction ReplaceButton( {\n\tisEntityAvailable,\n\tarea,\n\ttemplatePartId,\n\tisTemplatePartSelectionOpen,\n\tsetIsTemplatePartSelectionOpen,\n} ) {\n\t// This hook fetches patterns, so don't run it unconditionally in the main\n\t// edit function!\n\tconst { templateParts } = useAlternativeTemplateParts(\n\t\tarea,\n\t\ttemplatePartId\n\t);\n\tconst hasReplacements = !! templateParts.length;\n\tconst canReplace =\n\t\tisEntityAvailable &&\n\t\thasReplacements &&\n\t\t( area === 'header' || area === 'footer' );\n\n\tif ( ! canReplace ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\tsetIsTemplatePartSelectionOpen( true );\n\t\t\t} }\n\t\t\taria-expanded={ isTemplatePartSelectionOpen }\n\t\t\taria-haspopup=\"dialog\"\n\t\t>\n\t\t\t{ __( 'Replace' ) }\n\t\t</MenuItem>\n\t);\n}\n\nfunction TemplatesList( { area, clientId, isEntityAvailable, onSelect } ) {\n\t// This hook fetches patterns, so don't run it unconditionally in the main\n\t// edit function!\n\tconst blockPatterns = useAlternativeBlockPatterns( area, clientId );\n\tconst canReplace =\n\t\tisEntityAvailable &&\n\t\t!! blockPatterns.length &&\n\t\t( area === 'header' || area === 'footer' );\n\n\tif ( ! canReplace ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody title={ __( 'Design' ) }>\n\t\t\t<BlockPatternsList\n\t\t\t\tlabel={ __( 'Templates' ) }\n\t\t\t\tblockPatterns={ blockPatterns }\n\t\t\t\tonClickPattern={ onSelect }\n\t\t\t\tshowTitlesAsTooltip\n\t\t\t/>\n\t\t</PanelBody>\n\t);\n}\n\nexport default function TemplatePartEdit( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst currentTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.stylesheet,\n\t\t[]\n\t);\n\tconst { slug, theme = currentTheme, tagName, layout = {} } = attributes;\n\tconst templatePartId = createTemplatePartId( theme, slug );\n\tconst hasAlreadyRendered = useHasRecursion( templatePartId );\n\tconst [ isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen ] =\n\t\tuseState( false );\n\n\tconst {\n\t\tisResolved,\n\t\thasInnerBlocks,\n\t\tisMissing,\n\t\tarea,\n\t\tonNavigateToEntityRecord,\n\t\ttitle,\n\t\tcanUserEdit,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { getBlockCount, getSettings } = select( blockEditorStore );\n\n\t\t\tconst getEntityArgs = [\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\ttemplatePartId,\n\t\t\t];\n\t\t\tconst entityRecord = templatePartId\n\t\t\t\t? getEditedEntityRecord( ...getEntityArgs )\n\t\t\t\t: null;\n\t\t\tconst _area = entityRecord?.area || attributes.area;\n\t\t\tconst hasResolvedEntity = templatePartId\n\t\t\t\t? hasFinishedResolution(\n\t\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\t\tgetEntityArgs\n\t\t\t\t )\n\t\t\t\t: false;\n\n\t\t\tconst _canUserEdit = hasResolvedEntity\n\t\t\t\t? select( coreStore ).canUser( 'update', {\n\t\t\t\t\t\tkind: 'postType',\n\t\t\t\t\t\tname: 'wp_template_part',\n\t\t\t\t\t\tid: templatePartId,\n\t\t\t\t } )\n\t\t\t\t: false;\n\n\t\t\treturn {\n\t\t\t\thasInnerBlocks: getBlockCount( clientId ) > 0,\n\t\t\t\tisResolved: hasResolvedEntity,\n\t\t\t\tisMissing:\n\t\t\t\t\thasResolvedEntity &&\n\t\t\t\t\t( ! entityRecord ||\n\t\t\t\t\t\tObject.keys( entityRecord ).length === 0 ),\n\t\t\t\tarea: _area,\n\t\t\t\tonNavigateToEntityRecord:\n\t\t\t\t\tgetSettings().onNavigateToEntityRecord,\n\t\t\t\ttitle: entityRecord?.title,\n\t\t\t\tcanUserEdit: !! _canUserEdit,\n\t\t\t};\n\t\t},\n\t\t[ templatePartId, attributes.area, clientId ]\n\t);\n\n\tconst areaObject = useTemplatePartArea( area );\n\tconst blockProps = useBlockProps();\n\tconst isPlaceholder = ! slug;\n\tconst isEntityAvailable = ! isPlaceholder && ! isMissing && isResolved;\n\tconst TagName = tagName || areaObject.tagName;\n\n\tconst onPatternSelect = async ( pattern ) => {\n\t\tawait editEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template_part',\n\t\t\ttemplatePartId,\n\t\t\t{\n\t\t\t\tblocks: pattern.blocks,\n\t\t\t\tcontent: serialize( pattern.blocks ),\n\t\t\t}\n\t\t);\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: template part title. */\n\t\t\t\t__( 'Template Part \"%s\" updated.' ),\n\t\t\t\ttitle || slug\n\t\t\t),\n\t\t\t{\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t};\n\n\t// We don't want to render a missing state if we have any inner blocks.\n\t// A new template part is automatically created if we have any inner blocks but no entity.\n\tif (\n\t\t! hasInnerBlocks &&\n\t\t( ( slug && ! theme ) || ( slug && isMissing ) )\n\t) {\n\t\treturn (\n\t\t\t<TagName { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %s: Template part slug. */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Template part has been deleted or is unavailable: %s'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tslug\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t</TagName>\n\t\t);\n\t}\n\n\tif ( isEntityAvailable && hasAlreadyRendered ) {\n\t\treturn (\n\t\t\t<TagName { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ __( 'Block cannot be rendered inside itself.' ) }\n\t\t\t\t</Warning>\n\t\t\t</TagName>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<RecursionProvider uniqueId={ templatePartId }>\n\t\t\t\t{ isEntityAvailable &&\n\t\t\t\t\tonNavigateToEntityRecord &&\n\t\t\t\t\tcanUserEdit && (\n\t\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\t\t\t\t\t\tpostId: templatePartId,\n\t\t\t\t\t\t\t\t\t\tpostType: 'wp_template_part',\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\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t\t</BlockControls>\n\t\t\t\t\t) }\n\t\t\t\t{ canUserEdit && (\n\t\t\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t\t\t<TemplatePartAdvancedControls\n\t\t\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\tisEntityAvailable={ isEntityAvailable }\n\t\t\t\t\t\t\ttemplatePartId={ templatePartId }\n\t\t\t\t\t\t\tdefaultWrapper={ areaObject.tagName }\n\t\t\t\t\t\t\thasInnerBlocks={ hasInnerBlocks }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InspectorControls>\n\t\t\t\t) }\n\t\t\t\t{ isPlaceholder && (\n\t\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t\t<TemplatePartPlaceholder\n\t\t\t\t\t\t\tarea={ attributes.area }\n\t\t\t\t\t\t\ttemplatePartId={ templatePartId }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\tonOpenSelectionModal={ () =>\n\t\t\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( true )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TagName>\n\t\t\t\t) }\n\t\t\t\t<BlockSettingsMenuControls>\n\t\t\t\t\t{ ( { selectedClientIds } ) => {\n\t\t\t\t\t\t// Only enable for single selection that matches the current block.\n\t\t\t\t\t\t// Ensures menu item doesn't render multiple times.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t! (\n\t\t\t\t\t\t\t\tselectedClientIds.length === 1 &&\n\t\t\t\t\t\t\t\tclientId === selectedClientIds[ 0 ]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<ReplaceButton\n\t\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\t\tisEntityAvailable,\n\t\t\t\t\t\t\t\t\tarea,\n\t\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\t\ttemplatePartId,\n\t\t\t\t\t\t\t\t\tisTemplatePartSelectionOpen,\n\t\t\t\t\t\t\t\t\tsetIsTemplatePartSelectionOpen,\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</BlockSettingsMenuControls>\n\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<TemplatesList\n\t\t\t\t\t\tarea={ area }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tisEntityAvailable={ isEntityAvailable }\n\t\t\t\t\t\tonSelect={ ( pattern ) => onPatternSelect( pattern ) }\n\t\t\t\t\t/>\n\t\t\t\t</InspectorControls>\n\n\t\t\t\t{ isEntityAvailable && (\n\t\t\t\t\t<TemplatePartInnerBlocks\n\t\t\t\t\t\ttagName={ TagName }\n\t\t\t\t\t\tblockProps={ blockProps }\n\t\t\t\t\t\tpostId={ templatePartId }\n\t\t\t\t\t\thasInnerBlocks={ hasInnerBlocks }\n\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! isPlaceholder && ! isResolved && (\n\t\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t</TagName>\n\t\t\t\t) }\n\t\t\t</RecursionProvider>\n\t\t\t{ isTemplatePartSelectionOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\toverlayClassName=\"block-editor-template-part__selection-modal\"\n\t\t\t\t\ttitle={ sprintf(\n\t\t\t\t\t\t// Translators: %s as template part area title (\"Header\", \"Footer\", etc.).\n\t\t\t\t\t\t__( 'Choose a %s' ),\n\t\t\t\t\t\tareaObject.label.toLowerCase()\n\t\t\t\t\t) }\n\t\t\t\t\tonRequestClose={ () =>\n\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( false )\n\t\t\t\t\t}\n\t\t\t\t\tisFullScreen\n\t\t\t\t>\n\t\t\t\t\t<TemplatePartSelectionModal\n\t\t\t\t\t\ttemplatePartId={ templatePartId }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tarea={ area }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tonClose={ () =>\n\t\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( false )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,mBAAmB;AAC7C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,yBAAyB,EACzBC,aAAa,EACbC,OAAO,EACPC,KAAK,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,CAAE,aAAc,CAAC,EACnByE,UAAU,CAACrC,KAAK,CAACsD,WAAW,CAAC,CAC9B,CAAG;MACHC,cAAc,EAAGA,CAAA,KAChBnE,8BAA8B,CAAE,KAAM,CACtC;MACDoE,YAAY;MAAA9D,QAAA,eAEZhB,IAAA,CAACR,0BAA0B;QAC1BgB,cAAc,EAAGA,cAAgB;QACjCU,QAAQ,EAAGA,QAAU;QACrBX,IAAI,EAAGA,IAAM;QACboB,aAAa,EAAGA,aAAe;QAC/BoD,OAAO,EAAGA,CAAA,KACTrE,8BAA8B,CAAE,KAAM;MACtC,CACD;IAAC,CACI,CACP;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["serialize","useSelect","useDispatch","BlockSettingsMenuControls","useBlockProps","Warning","store","blockEditorStore","RecursionProvider","useHasRecursion","InspectorControls","__experimentalBlockPatternsList","BlockPatternsList","BlockControls","PanelBody","Spinner","Modal","MenuItem","ToolbarButton","__","sprintf","coreStore","useState","noticesStore","TemplatePartPlaceholder","TemplatePartSelectionModal","TemplatePartAdvancedControls","TemplatePartInnerBlocks","createTemplatePartId","useAlternativeBlockPatterns","useAlternativeTemplateParts","useTemplatePartArea","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","ReplaceButton","isEntityAvailable","area","templatePartId","isTemplatePartSelectionOpen","setIsTemplatePartSelectionOpen","templateParts","hasReplacements","length","canReplace","onClick","children","TemplatesList","clientId","onSelect","blockPatterns","title","label","onClickPattern","showTitlesAsTooltip","TemplatePartEdit","attributes","setAttributes","createSuccessNotice","editEntityRecord","currentTheme","select","getCurrentTheme","stylesheet","slug","theme","tagName","layout","hasAlreadyRendered","isResolved","hasInnerBlocks","isMissing","onNavigateToEntityRecord","canUserEdit","getEditedEntityRecord","hasFinishedResolution","getBlockCount","getSettings","getEntityArgs","entityRecord","_area","hasResolvedEntity","_canUserEdit","canUser","kind","name","id","Object","keys","areaObject","blockProps","isPlaceholder","TagName","onPatternSelect","pattern","blocks","content","type","uniqueId","group","postId","postType","defaultWrapper","onOpenSelectionModal","selectedClientIds","overlayClassName","toLowerCase","onRequestClose","isFullScreen","onClose"],"sources":["@wordpress/block-library/src/template-part/edit/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { serialize } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockSettingsMenuControls,\n\tuseBlockProps,\n\tWarning,\n\tstore as blockEditorStore,\n\tRecursionProvider,\n\tuseHasRecursion,\n\tInspectorControls,\n\t__experimentalBlockPatternsList as BlockPatternsList,\n\tBlockControls,\n} from '@wordpress/block-editor';\nimport {\n\tPanelBody,\n\tSpinner,\n\tModal,\n\tMenuItem,\n\tToolbarButton,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TemplatePartPlaceholder from './placeholder';\nimport TemplatePartSelectionModal from './selection-modal';\nimport { TemplatePartAdvancedControls } from './advanced-controls';\nimport TemplatePartInnerBlocks from './inner-blocks';\nimport { createTemplatePartId } from './utils/create-template-part-id';\nimport {\n\tuseAlternativeBlockPatterns,\n\tuseAlternativeTemplateParts,\n\tuseTemplatePartArea,\n} from './utils/hooks';\n\nfunction ReplaceButton( {\n\tisEntityAvailable,\n\tarea,\n\ttemplatePartId,\n\tisTemplatePartSelectionOpen,\n\tsetIsTemplatePartSelectionOpen,\n} ) {\n\t// This hook fetches patterns, so don't run it unconditionally in the main\n\t// edit function!\n\tconst { templateParts } = useAlternativeTemplateParts(\n\t\tarea,\n\t\ttemplatePartId\n\t);\n\tconst hasReplacements = !! templateParts.length;\n\tconst canReplace =\n\t\tisEntityAvailable &&\n\t\thasReplacements &&\n\t\t( area === 'header' || area === 'footer' );\n\n\tif ( ! canReplace ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\tsetIsTemplatePartSelectionOpen( true );\n\t\t\t} }\n\t\t\taria-expanded={ isTemplatePartSelectionOpen }\n\t\t\taria-haspopup=\"dialog\"\n\t\t>\n\t\t\t{ __( 'Replace' ) }\n\t\t</MenuItem>\n\t);\n}\n\nfunction TemplatesList( { area, clientId, isEntityAvailable, onSelect } ) {\n\t// This hook fetches patterns, so don't run it unconditionally in the main\n\t// edit function!\n\tconst blockPatterns = useAlternativeBlockPatterns( area, clientId );\n\tconst canReplace =\n\t\tisEntityAvailable &&\n\t\t!! blockPatterns.length &&\n\t\t( area === 'header' || area === 'footer' );\n\n\tif ( ! canReplace ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody title={ __( 'Design' ) }>\n\t\t\t<BlockPatternsList\n\t\t\t\tlabel={ __( 'Templates' ) }\n\t\t\t\tblockPatterns={ blockPatterns }\n\t\t\t\tonClickPattern={ onSelect }\n\t\t\t\tshowTitlesAsTooltip\n\t\t\t/>\n\t\t</PanelBody>\n\t);\n}\n\nexport default function TemplatePartEdit( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst currentTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.stylesheet,\n\t\t[]\n\t);\n\tconst { slug, theme = currentTheme, tagName, layout = {} } = attributes;\n\tconst templatePartId = createTemplatePartId( theme, slug );\n\tconst hasAlreadyRendered = useHasRecursion( templatePartId );\n\tconst [ isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen ] =\n\t\tuseState( false );\n\n\tconst {\n\t\tisResolved,\n\t\thasInnerBlocks,\n\t\tisMissing,\n\t\tarea,\n\t\tonNavigateToEntityRecord,\n\t\ttitle,\n\t\tcanUserEdit,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { getBlockCount, getSettings } = select( blockEditorStore );\n\n\t\t\tconst getEntityArgs = [\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\ttemplatePartId,\n\t\t\t];\n\t\t\tconst entityRecord = templatePartId\n\t\t\t\t? getEditedEntityRecord( ...getEntityArgs )\n\t\t\t\t: null;\n\t\t\tconst _area = entityRecord?.area || attributes.area;\n\t\t\tconst hasResolvedEntity = templatePartId\n\t\t\t\t? hasFinishedResolution(\n\t\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\t\tgetEntityArgs\n\t\t\t\t )\n\t\t\t\t: false;\n\n\t\t\tconst _canUserEdit = hasResolvedEntity\n\t\t\t\t? select( coreStore ).canUser( 'update', {\n\t\t\t\t\t\tkind: 'postType',\n\t\t\t\t\t\tname: 'wp_template_part',\n\t\t\t\t\t\tid: templatePartId,\n\t\t\t\t } )\n\t\t\t\t: false;\n\n\t\t\treturn {\n\t\t\t\thasInnerBlocks: getBlockCount( clientId ) > 0,\n\t\t\t\tisResolved: hasResolvedEntity,\n\t\t\t\tisMissing:\n\t\t\t\t\thasResolvedEntity &&\n\t\t\t\t\t( ! entityRecord ||\n\t\t\t\t\t\tObject.keys( entityRecord ).length === 0 ),\n\t\t\t\tarea: _area,\n\t\t\t\tonNavigateToEntityRecord:\n\t\t\t\t\tgetSettings().onNavigateToEntityRecord,\n\t\t\t\ttitle: entityRecord?.title,\n\t\t\t\tcanUserEdit: !! _canUserEdit,\n\t\t\t};\n\t\t},\n\t\t[ templatePartId, attributes.area, clientId ]\n\t);\n\n\tconst areaObject = useTemplatePartArea( area );\n\tconst blockProps = useBlockProps();\n\tconst isPlaceholder = ! slug;\n\tconst isEntityAvailable = ! isPlaceholder && ! isMissing && isResolved;\n\tconst TagName = tagName || areaObject.tagName;\n\n\tconst onPatternSelect = async ( pattern ) => {\n\t\tawait editEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template_part',\n\t\t\ttemplatePartId,\n\t\t\t{\n\t\t\t\tblocks: pattern.blocks,\n\t\t\t\tcontent: serialize( pattern.blocks ),\n\t\t\t}\n\t\t);\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: template part title. */\n\t\t\t\t__( 'Template Part \"%s\" updated.' ),\n\t\t\t\ttitle || slug\n\t\t\t),\n\t\t\t{\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t};\n\n\t// We don't want to render a missing state if we have any inner blocks.\n\t// A new template part is automatically created if we have any inner blocks but no entity.\n\tif (\n\t\t! hasInnerBlocks &&\n\t\t( ( slug && ! theme ) || ( slug && isMissing ) )\n\t) {\n\t\treturn (\n\t\t\t<TagName { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %s: Template part slug. */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Template part has been deleted or is unavailable: %s'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tslug\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t</TagName>\n\t\t);\n\t}\n\n\tif ( isEntityAvailable && hasAlreadyRendered ) {\n\t\treturn (\n\t\t\t<TagName { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ __( 'Block cannot be rendered inside itself.' ) }\n\t\t\t\t</Warning>\n\t\t\t</TagName>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<RecursionProvider uniqueId={ templatePartId }>\n\t\t\t\t{ isEntityAvailable &&\n\t\t\t\t\tonNavigateToEntityRecord &&\n\t\t\t\t\tcanUserEdit && (\n\t\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\t\t\t\t\t\tpostId: templatePartId,\n\t\t\t\t\t\t\t\t\t\tpostType: 'wp_template_part',\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\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t\t</BlockControls>\n\t\t\t\t\t) }\n\t\t\t\t{ canUserEdit && (\n\t\t\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t\t\t<TemplatePartAdvancedControls\n\t\t\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\tisEntityAvailable={ isEntityAvailable }\n\t\t\t\t\t\t\ttemplatePartId={ templatePartId }\n\t\t\t\t\t\t\tdefaultWrapper={ areaObject.tagName }\n\t\t\t\t\t\t\thasInnerBlocks={ hasInnerBlocks }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InspectorControls>\n\t\t\t\t) }\n\t\t\t\t{ isPlaceholder && (\n\t\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t\t<TemplatePartPlaceholder\n\t\t\t\t\t\t\tarea={ attributes.area }\n\t\t\t\t\t\t\ttemplatePartId={ templatePartId }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\tonOpenSelectionModal={ () =>\n\t\t\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( true )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TagName>\n\t\t\t\t) }\n\t\t\t\t<BlockSettingsMenuControls>\n\t\t\t\t\t{ ( { selectedClientIds } ) => {\n\t\t\t\t\t\t// Only enable for single selection that matches the current block.\n\t\t\t\t\t\t// Ensures menu item doesn't render multiple times.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t! (\n\t\t\t\t\t\t\t\tselectedClientIds.length === 1 &&\n\t\t\t\t\t\t\t\tclientId === selectedClientIds[ 0 ]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<ReplaceButton\n\t\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\t\tisEntityAvailable,\n\t\t\t\t\t\t\t\t\tarea,\n\t\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\t\ttemplatePartId,\n\t\t\t\t\t\t\t\t\tisTemplatePartSelectionOpen,\n\t\t\t\t\t\t\t\t\tsetIsTemplatePartSelectionOpen,\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</BlockSettingsMenuControls>\n\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<TemplatesList\n\t\t\t\t\t\tarea={ area }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tisEntityAvailable={ isEntityAvailable }\n\t\t\t\t\t\tonSelect={ ( pattern ) => onPatternSelect( pattern ) }\n\t\t\t\t\t/>\n\t\t\t\t</InspectorControls>\n\n\t\t\t\t{ isEntityAvailable && (\n\t\t\t\t\t<TemplatePartInnerBlocks\n\t\t\t\t\t\ttagName={ TagName }\n\t\t\t\t\t\tblockProps={ blockProps }\n\t\t\t\t\t\tpostId={ templatePartId }\n\t\t\t\t\t\thasInnerBlocks={ hasInnerBlocks }\n\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! isPlaceholder && ! isResolved && (\n\t\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t</TagName>\n\t\t\t\t) }\n\t\t\t</RecursionProvider>\n\t\t\t{ isTemplatePartSelectionOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\toverlayClassName=\"block-editor-template-part__selection-modal\"\n\t\t\t\t\ttitle={ sprintf(\n\t\t\t\t\t\t// Translators: %s as template part area title (\"Header\", \"Footer\", etc.).\n\t\t\t\t\t\t__( 'Choose a %s' ),\n\t\t\t\t\t\tareaObject.label.toLowerCase()\n\t\t\t\t\t) }\n\t\t\t\t\tonRequestClose={ () =>\n\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( false )\n\t\t\t\t\t}\n\t\t\t\t\tisFullScreen\n\t\t\t\t>\n\t\t\t\t\t<TemplatePartSelectionModal\n\t\t\t\t\t\ttemplatePartId={ templatePartId }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tarea={ area }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tonClose={ () =>\n\t\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( false )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,mBAAmB;AAC7C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,yBAAyB,EACzBC,aAAa,EACbC,OAAO,EACPC,KAAK,IAAIC,gBAAgB,EACzBC,iBAAiB,EACjBC,eAAe,EACfC,iBAAiB,EACjBC,+BAA+B,IAAIC,iBAAiB,EACpDC,aAAa,QACP,yBAAyB;AAChC,SACCC,SAAS,EACTC,OAAO,EACPC,KAAK,EACLC,QAAQ,EACRC,aAAa,QACP,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASd,KAAK,IAAIe,SAAS,QAAQ,sBAAsB;AACzD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAAShB,KAAK,IAAIiB,YAAY,QAAQ,oBAAoB;;AAE1D;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,eAAe;AACnD,OAAOC,0BAA0B,MAAM,mBAAmB;AAC1D,SAASC,4BAA4B,QAAQ,qBAAqB;AAClE,OA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is-menu-op
|
|
|
2377
2377
|
transform: none;
|
|
2378
2378
|
}
|
|
2379
2379
|
|
|
2380
|
-
:root :where(.wp-block-social-links)
|
|
2381
|
-
:root :where(.wp-block-social-links.is-style-logos-only .wp-block-social-links__social-placeholder .wp-social-link) {
|
|
2380
|
+
:root :where(.wp-block-social-links) {
|
|
2382
2381
|
padding: 0;
|
|
2383
2382
|
}
|
|
2384
2383
|
|
|
2385
|
-
:root :where(.wp-block-social-links__social-placeholder .wp-social-link) {
|
|
2386
|
-
padding: 0.25em;
|
|
2387
|
-
}
|
|
2388
|
-
|
|
2389
|
-
:root :where(.wp-block-social-links.is-style-pill-shape .wp-block-social-links__social-placeholder .wp-social-link) {
|
|
2390
|
-
padding-right: 0.6666666667em;
|
|
2391
|
-
padding-left: 0.6666666667em;
|
|
2392
|
-
}
|
|
2393
|
-
|
|
2394
|
-
.wp-block-social-links__social-placeholder {
|
|
2395
|
-
display: flex;
|
|
2396
|
-
opacity: 0.8;
|
|
2397
|
-
list-style: none;
|
|
2398
|
-
}
|
|
2399
|
-
.wp-block-social-links__social-placeholder > .wp-social-link {
|
|
2400
|
-
padding-right: 0 !important;
|
|
2401
|
-
margin-right: 0 !important;
|
|
2402
|
-
padding-left: 0 !important;
|
|
2403
|
-
margin-left: 0 !important;
|
|
2404
|
-
width: 0 !important;
|
|
2405
|
-
visibility: hidden;
|
|
2406
|
-
}
|
|
2407
|
-
.wp-block-social-links__social-placeholder > .wp-block-social-links__social-placeholder-icons {
|
|
2408
|
-
display: flex;
|
|
2409
|
-
}
|
|
2410
|
-
.wp-block-social-links__social-placeholder .wp-social-link::before {
|
|
2411
|
-
content: "";
|
|
2412
|
-
display: block;
|
|
2413
|
-
width: 1em;
|
|
2414
|
-
height: 1em;
|
|
2415
|
-
border-radius: 50%;
|
|
2416
|
-
}
|
|
2417
|
-
.is-style-logos-only .wp-block-social-links__social-placeholder .wp-social-link::before {
|
|
2418
|
-
background: currentColor;
|
|
2419
|
-
}
|
|
2420
|
-
|
|
2421
|
-
.wp-block-social-links .wp-block-social-links__social-prompt {
|
|
2422
|
-
min-height: 24px;
|
|
2423
|
-
list-style: none;
|
|
2424
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
2425
|
-
font-size: 13px;
|
|
2426
|
-
line-height: 24px;
|
|
2427
|
-
margin-top: auto;
|
|
2428
|
-
margin-bottom: auto;
|
|
2429
|
-
cursor: default;
|
|
2430
|
-
padding-left: 8px;
|
|
2431
|
-
}
|
|
2432
|
-
|
|
2433
2384
|
.wp-block[data-align=center] > .wp-block-social-links,
|
|
2434
2385
|
.wp-block.wp-block-social-links.aligncenter {
|
|
2435
2386
|
justify-content: center;
|
package/build-style/editor.css
CHANGED
|
@@ -2386,59 +2386,10 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
2386
2386
|
transform: none;
|
|
2387
2387
|
}
|
|
2388
2388
|
|
|
2389
|
-
:root :where(.wp-block-social-links)
|
|
2390
|
-
:root :where(.wp-block-social-links.is-style-logos-only .wp-block-social-links__social-placeholder .wp-social-link) {
|
|
2389
|
+
:root :where(.wp-block-social-links) {
|
|
2391
2390
|
padding: 0;
|
|
2392
2391
|
}
|
|
2393
2392
|
|
|
2394
|
-
:root :where(.wp-block-social-links__social-placeholder .wp-social-link) {
|
|
2395
|
-
padding: 0.25em;
|
|
2396
|
-
}
|
|
2397
|
-
|
|
2398
|
-
:root :where(.wp-block-social-links.is-style-pill-shape .wp-block-social-links__social-placeholder .wp-social-link) {
|
|
2399
|
-
padding-left: 0.6666666667em;
|
|
2400
|
-
padding-right: 0.6666666667em;
|
|
2401
|
-
}
|
|
2402
|
-
|
|
2403
|
-
.wp-block-social-links__social-placeholder {
|
|
2404
|
-
display: flex;
|
|
2405
|
-
opacity: 0.8;
|
|
2406
|
-
list-style: none;
|
|
2407
|
-
}
|
|
2408
|
-
.wp-block-social-links__social-placeholder > .wp-social-link {
|
|
2409
|
-
padding-left: 0 !important;
|
|
2410
|
-
margin-left: 0 !important;
|
|
2411
|
-
padding-right: 0 !important;
|
|
2412
|
-
margin-right: 0 !important;
|
|
2413
|
-
width: 0 !important;
|
|
2414
|
-
visibility: hidden;
|
|
2415
|
-
}
|
|
2416
|
-
.wp-block-social-links__social-placeholder > .wp-block-social-links__social-placeholder-icons {
|
|
2417
|
-
display: flex;
|
|
2418
|
-
}
|
|
2419
|
-
.wp-block-social-links__social-placeholder .wp-social-link::before {
|
|
2420
|
-
content: "";
|
|
2421
|
-
display: block;
|
|
2422
|
-
width: 1em;
|
|
2423
|
-
height: 1em;
|
|
2424
|
-
border-radius: 50%;
|
|
2425
|
-
}
|
|
2426
|
-
.is-style-logos-only .wp-block-social-links__social-placeholder .wp-social-link::before {
|
|
2427
|
-
background: currentColor;
|
|
2428
|
-
}
|
|
2429
|
-
|
|
2430
|
-
.wp-block-social-links .wp-block-social-links__social-prompt {
|
|
2431
|
-
min-height: 24px;
|
|
2432
|
-
list-style: none;
|
|
2433
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
2434
|
-
font-size: 13px;
|
|
2435
|
-
line-height: 24px;
|
|
2436
|
-
margin-top: auto;
|
|
2437
|
-
margin-bottom: auto;
|
|
2438
|
-
cursor: default;
|
|
2439
|
-
padding-right: 8px;
|
|
2440
|
-
}
|
|
2441
|
-
|
|
2442
2393
|
.wp-block[data-align=center] > .wp-block-social-links,
|
|
2443
2394
|
.wp-block.wp-block-social-links.aligncenter {
|
|
2444
2395
|
justify-content: center;
|
|
@@ -187,7 +187,6 @@
|
|
|
187
187
|
|
|
188
188
|
/* Image fill for versions 8 and onwards */
|
|
189
189
|
.wp-block-media-text.is-image-fill-element > .wp-block-media-text__media {
|
|
190
|
-
position: relative;
|
|
191
190
|
height: 100%;
|
|
192
191
|
min-height: 250px;
|
|
193
192
|
}
|
|
@@ -198,7 +197,6 @@
|
|
|
198
197
|
}
|
|
199
198
|
|
|
200
199
|
.wp-block-media-text.is-image-fill-element > .wp-block-media-text__media img {
|
|
201
|
-
position: absolute;
|
|
202
200
|
width: 100%;
|
|
203
201
|
height: 100%;
|
|
204
202
|
object-fit: cover;
|
|
@@ -197,7 +197,6 @@
|
|
|
197
197
|
|
|
198
198
|
/* Image fill for versions 8 and onwards */
|
|
199
199
|
.wp-block-media-text.is-image-fill-element > .wp-block-media-text__media {
|
|
200
|
-
position: relative;
|
|
201
200
|
height: 100%;
|
|
202
201
|
min-height: 250px;
|
|
203
202
|
}
|
|
@@ -208,7 +207,6 @@
|
|
|
208
207
|
}
|
|
209
208
|
|
|
210
209
|
.wp-block-media-text.is-image-fill-element > .wp-block-media-text__media img {
|
|
211
|
-
position: absolute;
|
|
212
210
|
width: 100%;
|
|
213
211
|
height: 100%;
|
|
214
212
|
object-fit: cover;
|
|
@@ -188,6 +188,7 @@
|
|
|
188
188
|
:where(.wp-block-search__button-inside .wp-block-search__inside-wrapper) {
|
|
189
189
|
padding: 4px;
|
|
190
190
|
border: 1px solid #949494;
|
|
191
|
+
background-color: #fff;
|
|
191
192
|
box-sizing: border-box;
|
|
192
193
|
}
|
|
193
194
|
:where(.wp-block-search__button-inside .wp-block-search__inside-wrapper) .wp-block-search__input {
|
|
@@ -188,6 +188,7 @@
|
|
|
188
188
|
:where(.wp-block-search__button-inside .wp-block-search__inside-wrapper) {
|
|
189
189
|
padding: 4px;
|
|
190
190
|
border: 1px solid #949494;
|
|
191
|
+
background-color: #fff;
|
|
191
192
|
box-sizing: border-box;
|
|
192
193
|
}
|
|
193
194
|
:where(.wp-block-search__button-inside .wp-block-search__inside-wrapper) .wp-block-search__input {
|
|
@@ -107,59 +107,10 @@
|
|
|
107
107
|
transform: none;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
:root :where(.wp-block-social-links)
|
|
111
|
-
:root :where(.wp-block-social-links.is-style-logos-only .wp-block-social-links__social-placeholder .wp-social-link) {
|
|
110
|
+
:root :where(.wp-block-social-links) {
|
|
112
111
|
padding: 0;
|
|
113
112
|
}
|
|
114
113
|
|
|
115
|
-
:root :where(.wp-block-social-links__social-placeholder .wp-social-link) {
|
|
116
|
-
padding: 0.25em;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
:root :where(.wp-block-social-links.is-style-pill-shape .wp-block-social-links__social-placeholder .wp-social-link) {
|
|
120
|
-
padding-right: 0.6666666667em;
|
|
121
|
-
padding-left: 0.6666666667em;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.wp-block-social-links__social-placeholder {
|
|
125
|
-
display: flex;
|
|
126
|
-
opacity: 0.8;
|
|
127
|
-
list-style: none;
|
|
128
|
-
}
|
|
129
|
-
.wp-block-social-links__social-placeholder > .wp-social-link {
|
|
130
|
-
padding-right: 0 !important;
|
|
131
|
-
margin-right: 0 !important;
|
|
132
|
-
padding-left: 0 !important;
|
|
133
|
-
margin-left: 0 !important;
|
|
134
|
-
width: 0 !important;
|
|
135
|
-
visibility: hidden;
|
|
136
|
-
}
|
|
137
|
-
.wp-block-social-links__social-placeholder > .wp-block-social-links__social-placeholder-icons {
|
|
138
|
-
display: flex;
|
|
139
|
-
}
|
|
140
|
-
.wp-block-social-links__social-placeholder .wp-social-link::before {
|
|
141
|
-
content: "";
|
|
142
|
-
display: block;
|
|
143
|
-
width: 1em;
|
|
144
|
-
height: 1em;
|
|
145
|
-
border-radius: 50%;
|
|
146
|
-
}
|
|
147
|
-
.is-style-logos-only .wp-block-social-links__social-placeholder .wp-social-link::before {
|
|
148
|
-
background: currentColor;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.wp-block-social-links .wp-block-social-links__social-prompt {
|
|
152
|
-
min-height: 24px;
|
|
153
|
-
list-style: none;
|
|
154
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
155
|
-
font-size: 13px;
|
|
156
|
-
line-height: 24px;
|
|
157
|
-
margin-top: auto;
|
|
158
|
-
margin-bottom: auto;
|
|
159
|
-
cursor: default;
|
|
160
|
-
padding-left: 8px;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
114
|
.wp-block[data-align=center] > .wp-block-social-links,
|
|
164
115
|
.wp-block.wp-block-social-links.aligncenter {
|
|
165
116
|
justify-content: center;
|
|
@@ -107,59 +107,10 @@
|
|
|
107
107
|
transform: none;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
:root :where(.wp-block-social-links)
|
|
111
|
-
:root :where(.wp-block-social-links.is-style-logos-only .wp-block-social-links__social-placeholder .wp-social-link) {
|
|
110
|
+
:root :where(.wp-block-social-links) {
|
|
112
111
|
padding: 0;
|
|
113
112
|
}
|
|
114
113
|
|
|
115
|
-
:root :where(.wp-block-social-links__social-placeholder .wp-social-link) {
|
|
116
|
-
padding: 0.25em;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
:root :where(.wp-block-social-links.is-style-pill-shape .wp-block-social-links__social-placeholder .wp-social-link) {
|
|
120
|
-
padding-left: 0.6666666667em;
|
|
121
|
-
padding-right: 0.6666666667em;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.wp-block-social-links__social-placeholder {
|
|
125
|
-
display: flex;
|
|
126
|
-
opacity: 0.8;
|
|
127
|
-
list-style: none;
|
|
128
|
-
}
|
|
129
|
-
.wp-block-social-links__social-placeholder > .wp-social-link {
|
|
130
|
-
padding-left: 0 !important;
|
|
131
|
-
margin-left: 0 !important;
|
|
132
|
-
padding-right: 0 !important;
|
|
133
|
-
margin-right: 0 !important;
|
|
134
|
-
width: 0 !important;
|
|
135
|
-
visibility: hidden;
|
|
136
|
-
}
|
|
137
|
-
.wp-block-social-links__social-placeholder > .wp-block-social-links__social-placeholder-icons {
|
|
138
|
-
display: flex;
|
|
139
|
-
}
|
|
140
|
-
.wp-block-social-links__social-placeholder .wp-social-link::before {
|
|
141
|
-
content: "";
|
|
142
|
-
display: block;
|
|
143
|
-
width: 1em;
|
|
144
|
-
height: 1em;
|
|
145
|
-
border-radius: 50%;
|
|
146
|
-
}
|
|
147
|
-
.is-style-logos-only .wp-block-social-links__social-placeholder .wp-social-link::before {
|
|
148
|
-
background: currentColor;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.wp-block-social-links .wp-block-social-links__social-prompt {
|
|
152
|
-
min-height: 24px;
|
|
153
|
-
list-style: none;
|
|
154
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
155
|
-
font-size: 13px;
|
|
156
|
-
line-height: 24px;
|
|
157
|
-
margin-top: auto;
|
|
158
|
-
margin-bottom: auto;
|
|
159
|
-
cursor: default;
|
|
160
|
-
padding-right: 8px;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
114
|
.wp-block[data-align=center] > .wp-block-social-links,
|
|
164
115
|
.wp-block.wp-block-social-links.aligncenter {
|
|
165
116
|
justify-content: center;
|
|
@@ -2185,7 +2185,6 @@ ul {
|
|
|
2185
2185
|
|
|
2186
2186
|
/* Image fill for versions 8 and onwards */
|
|
2187
2187
|
.wp-block-media-text.is-image-fill-element > .wp-block-media-text__media {
|
|
2188
|
-
position: relative;
|
|
2189
2188
|
height: 100%;
|
|
2190
2189
|
min-height: 250px;
|
|
2191
2190
|
}
|
|
@@ -2196,7 +2195,6 @@ ul {
|
|
|
2196
2195
|
}
|
|
2197
2196
|
|
|
2198
2197
|
.wp-block-media-text.is-image-fill-element > .wp-block-media-text__media img {
|
|
2199
|
-
position: absolute;
|
|
2200
2198
|
width: 100%;
|
|
2201
2199
|
height: 100%;
|
|
2202
2200
|
object-fit: cover;
|
|
@@ -3423,6 +3421,7 @@ ul.wp-block-rss.is-grid li {
|
|
|
3423
3421
|
:where(.wp-block-search__button-inside .wp-block-search__inside-wrapper) {
|
|
3424
3422
|
padding: 4px;
|
|
3425
3423
|
border: 1px solid #949494;
|
|
3424
|
+
background-color: #fff;
|
|
3426
3425
|
box-sizing: border-box;
|
|
3427
3426
|
}
|
|
3428
3427
|
:where(.wp-block-search__button-inside .wp-block-search__inside-wrapper) .wp-block-search__input {
|
|
@@ -3954,10 +3953,6 @@ ul.wp-block-rss.is-grid li {
|
|
|
3954
3953
|
text-align: center;
|
|
3955
3954
|
justify-content: center;
|
|
3956
3955
|
}
|
|
3957
|
-
.wp-block-tag-cloud.alignfull {
|
|
3958
|
-
padding-right: 1em;
|
|
3959
|
-
padding-left: 1em;
|
|
3960
|
-
}
|
|
3961
3956
|
.wp-block-tag-cloud a {
|
|
3962
3957
|
display: inline-block;
|
|
3963
3958
|
margin-left: 5px;
|
package/build-style/style.css
CHANGED
|
@@ -2217,7 +2217,6 @@ ul {
|
|
|
2217
2217
|
|
|
2218
2218
|
/* Image fill for versions 8 and onwards */
|
|
2219
2219
|
.wp-block-media-text.is-image-fill-element > .wp-block-media-text__media {
|
|
2220
|
-
position: relative;
|
|
2221
2220
|
height: 100%;
|
|
2222
2221
|
min-height: 250px;
|
|
2223
2222
|
}
|
|
@@ -2228,7 +2227,6 @@ ul {
|
|
|
2228
2227
|
}
|
|
2229
2228
|
|
|
2230
2229
|
.wp-block-media-text.is-image-fill-element > .wp-block-media-text__media img {
|
|
2231
|
-
position: absolute;
|
|
2232
2230
|
width: 100%;
|
|
2233
2231
|
height: 100%;
|
|
2234
2232
|
object-fit: cover;
|
|
@@ -3457,6 +3455,7 @@ ul.wp-block-rss.is-grid li {
|
|
|
3457
3455
|
:where(.wp-block-search__button-inside .wp-block-search__inside-wrapper) {
|
|
3458
3456
|
padding: 4px;
|
|
3459
3457
|
border: 1px solid #949494;
|
|
3458
|
+
background-color: #fff;
|
|
3460
3459
|
box-sizing: border-box;
|
|
3461
3460
|
}
|
|
3462
3461
|
:where(.wp-block-search__button-inside .wp-block-search__inside-wrapper) .wp-block-search__input {
|
|
@@ -3989,10 +3988,6 @@ ul.wp-block-rss.is-grid li {
|
|
|
3989
3988
|
text-align: center;
|
|
3990
3989
|
justify-content: center;
|
|
3991
3990
|
}
|
|
3992
|
-
.wp-block-tag-cloud.alignfull {
|
|
3993
|
-
padding-left: 1em;
|
|
3994
|
-
padding-right: 1em;
|
|
3995
|
-
}
|
|
3996
3991
|
.wp-block-tag-cloud a {
|
|
3997
3992
|
display: inline-block;
|
|
3998
3993
|
margin-right: 5px;
|