@wordpress/block-library 8.20.0 → 8.21.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 +7 -0
- package/README.md +12 -0
- package/build/block/index.js +2 -1
- package/build/block/index.js.map +1 -1
- package/build/code/edit.native.js +8 -2
- package/build/code/edit.native.js.map +1 -1
- package/build/cover/deprecated.js +110 -1
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/index.js +9 -3
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +1 -2
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/index.js +0 -3
- package/build/cover/index.js.map +1 -1
- package/build/cover/save.js +2 -1
- package/build/cover/save.js.map +1 -1
- package/build/cover/shared.js +1 -1
- package/build/cover/shared.js.map +1 -1
- package/build/footnotes/index.js +1 -0
- package/build/footnotes/index.js.map +1 -1
- package/build/form/edit.js +138 -0
- package/build/form/edit.js.map +1 -0
- package/build/form/index.js +92 -0
- package/build/form/index.js.map +1 -0
- package/build/form/init.js +13 -0
- package/build/form/init.js.map +1 -0
- package/build/form/save.js +28 -0
- package/build/form/save.js.map +1 -0
- package/build/form/utils.js +24 -0
- package/build/form/utils.js.map +1 -0
- package/build/form/variations.js +95 -0
- package/build/form/variations.js.map +1 -0
- package/build/form/view.js +42 -0
- package/build/form/view.js.map +1 -0
- package/build/form-input/edit.js +124 -0
- package/build/form-input/edit.js.map +1 -0
- package/build/form-input/index.js +105 -0
- package/build/form-input/index.js.map +1 -0
- package/build/form-input/init.js +13 -0
- package/build/form-input/init.js.map +1 -0
- package/build/form-input/save.js +87 -0
- package/build/form-input/save.js.map +1 -0
- package/build/form-input/variations.js +93 -0
- package/build/form-input/variations.js.map +1 -0
- package/build/form-submission-notification/edit.js +59 -0
- package/build/form-submission-notification/edit.js.map +1 -0
- package/build/form-submission-notification/index.js +56 -0
- package/build/form-submission-notification/index.js.map +1 -0
- package/build/form-submission-notification/init.js +13 -0
- package/build/form-submission-notification/init.js.map +1 -0
- package/build/form-submission-notification/save.js +33 -0
- package/build/form-submission-notification/save.js.map +1 -0
- package/build/form-submission-notification/variations.js +63 -0
- package/build/form-submission-notification/variations.js.map +1 -0
- package/build/form-submit-button/edit.js +32 -0
- package/build/form-submit-button/edit.js.map +1 -0
- package/build/form-submit-button/index.js +44 -0
- package/build/form-submit-button/index.js.map +1 -0
- package/build/form-submit-button/init.js +13 -0
- package/build/form-submit-button/init.js.map +1 -0
- package/build/form-submit-button/save.js +22 -0
- package/build/form-submit-button/save.js.map +1 -0
- package/build/group/index.js +0 -1
- package/build/group/index.js.map +1 -1
- package/build/heading/index.js +3 -2
- package/build/heading/index.js.map +1 -1
- package/build/image/image.js +4 -1
- package/build/image/image.js.map +1 -1
- package/build/image/view.js +82 -40
- package/build/image/view.js.map +1 -1
- package/build/index.js +10 -0
- package/build/index.js.map +1 -1
- package/build/latest-posts/edit.js +6 -2
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list-item/hooks/use-merge.js +15 -15
- package/build/list-item/hooks/use-merge.js.map +1 -1
- package/build/lock-unlock.js +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/missing/edit.native.js +14 -62
- package/build/missing/edit.native.js.map +1 -1
- package/build/navigation/edit/index.js +0 -1
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/index.js +2 -1
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/view.js +27 -5
- package/build/navigation/view.js.map +1 -1
- package/build/page-list-item/edit.js +3 -1
- package/build/page-list-item/edit.js.map +1 -1
- package/build/paragraph/index.js +7 -0
- package/build/paragraph/index.js.map +1 -1
- package/build/pattern/index.js +2 -1
- package/build/pattern/index.js.map +1 -1
- package/build/template-part/index.js +2 -1
- package/build/template-part/index.js.map +1 -1
- package/build-module/block/index.js +2 -1
- package/build-module/block/index.js.map +1 -1
- package/build-module/code/edit.native.js +8 -2
- package/build-module/code/edit.native.js.map +1 -1
- package/build-module/cover/deprecated.js +110 -1
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/index.js +9 -3
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +1 -2
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/index.js +0 -3
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/save.js +2 -1
- package/build-module/cover/save.js.map +1 -1
- package/build-module/cover/shared.js +1 -1
- package/build-module/cover/shared.js.map +1 -1
- package/build-module/footnotes/index.js +1 -0
- package/build-module/footnotes/index.js.map +1 -1
- package/build-module/form/edit.js +130 -0
- package/build-module/form/edit.js.map +1 -0
- package/build-module/form/index.js +82 -0
- package/build-module/form/index.js.map +1 -0
- package/build-module/form/init.js +6 -0
- package/build-module/form/init.js.map +1 -0
- package/build-module/form/save.js +20 -0
- package/build-module/form/save.js.map +1 -0
- package/build-module/form/utils.js +15 -0
- package/build-module/form/utils.js.map +1 -0
- package/build-module/form/variations.js +86 -0
- package/build-module/form/variations.js.map +1 -0
- package/build-module/form/view.js +40 -0
- package/build-module/form/view.js.map +1 -0
- package/build-module/form-input/edit.js +115 -0
- package/build-module/form-input/edit.js.map +1 -0
- package/build-module/form-input/index.js +95 -0
- package/build-module/form-input/index.js.map +1 -0
- package/build-module/form-input/init.js +6 -0
- package/build-module/form-input/init.js.map +1 -0
- package/build-module/form-input/save.js +80 -0
- package/build-module/form-input/save.js.map +1 -0
- package/build-module/form-input/variations.js +85 -0
- package/build-module/form-input/variations.js.map +1 -0
- package/build-module/form-submission-notification/edit.js +50 -0
- package/build-module/form-submission-notification/edit.js.map +1 -0
- package/build-module/form-submission-notification/index.js +47 -0
- package/build-module/form-submission-notification/index.js.map +1 -0
- package/build-module/form-submission-notification/init.js +6 -0
- package/build-module/form-submission-notification/init.js.map +1 -0
- package/build-module/form-submission-notification/save.js +25 -0
- package/build-module/form-submission-notification/save.js.map +1 -0
- package/build-module/form-submission-notification/variations.js +55 -0
- package/build-module/form-submission-notification/variations.js.map +1 -0
- package/build-module/form-submit-button/edit.js +24 -0
- package/build-module/form-submit-button/edit.js.map +1 -0
- package/build-module/form-submit-button/index.js +34 -0
- package/build-module/form-submit-button/index.js.map +1 -0
- package/build-module/form-submit-button/init.js +6 -0
- package/build-module/form-submit-button/init.js.map +1 -0
- package/build-module/form-submit-button/save.js +14 -0
- package/build-module/form-submit-button/save.js.map +1 -0
- package/build-module/group/index.js +0 -1
- package/build-module/group/index.js.map +1 -1
- package/build-module/heading/index.js +3 -2
- package/build-module/heading/index.js.map +1 -1
- package/build-module/image/image.js +4 -1
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/view.js +82 -40
- package/build-module/image/view.js.map +1 -1
- package/build-module/index.js +10 -0
- package/build-module/index.js.map +1 -1
- package/build-module/latest-posts/edit.js +6 -2
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list-item/hooks/use-merge.js +15 -15
- package/build-module/list-item/hooks/use-merge.js.map +1 -1
- package/build-module/lock-unlock.js +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/missing/edit.native.js +17 -65
- package/build-module/missing/edit.native.js.map +1 -1
- package/build-module/navigation/edit/index.js +0 -1
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/index.js +2 -1
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/view.js +27 -5
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/page-list-item/edit.js +3 -1
- package/build-module/page-list-item/edit.js.map +1 -1
- package/build-module/paragraph/index.js +7 -0
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/pattern/index.js +2 -1
- package/build-module/pattern/index.js.map +1 -1
- package/build-module/template-part/index.js +2 -1
- package/build-module/template-part/index.js.map +1 -1
- package/build-style/editor-rtl.css +50 -0
- package/build-style/editor.css +50 -0
- package/build-style/form-input/editor-rtl.css +106 -0
- package/build-style/form-input/editor.css +106 -0
- package/build-style/form-input/style-rtl.css +135 -0
- package/build-style/form-input/style.css +135 -0
- package/build-style/form-submission-notification/editor-rtl.css +118 -0
- package/build-style/form-submission-notification/editor.css +118 -0
- package/build-style/form-submit-button/style-rtl.css +91 -0
- package/build-style/form-submit-button/style.css +91 -0
- package/build-style/image/style-rtl.css +39 -5
- package/build-style/image/style.css +39 -5
- package/build-style/query/style-rtl.css +0 -10
- package/build-style/query/style.css +0 -10
- package/build-style/style-rtl.css +87 -5
- package/build-style/style.css +87 -5
- package/package.json +32 -32
- package/src/block/block.json +2 -1
- package/src/code/edit.native.js +15 -1
- package/src/cover/block.json +0 -3
- package/src/cover/deprecated.js +151 -1
- package/src/cover/edit/index.js +12 -3
- package/src/cover/edit/inspector-controls.js +19 -25
- package/src/cover/save.js +2 -1
- package/src/cover/shared.js +1 -1
- package/src/editor.scss +2 -0
- package/src/footnotes/block.json +1 -0
- package/src/form/block.json +60 -0
- package/src/form/edit.js +179 -0
- package/src/form/index.js +20 -0
- package/src/form/index.php +214 -0
- package/src/form/init.js +6 -0
- package/src/form/save.js +20 -0
- package/src/form/utils.js +39 -0
- package/src/form/variations.js +139 -0
- package/src/form/view.js +41 -0
- package/src/form-input/block.json +73 -0
- package/src/form-input/edit.js +151 -0
- package/src/form-input/editor.scss +24 -0
- package/src/form-input/index.js +20 -0
- package/src/form-input/index.php +45 -0
- package/src/form-input/init.js +6 -0
- package/src/form-input/save.js +83 -0
- package/src/form-input/style.scss +61 -0
- package/src/form-input/variations.js +82 -0
- package/src/form-submission-notification/block.json +19 -0
- package/src/form-submission-notification/edit.js +63 -0
- package/src/form-submission-notification/editor.scss +45 -0
- package/src/form-submission-notification/index.js +26 -0
- package/src/form-submission-notification/index.php +48 -0
- package/src/form-submission-notification/init.js +6 -0
- package/src/form-submission-notification/save.js +28 -0
- package/src/form-submission-notification/variations.js +59 -0
- package/src/form-submit-button/block.json +14 -0
- package/src/form-submit-button/edit.js +33 -0
- package/src/form-submit-button/index.js +18 -0
- package/src/form-submit-button/init.js +6 -0
- package/src/form-submit-button/save.js +14 -0
- package/src/form-submit-button/style.scss +3 -0
- package/src/group/block.json +0 -1
- package/src/heading/index.js +4 -2
- package/src/image/image.js +10 -0
- package/src/image/index.php +128 -82
- package/src/image/style.scss +49 -5
- package/src/image/view.js +100 -52
- package/src/index.js +10 -0
- package/src/latest-posts/edit.js +11 -2
- package/src/latest-posts/index.php +17 -8
- package/src/list-item/hooks/use-merge.js +20 -23
- package/src/lock-unlock.js +1 -1
- package/src/missing/edit.native.js +17 -115
- package/src/missing/style.native.scss +0 -67
- package/src/missing/test/edit-integration.native.js +135 -49
- package/src/missing/test/edit.native.js +0 -41
- package/src/navigation/block.json +2 -1
- package/src/navigation/edit/index.js +0 -1
- package/src/navigation/index.php +28 -8
- package/src/navigation/view.js +25 -6
- package/src/page-list-item/edit.js +2 -0
- package/src/paragraph/index.js +10 -0
- package/src/pattern/block.json +2 -1
- package/src/pattern/index.php +0 -3
- package/src/post-navigation-link/index.php +2 -1
- package/src/preformatted/test/edit.native.js +38 -0
- package/src/query/index.php +3 -2
- package/src/query/style.scss +0 -11
- package/src/search/index.php +0 -4
- package/src/style.scss +1 -0
- package/src/template-part/block.json +2 -1
- package/src/template-part/index.php +4 -7
- package/src/verse/test/edit.native.js +37 -0
package/build/image/view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_interactivity","require","focusableSelectors","scrollCallback","isTouching","lastTouchTime","handleScroll","context","Date","now","window","scrollTo","core","image","scrollLeftReset","scrollTopReset","store","state","windowWidth","innerWidth","windowHeight","innerHeight","actions","showLightbox","event","imageLoaded","initialized","lastFocusedElement","document","activeElement","scrollDelta","lightboxEnabled","setStyles","pageYOffset","documentElement","scrollTop","pageXOffset","scrollLeft","bind","addEventListener","hideLightbox","hideAnimationEnabled","setTimeout","removeEventListener","focus","preventScroll","handleKeydown","key","keyCode","shiftKey","firstFocusableElement","preventDefault","lastFocusableElement","handleLoad","effects","ref","imageCurrentSrc","currentSrc","setButtonStyles","handleTouchStart","handleTouchMove","handleTouchEnd","selectors","roleAttribute","lightboxObjectFit","enlargedImgSrc","imageUploadedSrc","setCurrentSrc","complete","initLightbox","figureRef","querySelector","imageRef","focusableElements","querySelectorAll","length","naturalWidth","naturalHeight","offsetWidth","offsetHeight","scaleAttr","naturalRatio","offsetRatio","imageButtonWidth","buttonHeight","imageButtonHeight","imageButtonTop","buttonWidth","imageButtonLeft","afterLoad","debounce","originalWidth","originalHeight","target","nextElementSibling","x","screenPosX","y","screenPosY","getBoundingClientRect","originalRatio","heightWithoutSpace","widthWithoutSpace","imgMaxWidth","parseFloat","targetWidth","imgMaxHeight","targetHeight","imgRatio","containerMaxWidth","containerMaxHeight","containerWidth","containerHeight","toFixed","reducedHeight","reducedWidth","horizontalPadding","verticalPadding","targetMaxWidth","Math","min","targetMaxHeight","targetContainerRatio","containerScale","lightboxImgWidth","lightboxImgHeight","styleTag","getElementById","createElement","id","head","appendChild","innerHTML","func","wait","timeout","later","clearTimeout"],"sources":["@wordpress/block-library/src/image/view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store } from '@wordpress/interactivity';\n\nconst focusableSelectors = [\n\t'a[href]',\n\t'area[href]',\n\t'input:not([disabled]):not([type=\"hidden\"]):not([aria-hidden])',\n\t'select:not([disabled]):not([aria-hidden])',\n\t'textarea:not([disabled]):not([aria-hidden])',\n\t'button:not([disabled]):not([aria-hidden])',\n\t'iframe',\n\t'object',\n\t'embed',\n\t'[contenteditable]',\n\t'[tabindex]:not([tabindex^=\"-\"])',\n];\n\n/*\n * Stores a context-bound scroll handler.\n *\n * This callback could be defined inline inside of the store\n * object but it's created externally to avoid confusion about\n * how its logic is called. This logic is not referenced directly\n * by the directives in the markup because the scroll event we\n * need to listen to is triggered on the window; so by defining it\n * outside of the store, we signal that the behavior here is different.\n * If we find a compelling reason to move it to the store, feel free.\n *\n * @type {Function}\n */\nlet scrollCallback;\n\n/*\n * Tracks whether user is touching screen; used to\n * differentiate behavior for touch and mouse input.\n *\n * @type {boolean}\n */\nlet isTouching = false;\n\n/*\n * Tracks the last time the screen was touched; used to\n * differentiate behavior for touch and mouse input.\n *\n * @type {number}\n */\nlet lastTouchTime = 0;\n\n/*\n * Lightbox page-scroll handler: prevents scrolling.\n *\n * This handler is added to prevent scrolling behaviors that\n * trigger content shift while the lightbox is open.\n *\n * It would be better to accomplish this through CSS alone, but\n * using overflow: hidden is currently the only way to do so, and\n * that causes the layout to shift and prevents the zoom animation\n * from working in some cases because we're unable to account for\n * the layout shift when doing the animation calculations. Instead,\n * here we use JavaScript to prevent and reset the scrolling\n * behavior. In the future, we may be able to use CSS or overflow: hidden\n * instead to not rely on JavaScript, but this seems to be the best approach\n * for now that provides the best visual experience.\n *\n * @param {Object} context Interactivity page context?\n */\nfunction handleScroll( context ) {\n\t// We can't override the scroll behavior on mobile devices\n\t// because doing so breaks the pinch to zoom functionality, and we\n\t// want to allow users to zoom in further on the high-res image.\n\tif ( ! isTouching && Date.now() - lastTouchTime > 450 ) {\n\t\t// We are unable to use event.preventDefault() to prevent scrolling\n\t\t// because the scroll event can't be canceled, so we reset the position instead.\n\t\twindow.scrollTo(\n\t\t\tcontext.core.image.scrollLeftReset,\n\t\t\tcontext.core.image.scrollTopReset\n\t\t);\n\t}\n}\n\nstore(\n\t{\n\t\tstate: {\n\t\t\tcore: {\n\t\t\t\timage: {\n\t\t\t\t\twindowWidth: window.innerWidth,\n\t\t\t\t\twindowHeight: window.innerHeight,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\tcore: {\n\t\t\t\timage: {\n\t\t\t\t\tshowLightbox: ( { context, event } ) => {\n\t\t\t\t\t\t// We can't initialize the lightbox until the reference\n\t\t\t\t\t\t// image is loaded, otherwise the UX is broken.\n\t\t\t\t\t\tif ( ! context.core.image.imageLoaded ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontext.core.image.initialized = true;\n\t\t\t\t\t\tcontext.core.image.lastFocusedElement =\n\t\t\t\t\t\t\twindow.document.activeElement;\n\t\t\t\t\t\tcontext.core.image.scrollDelta = 0;\n\n\t\t\t\t\t\tcontext.core.image.lightboxEnabled = true;\n\t\t\t\t\t\tsetStyles( context, event );\n\n\t\t\t\t\t\tcontext.core.image.scrollTopReset =\n\t\t\t\t\t\t\twindow.pageYOffset ||\n\t\t\t\t\t\t\tdocument.documentElement.scrollTop;\n\n\t\t\t\t\t\t// In most cases, this value will be 0, but this is included\n\t\t\t\t\t\t// in case a user has created a page with horizontal scrolling.\n\t\t\t\t\t\tcontext.core.image.scrollLeftReset =\n\t\t\t\t\t\t\twindow.pageXOffset ||\n\t\t\t\t\t\t\tdocument.documentElement.scrollLeft;\n\n\t\t\t\t\t\t// We define and bind the scroll callback here so\n\t\t\t\t\t\t// that we can pass the context and as an argument.\n\t\t\t\t\t\t// We may be able to change this in the future if we\n\t\t\t\t\t\t// define the scroll callback in the store instead, but\n\t\t\t\t\t\t// this approach seems to tbe clearest for now.\n\t\t\t\t\t\tscrollCallback = handleScroll.bind( null, context );\n\n\t\t\t\t\t\t// We need to add a scroll event listener to the window\n\t\t\t\t\t\t// here because we are unable to otherwise access it via\n\t\t\t\t\t\t// the Interactivity API directives. If we add a native way\n\t\t\t\t\t\t// to access the window, we can remove this.\n\t\t\t\t\t\twindow.addEventListener(\n\t\t\t\t\t\t\t'scroll',\n\t\t\t\t\t\t\tscrollCallback,\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t\thideLightbox: async ( { context } ) => {\n\t\t\t\t\t\tcontext.core.image.hideAnimationEnabled = true;\n\t\t\t\t\t\tif ( context.core.image.lightboxEnabled ) {\n\t\t\t\t\t\t\t// We want to wait until the close animation is completed\n\t\t\t\t\t\t\t// before allowing a user to scroll again. The duration of this\n\t\t\t\t\t\t\t// animation is defined in the styles.scss and depends on if the\n\t\t\t\t\t\t\t// animation is 'zoom' or 'fade', but in any case we should wait\n\t\t\t\t\t\t\t// a few milliseconds longer than the duration, otherwise a user\n\t\t\t\t\t\t\t// may scroll too soon and cause the animation to look sloppy.\n\t\t\t\t\t\t\tsetTimeout( function () {\n\t\t\t\t\t\t\t\twindow.removeEventListener(\n\t\t\t\t\t\t\t\t\t'scroll',\n\t\t\t\t\t\t\t\t\tscrollCallback\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}, 450 );\n\n\t\t\t\t\t\t\tcontext.core.image.lightboxEnabled = false;\n\t\t\t\t\t\t\tcontext.core.image.lastFocusedElement.focus( {\n\t\t\t\t\t\t\t\tpreventScroll: true,\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\thandleKeydown: ( { context, actions, event } ) => {\n\t\t\t\t\t\tif ( context.core.image.lightboxEnabled ) {\n\t\t\t\t\t\t\tif ( event.key === 'Tab' || event.keyCode === 9 ) {\n\t\t\t\t\t\t\t\t// If shift + tab it change the direction\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tevent.shiftKey &&\n\t\t\t\t\t\t\t\t\twindow.document.activeElement ===\n\t\t\t\t\t\t\t\t\t\tcontext.core.image.firstFocusableElement\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\tcontext.core.image.lastFocusableElement.focus();\n\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t! event.shiftKey &&\n\t\t\t\t\t\t\t\t\twindow.document.activeElement ===\n\t\t\t\t\t\t\t\t\t\tcontext.core.image.lastFocusableElement\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\tcontext.core.image.firstFocusableElement.focus();\n\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 (\n\t\t\t\t\t\t\t\tevent.key === 'Escape' ||\n\t\t\t\t\t\t\t\tevent.keyCode === 27\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tactions.core.image.hideLightbox( {\n\t\t\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\t\t\tevent,\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\thandleLoad: ( { state, context, effects, ref } ) => {\n\t\t\t\t\t\tcontext.core.image.imageLoaded = true;\n\t\t\t\t\t\tcontext.core.image.imageCurrentSrc = ref.currentSrc;\n\t\t\t\t\t\teffects.core.image.setButtonStyles( {\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\tref,\n\t\t\t\t\t\t} );\n\t\t\t\t\t},\n\t\t\t\t\thandleTouchStart: () => {\n\t\t\t\t\t\tisTouching = true;\n\t\t\t\t\t},\n\t\t\t\t\thandleTouchMove: ( { context, event } ) => {\n\t\t\t\t\t\t// On mobile devices, we want to prevent triggering the\n\t\t\t\t\t\t// scroll event because otherwise the page jumps around as\n\t\t\t\t\t\t// we reset the scroll position. This also means that closing\n\t\t\t\t\t\t// the lightbox requires that a user perform a simple tap. This\n\t\t\t\t\t\t// may be changed in the future if we find a better alternative\n\t\t\t\t\t\t// to override or reset the scroll position during swipe actions.\n\t\t\t\t\t\tif ( context.core.image.lightboxEnabled ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\thandleTouchEnd: () => {\n\t\t\t\t\t\t// We need to wait a few milliseconds before resetting\n\t\t\t\t\t\t// to ensure that pinch to zoom works consistently\n\t\t\t\t\t\t// on mobile devices when the lightbox is open.\n\t\t\t\t\t\tlastTouchTime = Date.now();\n\t\t\t\t\t\tisTouching = false;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tselectors: {\n\t\t\tcore: {\n\t\t\t\timage: {\n\t\t\t\t\troleAttribute: ( { context } ) => {\n\t\t\t\t\t\treturn context.core.image.lightboxEnabled\n\t\t\t\t\t\t\t? 'dialog'\n\t\t\t\t\t\t\t: '';\n\t\t\t\t\t},\n\t\t\t\t\tlightboxObjectFit: ( { context } ) => {\n\t\t\t\t\t\tif ( context.core.image.initialized ) {\n\t\t\t\t\t\t\treturn 'cover';\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tenlargedImgSrc: ( { context } ) => {\n\t\t\t\t\t\treturn context.core.image.initialized\n\t\t\t\t\t\t\t? context.core.image.imageUploadedSrc\n\t\t\t\t\t\t\t: '';\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\teffects: {\n\t\t\tcore: {\n\t\t\t\timage: {\n\t\t\t\t\tsetCurrentSrc: ( { context, ref } ) => {\n\t\t\t\t\t\tif ( ref.complete ) {\n\t\t\t\t\t\t\tcontext.core.image.imageLoaded = true;\n\t\t\t\t\t\t\tcontext.core.image.imageCurrentSrc = ref.currentSrc;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tinitLightbox: async ( { context, ref } ) => {\n\t\t\t\t\t\tcontext.core.image.figureRef =\n\t\t\t\t\t\t\tref.querySelector( 'figure' );\n\t\t\t\t\t\tcontext.core.image.imageRef =\n\t\t\t\t\t\t\tref.querySelector( 'img' );\n\t\t\t\t\t\tif ( context.core.image.lightboxEnabled ) {\n\t\t\t\t\t\t\tconst focusableElements =\n\t\t\t\t\t\t\t\tref.querySelectorAll( focusableSelectors );\n\t\t\t\t\t\t\tcontext.core.image.firstFocusableElement =\n\t\t\t\t\t\t\t\tfocusableElements[ 0 ];\n\t\t\t\t\t\t\tcontext.core.image.lastFocusableElement =\n\t\t\t\t\t\t\t\tfocusableElements[\n\t\t\t\t\t\t\t\t\tfocusableElements.length - 1\n\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\tref.querySelector( '.close-button' ).focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tsetButtonStyles: ( { state, context, ref } ) => {\n\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\tnaturalWidth,\n\t\t\t\t\t\t\tnaturalHeight,\n\t\t\t\t\t\t\toffsetWidth,\n\t\t\t\t\t\t\toffsetHeight,\n\t\t\t\t\t\t} = ref;\n\n\t\t\t\t\t\t// If the image isn't loaded yet, we can't\n\t\t\t\t\t\t// calculate how big the button should be.\n\t\t\t\t\t\tif ( naturalWidth === 0 || naturalHeight === 0 ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Subscribe to the window dimensions so we can\n\t\t\t\t\t\t// recalculate the styles if the window is resized.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t( state.core.image.windowWidth ||\n\t\t\t\t\t\t\t\tstate.core.image.windowHeight ) &&\n\t\t\t\t\t\t\tcontext.core.image.scaleAttr === 'contain'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// In the case of an image with object-fit: contain, the\n\t\t\t\t\t\t\t// size of the img element can be larger than the image itself,\n\t\t\t\t\t\t\t// so we need to calculate the size of the button to match.\n\n\t\t\t\t\t\t\t// Natural ratio of the image.\n\t\t\t\t\t\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\t\t\t\t\t\t// Offset ratio of the image.\n\t\t\t\t\t\t\tconst offsetRatio = offsetWidth / offsetHeight;\n\n\t\t\t\t\t\t\tif ( naturalRatio > offsetRatio ) {\n\t\t\t\t\t\t\t\t// If it reaches the width first, keep\n\t\t\t\t\t\t\t\t// the width and recalculate the height.\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonWidth =\n\t\t\t\t\t\t\t\t\toffsetWidth;\n\t\t\t\t\t\t\t\tconst buttonHeight = offsetWidth / naturalRatio;\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonHeight =\n\t\t\t\t\t\t\t\t\tbuttonHeight;\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonTop =\n\t\t\t\t\t\t\t\t\t( offsetHeight - buttonHeight ) / 2;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// If it reaches the height first, keep\n\t\t\t\t\t\t\t\t// the height and recalculate the width.\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonHeight =\n\t\t\t\t\t\t\t\t\toffsetHeight;\n\t\t\t\t\t\t\t\tconst buttonWidth = offsetHeight * naturalRatio;\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonWidth =\n\t\t\t\t\t\t\t\t\tbuttonWidth;\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonLeft =\n\t\t\t\t\t\t\t\t\t( offsetWidth - buttonWidth ) / 2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// In all other cases, we can trust that the size of\n\t\t\t\t\t\t\t// the image is the right size for the button as well.\n\n\t\t\t\t\t\t\tcontext.core.image.imageButtonWidth = offsetWidth;\n\t\t\t\t\t\t\tcontext.core.image.imageButtonHeight = offsetHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tafterLoad: ( { state } ) => {\n\t\t\twindow.addEventListener(\n\t\t\t\t'resize',\n\t\t\t\tdebounce( () => {\n\t\t\t\t\tstate.core.image.windowWidth = window.innerWidth;\n\t\t\t\t\tstate.core.image.windowHeight = window.innerHeight;\n\t\t\t\t} )\n\t\t\t);\n\t\t},\n\t}\n);\n\n/*\n * Computes styles for the lightbox and adds them to the document.\n *\n * @function\n * @param {Object} context - An Interactivity API context\n * @param {Object} event - A triggering event\n */\nfunction setStyles( context, event ) {\n\t// The reference img element lies adjacent\n\t// to the event target button in the DOM.\n\tlet {\n\t\tnaturalWidth,\n\t\tnaturalHeight,\n\t\toffsetWidth: originalWidth,\n\t\toffsetHeight: originalHeight,\n\t} = event.target.nextElementSibling;\n\tlet { x: screenPosX, y: screenPosY } =\n\t\tevent.target.nextElementSibling.getBoundingClientRect();\n\n\t// Natural ratio of the image clicked to open the lightbox.\n\tconst naturalRatio = naturalWidth / naturalHeight;\n\t// Original ratio of the image clicked to open the lightbox.\n\tlet originalRatio = originalWidth / originalHeight;\n\n\t// If it has object-fit: contain, recalculate the original sizes\n\t// and the screen position without the blank spaces.\n\tif ( context.core.image.scaleAttr === 'contain' ) {\n\t\tif ( naturalRatio > originalRatio ) {\n\t\t\tconst heightWithoutSpace = originalWidth / naturalRatio;\n\t\t\t// Recalculate screen position without the top space.\n\t\t\tscreenPosY += ( originalHeight - heightWithoutSpace ) / 2;\n\t\t\toriginalHeight = heightWithoutSpace;\n\t\t} else {\n\t\t\tconst widthWithoutSpace = originalHeight * naturalRatio;\n\t\t\t// Recalculate screen position without the left space.\n\t\t\tscreenPosX += ( originalWidth - widthWithoutSpace ) / 2;\n\t\t\toriginalWidth = widthWithoutSpace;\n\t\t}\n\t}\n\toriginalRatio = originalWidth / originalHeight;\n\n\t// Typically, we use the image's full-sized dimensions. If those\n\t// dimensions have not been set (i.e. an external image with only one size),\n\t// the image's dimensions in the lightbox are the same\n\t// as those of the image in the content.\n\tlet imgMaxWidth = parseFloat(\n\t\tcontext.core.image.targetWidth !== 'none'\n\t\t\t? context.core.image.targetWidth\n\t\t\t: naturalWidth\n\t);\n\tlet imgMaxHeight = parseFloat(\n\t\tcontext.core.image.targetHeight !== 'none'\n\t\t\t? context.core.image.targetHeight\n\t\t\t: naturalHeight\n\t);\n\n\t// Ratio of the biggest image stored in the database.\n\tlet imgRatio = imgMaxWidth / imgMaxHeight;\n\tlet containerMaxWidth = imgMaxWidth;\n\tlet containerMaxHeight = imgMaxHeight;\n\tlet containerWidth = imgMaxWidth;\n\tlet containerHeight = imgMaxHeight;\n\t// Check if the target image has a different ratio than the original one (thumbnail).\n\t// Recalculate the width and height.\n\tif ( naturalRatio.toFixed( 2 ) !== imgRatio.toFixed( 2 ) ) {\n\t\tif ( naturalRatio > imgRatio ) {\n\t\t\t// If the width is reached before the height, we keep the maxWidth\n\t\t\t// and recalculate the height.\n\t\t\t// Unless the difference between the maxHeight and the reducedHeight\n\t\t\t// is higher than the maxWidth, where we keep the reducedHeight and\n\t\t\t// recalculate the width.\n\t\t\tconst reducedHeight = imgMaxWidth / naturalRatio;\n\t\t\tif ( imgMaxHeight - reducedHeight > imgMaxWidth ) {\n\t\t\t\timgMaxHeight = reducedHeight;\n\t\t\t\timgMaxWidth = reducedHeight * naturalRatio;\n\t\t\t} else {\n\t\t\t\timgMaxHeight = imgMaxWidth / naturalRatio;\n\t\t\t}\n\t\t} else {\n\t\t\t// If the height is reached before the width, we keep the maxHeight\n\t\t\t// and recalculate the width.\n\t\t\t// Unless the difference between the maxWidth and the reducedWidth\n\t\t\t// is higher than the maxHeight, where we keep the reducedWidth and\n\t\t\t// recalculate the height.\n\t\t\tconst reducedWidth = imgMaxHeight * naturalRatio;\n\t\t\tif ( imgMaxWidth - reducedWidth > imgMaxHeight ) {\n\t\t\t\timgMaxWidth = reducedWidth;\n\t\t\t\timgMaxHeight = reducedWidth / naturalRatio;\n\t\t\t} else {\n\t\t\t\timgMaxWidth = imgMaxHeight * naturalRatio;\n\t\t\t}\n\t\t}\n\t\tcontainerWidth = imgMaxWidth;\n\t\tcontainerHeight = imgMaxHeight;\n\t\timgRatio = imgMaxWidth / imgMaxHeight;\n\n\t\t// Calculate the max size of the container.\n\t\tif ( originalRatio > imgRatio ) {\n\t\t\tcontainerMaxWidth = imgMaxWidth;\n\t\t\tcontainerMaxHeight = containerMaxWidth / originalRatio;\n\t\t} else {\n\t\t\tcontainerMaxHeight = imgMaxHeight;\n\t\t\tcontainerMaxWidth = containerMaxHeight * originalRatio;\n\t\t}\n\t}\n\n\t// If the image has been pixelated on purpose, keep that size.\n\tif ( originalWidth > containerWidth || originalHeight > containerHeight ) {\n\t\tcontainerWidth = originalWidth;\n\t\tcontainerHeight = originalHeight;\n\t}\n\n\t// Calculate the final lightbox image size and the\n\t// scale factor. MaxWidth is either the window container\n\t// (accounting for padding) or the image resolution.\n\tlet horizontalPadding = 0;\n\tif ( window.innerWidth > 480 ) {\n\t\thorizontalPadding = 80;\n\t} else if ( window.innerWidth > 1920 ) {\n\t\thorizontalPadding = 160;\n\t}\n\tconst verticalPadding = 80;\n\n\tconst targetMaxWidth = Math.min(\n\t\twindow.innerWidth - horizontalPadding,\n\t\tcontainerWidth\n\t);\n\tconst targetMaxHeight = Math.min(\n\t\twindow.innerHeight - verticalPadding,\n\t\tcontainerHeight\n\t);\n\tconst targetContainerRatio = targetMaxWidth / targetMaxHeight;\n\n\tif ( originalRatio > targetContainerRatio ) {\n\t\t// If targetMaxWidth is reached before targetMaxHeight\n\t\tcontainerWidth = targetMaxWidth;\n\t\tcontainerHeight = containerWidth / originalRatio;\n\t} else {\n\t\t// If targetMaxHeight is reached before targetMaxWidth\n\t\tcontainerHeight = targetMaxHeight;\n\t\tcontainerWidth = containerHeight * originalRatio;\n\t}\n\n\tconst containerScale = originalWidth / containerWidth;\n\tconst lightboxImgWidth =\n\t\timgMaxWidth * ( containerWidth / containerMaxWidth );\n\tconst lightboxImgHeight =\n\t\timgMaxHeight * ( containerHeight / containerMaxHeight );\n\n\t// Add the CSS variables needed.\n\tlet styleTag = document.getElementById( 'wp-lightbox-styles' );\n\tif ( ! styleTag ) {\n\t\tstyleTag = document.createElement( 'style' );\n\t\tstyleTag.id = 'wp-lightbox-styles';\n\t\tdocument.head.appendChild( styleTag );\n\t}\n\n\t// As of this writing, using the calculations above will render the lightbox\n\t// with a small, erroneous whitespace on the left side of the image in iOS Safari,\n\t// perhaps due to an inconsistency in how browsers handle absolute positioning and CSS\n\t// transformation. In any case, adding 1 pixel to the container width and height solves\n\t// the problem, though this can be removed if the issue is fixed in the future.\n\tstyleTag.innerHTML = `\n\t\t:root {\n\t\t\t--wp--lightbox-initial-top-position: ${ screenPosY }px;\n\t\t\t--wp--lightbox-initial-left-position: ${ screenPosX }px;\n\t\t\t--wp--lightbox-container-width: ${ containerWidth + 1 }px;\n\t\t\t--wp--lightbox-container-height: ${ containerHeight + 1 }px;\n\t\t\t--wp--lightbox-image-width: ${ lightboxImgWidth }px;\n\t\t\t--wp--lightbox-image-height: ${ lightboxImgHeight }px;\n\t\t\t--wp--lightbox-scale: ${ containerScale };\n\t\t}\n\t`;\n}\n\n/*\n * Debounces a function call.\n *\n * @function\n * @param {Function} func - A function to be called\n * @param {number} wait - The time to wait before calling the function\n */\nfunction debounce( func, wait = 50 ) {\n\tlet timeout;\n\treturn () => {\n\t\tconst later = () => {\n\t\t\ttimeout = null;\n\t\t\tfunc();\n\t\t};\n\t\tclearTimeout( timeout );\n\t\ttimeout = setTimeout( later, wait );\n\t};\n}\n"],"mappings":";;AAGA,IAAAA,cAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,kBAAkB,GAAG,CAC1B,SAAS,EACT,YAAY,EACZ,+DAA+D,EAC/D,2CAA2C,EAC3C,6CAA6C,EAC7C,2CAA2C,EAC3C,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,mBAAmB,EACnB,iCAAiC,CACjC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,cAAc;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,UAAU,GAAG,KAAK;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,aAAa,GAAG,CAAC;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,YAAYA,CAAEC,OAAO,EAAG;EAChC;EACA;EACA;EACA,IAAK,CAAEH,UAAU,IAAII,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGJ,aAAa,GAAG,GAAG,EAAG;IACvD;IACA;IACAK,MAAM,CAACC,QAAQ,CACdJ,OAAO,CAACK,IAAI,CAACC,KAAK,CAACC,eAAe,EAClCP,OAAO,CAACK,IAAI,CAACC,KAAK,CAACE,cACpB,CAAC;EACF;AACD;AAEA,IAAAC,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D,OAAO,GAAG,IAAI;MACdF,IAAI,CAAC,CAAC;IACP,CAAC;IACDI,YAAY,CAAEF,OAAQ,CAAC;IACvBA,OAAO,GAAG7F,UAAU,CAAE8F,KAAK,EAAEF,IAAK,CAAC;EACpC,CAAC;AACF"}
|
|
1
|
+
{"version":3,"names":["_interactivity","require","focusableSelectors","scrollCallback","isTouching","lastTouchTime","handleScroll","context","Date","now","window","scrollTo","core","image","scrollLeftReset","scrollTopReset","store","state","windowWidth","innerWidth","windowHeight","innerHeight","actions","showLightbox","event","imageLoaded","initialized","lastFocusedElement","document","activeElement","scrollDelta","pointerType","lightboxEnabled","setStyles","imageRef","pageYOffset","documentElement","scrollTop","pageXOffset","scrollLeft","bind","addEventListener","hideLightbox","hideAnimationEnabled","setTimeout","removeEventListener","focus","preventScroll","handleKeydown","key","keyCode","shiftKey","firstFocusableElement","preventDefault","lastFocusableElement","handleLoad","effects","ref","imageCurrentSrc","currentSrc","setButtonStyles","handleTouchStart","handleTouchMove","handleTouchEnd","selectors","roleAttribute","ariaModal","dialogLabel","lightboxObjectFit","enlargedImgSrc","imageUploadedSrc","initOriginImage","complete","initLightbox","focusableElements","querySelectorAll","length","querySelector","naturalWidth","naturalHeight","offsetWidth","offsetHeight","figure","parentElement","figureWidth","clientWidth","figureHeight","clientHeight","caption","captionComputedStyle","getComputedStyle","parseFloat","marginTop","marginBottom","buttonOffsetTop","buttonOffsetRight","scaleAttr","naturalRatio","offsetRatio","referenceHeight","imageButtonTop","imageButtonRight","referenceWidth","setStylesOnResize","afterLoad","debounce","originalWidth","originalHeight","x","screenPosX","y","screenPosY","getBoundingClientRect","originalRatio","heightWithoutSpace","widthWithoutSpace","imgMaxWidth","targetWidth","imgMaxHeight","targetHeight","imgRatio","containerMaxWidth","containerMaxHeight","containerWidth","containerHeight","toFixed","reducedHeight","reducedWidth","horizontalPadding","verticalPadding","targetMaxWidth","Math","min","targetMaxHeight","targetContainerRatio","containerScale","lightboxImgWidth","lightboxImgHeight","styleTag","getElementById","createElement","id","head","appendChild","innerHTML","func","wait","timeout","later","clearTimeout"],"sources":["@wordpress/block-library/src/image/view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store } from '@wordpress/interactivity';\n\nconst focusableSelectors = [\n\t'a[href]',\n\t'area[href]',\n\t'input:not([disabled]):not([type=\"hidden\"]):not([aria-hidden])',\n\t'select:not([disabled]):not([aria-hidden])',\n\t'textarea:not([disabled]):not([aria-hidden])',\n\t'button:not([disabled]):not([aria-hidden])',\n\t'iframe',\n\t'object',\n\t'embed',\n\t'[contenteditable]',\n\t'[tabindex]:not([tabindex^=\"-\"])',\n];\n\n/*\n * Stores a context-bound scroll handler.\n *\n * This callback could be defined inline inside of the store\n * object but it's created externally to avoid confusion about\n * how its logic is called. This logic is not referenced directly\n * by the directives in the markup because the scroll event we\n * need to listen to is triggered on the window; so by defining it\n * outside of the store, we signal that the behavior here is different.\n * If we find a compelling reason to move it to the store, feel free.\n *\n * @type {Function}\n */\nlet scrollCallback;\n\n/*\n * Tracks whether user is touching screen; used to\n * differentiate behavior for touch and mouse input.\n *\n * @type {boolean}\n */\nlet isTouching = false;\n\n/*\n * Tracks the last time the screen was touched; used to\n * differentiate behavior for touch and mouse input.\n *\n * @type {number}\n */\nlet lastTouchTime = 0;\n\n/*\n * Lightbox page-scroll handler: prevents scrolling.\n *\n * This handler is added to prevent scrolling behaviors that\n * trigger content shift while the lightbox is open.\n *\n * It would be better to accomplish this through CSS alone, but\n * using overflow: hidden is currently the only way to do so, and\n * that causes the layout to shift and prevents the zoom animation\n * from working in some cases because we're unable to account for\n * the layout shift when doing the animation calculations. Instead,\n * here we use JavaScript to prevent and reset the scrolling\n * behavior. In the future, we may be able to use CSS or overflow: hidden\n * instead to not rely on JavaScript, but this seems to be the best approach\n * for now that provides the best visual experience.\n *\n * @param {Object} context Interactivity page context?\n */\nfunction handleScroll( context ) {\n\t// We can't override the scroll behavior on mobile devices\n\t// because doing so breaks the pinch to zoom functionality, and we\n\t// want to allow users to zoom in further on the high-res image.\n\tif ( ! isTouching && Date.now() - lastTouchTime > 450 ) {\n\t\t// We are unable to use event.preventDefault() to prevent scrolling\n\t\t// because the scroll event can't be canceled, so we reset the position instead.\n\t\twindow.scrollTo(\n\t\t\tcontext.core.image.scrollLeftReset,\n\t\t\tcontext.core.image.scrollTopReset\n\t\t);\n\t}\n}\n\nstore(\n\t{\n\t\tstate: {\n\t\t\tcore: {\n\t\t\t\timage: {\n\t\t\t\t\twindowWidth: window.innerWidth,\n\t\t\t\t\twindowHeight: window.innerHeight,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\tcore: {\n\t\t\t\timage: {\n\t\t\t\t\tshowLightbox: ( { context, event } ) => {\n\t\t\t\t\t\t// We can't initialize the lightbox until the reference\n\t\t\t\t\t\t// image is loaded, otherwise the UX is broken.\n\t\t\t\t\t\tif ( ! context.core.image.imageLoaded ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontext.core.image.initialized = true;\n\t\t\t\t\t\tcontext.core.image.lastFocusedElement =\n\t\t\t\t\t\t\twindow.document.activeElement;\n\t\t\t\t\t\tcontext.core.image.scrollDelta = 0;\n\t\t\t\t\t\tcontext.core.image.pointerType = event.pointerType;\n\n\t\t\t\t\t\tcontext.core.image.lightboxEnabled = true;\n\t\t\t\t\t\tsetStyles( context, context.core.image.imageRef );\n\n\t\t\t\t\t\tcontext.core.image.scrollTopReset =\n\t\t\t\t\t\t\twindow.pageYOffset ||\n\t\t\t\t\t\t\tdocument.documentElement.scrollTop;\n\n\t\t\t\t\t\t// In most cases, this value will be 0, but this is included\n\t\t\t\t\t\t// in case a user has created a page with horizontal scrolling.\n\t\t\t\t\t\tcontext.core.image.scrollLeftReset =\n\t\t\t\t\t\t\twindow.pageXOffset ||\n\t\t\t\t\t\t\tdocument.documentElement.scrollLeft;\n\n\t\t\t\t\t\t// We define and bind the scroll callback here so\n\t\t\t\t\t\t// that we can pass the context and as an argument.\n\t\t\t\t\t\t// We may be able to change this in the future if we\n\t\t\t\t\t\t// define the scroll callback in the store instead, but\n\t\t\t\t\t\t// this approach seems to tbe clearest for now.\n\t\t\t\t\t\tscrollCallback = handleScroll.bind( null, context );\n\n\t\t\t\t\t\t// We need to add a scroll event listener to the window\n\t\t\t\t\t\t// here because we are unable to otherwise access it via\n\t\t\t\t\t\t// the Interactivity API directives. If we add a native way\n\t\t\t\t\t\t// to access the window, we can remove this.\n\t\t\t\t\t\twindow.addEventListener(\n\t\t\t\t\t\t\t'scroll',\n\t\t\t\t\t\t\tscrollCallback,\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t\thideLightbox: async ( { context, event } ) => {\n\t\t\t\t\t\tcontext.core.image.hideAnimationEnabled = true;\n\t\t\t\t\t\tif ( context.core.image.lightboxEnabled ) {\n\t\t\t\t\t\t\t// We want to wait until the close animation is completed\n\t\t\t\t\t\t\t// before allowing a user to scroll again. The duration of this\n\t\t\t\t\t\t\t// animation is defined in the styles.scss and depends on if the\n\t\t\t\t\t\t\t// animation is 'zoom' or 'fade', but in any case we should wait\n\t\t\t\t\t\t\t// a few milliseconds longer than the duration, otherwise a user\n\t\t\t\t\t\t\t// may scroll too soon and cause the animation to look sloppy.\n\t\t\t\t\t\t\tsetTimeout( function () {\n\t\t\t\t\t\t\t\twindow.removeEventListener(\n\t\t\t\t\t\t\t\t\t'scroll',\n\t\t\t\t\t\t\t\t\tscrollCallback\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}, 450 );\n\n\t\t\t\t\t\t\tcontext.core.image.lightboxEnabled = false;\n\n\t\t\t\t\t\t\t// We want to avoid drawing attention to the button\n\t\t\t\t\t\t\t// after the lightbox closes for mouse and touch users.\n\t\t\t\t\t\t\t// Note that the `event.pointerType` property returns\n\t\t\t\t\t\t\t// as an empty string if a keyboard fired the event.\n\t\t\t\t\t\t\tif ( event.pointerType === '' ) {\n\t\t\t\t\t\t\t\tcontext.core.image.lastFocusedElement.focus( {\n\t\t\t\t\t\t\t\t\tpreventScroll: true,\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\thandleKeydown: ( { context, actions, event } ) => {\n\t\t\t\t\t\tif ( context.core.image.lightboxEnabled ) {\n\t\t\t\t\t\t\tif ( event.key === 'Tab' || event.keyCode === 9 ) {\n\t\t\t\t\t\t\t\t// If shift + tab it change the direction\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tevent.shiftKey &&\n\t\t\t\t\t\t\t\t\twindow.document.activeElement ===\n\t\t\t\t\t\t\t\t\t\tcontext.core.image.firstFocusableElement\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\tcontext.core.image.lastFocusableElement.focus();\n\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t! event.shiftKey &&\n\t\t\t\t\t\t\t\t\twindow.document.activeElement ===\n\t\t\t\t\t\t\t\t\t\tcontext.core.image.lastFocusableElement\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\tcontext.core.image.firstFocusableElement.focus();\n\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 (\n\t\t\t\t\t\t\t\tevent.key === 'Escape' ||\n\t\t\t\t\t\t\t\tevent.keyCode === 27\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tactions.core.image.hideLightbox( {\n\t\t\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\t\t\tevent,\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// This is fired just by lazily loaded\n\t\t\t\t\t// images on the page, not all images.\n\t\t\t\t\thandleLoad: ( { context, effects, ref } ) => {\n\t\t\t\t\t\tcontext.core.image.imageLoaded = true;\n\t\t\t\t\t\tcontext.core.image.imageCurrentSrc = ref.currentSrc;\n\t\t\t\t\t\teffects.core.image.setButtonStyles( {\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\tref,\n\t\t\t\t\t\t} );\n\t\t\t\t\t},\n\t\t\t\t\thandleTouchStart: () => {\n\t\t\t\t\t\tisTouching = true;\n\t\t\t\t\t},\n\t\t\t\t\thandleTouchMove: ( { context, event } ) => {\n\t\t\t\t\t\t// On mobile devices, we want to prevent triggering the\n\t\t\t\t\t\t// scroll event because otherwise the page jumps around as\n\t\t\t\t\t\t// we reset the scroll position. This also means that closing\n\t\t\t\t\t\t// the lightbox requires that a user perform a simple tap. This\n\t\t\t\t\t\t// may be changed in the future if we find a better alternative\n\t\t\t\t\t\t// to override or reset the scroll position during swipe actions.\n\t\t\t\t\t\tif ( context.core.image.lightboxEnabled ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\thandleTouchEnd: () => {\n\t\t\t\t\t\t// We need to wait a few milliseconds before resetting\n\t\t\t\t\t\t// to ensure that pinch to zoom works consistently\n\t\t\t\t\t\t// on mobile devices when the lightbox is open.\n\t\t\t\t\t\tlastTouchTime = Date.now();\n\t\t\t\t\t\tisTouching = false;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tselectors: {\n\t\t\tcore: {\n\t\t\t\timage: {\n\t\t\t\t\troleAttribute: ( { context } ) => {\n\t\t\t\t\t\treturn context.core.image.lightboxEnabled\n\t\t\t\t\t\t\t? 'dialog'\n\t\t\t\t\t\t\t: null;\n\t\t\t\t\t},\n\t\t\t\t\tariaModal: ( { context } ) => {\n\t\t\t\t\t\treturn context.core.image.lightboxEnabled\n\t\t\t\t\t\t\t? 'true'\n\t\t\t\t\t\t\t: null;\n\t\t\t\t\t},\n\t\t\t\t\tdialogLabel: ( { context } ) => {\n\t\t\t\t\t\treturn context.core.image.lightboxEnabled\n\t\t\t\t\t\t\t? context.core.image.dialogLabel\n\t\t\t\t\t\t\t: null;\n\t\t\t\t\t},\n\t\t\t\t\tlightboxObjectFit: ( { context } ) => {\n\t\t\t\t\t\tif ( context.core.image.initialized ) {\n\t\t\t\t\t\t\treturn 'cover';\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tenlargedImgSrc: ( { context } ) => {\n\t\t\t\t\t\treturn context.core.image.initialized\n\t\t\t\t\t\t\t? context.core.image.imageUploadedSrc\n\t\t\t\t\t\t\t: 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\teffects: {\n\t\t\tcore: {\n\t\t\t\timage: {\n\t\t\t\t\tinitOriginImage: ( { context, ref } ) => {\n\t\t\t\t\t\tcontext.core.image.imageRef = ref;\n\t\t\t\t\t\tif ( ref.complete ) {\n\t\t\t\t\t\t\tcontext.core.image.imageLoaded = true;\n\t\t\t\t\t\t\tcontext.core.image.imageCurrentSrc = ref.currentSrc;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tinitLightbox: async ( { context, ref } ) => {\n\t\t\t\t\t\tif ( context.core.image.lightboxEnabled ) {\n\t\t\t\t\t\t\tconst focusableElements =\n\t\t\t\t\t\t\t\tref.querySelectorAll( focusableSelectors );\n\t\t\t\t\t\t\tcontext.core.image.firstFocusableElement =\n\t\t\t\t\t\t\t\tfocusableElements[ 0 ];\n\t\t\t\t\t\t\tcontext.core.image.lastFocusableElement =\n\t\t\t\t\t\t\t\tfocusableElements[\n\t\t\t\t\t\t\t\t\tfocusableElements.length - 1\n\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\t// We want to avoid drawing unnecessary attention to the close\n\t\t\t\t\t\t\t// button for mouse and touch users. Note that even if opening\n\t\t\t\t\t\t\t// the lightbox via keyboard, the event fired is of type\n\t\t\t\t\t\t\t// `pointerEvent`, so we need to rely on the `event.pointerType`\n\t\t\t\t\t\t\t// property, which returns an empty string for keyboard events.\n\t\t\t\t\t\t\tif ( context.core.image.pointerType === '' ) {\n\t\t\t\t\t\t\t\tref.querySelector( '.close-button' ).focus();\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\tsetButtonStyles: ( { context, ref } ) => {\n\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\tnaturalWidth,\n\t\t\t\t\t\t\tnaturalHeight,\n\t\t\t\t\t\t\toffsetWidth,\n\t\t\t\t\t\t\toffsetHeight,\n\t\t\t\t\t\t} = ref;\n\n\t\t\t\t\t\t// If the image isn't loaded yet, we can't\n\t\t\t\t\t\t// calculate where the button should be.\n\t\t\t\t\t\tif ( naturalWidth === 0 || naturalHeight === 0 ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst figure = ref.parentElement;\n\t\t\t\t\t\tconst figureWidth = ref.parentElement.clientWidth;\n\n\t\t\t\t\t\t// We need special handling for the height because\n\t\t\t\t\t\t// a caption will cause the figure to be taller than\n\t\t\t\t\t\t// the image, which means we need to account for that\n\t\t\t\t\t\t// when calculating the placement of the button in the\n\t\t\t\t\t\t// top right corner of the image.\n\t\t\t\t\t\tlet figureHeight = ref.parentElement.clientHeight;\n\t\t\t\t\t\tconst caption = figure.querySelector( 'figcaption' );\n\t\t\t\t\t\tif ( caption ) {\n\t\t\t\t\t\t\tconst captionComputedStyle =\n\t\t\t\t\t\t\t\twindow.getComputedStyle( caption );\n\t\t\t\t\t\t\tfigureHeight =\n\t\t\t\t\t\t\t\tfigureHeight -\n\t\t\t\t\t\t\t\tcaption.offsetHeight -\n\t\t\t\t\t\t\t\tparseFloat( captionComputedStyle.marginTop ) -\n\t\t\t\t\t\t\t\tparseFloat( captionComputedStyle.marginBottom );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst buttonOffsetTop = figureHeight - offsetHeight;\n\t\t\t\t\t\tconst buttonOffsetRight = figureWidth - offsetWidth;\n\n\t\t\t\t\t\t// In the case of an image with object-fit: contain, the\n\t\t\t\t\t\t// size of the <img> element can be larger than the image itself,\n\t\t\t\t\t\t// so we need to calculate where to place the button.\n\t\t\t\t\t\tif ( context.core.image.scaleAttr === 'contain' ) {\n\t\t\t\t\t\t\t// Natural ratio of the image.\n\t\t\t\t\t\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\t\t\t\t\t\t// Offset ratio of the image.\n\t\t\t\t\t\t\tconst offsetRatio = offsetWidth / offsetHeight;\n\n\t\t\t\t\t\t\tif ( naturalRatio >= offsetRatio ) {\n\t\t\t\t\t\t\t\t// If it reaches the width first, keep\n\t\t\t\t\t\t\t\t// the width and compute the height.\n\t\t\t\t\t\t\t\tconst referenceHeight =\n\t\t\t\t\t\t\t\t\toffsetWidth / naturalRatio;\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonTop =\n\t\t\t\t\t\t\t\t\t( offsetHeight - referenceHeight ) / 2 +\n\t\t\t\t\t\t\t\t\tbuttonOffsetTop +\n\t\t\t\t\t\t\t\t\t10;\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonRight =\n\t\t\t\t\t\t\t\t\tbuttonOffsetRight + 10;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// If it reaches the height first, keep\n\t\t\t\t\t\t\t\t// the height and compute the width.\n\t\t\t\t\t\t\t\tconst referenceWidth =\n\t\t\t\t\t\t\t\t\toffsetHeight * naturalRatio;\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonTop =\n\t\t\t\t\t\t\t\t\tbuttonOffsetTop + 10;\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonRight =\n\t\t\t\t\t\t\t\t\t( offsetWidth - referenceWidth ) / 2 +\n\t\t\t\t\t\t\t\t\tbuttonOffsetRight +\n\t\t\t\t\t\t\t\t\t10;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontext.core.image.imageButtonTop =\n\t\t\t\t\t\t\t\tbuttonOffsetTop + 10;\n\t\t\t\t\t\t\tcontext.core.image.imageButtonRight =\n\t\t\t\t\t\t\t\tbuttonOffsetRight + 10;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tsetStylesOnResize: ( { state, context, ref } ) => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tcontext.core.image.lightboxEnabled &&\n\t\t\t\t\t\t\t( state.core.image.windowWidth ||\n\t\t\t\t\t\t\t\tstate.core.image.windowHeight )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tsetStyles( context, ref );\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tafterLoad: ( { state } ) => {\n\t\t\twindow.addEventListener(\n\t\t\t\t'resize',\n\t\t\t\tdebounce( () => {\n\t\t\t\t\tstate.core.image.windowWidth = window.innerWidth;\n\t\t\t\t\tstate.core.image.windowHeight = window.innerHeight;\n\t\t\t\t} )\n\t\t\t);\n\t\t},\n\t}\n);\n\n/*\n * Computes styles for the lightbox and adds them to the document.\n *\n * @function\n * @param {Object} context - An Interactivity API context\n * @param {Object} event - A triggering event\n */\nfunction setStyles( context, ref ) {\n\t// The reference img element lies adjacent\n\t// to the event target button in the DOM.\n\tlet {\n\t\tnaturalWidth,\n\t\tnaturalHeight,\n\t\toffsetWidth: originalWidth,\n\t\toffsetHeight: originalHeight,\n\t} = ref;\n\tlet { x: screenPosX, y: screenPosY } = ref.getBoundingClientRect();\n\n\t// Natural ratio of the image clicked to open the lightbox.\n\tconst naturalRatio = naturalWidth / naturalHeight;\n\t// Original ratio of the image clicked to open the lightbox.\n\tlet originalRatio = originalWidth / originalHeight;\n\n\t// If it has object-fit: contain, recalculate the original sizes\n\t// and the screen position without the blank spaces.\n\tif ( context.core.image.scaleAttr === 'contain' ) {\n\t\tif ( naturalRatio > originalRatio ) {\n\t\t\tconst heightWithoutSpace = originalWidth / naturalRatio;\n\t\t\t// Recalculate screen position without the top space.\n\t\t\tscreenPosY += ( originalHeight - heightWithoutSpace ) / 2;\n\t\t\toriginalHeight = heightWithoutSpace;\n\t\t} else {\n\t\t\tconst widthWithoutSpace = originalHeight * naturalRatio;\n\t\t\t// Recalculate screen position without the left space.\n\t\t\tscreenPosX += ( originalWidth - widthWithoutSpace ) / 2;\n\t\t\toriginalWidth = widthWithoutSpace;\n\t\t}\n\t}\n\toriginalRatio = originalWidth / originalHeight;\n\n\t// Typically, we use the image's full-sized dimensions. If those\n\t// dimensions have not been set (i.e. an external image with only one size),\n\t// the image's dimensions in the lightbox are the same\n\t// as those of the image in the content.\n\tlet imgMaxWidth = parseFloat(\n\t\tcontext.core.image.targetWidth !== 'none'\n\t\t\t? context.core.image.targetWidth\n\t\t\t: naturalWidth\n\t);\n\tlet imgMaxHeight = parseFloat(\n\t\tcontext.core.image.targetHeight !== 'none'\n\t\t\t? context.core.image.targetHeight\n\t\t\t: naturalHeight\n\t);\n\n\t// Ratio of the biggest image stored in the database.\n\tlet imgRatio = imgMaxWidth / imgMaxHeight;\n\tlet containerMaxWidth = imgMaxWidth;\n\tlet containerMaxHeight = imgMaxHeight;\n\tlet containerWidth = imgMaxWidth;\n\tlet containerHeight = imgMaxHeight;\n\t// Check if the target image has a different ratio than the original one (thumbnail).\n\t// Recalculate the width and height.\n\tif ( naturalRatio.toFixed( 2 ) !== imgRatio.toFixed( 2 ) ) {\n\t\tif ( naturalRatio > imgRatio ) {\n\t\t\t// If the width is reached before the height, we keep the maxWidth\n\t\t\t// and recalculate the height.\n\t\t\t// Unless the difference between the maxHeight and the reducedHeight\n\t\t\t// is higher than the maxWidth, where we keep the reducedHeight and\n\t\t\t// recalculate the width.\n\t\t\tconst reducedHeight = imgMaxWidth / naturalRatio;\n\t\t\tif ( imgMaxHeight - reducedHeight > imgMaxWidth ) {\n\t\t\t\timgMaxHeight = reducedHeight;\n\t\t\t\timgMaxWidth = reducedHeight * naturalRatio;\n\t\t\t} else {\n\t\t\t\timgMaxHeight = imgMaxWidth / naturalRatio;\n\t\t\t}\n\t\t} else {\n\t\t\t// If the height is reached before the width, we keep the maxHeight\n\t\t\t// and recalculate the width.\n\t\t\t// Unless the difference between the maxWidth and the reducedWidth\n\t\t\t// is higher than the maxHeight, where we keep the reducedWidth and\n\t\t\t// recalculate the height.\n\t\t\tconst reducedWidth = imgMaxHeight * naturalRatio;\n\t\t\tif ( imgMaxWidth - reducedWidth > imgMaxHeight ) {\n\t\t\t\timgMaxWidth = reducedWidth;\n\t\t\t\timgMaxHeight = reducedWidth / naturalRatio;\n\t\t\t} else {\n\t\t\t\timgMaxWidth = imgMaxHeight * naturalRatio;\n\t\t\t}\n\t\t}\n\t\tcontainerWidth = imgMaxWidth;\n\t\tcontainerHeight = imgMaxHeight;\n\t\timgRatio = imgMaxWidth / imgMaxHeight;\n\n\t\t// Calculate the max size of the container.\n\t\tif ( originalRatio > imgRatio ) {\n\t\t\tcontainerMaxWidth = imgMaxWidth;\n\t\t\tcontainerMaxHeight = containerMaxWidth / originalRatio;\n\t\t} else {\n\t\t\tcontainerMaxHeight = imgMaxHeight;\n\t\t\tcontainerMaxWidth = containerMaxHeight * originalRatio;\n\t\t}\n\t}\n\n\t// If the image has been pixelated on purpose, keep that size.\n\tif ( originalWidth > containerWidth || originalHeight > containerHeight ) {\n\t\tcontainerWidth = originalWidth;\n\t\tcontainerHeight = originalHeight;\n\t}\n\n\t// Calculate the final lightbox image size and the\n\t// scale factor. MaxWidth is either the window container\n\t// (accounting for padding) or the image resolution.\n\tlet horizontalPadding = 0;\n\tif ( window.innerWidth > 480 ) {\n\t\thorizontalPadding = 80;\n\t} else if ( window.innerWidth > 1920 ) {\n\t\thorizontalPadding = 160;\n\t}\n\tconst verticalPadding = 80;\n\n\tconst targetMaxWidth = Math.min(\n\t\twindow.innerWidth - horizontalPadding,\n\t\tcontainerWidth\n\t);\n\tconst targetMaxHeight = Math.min(\n\t\twindow.innerHeight - verticalPadding,\n\t\tcontainerHeight\n\t);\n\tconst targetContainerRatio = targetMaxWidth / targetMaxHeight;\n\n\tif ( originalRatio > targetContainerRatio ) {\n\t\t// If targetMaxWidth is reached before targetMaxHeight\n\t\tcontainerWidth = targetMaxWidth;\n\t\tcontainerHeight = containerWidth / originalRatio;\n\t} else {\n\t\t// If targetMaxHeight is reached before targetMaxWidth\n\t\tcontainerHeight = targetMaxHeight;\n\t\tcontainerWidth = containerHeight * originalRatio;\n\t}\n\n\tconst containerScale = originalWidth / containerWidth;\n\tconst lightboxImgWidth =\n\t\timgMaxWidth * ( containerWidth / containerMaxWidth );\n\tconst lightboxImgHeight =\n\t\timgMaxHeight * ( containerHeight / containerMaxHeight );\n\n\t// Add the CSS variables needed.\n\tlet styleTag = document.getElementById( 'wp-lightbox-styles' );\n\tif ( ! styleTag ) {\n\t\tstyleTag = document.createElement( 'style' );\n\t\tstyleTag.id = 'wp-lightbox-styles';\n\t\tdocument.head.appendChild( styleTag );\n\t}\n\n\t// As of this writing, using the calculations above will render the lightbox\n\t// with a small, erroneous whitespace on the left side of the image in iOS Safari,\n\t// perhaps due to an inconsistency in how browsers handle absolute positioning and CSS\n\t// transformation. In any case, adding 1 pixel to the container width and height solves\n\t// the problem, though this can be removed if the issue is fixed in the future.\n\tstyleTag.innerHTML = `\n\t\t:root {\n\t\t\t--wp--lightbox-initial-top-position: ${ screenPosY }px;\n\t\t\t--wp--lightbox-initial-left-position: ${ screenPosX }px;\n\t\t\t--wp--lightbox-container-width: ${ containerWidth + 1 }px;\n\t\t\t--wp--lightbox-container-height: ${ containerHeight + 1 }px;\n\t\t\t--wp--lightbox-image-width: ${ lightboxImgWidth }px;\n\t\t\t--wp--lightbox-image-height: ${ lightboxImgHeight }px;\n\t\t\t--wp--lightbox-scale: ${ containerScale };\n\t\t}\n\t`;\n}\n\n/*\n * Debounces a function call.\n *\n * @function\n * @param {Function} func - A function to be called\n * @param {number} wait - The time to wait before calling the function\n */\nfunction debounce( func, wait = 50 ) {\n\tlet timeout;\n\treturn () => {\n\t\tconst later = () => {\n\t\t\ttimeout = null;\n\t\t\tfunc();\n\t\t};\n\t\tclearTimeout( timeout );\n\t\ttimeout = setTimeout( later, wait );\n\t};\n}\n"],"mappings":";;AAGA,IAAAA,cAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,kBAAkB,GAAG,CAC1B,SAAS,EACT,YAAY,EACZ,+DAA+D,EAC/D,2CAA2C,EAC3C,6CAA6C,EAC7C,2CAA2C,EAC3C,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,mBAAmB,EACnB,iCAAiC,CACjC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,cAAc;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,UAAU,GAAG,KAAK;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,aAAa,GAAG,CAAC;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,YAAYA,CAAEC,OAAO,EAAG;EAChC;EACA;EACA;EACA,IAAK,CAAEH,UAAU,IAAII,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGJ,aAAa,GAAG,GAAG,EAAG;IACvD;IACA;IACAK,MAAM,CAACC,QAAQ,CACdJ,OAAO,CAACK,IAAI,CAACC,KAAK,CAACC,eAAe,EAClCP,OAAO,CAACK,IAAI,CAACC,KAAK,CAACE,cACpB,CAAC;EACF;AACD;AAEA,IAAAC,oBAAK,EACJ;EACCC,KAAK,EAAE;IACNL,IAAI,EAAE;MACLC,KAAK,EAAE;QACNK,WAAW,EAAER,MAAM,CAACS,UAAU;QAC9BC,YAAY,EAAEV,MAAM,CAACW;MACtB;IACD;EACD,CAAC;EACDC,OAAO,EAAE;IACRV,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,10 @@ var cover = _interopRequireWildcard(require("./cover"));
|
|
|
34
34
|
var details = _interopRequireWildcard(require("./details"));
|
|
35
35
|
var embed = _interopRequireWildcard(require("./embed"));
|
|
36
36
|
var file = _interopRequireWildcard(require("./file"));
|
|
37
|
+
var form = _interopRequireWildcard(require("./form"));
|
|
38
|
+
var formInput = _interopRequireWildcard(require("./form-input"));
|
|
39
|
+
var formSubmitButton = _interopRequireWildcard(require("./form-submit-button"));
|
|
40
|
+
var formSubmissionNotification = _interopRequireWildcard(require("./form-submission-notification"));
|
|
37
41
|
var gallery = _interopRequireWildcard(require("./gallery"));
|
|
38
42
|
var group = _interopRequireWildcard(require("./group"));
|
|
39
43
|
var heading = _interopRequireWildcard(require("./heading"));
|
|
@@ -135,6 +139,12 @@ const getAllBlocks = () => {
|
|
|
135
139
|
archives, audio, button, buttons, calendar, categories, code, column, columns, commentAuthorAvatar, cover, details, embed, file, group, html, latestComments, latestPosts, mediaText, missing, more, nextpage, pageList, pageListItem, pattern, preformatted, pullquote, reusableBlock, rss, search, separator, shortcode, socialLink, socialLinks, spacer, table, tagCloud, textColumns, verse, video, footnotes,
|
|
136
140
|
// theme blocks
|
|
137
141
|
navigation, navigationLink, navigationSubmenu, siteLogo, siteTitle, siteTagline, query, templatePart, avatar, postTitle, postExcerpt, postFeaturedImage, postContent, postAuthor, postAuthorName, postComment, postCommentsCount, postCommentsLink, postDate, postTerms, postNavigationLink, postTemplate, postTimeToRead, queryPagination, queryPaginationNext, queryPaginationNumbers, queryPaginationPrevious, queryNoResults, readMore, comments, commentAuthorName, commentContent, commentDate, commentEditLink, commentReplyLink, commentTemplate, commentsTitle, commentsPagination, commentsPaginationNext, commentsPaginationNumbers, commentsPaginationPrevious, postCommentsForm, tableOfContents, homeLink, logInOut, termDescription, queryTitle, postAuthorBiography];
|
|
142
|
+
if (window?.__experimentalEnableFormBlocks) {
|
|
143
|
+
blocks.push(form);
|
|
144
|
+
blocks.push(formInput);
|
|
145
|
+
blocks.push(formSubmitButton);
|
|
146
|
+
blocks.push(formSubmissionNotification);
|
|
147
|
+
}
|
|
138
148
|
|
|
139
149
|
// When in a WordPress context, conditionally
|
|
140
150
|
// add the classic block and TinyMCE editor
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","archives","_interopRequireWildcard","avatar","audio","button","buttons","calendar","categories","classic","code","column","columns","comments","commentAuthorAvatar","commentAuthorName","commentContent","commentDate","commentEditLink","commentReplyLink","commentTemplate","commentsPaginationPrevious","commentsPagination","commentsPaginationNext","commentsPaginationNumbers","commentsTitle","cover","details","embed","file","gallery","group","heading","homeLink","html","image","latestComments","latestPosts","list","listItem","logInOut","mediaText","missing","more","navigation","navigationLink","navigationSubmenu","nextpage","pattern","pageList","pageListItem","paragraph","postAuthor","postAuthorName","postAuthorBiography","postComment","postCommentsCount","postCommentsForm","postCommentsLink","postContent","postDate","postExcerpt","postFeaturedImage","postNavigationLink","postTemplate","postTerms","postTimeToRead","postTitle","preformatted","pullquote","query","queryNoResults","queryPagination","queryPaginationNext","queryPaginationNumbers","queryPaginationPrevious","queryTitle","quote","reusableBlock","readMore","rss","search","separator","shortcode","siteLogo","siteTagline","siteTitle","socialLink","socialLinks","spacer","table","tableOfContents","tagCloud","templatePart","termDescription","textColumns","verse","video","footnotes","_isBlockMetadataExperimental","_interopRequireDefault","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","getAllBlocks","blocks","window","wp","oldEditor","needsClassicBlock","__experimentalDisableTinymce","URLSearchParams","location","push","filter","Boolean","__experimentalGetCoreBlocks","metadata","isBlockMetadataExperimental","exports","registerCoreBlocks","forEach","init","setDefaultBlockName","name","some","setFreeformContentHandlerName","setUnregisteredTypeHandlerName","setGroupingBlockName","__experimentalRegisterExperimentalCoreBlocks","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","enabledExperiments","__experimental","includes","undefined"],"sources":["@wordpress/block-library/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tsetDefaultBlockName,\n\tsetFreeformContentHandlerName,\n\tsetUnregisteredTypeHandlerName,\n\tsetGroupingBlockName,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\n// When IS_GUTENBERG_PLUGIN is set to false, imports of experimental blocks\n// are transformed by packages/block-library/src/index.js as follows:\n// import * as experimentalBlock from './experimental-block'\n// becomes\n// const experimentalBlock = null;\n// This enables webpack to eliminate the experimental blocks code from the\n// production build to make the final bundle smaller.\n//\n// See https://github.com/WordPress/gutenberg/pull/40655 for more context.\nimport * as archives from './archives';\nimport * as avatar from './avatar';\nimport * as audio from './audio';\nimport * as button from './button';\nimport * as buttons from './buttons';\nimport * as calendar from './calendar';\nimport * as categories from './categories';\nimport * as classic from './freeform';\nimport * as code from './code';\nimport * as column from './column';\nimport * as columns from './columns';\nimport * as comments from './comments';\nimport * as commentAuthorAvatar from './comment-author-avatar';\nimport * as commentAuthorName from './comment-author-name';\nimport * as commentContent from './comment-content';\nimport * as commentDate from './comment-date';\nimport * as commentEditLink from './comment-edit-link';\nimport * as commentReplyLink from './comment-reply-link';\nimport * as commentTemplate from './comment-template';\nimport * as commentsPaginationPrevious from './comments-pagination-previous';\nimport * as commentsPagination from './comments-pagination';\nimport * as commentsPaginationNext from './comments-pagination-next';\nimport * as commentsPaginationNumbers from './comments-pagination-numbers';\nimport * as commentsTitle from './comments-title';\nimport * as cover from './cover';\nimport * as details from './details';\nimport * as embed from './embed';\nimport * as file from './file';\nimport * as gallery from './gallery';\nimport * as group from './group';\nimport * as heading from './heading';\nimport * as homeLink from './home-link';\nimport * as html from './html';\nimport * as image from './image';\nimport * as latestComments from './latest-comments';\nimport * as latestPosts from './latest-posts';\nimport * as list from './list';\nimport * as listItem from './list-item';\nimport * as logInOut from './loginout';\nimport * as mediaText from './media-text';\nimport * as missing from './missing';\nimport * as more from './more';\nimport * as navigation from './navigation';\nimport * as navigationLink from './navigation-link';\nimport * as navigationSubmenu from './navigation-submenu';\nimport * as nextpage from './nextpage';\nimport * as pattern from './pattern';\nimport * as pageList from './page-list';\nimport * as pageListItem from './page-list-item';\nimport * as paragraph from './paragraph';\nimport * as postAuthor from './post-author';\nimport * as postAuthorName from './post-author-name';\nimport * as postAuthorBiography from './post-author-biography';\nimport * as postComment from './post-comment';\nimport * as postCommentsCount from './post-comments-count';\nimport * as postCommentsForm from './post-comments-form';\nimport * as postCommentsLink from './post-comments-link';\nimport * as postContent from './post-content';\nimport * as postDate from './post-date';\nimport * as postExcerpt from './post-excerpt';\nimport * as postFeaturedImage from './post-featured-image';\nimport * as postNavigationLink from './post-navigation-link';\nimport * as postTemplate from './post-template';\nimport * as postTerms from './post-terms';\nimport * as postTimeToRead from './post-time-to-read';\nimport * as postTitle from './post-title';\nimport * as preformatted from './preformatted';\nimport * as pullquote from './pullquote';\nimport * as query from './query';\nimport * as queryNoResults from './query-no-results';\nimport * as queryPagination from './query-pagination';\nimport * as queryPaginationNext from './query-pagination-next';\nimport * as queryPaginationNumbers from './query-pagination-numbers';\nimport * as queryPaginationPrevious from './query-pagination-previous';\nimport * as queryTitle from './query-title';\nimport * as quote from './quote';\nimport * as reusableBlock from './block';\nimport * as readMore from './read-more';\nimport * as rss from './rss';\nimport * as search from './search';\nimport * as separator from './separator';\nimport * as shortcode from './shortcode';\nimport * as siteLogo from './site-logo';\nimport * as siteTagline from './site-tagline';\nimport * as siteTitle from './site-title';\nimport * as socialLink from './social-link';\nimport * as socialLinks from './social-links';\nimport * as spacer from './spacer';\nimport * as table from './table';\nimport * as tableOfContents from './table-of-contents';\nimport * as tagCloud from './tag-cloud';\nimport * as templatePart from './template-part';\nimport * as termDescription from './term-description';\nimport * as textColumns from './text-columns';\nimport * as verse from './verse';\nimport * as video from './video';\nimport * as footnotes from './footnotes';\n\nimport isBlockMetadataExperimental from './utils/is-block-metadata-experimental';\n\n/**\n * Function to get all the block-library blocks in an array\n */\nconst getAllBlocks = () => {\n\tconst blocks = [\n\t\t// Common blocks are grouped at the top to prioritize their display\n\t\t// in various contexts — like the inserter and auto-complete components.\n\t\tparagraph,\n\t\timage,\n\t\theading,\n\t\tgallery,\n\t\tlist,\n\t\tlistItem,\n\t\tquote,\n\n\t\t// Register all remaining core blocks.\n\t\tarchives,\n\t\taudio,\n\t\tbutton,\n\t\tbuttons,\n\t\tcalendar,\n\t\tcategories,\n\t\tcode,\n\t\tcolumn,\n\t\tcolumns,\n\t\tcommentAuthorAvatar,\n\t\tcover,\n\t\tdetails,\n\t\tembed,\n\t\tfile,\n\t\tgroup,\n\t\thtml,\n\t\tlatestComments,\n\t\tlatestPosts,\n\t\tmediaText,\n\t\tmissing,\n\t\tmore,\n\t\tnextpage,\n\t\tpageList,\n\t\tpageListItem,\n\t\tpattern,\n\t\tpreformatted,\n\t\tpullquote,\n\t\treusableBlock,\n\t\trss,\n\t\tsearch,\n\t\tseparator,\n\t\tshortcode,\n\t\tsocialLink,\n\t\tsocialLinks,\n\t\tspacer,\n\t\ttable,\n\t\ttagCloud,\n\t\ttextColumns,\n\t\tverse,\n\t\tvideo,\n\t\tfootnotes,\n\n\t\t// theme blocks\n\t\tnavigation,\n\t\tnavigationLink,\n\t\tnavigationSubmenu,\n\t\tsiteLogo,\n\t\tsiteTitle,\n\t\tsiteTagline,\n\t\tquery,\n\t\ttemplatePart,\n\t\tavatar,\n\t\tpostTitle,\n\t\tpostExcerpt,\n\t\tpostFeaturedImage,\n\t\tpostContent,\n\t\tpostAuthor,\n\t\tpostAuthorName,\n\t\tpostComment,\n\t\tpostCommentsCount,\n\t\tpostCommentsLink,\n\t\tpostDate,\n\t\tpostTerms,\n\t\tpostNavigationLink,\n\t\tpostTemplate,\n\t\tpostTimeToRead,\n\t\tqueryPagination,\n\t\tqueryPaginationNext,\n\t\tqueryPaginationNumbers,\n\t\tqueryPaginationPrevious,\n\t\tqueryNoResults,\n\t\treadMore,\n\t\tcomments,\n\t\tcommentAuthorName,\n\t\tcommentContent,\n\t\tcommentDate,\n\t\tcommentEditLink,\n\t\tcommentReplyLink,\n\t\tcommentTemplate,\n\t\tcommentsTitle,\n\t\tcommentsPagination,\n\t\tcommentsPaginationNext,\n\t\tcommentsPaginationNumbers,\n\t\tcommentsPaginationPrevious,\n\t\tpostCommentsForm,\n\t\ttableOfContents,\n\t\thomeLink,\n\t\tlogInOut,\n\t\ttermDescription,\n\t\tqueryTitle,\n\t\tpostAuthorBiography,\n\t];\n\n\t// When in a WordPress context, conditionally\n\t// add the classic block and TinyMCE editor\n\t// under any of the following conditions:\n\t// - the current post contains a classic block\n\t// - the experiment to disable TinyMCE isn't active.\n\t// - a query argument specifies that TinyMCE should be loaded\n\tif (\n\t\twindow?.wp?.oldEditor &&\n\t\t( window?.wp?.needsClassicBlock ||\n\t\t\t! window?.__experimentalDisableTinymce ||\n\t\t\t!! new URLSearchParams( window?.location?.search ).get(\n\t\t\t\t'requiresTinymce'\n\t\t\t) )\n\t) {\n\t\tblocks.push( classic );\n\t}\n\n\treturn blocks.filter( Boolean );\n};\n\n/**\n * Function to get all the core blocks in an array.\n *\n * @example\n * ```js\n * import { __experimentalGetCoreBlocks } from '@wordpress/block-library';\n *\n * const coreBlocks = __experimentalGetCoreBlocks();\n * ```\n */\nexport const __experimentalGetCoreBlocks = () =>\n\tgetAllBlocks().filter(\n\t\t( { metadata } ) => ! isBlockMetadataExperimental( metadata )\n\t);\n\n/**\n * Function to register core blocks provided by the block editor.\n *\n * @param {Array} blocks An optional array of the core blocks being registered.\n *\n * @example\n * ```js\n * import { registerCoreBlocks } from '@wordpress/block-library';\n *\n * registerCoreBlocks();\n * ```\n */\nexport const registerCoreBlocks = (\n\tblocks = __experimentalGetCoreBlocks()\n) => {\n\tblocks.forEach( ( { init } ) => init() );\n\n\tsetDefaultBlockName( paragraph.name );\n\tif (\n\t\twindow.wp &&\n\t\twindow.wp.oldEditor &&\n\t\tblocks.some( ( { name } ) => name === classic.name )\n\t) {\n\t\tsetFreeformContentHandlerName( classic.name );\n\t}\n\tsetUnregisteredTypeHandlerName( missing.name );\n\tsetGroupingBlockName( group.name );\n};\n\n/**\n * Function to register experimental core blocks depending on editor settings.\n *\n * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.\n * @example\n * ```js\n * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';\n *\n * __experimentalRegisterExperimentalCoreBlocks( settings );\n * ```\n */\nexport const __experimentalRegisterExperimentalCoreBlocks = process.env\n\t.IS_GUTENBERG_PLUGIN\n\t? ( { enableFSEBlocks } = {} ) => {\n\t\t\tconst enabledExperiments = [ enableFSEBlocks ? 'fse' : null ];\n\t\t\tgetAllBlocks()\n\t\t\t\t.filter( ( { metadata } ) =>\n\t\t\t\t\tisBlockMetadataExperimental( metadata )\n\t\t\t\t)\n\t\t\t\t.filter(\n\t\t\t\t\t( { metadata: { __experimental } } ) =>\n\t\t\t\t\t\t__experimental === true ||\n\t\t\t\t\t\tenabledExperiments.includes( __experimental )\n\t\t\t\t)\n\t\t\t\t.forEach( ( { init } ) => init() );\n\t }\n\t: undefined;\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAmBA,IAAAC,QAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAD,uBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAF,uBAAA,CAAAF,OAAA;AACA,IAAAK,MAAA,GAAAH,uBAAA,CAAAF,OAAA;AACA,IAAAM,OAAA,GAAAJ,uBAAA,CAAAF,OAAA;AACA,IAAAO,QAAA,GAAAL,uBAAA,CAAAF,OAAA;AACA,IAAAQ,UAAA,GAAAN,uBAAA,CAAAF,OAAA;AACA,IAAAS,OAAA,GAAAP,uBAAA,CAAAF,OAAA;AACA,IAAAU,IAAA,GAAAR,uBAAA,CAAAF,OAAA;AACA,IAAAW,MAAA,GAAAT,uBA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AO,CAAE,CAAE;IAAEC;EAAK,CAAC,KAAMA,IAAI,CAAC,CAAE,CAAC;AACnC,CAAC,GACDe,SAAS;AAAClB,OAAA,CAAAU,4CAAA,GAAAA,4CAAA"}
|
|
1
|
+
{"version":3,"names":["_blocks","require","archives","_interopRequireWildcard","avatar","audio","button","buttons","calendar","categories","classic","code","column","columns","comments","commentAuthorAvatar","commentAuthorName","commentContent","commentDate","commentEditLink","commentReplyLink","commentTemplate","commentsPaginationPrevious","commentsPagination","commentsPaginationNext","commentsPaginationNumbers","commentsTitle","cover","details","embed","file","form","formInput","formSubmitButton","formSubmissionNotification","gallery","group","heading","homeLink","html","image","latestComments","latestPosts","list","listItem","logInOut","mediaText","missing","more","navigation","navigationLink","navigationSubmenu","nextpage","pattern","pageList","pageListItem","paragraph","postAuthor","postAuthorName","postAuthorBiography","postComment","postCommentsCount","postCommentsForm","postCommentsLink","postContent","postDate","postExcerpt","postFeaturedImage","postNavigationLink","postTemplate","postTerms","postTimeToRead","postTitle","preformatted","pullquote","query","queryNoResults","queryPagination","queryPaginationNext","queryPaginationNumbers","queryPaginationPrevious","queryTitle","quote","reusableBlock","readMore","rss","search","separator","shortcode","siteLogo","siteTagline","siteTitle","socialLink","socialLinks","spacer","table","tableOfContents","tagCloud","templatePart","termDescription","textColumns","verse","video","footnotes","_isBlockMetadataExperimental","_interopRequireDefault","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","getAllBlocks","blocks","window","__experimentalEnableFormBlocks","push","wp","oldEditor","needsClassicBlock","__experimentalDisableTinymce","URLSearchParams","location","filter","Boolean","__experimentalGetCoreBlocks","metadata","isBlockMetadataExperimental","exports","registerCoreBlocks","forEach","init","setDefaultBlockName","name","some","setFreeformContentHandlerName","setUnregisteredTypeHandlerName","setGroupingBlockName","__experimentalRegisterExperimentalCoreBlocks","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","enabledExperiments","__experimental","includes","undefined"],"sources":["@wordpress/block-library/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tsetDefaultBlockName,\n\tsetFreeformContentHandlerName,\n\tsetUnregisteredTypeHandlerName,\n\tsetGroupingBlockName,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\n// When IS_GUTENBERG_PLUGIN is set to false, imports of experimental blocks\n// are transformed by packages/block-library/src/index.js as follows:\n// import * as experimentalBlock from './experimental-block'\n// becomes\n// const experimentalBlock = null;\n// This enables webpack to eliminate the experimental blocks code from the\n// production build to make the final bundle smaller.\n//\n// See https://github.com/WordPress/gutenberg/pull/40655 for more context.\nimport * as archives from './archives';\nimport * as avatar from './avatar';\nimport * as audio from './audio';\nimport * as button from './button';\nimport * as buttons from './buttons';\nimport * as calendar from './calendar';\nimport * as categories from './categories';\nimport * as classic from './freeform';\nimport * as code from './code';\nimport * as column from './column';\nimport * as columns from './columns';\nimport * as comments from './comments';\nimport * as commentAuthorAvatar from './comment-author-avatar';\nimport * as commentAuthorName from './comment-author-name';\nimport * as commentContent from './comment-content';\nimport * as commentDate from './comment-date';\nimport * as commentEditLink from './comment-edit-link';\nimport * as commentReplyLink from './comment-reply-link';\nimport * as commentTemplate from './comment-template';\nimport * as commentsPaginationPrevious from './comments-pagination-previous';\nimport * as commentsPagination from './comments-pagination';\nimport * as commentsPaginationNext from './comments-pagination-next';\nimport * as commentsPaginationNumbers from './comments-pagination-numbers';\nimport * as commentsTitle from './comments-title';\nimport * as cover from './cover';\nimport * as details from './details';\nimport * as embed from './embed';\nimport * as file from './file';\nimport * as form from './form';\nimport * as formInput from './form-input';\nimport * as formSubmitButton from './form-submit-button';\nimport * as formSubmissionNotification from './form-submission-notification';\nimport * as gallery from './gallery';\nimport * as group from './group';\nimport * as heading from './heading';\nimport * as homeLink from './home-link';\nimport * as html from './html';\nimport * as image from './image';\nimport * as latestComments from './latest-comments';\nimport * as latestPosts from './latest-posts';\nimport * as list from './list';\nimport * as listItem from './list-item';\nimport * as logInOut from './loginout';\nimport * as mediaText from './media-text';\nimport * as missing from './missing';\nimport * as more from './more';\nimport * as navigation from './navigation';\nimport * as navigationLink from './navigation-link';\nimport * as navigationSubmenu from './navigation-submenu';\nimport * as nextpage from './nextpage';\nimport * as pattern from './pattern';\nimport * as pageList from './page-list';\nimport * as pageListItem from './page-list-item';\nimport * as paragraph from './paragraph';\nimport * as postAuthor from './post-author';\nimport * as postAuthorName from './post-author-name';\nimport * as postAuthorBiography from './post-author-biography';\nimport * as postComment from './post-comment';\nimport * as postCommentsCount from './post-comments-count';\nimport * as postCommentsForm from './post-comments-form';\nimport * as postCommentsLink from './post-comments-link';\nimport * as postContent from './post-content';\nimport * as postDate from './post-date';\nimport * as postExcerpt from './post-excerpt';\nimport * as postFeaturedImage from './post-featured-image';\nimport * as postNavigationLink from './post-navigation-link';\nimport * as postTemplate from './post-template';\nimport * as postTerms from './post-terms';\nimport * as postTimeToRead from './post-time-to-read';\nimport * as postTitle from './post-title';\nimport * as preformatted from './preformatted';\nimport * as pullquote from './pullquote';\nimport * as query from './query';\nimport * as queryNoResults from './query-no-results';\nimport * as queryPagination from './query-pagination';\nimport * as queryPaginationNext from './query-pagination-next';\nimport * as queryPaginationNumbers from './query-pagination-numbers';\nimport * as queryPaginationPrevious from './query-pagination-previous';\nimport * as queryTitle from './query-title';\nimport * as quote from './quote';\nimport * as reusableBlock from './block';\nimport * as readMore from './read-more';\nimport * as rss from './rss';\nimport * as search from './search';\nimport * as separator from './separator';\nimport * as shortcode from './shortcode';\nimport * as siteLogo from './site-logo';\nimport * as siteTagline from './site-tagline';\nimport * as siteTitle from './site-title';\nimport * as socialLink from './social-link';\nimport * as socialLinks from './social-links';\nimport * as spacer from './spacer';\nimport * as table from './table';\nimport * as tableOfContents from './table-of-contents';\nimport * as tagCloud from './tag-cloud';\nimport * as templatePart from './template-part';\nimport * as termDescription from './term-description';\nimport * as textColumns from './text-columns';\nimport * as verse from './verse';\nimport * as video from './video';\nimport * as footnotes from './footnotes';\n\nimport isBlockMetadataExperimental from './utils/is-block-metadata-experimental';\n\n/**\n * Function to get all the block-library blocks in an array\n */\nconst getAllBlocks = () => {\n\tconst blocks = [\n\t\t// Common blocks are grouped at the top to prioritize their display\n\t\t// in various contexts — like the inserter and auto-complete components.\n\t\tparagraph,\n\t\timage,\n\t\theading,\n\t\tgallery,\n\t\tlist,\n\t\tlistItem,\n\t\tquote,\n\n\t\t// Register all remaining core blocks.\n\t\tarchives,\n\t\taudio,\n\t\tbutton,\n\t\tbuttons,\n\t\tcalendar,\n\t\tcategories,\n\t\tcode,\n\t\tcolumn,\n\t\tcolumns,\n\t\tcommentAuthorAvatar,\n\t\tcover,\n\t\tdetails,\n\t\tembed,\n\t\tfile,\n\t\tgroup,\n\t\thtml,\n\t\tlatestComments,\n\t\tlatestPosts,\n\t\tmediaText,\n\t\tmissing,\n\t\tmore,\n\t\tnextpage,\n\t\tpageList,\n\t\tpageListItem,\n\t\tpattern,\n\t\tpreformatted,\n\t\tpullquote,\n\t\treusableBlock,\n\t\trss,\n\t\tsearch,\n\t\tseparator,\n\t\tshortcode,\n\t\tsocialLink,\n\t\tsocialLinks,\n\t\tspacer,\n\t\ttable,\n\t\ttagCloud,\n\t\ttextColumns,\n\t\tverse,\n\t\tvideo,\n\t\tfootnotes,\n\n\t\t// theme blocks\n\t\tnavigation,\n\t\tnavigationLink,\n\t\tnavigationSubmenu,\n\t\tsiteLogo,\n\t\tsiteTitle,\n\t\tsiteTagline,\n\t\tquery,\n\t\ttemplatePart,\n\t\tavatar,\n\t\tpostTitle,\n\t\tpostExcerpt,\n\t\tpostFeaturedImage,\n\t\tpostContent,\n\t\tpostAuthor,\n\t\tpostAuthorName,\n\t\tpostComment,\n\t\tpostCommentsCount,\n\t\tpostCommentsLink,\n\t\tpostDate,\n\t\tpostTerms,\n\t\tpostNavigationLink,\n\t\tpostTemplate,\n\t\tpostTimeToRead,\n\t\tqueryPagination,\n\t\tqueryPaginationNext,\n\t\tqueryPaginationNumbers,\n\t\tqueryPaginationPrevious,\n\t\tqueryNoResults,\n\t\treadMore,\n\t\tcomments,\n\t\tcommentAuthorName,\n\t\tcommentContent,\n\t\tcommentDate,\n\t\tcommentEditLink,\n\t\tcommentReplyLink,\n\t\tcommentTemplate,\n\t\tcommentsTitle,\n\t\tcommentsPagination,\n\t\tcommentsPaginationNext,\n\t\tcommentsPaginationNumbers,\n\t\tcommentsPaginationPrevious,\n\t\tpostCommentsForm,\n\t\ttableOfContents,\n\t\thomeLink,\n\t\tlogInOut,\n\t\ttermDescription,\n\t\tqueryTitle,\n\t\tpostAuthorBiography,\n\t];\n\tif ( window?.__experimentalEnableFormBlocks ) {\n\t\tblocks.push( form );\n\t\tblocks.push( formInput );\n\t\tblocks.push( formSubmitButton );\n\t\tblocks.push( formSubmissionNotification );\n\t}\n\n\t// When in a WordPress context, conditionally\n\t// add the classic block and TinyMCE editor\n\t// under any of the following conditions:\n\t// - the current post contains a classic block\n\t// - the experiment to disable TinyMCE isn't active.\n\t// - a query argument specifies that TinyMCE should be loaded\n\tif (\n\t\twindow?.wp?.oldEditor &&\n\t\t( window?.wp?.needsClassicBlock ||\n\t\t\t! window?.__experimentalDisableTinymce ||\n\t\t\t!! new URLSearchParams( window?.location?.search ).get(\n\t\t\t\t'requiresTinymce'\n\t\t\t) )\n\t) {\n\t\tblocks.push( classic );\n\t}\n\n\treturn blocks.filter( Boolean );\n};\n\n/**\n * Function to get all the core blocks in an array.\n *\n * @example\n * ```js\n * import { __experimentalGetCoreBlocks } from '@wordpress/block-library';\n *\n * const coreBlocks = __experimentalGetCoreBlocks();\n * ```\n */\nexport const __experimentalGetCoreBlocks = () =>\n\tgetAllBlocks().filter(\n\t\t( { metadata } ) => ! isBlockMetadataExperimental( metadata )\n\t);\n\n/**\n * Function to register core blocks provided by the block editor.\n *\n * @param {Array} blocks An optional array of the core blocks being registered.\n *\n * @example\n * ```js\n * import { registerCoreBlocks } from '@wordpress/block-library';\n *\n * registerCoreBlocks();\n * ```\n */\nexport const registerCoreBlocks = (\n\tblocks = __experimentalGetCoreBlocks()\n) => {\n\tblocks.forEach( ( { init } ) => init() );\n\n\tsetDefaultBlockName( paragraph.name );\n\tif (\n\t\twindow.wp &&\n\t\twindow.wp.oldEditor &&\n\t\tblocks.some( ( { name } ) => name === classic.name )\n\t) {\n\t\tsetFreeformContentHandlerName( classic.name );\n\t}\n\tsetUnregisteredTypeHandlerName( missing.name );\n\tsetGroupingBlockName( group.name );\n};\n\n/**\n * Function to register experimental core blocks depending on editor settings.\n *\n * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.\n * @example\n * ```js\n * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';\n *\n * __experimentalRegisterExperimentalCoreBlocks( settings );\n * ```\n */\nexport const __experimentalRegisterExperimentalCoreBlocks = process.env\n\t.IS_GUTENBERG_PLUGIN\n\t? ( { enableFSEBlocks } = {} ) => {\n\t\t\tconst enabledExperiments = [ enableFSEBlocks ? 'fse' : null ];\n\t\t\tgetAllBlocks()\n\t\t\t\t.filter( ( { metadata } ) =>\n\t\t\t\t\tisBlockMetadataExperimental( metadata )\n\t\t\t\t)\n\t\t\t\t.filter(\n\t\t\t\t\t( { metadata: { __experimental } } ) =>\n\t\t\t\t\t\t__experimental === true ||\n\t\t\t\t\t\tenabledExperiments.includes( __experimental )\n\t\t\t\t)\n\t\t\t\t.forEach( ( { init } ) => init() );\n\t }\n\t: undefined;\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAmBA,IAAAC,QAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAD,uBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAF,uBAAA,CAAAF,OAAA;AACA,IAAAK,MAAA,GAAAH,uBAAA,CAAAF,OAAA;AACA,IAAAM,OAAA,GAAAJ,uBAAA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AG,sCAA8B,EAAEzG,OAAO,CAACsG,IAAK,CAAC;EAC9C,IAAAI,4BAAoB,EAAErH,KAAK,CAACiH,IAAK,CAAC;AACnC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVAL,OAAA,CAAAC,kBAAA,GAAAA,kBAAA;AAWO,MAAMS,4CAA4C,GAAGC,OAAO,CAACC,GAAG,CACrEC,mBAAmB,GAClB,CAAE;EAAEC;AAAgB,CAAC,GAAG,CAAC,CAAC,KAAM;EAChC,MAAMC,kBAAkB,GAAG,CAAED,eAAe,GAAG,KAAK,GAAG,IAAI,CAAE;EAC7D9B,YAAY,CAAC,CAAC,CACZW,MAAM,CAAE,CAAE;IAAEG;EAAS,CAAC,KACtB,IAAAC,oCAA2B,EAAED,QAAS,CACvC,CAAC,CACAH,MAAM,CACN,CAAE;IAAEG,QAAQ,EAAE;MAAEkB;IAAe;EAAE,CAAC,KACjCA,cAAc,KAAK,IAAI,IACvBD,kBAAkB,CAACE,QAAQ,CAAED,cAAe,CAC9C,CAAC,CACAd,OAAO,CAAE,CAAE;IAAEC;EAAK,CAAC,KAAMA,IAAI,CAAC,CAAE,CAAC;AACnC,CAAC,GACDe,SAAS;AAAClB,OAAA,CAAAU,4CAAA,GAAAA,4CAAA"}
|
|
@@ -353,14 +353,18 @@ function LatestPostsEdit({
|
|
|
353
353
|
}
|
|
354
354
|
});
|
|
355
355
|
const needsReadMore = excerptLength < excerpt.trim().split(' ').length && post.excerpt.raw === '';
|
|
356
|
-
const postExcerpt = needsReadMore ? (0, _react.createElement)(_react.Fragment, null, excerpt.trim().split(' ', excerptLength).join(' '), (0, _element.createInterpolateElement)( /* translators:
|
|
357
|
-
(0, _i18n.__)('
|
|
356
|
+
const postExcerpt = needsReadMore ? (0, _react.createElement)(_react.Fragment, null, excerpt.trim().split(' ', excerptLength).join(' '), (0, _element.createInterpolateElement)((0, _i18n.sprintf)( /* translators: 1: Hidden accessibility text: Post title */
|
|
357
|
+
(0, _i18n.__)('… <a>Read more<span>: %1$s</span></a>'), titleTrimmed || (0, _i18n.__)('(no title)')), {
|
|
358
358
|
a:
|
|
359
359
|
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
360
360
|
(0, _react.createElement)("a", {
|
|
361
|
+
className: "wp-block-latest-posts__read-more",
|
|
361
362
|
href: post.link,
|
|
362
363
|
rel: "noopener noreferrer",
|
|
363
364
|
onClick: showRedirectionPreventedNotice
|
|
365
|
+
}),
|
|
366
|
+
span: (0, _react.createElement)("span", {
|
|
367
|
+
className: "screen-reader-text"
|
|
364
368
|
})
|
|
365
369
|
})) : excerpt;
|
|
366
370
|
return (0, _react.createElement)("li", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_i18n","_date","_blockEditor","_data","_icons","_coreData","_notices","_compose","_element","_constants","CATEGORIES_LIST_QUERY","per_page","context","USERS_LIST_QUERY","has_published_posts","getFeaturedImageDetails","post","size","_image$media_details$","image","_embedded","url","media_details","sizes","source_url","alt","alt_text","LatestPostsEdit","attributes","setAttributes","_categoriesList$reduc","instanceId","useInstanceId","postsToShow","order","orderBy","categories","selectedAuthor","displayFeaturedImage","displayPostContentRadio","displayPostContent","displayPostDate","displayAuthor","postLayout","columns","excerptLength","featuredImageAlign","featuredImageSizeSlug","featuredImageSizeWidth","featuredImageSizeHeight","addLinkToFeaturedImage","imageSizes","latestPosts","defaultImageWidth","defaultImageHeight","categoriesList","authorList","useSelect","select","_settings$imageDimens","_settings$imageDimens2","getEntityRecords","getUsers","coreStore","settings","blockEditorStore","getSettings","catIds","length","map","cat","id","latestPostsQuery","Object","fromEntries","entries","author","orderby","_embed","filter","value","imageDimensions","width","height","createWarningNotice","removeNotice","useDispatch","noticeStore","noticeId","showRedirectionPreventedNotice","event","preventDefault","__","type","imageSizeOptions","slug","name","label","categorySuggestions","reduce","accumulator","category","selectCategories","tokens","hasNoSuggestion","some","token","allCategories","includes","hasPosts","inspectorControls","_react","createElement","InspectorControls","PanelBody","title","ToggleControl","checked","onChange","RadioControl","selected","options","RangeControl","__nextHasNoMarginBottom","__next40pxDefaultSize","min","MIN_EXCERPT_LENGTH","max","MAX_EXCERPT_LENGTH","Fragment","__experimentalImageSizeControl","newAttrs","hasOwnProperty","imageWidth","imageHeight","imageSizeHelp","onChangeImage","undefined","BaseControl","className","VisualLabel","BlockAlignmentToolbar","controls","isCollapsed","QueryControls","numberOfItems","onOrderChange","onOrderByChange","onNumberOfItemsChange","onCategoryChange","selectedCategories","onAuthorChange","Number","selectedAuthorId","MAX_POSTS_COLUMNS","Math","required","blockProps","useBlockProps","classnames","Placeholder","icon","pin","Array","isArray","Spinner","displayPosts","slice","layoutControls","list","onClick","isActive","grid","dateFormat","formats","date","BlockControls","ToolbarGroup","titleTrimmed","rendered","trim","excerpt","currentAuthor","find","excerptElement","document","innerHTML","textContent","innerText","imageSourceUrl","featuredImageAlt","imageClasses","renderFeaturedImage","featuredImage","src","style","maxWidth","maxHeight","needsReadMore","split","raw","postExcerpt","join","createInterpolateElement","a","href","link","rel","key","dangerouslySetInnerHTML","__html","sprintf","date_gmt","dateTime","format","dateI18n","content"],"sources":["@wordpress/block-library/src/latest-posts/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBaseControl,\n\tPanelBody,\n\tPlaceholder,\n\tQueryControls,\n\tRadioControl,\n\tRangeControl,\n\tSpinner,\n\tToggleControl,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { dateI18n, format, getSettings } from '@wordpress/date';\nimport {\n\tInspectorControls,\n\tBlockAlignmentToolbar,\n\tBlockControls,\n\t__experimentalImageSizeControl as ImageSizeControl,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { pin, list, grid } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticeStore } from '@wordpress/notices';\nimport { useInstanceId } from '@wordpress/compose';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tMIN_EXCERPT_LENGTH,\n\tMAX_EXCERPT_LENGTH,\n\tMAX_POSTS_COLUMNS,\n} from './constants';\n\n/**\n * Module Constants\n */\nconst CATEGORIES_LIST_QUERY = {\n\tper_page: -1,\n\tcontext: 'view',\n};\nconst USERS_LIST_QUERY = {\n\tper_page: -1,\n\thas_published_posts: [ 'post' ],\n\tcontext: 'view',\n};\n\nfunction getFeaturedImageDetails( post, size ) {\n\tconst image = post._embedded?.[ 'wp:featuredmedia' ]?.[ '0' ];\n\n\treturn {\n\t\turl:\n\t\t\timage?.media_details?.sizes?.[ size ]?.source_url ??\n\t\t\timage?.source_url,\n\t\talt: image?.alt_text,\n\t};\n}\n\nexport default function LatestPostsEdit( { attributes, setAttributes } ) {\n\tconst instanceId = useInstanceId( LatestPostsEdit );\n\tconst {\n\t\tpostsToShow,\n\t\torder,\n\t\torderBy,\n\t\tcategories,\n\t\tselectedAuthor,\n\t\tdisplayFeaturedImage,\n\t\tdisplayPostContentRadio,\n\t\tdisplayPostContent,\n\t\tdisplayPostDate,\n\t\tdisplayAuthor,\n\t\tpostLayout,\n\t\tcolumns,\n\t\texcerptLength,\n\t\tfeaturedImageAlign,\n\t\tfeaturedImageSizeSlug,\n\t\tfeaturedImageSizeWidth,\n\t\tfeaturedImageSizeHeight,\n\t\taddLinkToFeaturedImage,\n\t} = attributes;\n\tconst {\n\t\timageSizes,\n\t\tlatestPosts,\n\t\tdefaultImageWidth,\n\t\tdefaultImageHeight,\n\t\tcategoriesList,\n\t\tauthorList,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecords, getUsers } = select( coreStore );\n\t\t\tconst settings = select( blockEditorStore ).getSettings();\n\t\t\tconst catIds =\n\t\t\t\tcategories && categories.length > 0\n\t\t\t\t\t? categories.map( ( cat ) => cat.id )\n\t\t\t\t\t: [];\n\t\t\tconst latestPostsQuery = Object.fromEntries(\n\t\t\t\tObject.entries( {\n\t\t\t\t\tcategories: catIds,\n\t\t\t\t\tauthor: selectedAuthor,\n\t\t\t\t\torder,\n\t\t\t\t\torderby: orderBy,\n\t\t\t\t\tper_page: postsToShow,\n\t\t\t\t\t_embed: 'wp:featuredmedia',\n\t\t\t\t} ).filter( ( [ , value ] ) => typeof value !== 'undefined' )\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tdefaultImageWidth:\n\t\t\t\t\tsettings.imageDimensions?.[ featuredImageSizeSlug ]\n\t\t\t\t\t\t?.width ?? 0,\n\t\t\t\tdefaultImageHeight:\n\t\t\t\t\tsettings.imageDimensions?.[ featuredImageSizeSlug ]\n\t\t\t\t\t\t?.height ?? 0,\n\t\t\t\timageSizes: settings.imageSizes,\n\t\t\t\tlatestPosts: getEntityRecords(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'post',\n\t\t\t\t\tlatestPostsQuery\n\t\t\t\t),\n\t\t\t\tcategoriesList: getEntityRecords(\n\t\t\t\t\t'taxonomy',\n\t\t\t\t\t'category',\n\t\t\t\t\tCATEGORIES_LIST_QUERY\n\t\t\t\t),\n\t\t\t\tauthorList: getUsers( USERS_LIST_QUERY ),\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tfeaturedImageSizeSlug,\n\t\t\tpostsToShow,\n\t\t\torder,\n\t\t\torderBy,\n\t\t\tcategories,\n\t\t\tselectedAuthor,\n\t\t]\n\t);\n\n\t// If a user clicks to a link prevent redirection and show a warning.\n\tconst { createWarningNotice, removeNotice } = useDispatch( noticeStore );\n\tlet noticeId;\n\tconst showRedirectionPreventedNotice = ( event ) => {\n\t\tevent.preventDefault();\n\t\t// Remove previous warning if any, to show one at a time per block.\n\t\tremoveNotice( noticeId );\n\t\tnoticeId = `block-library/core/latest-posts/redirection-prevented/${ instanceId }`;\n\t\tcreateWarningNotice( __( 'Links are disabled in the editor.' ), {\n\t\t\tid: noticeId,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t};\n\n\tconst imageSizeOptions = imageSizes\n\t\t.filter( ( { slug } ) => slug !== 'full' )\n\t\t.map( ( { name, slug } ) => ( {\n\t\t\tvalue: slug,\n\t\t\tlabel: name,\n\t\t} ) );\n\tconst categorySuggestions =\n\t\tcategoriesList?.reduce(\n\t\t\t( accumulator, category ) => ( {\n\t\t\t\t...accumulator,\n\t\t\t\t[ category.name ]: category,\n\t\t\t} ),\n\t\t\t{}\n\t\t) ?? {};\n\tconst selectCategories = ( tokens ) => {\n\t\tconst hasNoSuggestion = tokens.some(\n\t\t\t( token ) =>\n\t\t\t\ttypeof token === 'string' && ! categorySuggestions[ token ]\n\t\t);\n\t\tif ( hasNoSuggestion ) {\n\t\t\treturn;\n\t\t}\n\t\t// Categories that are already will be objects, while new additions will be strings (the name).\n\t\t// allCategories nomalizes the array so that they are all objects.\n\t\tconst allCategories = tokens.map( ( token ) => {\n\t\t\treturn typeof token === 'string'\n\t\t\t\t? categorySuggestions[ token ]\n\t\t\t\t: token;\n\t\t} );\n\t\t// We do nothing if the category is not selected\n\t\t// from suggestions.\n\t\tif ( allCategories.includes( null ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tsetAttributes( { categories: allCategories } );\n\t};\n\n\tconst hasPosts = !! latestPosts?.length;\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Post content' ) }>\n\t\t\t\t<ToggleControl\n\t\t\t\t\tlabel={ __( 'Post content' ) }\n\t\t\t\t\tchecked={ displayPostContent }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { displayPostContent: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ displayPostContent && (\n\t\t\t\t\t<RadioControl\n\t\t\t\t\t\tlabel={ __( 'Show:' ) }\n\t\t\t\t\t\tselected={ displayPostContentRadio }\n\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t{ label: __( 'Excerpt' ), value: 'excerpt' },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Full post' ),\n\t\t\t\t\t\t\t\tvalue: 'full_post',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tdisplayPostContentRadio: value,\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) }\n\t\t\t\t{ displayPostContent &&\n\t\t\t\t\tdisplayPostContentRadio === 'excerpt' && (\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Max number of words' ) }\n\t\t\t\t\t\t\tvalue={ excerptLength }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { excerptLength: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ MIN_EXCERPT_LENGTH }\n\t\t\t\t\t\t\tmax={ MAX_EXCERPT_LENGTH }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t</PanelBody>\n\n\t\t\t<PanelBody title={ __( 'Post meta' ) }>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Display author name' ) }\n\t\t\t\t\tchecked={ displayAuthor }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { displayAuthor: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Display post date' ) }\n\t\t\t\t\tchecked={ displayPostDate }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { displayPostDate: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\n\t\t\t<PanelBody title={ __( 'Featured image' ) }>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Display featured image' ) }\n\t\t\t\t\tchecked={ displayFeaturedImage }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { displayFeaturedImage: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ displayFeaturedImage && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<ImageSizeControl\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tconst newAttrs = {};\n\t\t\t\t\t\t\t\tif ( value.hasOwnProperty( 'width' ) ) {\n\t\t\t\t\t\t\t\t\tnewAttrs.featuredImageSizeWidth =\n\t\t\t\t\t\t\t\t\t\tvalue.width;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( value.hasOwnProperty( 'height' ) ) {\n\t\t\t\t\t\t\t\t\tnewAttrs.featuredImageSizeHeight =\n\t\t\t\t\t\t\t\t\t\tvalue.height;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetAttributes( newAttrs );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tslug={ featuredImageSizeSlug }\n\t\t\t\t\t\t\twidth={ featuredImageSizeWidth }\n\t\t\t\t\t\t\theight={ featuredImageSizeHeight }\n\t\t\t\t\t\t\timageWidth={ defaultImageWidth }\n\t\t\t\t\t\t\timageHeight={ defaultImageHeight }\n\t\t\t\t\t\t\timageSizeOptions={ imageSizeOptions }\n\t\t\t\t\t\t\timageSizeHelp={ __(\n\t\t\t\t\t\t\t\t'Select the size of the source image.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonChangeImage={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tfeaturedImageSizeSlug: value,\n\t\t\t\t\t\t\t\t\tfeaturedImageSizeWidth: undefined,\n\t\t\t\t\t\t\t\t\tfeaturedImageSizeHeight: undefined,\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\t<BaseControl className=\"editor-latest-posts-image-alignment-control\">\n\t\t\t\t\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t\t\t\t\t{ __( 'Image alignment' ) }\n\t\t\t\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t\t\t\t\t<BlockAlignmentToolbar\n\t\t\t\t\t\t\t\tvalue={ featuredImageAlign }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tfeaturedImageAlign: value,\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\tcontrols={ [ 'left', 'center', 'right' ] }\n\t\t\t\t\t\t\t\tisCollapsed={ false }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</BaseControl>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Add link to featured image' ) }\n\t\t\t\t\t\t\tchecked={ addLinkToFeaturedImage }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\taddLinkToFeaturedImage: value,\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) }\n\t\t\t</PanelBody>\n\n\t\t\t<PanelBody title={ __( 'Sorting and filtering' ) }>\n\t\t\t\t<QueryControls\n\t\t\t\t\t{ ...{ order, orderBy } }\n\t\t\t\t\tnumberOfItems={ postsToShow }\n\t\t\t\t\tonOrderChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { order: value } )\n\t\t\t\t\t}\n\t\t\t\t\tonOrderByChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { orderBy: value } )\n\t\t\t\t\t}\n\t\t\t\t\tonNumberOfItemsChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { postsToShow: value } )\n\t\t\t\t\t}\n\t\t\t\t\tcategorySuggestions={ categorySuggestions }\n\t\t\t\t\tonCategoryChange={ selectCategories }\n\t\t\t\t\tselectedCategories={ categories }\n\t\t\t\t\tonAuthorChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tselectedAuthor:\n\t\t\t\t\t\t\t\t'' !== value ? Number( value ) : undefined,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tauthorList={ authorList ?? [] }\n\t\t\t\t\tselectedAuthorId={ selectedAuthor }\n\t\t\t\t/>\n\n\t\t\t\t{ postLayout === 'grid' && (\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\tvalue={ columns }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { columns: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmin={ 2 }\n\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t! hasPosts\n\t\t\t\t\t\t\t\t? MAX_POSTS_COLUMNS\n\t\t\t\t\t\t\t\t: Math.min(\n\t\t\t\t\t\t\t\t\t\tMAX_POSTS_COLUMNS,\n\t\t\t\t\t\t\t\t\t\tlatestPosts.length\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t}\n\t\t\t\t\t\trequired\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t'wp-block-latest-posts__list': true,\n\t\t\t'is-grid': postLayout === 'grid',\n\t\t\t'has-dates': displayPostDate,\n\t\t\t'has-author': displayAuthor,\n\t\t\t[ `columns-${ columns }` ]: postLayout === 'grid',\n\t\t} ),\n\t} );\n\n\tif ( ! hasPosts ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ inspectorControls }\n\t\t\t\t<Placeholder icon={ pin } label={ __( 'Latest Posts' ) }>\n\t\t\t\t\t{ ! Array.isArray( latestPosts ) ? (\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t__( 'No posts found.' )\n\t\t\t\t\t) }\n\t\t\t\t</Placeholder>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Removing posts from display should be instant.\n\tconst displayPosts =\n\t\tlatestPosts.length > postsToShow\n\t\t\t? latestPosts.slice( 0, postsToShow )\n\t\t\t: latestPosts;\n\n\tconst layoutControls = [\n\t\t{\n\t\t\ticon: list,\n\t\t\ttitle: __( 'List view' ),\n\t\t\tonClick: () => setAttributes( { postLayout: 'list' } ),\n\t\t\tisActive: postLayout === 'list',\n\t\t},\n\t\t{\n\t\t\ticon: grid,\n\t\t\ttitle: __( 'Grid view' ),\n\t\t\tonClick: () => setAttributes( { postLayout: 'grid' } ),\n\t\t\tisActive: postLayout === 'grid',\n\t\t},\n\t];\n\n\tconst dateFormat = getSettings().formats.date;\n\n\treturn (\n\t\t<div>\n\t\t\t{ inspectorControls }\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup controls={ layoutControls } />\n\t\t\t</BlockControls>\n\t\t\t<ul { ...blockProps }>\n\t\t\t\t{ displayPosts.map( ( post ) => {\n\t\t\t\t\tconst titleTrimmed = post.title.rendered.trim();\n\t\t\t\t\tlet excerpt = post.excerpt.rendered;\n\t\t\t\t\tconst currentAuthor = authorList?.find(\n\t\t\t\t\t\t( author ) => author.id === post.author\n\t\t\t\t\t);\n\n\t\t\t\t\tconst excerptElement = document.createElement( 'div' );\n\t\t\t\t\texcerptElement.innerHTML = excerpt;\n\n\t\t\t\t\texcerpt =\n\t\t\t\t\t\texcerptElement.textContent ||\n\t\t\t\t\t\texcerptElement.innerText ||\n\t\t\t\t\t\t'';\n\n\t\t\t\t\tconst { url: imageSourceUrl, alt: featuredImageAlt } =\n\t\t\t\t\t\tgetFeaturedImageDetails( post, featuredImageSizeSlug );\n\t\t\t\t\tconst imageClasses = classnames( {\n\t\t\t\t\t\t'wp-block-latest-posts__featured-image': true,\n\t\t\t\t\t\t[ `align${ featuredImageAlign }` ]:\n\t\t\t\t\t\t\t!! featuredImageAlign,\n\t\t\t\t\t} );\n\t\t\t\t\tconst renderFeaturedImage =\n\t\t\t\t\t\tdisplayFeaturedImage && imageSourceUrl;\n\t\t\t\t\tconst featuredImage = renderFeaturedImage && (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tsrc={ imageSourceUrl }\n\t\t\t\t\t\t\talt={ featuredImageAlt }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmaxWidth: featuredImageSizeWidth,\n\t\t\t\t\t\t\t\tmaxHeight: featuredImageSizeHeight,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\n\t\t\t\t\tconst needsReadMore =\n\t\t\t\t\t\texcerptLength < excerpt.trim().split( ' ' ).length &&\n\t\t\t\t\t\tpost.excerpt.raw === '';\n\n\t\t\t\t\tconst postExcerpt = needsReadMore ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ excerpt\n\t\t\t\t\t\t\t\t.trim()\n\t\t\t\t\t\t\t\t.split( ' ', excerptLength )\n\t\t\t\t\t\t\t\t.join( ' ' ) }\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t/* translators: excerpt truncation character, default … */\n\t\t\t\t\t\t\t\t__( ' … <a>Read more</a>' ),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/anchor-has-content\n\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\thref={ post.link }\n\t\t\t\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\t\t\t\t\tshowRedirectionPreventedNotice\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : (\n\t\t\t\t\t\texcerpt\n\t\t\t\t\t);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<li key={ post.id }>\n\t\t\t\t\t\t\t{ renderFeaturedImage && (\n\t\t\t\t\t\t\t\t<div className={ imageClasses }>\n\t\t\t\t\t\t\t\t\t{ addLinkToFeaturedImage ? (\n\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"wp-block-latest-posts__post-title\"\n\t\t\t\t\t\t\t\t\t\t\thref={ post.link }\n\t\t\t\t\t\t\t\t\t\t\trel=\"noreferrer noopener\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\t\t\t\t\tshowRedirectionPreventedNotice\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ featuredImage }\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\tfeaturedImage\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\thref={ post.link }\n\t\t\t\t\t\t\t\trel=\"noreferrer noopener\"\n\t\t\t\t\t\t\t\tdangerouslySetInnerHTML={\n\t\t\t\t\t\t\t\t\t!! titleTrimmed\n\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\t__html: titleTrimmed,\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonClick={ showRedirectionPreventedNotice }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ ! titleTrimmed ? __( '(no title)' ) : null }\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t{ displayAuthor && currentAuthor && (\n\t\t\t\t\t\t\t\t<div className=\"wp-block-latest-posts__post-author\">\n\t\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: byline. %s: current author. */\n\t\t\t\t\t\t\t\t\t\t__( 'by %s' ),\n\t\t\t\t\t\t\t\t\t\tcurrentAuthor.name\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ displayPostDate && post.date_gmt && (\n\t\t\t\t\t\t\t\t<time\n\t\t\t\t\t\t\t\t\tdateTime={ format( 'c', post.date_gmt ) }\n\t\t\t\t\t\t\t\t\tclassName=\"wp-block-latest-posts__post-date\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ dateI18n( dateFormat, post.date_gmt ) }\n\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ displayPostContent &&\n\t\t\t\t\t\t\t\tdisplayPostContentRadio === 'excerpt' && (\n\t\t\t\t\t\t\t\t\t<div className=\"wp-block-latest-posts__post-excerpt\">\n\t\t\t\t\t\t\t\t\t\t{ postExcerpt }\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ displayPostContent &&\n\t\t\t\t\t\t\t\tdisplayPostContentRadio === 'full_post' && (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tclassName=\"wp-block-latest-posts__post-full-content\"\n\t\t\t\t\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t\t\t\t\t__html: post.content.raw.trim(),\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</li>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ul>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAWA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAQA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AAKA,IAAAW,UAAA,GAAAX,OAAA;AAvCA;AACA;AACA;;AAGA;AACA;AACA;;AA6BA;AACA;AACA;;AAOA;AACA;AACA;AACA,MAAMY,qBAAqB,GAAG;EAC7BC,QAAQ,EAAE,CAAC,CAAC;EACZC,OAAO,EAAE;AACV,CAAC;AACD,MAAMC,gBAAgB,GAAG;EACxBF,QAAQ,EAAE,CAAC,CAAC;EACZG,mBAAmB,EAAE,CAAE,MAAM,CAAE;EAC/BF,OAAO,EAAE;AACV,CAAC;AAED,SAASG,uBAAuBA,CAAEC,IAAI,EAAEC,IAAI,EAAG;EAAA,IAAAC,qBAAA;EAC9C,MAAMC,KAAK,GAAGH,IAAI,CAACI,SAAS,GAAI,kBAAkB,CA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AAS,EAAC;IAAqC,GACjD8D,WACE,CACL,EACAjK,kBAAkB,IACnBD,uBAAuB,KAAK,WAAW,IACtC,IAAAwE,MAAA,CAAAC,aAAA;MACC2B,SAAS,EAAC,0CAA0C;MACpDsE,uBAAuB,EAAG;QACzBC,MAAM,EAAElM,IAAI,CAACwM,OAAO,CAAChB,GAAG,CAACpB,IAAI,CAAC;MAC/B;IAAG,CACH,CAEA,CAAC;EAEP,CAAE,CACC,CACA,CAAC;AAER"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_i18n","_date","_blockEditor","_data","_icons","_coreData","_notices","_compose","_element","_constants","CATEGORIES_LIST_QUERY","per_page","context","USERS_LIST_QUERY","has_published_posts","getFeaturedImageDetails","post","size","_image$media_details$","image","_embedded","url","media_details","sizes","source_url","alt","alt_text","LatestPostsEdit","attributes","setAttributes","_categoriesList$reduc","instanceId","useInstanceId","postsToShow","order","orderBy","categories","selectedAuthor","displayFeaturedImage","displayPostContentRadio","displayPostContent","displayPostDate","displayAuthor","postLayout","columns","excerptLength","featuredImageAlign","featuredImageSizeSlug","featuredImageSizeWidth","featuredImageSizeHeight","addLinkToFeaturedImage","imageSizes","latestPosts","defaultImageWidth","defaultImageHeight","categoriesList","authorList","useSelect","select","_settings$imageDimens","_settings$imageDimens2","getEntityRecords","getUsers","coreStore","settings","blockEditorStore","getSettings","catIds","length","map","cat","id","latestPostsQuery","Object","fromEntries","entries","author","orderby","_embed","filter","value","imageDimensions","width","height","createWarningNotice","removeNotice","useDispatch","noticeStore","noticeId","showRedirectionPreventedNotice","event","preventDefault","__","type","imageSizeOptions","slug","name","label","categorySuggestions","reduce","accumulator","category","selectCategories","tokens","hasNoSuggestion","some","token","allCategories","includes","hasPosts","inspectorControls","_react","createElement","InspectorControls","PanelBody","title","ToggleControl","checked","onChange","RadioControl","selected","options","RangeControl","__nextHasNoMarginBottom","__next40pxDefaultSize","min","MIN_EXCERPT_LENGTH","max","MAX_EXCERPT_LENGTH","Fragment","__experimentalImageSizeControl","newAttrs","hasOwnProperty","imageWidth","imageHeight","imageSizeHelp","onChangeImage","undefined","BaseControl","className","VisualLabel","BlockAlignmentToolbar","controls","isCollapsed","QueryControls","numberOfItems","onOrderChange","onOrderByChange","onNumberOfItemsChange","onCategoryChange","selectedCategories","onAuthorChange","Number","selectedAuthorId","MAX_POSTS_COLUMNS","Math","required","blockProps","useBlockProps","classnames","Placeholder","icon","pin","Array","isArray","Spinner","displayPosts","slice","layoutControls","list","onClick","isActive","grid","dateFormat","formats","date","BlockControls","ToolbarGroup","titleTrimmed","rendered","trim","excerpt","currentAuthor","find","excerptElement","document","innerHTML","textContent","innerText","imageSourceUrl","featuredImageAlt","imageClasses","renderFeaturedImage","featuredImage","src","style","maxWidth","maxHeight","needsReadMore","split","raw","postExcerpt","join","createInterpolateElement","sprintf","a","href","link","rel","span","key","dangerouslySetInnerHTML","__html","date_gmt","dateTime","format","dateI18n","content"],"sources":["@wordpress/block-library/src/latest-posts/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBaseControl,\n\tPanelBody,\n\tPlaceholder,\n\tQueryControls,\n\tRadioControl,\n\tRangeControl,\n\tSpinner,\n\tToggleControl,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { dateI18n, format, getSettings } from '@wordpress/date';\nimport {\n\tInspectorControls,\n\tBlockAlignmentToolbar,\n\tBlockControls,\n\t__experimentalImageSizeControl as ImageSizeControl,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { pin, list, grid } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticeStore } from '@wordpress/notices';\nimport { useInstanceId } from '@wordpress/compose';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tMIN_EXCERPT_LENGTH,\n\tMAX_EXCERPT_LENGTH,\n\tMAX_POSTS_COLUMNS,\n} from './constants';\n\n/**\n * Module Constants\n */\nconst CATEGORIES_LIST_QUERY = {\n\tper_page: -1,\n\tcontext: 'view',\n};\nconst USERS_LIST_QUERY = {\n\tper_page: -1,\n\thas_published_posts: [ 'post' ],\n\tcontext: 'view',\n};\n\nfunction getFeaturedImageDetails( post, size ) {\n\tconst image = post._embedded?.[ 'wp:featuredmedia' ]?.[ '0' ];\n\n\treturn {\n\t\turl:\n\t\t\timage?.media_details?.sizes?.[ size ]?.source_url ??\n\t\t\timage?.source_url,\n\t\talt: image?.alt_text,\n\t};\n}\n\nexport default function LatestPostsEdit( { attributes, setAttributes } ) {\n\tconst instanceId = useInstanceId( LatestPostsEdit );\n\tconst {\n\t\tpostsToShow,\n\t\torder,\n\t\torderBy,\n\t\tcategories,\n\t\tselectedAuthor,\n\t\tdisplayFeaturedImage,\n\t\tdisplayPostContentRadio,\n\t\tdisplayPostContent,\n\t\tdisplayPostDate,\n\t\tdisplayAuthor,\n\t\tpostLayout,\n\t\tcolumns,\n\t\texcerptLength,\n\t\tfeaturedImageAlign,\n\t\tfeaturedImageSizeSlug,\n\t\tfeaturedImageSizeWidth,\n\t\tfeaturedImageSizeHeight,\n\t\taddLinkToFeaturedImage,\n\t} = attributes;\n\tconst {\n\t\timageSizes,\n\t\tlatestPosts,\n\t\tdefaultImageWidth,\n\t\tdefaultImageHeight,\n\t\tcategoriesList,\n\t\tauthorList,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecords, getUsers } = select( coreStore );\n\t\t\tconst settings = select( blockEditorStore ).getSettings();\n\t\t\tconst catIds =\n\t\t\t\tcategories && categories.length > 0\n\t\t\t\t\t? categories.map( ( cat ) => cat.id )\n\t\t\t\t\t: [];\n\t\t\tconst latestPostsQuery = Object.fromEntries(\n\t\t\t\tObject.entries( {\n\t\t\t\t\tcategories: catIds,\n\t\t\t\t\tauthor: selectedAuthor,\n\t\t\t\t\torder,\n\t\t\t\t\torderby: orderBy,\n\t\t\t\t\tper_page: postsToShow,\n\t\t\t\t\t_embed: 'wp:featuredmedia',\n\t\t\t\t} ).filter( ( [ , value ] ) => typeof value !== 'undefined' )\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tdefaultImageWidth:\n\t\t\t\t\tsettings.imageDimensions?.[ featuredImageSizeSlug ]\n\t\t\t\t\t\t?.width ?? 0,\n\t\t\t\tdefaultImageHeight:\n\t\t\t\t\tsettings.imageDimensions?.[ featuredImageSizeSlug ]\n\t\t\t\t\t\t?.height ?? 0,\n\t\t\t\timageSizes: settings.imageSizes,\n\t\t\t\tlatestPosts: getEntityRecords(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'post',\n\t\t\t\t\tlatestPostsQuery\n\t\t\t\t),\n\t\t\t\tcategoriesList: getEntityRecords(\n\t\t\t\t\t'taxonomy',\n\t\t\t\t\t'category',\n\t\t\t\t\tCATEGORIES_LIST_QUERY\n\t\t\t\t),\n\t\t\t\tauthorList: getUsers( USERS_LIST_QUERY ),\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tfeaturedImageSizeSlug,\n\t\t\tpostsToShow,\n\t\t\torder,\n\t\t\torderBy,\n\t\t\tcategories,\n\t\t\tselectedAuthor,\n\t\t]\n\t);\n\n\t// If a user clicks to a link prevent redirection and show a warning.\n\tconst { createWarningNotice, removeNotice } = useDispatch( noticeStore );\n\tlet noticeId;\n\tconst showRedirectionPreventedNotice = ( event ) => {\n\t\tevent.preventDefault();\n\t\t// Remove previous warning if any, to show one at a time per block.\n\t\tremoveNotice( noticeId );\n\t\tnoticeId = `block-library/core/latest-posts/redirection-prevented/${ instanceId }`;\n\t\tcreateWarningNotice( __( 'Links are disabled in the editor.' ), {\n\t\t\tid: noticeId,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t};\n\n\tconst imageSizeOptions = imageSizes\n\t\t.filter( ( { slug } ) => slug !== 'full' )\n\t\t.map( ( { name, slug } ) => ( {\n\t\t\tvalue: slug,\n\t\t\tlabel: name,\n\t\t} ) );\n\tconst categorySuggestions =\n\t\tcategoriesList?.reduce(\n\t\t\t( accumulator, category ) => ( {\n\t\t\t\t...accumulator,\n\t\t\t\t[ category.name ]: category,\n\t\t\t} ),\n\t\t\t{}\n\t\t) ?? {};\n\tconst selectCategories = ( tokens ) => {\n\t\tconst hasNoSuggestion = tokens.some(\n\t\t\t( token ) =>\n\t\t\t\ttypeof token === 'string' && ! categorySuggestions[ token ]\n\t\t);\n\t\tif ( hasNoSuggestion ) {\n\t\t\treturn;\n\t\t}\n\t\t// Categories that are already will be objects, while new additions will be strings (the name).\n\t\t// allCategories nomalizes the array so that they are all objects.\n\t\tconst allCategories = tokens.map( ( token ) => {\n\t\t\treturn typeof token === 'string'\n\t\t\t\t? categorySuggestions[ token ]\n\t\t\t\t: token;\n\t\t} );\n\t\t// We do nothing if the category is not selected\n\t\t// from suggestions.\n\t\tif ( allCategories.includes( null ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tsetAttributes( { categories: allCategories } );\n\t};\n\n\tconst hasPosts = !! latestPosts?.length;\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Post content' ) }>\n\t\t\t\t<ToggleControl\n\t\t\t\t\tlabel={ __( 'Post content' ) }\n\t\t\t\t\tchecked={ displayPostContent }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { displayPostContent: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ displayPostContent && (\n\t\t\t\t\t<RadioControl\n\t\t\t\t\t\tlabel={ __( 'Show:' ) }\n\t\t\t\t\t\tselected={ displayPostContentRadio }\n\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t{ label: __( 'Excerpt' ), value: 'excerpt' },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Full post' ),\n\t\t\t\t\t\t\t\tvalue: 'full_post',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tdisplayPostContentRadio: value,\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) }\n\t\t\t\t{ displayPostContent &&\n\t\t\t\t\tdisplayPostContentRadio === 'excerpt' && (\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Max number of words' ) }\n\t\t\t\t\t\t\tvalue={ excerptLength }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { excerptLength: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ MIN_EXCERPT_LENGTH }\n\t\t\t\t\t\t\tmax={ MAX_EXCERPT_LENGTH }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t</PanelBody>\n\n\t\t\t<PanelBody title={ __( 'Post meta' ) }>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Display author name' ) }\n\t\t\t\t\tchecked={ displayAuthor }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { displayAuthor: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Display post date' ) }\n\t\t\t\t\tchecked={ displayPostDate }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { displayPostDate: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\n\t\t\t<PanelBody title={ __( 'Featured image' ) }>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Display featured image' ) }\n\t\t\t\t\tchecked={ displayFeaturedImage }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { displayFeaturedImage: value } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ displayFeaturedImage && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<ImageSizeControl\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tconst newAttrs = {};\n\t\t\t\t\t\t\t\tif ( value.hasOwnProperty( 'width' ) ) {\n\t\t\t\t\t\t\t\t\tnewAttrs.featuredImageSizeWidth =\n\t\t\t\t\t\t\t\t\t\tvalue.width;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( value.hasOwnProperty( 'height' ) ) {\n\t\t\t\t\t\t\t\t\tnewAttrs.featuredImageSizeHeight =\n\t\t\t\t\t\t\t\t\t\tvalue.height;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetAttributes( newAttrs );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tslug={ featuredImageSizeSlug }\n\t\t\t\t\t\t\twidth={ featuredImageSizeWidth }\n\t\t\t\t\t\t\theight={ featuredImageSizeHeight }\n\t\t\t\t\t\t\timageWidth={ defaultImageWidth }\n\t\t\t\t\t\t\timageHeight={ defaultImageHeight }\n\t\t\t\t\t\t\timageSizeOptions={ imageSizeOptions }\n\t\t\t\t\t\t\timageSizeHelp={ __(\n\t\t\t\t\t\t\t\t'Select the size of the source image.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonChangeImage={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tfeaturedImageSizeSlug: value,\n\t\t\t\t\t\t\t\t\tfeaturedImageSizeWidth: undefined,\n\t\t\t\t\t\t\t\t\tfeaturedImageSizeHeight: undefined,\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\t<BaseControl className=\"editor-latest-posts-image-alignment-control\">\n\t\t\t\t\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t\t\t\t\t{ __( 'Image alignment' ) }\n\t\t\t\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t\t\t\t\t<BlockAlignmentToolbar\n\t\t\t\t\t\t\t\tvalue={ featuredImageAlign }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tfeaturedImageAlign: value,\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\tcontrols={ [ 'left', 'center', 'right' ] }\n\t\t\t\t\t\t\t\tisCollapsed={ false }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</BaseControl>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Add link to featured image' ) }\n\t\t\t\t\t\t\tchecked={ addLinkToFeaturedImage }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\taddLinkToFeaturedImage: value,\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) }\n\t\t\t</PanelBody>\n\n\t\t\t<PanelBody title={ __( 'Sorting and filtering' ) }>\n\t\t\t\t<QueryControls\n\t\t\t\t\t{ ...{ order, orderBy } }\n\t\t\t\t\tnumberOfItems={ postsToShow }\n\t\t\t\t\tonOrderChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { order: value } )\n\t\t\t\t\t}\n\t\t\t\t\tonOrderByChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { orderBy: value } )\n\t\t\t\t\t}\n\t\t\t\t\tonNumberOfItemsChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { postsToShow: value } )\n\t\t\t\t\t}\n\t\t\t\t\tcategorySuggestions={ categorySuggestions }\n\t\t\t\t\tonCategoryChange={ selectCategories }\n\t\t\t\t\tselectedCategories={ categories }\n\t\t\t\t\tonAuthorChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tselectedAuthor:\n\t\t\t\t\t\t\t\t'' !== value ? Number( value ) : undefined,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tauthorList={ authorList ?? [] }\n\t\t\t\t\tselectedAuthorId={ selectedAuthor }\n\t\t\t\t/>\n\n\t\t\t\t{ postLayout === 'grid' && (\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\tvalue={ columns }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { columns: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmin={ 2 }\n\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t! hasPosts\n\t\t\t\t\t\t\t\t? MAX_POSTS_COLUMNS\n\t\t\t\t\t\t\t\t: Math.min(\n\t\t\t\t\t\t\t\t\t\tMAX_POSTS_COLUMNS,\n\t\t\t\t\t\t\t\t\t\tlatestPosts.length\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t}\n\t\t\t\t\t\trequired\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t'wp-block-latest-posts__list': true,\n\t\t\t'is-grid': postLayout === 'grid',\n\t\t\t'has-dates': displayPostDate,\n\t\t\t'has-author': displayAuthor,\n\t\t\t[ `columns-${ columns }` ]: postLayout === 'grid',\n\t\t} ),\n\t} );\n\n\tif ( ! hasPosts ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ inspectorControls }\n\t\t\t\t<Placeholder icon={ pin } label={ __( 'Latest Posts' ) }>\n\t\t\t\t\t{ ! Array.isArray( latestPosts ) ? (\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t__( 'No posts found.' )\n\t\t\t\t\t) }\n\t\t\t\t</Placeholder>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Removing posts from display should be instant.\n\tconst displayPosts =\n\t\tlatestPosts.length > postsToShow\n\t\t\t? latestPosts.slice( 0, postsToShow )\n\t\t\t: latestPosts;\n\n\tconst layoutControls = [\n\t\t{\n\t\t\ticon: list,\n\t\t\ttitle: __( 'List view' ),\n\t\t\tonClick: () => setAttributes( { postLayout: 'list' } ),\n\t\t\tisActive: postLayout === 'list',\n\t\t},\n\t\t{\n\t\t\ticon: grid,\n\t\t\ttitle: __( 'Grid view' ),\n\t\t\tonClick: () => setAttributes( { postLayout: 'grid' } ),\n\t\t\tisActive: postLayout === 'grid',\n\t\t},\n\t];\n\n\tconst dateFormat = getSettings().formats.date;\n\n\treturn (\n\t\t<div>\n\t\t\t{ inspectorControls }\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup controls={ layoutControls } />\n\t\t\t</BlockControls>\n\t\t\t<ul { ...blockProps }>\n\t\t\t\t{ displayPosts.map( ( post ) => {\n\t\t\t\t\tconst titleTrimmed = post.title.rendered.trim();\n\t\t\t\t\tlet excerpt = post.excerpt.rendered;\n\t\t\t\t\tconst currentAuthor = authorList?.find(\n\t\t\t\t\t\t( author ) => author.id === post.author\n\t\t\t\t\t);\n\n\t\t\t\t\tconst excerptElement = document.createElement( 'div' );\n\t\t\t\t\texcerptElement.innerHTML = excerpt;\n\n\t\t\t\t\texcerpt =\n\t\t\t\t\t\texcerptElement.textContent ||\n\t\t\t\t\t\texcerptElement.innerText ||\n\t\t\t\t\t\t'';\n\n\t\t\t\t\tconst { url: imageSourceUrl, alt: featuredImageAlt } =\n\t\t\t\t\t\tgetFeaturedImageDetails( post, featuredImageSizeSlug );\n\t\t\t\t\tconst imageClasses = classnames( {\n\t\t\t\t\t\t'wp-block-latest-posts__featured-image': true,\n\t\t\t\t\t\t[ `align${ featuredImageAlign }` ]:\n\t\t\t\t\t\t\t!! featuredImageAlign,\n\t\t\t\t\t} );\n\t\t\t\t\tconst renderFeaturedImage =\n\t\t\t\t\t\tdisplayFeaturedImage && imageSourceUrl;\n\t\t\t\t\tconst featuredImage = renderFeaturedImage && (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tsrc={ imageSourceUrl }\n\t\t\t\t\t\t\talt={ featuredImageAlt }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmaxWidth: featuredImageSizeWidth,\n\t\t\t\t\t\t\t\tmaxHeight: featuredImageSizeHeight,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\n\t\t\t\t\tconst needsReadMore =\n\t\t\t\t\t\texcerptLength < excerpt.trim().split( ' ' ).length &&\n\t\t\t\t\t\tpost.excerpt.raw === '';\n\n\t\t\t\t\tconst postExcerpt = needsReadMore ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ excerpt\n\t\t\t\t\t\t\t\t.trim()\n\t\t\t\t\t\t\t\t.split( ' ', excerptLength )\n\t\t\t\t\t\t\t\t.join( ' ' ) }\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t/* translators: 1: Hidden accessibility text: Post title */\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'… <a>Read more<span>: %1$s</span></a>'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\ttitleTrimmed || __( '(no title)' )\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/anchor-has-content\n\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"wp-block-latest-posts__read-more\"\n\t\t\t\t\t\t\t\t\t\t\thref={ post.link }\n\t\t\t\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\t\t\t\t\tshowRedirectionPreventedNotice\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tspan: (\n\t\t\t\t\t\t\t\t\t\t<span className=\"screen-reader-text\" />\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</>\n\t\t\t\t\t) : (\n\t\t\t\t\t\texcerpt\n\t\t\t\t\t);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<li key={ post.id }>\n\t\t\t\t\t\t\t{ renderFeaturedImage && (\n\t\t\t\t\t\t\t\t<div className={ imageClasses }>\n\t\t\t\t\t\t\t\t\t{ addLinkToFeaturedImage ? (\n\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"wp-block-latest-posts__post-title\"\n\t\t\t\t\t\t\t\t\t\t\thref={ post.link }\n\t\t\t\t\t\t\t\t\t\t\trel=\"noreferrer noopener\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\t\t\t\t\tshowRedirectionPreventedNotice\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ featuredImage }\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\tfeaturedImage\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\thref={ post.link }\n\t\t\t\t\t\t\t\trel=\"noreferrer noopener\"\n\t\t\t\t\t\t\t\tdangerouslySetInnerHTML={\n\t\t\t\t\t\t\t\t\t!! titleTrimmed\n\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\t__html: titleTrimmed,\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonClick={ showRedirectionPreventedNotice }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ ! titleTrimmed ? __( '(no title)' ) : null }\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t{ displayAuthor && currentAuthor && (\n\t\t\t\t\t\t\t\t<div className=\"wp-block-latest-posts__post-author\">\n\t\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: byline. %s: current author. */\n\t\t\t\t\t\t\t\t\t\t__( 'by %s' ),\n\t\t\t\t\t\t\t\t\t\tcurrentAuthor.name\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ displayPostDate && post.date_gmt && (\n\t\t\t\t\t\t\t\t<time\n\t\t\t\t\t\t\t\t\tdateTime={ format( 'c', post.date_gmt ) }\n\t\t\t\t\t\t\t\t\tclassName=\"wp-block-latest-posts__post-date\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ dateI18n( dateFormat, post.date_gmt ) }\n\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ displayPostContent &&\n\t\t\t\t\t\t\t\tdisplayPostContentRadio === 'excerpt' && (\n\t\t\t\t\t\t\t\t\t<div className=\"wp-block-latest-posts__post-excerpt\">\n\t\t\t\t\t\t\t\t\t\t{ postExcerpt }\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ displayPostContent &&\n\t\t\t\t\t\t\t\tdisplayPostContentRadio === 'full_post' && (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tclassName=\"wp-block-latest-posts__post-full-content\"\n\t\t\t\t\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t\t\t\t\t__html: post.content.raw.trim(),\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</li>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ul>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAWA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAQA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AAKA,IAAAW,UAAA,GAAAX,OAAA;AAvCA;AACA;AACA;;AAGA;AACA;AACA;;AA6BA;AACA;AACA;;AAOA;AACA;AACA;AACA,MAAMY,qBAAqB,GAAG;EAC7BC,QAAQ,EAAE,CAAC,CAAC;EACZC,OAAO,EAAE;AACV,CAAC;AACD,MAAMC,gBAAgB,GAAG;EACxBF,QAAQ,EAAE,CAAC,CAAC;EACZG,mBAAmB,EAAE,CAAE,MAAM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ACf,CACI,CACL,EACCvD,eAAe,IAAIzB,IAAI,CAACqM,QAAQ,IACjC,IAAAtG,MAAA,CAAAC,aAAA;MACCsG,QAAQ,EAAG,IAAAC,YAAM,EAAE,GAAG,EAAEvM,IAAI,CAACqM,QAAS,CAAG;MACzC1E,SAAS,EAAC;IAAkC,GAE1C,IAAA6E,cAAQ,EAAE3C,UAAU,EAAE7J,IAAI,CAACqM,QAAS,CACjC,CACN,EACC7K,kBAAkB,IACnBD,uBAAuB,KAAK,SAAS,IACpC,IAAAwE,MAAA,CAAAC,aAAA;MAAK2B,SAAS,EAAC;IAAqC,GACjD8D,WACE,CACL,EACAjK,kBAAkB,IACnBD,uBAAuB,KAAK,WAAW,IACtC,IAAAwE,MAAA,CAAAC,aAAA;MACC2B,SAAS,EAAC,0CAA0C;MACpDwE,uBAAuB,EAAG;QACzBC,MAAM,EAAEpM,IAAI,CAACyM,OAAO,CAACjB,GAAG,CAACpB,IAAI,CAAC;MAC/B;IAAG,CACH,CAEA,CAAC;EAEP,CAAE,CACC,CACA,CAAC;AAER"}
|
|
@@ -80,6 +80,19 @@ function useMerge(clientId, onMerge) {
|
|
|
80
80
|
return getBlockOrder(order[0])[0];
|
|
81
81
|
}
|
|
82
82
|
return forward => {
|
|
83
|
+
function mergeWithNested(clientIdA, clientIdB) {
|
|
84
|
+
registry.batch(() => {
|
|
85
|
+
// When merging a sub list item with a higher next list item, we
|
|
86
|
+
// also need to move any nested list items. Check if there's a
|
|
87
|
+
// listed list, and append its nested list items to the current
|
|
88
|
+
// list.
|
|
89
|
+
const [nestedListClientId] = getBlockOrder(clientIdB);
|
|
90
|
+
if (nestedListClientId) {
|
|
91
|
+
moveBlocksToPosition(getBlockOrder(nestedListClientId), nestedListClientId, getBlockRootClientId(clientIdA));
|
|
92
|
+
}
|
|
93
|
+
mergeBlocks(clientIdA, clientIdB);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
83
96
|
if (forward) {
|
|
84
97
|
const nextBlockClientId = getNextId(clientId);
|
|
85
98
|
if (!nextBlockClientId) {
|
|
@@ -89,10 +102,7 @@ function useMerge(clientId, onMerge) {
|
|
|
89
102
|
if (getParentListItemId(nextBlockClientId)) {
|
|
90
103
|
outdentListItem(nextBlockClientId);
|
|
91
104
|
} else {
|
|
92
|
-
|
|
93
|
-
moveBlocksToPosition(getBlockOrder(nextBlockClientId), nextBlockClientId, getPreviousBlockClientId(nextBlockClientId));
|
|
94
|
-
mergeBlocks(clientId, nextBlockClientId);
|
|
95
|
-
});
|
|
105
|
+
mergeWithNested(clientId, nextBlockClientId);
|
|
96
106
|
}
|
|
97
107
|
} else {
|
|
98
108
|
// Merging is only done from the top level. For lowel levels, the
|
|
@@ -102,17 +112,7 @@ function useMerge(clientId, onMerge) {
|
|
|
102
112
|
outdentListItem(clientId);
|
|
103
113
|
} else if (previousBlockClientId) {
|
|
104
114
|
const trailingId = getTrailingId(previousBlockClientId);
|
|
105
|
-
|
|
106
|
-
// When merging a list item with a previous trailing list
|
|
107
|
-
// item, we also need to move any nested list items. First,
|
|
108
|
-
// check if there's a listed list. If there's a nested list,
|
|
109
|
-
// append its nested list items to the trailing list.
|
|
110
|
-
const [nestedListClientId] = getBlockOrder(clientId);
|
|
111
|
-
if (nestedListClientId) {
|
|
112
|
-
moveBlocksToPosition(getBlockOrder(nestedListClientId), nestedListClientId, getBlockRootClientId(trailingId));
|
|
113
|
-
}
|
|
114
|
-
mergeBlocks(trailingId, clientId);
|
|
115
|
-
});
|
|
115
|
+
mergeWithNested(trailingId, clientId);
|
|
116
116
|
} else {
|
|
117
117
|
onMerge(forward);
|
|
118
118
|
}
|