@wordpress/block-library 8.21.1-next.f8d8eceb.0 → 8.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/block/edit.js +6 -5
  3. package/build/block/edit.js.map +1 -1
  4. package/build/button/edit.js +57 -2
  5. package/build/button/edit.js.map +1 -1
  6. package/build/code/transforms.js +20 -7
  7. package/build/code/transforms.js.map +1 -1
  8. package/build/comments/edit/comments-inspector-controls.js +1 -0
  9. package/build/comments/edit/comments-inspector-controls.js.map +1 -1
  10. package/build/cover/edit/inspector-controls.js +1 -0
  11. package/build/cover/edit/inspector-controls.js.map +1 -1
  12. package/build/details/edit.js +1 -2
  13. package/build/details/edit.js.map +1 -1
  14. package/build/form/edit.js +1 -1
  15. package/build/form/edit.js.map +1 -1
  16. package/build/form/index.js +25 -5
  17. package/build/form/index.js.map +1 -1
  18. package/build/form-input/index.js +1 -1
  19. package/build/form-input/index.js.map +1 -1
  20. package/build/form-submission-notification/index.js +1 -1
  21. package/build/form-submission-notification/index.js.map +1 -1
  22. package/build/form-submit-button/edit.js +2 -1
  23. package/build/form-submit-button/edit.js.map +1 -1
  24. package/build/form-submit-button/index.js +1 -1
  25. package/build/form-submit-button/index.js.map +1 -1
  26. package/build/gallery/gap-styles.js +12 -7
  27. package/build/gallery/gap-styles.js.map +1 -1
  28. package/build/group/edit.js +1 -0
  29. package/build/group/edit.js.map +1 -1
  30. package/build/html/transforms.js +7 -2
  31. package/build/html/transforms.js.map +1 -1
  32. package/build/image/deprecated.js +8 -0
  33. package/build/image/deprecated.js.map +1 -1
  34. package/build/image/view.js +10 -7
  35. package/build/image/view.js.map +1 -1
  36. package/build/missing/index.js +1 -1
  37. package/build/navigation/edit/overlay-menu-preview.js +1 -1
  38. package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
  39. package/build/navigation/use-template-part-area-label.js +2 -1
  40. package/build/navigation/use-template-part-area-label.js.map +1 -1
  41. package/build/navigation-link/edit.js +1 -1
  42. package/build/navigation-link/edit.js.map +1 -1
  43. package/build/pattern/edit.js +1 -1
  44. package/build/pattern/edit.js.map +1 -1
  45. package/build/post-author/edit.js +0 -1
  46. package/build/post-author/edit.js.map +1 -1
  47. package/build/post-featured-image/edit.js +21 -6
  48. package/build/post-featured-image/edit.js.map +1 -1
  49. package/build/post-template/edit.js +2 -8
  50. package/build/post-template/edit.js.map +1 -1
  51. package/build/post-template/index.js +1 -1
  52. package/build/post-terms/edit.js +2 -4
  53. package/build/post-terms/edit.js.map +1 -1
  54. package/build/preformatted/transforms.js +1 -4
  55. package/build/preformatted/transforms.js.map +1 -1
  56. package/build/query/edit/query-content.js +1 -0
  57. package/build/query/edit/query-content.js.map +1 -1
  58. package/build/quote/index.js +6 -0
  59. package/build/quote/index.js.map +1 -1
  60. package/build/template-part/edit/advanced-controls.js +1 -0
  61. package/build/template-part/edit/advanced-controls.js.map +1 -1
  62. package/build/template-part/edit/index.js +3 -7
  63. package/build/template-part/edit/index.js.map +1 -1
  64. package/build/template-part/index.js +6 -2
  65. package/build/template-part/index.js.map +1 -1
  66. package/build/template-part/variations.js +5 -1
  67. package/build/template-part/variations.js.map +1 -1
  68. package/build-module/block/edit.js +6 -5
  69. package/build-module/block/edit.js.map +1 -1
  70. package/build-module/button/edit.js +61 -6
  71. package/build-module/button/edit.js.map +1 -1
  72. package/build-module/code/transforms.js +20 -7
  73. package/build-module/code/transforms.js.map +1 -1
  74. package/build-module/comments/edit/comments-inspector-controls.js +1 -0
  75. package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
  76. package/build-module/cover/edit/inspector-controls.js +1 -0
  77. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  78. package/build-module/details/edit.js +1 -2
  79. package/build-module/details/edit.js.map +1 -1
  80. package/build-module/form/edit.js +1 -1
  81. package/build-module/form/edit.js.map +1 -1
  82. package/build-module/form/index.js +29 -5
  83. package/build-module/form/index.js.map +1 -1
  84. package/build-module/form-input/index.js +1 -1
  85. package/build-module/form-input/index.js.map +1 -1
  86. package/build-module/form-submission-notification/index.js +1 -1
  87. package/build-module/form-submission-notification/index.js.map +1 -1
  88. package/build-module/form-submit-button/edit.js +2 -1
  89. package/build-module/form-submit-button/edit.js.map +1 -1
  90. package/build-module/form-submit-button/index.js +1 -1
  91. package/build-module/form-submit-button/index.js.map +1 -1
  92. package/build-module/gallery/gap-styles.js +13 -8
  93. package/build-module/gallery/gap-styles.js.map +1 -1
  94. package/build-module/group/edit.js +1 -0
  95. package/build-module/group/edit.js.map +1 -1
  96. package/build-module/html/transforms.js +7 -2
  97. package/build-module/html/transforms.js.map +1 -1
  98. package/build-module/image/deprecated.js +8 -0
  99. package/build-module/image/deprecated.js.map +1 -1
  100. package/build-module/image/view.js +10 -7
  101. package/build-module/image/view.js.map +1 -1
  102. package/build-module/missing/index.js +1 -1
  103. package/build-module/navigation/edit/overlay-menu-preview.js +1 -1
  104. package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
  105. package/build-module/navigation/use-template-part-area-label.js +2 -1
  106. package/build-module/navigation/use-template-part-area-label.js.map +1 -1
  107. package/build-module/navigation-link/edit.js +2 -2
  108. package/build-module/navigation-link/edit.js.map +1 -1
  109. package/build-module/pattern/edit.js +1 -1
  110. package/build-module/pattern/edit.js.map +1 -1
  111. package/build-module/post-author/edit.js +0 -1
  112. package/build-module/post-author/edit.js.map +1 -1
  113. package/build-module/post-featured-image/edit.js +21 -6
  114. package/build-module/post-featured-image/edit.js.map +1 -1
  115. package/build-module/post-template/edit.js +2 -8
  116. package/build-module/post-template/edit.js.map +1 -1
  117. package/build-module/post-template/index.js +1 -1
  118. package/build-module/post-terms/edit.js +2 -4
  119. package/build-module/post-terms/edit.js.map +1 -1
  120. package/build-module/preformatted/transforms.js +1 -4
  121. package/build-module/preformatted/transforms.js.map +1 -1
  122. package/build-module/query/edit/query-content.js +1 -0
  123. package/build-module/query/edit/query-content.js.map +1 -1
  124. package/build-module/quote/index.js +6 -0
  125. package/build-module/quote/index.js.map +1 -1
  126. package/build-module/template-part/edit/advanced-controls.js +1 -0
  127. package/build-module/template-part/edit/advanced-controls.js.map +1 -1
  128. package/build-module/template-part/edit/index.js +5 -9
  129. package/build-module/template-part/edit/index.js.map +1 -1
  130. package/build-module/template-part/index.js +6 -2
  131. package/build-module/template-part/index.js.map +1 -1
  132. package/build-module/template-part/variations.js +5 -1
  133. package/build-module/template-part/variations.js.map +1 -1
  134. package/build-style/editor-rtl.css +12 -0
  135. package/build-style/editor.css +12 -0
  136. package/build-style/image/editor-rtl.css +3 -0
  137. package/build-style/image/editor.css +3 -0
  138. package/build-style/image/style-rtl.css +19 -13
  139. package/build-style/image/style.css +19 -13
  140. package/build-style/post-featured-image/editor-rtl.css +9 -0
  141. package/build-style/post-featured-image/editor.css +9 -0
  142. package/build-style/quote/style-rtl.css +3 -0
  143. package/build-style/quote/style.css +3 -0
  144. package/build-style/read-more/style-rtl.css +2 -2
  145. package/build-style/read-more/style.css +2 -2
  146. package/build-style/style-rtl.css +24 -15
  147. package/build-style/style.css +24 -15
  148. package/package.json +32 -32
  149. package/src/block/edit.js +3 -2
  150. package/src/button/edit.js +70 -4
  151. package/src/code/transforms.js +14 -8
  152. package/src/comments/edit/comments-inspector-controls.js +1 -0
  153. package/src/cover/edit/inspector-controls.js +1 -0
  154. package/src/details/edit.js +0 -1
  155. package/src/form/edit.js +2 -0
  156. package/src/form/index.js +38 -1
  157. package/src/form-input/block.json +1 -1
  158. package/src/form-submission-notification/block.json +1 -1
  159. package/src/form-submit-button/block.json +1 -1
  160. package/src/form-submit-button/edit.js +1 -0
  161. package/src/gallery/gap-styles.js +10 -9
  162. package/src/group/edit.js +1 -0
  163. package/src/html/transforms.js +5 -2
  164. package/src/image/deprecated.js +8 -0
  165. package/src/image/editor.scss +7 -0
  166. package/src/image/index.php +3 -4
  167. package/src/image/style.scss +18 -13
  168. package/src/image/view.js +24 -11
  169. package/src/missing/block.json +1 -1
  170. package/src/navigation/edit/overlay-menu-preview.js +1 -1
  171. package/src/navigation/index.php +37 -402
  172. package/src/navigation/use-template-part-area-label.js +4 -2
  173. package/src/navigation-link/edit.js +2 -2
  174. package/src/navigation-link/index.php +57 -0
  175. package/src/paragraph/test/__snapshots__/transforms.native.js.snap +6 -0
  176. package/src/paragraph/test/transforms.native.js +1 -0
  177. package/src/pattern/edit.js +2 -1
  178. package/src/pattern/index.php +6 -1
  179. package/src/post-author/edit.js +0 -1
  180. package/src/post-featured-image/edit.js +38 -5
  181. package/src/post-featured-image/editor.scss +19 -0
  182. package/src/post-template/block.json +0 -1
  183. package/src/post-template/edit.js +1 -5
  184. package/src/post-terms/edit.js +2 -4
  185. package/src/preformatted/transforms.js +1 -4
  186. package/src/query/edit/query-content.js +1 -0
  187. package/src/query/index.php +6 -2
  188. package/src/quote/block.json +6 -0
  189. package/src/quote/style.scss +4 -0
  190. package/src/read-more/style.scss +1 -1
  191. package/src/template-part/edit/advanced-controls.js +1 -0
  192. package/src/template-part/edit/index.js +7 -14
  193. package/src/template-part/index.js +4 -3
  194. package/src/template-part/index.php +4 -4
  195. package/src/template-part/variations.js +4 -2
@@ -288,7 +288,9 @@ function handleScroll(context) {
288
288
  const caption = figure.querySelector('figcaption');
289
289
  if (caption) {
290
290
  const captionComputedStyle = window.getComputedStyle(caption);
291
- figureHeight = figureHeight - caption.offsetHeight - parseFloat(captionComputedStyle.marginTop) - parseFloat(captionComputedStyle.marginBottom);
291
+ if (!['absolute', 'fixed'].includes(captionComputedStyle.position)) {
292
+ figureHeight = figureHeight - caption.offsetHeight - parseFloat(captionComputedStyle.marginTop) - parseFloat(captionComputedStyle.marginBottom);
293
+ }
292
294
  }
293
295
  const buttonOffsetTop = figureHeight - offsetHeight;
294
296
  const buttonOffsetRight = figureWidth - offsetWidth;
@@ -305,18 +307,18 @@ function handleScroll(context) {
305
307
  // If it reaches the width first, keep
306
308
  // the width and compute the height.
307
309
  const referenceHeight = offsetWidth / naturalRatio;
308
- context.core.image.imageButtonTop = (offsetHeight - referenceHeight) / 2 + buttonOffsetTop + 10;
309
- context.core.image.imageButtonRight = buttonOffsetRight + 10;
310
+ context.core.image.imageButtonTop = (offsetHeight - referenceHeight) / 2 + buttonOffsetTop + 16;
311
+ context.core.image.imageButtonRight = buttonOffsetRight + 16;
310
312
  } else {
311
313
  // If it reaches the height first, keep
312
314
  // the height and compute the width.
313
315
  const referenceWidth = offsetHeight * naturalRatio;
314
- context.core.image.imageButtonTop = buttonOffsetTop + 10;
315
- context.core.image.imageButtonRight = (offsetWidth - referenceWidth) / 2 + buttonOffsetRight + 10;
316
+ context.core.image.imageButtonTop = buttonOffsetTop + 16;
317
+ context.core.image.imageButtonRight = (offsetWidth - referenceWidth) / 2 + buttonOffsetRight + 16;
316
318
  }
317
319
  } else {
318
- context.core.image.imageButtonTop = buttonOffsetTop + 10;
319
- context.core.image.imageButtonRight = buttonOffsetRight + 10;
320
+ context.core.image.imageButtonTop = buttonOffsetTop + 16;
321
+ context.core.image.imageButtonRight = buttonOffsetRight + 16;
320
322
  }
321
323
  },
322
324
  setStylesOnResize: ({
@@ -496,6 +498,7 @@ function setStyles(context, ref) {
496
498
  --wp--lightbox-image-width: ${lightboxImgWidth}px;
497
499
  --wp--lightbox-image-height: ${lightboxImgHeight}px;
498
500
  --wp--lightbox-scale: ${containerScale};
501
+ --wp--lightbox-scrollbar-width: ${window.innerWidth - document.documentElement.clientWidth}px;
499
502
  }
500
503
  `;
501
504
  }
@@ -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","pointerType","lightboxEnabled","setStyles","imageRef","pageYOffset","documentElement","scrollTop","pageXOffset","scrollLeft","bind","addEventListener","hideLightbox","hideAnimationEnabled","setTimeout","removeEventListener","lightboxTriggerRef","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","parentElement","querySelector","complete","initLightbox","focusableElements","querySelectorAll","length","naturalWidth","naturalHeight","offsetWidth","offsetHeight","figure","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 } ) => {\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\t// If we don't delay before changing the focus,\n\t\t\t\t\t\t\t\t// the focus ring will appear on Firefox before\n\t\t\t\t\t\t\t\t// the image has finished animating, which looks broken.\n\t\t\t\t\t\t\t\tcontext.core.image.lightboxTriggerRef.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}, 450 );\n\n\t\t\t\t\t\t\tcontext.core.image.lightboxEnabled = false;\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\tcontext.core.image.lightboxTriggerRef =\n\t\t\t\t\t\t\tref.parentElement.querySelector(\n\t\t\t\t\t\t\t\t'.lightbox-trigger'\n\t\t\t\t\t\t\t);\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// Move focus to the dialog when opening it.\n\t\t\t\t\t\t\tref.focus();\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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BAAmB;AACtD,2BAA4BF,cAAgB;AAC5C;AACA,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS9B,QAAQA,CAAEwC,IAAI,EAAEC,IAAI,GAAG,EAAE,EAAG;EACpC,IAAIC,OAAO;EACX,OAAO,MAAM;IACZ,MAAMC,KAAK,GAAGA,CAAA,KAAM;MACnBD,OAAO,GAAG,IAAI;MACdF,IAAI,CAAC,CAAC;IACP,CAAC;IACDI,YAAY,CAAEF,OAAQ,CAAC;IACvBA,OAAO,GAAGxG,UAAU,CAAEyG,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","lightboxTriggerRef","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","parentElement","querySelector","complete","initLightbox","focusableElements","querySelectorAll","length","naturalWidth","naturalHeight","offsetWidth","offsetHeight","figure","figureWidth","clientWidth","figureHeight","clientHeight","caption","captionComputedStyle","getComputedStyle","includes","position","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 } ) => {\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\t// If we don't delay before changing the focus,\n\t\t\t\t\t\t\t\t// the focus ring will appear on Firefox before\n\t\t\t\t\t\t\t\t// the image has finished animating, which looks broken.\n\t\t\t\t\t\t\t\tcontext.core.image.lightboxTriggerRef.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}, 450 );\n\n\t\t\t\t\t\t\tcontext.core.image.lightboxEnabled = false;\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\tcontext.core.image.lightboxTriggerRef =\n\t\t\t\t\t\t\tref.parentElement.querySelector(\n\t\t\t\t\t\t\t\t'.lightbox-trigger'\n\t\t\t\t\t\t\t);\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// Move focus to the dialog when opening it.\n\t\t\t\t\t\t\tref.focus();\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\tif (\n\t\t\t\t\t\t\t\t! [ 'absolute', 'fixed' ].includes(\n\t\t\t\t\t\t\t\t\tcaptionComputedStyle.position\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tfigureHeight =\n\t\t\t\t\t\t\t\t\tfigureHeight -\n\t\t\t\t\t\t\t\t\tcaption.offsetHeight -\n\t\t\t\t\t\t\t\t\tparseFloat(\n\t\t\t\t\t\t\t\t\t\tcaptionComputedStyle.marginTop\n\t\t\t\t\t\t\t\t\t) -\n\t\t\t\t\t\t\t\t\tparseFloat(\n\t\t\t\t\t\t\t\t\t\tcaptionComputedStyle.marginBottom\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\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\t16;\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonRight =\n\t\t\t\t\t\t\t\t\tbuttonOffsetRight + 16;\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 + 16;\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\t16;\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 + 16;\n\t\t\t\t\t\t\tcontext.core.image.imageButtonRight =\n\t\t\t\t\t\t\t\tbuttonOffsetRight + 16;\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\t--wp--lightbox-scrollbar-width: ${\n\t\t\t\twindow.innerWidth - document.documentElement.clientWidth\n\t\t\t}px;\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,CAA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IhI,MAAM,CAACS,UAAU,GAAGS,QAAQ,CAACQ,eAAe,CAACkD,WAC7C;AACJ;AACA,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASsB,QAAQA,CAAEwC,IAAI,EAAEC,IAAI,GAAG,EAAE,EAAG;EACpC,IAAIC,OAAO;EACX,OAAO,MAAM;IACZ,MAAMC,KAAK,GAAGA,CAAA,KAAM;MACnBD,OAAO,GAAG,IAAI;MACdF,IAAI,CAAC,CAAC;IACP,CAAC;IACDI,YAAY,CAAEF,OAAQ,CAAC;IACvBA,OAAO,GAAG1G,UAAU,CAAE2G,KAAK,EAAEF,IAAK,CAAC;EACpC,CAAC;AACF"}
@@ -32,7 +32,7 @@ const metadata = {
32
32
  },
33
33
  originalContent: {
34
34
  type: "string",
35
- source: "html"
35
+ source: "raw"
36
36
  }
37
37
  },
38
38
  supports: {
@@ -25,7 +25,7 @@ function OverlayMenuPreview({
25
25
  return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.ToggleControl, {
26
26
  __nextHasNoMarginBottom: true,
27
27
  label: (0, _i18n.__)('Show icon button'),
28
- help: (0, _i18n.__)('Configure the visual appearance of the button opening the overlay menu.'),
28
+ help: (0, _i18n.__)('Configure the visual appearance of the button that toggles the overlay menu.'),
29
29
  onChange: value => setAttributes({
30
30
  hasIcon: value
31
31
  }),
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_overlayMenuIcon","_interopRequireDefault","OverlayMenuPreview","setAttributes","hasIcon","icon","_react","createElement","Fragment","ToggleControl","__nextHasNoMarginBottom","label","__","help","onChange","value","checked","__experimentalToggleGroupControl","isBlock","__experimentalToggleGroupControlOption","default"],"sources":["@wordpress/block-library/src/navigation/edit/overlay-menu-preview.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tToggleControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport OverlayMenuIcon from './overlay-menu-icon';\n\nexport default function OverlayMenuPreview( { setAttributes, hasIcon, icon } ) {\n\treturn (\n\t\t<>\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Show icon button' ) }\n\t\t\t\thelp={ __(\n\t\t\t\t\t'Configure the visual appearance of the button opening the overlay menu.'\n\t\t\t\t) }\n\t\t\t\tonChange={ ( value ) => setAttributes( { hasIcon: value } ) }\n\t\t\t\tchecked={ hasIcon }\n\t\t\t/>\n\n\t\t\t<ToggleGroupControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Icon' ) }\n\t\t\t\tvalue={ icon }\n\t\t\t\tonChange={ ( value ) => setAttributes( { icon: value } ) }\n\t\t\t\tisBlock\n\t\t\t>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tvalue=\"handle\"\n\t\t\t\t\taria-label={ __( 'handle' ) }\n\t\t\t\t\tlabel={ <OverlayMenuIcon icon=\"handle\" /> }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tvalue=\"menu\"\n\t\t\t\t\taria-label={ __( 'menu' ) }\n\t\t\t\t\tlabel={ <OverlayMenuIcon icon=\"menu\" /> }\n\t\t\t\t/>\n\t\t\t</ToggleGroupControl>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,gBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAbA;AACA;AACA;;AAQA;AACA;AACA;;AAGe,SAASI,kBAAkBA,CAAE;EAAEC,aAAa;EAAEC,OAAO;EAAEC;AAAK,CAAC,EAAG;EAC9E,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAACV,WAAA,CAAAY,aAAa;IACbC,uBAAuB;IACvBC,KAAK,EAAG,IAAAC,QAAE,EAAE,kBAAmB,CAAG;IAClCC,IAAI,EAAG,IAAAD,QAAE,EACR,yEACD,CAAG;IACHE,QAAQ,EAAKC,KAAK,IAAMZ,aAAa,CAAE;MAAEC,OAAO,EAAEW;IAAM,CAAE,CAAG;IAC7DC,OAAO,EAAGZ;EAAS,CACnB,CAAC,EAEF,IAAAE,MAAA,CAAAC,aAAA,EAACV,WAAA,CAAAoB,gCAAkB;IAClBP,uBAAuB;IACvBC,KAAK,EAAG,IAAAC,QAAE,EAAE,MAAO,CAAG;IACtBG,KAAK,EAAGV,IAAM;IACdS,QAAQ,EAAKC,KAAK,IAAMZ,aAAa,CAAE;MAAEE,IAAI,EAAEU;IAAM,CAAE,CAAG;IAC1DG,OAAO;EAAA,GAEP,IAAAZ,MAAA,CAAAC,aAAA,EAACV,WAAA,CAAAsB,sCAAwB;IACxBJ,KAAK,EAAC,QAAQ;IACd,cAAa,IAAAH,QAAE,EAAE,QAAS,CAAG;IAC7BD,KAAK,EAAG,IAAAL,MAAA,CAAAC,aAAA,EAACP,gBAAA,CAAAoB,OAAe;MAACf,IAAI,EAAC;IAAQ,CAAE;EAAG,CAC3C,CAAC,EACF,IAAAC,MAAA,CAAAC,aAAA,EAACV,WAAA,CAAAsB,sCAAwB;IACxBJ,KAAK,EAAC,MAAM;IACZ,cAAa,IAAAH,QAAE,EAAE,MAAO,CAAG;IAC3BD,KAAK,EAAG,IAAAL,MAAA,CAAAC,aAAA,EAACP,gBAAA,CAAAoB,OAAe;MAACf,IAAI,EAAC;IAAM,CAAE;EAAG,CACzC,CACkB,CACnB,CAAC;AAEL"}
1
+ {"version":3,"names":["_components","require","_i18n","_overlayMenuIcon","_interopRequireDefault","OverlayMenuPreview","setAttributes","hasIcon","icon","_react","createElement","Fragment","ToggleControl","__nextHasNoMarginBottom","label","__","help","onChange","value","checked","__experimentalToggleGroupControl","isBlock","__experimentalToggleGroupControlOption","default"],"sources":["@wordpress/block-library/src/navigation/edit/overlay-menu-preview.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tToggleControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport OverlayMenuIcon from './overlay-menu-icon';\n\nexport default function OverlayMenuPreview( { setAttributes, hasIcon, icon } ) {\n\treturn (\n\t\t<>\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Show icon button' ) }\n\t\t\t\thelp={ __(\n\t\t\t\t\t'Configure the visual appearance of the button that toggles the overlay menu.'\n\t\t\t\t) }\n\t\t\t\tonChange={ ( value ) => setAttributes( { hasIcon: value } ) }\n\t\t\t\tchecked={ hasIcon }\n\t\t\t/>\n\n\t\t\t<ToggleGroupControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Icon' ) }\n\t\t\t\tvalue={ icon }\n\t\t\t\tonChange={ ( value ) => setAttributes( { icon: value } ) }\n\t\t\t\tisBlock\n\t\t\t>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tvalue=\"handle\"\n\t\t\t\t\taria-label={ __( 'handle' ) }\n\t\t\t\t\tlabel={ <OverlayMenuIcon icon=\"handle\" /> }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tvalue=\"menu\"\n\t\t\t\t\taria-label={ __( 'menu' ) }\n\t\t\t\t\tlabel={ <OverlayMenuIcon icon=\"menu\" /> }\n\t\t\t\t/>\n\t\t\t</ToggleGroupControl>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,gBAAA,GAAAC,sBAAA,CAAAH,OA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;EAAG,CACzC,CACkB,CACnB,CAAC;AAEL"}
@@ -43,6 +43,7 @@ function useTemplatePartAreaLabel(clientId) {
43
43
  const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas();
44
44
  /* eslint-enable @wordpress/data-no-store-string-literals */
45
45
  const {
46
+ getCurrentTheme,
46
47
  getEditedEntityRecord
47
48
  } = select(_coreData.store);
48
49
  for (const templatePartClientId of parentTemplatePartClientIds) {
@@ -51,7 +52,7 @@ function useTemplatePartAreaLabel(clientId) {
51
52
  // The 'area' usually isn't stored on the block, but instead
52
53
  // on the entity.
53
54
  const {
54
- theme,
55
+ theme = getCurrentTheme()?.stylesheet,
55
56
  slug
56
57
  } = templatePartBlock.attributes;
57
58
  const templatePartEntityId = (0, _createTemplatePartId.createTemplatePartId)(theme, slug);
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_coreData","_data","_createTemplatePartId","useTemplatePartAreaLabel","clientId","useSelect","select","getBlock","getBlockParentsByBlockName","blockEditorStore","withAscendingResults","parentTemplatePartClientIds","length","definedAreas","__experimentalGetDefaultTemplatePartAreas","getEditedEntityRecord","coreStore","templatePartClientId","templatePartBlock","theme","slug","attributes","templatePartEntityId","createTemplatePartId","templatePartEntity","area","find","definedArea","label"],"sources":["@wordpress/block-library/src/navigation/use-template-part-area-label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\n\n// TODO: this util should perhaps be refactored somewhere like core-data.\nimport { createTemplatePartId } from '../template-part/edit/utils/create-template-part-id';\n\nexport default function useTemplatePartAreaLabel( clientId ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\t// Use the lack of a clientId as an opportunity to bypass the rest\n\t\t\t// of this hook.\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { getBlock, getBlockParentsByBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst withAscendingResults = true;\n\t\t\tconst parentTemplatePartClientIds = getBlockParentsByBlockName(\n\t\t\t\tclientId,\n\t\t\t\t'core/template-part',\n\t\t\t\twithAscendingResults\n\t\t\t);\n\n\t\t\tif ( ! parentTemplatePartClientIds?.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// FIXME: @wordpress/block-library should not depend on @wordpress/editor.\n\t\t\t// Blocks can be loaded into a *non-post* block editor.\n\t\t\t// This code is lifted from this file:\n\t\t\t// packages/block-library/src/template-part/edit/advanced-controls.js\n\t\t\t/* eslint-disable @wordpress/data-no-store-string-literals */\n\t\t\tconst definedAreas =\n\t\t\t\tselect(\n\t\t\t\t\t'core/editor'\n\t\t\t\t).__experimentalGetDefaultTemplatePartAreas();\n\t\t\t/* eslint-enable @wordpress/data-no-store-string-literals */\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\n\t\t\tfor ( const templatePartClientId of parentTemplatePartClientIds ) {\n\t\t\t\tconst templatePartBlock = getBlock( templatePartClientId );\n\n\t\t\t\t// The 'area' usually isn't stored on the block, but instead\n\t\t\t\t// on the entity.\n\t\t\t\tconst { theme, slug } = templatePartBlock.attributes;\n\t\t\t\tconst templatePartEntityId = createTemplatePartId(\n\t\t\t\t\ttheme,\n\t\t\t\t\tslug\n\t\t\t\t);\n\t\t\t\tconst templatePartEntity = getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_template_part',\n\t\t\t\t\ttemplatePartEntityId\n\t\t\t\t);\n\n\t\t\t\t// Look up the `label` for the area in the defined areas so\n\t\t\t\t// that an internationalized label can be used.\n\t\t\t\tif ( templatePartEntity?.area ) {\n\t\t\t\t\treturn definedAreas.find(\n\t\t\t\t\t\t( definedArea ) =>\n\t\t\t\t\t\t\tdefinedArea.area !== 'uncategorized' &&\n\t\t\t\t\t\t\tdefinedArea.area === templatePartEntity.area\n\t\t\t\t\t)?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Z,YAAY,CAACa,IAAI,CACrBC,WAAW,IACZA,WAAW,CAACF,IAAI,KAAK,eAAe,IACpCE,WAAW,CAACF,IAAI,KAAKD,kBAAkB,CAACC,IAC1C,CAAC,EAAEG,KAAK;MACT;IACD;EACD,CAAC,EACD,CAAExB,QAAQ,CACX,CAAC;AACF"}
1
+ {"version":3,"names":["_blockEditor","require","_coreData","_data","_createTemplatePartId","useTemplatePartAreaLabel","clientId","useSelect","select","getBlock","getBlockParentsByBlockName","blockEditorStore","withAscendingResults","parentTemplatePartClientIds","length","definedAreas","__experimentalGetDefaultTemplatePartAreas","getCurrentTheme","getEditedEntityRecord","coreStore","templatePartClientId","templatePartBlock","theme","stylesheet","slug","attributes","templatePartEntityId","createTemplatePartId","templatePartEntity","area","find","definedArea","label"],"sources":["@wordpress/block-library/src/navigation/use-template-part-area-label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\n\n// TODO: this util should perhaps be refactored somewhere like core-data.\nimport { createTemplatePartId } from '../template-part/edit/utils/create-template-part-id';\n\nexport default function useTemplatePartAreaLabel( clientId ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\t// Use the lack of a clientId as an opportunity to bypass the rest\n\t\t\t// of this hook.\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { getBlock, getBlockParentsByBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst withAscendingResults = true;\n\t\t\tconst parentTemplatePartClientIds = getBlockParentsByBlockName(\n\t\t\t\tclientId,\n\t\t\t\t'core/template-part',\n\t\t\t\twithAscendingResults\n\t\t\t);\n\n\t\t\tif ( ! parentTemplatePartClientIds?.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// FIXME: @wordpress/block-library should not depend on @wordpress/editor.\n\t\t\t// Blocks can be loaded into a *non-post* block editor.\n\t\t\t// This code is lifted from this file:\n\t\t\t// packages/block-library/src/template-part/edit/advanced-controls.js\n\t\t\t/* eslint-disable @wordpress/data-no-store-string-literals */\n\t\t\tconst definedAreas =\n\t\t\t\tselect(\n\t\t\t\t\t'core/editor'\n\t\t\t\t).__experimentalGetDefaultTemplatePartAreas();\n\t\t\t/* eslint-enable @wordpress/data-no-store-string-literals */\n\t\t\tconst { getCurrentTheme, getEditedEntityRecord } =\n\t\t\t\tselect( coreStore );\n\n\t\t\tfor ( const templatePartClientId of parentTemplatePartClientIds ) {\n\t\t\t\tconst templatePartBlock = getBlock( templatePartClientId );\n\n\t\t\t\t// The 'area' usually isn't stored on the block, but instead\n\t\t\t\t// on the entity.\n\t\t\t\tconst { theme = getCurrentTheme()?.stylesheet, slug } =\n\t\t\t\t\ttemplatePartBlock.attributes;\n\t\t\t\tconst templatePartEntityId = createTemplatePartId(\n\t\t\t\t\ttheme,\n\t\t\t\t\tslug\n\t\t\t\t);\n\t\t\t\tconst templatePartEntity = getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_template_part',\n\t\t\t\t\ttemplatePartEntityId\n\t\t\t\t);\n\n\t\t\t\t// Look up the `label` for the area in the defined areas so\n\t\t\t\t// that an internationalized label can be used.\n\t\t\t\tif ( templatePartEntity?.area ) {\n\t\t\t\t\treturn definedAreas.find(\n\t\t\t\t\t\t( definedArea ) =>\n\t\t\t\t\t\t\tdefinedArea.area !== 'uncategorized' &&\n\t\t\t\t\t\t\tdefinedArea.area === templatePartEntity.area\n\t\t\t\t\t)?.label;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[ clientId ]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAOA,IAAAG,qBAAA,GAAAH,OAAA;AAZA;AACA;AACA;;AAKA;A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B,QAAQ,CACX,CAAC;AACF"}
@@ -365,7 +365,7 @@ function NavigationLinkEdit({
365
365
  onBlur: () => setIsLabelFieldFocused(false)
366
366
  }), (0, _react.createElement)(_components.TextControl, {
367
367
  __nextHasNoMarginBottom: true,
368
- value: url || '',
368
+ value: url ? (0, _url.safeDecodeURI)(url) : '',
369
369
  onChange: urlValue => {
370
370
  (0, _updateAttributes.updateAttributes)({
371
371
  url: urlValue
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_blocks","_data","_components","_keycodes","_i18n","_blockEditor","_url","_element","_dom","_htmlEntities","_icons","_coreData","_compose","_linkUi","_updateAttributes","_utils","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","useState","useEffect","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener","useIsInvalidLink","kind","type","id","isPostType","hasId","Number","isInteger","postStatus","useSelect","select","getEntityRecord","coreStore","status","isInvalid","isDraft","getMissingText","missingText","__","NavigationLinkEdit","attributes","isSelected","setAttributes","insertBlocksAfter","mergeBlocks","onReplace","context","clientId","label","url","description","rel","title","maxNestingLevel","replaceBlock","__unstableMarkNextChangeAsNotPersistent","useDispatch","blockEditorStore","isLinkOpen","setIsLinkOpen","popoverAnchor","setPopoverAnchor","listItemRef","useRef","itemLabelPlaceholder","ref","isLabelFieldFocused","setIsLabelFieldFocused","innerBlocks","isAtMaxNesting","isTopLevelLink","isParentOfSelectedBlock","hasChildren","getBlocks","getBlockCount","getBlockName","getBlockRootClientId","hasSelectedInnerBlock","getBlockParentsByBlockName","length","transformToSubmenu","newSubmenu","createBlock","isURL","prependHTTP","test","selectLabelText","placeCaretAtHorizontalEdge","focus","defaultView","selection","getSelection","range","createRange","selectNodeContents","removeAllRanges","addRange","removeLink","undefined","opensInNewTab","textColor","customTextColor","backgroundColor","customBackgroundColor","getColors","onKeyDown","isKeyboardEvent","primary","keyCode","ENTER","blockProps","useBlockProps","useMergeRefs","className","classnames","getColorClassName","style","color","ALLOWED_BLOCKS","DEFAULT_BLOCK","name","innerBlocksProps","useInnerBlocksProps","allowedBlocks","defaultBlock","directInsert","renderAppender","onClick","classes","placeholderText","tooltipText","_react","createElement","Fragment","BlockControls","ToolbarGroup","ToolbarButton","icon","linkIcon","shortcut","displayShortcut","addSubmenu","InspectorControls","PanelBody","TextControl","__nextHasNoMarginBottom","value","stripHTML","onChange","labelValue","autoComplete","onFocus","onBlur","urlValue","updateAttributes","TextareaControl","descriptionValue","help","titleValue","relValue","Tooltip","text","RichText","identifier","onMerge","__unstableOnSplitAtEnd","placeholder","withoutInteractiveFormatting","allowedFormats","decodeEntities","trim","LinkUI","link","onClose","anchor","onRemove","updatedValue"],"sources":["@wordpress/block-library/src/navigation-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPanelBody,\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tTooltip,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { displayShortcut, isKeyboardEvent, ENTER } from '@wordpress/keycodes';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tgetColorClassName,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport { isURL, prependHTTP } from '@wordpress/url';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport {\n\tplaceCaretAtHorizontalEdge,\n\t__unstableStripHTML as stripHTML,\n} from '@wordpress/dom';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { link as linkIcon, addSubmenu } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { LinkUI } from './link-ui';\nimport { updateAttributes } from './update-attributes';\nimport { getColors } from '../navigation/edit/utils';\n\n/**\n * A React hook to determine if it's dragging within the target element.\n *\n * @typedef {import('@wordpress/element').RefObject} RefObject\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the target element.\n */\nconst useIsDraggingWithin = ( elementRef ) => {\n\tconst [ isDraggingWithin, setIsDraggingWithin ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart( event ) {\n\t\t\t// Check the first time when the dragging starts.\n\t\t\thandleDragEnter( event );\n\t\t}\n\n\t\t// Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDraggingWithin( false );\n\t\t}\n\n\t\tfunction handleDragEnter( event ) {\n\t\t\t// Check if the current target is inside the item element.\n\t\t\tif ( elementRef.current.contains( event.target ) ) {\n\t\t\t\tsetIsDraggingWithin( true );\n\t\t\t} else {\n\t\t\t\tsetIsDraggingWithin( false );\n\t\t\t}\n\t\t}\n\n\t\t// Bind these events to the document to catch all drag events.\n\t\t// Ideally, we can also use `event.relatedTarget`, but sadly that\n\t\t// doesn't work in Safari.\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\t\townerDocument.addEventListener( 'dragenter', handleDragEnter );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener( 'dragstart', handleDragStart );\n\t\t\townerDocument.removeEventListener( 'dragend', handleDragEnd );\n\t\t\townerDocument.removeEventListener( 'dragenter', handleDragEnter );\n\t\t};\n\t}, [] );\n\n\treturn isDraggingWithin;\n};\n\nconst useIsInvalidLink = ( kind, type, id ) => {\n\tconst isPostType =\n\t\tkind === 'post-type' || type === 'post' || type === 'page';\n\tconst hasId = Number.isInteger( id );\n\tconst postStatus = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isPostType ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\treturn getEntityRecord( 'postType', type, id )?.status;\n\t\t},\n\t\t[ isPostType, type, id ]\n\t);\n\n\t// Check Navigation Link validity if:\n\t// 1. Link is 'post-type'.\n\t// 2. It has an id.\n\t// 3. It's neither null, nor undefined, as valid items might be either of those while loading.\n\t// If those conditions are met, check if\n\t// 1. The post status is published.\n\t// 2. The Navigation Link item has no label.\n\t// If either of those is true, invalidate.\n\tconst isInvalid =\n\t\tisPostType && hasId && postStatus && 'trash' === postStatus;\n\tconst isDraft = 'draft' === postStatus;\n\n\treturn [ isInvalid, isDraft ];\n};\n\nfunction getMissingText( type ) {\n\tlet missingText = '';\n\n\tswitch ( type ) {\n\t\tcase 'post':\n\t\t\t/* translators: label for missing post in navigation link block */\n\t\t\tmissingText = __( 'Select post' );\n\t\t\tbreak;\n\t\tcase 'page':\n\t\t\t/* translators: label for missing page in navigation link block */\n\t\t\tmissingText = __( 'Select page' );\n\t\t\tbreak;\n\t\tcase 'category':\n\t\t\t/* translators: label for missing category in navigation link block */\n\t\t\tmissingText = __( 'Select category' );\n\t\t\tbreak;\n\t\tcase 'tag':\n\t\t\t/* translators: label for missing tag in navigation link block */\n\t\t\tmissingText = __( 'Select tag' );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t/* translators: label for missing values in navigation link block */\n\t\t\tmissingText = __( 'Add link' );\n\t}\n\n\treturn missingText;\n}\n\nexport default function NavigationLinkEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tmergeBlocks,\n\tonReplace,\n\tcontext,\n\tclientId,\n} ) {\n\tconst { id, label, type, url, description, rel, title, kind } = attributes;\n\n\tconst [ isInvalid, isDraft ] = useIsInvalidLink( kind, type, id );\n\tconst { maxNestingLevel } = context;\n\n\tconst { replaceBlock, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst [ isLinkOpen, setIsLinkOpen ] = useState( false );\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst listItemRef = useRef( null );\n\tconst isDraggingWithin = useIsDraggingWithin( listItemRef );\n\tconst itemLabelPlaceholder = __( 'Add label…' );\n\tconst ref = useRef();\n\n\t// Change the label using inspector causes rich text to change focus on firefox.\n\t// This is a workaround to keep the focus on the label field when label filed is focused we don't render the rich text.\n\tconst [ isLabelFieldFocused, setIsLabelFieldFocused ] = useState( false );\n\n\tconst {\n\t\tinnerBlocks,\n\t\tisAtMaxNesting,\n\t\tisTopLevelLink,\n\t\tisParentOfSelectedBlock,\n\t\thasChildren,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlocks,\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\treturn {\n\t\t\t\tinnerBlocks: getBlocks( clientId ),\n\t\t\t\tisAtMaxNesting:\n\t\t\t\t\tgetBlockParentsByBlockName( clientId, [\n\t\t\t\t\t\t'core/navigation-link',\n\t\t\t\t\t\t'core/navigation-submenu',\n\t\t\t\t\t] ).length >= maxNestingLevel,\n\t\t\t\tisTopLevelLink:\n\t\t\t\t\tgetBlockName( getBlockRootClientId( clientId ) ) ===\n\t\t\t\t\t'core/navigation',\n\t\t\t\tisParentOfSelectedBlock: hasSelectedInnerBlock(\n\t\t\t\t\tclientId,\n\t\t\t\t\ttrue\n\t\t\t\t),\n\t\t\t\thasChildren: !! getBlockCount( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\t/**\n\t * Transform to submenu block.\n\t */\n\tfunction transformToSubmenu() {\n\t\tconst newSubmenu = createBlock(\n\t\t\t'core/navigation-submenu',\n\t\t\tattributes,\n\t\t\tinnerBlocks.length > 0\n\t\t\t\t? innerBlocks\n\t\t\t\t: [ createBlock( 'core/navigation-link' ) ]\n\t\t);\n\t\treplaceBlock( clientId, newSubmenu );\n\t}\n\n\tuseEffect( () => {\n\t\t// Show the LinkControl on mount if the URL is empty\n\t\t// ( When adding a new menu item)\n\t\t// This can't be done in the useState call because it conflicts\n\t\t// with the autofocus behavior of the BlockListBlock component.\n\t\tif ( ! url ) {\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}, [ url ] );\n\n\tuseEffect( () => {\n\t\t// If block has inner blocks, transform to Submenu.\n\t\tif ( hasChildren ) {\n\t\t\t// This side-effect should not create an undo level as those should\n\t\t\t// only be created via user interactions.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\ttransformToSubmenu();\n\t\t}\n\t}, [ hasChildren ] );\n\n\t/**\n\t * The hook shouldn't be necessary but due to a focus loss happening\n\t * when selecting a suggestion in the link popover, we force close on block unselection.\n\t */\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsLinkOpen( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\t// If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.\n\tuseEffect( () => {\n\t\tif ( isLinkOpen && url ) {\n\t\t\t// Does this look like a URL and have something TLD-ish?\n\t\t\tif (\n\t\t\t\tisURL( prependHTTP( label ) ) &&\n\t\t\t\t/^.+\\.[a-z]+/.test( label )\n\t\t\t) {\n\t\t\t\t// Focus and select the label text.\n\t\t\t\tselectLabelText();\n\t\t\t} else {\n\t\t\t\t// Focus it (but do not select).\n\t\t\t\tplaceCaretAtHorizontalEdge( ref.current, true );\n\t\t\t}\n\t\t}\n\t}, [ url ] );\n\n\t/**\n\t * Focus the Link label text and select it.\n\t */\n\tfunction selectLabelText() {\n\t\tref.current.focus();\n\t\tconst { ownerDocument } = ref.current;\n\t\tconst { defaultView } = ownerDocument;\n\t\tconst selection = defaultView.getSelection();\n\t\tconst range = ownerDocument.createRange();\n\t\t// Get the range of the current ref contents so we can add this range to the selection.\n\t\trange.selectNodeContents( ref.current );\n\t\tselection.removeAllRanges();\n\t\tselection.addRange( range );\n\t}\n\n\t/**\n\t * Removes the current link if set.\n\t */\n\tfunction removeLink() {\n\t\t// Reset all attributes that comprise the link.\n\t\t// It is critical that all attributes are reset\n\t\t// to their default values otherwise this may\n\t\t// in advertently trigger side effects because\n\t\t// the values will have \"changed\".\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tlabel: undefined,\n\t\t\tid: undefined,\n\t\t\tkind: undefined,\n\t\t\ttype: undefined,\n\t\t\topensInNewTab: false,\n\t\t} );\n\n\t\t// Close the link editing UI.\n\t\tsetIsLinkOpen( false );\n\t}\n\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t} = getColors( context, ! isTopLevelLink );\n\n\tfunction onKeyDown( event ) {\n\t\tif (\n\t\t\tisKeyboardEvent.primary( event, 'k' ) ||\n\t\t\t( ( ! url || isDraft || isInvalid ) && event.keyCode === ENTER )\n\t\t) {\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tref: useMergeRefs( [ setPopoverAnchor, listItemRef ] ),\n\t\tclassName: classnames( 'wp-block-navigation-item', {\n\t\t\t'is-editing': isSelected || isParentOfSelectedBlock,\n\t\t\t'is-dragging-within': isDraggingWithin,\n\t\t\t'has-link': !! url,\n\t\t\t'has-child': hasChildren,\n\t\t\t'has-text-color': !! textColor || !! customTextColor,\n\t\t\t[ getColorClassName( 'color', textColor ) ]: !! textColor,\n\t\t\t'has-background': !! backgroundColor || customBackgroundColor,\n\t\t\t[ getColorClassName( 'background-color', backgroundColor ) ]:\n\t\t\t\t!! backgroundColor,\n\t\t} ),\n\t\tstyle: {\n\t\t\tcolor: ! textColor && customTextColor,\n\t\t\tbackgroundColor: ! backgroundColor && customBackgroundColor,\n\t\t},\n\t\tonKeyDown,\n\t} );\n\n\tconst ALLOWED_BLOCKS = [\n\t\t'core/navigation-link',\n\t\t'core/navigation-submenu',\n\t\t'core/page-list',\n\t];\n\tconst DEFAULT_BLOCK = {\n\t\tname: 'core/navigation-link',\n\t};\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\t...blockProps,\n\t\t\tclassName: 'remove-outline', // Remove the outline from the inner blocks container.\n\t\t},\n\t\t{\n\t\t\tallowedBlocks: ALLOWED_BLOCKS,\n\t\t\tdefaultBlock: DEFAULT_BLOCK,\n\t\t\tdirectInsert: true,\n\t\t\trenderAppender: false,\n\t\t}\n\t);\n\n\tif ( ! url || isInvalid || isDraft ) {\n\t\tblockProps.onClick = () => setIsLinkOpen( true );\n\t}\n\n\tconst classes = classnames( 'wp-block-navigation-item__content', {\n\t\t'wp-block-navigation-link__placeholder': ! url || isInvalid || isDraft,\n\t} );\n\n\tconst missingText = getMissingText( type );\n\t/* translators: Whether the navigation link is Invalid or a Draft. */\n\tconst placeholderText = `(${\n\t\tisInvalid ? __( 'Invalid' ) : __( 'Draft' )\n\t})`;\n\tconst tooltipText =\n\t\tisInvalid || isDraft\n\t\t\t? __( 'This item has been deleted, or is a draft' )\n\t\t\t: __( 'This item is missing a link' );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\ticon={ linkIcon }\n\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\tonClick={ () => setIsLinkOpen( true ) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isAtMaxNesting && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tname=\"submenu\"\n\t\t\t\t\t\t\ticon={ addSubmenu }\n\t\t\t\t\t\t\ttitle={ __( 'Add submenu' ) }\n\t\t\t\t\t\t\tonClick={ transformToSubmenu }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarGroup>\n\t\t\t</BlockControls>\n\t\t\t{ /* Warning, this duplicated in packages/block-library/src/navigation-submenu/edit.js */ }\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ label ? stripHTML( label ) : '' }\n\t\t\t\t\t\tonChange={ ( labelValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { label: labelValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Label' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\tonFocus={ () => setIsLabelFieldFocused( true ) }\n\t\t\t\t\t\tonBlur={ () => setIsLabelFieldFocused( false ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ url || '' }\n\t\t\t\t\t\tonChange={ ( urlValue ) => {\n\t\t\t\t\t\t\tupdateAttributes(\n\t\t\t\t\t\t\t\t{ url: urlValue },\n\t\t\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\t\t\tattributes\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'URL' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ description || '' }\n\t\t\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { description: descriptionValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'The description will be displayed in the menu if the current theme supports it.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\t\tonChange={ ( titleValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { title: titleValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Additional information to help clarify the purpose of the link.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'The relationship of the linked URL as space-separated link types.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ /* eslint-disable jsx-a11y/anchor-is-valid */ }\n\t\t\t\t<a className={ classes }>\n\t\t\t\t\t{ /* eslint-enable */ }\n\t\t\t\t\t{ ! url ? (\n\t\t\t\t\t\t<div className=\"wp-block-navigation-link__placeholder-text\">\n\t\t\t\t\t\t\t<Tooltip text={ tooltipText }>\n\t\t\t\t\t\t\t\t<span>{ missingText }</span>\n\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! isInvalid &&\n\t\t\t\t\t\t\t\t! isDraft &&\n\t\t\t\t\t\t\t\t! isLabelFieldFocused && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\n\t\t\t\t\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\t\t\t\t\tonChange={ ( labelValue ) =>\n\t\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: labelValue,\n\t\t\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\t\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\t\t\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'core/navigation-link'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Navigation link text'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\t\t\t\t\t\tallowedFormats={ [\n\t\t\t\t\t\t\t\t\t\t\t\t'core/bold',\n\t\t\t\t\t\t\t\t\t\t\t\t'core/italic',\n\t\t\t\t\t\t\t\t\t\t\t\t'core/image',\n\t\t\t\t\t\t\t\t\t\t\t\t'core/strikethrough',\n\t\t\t\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\tif ( ! url ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\t\t\t\t\t\t}\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{ description && (\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"wp-block-navigation-item__description\">\n\t\t\t\t\t\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t\t\t\t\t\t</span>\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{ ( isInvalid ||\n\t\t\t\t\t\t\t\tisDraft ||\n\t\t\t\t\t\t\t\tisLabelFieldFocused ) && (\n\t\t\t\t\t\t\t\t<div className=\"wp-block-navigation-link__placeholder-text wp-block-navigation-link__label\">\n\t\t\t\t\t\t\t\t\t<Tooltip text={ tooltipText }>\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Navigation link text'\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{\n\t\t\t\t\t\t\t\t\t\t\t\t// Some attributes are stored in an escaped form. It's a legacy issue.\n\t\t\t\t\t\t\t\t\t\t\t\t// Ideally they would be stored in a raw, unescaped form.\n\t\t\t\t\t\t\t\t\t\t\t\t// Unescape is used here to \"recover\" the escaped characters\n\t\t\t\t\t\t\t\t\t\t\t\t// so they display without encoding.\n\t\t\t\t\t\t\t\t\t\t\t\t// See `updateAttributes` for more details.\n\t\t\t\t\t\t\t\t\t\t\t\t`${ decodeEntities( label ) } ${\n\t\t\t\t\t\t\t\t\t\t\t\t\tisInvalid || isDraft\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? placeholderText\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t\t\t\t\t\t\t}`.trim()\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</Tooltip>\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</>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isLinkOpen && (\n\t\t\t\t\t\t<LinkUI\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tlink={ attributes }\n\t\t\t\t\t\t\tonClose={ () => setIsLinkOpen( false ) }\n\t\t\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\t\t\tonRemove={ removeLink }\n\t\t\t\t\t\t\tonChange={ ( updatedValue ) => {\n\t\t\t\t\t\t\t\tupdateAttributes(\n\t\t\t\t\t\t\t\t\tupdatedValue,\n\t\t\t\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\t\t\t\tattributes\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</a>\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAQA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AASA,IAAAO,IAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,IAAA,GAAAT,OAAA;AAIA,IAAAU,aAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,SAAA,GAAAZ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GA,CAAA,KAAM;MACf,IAAK,CAAE9E,GAAG,EAAG;QACZU,aAAa,CAAE,IAAK,CAAC;MACtB;IACD;EAAG,CACH,CAAC,EACAT,WAAW,IACZ,IAAAiF,MAAA,CAAAC,aAAA;IAAMnB,SAAS,EAAC;EAAuC,GACpD/D,WACG,CAEN,CACF,EACA,CAAEhB,SAAS,IACZC,OAAO,IACP+B,mBAAmB,KACnB,IAAAiE,MAAA,CAAAC,aAAA;IAAKnB,SAAS,EAAC;EAA4E,GAC1F,IAAAkB,MAAA,CAAAC,aAAA,EAAC9I,WAAA,CAAA0K,OAAO;IAACC,IAAI,EAAG/B;EAAa,GAC5B,IAAAC,MAAA,CAAAC,aAAA;IACC,cAAa,IAAA9F,QAAE,EACd,sBACD;EAAG;EAGF;EACA;EACA;EACA;EACA;EACC,GAAG,IAAAmI,4BAAc,EAAEzH,KAAM,CAAG,IAC5Bd,SAAS,IAAIC,OAAO,GACjB8F,eAAe,GACf,EACH,EAAC,CAACyC,IAAI,CAAC,CAEJ,CACE,CACL,CAEL,CACF,EACChH,UAAU,IACX,IAAAyE,MAAA,CAAAC,aAAA,EAACnI,OAAA,CAAA0K,MAAM;IACN5H,QAAQ,EAAGA,QAAU;IACrB6H,IAAI,EAAGpI,UAAY;IACnBqI,OAAO,EAAGA,CAAA,KAAMlH,aAAa,CAAE,KAAM,CAAG;IACxCmH,MAAM,EAAGlH,aAAe;IACxBmH,QAAQ,EAAG9E,UAAY;IACvBmD,QAAQ,EAAK4B,YAAY,IAAM;MAC9B,IAAAtB,kCAAgB,EACfsB,YAAY,EACZtI,aAAa,EACbF,UACD,CAAC;IACF;EAAG,CACH,CAEA,CAAC,EACJ,IAAA2F,MAAA,CAAAC,aAAA;IAAA,GAAUX;EAAgB,CAAI,CAC1B,CACJ,CAAC;AAEL"}
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_blocks","_data","_components","_keycodes","_i18n","_blockEditor","_url","_element","_dom","_htmlEntities","_icons","_coreData","_compose","_linkUi","_updateAttributes","_utils","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","useState","useEffect","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener","useIsInvalidLink","kind","type","id","isPostType","hasId","Number","isInteger","postStatus","useSelect","select","getEntityRecord","coreStore","status","isInvalid","isDraft","getMissingText","missingText","__","NavigationLinkEdit","attributes","isSelected","setAttributes","insertBlocksAfter","mergeBlocks","onReplace","context","clientId","label","url","description","rel","title","maxNestingLevel","replaceBlock","__unstableMarkNextChangeAsNotPersistent","useDispatch","blockEditorStore","isLinkOpen","setIsLinkOpen","popoverAnchor","setPopoverAnchor","listItemRef","useRef","itemLabelPlaceholder","ref","isLabelFieldFocused","setIsLabelFieldFocused","innerBlocks","isAtMaxNesting","isTopLevelLink","isParentOfSelectedBlock","hasChildren","getBlocks","getBlockCount","getBlockName","getBlockRootClientId","hasSelectedInnerBlock","getBlockParentsByBlockName","length","transformToSubmenu","newSubmenu","createBlock","isURL","prependHTTP","test","selectLabelText","placeCaretAtHorizontalEdge","focus","defaultView","selection","getSelection","range","createRange","selectNodeContents","removeAllRanges","addRange","removeLink","undefined","opensInNewTab","textColor","customTextColor","backgroundColor","customBackgroundColor","getColors","onKeyDown","isKeyboardEvent","primary","keyCode","ENTER","blockProps","useBlockProps","useMergeRefs","className","classnames","getColorClassName","style","color","ALLOWED_BLOCKS","DEFAULT_BLOCK","name","innerBlocksProps","useInnerBlocksProps","allowedBlocks","defaultBlock","directInsert","renderAppender","onClick","classes","placeholderText","tooltipText","_react","createElement","Fragment","BlockControls","ToolbarGroup","ToolbarButton","icon","linkIcon","shortcut","displayShortcut","addSubmenu","InspectorControls","PanelBody","TextControl","__nextHasNoMarginBottom","value","stripHTML","onChange","labelValue","autoComplete","onFocus","onBlur","safeDecodeURI","urlValue","updateAttributes","TextareaControl","descriptionValue","help","titleValue","relValue","Tooltip","text","RichText","identifier","onMerge","__unstableOnSplitAtEnd","placeholder","withoutInteractiveFormatting","allowedFormats","decodeEntities","trim","LinkUI","link","onClose","anchor","onRemove","updatedValue"],"sources":["@wordpress/block-library/src/navigation-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPanelBody,\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tTooltip,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { displayShortcut, isKeyboardEvent, ENTER } from '@wordpress/keycodes';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tgetColorClassName,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport { isURL, prependHTTP, safeDecodeURI } from '@wordpress/url';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport {\n\tplaceCaretAtHorizontalEdge,\n\t__unstableStripHTML as stripHTML,\n} from '@wordpress/dom';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { link as linkIcon, addSubmenu } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { LinkUI } from './link-ui';\nimport { updateAttributes } from './update-attributes';\nimport { getColors } from '../navigation/edit/utils';\n\n/**\n * A React hook to determine if it's dragging within the target element.\n *\n * @typedef {import('@wordpress/element').RefObject} RefObject\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the target element.\n */\nconst useIsDraggingWithin = ( elementRef ) => {\n\tconst [ isDraggingWithin, setIsDraggingWithin ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart( event ) {\n\t\t\t// Check the first time when the dragging starts.\n\t\t\thandleDragEnter( event );\n\t\t}\n\n\t\t// Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDraggingWithin( false );\n\t\t}\n\n\t\tfunction handleDragEnter( event ) {\n\t\t\t// Check if the current target is inside the item element.\n\t\t\tif ( elementRef.current.contains( event.target ) ) {\n\t\t\t\tsetIsDraggingWithin( true );\n\t\t\t} else {\n\t\t\t\tsetIsDraggingWithin( false );\n\t\t\t}\n\t\t}\n\n\t\t// Bind these events to the document to catch all drag events.\n\t\t// Ideally, we can also use `event.relatedTarget`, but sadly that\n\t\t// doesn't work in Safari.\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\t\townerDocument.addEventListener( 'dragenter', handleDragEnter );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener( 'dragstart', handleDragStart );\n\t\t\townerDocument.removeEventListener( 'dragend', handleDragEnd );\n\t\t\townerDocument.removeEventListener( 'dragenter', handleDragEnter );\n\t\t};\n\t}, [] );\n\n\treturn isDraggingWithin;\n};\n\nconst useIsInvalidLink = ( kind, type, id ) => {\n\tconst isPostType =\n\t\tkind === 'post-type' || type === 'post' || type === 'page';\n\tconst hasId = Number.isInteger( id );\n\tconst postStatus = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isPostType ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\treturn getEntityRecord( 'postType', type, id )?.status;\n\t\t},\n\t\t[ isPostType, type, id ]\n\t);\n\n\t// Check Navigation Link validity if:\n\t// 1. Link is 'post-type'.\n\t// 2. It has an id.\n\t// 3. It's neither null, nor undefined, as valid items might be either of those while loading.\n\t// If those conditions are met, check if\n\t// 1. The post status is published.\n\t// 2. The Navigation Link item has no label.\n\t// If either of those is true, invalidate.\n\tconst isInvalid =\n\t\tisPostType && hasId && postStatus && 'trash' === postStatus;\n\tconst isDraft = 'draft' === postStatus;\n\n\treturn [ isInvalid, isDraft ];\n};\n\nfunction getMissingText( type ) {\n\tlet missingText = '';\n\n\tswitch ( type ) {\n\t\tcase 'post':\n\t\t\t/* translators: label for missing post in navigation link block */\n\t\t\tmissingText = __( 'Select post' );\n\t\t\tbreak;\n\t\tcase 'page':\n\t\t\t/* translators: label for missing page in navigation link block */\n\t\t\tmissingText = __( 'Select page' );\n\t\t\tbreak;\n\t\tcase 'category':\n\t\t\t/* translators: label for missing category in navigation link block */\n\t\t\tmissingText = __( 'Select category' );\n\t\t\tbreak;\n\t\tcase 'tag':\n\t\t\t/* translators: label for missing tag in navigation link block */\n\t\t\tmissingText = __( 'Select tag' );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t/* translators: label for missing values in navigation link block */\n\t\t\tmissingText = __( 'Add link' );\n\t}\n\n\treturn missingText;\n}\n\nexport default function NavigationLinkEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tmergeBlocks,\n\tonReplace,\n\tcontext,\n\tclientId,\n} ) {\n\tconst { id, label, type, url, description, rel, title, kind } = attributes;\n\n\tconst [ isInvalid, isDraft ] = useIsInvalidLink( kind, type, id );\n\tconst { maxNestingLevel } = context;\n\n\tconst { replaceBlock, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst [ isLinkOpen, setIsLinkOpen ] = useState( false );\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst listItemRef = useRef( null );\n\tconst isDraggingWithin = useIsDraggingWithin( listItemRef );\n\tconst itemLabelPlaceholder = __( 'Add label…' );\n\tconst ref = useRef();\n\n\t// Change the label using inspector causes rich text to change focus on firefox.\n\t// This is a workaround to keep the focus on the label field when label filed is focused we don't render the rich text.\n\tconst [ isLabelFieldFocused, setIsLabelFieldFocused ] = useState( false );\n\n\tconst {\n\t\tinnerBlocks,\n\t\tisAtMaxNesting,\n\t\tisTopLevelLink,\n\t\tisParentOfSelectedBlock,\n\t\thasChildren,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlocks,\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\treturn {\n\t\t\t\tinnerBlocks: getBlocks( clientId ),\n\t\t\t\tisAtMaxNesting:\n\t\t\t\t\tgetBlockParentsByBlockName( clientId, [\n\t\t\t\t\t\t'core/navigation-link',\n\t\t\t\t\t\t'core/navigation-submenu',\n\t\t\t\t\t] ).length >= maxNestingLevel,\n\t\t\t\tisTopLevelLink:\n\t\t\t\t\tgetBlockName( getBlockRootClientId( clientId ) ) ===\n\t\t\t\t\t'core/navigation',\n\t\t\t\tisParentOfSelectedBlock: hasSelectedInnerBlock(\n\t\t\t\t\tclientId,\n\t\t\t\t\ttrue\n\t\t\t\t),\n\t\t\t\thasChildren: !! getBlockCount( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\t/**\n\t * Transform to submenu block.\n\t */\n\tfunction transformToSubmenu() {\n\t\tconst newSubmenu = createBlock(\n\t\t\t'core/navigation-submenu',\n\t\t\tattributes,\n\t\t\tinnerBlocks.length > 0\n\t\t\t\t? innerBlocks\n\t\t\t\t: [ createBlock( 'core/navigation-link' ) ]\n\t\t);\n\t\treplaceBlock( clientId, newSubmenu );\n\t}\n\n\tuseEffect( () => {\n\t\t// Show the LinkControl on mount if the URL is empty\n\t\t// ( When adding a new menu item)\n\t\t// This can't be done in the useState call because it conflicts\n\t\t// with the autofocus behavior of the BlockListBlock component.\n\t\tif ( ! url ) {\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}, [ url ] );\n\n\tuseEffect( () => {\n\t\t// If block has inner blocks, transform to Submenu.\n\t\tif ( hasChildren ) {\n\t\t\t// This side-effect should not create an undo level as those should\n\t\t\t// only be created via user interactions.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\ttransformToSubmenu();\n\t\t}\n\t}, [ hasChildren ] );\n\n\t/**\n\t * The hook shouldn't be necessary but due to a focus loss happening\n\t * when selecting a suggestion in the link popover, we force close on block unselection.\n\t */\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsLinkOpen( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\t// If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.\n\tuseEffect( () => {\n\t\tif ( isLinkOpen && url ) {\n\t\t\t// Does this look like a URL and have something TLD-ish?\n\t\t\tif (\n\t\t\t\tisURL( prependHTTP( label ) ) &&\n\t\t\t\t/^.+\\.[a-z]+/.test( label )\n\t\t\t) {\n\t\t\t\t// Focus and select the label text.\n\t\t\t\tselectLabelText();\n\t\t\t} else {\n\t\t\t\t// Focus it (but do not select).\n\t\t\t\tplaceCaretAtHorizontalEdge( ref.current, true );\n\t\t\t}\n\t\t}\n\t}, [ url ] );\n\n\t/**\n\t * Focus the Link label text and select it.\n\t */\n\tfunction selectLabelText() {\n\t\tref.current.focus();\n\t\tconst { ownerDocument } = ref.current;\n\t\tconst { defaultView } = ownerDocument;\n\t\tconst selection = defaultView.getSelection();\n\t\tconst range = ownerDocument.createRange();\n\t\t// Get the range of the current ref contents so we can add this range to the selection.\n\t\trange.selectNodeContents( ref.current );\n\t\tselection.removeAllRanges();\n\t\tselection.addRange( range );\n\t}\n\n\t/**\n\t * Removes the current link if set.\n\t */\n\tfunction removeLink() {\n\t\t// Reset all attributes that comprise the link.\n\t\t// It is critical that all attributes are reset\n\t\t// to their default values otherwise this may\n\t\t// in advertently trigger side effects because\n\t\t// the values will have \"changed\".\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tlabel: undefined,\n\t\t\tid: undefined,\n\t\t\tkind: undefined,\n\t\t\ttype: undefined,\n\t\t\topensInNewTab: false,\n\t\t} );\n\n\t\t// Close the link editing UI.\n\t\tsetIsLinkOpen( false );\n\t}\n\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t} = getColors( context, ! isTopLevelLink );\n\n\tfunction onKeyDown( event ) {\n\t\tif (\n\t\t\tisKeyboardEvent.primary( event, 'k' ) ||\n\t\t\t( ( ! url || isDraft || isInvalid ) && event.keyCode === ENTER )\n\t\t) {\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tref: useMergeRefs( [ setPopoverAnchor, listItemRef ] ),\n\t\tclassName: classnames( 'wp-block-navigation-item', {\n\t\t\t'is-editing': isSelected || isParentOfSelectedBlock,\n\t\t\t'is-dragging-within': isDraggingWithin,\n\t\t\t'has-link': !! url,\n\t\t\t'has-child': hasChildren,\n\t\t\t'has-text-color': !! textColor || !! customTextColor,\n\t\t\t[ getColorClassName( 'color', textColor ) ]: !! textColor,\n\t\t\t'has-background': !! backgroundColor || customBackgroundColor,\n\t\t\t[ getColorClassName( 'background-color', backgroundColor ) ]:\n\t\t\t\t!! backgroundColor,\n\t\t} ),\n\t\tstyle: {\n\t\t\tcolor: ! textColor && customTextColor,\n\t\t\tbackgroundColor: ! backgroundColor && customBackgroundColor,\n\t\t},\n\t\tonKeyDown,\n\t} );\n\n\tconst ALLOWED_BLOCKS = [\n\t\t'core/navigation-link',\n\t\t'core/navigation-submenu',\n\t\t'core/page-list',\n\t];\n\tconst DEFAULT_BLOCK = {\n\t\tname: 'core/navigation-link',\n\t};\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\t...blockProps,\n\t\t\tclassName: 'remove-outline', // Remove the outline from the inner blocks container.\n\t\t},\n\t\t{\n\t\t\tallowedBlocks: ALLOWED_BLOCKS,\n\t\t\tdefaultBlock: DEFAULT_BLOCK,\n\t\t\tdirectInsert: true,\n\t\t\trenderAppender: false,\n\t\t}\n\t);\n\n\tif ( ! url || isInvalid || isDraft ) {\n\t\tblockProps.onClick = () => setIsLinkOpen( true );\n\t}\n\n\tconst classes = classnames( 'wp-block-navigation-item__content', {\n\t\t'wp-block-navigation-link__placeholder': ! url || isInvalid || isDraft,\n\t} );\n\n\tconst missingText = getMissingText( type );\n\t/* translators: Whether the navigation link is Invalid or a Draft. */\n\tconst placeholderText = `(${\n\t\tisInvalid ? __( 'Invalid' ) : __( 'Draft' )\n\t})`;\n\tconst tooltipText =\n\t\tisInvalid || isDraft\n\t\t\t? __( 'This item has been deleted, or is a draft' )\n\t\t\t: __( 'This item is missing a link' );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\ticon={ linkIcon }\n\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\tonClick={ () => setIsLinkOpen( true ) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isAtMaxNesting && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tname=\"submenu\"\n\t\t\t\t\t\t\ticon={ addSubmenu }\n\t\t\t\t\t\t\ttitle={ __( 'Add submenu' ) }\n\t\t\t\t\t\t\tonClick={ transformToSubmenu }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarGroup>\n\t\t\t</BlockControls>\n\t\t\t{ /* Warning, this duplicated in packages/block-library/src/navigation-submenu/edit.js */ }\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ label ? stripHTML( label ) : '' }\n\t\t\t\t\t\tonChange={ ( labelValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { label: labelValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Label' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\tonFocus={ () => setIsLabelFieldFocused( true ) }\n\t\t\t\t\t\tonBlur={ () => setIsLabelFieldFocused( false ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ url ? safeDecodeURI( url ) : '' }\n\t\t\t\t\t\tonChange={ ( urlValue ) => {\n\t\t\t\t\t\t\tupdateAttributes(\n\t\t\t\t\t\t\t\t{ url: urlValue },\n\t\t\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\t\t\tattributes\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'URL' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ description || '' }\n\t\t\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { description: descriptionValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'The description will be displayed in the menu if the current theme supports it.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\t\tonChange={ ( titleValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { title: titleValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Additional information to help clarify the purpose of the link.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'The relationship of the linked URL as space-separated link types.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ /* eslint-disable jsx-a11y/anchor-is-valid */ }\n\t\t\t\t<a className={ classes }>\n\t\t\t\t\t{ /* eslint-enable */ }\n\t\t\t\t\t{ ! url ? (\n\t\t\t\t\t\t<div className=\"wp-block-navigation-link__placeholder-text\">\n\t\t\t\t\t\t\t<Tooltip text={ tooltipText }>\n\t\t\t\t\t\t\t\t<span>{ missingText }</span>\n\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! isInvalid &&\n\t\t\t\t\t\t\t\t! isDraft &&\n\t\t\t\t\t\t\t\t! isLabelFieldFocused && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\n\t\t\t\t\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\t\t\t\t\tonChange={ ( labelValue ) =>\n\t\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: labelValue,\n\t\t\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\t\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\t\t\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'core/navigation-link'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Navigation link text'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\t\t\t\t\t\tallowedFormats={ [\n\t\t\t\t\t\t\t\t\t\t\t\t'core/bold',\n\t\t\t\t\t\t\t\t\t\t\t\t'core/italic',\n\t\t\t\t\t\t\t\t\t\t\t\t'core/image',\n\t\t\t\t\t\t\t\t\t\t\t\t'core/strikethrough',\n\t\t\t\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\tif ( ! url ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\t\t\t\t\t\t}\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{ description && (\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"wp-block-navigation-item__description\">\n\t\t\t\t\t\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t\t\t\t\t\t</span>\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{ ( isInvalid ||\n\t\t\t\t\t\t\t\tisDraft ||\n\t\t\t\t\t\t\t\tisLabelFieldFocused ) && (\n\t\t\t\t\t\t\t\t<div className=\"wp-block-navigation-link__placeholder-text wp-block-navigation-link__label\">\n\t\t\t\t\t\t\t\t\t<Tooltip text={ tooltipText }>\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Navigation link text'\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{\n\t\t\t\t\t\t\t\t\t\t\t\t// Some attributes are stored in an escaped form. It's a legacy issue.\n\t\t\t\t\t\t\t\t\t\t\t\t// Ideally they would be stored in a raw, unescaped form.\n\t\t\t\t\t\t\t\t\t\t\t\t// Unescape is used here to \"recover\" the escaped characters\n\t\t\t\t\t\t\t\t\t\t\t\t// so they display without encoding.\n\t\t\t\t\t\t\t\t\t\t\t\t// See `updateAttributes` for more details.\n\t\t\t\t\t\t\t\t\t\t\t\t`${ decodeEntities( label ) } ${\n\t\t\t\t\t\t\t\t\t\t\t\t\tisInvalid || isDraft\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? placeholderText\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t\t\t\t\t\t\t}`.trim()\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</Tooltip>\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</>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isLinkOpen && (\n\t\t\t\t\t\t<LinkUI\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tlink={ attributes }\n\t\t\t\t\t\t\tonClose={ () => setIsLinkOpen( false ) }\n\t\t\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\t\t\tonRemove={ removeLink }\n\t\t\t\t\t\t\tonChange={ ( updatedValue ) => {\n\t\t\t\t\t\t\t\tupdateAttributes(\n\t\t\t\t\t\t\t\t\tupdatedValue,\n\t\t\t\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\t\t\t\tattributes\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</a>\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAQA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AASA,IAAAO,IAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,IAAA,GAAAT,OAAA;AAIA,IAAAU,aAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,SAAA,GAAAZ,OAAA;AACA,IAAAa,QAAA,GAAAb,OAAA;AAKA,IAAAc,OAAA,GAAAd,OAAA;AACA,IAAAe,iBAAA,GAAAf,OAAA;AACA,IAAAgB,MAAA,GAAAhB,OAAA;AA7CA;AACA;AACA;;AAGA;AACA;AACA;;AAiCA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMiB,mBAAmB,GAAKC,UAAU,IAAM;EAC7C,MAAM,CAAEC,gBAAgB,EAAEC,mBAAmB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,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AC1F,IAAAkB,MAAA,CAAAC,aAAA,EAAC9I,WAAA,CAAA2K,OAAO;IAACC,IAAI,EAAGhC;EAAa,GAC5B,IAAAC,MAAA,CAAAC,aAAA;IACC,cAAa,IAAA9F,QAAE,EACd,sBACD;EAAG;EAGF;EACA;EACA;EACA;EACA;EACC,GAAG,IAAAoI,4BAAc,EAAE1H,KAAM,CAAG,IAC5Bd,SAAS,IAAIC,OAAO,GACjB8F,eAAe,GACf,EACH,EAAC,CAAC0C,IAAI,CAAC,CAEJ,CACE,CACL,CAEL,CACF,EACCjH,UAAU,IACX,IAAAyE,MAAA,CAAAC,aAAA,EAACnI,OAAA,CAAA2K,MAAM;IACN7H,QAAQ,EAAGA,QAAU;IACrB8H,IAAI,EAAGrI,UAAY;IACnBsI,OAAO,EAAGA,CAAA,KAAMnH,aAAa,CAAE,KAAM,CAAG;IACxCoH,MAAM,EAAGnH,aAAe;IACxBoH,QAAQ,EAAG/E,UAAY;IACvBmD,QAAQ,EAAK6B,YAAY,IAAM;MAC9B,IAAAtB,kCAAgB,EACfsB,YAAY,EACZvI,aAAa,EACbF,UACD,CAAC;IACF;EAAG,CACH,CAEA,CAAC,EACJ,IAAA2F,MAAA,CAAAC,aAAA;IAAA,GAAUX;EAAgB,CAAI,CAC1B,CACJ,CAAC;AAEL"}
@@ -19,7 +19,7 @@ const PatternEdit = ({
19
19
  clientId
20
20
  }) => {
21
21
  const selectedPattern = (0, _data.useSelect)(select => select(_blockEditor.store).__experimentalGetParsedPattern(attributes.slug), [attributes.slug]);
22
- const currentThemeStylesheet = (0, _data.useSelect)(select => select(_coreData.store).getCurrentTheme().stylesheet);
22
+ const currentThemeStylesheet = (0, _data.useSelect)(select => select(_coreData.store).getCurrentTheme()?.stylesheet, []);
23
23
  const {
24
24
  replaceBlocks,
25
25
  __unstableMarkNextChangeAsNotPersistent
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_data","_element","_blockEditor","_coreData","PatternEdit","attributes","clientId","selectedPattern","useSelect","select","blockEditorStore","__experimentalGetParsedPattern","slug","currentThemeStylesheet","coreStore","getCurrentTheme","stylesheet","replaceBlocks","__unstableMarkNextChangeAsNotPersistent","useDispatch","setBlockEditingMode","getBlockRootClientId","getBlockEditingMode","injectThemeAttributeInBlockTemplateContent","block","innerBlocks","find","innerBlock","name","map","theme","undefined","useEffect","blocks","window","queueMicrotask","rootClientId","clonedBlocks","cloneBlock","rootEditingMode","props","useBlockProps","_react","createElement","_default","exports","default"],"sources":["@wordpress/block-library/src/pattern/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { cloneBlock } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport {\n\tstore as blockEditorStore,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\nconst PatternEdit = ( { attributes, clientId } ) => {\n\tconst selectedPattern = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).__experimentalGetParsedPattern(\n\t\t\t\tattributes.slug\n\t\t\t),\n\t\t[ attributes.slug ]\n\t);\n\n\tconst currentThemeStylesheet = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme().stylesheet\n\t);\n\n\tconst { replaceBlocks, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst { setBlockEditingMode } = useDispatch( blockEditorStore );\n\tconst { getBlockRootClientId, getBlockEditingMode } =\n\t\tuseSelect( blockEditorStore );\n\n\t// Duplicated in packages/edit-site/src/components/start-template-options/index.js.\n\tfunction injectThemeAttributeInBlockTemplateContent( block ) {\n\t\tif (\n\t\t\tblock.innerBlocks.find(\n\t\t\t\t( innerBlock ) => innerBlock.name === 'core/template-part'\n\t\t\t)\n\t\t) {\n\t\t\tblock.innerBlocks = block.innerBlocks.map( ( innerBlock ) => {\n\t\t\t\tif (\n\t\t\t\t\tinnerBlock.name === 'core/template-part' &&\n\t\t\t\t\tinnerBlock.attributes.theme === undefined\n\t\t\t\t) {\n\t\t\t\t\tinnerBlock.attributes.theme = currentThemeStylesheet;\n\t\t\t\t}\n\t\t\t\treturn innerBlock;\n\t\t\t} );\n\t\t}\n\n\t\tif (\n\t\t\tblock.name === 'core/template-part' &&\n\t\t\tblock.attributes.theme === undefined\n\t\t) {\n\t\t\tblock.attributes.theme = currentThemeStylesheet;\n\t\t}\n\t\treturn block;\n\t}\n\n\t// Run this effect when the component loads.\n\t// This adds the Pattern's contents to the post.\n\t// This change won't be saved.\n\t// It will continue to pull from the pattern file unless changes are made to its respective template part.\n\tuseEffect( () => {\n\t\tif ( selectedPattern?.blocks ) {\n\t\t\t// We batch updates to block list settings to avoid triggering cascading renders\n\t\t\t// for each container block included in a tree and optimize initial render.\n\t\t\t// Since the above uses microtasks, we need to use a microtask here as well,\n\t\t\t// because nested pattern blocks cannot be inserted if the parent block supports\n\t\t\t// inner blocks but doesn't have blockSettings in the state.\n\t\t\twindow.queueMicrotask( () => {\n\t\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\t\t// Clone blocks from the pattern before insertion to ensure they receive\n\t\t\t\t// distinct client ids. See https://github.com/WordPress/gutenberg/issues/50628.\n\t\t\t\tconst clonedBlocks = selectedPattern.blocks.map( ( block ) =>\n\t\t\t\t\tcloneBlock(\n\t\t\t\t\t\tinjectThemeAttributeInBlockTemplateContent( block )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconst rootEditingMode = getBlockEditingMode( rootClientId );\n\t\t\t\t// Temporarily set the root block to default mode to allow replacing the pattern.\n\t\t\t\t// This could happen when the page is disabling edits of non-content blocks.\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\tsetBlockEditingMode( rootClientId, 'default' );\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\treplaceBlocks( clientId, clonedBlocks );\n\t\t\t\t// Restore the root block's original mode.\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\tsetBlockEditingMode( rootClientId, rootEditingMode );\n\t\t\t} );\n\t\t}\n\t}, [\n\t\tclientId,\n\t\tselectedPattern?.blocks,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\treplaceBlocks,\n\t\tgetBlockEditingMode,\n\t\tsetBlockEditingMode,\n\t\tgetBlockRootClientId,\n\t] );\n\n\tconst props = useBlockProps();\n\n\treturn <div { ...props } />;\n};\n\nexport default PatternEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAIA,IAAAI,SAAA,GAAAJ,OAAA;AAVA;AACA;AACA;;AAUA,MAAMK,WAAW,GAAGA,CAAE;EAAEC,UAAU;EAAEC;AAAS,CAAC,KAAM;EACnD,MAAMC,eAAe,GAAG,IAAAC,eAAS,EAC9BC,MAAM,IACPA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,8BAA8B,CACxDN,UAAU,CAACO,IACZ,CAAC,EACF,CAAEP,UAAU,CAACO,IAAI,CAClB,CAAC;EAED,MAAMC,sBAAsB,GAAG,IAAAL,eAAS,EACrCC,MAAM,IAAMA,MAAM,CAAEK,eAAU,CAAC,CAACC,eAAe,CAAC,CAAC,CAACC,UACrD,CAAC;EAED,MAAM;IAAEC,aAAa;IAAEC;EAAwC,CAAC,GAC/D,IAAAC,iBAAW,EAAET,kBAAiB,CAAC;EAChC,MAAM;IAAEU;EAAoB,CAAC,GAAG,IAAAD,iBAAW,EAAET,kBAAiB,CAAC;EAC/D,MAAM;IAAEW,oBAAoB;IAAEC;EAAoB,CAAC,GAClD,IAAAd,eAAS,EAAEE,kBAAiB,CAAC;;EAE9B;EACA,SAASa,0CAA0CA,CAAEC,KAAK,EAAG;IAC5D,IACCA,KAAK,CAACC,WAAW,CAACC,IAAI,CACnBC,UAAU,IAAMA,UAAU,CAACC,IAAI,KA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AAe,EAAE0B,MAAM,EACvBf,uCAAuC,EACvCD,aAAa,EACbK,mBAAmB,EACnBF,mBAAmB,EACnBC,oBAAoB,CACnB,CAAC;EAEH,MAAMmB,KAAK,GAAG,IAAAC,0BAAa,EAAC,CAAC;EAE7B,OAAO,IAAAC,MAAA,CAAAC,aAAA;IAAA,GAAUH;EAAK,CAAI,CAAC;AAC5B,CAAC;AAAC,IAAAI,QAAA,GAEaxC,WAAW;AAAAyC,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
1
+ {"version":3,"names":["_blocks","require","_data","_element","_blockEditor","_coreData","PatternEdit","attributes","clientId","selectedPattern","useSelect","select","blockEditorStore","__experimentalGetParsedPattern","slug","currentThemeStylesheet","coreStore","getCurrentTheme","stylesheet","replaceBlocks","__unstableMarkNextChangeAsNotPersistent","useDispatch","setBlockEditingMode","getBlockRootClientId","getBlockEditingMode","injectThemeAttributeInBlockTemplateContent","block","innerBlocks","find","innerBlock","name","map","theme","undefined","useEffect","blocks","window","queueMicrotask","rootClientId","clonedBlocks","cloneBlock","rootEditingMode","props","useBlockProps","_react","createElement","_default","exports","default"],"sources":["@wordpress/block-library/src/pattern/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { cloneBlock } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport {\n\tstore as blockEditorStore,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\nconst PatternEdit = ( { attributes, clientId } ) => {\n\tconst selectedPattern = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).__experimentalGetParsedPattern(\n\t\t\t\tattributes.slug\n\t\t\t),\n\t\t[ attributes.slug ]\n\t);\n\n\tconst currentThemeStylesheet = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.stylesheet,\n\t\t[]\n\t);\n\n\tconst { replaceBlocks, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst { setBlockEditingMode } = useDispatch( blockEditorStore );\n\tconst { getBlockRootClientId, getBlockEditingMode } =\n\t\tuseSelect( blockEditorStore );\n\n\t// Duplicated in packages/edit-site/src/components/start-template-options/index.js.\n\tfunction injectThemeAttributeInBlockTemplateContent( block ) {\n\t\tif (\n\t\t\tblock.innerBlocks.find(\n\t\t\t\t( innerBlock ) => innerBlock.name === 'core/template-part'\n\t\t\t)\n\t\t) {\n\t\t\tblock.innerBlocks = block.innerBlocks.map( ( innerBlock ) => {\n\t\t\t\tif (\n\t\t\t\t\tinnerBlock.name === 'core/template-part' &&\n\t\t\t\t\tinnerBlock.attributes.theme === undefined\n\t\t\t\t) {\n\t\t\t\t\tinnerBlock.attributes.theme = currentThemeStylesheet;\n\t\t\t\t}\n\t\t\t\treturn innerBlock;\n\t\t\t} );\n\t\t}\n\n\t\tif (\n\t\t\tblock.name === 'core/template-part' &&\n\t\t\tblock.attributes.theme === undefined\n\t\t) {\n\t\t\tblock.attributes.theme = currentThemeStylesheet;\n\t\t}\n\t\treturn block;\n\t}\n\n\t// Run this effect when the component loads.\n\t// This adds the Pattern's contents to the post.\n\t// This change won't be saved.\n\t// It will continue to pull from the pattern file unless changes are made to its respective template part.\n\tuseEffect( () => {\n\t\tif ( selectedPattern?.blocks ) {\n\t\t\t// We batch updates to block list settings to avoid triggering cascading renders\n\t\t\t// for each container block included in a tree and optimize initial render.\n\t\t\t// Since the above uses microtasks, we need to use a microtask here as well,\n\t\t\t// because nested pattern blocks cannot be inserted if the parent block supports\n\t\t\t// inner blocks but doesn't have blockSettings in the state.\n\t\t\twindow.queueMicrotask( () => {\n\t\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\t\t// Clone blocks from the pattern before insertion to ensure they receive\n\t\t\t\t// distinct client ids. See https://github.com/WordPress/gutenberg/issues/50628.\n\t\t\t\tconst clonedBlocks = selectedPattern.blocks.map( ( block ) =>\n\t\t\t\t\tcloneBlock(\n\t\t\t\t\t\tinjectThemeAttributeInBlockTemplateContent( block )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconst rootEditingMode = getBlockEditingMode( rootClientId );\n\t\t\t\t// Temporarily set the root block to default mode to allow replacing the pattern.\n\t\t\t\t// This could happen when the page is disabling edits of non-content blocks.\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\tsetBlockEditingMode( rootClientId, 'default' );\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\treplaceBlocks( clientId, clonedBlocks );\n\t\t\t\t// Restore the root block's original mode.\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\tsetBlockEditingMode( rootClientId, rootEditingMode );\n\t\t\t} );\n\t\t}\n\t}, [\n\t\tclientId,\n\t\tselectedPattern?.blocks,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\treplaceBlocks,\n\t\tgetBlockEditingMode,\n\t\tsetBlockEditingMode,\n\t\tgetBlockRootClientId,\n\t] );\n\n\tconst props = useBlockProps();\n\n\treturn <div { ...props } />;\n};\n\nexport default PatternEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAIA,IAAAI,SAAA,GAAAJ,OAAA;AAVA;AACA;AACA;;AAUA,MAAMK,WAAW,GAAGA,CAAE;EAAEC,UAAU;EAAEC;AAAS,CAAC,KAAM;EACnD,MAAMC,eAAe,GAAG,IAAAC,eAAS,EAC9BC,MAAM,IACPA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,8BAA8B,CACxDN,UAAU,CAACO,IACZ,CAAC,EACF,CAAEP,UAAU,CAACO,IAAI,CAClB,CAAC;EAED,MAAMC,sBAAsB,GAAG,IAAAL,eAAS,EACrCC,MAAM,IAAMA,MAAM,CAAEK,eAAU,CAAC,CAACC,eAAe,CAAC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c,kBAAU,EACTf,0CAA0C,CAAEC,KAAM,CACnD,CACD,CAAC;QACD,MAAMe,eAAe,GAAGjB,mBAAmB,CAAEc,YAAa,CAAC;QAC3D;QACA;QACAlB,uCAAuC,CAAC,CAAC;QACzCE,mBAAmB,CAAEgB,YAAY,EAAE,SAAU,CAAC;QAC9ClB,uCAAuC,CAAC,CAAC;QACzCD,aAAa,CAAEX,QAAQ,EAAE+B,YAAa,CAAC;QACvC;QACAnB,uCAAuC,CAAC,CAAC;QACzCE,mBAAmB,CAAEgB,YAAY,EAAEG,eAAgB,CAAC;MACrD,CAAE,CAAC;IACJ;EACD,CAAC,EAAE,CACFjC,QAAQ,EACRC,eAAe,EAAE0B,MAAM,EACvBf,uCAAuC,EACvCD,aAAa,EACbK,mBAAmB,EACnBF,mBAAmB,EACnBC,oBAAoB,CACnB,CAAC;EAEH,MAAMmB,KAAK,GAAG,IAAAC,0BAAa,EAAC,CAAC;EAE7B,OAAO,IAAAC,MAAA,CAAAC,aAAA;IAAA,GAAUH;EAAK,CAAI,CAAC;AAC5B,CAAC;AAAC,IAAAI,QAAA,GAEaxC,WAAW;AAAAyC,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -169,7 +169,6 @@ function PostAuthorEdit({
169
169
  className: "wp-block-post-author__content"
170
170
  }, (!_blockEditor.RichText.isEmpty(byline) || isSelected) && (0, _react.createElement)(_blockEditor.RichText, {
171
171
  className: "wp-block-post-author__byline",
172
- multiline: false,
173
172
  "aria-label": (0, _i18n.__)('Post author byline text'),
174
173
  placeholder: (0, _i18n.__)('Write byline…'),
175
174
  value: byline,