| @@ -1,4 +1,5 @@ | ||
| 1 | +(function() { | |
| 1 | 2 | "use strict"; |
| 2 | 3 | var wp; |
| 3 | 4 | (wp ||= {}).viewport = (() => { |
| 4 | 5 | var __create = Object.create; |
| @@ -128,9 +129,9 @@ | ||
| 128 | 129 | ([name, width]) => { |
| 129 | 130 | return operatorEntries.map( |
| 130 | 131 | ([operator, condition]) => { |
| 131 | 132 | const list = window.matchMedia( |
| 132 | - `(${condition}: ${width}px)` | |
| 133 | + `screen and (${condition}: ${width}px)` | |
| 133 | 134 | ); |
| 134 | 135 | list.addEventListener("change", setIsMatching2); |
| 135 | 136 | return [`${operator} ${name}`, list]; |
| 136 | 137 | } |
| @@ -172,9 +173,9 @@ | ||
| 172 | 173 | }) |
| 173 | 174 | ); |
| 174 | 175 | return (0, import_compose2.createHigherOrderComponent)( |
| 175 | 176 | (WrappedComponent) => { |
| 176 | - const WrappedWithViewport = (props) => { | |
| 177 | + return function WithViewportMatch(props) { | |
| 177 | 178 | const queriesResult = useViewPortQueriesResult(); |
| 178 | 179 | return (0, import_element.createElement)(WrappedComponent, { |
| 179 | 180 | ...props, |
| 180 | 181 | ...queriesResult |
| @@ -179,9 +180,8 @@ | ||
| 179 | 180 | ...props, |
| 180 | 181 | ...queriesResult |
| 181 | 182 | }); |
| 182 | 183 | }; |
| 183 | - return (0, import_compose2.pure)(WrappedWithViewport); | |
| 184 | 184 | }, |
| 185 | 185 | "withViewportMatch" |
| 186 | 186 | ); |
| 187 | 187 | }; |
| @@ -215,6 +215,8 @@ | ||
| 215 | 215 | ">=": "min-width" |
| 216 | 216 | }; |
| 217 | 217 | listener_default(BREAKPOINTS, OPERATORS); |
| 218 | 218 | return __toCommonJS(index_exports); |
| 219 | +})(); | |
| 220 | +(window.wp ||= {}).viewport = wp.viewport; | |
| 219 | 221 | })(); |
| 220 | 222 | //# sourceMappingURL=index.js.map |