@wordpress/block-library 8.19.10 → 8.19.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/image/image.js +2 -2
- package/build/image/image.js.map +1 -1
- package/build/image/view.js +6 -6
- package/build/image/view.js.map +1 -1
- package/build/pattern/edit.js +1 -1
- package/build/pattern/edit.js.map +1 -1
- package/build/query/edit/enhanced-pagination-modal.js +25 -13
- package/build/query/edit/enhanced-pagination-modal.js.map +1 -1
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js +15 -16
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build/query/utils.js +27 -8
- package/build/query/utils.js.map +1 -1
- package/build/query/view.js +4 -2
- package/build/query/view.js.map +1 -1
- package/build-module/image/image.js +2 -2
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/view.js +6 -6
- package/build-module/image/view.js.map +1 -1
- package/build-module/pattern/edit.js +1 -1
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/query/edit/enhanced-pagination-modal.js +26 -14
- package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -1
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +17 -18
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build-module/query/utils.js +25 -6
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query/view.js +4 -2
- package/build-module/query/view.js.map +1 -1
- package/build-style/image/style-rtl.css +16 -10
- package/build-style/image/style.css +16 -10
- package/build-style/query/style-rtl.css +0 -10
- package/build-style/query/style.css +0 -10
- package/build-style/style-rtl.css +16 -10
- package/build-style/style.css +16 -10
- package/package.json +32 -32
- package/src/image/image.js +2 -2
- package/src/image/index.php +3 -4
- package/src/image/style.scss +15 -10
- package/src/image/view.js +6 -6
- package/src/pattern/edit.js +1 -1
- package/src/query/edit/enhanced-pagination-modal.js +35 -21
- package/src/query/edit/inspector-controls/enhanced-pagination-control.js +19 -32
- package/src/query/index.php +98 -9
- package/src/query/style.scss +0 -11
- package/src/query/utils.js +26 -12
- package/src/query/view.js +11 -2
- package/src/query-pagination-next/index.php +1 -1
- package/src/query-pagination-previous/index.php +1 -1
|
@@ -33,7 +33,8 @@ store({
|
|
|
33
33
|
ref,
|
|
34
34
|
context
|
|
35
35
|
}) => {
|
|
36
|
-
|
|
36
|
+
const isDisabled = ref.closest('[data-wp-navigation-id]')?.dataset.wpNavigationDisabled;
|
|
37
|
+
if (isValidLink(ref) && isValidEvent(event) && !isDisabled) {
|
|
37
38
|
event.preventDefault();
|
|
38
39
|
const id = ref.closest('[data-wp-navigation-id]').dataset.wpNavigationId;
|
|
39
40
|
|
|
@@ -62,7 +63,8 @@ store({
|
|
|
62
63
|
prefetch: async ({
|
|
63
64
|
ref
|
|
64
65
|
}) => {
|
|
65
|
-
|
|
66
|
+
const isDisabled = ref.closest('[data-wp-navigation-id]')?.dataset.wpNavigationDisabled;
|
|
67
|
+
if (isValidLink(ref) && !isDisabled) {
|
|
66
68
|
await prefetch(ref.href);
|
|
67
69
|
}
|
|
68
70
|
}
|
|
@@ -1 +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","
|
|
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","isDisabled","closest","dataset","wpNavigationDisabled","preventDefault","id","wpNavigationId","timeout","setTimeout","message","loadingText","clearTimeout","loadedText","url","firstAnchor","document","querySelector","focus","effects"],"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 } ) => {\n\t\t\t\t\tconst isDisabled = ref.closest( '[data-wp-navigation-id]' )\n\t\t\t\t\t\t?.dataset.wpNavigationDisabled;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tisValidLink( ref ) &&\n\t\t\t\t\t\tisValidEvent( event ) &&\n\t\t\t\t\t\t! isDisabled\n\t\t\t\t\t) {\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\tcontext.core.query.loadingText;\n\t\t\t\t\t\t\tcontext.core.query.animation = 'start';\n\t\t\t\t\t\t}, 400 );\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\tcontext.core.query.loadedText +\n\t\t\t\t\t\t\t( context.core.query.message ===\n\t\t\t\t\t\t\tcontext.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\t\t\t\t\t\tcontext.core.query.url = ref.href;\n\n\t\t\t\t\t\t// Focus the first anchor of the Query block.\n\t\t\t\t\t\tconst firstAnchor = `[data-wp-navigation-id=${ id }] .wp-block-post-template a[href]`;\n\t\t\t\t\t\tdocument.querySelector( firstAnchor )?.focus();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tprefetch: async ( { ref } ) => {\n\t\t\t\t\tconst isDisabled = ref.closest( '[data-wp-navigation-id]' )\n\t\t\t\t\t\t?.dataset.wpNavigationDisabled;\n\t\t\t\t\tif ( isValidLink( ref ) && ! isDisabled ) {\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\teffects: {\n\t\tcore: {\n\t\t\tquery: {\n\t\t\t\tprefetch: async ( { ref, context } ) => {\n\t\t\t\t\tif ( context.core.query.url && 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,KACN,CAAEH,GAA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Q,CAAC,KAAM;UACvC,IAAKA,OAAO,CAACH,IAAI,CAACC,KAAK,CAACmB,GAAG,IAAIrC,WAAW,CAAEC,GAAI,CAAC,EAAG;YACnD,MAAMF,QAAQ,CAAEE,GAAG,CAACG,IAAK,CAAC;UAC3B;QACD;MACD;IACD;EACD;AACD,CAAE,CAAC"}
|
|
@@ -213,22 +213,28 @@
|
|
|
213
213
|
.wp-lightbox-container button {
|
|
214
214
|
opacity: 0;
|
|
215
215
|
border: none;
|
|
216
|
-
background:
|
|
216
|
+
background-color: rgba(90, 90, 90, 0.25);
|
|
217
|
+
-webkit-backdrop-filter: blur(16px) saturate(180%);
|
|
218
|
+
backdrop-filter: blur(16px) saturate(180%);
|
|
217
219
|
cursor: zoom-in;
|
|
218
|
-
|
|
219
|
-
|
|
220
|
+
display: flex;
|
|
221
|
+
justify-content: center;
|
|
222
|
+
align-items: center;
|
|
223
|
+
width: 20px;
|
|
224
|
+
height: 20px;
|
|
220
225
|
position: absolute;
|
|
221
226
|
z-index: 100;
|
|
222
|
-
top:
|
|
223
|
-
left:
|
|
227
|
+
top: 16px;
|
|
228
|
+
left: 16px;
|
|
224
229
|
text-align: center;
|
|
225
230
|
padding: 0;
|
|
226
|
-
border-radius:
|
|
231
|
+
border-radius: 4px;
|
|
232
|
+
transition: opacity 0.2s ease;
|
|
227
233
|
}
|
|
228
234
|
.wp-lightbox-container button:focus-visible {
|
|
229
|
-
outline:
|
|
230
|
-
outline:
|
|
231
|
-
outline-offset:
|
|
235
|
+
outline: 3px auto rgba(90, 90, 90, 0.25);
|
|
236
|
+
outline: 3px auto -webkit-focus-ring-color;
|
|
237
|
+
outline-offset: 3px;
|
|
232
238
|
}
|
|
233
239
|
.wp-lightbox-container button:hover {
|
|
234
240
|
cursor: pointer;
|
|
@@ -238,7 +244,7 @@
|
|
|
238
244
|
opacity: 1;
|
|
239
245
|
}
|
|
240
246
|
.wp-lightbox-container button:hover, .wp-lightbox-container button:focus, .wp-lightbox-container button:not(:hover):not(:active):not(.has-background) {
|
|
241
|
-
background:
|
|
247
|
+
background-color: rgba(90, 90, 90, 0.25);
|
|
242
248
|
border: none;
|
|
243
249
|
}
|
|
244
250
|
|
|
@@ -219,22 +219,28 @@
|
|
|
219
219
|
.wp-lightbox-container button {
|
|
220
220
|
opacity: 0;
|
|
221
221
|
border: none;
|
|
222
|
-
background:
|
|
222
|
+
background-color: rgba(90, 90, 90, 0.25);
|
|
223
|
+
-webkit-backdrop-filter: blur(16px) saturate(180%);
|
|
224
|
+
backdrop-filter: blur(16px) saturate(180%);
|
|
223
225
|
cursor: zoom-in;
|
|
224
|
-
|
|
225
|
-
|
|
226
|
+
display: flex;
|
|
227
|
+
justify-content: center;
|
|
228
|
+
align-items: center;
|
|
229
|
+
width: 20px;
|
|
230
|
+
height: 20px;
|
|
226
231
|
position: absolute;
|
|
227
232
|
z-index: 100;
|
|
228
|
-
top:
|
|
229
|
-
right:
|
|
233
|
+
top: 16px;
|
|
234
|
+
right: 16px;
|
|
230
235
|
text-align: center;
|
|
231
236
|
padding: 0;
|
|
232
|
-
border-radius:
|
|
237
|
+
border-radius: 4px;
|
|
238
|
+
transition: opacity 0.2s ease;
|
|
233
239
|
}
|
|
234
240
|
.wp-lightbox-container button:focus-visible {
|
|
235
|
-
outline:
|
|
236
|
-
outline:
|
|
237
|
-
outline-offset:
|
|
241
|
+
outline: 3px auto rgba(90, 90, 90, 0.25);
|
|
242
|
+
outline: 3px auto -webkit-focus-ring-color;
|
|
243
|
+
outline-offset: 3px;
|
|
238
244
|
}
|
|
239
245
|
.wp-lightbox-container button:hover {
|
|
240
246
|
cursor: pointer;
|
|
@@ -244,7 +250,7 @@
|
|
|
244
250
|
opacity: 1;
|
|
245
251
|
}
|
|
246
252
|
.wp-lightbox-container button:hover, .wp-lightbox-container button:focus, .wp-lightbox-container button:not(:hover):not(:active):not(.has-background) {
|
|
247
|
-
background:
|
|
253
|
+
background-color: rgba(90, 90, 90, 0.25);
|
|
248
254
|
border: none;
|
|
249
255
|
}
|
|
250
256
|
|
|
@@ -127,14 +127,4 @@
|
|
|
127
127
|
100% {
|
|
128
128
|
opacity: 0;
|
|
129
129
|
}
|
|
130
|
-
}
|
|
131
|
-
.wp-block-query__enhanced-pagination-navigation-announce {
|
|
132
|
-
position: absolute;
|
|
133
|
-
clip: rect(0, 0, 0, 0);
|
|
134
|
-
width: 1px;
|
|
135
|
-
height: 1px;
|
|
136
|
-
padding: 0;
|
|
137
|
-
margin: -1px;
|
|
138
|
-
overflow: hidden;
|
|
139
|
-
border: 0;
|
|
140
130
|
}
|
|
@@ -127,14 +127,4 @@
|
|
|
127
127
|
100% {
|
|
128
128
|
opacity: 0;
|
|
129
129
|
}
|
|
130
|
-
}
|
|
131
|
-
.wp-block-query__enhanced-pagination-navigation-announce {
|
|
132
|
-
position: absolute;
|
|
133
|
-
clip: rect(0, 0, 0, 0);
|
|
134
|
-
width: 1px;
|
|
135
|
-
height: 1px;
|
|
136
|
-
padding: 0;
|
|
137
|
-
margin: -1px;
|
|
138
|
-
overflow: hidden;
|
|
139
|
-
border: 0;
|
|
140
130
|
}
|
|
@@ -1621,22 +1621,28 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
|
|
|
1621
1621
|
.wp-lightbox-container button {
|
|
1622
1622
|
opacity: 0;
|
|
1623
1623
|
border: none;
|
|
1624
|
-
background:
|
|
1624
|
+
background-color: rgba(90, 90, 90, 0.25);
|
|
1625
|
+
-webkit-backdrop-filter: blur(16px) saturate(180%);
|
|
1626
|
+
backdrop-filter: blur(16px) saturate(180%);
|
|
1625
1627
|
cursor: zoom-in;
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
+
display: flex;
|
|
1629
|
+
justify-content: center;
|
|
1630
|
+
align-items: center;
|
|
1631
|
+
width: 20px;
|
|
1632
|
+
height: 20px;
|
|
1628
1633
|
position: absolute;
|
|
1629
1634
|
z-index: 100;
|
|
1630
|
-
top:
|
|
1631
|
-
left:
|
|
1635
|
+
top: 16px;
|
|
1636
|
+
left: 16px;
|
|
1632
1637
|
text-align: center;
|
|
1633
1638
|
padding: 0;
|
|
1634
|
-
border-radius:
|
|
1639
|
+
border-radius: 4px;
|
|
1640
|
+
transition: opacity 0.2s ease;
|
|
1635
1641
|
}
|
|
1636
1642
|
.wp-lightbox-container button:focus-visible {
|
|
1637
|
-
outline:
|
|
1638
|
-
outline:
|
|
1639
|
-
outline-offset:
|
|
1643
|
+
outline: 3px auto rgba(90, 90, 90, 0.25);
|
|
1644
|
+
outline: 3px auto -webkit-focus-ring-color;
|
|
1645
|
+
outline-offset: 3px;
|
|
1640
1646
|
}
|
|
1641
1647
|
.wp-lightbox-container button:hover {
|
|
1642
1648
|
cursor: pointer;
|
|
@@ -1646,7 +1652,7 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
|
|
|
1646
1652
|
opacity: 1;
|
|
1647
1653
|
}
|
|
1648
1654
|
.wp-lightbox-container button:hover, .wp-lightbox-container button:focus, .wp-lightbox-container button:not(:hover):not(:active):not(.has-background) {
|
|
1649
|
-
background:
|
|
1655
|
+
background-color: rgba(90, 90, 90, 0.25);
|
|
1650
1656
|
border: none;
|
|
1651
1657
|
}
|
|
1652
1658
|
|
package/build-style/style.css
CHANGED
|
@@ -1635,22 +1635,28 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
|
|
|
1635
1635
|
.wp-lightbox-container button {
|
|
1636
1636
|
opacity: 0;
|
|
1637
1637
|
border: none;
|
|
1638
|
-
background:
|
|
1638
|
+
background-color: rgba(90, 90, 90, 0.25);
|
|
1639
|
+
-webkit-backdrop-filter: blur(16px) saturate(180%);
|
|
1640
|
+
backdrop-filter: blur(16px) saturate(180%);
|
|
1639
1641
|
cursor: zoom-in;
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
+
display: flex;
|
|
1643
|
+
justify-content: center;
|
|
1644
|
+
align-items: center;
|
|
1645
|
+
width: 20px;
|
|
1646
|
+
height: 20px;
|
|
1642
1647
|
position: absolute;
|
|
1643
1648
|
z-index: 100;
|
|
1644
|
-
top:
|
|
1645
|
-
right:
|
|
1649
|
+
top: 16px;
|
|
1650
|
+
right: 16px;
|
|
1646
1651
|
text-align: center;
|
|
1647
1652
|
padding: 0;
|
|
1648
|
-
border-radius:
|
|
1653
|
+
border-radius: 4px;
|
|
1654
|
+
transition: opacity 0.2s ease;
|
|
1649
1655
|
}
|
|
1650
1656
|
.wp-lightbox-container button:focus-visible {
|
|
1651
|
-
outline:
|
|
1652
|
-
outline:
|
|
1653
|
-
outline-offset:
|
|
1657
|
+
outline: 3px auto rgba(90, 90, 90, 0.25);
|
|
1658
|
+
outline: 3px auto -webkit-focus-ring-color;
|
|
1659
|
+
outline-offset: 3px;
|
|
1654
1660
|
}
|
|
1655
1661
|
.wp-lightbox-container button:hover {
|
|
1656
1662
|
cursor: pointer;
|
|
@@ -1660,7 +1666,7 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
|
|
|
1660
1666
|
opacity: 1;
|
|
1661
1667
|
}
|
|
1662
1668
|
.wp-lightbox-container button:hover, .wp-lightbox-container button:focus, .wp-lightbox-container button:not(:hover):not(:active):not(.has-background) {
|
|
1663
|
-
background:
|
|
1669
|
+
background-color: rgba(90, 90, 90, 0.25);
|
|
1664
1670
|
border: none;
|
|
1665
1671
|
}
|
|
1666
1672
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "8.19.
|
|
3
|
+
"version": "8.19.12",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -31,36 +31,36 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@wordpress/a11y": "^3.42.
|
|
35
|
-
"@wordpress/api-fetch": "^6.39.
|
|
36
|
-
"@wordpress/autop": "^3.42.
|
|
37
|
-
"@wordpress/blob": "^3.42.
|
|
38
|
-
"@wordpress/block-editor": "^12.10.
|
|
39
|
-
"@wordpress/blocks": "^12.19.
|
|
40
|
-
"@wordpress/components": "^25.8.
|
|
41
|
-
"@wordpress/compose": "^6.19.
|
|
42
|
-
"@wordpress/core-data": "^6.19.
|
|
43
|
-
"@wordpress/data": "^9.12.
|
|
44
|
-
"@wordpress/date": "^4.42.
|
|
45
|
-
"@wordpress/deprecated": "^3.42.
|
|
46
|
-
"@wordpress/dom": "^3.42.
|
|
47
|
-
"@wordpress/element": "^5.19.
|
|
48
|
-
"@wordpress/escape-html": "^2.42.
|
|
49
|
-
"@wordpress/hooks": "^3.42.
|
|
50
|
-
"@wordpress/html-entities": "^3.42.
|
|
51
|
-
"@wordpress/i18n": "^4.42.
|
|
52
|
-
"@wordpress/icons": "^9.33.
|
|
53
|
-
"@wordpress/interactivity": "^2.3.
|
|
54
|
-
"@wordpress/keycodes": "^3.42.
|
|
55
|
-
"@wordpress/notices": "^4.10.
|
|
56
|
-
"@wordpress/primitives": "^3.40.
|
|
57
|
-
"@wordpress/private-apis": "^0.24.
|
|
58
|
-
"@wordpress/reusable-blocks": "^4.19.
|
|
59
|
-
"@wordpress/rich-text": "^6.19.
|
|
60
|
-
"@wordpress/server-side-render": "^4.19.
|
|
61
|
-
"@wordpress/url": "^3.43.
|
|
62
|
-
"@wordpress/viewport": "^5.19.
|
|
63
|
-
"@wordpress/wordcount": "^3.42.
|
|
34
|
+
"@wordpress/a11y": "^3.42.12",
|
|
35
|
+
"@wordpress/api-fetch": "^6.39.12",
|
|
36
|
+
"@wordpress/autop": "^3.42.12",
|
|
37
|
+
"@wordpress/blob": "^3.42.12",
|
|
38
|
+
"@wordpress/block-editor": "^12.10.12",
|
|
39
|
+
"@wordpress/blocks": "^12.19.12",
|
|
40
|
+
"@wordpress/components": "^25.8.12",
|
|
41
|
+
"@wordpress/compose": "^6.19.12",
|
|
42
|
+
"@wordpress/core-data": "^6.19.12",
|
|
43
|
+
"@wordpress/data": "^9.12.12",
|
|
44
|
+
"@wordpress/date": "^4.42.12",
|
|
45
|
+
"@wordpress/deprecated": "^3.42.12",
|
|
46
|
+
"@wordpress/dom": "^3.42.12",
|
|
47
|
+
"@wordpress/element": "^5.19.12",
|
|
48
|
+
"@wordpress/escape-html": "^2.42.12",
|
|
49
|
+
"@wordpress/hooks": "^3.42.12",
|
|
50
|
+
"@wordpress/html-entities": "^3.42.12",
|
|
51
|
+
"@wordpress/i18n": "^4.42.12",
|
|
52
|
+
"@wordpress/icons": "^9.33.12",
|
|
53
|
+
"@wordpress/interactivity": "^2.3.12",
|
|
54
|
+
"@wordpress/keycodes": "^3.42.12",
|
|
55
|
+
"@wordpress/notices": "^4.10.12",
|
|
56
|
+
"@wordpress/primitives": "^3.40.12",
|
|
57
|
+
"@wordpress/private-apis": "^0.24.12",
|
|
58
|
+
"@wordpress/reusable-blocks": "^4.19.12",
|
|
59
|
+
"@wordpress/rich-text": "^6.19.12",
|
|
60
|
+
"@wordpress/server-side-render": "^4.19.12",
|
|
61
|
+
"@wordpress/url": "^3.43.12",
|
|
62
|
+
"@wordpress/viewport": "^5.19.12",
|
|
63
|
+
"@wordpress/wordcount": "^3.42.12",
|
|
64
64
|
"change-case": "^4.1.2",
|
|
65
65
|
"classnames": "^2.3.1",
|
|
66
66
|
"colord": "^2.7.0",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "8447c60232efe04eb248a1c893bf3a1fc4e47ecc"
|
|
82
82
|
}
|
package/src/image/image.js
CHANGED
|
@@ -548,14 +548,14 @@ export default function Image( {
|
|
|
548
548
|
{ showLightboxToggle && (
|
|
549
549
|
<ToolsPanelItem
|
|
550
550
|
hasValue={ () => !! lightbox }
|
|
551
|
-
label={ __( 'Expand on
|
|
551
|
+
label={ __( 'Expand on click' ) }
|
|
552
552
|
onDeselect={ () => {
|
|
553
553
|
setAttributes( { lightbox: undefined } );
|
|
554
554
|
} }
|
|
555
555
|
isShownByDefault={ true }
|
|
556
556
|
>
|
|
557
557
|
<ToggleControl
|
|
558
|
-
label={ __( 'Expand on
|
|
558
|
+
label={ __( 'Expand on click' ) }
|
|
559
559
|
checked={ lightboxChecked }
|
|
560
560
|
onChange={ ( newValue ) => {
|
|
561
561
|
setAttributes( {
|
package/src/image/index.php
CHANGED
|
@@ -242,10 +242,9 @@ function block_core_image_render_lightbox( $block_content, $block ) {
|
|
|
242
242
|
data-wp-on--click="actions.core.image.showLightbox"
|
|
243
243
|
data-wp-style--right="context.core.image.imageButtonRight"
|
|
244
244
|
data-wp-style--top="context.core.image.imageButtonTop"
|
|
245
|
-
style="background: #000"
|
|
246
245
|
>
|
|
247
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
248
|
-
<
|
|
246
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
|
|
247
|
+
<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
|
|
249
248
|
</svg>
|
|
250
249
|
</button>';
|
|
251
250
|
|
|
@@ -303,7 +302,7 @@ function block_core_image_render_lightbox( $block_content, $block ) {
|
|
|
303
302
|
}
|
|
304
303
|
}
|
|
305
304
|
|
|
306
|
-
$close_button_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="
|
|
305
|
+
$close_button_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" focusable="false"><path d="M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"></path></svg>';
|
|
307
306
|
$close_button_label = esc_attr__( 'Close' );
|
|
308
307
|
|
|
309
308
|
$lightbox_html = <<<HTML
|
package/src/image/style.scss
CHANGED
|
@@ -168,22 +168,27 @@
|
|
|
168
168
|
button {
|
|
169
169
|
opacity: 0;
|
|
170
170
|
border: none;
|
|
171
|
-
background:
|
|
171
|
+
background-color: rgb(90 90 90 / 25%);
|
|
172
|
+
backdrop-filter: blur($grid-unit-20) saturate(180%);
|
|
172
173
|
cursor: zoom-in;
|
|
173
|
-
|
|
174
|
-
|
|
174
|
+
display: flex;
|
|
175
|
+
justify-content: center;
|
|
176
|
+
align-items: center;
|
|
177
|
+
width: 20px;
|
|
178
|
+
height: 20px;
|
|
175
179
|
position: absolute;
|
|
176
180
|
z-index: 100;
|
|
177
|
-
top:
|
|
178
|
-
right:
|
|
181
|
+
top: 16px;
|
|
182
|
+
right: 16px;
|
|
179
183
|
text-align: center;
|
|
180
184
|
padding: 0;
|
|
181
|
-
border-radius:
|
|
185
|
+
border-radius: 4px;
|
|
186
|
+
transition: opacity 0.2s ease;
|
|
182
187
|
|
|
183
188
|
&:focus-visible {
|
|
184
|
-
outline:
|
|
185
|
-
outline:
|
|
186
|
-
outline-offset:
|
|
189
|
+
outline: 3px auto rgb(90 90 90 / 25%);
|
|
190
|
+
outline: 3px auto -webkit-focus-ring-color;
|
|
191
|
+
outline-offset: 3px;
|
|
187
192
|
}
|
|
188
193
|
|
|
189
194
|
&:hover {
|
|
@@ -198,7 +203,7 @@
|
|
|
198
203
|
&:hover,
|
|
199
204
|
&:focus,
|
|
200
205
|
&:not(:hover):not(:active):not(.has-background) {
|
|
201
|
-
background:
|
|
206
|
+
background-color: rgb(90 90 90 / 25%);
|
|
202
207
|
border: none;
|
|
203
208
|
}
|
|
204
209
|
}
|
package/src/image/view.js
CHANGED
|
@@ -340,26 +340,26 @@ store(
|
|
|
340
340
|
context.core.image.imageButtonTop =
|
|
341
341
|
( offsetHeight - referenceHeight ) / 2 +
|
|
342
342
|
buttonOffsetTop +
|
|
343
|
-
|
|
343
|
+
16;
|
|
344
344
|
context.core.image.imageButtonRight =
|
|
345
|
-
buttonOffsetRight +
|
|
345
|
+
buttonOffsetRight + 16;
|
|
346
346
|
} else {
|
|
347
347
|
// If it reaches the height first, keep
|
|
348
348
|
// the height and compute the width.
|
|
349
349
|
const referenceWidth =
|
|
350
350
|
offsetHeight * naturalRatio;
|
|
351
351
|
context.core.image.imageButtonTop =
|
|
352
|
-
buttonOffsetTop +
|
|
352
|
+
buttonOffsetTop + 16;
|
|
353
353
|
context.core.image.imageButtonRight =
|
|
354
354
|
( offsetWidth - referenceWidth ) / 2 +
|
|
355
355
|
buttonOffsetRight +
|
|
356
|
-
|
|
356
|
+
16;
|
|
357
357
|
}
|
|
358
358
|
} else {
|
|
359
359
|
context.core.image.imageButtonTop =
|
|
360
|
-
buttonOffsetTop +
|
|
360
|
+
buttonOffsetTop + 16;
|
|
361
361
|
context.core.image.imageButtonRight =
|
|
362
|
-
buttonOffsetRight +
|
|
362
|
+
buttonOffsetRight + 16;
|
|
363
363
|
}
|
|
364
364
|
},
|
|
365
365
|
setStylesOnResize: ( { state, context, ref } ) => {
|
package/src/pattern/edit.js
CHANGED
|
@@ -20,7 +20,7 @@ const PatternEdit = ( { attributes, clientId } ) => {
|
|
|
20
20
|
);
|
|
21
21
|
|
|
22
22
|
const currentThemeStylesheet = useSelect(
|
|
23
|
-
( select ) => select( coreStore ).getCurrentTheme()
|
|
23
|
+
( select ) => select( coreStore ).getCurrentTheme()?.stylesheet
|
|
24
24
|
);
|
|
25
25
|
|
|
26
26
|
const { replaceBlocks, __unstableMarkNextChangeAsNotPersistent } =
|
|
@@ -12,11 +12,7 @@ import { useState, useEffect } from '@wordpress/element';
|
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
const disableEnhancedPaginationDescription = __(
|
|
18
|
-
'You have added unsupported blocks. For the enhanced pagination to work, remove them, then re-enable "Enhanced pagination" in the Query Block settings.'
|
|
19
|
-
);
|
|
15
|
+
import { useUnsupportedBlocks } from '../utils';
|
|
20
16
|
|
|
21
17
|
const modalDescriptionId =
|
|
22
18
|
'wp-block-query-enhanced-pagination-modal__description';
|
|
@@ -27,35 +23,53 @@ export default function EnhancedPaginationModal( {
|
|
|
27
23
|
setAttributes,
|
|
28
24
|
} ) {
|
|
29
25
|
const [ isOpen, setOpen ] = useState( false );
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
const { hasBlocksFromPlugins, hasPostContentBlock, hasUnsupportedBlocks } =
|
|
27
|
+
useUnsupportedBlocks( clientId );
|
|
32
28
|
|
|
33
29
|
useEffect( () => {
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
if ( enhancedPagination && hasUnsupportedBlocks ) {
|
|
31
|
+
setAttributes( { enhancedPagination: false } );
|
|
32
|
+
setOpen( true );
|
|
33
|
+
}
|
|
34
|
+
}, [ enhancedPagination, hasUnsupportedBlocks, setAttributes ] );
|
|
35
|
+
|
|
36
|
+
const closeModal = () => {
|
|
37
|
+
setOpen( false );
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
let notice = __(
|
|
41
|
+
'If you still want to prevent full page reloads, remove that block, then disable "Force page reload" again in the Query Block settings.'
|
|
42
|
+
);
|
|
43
|
+
if ( hasBlocksFromPlugins ) {
|
|
44
|
+
notice =
|
|
45
|
+
__(
|
|
46
|
+
'Currently, avoiding full page reloads is not possible when blocks from plugins are present inside the Query block.'
|
|
47
|
+
) +
|
|
48
|
+
' ' +
|
|
49
|
+
notice;
|
|
50
|
+
} else if ( hasPostContentBlock ) {
|
|
51
|
+
notice =
|
|
52
|
+
__(
|
|
53
|
+
'Currently, avoiding full page reloads is not possible when a Content block is present inside the Query block.'
|
|
54
|
+
) +
|
|
55
|
+
' ' +
|
|
56
|
+
notice;
|
|
57
|
+
}
|
|
36
58
|
|
|
37
59
|
return (
|
|
38
60
|
isOpen && (
|
|
39
61
|
<Modal
|
|
40
|
-
title={ __( '
|
|
62
|
+
title={ __( 'Query block: Force page reload enabled' ) }
|
|
41
63
|
className="wp-block-query__enhanced-pagination-modal"
|
|
42
64
|
aria={ {
|
|
43
65
|
describedby: modalDescriptionId,
|
|
44
66
|
} }
|
|
45
67
|
isDismissible={ false }
|
|
46
|
-
|
|
47
|
-
shouldCloseOnClickOutside={ false }
|
|
68
|
+
onRequestClose={ closeModal }
|
|
48
69
|
>
|
|
49
70
|
<VStack alignment="right" spacing={ 5 }>
|
|
50
|
-
<span id={ modalDescriptionId }>
|
|
51
|
-
|
|
52
|
-
</span>
|
|
53
|
-
<Button
|
|
54
|
-
variant="primary"
|
|
55
|
-
onClick={ () => {
|
|
56
|
-
setAttributes( { enhancedPagination: false } );
|
|
57
|
-
} }
|
|
58
|
-
>
|
|
71
|
+
<span id={ modalDescriptionId }>{ notice }</span>
|
|
72
|
+
<Button variant="primary" onClick={ closeModal }>
|
|
59
73
|
{ __( 'OK' ) }
|
|
60
74
|
</Button>
|
|
61
75
|
</VStack>
|
|
@@ -1,58 +1,45 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { ToggleControl
|
|
4
|
+
import { ToggleControl } from '@wordpress/components';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
|
-
import { BlockTitle } from '@wordpress/block-editor';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* Internal dependencies
|
|
10
9
|
*/
|
|
11
|
-
import {
|
|
10
|
+
import { useUnsupportedBlocks } from '../../utils';
|
|
12
11
|
|
|
13
12
|
export default function EnhancedPaginationControl( {
|
|
14
13
|
enhancedPagination,
|
|
15
14
|
setAttributes,
|
|
16
15
|
clientId,
|
|
17
16
|
} ) {
|
|
18
|
-
const
|
|
17
|
+
const { hasUnsupportedBlocks } = useUnsupportedBlocks( clientId );
|
|
18
|
+
|
|
19
|
+
let help = __( 'Browsing between pages requires a full page reload.' );
|
|
20
|
+
if ( enhancedPagination ) {
|
|
21
|
+
help = __(
|
|
22
|
+
"Browsing between pages won't require a full page reload, unless non-compatible blocks are detected."
|
|
23
|
+
);
|
|
24
|
+
} else if ( hasUnsupportedBlocks ) {
|
|
25
|
+
help = __(
|
|
26
|
+
"Force page reload can't be disabled because there are non-compatible blocks inside the Query block."
|
|
27
|
+
);
|
|
28
|
+
}
|
|
19
29
|
|
|
20
30
|
return (
|
|
21
31
|
<>
|
|
22
32
|
<ToggleControl
|
|
23
|
-
label={ __( '
|
|
24
|
-
help={
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
checked={ !! enhancedPagination }
|
|
28
|
-
disabled={ unsupported.length }
|
|
33
|
+
label={ __( 'Force page reload' ) }
|
|
34
|
+
help={ help }
|
|
35
|
+
checked={ ! enhancedPagination }
|
|
36
|
+
disabled={ hasUnsupportedBlocks }
|
|
29
37
|
onChange={ ( value ) => {
|
|
30
38
|
setAttributes( {
|
|
31
|
-
enhancedPagination:
|
|
39
|
+
enhancedPagination: ! value,
|
|
32
40
|
} );
|
|
33
41
|
} }
|
|
34
42
|
/>
|
|
35
|
-
{ !! unsupported.length && (
|
|
36
|
-
<Notice
|
|
37
|
-
status="warning"
|
|
38
|
-
isDismissible={ false }
|
|
39
|
-
className="wp-block-query__enhanced-pagination-notice"
|
|
40
|
-
>
|
|
41
|
-
{ __(
|
|
42
|
-
"Enhanced pagination doesn't support the following blocks:"
|
|
43
|
-
) }
|
|
44
|
-
<ul>
|
|
45
|
-
{ unsupported.map( ( id ) => (
|
|
46
|
-
<li key={ id }>
|
|
47
|
-
<BlockTitle clientId={ id } />
|
|
48
|
-
</li>
|
|
49
|
-
) ) }
|
|
50
|
-
</ul>
|
|
51
|
-
{ __(
|
|
52
|
-
'If you want to enable it, you have to remove all unsupported blocks first.'
|
|
53
|
-
) }
|
|
54
|
-
</Notice>
|
|
55
|
-
) }
|
|
56
43
|
</>
|
|
57
44
|
);
|
|
58
45
|
}
|