@wordpress/block-library 8.17.1 → 8.18.1-next.5a1d1283.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 (124) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/column/edit.native.js +5 -5
  3. package/build/column/edit.native.js.map +1 -1
  4. package/build/cover/edit/index.js +3 -1
  5. package/build/cover/edit/index.js.map +1 -1
  6. package/build/cover/shared.js +26 -21
  7. package/build/cover/shared.js.map +1 -1
  8. package/build/embed/embed-link-settings.native.js +0 -1
  9. package/build/embed/embed-link-settings.native.js.map +1 -1
  10. package/build/footnotes/edit.js +2 -3
  11. package/build/footnotes/edit.js.map +1 -1
  12. package/build/group/index.js +1 -0
  13. package/build/group/index.js.map +1 -1
  14. package/build/post-content/edit.js +1 -1
  15. package/build/post-content/edit.js.map +1 -1
  16. package/build/post-template/index.js +1 -1
  17. package/build/post-terms/use-post-terms.js +3 -2
  18. package/build/post-terms/use-post-terms.js.map +1 -1
  19. package/build/query/edit/inspector-controls/index.js +28 -3
  20. package/build/query/edit/inspector-controls/index.js.map +1 -1
  21. package/build/query/edit/query-content.js +2 -1
  22. package/build/query/edit/query-content.js.map +1 -1
  23. package/build/query/index.js +9 -2
  24. package/build/query/index.js.map +1 -1
  25. package/build/query/view.js +75 -0
  26. package/build/query/view.js.map +1 -0
  27. package/build/query-pagination-next/index.js +1 -1
  28. package/build/query-pagination-numbers/edit.js +50 -5
  29. package/build/query-pagination-numbers/edit.js.map +1 -1
  30. package/build/query-pagination-numbers/index.js +7 -1
  31. package/build/query-pagination-numbers/index.js.map +1 -1
  32. package/build/query-pagination-previous/index.js +1 -1
  33. package/build/search/edit.js +3 -1
  34. package/build/search/edit.js.map +1 -1
  35. package/build/search/utils.js +2 -4
  36. package/build/search/utils.js.map +1 -1
  37. package/build/social-link/edit.native.js +1 -3
  38. package/build/social-link/edit.native.js.map +1 -1
  39. package/build-module/column/edit.native.js +5 -5
  40. package/build-module/column/edit.native.js.map +1 -1
  41. package/build-module/cover/edit/index.js +3 -1
  42. package/build-module/cover/edit/index.js.map +1 -1
  43. package/build-module/cover/shared.js +26 -21
  44. package/build-module/cover/shared.js.map +1 -1
  45. package/build-module/embed/embed-link-settings.native.js +0 -1
  46. package/build-module/embed/embed-link-settings.native.js.map +1 -1
  47. package/build-module/footnotes/edit.js +2 -3
  48. package/build-module/footnotes/edit.js.map +1 -1
  49. package/build-module/group/index.js +1 -0
  50. package/build-module/group/index.js.map +1 -1
  51. package/build-module/post-content/edit.js +1 -1
  52. package/build-module/post-content/edit.js.map +1 -1
  53. package/build-module/post-template/index.js +1 -1
  54. package/build-module/post-terms/use-post-terms.js +3 -2
  55. package/build-module/post-terms/use-post-terms.js.map +1 -1
  56. package/build-module/query/edit/inspector-controls/index.js +29 -4
  57. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  58. package/build-module/query/edit/query-content.js +2 -1
  59. package/build-module/query/edit/query-content.js.map +1 -1
  60. package/build-module/query/index.js +9 -2
  61. package/build-module/query/index.js.map +1 -1
  62. package/build-module/query/view.js +72 -0
  63. package/build-module/query/view.js.map +1 -0
  64. package/build-module/query-pagination-next/index.js +1 -1
  65. package/build-module/query-pagination-numbers/edit.js +51 -6
  66. package/build-module/query-pagination-numbers/edit.js.map +1 -1
  67. package/build-module/query-pagination-numbers/index.js +7 -1
  68. package/build-module/query-pagination-numbers/index.js.map +1 -1
  69. package/build-module/query-pagination-previous/index.js +1 -1
  70. package/build-module/search/edit.js +4 -2
  71. package/build-module/search/edit.js.map +1 -1
  72. package/build-module/search/utils.js +0 -1
  73. package/build-module/search/utils.js.map +1 -1
  74. package/build-module/social-link/edit.native.js +1 -3
  75. package/build-module/social-link/edit.native.js.map +1 -1
  76. package/build-style/query/style-rtl.css +140 -0
  77. package/build-style/query/style.css +140 -0
  78. package/build-style/site-logo/style-rtl.css +1 -0
  79. package/build-style/site-logo/style.css +1 -0
  80. package/build-style/style-rtl.css +1 -0
  81. package/build-style/style.css +1 -0
  82. package/package.json +32 -32
  83. package/src/audio/test/__snapshots__/edit.native.js.snap +106 -78
  84. package/src/column/edit.native.js +4 -4
  85. package/src/columns/test/__snapshots__/edit.native.js.snap +14 -0
  86. package/src/columns/test/edit.native.js +47 -17
  87. package/src/cover/edit/index.js +3 -1
  88. package/src/cover/shared.js +25 -20
  89. package/src/cover/test/edit.native.js +1 -5
  90. package/src/embed/embed-link-settings.native.js +0 -1
  91. package/src/embed/test/index.native.js +9 -9
  92. package/src/file/test/__snapshots__/edit.native.js.snap +218 -162
  93. package/src/footnotes/edit.js +3 -1
  94. package/src/group/block.json +1 -0
  95. package/src/image/index.php +5 -0
  96. package/src/post-content/edit.js +2 -2
  97. package/src/post-content/index.php +0 -6
  98. package/src/post-featured-image/index.php +0 -6
  99. package/src/post-navigation-link/index.php +10 -1
  100. package/src/post-template/block.json +2 -1
  101. package/src/post-template/index.php +19 -4
  102. package/src/post-terms/use-post-terms.js +4 -2
  103. package/src/query/block.json +9 -2
  104. package/src/query/edit/inspector-controls/index.js +46 -3
  105. package/src/query/edit/query-content.js +1 -0
  106. package/src/query/index.php +94 -1
  107. package/src/query/style.scss +63 -0
  108. package/src/query/view.js +82 -0
  109. package/src/query-no-results/index.php +1 -5
  110. package/src/query-pagination-next/block.json +7 -1
  111. package/src/query-pagination-next/index.php +20 -3
  112. package/src/query-pagination-numbers/block.json +7 -1
  113. package/src/query-pagination-numbers/edit.js +64 -16
  114. package/src/query-pagination-numbers/index.php +27 -4
  115. package/src/query-pagination-previous/block.json +7 -1
  116. package/src/query-pagination-previous/index.php +19 -2
  117. package/src/search/edit.js +8 -2
  118. package/src/search/test/__snapshots__/edit.native.js.snap +363 -265
  119. package/src/search/utils.js +0 -1
  120. package/src/site-logo/style.scss +1 -0
  121. package/src/social-link/edit.native.js +1 -1
  122. package/src/social-link/editor.native.scss +0 -4
  123. package/src/social-links/test/edit.native.js +30 -0
  124. package/src/social-link/test/index.native.js +0 -132
@@ -0,0 +1,72 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { store, navigate, prefetch } from '@wordpress/interactivity';
5
+ const isValidLink = ref => ref && ref instanceof window.HTMLAnchorElement && ref.href && (!ref.target || ref.target === '_self') && ref.origin === window.location.origin;
6
+ const isValidEvent = event => event.button === 0 &&
7
+ // left clicks only
8
+ !event.metaKey &&
9
+ // open in new tab (mac)
10
+ !event.ctrlKey &&
11
+ // open in new tab (windows)
12
+ !event.altKey &&
13
+ // download
14
+ !event.shiftKey && !event.defaultPrevented;
15
+ store({
16
+ selectors: {
17
+ core: {
18
+ query: {
19
+ startAnimation: ({
20
+ context
21
+ }) => context.core.query.animation === 'start',
22
+ finishAnimation: ({
23
+ context
24
+ }) => context.core.query.animation === 'finish'
25
+ }
26
+ }
27
+ },
28
+ actions: {
29
+ core: {
30
+ query: {
31
+ navigate: async ({
32
+ event,
33
+ ref,
34
+ context,
35
+ state
36
+ }) => {
37
+ if (isValidLink(ref) && isValidEvent(event)) {
38
+ event.preventDefault();
39
+ const id = ref.closest('[data-wp-navigation-id]').dataset.wpNavigationId;
40
+
41
+ // Don't announce the navigation immediately, wait 300 ms.
42
+ const timeout = setTimeout(() => {
43
+ context.core.query.message = state.core.query.loadingText;
44
+ context.core.query.animation = 'start';
45
+ }, 300);
46
+ await navigate(ref.href);
47
+
48
+ // Dismiss loading message if it hasn't been added yet.
49
+ clearTimeout(timeout);
50
+
51
+ // Announce that the page has been loaded. If the message is the
52
+ // same, we use a no-break space similar to the @wordpress/a11y
53
+ // package: https://github.com/WordPress/gutenberg/blob/c395242b8e6ee20f8b06c199e4fc2920d7018af1/packages/a11y/src/filter-message.js#L20-L26
54
+ context.core.query.message = state.core.query.loadedText + (context.core.query.message === state.core.query.loadedText ? '\u00A0' : '');
55
+ context.core.query.animation = 'finish';
56
+
57
+ // Focus the first anchor of the Query block.
58
+ document.querySelector(`[data-wp-navigation-id=${id}] a[href]`)?.focus();
59
+ }
60
+ },
61
+ prefetch: async ({
62
+ ref
63
+ }) => {
64
+ if (isValidLink(ref)) {
65
+ await prefetch(ref.href);
66
+ }
67
+ }
68
+ }
69
+ }
70
+ }
71
+ });
72
+ //# sourceMappingURL=view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["store","navigate","prefetch","isValidLink","ref","window","HTMLAnchorElement","href","target","origin","location","isValidEvent","event","button","metaKey","ctrlKey","altKey","shiftKey","defaultPrevented","selectors","core","query","startAnimation","context","animation","finishAnimation","actions","state","preventDefault","id","closest","dataset","wpNavigationId","timeout","setTimeout","message","loadingText","clearTimeout","loadedText","document","querySelector","focus"],"sources":["@wordpress/block-library/src/query/view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store, navigate, prefetch } from '@wordpress/interactivity';\n\nconst isValidLink = ( ref ) =>\n\tref &&\n\tref instanceof window.HTMLAnchorElement &&\n\tref.href &&\n\t( ! ref.target || ref.target === '_self' ) &&\n\tref.origin === window.location.origin;\n\nconst isValidEvent = ( event ) =>\n\tevent.button === 0 && // left clicks only\n\t! event.metaKey && // open in new tab (mac)\n\t! event.ctrlKey && // open in new tab (windows)\n\t! event.altKey && // download\n\t! event.shiftKey &&\n\t! event.defaultPrevented;\n\nstore( {\n\tselectors: {\n\t\tcore: {\n\t\t\tquery: {\n\t\t\t\tstartAnimation: ( { context } ) =>\n\t\t\t\t\tcontext.core.query.animation === 'start',\n\t\t\t\tfinishAnimation: ( { context } ) =>\n\t\t\t\t\tcontext.core.query.animation === 'finish',\n\t\t\t},\n\t\t},\n\t},\n\tactions: {\n\t\tcore: {\n\t\t\tquery: {\n\t\t\t\tnavigate: async ( { event, ref, context, state } ) => {\n\t\t\t\t\tif ( isValidLink( ref ) && isValidEvent( event ) ) {\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\tconst id = ref.closest( '[data-wp-navigation-id]' )\n\t\t\t\t\t\t\t.dataset.wpNavigationId;\n\n\t\t\t\t\t\t// Don't announce the navigation immediately, wait 300 ms.\n\t\t\t\t\t\tconst timeout = setTimeout( () => {\n\t\t\t\t\t\t\tcontext.core.query.message =\n\t\t\t\t\t\t\t\tstate.core.query.loadingText;\n\t\t\t\t\t\t\tcontext.core.query.animation = 'start';\n\t\t\t\t\t\t}, 300 );\n\n\t\t\t\t\t\tawait navigate( ref.href );\n\n\t\t\t\t\t\t// Dismiss loading message if it hasn't been added yet.\n\t\t\t\t\t\tclearTimeout( timeout );\n\n\t\t\t\t\t\t// Announce that the page has been loaded. If the message is the\n\t\t\t\t\t\t// same, we use a no-break space similar to the @wordpress/a11y\n\t\t\t\t\t\t// package: https://github.com/WordPress/gutenberg/blob/c395242b8e6ee20f8b06c199e4fc2920d7018af1/packages/a11y/src/filter-message.js#L20-L26\n\t\t\t\t\t\tcontext.core.query.message =\n\t\t\t\t\t\t\tstate.core.query.loadedText +\n\t\t\t\t\t\t\t( context.core.query.message ===\n\t\t\t\t\t\t\tstate.core.query.loadedText\n\t\t\t\t\t\t\t\t? '\\u00A0'\n\t\t\t\t\t\t\t\t: '' );\n\n\t\t\t\t\t\tcontext.core.query.animation = 'finish';\n\n\t\t\t\t\t\t// Focus the first anchor of the Query block.\n\t\t\t\t\t\tdocument\n\t\t\t\t\t\t\t.querySelector(\n\t\t\t\t\t\t\t\t`[data-wp-navigation-id=${ id }] a[href]`\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t?.focus();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tprefetch: async ( { ref } ) => {\n\t\t\t\t\tif ( isValidLink( ref ) ) {\n\t\t\t\t\t\tawait prefetch( ref.href );\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,0BAA0B;AAEpE,MAAMC,WAAW,GAAKC,GAAG,IACxBA,GAAG,IACHA,GAAG,YAAYC,MAAM,CAACC,iBAAiB,IACvCF,GAAG,CAACG,IAAI,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OAAO,CAACH,IAAI,CAACC,KAAK,CAACG,SAAS,GAAG,OAAO;YACvC,CAAC,EAAE,GAAI,CAAC;YAER,MAAMvB,QAAQ,CAAEG,GAAG,CAACG,IAAK,CAAC;;YAE1B;YACA8B,YAAY,CAAEJ,OAAQ,CAAC;;YAEvB;YACA;YACA;YACAV,OAAO,CAACH,IAAI,CAACC,KAAK,CAACc,OAAO,GACzBR,KAAK,CAACP,IAAI,CAACC,KAAK,CAACiB,UAAU,IACzBf,OAAO,CAACH,IAAI,CAACC,KAAK,CAACc,OAAO,KAC5BR,KAAK,CAACP,IAAI,CAACC,KAAK,CAACiB,UAAU,GACxB,QAAQ,GACR,EAAE,CAAE;YAERf,OAAO,CAACH,IAAI,CAACC,KAAK,CAACG,SAAS,GAAG,QAAQ;;YAEvC;YACAe,QAAQ,CACNC,aAAa,CACZ,0BAA0BX,EAAI,WAChC,CAAC,EACCY,KAAK,CAAC,CAAC;UACX;QACD,CAAC;QACDvC,QAAQ,EAAE,MAAAA,CAAQ;UAAEE;QAAI,CAAC,KAAM;UAC9B,IAAKD,WAAW,CAAEC,GAAI,CAAC,EAAG;YACzB,MAAMF,QAAQ,CAAEE,GAAG,CAACG,IAAK,CAAC;UAC3B;QACD;MACD;IACD;EACD;AACD,CAAE,CAAC"}
@@ -21,7 +21,7 @@ const metadata = {
21
21
  type: "string"
22
22
  }
23
23
  },
24
- usesContext: ["queryId", "query", "paginationArrow", "showLabel"],
24
+ usesContext: ["queryId", "query", "paginationArrow", "showLabel", "enhancedPagination"],
25
25
  supports: {
26
26
  reusable: false,
27
27
  html: false,
@@ -2,15 +2,60 @@ import { createElement, Fragment } from "@wordpress/element";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
5
- import { useBlockProps } from '@wordpress/block-editor';
5
+ import { __ } from '@wordpress/i18n';
6
+ import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
7
+ import { PanelBody, RangeControl } from '@wordpress/components';
6
8
  const createPaginationItem = (content, Tag = 'a', extraClass = '') => createElement(Tag, {
9
+ key: content,
7
10
  className: `page-numbers ${extraClass}`
8
11
  }, content);
9
- const previewPaginationNumbers = () => createElement(Fragment, null, createPaginationItem(1), createPaginationItem(2), createPaginationItem(3, 'span', 'current'), createPaginationItem(4), createPaginationItem(5), createPaginationItem('...', 'span', 'dots'), createPaginationItem(8));
10
- export default function QueryPaginationNumbersEdit() {
11
- const paginationNumbers = previewPaginationNumbers();
12
- return createElement("div", {
12
+ const previewPaginationNumbers = midSize => {
13
+ const paginationItems = [];
14
+
15
+ // First set of pagination items.
16
+ for (let i = 1; i <= midSize; i++) {
17
+ paginationItems.push(createPaginationItem(i));
18
+ }
19
+
20
+ // Current pagination item.
21
+ paginationItems.push(createPaginationItem(midSize + 1, 'span', 'current'));
22
+
23
+ // Second set of pagination items.
24
+ for (let i = 1; i <= midSize; i++) {
25
+ paginationItems.push(createPaginationItem(midSize + 1 + i));
26
+ }
27
+
28
+ // Dots.
29
+ paginationItems.push(createPaginationItem('...', 'span', 'dots'));
30
+
31
+ // Last pagination item.
32
+ paginationItems.push(createPaginationItem(midSize * 2 + 3));
33
+ return createElement(Fragment, null, paginationItems);
34
+ };
35
+ export default function QueryPaginationNumbersEdit({
36
+ attributes,
37
+ setAttributes
38
+ }) {
39
+ const {
40
+ midSize
41
+ } = attributes;
42
+ const paginationNumbers = previewPaginationNumbers(parseInt(midSize, 10));
43
+ return createElement(Fragment, null, createElement(InspectorControls, null, createElement(PanelBody, {
44
+ title: __('Settings')
45
+ }, createElement(RangeControl, {
46
+ label: __('Number of links'),
47
+ help: __('Specify how many links can appear before and after the current page number. Links to the first, current and last page are always visible.'),
48
+ value: midSize,
49
+ onChange: value => {
50
+ setAttributes({
51
+ midSize: parseInt(value, 10)
52
+ });
53
+ },
54
+ min: 0,
55
+ max: 5,
56
+ withInputField: false
57
+ }))), createElement("div", {
13
58
  ...useBlockProps()
14
- }, paginationNumbers);
59
+ }, paginationNumbers));
15
60
  }
16
61
  //# sourceMappingURL=edit.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useBlockProps","createPaginationItem","content","Tag","extraClass","createElement","className","previewPaginationNumbers","Fragment","QueryPaginationNumbersEdit","paginationNumbers"],"sources":["@wordpress/block-library/src/query-pagination-numbers/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useBlockProps } from '@wordpress/block-editor';\n\nconst createPaginationItem = ( content, Tag = 'a', extraClass = '' ) => (\n\t<Tag className={ `page-numbers ${ extraClass }` }>{ content }</Tag>\n);\n\nconst previewPaginationNumbers = () => (\n\t<>\n\t\t{ createPaginationItem( 1 ) }\n\t\t{ createPaginationItem( 2 ) }\n\t\t{ createPaginationItem( 3, 'span', 'current' ) }\n\t\t{ createPaginationItem( 4 ) }\n\t\t{ createPaginationItem( 5 ) }\n\t\t{ createPaginationItem( '...', 'span', 'dots' ) }\n\t\t{ createPaginationItem( 8 ) }\n\t</>\n);\n\nexport default function QueryPaginationNumbersEdit() {\n\tconst paginationNumbers = previewPaginationNumbers();\n\treturn <div { ...useBlockProps() }>{ paginationNumbers }</div>;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,yBAAyB;AAEvD,MAAMC,oBAAoB,GAAGA,CAAEC,OAAO,EAAEC,GAAG,GAAG,GAAG,EAAEC,UAAU,GAAG,EAAE,KACjEC,aAAA,CAACF,GAAG;EAACG,SAAS,EAAI,gBAAgBF,UAAY;AAAG,GAAGF,OAAc,CAClE;AAED,MAAMK,wBAAwB,GAAGA,CAAA,KAChCF,aAAA,CAAAG,QAAA,QACGP,oBAAoB,CAAE,CAAE,CAAC,EACzBA,oBAAoB,CAAE,CAAE,CAAC,EACzBA,oBAAoB,CAAE,CAAC,EAAE,MAAM,EAAE,SAAU,CAAC,EAC5CA,oBAAoB,CAAE,CAAE,CAAC,EACzBA,oBAAoB,CAAE,CAAE,CAAC,EACzBA,oBAAoB,CAAE,KAAK,EAAE,MAAM,EAAE,MAAO,CAAC,EAC7CA,oBAAoB,CAAE,CAAE,CACzB,CACF;AAED,eAAe,SAASQ,0BAA0BA,CAAA,EAAG;EACpD,MAAMC,iBAAiB,GAAGH,wBAAwB,CAAC,CAAC;EACpD,OAAOF,aAAA;IAAA,GAAUL,aAAa,CAAC;EAAC,GAAKU,iBAAwB,CAAC;AAC/D"}
1
+ {"version":3,"names":["__","InspectorControls","useBlockProps","PanelBody","RangeControl","createPaginationItem","content","Tag","extraClass","createElement","key","className","previewPaginationNumbers","midSize","paginationItems","i","push","Fragment","QueryPaginationNumbersEdit","attributes","setAttributes","paginationNumbers","parseInt","title","label","help","value","onChange","min","max","withInputField"],"sources":["@wordpress/block-library/src/query-pagination-numbers/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { InspectorControls, useBlockProps } from '@wordpress/block-editor';\nimport { PanelBody, RangeControl } from '@wordpress/components';\n\nconst createPaginationItem = ( content, Tag = 'a', extraClass = '' ) => (\n\t<Tag key={ content } className={ `page-numbers ${ extraClass }` }>\n\t\t{ content }\n\t</Tag>\n);\n\nconst previewPaginationNumbers = ( midSize ) => {\n\tconst paginationItems = [];\n\n\t// First set of pagination items.\n\tfor ( let i = 1; i <= midSize; i++ ) {\n\t\tpaginationItems.push( createPaginationItem( i ) );\n\t}\n\n\t// Current pagination item.\n\tpaginationItems.push(\n\t\tcreatePaginationItem( midSize + 1, 'span', 'current' )\n\t);\n\n\t// Second set of pagination items.\n\tfor ( let i = 1; i <= midSize; i++ ) {\n\t\tpaginationItems.push( createPaginationItem( midSize + 1 + i ) );\n\t}\n\n\t// Dots.\n\tpaginationItems.push( createPaginationItem( '...', 'span', 'dots' ) );\n\n\t// Last pagination item.\n\tpaginationItems.push( createPaginationItem( midSize * 2 + 3 ) );\n\n\treturn <>{ paginationItems }</>;\n};\n\nexport default function QueryPaginationNumbersEdit( {\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst { midSize } = attributes;\n\tconst paginationNumbers = previewPaginationNumbers(\n\t\tparseInt( midSize, 10 )\n\t);\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\tlabel={ __( 'Number of links' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Specify how many links can appear before and after the current page number. Links to the first, current and last page are always visible.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tvalue={ midSize }\n\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tmidSize: parseInt( value, 10 ),\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tmax={ 5 }\n\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...useBlockProps() }>{ paginationNumbers }</div>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,iBAAiB,EAAEC,aAAa,QAAQ,yBAAyB;AAC1E,SAASC,SAAS,EAAEC,YAAY,QAAQ,uBAAuB;AAE/D,MAAMC,oBAAoB,GAAGA,CAAEC,OAAO,EAAEC,GAAG,GAAG,GAAG,EAAEC,UAAU,GAAG,EAAE,KACjEC,aAAA,CAACF,GAAG;EAACG,GAAG,EAAGJ,OAAS;EAACK,SAAS,EAAI,gBAAgBH,UAAY;AAAG,GAC9DF,OACE,CACL;AAED,MAAMM,wBAAwB,GAAKC,OAAO,IAAM;EAC/C,MAAMC,eAAe,GAAG,EAAE;;EAE1B;EACA,KAAM,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,IAAIF,OAAO,EAAEE,CAAC,EAAE,EAAG;IACpCD,eAAe,CAACE,IAAI,CAAEX,oBAAoB,CAAEU,CAAE,CAAE,CAAC;EAClD;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Ac,EAAG;EAAO,CACxB,CACS,CACO,CAAC,EACpBrB,aAAA;IAAA,GAAUP,aAAa,CAAC;EAAC,GAAKmB,iBAAwB,CACrD,CAAC;AAEL"}
@@ -16,7 +16,13 @@ const metadata = {
16
16
  parent: ["core/query-pagination"],
17
17
  description: "Displays a list of page numbers for pagination",
18
18
  textdomain: "default",
19
- usesContext: ["queryId", "query"],
19
+ attributes: {
20
+ midSize: {
21
+ type: "number",
22
+ "default": 2
23
+ }
24
+ },
25
+ usesContext: ["queryId", "query", "enhancedPagination"],
20
26
  supports: {
21
27
  reusable: false,
22
28
  html: false,
@@ -1 +1 @@
1
- {"version":3,"names":["queryPaginationNumbers","icon","initBlock","metadata","$schema","apiVersion","name","title","category","parent","description","textdomain","usesContext","supports","reusable","html","color","gradients","text","__experimentalDefaultControls","background","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","editorStyle","edit","settings","init"],"sources":["@wordpress/block-library/src/query-pagination-numbers/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { queryPaginationNumbers as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAsB,IAAIC,IAAI,QAAQ,kBAAkB;;AAEjE;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,MAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,WAAA;EAAAC,QAAA;IAAAC,QAAA;IAAAC,IAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;MAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAV,6BAAA;QAAAG,QAAA;MAAA;IAAA;EAAA;EAAAQ,WAAA;AAAA;AAE5C,OAAOC,IAAI,MAAM,QAAQ;AAEzB,MAAM;EAAEzB;AAAK,CAAC,GAAGH,QAAQ;AACzB,SAASA,QAAQ,EAAEG,IAAI;AAEvB,OAAO,MAAM0B,QAAQ,GAAG;EACvB/B,IAAI;EACJ8B;AACD,CAAC;AAED,OAAO,MAAME,IAAI,GAAGA,CAAA,KAAM/B,SAAS,CAAE;EAAEI,IAAI;EAAEH,QAAQ;EAAE6B;AAAS,CAAE,CAAC"}
1
+ {"version":3,"names":["queryPaginationNumbers","icon","initBlock","metadata","$schema","apiVersion","name","title","category","parent","description","textdomain","attributes","midSize","type","usesContext","supports","reusable","html","color","gradients","text","__experimentalDefaultControls","background","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","editorStyle","edit","settings","init"],"sources":["@wordpress/block-library/src/query-pagination-numbers/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { queryPaginationNumbers as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAsB,IAAIC,IAAI,QAAQ,kBAAkB;;AAEjE;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,MAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,OAAA;MAAAC,IAAA;MAAA;IAAA;EAAA;EAAAC,WAAA;EAAAC,QAAA;IAAAC,QAAA;IAAAC,IAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;MAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAV,6BAAA;QAAAG,QAAA;MAAA;IAAA;EAAA;EAAAQ,WAAA;AAAA;AAE5C,OAAOC,IAAI,MAAM,QAAQ;AAEzB,MAAM;EAAE5B;AAAK,CAAC,GAAGH,QAAQ;AACzB,SAASA,QAAQ,EAAEG,IAAI;AAEvB,OAAO,MAAM6B,QAAQ,GAAG;EACvBlC,IAAI;EACJiC;AACD,CAAC;AAED,OAAO,MAAME,IAAI,GAAGA,CAAA,KAAMlC,SAAS,CAAE;EAAEI,IAAI;EAAEH,QAAQ;EAAEgC;AAAS,CAAE,CAAC"}
@@ -21,7 +21,7 @@ const metadata = {
21
21
  type: "string"
22
22
  }
23
23
  },
24
- usesContext: ["queryId", "query", "paginationArrow", "showLabel"],
24
+ usesContext: ["queryId", "query", "paginationArrow", "showLabel", "enhancedPagination"],
25
25
  supports: {
26
26
  reusable: false,
27
27
  html: false,
@@ -20,7 +20,7 @@ import { __unstableStripHTML as stripHTML } from '@wordpress/dom';
20
20
  * Internal dependencies
21
21
  */
22
22
  import { buttonOnly, buttonOutside, buttonInside, noButton, buttonWithIcon, toggleLabel } from './icons';
23
- import { PC_WIDTH_DEFAULT, PX_WIDTH_DEFAULT, MIN_WIDTH, MIN_WIDTH_UNIT } from './utils.js';
23
+ import { PC_WIDTH_DEFAULT, PX_WIDTH_DEFAULT, MIN_WIDTH, isPercentageUnit } from './utils.js';
24
24
 
25
25
  // Used to calculate border radius adjustment to avoid "fat" corners when
26
26
  // button is placed inside wrapper.
@@ -283,7 +283,9 @@ export default function SearchEdit({
283
283
  id: unitControlInputId
284
284
  }, createElement(UnitControl, {
285
285
  id: unitControlInputId,
286
- min: `${MIN_WIDTH}${MIN_WIDTH_UNIT}`,
286
+ min: isPercentageUnit(widthUnit) ? 0 : MIN_WIDTH,
287
+ max: isPercentageUnit(widthUnit) ? 100 : undefined,
288
+ step: 1,
287
289
  onChange: newWidth => {
288
290
  const filteredWidth = widthUnit === '%' && parseInt(newWidth, 10) > 100 ? 100 : newWidth;
289
291
  setAttributes({
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useBlockProps","BlockControls","InspectorControls","RichText","__experimentalUseBorderProps","useBorderProps","__experimentalUseColorProps","useColorProps","getTypographyClassesAndStyles","useTypographyProps","store","blockEditorStore","__experimentalGetElementClassName","useSetting","useDispatch","useSelect","useEffect","useRef","ToolbarDropdownMenu","ToolbarGroup","Button","ButtonGroup","ToolbarButton","ResizableBox","PanelBody","BaseControl","__experimentalUseCustomUnits","useCustomUnits","__experimentalUnitControl","UnitControl","useInstanceId","Icon","search","__","__unstableStripHTML","stripHTML","buttonOnly","buttonOutside","buttonInside","noButton","buttonWithIcon","toggleLabel","PC_WIDTH_DEFAULT","PX_WIDTH_DEFAULT","MIN_WIDTH","MIN_WIDTH_UNIT","DEFAULT_INNER_PADDING","BUTTON_BEHAVIOR_EXPAND","SearchEdit","className","attributes","setAttributes","toggleSelection","isSelected","clientId","label","showLabel","placeholder","width","widthUnit","align","buttonText","buttonPosition","buttonUseIcon","buttonBehavior","isSearchFieldHidden","style","insertedInNavigationBlock","select","getBlockParentsByBlockName","wasBlockJustInserted","length","__unstableMarkNextChangeAsNotPersistent","borderRadius","border","radius","borderProps","colorProps","fluidTypographySettings","layout","typographyProps","typography","fluid","wideSize","unitControlInstanceId","unitControlInputId","isButtonPositionInside","isButtonPositionOutside","hasNoButton","hasOnlyButton","searchFieldRef","buttonRef","units","availableUnits","defaultValues","px","getBlockClassNames","undefined","buttonPositionControls","role","title","isActive","icon","onClick","getButtonPositionIcon","getResizableSides","right","left","renderTextField","textFieldClasses","textFieldStyles","textDecoration","createElement","type","value","onChange","event","target","ref","renderButton","buttonClasses","buttonStyles","handleButtonClick","Fragment","withoutInteractiveFormatting","html","controls","id","min","newWidth","filteredWidth","parseInt","onUnitChange","newUnit","__unstableInputWidth","map","widthValue","key","isSmall","variant","padBorderRadius","getWrapperStyles","styles","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","isNonZeroBorderRadius","topLeft","topRight","bottomLeft","bottomRight","Number","isInteger","blockProps","labelClassnames","size","minWidth","enable","onResizeStart","direction","elt","offsetWidth","onResizeStop","delta","showHandle"],"sources":["@wordpress/block-library/src/search/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseBlockProps,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalUseColorProps as useColorProps,\n\tgetTypographyClassesAndStyles as useTypographyProps,\n\tstore as blockEditorStore,\n\t__experimentalGetElementClassName,\n\tuseSetting,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tToolbarDropdownMenu,\n\tToolbarGroup,\n\tButton,\n\tButtonGroup,\n\tToolbarButton,\n\tResizableBox,\n\tPanelBody,\n\tBaseControl,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { Icon, search } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport {\n\tbuttonOnly,\n\tbuttonOutside,\n\tbuttonInside,\n\tnoButton,\n\tbuttonWithIcon,\n\ttoggleLabel,\n} from './icons';\nimport {\n\tPC_WIDTH_DEFAULT,\n\tPX_WIDTH_DEFAULT,\n\tMIN_WIDTH,\n\tMIN_WIDTH_UNIT,\n} from './utils.js';\n\n// Used to calculate border radius adjustment to avoid \"fat\" corners when\n// button is placed inside wrapper.\nconst DEFAULT_INNER_PADDING = '4px';\n\nconst BUTTON_BEHAVIOR_EXPAND = 'expand-searchfield';\n\nexport default function SearchEdit( {\n\tclassName,\n\tattributes,\n\tsetAttributes,\n\ttoggleSelection,\n\tisSelected,\n\tclientId,\n} ) {\n\tconst {\n\t\tlabel,\n\t\tshowLabel,\n\t\tplaceholder,\n\t\twidth,\n\t\twidthUnit,\n\t\talign,\n\t\tbuttonText,\n\t\tbuttonPosition,\n\t\tbuttonUseIcon,\n\t\tbuttonBehavior,\n\t\tisSearchFieldHidden,\n\t\tstyle,\n\t} = attributes;\n\n\tconst insertedInNavigationBlock = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParentsByBlockName, wasBlockJustInserted } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn (\n\t\t\t\t!! getBlockParentsByBlockName( clientId, 'core/navigation' )\n\t\t\t\t\t?.length && wasBlockJustInserted( clientId )\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tif ( insertedInNavigationBlock ) {\n\t\t// This side-effect should not create an undo level.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\tsetAttributes( {\n\t\t\tshowLabel: false,\n\t\t\tbuttonUseIcon: true,\n\t\t\tbuttonPosition: 'button-inside',\n\t\t} );\n\t}\n\n\tconst borderRadius = style?.border?.radius;\n\tconst borderProps = useBorderProps( attributes );\n\n\t// Check for old deprecated numerical border radius. Done as a separate\n\t// check so that a borderRadius style won't overwrite the longhand\n\t// per-corner styles.\n\tif ( typeof borderRadius === 'number' ) {\n\t\tborderProps.style.borderRadius = `${ borderRadius }px`;\n\t}\n\n\tconst colorProps = useColorProps( attributes );\n\tconst fluidTypographySettings = useSetting( 'typography.fluid' );\n\tconst layout = useSetting( 'layout' );\n\tconst typographyProps = useTypographyProps( attributes, {\n\t\ttypography: {\n\t\t\tfluid: fluidTypographySettings,\n\t\t},\n\t\tlayout: {\n\t\t\twideSize: layout?.wideSize,\n\t\t},\n\t} );\n\tconst unitControlInstanceId = useInstanceId( UnitControl );\n\tconst unitControlInputId = `wp-block-search__width-${ unitControlInstanceId }`;\n\tconst isButtonPositionInside = 'button-inside' === buttonPosition;\n\tconst isButtonPositionOutside = 'button-outside' === buttonPosition;\n\tconst hasNoButton = 'no-button' === buttonPosition;\n\tconst hasOnlyButton = 'button-only' === buttonPosition;\n\tconst searchFieldRef = useRef();\n\tconst buttonRef = useRef();\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: [ '%', 'px' ],\n\t\tdefaultValues: { '%': PC_WIDTH_DEFAULT, px: PX_WIDTH_DEFAULT },\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( hasOnlyButton && ! isSelected ) {\n\t\t\tsetAttributes( {\n\t\t\t\tisSearchFieldHidden: true,\n\t\t\t} );\n\t\t}\n\t}, [ hasOnlyButton, isSelected, setAttributes ] );\n\n\t// Show the search field when width changes.\n\tuseEffect( () => {\n\t\tif ( ! hasOnlyButton || ! isSelected ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\tisSearchFieldHidden: false,\n\t\t} );\n\t}, [ hasOnlyButton, isSelected, setAttributes, width ] );\n\n\tconst getBlockClassNames = () => {\n\t\treturn classnames(\n\t\t\tclassName,\n\t\t\tisButtonPositionInside\n\t\t\t\t? 'wp-block-search__button-inside'\n\t\t\t\t: undefined,\n\t\t\tisButtonPositionOutside\n\t\t\t\t? 'wp-block-search__button-outside'\n\t\t\t\t: undefined,\n\t\t\thasNoButton ? 'wp-block-search__no-button' : undefined,\n\t\t\thasOnlyButton ? 'wp-block-search__button-only' : undefined,\n\t\t\t! buttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__text-button'\n\t\t\t\t: undefined,\n\t\t\tbuttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__icon-button'\n\t\t\t\t: undefined,\n\t\t\thasOnlyButton && BUTTON_BEHAVIOR_EXPAND === buttonBehavior\n\t\t\t\t? 'wp-block-search__button-behavior-expand'\n\t\t\t\t: undefined,\n\t\t\thasOnlyButton && isSearchFieldHidden\n\t\t\t\t? 'wp-block-search__searchfield-hidden'\n\t\t\t\t: undefined\n\t\t);\n\t};\n\n\tconst buttonPositionControls = [\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Button outside' ),\n\t\t\tisActive: buttonPosition === 'button-outside',\n\t\t\ticon: buttonOutside,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'button-outside',\n\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Button inside' ),\n\t\t\tisActive: buttonPosition === 'button-inside',\n\t\t\ticon: buttonInside,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'button-inside',\n\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'No button' ),\n\t\t\tisActive: buttonPosition === 'no-button',\n\t\t\ticon: noButton,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'no-button',\n\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Button only' ),\n\t\t\tisActive: buttonPosition === 'button-only',\n\t\t\ticon: buttonOnly,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'button-only',\n\t\t\t\t\tisSearchFieldHidden: true,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t];\n\n\tconst getButtonPositionIcon = () => {\n\t\tswitch ( buttonPosition ) {\n\t\t\tcase 'button-inside':\n\t\t\t\treturn buttonInside;\n\t\t\tcase 'button-outside':\n\t\t\t\treturn buttonOutside;\n\t\t\tcase 'no-button':\n\t\t\t\treturn noButton;\n\t\t\tcase 'button-only':\n\t\t\t\treturn buttonOnly;\n\t\t}\n\t};\n\n\tconst getResizableSides = () => {\n\t\tif ( hasOnlyButton ) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tright: align !== 'right',\n\t\t\tleft: align === 'right',\n\t\t};\n\t};\n\n\tconst renderTextField = () => {\n\t\t// If the input is inside the wrapper, the wrapper gets the border color styles/classes, not the input control.\n\t\tconst textFieldClasses = classnames(\n\t\t\t'wp-block-search__input',\n\t\t\tisButtonPositionInside ? undefined : borderProps.className,\n\t\t\ttypographyProps.className\n\t\t);\n\t\tconst textFieldStyles = {\n\t\t\t...( isButtonPositionInside\n\t\t\t\t? { borderRadius }\n\t\t\t\t: borderProps.style ),\n\t\t\t...typographyProps.style,\n\t\t\ttextDecoration: undefined,\n\t\t};\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\ttype=\"search\"\n\t\t\t\tclassName={ textFieldClasses }\n\t\t\t\tstyle={ textFieldStyles }\n\t\t\t\taria-label={ __( 'Optional placeholder text' ) }\n\t\t\t\t// We hide the placeholder field's placeholder when there is a value. This\n\t\t\t\t// stops screen readers from reading the placeholder field's placeholder\n\t\t\t\t// which is confusing.\n\t\t\t\tplaceholder={\n\t\t\t\t\tplaceholder ? undefined : __( 'Optional placeholder…' )\n\t\t\t\t}\n\t\t\t\tvalue={ placeholder }\n\t\t\t\tonChange={ ( event ) =>\n\t\t\t\t\tsetAttributes( { placeholder: event.target.value } )\n\t\t\t\t}\n\t\t\t\tref={ searchFieldRef }\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst renderButton = () => {\n\t\t// If the button is inside the wrapper, the wrapper gets the border color styles/classes, not the button.\n\t\tconst buttonClasses = classnames(\n\t\t\t'wp-block-search__button',\n\t\t\tcolorProps.className,\n\t\t\ttypographyProps.className,\n\t\t\tisButtonPositionInside ? undefined : borderProps.className,\n\t\t\tbuttonUseIcon ? 'has-icon' : undefined,\n\t\t\t__experimentalGetElementClassName( 'button' )\n\t\t);\n\t\tconst buttonStyles = {\n\t\t\t...colorProps.style,\n\t\t\t...typographyProps.style,\n\t\t\t...( isButtonPositionInside\n\t\t\t\t? { borderRadius }\n\t\t\t\t: borderProps.style ),\n\t\t};\n\t\tconst handleButtonClick = () => {\n\t\t\tif ( hasOnlyButton && BUTTON_BEHAVIOR_EXPAND === buttonBehavior ) {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tisSearchFieldHidden: ! isSearchFieldHidden,\n\t\t\t\t} );\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ buttonUseIcon && (\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName={ buttonClasses }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\tbuttonText\n\t\t\t\t\t\t\t\t? stripHTML( buttonText )\n\t\t\t\t\t\t\t\t: __( 'Search' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={ handleButtonClick }\n\t\t\t\t\t\tref={ buttonRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon icon={ search } />\n\t\t\t\t\t</button>\n\t\t\t\t) }\n\n\t\t\t\t{ ! buttonUseIcon && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tclassName={ buttonClasses }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taria-label={ __( 'Button text' ) }\n\t\t\t\t\t\tplaceholder={ __( 'Add button text…' ) }\n\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\tvalue={ buttonText }\n\t\t\t\t\t\tonChange={ ( html ) =>\n\t\t\t\t\t\t\tsetAttributes( { buttonText: html } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={ handleButtonClick }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t};\n\n\tconst controls = (\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\ttitle={ __( 'Toggle search label' ) }\n\t\t\t\t\t\ticon={ toggleLabel }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowLabel: ! showLabel,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tclassName={ showLabel ? 'is-pressed' : undefined }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\t\ticon={ getButtonPositionIcon() }\n\t\t\t\t\t\tlabel={ __( 'Change button position' ) }\n\t\t\t\t\t\tcontrols={ buttonPositionControls }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! hasNoButton && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\ttitle={ __( 'Use button with icon' ) }\n\t\t\t\t\t\t\ticon={ buttonWithIcon }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tbuttonUseIcon: ! buttonUseIcon,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\tbuttonUseIcon ? 'is-pressed' : undefined\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</ToolbarGroup>\n\t\t\t</BlockControls>\n\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Display Settings' ) }>\n\t\t\t\t\t<BaseControl\n\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\tid={ unitControlInputId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tid={ unitControlInputId }\n\t\t\t\t\t\t\tmin={ `${ MIN_WIDTH }${ MIN_WIDTH_UNIT }` }\n\t\t\t\t\t\t\tonChange={ ( newWidth ) => {\n\t\t\t\t\t\t\t\tconst filteredWidth =\n\t\t\t\t\t\t\t\t\twidthUnit === '%' &&\n\t\t\t\t\t\t\t\t\tparseInt( newWidth, 10 ) > 100\n\t\t\t\t\t\t\t\t\t\t? 100\n\t\t\t\t\t\t\t\t\t\t: newWidth;\n\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\twidth: parseInt( filteredWidth, 10 ),\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonUnitChange={ ( newUnit ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t'%' === newUnit\n\t\t\t\t\t\t\t\t\t\t\t? PC_WIDTH_DEFAULT\n\t\t\t\t\t\t\t\t\t\t\t: PX_WIDTH_DEFAULT,\n\t\t\t\t\t\t\t\t\twidthUnit: newUnit,\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__unstableInputWidth={ '80px' }\n\t\t\t\t\t\t\tvalue={ `${ width }${ widthUnit }` }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<ButtonGroup\n\t\t\t\t\t\t\tclassName=\"wp-block-search__components-button-group\"\n\t\t\t\t\t\t\taria-label={ __( 'Percentage Width' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ [ 25, 50, 75, 100 ].map( ( widthValue ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tkey={ widthValue }\n\t\t\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\t\twidthValue === width &&\n\t\t\t\t\t\t\t\t\t\t\twidthUnit === '%'\n\t\t\t\t\t\t\t\t\t\t\t\t? 'primary'\n\t\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\twidth: widthValue,\n\t\t\t\t\t\t\t\t\t\t\t\twidthUnit: '%',\n\t\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ widthValue }%\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</ButtonGroup>\n\t\t\t\t\t</BaseControl>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\n\tconst padBorderRadius = ( radius ) =>\n\t\tradius ? `calc(${ radius } + ${ DEFAULT_INNER_PADDING })` : undefined;\n\n\tconst getWrapperStyles = () => {\n\t\tconst styles = isButtonPositionInside\n\t\t\t? borderProps.style\n\t\t\t: {\n\t\t\t\t\tborderRadius: borderProps.style?.borderRadius,\n\t\t\t\t\tborderTopLeftRadius: borderProps.style?.borderTopLeftRadius,\n\t\t\t\t\tborderTopRightRadius:\n\t\t\t\t\t\tborderProps.style?.borderTopRightRadius,\n\t\t\t\t\tborderBottomLeftRadius:\n\t\t\t\t\t\tborderProps.style?.borderBottomLeftRadius,\n\t\t\t\t\tborderBottomRightRadius:\n\t\t\t\t\t\tborderProps.style?.borderBottomRightRadius,\n\t\t\t };\n\n\t\tconst isNonZeroBorderRadius =\n\t\t\tborderRadius !== undefined && parseInt( borderRadius, 10 ) !== 0;\n\n\t\tif ( isButtonPositionInside && isNonZeroBorderRadius ) {\n\t\t\t// We have button inside wrapper and a border radius value to apply.\n\t\t\t// Add default padding so we don't get \"fat\" corners.\n\t\t\t//\n\t\t\t// CSS calc() is used here to support non-pixel units. The inline\n\t\t\t// style using calc() will only apply if both values have units.\n\n\t\t\tif ( typeof borderRadius === 'object' ) {\n\t\t\t\t// Individual corner border radii present.\n\t\t\t\tconst { topLeft, topRight, bottomLeft, bottomRight } =\n\t\t\t\t\tborderRadius;\n\n\t\t\t\treturn {\n\t\t\t\t\t...styles,\n\t\t\t\t\tborderTopLeftRadius: padBorderRadius( topLeft ),\n\t\t\t\t\tborderTopRightRadius: padBorderRadius( topRight ),\n\t\t\t\t\tborderBottomLeftRadius: padBorderRadius( bottomLeft ),\n\t\t\t\t\tborderBottomRightRadius: padBorderRadius( bottomRight ),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// The inline style using calc() will only apply if both values\n\t\t\t// supplied to calc() have units. Deprecated block's may have\n\t\t\t// unitless integer.\n\t\t\tconst radius = Number.isInteger( borderRadius )\n\t\t\t\t? `${ borderRadius }px`\n\t\t\t\t: borderRadius;\n\n\t\t\tstyles.borderRadius = `calc(${ radius } + ${ DEFAULT_INNER_PADDING })`;\n\t\t}\n\n\t\treturn styles;\n\t};\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: getBlockClassNames(),\n\t\tstyle: {\n\t\t\t...typographyProps.style,\n\t\t\t// Input opts out of text decoration.\n\t\t\ttextDecoration: undefined,\n\t\t},\n\t} );\n\n\tconst labelClassnames = classnames(\n\t\t'wp-block-search__label',\n\t\ttypographyProps.className\n\t);\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t{ controls }\n\n\t\t\t{ showLabel && (\n\t\t\t\t<RichText\n\t\t\t\t\tclassName={ labelClassnames }\n\t\t\t\t\taria-label={ __( 'Label text' ) }\n\t\t\t\t\tplaceholder={ __( 'Add label…' ) }\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\tonChange={ ( html ) => setAttributes( { label: html } ) }\n\t\t\t\t\tstyle={ typographyProps.style }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t<ResizableBox\n\t\t\t\tsize={ {\n\t\t\t\t\twidth: `${ width }${ widthUnit }`,\n\t\t\t\t} }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'wp-block-search__inside-wrapper',\n\t\t\t\t\tisButtonPositionInside ? borderProps.className : undefined\n\t\t\t\t) }\n\t\t\t\tstyle={ getWrapperStyles() }\n\t\t\t\tminWidth={ MIN_WIDTH }\n\t\t\t\tenable={ getResizableSides() }\n\t\t\t\tonResizeStart={ ( event, direction, elt ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( elt.offsetWidth, 10 ),\n\t\t\t\t\t\twidthUnit: 'px',\n\t\t\t\t\t} );\n\t\t\t\t\ttoggleSelection( false );\n\t\t\t\t} }\n\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( width + delta.width, 10 ),\n\t\t\t\t\t} );\n\t\t\t\t\ttoggleSelection( true );\n\t\t\t\t} }\n\t\t\t\tshowHandle={ isSelected }\n\t\t\t>\n\t\t\t\t{ ( isButtonPositionInside ||\n\t\t\t\t\tisButtonPositionOutside ||\n\t\t\t\t\thasOnlyButton ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ renderTextField() }\n\t\t\t\t\t\t{ renderButton() }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t{ hasNoButton && renderTextField() }\n\t\t\t</ResizableBox>\n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C5BgB,QAAQ,EAAGjH,SAAW;IACtBkH,MAAM,EAAGrD,iBAAiB,CAAC,CAAG;IAC9BsD,aAAa,EAAGA,CAAE3C,KAAK,EAAE4C,SAAS,EAAEC,GAAG,KAAM;MAC5C9G,aAAa,CAAE;QACdO,KAAK,EAAEyE,QAAQ,CAAE8B,GAAG,CAACC,WAAW,EAAE,EAAG,CAAC;QACtCvG,SAAS,EAAE;MACZ,CAAE,CAAC;MACHP,eAAe,CAAE,KAAM,CAAC;IACzB,CAAG;IACH+G,YAAY,EAAGA,CAAE/C,KAAK,EAAE4C,SAAS,EAAEC,GAAG,EAAEG,KAAK,KAAM;MAClDjH,aAAa,CAAE;QACdO,KAAK,EAAEyE,QAAQ,CAAEzE,KAAK,GAAG0G,KAAK,CAAC1G,KAAK,EAAE,EAAG;MAC1C,CAAE,CAAC;MACHN,eAAe,CAAE,IAAK,CAAC;IACxB,CAAG;IACHiH,UAAU,EAAGhH;EAAY,GAEvB,CAAEiC,sBAAsB,IACzBC,uBAAuB,IACvBE,aAAa,KACbuB,aAAA,CAAAW,QAAA,QACGf,eAAe,CAAC,CAAC,EACjBW,YAAY,CAAC,CACd,CACF,EAEC/B,WAAW,IAAIoB,eAAe,CAAC,CACpB,CACV,CAAC;AAER"}
1
+ {"version":3,"names":["classnames","useBlockProps","BlockControls","InspectorControls","RichText","__experimentalUseBorderProps","useBorderProps","__experimentalUseColorProps","useColorProps","getTypographyClassesAndStyles","useTypographyProps","store","blockEditorStore","__experimentalGetElementClassName","useSetting","useDispatch","useSelect","useEffect","useRef","ToolbarDropdownMenu","ToolbarGroup","Button","ButtonGroup","ToolbarButton","ResizableBox","PanelBody","BaseControl","__experimentalUseCustomUnits","useCustomUnits","__experimentalUnitControl","UnitControl","useInstanceId","Icon","search","__","__unstableStripHTML","stripHTML","buttonOnly","buttonOutside","buttonInside","noButton","buttonWithIcon","toggleLabel","PC_WIDTH_DEFAULT","PX_WIDTH_DEFAULT","MIN_WIDTH","isPercentageUnit","DEFAULT_INNER_PADDING","BUTTON_BEHAVIOR_EXPAND","SearchEdit","className","attributes","setAttributes","toggleSelection","isSelected","clientId","label","showLabel","placeholder","width","widthUnit","align","buttonText","buttonPosition","buttonUseIcon","buttonBehavior","isSearchFieldHidden","style","insertedInNavigationBlock","select","getBlockParentsByBlockName","wasBlockJustInserted","length","__unstableMarkNextChangeAsNotPersistent","borderRadius","border","radius","borderProps","colorProps","fluidTypographySettings","layout","typographyProps","typography","fluid","wideSize","unitControlInstanceId","unitControlInputId","isButtonPositionInside","isButtonPositionOutside","hasNoButton","hasOnlyButton","searchFieldRef","buttonRef","units","availableUnits","defaultValues","px","getBlockClassNames","undefined","buttonPositionControls","role","title","isActive","icon","onClick","getButtonPositionIcon","getResizableSides","right","left","renderTextField","textFieldClasses","textFieldStyles","textDecoration","createElement","type","value","onChange","event","target","ref","renderButton","buttonClasses","buttonStyles","handleButtonClick","Fragment","withoutInteractiveFormatting","html","controls","id","min","max","step","newWidth","filteredWidth","parseInt","onUnitChange","newUnit","__unstableInputWidth","map","widthValue","key","isSmall","variant","padBorderRadius","getWrapperStyles","styles","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","isNonZeroBorderRadius","topLeft","topRight","bottomLeft","bottomRight","Number","isInteger","blockProps","labelClassnames","size","minWidth","enable","onResizeStart","direction","elt","offsetWidth","onResizeStop","delta","showHandle"],"sources":["@wordpress/block-library/src/search/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseBlockProps,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalUseColorProps as useColorProps,\n\tgetTypographyClassesAndStyles as useTypographyProps,\n\tstore as blockEditorStore,\n\t__experimentalGetElementClassName,\n\tuseSetting,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tToolbarDropdownMenu,\n\tToolbarGroup,\n\tButton,\n\tButtonGroup,\n\tToolbarButton,\n\tResizableBox,\n\tPanelBody,\n\tBaseControl,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { Icon, search } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport {\n\tbuttonOnly,\n\tbuttonOutside,\n\tbuttonInside,\n\tnoButton,\n\tbuttonWithIcon,\n\ttoggleLabel,\n} from './icons';\nimport {\n\tPC_WIDTH_DEFAULT,\n\tPX_WIDTH_DEFAULT,\n\tMIN_WIDTH,\n\tisPercentageUnit,\n} from './utils.js';\n\n// Used to calculate border radius adjustment to avoid \"fat\" corners when\n// button is placed inside wrapper.\nconst DEFAULT_INNER_PADDING = '4px';\n\nconst BUTTON_BEHAVIOR_EXPAND = 'expand-searchfield';\n\nexport default function SearchEdit( {\n\tclassName,\n\tattributes,\n\tsetAttributes,\n\ttoggleSelection,\n\tisSelected,\n\tclientId,\n} ) {\n\tconst {\n\t\tlabel,\n\t\tshowLabel,\n\t\tplaceholder,\n\t\twidth,\n\t\twidthUnit,\n\t\talign,\n\t\tbuttonText,\n\t\tbuttonPosition,\n\t\tbuttonUseIcon,\n\t\tbuttonBehavior,\n\t\tisSearchFieldHidden,\n\t\tstyle,\n\t} = attributes;\n\n\tconst insertedInNavigationBlock = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParentsByBlockName, wasBlockJustInserted } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn (\n\t\t\t\t!! getBlockParentsByBlockName( clientId, 'core/navigation' )\n\t\t\t\t\t?.length && wasBlockJustInserted( clientId )\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tif ( insertedInNavigationBlock ) {\n\t\t// This side-effect should not create an undo level.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\tsetAttributes( {\n\t\t\tshowLabel: false,\n\t\t\tbuttonUseIcon: true,\n\t\t\tbuttonPosition: 'button-inside',\n\t\t} );\n\t}\n\n\tconst borderRadius = style?.border?.radius;\n\tconst borderProps = useBorderProps( attributes );\n\n\t// Check for old deprecated numerical border radius. Done as a separate\n\t// check so that a borderRadius style won't overwrite the longhand\n\t// per-corner styles.\n\tif ( typeof borderRadius === 'number' ) {\n\t\tborderProps.style.borderRadius = `${ borderRadius }px`;\n\t}\n\n\tconst colorProps = useColorProps( attributes );\n\tconst fluidTypographySettings = useSetting( 'typography.fluid' );\n\tconst layout = useSetting( 'layout' );\n\tconst typographyProps = useTypographyProps( attributes, {\n\t\ttypography: {\n\t\t\tfluid: fluidTypographySettings,\n\t\t},\n\t\tlayout: {\n\t\t\twideSize: layout?.wideSize,\n\t\t},\n\t} );\n\tconst unitControlInstanceId = useInstanceId( UnitControl );\n\tconst unitControlInputId = `wp-block-search__width-${ unitControlInstanceId }`;\n\tconst isButtonPositionInside = 'button-inside' === buttonPosition;\n\tconst isButtonPositionOutside = 'button-outside' === buttonPosition;\n\tconst hasNoButton = 'no-button' === buttonPosition;\n\tconst hasOnlyButton = 'button-only' === buttonPosition;\n\tconst searchFieldRef = useRef();\n\tconst buttonRef = useRef();\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: [ '%', 'px' ],\n\t\tdefaultValues: { '%': PC_WIDTH_DEFAULT, px: PX_WIDTH_DEFAULT },\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( hasOnlyButton && ! isSelected ) {\n\t\t\tsetAttributes( {\n\t\t\t\tisSearchFieldHidden: true,\n\t\t\t} );\n\t\t}\n\t}, [ hasOnlyButton, isSelected, setAttributes ] );\n\n\t// Show the search field when width changes.\n\tuseEffect( () => {\n\t\tif ( ! hasOnlyButton || ! isSelected ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\tisSearchFieldHidden: false,\n\t\t} );\n\t}, [ hasOnlyButton, isSelected, setAttributes, width ] );\n\n\tconst getBlockClassNames = () => {\n\t\treturn classnames(\n\t\t\tclassName,\n\t\t\tisButtonPositionInside\n\t\t\t\t? 'wp-block-search__button-inside'\n\t\t\t\t: undefined,\n\t\t\tisButtonPositionOutside\n\t\t\t\t? 'wp-block-search__button-outside'\n\t\t\t\t: undefined,\n\t\t\thasNoButton ? 'wp-block-search__no-button' : undefined,\n\t\t\thasOnlyButton ? 'wp-block-search__button-only' : undefined,\n\t\t\t! buttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__text-button'\n\t\t\t\t: undefined,\n\t\t\tbuttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__icon-button'\n\t\t\t\t: undefined,\n\t\t\thasOnlyButton && BUTTON_BEHAVIOR_EXPAND === buttonBehavior\n\t\t\t\t? 'wp-block-search__button-behavior-expand'\n\t\t\t\t: undefined,\n\t\t\thasOnlyButton && isSearchFieldHidden\n\t\t\t\t? 'wp-block-search__searchfield-hidden'\n\t\t\t\t: undefined\n\t\t);\n\t};\n\n\tconst buttonPositionControls = [\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Button outside' ),\n\t\t\tisActive: buttonPosition === 'button-outside',\n\t\t\ticon: buttonOutside,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'button-outside',\n\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Button inside' ),\n\t\t\tisActive: buttonPosition === 'button-inside',\n\t\t\ticon: buttonInside,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'button-inside',\n\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'No button' ),\n\t\t\tisActive: buttonPosition === 'no-button',\n\t\t\ticon: noButton,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'no-button',\n\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Button only' ),\n\t\t\tisActive: buttonPosition === 'button-only',\n\t\t\ticon: buttonOnly,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'button-only',\n\t\t\t\t\tisSearchFieldHidden: true,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t];\n\n\tconst getButtonPositionIcon = () => {\n\t\tswitch ( buttonPosition ) {\n\t\t\tcase 'button-inside':\n\t\t\t\treturn buttonInside;\n\t\t\tcase 'button-outside':\n\t\t\t\treturn buttonOutside;\n\t\t\tcase 'no-button':\n\t\t\t\treturn noButton;\n\t\t\tcase 'button-only':\n\t\t\t\treturn buttonOnly;\n\t\t}\n\t};\n\n\tconst getResizableSides = () => {\n\t\tif ( hasOnlyButton ) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tright: align !== 'right',\n\t\t\tleft: align === 'right',\n\t\t};\n\t};\n\n\tconst renderTextField = () => {\n\t\t// If the input is inside the wrapper, the wrapper gets the border color styles/classes, not the input control.\n\t\tconst textFieldClasses = classnames(\n\t\t\t'wp-block-search__input',\n\t\t\tisButtonPositionInside ? undefined : borderProps.className,\n\t\t\ttypographyProps.className\n\t\t);\n\t\tconst textFieldStyles = {\n\t\t\t...( isButtonPositionInside\n\t\t\t\t? { borderRadius }\n\t\t\t\t: borderProps.style ),\n\t\t\t...typographyProps.style,\n\t\t\ttextDecoration: undefined,\n\t\t};\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\ttype=\"search\"\n\t\t\t\tclassName={ textFieldClasses }\n\t\t\t\tstyle={ textFieldStyles }\n\t\t\t\taria-label={ __( 'Optional placeholder text' ) }\n\t\t\t\t// We hide the placeholder field's placeholder when there is a value. This\n\t\t\t\t// stops screen readers from reading the placeholder field's placeholder\n\t\t\t\t// which is confusing.\n\t\t\t\tplaceholder={\n\t\t\t\t\tplaceholder ? undefined : __( 'Optional placeholder…' )\n\t\t\t\t}\n\t\t\t\tvalue={ placeholder }\n\t\t\t\tonChange={ ( event ) =>\n\t\t\t\t\tsetAttributes( { placeholder: event.target.value } )\n\t\t\t\t}\n\t\t\t\tref={ searchFieldRef }\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst renderButton = () => {\n\t\t// If the button is inside the wrapper, the wrapper gets the border color styles/classes, not the button.\n\t\tconst buttonClasses = classnames(\n\t\t\t'wp-block-search__button',\n\t\t\tcolorProps.className,\n\t\t\ttypographyProps.className,\n\t\t\tisButtonPositionInside ? undefined : borderProps.className,\n\t\t\tbuttonUseIcon ? 'has-icon' : undefined,\n\t\t\t__experimentalGetElementClassName( 'button' )\n\t\t);\n\t\tconst buttonStyles = {\n\t\t\t...colorProps.style,\n\t\t\t...typographyProps.style,\n\t\t\t...( isButtonPositionInside\n\t\t\t\t? { borderRadius }\n\t\t\t\t: borderProps.style ),\n\t\t};\n\t\tconst handleButtonClick = () => {\n\t\t\tif ( hasOnlyButton && BUTTON_BEHAVIOR_EXPAND === buttonBehavior ) {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tisSearchFieldHidden: ! isSearchFieldHidden,\n\t\t\t\t} );\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ buttonUseIcon && (\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName={ buttonClasses }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\tbuttonText\n\t\t\t\t\t\t\t\t? stripHTML( buttonText )\n\t\t\t\t\t\t\t\t: __( 'Search' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={ handleButtonClick }\n\t\t\t\t\t\tref={ buttonRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon icon={ search } />\n\t\t\t\t\t</button>\n\t\t\t\t) }\n\n\t\t\t\t{ ! buttonUseIcon && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tclassName={ buttonClasses }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taria-label={ __( 'Button text' ) }\n\t\t\t\t\t\tplaceholder={ __( 'Add button text…' ) }\n\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\tvalue={ buttonText }\n\t\t\t\t\t\tonChange={ ( html ) =>\n\t\t\t\t\t\t\tsetAttributes( { buttonText: html } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={ handleButtonClick }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t};\n\n\tconst controls = (\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\ttitle={ __( 'Toggle search label' ) }\n\t\t\t\t\t\ticon={ toggleLabel }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowLabel: ! showLabel,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tclassName={ showLabel ? 'is-pressed' : undefined }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\t\ticon={ getButtonPositionIcon() }\n\t\t\t\t\t\tlabel={ __( 'Change button position' ) }\n\t\t\t\t\t\tcontrols={ buttonPositionControls }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! hasNoButton && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\ttitle={ __( 'Use button with icon' ) }\n\t\t\t\t\t\t\ticon={ buttonWithIcon }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tbuttonUseIcon: ! buttonUseIcon,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\tbuttonUseIcon ? 'is-pressed' : undefined\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</ToolbarGroup>\n\t\t\t</BlockControls>\n\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Display Settings' ) }>\n\t\t\t\t\t<BaseControl\n\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\tid={ unitControlInputId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tid={ unitControlInputId }\n\t\t\t\t\t\t\tmin={\n\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit ) ? 0 : MIN_WIDTH\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit ) ? 100 : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\tonChange={ ( newWidth ) => {\n\t\t\t\t\t\t\t\tconst filteredWidth =\n\t\t\t\t\t\t\t\t\twidthUnit === '%' &&\n\t\t\t\t\t\t\t\t\tparseInt( newWidth, 10 ) > 100\n\t\t\t\t\t\t\t\t\t\t? 100\n\t\t\t\t\t\t\t\t\t\t: newWidth;\n\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\twidth: parseInt( filteredWidth, 10 ),\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonUnitChange={ ( newUnit ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t'%' === newUnit\n\t\t\t\t\t\t\t\t\t\t\t? PC_WIDTH_DEFAULT\n\t\t\t\t\t\t\t\t\t\t\t: PX_WIDTH_DEFAULT,\n\t\t\t\t\t\t\t\t\twidthUnit: newUnit,\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__unstableInputWidth={ '80px' }\n\t\t\t\t\t\t\tvalue={ `${ width }${ widthUnit }` }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<ButtonGroup\n\t\t\t\t\t\t\tclassName=\"wp-block-search__components-button-group\"\n\t\t\t\t\t\t\taria-label={ __( 'Percentage Width' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ [ 25, 50, 75, 100 ].map( ( widthValue ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tkey={ widthValue }\n\t\t\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\t\twidthValue === width &&\n\t\t\t\t\t\t\t\t\t\t\twidthUnit === '%'\n\t\t\t\t\t\t\t\t\t\t\t\t? 'primary'\n\t\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\twidth: widthValue,\n\t\t\t\t\t\t\t\t\t\t\t\twidthUnit: '%',\n\t\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ widthValue }%\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</ButtonGroup>\n\t\t\t\t\t</BaseControl>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\n\tconst padBorderRadius = ( radius ) =>\n\t\tradius ? `calc(${ radius } + ${ DEFAULT_INNER_PADDING })` : undefined;\n\n\tconst getWrapperStyles = () => {\n\t\tconst styles = isButtonPositionInside\n\t\t\t? borderProps.style\n\t\t\t: {\n\t\t\t\t\tborderRadius: borderProps.style?.borderRadius,\n\t\t\t\t\tborderTopLeftRadius: borderProps.style?.borderTopLeftRadius,\n\t\t\t\t\tborderTopRightRadius:\n\t\t\t\t\t\tborderProps.style?.borderTopRightRadius,\n\t\t\t\t\tborderBottomLeftRadius:\n\t\t\t\t\t\tborderProps.style?.borderBottomLeftRadius,\n\t\t\t\t\tborderBottomRightRadius:\n\t\t\t\t\t\tborderProps.style?.borderBottomRightRadius,\n\t\t\t };\n\n\t\tconst isNonZeroBorderRadius =\n\t\t\tborderRadius !== undefined && parseInt( borderRadius, 10 ) !== 0;\n\n\t\tif ( isButtonPositionInside && isNonZeroBorderRadius ) {\n\t\t\t// We have button inside wrapper and a border radius value to apply.\n\t\t\t// Add default padding so we don't get \"fat\" corners.\n\t\t\t//\n\t\t\t// CSS calc() is used here to support non-pixel units. The inline\n\t\t\t// style using calc() will only apply if both values have units.\n\n\t\t\tif ( typeof borderRadius === 'object' ) {\n\t\t\t\t// Individual corner border radii present.\n\t\t\t\tconst { topLeft, topRight, bottomLeft, bottomRight } =\n\t\t\t\t\tborderRadius;\n\n\t\t\t\treturn {\n\t\t\t\t\t...styles,\n\t\t\t\t\tborderTopLeftRadius: padBorderRadius( topLeft ),\n\t\t\t\t\tborderTopRightRadius: padBorderRadius( topRight ),\n\t\t\t\t\tborderBottomLeftRadius: padBorderRadius( bottomLeft ),\n\t\t\t\t\tborderBottomRightRadius: padBorderRadius( bottomRight ),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// The inline style using calc() will only apply if both values\n\t\t\t// supplied to calc() have units. Deprecated block's may have\n\t\t\t// unitless integer.\n\t\t\tconst radius = Number.isInteger( borderRadius )\n\t\t\t\t? `${ borderRadius }px`\n\t\t\t\t: borderRadius;\n\n\t\t\tstyles.borderRadius = `calc(${ radius } + ${ DEFAULT_INNER_PADDING })`;\n\t\t}\n\n\t\treturn styles;\n\t};\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: getBlockClassNames(),\n\t\tstyle: {\n\t\t\t...typographyProps.style,\n\t\t\t// Input opts out of text decoration.\n\t\t\ttextDecoration: undefined,\n\t\t},\n\t} );\n\n\tconst labelClassnames = classnames(\n\t\t'wp-block-search__label',\n\t\ttypographyProps.className\n\t);\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t{ controls }\n\n\t\t\t{ showLabel && (\n\t\t\t\t<RichText\n\t\t\t\t\tclassName={ labelClassnames }\n\t\t\t\t\taria-label={ __( 'Label text' ) }\n\t\t\t\t\tplaceholder={ __( 'Add label…' ) }\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\tonChange={ ( html ) => setAttributes( { label: html } ) }\n\t\t\t\t\tstyle={ typographyProps.style }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t<ResizableBox\n\t\t\t\tsize={ {\n\t\t\t\t\twidth: `${ width }${ widthUnit }`,\n\t\t\t\t} }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'wp-block-search__inside-wrapper',\n\t\t\t\t\tisButtonPositionInside ? borderProps.className : undefined\n\t\t\t\t) }\n\t\t\t\tstyle={ getWrapperStyles() }\n\t\t\t\tminWidth={ MIN_WIDTH }\n\t\t\t\tenable={ getResizableSides() }\n\t\t\t\tonResizeStart={ ( event, direction, elt ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( elt.offsetWidth, 10 ),\n\t\t\t\t\t\twidthUnit: 'px',\n\t\t\t\t\t} );\n\t\t\t\t\ttoggleSelection( false );\n\t\t\t\t} }\n\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( width + delta.width, 10 ),\n\t\t\t\t\t} );\n\t\t\t\t\ttoggleSelection( true );\n\t\t\t\t} }\n\t\t\t\tshowHandle={ isSelected }\n\t\t\t>\n\t\t\t\t{ ( isButtonPositionInside ||\n\t\t\t\t\tisButtonPositionOutside ||\n\t\t\t\t\thasOnlyButton ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ renderTextField() }\n\t\t\t\t\t\t{ renderButton() }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t{ hasNoButton && renderTextField() }\n\t\t\t</ResizableBox>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,aAAa,EACbC,aAAa,EACbC,iBAAiB,EACjBC,QAAQ,EACRC,4BAA4B,IAAIC,cAAc,EAC9CC,2BAA2B,IAAIC,aAAa,EAC5CC,6BAA6B,IAAIC,kBAAkB,EACnDC,KAAK,IAAIC,gBAAgB,EACzBC,iCAAiC,EACjCC,UAAU,QACJ,yBAAyB;AAChC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AACtD,SACCC,mBAAmB,EACnBC,YAAY,EACZC,MAAM,EACNC,WAAW,EACXC,aAAa,EACbC,YAAY,EACZC,SAAS,EACTC,WAAW,EACXC,4BAA4B,IAAIC,cAAc,EAC9CC,yBAAyB,IAAIC,WAAW,QAClC,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,IAAI,EAAEC,MAAM,QAAQ,kBAAkB;AAC/C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,mBAAmB,IAA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AsB,IACzBC,uBAAuB,IACvBE,aAAa,KACbuB,aAAA,CAAAW,QAAA,QACGf,eAAe,CAAC,CAAC,EACjBW,YAAY,CAAC,CACd,CACF,EAEC/B,WAAW,IAAIoB,eAAe,CAAC,CACpB,CACV,CAAC;AAER"}
@@ -4,7 +4,6 @@
4
4
  export const PC_WIDTH_DEFAULT = 50;
5
5
  export const PX_WIDTH_DEFAULT = 350;
6
6
  export const MIN_WIDTH = 220;
7
- export const MIN_WIDTH_UNIT = 'px';
8
7
 
9
8
  /**
10
9
  * Returns a boolean whether passed unit is percentage
@@ -1 +1 @@
1
- {"version":3,"names":["PC_WIDTH_DEFAULT","PX_WIDTH_DEFAULT","MIN_WIDTH","MIN_WIDTH_UNIT","isPercentageUnit","unit"],"sources":["@wordpress/block-library/src/search/utils.js"],"sourcesContent":["/**\n * Constants\n */\nexport const PC_WIDTH_DEFAULT = 50;\nexport const PX_WIDTH_DEFAULT = 350;\nexport const MIN_WIDTH = 220;\nexport const MIN_WIDTH_UNIT = 'px';\n\n/**\n * Returns a boolean whether passed unit is percentage\n *\n * @param {string} unit Block width unit.\n *\n * @return {boolean} \tWhether unit is '%'.\n */\nexport function isPercentageUnit( unit ) {\n\treturn unit === '%';\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,MAAMA,gBAAgB,GAAG,EAAE;AAClC,OAAO,MAAMC,gBAAgB,GAAG,GAAG;AACnC,OAAO,MAAMC,SAAS,GAAG,GAAG;AAC5B,OAAO,MAAMC,cAAc,GAAG,IAAI;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAEC,IAAI,EAAG;EACxC,OAAOA,IAAI,KAAK,GAAG;AACpB"}
1
+ {"version":3,"names":["PC_WIDTH_DEFAULT","PX_WIDTH_DEFAULT","MIN_WIDTH","isPercentageUnit","unit"],"sources":["@wordpress/block-library/src/search/utils.js"],"sourcesContent":["/**\n * Constants\n */\nexport const PC_WIDTH_DEFAULT = 50;\nexport const PX_WIDTH_DEFAULT = 350;\nexport const MIN_WIDTH = 220;\n\n/**\n * Returns a boolean whether passed unit is percentage\n *\n * @param {string} unit Block width unit.\n *\n * @return {boolean} \tWhether unit is '%'.\n */\nexport function isPercentageUnit( unit ) {\n\treturn unit === '%';\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,MAAMA,gBAAgB,GAAG,EAAE;AAClC,OAAO,MAAMC,gBAAgB,GAAG,GAAG;AACnC,OAAO,MAAMC,SAAS,GAAG,GAAG;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAEC,IAAI,EAAG;EACxC,OAAOA,IAAI,KAAK,GAAG;AACpB"}
@@ -122,9 +122,7 @@ const SocialLinkEdit = ({
122
122
  __('%s has URL set'), socialLinkName) : sprintf(
123
123
  // translators: %s: social link name e.g: "Instagram".
124
124
  __('%s has no URL set'), socialLinkName);
125
- return createElement(View, {
126
- style: styles.container
127
- }, isSelected && createElement(Fragment, null, createElement(BlockControls, null, createElement(ToolbarGroup, null, createElement(ToolbarButton, {
125
+ return createElement(View, null, isSelected && createElement(Fragment, null, createElement(BlockControls, null, createElement(ToolbarGroup, null, createElement(ToolbarButton, {
128
126
  title: sprintf(
129
127
  // translators: %s: social link name e.g: "Instagram".
130
128
  __('Add link to %s'), socialLinkName),
@@ -1 +1 @@
1
- {"version":3,"names":["View","Animated","Easing","TouchableWithoutFeedback","BlockControls","store","blockEditorStore","useEffect","useState","useRef","useCallback","ToolbarGroup","ToolbarButton","LinkSettingsNavigation","compose","usePreferredColorSchemeStyle","__","sprintf","link","Icon","withSelect","getIconBySite","getNameBySite","styles","DEFAULT_ACTIVE_ICON_STYLES","backgroundColor","color","DEFAULT_INACTIVE_ICON_STYLES","ANIMATION_DELAY","ANIMATION_DURATION","linkSettingsOptions","url","label","placeholder","autoFocus","linkLabel","footer","SocialLinkEdit","attributes","setAttributes","isSelected","onFocus","name","service","isLinkSheetVisible","setIsLinkSheetVisible","hasUrl","setHasUrl","activeIcon","inactiveIcon","inactiveIconDark","animatedValue","Value","current","IconComponent","socialLinkName","setValue","animateColors","interpolationColors","interpolate","inputRange","outputRange","stroke","sequence","delay","timing","toValue","duration","easing","circle","useNativeDriver","start","onCloseSettingsSheet","onOpenSettingsSheet","onEmptyURL","onIconPress","accessibilityHint","createElement","style","container","Fragment","title","icon","onClick","isActive","isVisible","rel","onClose","options","withBottomSheet","onPress","accessibilityRole","accessibilityLabel","iconContainer","animated","select","clientId","getBlock","block","substring"],"sources":["@wordpress/block-library/src/social-link/edit.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Animated, Easing, TouchableWithoutFeedback } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useEffect, useState, useRef, useCallback } from '@wordpress/element';\nimport {\n\tToolbarGroup,\n\tToolbarButton,\n\tLinkSettingsNavigation,\n} from '@wordpress/components';\nimport { compose, usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { link, Icon } from '@wordpress/icons';\nimport { withSelect } from '@wordpress/data';\n/**\n * Internal dependencies\n */\nimport { getIconBySite, getNameBySite } from './social-list';\nimport styles from './editor.scss';\n\nconst DEFAULT_ACTIVE_ICON_STYLES = {\n\tbackgroundColor: '#f0f0f0',\n\tcolor: '#444',\n};\nconst DEFAULT_INACTIVE_ICON_STYLES = {\n\tbackgroundColor: '#0000003f',\n\tcolor: '#fff',\n};\nconst ANIMATION_DELAY = 300;\nconst ANIMATION_DURATION = 400;\n\nconst linkSettingsOptions = {\n\turl: {\n\t\tlabel: __( 'URL' ),\n\t\tplaceholder: __( 'Add URL' ),\n\t\tautoFocus: true,\n\t},\n\tlinkLabel: {\n\t\tlabel: __( 'Link label' ),\n\t\tplaceholder: __( 'None' ),\n\t},\n\tfooter: {\n\t\tlabel: __( 'Briefly describe the link to help screen reader user' ),\n\t},\n};\n\nconst SocialLinkEdit = ( {\n\tattributes,\n\tsetAttributes,\n\tisSelected,\n\tonFocus,\n\tname,\n} ) => {\n\tconst { url, service = name } = attributes;\n\tconst [ isLinkSheetVisible, setIsLinkSheetVisible ] = useState( false );\n\tconst [ hasUrl, setHasUrl ] = useState( !! url );\n\tconst activeIcon =\n\t\tstyles[ `wp-social-link-${ service }` ] ||\n\t\tstyles[ `wp-social-link` ] ||\n\t\tDEFAULT_ACTIVE_ICON_STYLES;\n\tconst inactiveIcon =\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles.inactiveIcon,\n\t\t\tstyles.inactiveIconDark\n\t\t) || DEFAULT_INACTIVE_ICON_STYLES;\n\n\tconst animatedValue = useRef( new Animated.Value( 0 ) ).current;\n\n\tconst IconComponent = getIconBySite( service )();\n\tconst socialLinkName = getNameBySite( service );\n\n\t// When new social icon is added link sheet is opened automatically.\n\tuseEffect( () => {\n\t\tif ( isSelected && ! url ) {\n\t\t\tsetIsLinkSheetVisible( true );\n\t\t}\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( ! url ) {\n\t\t\tsetHasUrl( false );\n\t\t\tanimatedValue.setValue( 0 );\n\t\t} else if ( url ) {\n\t\t\tanimateColors();\n\t\t}\n\t}, [ url ] );\n\n\tconst interpolationColors = {\n\t\tbackgroundColor: animatedValue.interpolate( {\n\t\t\tinputRange: [ 0, 1 ],\n\t\t\toutputRange: [\n\t\t\t\tinactiveIcon.backgroundColor,\n\t\t\t\tactiveIcon.backgroundColor,\n\t\t\t],\n\t\t} ),\n\t\tcolor: animatedValue.interpolate( {\n\t\t\tinputRange: [ 0, 1 ],\n\t\t\toutputRange: [ inactiveIcon.color, activeIcon.color ],\n\t\t} ),\n\t\tstroke: '',\n\t};\n\n\tconst { backgroundColor, color, stroke } = hasUrl\n\t\t? activeIcon\n\t\t: interpolationColors;\n\n\tfunction animateColors() {\n\t\tAnimated.sequence( [\n\t\t\tAnimated.delay( ANIMATION_DELAY ),\n\t\t\tAnimated.timing( animatedValue, {\n\t\t\t\ttoValue: 1,\n\t\t\t\tduration: ANIMATION_DURATION,\n\t\t\t\teasing: Easing.circle,\n\t\t\t\tuseNativeDriver: false,\n\t\t\t} ),\n\t\t] ).start( () => setHasUrl( true ) );\n\t}\n\n\tconst onCloseSettingsSheet = useCallback( () => {\n\t\tsetIsLinkSheetVisible( false );\n\t}, [] );\n\n\tconst onOpenSettingsSheet = useCallback( () => {\n\t\tsetIsLinkSheetVisible( true );\n\t}, [] );\n\n\tconst onEmptyURL = useCallback( () => {\n\t\tanimatedValue.setValue( 0 );\n\t\tsetHasUrl( false );\n\t}, [ animatedValue ] );\n\n\tfunction onIconPress() {\n\t\tif ( isSelected ) {\n\t\t\tsetIsLinkSheetVisible( true );\n\t\t} else {\n\t\t\tonFocus();\n\t\t}\n\t}\n\n\tconst accessibilityHint = url\n\t\t? sprintf(\n\t\t\t\t// translators: %s: social link name e.g: \"Instagram\".\n\t\t\t\t__( '%s has URL set' ),\n\t\t\t\tsocialLinkName\n\t\t )\n\t\t: sprintf(\n\t\t\t\t// translators: %s: social link name e.g: \"Instagram\".\n\t\t\t\t__( '%s has no URL set' ),\n\t\t\t\tsocialLinkName\n\t\t );\n\n\treturn (\n\t\t<View style={ styles.container }>\n\t\t\t{ isSelected && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls>\n\t\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\ttitle={ sprintf(\n\t\t\t\t\t\t\t\t\t// translators: %s: social link name e.g: \"Instagram\".\n\t\t\t\t\t\t\t\t\t__( 'Add link to %s' ),\n\t\t\t\t\t\t\t\t\tsocialLinkName\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ticon={ link }\n\t\t\t\t\t\t\t\tonClick={ onOpenSettingsSheet }\n\t\t\t\t\t\t\t\tisActive={ url }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t\t<LinkSettingsNavigation\n\t\t\t\t\t\tisVisible={ isLinkSheetVisible }\n\t\t\t\t\t\turl={ attributes.url }\n\t\t\t\t\t\tlabel={ attributes.label }\n\t\t\t\t\t\trel={ attributes.rel }\n\t\t\t\t\t\tonEmptyURL={ onEmptyURL }\n\t\t\t\t\t\tonClose={ onCloseSettingsSheet }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\toptions={ linkSettingsOptions }\n\t\t\t\t\t\twithBottomSheet\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\n\t\t\t<TouchableWithoutFeedback\n\t\t\t\tonPress={ onIconPress }\n\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\taccessibilityLabel={ sprintf(\n\t\t\t\t\t// translators: %s: social link name e.g: \"Instagram\".\n\t\t\t\t\t__( '%s social icon' ),\n\t\t\t\t\tsocialLinkName\n\t\t\t\t) }\n\t\t\t\taccessibilityHint={ accessibilityHint }\n\t\t\t>\n\t\t\t\t<Animated.View\n\t\t\t\t\tstyle={ [ styles.iconContainer, { backgroundColor } ] }\n\t\t\t\t>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tanimated\n\t\t\t\t\t\ticon={ IconComponent }\n\t\t\t\t\t\tstyle={ { stroke, color } }\n\t\t\t\t\t/>\n\t\t\t\t</Animated.View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t</View>\n\t);\n};\n\nexport default compose( [\n\twithSelect( ( select, { clientId } ) => {\n\t\tconst { getBlock } = select( blockEditorStore );\n\n\t\tconst block = getBlock( clientId );\n\t\tconst name = block?.name.substring( 17 );\n\n\t\treturn {\n\t\t\tname,\n\t\t};\n\t} ),\n] )( SocialLinkEdit );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,wBAAwB,QAAQ,cAAc;;AAE/E;AACA;AACA;AACA,SACCC,aAAa,E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,CAACsE,aAAa,EAAE;MAAEpE;IAAgB,CAAC;EAAI,GAEvDoD,aAAA,CAAC1D,IAAI;IACJ2E,QAAQ;IACRZ,IAAI,EAAG5B,aAAe;IACtBwB,KAAK,EAAG;MAAEhB,MAAM;MAAEpC;IAAM;EAAG,CAC3B,CACa,CACU,CACrB,CAAC;AAET,CAAC;AAED,eAAeZ,OAAO,CAAE,CACvBM,UAAU,CAAE,CAAE2E,MAAM,EAAE;EAAEC;AAAS,CAAC,KAAM;EACvC,MAAM;IAAEC;EAAS,CAAC,GAAGF,MAAM,CAAEzF,gBAAiB,CAAC;EAE/C,MAAM4F,KAAK,GAAGD,QAAQ,CAAED,QAAS,CAAC;EAClC,MAAMtD,IAAI,GAAGwD,KAAK,EAAExD,IAAI,CAACyD,SAAS,CAAE,EAAG,CAAC;EAExC,OAAO;IACNzD;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAEL,cAAe,CAAC"}
1
+ {"version":3,"names":["View","Animated","Easing","TouchableWithoutFeedback","BlockControls","store","blockEditorStore","useEffect","useState","useRef","useCallback","ToolbarGroup","ToolbarButton","LinkSettingsNavigation","compose","usePreferredColorSchemeStyle","__","sprintf","link","Icon","withSelect","getIconBySite","getNameBySite","styles","DEFAULT_ACTIVE_ICON_STYLES","backgroundColor","color","DEFAULT_INACTIVE_ICON_STYLES","ANIMATION_DELAY","ANIMATION_DURATION","linkSettingsOptions","url","label","placeholder","autoFocus","linkLabel","footer","SocialLinkEdit","attributes","setAttributes","isSelected","onFocus","name","service","isLinkSheetVisible","setIsLinkSheetVisible","hasUrl","setHasUrl","activeIcon","inactiveIcon","inactiveIconDark","animatedValue","Value","current","IconComponent","socialLinkName","setValue","animateColors","interpolationColors","interpolate","inputRange","outputRange","stroke","sequence","delay","timing","toValue","duration","easing","circle","useNativeDriver","start","onCloseSettingsSheet","onOpenSettingsSheet","onEmptyURL","onIconPress","accessibilityHint","createElement","Fragment","title","icon","onClick","isActive","isVisible","rel","onClose","options","withBottomSheet","onPress","accessibilityRole","accessibilityLabel","style","iconContainer","animated","select","clientId","getBlock","block","substring"],"sources":["@wordpress/block-library/src/social-link/edit.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Animated, Easing, TouchableWithoutFeedback } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useEffect, useState, useRef, useCallback } from '@wordpress/element';\nimport {\n\tToolbarGroup,\n\tToolbarButton,\n\tLinkSettingsNavigation,\n} from '@wordpress/components';\nimport { compose, usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { link, Icon } from '@wordpress/icons';\nimport { withSelect } from '@wordpress/data';\n/**\n * Internal dependencies\n */\nimport { getIconBySite, getNameBySite } from './social-list';\nimport styles from './editor.scss';\n\nconst DEFAULT_ACTIVE_ICON_STYLES = {\n\tbackgroundColor: '#f0f0f0',\n\tcolor: '#444',\n};\nconst DEFAULT_INACTIVE_ICON_STYLES = {\n\tbackgroundColor: '#0000003f',\n\tcolor: '#fff',\n};\nconst ANIMATION_DELAY = 300;\nconst ANIMATION_DURATION = 400;\n\nconst linkSettingsOptions = {\n\turl: {\n\t\tlabel: __( 'URL' ),\n\t\tplaceholder: __( 'Add URL' ),\n\t\tautoFocus: true,\n\t},\n\tlinkLabel: {\n\t\tlabel: __( 'Link label' ),\n\t\tplaceholder: __( 'None' ),\n\t},\n\tfooter: {\n\t\tlabel: __( 'Briefly describe the link to help screen reader user' ),\n\t},\n};\n\nconst SocialLinkEdit = ( {\n\tattributes,\n\tsetAttributes,\n\tisSelected,\n\tonFocus,\n\tname,\n} ) => {\n\tconst { url, service = name } = attributes;\n\tconst [ isLinkSheetVisible, setIsLinkSheetVisible ] = useState( false );\n\tconst [ hasUrl, setHasUrl ] = useState( !! url );\n\tconst activeIcon =\n\t\tstyles[ `wp-social-link-${ service }` ] ||\n\t\tstyles[ `wp-social-link` ] ||\n\t\tDEFAULT_ACTIVE_ICON_STYLES;\n\tconst inactiveIcon =\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles.inactiveIcon,\n\t\t\tstyles.inactiveIconDark\n\t\t) || DEFAULT_INACTIVE_ICON_STYLES;\n\n\tconst animatedValue = useRef( new Animated.Value( 0 ) ).current;\n\n\tconst IconComponent = getIconBySite( service )();\n\tconst socialLinkName = getNameBySite( service );\n\n\t// When new social icon is added link sheet is opened automatically.\n\tuseEffect( () => {\n\t\tif ( isSelected && ! url ) {\n\t\t\tsetIsLinkSheetVisible( true );\n\t\t}\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( ! url ) {\n\t\t\tsetHasUrl( false );\n\t\t\tanimatedValue.setValue( 0 );\n\t\t} else if ( url ) {\n\t\t\tanimateColors();\n\t\t}\n\t}, [ url ] );\n\n\tconst interpolationColors = {\n\t\tbackgroundColor: animatedValue.interpolate( {\n\t\t\tinputRange: [ 0, 1 ],\n\t\t\toutputRange: [\n\t\t\t\tinactiveIcon.backgroundColor,\n\t\t\t\tactiveIcon.backgroundColor,\n\t\t\t],\n\t\t} ),\n\t\tcolor: animatedValue.interpolate( {\n\t\t\tinputRange: [ 0, 1 ],\n\t\t\toutputRange: [ inactiveIcon.color, activeIcon.color ],\n\t\t} ),\n\t\tstroke: '',\n\t};\n\n\tconst { backgroundColor, color, stroke } = hasUrl\n\t\t? activeIcon\n\t\t: interpolationColors;\n\n\tfunction animateColors() {\n\t\tAnimated.sequence( [\n\t\t\tAnimated.delay( ANIMATION_DELAY ),\n\t\t\tAnimated.timing( animatedValue, {\n\t\t\t\ttoValue: 1,\n\t\t\t\tduration: ANIMATION_DURATION,\n\t\t\t\teasing: Easing.circle,\n\t\t\t\tuseNativeDriver: false,\n\t\t\t} ),\n\t\t] ).start( () => setHasUrl( true ) );\n\t}\n\n\tconst onCloseSettingsSheet = useCallback( () => {\n\t\tsetIsLinkSheetVisible( false );\n\t}, [] );\n\n\tconst onOpenSettingsSheet = useCallback( () => {\n\t\tsetIsLinkSheetVisible( true );\n\t}, [] );\n\n\tconst onEmptyURL = useCallback( () => {\n\t\tanimatedValue.setValue( 0 );\n\t\tsetHasUrl( false );\n\t}, [ animatedValue ] );\n\n\tfunction onIconPress() {\n\t\tif ( isSelected ) {\n\t\t\tsetIsLinkSheetVisible( true );\n\t\t} else {\n\t\t\tonFocus();\n\t\t}\n\t}\n\n\tconst accessibilityHint = url\n\t\t? sprintf(\n\t\t\t\t// translators: %s: social link name e.g: \"Instagram\".\n\t\t\t\t__( '%s has URL set' ),\n\t\t\t\tsocialLinkName\n\t\t )\n\t\t: sprintf(\n\t\t\t\t// translators: %s: social link name e.g: \"Instagram\".\n\t\t\t\t__( '%s has no URL set' ),\n\t\t\t\tsocialLinkName\n\t\t );\n\n\treturn (\n\t\t<View>\n\t\t\t{ isSelected && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls>\n\t\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\ttitle={ sprintf(\n\t\t\t\t\t\t\t\t\t// translators: %s: social link name e.g: \"Instagram\".\n\t\t\t\t\t\t\t\t\t__( 'Add link to %s' ),\n\t\t\t\t\t\t\t\t\tsocialLinkName\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ticon={ link }\n\t\t\t\t\t\t\t\tonClick={ onOpenSettingsSheet }\n\t\t\t\t\t\t\t\tisActive={ url }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t\t<LinkSettingsNavigation\n\t\t\t\t\t\tisVisible={ isLinkSheetVisible }\n\t\t\t\t\t\turl={ attributes.url }\n\t\t\t\t\t\tlabel={ attributes.label }\n\t\t\t\t\t\trel={ attributes.rel }\n\t\t\t\t\t\tonEmptyURL={ onEmptyURL }\n\t\t\t\t\t\tonClose={ onCloseSettingsSheet }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\toptions={ linkSettingsOptions }\n\t\t\t\t\t\twithBottomSheet\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\n\t\t\t<TouchableWithoutFeedback\n\t\t\t\tonPress={ onIconPress }\n\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\taccessibilityLabel={ sprintf(\n\t\t\t\t\t// translators: %s: social link name e.g: \"Instagram\".\n\t\t\t\t\t__( '%s social icon' ),\n\t\t\t\t\tsocialLinkName\n\t\t\t\t) }\n\t\t\t\taccessibilityHint={ accessibilityHint }\n\t\t\t>\n\t\t\t\t<Animated.View\n\t\t\t\t\tstyle={ [ styles.iconContainer, { backgroundColor } ] }\n\t\t\t\t>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tanimated\n\t\t\t\t\t\ticon={ IconComponent }\n\t\t\t\t\t\tstyle={ { stroke, color } }\n\t\t\t\t\t/>\n\t\t\t\t</Animated.View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t</View>\n\t);\n};\n\nexport default compose( [\n\twithSelect( ( select, { clientId } ) => {\n\t\tconst { getBlock } = select( blockEditorStore );\n\n\t\tconst block = getBlock( clientId );\n\t\tconst name = block?.name.substring( 17 );\n\n\t\treturn {\n\t\t\tname,\n\t\t};\n\t} ),\n] )( SocialLinkEdit );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,wBAAwB,QAAQ,cAAc;;AAE/E;AACA;AACA;AACA,SACCC,aAAa,EACbC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,WAAW,QAAQ,oBAAoB;AAC7E,SACCC,YAAY,EACZC,aAAa,EACbC,sBAAsB,QAChB,uBAAuB;AAC9B,SAASC,OAAO,EAAEC,4BAA4B,QAAQ,oBAAoB;AAC1E,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;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