| 1 |
/******/ (() => { // webpackBootstrap |
| 2 |
/******/ var __webpack_modules__ = ({ |
| 3 |
|
| 4 |
/***/ "./assets/src/apps/js/blocks/courses/course-item-template/edit.js" |
| 5 |
/*!************************************************************************!*\ |
| 6 |
!*** ./assets/src/apps/js/blocks/courses/course-item-template/edit.js ***! |
| 7 |
\************************************************************************/ |
| 8 |
(__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| 9 |
|
| 10 |
"use strict"; |
| 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 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 |
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); |
| 20 |
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); |
| 21 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); |
| 22 |
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); |
| 23 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 24 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__); |
| 25 |
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); |
| 26 |
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__); |
| 27 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 28 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__); |
| 29 |
/* harmony import */ var lpAssetsJsPath_utils_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lpAssetsJsPath/utils.js */ "./assets/src/js/utils.js"); |
| 30 |
/* harmony import */ var lpAssetsJsPath_api_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lpAssetsJsPath/api.js */ "./assets/src/js/api.js"); |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
const TEMPLATE_DEFAULT = [['learnpress/course-image'], ['learnpress/course-title'], ['learnpress/course-price']]; |
| 41 |
function PostTemplateInnerBlocks({ |
| 42 |
classList |
| 43 |
}) { |
| 44 |
const innerBlocksProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useInnerBlocksProps)({ |
| 45 |
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('wp-block-learnpress-course-item-template') |
| 46 |
}, { |
| 47 |
template: TEMPLATE_DEFAULT |
| 48 |
}); |
| 49 |
return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("li", { |
| 50 |
className: "course" |
| 51 |
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 52 |
...innerBlocksProps |
| 53 |
})); |
| 54 |
} |
| 55 |
function PostTemplateBlockPreview({ |
| 56 |
blocks, |
| 57 |
blockContextId, |
| 58 |
classList, |
| 59 |
isHidden, |
| 60 |
setActiveBlockContextId |
| 61 |
}) { |
| 62 |
const blockPreviewProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.__experimentalUseBlockPreview)({ |
| 63 |
blocks |
| 64 |
}); |
| 65 |
const handleOnClick = () => { |
| 66 |
setActiveBlockContextId(blockContextId); |
| 67 |
}; |
| 68 |
const style = { |
| 69 |
display: isHidden ? 'none' : undefined |
| 70 |
}; |
| 71 |
return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("li", { |
| 72 |
className: "course", |
| 73 |
tabIndex: 0 |
| 74 |
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role |
| 75 |
, |
| 76 |
role: "button", |
| 77 |
onClick: handleOnClick, |
| 78 |
onKeyPress: handleOnClick, |
| 79 |
style: style |
| 80 |
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 81 |
...blockPreviewProps, |
| 82 |
className: "wp-block-learnpress-course-item-template" |
| 83 |
})); |
| 84 |
} |
| 85 |
const fetchLearnPressCourses = async (courseQuery, signal) => { |
| 86 |
let url = lpAssetsJsPath_api_js__WEBPACK_IMPORTED_MODULE_8__["default"].apiEditCoursesArchiveBlock; |
| 87 |
url = lpAssetsJsPath_utils_js__WEBPACK_IMPORTED_MODULE_7__.lpAddQueryArgs(url, courseQuery); |
| 88 |
const response = await fetch(url, { |
| 89 |
method: 'GET', |
| 90 |
signal |
| 91 |
}); |
| 92 |
if (!response.ok) { |
| 93 |
throw new Error(`HTTP error! Status: ${response.status}`); |
| 94 |
} |
| 95 |
return await response.json(); |
| 96 |
}; |
| 97 |
const MemoizedPostTemplateBlockPreview = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.memo)(PostTemplateBlockPreview); |
| 98 |
const Edit = ({ |
| 99 |
clientId, |
| 100 |
context, |
| 101 |
attributes, |
| 102 |
setAttributes |
| 103 |
}) => { |
| 104 |
const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({ |
| 105 |
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('learn-press-courses') |
| 106 |
}); |
| 107 |
const [activeBlockContextId, setActiveBlockContextId] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(); |
| 108 |
const [coursesData, setCoursesData] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(); |
| 109 |
const [listCourses, setListCourses] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)([]); |
| 110 |
const [loadingAPI, setLoadingAPI] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(0); |
| 111 |
// const [ totalPages, setTotalPages ] = useState( 1 ); |
| 112 |
const { |
| 113 |
columns |
| 114 |
} = attributes; |
| 115 |
const layoutPagination = context.lpCourseQuery?.pagination_type || 'number'; |
| 116 |
|
| 117 |
// Fetch courses when query parameters change |
| 118 |
(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => { |
| 119 |
var _context$lpCourseQuer; |
| 120 |
const courseQuery = (_context$lpCourseQuer = context.lpCourseQuery) !== null && _context$lpCourseQuer !== void 0 ? _context$lpCourseQuer : {}; |
| 121 |
let signal, controller; |
| 122 |
const fetchCourses = async () => { |
| 123 |
try { |
| 124 |
setLoadingAPI(1); |
| 125 |
controller = new AbortController(); |
| 126 |
signal = controller.signal; |
| 127 |
const response = await fetchLearnPressCourses(courseQuery, signal); |
| 128 |
const { |
| 129 |
data |
| 130 |
} = response; |
| 131 |
const { |
| 132 |
courses, |
| 133 |
page, |
| 134 |
total, |
| 135 |
total_pages |
| 136 |
} = data; |
| 137 |
setCoursesData(response); |
| 138 |
setListCourses(courses); |
| 139 |
// setTotalPages( total_pages ); |
| 140 |
} catch (error) { |
| 141 |
if (error.name !== 'AbortError') { |
| 142 |
console.error('Failed to fetch courses:', error); |
| 143 |
} |
| 144 |
} finally { |
| 145 |
setLoadingAPI(0); |
| 146 |
} |
| 147 |
}; |
| 148 |
fetchCourses(); |
| 149 |
return () => { |
| 150 |
controller.abort(); |
| 151 |
}; |
| 152 |
}, [context.lpCourseQuery?.order_by, context.lpCourseQuery?.limit]); |
| 153 |
const { |
| 154 |
blocks |
| 155 |
} = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => { |
| 156 |
const { |
| 157 |
getBlocks |
| 158 |
} = select(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.store); |
| 159 |
return { |
| 160 |
blocks: getBlocks(clientId) |
| 161 |
}; |
| 162 |
}, [clientId]); |
| 163 |
const blockContexts = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useMemo)(() => listCourses?.map(course => ({ |
| 164 |
lpCourseData: course, |
| 165 |
courseId: course?.ID |
| 166 |
})), [listCourses]); |
| 167 |
if (loadingAPI) { |
| 168 |
return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("ul", { |
| 169 |
...blockProps |
| 170 |
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("li", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Courses Fetching…', 'learnpress'))); |
| 171 |
} |
| 172 |
if (listCourses.length === 0 && !loadingAPI) { |
| 173 |
const dataDummy = [{ |
| 174 |
ID: 1, |
| 175 |
post_title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Course One', 'learnpress') |
| 176 |
}, { |
| 177 |
ID: 2, |
| 178 |
post_title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Course two', 'learnpress') |
| 179 |
}]; |
| 180 |
setListCourses(dataDummy); |
| 181 |
} |
| 182 |
function paginationTypeDisplay(type) { |
| 183 |
switch (type) { |
| 184 |
case 'load-more': |
| 185 |
return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", { |
| 186 |
className: "courses-btn-load-more" |
| 187 |
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Load More', 'learnpress')); |
| 188 |
case 'infinite': |
| 189 |
return ''; |
| 190 |
default: |
| 191 |
return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("nav", { |
| 192 |
className: "learnpress-block-pagination navigation pagination" |
| 193 |
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("ul", { |
| 194 |
className: "page-numbers" |
| 195 |
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("li", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", { |
| 196 |
className: "prev page-numbers", |
| 197 |
href: "?paged=1" |
| 198 |
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", { |
| 199 |
className: "lp-icon-arrow-left" |
| 200 |
}))), Array.from({ |
| 201 |
length: 3 |
| 202 |
}, (_, index) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("li", { |
| 203 |
key: index |
| 204 |
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", { |
| 205 |
className: "page-numbers", |
| 206 |
href: "{index}" |
| 207 |
}, index + 1))))); |
| 208 |
} |
| 209 |
} |
| 210 |
return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.PanelBody, { |
| 211 |
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Settings', 'learnpress') |
| 212 |
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.__experimentalToggleGroupControl, { |
| 213 |
label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Layout', 'learnpress'), |
| 214 |
value: attributes.layout || 'gird', |
| 215 |
onChange: value => { |
| 216 |
setAttributes({ |
| 217 |
layout: value || 'gird' |
| 218 |
}); |
| 219 |
}, |
| 220 |
isBlock: true |
| 221 |
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.__experimentalToggleGroupControlOption, { |
| 222 |
value: "list", |
| 223 |
label: "Stack" |
| 224 |
}), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.__experimentalToggleGroupControlOption, { |
| 225 |
value: "grid", |
| 226 |
label: "Grid" |
| 227 |
})), attributes.layout === 'grid' && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.RangeControl, { |
| 228 |
label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Columns', 'learnpress'), |
| 229 |
value: attributes.columns || 3, |
| 230 |
onChange: value => { |
| 231 |
setAttributes({ |
| 232 |
columns: value |
| 233 |
}); |
| 234 |
}, |
| 235 |
min: 2, |
| 236 |
max: 6, |
| 237 |
step: 1, |
| 238 |
marks: [{ |
| 239 |
value: 2, |
| 240 |
label: '2' |
| 241 |
}, { |
| 242 |
value: 3, |
| 243 |
label: '3' |
| 244 |
}, { |
| 245 |
value: 4, |
| 246 |
label: '4' |
| 247 |
}, { |
| 248 |
value: 5, |
| 249 |
label: '5' |
| 250 |
}, { |
| 251 |
value: 6, |
| 252 |
label: '6' |
| 253 |
}], |
| 254 |
withInputField: true |
| 255 |
}))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("ul", { |
| 256 |
className: "learn-press-courses wp-block-learn-press-courses", |
| 257 |
"data-layout": attributes.layout ? attributes.layout : 'list', |
| 258 |
style: { |
| 259 |
'--columns': attributes.columns || 3 |
| 260 |
} |
| 261 |
}, blockContexts && blockContexts.map(blockContext => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.BlockContextProvider, { |
| 262 |
key: blockContext.courseId, |
| 263 |
value: blockContext |
| 264 |
}, blockContext.courseId === (activeBlockContextId || blockContexts[0]?.courseId) ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(PostTemplateInnerBlocks, { |
| 265 |
classList: blockContext.classList |
| 266 |
}) : null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(MemoizedPostTemplateBlockPreview, { |
| 267 |
blocks: blocks, |
| 268 |
blockContextId: blockContext.courseId, |
| 269 |
classList: blockContext.classList, |
| 270 |
setActiveBlockContextId: setActiveBlockContextId, |
| 271 |
isHidden: blockContext.courseId === (activeBlockContextId || blockContexts[0]?.courseId) |
| 272 |
})))), context.lpCourseQuery?.pagination ? paginationTypeDisplay(layoutPagination) : null); |
| 273 |
}; |
| 274 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Edit); |
| 275 |
|
| 276 |
/***/ }, |
| 277 |
|
| 278 |
/***/ "./assets/src/apps/js/blocks/courses/course-item-template/save.js" |
| 279 |
/*!************************************************************************!*\ |
| 280 |
!*** ./assets/src/apps/js/blocks/courses/course-item-template/save.js ***! |
| 281 |
\************************************************************************/ |
| 282 |
(__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| 283 |
|
| 284 |
"use strict"; |
| 285 |
__webpack_require__.r(__webpack_exports__); |
| 286 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 287 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 288 |
/* harmony export */ }); |
| 289 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 290 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 291 |
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); |
| 292 |
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); |
| 293 |
|
| 294 |
|
| 295 |
const Save = props => { |
| 296 |
const blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save(); |
| 297 |
return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 298 |
...blockProps |
| 299 |
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null)); |
| 300 |
}; |
| 301 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Save); |
| 302 |
|
| 303 |
/***/ }, |
| 304 |
|
| 305 |
/***/ "./assets/src/js/api.js" |
| 306 |
/*!******************************!*\ |
| 307 |
!*** ./assets/src/js/api.js ***! |
| 308 |
\******************************/ |
| 309 |
(__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| 310 |
|
| 311 |
"use strict"; |
| 312 |
__webpack_require__.r(__webpack_exports__); |
| 313 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 314 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 315 |
/* harmony export */ }); |
| 316 |
/** |
| 317 |
* List API on backend |
| 318 |
* |
| 319 |
* @since 4.2.6 |
| 320 |
* @version 1.0.2 |
| 321 |
*/ |
| 322 |
|
| 323 |
const lplistAPI = {}; |
| 324 |
let lp_rest_url; |
| 325 |
if ('undefined' !== typeof lpDataAdmin) { |
| 326 |
lp_rest_url = lpDataAdmin.lp_rest_url; |
| 327 |
lplistAPI.admin = { |
| 328 |
apiAdminNotice: lp_rest_url + 'lp/v1/admin/tools/admin-notices', |
| 329 |
apiAddons: lp_rest_url + 'lp/v1/addon/all', |
| 330 |
apiAddonAction: lp_rest_url + 'lp/v1/addon/action-n', |
| 331 |
apiAddonsPurchase: lp_rest_url + 'lp/v1/addon/info-addons-purchase', |
| 332 |
apiSearchCourses: lp_rest_url + 'lp/v1/admin/tools/search-course', |
| 333 |
apiSearchUsers: lp_rest_url + 'lp/v1/admin/tools/search-user', |
| 334 |
apiAssignUserCourse: lp_rest_url + 'lp/v1/admin/tools/assign-user-course', |
| 335 |
apiUnAssignUserCourse: lp_rest_url + 'lp/v1/admin/tools/unassign-user-course' |
| 336 |
}; |
| 337 |
} |
| 338 |
if ('undefined' !== typeof lpData) { |
| 339 |
lp_rest_url = lpData.lp_rest_url; |
| 340 |
lplistAPI.frontend = { |
| 341 |
apiWidgets: lp_rest_url + 'lp/v1/widgets/api', |
| 342 |
apiCourses: lp_rest_url + 'lp/v1/courses/archive-course', |
| 343 |
// Deprecated API, don't load from v4.3.7 |
| 344 |
apiAJAX: lp_rest_url + 'lp/v1/load_content_via_ajax/', |
| 345 |
// Deprecated since 4.3.0 |
| 346 |
apiProfileCoverImage: lp_rest_url + 'lp/v1/profile/cover-image' |
| 347 |
}; |
| 348 |
} |
| 349 |
if (lp_rest_url) { |
| 350 |
lplistAPI.apiCourses = lp_rest_url + 'lp/v1/courses/'; |
| 351 |
lplistAPI.apiEditCoursesArchiveBlock = lp_rest_url + 'lp/v1/courses/edit-archive-block'; |
| 352 |
lplistAPI.apiCoursesSuggest = lp_rest_url + 'lp/v1/courses/courses-suggest'; |
| 353 |
} |
| 354 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (lplistAPI); |
| 355 |
|
| 356 |
/***/ }, |
| 357 |
|
| 358 |
/***/ "./assets/src/js/utils.js" |
| 359 |
/*!********************************!*\ |
| 360 |
!*** ./assets/src/js/utils.js ***! |
| 361 |
\********************************/ |
| 362 |
(__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| 363 |
|
| 364 |
"use strict"; |
| 365 |
__webpack_require__.r(__webpack_exports__); |
| 366 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 367 |
/* harmony export */ debounce: () => (/* binding */ debounce), |
| 368 |
/* harmony export */ eventHandlers: () => (/* binding */ eventHandlers), |
| 369 |
/* harmony export */ getDataOfForm: () => (/* binding */ getDataOfForm), |
| 370 |
/* harmony export */ getFieldKeysOfForm: () => (/* binding */ getFieldKeysOfForm), |
| 371 |
/* harmony export */ listenElementCreated: () => (/* binding */ listenElementCreated), |
| 372 |
/* harmony export */ listenElementViewed: () => (/* binding */ listenElementViewed), |
| 373 |
/* harmony export */ lpAddQueryArgs: () => (/* binding */ lpAddQueryArgs), |
| 374 |
/* harmony export */ lpAjaxParseJsonOld: () => (/* binding */ lpAjaxParseJsonOld), |
| 375 |
/* harmony export */ lpClassName: () => (/* binding */ lpClassName), |
| 376 |
/* harmony export */ lpFetchAPI: () => (/* binding */ lpFetchAPI), |
| 377 |
/* harmony export */ lpGetCurrentURLNoParam: () => (/* binding */ lpGetCurrentURLNoParam), |
| 378 |
/* harmony export */ lpOnElementReady: () => (/* binding */ lpOnElementReady), |
| 379 |
/* harmony export */ lpSetLoadingEl: () => (/* binding */ lpSetLoadingEl), |
| 380 |
/* harmony export */ lpShowHideEl: () => (/* binding */ lpShowHideEl), |
| 381 |
/* harmony export */ mergeDataWithDatForm: () => (/* binding */ mergeDataWithDatForm), |
| 382 |
/* harmony export */ toggleCollapse: () => (/* binding */ toggleCollapse) |
| 383 |
/* harmony export */ }); |
| 384 |
/** |
| 385 |
* Utils functions |
| 386 |
* |
| 387 |
* @param url |
| 388 |
* @param data |
| 389 |
* @param functions |
| 390 |
* @since 4.2.5.1 |
| 391 |
* @version 1.0.6 |
| 392 |
*/ |
| 393 |
const lpClassName = { |
| 394 |
hidden: 'lp-hidden', |
| 395 |
loading: 'loading', |
| 396 |
elCollapse: 'lp-collapse', |
| 397 |
elSectionToggle: '.lp-section-toggle', |
| 398 |
elTriggerToggle: '.lp-trigger-toggle' |
| 399 |
}; |
| 400 |
const lpFetchAPI = (url, data = {}, functions = {}) => { |
| 401 |
if ('function' === typeof functions.before) { |
| 402 |
functions.before(); |
| 403 |
} |
| 404 |
fetch(url, { |
| 405 |
method: 'GET', |
| 406 |
...data |
| 407 |
}).then(response => response.json()).then(response => { |
| 408 |
if ('function' === typeof functions.success) { |
| 409 |
functions.success(response); |
| 410 |
} |
| 411 |
}).catch(err => { |
| 412 |
if ('function' === typeof functions.error) { |
| 413 |
functions.error(err); |
| 414 |
} |
| 415 |
}).finally(() => { |
| 416 |
if ('function' === typeof functions.completed) { |
| 417 |
functions.completed(); |
| 418 |
} |
| 419 |
}); |
| 420 |
}; |
| 421 |
|
| 422 |
/** |
| 423 |
* Get current URL without params. |
| 424 |
* |
| 425 |
* @since 4.2.5.1 |
| 426 |
*/ |
| 427 |
const lpGetCurrentURLNoParam = () => { |
| 428 |
let currentUrl = window.location.href; |
| 429 |
const hasParams = currentUrl.includes('?'); |
| 430 |
if (hasParams) { |
| 431 |
currentUrl = currentUrl.split('?')[0]; |
| 432 |
} |
| 433 |
return currentUrl; |
| 434 |
}; |
| 435 |
const lpAddQueryArgs = (endpoint, args) => { |
| 436 |
const url = new URL(endpoint); |
| 437 |
Object.keys(args).forEach(arg => { |
| 438 |
url.searchParams.set(arg, args[arg]); |
| 439 |
}); |
| 440 |
return url; |
| 441 |
}; |
| 442 |
|
| 443 |
/** |
| 444 |
* Listen element viewed. |
| 445 |
* |
| 446 |
* @param el |
| 447 |
* @param callback |
| 448 |
* @since 4.2.5.8 |
| 449 |
*/ |
| 450 |
const listenElementViewed = (el, callback) => { |
| 451 |
const observerSeeItem = new IntersectionObserver(function (entries) { |
| 452 |
for (const entry of entries) { |
| 453 |
if (entry.isIntersecting) { |
| 454 |
callback(entry); |
| 455 |
} |
| 456 |
} |
| 457 |
}); |
| 458 |
observerSeeItem.observe(el); |
| 459 |
}; |
| 460 |
|
| 461 |
/** |
| 462 |
* Listen element created. |
| 463 |
* |
| 464 |
* @param callback |
| 465 |
* @since 4.2.5.8 |
| 466 |
*/ |
| 467 |
const listenElementCreated = callback => { |
| 468 |
const observerCreateItem = new MutationObserver(function (mutations) { |
| 469 |
mutations.forEach(function (mutation) { |
| 470 |
if (mutation.addedNodes) { |
| 471 |
mutation.addedNodes.forEach(function (node) { |
| 472 |
if (node.nodeType === 1) { |
| 473 |
callback(node); |
| 474 |
} |
| 475 |
}); |
| 476 |
} |
| 477 |
}); |
| 478 |
}); |
| 479 |
observerCreateItem.observe(document, { |
| 480 |
childList: true, |
| 481 |
subtree: true |
| 482 |
}); |
| 483 |
// End. |
| 484 |
}; |
| 485 |
|
| 486 |
/** |
| 487 |
* Listen element created. |
| 488 |
* |
| 489 |
* @param selector |
| 490 |
* @param callback |
| 491 |
* @since 4.2.7.1 |
| 492 |
*/ |
| 493 |
const lpOnElementReady = (selector, callback) => { |
| 494 |
const element = document.querySelector(selector); |
| 495 |
if (element) { |
| 496 |
callback(element); |
| 497 |
return; |
| 498 |
} |
| 499 |
const observer = new MutationObserver((mutations, obs) => { |
| 500 |
const element = document.querySelector(selector); |
| 501 |
if (element) { |
| 502 |
obs.disconnect(); |
| 503 |
callback(element); |
| 504 |
} |
| 505 |
}); |
| 506 |
observer.observe(document.documentElement, { |
| 507 |
childList: true, |
| 508 |
subtree: true |
| 509 |
}); |
| 510 |
}; |
| 511 |
|
| 512 |
// Parse JSON from string with content include LP_AJAX_START. |
| 513 |
const lpAjaxParseJsonOld = data => { |
| 514 |
if (typeof data !== 'string') { |
| 515 |
return data; |
| 516 |
} |
| 517 |
const m = String.raw({ |
| 518 |
raw: data |
| 519 |
}).match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/s); |
| 520 |
try { |
| 521 |
if (m) { |
| 522 |
data = JSON.parse(m[1].replace(/(?:\r\n|\r|\n)/g, '')); |
| 523 |
} else { |
| 524 |
data = JSON.parse(data); |
| 525 |
} |
| 526 |
} catch (e) { |
| 527 |
data = {}; |
| 528 |
} |
| 529 |
return data; |
| 530 |
}; |
| 531 |
|
| 532 |
// status 0: hide, 1: show |
| 533 |
const lpShowHideEl = (el, status = 0) => { |
| 534 |
if (!el) { |
| 535 |
return; |
| 536 |
} |
| 537 |
if (!status) { |
| 538 |
el.classList.add(lpClassName.hidden); |
| 539 |
} else { |
| 540 |
el.classList.remove(lpClassName.hidden); |
| 541 |
} |
| 542 |
}; |
| 543 |
|
| 544 |
// status 0: hide, 1: show |
| 545 |
const lpSetLoadingEl = (el, status) => { |
| 546 |
if (!el) { |
| 547 |
return; |
| 548 |
} |
| 549 |
if (!status) { |
| 550 |
el.classList.remove(lpClassName.loading); |
| 551 |
} else { |
| 552 |
el.classList.add(lpClassName.loading); |
| 553 |
} |
| 554 |
}; |
| 555 |
|
| 556 |
// Toggle collapse section |
| 557 |
const toggleCollapse = (e, target, elTriggerClassName = '', elsExclude = [], callback) => { |
| 558 |
if (!elTriggerClassName) { |
| 559 |
elTriggerClassName = lpClassName.elTriggerToggle; |
| 560 |
} |
| 561 |
|
| 562 |
// Exclude elements, which should not trigger the collapse toggle |
| 563 |
if (elsExclude && elsExclude.length > 0) { |
| 564 |
for (const elExclude of elsExclude) { |
| 565 |
if (target.closest(elExclude)) { |
| 566 |
return; |
| 567 |
} |
| 568 |
} |
| 569 |
} |
| 570 |
const elTrigger = target.closest(elTriggerClassName); |
| 571 |
if (!elTrigger) { |
| 572 |
return; |
| 573 |
} |
| 574 |
|
| 575 |
//console.log( 'elTrigger', elTrigger ); |
| 576 |
|
| 577 |
const elSectionToggle = elTrigger.closest(`${lpClassName.elSectionToggle}`); |
| 578 |
if (!elSectionToggle) { |
| 579 |
return; |
| 580 |
} |
| 581 |
elSectionToggle.classList.toggle(`${lpClassName.elCollapse}`); |
| 582 |
if ('function' === typeof callback) { |
| 583 |
callback(elSectionToggle); |
| 584 |
} |
| 585 |
}; |
| 586 |
|
| 587 |
// Get data of form |
| 588 |
const getDataOfForm = form => { |
| 589 |
const dataSend = {}; |
| 590 |
const formData = new FormData(form); |
| 591 |
for (const pair of formData.entries()) { |
| 592 |
const key = pair[0]; |
| 593 |
const value = formData.getAll(key); |
| 594 |
if (!dataSend.hasOwnProperty(key)) { |
| 595 |
// Convert value array to string. |
| 596 |
dataSend[key] = value.join(','); |
| 597 |
} |
| 598 |
} |
| 599 |
return dataSend; |
| 600 |
}; |
| 601 |
|
| 602 |
// Get field keys of form |
| 603 |
const getFieldKeysOfForm = form => { |
| 604 |
const keys = []; |
| 605 |
const elements = form.elements; |
| 606 |
for (let i = 0; i < elements.length; i++) { |
| 607 |
const name = elements[i].name; |
| 608 |
if (name && !keys.includes(name)) { |
| 609 |
keys.push(name); |
| 610 |
} |
| 611 |
} |
| 612 |
return keys; |
| 613 |
}; |
| 614 |
|
| 615 |
// Merge data handle with data form. |
| 616 |
const mergeDataWithDatForm = (elForm, dataHandle) => { |
| 617 |
const dataForm = getDataOfForm(elForm); |
| 618 |
const keys = getFieldKeysOfForm(elForm); |
| 619 |
keys.forEach(key => { |
| 620 |
if (!dataForm.hasOwnProperty(key)) { |
| 621 |
delete dataHandle[key]; |
| 622 |
} else if (dataForm[key][0] === '') { |
| 623 |
delete dataForm[key]; |
| 624 |
delete dataHandle[key]; |
| 625 |
} |
| 626 |
}); |
| 627 |
dataHandle = { |
| 628 |
...dataHandle, |
| 629 |
...dataForm |
| 630 |
}; |
| 631 |
return dataHandle; |
| 632 |
}; |
| 633 |
|
| 634 |
/** |
| 635 |
* Event trigger |
| 636 |
* For each list of event handlers, listen event on document. |
| 637 |
* |
| 638 |
* eventName: 'click', 'change', ... |
| 639 |
* eventHandlers = [ { selector: '.lp-button', callBack: function(){}, class: object } ] |
| 640 |
* |
| 641 |
* @param eventName |
| 642 |
* @param eventHandlers |
| 643 |
*/ |
| 644 |
const eventHandlers = (eventName, eventHandlers) => { |
| 645 |
document.addEventListener(eventName, e => { |
| 646 |
const target = e.target; |
| 647 |
let args = { |
| 648 |
e, |
| 649 |
target |
| 650 |
}; |
| 651 |
eventHandlers.forEach(eventHandler => { |
| 652 |
args = { |
| 653 |
...args, |
| 654 |
...eventHandler |
| 655 |
}; |
| 656 |
|
| 657 |
//console.log( args ); |
| 658 |
|
| 659 |
// Check condition before call back |
| 660 |
if (eventHandler.conditionBeforeCallBack) { |
| 661 |
if (eventHandler.conditionBeforeCallBack(args) !== true) { |
| 662 |
return; |
| 663 |
} |
| 664 |
} |
| 665 |
|
| 666 |
// Special check for keydown event with checkIsEventEnter = true |
| 667 |
if (eventName === 'keydown' && eventHandler.checkIsEventEnter) { |
| 668 |
if (e.key !== 'Enter') { |
| 669 |
return; |
| 670 |
} |
| 671 |
} |
| 672 |
if (target.closest(eventHandler.selector)) { |
| 673 |
if (eventHandler.class) { |
| 674 |
// Call method of class, function callBack will understand exactly {this} is class object. |
| 675 |
eventHandler.class[eventHandler.callBack](args); |
| 676 |
} else { |
| 677 |
// For send args is objected, {this} is eventHandler object, not class object. |
| 678 |
eventHandler.callBack(args); |
| 679 |
} |
| 680 |
} |
| 681 |
}); |
| 682 |
}); |
| 683 |
}; |
| 684 |
|
| 685 |
/** |
| 686 |
* Debounce - delays function execution until after `wait` ms of inactivity. |
| 687 |
* |
| 688 |
* Each call resets the timer. Only the last call in a burst executes. |
| 689 |
* |
| 690 |
* USE CASES: |
| 691 |
* - Search inputs, form validation, window resize |
| 692 |
* - Multiple elements need independent timers |
| 693 |
* - When you need to call with different arguments |
| 694 |
* |
| 695 |
* EXAMPLES: |
| 696 |
* const debouncedSearch = debounce( (query) => fetchResults(query), 300 ); |
| 697 |
* searchInput.addEventListener('input', (e) => debouncedSearch(e.target.value)); |
| 698 |
* |
| 699 |
* const debouncedResize = debounce( recalculateLayout, 250 ); |
| 700 |
* window.addEventListener('resize', debouncedResize); |
| 701 |
* |
| 702 |
* ⚠️ Create ONCE outside event handlers, not inside. |
| 703 |
* |
| 704 |
* @param {Function} func - Function to debounce (can be anonymous) |
| 705 |
* @param {number} wait - Milliseconds to wait (default: 500) |
| 706 |
* @return {Function} Debounced wrapper function |
| 707 |
* @since 4.3.7 |
| 708 |
* @version 1.0.0 |
| 709 |
*/ |
| 710 |
const debounce = (func, wait = 500) => { |
| 711 |
let timer; |
| 712 |
return args => { |
| 713 |
clearTimeout(timer); |
| 714 |
timer = setTimeout(() => func(args), wait); |
| 715 |
}; |
| 716 |
}; |
| 717 |
|
| 718 |
/***/ }, |
| 719 |
|
| 720 |
/***/ "react" |
| 721 |
/*!************************!*\ |
| 722 |
!*** external "React" ***! |
| 723 |
\************************/ |
| 724 |
(module) { |
| 725 |
|
| 726 |
"use strict"; |
| 727 |
module.exports = window["React"]; |
| 728 |
|
| 729 |
/***/ }, |
| 730 |
|
| 731 |
/***/ "@wordpress/block-editor" |
| 732 |
/*!*************************************!*\ |
| 733 |
!*** external ["wp","blockEditor"] ***! |
| 734 |
\*************************************/ |
| 735 |
(module) { |
| 736 |
|
| 737 |
"use strict"; |
| 738 |
module.exports = window["wp"]["blockEditor"]; |
| 739 |
|
| 740 |
/***/ }, |
| 741 |
|
| 742 |
/***/ "@wordpress/blocks" |
| 743 |
/*!********************************!*\ |
| 744 |
!*** external ["wp","blocks"] ***! |
| 745 |
\********************************/ |
| 746 |
(module) { |
| 747 |
|
| 748 |
"use strict"; |
| 749 |
module.exports = window["wp"]["blocks"]; |
| 750 |
|
| 751 |
/***/ }, |
| 752 |
|
| 753 |
/***/ "@wordpress/components" |
| 754 |
/*!************************************!*\ |
| 755 |
!*** external ["wp","components"] ***! |
| 756 |
\************************************/ |
| 757 |
(module) { |
| 758 |
|
| 759 |
"use strict"; |
| 760 |
module.exports = window["wp"]["components"]; |
| 761 |
|
| 762 |
/***/ }, |
| 763 |
|
| 764 |
/***/ "@wordpress/data" |
| 765 |
/*!******************************!*\ |
| 766 |
!*** external ["wp","data"] ***! |
| 767 |
\******************************/ |
| 768 |
(module) { |
| 769 |
|
| 770 |
"use strict"; |
| 771 |
module.exports = window["wp"]["data"]; |
| 772 |
|
| 773 |
/***/ }, |
| 774 |
|
| 775 |
/***/ "@wordpress/element" |
| 776 |
/*!*********************************!*\ |
| 777 |
!*** external ["wp","element"] ***! |
| 778 |
\*********************************/ |
| 779 |
(module) { |
| 780 |
|
| 781 |
"use strict"; |
| 782 |
module.exports = window["wp"]["element"]; |
| 783 |
|
| 784 |
/***/ }, |
| 785 |
|
| 786 |
/***/ "@wordpress/i18n" |
| 787 |
/*!******************************!*\ |
| 788 |
!*** external ["wp","i18n"] ***! |
| 789 |
\******************************/ |
| 790 |
(module) { |
| 791 |
|
| 792 |
"use strict"; |
| 793 |
module.exports = window["wp"]["i18n"]; |
| 794 |
|
| 795 |
/***/ }, |
| 796 |
|
| 797 |
/***/ "./node_modules/classnames/index.js" |
| 798 |
/*!******************************************!*\ |
| 799 |
!*** ./node_modules/classnames/index.js ***! |
| 800 |
\******************************************/ |
| 801 |
(module, exports) { |
| 802 |
|
| 803 |
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! |
| 804 |
Copyright (c) 2018 Jed Watson. |
| 805 |
Licensed under the MIT License (MIT), see |
| 806 |
http://jedwatson.github.io/classnames |
| 807 |
*/ |
| 808 |
/* global define */ |
| 809 |
|
| 810 |
(function () { |
| 811 |
'use strict'; |
| 812 |
|
| 813 |
var hasOwn = {}.hasOwnProperty; |
| 814 |
|
| 815 |
function classNames () { |
| 816 |
var classes = ''; |
| 817 |
|
| 818 |
for (var i = 0; i < arguments.length; i++) { |
| 819 |
var arg = arguments[i]; |
| 820 |
if (arg) { |
| 821 |
classes = appendClass(classes, parseValue(arg)); |
| 822 |
} |
| 823 |
} |
| 824 |
|
| 825 |
return classes; |
| 826 |
} |
| 827 |
|
| 828 |
function parseValue (arg) { |
| 829 |
if (typeof arg === 'string' || typeof arg === 'number') { |
| 830 |
return arg; |
| 831 |
} |
| 832 |
|
| 833 |
if (typeof arg !== 'object') { |
| 834 |
return ''; |
| 835 |
} |
| 836 |
|
| 837 |
if (Array.isArray(arg)) { |
| 838 |
return classNames.apply(null, arg); |
| 839 |
} |
| 840 |
|
| 841 |
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { |
| 842 |
return arg.toString(); |
| 843 |
} |
| 844 |
|
| 845 |
var classes = ''; |
| 846 |
|
| 847 |
for (var key in arg) { |
| 848 |
if (hasOwn.call(arg, key) && arg[key]) { |
| 849 |
classes = appendClass(classes, key); |
| 850 |
} |
| 851 |
} |
| 852 |
|
| 853 |
return classes; |
| 854 |
} |
| 855 |
|
| 856 |
function appendClass (value, newClass) { |
| 857 |
if (!newClass) { |
| 858 |
return value; |
| 859 |
} |
| 860 |
|
| 861 |
if (value) { |
| 862 |
return value + ' ' + newClass; |
| 863 |
} |
| 864 |
|
| 865 |
return value + newClass; |
| 866 |
} |
| 867 |
|
| 868 |
if ( true && module.exports) { |
| 869 |
classNames.default = classNames; |
| 870 |
module.exports = classNames; |
| 871 |
} else if (true) { |
| 872 |
// register as 'classnames', consistent with npm package name |
| 873 |
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { |
| 874 |
return classNames; |
| 875 |
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), |
| 876 |
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); |
| 877 |
} else // removed by dead control flow |
| 878 |
{} |
| 879 |
}()); |
| 880 |
|
| 881 |
|
| 882 |
/***/ }, |
| 883 |
|
| 884 |
/***/ "./assets/src/apps/js/blocks/courses/course-item-template/block.json" |
| 885 |
/*!***************************************************************************!*\ |
| 886 |
!*** ./assets/src/apps/js/blocks/courses/course-item-template/block.json ***! |
| 887 |
\***************************************************************************/ |
| 888 |
(module) { |
| 889 |
|
| 890 |
"use strict"; |
| 891 |
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"learnpress/course-item-template","title":"Course Item Template","category":"","description":"Course Item Template","textdomain":"learnpress","keywords":["course item","learnpress"],"usesContext":["lpCourseQuery"],"supports":{"align":true},"attributes":{"layout":{"type":"string","default":"list"},"columns":{"type":"number","default":3}},"ancestor":["learnpress/list-courses"]}'); |
| 892 |
|
| 893 |
/***/ } |
| 894 |
|
| 895 |
/******/ }); |
| 896 |
/************************************************************************/ |
| 897 |
/******/ // The module cache |
| 898 |
/******/ var __webpack_module_cache__ = {}; |
| 899 |
/******/ |
| 900 |
/******/ // The require function |
| 901 |
/******/ function __webpack_require__(moduleId) { |
| 902 |
/******/ // Check if module is in cache |
| 903 |
/******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| 904 |
/******/ if (cachedModule !== undefined) { |
| 905 |
/******/ return cachedModule.exports; |
| 906 |
/******/ } |
| 907 |
/******/ // Create a new module (and put it into the cache) |
| 908 |
/******/ var module = __webpack_module_cache__[moduleId] = { |
| 909 |
/******/ // no module.id needed |
| 910 |
/******/ // no module.loaded needed |
| 911 |
/******/ exports: {} |
| 912 |
/******/ }; |
| 913 |
/******/ |
| 914 |
/******/ // Execute the module function |
| 915 |
/******/ if (!(moduleId in __webpack_modules__)) { |
| 916 |
/******/ delete __webpack_module_cache__[moduleId]; |
| 917 |
/******/ var e = new Error("Cannot find module '" + moduleId + "'"); |
| 918 |
/******/ e.code = 'MODULE_NOT_FOUND'; |
| 919 |
/******/ throw e; |
| 920 |
/******/ } |
| 921 |
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| 922 |
/******/ |
| 923 |
/******/ // Return the exports of the module |
| 924 |
/******/ return module.exports; |
| 925 |
/******/ } |
| 926 |
/******/ |
| 927 |
/************************************************************************/ |
| 928 |
/******/ /* webpack/runtime/compat get default export */ |
| 929 |
/******/ (() => { |
| 930 |
/******/ // getDefaultExport function for compatibility with non-harmony modules |
| 931 |
/******/ __webpack_require__.n = (module) => { |
| 932 |
/******/ var getter = module && module.__esModule ? |
| 933 |
/******/ () => (module['default']) : |
| 934 |
/******/ () => (module); |
| 935 |
/******/ __webpack_require__.d(getter, { a: getter }); |
| 936 |
/******/ return getter; |
| 937 |
/******/ }; |
| 938 |
/******/ })(); |
| 939 |
/******/ |
| 940 |
/******/ /* webpack/runtime/define property getters */ |
| 941 |
/******/ (() => { |
| 942 |
/******/ // define getter functions for harmony exports |
| 943 |
/******/ __webpack_require__.d = (exports, definition) => { |
| 944 |
/******/ for(var key in definition) { |
| 945 |
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| 946 |
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| 947 |
/******/ } |
| 948 |
/******/ } |
| 949 |
/******/ }; |
| 950 |
/******/ })(); |
| 951 |
/******/ |
| 952 |
/******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| 953 |
/******/ (() => { |
| 954 |
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
| 955 |
/******/ })(); |
| 956 |
/******/ |
| 957 |
/******/ /* webpack/runtime/make namespace object */ |
| 958 |
/******/ (() => { |
| 959 |
/******/ // define __esModule on exports |
| 960 |
/******/ __webpack_require__.r = (exports) => { |
| 961 |
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
| 962 |
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| 963 |
/******/ } |
| 964 |
/******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| 965 |
/******/ }; |
| 966 |
/******/ })(); |
| 967 |
/******/ |
| 968 |
/************************************************************************/ |
| 969 |
var __webpack_exports__ = {}; |
| 970 |
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. |
| 971 |
(() => { |
| 972 |
"use strict"; |
| 973 |
/*!*************************************************************************!*\ |
| 974 |
!*** ./assets/src/apps/js/blocks/courses/course-item-template/index.js ***! |
| 975 |
\*************************************************************************/ |
| 976 |
__webpack_require__.r(__webpack_exports__); |
| 977 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 978 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 979 |
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edit */ "./assets/src/apps/js/blocks/courses/course-item-template/edit.js"); |
| 980 |
/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./save */ "./assets/src/apps/js/blocks/courses/course-item-template/save.js"); |
| 981 |
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block.json */ "./assets/src/apps/js/blocks/courses/course-item-template/block.json"); |
| 982 |
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); |
| 983 |
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__); |
| 984 |
|
| 985 |
/** |
| 986 |
* Register block single course property. |
| 987 |
*/ |
| 988 |
|
| 989 |
|
| 990 |
|
| 991 |
|
| 992 |
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_4__.registerBlockType)('learnpress/course-item-template', { |
| 993 |
..._block_json__WEBPACK_IMPORTED_MODULE_3__, |
| 994 |
icon: { |
| 995 |
src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", { |
| 996 |
xmlns: "http://www.w3.org/2000/svg", |
| 997 |
viewBox: "0 0 24 24", |
| 998 |
width: "24", |
| 999 |
height: "24", |
| 1000 |
"aria-hidden": "true", |
| 1001 |
focusable: "false" |
| 1002 |
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { |
| 1003 |
fillRule: "evenodd", |
| 1004 |
d: "M5 5.5h14a.5.5 0 01.5.5v1.5a.5.5 0 01-.5.5H5a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 9.232A2 2 0 013 7.5V6a2 2 0 012-2h14a2 2 0 012 2v1.5a2 2 0 01-1 1.732V18a2 2 0 01-2 2H6a2 2 0 01-2-2V9.232zm1.5.268V18a.5.5 0 00.5.5h12a.5.5 0 00.5-.5V9.5h-13z", |
| 1005 |
clipRule: "evenodd" |
| 1006 |
})) |
| 1007 |
}, |
| 1008 |
edit: _edit__WEBPACK_IMPORTED_MODULE_1__["default"], |
| 1009 |
save: _save__WEBPACK_IMPORTED_MODULE_2__["default"] |
| 1010 |
}); |
| 1011 |
})(); |
| 1012 |
|
| 1013 |
/******/ })() |
| 1014 |
; |
| 1015 |
//# sourceMappingURL=course-item-template.js.map |