@wordpress/block-editor 14.14.0 → 14.14.1
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/components/block-popover/use-popover-scroll.js +2 -1
- package/build/components/block-popover/use-popover-scroll.js.map +1 -1
- package/build-module/components/block-popover/use-popover-scroll.js +2 -1
- package/build-module/components/block-popover/use-popover-scroll.js.map +1 -1
- package/package.json +34 -34
- package/src/components/block-popover/use-popover-scroll.js +2 -1
|
@@ -20,7 +20,7 @@ const scrollContainerCache = new WeakMap();
|
|
|
20
20
|
* @param {Object} contentRef
|
|
21
21
|
*/
|
|
22
22
|
function usePopoverScroll(contentRef) {
|
|
23
|
-
|
|
23
|
+
const effect = (0, _compose.useRefEffect)(node => {
|
|
24
24
|
function onWheel(event) {
|
|
25
25
|
const {
|
|
26
26
|
deltaX,
|
|
@@ -44,6 +44,7 @@ function usePopoverScroll(contentRef) {
|
|
|
44
44
|
node.removeEventListener('wheel', onWheel, options);
|
|
45
45
|
};
|
|
46
46
|
}, [contentRef]);
|
|
47
|
+
return contentRef ? effect : null;
|
|
47
48
|
}
|
|
48
49
|
var _default = exports.default = usePopoverScroll;
|
|
49
50
|
//# sourceMappingURL=use-popover-scroll.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_compose","require","_dom","scrollContainerCache","WeakMap","usePopoverScroll","contentRef","useRefEffect","node","onWheel","event","deltaX","deltaY","contentEl","current","scrollContainer","get","getScrollContainer","set","scrollBy","options","passive","addEventListener","removeEventListener","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-popover/use-popover-scroll.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { getScrollContainer } from '@wordpress/dom';\n\nconst scrollContainerCache = new WeakMap();\n\n/**\n * Allow scrolling \"through\" popovers over the canvas. This is only called for\n * as long as the pointer is over a popover. Do not use React events because it\n * will bubble through portals.\n *\n * @param {Object} contentRef\n */\nfunction usePopoverScroll( contentRef ) {\n\
|
|
1
|
+
{"version":3,"names":["_compose","require","_dom","scrollContainerCache","WeakMap","usePopoverScroll","contentRef","effect","useRefEffect","node","onWheel","event","deltaX","deltaY","contentEl","current","scrollContainer","get","getScrollContainer","set","scrollBy","options","passive","addEventListener","removeEventListener","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-popover/use-popover-scroll.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { getScrollContainer } from '@wordpress/dom';\n\nconst scrollContainerCache = new WeakMap();\n\n/**\n * Allow scrolling \"through\" popovers over the canvas. This is only called for\n * as long as the pointer is over a popover. Do not use React events because it\n * will bubble through portals.\n *\n * @param {Object} contentRef\n */\nfunction usePopoverScroll( contentRef ) {\n\tconst effect = useRefEffect(\n\t\t( node ) => {\n\t\t\tfunction onWheel( event ) {\n\t\t\t\tconst { deltaX, deltaY } = event;\n\t\t\t\tconst contentEl = contentRef.current;\n\t\t\t\tlet scrollContainer = scrollContainerCache.get( contentEl );\n\t\t\t\tif ( ! scrollContainer ) {\n\t\t\t\t\tscrollContainer = getScrollContainer( contentEl );\n\t\t\t\t\tscrollContainerCache.set( contentEl, scrollContainer );\n\t\t\t\t}\n\t\t\t\tscrollContainer.scrollBy( deltaX, deltaY );\n\t\t\t}\n\t\t\t// Tell the browser that we do not call event.preventDefault\n\t\t\t// See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners\n\t\t\tconst options = { passive: true };\n\t\t\tnode.addEventListener( 'wheel', onWheel, options );\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'wheel', onWheel, options );\n\t\t\t};\n\t\t},\n\t\t[ contentRef ]\n\t);\n\treturn contentRef ? effect : null;\n}\n\nexport default usePopoverScroll;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,oBAAoB,GAAG,IAAIC,OAAO,CAAC,CAAC;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CAAEC,UAAU,EAAG;EACvC,MAAMC,MAAM,GAAG,IAAAC,qBAAY,EACxBC,IAAI,IAAM;IACX,SAASC,OAAOA,CAAEC,KAAK,EAAG;MACzB,MAAM;QAAEC,MAAM;QAAEC;MAAO,CAAC,GAAGF,KAAK;MAChC,MAAMG,SAAS,GAAGR,UAAU,CAACS,OAAO;MACpC,IAAIC,eAAe,GAAGb,oBAAoB,CAACc,GAAG,CAAEH,SAAU,CAAC;MAC3D,IAAK,CAAEE,eAAe,EAAG;QACxBA,eAAe,GAAG,IAAAE,uBAAkB,EAAEJ,SAAU,CAAC;QACjDX,oBAAoB,CAACgB,GAAG,CAAEL,SAAS,EAAEE,eAAgB,CAAC;MACvD;MACAA,eAAe,CAACI,QAAQ,CAAER,MAAM,EAAEC,MAAO,CAAC;IAC3C;IACA;IACA;IACA,MAAMQ,OAAO,GAAG;MAAEC,OAAO,EAAE;IAAK,CAAC;IACjCb,IAAI,CAACc,gBAAgB,CAAE,OAAO,EAAEb,OAAO,EAAEW,OAAQ,CAAC;IAClD,OAAO,MAAM;MACZZ,IAAI,CAACe,mBAAmB,CAAE,OAAO,EAAEd,OAAO,EAAEW,OAAQ,CAAC;IACtD,CAAC;EACF,CAAC,EACD,CAAEf,UAAU,CACb,CAAC;EACD,OAAOA,UAAU,GAAGC,MAAM,GAAG,IAAI;AAClC;AAAC,IAAAkB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEctB,gBAAgB","ignoreList":[]}
|
|
@@ -13,7 +13,7 @@ const scrollContainerCache = new WeakMap();
|
|
|
13
13
|
* @param {Object} contentRef
|
|
14
14
|
*/
|
|
15
15
|
function usePopoverScroll(contentRef) {
|
|
16
|
-
|
|
16
|
+
const effect = useRefEffect(node => {
|
|
17
17
|
function onWheel(event) {
|
|
18
18
|
const {
|
|
19
19
|
deltaX,
|
|
@@ -37,6 +37,7 @@ function usePopoverScroll(contentRef) {
|
|
|
37
37
|
node.removeEventListener('wheel', onWheel, options);
|
|
38
38
|
};
|
|
39
39
|
}, [contentRef]);
|
|
40
|
+
return contentRef ? effect : null;
|
|
40
41
|
}
|
|
41
42
|
export default usePopoverScroll;
|
|
42
43
|
//# sourceMappingURL=use-popover-scroll.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useRefEffect","getScrollContainer","scrollContainerCache","WeakMap","usePopoverScroll","contentRef","node","onWheel","event","deltaX","deltaY","contentEl","current","scrollContainer","get","set","scrollBy","options","passive","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/block-popover/use-popover-scroll.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { getScrollContainer } from '@wordpress/dom';\n\nconst scrollContainerCache = new WeakMap();\n\n/**\n * Allow scrolling \"through\" popovers over the canvas. This is only called for\n * as long as the pointer is over a popover. Do not use React events because it\n * will bubble through portals.\n *\n * @param {Object} contentRef\n */\nfunction usePopoverScroll( contentRef ) {\n\
|
|
1
|
+
{"version":3,"names":["useRefEffect","getScrollContainer","scrollContainerCache","WeakMap","usePopoverScroll","contentRef","effect","node","onWheel","event","deltaX","deltaY","contentEl","current","scrollContainer","get","set","scrollBy","options","passive","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/block-popover/use-popover-scroll.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { getScrollContainer } from '@wordpress/dom';\n\nconst scrollContainerCache = new WeakMap();\n\n/**\n * Allow scrolling \"through\" popovers over the canvas. This is only called for\n * as long as the pointer is over a popover. Do not use React events because it\n * will bubble through portals.\n *\n * @param {Object} contentRef\n */\nfunction usePopoverScroll( contentRef ) {\n\tconst effect = useRefEffect(\n\t\t( node ) => {\n\t\t\tfunction onWheel( event ) {\n\t\t\t\tconst { deltaX, deltaY } = event;\n\t\t\t\tconst contentEl = contentRef.current;\n\t\t\t\tlet scrollContainer = scrollContainerCache.get( contentEl );\n\t\t\t\tif ( ! scrollContainer ) {\n\t\t\t\t\tscrollContainer = getScrollContainer( contentEl );\n\t\t\t\t\tscrollContainerCache.set( contentEl, scrollContainer );\n\t\t\t\t}\n\t\t\t\tscrollContainer.scrollBy( deltaX, deltaY );\n\t\t\t}\n\t\t\t// Tell the browser that we do not call event.preventDefault\n\t\t\t// See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners\n\t\t\tconst options = { passive: true };\n\t\t\tnode.addEventListener( 'wheel', onWheel, options );\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'wheel', onWheel, options );\n\t\t\t};\n\t\t},\n\t\t[ contentRef ]\n\t);\n\treturn contentRef ? effect : null;\n}\n\nexport default usePopoverScroll;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,oBAAoB;AACjD,SAASC,kBAAkB,QAAQ,gBAAgB;AAEnD,MAAMC,oBAAoB,GAAG,IAAIC,OAAO,CAAC,CAAC;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CAAEC,UAAU,EAAG;EACvC,MAAMC,MAAM,GAAGN,YAAY,CACxBO,IAAI,IAAM;IACX,SAASC,OAAOA,CAAEC,KAAK,EAAG;MACzB,MAAM;QAAEC,MAAM;QAAEC;MAAO,CAAC,GAAGF,KAAK;MAChC,MAAMG,SAAS,GAAGP,UAAU,CAACQ,OAAO;MACpC,IAAIC,eAAe,GAAGZ,oBAAoB,CAACa,GAAG,CAAEH,SAAU,CAAC;MAC3D,IAAK,CAAEE,eAAe,EAAG;QACxBA,eAAe,GAAGb,kBAAkB,CAAEW,SAAU,CAAC;QACjDV,oBAAoB,CAACc,GAAG,CAAEJ,SAAS,EAAEE,eAAgB,CAAC;MACvD;MACAA,eAAe,CAACG,QAAQ,CAAEP,MAAM,EAAEC,MAAO,CAAC;IAC3C;IACA;IACA;IACA,MAAMO,OAAO,GAAG;MAAEC,OAAO,EAAE;IAAK,CAAC;IACjCZ,IAAI,CAACa,gBAAgB,CAAE,OAAO,EAAEZ,OAAO,EAAEU,OAAQ,CAAC;IAClD,OAAO,MAAM;MACZX,IAAI,CAACc,mBAAmB,CAAE,OAAO,EAAEb,OAAO,EAAEU,OAAQ,CAAC;IACtD,CAAC;EACF,CAAC,EACD,CAAEb,UAAU,CACb,CAAC;EACD,OAAOA,UAAU,GAAGC,MAAM,GAAG,IAAI;AAClC;AAEA,eAAeF,gBAAgB","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "14.14.
|
|
3
|
+
"version": "14.14.1",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -37,38 +37,38 @@
|
|
|
37
37
|
"@emotion/react": "^11.7.1",
|
|
38
38
|
"@emotion/styled": "^11.6.0",
|
|
39
39
|
"@react-spring/web": "^9.4.5",
|
|
40
|
-
"@wordpress/a11y": "^4.19.
|
|
41
|
-
"@wordpress/api-fetch": "^7.19.
|
|
42
|
-
"@wordpress/blob": "^4.19.
|
|
43
|
-
"@wordpress/block-serialization-default-parser": "^5.19.
|
|
44
|
-
"@wordpress/blocks": "^14.8.
|
|
45
|
-
"@wordpress/commands": "^1.19.
|
|
46
|
-
"@wordpress/components": "^29.5.
|
|
47
|
-
"@wordpress/compose": "^7.19.
|
|
48
|
-
"@wordpress/data": "^10.19.
|
|
49
|
-
"@wordpress/date": "^5.19.
|
|
50
|
-
"@wordpress/deprecated": "^4.19.
|
|
51
|
-
"@wordpress/dom": "^4.19.
|
|
52
|
-
"@wordpress/element": "^6.19.
|
|
53
|
-
"@wordpress/escape-html": "^3.19.
|
|
54
|
-
"@wordpress/hooks": "^4.19.
|
|
55
|
-
"@wordpress/html-entities": "^4.19.
|
|
56
|
-
"@wordpress/i18n": "^5.19.
|
|
57
|
-
"@wordpress/icons": "^10.19.
|
|
58
|
-
"@wordpress/is-shallow-equal": "^5.19.
|
|
59
|
-
"@wordpress/keyboard-shortcuts": "^5.19.
|
|
60
|
-
"@wordpress/keycodes": "^4.19.
|
|
61
|
-
"@wordpress/notices": "^5.19.
|
|
62
|
-
"@wordpress/preferences": "^4.19.
|
|
63
|
-
"@wordpress/priority-queue": "^3.19.
|
|
64
|
-
"@wordpress/private-apis": "^1.19.
|
|
65
|
-
"@wordpress/rich-text": "^7.19.
|
|
66
|
-
"@wordpress/style-engine": "^2.19.
|
|
67
|
-
"@wordpress/token-list": "^3.19.
|
|
68
|
-
"@wordpress/upload-media": "^0.4.
|
|
69
|
-
"@wordpress/url": "^4.19.
|
|
70
|
-
"@wordpress/warning": "^3.19.
|
|
71
|
-
"@wordpress/wordcount": "^4.19.
|
|
40
|
+
"@wordpress/a11y": "^4.19.1",
|
|
41
|
+
"@wordpress/api-fetch": "^7.19.1",
|
|
42
|
+
"@wordpress/blob": "^4.19.1",
|
|
43
|
+
"@wordpress/block-serialization-default-parser": "^5.19.1",
|
|
44
|
+
"@wordpress/blocks": "^14.8.1",
|
|
45
|
+
"@wordpress/commands": "^1.19.1",
|
|
46
|
+
"@wordpress/components": "^29.5.1",
|
|
47
|
+
"@wordpress/compose": "^7.19.1",
|
|
48
|
+
"@wordpress/data": "^10.19.1",
|
|
49
|
+
"@wordpress/date": "^5.19.1",
|
|
50
|
+
"@wordpress/deprecated": "^4.19.1",
|
|
51
|
+
"@wordpress/dom": "^4.19.1",
|
|
52
|
+
"@wordpress/element": "^6.19.1",
|
|
53
|
+
"@wordpress/escape-html": "^3.19.1",
|
|
54
|
+
"@wordpress/hooks": "^4.19.1",
|
|
55
|
+
"@wordpress/html-entities": "^4.19.1",
|
|
56
|
+
"@wordpress/i18n": "^5.19.1",
|
|
57
|
+
"@wordpress/icons": "^10.19.1",
|
|
58
|
+
"@wordpress/is-shallow-equal": "^5.19.1",
|
|
59
|
+
"@wordpress/keyboard-shortcuts": "^5.19.1",
|
|
60
|
+
"@wordpress/keycodes": "^4.19.1",
|
|
61
|
+
"@wordpress/notices": "^5.19.1",
|
|
62
|
+
"@wordpress/preferences": "^4.19.1",
|
|
63
|
+
"@wordpress/priority-queue": "^3.19.1",
|
|
64
|
+
"@wordpress/private-apis": "^1.19.1",
|
|
65
|
+
"@wordpress/rich-text": "^7.19.1",
|
|
66
|
+
"@wordpress/style-engine": "^2.19.1",
|
|
67
|
+
"@wordpress/token-list": "^3.19.1",
|
|
68
|
+
"@wordpress/upload-media": "^0.4.1",
|
|
69
|
+
"@wordpress/url": "^4.19.1",
|
|
70
|
+
"@wordpress/warning": "^3.19.1",
|
|
71
|
+
"@wordpress/wordcount": "^4.19.1",
|
|
72
72
|
"change-case": "^4.1.2",
|
|
73
73
|
"clsx": "^2.1.1",
|
|
74
74
|
"colord": "^2.7.0",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"publishConfig": {
|
|
92
92
|
"access": "public"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "6f49fee89f840761f7fedf662713cbd4a71723e9"
|
|
95
95
|
}
|
|
@@ -14,7 +14,7 @@ const scrollContainerCache = new WeakMap();
|
|
|
14
14
|
* @param {Object} contentRef
|
|
15
15
|
*/
|
|
16
16
|
function usePopoverScroll( contentRef ) {
|
|
17
|
-
|
|
17
|
+
const effect = useRefEffect(
|
|
18
18
|
( node ) => {
|
|
19
19
|
function onWheel( event ) {
|
|
20
20
|
const { deltaX, deltaY } = event;
|
|
@@ -36,6 +36,7 @@ function usePopoverScroll( contentRef ) {
|
|
|
36
36
|
},
|
|
37
37
|
[ contentRef ]
|
|
38
38
|
);
|
|
39
|
+
return contentRef ? effect : null;
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
export default usePopoverScroll;
|