PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.2
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.2
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / assets / js / dist / blocks / instructor-name.js

instructor-name.js in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.2, at assets/js/dist/blocks/instructor-name.js

333 lines 14.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /******/ (() => { // webpackBootstrap
2 /******/ "use strict";
3 /******/ var __webpack_modules__ = ({
4
5 /***/ "./node_modules/@wordpress/icons/build-module/library/title.js"
6 /*!*********************************************************************!*\
7 !*** ./node_modules/@wordpress/icons/build-module/library/title.js ***!
8 \*********************************************************************/
9 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
10
11 __webpack_require__.r(__webpack_exports__);
12 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
14 /* harmony export */ });
15 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
16 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
17 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
18 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
19 /**
20 * WordPress dependencies
21 */
22
23
24 const title = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, {
25 xmlns: "http://www.w3.org/2000/svg",
26 viewBox: "0 0 24 24",
27 children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, {
28 d: "m4 5.5h2v6.5h1.5v-6.5h2v-1.5h-5.5zm16 10.5h-16v-1.5h16zm-7 4h-9v-1.5h9z"
29 })
30 });
31 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (title);
32 //# sourceMappingURL=title.js.map
33
34 /***/ },
35
36 /***/ "./assets/src/apps/js/blocks/instructor-elements/instructor-name/edit.js"
37 /*!*******************************************************************************!*\
38 !*** ./assets/src/apps/js/blocks/instructor-elements/instructor-name/edit.js ***!
39 \*******************************************************************************/
40 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
41
42 __webpack_require__.r(__webpack_exports__);
43 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
44 /* harmony export */ edit: () => (/* binding */ edit)
45 /* harmony export */ });
46 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
47 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
48 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
49 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
50 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
51 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);
52
53
54
55 const edit = props => {
56 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)();
57 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
58 ...blockProps
59 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h2", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
60 className: "instructor-display-name"
61 }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Instructor's name", 'learnpress')))));
62 };
63
64 /***/ },
65
66 /***/ "./assets/src/apps/js/blocks/instructor-elements/instructor-name/save.js"
67 /*!*******************************************************************************!*\
68 !*** ./assets/src/apps/js/blocks/instructor-elements/instructor-name/save.js ***!
69 \*******************************************************************************/
70 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
71
72 __webpack_require__.r(__webpack_exports__);
73 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
74 /* harmony export */ save: () => (/* binding */ save)
75 /* harmony export */ });
76 const save = props => null;
77
78 /***/ },
79
80 /***/ "./assets/src/apps/js/blocks/utilBlock.js"
81 /*!************************************************!*\
82 !*** ./assets/src/apps/js/blocks/utilBlock.js ***!
83 \************************************************/
84 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
85
86 __webpack_require__.r(__webpack_exports__);
87 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
88 /* harmony export */ checkTemplatesCanLoadBlock: () => (/* binding */ checkTemplatesCanLoadBlock)
89 /* harmony export */ });
90 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
91 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
92 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
93 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
94 /**
95 * Check if the block can be loaded in the current template.
96 *
97 * @since 4.2.8.4
98 * @version 1.0.0
99 */
100
101
102 let currentPostIdOld = null;
103 const checkTemplatesCanLoadBlock = (templates, metadata, callBack) => {
104 (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.subscribe)(() => {
105 const metaDataNew = {
106 ...metadata
107 };
108 const store = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.select)('core/editor') || null;
109 if (!store || typeof store.getCurrentPostId !== 'function' || !store.getCurrentPostId()) {
110 return;
111 }
112 const currentPostId = store.getCurrentPostId();
113 if (currentPostId === null) {
114 return;
115 }
116 if (currentPostIdOld === currentPostId) {
117 return;
118 }
119 currentPostIdOld = currentPostId;
120 if ((0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.getBlockType)(metaDataNew.name)) {
121 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.unregisterBlockType)(metaDataNew.name);
122 if (templates.includes(currentPostId)) {
123 metaDataNew.ancestor = null;
124 callBack(metaDataNew);
125 } else {
126 if (!metaDataNew.ancestor) {
127 metaDataNew.ancestor = [];
128 }
129 callBack(metaDataNew);
130 }
131 }
132 });
133 };
134
135
136 /***/ },
137
138 /***/ "react"
139 /*!************************!*\
140 !*** external "React" ***!
141 \************************/
142 (module) {
143
144 module.exports = window["React"];
145
146 /***/ },
147
148 /***/ "react/jsx-runtime"
149 /*!**********************************!*\
150 !*** external "ReactJSXRuntime" ***!
151 \**********************************/
152 (module) {
153
154 module.exports = window["ReactJSXRuntime"];
155
156 /***/ },
157
158 /***/ "@wordpress/block-editor"
159 /*!*************************************!*\
160 !*** external ["wp","blockEditor"] ***!
161 \*************************************/
162 (module) {
163
164 module.exports = window["wp"]["blockEditor"];
165
166 /***/ },
167
168 /***/ "@wordpress/blocks"
169 /*!********************************!*\
170 !*** external ["wp","blocks"] ***!
171 \********************************/
172 (module) {
173
174 module.exports = window["wp"]["blocks"];
175
176 /***/ },
177
178 /***/ "@wordpress/data"
179 /*!******************************!*\
180 !*** external ["wp","data"] ***!
181 \******************************/
182 (module) {
183
184 module.exports = window["wp"]["data"];
185
186 /***/ },
187
188 /***/ "@wordpress/i18n"
189 /*!******************************!*\
190 !*** external ["wp","i18n"] ***!
191 \******************************/
192 (module) {
193
194 module.exports = window["wp"]["i18n"];
195
196 /***/ },
197
198 /***/ "@wordpress/primitives"
199 /*!************************************!*\
200 !*** external ["wp","primitives"] ***!
201 \************************************/
202 (module) {
203
204 module.exports = window["wp"]["primitives"];
205
206 /***/ },
207
208 /***/ "./assets/src/apps/js/blocks/instructor-elements/instructor-name/block.json"
209 /*!**********************************************************************************!*\
210 !*** ./assets/src/apps/js/blocks/instructor-elements/instructor-name/block.json ***!
211 \**********************************************************************************/
212 (module) {
213
214 module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"learnpress/instructor-name","title":"Instructor Name","category":"learnpress-course-elements","icon":"nametag","description":"Renders template Instructor Name PHP templates.","textdomain":"learnpress","keywords":["instructor name single","learnpress"],"ancestor":["learnpress/single-instructor"],"usesContext":[],"supports":{"multiple":false,"align":["wide","full"],"html":false,"typography":{"fontSize":true,"lineHeight":false,"fontWeight":true,"__experimentalFontFamily":false,"__experimentalTextDecoration":false,"__experimentalFontStyle":false,"__experimentalFontWeight":true,"__experimentalLetterSpacing":false,"__experimentalTextTransform":true,"__experimentalDefaultControls":{"fontSize":true}},"color":{"background":false,"text":true,"link":false,"gradients":false,"__experimentalDefaultControls":{"text":true}}}}');
215
216 /***/ }
217
218 /******/ });
219 /************************************************************************/
220 /******/ // The module cache
221 /******/ var __webpack_module_cache__ = {};
222 /******/
223 /******/ // The require function
224 /******/ function __webpack_require__(moduleId) {
225 /******/ // Check if module is in cache
226 /******/ var cachedModule = __webpack_module_cache__[moduleId];
227 /******/ if (cachedModule !== undefined) {
228 /******/ return cachedModule.exports;
229 /******/ }
230 /******/ // Create a new module (and put it into the cache)
231 /******/ var module = __webpack_module_cache__[moduleId] = {
232 /******/ // no module.id needed
233 /******/ // no module.loaded needed
234 /******/ exports: {}
235 /******/ };
236 /******/
237 /******/ // Execute the module function
238 /******/ if (!(moduleId in __webpack_modules__)) {
239 /******/ delete __webpack_module_cache__[moduleId];
240 /******/ var e = new Error("Cannot find module '" + moduleId + "'");
241 /******/ e.code = 'MODULE_NOT_FOUND';
242 /******/ throw e;
243 /******/ }
244 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
245 /******/
246 /******/ // Return the exports of the module
247 /******/ return module.exports;
248 /******/ }
249 /******/
250 /************************************************************************/
251 /******/ /* webpack/runtime/compat get default export */
252 /******/ (() => {
253 /******/ // getDefaultExport function for compatibility with non-harmony modules
254 /******/ __webpack_require__.n = (module) => {
255 /******/ var getter = module && module.__esModule ?
256 /******/ () => (module['default']) :
257 /******/ () => (module);
258 /******/ __webpack_require__.d(getter, { a: getter });
259 /******/ return getter;
260 /******/ };
261 /******/ })();
262 /******/
263 /******/ /* webpack/runtime/define property getters */
264 /******/ (() => {
265 /******/ // define getter functions for harmony exports
266 /******/ __webpack_require__.d = (exports, definition) => {
267 /******/ for(var key in definition) {
268 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
269 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
270 /******/ }
271 /******/ }
272 /******/ };
273 /******/ })();
274 /******/
275 /******/ /* webpack/runtime/hasOwnProperty shorthand */
276 /******/ (() => {
277 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
278 /******/ })();
279 /******/
280 /******/ /* webpack/runtime/make namespace object */
281 /******/ (() => {
282 /******/ // define __esModule on exports
283 /******/ __webpack_require__.r = (exports) => {
284 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
285 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
286 /******/ }
287 /******/ Object.defineProperty(exports, '__esModule', { value: true });
288 /******/ };
289 /******/ })();
290 /******/
291 /************************************************************************/
292 var __webpack_exports__ = {};
293 // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
294 (() => {
295 /*!********************************************************************************!*\
296 !*** ./assets/src/apps/js/blocks/instructor-elements/instructor-name/index.js ***!
297 \********************************************************************************/
298 __webpack_require__.r(__webpack_exports__);
299 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./edit */ "./assets/src/apps/js/blocks/instructor-elements/instructor-name/edit.js");
300 /* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./save */ "./assets/src/apps/js/blocks/instructor-elements/instructor-name/save.js");
301 /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./block.json */ "./assets/src/apps/js/blocks/instructor-elements/instructor-name/block.json");
302 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
303 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__);
304 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/title.js");
305 /* harmony import */ var _utilBlock_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utilBlock.js */ "./assets/src/apps/js/blocks/utilBlock.js");
306 /**
307 * Register block instructor name.
308 */
309
310
311
312
313
314
315 const templatesName = [Number(lpDataAdmin?.single_instructor_id)];
316 (0,_utilBlock_js__WEBPACK_IMPORTED_MODULE_5__.checkTemplatesCanLoadBlock)(templatesName, _block_json__WEBPACK_IMPORTED_MODULE_2__, metadataNew => {
317 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__.registerBlockType)(metadataNew.name, {
318 ...metadataNew,
319 edit: _edit__WEBPACK_IMPORTED_MODULE_0__.edit,
320 save: _save__WEBPACK_IMPORTED_MODULE_1__.save
321 });
322 });
323 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_2__.name, {
324 ..._block_json__WEBPACK_IMPORTED_MODULE_2__,
325 icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"],
326 edit: _edit__WEBPACK_IMPORTED_MODULE_0__.edit,
327 save: _save__WEBPACK_IMPORTED_MODULE_1__.save
328 });
329 })();
330
331 /******/ })()
332 ;
333 //# sourceMappingURL=instructor-name.js.map