Diff: STRATO-apps/wordpress_03/app/wp-includes/js/dist/nux.js

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + /******/ (() => { // webpackBootstrap
2 + /******/ "use strict";
3 + /******/ // The require scope
4 + /******/ var __webpack_require__ = {};
5 + /******/
6 + /************************************************************************/
7 + /******/ /* webpack/runtime/compat get default export */
8 + /******/ (() => {
9 + /******/ // getDefaultExport function for compatibility with non-harmony modules
10 + /******/ __webpack_require__.n = (module) => {
11 + /******/ var getter = module && module.__esModule ?
12 + /******/ () => (module['default']) :
13 + /******/ () => (module);
14 + /******/ __webpack_require__.d(getter, { a: getter });
15 + /******/ return getter;
16 + /******/ };
17 + /******/ })();
18 + /******/
19 + /******/ /* webpack/runtime/define property getters */
20 + /******/ (() => {
21 + /******/ // define getter functions for harmony exports
22 + /******/ __webpack_require__.d = (exports, definition) => {
23 + /******/ for(var key in definition) {
24 + /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
25 + /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
26 + /******/ }
27 + /******/ }
28 + /******/ };
29 + /******/ })();
30 + /******/
31 + /******/ /* webpack/runtime/hasOwnProperty shorthand */
32 + /******/ (() => {
33 + /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
34 + /******/ })();
35 + /******/
36 + /******/ /* webpack/runtime/make namespace object */
37 + /******/ (() => {
38 + /******/ // define __esModule on exports
39 + /******/ __webpack_require__.r = (exports) => {
40 + /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
41 + /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42 + /******/ }
43 + /******/ Object.defineProperty(exports, '__esModule', { value: true });
44 + /******/ };
45 + /******/ })();
46 + /******/
47 + /************************************************************************/
48 + var __webpack_exports__ = {};
49 + // ESM COMPAT FLAG
50 + __webpack_require__.r(__webpack_exports__);
51 +
52 + // EXPORTS
53 + __webpack_require__.d(__webpack_exports__, {
54 + DotTip: () => (/* reexport */ dot_tip_default),
55 + store: () => (/* reexport */ store)
56 + });
57 +
58 + // NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/actions.js
59 + var actions_namespaceObject = {};
60 + __webpack_require__.r(actions_namespaceObject);
61 + __webpack_require__.d(actions_namespaceObject, {
62 + disableTips: () => (disableTips),
63 + dismissTip: () => (dismissTip),
64 + enableTips: () => (enableTips),
65 + triggerGuide: () => (triggerGuide)
66 + });
67 +
68 + // NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/selectors.js
69 + var selectors_namespaceObject = {};
70 + __webpack_require__.r(selectors_namespaceObject);
71 + __webpack_require__.d(selectors_namespaceObject, {
72 + areTipsEnabled: () => (selectors_areTipsEnabled),
73 + getAssociatedGuide: () => (getAssociatedGuide),
74 + isTipVisible: () => (isTipVisible)
75 + });
76 +
77 + ;// external ["wp","deprecated"]
78 + const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
79 + var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
80 + ;// external ["wp","data"]
81 + const external_wp_data_namespaceObject = window["wp"]["data"];
82 + ;// ./node_modules/@wordpress/nux/build-module/store/reducer.js
83 +
84 + function guides(state = [], action) {
85 + switch (action.type) {
86 + case "TRIGGER_GUIDE":
87 + return [...state, action.tipIds];
88 + }
89 + return state;
90 + }
91 + function areTipsEnabled(state = true, action) {
92 + switch (action.type) {
93 + case "DISABLE_TIPS":
94 + return false;
95 + case "ENABLE_TIPS":
96 + return true;
97 + }
98 + return state;
99 + }
100 + function dismissedTips(state = {}, action) {
101 + switch (action.type) {
102 + case "DISMISS_TIP":
103 + return {
104 + ...state,
105 + [action.id]: true
106 + };
107 + case "ENABLE_TIPS":
108 + return {};
109 + }
110 + return state;
111 + }
112 + const preferences = (0,external_wp_data_namespaceObject.combineReducers)({ areTipsEnabled, dismissedTips });
113 + var reducer_default = (0,external_wp_data_namespaceObject.combineReducers)({ guides, preferences });
114 +
115 +
116 + ;// ./node_modules/@wordpress/nux/build-module/store/actions.js
117 + function triggerGuide(tipIds) {
118 + return {
119 + type: "TRIGGER_GUIDE",
120 + tipIds
121 + };
122 + }
123 + function dismissTip(id) {
124 + return {
125 + type: "DISMISS_TIP",
126 + id
127 + };
128 + }
129 + function disableTips() {
130 + return {
131 + type: "DISABLE_TIPS"
132 + };
133 + }
134 + function enableTips() {
135 + return {
136 + type: "ENABLE_TIPS"
137 + };
138 + }
139 +
140 +
141 + ;// ./node_modules/@wordpress/nux/build-module/store/selectors.js
142 +
143 + const getAssociatedGuide = (0,external_wp_data_namespaceObject.createSelector)(
144 + (state, tipId) => {
145 + for (const tipIds of state.guides) {
146 + if (tipIds.includes(tipId)) {
147 + const nonDismissedTips = tipIds.filter(
148 + (tId) => !Object.keys(
149 + state.preferences.dismissedTips
150 + ).includes(tId)
151 + );
152 + const [currentTipId = null, nextTipId = null] = nonDismissedTips;
153 + return { tipIds, currentTipId, nextTipId };
154 + }
155 + }
156 + return null;
157 + },
158 + (state) => [state.guides, state.preferences.dismissedTips]
159 + );
160 + function isTipVisible(state, tipId) {
161 + if (!state.preferences.areTipsEnabled) {
162 + return false;
163 + }
164 + if (state.preferences.dismissedTips?.hasOwnProperty(tipId)) {
165 + return false;
166 + }
167 + const associatedGuide = getAssociatedGuide(state, tipId);
168 + if (associatedGuide && associatedGuide.currentTipId !== tipId) {
169 + return false;
170 + }
171 + return true;
172 + }
173 + function selectors_areTipsEnabled(state) {
174 + return state.preferences.areTipsEnabled;
175 + }
176 +
177 +
178 + ;// ./node_modules/@wordpress/nux/build-module/store/index.js
179 +
180 +
181 +
182 +
183 + const STORE_NAME = "core/nux";
184 + const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
185 + reducer: reducer_default,
186 + actions: actions_namespaceObject,
187 + selectors: selectors_namespaceObject,
188 + persist: ["preferences"]
189 + });
190 + (0,external_wp_data_namespaceObject.registerStore)(STORE_NAME, {
191 + reducer: reducer_default,
192 + actions: actions_namespaceObject,
193 + selectors: selectors_namespaceObject,
194 + persist: ["preferences"]
195 + });
196 +
197 +
198 + ;// external "ReactJSXRuntime"
199 + const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
200 + ;// external ["wp","compose"]
201 + const external_wp_compose_namespaceObject = window["wp"]["compose"];
202 + ;// external ["wp","components"]
203 + const external_wp_components_namespaceObject = window["wp"]["components"];
204 + ;// external ["wp","i18n"]
205 + const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
206 + ;// external ["wp","element"]
207 + const external_wp_element_namespaceObject = window["wp"]["element"];
208 + ;// external ["wp","primitives"]
209 + const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
210 + ;// ./node_modules/@wordpress/icons/build-module/library/close.js
211 +
212 +
213 + var close_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" }) });
214 +
215 +
216 + ;// ./node_modules/@wordpress/nux/build-module/components/dot-tip/index.js
217 +
218 +
219 +
220 +
221 +
222 +
223 +
224 +
225 + function onClick(event) {
226 + event.stopPropagation();
227 + }
228 + function DotTip({
229 + position = "middle right",
230 + children,
231 + isVisible,
232 + hasNextTip,
233 + onDismiss,
234 + onDisable
235 + }) {
236 + const anchorParent = (0,external_wp_element_namespaceObject.useRef)(null);
237 + const onFocusOutsideCallback = (0,external_wp_element_namespaceObject.useCallback)(
238 + (event) => {
239 + if (!anchorParent.current) {
240 + return;
241 + }
242 + if (anchorParent.current.contains(event.relatedTarget)) {
243 + return;
244 + }
245 + onDisable();
246 + },
247 + [onDisable, anchorParent]
248 + );
249 + if (!isVisible) {
250 + return null;
251 + }
252 + return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
253 + external_wp_components_namespaceObject.Popover,
254 + {
255 + className: "nux-dot-tip",
256 + position,
257 + focusOnMount: true,
258 + role: "dialog",
259 + "aria-label": (0,external_wp_i18n_namespaceObject.__)("Editor tips"),
260 + onClick,
261 + onFocusOutside: onFocusOutsideCallback,
262 + children: [
263 + /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children }),
264 + /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
265 + external_wp_components_namespaceObject.Button,
266 + {
267 + __next40pxDefaultSize: true,
268 + variant: "link",
269 + onClick: onDismiss,
270 + children: hasNextTip ? (0,external_wp_i18n_namespaceObject.__)("See next tip") : (0,external_wp_i18n_namespaceObject.__)("Got it")
271 + }
272 + ) }),
273 + /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
274 + external_wp_components_namespaceObject.Button,
275 + {
276 + size: "small",
277 + className: "nux-dot-tip__disable",
278 + icon: close_default,
279 + label: (0,external_wp_i18n_namespaceObject.__)("Disable tips"),
280 + onClick: onDisable
281 + }
282 + )
283 + ]
284 + }
285 + );
286 + }
287 + var dot_tip_default = (0,external_wp_compose_namespaceObject.compose)(
288 + (0,external_wp_data_namespaceObject.withSelect)((select, { tipId }) => {
289 + const { isTipVisible, getAssociatedGuide } = select(store);
290 + const associatedGuide = getAssociatedGuide(tipId);
291 + return {
292 + isVisible: isTipVisible(tipId),
293 + hasNextTip: !!(associatedGuide && associatedGuide.nextTipId)
294 + };
295 + }),
296 + (0,external_wp_data_namespaceObject.withDispatch)((dispatch, { tipId }) => {
297 + const { dismissTip, disableTips } = dispatch(store);
298 + return {
299 + onDismiss() {
300 + dismissTip(tipId);
301 + },
302 + onDisable() {
303 + disableTips();
304 + }
305 + };
306 + })
307 + )(DotTip);
308 +
309 +
310 + ;// ./node_modules/@wordpress/nux/build-module/index.js
311 +
312 +
313 +
314 + external_wp_deprecated_default()("wp.nux", {
315 + since: "5.4",
316 + hint: "wp.components.Guide can be used to show a user guide.",
317 + version: "6.2"
318 + });
319 +
320 +
321 + (window.wp = window.wp || {}).nux = __webpack_exports__;
322 + /******/ })()
323 + ;