Diff: STRATO-apps/wordpress_03/app/wp-includes/js/dist/viewport.js
Keine Baseline-Datei – Diff nur gegen leer.
1
-
1
+
/******/ (() => { // webpackBootstrap
2
+
/******/ "use strict";
3
+
/******/ // The require scope
4
+
/******/ var __webpack_require__ = {};
5
+
/******/
6
+
/************************************************************************/
7
+
/******/ /* webpack/runtime/define property getters */
8
+
/******/ (() => {
9
+
/******/ // define getter functions for harmony exports
10
+
/******/ __webpack_require__.d = (exports, definition) => {
11
+
/******/ for(var key in definition) {
12
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
13
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
14
+
/******/ }
15
+
/******/ }
16
+
/******/ };
17
+
/******/ })();
18
+
/******/
19
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
20
+
/******/ (() => {
21
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
22
+
/******/ })();
23
+
/******/
24
+
/******/ /* webpack/runtime/make namespace object */
25
+
/******/ (() => {
26
+
/******/ // define __esModule on exports
27
+
/******/ __webpack_require__.r = (exports) => {
28
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
29
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
30
+
/******/ }
31
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
32
+
/******/ };
33
+
/******/ })();
34
+
/******/
35
+
/************************************************************************/
36
+
var __webpack_exports__ = {};
37
+
// ESM COMPAT FLAG
38
+
__webpack_require__.r(__webpack_exports__);
39
+
40
+
// EXPORTS
41
+
__webpack_require__.d(__webpack_exports__, {
42
+
ifViewportMatches: () => (/* reexport */ if_viewport_matches_default),
43
+
store: () => (/* reexport */ store),
44
+
withViewportMatch: () => (/* reexport */ with_viewport_match_default)
45
+
});
46
+
47
+
// NAMESPACE OBJECT: ./node_modules/@wordpress/viewport/build-module/store/actions.js
48
+
var actions_namespaceObject = {};
49
+
__webpack_require__.r(actions_namespaceObject);
50
+
__webpack_require__.d(actions_namespaceObject, {
51
+
setIsMatching: () => (setIsMatching)
52
+
});
53
+
54
+
// NAMESPACE OBJECT: ./node_modules/@wordpress/viewport/build-module/store/selectors.js
55
+
var selectors_namespaceObject = {};
56
+
__webpack_require__.r(selectors_namespaceObject);
57
+
__webpack_require__.d(selectors_namespaceObject, {
58
+
isViewportMatch: () => (isViewportMatch)
59
+
});
60
+
61
+
;// external ["wp","compose"]
62
+
const external_wp_compose_namespaceObject = window["wp"]["compose"];
63
+
;// external ["wp","data"]
64
+
const external_wp_data_namespaceObject = window["wp"]["data"];
65
+
;// ./node_modules/@wordpress/viewport/build-module/store/reducer.js
66
+
function reducer(state = {}, action) {
67
+
switch (action.type) {
68
+
case "SET_IS_MATCHING":
69
+
return action.values;
70
+
}
71
+
return state;
72
+
}
73
+
var reducer_default = reducer;
74
+
75
+
76
+
;// ./node_modules/@wordpress/viewport/build-module/store/actions.js
77
+
function setIsMatching(values) {
78
+
return {
79
+
type: "SET_IS_MATCHING",
80
+
values
81
+
};
82
+
}
83
+
84
+
85
+
;// ./node_modules/@wordpress/viewport/build-module/store/selectors.js
86
+
function isViewportMatch(state, query) {
87
+
if (query.indexOf(" ") === -1) {
88
+
query = ">= " + query;
89
+
}
90
+
return !!state[query];
91
+
}
92
+
93
+
94
+
;// ./node_modules/@wordpress/viewport/build-module/store/index.js
95
+
96
+
97
+
98
+
99
+
const STORE_NAME = "core/viewport";
100
+
const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
101
+
reducer: reducer_default,
102
+
actions: actions_namespaceObject,
103
+
selectors: selectors_namespaceObject
104
+
});
105
+
(0,external_wp_data_namespaceObject.register)(store);
106
+
107
+
108
+
;// ./node_modules/@wordpress/viewport/build-module/listener.js
109
+
110
+
111
+
112
+
const addDimensionsEventListener = (breakpoints, operators) => {
113
+
const setIsMatching = (0,external_wp_compose_namespaceObject.debounce)(
114
+
() => {
115
+
const values = Object.fromEntries(
116
+
queries.map(([key, query]) => [key, query.matches])
117
+
);
118
+
(0,external_wp_data_namespaceObject.dispatch)(store).setIsMatching(values);
119
+
},
120
+
0,
121
+
{ leading: true }
122
+
);
123
+
const operatorEntries = Object.entries(operators);
124
+
const queries = Object.entries(breakpoints).flatMap(
125
+
([name, width]) => {
126
+
return operatorEntries.map(([operator, condition]) => {
127
+
const list = window.matchMedia(
128
+
`(${condition}: ${width}px)`
129
+
);
130
+
list.addEventListener("change", setIsMatching);
131
+
return [`${operator} ${name}`, list];
132
+
});
133
+
}
134
+
);
135
+
window.addEventListener("orientationchange", setIsMatching);
136
+
setIsMatching();
137
+
setIsMatching.flush();
138
+
};
139
+
var listener_default = addDimensionsEventListener;
140
+
141
+
142
+
;// external "ReactJSXRuntime"
143
+
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
144
+
;// ./node_modules/@wordpress/viewport/build-module/with-viewport-match.js
145
+
146
+
147
+
const withViewportMatch = (queries) => {
148
+
const queryEntries = Object.entries(queries);
149
+
const useViewPortQueriesResult = () => Object.fromEntries(
150
+
queryEntries.map(([key, query]) => {
151
+
let [operator, breakpointName] = query.split(" ");
152
+
if (breakpointName === void 0) {
153
+
breakpointName = operator;
154
+
operator = ">=";
155
+
}
156
+
return [key, (0,external_wp_compose_namespaceObject.useViewportMatch)(breakpointName, operator)];
157
+
})
158
+
);
159
+
return (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((WrappedComponent) => {
160
+
return (0,external_wp_compose_namespaceObject.pure)((props) => {
161
+
const queriesResult = useViewPortQueriesResult();
162
+
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { ...props, ...queriesResult });
163
+
});
164
+
}, "withViewportMatch");
165
+
};
166
+
var with_viewport_match_default = withViewportMatch;
167
+
168
+
169
+
;// ./node_modules/@wordpress/viewport/build-module/if-viewport-matches.js
170
+
171
+
172
+
const ifViewportMatches = (query) => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
173
+
(0,external_wp_compose_namespaceObject.compose)([
174
+
with_viewport_match_default({
175
+
isViewportMatch: query
176
+
}),
177
+
(0,external_wp_compose_namespaceObject.ifCondition)((props) => props.isViewportMatch)
178
+
]),
179
+
"ifViewportMatches"
180
+
);
181
+
var if_viewport_matches_default = ifViewportMatches;
182
+
183
+
184
+
;// ./node_modules/@wordpress/viewport/build-module/index.js
185
+
186
+
187
+
188
+
189
+
const BREAKPOINTS = {
190
+
huge: 1440,
191
+
wide: 1280,
192
+
large: 960,
193
+
medium: 782,
194
+
small: 600,
195
+
mobile: 480
196
+
};
197
+
const OPERATORS = {
198
+
"<": "max-width",
199
+
">=": "min-width"
200
+
};
201
+
listener_default(BREAKPOINTS, OPERATORS);
202
+
203
+
204
+
(window.wp = window.wp || {}).viewport = __webpack_exports__;
205
+
/******/ })()
206
+
;