PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.3.9.1
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.3.9.1
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-description.js

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

266 lines 12.1 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 /***/ "./assets/src/apps/js/blocks/instructor-elements/instructor-description/edit.js"
6 /*!**************************************************************************************!*\
7 !*** ./assets/src/apps/js/blocks/instructor-elements/instructor-description/edit.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 */ edit: () => (/* binding */ edit)
14 /* harmony export */ });
15 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
16 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
17 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
18 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
19
20
21 const edit = props => {
22 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)();
23 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
24 ...blockProps
25 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
26 className: "instructor-description"
27 }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.'))));
28 };
29
30 /***/ },
31
32 /***/ "./assets/src/apps/js/blocks/instructor-elements/instructor-description/save.js"
33 /*!**************************************************************************************!*\
34 !*** ./assets/src/apps/js/blocks/instructor-elements/instructor-description/save.js ***!
35 \**************************************************************************************/
36 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
37
38 __webpack_require__.r(__webpack_exports__);
39 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
40 /* harmony export */ save: () => (/* binding */ save)
41 /* harmony export */ });
42 const save = props => null;
43
44 /***/ },
45
46 /***/ "./assets/src/apps/js/blocks/utilBlock.js"
47 /*!************************************************!*\
48 !*** ./assets/src/apps/js/blocks/utilBlock.js ***!
49 \************************************************/
50 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
51
52 __webpack_require__.r(__webpack_exports__);
53 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
54 /* harmony export */ checkTemplatesCanLoadBlock: () => (/* binding */ checkTemplatesCanLoadBlock)
55 /* harmony export */ });
56 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
57 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
58 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
59 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
60 /**
61 * Check if the block can be loaded in the current template.
62 *
63 * @since 4.2.8.4
64 * @version 1.0.0
65 */
66
67
68 let currentPostIdOld = null;
69 const checkTemplatesCanLoadBlock = (templates, metadata, callBack) => {
70 (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.subscribe)(() => {
71 const metaDataNew = {
72 ...metadata
73 };
74 const store = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.select)('core/editor') || null;
75 if (!store || typeof store.getCurrentPostId !== 'function' || !store.getCurrentPostId()) {
76 return;
77 }
78 const currentPostId = store.getCurrentPostId();
79 if (currentPostId === null) {
80 return;
81 }
82 if (currentPostIdOld === currentPostId) {
83 return;
84 }
85 currentPostIdOld = currentPostId;
86 if ((0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.getBlockType)(metaDataNew.name)) {
87 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.unregisterBlockType)(metaDataNew.name);
88 if (templates.includes(currentPostId)) {
89 metaDataNew.ancestor = null;
90 callBack(metaDataNew);
91 } else {
92 if (!metaDataNew.ancestor) {
93 metaDataNew.ancestor = [];
94 }
95 callBack(metaDataNew);
96 }
97 }
98 });
99 };
100
101
102 /***/ },
103
104 /***/ "react"
105 /*!************************!*\
106 !*** external "React" ***!
107 \************************/
108 (module) {
109
110 module.exports = window["React"];
111
112 /***/ },
113
114 /***/ "@wordpress/block-editor"
115 /*!*************************************!*\
116 !*** external ["wp","blockEditor"] ***!
117 \*************************************/
118 (module) {
119
120 module.exports = window["wp"]["blockEditor"];
121
122 /***/ },
123
124 /***/ "@wordpress/blocks"
125 /*!********************************!*\
126 !*** external ["wp","blocks"] ***!
127 \********************************/
128 (module) {
129
130 module.exports = window["wp"]["blocks"];
131
132 /***/ },
133
134 /***/ "@wordpress/data"
135 /*!******************************!*\
136 !*** external ["wp","data"] ***!
137 \******************************/
138 (module) {
139
140 module.exports = window["wp"]["data"];
141
142 /***/ },
143
144 /***/ "./assets/src/apps/js/blocks/instructor-elements/instructor-description/block.json"
145 /*!*****************************************************************************************!*\
146 !*** ./assets/src/apps/js/blocks/instructor-elements/instructor-description/block.json ***!
147 \*****************************************************************************************/
148 (module) {
149
150 module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"learnpress/instructor-description","title":"Instructor Description","category":"learnpress-course-elements","icon":"format-image","description":"Renders template Instructor Description PHP templates.","textdomain":"learnpress","keywords":["instructor description 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}}}}');
151
152 /***/ }
153
154 /******/ });
155 /************************************************************************/
156 /******/ // The module cache
157 /******/ var __webpack_module_cache__ = {};
158 /******/
159 /******/ // The require function
160 /******/ function __webpack_require__(moduleId) {
161 /******/ // Check if module is in cache
162 /******/ var cachedModule = __webpack_module_cache__[moduleId];
163 /******/ if (cachedModule !== undefined) {
164 /******/ return cachedModule.exports;
165 /******/ }
166 /******/ // Create a new module (and put it into the cache)
167 /******/ var module = __webpack_module_cache__[moduleId] = {
168 /******/ // no module.id needed
169 /******/ // no module.loaded needed
170 /******/ exports: {}
171 /******/ };
172 /******/
173 /******/ // Execute the module function
174 /******/ if (!(moduleId in __webpack_modules__)) {
175 /******/ delete __webpack_module_cache__[moduleId];
176 /******/ var e = new Error("Cannot find module '" + moduleId + "'");
177 /******/ e.code = 'MODULE_NOT_FOUND';
178 /******/ throw e;
179 /******/ }
180 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
181 /******/
182 /******/ // Return the exports of the module
183 /******/ return module.exports;
184 /******/ }
185 /******/
186 /************************************************************************/
187 /******/ /* webpack/runtime/compat get default export */
188 /******/ (() => {
189 /******/ // getDefaultExport function for compatibility with non-harmony modules
190 /******/ __webpack_require__.n = (module) => {
191 /******/ var getter = module && module.__esModule ?
192 /******/ () => (module['default']) :
193 /******/ () => (module);
194 /******/ __webpack_require__.d(getter, { a: getter });
195 /******/ return getter;
196 /******/ };
197 /******/ })();
198 /******/
199 /******/ /* webpack/runtime/define property getters */
200 /******/ (() => {
201 /******/ // define getter functions for harmony exports
202 /******/ __webpack_require__.d = (exports, definition) => {
203 /******/ for(var key in definition) {
204 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
205 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
206 /******/ }
207 /******/ }
208 /******/ };
209 /******/ })();
210 /******/
211 /******/ /* webpack/runtime/hasOwnProperty shorthand */
212 /******/ (() => {
213 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
214 /******/ })();
215 /******/
216 /******/ /* webpack/runtime/make namespace object */
217 /******/ (() => {
218 /******/ // define __esModule on exports
219 /******/ __webpack_require__.r = (exports) => {
220 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
221 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
222 /******/ }
223 /******/ Object.defineProperty(exports, '__esModule', { value: true });
224 /******/ };
225 /******/ })();
226 /******/
227 /************************************************************************/
228 var __webpack_exports__ = {};
229 // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
230 (() => {
231 /*!***************************************************************************************!*\
232 !*** ./assets/src/apps/js/blocks/instructor-elements/instructor-description/index.js ***!
233 \***************************************************************************************/
234 __webpack_require__.r(__webpack_exports__);
235 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./edit */ "./assets/src/apps/js/blocks/instructor-elements/instructor-description/edit.js");
236 /* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./save */ "./assets/src/apps/js/blocks/instructor-elements/instructor-description/save.js");
237 /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./block.json */ "./assets/src/apps/js/blocks/instructor-elements/instructor-description/block.json");
238 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
239 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__);
240 /* harmony import */ var _utilBlock_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utilBlock.js */ "./assets/src/apps/js/blocks/utilBlock.js");
241 /**
242 * Register block instructor description property.
243 */
244
245
246
247
248
249 const templatesName = [Number(lpDataAdmin?.single_instructor_id)];
250 (0,_utilBlock_js__WEBPACK_IMPORTED_MODULE_4__.checkTemplatesCanLoadBlock)(templatesName, _block_json__WEBPACK_IMPORTED_MODULE_2__, metadataNew => {
251 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__.registerBlockType)(metadataNew.name, {
252 ...metadataNew,
253 edit: _edit__WEBPACK_IMPORTED_MODULE_0__.edit,
254 save: _save__WEBPACK_IMPORTED_MODULE_1__.save
255 });
256 });
257 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_2__.name, {
258 ..._block_json__WEBPACK_IMPORTED_MODULE_2__,
259 edit: _edit__WEBPACK_IMPORTED_MODULE_0__.edit,
260 save: _save__WEBPACK_IMPORTED_MODULE_1__.save
261 });
262 })();
263
264 /******/ })()
265 ;
266 //# sourceMappingURL=instructor-description.js.map