=Timeline block fixes. Next up: adding article schema classes
3 files added
90 files modified
27 files deleted
| | |
| | | this.initModal(); |
| | | this.initListeners(); |
| | | this.initSubscribers(); |
| | | console.log('Gallery loaded...'); |
| | | } |
| | | /********************************************************************* |
| | | ELEMENTS |
| | |
| | | let selector = filtered ? `[data-gallery="${filtered}"]` : this.elements.imageSelector; |
| | | this.items = Array.from(document.querySelectorAll(selector)) |
| | | .map((img, index) => { |
| | | let caption = img.nextElementSibling && img.nextElementSibling.tagName === 'FIGCAPTION' ? |
| | | let caption = ''; |
| | | if (Object.hasOwn(img.dataset, 'caption')) { |
| | | caption = img.parentElement.querySelector(img.dataset.caption).cloneNode(true); |
| | | } else { |
| | | caption = img.nextElementSibling && img.nextElementSibling.tagName === 'FIGCAPTION' ? |
| | | img.nextElementSibling.textContent : |
| | | ''; |
| | | } |
| | | |
| | | |
| | | return { |
| | | id: img.dataset.id||index, |
| | |
| | | this.toggleGallery(true); |
| | | } else if (this.modal.isOpen) { |
| | | if (window.targetCheck(e, this.elements.gallery.nextButton)) { |
| | | console.log('Next'); |
| | | this.nextElement(); |
| | | } else if (window.targetCheck(e, this.elements.gallery.prevButton)) { |
| | | console.log('Previous'); |
| | | this.prevElement(); |
| | | } |
| | | } |
| | |
| | | galleryImg.src = item.src; // Fallback |
| | | galleryImg.alt = item.alt; |
| | | |
| | | window.removeChildren(this.ui.gallery.caption); |
| | | if (typeof item.caption === 'object') { |
| | | this.ui.gallery.caption.append(item.caption); |
| | | |
| | | } else { |
| | | this.ui.gallery.caption.textContent = item.caption; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | (()=>{class e{constructor(){this.a11y=window.jvbA11y,this.index=0,this.images=[],this.zoom={scale:1,min:1,max:4,threshold:50,x:0,y:0,startX:0,startY:0,ease:.2,panning:!1},this.swipe=this.resetSwipe(),this.activePointers=new Map,this.lastTap=0,this.initElements(),this.initModal(),this.initListeners(),this.initSubscribers(),console.log("Gallery loaded...")}initElements(){this.elements={imageSelector:"img[data-gallery]",gallery:{modal:"dialog.gallery",wrap:".wrap",nextButton:".next",prevButton:".prev",image:".image",leftImage:".image-left",rightImage:".image-right",counter:".counter",caption:"details .item-info"}},this.ui=window.uiFromSelectors(this.elements)}initModal(){this.modal=new window.jvbModal(this.ui.gallery.modal,{openMessage:"Opened Gallery",closeMessage:"Closed Gallery"}),this.modal.subscribe(e=>{"modal-close"===e&&this.toggleGallery(!1)})}buildGalleryItems(e=null){let t=e?`[data-gallery="${e}"]`:this.elements.imageSelector;this.items=Array.from(document.querySelectorAll(t)).map((e,t)=>{let i=e.nextElementSibling&&"FIGCAPTION"===e.nextElementSibling.tagName?e.nextElementSibling.textContent:"";return{id:e.dataset.id||t,srcset:e.srcset||e.src,sizes:e.sizes||"100vw",src:e.currentSrc||e.src,full:e.dataset.full||e.src,alt:e.alt||"",element:e,caption:i}})}initListeners(){this.clickHandler=this.handleClick.bind(this),this.pointerDownHandler=this.onPointerDown.bind(this),this.pointerMoveHandler=this.onPointerMove.bind(this),this.pointerUpHandler=this.onPointerUp.bind(this),this.wheelHandler=this.onWheel.bind(this),this.keyHandler=this.handleKeys.bind(this),document.addEventListener("click",this.clickHandler)}handleClick(e){let t=window.targetCheck(e,this.elements.imageSelector);t&&!this.modal.isOpen?(e.preventDefault(),this.buildGalleryItems(t.dataset.gallery||null),this.index=this.items.findIndex(e=>e.element===t),this.toggleGallery(!0)):this.modal.isOpen&&(window.targetCheck(e,this.elements.gallery.nextButton)?(console.log("Next"),this.nextElement()):window.targetCheck(e,this.elements.gallery.prevButton)&&(console.log("Previous"),this.prevElement()))}handleKeys(e){if(this.modal.isOpen){switch(e.key){case"ArrowLeft":e.preventDefault(),this.prevElement();break;case"ArrowRight":e.preventDefault(),this.nextElement()}e.ctrlKey&&("+"!==e.key&&"="!==e.key||(e.preventDefault(),this.handleZoom(.2)),"-"===e.key&&(e.preventDefault(),this.handleZoom(-.2)),"0"===e.key&&(e.preventDefault(),this.resetZoom()))}}onPointerDown(e){e.preventDefault(),this.swipe.startX=e.clientX,this.swipe.startY=e.clientY,this.ui.gallery.image.setPointerCapture(e.pointerId),this.activePointers.set(e.pointerId,{x:e.clientX,y:e.clientY});const t=performance.now();if(t-this.lastTap<300&&1===this.activePointers.size)return this.zoom.scale>1?this.resetZoom():this.handleZoom(1,e.clientX,e.clientY),void(this.lastTap=0);if(this.lastTap=t,2===this.activePointers.size){const e=[...this.activePointers.values()];return this.pinchStartDist=Math.hypot(e[0].x-e[1].x,e[0].y-e[1].y),void(this.pinchStartScale=this.zoom.scale)}this.zoom.scale>1&&(this.zoom.panning=!0,this.zoom.startX=e.clientX-this.zoom.x,this.zoom.startY=e.clientY-this.zoom.y,this.ui.gallery.image.style.cursor="grabbing")}onPointerMove(e){if(this.activePointers.has(e.pointerId)){if(this.activePointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===this.activePointers.size){const e=[...this.activePointers.values()],t=Math.hypot(e[0].x-e[1].x,e[0].y-e[1].y),i=this.pinchStartScale*(t/this.pinchStartDist)-this.zoom.scale,s=(e[0].x+e[1].x)/2,n=(e[0].y+e[1].y)/2;return void this.handleZoom(i,s,n)}this.zoom.panning&&(this.zoom.x=e.clientX-this.zoom.startX,this.zoom.y=e.clientY-this.zoom.startY,this.applyTransform())}}onPointerUp(e){const t=this.activePointers.get(e.pointerId);if(this.activePointers.delete(e.pointerId),this.activePointers.size<2&&(this.pinchStartDist=0),this.zoom.scale<=1&&!this.zoom.panning&&0===this.activePointers.size){const i=t?.x??e.clientX,s=t?.y??e.clientY,n=i-this.swipe.startX,o=s-this.swipe.startY;Math.abs(n)>this.zoom.threshold&&Math.abs(n)>Math.abs(o)&&(n>0?this.prevElement():this.nextElement())}0===this.activePointers.size&&(this.zoom.panning=!1,this.ui.gallery.image.style.cursor=this.zoom.scale>1?"grab":"default")}onWheel(e){if(!e.ctrlKey)return;e.preventDefault();const t=e.deltaY<0?.2:-.2;this.handleZoom(t,e.clientX,e.clientY)}handleZoom(e,t=null,i=null){const s=this.zoom.scale;let n=s+e;if(n=Math.min(this.zoom.max,Math.max(this.zoom.min,n)),n===s)return;const o=n/s;let l=this.ui.gallery.image.getBoundingClientRect();null!==t&&null!==i||(t=l.left+l.width/2,i=l.top+l.height/2);const a=t-l.left,r=i-l.top;this.zoom.x=(this.zoom.x-a)*o+a,this.zoom.y=(this.zoom.y-r)*o+r,this.zoom.scale=n,this.applyTransform(),this.notify("zoom",{scale:this.zoom.scale})}applyTransform(){this.clampPan();const e=this.ui.gallery.image;e.style.transform=`translate(${this.zoom.x}px, ${this.zoom.y}px) scale(${this.zoom.scale})`,e.style.cursor=this.zoom.scale>1?"grab":"default"}clampPan(){const e=this.ui.gallery.image,t=Math.max(0,(e.offsetWidth*this.zoom.scale-window.innerWidth)/2),i=Math.max(0,(e.offsetHeight*this.zoom.scale-window.innerHeight)/2);this.zoom.x=Math.max(-t,Math.min(t,this.zoom.x)),this.zoom.y=Math.max(-i,Math.min(i,this.zoom.y))}resetZoom(){this.zoom.scale=1,this.zoom.x=0,this.zoom.y=0,this.zoom.startX=0,this.zoom.startY=0,this.zoom.panning=!1,this.applyTransform()}resetSwipe(){return{startX:null,startY:null,endX:null,endY:null}}toggleGallery(e){e?(this.ui.gallery.image.draggable=!1,this.ui.gallery.image.style.userSelect="none",this.ui.gallery.image.addEventListener("pointerdown",this.pointerDownHandler),this.ui.gallery.image.addEventListener("pointermove",this.pointerMoveHandler),this.ui.gallery.image.addEventListener("pointerup",this.pointerUpHandler),this.ui.gallery.image.addEventListener("pointercancel",this.pointerUpHandler),window.addEventListener("wheel",this.wheelHandler,{passive:!1}),window.addEventListener("keydown",this.keyHandler),this.moveIntoView()):(this.ui.gallery.image.removeEventListener("pointerdown",this.pointerDownHandler),this.ui.gallery.image.removeEventListener("pointermove",this.pointerMoveHandler),this.ui.gallery.image.removeEventListener("pointerup",this.pointerUpHandler),this.ui.gallery.image.removeEventListener("pointercancel",this.pointerUpHandler),window.removeEventListener("wheel",this.wheelHandler),window.removeEventListener("keydown",this.keyHandler),this.resetZoom(),this.resetSwipe(),this.activePointers.clear(),this.lastTap=0),e&&!this.modal.isOpen&&this.modal.handleOpen()}moveIntoView(e=0){let t=this.index+e;t<0?t=this.items.length-1:t>=this.items.length?t=0:t===this.items.length-3&&this.notify("load-more"),this.index=t,this.updateDisplay(),this.preloadAdjacent(),this.a11y.announce(`Image ${this.index+1} of ${this.items.length}`)}nextElement(){this.resetZoom(),this.moveIntoView(1)}prevElement(){this.resetZoom(),this.moveIntoView(-1)}updateDisplay(){const e=this.items[this.index];if(!e)return;const t=this.ui.gallery.image;if(e.srcset&&(t.srcset=e.srcset,t.sizes=e.sizes),t.src=e.src,t.alt=e.alt,this.ui.gallery.caption.textContent=e.caption,e.full&&e.full!==e.src){const i=new Image;i.onload=()=>{this.items[this.index]===e&&(t.src=e.full,t.removeAttribute("srcset"),t.removeAttribute("sizes"))},i.src=e.full}this.ui.gallery.counter.textContent=`${this.index+1} / ${this.items.length}`,this.ui.gallery.prevButton.disabled=this.items.length<=1,this.ui.gallery.nextButton.disabled=this.items.length<=1}preloadAdjacent(){[-1,1].forEach(e=>{const t=this.index+e;if(t>0&&t<this.items.length){const i=this.items[t];(e<0?this.ui.gallery.leftImage:this.ui.gallery.rightImage).src=i.full}})}initSubscribers(){this.subscribers=new Set}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}notify(e,t={}){this.subscribers.forEach(i=>{try{i(e,t)}catch(e){console.error("Subscriber error:",e)}})}destroy(){this.subscribers.clear(),this.toggleGallery(!1),document.removeEventListener("click",this.clickHandler)}}document.addEventListener("DOMContentLoaded",function(){document.querySelector("dialog.gallery")&&(window.jvbGallery=new e)})})(); |
| | | (()=>{class t{constructor(){this.a11y=window.jvbA11y,this.index=0,this.images=[],this.zoom={scale:1,min:1,max:4,threshold:50,x:0,y:0,startX:0,startY:0,ease:.2,panning:!1},this.swipe=this.resetSwipe(),this.activePointers=new Map,this.lastTap=0,this.initElements(),this.initModal(),this.initListeners(),this.initSubscribers()}initElements(){this.elements={imageSelector:"img[data-gallery]",gallery:{modal:"dialog.gallery",wrap:".wrap",nextButton:".next",prevButton:".prev",image:".image",leftImage:".image-left",rightImage:".image-right",counter:".counter",caption:"details .item-info"}},this.ui=window.uiFromSelectors(this.elements)}initModal(){this.modal=new window.jvbModal(this.ui.gallery.modal,{openMessage:"Opened Gallery",closeMessage:"Closed Gallery"}),this.modal.subscribe(t=>{"modal-close"===t&&this.toggleGallery(!1)})}buildGalleryItems(t=null){let e=t?`[data-gallery="${t}"]`:this.elements.imageSelector;this.items=Array.from(document.querySelectorAll(e)).map((t,e)=>{let i="";return i=Object.hasOwn(t.dataset,"caption")?t.parentElement.querySelector(t.dataset.caption).cloneNode(!0):t.nextElementSibling&&"FIGCAPTION"===t.nextElementSibling.tagName?t.nextElementSibling.textContent:"",{id:t.dataset.id||e,srcset:t.srcset||t.src,sizes:t.sizes||"100vw",src:t.currentSrc||t.src,full:t.dataset.full||t.src,alt:t.alt||"",element:t,caption:i}})}initListeners(){this.clickHandler=this.handleClick.bind(this),this.pointerDownHandler=this.onPointerDown.bind(this),this.pointerMoveHandler=this.onPointerMove.bind(this),this.pointerUpHandler=this.onPointerUp.bind(this),this.wheelHandler=this.onWheel.bind(this),this.keyHandler=this.handleKeys.bind(this),document.addEventListener("click",this.clickHandler)}handleClick(t){let e=window.targetCheck(t,this.elements.imageSelector);e&&!this.modal.isOpen?(t.preventDefault(),this.buildGalleryItems(e.dataset.gallery||null),this.index=this.items.findIndex(t=>t.element===e),this.toggleGallery(!0)):this.modal.isOpen&&(window.targetCheck(t,this.elements.gallery.nextButton)?this.nextElement():window.targetCheck(t,this.elements.gallery.prevButton)&&this.prevElement())}handleKeys(t){if(this.modal.isOpen){switch(t.key){case"ArrowLeft":t.preventDefault(),this.prevElement();break;case"ArrowRight":t.preventDefault(),this.nextElement()}t.ctrlKey&&("+"!==t.key&&"="!==t.key||(t.preventDefault(),this.handleZoom(.2)),"-"===t.key&&(t.preventDefault(),this.handleZoom(-.2)),"0"===t.key&&(t.preventDefault(),this.resetZoom()))}}onPointerDown(t){t.preventDefault(),this.swipe.startX=t.clientX,this.swipe.startY=t.clientY,this.ui.gallery.image.setPointerCapture(t.pointerId),this.activePointers.set(t.pointerId,{x:t.clientX,y:t.clientY});const e=performance.now();if(e-this.lastTap<300&&1===this.activePointers.size)return this.zoom.scale>1?this.resetZoom():this.handleZoom(1,t.clientX,t.clientY),void(this.lastTap=0);if(this.lastTap=e,2===this.activePointers.size){const t=[...this.activePointers.values()];return this.pinchStartDist=Math.hypot(t[0].x-t[1].x,t[0].y-t[1].y),void(this.pinchStartScale=this.zoom.scale)}this.zoom.scale>1&&(this.zoom.panning=!0,this.zoom.startX=t.clientX-this.zoom.x,this.zoom.startY=t.clientY-this.zoom.y,this.ui.gallery.image.style.cursor="grabbing")}onPointerMove(t){if(this.activePointers.has(t.pointerId)){if(this.activePointers.set(t.pointerId,{x:t.clientX,y:t.clientY}),2===this.activePointers.size){const t=[...this.activePointers.values()],e=Math.hypot(t[0].x-t[1].x,t[0].y-t[1].y),i=this.pinchStartScale*(e/this.pinchStartDist)-this.zoom.scale,s=(t[0].x+t[1].x)/2,n=(t[0].y+t[1].y)/2;return void this.handleZoom(i,s,n)}this.zoom.panning&&(this.zoom.x=t.clientX-this.zoom.startX,this.zoom.y=t.clientY-this.zoom.startY,this.applyTransform())}}onPointerUp(t){const e=this.activePointers.get(t.pointerId);if(this.activePointers.delete(t.pointerId),this.activePointers.size<2&&(this.pinchStartDist=0),this.zoom.scale<=1&&!this.zoom.panning&&0===this.activePointers.size){const i=e?.x??t.clientX,s=e?.y??t.clientY,n=i-this.swipe.startX,o=s-this.swipe.startY;Math.abs(n)>this.zoom.threshold&&Math.abs(n)>Math.abs(o)&&(n>0?this.prevElement():this.nextElement())}0===this.activePointers.size&&(this.zoom.panning=!1,this.ui.gallery.image.style.cursor=this.zoom.scale>1?"grab":"default")}onWheel(t){if(!t.ctrlKey)return;t.preventDefault();const e=t.deltaY<0?.2:-.2;this.handleZoom(e,t.clientX,t.clientY)}handleZoom(t,e=null,i=null){const s=this.zoom.scale;let n=s+t;if(n=Math.min(this.zoom.max,Math.max(this.zoom.min,n)),n===s)return;const o=n/s;let l=this.ui.gallery.image.getBoundingClientRect();null!==e&&null!==i||(e=l.left+l.width/2,i=l.top+l.height/2);const a=e-l.left,r=i-l.top;this.zoom.x=(this.zoom.x-a)*o+a,this.zoom.y=(this.zoom.y-r)*o+r,this.zoom.scale=n,this.applyTransform(),this.notify("zoom",{scale:this.zoom.scale})}applyTransform(){this.clampPan();const t=this.ui.gallery.image;t.style.transform=`translate(${this.zoom.x}px, ${this.zoom.y}px) scale(${this.zoom.scale})`,t.style.cursor=this.zoom.scale>1?"grab":"default"}clampPan(){const t=this.ui.gallery.image,e=Math.max(0,(t.offsetWidth*this.zoom.scale-window.innerWidth)/2),i=Math.max(0,(t.offsetHeight*this.zoom.scale-window.innerHeight)/2);this.zoom.x=Math.max(-e,Math.min(e,this.zoom.x)),this.zoom.y=Math.max(-i,Math.min(i,this.zoom.y))}resetZoom(){this.zoom.scale=1,this.zoom.x=0,this.zoom.y=0,this.zoom.startX=0,this.zoom.startY=0,this.zoom.panning=!1,this.applyTransform()}resetSwipe(){return{startX:null,startY:null,endX:null,endY:null}}toggleGallery(t){t?(this.ui.gallery.image.draggable=!1,this.ui.gallery.image.style.userSelect="none",this.ui.gallery.image.addEventListener("pointerdown",this.pointerDownHandler),this.ui.gallery.image.addEventListener("pointermove",this.pointerMoveHandler),this.ui.gallery.image.addEventListener("pointerup",this.pointerUpHandler),this.ui.gallery.image.addEventListener("pointercancel",this.pointerUpHandler),window.addEventListener("wheel",this.wheelHandler,{passive:!1}),window.addEventListener("keydown",this.keyHandler),this.moveIntoView()):(this.ui.gallery.image.removeEventListener("pointerdown",this.pointerDownHandler),this.ui.gallery.image.removeEventListener("pointermove",this.pointerMoveHandler),this.ui.gallery.image.removeEventListener("pointerup",this.pointerUpHandler),this.ui.gallery.image.removeEventListener("pointercancel",this.pointerUpHandler),window.removeEventListener("wheel",this.wheelHandler),window.removeEventListener("keydown",this.keyHandler),this.resetZoom(),this.resetSwipe(),this.activePointers.clear(),this.lastTap=0),t&&!this.modal.isOpen&&this.modal.handleOpen()}moveIntoView(t=0){let e=this.index+t;e<0?e=this.items.length-1:e>=this.items.length?e=0:e===this.items.length-3&&this.notify("load-more"),this.index=e,this.updateDisplay(),this.preloadAdjacent(),this.a11y.announce(`Image ${this.index+1} of ${this.items.length}`)}nextElement(){this.resetZoom(),this.moveIntoView(1)}prevElement(){this.resetZoom(),this.moveIntoView(-1)}updateDisplay(){const t=this.items[this.index];if(!t)return;const e=this.ui.gallery.image;if(t.srcset&&(e.srcset=t.srcset,e.sizes=t.sizes),e.src=t.src,e.alt=t.alt,window.removeChildren(this.ui.gallery.caption),"object"==typeof t.caption?this.ui.gallery.caption.append(t.caption):this.ui.gallery.caption.textContent=t.caption,t.full&&t.full!==t.src){const i=new Image;i.onload=()=>{this.items[this.index]===t&&(e.src=t.full,e.removeAttribute("srcset"),e.removeAttribute("sizes"))},i.src=t.full}this.ui.gallery.counter.textContent=`${this.index+1} / ${this.items.length}`,this.ui.gallery.prevButton.disabled=this.items.length<=1,this.ui.gallery.nextButton.disabled=this.items.length<=1}preloadAdjacent(){[-1,1].forEach(t=>{const e=this.index+t;if(e>0&&e<this.items.length){const i=this.items[e];(t<0?this.ui.gallery.leftImage:this.ui.gallery.rightImage).src=i.full}})}initSubscribers(){this.subscribers=new Set}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}notify(t,e={}){this.subscribers.forEach(i=>{try{i(t,e)}catch(t){console.error("Subscriber error:",t)}})}destroy(){this.subscribers.clear(),this.toggleGallery(!1),document.removeEventListener("click",this.clickHandler)}}document.addEventListener("DOMContentLoaded",function(){document.querySelector("dialog.gallery")&&(window.jvbGallery=new t)})})(); |
| | |
| | | /*!****************************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/drawer-menu/editor.scss ***! |
| | | \****************************************************************************************************************************************************************************************************************************************************/ |
| | | |
| | |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components'), 'version' => '65376817f33306cc5678'); |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components'), 'version' => '483555faf4d69fc14935'); |
| | |
| | | /*!****************************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/drawer-menu/editor.scss ***! |
| | | \****************************************************************************************************************************************************************************************************************************************************/ |
| | | |
| | |
| | | /******/ (() => { // webpackBootstrap |
| | | /******/ "use strict"; |
| | | /******/ var __webpack_modules__ = ({ |
| | | |
| | | /***/ "./src/drawer-menu/edit.js" |
| | | /*!*********************************!*\ |
| | | !*** ./src/drawer-menu/edit.js ***! |
| | | \*********************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| | | /* harmony export */ "default": () => (/* binding */ Edit) |
| | | /* harmony export */ }); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); |
| | | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__); |
| | | |
| | | |
| | | |
| | | function Edit({ |
| | | attributes, |
| | | setAttributes |
| | | }) { |
| | | const { |
| | | menuId, |
| | | collapsed |
| | | } = attributes; |
| | | const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps)(); |
| | | return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.Fragment, { |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InspectorControls, { |
| | | children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelBody, { |
| | | title: "Drawer Settings", |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, { |
| | | label: "Menu ID", |
| | | value: menuId, |
| | | onChange: value => setAttributes({ |
| | | menuId: value |
| | | }), |
| | | help: "PHP-generated menu identifier" |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ToggleControl, { |
| | | label: "Start Collapsed", |
| | | checked: collapsed, |
| | | onChange: value => setAttributes({ |
| | | collapsed: value |
| | | }) |
| | | })] |
| | | }) |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", { |
| | | ...blockProps, |
| | | children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", { |
| | | className: "drawer-menu-preview", |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("p", { |
| | | children: ["Drawer Menu: ", menuId || 'Not configured'] |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("p", { |
| | | children: ["State: ", collapsed ? 'Collapsed' : 'Expanded'] |
| | | })] |
| | | }) |
| | | })] |
| | | }); |
| | | } |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/drawer-menu/index.js" |
| | | /*!**********************************!*\ |
| | | !*** ./src/drawer-menu/index.js ***! |
| | | \**********************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edit */ "./src/drawer-menu/edit.js"); |
| | | /* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./save */ "./src/drawer-menu/save.js"); |
| | | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style.scss */ "./src/drawer-menu/style.scss"); |
| | | /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editor.scss */ "./src/drawer-menu/editor.scss"); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)('jvb/drawer-menu', { |
| | | edit: _edit__WEBPACK_IMPORTED_MODULE_1__["default"], |
| | | save: _save__WEBPACK_IMPORTED_MODULE_2__["default"] |
| | | }); |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/drawer-menu/save.js" |
| | | /*!*********************************!*\ |
| | | !*** ./src/drawer-menu/save.js ***! |
| | | \*********************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| | | /* harmony export */ "default": () => (/* binding */ save) |
| | | /* harmony export */ }); |
| | | function save() { |
| | | return null; // Server-side rendered |
| | | } |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/drawer-menu/editor.scss" |
| | | /*!*************************************!*\ |
| | | !*** ./src/drawer-menu/editor.scss ***! |
| | | \*************************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | // extracted by mini-css-extract-plugin |
| | | |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/drawer-menu/style.scss" |
| | | /*!************************************!*\ |
| | | !*** ./src/drawer-menu/style.scss ***! |
| | | \************************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | // extracted by mini-css-extract-plugin |
| | | |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "react/jsx-runtime" |
| | | /*!**********************************!*\ |
| | | !*** external "ReactJSXRuntime" ***! |
| | | \**********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["ReactJSXRuntime"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/block-editor" |
| | | /*!*************************************!*\ |
| | | !*** external ["wp","blockEditor"] ***! |
| | | \*************************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blockEditor"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/blocks" |
| | | /*!********************************!*\ |
| | | !*** external ["wp","blocks"] ***! |
| | | \********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blocks"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/components" |
| | | /*!************************************!*\ |
| | | !*** external ["wp","components"] ***! |
| | | \************************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["components"]; |
| | | |
| | | /***/ } |
| | | |
| | | /******/ }); |
| | | /************************************************************************/ |
| | | /******/ // The module cache |
| | | /******/ var __webpack_module_cache__ = {}; |
| | | /******/ |
| | | /******/ // The require function |
| | | /******/ function __webpack_require__(moduleId) { |
| | | /******/ // Check if module is in cache |
| | | /******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| | | /******/ if (cachedModule !== undefined) { |
| | | /******/ return cachedModule.exports; |
| | | /******/ } |
| | | /******/ // Create a new module (and put it into the cache) |
| | | /******/ var module = __webpack_module_cache__[moduleId] = { |
| | | /******/ // no module.id needed |
| | | /******/ // no module.loaded needed |
| | | /******/ exports: {} |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // Execute the module function |
| | | /******/ if (!(moduleId in __webpack_modules__)) { |
| | | /******/ delete __webpack_module_cache__[moduleId]; |
| | | /******/ var e = new Error("Cannot find module '" + moduleId + "'"); |
| | | /******/ e.code = 'MODULE_NOT_FOUND'; |
| | | /******/ throw e; |
| | | /******/ } |
| | | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| | | /******/ |
| | | /******/ // Return the exports of the module |
| | | /******/ return module.exports; |
| | | /******/ } |
| | | /******/ |
| | | /******/ // expose the modules object (__webpack_modules__) |
| | | /******/ __webpack_require__.m = __webpack_modules__; |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ /* webpack/runtime/chunk loaded */ |
| | | /******/ (() => { |
| | | /******/ var deferred = []; |
| | | /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { |
| | | /******/ if(chunkIds) { |
| | | /******/ priority = priority || 0; |
| | | /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; |
| | | /******/ deferred[i] = [chunkIds, fn, priority]; |
| | | /******/ return; |
| | | /******/ } |
| | | /******/ var notFulfilled = Infinity; |
| | | /******/ for (var i = 0; i < deferred.length; i++) { |
| | | /******/ var [chunkIds, fn, priority] = deferred[i]; |
| | | /******/ var fulfilled = true; |
| | | /******/ for (var j = 0; j < chunkIds.length; j++) { |
| | | /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { |
| | | /******/ chunkIds.splice(j--, 1); |
| | | /******/ } else { |
| | | /******/ fulfilled = false; |
| | | /******/ if(priority < notFulfilled) notFulfilled = priority; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(fulfilled) { |
| | | /******/ deferred.splice(i--, 1) |
| | | /******/ var r = fn(); |
| | | /******/ if (r !== undefined) result = r; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ return result; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/compat get default export */ |
| | | /******/ (() => { |
| | | /******/ // getDefaultExport function for compatibility with non-harmony modules |
| | | /******/ __webpack_require__.n = (module) => { |
| | | /******/ var getter = module && module.__esModule ? |
| | | /******/ () => (module['default']) : |
| | | /******/ () => (module); |
| | | /******/ __webpack_require__.d(getter, { a: getter }); |
| | | /******/ return getter; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/define property getters */ |
| | | /******/ (() => { |
| | | /******/ // define getter functions for harmony exports |
| | | /******/ __webpack_require__.d = (exports, definition) => { |
| | | /******/ for(var key in definition) { |
| | | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| | | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| | | /******/ } |
| | | /******/ } |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| | | /******/ (() => { |
| | | /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/make namespace object */ |
| | | /******/ (() => { |
| | | /******/ // define __esModule on exports |
| | | /******/ __webpack_require__.r = (exports) => { |
| | | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
| | | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| | | /******/ } |
| | | /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/jsonp chunk loading */ |
| | | /******/ (() => { |
| | | /******/ // no baseURI |
| | | /******/ |
| | | /******/ // object to store loaded and loading chunks |
| | | /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched |
| | | /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded |
| | | /******/ var installedChunks = { |
| | | /******/ "drawer-menu/index": 0, |
| | | /******/ "drawer-menu/style-index": 0 |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // no chunk on demand loading |
| | | /******/ |
| | | /******/ // no prefetching |
| | | /******/ |
| | | /******/ // no preloaded |
| | | /******/ |
| | | /******/ // no HMR |
| | | /******/ |
| | | /******/ // no HMR manifest |
| | | /******/ |
| | | /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); |
| | | /******/ |
| | | /******/ // install a JSONP callback for chunk loading |
| | | /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { |
| | | /******/ var [chunkIds, moreModules, runtime] = data; |
| | | /******/ // add "moreModules" to the modules object, |
| | | /******/ // then flag all "chunkIds" as loaded and fire callback |
| | | /******/ var moduleId, chunkId, i = 0; |
| | | /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { |
| | | /******/ for(moduleId in moreModules) { |
| | | /******/ if(__webpack_require__.o(moreModules, moduleId)) { |
| | | /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(runtime) var result = runtime(__webpack_require__); |
| | | /******/ } |
| | | /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); |
| | | /******/ for(;i < chunkIds.length; i++) { |
| | | /******/ chunkId = chunkIds[i]; |
| | | /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { |
| | | /******/ installedChunks[chunkId][0](); |
| | | /******/ } |
| | | /******/ installedChunks[chunkId] = 0; |
| | | /******/ } |
| | | /******/ return __webpack_require__.O(result); |
| | | /******/ } |
| | | /******/ |
| | | /******/ var chunkLoadingGlobal = globalThis["webpackChunkjvb"] = globalThis["webpackChunkjvb"] || []; |
| | | /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); |
| | | /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); |
| | | /******/ })(); |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ |
| | | /******/ // startup |
| | | /******/ // Load entry module and return exports |
| | | /******/ // This entry module depends on other loaded chunks and execution need to be delayed |
| | | /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["drawer-menu/style-index"], () => (__webpack_require__("./src/drawer-menu/index.js"))) |
| | | /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); |
| | | /******/ |
| | | /******/ })() |
| | | ; |
| | | //# sourceMappingURL=index.js.map |
| | | (()=>{"use strict";var e,r={582(){const e=window.wp.blocks,r=window.wp.blockEditor,n=window.wp.components,o=window.ReactJSXRuntime;(0,e.registerBlockType)("jvb/drawer-menu",{edit:function({attributes:e,setAttributes:t}){const{menuId:l,collapsed:s}=e,i=(0,r.useBlockProps)();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r.InspectorControls,{children:(0,o.jsxs)(n.PanelBody,{title:"Drawer Settings",children:[(0,o.jsx)(n.TextControl,{label:"Menu ID",value:l,onChange:e=>t({menuId:e}),help:"PHP-generated menu identifier"}),(0,o.jsx)(n.ToggleControl,{label:"Start Collapsed",checked:s,onChange:e=>t({collapsed:e})})]})}),(0,o.jsx)("div",{...i,children:(0,o.jsxs)("div",{className:"drawer-menu-preview",children:[(0,o.jsxs)("p",{children:["Drawer Menu: ",l||"Not configured"]}),(0,o.jsxs)("p",{children:["State: ",s?"Collapsed":"Expanded"]})]})})]})},save:function(){return null}})}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var l=n[e]={exports:{}};return r[e](l,l.exports,o),l.exports}o.m=r,e=[],o.O=(r,n,t,l)=>{if(!n){var s=1/0;for(c=0;c<e.length;c++){for(var[n,t,l]=e[c],i=!0,a=0;a<n.length;a++)(!1&l||s>=l)&&Object.keys(o.O).every(e=>o.O[e](n[a]))?n.splice(a--,1):(i=!1,l<s&&(s=l));if(i){e.splice(c--,1);var d=t();void 0!==d&&(r=d)}}return r}l=l||0;for(var c=e.length;c>0&&e[c-1][2]>l;c--)e[c]=e[c-1];e[c]=[n,t,l]},o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={121:0,397:0};o.O.j=r=>0===e[r];var r=(r,n)=>{var t,l,[s,i,a]=n,d=0;if(s.some(r=>0!==e[r])){for(t in i)o.o(i,t)&&(o.m[t]=i[t]);if(a)var c=a(o)}for(r&&r(n);d<s.length;d++)l=s[d],o.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return o.O(c)},n=globalThis.webpackChunkjvb=globalThis.webpackChunkjvb||[];n.forEach(r.bind(null,0)),n.push=r.bind(null,n.push.bind(n))})();var t=o.O(void 0,[397],()=>o(582));t=o.O(t)})(); |
| | |
| | | /*!***************************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/drawer-menu/style.scss ***! |
| | | \***************************************************************************************************************************************************************************************************************************************************/ |
| | | nav.drawer { |
| | | position: fixed; |
| | | left: 0; |
| | | bottom: 0; |
| | | max-height: 100vh; |
| | | overflow: hidden auto; |
| | | width: var(--btn); |
| | | z-index: var(--z-5); |
| | | transition: var(--trans-size); |
| | | --dir: column-reverse; |
| | | background-color: rgb(var(--base)); |
| | | border-right: 1px solid rgb(var(--base-200)); |
| | | box-shadow: rgba(var(--base), var(--op-4)) var(--shdw-left); |
| | | height: auto; |
| | | --w: var(--chip_); |
| | | } |
| | | nav.drawer .title, |
| | | nav.drawer .section-title { |
| | | display: none; |
| | | } |
| | | nav.drawer ul .icon { |
| | | min-width: var(--chip_); |
| | | } |
| | | nav.drawer a, |
| | | nav.drawer .a { |
| | | height: var(--chipchip); |
| | | padding: 0 0.5rem; |
| | | width: 100%; |
| | | gap: 0.5rem; |
| | | justify-content: center; |
| | | } |
| | | nav.drawer .toggle { |
| | | width: 100%; |
| | | aspect-ratio: unset; |
| | | } |
| | | nav.drawer .toggle .icon { |
| | | transform: rotate(0); |
| | | transition: var(--trans-transform); |
| | | } |
| | | nav.drawer.open { |
| | | width: 240px; |
| | | } |
| | | nav.drawer.open .title, |
| | | nav.drawer.open .section-title { |
| | | display: block; |
| | | } |
| | | nav.drawer.open .toggle .icon { |
| | | transform: rotate(-180deg); |
| | | } |
| | | nav.drawer.open a, |
| | | nav.drawer.open .a { |
| | | justify-content: flex-start; |
| | | } |
| | | nav.drawer ul { |
| | | --dir: column; |
| | | --gap: 0; |
| | | --height: auto; |
| | | padding: 0; |
| | | margin: 0; |
| | | height: auto; |
| | | width: 100%; |
| | | overflow: hidden; |
| | | } |
| | | nav.drawer li { |
| | | height: auto; |
| | | width: 100%; |
| | | } |
| | | nav.drawer .row { |
| | | width: 100%; |
| | | } |
| | | nav.drawer .menu-section { |
| | | border-bottom: 1px solid rgb(var(--contrast-200)); |
| | | } |
| | | nav.drawer .section-title { |
| | | padding: 0.5rem var(--px); |
| | | font-size: var(--small); |
| | | text-transform: uppercase; |
| | | opacity: 0.6; |
| | | font-weight: bold; |
| | | } |
| | | .main-actions .buttons.buttons { |
| | | left: calc(var(--btn_) + 0.5rem); |
| | | } |
| | | nav.on-this-page.on-this-page.on-this-page { |
| | | width: calc(100vw - var(--btn)) !important; |
| | | } |
| | | nav.drawer{bottom:0;max-height:100vh;overflow:hidden auto;position:fixed;left:0;transition:var(--trans-size);width:var(--btn);z-index:var(--z-5);--dir:column-reverse;background-color:rgb(var(--base));border-right:1px solid rgb(var(--base-200));box-shadow:rgba(var(--base),var(--op-4)) var(--shdw-left);height:auto;--w:var(--chip_)}nav.drawer .section-title,nav.drawer .title{display:none}nav.drawer ul .icon{min-width:var(--chip_)}nav.drawer .a,nav.drawer a{gap:.5rem;height:var(--chipchip);justify-content:center;padding:0 .5rem;width:100%}nav.drawer .toggle{aspect-ratio:unset;width:100%}nav.drawer .toggle .icon{transform:rotate(0);transition:var(--trans-transform)}nav.drawer.open{width:240px}nav.drawer.open .section-title,nav.drawer.open .title{display:block}nav.drawer.open .toggle .icon{transform:rotate(-180deg)}nav.drawer.open .a,nav.drawer.open a{justify-content:flex-start}nav.drawer ul{--dir:column;--gap:0;--height:auto;margin:0;overflow:hidden;padding:0}nav.drawer li,nav.drawer ul{height:auto;width:100%}nav.drawer .row{width:100%}nav.drawer .menu-section{border-bottom:1px solid rgb(var(--contrast-200))}nav.drawer .section-title{font-size:var(--small);font-weight:700;opacity:.6;padding:.5rem var(--px);text-transform:uppercase}.main-actions .buttons.buttons{left:calc(var(--btn_) + .5rem)}nav.on-this-page.on-this-page.on-this-page{width:calc(100vw - var(--btn))!important} |
| | |
| | | /*!***************************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/drawer-menu/style.scss ***! |
| | | \***************************************************************************************************************************************************************************************************************************************************/ |
| | | nav.drawer { |
| | | position: fixed; |
| | | right: 0; |
| | | bottom: 0; |
| | | max-height: 100vh; |
| | | overflow: hidden auto; |
| | | width: var(--btn); |
| | | z-index: var(--z-5); |
| | | transition: var(--trans-size); |
| | | --dir: column-reverse; |
| | | background-color: rgb(var(--base)); |
| | | border-left: 1px solid rgb(var(--base-200)); |
| | | box-shadow: rgba(var(--base), var(--op-4)) var(--shdw-left); |
| | | height: auto; |
| | | --w: var(--chip_); |
| | | } |
| | | nav.drawer .title, |
| | | nav.drawer .section-title { |
| | | display: none; |
| | | } |
| | | nav.drawer ul .icon { |
| | | min-width: var(--chip_); |
| | | } |
| | | nav.drawer a, |
| | | nav.drawer .a { |
| | | height: var(--chipchip); |
| | | padding: 0 0.5rem; |
| | | width: 100%; |
| | | gap: 0.5rem; |
| | | justify-content: center; |
| | | } |
| | | nav.drawer .toggle { |
| | | width: 100%; |
| | | aspect-ratio: unset; |
| | | } |
| | | nav.drawer .toggle .icon { |
| | | transform: rotate(0); |
| | | transition: var(--trans-transform); |
| | | } |
| | | nav.drawer.open { |
| | | width: 240px; |
| | | } |
| | | nav.drawer.open .title, |
| | | nav.drawer.open .section-title { |
| | | display: block; |
| | | } |
| | | nav.drawer.open .toggle .icon { |
| | | transform: rotate(180deg); |
| | | } |
| | | nav.drawer.open a, |
| | | nav.drawer.open .a { |
| | | justify-content: flex-start; |
| | | } |
| | | nav.drawer ul { |
| | | --dir: column; |
| | | --gap: 0; |
| | | --height: auto; |
| | | padding: 0; |
| | | margin: 0; |
| | | height: auto; |
| | | width: 100%; |
| | | overflow: hidden; |
| | | } |
| | | nav.drawer li { |
| | | height: auto; |
| | | width: 100%; |
| | | } |
| | | nav.drawer .row { |
| | | width: 100%; |
| | | } |
| | | nav.drawer .menu-section { |
| | | border-bottom: 1px solid rgb(var(--contrast-200)); |
| | | } |
| | | nav.drawer .section-title { |
| | | padding: 0.5rem var(--px); |
| | | font-size: var(--small); |
| | | text-transform: uppercase; |
| | | opacity: 0.6; |
| | | font-weight: bold; |
| | | } |
| | | .main-actions .buttons.buttons { |
| | | right: calc(var(--btn_) + 0.5rem); |
| | | } |
| | | nav.on-this-page.on-this-page.on-this-page { |
| | | width: calc(100vw - var(--btn)) !important; |
| | | } |
| | | |
| | | /*# sourceMappingURL=style-index.css.map*/ |
| | | nav.drawer{bottom:0;max-height:100vh;overflow:hidden auto;position:fixed;right:0;transition:var(--trans-size);width:var(--btn);z-index:var(--z-5);--dir:column-reverse;background-color:rgb(var(--base));border-left:1px solid rgb(var(--base-200));box-shadow:rgba(var(--base),var(--op-4)) var(--shdw-left);height:auto;--w:var(--chip_)}nav.drawer .section-title,nav.drawer .title{display:none}nav.drawer ul .icon{min-width:var(--chip_)}nav.drawer .a,nav.drawer a{gap:.5rem;height:var(--chipchip);justify-content:center;padding:0 .5rem;width:100%}nav.drawer .toggle{aspect-ratio:unset;width:100%}nav.drawer .toggle .icon{transform:rotate(0);transition:var(--trans-transform)}nav.drawer.open{width:240px}nav.drawer.open .section-title,nav.drawer.open .title{display:block}nav.drawer.open .toggle .icon{transform:rotate(180deg)}nav.drawer.open .a,nav.drawer.open a{justify-content:flex-start}nav.drawer ul{--dir:column;--gap:0;--height:auto;margin:0;overflow:hidden;padding:0}nav.drawer li,nav.drawer ul{height:auto;width:100%}nav.drawer .row{width:100%}nav.drawer .menu-section{border-bottom:1px solid rgb(var(--contrast-200))}nav.drawer .section-title{font-size:var(--small);font-weight:700;opacity:.6;padding:.5rem var(--px);text-transform:uppercase}.main-actions .buttons.buttons{right:calc(var(--btn_) + .5rem)}nav.on-this-page.on-this-page.on-this-page{width:calc(100vw - var(--btn))!important} |
| | |
| | | /*!********************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/faq/editor.scss ***! |
| | | \********************************************************************************************************************************************************************************************************************************************/ |
| | | /** |
| | | * FAQ Block - Editor Styles |
| | | */ |
| | | .faq-block-editor { |
| | | padding: 2rem; |
| | | border: 2px dashed #ccc; |
| | | border-radius: 8px; |
| | | background: #f9f9f9; |
| | | } |
| | | .faq-block-editor .faq-block-preview { |
| | | text-align: center; |
| | | } |
| | | .faq-block-editor .faq-block-preview h3 { |
| | | margin: 0 0 0.5rem; |
| | | font-size: 1.25rem; |
| | | font-weight: 600; |
| | | } |
| | | .faq-block-editor .faq-block-preview > p { |
| | | margin: 0 0 1.5rem; |
| | | color: #666; |
| | | } |
| | | .faq-block-editor .faq-block-preview .faq-sections-preview { |
| | | margin-top: 1.5rem; |
| | | text-align: right; |
| | | background: white; |
| | | padding: 1rem; |
| | | border-radius: 4px; |
| | | } |
| | | .faq-block-editor .faq-block-preview .faq-sections-preview strong { |
| | | display: block; |
| | | margin-bottom: 0.5rem; |
| | | } |
| | | .faq-block-editor .faq-block-preview .faq-sections-preview ol { |
| | | margin: 0; |
| | | padding-right: 1.5rem; |
| | | } |
| | | .faq-block-editor .faq-block-preview .faq-sections-preview ol li { |
| | | margin: 0.25rem 0; |
| | | padding: 0.25rem 0; |
| | | } |
| | | .faq-section-list { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 0.5rem; |
| | | margin-top: 0.5rem; |
| | | } |
| | | .faq-section-item { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 0.5rem; |
| | | padding: 0.5rem 0.75rem; |
| | | background: white; |
| | | border: 1px solid #ddd; |
| | | border-radius: 4px; |
| | | transition: background 150ms ease; |
| | | } |
| | | .faq-section-item:hover { |
| | | background: #f9f9f9; |
| | | } |
| | | .faq-section-controls { |
| | | display: flex; |
| | | gap: 0.25rem; |
| | | flex-shrink: 0; |
| | | } |
| | | .faq-section-button { |
| | | min-width: 30px !important; |
| | | padding: 4px !important; |
| | | height: 30px !important; |
| | | } |
| | | .faq-section-button:disabled { |
| | | opacity: 0.3; |
| | | cursor: not-allowed; |
| | | } |
| | | .faq-section-name { |
| | | flex: 1; |
| | | font-weight: 500; |
| | | padding-right: 0.5rem; |
| | | } |
| | | .components-panel__body .components-notice { |
| | | margin: 1rem 0; |
| | | } |
| | | .faq-block-editor{background:#f9f9f9;border:2px dashed #ccc;border-radius:8px;padding:2rem}.faq-block-editor .faq-block-preview{text-align:center}.faq-block-editor .faq-block-preview h3{font-size:1.25rem;font-weight:600;margin:0 0 .5rem}.faq-block-editor .faq-block-preview>p{color:#666;margin:0 0 1.5rem}.faq-block-editor .faq-block-preview .faq-sections-preview{background:#fff;border-radius:4px;margin-top:1.5rem;padding:1rem;text-align:right}.faq-block-editor .faq-block-preview .faq-sections-preview strong{display:block;margin-bottom:.5rem}.faq-block-editor .faq-block-preview .faq-sections-preview ol{margin:0;padding-right:1.5rem}.faq-block-editor .faq-block-preview .faq-sections-preview ol li{margin:.25rem 0;padding:.25rem 0}.faq-section-list{display:flex;flex-direction:column;gap:.5rem;margin-top:.5rem}.faq-section-item{align-items:center;background:#fff;border:1px solid #ddd;border-radius:4px;display:flex;gap:.5rem;padding:.5rem .75rem;transition:background .15s ease}.faq-section-item:hover{background:#f9f9f9}.faq-section-controls{display:flex;flex-shrink:0;gap:.25rem}.faq-section-button{height:30px!important;min-width:30px!important;padding:4px!important}.faq-section-button:disabled{cursor:not-allowed;opacity:.3}.faq-section-name{flex:1;font-weight:500;padding-right:.5rem}.components-panel__body .components-notice{margin:1rem 0} |
| | |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '48d21a70dd8a090baee8'); |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '4f3282194e1c2db371a3'); |
| | |
| | | /*!********************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/faq/editor.scss ***! |
| | | \********************************************************************************************************************************************************************************************************************************************/ |
| | | /** |
| | | * FAQ Block - Editor Styles |
| | | */ |
| | | .faq-block-editor { |
| | | padding: 2rem; |
| | | border: 2px dashed #ccc; |
| | | border-radius: 8px; |
| | | background: #f9f9f9; |
| | | } |
| | | .faq-block-editor .faq-block-preview { |
| | | text-align: center; |
| | | } |
| | | .faq-block-editor .faq-block-preview h3 { |
| | | margin: 0 0 0.5rem; |
| | | font-size: 1.25rem; |
| | | font-weight: 600; |
| | | } |
| | | .faq-block-editor .faq-block-preview > p { |
| | | margin: 0 0 1.5rem; |
| | | color: #666; |
| | | } |
| | | .faq-block-editor .faq-block-preview .faq-sections-preview { |
| | | margin-top: 1.5rem; |
| | | text-align: left; |
| | | background: white; |
| | | padding: 1rem; |
| | | border-radius: 4px; |
| | | } |
| | | .faq-block-editor .faq-block-preview .faq-sections-preview strong { |
| | | display: block; |
| | | margin-bottom: 0.5rem; |
| | | } |
| | | .faq-block-editor .faq-block-preview .faq-sections-preview ol { |
| | | margin: 0; |
| | | padding-left: 1.5rem; |
| | | } |
| | | .faq-block-editor .faq-block-preview .faq-sections-preview ol li { |
| | | margin: 0.25rem 0; |
| | | padding: 0.25rem 0; |
| | | } |
| | | .faq-section-list { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 0.5rem; |
| | | margin-top: 0.5rem; |
| | | } |
| | | .faq-section-item { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 0.5rem; |
| | | padding: 0.5rem 0.75rem; |
| | | background: white; |
| | | border: 1px solid #ddd; |
| | | border-radius: 4px; |
| | | transition: background 150ms ease; |
| | | } |
| | | .faq-section-item:hover { |
| | | background: #f9f9f9; |
| | | } |
| | | .faq-section-controls { |
| | | display: flex; |
| | | gap: 0.25rem; |
| | | flex-shrink: 0; |
| | | } |
| | | .faq-section-button { |
| | | min-width: 30px !important; |
| | | padding: 4px !important; |
| | | height: 30px !important; |
| | | } |
| | | .faq-section-button:disabled { |
| | | opacity: 0.3; |
| | | cursor: not-allowed; |
| | | } |
| | | .faq-section-name { |
| | | flex: 1; |
| | | font-weight: 500; |
| | | padding-left: 0.5rem; |
| | | } |
| | | .components-panel__body .components-notice { |
| | | margin: 1rem 0; |
| | | } |
| | | |
| | | /*# sourceMappingURL=index.css.map*/ |
| | | .faq-block-editor{background:#f9f9f9;border:2px dashed #ccc;border-radius:8px;padding:2rem}.faq-block-editor .faq-block-preview{text-align:center}.faq-block-editor .faq-block-preview h3{font-size:1.25rem;font-weight:600;margin:0 0 .5rem}.faq-block-editor .faq-block-preview>p{color:#666;margin:0 0 1.5rem}.faq-block-editor .faq-block-preview .faq-sections-preview{background:#fff;border-radius:4px;margin-top:1.5rem;padding:1rem;text-align:left}.faq-block-editor .faq-block-preview .faq-sections-preview strong{display:block;margin-bottom:.5rem}.faq-block-editor .faq-block-preview .faq-sections-preview ol{margin:0;padding-left:1.5rem}.faq-block-editor .faq-block-preview .faq-sections-preview ol li{margin:.25rem 0;padding:.25rem 0}.faq-section-list{display:flex;flex-direction:column;gap:.5rem;margin-top:.5rem}.faq-section-item{align-items:center;background:#fff;border:1px solid #ddd;border-radius:4px;display:flex;gap:.5rem;padding:.5rem .75rem;transition:background .15s ease}.faq-section-item:hover{background:#f9f9f9}.faq-section-controls{display:flex;flex-shrink:0;gap:.25rem}.faq-section-button{height:30px!important;min-width:30px!important;padding:4px!important}.faq-section-button:disabled{cursor:not-allowed;opacity:.3}.faq-section-name{flex:1;font-weight:500;padding-left:.5rem}.components-panel__body .components-notice{margin:1rem 0} |
| | |
| | | /******/ (() => { // webpackBootstrap |
| | | /******/ "use strict"; |
| | | /******/ var __webpack_modules__ = ({ |
| | | |
| | | /***/ "./src/faq/edit.js" |
| | | /*!*************************!*\ |
| | | !*** ./src/faq/edit.js ***! |
| | | \*************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| | | /* harmony export */ "default": () => (/* binding */ Edit) |
| | | /* harmony export */ }); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); |
| | | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); |
| | | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| | | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); |
| | | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| | | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); |
| | | /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editor.scss */ "./src/faq/editor.scss"); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | function Edit({ |
| | | attributes, |
| | | setAttributes |
| | | }) { |
| | | const { |
| | | sectionOrder, |
| | | showSectionTitles, |
| | | collapseByDefault |
| | | } = attributes; |
| | | const [sections, setSections] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)([]); |
| | | |
| | | // Get sections from localized script |
| | | const allSections = window.jvbFaq?.sections || []; |
| | | |
| | | // Initialize sections with proper ordering |
| | | (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => { |
| | | if (!allSections.length) return; |
| | | if (sectionOrder.length === 0) { |
| | | // First time - use default order |
| | | const orderedSections = allSections.map(section => ({ |
| | | id: section.id, |
| | | name: section.name |
| | | })); |
| | | setSections(orderedSections); |
| | | setAttributes({ |
| | | sectionOrder: orderedSections.map(s => s.id) |
| | | }); |
| | | } else { |
| | | // Use saved order, add any new sections at the end |
| | | const orderedSections = []; |
| | | const existingIds = new Set(sectionOrder); |
| | | |
| | | // Add sections in saved order |
| | | sectionOrder.forEach(id => { |
| | | const section = allSections.find(s => s.id === id); |
| | | if (section) { |
| | | orderedSections.push({ |
| | | id: section.id, |
| | | name: section.name |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // Add any new sections that weren't in the saved order |
| | | allSections.forEach(section => { |
| | | if (!existingIds.has(section.id)) { |
| | | orderedSections.push({ |
| | | id: section.id, |
| | | name: section.name |
| | | }); |
| | | } |
| | | }); |
| | | setSections(orderedSections); |
| | | } |
| | | }, [allSections, sectionOrder]); |
| | | const moveSection = (index, direction) => { |
| | | const newSections = [...sections]; |
| | | const newIndex = direction === 'up' ? index - 1 : index + 1; |
| | | if (newIndex < 0 || newIndex >= newSections.length) return; |
| | | |
| | | // Swap sections |
| | | [newSections[index], newSections[newIndex]] = [newSections[newIndex], newSections[index]]; |
| | | setSections(newSections); |
| | | setAttributes({ |
| | | sectionOrder: newSections.map(s => s.id) |
| | | }); |
| | | }; |
| | | const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps)({ |
| | | className: 'faq-block-editor' |
| | | }); |
| | | return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, { |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InspectorControls, { |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelBody, { |
| | | title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('FAQ Settings', 'jvb'), |
| | | initialOpen: true, |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ToggleControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show Section Titles', 'jvb'), |
| | | checked: showSectionTitles, |
| | | onChange: value => setAttributes({ |
| | | showSectionTitles: value |
| | | }), |
| | | help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Display section names as headings', 'jvb') |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ToggleControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Collapse by Default', 'jvb'), |
| | | checked: collapseByDefault, |
| | | onChange: value => setAttributes({ |
| | | collapseByDefault: value |
| | | }), |
| | | help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Questions start collapsed and expand on click', 'jvb') |
| | | })] |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelBody, { |
| | | title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Section Order', 'jvb'), |
| | | initialOpen: false, |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("p", { |
| | | className: "components-base-control__help", |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Use the arrow buttons to reorder sections', 'jvb') |
| | | }), sections.length > 0 ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { |
| | | className: "faq-section-list", |
| | | children: sections.map((section, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", { |
| | | className: "faq-section-item", |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", { |
| | | className: "faq-section-controls", |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, { |
| | | icon: "arrow-up-alt2", |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Move up', 'jvb'), |
| | | disabled: index === 0, |
| | | onClick: () => moveSection(index, 'up'), |
| | | className: "faq-section-button" |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, { |
| | | icon: "arrow-down-alt2", |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Move down', 'jvb'), |
| | | disabled: index === sections.length - 1, |
| | | onClick: () => moveSection(index, 'down'), |
| | | className: "faq-section-button" |
| | | })] |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span", { |
| | | className: "faq-section-name", |
| | | children: section.name |
| | | })] |
| | | }, section.id)) |
| | | }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Notice, { |
| | | status: "info", |
| | | isDismissible: false, |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('No sections found. Create sections in the FAQ taxonomy.', 'jvb') |
| | | })] |
| | | })] |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { |
| | | ...blockProps, |
| | | children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", { |
| | | className: "faq-block-preview", |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("h3", { |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('FAQ Block', 'jvb') |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("p", { |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('This block will display FAQs organized by sections.', 'jvb') |
| | | }), sections.length > 0 ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", { |
| | | className: "faq-sections-preview", |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("strong", { |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Section Order:', 'jvb') |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("ol", { |
| | | children: sections.map(section => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("li", { |
| | | children: section.name |
| | | }, section.id)) |
| | | })] |
| | | }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Notice, { |
| | | status: "warning", |
| | | isDismissible: false, |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('No sections available. Create sections in the FAQ taxonomy.', 'jvb') |
| | | })] |
| | | }) |
| | | })] |
| | | }); |
| | | } |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/faq/index.js" |
| | | /*!**************************!*\ |
| | | !*** ./src/faq/index.js ***! |
| | | \**************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edit */ "./src/faq/edit.js"); |
| | | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./src/faq/style.scss"); |
| | | /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor.scss */ "./src/faq/editor.scss"); |
| | | /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/faq/block.json"); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, { |
| | | edit: _edit__WEBPACK_IMPORTED_MODULE_1__["default"], |
| | | // No save function - dynamic block rendered on server |
| | | save: () => null |
| | | }); |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/faq/editor.scss" |
| | | /*!*****************************!*\ |
| | | !*** ./src/faq/editor.scss ***! |
| | | \*****************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | // extracted by mini-css-extract-plugin |
| | | |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/faq/style.scss" |
| | | /*!****************************!*\ |
| | | !*** ./src/faq/style.scss ***! |
| | | \****************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | // extracted by mini-css-extract-plugin |
| | | |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "react/jsx-runtime" |
| | | /*!**********************************!*\ |
| | | !*** external "ReactJSXRuntime" ***! |
| | | \**********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["ReactJSXRuntime"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/block-editor" |
| | | /*!*************************************!*\ |
| | | !*** external ["wp","blockEditor"] ***! |
| | | \*************************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blockEditor"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/blocks" |
| | | /*!********************************!*\ |
| | | !*** external ["wp","blocks"] ***! |
| | | \********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blocks"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/components" |
| | | /*!************************************!*\ |
| | | !*** external ["wp","components"] ***! |
| | | \************************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["components"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/element" |
| | | /*!*********************************!*\ |
| | | !*** external ["wp","element"] ***! |
| | | \*********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["element"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/i18n" |
| | | /*!******************************!*\ |
| | | !*** external ["wp","i18n"] ***! |
| | | \******************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["i18n"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/faq/block.json" |
| | | /*!****************************!*\ |
| | | !*** ./src/faq/block.json ***! |
| | | \****************************/ |
| | | (module) { |
| | | |
| | | module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"jvb/faq","title":"FAQ Block","category":"jvb","icon":"info","description":"Display FAQs organized by sections with customizable ordering","keywords":["faq","questions","help"],"version":"1.0.0","textdomain":"jvb","attributes":{"sectionOrder":{"type":"array","default":[]},"showSectionTitles":{"type":"boolean","default":true},"collapseByDefault":{"type":"boolean","default":false}},"supports":{"align":["wide","full"],"html":false},"editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js"}'); |
| | | |
| | | /***/ } |
| | | |
| | | /******/ }); |
| | | /************************************************************************/ |
| | | /******/ // The module cache |
| | | /******/ var __webpack_module_cache__ = {}; |
| | | /******/ |
| | | /******/ // The require function |
| | | /******/ function __webpack_require__(moduleId) { |
| | | /******/ // Check if module is in cache |
| | | /******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| | | /******/ if (cachedModule !== undefined) { |
| | | /******/ return cachedModule.exports; |
| | | /******/ } |
| | | /******/ // Create a new module (and put it into the cache) |
| | | /******/ var module = __webpack_module_cache__[moduleId] = { |
| | | /******/ // no module.id needed |
| | | /******/ // no module.loaded needed |
| | | /******/ exports: {} |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // Execute the module function |
| | | /******/ if (!(moduleId in __webpack_modules__)) { |
| | | /******/ delete __webpack_module_cache__[moduleId]; |
| | | /******/ var e = new Error("Cannot find module '" + moduleId + "'"); |
| | | /******/ e.code = 'MODULE_NOT_FOUND'; |
| | | /******/ throw e; |
| | | /******/ } |
| | | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| | | /******/ |
| | | /******/ // Return the exports of the module |
| | | /******/ return module.exports; |
| | | /******/ } |
| | | /******/ |
| | | /******/ // expose the modules object (__webpack_modules__) |
| | | /******/ __webpack_require__.m = __webpack_modules__; |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ /* webpack/runtime/chunk loaded */ |
| | | /******/ (() => { |
| | | /******/ var deferred = []; |
| | | /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { |
| | | /******/ if(chunkIds) { |
| | | /******/ priority = priority || 0; |
| | | /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; |
| | | /******/ deferred[i] = [chunkIds, fn, priority]; |
| | | /******/ return; |
| | | /******/ } |
| | | /******/ var notFulfilled = Infinity; |
| | | /******/ for (var i = 0; i < deferred.length; i++) { |
| | | /******/ var [chunkIds, fn, priority] = deferred[i]; |
| | | /******/ var fulfilled = true; |
| | | /******/ for (var j = 0; j < chunkIds.length; j++) { |
| | | /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { |
| | | /******/ chunkIds.splice(j--, 1); |
| | | /******/ } else { |
| | | /******/ fulfilled = false; |
| | | /******/ if(priority < notFulfilled) notFulfilled = priority; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(fulfilled) { |
| | | /******/ deferred.splice(i--, 1) |
| | | /******/ var r = fn(); |
| | | /******/ if (r !== undefined) result = r; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ return result; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/compat get default export */ |
| | | /******/ (() => { |
| | | /******/ // getDefaultExport function for compatibility with non-harmony modules |
| | | /******/ __webpack_require__.n = (module) => { |
| | | /******/ var getter = module && module.__esModule ? |
| | | /******/ () => (module['default']) : |
| | | /******/ () => (module); |
| | | /******/ __webpack_require__.d(getter, { a: getter }); |
| | | /******/ return getter; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/define property getters */ |
| | | /******/ (() => { |
| | | /******/ // define getter functions for harmony exports |
| | | /******/ __webpack_require__.d = (exports, definition) => { |
| | | /******/ for(var key in definition) { |
| | | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| | | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| | | /******/ } |
| | | /******/ } |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| | | /******/ (() => { |
| | | /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/make namespace object */ |
| | | /******/ (() => { |
| | | /******/ // define __esModule on exports |
| | | /******/ __webpack_require__.r = (exports) => { |
| | | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
| | | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| | | /******/ } |
| | | /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/jsonp chunk loading */ |
| | | /******/ (() => { |
| | | /******/ // no baseURI |
| | | /******/ |
| | | /******/ // object to store loaded and loading chunks |
| | | /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched |
| | | /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded |
| | | /******/ var installedChunks = { |
| | | /******/ "faq/index": 0, |
| | | /******/ "faq/style-index": 0 |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // no chunk on demand loading |
| | | /******/ |
| | | /******/ // no prefetching |
| | | /******/ |
| | | /******/ // no preloaded |
| | | /******/ |
| | | /******/ // no HMR |
| | | /******/ |
| | | /******/ // no HMR manifest |
| | | /******/ |
| | | /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); |
| | | /******/ |
| | | /******/ // install a JSONP callback for chunk loading |
| | | /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { |
| | | /******/ var [chunkIds, moreModules, runtime] = data; |
| | | /******/ // add "moreModules" to the modules object, |
| | | /******/ // then flag all "chunkIds" as loaded and fire callback |
| | | /******/ var moduleId, chunkId, i = 0; |
| | | /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { |
| | | /******/ for(moduleId in moreModules) { |
| | | /******/ if(__webpack_require__.o(moreModules, moduleId)) { |
| | | /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(runtime) var result = runtime(__webpack_require__); |
| | | /******/ } |
| | | /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); |
| | | /******/ for(;i < chunkIds.length; i++) { |
| | | /******/ chunkId = chunkIds[i]; |
| | | /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { |
| | | /******/ installedChunks[chunkId][0](); |
| | | /******/ } |
| | | /******/ installedChunks[chunkId] = 0; |
| | | /******/ } |
| | | /******/ return __webpack_require__.O(result); |
| | | /******/ } |
| | | /******/ |
| | | /******/ var chunkLoadingGlobal = globalThis["webpackChunkjvb"] = globalThis["webpackChunkjvb"] || []; |
| | | /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); |
| | | /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); |
| | | /******/ })(); |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ |
| | | /******/ // startup |
| | | /******/ // Load entry module and return exports |
| | | /******/ // This entry module depends on other loaded chunks and execution need to be delayed |
| | | /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["faq/style-index"], () => (__webpack_require__("./src/faq/index.js"))) |
| | | /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); |
| | | /******/ |
| | | /******/ })() |
| | | ; |
| | | //# sourceMappingURL=index.js.map |
| | | (()=>{"use strict";var e,s={604(){const e=window.wp.blocks,s=window.wp.blockEditor,n=window.wp.components,i=window.wp.i18n,o=window.wp.element,t=window.ReactJSXRuntime;(0,e.registerBlockType)("jvb/faq",{edit:function({attributes:e,setAttributes:l}){const{sectionOrder:a,showSectionTitles:c,collapseByDefault:r}=e,[d,h]=(0,o.useState)([]),p=window.jvbFaq?.sections||[];(0,o.useEffect)(()=>{if(p.length)if(0===a.length){const e=p.map(e=>({id:e.id,name:e.name}));h(e),l({sectionOrder:e.map(e=>e.id)})}else{const e=[],s=new Set(a);a.forEach(s=>{const n=p.find(e=>e.id===s);n&&e.push({id:n.id,name:n.name})}),p.forEach(n=>{s.has(n.id)||e.push({id:n.id,name:n.name})}),h(e)}},[p,a]);const b=(e,s)=>{const n=[...d],i="up"===s?e-1:e+1;i<0||i>=n.length||([n[e],n[i]]=[n[i],n[e]],h(n),l({sectionOrder:n.map(e=>e.id)}))},v=(0,s.useBlockProps)({className:"faq-block-editor"});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(s.InspectorControls,{children:[(0,t.jsxs)(n.PanelBody,{title:(0,i.__)("FAQ Settings","jvb"),initialOpen:!0,children:[(0,t.jsx)(n.ToggleControl,{label:(0,i.__)("Show Section Titles","jvb"),checked:c,onChange:e=>l({showSectionTitles:e}),help:(0,i.__)("Display section names as headings","jvb")}),(0,t.jsx)(n.ToggleControl,{label:(0,i.__)("Collapse by Default","jvb"),checked:r,onChange:e=>l({collapseByDefault:e}),help:(0,i.__)("Questions start collapsed and expand on click","jvb")})]}),(0,t.jsxs)(n.PanelBody,{title:(0,i.__)("Section Order","jvb"),initialOpen:!1,children:[(0,t.jsx)("p",{className:"components-base-control__help",children:(0,i.__)("Use the arrow buttons to reorder sections","jvb")}),d.length>0?(0,t.jsx)("div",{className:"faq-section-list",children:d.map((e,s)=>(0,t.jsxs)("div",{className:"faq-section-item",children:[(0,t.jsxs)("div",{className:"faq-section-controls",children:[(0,t.jsx)(n.Button,{icon:"arrow-up-alt2",label:(0,i.__)("Move up","jvb"),disabled:0===s,onClick:()=>b(s,"up"),className:"faq-section-button"}),(0,t.jsx)(n.Button,{icon:"arrow-down-alt2",label:(0,i.__)("Move down","jvb"),disabled:s===d.length-1,onClick:()=>b(s,"down"),className:"faq-section-button"})]}),(0,t.jsx)("span",{className:"faq-section-name",children:e.name})]},e.id))}):(0,t.jsx)(n.Notice,{status:"info",isDismissible:!1,children:(0,i.__)("No sections found. Create sections in the FAQ taxonomy.","jvb")})]})]}),(0,t.jsx)("div",{...v,children:(0,t.jsxs)("div",{className:"faq-block-preview",children:[(0,t.jsx)("h3",{children:(0,i.__)("FAQ Block","jvb")}),(0,t.jsx)("p",{children:(0,i.__)("This block will display FAQs organized by sections.","jvb")}),d.length>0?(0,t.jsxs)("div",{className:"faq-sections-preview",children:[(0,t.jsx)("strong",{children:(0,i.__)("Section Order:","jvb")}),(0,t.jsx)("ol",{children:d.map(e=>(0,t.jsx)("li",{children:e.name},e.id))})]}):(0,t.jsx)(n.Notice,{status:"warning",isDismissible:!1,children:(0,i.__)("No sections available. Create sections in the FAQ taxonomy.","jvb")})]})})]})},save:()=>null})}},n={};function i(e){var o=n[e];if(void 0!==o)return o.exports;var t=n[e]={exports:{}};return s[e](t,t.exports,i),t.exports}i.m=s,e=[],i.O=(s,n,o,t)=>{if(!n){var l=1/0;for(d=0;d<e.length;d++){for(var[n,o,t]=e[d],a=!0,c=0;c<n.length;c++)(!1&t||l>=t)&&Object.keys(i.O).every(e=>i.O[e](n[c]))?n.splice(c--,1):(a=!1,t<l&&(l=t));if(a){e.splice(d--,1);var r=o();void 0!==r&&(s=r)}}return s}t=t||0;for(var d=e.length;d>0&&e[d-1][2]>t;d--)e[d]=e[d-1];e[d]=[n,o,t]},i.o=(e,s)=>Object.prototype.hasOwnProperty.call(e,s),(()=>{var e={456:0,656:0};i.O.j=s=>0===e[s];var s=(s,n)=>{var o,t,[l,a,c]=n,r=0;if(l.some(s=>0!==e[s])){for(o in a)i.o(a,o)&&(i.m[o]=a[o]);if(c)var d=c(i)}for(s&&s(n);r<l.length;r++)t=l[r],i.o(e,t)&&e[t]&&e[t][0](),e[t]=0;return i.O(d)},n=globalThis.webpackChunkjvb=globalThis.webpackChunkjvb||[];n.forEach(s.bind(null,0)),n.push=s.bind(null,n.push.bind(n))})();var o=i.O(void 0,[656],()=>i(604));o=i.O(o)})(); |
| | |
| | | /*!*******************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/faq/style.scss ***! |
| | | \*******************************************************************************************************************************************************************************************************************************************/ |
| | | nav#faq { |
| | | height: -moz-max-content; |
| | | height: max-content; |
| | | display: block; |
| | | background-color: rgb(var(--base-100)); |
| | | border-radius: var(--radius-outer); |
| | | padding: 1.5rem; |
| | | touch-action: auto; |
| | | } |
| | | nav#faq ol { |
| | | list-style: decimal-leading-zero; |
| | | height: -moz-fit-content; |
| | | height: fit-content; |
| | | display: block; |
| | | counter-reset: faq; |
| | | } |
| | | nav#faq ol li { |
| | | counter-increment: faq; |
| | | width: -moz-max-content; |
| | | width: max-content; |
| | | } |
| | | nav#faq ol li::before { |
| | | content: counter(faq); |
| | | display: block; |
| | | font-family: var(--heading); |
| | | font-weight: var(--fw-h-bold); |
| | | } |
| | | nav#faq h2 { |
| | | right: 0; |
| | | font-size: var(--txt-large); |
| | | margin: 0.5rem 0 0.5rem; |
| | | } |
| | | nav#faq a { |
| | | padding: 0.5rem; |
| | | } |
| | | .faq-block { |
| | | padding-bottom: 3rem; |
| | | max-width: none; |
| | | width: 100%; |
| | | } |
| | | .faq-block > * { |
| | | max-width: var(--wide); |
| | | margin: 1rem auto; |
| | | } |
| | | .faq-block h2 { |
| | | margin: 5rem 0 1.5rem; |
| | | } |
| | | .faq-block h3 { |
| | | margin: 0; |
| | | text-transform: none; |
| | | } |
| | | .faq-block :target { |
| | | background-color: rgb(var(--base)); |
| | | outline: none; |
| | | } |
| | | .faq-block :target h2 { |
| | | background-color: rgb(var(--base)); |
| | | padding: 1rem 1.5rem; |
| | | border-radius: var(--radius-outer); |
| | | } |
| | | .faq-block details { |
| | | max-width: var(--content); |
| | | margin: 1rem auto; |
| | | padding: 0.75rem; |
| | | } |
| | | .faq-block details + details { |
| | | margin-top: 3rem; |
| | | } |
| | | .faq-block details .button { |
| | | height: -moz-fit-content; |
| | | height: fit-content; |
| | | display: flex; |
| | | margin-right: auto; |
| | | } |
| | | nav#faq{background-color:rgb(var(--base-100));border-radius:var(--radius-outer);display:block;height:-moz-max-content;height:max-content;padding:1.5rem;touch-action:auto}nav#faq ol{counter-reset:faq;display:block;height:-moz-fit-content;height:fit-content;list-style:decimal-leading-zero}nav#faq ol li{counter-increment:faq;width:-moz-max-content;width:max-content}nav#faq ol li:before{content:counter(faq);display:block;font-family:var(--heading);font-weight:var(--fw-h-bold)}nav#faq h2{font-size:var(--txt-large);right:0;margin:.5rem 0}nav#faq a{padding:.5rem}.faq-block{max-width:none;padding-bottom:3rem;width:100%}.faq-block>*{margin:1rem auto;max-width:var(--wide)}.faq-block h2{margin:5rem 0 1.5rem}.faq-block h3{margin:0;text-transform:none}.faq-block :target{background-color:rgb(var(--base));outline:none}.faq-block :target h2{background-color:rgb(var(--base));border-radius:var(--radius-outer);padding:1rem 1.5rem}.faq-block details{margin:1rem auto;max-width:var(--content);padding:.75rem}.faq-block details+details{margin-top:3rem}.faq-block details .button{display:flex;height:-moz-fit-content;height:fit-content;margin-right:auto} |
| | |
| | | /*!*******************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/faq/style.scss ***! |
| | | \*******************************************************************************************************************************************************************************************************************************************/ |
| | | nav#faq { |
| | | height: -moz-max-content; |
| | | height: max-content; |
| | | display: block; |
| | | background-color: rgb(var(--base-100)); |
| | | border-radius: var(--radius-outer); |
| | | padding: 1.5rem; |
| | | touch-action: auto; |
| | | } |
| | | nav#faq ol { |
| | | list-style: decimal-leading-zero; |
| | | height: -moz-fit-content; |
| | | height: fit-content; |
| | | display: block; |
| | | counter-reset: faq; |
| | | } |
| | | nav#faq ol li { |
| | | counter-increment: faq; |
| | | width: -moz-max-content; |
| | | width: max-content; |
| | | } |
| | | nav#faq ol li::before { |
| | | content: counter(faq); |
| | | display: block; |
| | | font-family: var(--heading); |
| | | font-weight: var(--fw-h-bold); |
| | | } |
| | | nav#faq h2 { |
| | | left: 0; |
| | | font-size: var(--txt-large); |
| | | margin: 0.5rem 0 0.5rem; |
| | | } |
| | | nav#faq a { |
| | | padding: 0.5rem; |
| | | } |
| | | .faq-block { |
| | | padding-bottom: 3rem; |
| | | max-width: none; |
| | | width: 100%; |
| | | } |
| | | .faq-block > * { |
| | | max-width: var(--wide); |
| | | margin: 1rem auto; |
| | | } |
| | | .faq-block h2 { |
| | | margin: 5rem 0 1.5rem; |
| | | } |
| | | .faq-block h3 { |
| | | margin: 0; |
| | | text-transform: none; |
| | | } |
| | | .faq-block :target { |
| | | background-color: rgb(var(--base)); |
| | | outline: none; |
| | | } |
| | | .faq-block :target h2 { |
| | | background-color: rgb(var(--base)); |
| | | padding: 1rem 1.5rem; |
| | | border-radius: var(--radius-outer); |
| | | } |
| | | .faq-block details { |
| | | max-width: var(--content); |
| | | margin: 1rem auto; |
| | | padding: 0.75rem; |
| | | } |
| | | .faq-block details + details { |
| | | margin-top: 3rem; |
| | | } |
| | | .faq-block details .button { |
| | | height: -moz-fit-content; |
| | | height: fit-content; |
| | | display: flex; |
| | | margin-left: auto; |
| | | } |
| | | |
| | | /*# sourceMappingURL=style-index.css.map*/ |
| | | nav#faq{background-color:rgb(var(--base-100));border-radius:var(--radius-outer);display:block;height:-moz-max-content;height:max-content;padding:1.5rem;touch-action:auto}nav#faq ol{counter-reset:faq;display:block;height:-moz-fit-content;height:fit-content;list-style:decimal-leading-zero}nav#faq ol li{counter-increment:faq;width:-moz-max-content;width:max-content}nav#faq ol li:before{content:counter(faq);display:block;font-family:var(--heading);font-weight:var(--fw-h-bold)}nav#faq h2{font-size:var(--txt-large);left:0;margin:.5rem 0}nav#faq a{padding:.5rem}.faq-block{max-width:none;padding-bottom:3rem;width:100%}.faq-block>*{margin:1rem auto;max-width:var(--wide)}.faq-block h2{margin:5rem 0 1.5rem}.faq-block h3{margin:0;text-transform:none}.faq-block :target{background-color:rgb(var(--base));outline:none}.faq-block :target h2{background-color:rgb(var(--base));border-radius:var(--radius-outer);padding:1rem 1.5rem}.faq-block details{margin:1rem auto;max-width:var(--content);padding:.75rem}.faq-block details+details{margin-top:3rem}.faq-block details .button{display:flex;height:-moz-fit-content;height:fit-content;margin-left:auto} |
| | |
| | | <?php return array('dependencies' => array(), 'version' => 'b2708d109babb049c10a'); |
| | | <?php return array('dependencies' => array(), 'version' => 'd8ed72030ab0be236a6c'); |
| | |
| | | /******/ (() => { // webpackBootstrap |
| | | /*!*************************!*\ |
| | | !*** ./src/faq/view.js ***! |
| | | \*************************/ |
| | | /** |
| | | * FAQ Block - Frontend Interactions |
| | | * Handles accordion functionality for FAQ items |
| | | */ |
| | | |
| | | document.addEventListener('DOMContentLoaded', () => { |
| | | const faqBlocks = document.querySelectorAll('.faq-block'); |
| | | faqBlocks.forEach(block => { |
| | | const faqItems = block.querySelectorAll('.faq-item'); |
| | | faqItems.forEach(item => { |
| | | const button = item.querySelector('.faq-item__question'); |
| | | const answer = item.querySelector('.faq-item__answer'); |
| | | if (!button || !answer) return; |
| | | button.addEventListener('click', () => { |
| | | const isExpanded = button.getAttribute('aria-expanded') === 'true'; |
| | | |
| | | // Toggle this item |
| | | button.setAttribute('aria-expanded', !isExpanded); |
| | | if (isExpanded) { |
| | | // Collapse |
| | | answer.style.height = answer.scrollHeight + 'px'; |
| | | // Force reflow |
| | | answer.offsetHeight; |
| | | answer.style.height = '0'; |
| | | setTimeout(() => { |
| | | answer.style.display = 'none'; |
| | | answer.style.height = ''; |
| | | }, 300); |
| | | item.classList.remove('faq-item--expanded'); |
| | | } else { |
| | | // Expand |
| | | answer.style.display = 'block'; |
| | | answer.style.height = '0'; |
| | | // Force reflow |
| | | answer.offsetHeight; |
| | | answer.style.height = answer.scrollHeight + 'px'; |
| | | setTimeout(() => { |
| | | answer.style.height = 'auto'; |
| | | }, 300); |
| | | item.classList.add('faq-item--expanded'); |
| | | } |
| | | }); |
| | | |
| | | // Handle keyboard navigation |
| | | button.addEventListener('keydown', e => { |
| | | // Space or Enter triggers the button |
| | | if (e.key === ' ' || e.key === 'Enter') { |
| | | e.preventDefault(); |
| | | button.click(); |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | // Optional: Add URL hash navigation |
| | | // If URL has #faq-123, open that specific FAQ |
| | | if (window.location.hash) { |
| | | const hash = window.location.hash.substring(1); |
| | | const targetItem = document.querySelector(`[data-faq-id="${hash}"]`); |
| | | if (targetItem) { |
| | | const button = targetItem.querySelector('.faq-item__question'); |
| | | const isExpanded = button.getAttribute('aria-expanded') === 'true'; |
| | | if (!isExpanded) { |
| | | button.click(); |
| | | } |
| | | |
| | | // Scroll to item after a short delay |
| | | setTimeout(() => { |
| | | targetItem.scrollIntoView({ |
| | | behavior: 'smooth', |
| | | block: 'center' |
| | | }); |
| | | }, 350); |
| | | } |
| | | } |
| | | }); |
| | | /******/ })() |
| | | ; |
| | | //# sourceMappingURL=view.js.map |
| | | document.addEventListener("DOMContentLoaded",()=>{if(document.querySelectorAll(".faq-block").forEach(e=>{e.querySelectorAll(".faq-item").forEach(e=>{const t=e.querySelector(".faq-item__question"),i=e.querySelector(".faq-item__answer");t&&i&&(t.addEventListener("click",()=>{const o="true"===t.getAttribute("aria-expanded");t.setAttribute("aria-expanded",!o),o?(i.style.height=i.scrollHeight+"px",i.offsetHeight,i.style.height="0",setTimeout(()=>{i.style.display="none",i.style.height=""},300),e.classList.remove("faq-item--expanded")):(i.style.display="block",i.style.height="0",i.offsetHeight,i.style.height=i.scrollHeight+"px",setTimeout(()=>{i.style.height="auto"},300),e.classList.add("faq-item--expanded"))}),t.addEventListener("keydown",e=>{" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),t.click())}))})}),window.location.hash){const e=window.location.hash.substring(1),t=document.querySelector(`[data-faq-id="${e}"]`);if(t){const e=t.querySelector(".faq-item__question");"true"===e.getAttribute("aria-expanded")||e.click(),setTimeout(()=>{t.scrollIntoView({behavior:"smooth",block:"center"})},350)}}}); |
| | |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'fe0e82dbe0767c5155b9'); |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '33aeda6042c7c1cebcc0'); |
| | |
| | | /******/ (() => { // webpackBootstrap |
| | | /******/ "use strict"; |
| | | /******/ var __webpack_modules__ = ({ |
| | | |
| | | /***/ "./src/feed/edit.js" |
| | | /*!**************************!*\ |
| | | !*** ./src/feed/edit.js ***! |
| | | \**************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| | | /* harmony export */ "default": () => (/* binding */ Edit) |
| | | /* harmony export */ }); |
| | | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| | | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); |
| | | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); |
| | | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); |
| | | /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); |
| | | /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__); |
| | | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| | | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__); |
| | | /** |
| | | * Feed Block - Edit Component |
| | | * Fetches available feed types from /jvb/v1/feed/types |
| | | * Allows configuration of content types and inherit query setting |
| | | */ |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | function Edit({ |
| | | attributes, |
| | | setAttributes |
| | | }) { |
| | | const [feedTypes, setFeedTypes] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(null); |
| | | const [loading, setLoading] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(true); |
| | | const [error, setError] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(null); |
| | | const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({ |
| | | className: 'feed-block-editor' |
| | | }); |
| | | |
| | | /** |
| | | * Fetch available feed types on component mount |
| | | */ |
| | | (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { |
| | | _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default()({ |
| | | path: '/jvb/v1/feed/types', |
| | | headers: { |
| | | 'If-Modified-Since': localStorage.getItem('feed_types_modified') |
| | | } |
| | | }).then(types => { |
| | | setFeedTypes(types); |
| | | setLoading(false); |
| | | |
| | | // Store Last-Modified for future requests |
| | | // (apiFetch doesn't expose response headers easily, |
| | | // but the server will handle 304s) |
| | | |
| | | // Initialize contentTypes if not set and not inheriting |
| | | if (!attributes.contentTypes && !attributes.inheritQuery) { |
| | | const firstType = Object.keys(types)[0]; |
| | | if (firstType) { |
| | | setAttributes({ |
| | | contentTypes: [firstType] |
| | | }); |
| | | } |
| | | } |
| | | }).catch(err => { |
| | | console.error('Error loading feed types:', err); |
| | | setError(err.message); |
| | | setLoading(false); |
| | | }); |
| | | }, [attributes.inheritQuery]); |
| | | |
| | | /** |
| | | * Toggle a content type in the selection |
| | | */ |
| | | const toggleContentType = (slug, checked) => { |
| | | const currentTypes = attributes.contentTypes || []; |
| | | const newTypes = checked ? [...currentTypes, slug] : currentTypes.filter(t => t !== slug); |
| | | setAttributes({ |
| | | contentTypes: newTypes |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * Get friendly label for content type |
| | | */ |
| | | const getTypeLabel = (slug, config) => { |
| | | return `${config.plural} (${config.type})`; |
| | | }; |
| | | |
| | | /** |
| | | * Group types by category for better UX |
| | | */ |
| | | const groupedTypes = feedTypes ? { |
| | | content: Object.entries(feedTypes).filter(([_, config]) => config.type === 'content'), |
| | | taxonomy: Object.entries(feedTypes).filter(([_, config]) => config.type === 'taxonomy') |
| | | } : { |
| | | content: [], |
| | | taxonomy: [] |
| | | }; |
| | | return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", { |
| | | ...blockProps, |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, { |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { |
| | | title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Feed Settings', 'jvb'), |
| | | initialOpen: true, |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ToggleControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Inherit from Page Context', 'jvb'), |
| | | help: attributes.inheritQuery ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Feed will adapt to the current page (profile, taxonomy, etc.)', 'jvb') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Manually select content types to display', 'jvb'), |
| | | checked: attributes.inheritQuery, |
| | | onChange: value => setAttributes({ |
| | | inheritQuery: value |
| | | }) |
| | | }), !attributes.inheritQuery && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, { |
| | | children: [loading && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", { |
| | | style: { |
| | | textAlign: 'center', |
| | | padding: '20px' |
| | | }, |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("p", { |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Loading feed types...', 'jvb') |
| | | })] |
| | | }), error && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Notice, { |
| | | status: "error", |
| | | isDismissible: false, |
| | | children: [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Error loading feed types: ', 'jvb'), " ", error] |
| | | }), !loading && !error && feedTypes && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, { |
| | | children: [groupedTypes.content.length > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, { |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("h4", { |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Content Types', 'jvb') |
| | | }), groupedTypes.content.map(([slug, config]) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.CheckboxControl, { |
| | | label: getTypeLabel(slug, config), |
| | | checked: attributes.contentTypes?.includes(slug) || false, |
| | | onChange: checked => toggleContentType(slug, checked), |
| | | help: config.taxonomies?.length > 0 ? `Filters: ${config.taxonomies.join(', ')}` : null |
| | | }, slug))] |
| | | }), groupedTypes.taxonomy.length > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, { |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("h4", { |
| | | style: { |
| | | marginTop: '20px' |
| | | }, |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Content Taxonomies', 'jvb') |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("p", { |
| | | style: { |
| | | fontSize: '12px', |
| | | color: '#757575' |
| | | }, |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('These are collections that group other content', 'jvb') |
| | | }), groupedTypes.taxonomy.map(([slug, config]) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.CheckboxControl, { |
| | | label: getTypeLabel(slug, config), |
| | | checked: attributes.contentTypes?.includes(slug) || false, |
| | | onChange: checked => toggleContentType(slug, checked), |
| | | help: config.for_content?.length > 0 ? `Contains: ${config.for_content.join(', ')}` : null |
| | | }, slug))] |
| | | }), !attributes.contentTypes?.length && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Notice, { |
| | | status: "warning", |
| | | isDismissible: false, |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Please select at least one content type', 'jvb') |
| | | })] |
| | | })] |
| | | })] |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { |
| | | title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Display Settings', 'jvb'), |
| | | initialOpen: false, |
| | | children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ToggleControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Show Gallery View', 'jvb'), |
| | | help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Enable lightbox for images', 'jvb'), |
| | | checked: attributes.enableGallery || false, |
| | | onChange: value => setAttributes({ |
| | | enableGallery: value |
| | | }) |
| | | }) |
| | | })] |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", { |
| | | className: "feed-block-placeholder", |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { |
| | | className: "feed-block-icon", |
| | | children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("svg", { |
| | | width: "48", |
| | | height: "48", |
| | | viewBox: "0 0 24 24", |
| | | fill: "none", |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("rect", { |
| | | x: "3", |
| | | y: "3", |
| | | width: "7", |
| | | height: "7", |
| | | fill: "currentColor", |
| | | opacity: "0.3" |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("rect", { |
| | | x: "13", |
| | | y: "3", |
| | | width: "7", |
| | | height: "7", |
| | | fill: "currentColor", |
| | | opacity: "0.3" |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("rect", { |
| | | x: "3", |
| | | y: "13", |
| | | width: "7", |
| | | height: "7", |
| | | fill: "currentColor", |
| | | opacity: "0.3" |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("rect", { |
| | | x: "13", |
| | | y: "13", |
| | | width: "7", |
| | | height: "7", |
| | | fill: "currentColor", |
| | | opacity: "0.3" |
| | | })] |
| | | }) |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("h3", { |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Feed Block', 'jvb') |
| | | }), attributes.inheritQuery ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("p", { |
| | | className: "feed-block-description", |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('📍 Inheriting from page context', 'jvb') |
| | | }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { |
| | | className: "feed-block-description", |
| | | children: attributes.contentTypes?.length > 0 ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, { |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("p", { |
| | | children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("strong", { |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Showing:', 'jvb') |
| | | }) |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("ul", { |
| | | style: { |
| | | listStyle: 'none', |
| | | padding: '0', |
| | | margin: '8px 0' |
| | | }, |
| | | children: attributes.contentTypes.map(type => { |
| | | const config = feedTypes?.[type]; |
| | | return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("li", { |
| | | style: { |
| | | padding: '4px 0', |
| | | color: '#2271b1' |
| | | }, |
| | | children: ["\u2713 ", config?.plural || type] |
| | | }, type); |
| | | }) |
| | | })] |
| | | }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("p", { |
| | | style: { |
| | | color: '#d63638' |
| | | }, |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('⚠️ No content types selected', 'jvb') |
| | | }) |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("p", { |
| | | className: "feed-block-note", |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Feed will be displayed on the frontend', 'jvb') |
| | | })] |
| | | })] |
| | | }); |
| | | } |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/feed/index.js" |
| | | /*!***************************!*\ |
| | | !*** ./src/feed/index.js ***! |
| | | \***************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/feed/style.scss"); |
| | | /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/feed/edit.js"); |
| | | /* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/feed/save.js"); |
| | | /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/feed/block.json"); |
| | | /** |
| | | * Registers a new block provided a unique name and an object defining its behavior. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. |
| | | * All files containing `style` keyword are bundled together. The code used |
| | | * gets applied both to the front of your site and to the editor. |
| | | * |
| | | * @see https://www.npmjs.com/package/@wordpress/scripts#using-css |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * Internal dependencies |
| | | */ |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Every block starts by registering a new block type definition. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ |
| | | */ |
| | | (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, { |
| | | /** |
| | | * @see ./edit.js |
| | | */ |
| | | edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"], |
| | | /** |
| | | * @see ./save.js |
| | | */ |
| | | save: _save__WEBPACK_IMPORTED_MODULE_3__["default"] |
| | | }); |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/feed/save.js" |
| | | /*!**************************!*\ |
| | | !*** ./src/feed/save.js ***! |
| | | \**************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| | | /* harmony export */ "default": () => (/* binding */ save) |
| | | /* harmony export */ }); |
| | | function save() { |
| | | return null; // Dynamic block rendered by PHP |
| | | } |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/feed/style.scss" |
| | | /*!*****************************!*\ |
| | | !*** ./src/feed/style.scss ***! |
| | | \*****************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | // extracted by mini-css-extract-plugin |
| | | |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "react/jsx-runtime" |
| | | /*!**********************************!*\ |
| | | !*** external "ReactJSXRuntime" ***! |
| | | \**********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["ReactJSXRuntime"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/api-fetch" |
| | | /*!**********************************!*\ |
| | | !*** external ["wp","apiFetch"] ***! |
| | | \**********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["apiFetch"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/block-editor" |
| | | /*!*************************************!*\ |
| | | !*** external ["wp","blockEditor"] ***! |
| | | \*************************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blockEditor"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/blocks" |
| | | /*!********************************!*\ |
| | | !*** external ["wp","blocks"] ***! |
| | | \********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blocks"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/components" |
| | | /*!************************************!*\ |
| | | !*** external ["wp","components"] ***! |
| | | \************************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["components"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/element" |
| | | /*!*********************************!*\ |
| | | !*** external ["wp","element"] ***! |
| | | \*********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["element"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/i18n" |
| | | /*!******************************!*\ |
| | | !*** external ["wp","i18n"] ***! |
| | | \******************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["i18n"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/feed/block.json" |
| | | /*!*****************************!*\ |
| | | !*** ./src/feed/block.json ***! |
| | | \*****************************/ |
| | | (module) { |
| | | |
| | | module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"jvb/feed","title":"Feed","category":"jvb","icon":"grid-view","description":"Displays a filterable feed of registered content types","keywords":["feed","grid"],"version":"0.9.0","textdomain":"jvb","supports":{"html":false,"align":["wide","full"]},"attributes":{"title":{"type":"string","default":"Your Scene"},"inheritQuery":{"type":"boolean","default":false},"contentTypes":{"type":"array","default":["tattoo","artwork","artist"],"items":{"type":"string"}},"itemsPerPage":{"type":"number","default":36},"defaultOrder":{"type":"string","default":"date_desc"}},"selectors":{"root":".feed-block"},"styles":[{"name":"default","label":"Default","isDefault":true},{"name":"other","label":"Other"}],"example":{"attributes":{"message":"This is a notice!"}},"editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js"}'); |
| | | |
| | | /***/ } |
| | | |
| | | /******/ }); |
| | | /************************************************************************/ |
| | | /******/ // The module cache |
| | | /******/ var __webpack_module_cache__ = {}; |
| | | /******/ |
| | | /******/ // The require function |
| | | /******/ function __webpack_require__(moduleId) { |
| | | /******/ // Check if module is in cache |
| | | /******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| | | /******/ if (cachedModule !== undefined) { |
| | | /******/ return cachedModule.exports; |
| | | /******/ } |
| | | /******/ // Create a new module (and put it into the cache) |
| | | /******/ var module = __webpack_module_cache__[moduleId] = { |
| | | /******/ // no module.id needed |
| | | /******/ // no module.loaded needed |
| | | /******/ exports: {} |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // Execute the module function |
| | | /******/ if (!(moduleId in __webpack_modules__)) { |
| | | /******/ delete __webpack_module_cache__[moduleId]; |
| | | /******/ var e = new Error("Cannot find module '" + moduleId + "'"); |
| | | /******/ e.code = 'MODULE_NOT_FOUND'; |
| | | /******/ throw e; |
| | | /******/ } |
| | | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| | | /******/ |
| | | /******/ // Return the exports of the module |
| | | /******/ return module.exports; |
| | | /******/ } |
| | | /******/ |
| | | /******/ // expose the modules object (__webpack_modules__) |
| | | /******/ __webpack_require__.m = __webpack_modules__; |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ /* webpack/runtime/chunk loaded */ |
| | | /******/ (() => { |
| | | /******/ var deferred = []; |
| | | /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { |
| | | /******/ if(chunkIds) { |
| | | /******/ priority = priority || 0; |
| | | /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; |
| | | /******/ deferred[i] = [chunkIds, fn, priority]; |
| | | /******/ return; |
| | | /******/ } |
| | | /******/ var notFulfilled = Infinity; |
| | | /******/ for (var i = 0; i < deferred.length; i++) { |
| | | /******/ var [chunkIds, fn, priority] = deferred[i]; |
| | | /******/ var fulfilled = true; |
| | | /******/ for (var j = 0; j < chunkIds.length; j++) { |
| | | /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { |
| | | /******/ chunkIds.splice(j--, 1); |
| | | /******/ } else { |
| | | /******/ fulfilled = false; |
| | | /******/ if(priority < notFulfilled) notFulfilled = priority; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(fulfilled) { |
| | | /******/ deferred.splice(i--, 1) |
| | | /******/ var r = fn(); |
| | | /******/ if (r !== undefined) result = r; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ return result; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/compat get default export */ |
| | | /******/ (() => { |
| | | /******/ // getDefaultExport function for compatibility with non-harmony modules |
| | | /******/ __webpack_require__.n = (module) => { |
| | | /******/ var getter = module && module.__esModule ? |
| | | /******/ () => (module['default']) : |
| | | /******/ () => (module); |
| | | /******/ __webpack_require__.d(getter, { a: getter }); |
| | | /******/ return getter; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/define property getters */ |
| | | /******/ (() => { |
| | | /******/ // define getter functions for harmony exports |
| | | /******/ __webpack_require__.d = (exports, definition) => { |
| | | /******/ for(var key in definition) { |
| | | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| | | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| | | /******/ } |
| | | /******/ } |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| | | /******/ (() => { |
| | | /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/make namespace object */ |
| | | /******/ (() => { |
| | | /******/ // define __esModule on exports |
| | | /******/ __webpack_require__.r = (exports) => { |
| | | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
| | | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| | | /******/ } |
| | | /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/jsonp chunk loading */ |
| | | /******/ (() => { |
| | | /******/ // no baseURI |
| | | /******/ |
| | | /******/ // object to store loaded and loading chunks |
| | | /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched |
| | | /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded |
| | | /******/ var installedChunks = { |
| | | /******/ "feed/index": 0, |
| | | /******/ "feed/style-index": 0 |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // no chunk on demand loading |
| | | /******/ |
| | | /******/ // no prefetching |
| | | /******/ |
| | | /******/ // no preloaded |
| | | /******/ |
| | | /******/ // no HMR |
| | | /******/ |
| | | /******/ // no HMR manifest |
| | | /******/ |
| | | /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); |
| | | /******/ |
| | | /******/ // install a JSONP callback for chunk loading |
| | | /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { |
| | | /******/ var [chunkIds, moreModules, runtime] = data; |
| | | /******/ // add "moreModules" to the modules object, |
| | | /******/ // then flag all "chunkIds" as loaded and fire callback |
| | | /******/ var moduleId, chunkId, i = 0; |
| | | /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { |
| | | /******/ for(moduleId in moreModules) { |
| | | /******/ if(__webpack_require__.o(moreModules, moduleId)) { |
| | | /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(runtime) var result = runtime(__webpack_require__); |
| | | /******/ } |
| | | /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); |
| | | /******/ for(;i < chunkIds.length; i++) { |
| | | /******/ chunkId = chunkIds[i]; |
| | | /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { |
| | | /******/ installedChunks[chunkId][0](); |
| | | /******/ } |
| | | /******/ installedChunks[chunkId] = 0; |
| | | /******/ } |
| | | /******/ return __webpack_require__.O(result); |
| | | /******/ } |
| | | /******/ |
| | | /******/ var chunkLoadingGlobal = globalThis["webpackChunkjvb"] = globalThis["webpackChunkjvb"] || []; |
| | | /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); |
| | | /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); |
| | | /******/ })(); |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ |
| | | /******/ // startup |
| | | /******/ // Load entry module and return exports |
| | | /******/ // This entry module depends on other loaded chunks and execution need to be delayed |
| | | /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["feed/style-index"], () => (__webpack_require__("./src/feed/index.js"))) |
| | | /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); |
| | | /******/ |
| | | /******/ })() |
| | | ; |
| | | //# sourceMappingURL=index.js.map |
| | | (()=>{"use strict";var e,t={111(e,t,n){const o=window.wp.blocks,l=window.wp.element,i=window.wp.blockEditor,r=window.wp.components,s=window.wp.apiFetch;var c=n.n(s);const a=window.wp.i18n,d=window.ReactJSXRuntime;(0,o.registerBlockType)("jvb/feed",{edit:function({attributes:e,setAttributes:t}){const[n,o]=(0,l.useState)(null),[s,h]=(0,l.useState)(!0),[p,j]=(0,l.useState)(null),x=(0,i.useBlockProps)({className:"feed-block-editor"});(0,l.useEffect)(()=>{c()({path:"/jvb/v1/feed/types",headers:{"If-Modified-Since":localStorage.getItem("feed_types_modified")}}).then(n=>{if(o(n),h(!1),!e.contentTypes&&!e.inheritQuery){const e=Object.keys(n)[0];e&&t({contentTypes:[e]})}}).catch(e=>{console.error("Error loading feed types:",e),j(e.message),h(!1)})},[e.inheritQuery]);const y=(n,o)=>{const l=e.contentTypes||[],i=o?[...l,n]:l.filter(e=>e!==n);t({contentTypes:i})},b=(e,t)=>`${t.plural} (${t.type})`,g=n?{content:Object.entries(n).filter(([e,t])=>"content"===t.type),taxonomy:Object.entries(n).filter(([e,t])=>"taxonomy"===t.type)}:{content:[],taxonomy:[]};return(0,d.jsxs)("div",{...x,children:[(0,d.jsxs)(i.InspectorControls,{children:[(0,d.jsxs)(r.PanelBody,{title:(0,a.__)("Feed Settings","jvb"),initialOpen:!0,children:[(0,d.jsx)(r.ToggleControl,{label:(0,a.__)("Inherit from Page Context","jvb"),help:e.inheritQuery?(0,a.__)("Feed will adapt to the current page (profile, taxonomy, etc.)","jvb"):(0,a.__)("Manually select content types to display","jvb"),checked:e.inheritQuery,onChange:e=>t({inheritQuery:e})}),!e.inheritQuery&&(0,d.jsxs)(d.Fragment,{children:[s&&(0,d.jsxs)("div",{style:{textAlign:"center",padding:"20px"},children:[(0,d.jsx)(r.Spinner,{}),(0,d.jsx)("p",{children:(0,a.__)("Loading feed types...","jvb")})]}),p&&(0,d.jsxs)(r.Notice,{status:"error",isDismissible:!1,children:[(0,a.__)("Error loading feed types: ","jvb")," ",p]}),!s&&!p&&n&&(0,d.jsxs)(d.Fragment,{children:[g.content.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("h4",{children:(0,a.__)("Content Types","jvb")}),g.content.map(([t,n])=>(0,d.jsx)(r.CheckboxControl,{label:b(0,n),checked:e.contentTypes?.includes(t)||!1,onChange:e=>y(t,e),help:n.taxonomies?.length>0?`Filters: ${n.taxonomies.join(", ")}`:null},t))]}),g.taxonomy.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("h4",{style:{marginTop:"20px"},children:(0,a.__)("Content Taxonomies","jvb")}),(0,d.jsx)("p",{style:{fontSize:"12px",color:"#757575"},children:(0,a.__)("These are collections that group other content","jvb")}),g.taxonomy.map(([t,n])=>(0,d.jsx)(r.CheckboxControl,{label:b(0,n),checked:e.contentTypes?.includes(t)||!1,onChange:e=>y(t,e),help:n.for_content?.length>0?`Contains: ${n.for_content.join(", ")}`:null},t))]}),!e.contentTypes?.length&&(0,d.jsx)(r.Notice,{status:"warning",isDismissible:!1,children:(0,a.__)("Please select at least one content type","jvb")})]})]})]}),(0,d.jsx)(r.PanelBody,{title:(0,a.__)("Display Settings","jvb"),initialOpen:!1,children:(0,d.jsx)(r.ToggleControl,{label:(0,a.__)("Show Gallery View","jvb"),help:(0,a.__)("Enable lightbox for images","jvb"),checked:e.enableGallery||!1,onChange:e=>t({enableGallery:e})})})]}),(0,d.jsxs)("div",{className:"feed-block-placeholder",children:[(0,d.jsx)("div",{className:"feed-block-icon",children:(0,d.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",children:[(0,d.jsx)("rect",{x:"3",y:"3",width:"7",height:"7",fill:"currentColor",opacity:"0.3"}),(0,d.jsx)("rect",{x:"13",y:"3",width:"7",height:"7",fill:"currentColor",opacity:"0.3"}),(0,d.jsx)("rect",{x:"3",y:"13",width:"7",height:"7",fill:"currentColor",opacity:"0.3"}),(0,d.jsx)("rect",{x:"13",y:"13",width:"7",height:"7",fill:"currentColor",opacity:"0.3"})]})}),(0,d.jsx)("h3",{children:(0,a.__)("Feed Block","jvb")}),e.inheritQuery?(0,d.jsx)("p",{className:"feed-block-description",children:(0,a.__)("📍 Inheriting from page context","jvb")}):(0,d.jsx)("div",{className:"feed-block-description",children:e.contentTypes?.length>0?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{children:(0,d.jsx)("strong",{children:(0,a.__)("Showing:","jvb")})}),(0,d.jsx)("ul",{style:{listStyle:"none",padding:"0",margin:"8px 0"},children:e.contentTypes.map(e=>{const t=n?.[e];return(0,d.jsxs)("li",{style:{padding:"4px 0",color:"#2271b1"},children:["✓ ",t?.plural||e]},e)})})]}):(0,d.jsx)("p",{style:{color:"#d63638"},children:(0,a.__)("⚠️ No content types selected","jvb")})}),(0,d.jsx)("p",{className:"feed-block-note",children:(0,a.__)("Feed will be displayed on the frontend","jvb")})]})]})},save:function(){return null}})}},n={};function o(e){var l=n[e];if(void 0!==l)return l.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.m=t,e=[],o.O=(t,n,l,i)=>{if(!n){var r=1/0;for(d=0;d<e.length;d++){for(var[n,l,i]=e[d],s=!0,c=0;c<n.length;c++)(!1&i||r>=i)&&Object.keys(o.O).every(e=>o.O[e](n[c]))?n.splice(c--,1):(s=!1,i<r&&(r=i));if(s){e.splice(d--,1);var a=l();void 0!==a&&(t=a)}}return t}i=i||0;for(var d=e.length;d>0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[n,l,i]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={814:0,138:0};o.O.j=t=>0===e[t];var t=(t,n)=>{var l,i,[r,s,c]=n,a=0;if(r.some(t=>0!==e[t])){for(l in s)o.o(s,l)&&(o.m[l]=s[l]);if(c)var d=c(o)}for(t&&t(n);a<r.length;a++)i=r[a],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return o.O(d)},n=globalThis.webpackChunkjvb=globalThis.webpackChunkjvb||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var l=o.O(void 0,[138],()=>o(111));l=o.O(l)})(); |
| | |
| | | /*!********************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/feed/style.scss ***! |
| | | \********************************************************************************************************************************************************************************************************************************************/ |
| | | /***** START FRESH *****/ |
| | | .feed-block { |
| | | grid-column: full; |
| | | } |
| | | .feed-block .placeholder { |
| | | aspect-ratio: 1; |
| | | background: rgb(var(--base)); |
| | | border: 1rem solid rgb(var(--base-50)); |
| | | border-radius: 1rem; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | --w: 50%; |
| | | color: rgb(var(--base-200)); |
| | | } |
| | | .feed-block .placeholder i.icon { |
| | | animation: dance 2.5s ease-in-out infinite; |
| | | } |
| | | .feed-block .item-grid { |
| | | max-width: var(--full); |
| | | } |
| | | .feed-block .item-grid:has([data-timeline]) { |
| | | grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); |
| | | } |
| | | .feed-block .item { |
| | | overflow: hidden; |
| | | background: rgb(var(--base-50)); |
| | | box-shadow: rgba(var(--base), var(--op-2)) var(--shdw); |
| | | height: -moz-fit-content; |
| | | height: fit-content; |
| | | padding: 0; |
| | | } |
| | | .feed-block .item h3 { |
| | | margin: 0; |
| | | font-size: var(--txt-medium); |
| | | } |
| | | .feed-block .item details { |
| | | z-index: var(--z-2); |
| | | width: 100%; |
| | | position: relative; |
| | | padding: 0; |
| | | } |
| | | .feed-block .item details summary { |
| | | position: absolute; |
| | | top: calc(var(--chip_) * -1); |
| | | right: 0; |
| | | width: 100%; |
| | | background-color: rgba(var(--base), var(--op-2)); |
| | | backdrop-filter: blur(5px); |
| | | } |
| | | .feed-block .item details summary:hover { |
| | | background-color: rgba(var(--action-0), var(--op-45)); |
| | | } |
| | | .feed-block .item details[open] { |
| | | padding: 0.25rem 0.5rem; |
| | | } |
| | | .feed-block .item img:hover { |
| | | opacity: 0.8; |
| | | } |
| | | .feed-block .item[data-timeline] .images { |
| | | aspect-ratio: 3/2; |
| | | padding: 0 0 1rem; |
| | | } |
| | | .feed-block .item[data-timeline] .images span { |
| | | width: 50%; |
| | | position: absolute; |
| | | background-color: rgb(var(--action-0)); |
| | | color: rgb(var(--action-contrast)); |
| | | padding: 0.25rem 0.5rem; |
| | | } |
| | | .feed-block .item[data-timeline] .images span:first-of-type { |
| | | bottom: 0; |
| | | left: 50%; |
| | | text-align: left; |
| | | } |
| | | .feed-block .item[data-timeline] .images span:last-of-type { |
| | | top: 0; |
| | | right: 50%; |
| | | } |
| | | .feed-block .item[data-timeline] .images img { |
| | | width: 50%; |
| | | } |
| | | .feed-block .item[data-timeline] .images img:first-of-type { |
| | | border-left: 2px solid rgb(var(--action-0)); |
| | | } |
| | | .feed-block .item a::before, .feed-block .item a::after { |
| | | display: none; |
| | | } |
| | | .feed-block .item label { |
| | | font-weight: normal; |
| | | text-transform: none; |
| | | --w: 1.5em; |
| | | } |
| | | .feed-block .all-filters summary { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | .all-filters { |
| | | font-size: var(--txt-x-small); |
| | | } |
| | | .all-filters[open] { |
| | | border: 2px solid rgb(var(--action-0)); |
| | | padding: 0; |
| | | border-radius: 0 0 var(--radius-outer) var(--radius-outer); |
| | | } |
| | | .all-filters summary { |
| | | width: 100%; |
| | | } |
| | | .all-filters[open] summary, |
| | | .all-filters summary:hover { |
| | | background-color: rgb(var(--action-0)); |
| | | color: rgb(var(--action-contrast)); |
| | | } |
| | | .all-filters[open] summary::after, |
| | | .all-filters summary:hover::after { |
| | | background-color: rgb(var(--action-contrast)); |
| | | } |
| | | .all-filters > .row.row { |
| | | padding: 0 0.75rem 2rem; |
| | | width: var(--content); |
| | | } |
| | | .all-filters > .row.row.search { |
| | | padding-bottom: 0; |
| | | } |
| | | .all-filters > .row.row { |
| | | position: relative; |
| | | } |
| | | .all-filters > .row.row > .label, |
| | | .all-filters > .row.row > .row > .label { |
| | | font-family: var(--heading); |
| | | font-weight: var(--fw-h-bold); |
| | | text-transform: uppercase; |
| | | } |
| | | .all-filters > .row.row > .label { |
| | | width: 20%; |
| | | } |
| | | .all-filters > .row.row > .row > .label { |
| | | white-space: nowrap; |
| | | } |
| | | .all-filters button, |
| | | .all-filters .btn + label { |
| | | width: var(--chipchip); |
| | | min-height: var(--chipchip); |
| | | padding: 0; |
| | | } |
| | | .all-filters button .label, |
| | | .all-filters .row:has(> .btn:not(:checked) + label:hover) :checked + label .label, |
| | | .all-filters .btn + label .label { |
| | | position: absolute; |
| | | bottom: -2rem; |
| | | width: -moz-max-content; |
| | | width: max-content; |
| | | white-space: nowrap; |
| | | opacity: 0; |
| | | z-index: var(--z-4); |
| | | } |
| | | .all-filters button:hover .label, |
| | | .all-filters .btn:checked + label .label, |
| | | .all-filters .btn + label:hover .label { |
| | | opacity: 1; |
| | | } |
| | | .all-filters .search.row, |
| | | .all-filters .view.row { |
| | | display: none; |
| | | } |
| | | .all-filters .ordering { |
| | | padding: 2rem 0 0.75rem 0; |
| | | } |
| | | .all-filters .ordering > .row label { |
| | | position: unset; |
| | | } |
| | | .all-filters .ordering .row .label { |
| | | top: -1rem; |
| | | color: rgb(var(--contrast)); |
| | | } |
| | | .all-filters .ordering .row.orderby .label { |
| | | right: 0; |
| | | } |
| | | .all-filters .ordering .row.order-direction .label { |
| | | left: 0; |
| | | } |
| | | .search-container:not(.open) input[type=search], |
| | | .search-container:not(.open) .clear-search { |
| | | transform: scaleX(0); |
| | | transform-origin: right; |
| | | width: 0; |
| | | padding: 0; |
| | | transition: transform var(--trans-base), width var(--trans-base), padding var(--trans-base); |
| | | } |
| | | .search-container button { |
| | | padding: 0.5rem; |
| | | } |
| | | .search-container .icon { |
| | | --w: 1.5rem; |
| | | } |
| | | .search-container.open input[type=search], |
| | | .search-container.open .clear-search { |
| | | transform: scaleX(1); |
| | | transform-origin: right; |
| | | transition: transform var(--trans-base), width var(--trans-base), padding var(--trans-base); |
| | | } |
| | | .all-filters > .search, |
| | | input[type=search], |
| | | .search-container { |
| | | width: 100%; |
| | | } |
| | | .toggle-text input + label { |
| | | font-weight: normal; |
| | | color: var(--contrast) !important; |
| | | text-transform: none; |
| | | cursor: pointer; |
| | | position: relative; |
| | | padding: 0.25rem 0.5rem; |
| | | -webkit-user-select: none; |
| | | -moz-user-select: none; |
| | | user-select: none; |
| | | border: 1px dashed transparent; |
| | | } |
| | | .toggle-text input + label::before, .toggle-text input + label::after { |
| | | display: none !important; |
| | | } |
| | | .toggle-text input + label .text { |
| | | position: relative; |
| | | margin: 0; |
| | | --gap: 0; |
| | | font-weight: bold; |
| | | width: -moz-fit-content; |
| | | width: fit-content; |
| | | padding: 2px 4px; |
| | | border: 1px solid rgb(var(--action-50)); |
| | | border-radius: var(--radius); |
| | | color: rgb(var(--action-50)); |
| | | } |
| | | .toggle-text input + label .off { |
| | | --mid: -100%; |
| | | } |
| | | .toggle-text input + label .on { |
| | | --mid: 100%; |
| | | } |
| | | .toggle-text input + label .off, |
| | | .toggle-text input + label .on { |
| | | transition: var(--trans-transform), opacity var(--trans-base); |
| | | } |
| | | .toggle-text input + label .off, .toggle-text input:checked + label .on { |
| | | opacity: 1; |
| | | max-width: 100%; |
| | | transform: translate3d(0, 0, 0); |
| | | } |
| | | .toggle-text input + label .on, .toggle-text input:checked + label .off { |
| | | opacity: 0; |
| | | max-width: 0; |
| | | transform: translate3d(0, var(--mid), 0); |
| | | } |
| | | .toggle-text:hover label { |
| | | border-color: rgb(var(--action-200)); |
| | | } |
| | | .toggle-text:hover .text { |
| | | background-color: rgb(var(--action-50)); |
| | | color: rgb(var(--action-contrast)); |
| | | border-color: rgb(var(--action-50)); |
| | | } |
| | | .feed-block{grid-column:full}.feed-block .placeholder{align-items:center;aspect-ratio:1;background:rgb(var(--base));border:1rem solid rgb(var(--base-50));border-radius:1rem;display:flex;justify-content:center;--w:50%;color:rgb(var(--base-200))}.feed-block .placeholder i.icon{animation:dance 2.5s ease-in-out infinite}.feed-block .item-grid{max-width:var(--full)}.feed-block .item-grid:has([data-timeline]){grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}.feed-block .item{background:rgb(var(--base-50));box-shadow:rgba(var(--base),var(--op-2)) var(--shdw);height:-moz-fit-content;height:fit-content;overflow:hidden;padding:0}.feed-block .item h3{font-size:var(--txt-medium);margin:0}.feed-block .item details{padding:0;position:relative;width:100%;z-index:var(--z-2)}.feed-block .item details summary{backdrop-filter:blur(5px);background-color:rgba(var(--base),var(--op-2));right:0;position:absolute;top:calc(var(--chip_)*-1);width:100%}.feed-block .item details summary:hover{background-color:rgba(var(--action-0),var(--op-45))}.feed-block .item details[open]{padding:.25rem .5rem}.feed-block .item img:hover{opacity:.8}.feed-block .item[data-timeline] .images{aspect-ratio:3/2;padding:0 0 1rem}.feed-block .item[data-timeline] .images span{background-color:rgb(var(--action-0));color:rgb(var(--action-contrast));padding:.25rem .5rem;position:absolute;width:50%}.feed-block .item[data-timeline] .images span:first-of-type{bottom:0;left:50%;text-align:left}.feed-block .item[data-timeline] .images span:last-of-type{right:50%;top:0}.feed-block .item[data-timeline] .images img{width:50%}.feed-block .item[data-timeline] .images img:first-of-type{border-left:2px solid rgb(var(--action-0))}.feed-block .item a:after,.feed-block .item a:before{display:none}.feed-block .item label{font-weight:400;text-transform:none;--w:1.5em}.feed-block .all-filters summary{display:flex;justify-content:space-between}.all-filters{font-size:var(--txt-x-small)}.all-filters[open]{border:2px solid rgb(var(--action-0));border-radius:0 0 var(--radius-outer) var(--radius-outer);padding:0}.all-filters summary{width:100%}.all-filters summary:hover,.all-filters[open] summary{background-color:rgb(var(--action-0));color:rgb(var(--action-contrast))}.all-filters summary:hover:after,.all-filters[open] summary:after{background-color:rgb(var(--action-contrast))}.all-filters>.row.row{padding:0 .75rem 2rem;width:var(--content)}.all-filters>.row.row.search{padding-bottom:0}.all-filters>.row.row{position:relative}.all-filters>.row.row>.label,.all-filters>.row.row>.row>.label{font-family:var(--heading);font-weight:var(--fw-h-bold);text-transform:uppercase}.all-filters>.row.row>.label{width:20%}.all-filters>.row.row>.row>.label{white-space:nowrap}.all-filters .btn+label,.all-filters button{min-height:var(--chipchip);padding:0;width:var(--chipchip)}.all-filters .btn+label .label,.all-filters .row:has(>.btn:not(:checked)+label:hover) :checked+label .label,.all-filters button .label{bottom:-2rem;opacity:0;position:absolute;white-space:nowrap;width:-moz-max-content;width:max-content;z-index:var(--z-4)}.all-filters .btn+label:hover .label,.all-filters .btn:checked+label .label,.all-filters button:hover .label{opacity:1}.all-filters .search.row,.all-filters .view.row{display:none}.all-filters .ordering{padding:2rem 0 .75rem}.all-filters .ordering>.row label{position:unset}.all-filters .ordering .row .label{color:rgb(var(--contrast));top:-1rem}.all-filters .ordering .row.orderby .label{right:0}.all-filters .ordering .row.order-direction .label{left:0}.search-container:not(.open) .clear-search,.search-container:not(.open) input[type=search]{padding:0;transform:scaleX(0);transform-origin:right;transition:transform var(--trans-base),width var(--trans-base),padding var(--trans-base);width:0}.search-container button{padding:.5rem}.search-container .icon{--w:1.5rem}.search-container.open .clear-search,.search-container.open input[type=search]{transform:scaleX(1);transform-origin:right;transition:transform var(--trans-base),width var(--trans-base),padding var(--trans-base)}.all-filters>.search,.search-container,input[type=search]{width:100%}.toggle-text input+label{border:1px dashed transparent;color:var(--contrast)!important;cursor:pointer;font-weight:400;padding:.25rem .5rem;position:relative;text-transform:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.toggle-text input+label:after,.toggle-text input+label:before{display:none!important}.toggle-text input+label .text{margin:0;position:relative;--gap:0;border:1px solid rgb(var(--action-50));border-radius:var(--radius);color:rgb(var(--action-50));font-weight:700;padding:2px 4px;width:-moz-fit-content;width:fit-content}.toggle-text input+label .off{--mid:-100%}.toggle-text input+label .on{--mid:100%}.toggle-text input+label .off,.toggle-text input+label .on{transition:var(--trans-transform),opacity var(--trans-base)}.toggle-text input+label .off,.toggle-text input:checked+label .on{max-width:100%;opacity:1;transform:translateZ(0)}.toggle-text input+label .on,.toggle-text input:checked+label .off{max-width:0;opacity:0;transform:translate3d(0,var(--mid),0)}.toggle-text:hover label{border-color:rgb(var(--action-200))}.toggle-text:hover .text{background-color:rgb(var(--action-50));border-color:rgb(var(--action-50));color:rgb(var(--action-contrast))} |
| | |
| | | /*!********************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/feed/style.scss ***! |
| | | \********************************************************************************************************************************************************************************************************************************************/ |
| | | /***** START FRESH *****/ |
| | | .feed-block { |
| | | grid-column: full; |
| | | } |
| | | .feed-block .placeholder { |
| | | aspect-ratio: 1; |
| | | background: rgb(var(--base)); |
| | | border: 1rem solid rgb(var(--base-50)); |
| | | border-radius: 1rem; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | --w: 50%; |
| | | color: rgb(var(--base-200)); |
| | | } |
| | | .feed-block .placeholder i.icon { |
| | | animation: dance 2.5s ease-in-out infinite; |
| | | } |
| | | .feed-block .item-grid { |
| | | max-width: var(--full); |
| | | } |
| | | .feed-block .item-grid:has([data-timeline]) { |
| | | grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); |
| | | } |
| | | .feed-block .item { |
| | | overflow: hidden; |
| | | background: rgb(var(--base-50)); |
| | | box-shadow: rgba(var(--base), var(--op-2)) var(--shdw); |
| | | height: -moz-fit-content; |
| | | height: fit-content; |
| | | padding: 0; |
| | | } |
| | | .feed-block .item h3 { |
| | | margin: 0; |
| | | font-size: var(--txt-medium); |
| | | } |
| | | .feed-block .item details { |
| | | z-index: var(--z-2); |
| | | width: 100%; |
| | | position: relative; |
| | | padding: 0; |
| | | } |
| | | .feed-block .item details summary { |
| | | position: absolute; |
| | | top: calc(var(--chip_) * -1); |
| | | left: 0; |
| | | width: 100%; |
| | | background-color: rgba(var(--base), var(--op-2)); |
| | | backdrop-filter: blur(5px); |
| | | } |
| | | .feed-block .item details summary:hover { |
| | | background-color: rgba(var(--action-0), var(--op-45)); |
| | | } |
| | | .feed-block .item details[open] { |
| | | padding: 0.25rem 0.5rem; |
| | | } |
| | | .feed-block .item img:hover { |
| | | opacity: 0.8; |
| | | } |
| | | .feed-block .item[data-timeline] .images { |
| | | aspect-ratio: 3/2; |
| | | padding: 0 0 1rem; |
| | | } |
| | | .feed-block .item[data-timeline] .images span { |
| | | width: 50%; |
| | | position: absolute; |
| | | background-color: rgb(var(--action-0)); |
| | | color: rgb(var(--action-contrast)); |
| | | padding: 0.25rem 0.5rem; |
| | | } |
| | | .feed-block .item[data-timeline] .images span:first-of-type { |
| | | bottom: 0; |
| | | right: 50%; |
| | | text-align: right; |
| | | } |
| | | .feed-block .item[data-timeline] .images span:last-of-type { |
| | | top: 0; |
| | | left: 50%; |
| | | } |
| | | .feed-block .item[data-timeline] .images img { |
| | | width: 50%; |
| | | } |
| | | .feed-block .item[data-timeline] .images img:first-of-type { |
| | | border-right: 2px solid rgb(var(--action-0)); |
| | | } |
| | | .feed-block .item a::before, .feed-block .item a::after { |
| | | display: none; |
| | | } |
| | | .feed-block .item label { |
| | | font-weight: normal; |
| | | text-transform: none; |
| | | --w: 1.5em; |
| | | } |
| | | .feed-block .all-filters summary { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | .all-filters { |
| | | font-size: var(--txt-x-small); |
| | | } |
| | | .all-filters[open] { |
| | | border: 2px solid rgb(var(--action-0)); |
| | | padding: 0; |
| | | border-radius: 0 0 var(--radius-outer) var(--radius-outer); |
| | | } |
| | | .all-filters summary { |
| | | width: 100%; |
| | | } |
| | | .all-filters[open] summary, |
| | | .all-filters summary:hover { |
| | | background-color: rgb(var(--action-0)); |
| | | color: rgb(var(--action-contrast)); |
| | | } |
| | | .all-filters[open] summary::after, |
| | | .all-filters summary:hover::after { |
| | | background-color: rgb(var(--action-contrast)); |
| | | } |
| | | .all-filters > .row.row { |
| | | padding: 0 0.75rem 2rem; |
| | | width: var(--content); |
| | | } |
| | | .all-filters > .row.row.search { |
| | | padding-bottom: 0; |
| | | } |
| | | .all-filters > .row.row { |
| | | position: relative; |
| | | } |
| | | .all-filters > .row.row > .label, |
| | | .all-filters > .row.row > .row > .label { |
| | | font-family: var(--heading); |
| | | font-weight: var(--fw-h-bold); |
| | | text-transform: uppercase; |
| | | } |
| | | .all-filters > .row.row > .label { |
| | | width: 20%; |
| | | } |
| | | .all-filters > .row.row > .row > .label { |
| | | white-space: nowrap; |
| | | } |
| | | .all-filters button, |
| | | .all-filters .btn + label { |
| | | width: var(--chipchip); |
| | | min-height: var(--chipchip); |
| | | padding: 0; |
| | | } |
| | | .all-filters button .label, |
| | | .all-filters .row:has(> .btn:not(:checked) + label:hover) :checked + label .label, |
| | | .all-filters .btn + label .label { |
| | | position: absolute; |
| | | bottom: -2rem; |
| | | width: -moz-max-content; |
| | | width: max-content; |
| | | white-space: nowrap; |
| | | opacity: 0; |
| | | z-index: var(--z-4); |
| | | } |
| | | .all-filters button:hover .label, |
| | | .all-filters .btn:checked + label .label, |
| | | .all-filters .btn + label:hover .label { |
| | | opacity: 1; |
| | | } |
| | | .all-filters .search.row, |
| | | .all-filters .view.row { |
| | | display: none; |
| | | } |
| | | .all-filters .ordering { |
| | | padding: 2rem 0 0.75rem 0; |
| | | } |
| | | .all-filters .ordering > .row label { |
| | | position: unset; |
| | | } |
| | | .all-filters .ordering .row .label { |
| | | top: -1rem; |
| | | color: rgb(var(--contrast)); |
| | | } |
| | | .all-filters .ordering .row.orderby .label { |
| | | left: 0; |
| | | } |
| | | .all-filters .ordering .row.order-direction .label { |
| | | right: 0; |
| | | } |
| | | .search-container:not(.open) input[type=search], |
| | | .search-container:not(.open) .clear-search { |
| | | transform: scaleX(0); |
| | | transform-origin: left; |
| | | width: 0; |
| | | padding: 0; |
| | | transition: transform var(--trans-base), width var(--trans-base), padding var(--trans-base); |
| | | } |
| | | .search-container button { |
| | | padding: 0.5rem; |
| | | } |
| | | .search-container .icon { |
| | | --w: 1.5rem; |
| | | } |
| | | .search-container.open input[type=search], |
| | | .search-container.open .clear-search { |
| | | transform: scaleX(1); |
| | | transform-origin: left; |
| | | transition: transform var(--trans-base), width var(--trans-base), padding var(--trans-base); |
| | | } |
| | | .all-filters > .search, |
| | | input[type=search], |
| | | .search-container { |
| | | width: 100%; |
| | | } |
| | | .toggle-text input + label { |
| | | font-weight: normal; |
| | | color: var(--contrast) !important; |
| | | text-transform: none; |
| | | cursor: pointer; |
| | | position: relative; |
| | | padding: 0.25rem 0.5rem; |
| | | -webkit-user-select: none; |
| | | -moz-user-select: none; |
| | | user-select: none; |
| | | border: 1px dashed transparent; |
| | | } |
| | | .toggle-text input + label::before, .toggle-text input + label::after { |
| | | display: none !important; |
| | | } |
| | | .toggle-text input + label .text { |
| | | position: relative; |
| | | margin: 0; |
| | | --gap: 0; |
| | | font-weight: bold; |
| | | width: -moz-fit-content; |
| | | width: fit-content; |
| | | padding: 2px 4px; |
| | | border: 1px solid rgb(var(--action-50)); |
| | | border-radius: var(--radius); |
| | | color: rgb(var(--action-50)); |
| | | } |
| | | .toggle-text input + label .off { |
| | | --mid: -100%; |
| | | } |
| | | .toggle-text input + label .on { |
| | | --mid: 100%; |
| | | } |
| | | .toggle-text input + label .off, |
| | | .toggle-text input + label .on { |
| | | transition: var(--trans-transform), opacity var(--trans-base); |
| | | } |
| | | .toggle-text input + label .off, .toggle-text input:checked + label .on { |
| | | opacity: 1; |
| | | max-width: 100%; |
| | | transform: translate3d(0, 0, 0); |
| | | } |
| | | .toggle-text input + label .on, .toggle-text input:checked + label .off { |
| | | opacity: 0; |
| | | max-width: 0; |
| | | transform: translate3d(0, var(--mid), 0); |
| | | } |
| | | .toggle-text:hover label { |
| | | border-color: rgb(var(--action-200)); |
| | | } |
| | | .toggle-text:hover .text { |
| | | background-color: rgb(var(--action-50)); |
| | | color: rgb(var(--action-contrast)); |
| | | border-color: rgb(var(--action-50)); |
| | | } |
| | | |
| | | /*# sourceMappingURL=style-index.css.map*/ |
| | | .feed-block{grid-column:full}.feed-block .placeholder{align-items:center;aspect-ratio:1;background:rgb(var(--base));border:1rem solid rgb(var(--base-50));border-radius:1rem;display:flex;justify-content:center;--w:50%;color:rgb(var(--base-200))}.feed-block .placeholder i.icon{animation:dance 2.5s ease-in-out infinite}.feed-block .item-grid{max-width:var(--full)}.feed-block .item-grid:has([data-timeline]){grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}.feed-block .item{background:rgb(var(--base-50));box-shadow:rgba(var(--base),var(--op-2)) var(--shdw);height:-moz-fit-content;height:fit-content;overflow:hidden;padding:0}.feed-block .item h3{font-size:var(--txt-medium);margin:0}.feed-block .item details{padding:0;position:relative;width:100%;z-index:var(--z-2)}.feed-block .item details summary{backdrop-filter:blur(5px);background-color:rgba(var(--base),var(--op-2));left:0;position:absolute;top:calc(var(--chip_)*-1);width:100%}.feed-block .item details summary:hover{background-color:rgba(var(--action-0),var(--op-45))}.feed-block .item details[open]{padding:.25rem .5rem}.feed-block .item img:hover{opacity:.8}.feed-block .item[data-timeline] .images{aspect-ratio:3/2;padding:0 0 1rem}.feed-block .item[data-timeline] .images span{background-color:rgb(var(--action-0));color:rgb(var(--action-contrast));padding:.25rem .5rem;position:absolute;width:50%}.feed-block .item[data-timeline] .images span:first-of-type{bottom:0;right:50%;text-align:right}.feed-block .item[data-timeline] .images span:last-of-type{left:50%;top:0}.feed-block .item[data-timeline] .images img{width:50%}.feed-block .item[data-timeline] .images img:first-of-type{border-right:2px solid rgb(var(--action-0))}.feed-block .item a:after,.feed-block .item a:before{display:none}.feed-block .item label{font-weight:400;text-transform:none;--w:1.5em}.feed-block .all-filters summary{display:flex;justify-content:space-between}.all-filters{font-size:var(--txt-x-small)}.all-filters[open]{border:2px solid rgb(var(--action-0));border-radius:0 0 var(--radius-outer) var(--radius-outer);padding:0}.all-filters summary{width:100%}.all-filters summary:hover,.all-filters[open] summary{background-color:rgb(var(--action-0));color:rgb(var(--action-contrast))}.all-filters summary:hover:after,.all-filters[open] summary:after{background-color:rgb(var(--action-contrast))}.all-filters>.row.row{padding:0 .75rem 2rem;width:var(--content)}.all-filters>.row.row.search{padding-bottom:0}.all-filters>.row.row{position:relative}.all-filters>.row.row>.label,.all-filters>.row.row>.row>.label{font-family:var(--heading);font-weight:var(--fw-h-bold);text-transform:uppercase}.all-filters>.row.row>.label{width:20%}.all-filters>.row.row>.row>.label{white-space:nowrap}.all-filters .btn+label,.all-filters button{min-height:var(--chipchip);padding:0;width:var(--chipchip)}.all-filters .btn+label .label,.all-filters .row:has(>.btn:not(:checked)+label:hover) :checked+label .label,.all-filters button .label{bottom:-2rem;opacity:0;position:absolute;white-space:nowrap;width:-moz-max-content;width:max-content;z-index:var(--z-4)}.all-filters .btn+label:hover .label,.all-filters .btn:checked+label .label,.all-filters button:hover .label{opacity:1}.all-filters .search.row,.all-filters .view.row{display:none}.all-filters .ordering{padding:2rem 0 .75rem}.all-filters .ordering>.row label{position:unset}.all-filters .ordering .row .label{color:rgb(var(--contrast));top:-1rem}.all-filters .ordering .row.orderby .label{left:0}.all-filters .ordering .row.order-direction .label{right:0}.search-container:not(.open) .clear-search,.search-container:not(.open) input[type=search]{padding:0;transform:scaleX(0);transform-origin:left;transition:transform var(--trans-base),width var(--trans-base),padding var(--trans-base);width:0}.search-container button{padding:.5rem}.search-container .icon{--w:1.5rem}.search-container.open .clear-search,.search-container.open input[type=search]{transform:scaleX(1);transform-origin:left;transition:transform var(--trans-base),width var(--trans-base),padding var(--trans-base)}.all-filters>.search,.search-container,input[type=search]{width:100%}.toggle-text input+label{border:1px dashed transparent;color:var(--contrast)!important;cursor:pointer;font-weight:400;padding:.25rem .5rem;position:relative;text-transform:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.toggle-text input+label:after,.toggle-text input+label:before{display:none!important}.toggle-text input+label .text{margin:0;position:relative;--gap:0;border:1px solid rgb(var(--action-50));border-radius:var(--radius);color:rgb(var(--action-50));font-weight:700;padding:2px 4px;width:-moz-fit-content;width:fit-content}.toggle-text input+label .off{--mid:-100%}.toggle-text input+label .on{--mid:100%}.toggle-text input+label .off,.toggle-text input+label .on{transition:var(--trans-transform),opacity var(--trans-base)}.toggle-text input+label .off,.toggle-text input:checked+label .on{max-width:100%;opacity:1;transform:translateZ(0)}.toggle-text input+label .on,.toggle-text input:checked+label .off{max-width:0;opacity:0;transform:translate3d(0,var(--mid),0)}.toggle-text:hover label{border-color:rgb(var(--action-200))}.toggle-text:hover .text{background-color:rgb(var(--action-50));border-color:rgb(var(--action-50));color:rgb(var(--action-contrast))} |
| | |
| | | <?php return array('dependencies' => array(), 'version' => '66a07f12c0b535077080'); |
| | | <?php return array('dependencies' => array(), 'version' => '7bbcf703e79934b80731'); |
| | |
| | | /******/ (() => { // webpackBootstrap |
| | | /*!**************************!*\ |
| | | !*** ./src/feed/view.js ***! |
| | | \**************************/ |
| | | class FeedBlock { |
| | | constructor() { |
| | | this.container = document.querySelector('section.feed-block'); |
| | | if (!this.container) return; |
| | | this.a11y = window.jvbA11y; |
| | | this.error = window.jvbError; |
| | | this.cache = new window.jvbCache('feed'); |
| | | this.templates = window.jvbTemplates; |
| | | this.config = { |
| | | contextId: '', |
| | | context: '', |
| | | highlight: null, |
| | | gallery: false, |
| | | view: this.cache.get('feedView') || 'grid', |
| | | ...this.container.dataset |
| | | }; |
| | | console.log(this.config); |
| | | this.init(); |
| | | } |
| | | init() { |
| | | this.initElements(); |
| | | this.defineTemplates(); |
| | | this.initListeners(); |
| | | this.initFilters(); |
| | | if ('requestIdleCallback' in window) { |
| | | requestIdleCallback(() => { |
| | | this.initStore(); |
| | | this.initTaxonomies(); |
| | | this.processCachedFilters(); |
| | | this.processURLFilters(); |
| | | this.updateFilterUI(); |
| | | this.initGallery(); |
| | | }, { |
| | | timeout: 2000 |
| | | }); |
| | | } else { |
| | | setTimeout(() => { |
| | | this.initStore(); |
| | | this.initTaxonomies(); |
| | | this.processCachedFilters(); |
| | | this.processURLFilters(); |
| | | this.updateFilterUI(); |
| | | this.initGallery(); |
| | | }, 100); |
| | | } |
| | | } |
| | | initElements() { |
| | | this.selectors = { |
| | | filterTrigger: '[data-filter]', |
| | | filters: { |
| | | actions: '.filter-actions .toggle-text', |
| | | container: '.all-filters', |
| | | showing: '.all-filters summary .current', |
| | | content: '[data-filter="content"]', |
| | | ordering: '.ordering', |
| | | orderby: '[data-filter="orderby"]', |
| | | order: '[data-filter="order"]', |
| | | orderWrap: '.order-direction', |
| | | match: '[data-filter="match"]', |
| | | favourites: '[data-filter="favourites"]', |
| | | taxonomy: '[data-filter^="taxonomy"]' |
| | | }, |
| | | grid: '.item-grid', |
| | | selected: '.selected-items', |
| | | buttons: { |
| | | loadMore: 'button.load-more', |
| | | remove: '.remove-term', |
| | | clearFilters: 'button.clear-filters', |
| | | refresh: 'button[data-action="refresh"]' |
| | | } |
| | | }; |
| | | this.ui = window.uiFromSelectors(this.selectors, this.container); |
| | | this.ui.buttons.refresh = document.querySelector(this.selectors.buttons.refresh); |
| | | |
| | | //Add content and taxonomies |
| | | let getAll = ['content', 'orderby', 'order', 'taxonomy']; |
| | | getAll.forEach(item => { |
| | | let items = this.ui.filters.container.querySelectorAll(this.selectors.filters[item]); |
| | | this.ui[item] = Array.from(items); |
| | | }); |
| | | this.contentTypes = this.ui.content.length > 0 ? this.ui.content.map(c => c.value) : [this.container.dataset.content]; |
| | | this.taxonomies = this.ui.taxonomies?.length > 0 ? Array.from(this.ui.taxonomies).map(t => t.dataset.taxonomy) : []; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param {string} item |
| | | */ |
| | | getChecked(item) { |
| | | if (!['content', 'orderby', 'order'].includes(item)) { |
| | | console.log('Invalid item to check: ', item); |
| | | } |
| | | let items = this.ui[item]; |
| | | if (!items) { |
| | | return; |
| | | } |
| | | let checked = items.filter(i => i.checked); |
| | | if (item === 'content' && checked.length > 0) { |
| | | this.updateContentFor(checked[0].value); |
| | | } |
| | | return checked.length === 0 ? items[0].value : checked[0].value; |
| | | } |
| | | initListeners() { |
| | | this.popStateHandler = this.handlePopState.bind(this); |
| | | this.clickHandler = this.handleClick.bind(this); |
| | | this.changeHandler = this.handleChange.bind(this); |
| | | window.addEventListener('popstate', this.popStateHandler); |
| | | document.addEventListener('click', this.clickHandler); |
| | | document.addEventListener('change', this.changeHandler); |
| | | } |
| | | initFilters() { |
| | | this.allowedFilters = ['content', 'order', 'orderby', 'favourites', 'match']; |
| | | let defaults = { |
| | | content: this.getChecked('content'), |
| | | orderby: this.getChecked('orderby'), |
| | | order: this.getChecked('order'), |
| | | page: 1 |
| | | }; |
| | | if (this.config.context) defaults.context = this.config.context; |
| | | if (this.config.contextId) defaults.contextId = this.config.contextId; |
| | | this.filters = defaults; |
| | | console.log(this.filters); |
| | | this.defaults = { |
| | | ...defaults |
| | | }; |
| | | } |
| | | updateFilterUI() { |
| | | if (this.ui.filters.container) { |
| | | //Get cached inputs |
| | | let groups = [this.ui.content, this.ui.orderby, this.ui.order]; |
| | | groups.forEach(group => { |
| | | if (group) { |
| | | for (let input of group) { |
| | | let [filter, value] = [input.dataset.filter, input.value]; |
| | | if (!Object.hasOwn(this.store.filters, filter)) break; |
| | | let doit = this.store.filters[filter] === value; |
| | | if (doit) { |
| | | input.checked = doit; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | if (Object.hasOwn(this.store.filters, 'taxonomy')) { |
| | | for (let [taxonomy, terms] of Object.entries(this.store.filters.taxonomy)) { |
| | | terms.forEach(termId => { |
| | | termId = parseInt(termId); |
| | | const term = this.selector.store.get(termId); |
| | | if (term) { |
| | | this.createTermElement(termId); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | handlePopState(e) { |
| | | if (e.state?.filters) { |
| | | if (this.processURLFilters()) { |
| | | this.store.setFilters(this.filters); |
| | | this.a11y.announce('Feed filters updated from browser history'); |
| | | } |
| | | } |
| | | } |
| | | handleClick(e) { |
| | | if (window.targetCheck(e, this.selectors.buttons.loadMore)) { |
| | | this.nextPage(); |
| | | } else if (window.targetCheck(e, this.selectors.buttons.clearFilters)) { |
| | | this.clearFilters(); |
| | | } |
| | | let remove = window.targetCheck(e, this.selectors.buttons.remove); |
| | | if (remove) { |
| | | this.removeSelectedTerm(remove); |
| | | } |
| | | let refresh = window.targetCheck(e, this.selectors.buttons.refresh); |
| | | if (refresh) { |
| | | this.store.clearCache(); |
| | | this.store.fetch(); |
| | | } |
| | | let orderbyButton = window.targetCheck(e, '[data-filter="orderby"]'); |
| | | if (orderbyButton && orderbyButton.value === 'random' && orderbyButton.checked) { |
| | | // Already selected random, just re-render to trigger new shuffle |
| | | this.renderItems(); |
| | | } |
| | | } |
| | | nextPage() { |
| | | const nextPage = (this.store.filters.page || 1) + 1; |
| | | const maxPage = this.store.lastResponse?.pages || nextPage; |
| | | this.store.setFilters({ |
| | | page: Math.min(nextPage, maxPage) |
| | | }); |
| | | } |
| | | handleChange(e) { |
| | | const target = e.target; |
| | | if (Object.hasOwn(target.dataset, 'filter')) { |
| | | if (this.allowedFilters.includes(target.dataset.filter)) { |
| | | let filters = {}; |
| | | filters[target.dataset.filter] = target.value; |
| | | this.resetFilters(filters); |
| | | } |
| | | switch (target.dataset.filter) { |
| | | case 'content': |
| | | this.updateContentFor(target.value); |
| | | break; |
| | | case 'orderby': |
| | | this.updateOrderOptions(target.value); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | clearFilters() { |
| | | this.taxFilters = {}; |
| | | window.removeChildren(this.ui.selected); |
| | | this.taxonomies.forEach(tax => { |
| | | let fieldId = this.getFieldId(tax); |
| | | this.selector.selectedTerms.get(fieldId)?.clear(); |
| | | }); |
| | | this.store.setFilters({ |
| | | ...this.defaults, |
| | | taxonomy: null |
| | | }); |
| | | this.updateURL(); |
| | | this.saveToCacheFilters(); |
| | | } |
| | | resetFilters(filters) { |
| | | filters = { |
| | | ...this.store.filters, |
| | | page: 1, |
| | | ...filters |
| | | }; |
| | | this.store.setFilters(filters); |
| | | this.updateURL(); |
| | | this.saveToCacheFilters(); |
| | | } |
| | | getFieldId(taxonomy) { |
| | | return this.selector.getFieldId(this.ui.taxonomies.filter(tax => tax.dataset.taxonomy === taxonomy)[0] ?? null); |
| | | } |
| | | removeSelectedTerm(button) { |
| | | const termId = parseInt(button.dataset.id); |
| | | const taxonomy = button.dataset.taxonomy; |
| | | if (Object.hasOwn(this.taxFilters, taxonomy)) { |
| | | this.taxFilters[taxonomy] = this.taxFilters[taxonomy].filter(id => id !== termId); |
| | | if (this.taxFilters[taxonomy].length === 0) { |
| | | delete this.taxFilters[taxonomy]; |
| | | } |
| | | } |
| | | button.remove(); |
| | | |
| | | // Find the fieldId for this taxonomy |
| | | const field = this.getFieldId(taxonomy); |
| | | if (field) { |
| | | this.selector.activeField = field; |
| | | // Notify selector to remove from its selectedTerms |
| | | this.selector.removeSelected(termId, field); |
| | | } |
| | | this.resetFilters({ |
| | | taxonomy: Object.keys(this.taxFilters).length > 0 ? this.taxFilters : null |
| | | }); |
| | | } |
| | | updateContentFor(content) { |
| | | let checkIt = [this.ui.taxonomies, this.ui.orderby]; |
| | | this.ui.filters.showing.textContent = this.ui.content.filter(c => c.value === content)[0].dataset.label; |
| | | checkIt.forEach(check => { |
| | | if (!check) return; |
| | | check.forEach(button => { |
| | | const forTypes = button.dataset.for?.split(',') ?? []; |
| | | button.hidden = forTypes.length > 0 && !forTypes.includes(content); |
| | | if (button.hidden && button.checked) { |
| | | button.checked = false; |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | updateOrderOptions(order) { |
| | | if (this.ui.filters.orderWrap) { |
| | | let options = this.ui.filters.orderWrap.dataset.forOrder.split(',') ?? []; |
| | | this.ui.filters.orderWrap.hidden = !options.includes(order); |
| | | } |
| | | } |
| | | updateFilterControls() { |
| | | const keys = Object.keys(this.taxFilters); |
| | | if (this.ui.buttons.clearFilters) { |
| | | this.ui.buttons.clearFilters.hidden = keys.length === 0; |
| | | } |
| | | if (this.ui.filters.actions) { |
| | | this.ui.filters.actions.hidden = keys.length <= 1; |
| | | } |
| | | } |
| | | async initTaxonomies() { |
| | | this.taxFilters = {}; |
| | | this.selector = window.jvbSelector; |
| | | // this.selector.scanExistingFields(this.ui.filters.container); |
| | | // this.taxonomies.map(tax => this.selector.batchFetch.add(tax)); |
| | | // this.selector.batchFetchTaxonomies(); |
| | | this.selector.subscribe((event, data) => { |
| | | switch (event) { |
| | | case 'selected-terms': |
| | | this.handleTaxonomyChange(data); |
| | | break; |
| | | } |
| | | }); |
| | | } |
| | | handleTaxonomyChange(data) { |
| | | const { |
| | | terms, |
| | | taxonomy |
| | | } = data; |
| | | if (terms.size === 0) return; |
| | | this.taxFilters[taxonomy] = Array.from(terms); |
| | | this.resetFilters({ |
| | | taxonomy: this.taxFilters |
| | | }); |
| | | terms.forEach(t => { |
| | | this.createTermElement(t); |
| | | }); |
| | | this.updateFilterControls(); |
| | | } |
| | | getTaxonomyIcon(taxonomy) { |
| | | let iconButton = this.ui.taxonomies.find(t => t.dataset.taxonomy === taxonomy); |
| | | return iconButton?.dataset.icon.trim() || 'tag'; |
| | | } |
| | | createTermElement(termId) { |
| | | const term = this.selector.store.get(termId); |
| | | if (!term) return; |
| | | if (this.ui.selected.querySelector(`[data-id="${termId}"]`)) return; |
| | | term.icon = this.getTaxonomyIcon(term.taxonomy); |
| | | this.ui.selected.append(this.templates.create('feedTerm', term)); |
| | | } |
| | | processCachedFilters() { |
| | | Object.keys(this.filters).forEach(filter => { |
| | | let cached = this.cache.get(`${this.config.contextId}_${this.config.context}_${filter}`); |
| | | if (cached && cached !== this.filters[filter]) { |
| | | this.filters[filter] = cached; |
| | | } |
| | | }); |
| | | } |
| | | processURLFilters() { |
| | | if (!this.isFirstPage()) return false; |
| | | const params = new URLSearchParams(window.location.search); |
| | | if (!params.toString()) return false; |
| | | let shouldUpdate = false; |
| | | this.allowedFilters.forEach(filter => { |
| | | let value = params.get(`f_${filter}`); |
| | | if (value) { |
| | | shouldUpdate = true; |
| | | this.filters[filter] = value; |
| | | } |
| | | }); |
| | | let hasTax = false; |
| | | params.forEach((value, key) => { |
| | | if (key.startsWith('f_tax_')) { |
| | | hasTax = true; |
| | | shouldUpdate = true; |
| | | const taxonomy = key.replace('f_tax_', ''); |
| | | this.taxFilters[taxonomy] = value.split(',').map(Number); |
| | | } |
| | | }); |
| | | if (shouldUpdate) { |
| | | if (hasTax) { |
| | | this.filters.taxonomy = this.taxFilters; |
| | | } |
| | | this.resetFilters(this.filters); |
| | | } |
| | | return true; |
| | | } |
| | | updateURL() { |
| | | const params = new URLSearchParams(); |
| | | this.allowedFilters.forEach(key => { |
| | | if (Object.hasOwn(this.store.filters, key) && this.store.filters[key] !== this.defaults[key]) { |
| | | params.set(`f_${key}`, this.store.filters[key]); |
| | | } |
| | | }); |
| | | for (let [tax, terms] of Object.entries(this.taxFilters)) { |
| | | if (terms.length > 0) { |
| | | params.set(`f_tax_${tax}`, terms.join(',')); |
| | | } |
| | | } |
| | | const newURL = `${window.location.pathname}${params.toString() ? '?' + params.toString() : ''}`; |
| | | const currentURL = window.location.pathname + window.location.search; // Change this line |
| | | |
| | | if (newURL !== currentURL) { |
| | | window.history.pushState({ |
| | | filters: this.store.filters |
| | | }, '', newURL); |
| | | } |
| | | } |
| | | saveToCacheFilters() { |
| | | Object.keys(this.store.filters).forEach(filter => { |
| | | const cacheKey = `${this.config.contextId}_${this.config.context}_${filter}`; |
| | | if (this.store.filters[filter] !== this.defaults[filter]) { |
| | | this.cache.set(cacheKey, this.store.filters[filter]); |
| | | } else { |
| | | this.cache.remove(cacheKey); |
| | | } |
| | | }); |
| | | const taxCacheKey = `${this.config.contextId}_${this.config.context}_taxonomy`; |
| | | if (Object.keys(this.taxFilters).length > 0) { |
| | | this.cache.set(taxCacheKey, this.taxFilters); |
| | | } else { |
| | | this.cache.remove(taxCacheKey); |
| | | } |
| | | } |
| | | initGallery() { |
| | | this.gallery = this.config.gallery ? window.jvbGallery : false; |
| | | if (this.gallery) { |
| | | this.gallery.subscribe((event, data) => { |
| | | if (event === 'load-more' && this.store.lastResponse?.has_more) { |
| | | this.nextPage(); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | initStore() { |
| | | let extraOrderby = this.ui.orderby.filter(v => !['date', 'date_modified', 'title', 'random'].includes(v.value)); |
| | | let extraIndexes = []; |
| | | extraOrderby.forEach(orderby => { |
| | | extraIndexes.push({ |
| | | name: orderby.value, |
| | | keyPath: orderby.value |
| | | }); |
| | | }); |
| | | const store = window.jvbStore.register('feed', { |
| | | storeName: 'feed', |
| | | endpoint: 'feed', |
| | | keyPath: 'id', |
| | | indexes: [{ |
| | | name: 'content', |
| | | keyPath: 'content' |
| | | }, { |
| | | name: 'taxonomy', |
| | | keyPath: 'taxonomy' |
| | | }, { |
| | | name: 'user', |
| | | keyPath: 'user' |
| | | }, { |
| | | name: 'date', |
| | | keyPath: 'date' |
| | | }, { |
| | | name: 'modified', |
| | | keyPath: 'modified' |
| | | }, { |
| | | name: 'title', |
| | | keyPath: 'title' |
| | | }, ...extraIndexes], |
| | | filters: this.filters, |
| | | TTL: 6 * 60 * 60 * 1000, |
| | | //6 hours |
| | | showLoading: true, |
| | | required: 'content' |
| | | }); |
| | | this.store = store.feed; |
| | | this.store.subscribe((event, data) => { |
| | | switch (event) { |
| | | case 'data-loaded': |
| | | this.renderItems(data.items); |
| | | this.ui.buttons.loadMore.hidden = true; |
| | | if (this.store.lastResponse && this.store.lastResponse?.has_more) { |
| | | this.ui.buttons.loadMore.hidden = !this.store.lastResponse?.has_more ?? true; |
| | | } |
| | | break; |
| | | } |
| | | }); |
| | | } |
| | | isFirstPage() { |
| | | return this.store.filters.page === 1; |
| | | } |
| | | renderItems(items = null) { |
| | | items = items ?? this.store.getFiltered(); |
| | | if (this.isFirstPage()) { |
| | | window.removeChildren(this.ui.grid); |
| | | } |
| | | if (items.length === 0) { |
| | | this.showEmptyState(); |
| | | this.a11y.announceItems(0, this.isFirstPage()); |
| | | } else { |
| | | window.chunkIt(items, item => this.createItemElement(item), fragment => { |
| | | this.removePlaceholders(); |
| | | this.ui.grid.append(fragment); |
| | | if (this.config.gallery) this.gallery.buildGalleryItems('.item img'); |
| | | this.a11y.makeNavigable(this.ui.grid.querySelectorAll('.item:not([data-keyboard-nav])')); |
| | | this.a11y.announceItems(items.length, !this.isFirstPage(), this.store.lastResponse?.has_more ?? false); |
| | | }, 5).then(() => {}); |
| | | } |
| | | this.updateFilterControls(); |
| | | } |
| | | showEmptyState() { |
| | | window.removeChildren(this.ui.grid); |
| | | this.ui.grid.append(this.templates.create('emptyState')); |
| | | } |
| | | createItemElement(item) { |
| | | if (typeof item !== 'object') { |
| | | item = this.store.get(item); |
| | | if (!item) return; |
| | | } |
| | | return this.templates.create(`feedItem${window.uppercaseFirst(item.content)}`, item); |
| | | } |
| | | splitIDs(value) { |
| | | return String(value).split(',').map(value => parseInt(value.trim())).filter(value => value); |
| | | } |
| | | isImageField(item, value) { |
| | | if (!Object.hasOwn(item, 'images') || Object.keys(item.images).length === 0) { |
| | | return false; |
| | | } |
| | | let values = this.splitIDs(value); |
| | | return values.some(v => Object.keys(item.images).map(k => parseInt(k)).includes(parseInt(v))); |
| | | } |
| | | formatImageFields(element, value, item) { |
| | | let values = this.splitIDs(value); // Convert string to array first |
| | | if (values.length === 0) return; |
| | | if (values.length > 1) { |
| | | let image = element.querySelector('img'); |
| | | if (!image) return; |
| | | values.forEach(imgID => { |
| | | let img = image.cloneNode(true); |
| | | this.formatImageField(img, imgID, item); |
| | | element.append(img); |
| | | }); |
| | | image.remove(); |
| | | } else { |
| | | if (element.tagName !== 'IMG') { |
| | | element = element.querySelector('img'); |
| | | if (!element) return; |
| | | } |
| | | this.formatImageField(element, values[0], item); |
| | | } |
| | | } |
| | | formatImageField(element, value, item) { |
| | | let imgData = item.images[value] ?? false; |
| | | if (!imgData) return; |
| | | [element.src, element.srcset, element.alt] = [imgData.tiny, `${imgData.tiny} 50w, ${imgData.small} 300w, ${imgData.medium} 1024w`, imgData['image-alt-text']]; |
| | | } |
| | | isTaxonomyField(item, field) { |
| | | if (!Object.hasOwn(item, 'taxonomies') || Object.keys(item.taxonomies).length === 0) { |
| | | return false; |
| | | } |
| | | return Object.keys(item.taxonomies).includes(field); |
| | | } |
| | | formatTaxonomyField(element, item, field, value) { |
| | | if (element.tagName !== 'UL' || !element.querySelector('li')) return; |
| | | let values = this.splitIDs(value); |
| | | if (values.length === 0) { |
| | | element.remove(); |
| | | } |
| | | let listItem = element.querySelector('li'); |
| | | for (let termID of values) { |
| | | let term = item.taxonomies[field][termID] ?? false; |
| | | if (!term) continue; |
| | | let termItem = listItem.cloneNode(true); |
| | | let link = termItem.querySelector('a'); |
| | | if (!link) continue; |
| | | let title = window.decodeHTMLEntities(term.title); |
| | | [link.href, link.title, link.textContent] = [term.url, `See more ${title}`, title]; |
| | | element.append(termItem); |
| | | } |
| | | listItem.remove(); |
| | | } |
| | | isTimeField(el) { |
| | | return el.tagName === 'TIME' || el.querySelector('time') !== null; |
| | | } |
| | | formatTimeField(element, value) { |
| | | if (element.tagName !== 'TIME') { |
| | | element = element.querySelector('time'); |
| | | if (!element) return; |
| | | } |
| | | element.setAttribute('datetime', value); |
| | | element.textContent = window.formatTimeAgo(value, 'F Y'); |
| | | } |
| | | formatField(element, value) { |
| | | element.textContent = window.decodeHTMLEntities(value); |
| | | } |
| | | addTimelineElements(item, template) { |
| | | let [afterEl, number, started, last] = [template.querySelector('span.after-text'), template.querySelector('[data-field="number"] b'), template.querySelector('[data-field="started"] time'), template.querySelector('[data-field="updated"] time')]; |
| | | if (afterEl) { |
| | | afterEl.textContent = `After ${item.number - 1} Tx`; |
| | | } |
| | | if (number) { |
| | | number.textContent = item.number - 1; |
| | | } |
| | | if (started) { |
| | | this.formatTimeField(started, item.fields.timeline[0]['post_date']); |
| | | } |
| | | if (last) { |
| | | this.formatTimeField(last, item.fields.timeline[item.fields.timeline.length - 1]['post_date']); |
| | | } |
| | | } |
| | | removePlaceholders() { |
| | | const placeholders = this.ui.grid.querySelectorAll('.placeholder'); |
| | | if (placeholders.length > 0) { |
| | | placeholders.forEach(p => p.remove()); |
| | | } |
| | | } |
| | | defineTemplates() { |
| | | const T = this.templates; |
| | | const f = this; |
| | | T.define('feedTerm', { |
| | | refs: { |
| | | icon: '.icon', |
| | | span: 'span' |
| | | }, |
| | | setup({ |
| | | el, |
| | | refs, |
| | | manyRefs, |
| | | data |
| | | }) { |
| | | el.dataset.id = data.id; |
| | | el.dataset.taxonomy = data.taxonomy; |
| | | if (refs.icon) refs.icon.className = `icon icon-${data.icon}`; |
| | | if (refs.span) refs.span.textContent = window.decodeHTMLEntities(data.name); |
| | | } |
| | | }); |
| | | T.define('emptyState'); |
| | | this.contentTypes.forEach(content => { |
| | | T.define(`feedItem${window.uppercaseFirst(content)}`, { |
| | | refs: { |
| | | link: 'a' |
| | | }, |
| | | manyRefs: { |
| | | fields: '[data-field]' |
| | | }, |
| | | setup({ |
| | | el, |
| | | refs, |
| | | manyRefs, |
| | | data |
| | | }) { |
| | | const isTimeline = Object.hasOwn(el.dataset, 'timeline'); |
| | | if (manyRefs.fields) { |
| | | for (let field of manyRefs.fields) { |
| | | if (isTimeline && ['timeline', 'number'].includes(field.dataset.field)) continue; |
| | | const value = Object.hasOwn(data.fields, field.dataset.field) ? data.fields[field.dataset.field] : false; |
| | | if (!value) { |
| | | field.remove(); |
| | | continue; |
| | | } |
| | | if (f.isImageField(data, value)) { |
| | | f.formatImageField(field, value, data); |
| | | } else if (f.isTaxonomyField(data, field.dataset.field)) { |
| | | f.formatTaxonomyField(field, data, field.dataset.field, value); |
| | | } else if (f.isTimeField(field)) { |
| | | f.formatTimeField(field, value); |
| | | } else { |
| | | f.formatField(field, value); |
| | | } |
| | | } |
| | | if (refs.link && data.url !== '') { |
| | | refs.link.href = data.url; |
| | | refs.link.title = `View ${data.fields['post_title'] ?? 'Item'}`; |
| | | } |
| | | if (isTimeline) f.addTimelineElements(data, el); |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | // addPlaceholders() { |
| | | // let total = this.contentTypes.length; |
| | | // const fragment = document.createDocumentFragment(); |
| | | // for (let i = 0; i < 12; i++) { |
| | | // let template = window.getTemplate('placeholderTemplate'); |
| | | // |
| | | // let rand = Math.floor(Math.random() * total); |
| | | // let icon; |
| | | // if (this.ui.content && this.ui.content.length > 0) { |
| | | // icon = this.ui.content.filter((content) => { return content.value === this.contentTypes[rand]}).querySelector('.icon').cloneNode(true); |
| | | // } else { |
| | | // icon = window.getIcon(this.container.dataset.icon); |
| | | // } |
| | | // template.append(icon); |
| | | // fragment.append(template); |
| | | // } |
| | | // this.ui.grid.append(fragment); |
| | | // } |
| | | } |
| | | document.addEventListener('DOMContentLoaded', async function () { |
| | | window.auth.subscribe(event => { |
| | | if (event === 'auth-loaded') { |
| | | window.feedBlock = new FeedBlock(); |
| | | } |
| | | }); |
| | | }); |
| | | /******/ })() |
| | | ; |
| | | //# sourceMappingURL=view.js.map |
| | | (()=>{class e{constructor(){this.container=document.querySelector("section.feed-block"),this.container&&(this.a11y=window.jvbA11y,this.error=window.jvbError,this.cache=new window.jvbCache("feed"),this.templates=window.jvbTemplates,this.config={contextId:"",context:"",highlight:null,gallery:!1,view:this.cache.get("feedView")||"grid",...this.container.dataset},this.init())}init(){this.initElements(),this.defineTemplates(),this.initListeners(),this.initFilters(),"requestIdleCallback"in window?requestIdleCallback(()=>{this.initStore(),this.initTaxonomies(),this.processCachedFilters(),this.processURLFilters(),this.updateFilterUI(),this.initGallery()},{timeout:2e3}):setTimeout(()=>{this.initStore(),this.initTaxonomies(),this.processCachedFilters(),this.processURLFilters(),this.updateFilterUI(),this.initGallery()},100)}initElements(){this.selectors={filterTrigger:"[data-filter]",filters:{actions:".filter-actions .toggle-text",container:".all-filters",showing:".all-filters summary .current",content:'[data-filter="content"]',ordering:".ordering",orderby:'[data-filter="orderby"]',order:'[data-filter="order"]',orderWrap:".order-direction",match:'[data-filter="match"]',favourites:'[data-filter="favourites"]',taxonomy:'[data-filter^="taxonomy"]'},grid:".item-grid",selected:".selected-items",buttons:{loadMore:"button.load-more",remove:".remove-term",clearFilters:"button.clear-filters",refresh:'button[data-action="refresh"]'}},this.ui=window.uiFromSelectors(this.selectors,this.container),this.ui.buttons.refresh=document.querySelector(this.selectors.buttons.refresh),["content","orderby","order","taxonomy"].forEach(e=>{let t=this.ui.filters.container.querySelectorAll(this.selectors.filters[e]);this.ui[e]=Array.from(t)}),this.contentTypes=this.ui.content.length>0?this.ui.content.map(e=>e.value):[this.container.dataset.content],this.taxonomies=this.ui.taxonomies?.length>0?Array.from(this.ui.taxonomies).map(e=>e.dataset.taxonomy):[]}getChecked(e){["content","orderby","order"].includes(e)||console.log("Invalid item to check: ",e);let t=this.ui[e];if(!t)return;let i=t.filter(e=>e.checked);return"content"===e&&i.length>0&&this.updateContentFor(i[0].value),0===i.length?t[0].value:i[0].value}initListeners(){this.popStateHandler=this.handlePopState.bind(this),this.clickHandler=this.handleClick.bind(this),this.changeHandler=this.handleChange.bind(this),window.addEventListener("popstate",this.popStateHandler),document.addEventListener("click",this.clickHandler),document.addEventListener("change",this.changeHandler)}initFilters(){this.allowedFilters=["content","order","orderby","favourites","match"];let e={content:this.getChecked("content"),orderby:this.getChecked("orderby"),order:this.getChecked("order"),page:1};this.config.context&&(e.context=this.config.context),this.config.contextId&&(e.contextId=this.config.contextId),this.filters=e,this.defaults={...e}}updateFilterUI(){if(this.ui.filters.container&&([this.ui.content,this.ui.orderby,this.ui.order].forEach(e=>{if(e)for(let t of e){let[e,i]=[t.dataset.filter,t.value];if(!Object.hasOwn(this.store.filters,e))break;let s=this.store.filters[e]===i;if(s){t.checked=s;break}}}),Object.hasOwn(this.store.filters,"taxonomy")))for(let[e,t]of Object.entries(this.store.filters.taxonomy))t.forEach(e=>{e=parseInt(e),this.selector.store.get(e)&&this.createTermElement(e)})}handlePopState(e){e.state?.filters&&this.processURLFilters()&&(this.store.setFilters(this.filters),this.a11y.announce("Feed filters updated from browser history"))}handleClick(e){window.targetCheck(e,this.selectors.buttons.loadMore)?this.nextPage():window.targetCheck(e,this.selectors.buttons.clearFilters)&&this.clearFilters();let t=window.targetCheck(e,this.selectors.buttons.remove);t&&this.removeSelectedTerm(t),window.targetCheck(e,this.selectors.buttons.refresh)&&(this.store.clearCache(),this.store.fetch());let i=window.targetCheck(e,'[data-filter="orderby"]');i&&"random"===i.value&&i.checked&&this.renderItems()}nextPage(){const e=(this.store.filters.page||1)+1,t=this.store.lastResponse?.pages||e;this.store.setFilters({page:Math.min(e,t)})}handleChange(e){const t=e.target;if(Object.hasOwn(t.dataset,"filter")){if(this.allowedFilters.includes(t.dataset.filter)){let e={};e[t.dataset.filter]=t.value,this.resetFilters(e)}switch(t.dataset.filter){case"content":this.updateContentFor(t.value);break;case"orderby":this.updateOrderOptions(t.value)}}}clearFilters(){this.taxFilters={},window.removeChildren(this.ui.selected),this.taxonomies.forEach(e=>{let t=this.getFieldId(e);this.selector.selectedTerms.get(t)?.clear()}),this.store.setFilters({...this.defaults,taxonomy:null}),this.updateURL(),this.saveToCacheFilters()}resetFilters(e){e={...this.store.filters,page:1,...e},this.store.setFilters(e),this.updateURL(),this.saveToCacheFilters()}getFieldId(e){return this.selector.getFieldId(this.ui.taxonomies.filter(t=>t.dataset.taxonomy===e)[0]??null)}removeSelectedTerm(e){const t=parseInt(e.dataset.id),i=e.dataset.taxonomy;Object.hasOwn(this.taxFilters,i)&&(this.taxFilters[i]=this.taxFilters[i].filter(e=>e!==t),0===this.taxFilters[i].length&&delete this.taxFilters[i]),e.remove();const s=this.getFieldId(i);s&&(this.selector.activeField=s,this.selector.removeSelected(t,s)),this.resetFilters({taxonomy:Object.keys(this.taxFilters).length>0?this.taxFilters:null})}updateContentFor(e){let t=[this.ui.taxonomies,this.ui.orderby];this.ui.filters.showing.textContent=this.ui.content.filter(t=>t.value===e)[0].dataset.label,t.forEach(t=>{t&&t.forEach(t=>{const i=t.dataset.for?.split(",")??[];t.hidden=i.length>0&&!i.includes(e),t.hidden&&t.checked&&(t.checked=!1)})})}updateOrderOptions(e){if(this.ui.filters.orderWrap){let t=this.ui.filters.orderWrap.dataset.forOrder.split(",")??[];this.ui.filters.orderWrap.hidden=!t.includes(e)}}updateFilterControls(){const e=Object.keys(this.taxFilters);this.ui.buttons.clearFilters&&(this.ui.buttons.clearFilters.hidden=0===e.length),this.ui.filters.actions&&(this.ui.filters.actions.hidden=e.length<=1)}async initTaxonomies(){this.taxFilters={},this.selector=window.jvbSelector,this.selector.subscribe((e,t)=>{"selected-terms"===e&&this.handleTaxonomyChange(t)})}handleTaxonomyChange(e){const{terms:t,taxonomy:i}=e;0!==t.size&&(this.taxFilters[i]=Array.from(t),this.resetFilters({taxonomy:this.taxFilters}),t.forEach(e=>{this.createTermElement(e)}),this.updateFilterControls())}getTaxonomyIcon(e){let t=this.ui.taxonomies.find(t=>t.dataset.taxonomy===e);return t?.dataset.icon.trim()||"tag"}createTermElement(e){const t=this.selector.store.get(e);t&&(this.ui.selected.querySelector(`[data-id="${e}"]`)||(t.icon=this.getTaxonomyIcon(t.taxonomy),this.ui.selected.append(this.templates.create("feedTerm",t))))}processCachedFilters(){Object.keys(this.filters).forEach(e=>{let t=this.cache.get(`${this.config.contextId}_${this.config.context}_${e}`);t&&t!==this.filters[e]&&(this.filters[e]=t)})}processURLFilters(){if(!this.isFirstPage())return!1;const e=new URLSearchParams(window.location.search);if(!e.toString())return!1;let t=!1;this.allowedFilters.forEach(i=>{let s=e.get(`f_${i}`);s&&(t=!0,this.filters[i]=s)});let i=!1;return e.forEach((e,s)=>{if(s.startsWith("f_tax_")){i=!0,t=!0;const r=s.replace("f_tax_","");this.taxFilters[r]=e.split(",").map(Number)}}),t&&(i&&(this.filters.taxonomy=this.taxFilters),this.resetFilters(this.filters)),!0}updateURL(){const e=new URLSearchParams;this.allowedFilters.forEach(t=>{Object.hasOwn(this.store.filters,t)&&this.store.filters[t]!==this.defaults[t]&&e.set(`f_${t}`,this.store.filters[t])});for(let[t,i]of Object.entries(this.taxFilters))i.length>0&&e.set(`f_tax_${t}`,i.join(","));const t=`${window.location.pathname}${e.toString()?"?"+e.toString():""}`;t!==window.location.pathname+window.location.search&&window.history.pushState({filters:this.store.filters},"",t)}saveToCacheFilters(){Object.keys(this.store.filters).forEach(e=>{const t=`${this.config.contextId}_${this.config.context}_${e}`;this.store.filters[e]!==this.defaults[e]?this.cache.set(t,this.store.filters[e]):this.cache.remove(t)});const e=`${this.config.contextId}_${this.config.context}_taxonomy`;Object.keys(this.taxFilters).length>0?this.cache.set(e,this.taxFilters):this.cache.remove(e)}initGallery(){this.gallery=!!this.config.gallery&&window.jvbGallery,this.gallery&&this.gallery.subscribe((e,t)=>{"load-more"===e&&this.store.lastResponse?.has_more&&this.nextPage()})}initStore(){let e=this.ui.orderby.filter(e=>!["date","date_modified","title","random"].includes(e.value)),t=[];e.forEach(e=>{t.push({name:e.value,keyPath:e.value})});const i=window.jvbStore.register("feed",{storeName:"feed",endpoint:"feed",keyPath:"id",indexes:[{name:"content",keyPath:"content"},{name:"taxonomy",keyPath:"taxonomy"},{name:"user",keyPath:"user"},{name:"date",keyPath:"date"},{name:"modified",keyPath:"modified"},{name:"title",keyPath:"title"},...t],filters:this.filters,TTL:216e5,showLoading:!0,required:"content"});this.store=i.feed,this.store.subscribe((e,t)=>{"data-loaded"===e&&(this.renderItems(t.items),this.ui.buttons.loadMore.hidden=!0,this.store.lastResponse&&this.store.lastResponse?.has_more&&(this.ui.buttons.loadMore.hidden=!this.store.lastResponse?.has_more??!0))})}isFirstPage(){return 1===this.store.filters.page}renderItems(e=null){e=e??this.store.getFiltered(),this.isFirstPage()&&window.removeChildren(this.ui.grid),0===e.length?(this.showEmptyState(),this.a11y.announceItems(0,this.isFirstPage())):window.chunkIt(e,e=>this.createItemElement(e),t=>{this.removePlaceholders(),this.ui.grid.append(t),this.config.gallery&&this.gallery.buildGalleryItems(".item img"),this.a11y.makeNavigable(this.ui.grid.querySelectorAll(".item:not([data-keyboard-nav])")),this.a11y.announceItems(e.length,!this.isFirstPage(),this.store.lastResponse?.has_more??!1)},5).then(()=>{}),this.updateFilterControls()}showEmptyState(){window.removeChildren(this.ui.grid),this.ui.grid.append(this.templates.create("emptyState"))}createItemElement(e){if("object"==typeof e||(e=this.store.get(e)))return this.templates.create(`feedItem${window.uppercaseFirst(e.content)}`,e)}splitIDs(e){return String(e).split(",").map(e=>parseInt(e.trim())).filter(e=>e)}isImageField(e,t){return!(!Object.hasOwn(e,"images")||0===Object.keys(e.images).length)&&this.splitIDs(t).some(t=>Object.keys(e.images).map(e=>parseInt(e)).includes(parseInt(t)))}formatImageFields(e,t,i){let s=this.splitIDs(t);if(0!==s.length)if(s.length>1){let t=e.querySelector("img");if(!t)return;s.forEach(s=>{let r=t.cloneNode(!0);this.formatImageField(r,s,i),e.append(r)}),t.remove()}else{if("IMG"!==e.tagName&&!(e=e.querySelector("img")))return;this.formatImageField(e,s[0],i)}}formatImageField(e,t,i){let s=i.images[t]??!1;s&&([e.src,e.srcset,e.alt]=[s.tiny,`${s.tiny} 50w, ${s.small} 300w, ${s.medium} 1024w`,s["image-alt-text"]])}isTaxonomyField(e,t){return!(!Object.hasOwn(e,"taxonomies")||0===Object.keys(e.taxonomies).length)&&Object.keys(e.taxonomies).includes(t)}formatTaxonomyField(e,t,i,s){if("UL"!==e.tagName||!e.querySelector("li"))return;let r=this.splitIDs(s);0===r.length&&e.remove();let o=e.querySelector("li");for(let s of r){let r=t.taxonomies[i][s]??!1;if(!r)continue;let a=o.cloneNode(!0),n=a.querySelector("a");if(!n)continue;let l=window.decodeHTMLEntities(r.title);[n.href,n.title,n.textContent]=[r.url,`See more ${l}`,l],e.append(a)}o.remove()}isTimeField(e){return"TIME"===e.tagName||null!==e.querySelector("time")}formatTimeField(e,t){("TIME"===e.tagName||(e=e.querySelector("time")))&&(e.setAttribute("datetime",t),e.textContent=window.formatTimeAgo(t,"F Y"))}formatField(e,t){e.textContent=window.decodeHTMLEntities(t)}addTimelineElements(e,t){let[i,s,r,o]=[t.querySelector("span.after-text"),t.querySelector('[data-field="number"] b'),t.querySelector('[data-field="started"] time'),t.querySelector('[data-field="updated"] time')];i&&(i.textContent=`After ${e.number-1} Tx`),s&&(s.textContent=e.number-1),r&&this.formatTimeField(r,e.fields.timeline[0].post_date),o&&this.formatTimeField(o,e.fields.timeline[e.fields.timeline.length-1].post_date)}removePlaceholders(){const e=this.ui.grid.querySelectorAll(".placeholder");e.length>0&&e.forEach(e=>e.remove())}defineTemplates(){const e=this.templates,t=this;e.define("feedTerm",{refs:{icon:".icon",span:"span"},setup({el:e,refs:t,manyRefs:i,data:s}){e.dataset.id=s.id,e.dataset.taxonomy=s.taxonomy,t.icon&&(t.icon.className=`icon icon-${s.icon}`),t.span&&(t.span.textContent=window.decodeHTMLEntities(s.name))}}),e.define("emptyState"),this.contentTypes.forEach(i=>{e.define(`feedItem${window.uppercaseFirst(i)}`,{refs:{link:"a"},manyRefs:{fields:"[data-field]"},setup({el:e,refs:i,manyRefs:s,data:r}){const o=Object.hasOwn(e.dataset,"timeline");if(s.fields){for(let e of s.fields){if(o&&["timeline","number"].includes(e.dataset.field))continue;const i=!!Object.hasOwn(r.fields,e.dataset.field)&&r.fields[e.dataset.field];i?t.isImageField(r,i)?t.formatImageField(e,i,r):t.isTaxonomyField(r,e.dataset.field)?t.formatTaxonomyField(e,r,e.dataset.field,i):t.isTimeField(e)?t.formatTimeField(e,i):t.formatField(e,i):e.remove()}i.link&&""!==r.url&&(i.link.href=r.url,i.link.title=`View ${r.fields.post_title??"Item"}`),o&&t.addTimelineElements(r,e)}}})})}}document.addEventListener("DOMContentLoaded",async function(){window.auth.subscribe(t=>{"auth-loaded"===t&&(window.feedBlock=new e)})})})(); |
| | |
| | | /*!**********************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/forms/editor.scss ***! |
| | | \**********************************************************************************************************************************************************************************************************************************************/ |
| | | |
| | |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'b663341232d8262dddc0'); |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '0627d4138bd3642db1b4'); |
| | |
| | | /*!**********************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/forms/editor.scss ***! |
| | | \**********************************************************************************************************************************************************************************************************************************************/ |
| | | |
| | |
| | | /******/ (() => { // webpackBootstrap |
| | | /******/ "use strict"; |
| | | /******/ var __webpack_modules__ = ({ |
| | | |
| | | /***/ "./src/forms/edit.js" |
| | | /*!***************************!*\ |
| | | !*** ./src/forms/edit.js ***! |
| | | \***************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| | | /* harmony export */ "default": () => (/* binding */ Edit) |
| | | /* harmony export */ }); |
| | | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| | | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); |
| | | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); |
| | | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); |
| | | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| | | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); |
| | | /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editor.scss */ "./src/forms/editor.scss"); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__); |
| | | /** |
| | | * edit.js |
| | | * WordPress dependencies |
| | | */ |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Styles |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * Edit function for Form Block |
| | | */ |
| | | |
| | | function Edit({ |
| | | attributes, |
| | | setAttributes |
| | | }) { |
| | | const { |
| | | formType, |
| | | showLabels, |
| | | customEmailTo, |
| | | turnstileEnabled |
| | | } = attributes; |
| | | const [isPreviewVisible, setIsPreviewVisible] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(true); |
| | | const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({ |
| | | className: `jvb-form-block ${formType ? `jvb-form-block-${formType}` : ''}` |
| | | }); |
| | | |
| | | // Get form types from localized data, with fallback |
| | | const getFormTypes = () => { |
| | | if (typeof window !== 'undefined' && window.jvbFormsData && window.jvbFormsData.formTypes) { |
| | | return window.jvbFormsData.formTypes; |
| | | } |
| | | |
| | | // Fallback if data isn't available |
| | | return [{ |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select a form type', 'jvb'), |
| | | value: '' |
| | | }, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('No forms available', 'jvb'), |
| | | value: '', |
| | | disabled: true |
| | | }]; |
| | | }; |
| | | |
| | | // Get available forms configuration |
| | | const getAvailableForms = () => { |
| | | console.log(window.jvbFormsData); |
| | | if (typeof window !== 'undefined' && window.jvbFormsData && window.jvbFormsData.availableForms) { |
| | | return window.jvbFormsData.availableForms; |
| | | } |
| | | return {}; |
| | | }; |
| | | const formTypes = getFormTypes(); |
| | | const availableForms = getAvailableForms(); |
| | | |
| | | // Get form configuration based on selected type |
| | | const getCurrentFormConfig = () => { |
| | | if (!formType || !availableForms[formType]) { |
| | | return null; |
| | | } |
| | | return availableForms[formType]; |
| | | }; |
| | | |
| | | // Form labels based on the selected form type |
| | | const getFormLabels = () => { |
| | | const formConfig = getCurrentFormConfig(); |
| | | if (formConfig) { |
| | | return { |
| | | title: formConfig.title || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Form', 'jvb'), |
| | | description: Array.isArray(formConfig.description) ? formConfig.description.join(' ') : formConfig.description || '', |
| | | button: formConfig.submit || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Submit', 'jvb') |
| | | }; |
| | | } |
| | | return { |
| | | title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Form', 'jvb'), |
| | | description: formType ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Loading form configuration...', 'jvb') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Please select a form type in the sidebar', 'jvb'), |
| | | button: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Submit', 'jvb') |
| | | }; |
| | | }; |
| | | const formLabels = getFormLabels(); |
| | | |
| | | // Render a preview of the form in the editor |
| | | const renderFormPreview = () => { |
| | | if (!formType) { |
| | | return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Notice, { |
| | | status: "warning", |
| | | isDismissible: false, |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Please select a form type in the block settings.', 'jvb') |
| | | }); |
| | | } |
| | | let formFields = []; |
| | | switch (formType) { |
| | | case 'contact': |
| | | formFields = [{ |
| | | id: 'name', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Name', 'jvb'), |
| | | type: 'text', |
| | | required: true |
| | | }, { |
| | | id: 'email', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Email', 'jvb'), |
| | | type: 'email', |
| | | required: true |
| | | }, { |
| | | id: 'phone', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Phone', 'jvb'), |
| | | type: 'tel', |
| | | required: true |
| | | }, { |
| | | id: 'instagram', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Instagram URL', 'jvb'), |
| | | type: 'url' |
| | | }, { |
| | | id: 'contact_methods', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Preferred Contact', 'jvb'), |
| | | type: 'checkboxes', |
| | | options: [{ |
| | | value: 'text', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Text', 'jvb') |
| | | }, { |
| | | value: 'call', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Call', 'jvb') |
| | | }, { |
| | | value: 'email', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Email', 'jvb') |
| | | }, { |
| | | value: 'instagram', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Instagram', 'jvb') |
| | | }] |
| | | }, { |
| | | id: 'message', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your Message', 'jvb'), |
| | | type: 'textarea', |
| | | required: true |
| | | }]; |
| | | break; |
| | | case 'feature_request': |
| | | formFields = [{ |
| | | id: 'name', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Name', 'jvb'), |
| | | type: 'text', |
| | | help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Required if you want us to follow up.', 'jvb') |
| | | }, { |
| | | id: 'email', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Email', 'jvb'), |
| | | type: 'email', |
| | | help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Required if you want us to follow up.', 'jvb') |
| | | }, { |
| | | id: 'follow_up', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Would you like me to follow up with you?', 'jvb'), |
| | | type: 'checkbox' |
| | | }, { |
| | | id: 'target_audience', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This Feature is For', 'jvb'), |
| | | type: 'checkboxes', |
| | | options: [{ |
| | | value: 'artists', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Artists', 'jvb') |
| | | }, { |
| | | value: 'visitors', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Site Visitors', 'jvb') |
| | | }, { |
| | | value: 'partners', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Partners', 'jvb') |
| | | }, { |
| | | value: 'other', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Other', 'jvb') |
| | | }] |
| | | }, { |
| | | id: 'feature_name', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Name your Feature', 'jvb'), |
| | | type: 'text', |
| | | required: true |
| | | }, { |
| | | id: 'message', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Describe Your Feature', 'jvb'), |
| | | type: 'textarea', |
| | | required: true |
| | | }]; |
| | | break; |
| | | case 'technical_issue': |
| | | formFields = [{ |
| | | id: 'name', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Name', 'jvb'), |
| | | type: 'text' |
| | | }, { |
| | | id: 'email', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Email', 'jvb'), |
| | | type: 'email' |
| | | }, { |
| | | id: 'follow_up', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Would you like me to follow up with you?', 'jvb'), |
| | | type: 'checkbox' |
| | | }, { |
| | | id: 'issue_type', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Type of Issue', 'jvb'), |
| | | type: 'checkboxes', |
| | | options: [{ |
| | | value: 'visual', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Visual', 'jvb') |
| | | }, { |
| | | value: 'error', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Error Page', 'jvb') |
| | | }, { |
| | | value: 'other', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Other', 'jvb') |
| | | }] |
| | | }, { |
| | | id: 'message', |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Please describe the issue.', 'jvb'), |
| | | type: 'textarea', |
| | | required: true |
| | | }]; |
| | | break; |
| | | } |
| | | return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, { |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("h3", { |
| | | className: "jvb-form-title", |
| | | children: formLabels.title |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("p", { |
| | | className: "jvb-form-description", |
| | | children: formLabels.description |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", { |
| | | className: "jvb-form-preview", |
| | | children: [formFields.map(field => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", { |
| | | className: "jvb-form-field", |
| | | children: [showLabels && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("label", { |
| | | htmlFor: `jvb-${field.id}`, |
| | | className: field.required ? 'required' : '', |
| | | children: field.label |
| | | }), field.type === 'text' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("input", { |
| | | type: "text", |
| | | id: `jvb-${field.id}`, |
| | | placeholder: showLabels ? '' : field.label, |
| | | disabled: true |
| | | }), field.type === 'email' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("input", { |
| | | type: "email", |
| | | id: `jvb-${field.id}`, |
| | | placeholder: showLabels ? '' : field.label, |
| | | disabled: true |
| | | }), field.type === 'tel' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("input", { |
| | | type: "tel", |
| | | id: `jvb-${field.id}`, |
| | | placeholder: showLabels ? '' : field.label, |
| | | disabled: true |
| | | }), field.type === 'url' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("input", { |
| | | type: "url", |
| | | id: `jvb-${field.id}`, |
| | | placeholder: showLabels ? '' : field.label, |
| | | disabled: true |
| | | }), field.type === 'textarea' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("textarea", { |
| | | id: `jvb-${field.id}`, |
| | | placeholder: showLabels ? '' : field.label, |
| | | disabled: true, |
| | | rows: "4" |
| | | }), field.type === 'checkbox' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", { |
| | | className: "jvb-form-checkbox", |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("input", { |
| | | type: "checkbox", |
| | | id: `jvb-${field.id}`, |
| | | disabled: true |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("label", { |
| | | htmlFor: `jvb-${field.id}`, |
| | | children: field.label |
| | | })] |
| | | }), field.type === 'checkboxes' && field.options && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { |
| | | className: "jvb-form-checkboxes", |
| | | children: field.options.map(option => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", { |
| | | className: "jvb-form-checkbox", |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("input", { |
| | | type: "checkbox", |
| | | id: `jvb-${field.id}-${option.value}`, |
| | | disabled: true |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("label", { |
| | | htmlFor: `jvb-${field.id}-${option.value}`, |
| | | children: option.label |
| | | })] |
| | | }, option.value)) |
| | | }), field.help && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("p", { |
| | | className: "jvb-form-help", |
| | | children: field.help |
| | | })] |
| | | }, field.id)), turnstileEnabled && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { |
| | | className: "jvb-form-turnstile", |
| | | children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { |
| | | className: "jvb-turnstile-placeholder", |
| | | children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span", { |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Cloudflare Turnstile will appear here', 'jvb') |
| | | }) |
| | | }) |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { |
| | | className: "jvb-form-submit", |
| | | children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("button", { |
| | | type: "button", |
| | | className: "jvb-form-button", |
| | | children: formLabels.button |
| | | }) |
| | | })] |
| | | })] |
| | | }); |
| | | }; |
| | | return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, { |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, { |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { |
| | | title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Form Settings', 'jvb'), |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SelectControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Form Type', 'jvb'), |
| | | value: formType, |
| | | options: formTypes, |
| | | onChange: value => setAttributes({ |
| | | formType: value |
| | | }) |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ToggleControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Show Field Labels', 'jvb'), |
| | | checked: showLabels, |
| | | onChange: value => setAttributes({ |
| | | showLabels: value |
| | | }), |
| | | help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Toggle to show or hide field labels.', 'jvb') |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.TextControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Custom Recipient Email', 'jvb'), |
| | | value: customEmailTo || '', |
| | | onChange: value => setAttributes({ |
| | | customEmailTo: value |
| | | }), |
| | | help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Leave empty to use the default email.', 'jvb'), |
| | | type: "email" |
| | | })] |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { |
| | | title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Form Preview', 'jvb'), |
| | | initialOpen: false, |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ToggleControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Show Preview', 'jvb'), |
| | | checked: isPreviewVisible, |
| | | onChange: value => setIsPreviewVisible(value) |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("p", { |
| | | className: "components-base-control__help", |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This is just a preview. The actual form will be rendered on the frontend.', 'jvb') |
| | | })] |
| | | })] |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { |
| | | ...blockProps, |
| | | children: isPreviewVisible ? renderFormPreview() : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", { |
| | | className: "jvb-form-placeholder", |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("h3", { |
| | | children: formLabels.title |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("p", { |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Form preview is hidden. Edit settings in the sidebar.', 'jvb') |
| | | })] |
| | | }) |
| | | })] |
| | | }); |
| | | } |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/forms/index.js" |
| | | /*!****************************!*\ |
| | | !*** ./src/forms/index.js ***! |
| | | \****************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/forms/style.scss"); |
| | | /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/forms/edit.js"); |
| | | /* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/forms/save.js"); |
| | | /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/forms/block.json"); |
| | | //index.js |
| | | /** |
| | | * Registers a new block provided a unique name and an object defining its behavior. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. |
| | | * All files containing `style` keyword are bundled together. The code used |
| | | * gets applied both to the front of your site and to the editor. |
| | | * |
| | | * @see https://www.npmjs.com/package/@wordpress/scripts#using-css |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * Internal dependencies |
| | | */ |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Every block starts by registering a new block type definition. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ |
| | | */ |
| | | (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, { |
| | | /** |
| | | * @see ./edit.js |
| | | */ |
| | | edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"], |
| | | /** |
| | | * @see ./save.js |
| | | */ |
| | | save: _save__WEBPACK_IMPORTED_MODULE_3__["default"] |
| | | }); |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/forms/save.js" |
| | | /*!***************************!*\ |
| | | !*** ./src/forms/save.js ***! |
| | | \***************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| | | /* harmony export */ "default": () => (/* binding */ save) |
| | | /* harmony export */ }); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__); |
| | | //save.js |
| | | /** |
| | | * React hook that is used to mark the block wrapper element. |
| | | * It provides all the necessary props like the class name. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * The save function defines the way in which the different attributes should |
| | | * be combined into the final markup, which is then serialized by the block |
| | | * editor into `post_content`. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save |
| | | * |
| | | * @return {WPElement} Element to render. |
| | | */ |
| | | function save() { |
| | | // This is a dynamic block that is rendered on the server side |
| | | // Return null to let WordPress handle the saving and rendering |
| | | return null; |
| | | } |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/forms/editor.scss" |
| | | /*!*******************************!*\ |
| | | !*** ./src/forms/editor.scss ***! |
| | | \*******************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | // extracted by mini-css-extract-plugin |
| | | |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/forms/style.scss" |
| | | /*!******************************!*\ |
| | | !*** ./src/forms/style.scss ***! |
| | | \******************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | // extracted by mini-css-extract-plugin |
| | | |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "react/jsx-runtime" |
| | | /*!**********************************!*\ |
| | | !*** external "ReactJSXRuntime" ***! |
| | | \**********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["ReactJSXRuntime"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/block-editor" |
| | | /*!*************************************!*\ |
| | | !*** external ["wp","blockEditor"] ***! |
| | | \*************************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blockEditor"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/blocks" |
| | | /*!********************************!*\ |
| | | !*** external ["wp","blocks"] ***! |
| | | \********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blocks"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/components" |
| | | /*!************************************!*\ |
| | | !*** external ["wp","components"] ***! |
| | | \************************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["components"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/element" |
| | | /*!*********************************!*\ |
| | | !*** external ["wp","element"] ***! |
| | | \*********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["element"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/i18n" |
| | | /*!******************************!*\ |
| | | !*** external ["wp","i18n"] ***! |
| | | \******************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["i18n"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/forms/block.json" |
| | | /*!******************************!*\ |
| | | !*** ./src/forms/block.json ***! |
| | | \******************************/ |
| | | (module) { |
| | | |
| | | module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"jvb/forms","title":"Contact Forms","category":"jvb","icon":"align-center","description":"Our custom contact forms","keywords":["form","forms","contact"],"version":"1.0.0","textdomain":"jvb","attributes":{"formType":{"type":"string","default":""},"showLabels":{"type":"boolean","default":true},"customEmailTo":{"type":"string","default":""}},"supports":{"html":false,"align":["wide","full"]},"selectors":{"root":".jvb-form-block"},"styles":[{"name":"default","label":"Default","isDefault":true}],"example":{"attributes":{"formType":"contact","showLabels":true}},"render":"file:./render.php","editorScript":"file:./index.js","editorStyle":"file:./index.scss","style":"file:./style-index.css","viewScript":"file:./view.js"}'); |
| | | |
| | | /***/ } |
| | | |
| | | /******/ }); |
| | | /************************************************************************/ |
| | | /******/ // The module cache |
| | | /******/ var __webpack_module_cache__ = {}; |
| | | /******/ |
| | | /******/ // The require function |
| | | /******/ function __webpack_require__(moduleId) { |
| | | /******/ // Check if module is in cache |
| | | /******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| | | /******/ if (cachedModule !== undefined) { |
| | | /******/ return cachedModule.exports; |
| | | /******/ } |
| | | /******/ // Create a new module (and put it into the cache) |
| | | /******/ var module = __webpack_module_cache__[moduleId] = { |
| | | /******/ // no module.id needed |
| | | /******/ // no module.loaded needed |
| | | /******/ exports: {} |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // Execute the module function |
| | | /******/ if (!(moduleId in __webpack_modules__)) { |
| | | /******/ delete __webpack_module_cache__[moduleId]; |
| | | /******/ var e = new Error("Cannot find module '" + moduleId + "'"); |
| | | /******/ e.code = 'MODULE_NOT_FOUND'; |
| | | /******/ throw e; |
| | | /******/ } |
| | | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| | | /******/ |
| | | /******/ // Return the exports of the module |
| | | /******/ return module.exports; |
| | | /******/ } |
| | | /******/ |
| | | /******/ // expose the modules object (__webpack_modules__) |
| | | /******/ __webpack_require__.m = __webpack_modules__; |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ /* webpack/runtime/chunk loaded */ |
| | | /******/ (() => { |
| | | /******/ var deferred = []; |
| | | /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { |
| | | /******/ if(chunkIds) { |
| | | /******/ priority = priority || 0; |
| | | /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; |
| | | /******/ deferred[i] = [chunkIds, fn, priority]; |
| | | /******/ return; |
| | | /******/ } |
| | | /******/ var notFulfilled = Infinity; |
| | | /******/ for (var i = 0; i < deferred.length; i++) { |
| | | /******/ var [chunkIds, fn, priority] = deferred[i]; |
| | | /******/ var fulfilled = true; |
| | | /******/ for (var j = 0; j < chunkIds.length; j++) { |
| | | /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { |
| | | /******/ chunkIds.splice(j--, 1); |
| | | /******/ } else { |
| | | /******/ fulfilled = false; |
| | | /******/ if(priority < notFulfilled) notFulfilled = priority; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(fulfilled) { |
| | | /******/ deferred.splice(i--, 1) |
| | | /******/ var r = fn(); |
| | | /******/ if (r !== undefined) result = r; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ return result; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/compat get default export */ |
| | | /******/ (() => { |
| | | /******/ // getDefaultExport function for compatibility with non-harmony modules |
| | | /******/ __webpack_require__.n = (module) => { |
| | | /******/ var getter = module && module.__esModule ? |
| | | /******/ () => (module['default']) : |
| | | /******/ () => (module); |
| | | /******/ __webpack_require__.d(getter, { a: getter }); |
| | | /******/ return getter; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/define property getters */ |
| | | /******/ (() => { |
| | | /******/ // define getter functions for harmony exports |
| | | /******/ __webpack_require__.d = (exports, definition) => { |
| | | /******/ for(var key in definition) { |
| | | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| | | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| | | /******/ } |
| | | /******/ } |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| | | /******/ (() => { |
| | | /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/make namespace object */ |
| | | /******/ (() => { |
| | | /******/ // define __esModule on exports |
| | | /******/ __webpack_require__.r = (exports) => { |
| | | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
| | | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| | | /******/ } |
| | | /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/jsonp chunk loading */ |
| | | /******/ (() => { |
| | | /******/ // no baseURI |
| | | /******/ |
| | | /******/ // object to store loaded and loading chunks |
| | | /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched |
| | | /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded |
| | | /******/ var installedChunks = { |
| | | /******/ "forms/index": 0, |
| | | /******/ "forms/style-index": 0 |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // no chunk on demand loading |
| | | /******/ |
| | | /******/ // no prefetching |
| | | /******/ |
| | | /******/ // no preloaded |
| | | /******/ |
| | | /******/ // no HMR |
| | | /******/ |
| | | /******/ // no HMR manifest |
| | | /******/ |
| | | /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); |
| | | /******/ |
| | | /******/ // install a JSONP callback for chunk loading |
| | | /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { |
| | | /******/ var [chunkIds, moreModules, runtime] = data; |
| | | /******/ // add "moreModules" to the modules object, |
| | | /******/ // then flag all "chunkIds" as loaded and fire callback |
| | | /******/ var moduleId, chunkId, i = 0; |
| | | /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { |
| | | /******/ for(moduleId in moreModules) { |
| | | /******/ if(__webpack_require__.o(moreModules, moduleId)) { |
| | | /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(runtime) var result = runtime(__webpack_require__); |
| | | /******/ } |
| | | /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); |
| | | /******/ for(;i < chunkIds.length; i++) { |
| | | /******/ chunkId = chunkIds[i]; |
| | | /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { |
| | | /******/ installedChunks[chunkId][0](); |
| | | /******/ } |
| | | /******/ installedChunks[chunkId] = 0; |
| | | /******/ } |
| | | /******/ return __webpack_require__.O(result); |
| | | /******/ } |
| | | /******/ |
| | | /******/ var chunkLoadingGlobal = globalThis["webpackChunkjvb"] = globalThis["webpackChunkjvb"] || []; |
| | | /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); |
| | | /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); |
| | | /******/ })(); |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ |
| | | /******/ // startup |
| | | /******/ // Load entry module and return exports |
| | | /******/ // This entry module depends on other loaded chunks and execution need to be delayed |
| | | /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["forms/style-index"], () => (__webpack_require__("./src/forms/index.js"))) |
| | | /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); |
| | | /******/ |
| | | /******/ })() |
| | | ; |
| | | //# sourceMappingURL=index.js.map |
| | | (()=>{"use strict";var e,l={677(){const e=window.wp.blocks,l=window.wp.i18n,a=window.wp.blockEditor,t=window.wp.components,i=window.wp.element,s=window.ReactJSXRuntime;(0,e.registerBlockType)("jvb/forms",{edit:function({attributes:e,setAttributes:r}){const{formType:o,showLabels:b,customEmailTo:n,turnstileEnabled:d}=e,[v,c]=(0,i.useState)(!0),j=(0,a.useBlockProps)({className:"jvb-form-block "+(o?`jvb-form-block-${o}`:"")}),p="undefined"!=typeof window&&window.jvbFormsData&&window.jvbFormsData.formTypes?window.jvbFormsData.formTypes:[{label:(0,l.__)("Select a form type","jvb"),value:""},{label:(0,l.__)("No forms available","jvb"),value:"",disabled:!0}],u=(console.log(window.jvbFormsData),"undefined"!=typeof window&&window.jvbFormsData&&window.jvbFormsData.availableForms?window.jvbFormsData.availableForms:{}),m=(()=>{const e=o&&u[o]?u[o]:null;return e?{title:e.title||(0,l.__)("Form","jvb"),description:Array.isArray(e.description)?e.description.join(" "):e.description||"",button:e.submit||(0,l.__)("Submit","jvb")}:{title:(0,l.__)("Form","jvb"),description:o?(0,l.__)("Loading form configuration...","jvb"):(0,l.__)("Please select a form type in the sidebar","jvb"),button:(0,l.__)("Submit","jvb")}})();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(a.InspectorControls,{children:[(0,s.jsxs)(t.PanelBody,{title:(0,l.__)("Form Settings","jvb"),children:[(0,s.jsx)(t.SelectControl,{label:(0,l.__)("Form Type","jvb"),value:o,options:p,onChange:e=>r({formType:e})}),(0,s.jsx)(t.ToggleControl,{label:(0,l.__)("Show Field Labels","jvb"),checked:b,onChange:e=>r({showLabels:e}),help:(0,l.__)("Toggle to show or hide field labels.","jvb")}),(0,s.jsx)(t.TextControl,{label:(0,l.__)("Custom Recipient Email","jvb"),value:n||"",onChange:e=>r({customEmailTo:e}),help:(0,l.__)("Leave empty to use the default email.","jvb"),type:"email"})]}),(0,s.jsxs)(t.PanelBody,{title:(0,l.__)("Form Preview","jvb"),initialOpen:!1,children:[(0,s.jsx)(t.ToggleControl,{label:(0,l.__)("Show Preview","jvb"),checked:v,onChange:e=>c(e)}),(0,s.jsx)("p",{className:"components-base-control__help",children:(0,l.__)("This is just a preview. The actual form will be rendered on the frontend.","jvb")})]})]}),(0,s.jsx)("div",{...j,children:v?(()=>{if(!o)return(0,s.jsx)(t.Notice,{status:"warning",isDismissible:!1,children:(0,l.__)("Please select a form type in the block settings.","jvb")});let e=[];switch(o){case"contact":e=[{id:"name",label:(0,l.__)("Name","jvb"),type:"text",required:!0},{id:"email",label:(0,l.__)("Email","jvb"),type:"email",required:!0},{id:"phone",label:(0,l.__)("Phone","jvb"),type:"tel",required:!0},{id:"instagram",label:(0,l.__)("Instagram URL","jvb"),type:"url"},{id:"contact_methods",label:(0,l.__)("Preferred Contact","jvb"),type:"checkboxes",options:[{value:"text",label:(0,l.__)("Text","jvb")},{value:"call",label:(0,l.__)("Call","jvb")},{value:"email",label:(0,l.__)("Email","jvb")},{value:"instagram",label:(0,l.__)("Instagram","jvb")}]},{id:"message",label:(0,l.__)("Your Message","jvb"),type:"textarea",required:!0}];break;case"feature_request":e=[{id:"name",label:(0,l.__)("Name","jvb"),type:"text",help:(0,l.__)("Required if you want us to follow up.","jvb")},{id:"email",label:(0,l.__)("Email","jvb"),type:"email",help:(0,l.__)("Required if you want us to follow up.","jvb")},{id:"follow_up",label:(0,l.__)("Would you like me to follow up with you?","jvb"),type:"checkbox"},{id:"target_audience",label:(0,l.__)("This Feature is For","jvb"),type:"checkboxes",options:[{value:"artists",label:(0,l.__)("Artists","jvb")},{value:"visitors",label:(0,l.__)("Site Visitors","jvb")},{value:"partners",label:(0,l.__)("Partners","jvb")},{value:"other",label:(0,l.__)("Other","jvb")}]},{id:"feature_name",label:(0,l.__)("Name your Feature","jvb"),type:"text",required:!0},{id:"message",label:(0,l.__)("Describe Your Feature","jvb"),type:"textarea",required:!0}];break;case"technical_issue":e=[{id:"name",label:(0,l.__)("Name","jvb"),type:"text"},{id:"email",label:(0,l.__)("Email","jvb"),type:"email"},{id:"follow_up",label:(0,l.__)("Would you like me to follow up with you?","jvb"),type:"checkbox"},{id:"issue_type",label:(0,l.__)("Type of Issue","jvb"),type:"checkboxes",options:[{value:"visual",label:(0,l.__)("Visual","jvb")},{value:"error",label:(0,l.__)("Error Page","jvb")},{value:"other",label:(0,l.__)("Other","jvb")}]},{id:"message",label:(0,l.__)("Please describe the issue.","jvb"),type:"textarea",required:!0}]}return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h3",{className:"jvb-form-title",children:m.title}),(0,s.jsx)("p",{className:"jvb-form-description",children:m.description}),(0,s.jsxs)("div",{className:"jvb-form-preview",children:[e.map(e=>(0,s.jsxs)("div",{className:"jvb-form-field",children:[b&&(0,s.jsx)("label",{htmlFor:`jvb-${e.id}`,className:e.required?"required":"",children:e.label}),"text"===e.type&&(0,s.jsx)("input",{type:"text",id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0}),"email"===e.type&&(0,s.jsx)("input",{type:"email",id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0}),"tel"===e.type&&(0,s.jsx)("input",{type:"tel",id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0}),"url"===e.type&&(0,s.jsx)("input",{type:"url",id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0}),"textarea"===e.type&&(0,s.jsx)("textarea",{id:`jvb-${e.id}`,placeholder:b?"":e.label,disabled:!0,rows:"4"}),"checkbox"===e.type&&(0,s.jsxs)("div",{className:"jvb-form-checkbox",children:[(0,s.jsx)("input",{type:"checkbox",id:`jvb-${e.id}`,disabled:!0}),(0,s.jsx)("label",{htmlFor:`jvb-${e.id}`,children:e.label})]}),"checkboxes"===e.type&&e.options&&(0,s.jsx)("div",{className:"jvb-form-checkboxes",children:e.options.map(l=>(0,s.jsxs)("div",{className:"jvb-form-checkbox",children:[(0,s.jsx)("input",{type:"checkbox",id:`jvb-${e.id}-${l.value}`,disabled:!0}),(0,s.jsx)("label",{htmlFor:`jvb-${e.id}-${l.value}`,children:l.label})]},l.value))}),e.help&&(0,s.jsx)("p",{className:"jvb-form-help",children:e.help})]},e.id)),d&&(0,s.jsx)("div",{className:"jvb-form-turnstile",children:(0,s.jsx)("div",{className:"jvb-turnstile-placeholder",children:(0,s.jsx)("span",{children:(0,l.__)("Cloudflare Turnstile will appear here","jvb")})})}),(0,s.jsx)("div",{className:"jvb-form-submit",children:(0,s.jsx)("button",{type:"button",className:"jvb-form-button",children:m.button})})]})]})})():(0,s.jsxs)("div",{className:"jvb-form-placeholder",children:[(0,s.jsx)("h3",{children:m.title}),(0,s.jsx)("p",{children:(0,l.__)("Form preview is hidden. Edit settings in the sidebar.","jvb")})]})})]})},save:function(){return null}})}},a={};function t(e){var i=a[e];if(void 0!==i)return i.exports;var s=a[e]={exports:{}};return l[e](s,s.exports,t),s.exports}t.m=l,e=[],t.O=(l,a,i,s)=>{if(!a){var r=1/0;for(d=0;d<e.length;d++){for(var[a,i,s]=e[d],o=!0,b=0;b<a.length;b++)(!1&s||r>=s)&&Object.keys(t.O).every(e=>t.O[e](a[b]))?a.splice(b--,1):(o=!1,s<r&&(r=s));if(o){e.splice(d--,1);var n=i();void 0!==n&&(l=n)}}return l}s=s||0;for(var d=e.length;d>0&&e[d-1][2]>s;d--)e[d]=e[d-1];e[d]=[a,i,s]},t.o=(e,l)=>Object.prototype.hasOwnProperty.call(e,l),(()=>{var e={637:0,705:0};t.O.j=l=>0===e[l];var l=(l,a)=>{var i,s,[r,o,b]=a,n=0;if(r.some(l=>0!==e[l])){for(i in o)t.o(o,i)&&(t.m[i]=o[i]);if(b)var d=b(t)}for(l&&l(a);n<r.length;n++)s=r[n],t.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return t.O(d)},a=globalThis.webpackChunkjvb=globalThis.webpackChunkjvb||[];a.forEach(l.bind(null,0)),a.push=l.bind(null,a.push.bind(a))})();var i=t.O(void 0,[705],()=>t(677));i=t.O(i)})(); |
| | |
| | | /*!*********************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/forms/style.scss ***! |
| | | \*********************************************************************************************************************************************************************************************************************************************/ |
| | | |
| | |
| | | /*!*********************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/forms/style.scss ***! |
| | | \*********************************************************************************************************************************************************************************************************************************************/ |
| | | |
| | |
| | | <?php return array('dependencies' => array(), 'version' => '0d39a06fe13d4bdc84a0'); |
| | | <?php return array('dependencies' => array(), 'version' => 'bfff25a4ea4603e12189'); |
| | |
| | | /******/ (() => { // webpackBootstrap |
| | | /*!***************************!*\ |
| | | !*** ./src/forms/view.js ***! |
| | | \***************************/ |
| | | /** |
| | | * view.js |
| | | * Frontend JavaScript for the Form Block |
| | | * Handles form validation and submission |
| | | */ |
| | | /** |
| | | * view.js |
| | | * Frontend JavaScript for the Form Block |
| | | */ |
| | | class FormBlock { |
| | | constructor() { |
| | | this.controller = window.jvbForm; |
| | | document.querySelectorAll('.jvb-form-block form').forEach(form => { |
| | | this.controller.registerForm(form, { |
| | | cache: true, |
| | | autoUpload: false, |
| | | imageMeta: false |
| | | }); |
| | | }); |
| | | this.controller.subscribe((event, data) => { |
| | | if (event === 'form-submit') { |
| | | this.handleFormSubmission(data).then(() => {}); |
| | | } |
| | | }); |
| | | } |
| | | async handleFormSubmission(eventData) { |
| | | const { |
| | | config, |
| | | data |
| | | } = eventData; |
| | | const form = config.element; |
| | | const submitData = new FormData(); |
| | | |
| | | // Add regular form fields |
| | | for (const [key, value] of Object.entries(data)) { |
| | | if (Array.isArray(value)) { |
| | | value.forEach(v => submitData.append(`${key}[]`, v)); |
| | | } else if (typeof value === 'object' && value !== null) { |
| | | submitData.append(key, JSON.stringify(value)); |
| | | } else { |
| | | submitData.append(key, value); |
| | | } |
| | | } |
| | | config.element.querySelectorAll('[name="form_id"],[name="form_type"],[name="timestamp"],[name="cf-turnstile-response"]').forEach(input => { |
| | | submitData.append(input.name, input.value); |
| | | }); |
| | | |
| | | // Add uploaded files |
| | | if (window.jvbUploads) { |
| | | try { |
| | | const files = await window.jvbUploads.getFilesForForm(form); |
| | | files.forEach(({ |
| | | file, |
| | | fieldName |
| | | }) => { |
| | | submitData.append(`${fieldName}[]`, file); |
| | | }); |
| | | } catch (error) { |
| | | console.error('Error getting files:', error); |
| | | } |
| | | } |
| | | this.controller.showFormStatus(config.id, 'uploading'); |
| | | try { |
| | | const response = await fetch(`${jvbSettings.api}forms`, { |
| | | method: 'POST', |
| | | credentials: 'same-origin', |
| | | body: submitData |
| | | }); |
| | | const result = await response.json(); |
| | | if (!response.ok) { |
| | | this.controller.showFormStatus(config.id, 'error'); |
| | | this.controller.handleFormError(form, result); |
| | | return; |
| | | } |
| | | this.controller.showFormStatus(config.id, 'submitted'); |
| | | // this.controller.handleFormSuccess(form, result); |
| | | this.controller.showSummary({ |
| | | changes: data, |
| | | config: config |
| | | }); |
| | | window.jvbA11y.announce('Form successfully submitted!'); |
| | | |
| | | // Clean up uploaded files |
| | | if (window.jvbUploads) { |
| | | const uploadFields = form.querySelectorAll('[data-upload-field]'); |
| | | for (const field of uploadFields) { |
| | | const fieldId = window.jvbUploads.determineFieldId(field); |
| | | await window.jvbUploads.clearFieldFromStores(fieldId); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | console.error('Form submission error:', error); |
| | | this.controller.showFormStatus(config.id, 'error'); |
| | | this.controller.handleFormError(form, { |
| | | message: 'Network error. Please check your connection and try again.', |
| | | code: 'network_error' |
| | | }); |
| | | } finally { |
| | | await this.controller.store.delete(config.id); |
| | | } |
| | | } |
| | | } |
| | | document.addEventListener('DOMContentLoaded', async function () { |
| | | window.auth.subscribe(event => { |
| | | if (event === 'auth-loaded') { |
| | | new FormBlock(); |
| | | } |
| | | }); |
| | | }); |
| | | /******/ })() |
| | | ; |
| | | //# sourceMappingURL=view.js.map |
| | | (()=>{class o{constructor(){this.controller=window.jvbForm,document.querySelectorAll(".jvb-form-block form").forEach(o=>{this.controller.registerForm(o,{cache:!0,autoUpload:!1,imageMeta:!1})}),this.controller.subscribe((o,e)=>{"form-submit"===o&&this.handleFormSubmission(e).then(()=>{})})}async handleFormSubmission(o){const{config:e,data:r}=o,t=e.element,n=new FormData;for(const[o,e]of Object.entries(r))Array.isArray(e)?e.forEach(e=>n.append(`${o}[]`,e)):"object"==typeof e&&null!==e?n.append(o,JSON.stringify(e)):n.append(o,e);if(e.element.querySelectorAll('[name="form_id"],[name="form_type"],[name="timestamp"],[name="cf-turnstile-response"]').forEach(o=>{n.append(o.name,o.value)}),window.jvbUploads)try{(await window.jvbUploads.getFilesForForm(t)).forEach(({file:o,fieldName:e})=>{n.append(`${e}[]`,o)})}catch(o){console.error("Error getting files:",o)}this.controller.showFormStatus(e.id,"uploading");try{const o=await fetch(`${jvbSettings.api}forms`,{method:"POST",credentials:"same-origin",body:n}),a=await o.json();if(!o.ok)return this.controller.showFormStatus(e.id,"error"),void this.controller.handleFormError(t,a);if(this.controller.showFormStatus(e.id,"submitted"),this.controller.showSummary({changes:r,config:e}),window.jvbA11y.announce("Form successfully submitted!"),window.jvbUploads){const o=t.querySelectorAll("[data-upload-field]");for(const e of o){const o=window.jvbUploads.determineFieldId(e);await window.jvbUploads.clearFieldFromStores(o)}}}catch(o){console.error("Form submission error:",o),this.controller.showFormStatus(e.id,"error"),this.controller.handleFormError(t,{message:"Network error. Please check your connection and try again.",code:"network_error"})}finally{await this.controller.store.delete(e.id)}}}document.addEventListener("DOMContentLoaded",async function(){window.auth.subscribe(e=>{"auth-loaded"===e&&new o})})})(); |
| | |
| | | /*!*************************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/glossary/editor.scss ***! |
| | | \*************************************************************************************************************************************************************************************************************************************************/ |
| | | |
| | |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => '79ce82491ba71adc10c3'); |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => '809c5c76c0c41769d801'); |
| | |
| | | /*!*************************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/glossary/editor.scss ***! |
| | | \*************************************************************************************************************************************************************************************************************************************************/ |
| | | |
| | |
| | | /******/ (() => { // webpackBootstrap |
| | | /******/ "use strict"; |
| | | /******/ var __webpack_modules__ = ({ |
| | | |
| | | /***/ "./src/glossary/edit.js" |
| | | /*!******************************!*\ |
| | | !*** ./src/glossary/edit.js ***! |
| | | \******************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| | | /* harmony export */ "default": () => (/* binding */ Edit) |
| | | /* harmony export */ }); |
| | | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| | | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); |
| | | /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/glossary/editor.scss"); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__); |
| | | /** |
| | | * Retrieves the translation of text. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/ |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * React hook that is used to mark the block wrapper element. |
| | | * It provides all the necessary props like the class name. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. |
| | | * Those files can contain any CSS code that gets applied to the editor. |
| | | * |
| | | * @see https://www.npmjs.com/package/@wordpress/scripts#using-css |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * The edit function describes the structure of your block in the context of the |
| | | * editor. This represents what the editor will render when the block is used. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit |
| | | * |
| | | * @return {Element} Element to render. |
| | | */ |
| | | |
| | | function Edit() { |
| | | return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", { |
| | | ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)(), |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Will output the glossary', 'jvb') |
| | | }); |
| | | } |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/glossary/index.js" |
| | | /*!*******************************!*\ |
| | | !*** ./src/glossary/index.js ***! |
| | | \*******************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/glossary/style.scss"); |
| | | /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/glossary/edit.js"); |
| | | /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block.json */ "./src/glossary/block.json"); |
| | | /** |
| | | * Registers a new block provided a unique name and an object defining its behavior. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. |
| | | * All files containing `style` keyword are bundled together. The code used |
| | | * gets applied both to the front of your site and to the editor. |
| | | * |
| | | * @see https://www.npmjs.com/package/@wordpress/scripts#using-css |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * Internal dependencies |
| | | */ |
| | | |
| | | |
| | | |
| | | /** |
| | | * Every block starts by registering a new block type definition. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ |
| | | */ |
| | | (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_3__.name, { |
| | | /** |
| | | * @see ./edit.js |
| | | */ |
| | | edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"] |
| | | }); |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/glossary/editor.scss" |
| | | /*!**********************************!*\ |
| | | !*** ./src/glossary/editor.scss ***! |
| | | \**********************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | // extracted by mini-css-extract-plugin |
| | | |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/glossary/style.scss" |
| | | /*!*********************************!*\ |
| | | !*** ./src/glossary/style.scss ***! |
| | | \*********************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | // extracted by mini-css-extract-plugin |
| | | |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "react/jsx-runtime" |
| | | /*!**********************************!*\ |
| | | !*** external "ReactJSXRuntime" ***! |
| | | \**********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["ReactJSXRuntime"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/block-editor" |
| | | /*!*************************************!*\ |
| | | !*** external ["wp","blockEditor"] ***! |
| | | \*************************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blockEditor"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/blocks" |
| | | /*!********************************!*\ |
| | | !*** external ["wp","blocks"] ***! |
| | | \********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blocks"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/i18n" |
| | | /*!******************************!*\ |
| | | !*** external ["wp","i18n"] ***! |
| | | \******************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["i18n"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/glossary/block.json" |
| | | /*!*********************************!*\ |
| | | !*** ./src/glossary/block.json ***! |
| | | \*********************************/ |
| | | (module) { |
| | | |
| | | module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"jvb/glossary","version":"0.1.0","title":"Glossary of Terms","category":"jvb","icon":"excerpt-view","description":"Outputs the terms","example":{},"supports":{"html":false,"align":["wide","full"]},"textdomain":"jvb","selectors":{"root":".glossary"},"editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","viewScript":"file:./view.js"}'); |
| | | |
| | | /***/ } |
| | | |
| | | /******/ }); |
| | | /************************************************************************/ |
| | | /******/ // The module cache |
| | | /******/ var __webpack_module_cache__ = {}; |
| | | /******/ |
| | | /******/ // The require function |
| | | /******/ function __webpack_require__(moduleId) { |
| | | /******/ // Check if module is in cache |
| | | /******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| | | /******/ if (cachedModule !== undefined) { |
| | | /******/ return cachedModule.exports; |
| | | /******/ } |
| | | /******/ // Create a new module (and put it into the cache) |
| | | /******/ var module = __webpack_module_cache__[moduleId] = { |
| | | /******/ // no module.id needed |
| | | /******/ // no module.loaded needed |
| | | /******/ exports: {} |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // Execute the module function |
| | | /******/ if (!(moduleId in __webpack_modules__)) { |
| | | /******/ delete __webpack_module_cache__[moduleId]; |
| | | /******/ var e = new Error("Cannot find module '" + moduleId + "'"); |
| | | /******/ e.code = 'MODULE_NOT_FOUND'; |
| | | /******/ throw e; |
| | | /******/ } |
| | | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| | | /******/ |
| | | /******/ // Return the exports of the module |
| | | /******/ return module.exports; |
| | | /******/ } |
| | | /******/ |
| | | /******/ // expose the modules object (__webpack_modules__) |
| | | /******/ __webpack_require__.m = __webpack_modules__; |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ /* webpack/runtime/chunk loaded */ |
| | | /******/ (() => { |
| | | /******/ var deferred = []; |
| | | /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { |
| | | /******/ if(chunkIds) { |
| | | /******/ priority = priority || 0; |
| | | /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; |
| | | /******/ deferred[i] = [chunkIds, fn, priority]; |
| | | /******/ return; |
| | | /******/ } |
| | | /******/ var notFulfilled = Infinity; |
| | | /******/ for (var i = 0; i < deferred.length; i++) { |
| | | /******/ var [chunkIds, fn, priority] = deferred[i]; |
| | | /******/ var fulfilled = true; |
| | | /******/ for (var j = 0; j < chunkIds.length; j++) { |
| | | /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { |
| | | /******/ chunkIds.splice(j--, 1); |
| | | /******/ } else { |
| | | /******/ fulfilled = false; |
| | | /******/ if(priority < notFulfilled) notFulfilled = priority; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(fulfilled) { |
| | | /******/ deferred.splice(i--, 1) |
| | | /******/ var r = fn(); |
| | | /******/ if (r !== undefined) result = r; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ return result; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/compat get default export */ |
| | | /******/ (() => { |
| | | /******/ // getDefaultExport function for compatibility with non-harmony modules |
| | | /******/ __webpack_require__.n = (module) => { |
| | | /******/ var getter = module && module.__esModule ? |
| | | /******/ () => (module['default']) : |
| | | /******/ () => (module); |
| | | /******/ __webpack_require__.d(getter, { a: getter }); |
| | | /******/ return getter; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/define property getters */ |
| | | /******/ (() => { |
| | | /******/ // define getter functions for harmony exports |
| | | /******/ __webpack_require__.d = (exports, definition) => { |
| | | /******/ for(var key in definition) { |
| | | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| | | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| | | /******/ } |
| | | /******/ } |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| | | /******/ (() => { |
| | | /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/make namespace object */ |
| | | /******/ (() => { |
| | | /******/ // define __esModule on exports |
| | | /******/ __webpack_require__.r = (exports) => { |
| | | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
| | | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| | | /******/ } |
| | | /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/jsonp chunk loading */ |
| | | /******/ (() => { |
| | | /******/ // no baseURI |
| | | /******/ |
| | | /******/ // object to store loaded and loading chunks |
| | | /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched |
| | | /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded |
| | | /******/ var installedChunks = { |
| | | /******/ "glossary/index": 0, |
| | | /******/ "glossary/style-index": 0 |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // no chunk on demand loading |
| | | /******/ |
| | | /******/ // no prefetching |
| | | /******/ |
| | | /******/ // no preloaded |
| | | /******/ |
| | | /******/ // no HMR |
| | | /******/ |
| | | /******/ // no HMR manifest |
| | | /******/ |
| | | /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); |
| | | /******/ |
| | | /******/ // install a JSONP callback for chunk loading |
| | | /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { |
| | | /******/ var [chunkIds, moreModules, runtime] = data; |
| | | /******/ // add "moreModules" to the modules object, |
| | | /******/ // then flag all "chunkIds" as loaded and fire callback |
| | | /******/ var moduleId, chunkId, i = 0; |
| | | /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { |
| | | /******/ for(moduleId in moreModules) { |
| | | /******/ if(__webpack_require__.o(moreModules, moduleId)) { |
| | | /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(runtime) var result = runtime(__webpack_require__); |
| | | /******/ } |
| | | /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); |
| | | /******/ for(;i < chunkIds.length; i++) { |
| | | /******/ chunkId = chunkIds[i]; |
| | | /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { |
| | | /******/ installedChunks[chunkId][0](); |
| | | /******/ } |
| | | /******/ installedChunks[chunkId] = 0; |
| | | /******/ } |
| | | /******/ return __webpack_require__.O(result); |
| | | /******/ } |
| | | /******/ |
| | | /******/ var chunkLoadingGlobal = globalThis["webpackChunkjvb"] = globalThis["webpackChunkjvb"] || []; |
| | | /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); |
| | | /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); |
| | | /******/ })(); |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ |
| | | /******/ // startup |
| | | /******/ // Load entry module and return exports |
| | | /******/ // This entry module depends on other loaded chunks and execution need to be delayed |
| | | /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["glossary/style-index"], () => (__webpack_require__("./src/glossary/index.js"))) |
| | | /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); |
| | | /******/ |
| | | /******/ })() |
| | | ; |
| | | //# sourceMappingURL=index.js.map |
| | | (()=>{"use strict";var r,o={359(){const r=window.wp.blocks,o=window.wp.i18n,e=window.wp.blockEditor,t=window.ReactJSXRuntime,i=JSON.parse('{"UU":"jvb/glossary"}');(0,r.registerBlockType)(i.UU,{edit:function(){return(0,t.jsx)("p",{...(0,e.useBlockProps)(),children:(0,o.__)("Will output the glossary","jvb")})}})}},e={};function t(r){var i=e[r];if(void 0!==i)return i.exports;var n=e[r]={exports:{}};return o[r](n,n.exports,t),n.exports}t.m=o,r=[],t.O=(o,e,i,n)=>{if(!e){var s=1/0;for(v=0;v<r.length;v++){for(var[e,i,n]=r[v],l=!0,a=0;a<e.length;a++)(!1&n||s>=n)&&Object.keys(t.O).every(r=>t.O[r](e[a]))?e.splice(a--,1):(l=!1,n<s&&(s=n));if(l){r.splice(v--,1);var p=i();void 0!==p&&(o=p)}}return o}n=n||0;for(var v=r.length;v>0&&r[v-1][2]>n;v--)r[v]=r[v-1];r[v]=[e,i,n]},t.o=(r,o)=>Object.prototype.hasOwnProperty.call(r,o),(()=>{var r={342:0,642:0};t.O.j=o=>0===r[o];var o=(o,e)=>{var i,n,[s,l,a]=e,p=0;if(s.some(o=>0!==r[o])){for(i in l)t.o(l,i)&&(t.m[i]=l[i]);if(a)var v=a(t)}for(o&&o(e);p<s.length;p++)n=s[p],t.o(r,n)&&r[n]&&r[n][0](),r[n]=0;return t.O(v)},e=globalThis.webpackChunkjvb=globalThis.webpackChunkjvb||[];e.forEach(o.bind(null,0)),e.push=o.bind(null,e.push.bind(e))})();var i=t.O(void 0,[642],()=>t(359));i=t.O(i)})(); |
| | |
| | | /*!************************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/glossary/style.scss ***! |
| | | \************************************************************************************************************************************************************************************************************************************************/ |
| | | :root { |
| | | --navWidth: 40vw; |
| | | } |
| | | @media (min-width: 768px) { |
| | | :root { |
| | | --navWidth: 22vw; |
| | | } |
| | | } |
| | | nav.glossary-index { |
| | | position: fixed; |
| | | top: 50%; |
| | | transform: translateY(-50%); |
| | | width: var(--navWidth); |
| | | left: -8px; |
| | | height: 60vh; |
| | | z-index: var(--z-3); |
| | | } |
| | | nav.glossary-index > ul { |
| | | --dir: column; |
| | | --align: flex-start; |
| | | --justify: flex-start; |
| | | --gap: 1px; |
| | | touch-action: pan-y; |
| | | max-height: 100%; |
| | | height: 100%; |
| | | width: 100%; |
| | | overflow: hidden auto; |
| | | scroll-behavior: smooth; |
| | | } |
| | | nav.glossary-index li, nav.glossary-index a { |
| | | flex: 1; |
| | | width: 100%; |
| | | height: -moz-max-content; |
| | | height: max-content; |
| | | min-height: max(var(--chipchip), -moz-max-content); |
| | | min-height: max(var(--chipchip), max-content); |
| | | } |
| | | nav.glossary-index a { |
| | | --justify: center; |
| | | padding: 0.25rem 0.5rem; |
| | | hyphens: auto; |
| | | background-color: rgba(var(--base), var(--op-45)); |
| | | word-wrap: anywhere; |
| | | white-space: wrap; |
| | | } |
| | | nav.glossary-index a:hover, |
| | | nav.glossary-index a:focus, |
| | | nav.glossary-index a.active { |
| | | background-color: rgba(var(--action-0), var(--op-6)); |
| | | color: var(--action-contrast); |
| | | } |
| | | .glossary dd { |
| | | margin-right: 0.5rem; |
| | | width: calc(100% + 0.75rem); |
| | | } |
| | | .glossary dd, |
| | | .glossary dt { |
| | | position: relative; |
| | | right: 0; |
| | | transition: margin var(--trans-base), right var(--trans-base), width var(--trans-base); |
| | | } |
| | | .glossary dt:target, |
| | | .glossary dt.active { |
| | | outline: none; |
| | | right: -1.5rem; |
| | | padding: 0; |
| | | color: rgb(var(--action-0)); |
| | | } |
| | | .glossary dt:target + dd, |
| | | .glossary dt.active + dd { |
| | | right: -1.5rem; |
| | | } |
| | | main header, |
| | | dl.glossary { |
| | | grid-column: full; |
| | | padding: 0 2rem 0 var(--navWidth); |
| | | } |
| | | @media (min-width: 768px) { |
| | | main header, |
| | | dl.glossary { |
| | | margin-right: auto; |
| | | max-width: var(--content); |
| | | margin-left: var(--navWidth); |
| | | padding-left: var(--btn); |
| | | } |
| | | } |
| | | @media (max-width: 768px) { |
| | | .glossary h2 { |
| | | font-size: var(--txt-medium); |
| | | } |
| | | .glossary p { |
| | | font-size: var(--txt-x-small); |
| | | } |
| | | .glossary-index li, .glossary-index a { |
| | | height: -moz-fit-content; |
| | | height: fit-content; |
| | | } |
| | | .glossary-index a { |
| | | font-size: var(--txt-x-small); |
| | | padding: 0.25rem; |
| | | min-height: 2em; |
| | | } |
| | | body:has(.glossary) h1 { |
| | | font-size: var(--txt-xx-large); |
| | | } |
| | | } |
| | | :root{--navWidth:40vw}@media(min-width:768px){:root{--navWidth:22vw}}nav.glossary-index{height:60vh;position:fixed;left:-8px;top:50%;transform:translateY(-50%);width:var(--navWidth);z-index:var(--z-3)}nav.glossary-index>ul{--dir:column;--align:flex-start;--justify:flex-start;--gap:1px;height:100%;max-height:100%;overflow:hidden auto;scroll-behavior:smooth;touch-action:pan-y;width:100%}nav.glossary-index a,nav.glossary-index li{flex:1;height:-moz-max-content;height:max-content;min-height:max(var(--chipchip),-moz-max-content);min-height:max(var(--chipchip),max-content);width:100%}nav.glossary-index a{--justify:center;background-color:rgba(var(--base),var(--op-45));hyphens:auto;padding:.25rem .5rem;word-wrap:anywhere;white-space:wrap}nav.glossary-index a.active,nav.glossary-index a:focus,nav.glossary-index a:hover{background-color:rgba(var(--action-0),var(--op-6));color:var(--action-contrast)}.glossary dd{margin-right:.5rem;width:calc(100% + .75rem)}.glossary dd,.glossary dt{right:0;position:relative;transition:margin var(--trans-base),right var(--trans-base),width var(--trans-base)}.glossary dt.active,.glossary dt:target{color:rgb(var(--action-0));right:-1.5rem;outline:none;padding:0}.glossary dt.active+dd,.glossary dt:target+dd{right:-1.5rem}dl.glossary,main header{grid-column:full;padding:0 2rem 0 var(--navWidth)}@media(min-width:768px){dl.glossary,main header{margin-right:auto;margin-left:var(--navWidth);max-width:var(--content);padding-left:var(--btn)}}@media(max-width:768px){.glossary h2{font-size:var(--txt-medium)}.glossary p{font-size:var(--txt-x-small)}.glossary-index a,.glossary-index li{height:-moz-fit-content;height:fit-content}.glossary-index a{font-size:var(--txt-x-small);min-height:2em;padding:.25rem}body:has(.glossary) h1{font-size:var(--txt-xx-large)}} |
| | |
| | | /*!************************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/glossary/style.scss ***! |
| | | \************************************************************************************************************************************************************************************************************************************************/ |
| | | :root { |
| | | --navWidth: 40vw; |
| | | } |
| | | @media (min-width: 768px) { |
| | | :root { |
| | | --navWidth: 22vw; |
| | | } |
| | | } |
| | | nav.glossary-index { |
| | | position: fixed; |
| | | top: 50%; |
| | | transform: translateY(-50%); |
| | | width: var(--navWidth); |
| | | right: -8px; |
| | | height: 60vh; |
| | | z-index: var(--z-3); |
| | | } |
| | | nav.glossary-index > ul { |
| | | --dir: column; |
| | | --align: flex-start; |
| | | --justify: flex-start; |
| | | --gap: 1px; |
| | | touch-action: pan-y; |
| | | max-height: 100%; |
| | | height: 100%; |
| | | width: 100%; |
| | | overflow: hidden auto; |
| | | scroll-behavior: smooth; |
| | | } |
| | | nav.glossary-index li, nav.glossary-index a { |
| | | flex: 1; |
| | | width: 100%; |
| | | height: -moz-max-content; |
| | | height: max-content; |
| | | min-height: max(var(--chipchip), -moz-max-content); |
| | | min-height: max(var(--chipchip), max-content); |
| | | } |
| | | nav.glossary-index a { |
| | | --justify: center; |
| | | padding: 0.25rem 0.5rem; |
| | | hyphens: auto; |
| | | background-color: rgba(var(--base), var(--op-45)); |
| | | word-wrap: anywhere; |
| | | white-space: wrap; |
| | | } |
| | | nav.glossary-index a:hover, |
| | | nav.glossary-index a:focus, |
| | | nav.glossary-index a.active { |
| | | background-color: rgba(var(--action-0), var(--op-6)); |
| | | color: var(--action-contrast); |
| | | } |
| | | .glossary dd { |
| | | margin-left: 0.5rem; |
| | | width: calc(100% + 0.75rem); |
| | | } |
| | | .glossary dd, |
| | | .glossary dt { |
| | | position: relative; |
| | | left: 0; |
| | | transition: margin var(--trans-base), left var(--trans-base), width var(--trans-base); |
| | | } |
| | | .glossary dt:target, |
| | | .glossary dt.active { |
| | | outline: none; |
| | | left: -1.5rem; |
| | | padding: 0; |
| | | color: rgb(var(--action-0)); |
| | | } |
| | | .glossary dt:target + dd, |
| | | .glossary dt.active + dd { |
| | | left: -1.5rem; |
| | | } |
| | | main header, |
| | | dl.glossary { |
| | | grid-column: full; |
| | | padding: 0 var(--navWidth) 0 2rem; |
| | | } |
| | | @media (min-width: 768px) { |
| | | main header, |
| | | dl.glossary { |
| | | margin-left: auto; |
| | | max-width: var(--content); |
| | | margin-right: var(--navWidth); |
| | | padding-right: var(--btn); |
| | | } |
| | | } |
| | | @media (max-width: 768px) { |
| | | .glossary h2 { |
| | | font-size: var(--txt-medium); |
| | | } |
| | | .glossary p { |
| | | font-size: var(--txt-x-small); |
| | | } |
| | | .glossary-index li, .glossary-index a { |
| | | height: -moz-fit-content; |
| | | height: fit-content; |
| | | } |
| | | .glossary-index a { |
| | | font-size: var(--txt-x-small); |
| | | padding: 0.25rem; |
| | | min-height: 2em; |
| | | } |
| | | body:has(.glossary) h1 { |
| | | font-size: var(--txt-xx-large); |
| | | } |
| | | } |
| | | |
| | | /*# sourceMappingURL=style-index.css.map*/ |
| | | :root{--navWidth:40vw}@media(min-width:768px){:root{--navWidth:22vw}}nav.glossary-index{height:60vh;position:fixed;right:-8px;top:50%;transform:translateY(-50%);width:var(--navWidth);z-index:var(--z-3)}nav.glossary-index>ul{--dir:column;--align:flex-start;--justify:flex-start;--gap:1px;height:100%;max-height:100%;overflow:hidden auto;scroll-behavior:smooth;touch-action:pan-y;width:100%}nav.glossary-index a,nav.glossary-index li{flex:1;height:-moz-max-content;height:max-content;min-height:max(var(--chipchip),-moz-max-content);min-height:max(var(--chipchip),max-content);width:100%}nav.glossary-index a{--justify:center;background-color:rgba(var(--base),var(--op-45));hyphens:auto;padding:.25rem .5rem;word-wrap:anywhere;white-space:wrap}nav.glossary-index a.active,nav.glossary-index a:focus,nav.glossary-index a:hover{background-color:rgba(var(--action-0),var(--op-6));color:var(--action-contrast)}.glossary dd{margin-left:.5rem;width:calc(100% + .75rem)}.glossary dd,.glossary dt{left:0;position:relative;transition:margin var(--trans-base),left var(--trans-base),width var(--trans-base)}.glossary dt.active,.glossary dt:target{color:rgb(var(--action-0));left:-1.5rem;outline:none;padding:0}.glossary dt.active+dd,.glossary dt:target+dd{left:-1.5rem}dl.glossary,main header{grid-column:full;padding:0 var(--navWidth) 0 2rem}@media(min-width:768px){dl.glossary,main header{margin-left:auto;margin-right:var(--navWidth);max-width:var(--content);padding-right:var(--btn)}}@media(max-width:768px){.glossary h2{font-size:var(--txt-medium)}.glossary p{font-size:var(--txt-x-small)}.glossary-index a,.glossary-index li{height:-moz-fit-content;height:fit-content}.glossary-index a{font-size:var(--txt-x-small);min-height:2em;padding:.25rem}body:has(.glossary) h1{font-size:var(--txt-xx-large)}} |
| | |
| | | <?php return array('dependencies' => array(), 'version' => 'e30b748c75ec41be86b1'); |
| | | <?php return array('dependencies' => array(), 'version' => '01134b86c4f4fc8a5f6e'); |
| | |
| | | /******/ (() => { // webpackBootstrap |
| | | /*!******************************!*\ |
| | | !*** ./src/glossary/view.js ***! |
| | | \******************************/ |
| | | /** |
| | | * Glossary Navigation Active State Manager |
| | | * Handles highlighting active terms as they scroll into view |
| | | * and syncing navigation with scroll position |
| | | */ |
| | | class GlossaryNavigator { |
| | | constructor(glossarySelector = 'dl.glossary', navSelector = 'nav.glossary-index') { |
| | | this.glossary = document.querySelector(glossarySelector); |
| | | this.nav = document.querySelector(navSelector); |
| | | if (!this.glossary || !this.nav) return; |
| | | this.terms = this.glossary.querySelectorAll('dt[id]'); |
| | | this.navList = this.nav.querySelector('ul'); |
| | | this.activeClass = 'active'; |
| | | this.currentActive = null; |
| | | this.init(); |
| | | this.setupResizeHandler(); |
| | | } |
| | | init() { |
| | | // Set up Intersection Observer with screen-size appropriate margins |
| | | const observerOptions = { |
| | | root: null, |
| | | // viewport |
| | | rootMargin: this.getRootMargin(), |
| | | threshold: 0 |
| | | }; |
| | | this.observer = new IntersectionObserver(entries => this.handleIntersection(entries), observerOptions); |
| | | |
| | | // Observe all terms |
| | | this.terms.forEach(term => this.observer.observe(term)); |
| | | |
| | | // Also handle manual scroll for edge cases |
| | | this.handleScroll = this.debounce(() => this.checkActiveTerm(), 100); |
| | | window.addEventListener('scroll', this.handleScroll, { |
| | | passive: true |
| | | }); |
| | | } |
| | | getRootMargin() { |
| | | // On larger screens: centered (50% from top and bottom) |
| | | return '-50% 0px -50% 0px'; |
| | | } |
| | | setupResizeHandler() { |
| | | let resizeTimer; |
| | | window.addEventListener('resize', () => { |
| | | clearTimeout(resizeTimer); |
| | | resizeTimer = setTimeout(() => { |
| | | // Reinitialize observer with new margins on resize |
| | | this.reinitialize(); |
| | | }, 250); |
| | | }); |
| | | } |
| | | reinitialize() { |
| | | // Disconnect old observer |
| | | if (this.observer) { |
| | | this.observer.disconnect(); |
| | | } |
| | | |
| | | // Create new observer with updated margins |
| | | this.init(); |
| | | } |
| | | handleIntersection(entries) { |
| | | // Find the entry that's intersecting |
| | | const intersecting = entries.find(entry => entry.isIntersecting); |
| | | if (intersecting) { |
| | | this.setActive(intersecting.target); |
| | | } |
| | | } |
| | | checkActiveTerm() { |
| | | // Fallback method to find which term is in the trigger zone |
| | | const remInPixels = parseFloat(getComputedStyle(document.documentElement).fontSize); |
| | | const margin = remInPixels * 4; |
| | | let closestTerm = null; |
| | | let closestDistance = Infinity; |
| | | this.terms.forEach(term => { |
| | | const rect = term.getBoundingClientRect(); |
| | | const isInZone = rect.top + rect.height / 2 >= 0 && rect.top + rect.height / 2 <= window.innerHeight; |
| | | if (isInZone) { |
| | | // Find closest to the trigger point |
| | | const triggerPoint = window.innerHeight / 2; |
| | | const distance = Math.abs(rect.top - triggerPoint); |
| | | if (distance < closestDistance) { |
| | | closestDistance = distance; |
| | | closestTerm = term; |
| | | } |
| | | } |
| | | }); |
| | | if (closestTerm) { |
| | | this.setActive(closestTerm); |
| | | } |
| | | } |
| | | setActive(term) { |
| | | if (this.currentActive === term) return; |
| | | |
| | | // Remove active class from previous term |
| | | if (this.currentActive) { |
| | | this.currentActive.classList.remove(this.activeClass); |
| | | } |
| | | |
| | | // Add active class to current term |
| | | term.classList.add(this.activeClass); |
| | | this.currentActive = term; |
| | | |
| | | // Update navigation |
| | | this.updateNavigation(term.id); |
| | | } |
| | | updateNavigation(termId) { |
| | | // Remove active from all nav links |
| | | const navLinks = this.nav.querySelectorAll('a'); |
| | | navLinks.forEach(link => link.classList.remove(this.activeClass)); |
| | | |
| | | // Find and activate corresponding nav link |
| | | const activeLink = this.nav.querySelector(`a[href="#${termId}"]`); |
| | | if (activeLink) { |
| | | activeLink.classList.add(this.activeClass); |
| | | |
| | | // Scroll the nav list to center the active link |
| | | this.centerNavItem(activeLink); |
| | | } |
| | | } |
| | | centerNavItem(link) { |
| | | const listRect = this.navList.getBoundingClientRect(); |
| | | const linkRect = link.getBoundingClientRect(); |
| | | |
| | | // Calculate position to center the link in the nav container |
| | | const scrollTop = this.navList.scrollTop; |
| | | const linkOffset = linkRect.top - listRect.top; |
| | | const centerOffset = listRect.height / 2 - linkRect.height / 2; |
| | | this.navList.scrollTo({ |
| | | top: scrollTop + linkOffset - centerOffset, |
| | | behavior: 'smooth' |
| | | }); |
| | | } |
| | | debounce(func, wait) { |
| | | let timeout; |
| | | return function executedFunction(...args) { |
| | | const later = () => { |
| | | clearTimeout(timeout); |
| | | func(...args); |
| | | }; |
| | | clearTimeout(timeout); |
| | | timeout = setTimeout(later, wait); |
| | | }; |
| | | } |
| | | destroy() { |
| | | if (this.observer) { |
| | | this.observer.disconnect(); |
| | | } |
| | | window.removeEventListener('scroll', this.handleScroll); |
| | | } |
| | | } |
| | | |
| | | // Initialize when DOM is ready |
| | | if (document.readyState === 'loading') { |
| | | document.addEventListener('DOMContentLoaded', () => { |
| | | new GlossaryNavigator(); |
| | | }); |
| | | } else { |
| | | new GlossaryNavigator(); |
| | | } |
| | | /******/ })() |
| | | ; |
| | | //# sourceMappingURL=view.js.map |
| | | (()=>{class t{constructor(t="dl.glossary",e="nav.glossary-index"){this.glossary=document.querySelector(t),this.nav=document.querySelector(e),this.glossary&&this.nav&&(this.terms=this.glossary.querySelectorAll("dt[id]"),this.navList=this.nav.querySelector("ul"),this.activeClass="active",this.currentActive=null,this.init(),this.setupResizeHandler())}init(){const t={root:null,rootMargin:this.getRootMargin(),threshold:0};this.observer=new IntersectionObserver(t=>this.handleIntersection(t),t),this.terms.forEach(t=>this.observer.observe(t)),this.handleScroll=this.debounce(()=>this.checkActiveTerm(),100),window.addEventListener("scroll",this.handleScroll,{passive:!0})}getRootMargin(){return"-50% 0px -50% 0px"}setupResizeHandler(){let t;window.addEventListener("resize",()=>{clearTimeout(t),t=setTimeout(()=>{this.reinitialize()},250)})}reinitialize(){this.observer&&this.observer.disconnect(),this.init()}handleIntersection(t){const e=t.find(t=>t.isIntersecting);e&&this.setActive(e.target)}checkActiveTerm(){parseFloat(getComputedStyle(document.documentElement).fontSize);let t=null,e=1/0;this.terms.forEach(i=>{const s=i.getBoundingClientRect();if(s.top+s.height/2>=0&&s.top+s.height/2<=window.innerHeight){const n=window.innerHeight/2,r=Math.abs(s.top-n);r<e&&(e=r,t=i)}}),t&&this.setActive(t)}setActive(t){this.currentActive!==t&&(this.currentActive&&this.currentActive.classList.remove(this.activeClass),t.classList.add(this.activeClass),this.currentActive=t,this.updateNavigation(t.id))}updateNavigation(t){this.nav.querySelectorAll("a").forEach(t=>t.classList.remove(this.activeClass));const e=this.nav.querySelector(`a[href="#${t}"]`);e&&(e.classList.add(this.activeClass),this.centerNavItem(e))}centerNavItem(t){const e=this.navList.getBoundingClientRect(),i=t.getBoundingClientRect(),s=this.navList.scrollTop,n=i.top-e.top,r=e.height/2-i.height/2;this.navList.scrollTo({top:s+n-r,behavior:"smooth"})}debounce(t,e){let i;return function(...s){clearTimeout(i),i=setTimeout(()=>{clearTimeout(i),t(...s)},e)}}destroy(){this.observer&&this.observer.disconnect(),window.removeEventListener("scroll",this.handleScroll)}}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{new t}):new t})(); |
| | |
| | | /*!***************************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/gmbreviews/editor.scss ***! |
| | | \***************************************************************************************************************************************************************************************************************************************************/ |
| | | |
| | |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-server-side-render'), 'version' => 'dc847e00ceda934012c0'); |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-server-side-render'), 'version' => '9abfec4c1bba023a261c'); |
| | |
| | | /*!***************************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/gmbreviews/editor.scss ***! |
| | | \***************************************************************************************************************************************************************************************************************************************************/ |
| | | |
| | |
| | | /******/ (() => { // webpackBootstrap |
| | | /******/ "use strict"; |
| | | /******/ var __webpack_modules__ = ({ |
| | | |
| | | /***/ "./src/gmbreviews/edit.js" |
| | | /*!********************************!*\ |
| | | !*** ./src/gmbreviews/edit.js ***! |
| | | \********************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| | | /* harmony export */ "default": () => (/* binding */ Edit) |
| | | /* harmony export */ }); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); |
| | | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); |
| | | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| | | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); |
| | | /* harmony import */ var _wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/server-side-render */ "@wordpress/server-side-render"); |
| | | /* harmony import */ var _wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_3__); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__); |
| | | // src/gmbreviews/edit.js |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | function Edit({ |
| | | attributes, |
| | | setAttributes |
| | | }) { |
| | | const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps)(); |
| | | const { |
| | | count, |
| | | inheritUser, |
| | | showStats, |
| | | minStars, |
| | | showViewAllLink, |
| | | showRating, |
| | | showDate, |
| | | showReviewLink |
| | | } = attributes; |
| | | return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, { |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InspectorControls, { |
| | | children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelBody, { |
| | | title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Review Settings', 'jvb'), |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ToggleControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Inherit User', 'jvb'), |
| | | checked: inheritUser, |
| | | onChange: value => setAttributes({ |
| | | inheritUser: value |
| | | }) |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.RangeControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Number of Reviews', 'jvb'), |
| | | value: count, |
| | | onChange: value => setAttributes({ |
| | | count: value |
| | | }), |
| | | min: 1, |
| | | max: 20 |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ToggleControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show Rating', 'jvb'), |
| | | checked: showRating, |
| | | onChange: value => setAttributes({ |
| | | showRating: value |
| | | }) |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ToggleControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show Date', 'jvb'), |
| | | checked: showDate, |
| | | onChange: value => setAttributes({ |
| | | showDate: value |
| | | }) |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ToggleControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show Review Link', 'jvb'), |
| | | checked: showReviewLink, |
| | | onChange: value => setAttributes({ |
| | | showReviewLink: value |
| | | }) |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ToggleControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show Stats', 'jvb'), |
| | | checked: showStats, |
| | | onChange: value => setAttributes({ |
| | | showStats: value |
| | | }) |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ToggleControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show All Reviews Link', 'jvb'), |
| | | checked: showViewAllLink, |
| | | onChange: value => setAttributes({ |
| | | showViewAllLink: value |
| | | }) |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.RangeControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Minimum Rating', 'jvb'), |
| | | value: minStars, |
| | | onChange: value => setAttributes({ |
| | | minStars: value |
| | | }), |
| | | min: 1, |
| | | max: 5 |
| | | })] |
| | | }) |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", { |
| | | ...blockProps, |
| | | children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)((_wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_3___default()), { |
| | | block: "jvb/gmbreviews", |
| | | attributes: attributes |
| | | }) |
| | | })] |
| | | }); |
| | | } |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/gmbreviews/index.js" |
| | | /*!*********************************!*\ |
| | | !*** ./src/gmbreviews/index.js ***! |
| | | \*********************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edit */ "./src/gmbreviews/edit.js"); |
| | | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./src/gmbreviews/style.scss"); |
| | | /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor.scss */ "./src/gmbreviews/editor.scss"); |
| | | /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/gmbreviews/block.json"); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, { |
| | | edit: _edit__WEBPACK_IMPORTED_MODULE_1__["default"], |
| | | // No save function - dynamic block rendered on server |
| | | save: () => null |
| | | }); |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/gmbreviews/editor.scss" |
| | | /*!************************************!*\ |
| | | !*** ./src/gmbreviews/editor.scss ***! |
| | | \************************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | // extracted by mini-css-extract-plugin |
| | | |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/gmbreviews/style.scss" |
| | | /*!***********************************!*\ |
| | | !*** ./src/gmbreviews/style.scss ***! |
| | | \***********************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | // extracted by mini-css-extract-plugin |
| | | |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "react/jsx-runtime" |
| | | /*!**********************************!*\ |
| | | !*** external "ReactJSXRuntime" ***! |
| | | \**********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["ReactJSXRuntime"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/block-editor" |
| | | /*!*************************************!*\ |
| | | !*** external ["wp","blockEditor"] ***! |
| | | \*************************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blockEditor"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/blocks" |
| | | /*!********************************!*\ |
| | | !*** external ["wp","blocks"] ***! |
| | | \********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blocks"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/components" |
| | | /*!************************************!*\ |
| | | !*** external ["wp","components"] ***! |
| | | \************************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["components"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/i18n" |
| | | /*!******************************!*\ |
| | | !*** external ["wp","i18n"] ***! |
| | | \******************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["i18n"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/server-side-render" |
| | | /*!******************************************!*\ |
| | | !*** external ["wp","serverSideRender"] ***! |
| | | \******************************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["serverSideRender"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/gmbreviews/block.json" |
| | | /*!***********************************!*\ |
| | | !*** ./src/gmbreviews/block.json ***! |
| | | \***********************************/ |
| | | (module) { |
| | | |
| | | module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"jvb/gmbreviews","title":"GMB Reviews","category":"jvb","description":"Display top-rated Google My Business reviews with statistics and action buttons","keywords":["reviews","google","testimonials","gmb","ratings"],"textdomain":"jvb","attributes":{"inheritUser":{"type":"boolean","default":false},"count":{"type":"number","default":5},"showRating":{"type":"boolean","default":true},"showDate":{"type":"boolean","default":true},"showReviewLink":{"type":"boolean","default":true},"showViewAllLink":{"type":"boolean","default":true},"showStats":{"type":"boolean","default":true},"minStars":{"type":"number","default":4,"minimum":1,"maximum":5}},"supports":{"html":false,"align":true,"color":{"text":true,"background":true,"link":true},"spacing":{"margin":true,"padding":true},"typography":{"fontSize":true,"lineHeight":true}},"render":"file:./render.php","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js"}'); |
| | | |
| | | /***/ } |
| | | |
| | | /******/ }); |
| | | /************************************************************************/ |
| | | /******/ // The module cache |
| | | /******/ var __webpack_module_cache__ = {}; |
| | | /******/ |
| | | /******/ // The require function |
| | | /******/ function __webpack_require__(moduleId) { |
| | | /******/ // Check if module is in cache |
| | | /******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| | | /******/ if (cachedModule !== undefined) { |
| | | /******/ return cachedModule.exports; |
| | | /******/ } |
| | | /******/ // Create a new module (and put it into the cache) |
| | | /******/ var module = __webpack_module_cache__[moduleId] = { |
| | | /******/ // no module.id needed |
| | | /******/ // no module.loaded needed |
| | | /******/ exports: {} |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // Execute the module function |
| | | /******/ if (!(moduleId in __webpack_modules__)) { |
| | | /******/ delete __webpack_module_cache__[moduleId]; |
| | | /******/ var e = new Error("Cannot find module '" + moduleId + "'"); |
| | | /******/ e.code = 'MODULE_NOT_FOUND'; |
| | | /******/ throw e; |
| | | /******/ } |
| | | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| | | /******/ |
| | | /******/ // Return the exports of the module |
| | | /******/ return module.exports; |
| | | /******/ } |
| | | /******/ |
| | | /******/ // expose the modules object (__webpack_modules__) |
| | | /******/ __webpack_require__.m = __webpack_modules__; |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ /* webpack/runtime/chunk loaded */ |
| | | /******/ (() => { |
| | | /******/ var deferred = []; |
| | | /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { |
| | | /******/ if(chunkIds) { |
| | | /******/ priority = priority || 0; |
| | | /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; |
| | | /******/ deferred[i] = [chunkIds, fn, priority]; |
| | | /******/ return; |
| | | /******/ } |
| | | /******/ var notFulfilled = Infinity; |
| | | /******/ for (var i = 0; i < deferred.length; i++) { |
| | | /******/ var [chunkIds, fn, priority] = deferred[i]; |
| | | /******/ var fulfilled = true; |
| | | /******/ for (var j = 0; j < chunkIds.length; j++) { |
| | | /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { |
| | | /******/ chunkIds.splice(j--, 1); |
| | | /******/ } else { |
| | | /******/ fulfilled = false; |
| | | /******/ if(priority < notFulfilled) notFulfilled = priority; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(fulfilled) { |
| | | /******/ deferred.splice(i--, 1) |
| | | /******/ var r = fn(); |
| | | /******/ if (r !== undefined) result = r; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ return result; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/compat get default export */ |
| | | /******/ (() => { |
| | | /******/ // getDefaultExport function for compatibility with non-harmony modules |
| | | /******/ __webpack_require__.n = (module) => { |
| | | /******/ var getter = module && module.__esModule ? |
| | | /******/ () => (module['default']) : |
| | | /******/ () => (module); |
| | | /******/ __webpack_require__.d(getter, { a: getter }); |
| | | /******/ return getter; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/define property getters */ |
| | | /******/ (() => { |
| | | /******/ // define getter functions for harmony exports |
| | | /******/ __webpack_require__.d = (exports, definition) => { |
| | | /******/ for(var key in definition) { |
| | | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| | | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| | | /******/ } |
| | | /******/ } |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| | | /******/ (() => { |
| | | /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/make namespace object */ |
| | | /******/ (() => { |
| | | /******/ // define __esModule on exports |
| | | /******/ __webpack_require__.r = (exports) => { |
| | | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
| | | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| | | /******/ } |
| | | /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/jsonp chunk loading */ |
| | | /******/ (() => { |
| | | /******/ // no baseURI |
| | | /******/ |
| | | /******/ // object to store loaded and loading chunks |
| | | /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched |
| | | /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded |
| | | /******/ var installedChunks = { |
| | | /******/ "gmbreviews/index": 0, |
| | | /******/ "gmbreviews/style-index": 0 |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // no chunk on demand loading |
| | | /******/ |
| | | /******/ // no prefetching |
| | | /******/ |
| | | /******/ // no preloaded |
| | | /******/ |
| | | /******/ // no HMR |
| | | /******/ |
| | | /******/ // no HMR manifest |
| | | /******/ |
| | | /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); |
| | | /******/ |
| | | /******/ // install a JSONP callback for chunk loading |
| | | /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { |
| | | /******/ var [chunkIds, moreModules, runtime] = data; |
| | | /******/ // add "moreModules" to the modules object, |
| | | /******/ // then flag all "chunkIds" as loaded and fire callback |
| | | /******/ var moduleId, chunkId, i = 0; |
| | | /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { |
| | | /******/ for(moduleId in moreModules) { |
| | | /******/ if(__webpack_require__.o(moreModules, moduleId)) { |
| | | /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(runtime) var result = runtime(__webpack_require__); |
| | | /******/ } |
| | | /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); |
| | | /******/ for(;i < chunkIds.length; i++) { |
| | | /******/ chunkId = chunkIds[i]; |
| | | /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { |
| | | /******/ installedChunks[chunkId][0](); |
| | | /******/ } |
| | | /******/ installedChunks[chunkId] = 0; |
| | | /******/ } |
| | | /******/ return __webpack_require__.O(result); |
| | | /******/ } |
| | | /******/ |
| | | /******/ var chunkLoadingGlobal = globalThis["webpackChunkjvb"] = globalThis["webpackChunkjvb"] || []; |
| | | /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); |
| | | /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); |
| | | /******/ })(); |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ |
| | | /******/ // startup |
| | | /******/ // Load entry module and return exports |
| | | /******/ // This entry module depends on other loaded chunks and execution need to be delayed |
| | | /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["gmbreviews/style-index"], () => (__webpack_require__("./src/gmbreviews/index.js"))) |
| | | /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); |
| | | /******/ |
| | | /******/ })() |
| | | ; |
| | | //# sourceMappingURL=index.js.map |
| | | (()=>{"use strict";var e,o={819(e,o,n){const r=window.wp.blocks,t=window.wp.blockEditor,i=window.wp.components,l=window.wp.i18n,s=window.wp.serverSideRender;var a=n.n(s);const h=window.ReactJSXRuntime,v=JSON.parse('{"UU":"jvb/gmbreviews"}');(0,r.registerBlockType)(v.UU,{edit:function({attributes:e,setAttributes:o}){const n=(0,t.useBlockProps)(),{count:r,inheritUser:s,showStats:v,minStars:w,showViewAllLink:b,showRating:c,showDate:g,showReviewLink:d}=e;return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(t.InspectorControls,{children:(0,h.jsxs)(i.PanelBody,{title:(0,l.__)("Review Settings","jvb"),children:[(0,h.jsx)(i.ToggleControl,{label:(0,l.__)("Inherit User","jvb"),checked:s,onChange:e=>o({inheritUser:e})}),(0,h.jsx)(i.RangeControl,{label:(0,l.__)("Number of Reviews","jvb"),value:r,onChange:e=>o({count:e}),min:1,max:20}),(0,h.jsx)(i.ToggleControl,{label:(0,l.__)("Show Rating","jvb"),checked:c,onChange:e=>o({showRating:e})}),(0,h.jsx)(i.ToggleControl,{label:(0,l.__)("Show Date","jvb"),checked:g,onChange:e=>o({showDate:e})}),(0,h.jsx)(i.ToggleControl,{label:(0,l.__)("Show Review Link","jvb"),checked:d,onChange:e=>o({showReviewLink:e})}),(0,h.jsx)(i.ToggleControl,{label:(0,l.__)("Show Stats","jvb"),checked:v,onChange:e=>o({showStats:e})}),(0,h.jsx)(i.ToggleControl,{label:(0,l.__)("Show All Reviews Link","jvb"),checked:b,onChange:e=>o({showViewAllLink:e})}),(0,h.jsx)(i.RangeControl,{label:(0,l.__)("Minimum Rating","jvb"),value:w,onChange:e=>o({minStars:e}),min:1,max:5})]})}),(0,h.jsx)("div",{...n,children:(0,h.jsx)(a(),{block:"jvb/gmbreviews",attributes:e})})]})},save:()=>null})}},n={};function r(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return o[e](i,i.exports,r),i.exports}r.m=o,e=[],r.O=(o,n,t,i)=>{if(!n){var l=1/0;for(v=0;v<e.length;v++){for(var[n,t,i]=e[v],s=!0,a=0;a<n.length;a++)(!1&i||l>=i)&&Object.keys(r.O).every(e=>r.O[e](n[a]))?n.splice(a--,1):(s=!1,i<l&&(l=i));if(s){e.splice(v--,1);var h=t();void 0!==h&&(o=h)}}return o}i=i||0;for(var v=e.length;v>0&&e[v-1][2]>i;v--)e[v]=e[v-1];e[v]=[n,t,i]},r.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return r.d(o,{a:o}),o},r.d=(e,o)=>{for(var n in o)r.o(o,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={807:0,423:0};r.O.j=o=>0===e[o];var o=(o,n)=>{var t,i,[l,s,a]=n,h=0;if(l.some(o=>0!==e[o])){for(t in s)r.o(s,t)&&(r.m[t]=s[t]);if(a)var v=a(r)}for(o&&o(n);h<l.length;h++)i=l[h],r.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return r.O(v)},n=globalThis.webpackChunkjvb=globalThis.webpackChunkjvb||[];n.forEach(o.bind(null,0)),n.push=o.bind(null,n.push.bind(n))})();var t=r.O(void 0,[423],()=>r(819));t=r.O(t)})(); |
| | |
| | | /*!**************************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/gmbreviews/style.scss ***! |
| | | \**************************************************************************************************************************************************************************************************************************************************/ |
| | | .gmb-reviews { |
| | | max-width: none; |
| | | } |
| | | .gmb-reviews > .row.x-mid { |
| | | max-width: var(--content); |
| | | margin: 0 auto; |
| | | --gap: .5rem 6rem; |
| | | } |
| | | .gmb-reviews > .row.x-mid p { |
| | | width: -moz-fit-content; |
| | | width: fit-content; |
| | | } |
| | | .gmb-reviews .button { |
| | | width: 66.6%; |
| | | margin: 0 auto 2rem; |
| | | display: flex; |
| | | height: -moz-max-content; |
| | | height: max-content; |
| | | } |
| | | .gmb-reviews .stars { |
| | | display: inline-flex; |
| | | align-items: center; |
| | | justify-content: flex-start; |
| | | flex-wrap: nowrap; |
| | | } |
| | | .gmb-reviews ul { |
| | | list-style: none; |
| | | margin: 0; |
| | | padding: 0; |
| | | max-width: var(--full); |
| | | } |
| | | .gmb-reviews ul li { |
| | | width: 100%; |
| | | max-width: none; |
| | | padding: 4rem 1rem; |
| | | } |
| | | .gmb-reviews ul li:nth-of-type(odd) { |
| | | background-color: rgb(var(--base-50)); |
| | | } |
| | | .gmb-reviews ul li:nth-of-type(odd) blockquote { |
| | | --background: rgb(var(--base-50)); |
| | | } |
| | | .gmb-reviews ul li:nth-of-type(even) { |
| | | background-color: rgb(var(--base-100)); |
| | | } |
| | | .gmb-reviews ul li:nth-of-type(even) blockquote { |
| | | --background: rgb(var(--base-100)); |
| | | } |
| | | .gmb-reviews blockquote { |
| | | margin: 1rem auto; |
| | | padding: 1rem 0 0; |
| | | max-width: var(--content); |
| | | border-top: 1px solid rgb(var(--base-200)); |
| | | } |
| | | .gmb-reviews blockquote .icon-quotes-fi { |
| | | right: calc(var(--btnbtn) * -1); |
| | | } |
| | | .gmb-reviews blockquote .content { |
| | | border-width: 4px 1px; |
| | | } |
| | | .gmb-reviews blockquote .content::after { |
| | | border-width: 4px 1px; |
| | | } |
| | | .gmb-reviews blockquote .content::before { |
| | | border-width: 8px; |
| | | bottom: -4px; |
| | | } |
| | | .gmb-reviews blockquote cite { |
| | | position: relative; |
| | | margin-top: var(--btn); |
| | | } |
| | | .gmb-reviews blockquote cite img { |
| | | width: 4.5rem; |
| | | position: absolute; |
| | | right: -8rem; |
| | | top: 0; |
| | | } |
| | | .gmb-reviews blockquote cite p { |
| | | margin: 0; |
| | | } |
| | | .gmb-reviews blockquote cite .wrap { |
| | | --wrap: wrap; |
| | | } |
| | | .gmb-reviews blockquote cite .wrap p, .gmb-reviews blockquote cite .wrap time { |
| | | max-width: 49%; |
| | | } |
| | | .gmb-reviews blockquote cite .wrap .stars { |
| | | width: 100%; |
| | | } |
| | | .gmb-reviews blockquote time { |
| | | white-space: nowrap; |
| | | } |
| | | .gmb-reviews .stars .icon { |
| | | background-color: rgb(var(--action-0)); |
| | | } |
| | | .gmb-reviews article { |
| | | padding: 1rem; |
| | | border-radius: var(--radius-outer); |
| | | background-color: rgb(var(--base)); |
| | | } |
| | | .gmb-reviews article header { |
| | | --align: center; |
| | | } |
| | | .gmb-reviews article header > img { |
| | | position: relative; |
| | | right: 0; |
| | | } |
| | | .gmb-reviews article time { |
| | | font-style: italic; |
| | | } |
| | | .gmb-reviews article .review { |
| | | padding: 1.5rem; |
| | | } |
| | | .gmb-reviews article h4 { |
| | | width: -moz-max-content; |
| | | width: max-content; |
| | | } |
| | | .gmb-reviews article .icon { |
| | | color: rgb(var(--action-0)); |
| | | } |
| | | .gmb-reviews .btn { |
| | | width: 100%; |
| | | } |
| | | .gmb-reviews{max-width:none}.gmb-reviews>.row.x-mid{margin:0 auto;max-width:var(--content);--gap:.5rem 6rem}.gmb-reviews>.row.x-mid p{width:-moz-fit-content;width:fit-content}.gmb-reviews .button{display:flex;height:-moz-max-content;height:max-content;margin:0 auto 2rem;width:66.6%}.gmb-reviews .stars{align-items:center;display:inline-flex;flex-wrap:nowrap;justify-content:flex-start}.gmb-reviews ul{list-style:none;margin:0;max-width:var(--full);padding:0}.gmb-reviews ul li{max-width:none;padding:4rem 1rem;width:100%}.gmb-reviews ul li:nth-of-type(odd){background-color:rgb(var(--base-50))}.gmb-reviews ul li:nth-of-type(odd) blockquote{--background:rgb(var(--base-50))}.gmb-reviews ul li:nth-of-type(2n){background-color:rgb(var(--base-100))}.gmb-reviews ul li:nth-of-type(2n) blockquote{--background:rgb(var(--base-100))}.gmb-reviews blockquote{border-top:1px solid rgb(var(--base-200));margin:1rem auto;max-width:var(--content);padding:1rem 0 0}.gmb-reviews blockquote .icon-quotes-fi{right:calc(var(--btnbtn)*-1)}.gmb-reviews blockquote .content,.gmb-reviews blockquote .content:after{border-width:4px 1px}.gmb-reviews blockquote .content:before{border-width:8px;bottom:-4px}.gmb-reviews blockquote cite{margin-top:var(--btn);position:relative}.gmb-reviews blockquote cite img{right:-8rem;position:absolute;top:0;width:4.5rem}.gmb-reviews blockquote cite p{margin:0}.gmb-reviews blockquote cite .wrap{--wrap:wrap}.gmb-reviews blockquote cite .wrap p,.gmb-reviews blockquote cite .wrap time{max-width:49%}.gmb-reviews blockquote cite .wrap .stars{width:100%}.gmb-reviews blockquote time{white-space:nowrap}.gmb-reviews .stars .icon{background-color:rgb(var(--action-0))}.gmb-reviews article{background-color:rgb(var(--base));border-radius:var(--radius-outer);padding:1rem}.gmb-reviews article header{--align:center}.gmb-reviews article header>img{right:0;position:relative}.gmb-reviews article time{font-style:italic}.gmb-reviews article .review{padding:1.5rem}.gmb-reviews article h4{width:-moz-max-content;width:max-content}.gmb-reviews article .icon{color:rgb(var(--action-0))}.gmb-reviews .btn{width:100%} |
| | |
| | | /*!**************************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/gmbreviews/style.scss ***! |
| | | \**************************************************************************************************************************************************************************************************************************************************/ |
| | | .gmb-reviews { |
| | | max-width: none; |
| | | } |
| | | .gmb-reviews > .row.x-mid { |
| | | max-width: var(--content); |
| | | margin: 0 auto; |
| | | --gap: .5rem 6rem; |
| | | } |
| | | .gmb-reviews > .row.x-mid p { |
| | | width: -moz-fit-content; |
| | | width: fit-content; |
| | | } |
| | | .gmb-reviews .button { |
| | | width: 66.6%; |
| | | margin: 0 auto 2rem; |
| | | display: flex; |
| | | height: -moz-max-content; |
| | | height: max-content; |
| | | } |
| | | .gmb-reviews .stars { |
| | | display: inline-flex; |
| | | align-items: center; |
| | | justify-content: flex-start; |
| | | flex-wrap: nowrap; |
| | | } |
| | | .gmb-reviews ul { |
| | | list-style: none; |
| | | margin: 0; |
| | | padding: 0; |
| | | max-width: var(--full); |
| | | } |
| | | .gmb-reviews ul li { |
| | | width: 100%; |
| | | max-width: none; |
| | | padding: 4rem 1rem; |
| | | } |
| | | .gmb-reviews ul li:nth-of-type(odd) { |
| | | background-color: rgb(var(--base-50)); |
| | | } |
| | | .gmb-reviews ul li:nth-of-type(odd) blockquote { |
| | | --background: rgb(var(--base-50)); |
| | | } |
| | | .gmb-reviews ul li:nth-of-type(even) { |
| | | background-color: rgb(var(--base-100)); |
| | | } |
| | | .gmb-reviews ul li:nth-of-type(even) blockquote { |
| | | --background: rgb(var(--base-100)); |
| | | } |
| | | .gmb-reviews blockquote { |
| | | margin: 1rem auto; |
| | | padding: 1rem 0 0; |
| | | max-width: var(--content); |
| | | border-top: 1px solid rgb(var(--base-200)); |
| | | } |
| | | .gmb-reviews blockquote .icon-quotes-fi { |
| | | left: calc(var(--btnbtn) * -1); |
| | | } |
| | | .gmb-reviews blockquote .content { |
| | | border-width: 4px 1px; |
| | | } |
| | | .gmb-reviews blockquote .content::after { |
| | | border-width: 4px 1px; |
| | | } |
| | | .gmb-reviews blockquote .content::before { |
| | | border-width: 8px; |
| | | bottom: -4px; |
| | | } |
| | | .gmb-reviews blockquote cite { |
| | | position: relative; |
| | | margin-top: var(--btn); |
| | | } |
| | | .gmb-reviews blockquote cite img { |
| | | width: 4.5rem; |
| | | position: absolute; |
| | | left: -8rem; |
| | | top: 0; |
| | | } |
| | | .gmb-reviews blockquote cite p { |
| | | margin: 0; |
| | | } |
| | | .gmb-reviews blockquote cite .wrap { |
| | | --wrap: wrap; |
| | | } |
| | | .gmb-reviews blockquote cite .wrap p, .gmb-reviews blockquote cite .wrap time { |
| | | max-width: 49%; |
| | | } |
| | | .gmb-reviews blockquote cite .wrap .stars { |
| | | width: 100%; |
| | | } |
| | | .gmb-reviews blockquote time { |
| | | white-space: nowrap; |
| | | } |
| | | .gmb-reviews .stars .icon { |
| | | background-color: rgb(var(--action-0)); |
| | | } |
| | | .gmb-reviews article { |
| | | padding: 1rem; |
| | | border-radius: var(--radius-outer); |
| | | background-color: rgb(var(--base)); |
| | | } |
| | | .gmb-reviews article header { |
| | | --align: center; |
| | | } |
| | | .gmb-reviews article header > img { |
| | | position: relative; |
| | | left: 0; |
| | | } |
| | | .gmb-reviews article time { |
| | | font-style: italic; |
| | | } |
| | | .gmb-reviews article .review { |
| | | padding: 1.5rem; |
| | | } |
| | | .gmb-reviews article h4 { |
| | | width: -moz-max-content; |
| | | width: max-content; |
| | | } |
| | | .gmb-reviews article .icon { |
| | | color: rgb(var(--action-0)); |
| | | } |
| | | .gmb-reviews .btn { |
| | | width: 100%; |
| | | } |
| | | |
| | | /*# sourceMappingURL=style-index.css.map*/ |
| | | .gmb-reviews{max-width:none}.gmb-reviews>.row.x-mid{margin:0 auto;max-width:var(--content);--gap:.5rem 6rem}.gmb-reviews>.row.x-mid p{width:-moz-fit-content;width:fit-content}.gmb-reviews .button{display:flex;height:-moz-max-content;height:max-content;margin:0 auto 2rem;width:66.6%}.gmb-reviews .stars{align-items:center;display:inline-flex;flex-wrap:nowrap;justify-content:flex-start}.gmb-reviews ul{list-style:none;margin:0;max-width:var(--full);padding:0}.gmb-reviews ul li{max-width:none;padding:4rem 1rem;width:100%}.gmb-reviews ul li:nth-of-type(odd){background-color:rgb(var(--base-50))}.gmb-reviews ul li:nth-of-type(odd) blockquote{--background:rgb(var(--base-50))}.gmb-reviews ul li:nth-of-type(2n){background-color:rgb(var(--base-100))}.gmb-reviews ul li:nth-of-type(2n) blockquote{--background:rgb(var(--base-100))}.gmb-reviews blockquote{border-top:1px solid rgb(var(--base-200));margin:1rem auto;max-width:var(--content);padding:1rem 0 0}.gmb-reviews blockquote .icon-quotes-fi{left:calc(var(--btnbtn)*-1)}.gmb-reviews blockquote .content,.gmb-reviews blockquote .content:after{border-width:4px 1px}.gmb-reviews blockquote .content:before{border-width:8px;bottom:-4px}.gmb-reviews blockquote cite{margin-top:var(--btn);position:relative}.gmb-reviews blockquote cite img{left:-8rem;position:absolute;top:0;width:4.5rem}.gmb-reviews blockquote cite p{margin:0}.gmb-reviews blockquote cite .wrap{--wrap:wrap}.gmb-reviews blockquote cite .wrap p,.gmb-reviews blockquote cite .wrap time{max-width:49%}.gmb-reviews blockquote cite .wrap .stars{width:100%}.gmb-reviews blockquote time{white-space:nowrap}.gmb-reviews .stars .icon{background-color:rgb(var(--action-0))}.gmb-reviews article{background-color:rgb(var(--base));border-radius:var(--radius-outer);padding:1rem}.gmb-reviews article header{--align:center}.gmb-reviews article header>img{left:0;position:relative}.gmb-reviews article time{font-style:italic}.gmb-reviews article .review{padding:1.5rem}.gmb-reviews article h4{width:-moz-max-content;width:max-content}.gmb-reviews article .icon{color:rgb(var(--action-0))}.gmb-reviews .btn{width:100%} |
| | |
| | | <?php return array('dependencies' => array(), 'version' => 'd580aba8c310115dcf70'); |
| | | <?php return array('dependencies' => array(), 'version' => '31d6cfe0d16ae931b73c'); |
| | |
| | | /******/ (() => { // webpackBootstrap |
| | | /*!********************************!*\ |
| | | !*** ./src/gmbreviews/view.js ***! |
| | | \********************************/ |
| | | |
| | | /******/ })() |
| | | ; |
| | |
| | | /*!*********************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/menu/editor.scss ***! |
| | | \*********************************************************************************************************************************************************************************************************************************************/ |
| | | |
| | |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => 'e5ab84e1b3eacc46d4db'); |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => '60dee3034fa9da82f1ec'); |
| | |
| | | /*!*********************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/menu/editor.scss ***! |
| | | \*********************************************************************************************************************************************************************************************************************************************/ |
| | | |
| | |
| | | /******/ (() => { // webpackBootstrap |
| | | /******/ "use strict"; |
| | | /******/ var __webpack_modules__ = ({ |
| | | |
| | | /***/ "./src/menu/edit.js" |
| | | /*!**************************!*\ |
| | | !*** ./src/menu/edit.js ***! |
| | | \**************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| | | /* harmony export */ "default": () => (/* binding */ Edit) |
| | | /* harmony export */ }); |
| | | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| | | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); |
| | | /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/menu/editor.scss"); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__); |
| | | /** |
| | | * Retrieves the translation of text. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/ |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * React hook that is used to mark the block wrapper element. |
| | | * It provides all the necessary props like the class name. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. |
| | | * Those files can contain any CSS code that gets applied to the editor. |
| | | * |
| | | * @see https://www.npmjs.com/package/@wordpress/scripts#using-css |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * The edit function describes the structure of your block in the context of the |
| | | * editor. This represents what the editor will render when the block is used. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit |
| | | * |
| | | * @return {Element} Element to render. |
| | | */ |
| | | |
| | | function Edit() { |
| | | return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", { |
| | | ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)(), |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Will output the menu', 'jvb') |
| | | }); |
| | | } |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/menu/index.js" |
| | | /*!***************************!*\ |
| | | !*** ./src/menu/index.js ***! |
| | | \***************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/menu/style.scss"); |
| | | /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/menu/edit.js"); |
| | | /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block.json */ "./src/menu/block.json"); |
| | | /** |
| | | * Registers a new block provided a unique name and an object defining its behavior. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. |
| | | * All files containing `style` keyword are bundled together. The code used |
| | | * gets applied both to the front of your site and to the editor. |
| | | * |
| | | * @see https://www.npmjs.com/package/@wordpress/scripts#using-css |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * Internal dependencies |
| | | */ |
| | | |
| | | |
| | | |
| | | /** |
| | | * Every block starts by registering a new block type definition. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ |
| | | */ |
| | | (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_3__.name, { |
| | | /** |
| | | * @see ./edit.js |
| | | */ |
| | | edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"] |
| | | }); |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/menu/editor.scss" |
| | | /*!******************************!*\ |
| | | !*** ./src/menu/editor.scss ***! |
| | | \******************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | // extracted by mini-css-extract-plugin |
| | | |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/menu/style.scss" |
| | | /*!*****************************!*\ |
| | | !*** ./src/menu/style.scss ***! |
| | | \*****************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | // extracted by mini-css-extract-plugin |
| | | |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "react/jsx-runtime" |
| | | /*!**********************************!*\ |
| | | !*** external "ReactJSXRuntime" ***! |
| | | \**********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["ReactJSXRuntime"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/block-editor" |
| | | /*!*************************************!*\ |
| | | !*** external ["wp","blockEditor"] ***! |
| | | \*************************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blockEditor"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/blocks" |
| | | /*!********************************!*\ |
| | | !*** external ["wp","blocks"] ***! |
| | | \********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blocks"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/i18n" |
| | | /*!******************************!*\ |
| | | !*** external ["wp","i18n"] ***! |
| | | \******************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["i18n"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/menu/block.json" |
| | | /*!*****************************!*\ |
| | | !*** ./src/menu/block.json ***! |
| | | \*****************************/ |
| | | (module) { |
| | | |
| | | module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"jvb/menu","version":"0.1.0","title":"Our Menu","category":"jvb","icon":"food","description":"Outputs our menu, organized by categories","example":{},"supports":{"html":false,"align":["wide","full"]},"textdomain":"jvb","selectors":{"root":".menu-block"},"editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","viewScript":"file:./view.js"}'); |
| | | |
| | | /***/ } |
| | | |
| | | /******/ }); |
| | | /************************************************************************/ |
| | | /******/ // The module cache |
| | | /******/ var __webpack_module_cache__ = {}; |
| | | /******/ |
| | | /******/ // The require function |
| | | /******/ function __webpack_require__(moduleId) { |
| | | /******/ // Check if module is in cache |
| | | /******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| | | /******/ if (cachedModule !== undefined) { |
| | | /******/ return cachedModule.exports; |
| | | /******/ } |
| | | /******/ // Create a new module (and put it into the cache) |
| | | /******/ var module = __webpack_module_cache__[moduleId] = { |
| | | /******/ // no module.id needed |
| | | /******/ // no module.loaded needed |
| | | /******/ exports: {} |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // Execute the module function |
| | | /******/ if (!(moduleId in __webpack_modules__)) { |
| | | /******/ delete __webpack_module_cache__[moduleId]; |
| | | /******/ var e = new Error("Cannot find module '" + moduleId + "'"); |
| | | /******/ e.code = 'MODULE_NOT_FOUND'; |
| | | /******/ throw e; |
| | | /******/ } |
| | | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| | | /******/ |
| | | /******/ // Return the exports of the module |
| | | /******/ return module.exports; |
| | | /******/ } |
| | | /******/ |
| | | /******/ // expose the modules object (__webpack_modules__) |
| | | /******/ __webpack_require__.m = __webpack_modules__; |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ /* webpack/runtime/chunk loaded */ |
| | | /******/ (() => { |
| | | /******/ var deferred = []; |
| | | /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { |
| | | /******/ if(chunkIds) { |
| | | /******/ priority = priority || 0; |
| | | /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; |
| | | /******/ deferred[i] = [chunkIds, fn, priority]; |
| | | /******/ return; |
| | | /******/ } |
| | | /******/ var notFulfilled = Infinity; |
| | | /******/ for (var i = 0; i < deferred.length; i++) { |
| | | /******/ var [chunkIds, fn, priority] = deferred[i]; |
| | | /******/ var fulfilled = true; |
| | | /******/ for (var j = 0; j < chunkIds.length; j++) { |
| | | /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { |
| | | /******/ chunkIds.splice(j--, 1); |
| | | /******/ } else { |
| | | /******/ fulfilled = false; |
| | | /******/ if(priority < notFulfilled) notFulfilled = priority; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(fulfilled) { |
| | | /******/ deferred.splice(i--, 1) |
| | | /******/ var r = fn(); |
| | | /******/ if (r !== undefined) result = r; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ return result; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/compat get default export */ |
| | | /******/ (() => { |
| | | /******/ // getDefaultExport function for compatibility with non-harmony modules |
| | | /******/ __webpack_require__.n = (module) => { |
| | | /******/ var getter = module && module.__esModule ? |
| | | /******/ () => (module['default']) : |
| | | /******/ () => (module); |
| | | /******/ __webpack_require__.d(getter, { a: getter }); |
| | | /******/ return getter; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/define property getters */ |
| | | /******/ (() => { |
| | | /******/ // define getter functions for harmony exports |
| | | /******/ __webpack_require__.d = (exports, definition) => { |
| | | /******/ for(var key in definition) { |
| | | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| | | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| | | /******/ } |
| | | /******/ } |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| | | /******/ (() => { |
| | | /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/make namespace object */ |
| | | /******/ (() => { |
| | | /******/ // define __esModule on exports |
| | | /******/ __webpack_require__.r = (exports) => { |
| | | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
| | | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| | | /******/ } |
| | | /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/jsonp chunk loading */ |
| | | /******/ (() => { |
| | | /******/ // no baseURI |
| | | /******/ |
| | | /******/ // object to store loaded and loading chunks |
| | | /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched |
| | | /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded |
| | | /******/ var installedChunks = { |
| | | /******/ "menu/index": 0, |
| | | /******/ "menu/style-index": 0 |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // no chunk on demand loading |
| | | /******/ |
| | | /******/ // no prefetching |
| | | /******/ |
| | | /******/ // no preloaded |
| | | /******/ |
| | | /******/ // no HMR |
| | | /******/ |
| | | /******/ // no HMR manifest |
| | | /******/ |
| | | /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); |
| | | /******/ |
| | | /******/ // install a JSONP callback for chunk loading |
| | | /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { |
| | | /******/ var [chunkIds, moreModules, runtime] = data; |
| | | /******/ // add "moreModules" to the modules object, |
| | | /******/ // then flag all "chunkIds" as loaded and fire callback |
| | | /******/ var moduleId, chunkId, i = 0; |
| | | /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { |
| | | /******/ for(moduleId in moreModules) { |
| | | /******/ if(__webpack_require__.o(moreModules, moduleId)) { |
| | | /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(runtime) var result = runtime(__webpack_require__); |
| | | /******/ } |
| | | /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); |
| | | /******/ for(;i < chunkIds.length; i++) { |
| | | /******/ chunkId = chunkIds[i]; |
| | | /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { |
| | | /******/ installedChunks[chunkId][0](); |
| | | /******/ } |
| | | /******/ installedChunks[chunkId] = 0; |
| | | /******/ } |
| | | /******/ return __webpack_require__.O(result); |
| | | /******/ } |
| | | /******/ |
| | | /******/ var chunkLoadingGlobal = globalThis["webpackChunkjvb"] = globalThis["webpackChunkjvb"] || []; |
| | | /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); |
| | | /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); |
| | | /******/ })(); |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ |
| | | /******/ // startup |
| | | /******/ // Load entry module and return exports |
| | | /******/ // This entry module depends on other loaded chunks and execution need to be delayed |
| | | /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["menu/style-index"], () => (__webpack_require__("./src/menu/index.js"))) |
| | | /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); |
| | | /******/ |
| | | /******/ })() |
| | | ; |
| | | //# sourceMappingURL=index.js.map |
| | | (()=>{"use strict";var r,e={722(){const r=window.wp.blocks,e=window.wp.i18n,o=window.wp.blockEditor,n=window.ReactJSXRuntime;(0,r.registerBlockType)("jvb/menu",{edit:function(){return(0,n.jsx)("p",{...(0,o.useBlockProps)(),children:(0,e.__)("Will output the menu","jvb")})}})}},o={};function n(r){var t=o[r];if(void 0!==t)return t.exports;var i=o[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.m=e,r=[],n.O=(e,o,t,i)=>{if(!o){var l=1/0;for(u=0;u<r.length;u++){for(var[o,t,i]=r[u],s=!0,a=0;a<o.length;a++)(!1&i||l>=i)&&Object.keys(n.O).every(r=>n.O[r](o[a]))?o.splice(a--,1):(s=!1,i<l&&(l=i));if(s){r.splice(u--,1);var p=t();void 0!==p&&(e=p)}}return e}i=i||0;for(var u=r.length;u>0&&r[u-1][2]>i;u--)r[u]=r[u-1];r[u]=[o,t,i]},n.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r={447:0,103:0};n.O.j=e=>0===r[e];var e=(e,o)=>{var t,i,[l,s,a]=o,p=0;if(l.some(e=>0!==r[e])){for(t in s)n.o(s,t)&&(n.m[t]=s[t]);if(a)var u=a(n)}for(e&&e(o);p<l.length;p++)i=l[p],n.o(r,i)&&r[i]&&r[i][0](),r[i]=0;return n.O(u)},o=globalThis.webpackChunkjvb=globalThis.webpackChunkjvb||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))})();var t=n.O(void 0,[103],()=>n(722));t=n.O(t)})(); |
| | |
| | | /*!********************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/menu/style.scss ***! |
| | | \********************************************************************************************************************************************************************************************************************************************/ |
| | | |
| | |
| | | /*!********************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/menu/style.scss ***! |
| | | \********************************************************************************************************************************************************************************************************************************************/ |
| | | |
| | |
| | | <?php return array('dependencies' => array(), 'version' => '6e7f34524894e70f78cb'); |
| | | <?php return array('dependencies' => array(), 'version' => 'fa2ae0d9cf37735dbf5a'); |
| | |
| | | /******/ (() => { // webpackBootstrap |
| | | /*!**************************!*\ |
| | | !*** ./src/menu/view.js ***! |
| | | \**************************/ |
| | | window.details = document.querySelectorAll('details'); |
| | | window.toggles = document.querySelectorAll('.toggle-details'); |
| | | document.addEventListener('click', e => { |
| | | if (e.target.classList.contains('toggle-details')) { |
| | | e.target.classList.toggle('open'); |
| | | let on = e.target.classList.contains('open'); |
| | | let section = e.target.dataset.toggle; |
| | | if (section === 'all') { |
| | | toggleToggles(on); |
| | | } |
| | | let span = e.target.querySelector('span'); |
| | | span.textContent = on ? 'Close' : 'Open'; |
| | | toggleDetails(section, on); |
| | | } |
| | | }); |
| | | console.log(window.details); |
| | | function toggleDetails(name, toggle) { |
| | | if (name === 'all') { |
| | | console.log('Toggling all!'); |
| | | window.details.forEach(detail => { |
| | | console.log(detail); |
| | | detail.open = toggle; |
| | | }); |
| | | } else { |
| | | for (let detail of window.details) { |
| | | if (detail.dataset.section === name) { |
| | | detail.open = toggle; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | function toggleToggles(on) { |
| | | window.toggles.forEach(toggle => { |
| | | if (toggle.dataset.toggle !== 'all') { |
| | | toggle.querySelector('span').textContent = on ? 'Close' : 'Open'; |
| | | } |
| | | }); |
| | | } |
| | | /******/ })() |
| | | ; |
| | | //# sourceMappingURL=view.js.map |
| | | window.details=document.querySelectorAll("details"),window.toggles=document.querySelectorAll(".toggle-details"),document.addEventListener("click",e=>{if(e.target.classList.contains("toggle-details")){e.target.classList.toggle("open");let t=e.target.classList.contains("open"),o=e.target.dataset.toggle;"all"===o&&function(e){window.toggles.forEach(t=>{"all"!==t.dataset.toggle&&(t.querySelector("span").textContent=e?"Close":"Open")})}(t),e.target.querySelector("span").textContent=t?"Close":"Open",function(e,t){if("all"===e)console.log("Toggling all!"),window.details.forEach(e=>{console.log(e),e.open=t});else for(let o of window.details)o.dataset.section===e&&(o.open=t)}(o,t)}}),console.log(window.details); |
| | |
| | | /*!************************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/summary/editor.scss ***! |
| | | \************************************************************************************************************************************************************************************************************************************************/ |
| | | /** |
| | | * Directory List Block Editor Styles |
| | | */ |
| | | .jvb-summary-preview { |
| | | padding: 20px; |
| | | background-color: #f8f9fa; |
| | | border: 1px solid #e2e4e7; |
| | | border-radius: 4px; |
| | | } |
| | | .jvb-summary-preview h3 { |
| | | margin-top: 0; |
| | | padding-bottom: 10px; |
| | | border-bottom: 1px solid #ff0080; |
| | | } |
| | | .jvb-summary-preview-note { |
| | | font-style: italic; |
| | | color: #555d66; |
| | | margin-bottom: 0; |
| | | } |
| | | .jvb-summary-preview{background-color:#f8f9fa;border:1px solid #e2e4e7;border-radius:4px;padding:20px}.jvb-summary-preview h3{border-bottom:1px solid #ff0080;margin-top:0;padding-bottom:10px}.jvb-summary-preview-note{color:#555d66;font-style:italic;margin-bottom:0} |
| | |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '57ed577bade7a3bfaa6d'); |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '7e1ea861fc0d23381c53'); |
| | |
| | | /*!************************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/summary/editor.scss ***! |
| | | \************************************************************************************************************************************************************************************************************************************************/ |
| | | /** |
| | | * Directory List Block Editor Styles |
| | | */ |
| | | .jvb-summary-preview { |
| | | padding: 20px; |
| | | background-color: #f8f9fa; |
| | | border: 1px solid #e2e4e7; |
| | | border-radius: 4px; |
| | | } |
| | | .jvb-summary-preview h3 { |
| | | margin-top: 0; |
| | | padding-bottom: 10px; |
| | | border-bottom: 1px solid #ff0080; |
| | | } |
| | | .jvb-summary-preview-note { |
| | | font-style: italic; |
| | | color: #555d66; |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | /*# sourceMappingURL=index.css.map*/ |
| | | .jvb-summary-preview{background-color:#f8f9fa;border:1px solid #e2e4e7;border-radius:4px;padding:20px}.jvb-summary-preview h3{border-bottom:1px solid #ff0080;margin-top:0;padding-bottom:10px}.jvb-summary-preview-note{color:#555d66;font-style:italic;margin-bottom:0} |
| | |
| | | /******/ (() => { // webpackBootstrap |
| | | /******/ "use strict"; |
| | | /******/ var __webpack_modules__ = ({ |
| | | |
| | | /***/ "./src/summary/edit.js" |
| | | /*!*****************************!*\ |
| | | !*** ./src/summary/edit.js ***! |
| | | \*****************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| | | /* harmony export */ "default": () => (/* binding */ Edit) |
| | | /* harmony export */ }); |
| | | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| | | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); |
| | | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); |
| | | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); |
| | | /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor.scss */ "./src/summary/editor.scss"); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__); |
| | | /** |
| | | * WordPress dependencies |
| | | */ |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Styles |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * Edit function for Summary Block |
| | | */ |
| | | |
| | | function Edit({ |
| | | attributes, |
| | | setAttributes |
| | | }) { |
| | | const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)(); |
| | | return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", { |
| | | ...blockProps, |
| | | children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { |
| | | className: "jvb-summary-preview", |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("h3", { |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Summary', 'jvb') |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", { |
| | | className: "jvb-list-preview-note", |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This will inherit the current query to build the information from our custom meta on the front end.', 'jvb') |
| | | })] |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/summary/index.js" |
| | | /*!******************************!*\ |
| | | !*** ./src/summary/index.js ***! |
| | | \******************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/summary/style.scss"); |
| | | /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/summary/edit.js"); |
| | | /* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/summary/save.js"); |
| | | /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/summary/block.json"); |
| | | /** |
| | | * Registers a new block provided a unique name and an object defining its behavior. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. |
| | | * All files containing `style` keyword are bundled together. The code used |
| | | * gets applied both to the front of your site and to the editor. |
| | | * |
| | | * @see https://www.npmjs.com/package/@wordpress/scripts#using-css |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * Internal dependencies |
| | | */ |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Every block starts by registering a new block type definition. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ |
| | | */ |
| | | (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, { |
| | | /** |
| | | * @see ./edit.js |
| | | */ |
| | | edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"], |
| | | /** |
| | | * @see ./save.js |
| | | */ |
| | | save: _save__WEBPACK_IMPORTED_MODULE_3__["default"] |
| | | }); |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/summary/save.js" |
| | | /*!*****************************!*\ |
| | | !*** ./src/summary/save.js ***! |
| | | \*****************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| | | /* harmony export */ "default": () => (/* binding */ save) |
| | | /* harmony export */ }); |
| | | function save() { |
| | | return null; // Dynamic block rendered by PHP |
| | | } |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/summary/editor.scss" |
| | | /*!*********************************!*\ |
| | | !*** ./src/summary/editor.scss ***! |
| | | \*********************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | // extracted by mini-css-extract-plugin |
| | | |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/summary/style.scss" |
| | | /*!********************************!*\ |
| | | !*** ./src/summary/style.scss ***! |
| | | \********************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | // extracted by mini-css-extract-plugin |
| | | |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "react/jsx-runtime" |
| | | /*!**********************************!*\ |
| | | !*** external "ReactJSXRuntime" ***! |
| | | \**********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["ReactJSXRuntime"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/block-editor" |
| | | /*!*************************************!*\ |
| | | !*** external ["wp","blockEditor"] ***! |
| | | \*************************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blockEditor"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/blocks" |
| | | /*!********************************!*\ |
| | | !*** external ["wp","blocks"] ***! |
| | | \********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blocks"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/components" |
| | | /*!************************************!*\ |
| | | !*** external ["wp","components"] ***! |
| | | \************************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["components"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/i18n" |
| | | /*!******************************!*\ |
| | | !*** external ["wp","i18n"] ***! |
| | | \******************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["i18n"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/summary/block.json" |
| | | /*!********************************!*\ |
| | | !*** ./src/summary/block.json ***! |
| | | \********************************/ |
| | | (module) { |
| | | |
| | | module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"jvb/summary","title":"Archive Summary","category":"jvb","icon":"align-center","description":"Outputs the information for the given archive page, or the bio for a profile. Pairs well with the feed block.","keywords":["summary","bio","style","term"],"version":"0.9.0","textdomain":"jvb","supports":{"html":false,"align":["wide","full"]},"selectors":{"root":".summary-block"},"styles":[{"name":"default","label":"Default","isDefault":true}],"example":{"attributes":{"listType":"tattoo"}},"render":"file:./render.php","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js"}'); |
| | | |
| | | /***/ } |
| | | |
| | | /******/ }); |
| | | /************************************************************************/ |
| | | /******/ // The module cache |
| | | /******/ var __webpack_module_cache__ = {}; |
| | | /******/ |
| | | /******/ // The require function |
| | | /******/ function __webpack_require__(moduleId) { |
| | | /******/ // Check if module is in cache |
| | | /******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| | | /******/ if (cachedModule !== undefined) { |
| | | /******/ return cachedModule.exports; |
| | | /******/ } |
| | | /******/ // Create a new module (and put it into the cache) |
| | | /******/ var module = __webpack_module_cache__[moduleId] = { |
| | | /******/ // no module.id needed |
| | | /******/ // no module.loaded needed |
| | | /******/ exports: {} |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // Execute the module function |
| | | /******/ if (!(moduleId in __webpack_modules__)) { |
| | | /******/ delete __webpack_module_cache__[moduleId]; |
| | | /******/ var e = new Error("Cannot find module '" + moduleId + "'"); |
| | | /******/ e.code = 'MODULE_NOT_FOUND'; |
| | | /******/ throw e; |
| | | /******/ } |
| | | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| | | /******/ |
| | | /******/ // Return the exports of the module |
| | | /******/ return module.exports; |
| | | /******/ } |
| | | /******/ |
| | | /******/ // expose the modules object (__webpack_modules__) |
| | | /******/ __webpack_require__.m = __webpack_modules__; |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ /* webpack/runtime/chunk loaded */ |
| | | /******/ (() => { |
| | | /******/ var deferred = []; |
| | | /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { |
| | | /******/ if(chunkIds) { |
| | | /******/ priority = priority || 0; |
| | | /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; |
| | | /******/ deferred[i] = [chunkIds, fn, priority]; |
| | | /******/ return; |
| | | /******/ } |
| | | /******/ var notFulfilled = Infinity; |
| | | /******/ for (var i = 0; i < deferred.length; i++) { |
| | | /******/ var [chunkIds, fn, priority] = deferred[i]; |
| | | /******/ var fulfilled = true; |
| | | /******/ for (var j = 0; j < chunkIds.length; j++) { |
| | | /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { |
| | | /******/ chunkIds.splice(j--, 1); |
| | | /******/ } else { |
| | | /******/ fulfilled = false; |
| | | /******/ if(priority < notFulfilled) notFulfilled = priority; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(fulfilled) { |
| | | /******/ deferred.splice(i--, 1) |
| | | /******/ var r = fn(); |
| | | /******/ if (r !== undefined) result = r; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ return result; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/compat get default export */ |
| | | /******/ (() => { |
| | | /******/ // getDefaultExport function for compatibility with non-harmony modules |
| | | /******/ __webpack_require__.n = (module) => { |
| | | /******/ var getter = module && module.__esModule ? |
| | | /******/ () => (module['default']) : |
| | | /******/ () => (module); |
| | | /******/ __webpack_require__.d(getter, { a: getter }); |
| | | /******/ return getter; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/define property getters */ |
| | | /******/ (() => { |
| | | /******/ // define getter functions for harmony exports |
| | | /******/ __webpack_require__.d = (exports, definition) => { |
| | | /******/ for(var key in definition) { |
| | | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| | | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| | | /******/ } |
| | | /******/ } |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| | | /******/ (() => { |
| | | /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/make namespace object */ |
| | | /******/ (() => { |
| | | /******/ // define __esModule on exports |
| | | /******/ __webpack_require__.r = (exports) => { |
| | | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
| | | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| | | /******/ } |
| | | /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/jsonp chunk loading */ |
| | | /******/ (() => { |
| | | /******/ // no baseURI |
| | | /******/ |
| | | /******/ // object to store loaded and loading chunks |
| | | /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched |
| | | /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded |
| | | /******/ var installedChunks = { |
| | | /******/ "summary/index": 0, |
| | | /******/ "summary/style-index": 0 |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // no chunk on demand loading |
| | | /******/ |
| | | /******/ // no prefetching |
| | | /******/ |
| | | /******/ // no preloaded |
| | | /******/ |
| | | /******/ // no HMR |
| | | /******/ |
| | | /******/ // no HMR manifest |
| | | /******/ |
| | | /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); |
| | | /******/ |
| | | /******/ // install a JSONP callback for chunk loading |
| | | /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { |
| | | /******/ var [chunkIds, moreModules, runtime] = data; |
| | | /******/ // add "moreModules" to the modules object, |
| | | /******/ // then flag all "chunkIds" as loaded and fire callback |
| | | /******/ var moduleId, chunkId, i = 0; |
| | | /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { |
| | | /******/ for(moduleId in moreModules) { |
| | | /******/ if(__webpack_require__.o(moreModules, moduleId)) { |
| | | /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(runtime) var result = runtime(__webpack_require__); |
| | | /******/ } |
| | | /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); |
| | | /******/ for(;i < chunkIds.length; i++) { |
| | | /******/ chunkId = chunkIds[i]; |
| | | /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { |
| | | /******/ installedChunks[chunkId][0](); |
| | | /******/ } |
| | | /******/ installedChunks[chunkId] = 0; |
| | | /******/ } |
| | | /******/ return __webpack_require__.O(result); |
| | | /******/ } |
| | | /******/ |
| | | /******/ var chunkLoadingGlobal = globalThis["webpackChunkjvb"] = globalThis["webpackChunkjvb"] || []; |
| | | /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); |
| | | /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); |
| | | /******/ })(); |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ |
| | | /******/ // startup |
| | | /******/ // Load entry module and return exports |
| | | /******/ // This entry module depends on other loaded chunks and execution need to be delayed |
| | | /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["summary/style-index"], () => (__webpack_require__("./src/summary/index.js"))) |
| | | /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); |
| | | /******/ |
| | | /******/ })() |
| | | ; |
| | | //# sourceMappingURL=index.js.map |
| | | (()=>{"use strict";var r,e={955(){const r=window.wp.blocks,e=window.wp.i18n,t=window.wp.blockEditor,n=(window.wp.components,window.ReactJSXRuntime);(0,r.registerBlockType)("jvb/summary",{edit:function({attributes:r,setAttributes:o}){const i=(0,t.useBlockProps)();return(0,n.jsx)("div",{...i,children:(0,n.jsxs)("div",{className:"jvb-summary-preview",children:[(0,n.jsx)("h3",{children:(0,e.__)("Summary","jvb")}),(0,n.jsx)("p",{className:"jvb-list-preview-note",children:(0,e.__)("This will inherit the current query to build the information from our custom meta on the front end.","jvb")})]})})},save:function(){return null}})}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.m=e,r=[],n.O=(e,t,o,i)=>{if(!t){var s=1/0;for(c=0;c<r.length;c++){for(var[t,o,i]=r[c],l=!0,a=0;a<t.length;a++)(!1&i||s>=i)&&Object.keys(n.O).every(r=>n.O[r](t[a]))?t.splice(a--,1):(l=!1,i<s&&(s=i));if(l){r.splice(c--,1);var u=o();void 0!==u&&(e=u)}}return e}i=i||0;for(var c=r.length;c>0&&r[c-1][2]>i;c--)r[c]=r[c-1];r[c]=[t,o,i]},n.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r={592:0,75:0};n.O.j=e=>0===r[e];var e=(e,t)=>{var o,i,[s,l,a]=t,u=0;if(s.some(e=>0!==r[e])){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(a)var c=a(n)}for(e&&e(t);u<s.length;u++)i=s[u],n.o(r,i)&&r[i]&&r[i][0](),r[i]=0;return n.O(c)},t=globalThis.webpackChunkjvb=globalThis.webpackChunkjvb||[];t.forEach(e.bind(null,0)),t.push=e.bind(null,t.push.bind(t))})();var o=n.O(void 0,[75],()=>n(955));o=n.O(o)})(); |
| | |
| | | /*!***********************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/summary/style.scss ***! |
| | | \***********************************************************************************************************************************************************************************************************************************************/ |
| | | details > div { |
| | | margin: 1rem 0; |
| | | } |
| | | |
| | | main > header:not(:has(img)) { |
| | | margin-top: 3rem !important; |
| | | } |
| | | |
| | | header a::before { |
| | | display: none !important; |
| | | } |
| | | |
| | | header + details { |
| | | margin: 1.5rem auto 3rem !important; |
| | | max-width: var(--wide); |
| | | } |
| | | |
| | | main { |
| | | padding-top: 0 !important; |
| | | } |
| | | |
| | | ul.summary .term-list { |
| | | padding-right: 0; |
| | | display: flex; |
| | | flex-wrap: nowrap; |
| | | } |
| | | details>div{margin:1rem 0}main>header:not(:has(img)){margin-top:3rem!important}header a:before{display:none!important}header+details{margin:1.5rem auto 3rem!important;max-width:var(--wide)}main{padding-top:0!important}ul.summary .term-list{display:flex;flex-wrap:nowrap;padding-right:0} |
| | |
| | | /*!***********************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/summary/style.scss ***! |
| | | \***********************************************************************************************************************************************************************************************************************************************/ |
| | | details > div { |
| | | margin: 1rem 0; |
| | | } |
| | | |
| | | main > header:not(:has(img)) { |
| | | margin-top: 3rem !important; |
| | | } |
| | | |
| | | header a::before { |
| | | display: none !important; |
| | | } |
| | | |
| | | header + details { |
| | | margin: 1.5rem auto 3rem !important; |
| | | max-width: var(--wide); |
| | | } |
| | | |
| | | main { |
| | | padding-top: 0 !important; |
| | | } |
| | | |
| | | ul.summary .term-list { |
| | | padding-left: 0; |
| | | display: flex; |
| | | flex-wrap: nowrap; |
| | | } |
| | | |
| | | /*# sourceMappingURL=style-index.css.map*/ |
| | | details>div{margin:1rem 0}main>header:not(:has(img)){margin-top:3rem!important}header a:before{display:none!important}header+details{margin:1.5rem auto 3rem!important;max-width:var(--wide)}main{padding-top:0!important}ul.summary .term-list{display:flex;flex-wrap:nowrap;padding-left:0} |
| | |
| | | <?php return array('dependencies' => array(), 'version' => '36101a3ecdf0d3b75d47'); |
| | | <?php return array('dependencies' => array(), 'version' => '31d6cfe0d16ae931b73c'); |
| | |
| | | /******/ (() => { // webpackBootstrap |
| | | /*!*****************************!*\ |
| | | !*** ./src/summary/view.js ***! |
| | | \*****************************/ |
| | | |
| | | /******/ })() |
| | | ; |
| | |
| | | /*!*************************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/timeline/editor.scss ***! |
| | | \*************************************************************************************************************************************************************************************************************************************************/ |
| | | |
| | |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => '1af5090201888138cb2b'); |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => '52e1cf3b8eb73003e597'); |
| | |
| | | /*!*************************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/timeline/editor.scss ***! |
| | | \*************************************************************************************************************************************************************************************************************************************************/ |
| | | |
| | |
| | | /******/ (() => { // webpackBootstrap |
| | | /******/ "use strict"; |
| | | /******/ var __webpack_modules__ = ({ |
| | | |
| | | /***/ "./src/timeline/edit.js" |
| | | /*!******************************!*\ |
| | | !*** ./src/timeline/edit.js ***! |
| | | \******************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| | | /* harmony export */ "default": () => (/* binding */ Edit) |
| | | /* harmony export */ }); |
| | | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| | | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); |
| | | /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/timeline/editor.scss"); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__); |
| | | /** |
| | | * Retrieves the translation of text. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/ |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * React hook that is used to mark the block wrapper element. |
| | | * It provides all the necessary props like the class name. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. |
| | | * Those files can contain any CSS code that gets applied to the editor. |
| | | * |
| | | * @see https://www.npmjs.com/package/@wordpress/scripts#using-css |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * The edit function describes the structure of your block in the context of the |
| | | * editor. This represents what the editor will render when the block is used. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit |
| | | * |
| | | * @return {Element} Element to render. |
| | | */ |
| | | |
| | | function Edit() { |
| | | return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", { |
| | | ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)(), |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Will output the timeline', 'jvb') |
| | | }); |
| | | } |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/timeline/index.js" |
| | | /*!*******************************!*\ |
| | | !*** ./src/timeline/index.js ***! |
| | | \*******************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/timeline/style.scss"); |
| | | /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/timeline/edit.js"); |
| | | /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block.json */ "./src/timeline/block.json"); |
| | | /** |
| | | * Registers a new block provided a unique name and an object defining its behavior. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. |
| | | * All files containing `style` keyword are bundled together. The code used |
| | | * gets applied both to the front of your site and to the editor. |
| | | * |
| | | * @see https://www.npmjs.com/package/@wordpress/scripts#using-css |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * Internal dependencies |
| | | */ |
| | | |
| | | |
| | | |
| | | /** |
| | | * Every block starts by registering a new block type definition. |
| | | * |
| | | * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ |
| | | */ |
| | | (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_3__.name, { |
| | | /** |
| | | * @see ./edit.js |
| | | */ |
| | | edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"] |
| | | }); |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/timeline/editor.scss" |
| | | /*!**********************************!*\ |
| | | !*** ./src/timeline/editor.scss ***! |
| | | \**********************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | // extracted by mini-css-extract-plugin |
| | | |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/timeline/style.scss" |
| | | /*!*********************************!*\ |
| | | !*** ./src/timeline/style.scss ***! |
| | | \*********************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | // extracted by mini-css-extract-plugin |
| | | |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "react/jsx-runtime" |
| | | /*!**********************************!*\ |
| | | !*** external "ReactJSXRuntime" ***! |
| | | \**********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["ReactJSXRuntime"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/block-editor" |
| | | /*!*************************************!*\ |
| | | !*** external ["wp","blockEditor"] ***! |
| | | \*************************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blockEditor"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/blocks" |
| | | /*!********************************!*\ |
| | | !*** external ["wp","blocks"] ***! |
| | | \********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blocks"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/i18n" |
| | | /*!******************************!*\ |
| | | !*** external ["wp","i18n"] ***! |
| | | \******************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["i18n"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/timeline/block.json" |
| | | /*!*********************************!*\ |
| | | !*** ./src/timeline/block.json ***! |
| | | \*********************************/ |
| | | (module) { |
| | | |
| | | module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"jvb/timeline","version":"0.1.0","title":"Timeline","category":"jvb","icon":"shortcode","description":"Outputs a single timeline post in a cool way","example":{},"supports":{"html":false,"align":["wide","full"]},"textdomain":"jvb","selectors":{"root":".timeline"},"editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js"}'); |
| | | |
| | | /***/ } |
| | | |
| | | /******/ }); |
| | | /************************************************************************/ |
| | | /******/ // The module cache |
| | | /******/ var __webpack_module_cache__ = {}; |
| | | /******/ |
| | | /******/ // The require function |
| | | /******/ function __webpack_require__(moduleId) { |
| | | /******/ // Check if module is in cache |
| | | /******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| | | /******/ if (cachedModule !== undefined) { |
| | | /******/ return cachedModule.exports; |
| | | /******/ } |
| | | /******/ // Create a new module (and put it into the cache) |
| | | /******/ var module = __webpack_module_cache__[moduleId] = { |
| | | /******/ // no module.id needed |
| | | /******/ // no module.loaded needed |
| | | /******/ exports: {} |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // Execute the module function |
| | | /******/ if (!(moduleId in __webpack_modules__)) { |
| | | /******/ delete __webpack_module_cache__[moduleId]; |
| | | /******/ var e = new Error("Cannot find module '" + moduleId + "'"); |
| | | /******/ e.code = 'MODULE_NOT_FOUND'; |
| | | /******/ throw e; |
| | | /******/ } |
| | | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| | | /******/ |
| | | /******/ // Return the exports of the module |
| | | /******/ return module.exports; |
| | | /******/ } |
| | | /******/ |
| | | /******/ // expose the modules object (__webpack_modules__) |
| | | /******/ __webpack_require__.m = __webpack_modules__; |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ /* webpack/runtime/chunk loaded */ |
| | | /******/ (() => { |
| | | /******/ var deferred = []; |
| | | /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { |
| | | /******/ if(chunkIds) { |
| | | /******/ priority = priority || 0; |
| | | /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; |
| | | /******/ deferred[i] = [chunkIds, fn, priority]; |
| | | /******/ return; |
| | | /******/ } |
| | | /******/ var notFulfilled = Infinity; |
| | | /******/ for (var i = 0; i < deferred.length; i++) { |
| | | /******/ var [chunkIds, fn, priority] = deferred[i]; |
| | | /******/ var fulfilled = true; |
| | | /******/ for (var j = 0; j < chunkIds.length; j++) { |
| | | /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { |
| | | /******/ chunkIds.splice(j--, 1); |
| | | /******/ } else { |
| | | /******/ fulfilled = false; |
| | | /******/ if(priority < notFulfilled) notFulfilled = priority; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(fulfilled) { |
| | | /******/ deferred.splice(i--, 1) |
| | | /******/ var r = fn(); |
| | | /******/ if (r !== undefined) result = r; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ return result; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/compat get default export */ |
| | | /******/ (() => { |
| | | /******/ // getDefaultExport function for compatibility with non-harmony modules |
| | | /******/ __webpack_require__.n = (module) => { |
| | | /******/ var getter = module && module.__esModule ? |
| | | /******/ () => (module['default']) : |
| | | /******/ () => (module); |
| | | /******/ __webpack_require__.d(getter, { a: getter }); |
| | | /******/ return getter; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/define property getters */ |
| | | /******/ (() => { |
| | | /******/ // define getter functions for harmony exports |
| | | /******/ __webpack_require__.d = (exports, definition) => { |
| | | /******/ for(var key in definition) { |
| | | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| | | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| | | /******/ } |
| | | /******/ } |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| | | /******/ (() => { |
| | | /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/make namespace object */ |
| | | /******/ (() => { |
| | | /******/ // define __esModule on exports |
| | | /******/ __webpack_require__.r = (exports) => { |
| | | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
| | | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| | | /******/ } |
| | | /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/jsonp chunk loading */ |
| | | /******/ (() => { |
| | | /******/ // no baseURI |
| | | /******/ |
| | | /******/ // object to store loaded and loading chunks |
| | | /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched |
| | | /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded |
| | | /******/ var installedChunks = { |
| | | /******/ "timeline/index": 0, |
| | | /******/ "timeline/style-index": 0 |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // no chunk on demand loading |
| | | /******/ |
| | | /******/ // no prefetching |
| | | /******/ |
| | | /******/ // no preloaded |
| | | /******/ |
| | | /******/ // no HMR |
| | | /******/ |
| | | /******/ // no HMR manifest |
| | | /******/ |
| | | /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); |
| | | /******/ |
| | | /******/ // install a JSONP callback for chunk loading |
| | | /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { |
| | | /******/ var [chunkIds, moreModules, runtime] = data; |
| | | /******/ // add "moreModules" to the modules object, |
| | | /******/ // then flag all "chunkIds" as loaded and fire callback |
| | | /******/ var moduleId, chunkId, i = 0; |
| | | /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { |
| | | /******/ for(moduleId in moreModules) { |
| | | /******/ if(__webpack_require__.o(moreModules, moduleId)) { |
| | | /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(runtime) var result = runtime(__webpack_require__); |
| | | /******/ } |
| | | /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); |
| | | /******/ for(;i < chunkIds.length; i++) { |
| | | /******/ chunkId = chunkIds[i]; |
| | | /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { |
| | | /******/ installedChunks[chunkId][0](); |
| | | /******/ } |
| | | /******/ installedChunks[chunkId] = 0; |
| | | /******/ } |
| | | /******/ return __webpack_require__.O(result); |
| | | /******/ } |
| | | /******/ |
| | | /******/ var chunkLoadingGlobal = globalThis["webpackChunkjvb"] = globalThis["webpackChunkjvb"] || []; |
| | | /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); |
| | | /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); |
| | | /******/ })(); |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ |
| | | /******/ // startup |
| | | /******/ // Load entry module and return exports |
| | | /******/ // This entry module depends on other loaded chunks and execution need to be delayed |
| | | /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["timeline/style-index"], () => (__webpack_require__("./src/timeline/index.js"))) |
| | | /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); |
| | | /******/ |
| | | /******/ })() |
| | | ; |
| | | //# sourceMappingURL=index.js.map |
| | | (()=>{"use strict";var r,e={798(){const r=window.wp.blocks,e=window.wp.i18n,o=window.wp.blockEditor,i=window.ReactJSXRuntime,t=JSON.parse('{"UU":"jvb/timeline"}');(0,r.registerBlockType)(t.UU,{edit:function(){return(0,i.jsx)("p",{...(0,o.useBlockProps)(),children:(0,e.__)("Will output the timeline","jvb")})}})}},o={};function i(r){var t=o[r];if(void 0!==t)return t.exports;var n=o[r]={exports:{}};return e[r](n,n.exports,i),n.exports}i.m=e,r=[],i.O=(e,o,t,n)=>{if(!o){var l=1/0;for(v=0;v<r.length;v++){for(var[o,t,n]=r[v],s=!0,a=0;a<o.length;a++)(!1&n||l>=n)&&Object.keys(i.O).every(r=>i.O[r](o[a]))?o.splice(a--,1):(s=!1,n<l&&(l=n));if(s){r.splice(v--,1);var p=t();void 0!==p&&(e=p)}}return e}n=n||0;for(var v=r.length;v>0&&r[v-1][2]>n;v--)r[v]=r[v-1];r[v]=[o,t,n]},i.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r={643:0,627:0};i.O.j=e=>0===r[e];var e=(e,o)=>{var t,n,[l,s,a]=o,p=0;if(l.some(e=>0!==r[e])){for(t in s)i.o(s,t)&&(i.m[t]=s[t]);if(a)var v=a(i)}for(e&&e(o);p<l.length;p++)n=l[p],i.o(r,n)&&r[n]&&r[n][0](),r[n]=0;return i.O(v)},o=globalThis.webpackChunkjvb=globalThis.webpackChunkjvb||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))})();var t=i.O(void 0,[627],()=>i(798));t=i.O(t)})(); |
| | |
| | | /*!************************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/timeline/style.scss ***! |
| | | \************************************************************************************************************************************************************************************************************************************************/ |
| | | main { |
| | | --gap: 0; |
| | | } |
| | | main section:last-of-type { |
| | | margin-bottom: 0; |
| | | } |
| | | #at-a-glance { |
| | | padding: 0 10vw; |
| | | --gap: 0; |
| | | } |
| | | #at-a-glance img { |
| | | width: 100%; |
| | | height: auto; |
| | | border: 2px solid rgb(var(--action-0)); |
| | | } |
| | | #at-a-glance h3 { |
| | | font-size: var(--txt-x-small); |
| | | } |
| | | #at-a-glance .before img { |
| | | border-left-width: 1px; |
| | | border-right: 0; |
| | | border-top: 0; |
| | | } |
| | | #at-a-glance .after img { |
| | | border-right-width: 1px; |
| | | border-left: 0; |
| | | border-bottom: 0; |
| | | } |
| | | .timeline-point.timeline-point { |
| | | --lineWidth: 1px; |
| | | --gap: 2rem; |
| | | padding: 0; |
| | | margin: 0; |
| | | background-color: rgb(var(--base)); |
| | | max-width: 100vw; |
| | | position: relative; |
| | | overflow: hidden; |
| | | } |
| | | .timeline-point.timeline-point img { |
| | | width: 40%; |
| | | border-radius: 4px; |
| | | position: sticky; |
| | | padding: 0.5rem; |
| | | } |
| | | .timeline-point.timeline-point .info { |
| | | padding: 1rem 0.5rem 0.5rem; |
| | | width: 60%; |
| | | position: relative; |
| | | } |
| | | .timeline-point.timeline-point .info h2 { |
| | | margin: 0 0 0.5rem; |
| | | font-size: var(--txt-medium); |
| | | position: relative; |
| | | } |
| | | .timeline-point.timeline-point .info h2 .icon { |
| | | --w: 2.5rem; |
| | | transform: rotate(90deg); |
| | | position: absolute; |
| | | right: -2.5rem; |
| | | top: 0.25rem; |
| | | background-color: rgb(var(--action-100)); |
| | | } |
| | | .timeline-point.timeline-point::before, .timeline-point.timeline-point::after { |
| | | content: ""; |
| | | display: block; |
| | | position: absolute; |
| | | right: 45%; |
| | | height: 100%; |
| | | width: var(--lineWidth); |
| | | background-color: rgb(var(--action-0)); |
| | | } |
| | | .timeline-point.timeline-point::before { |
| | | height: 1rem; |
| | | } |
| | | .timeline-point.timeline-point::after { |
| | | top: 4rem; |
| | | } |
| | | .timeline-point.timeline-point#before-treatment::before, .timeline-point.timeline-point:last-of-type::after { |
| | | display: none; |
| | | } |
| | | @media (min-width: 768px) { |
| | | #at-a-glance h3 { |
| | | font-size: var(--txt-x-large); |
| | | } |
| | | .timeline-point.timeline-point { |
| | | --gap: 4rem; |
| | | } |
| | | .timeline-point.timeline-point img { |
| | | width: 50%; |
| | | } |
| | | .timeline-point.timeline-point .info { |
| | | width: 50%; |
| | | padding: 25vh 1rem 1rem; |
| | | } |
| | | .timeline-point.timeline-point .info h2 .icon { |
| | | --w: 4rem; |
| | | right: -6.15rem; |
| | | top: 0; |
| | | } |
| | | .timeline-point.timeline-point .info a { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | align-items: center; |
| | | } |
| | | .timeline-point.timeline-point .info time { |
| | | text-transform: uppercase; |
| | | font-size: var(--txt-x-small); |
| | | } |
| | | .timeline-point.timeline-point::before, .timeline-point.timeline-point::after { |
| | | right: calc(50% + 2rem); |
| | | } |
| | | .timeline-point.timeline-point::before { |
| | | height: calc(25vh - 2rem); |
| | | } |
| | | .timeline-point.timeline-point::after { |
| | | top: calc(25vh + 6rem); |
| | | } |
| | | } |
| | | main{--gap:0}main section:last-of-type{margin-bottom:0}#at-a-glance{padding:0 10vw;--gap:0}#at-a-glance img{border:2px solid rgb(var(--action-0));height:auto;width:100%}#at-a-glance h3{font-size:var(--txt-x-small)}#at-a-glance .before img{border-right:0;border-left-width:1px;border-top:0}#at-a-glance .after img{border-bottom:0;border-right-width:1px;border-left:0}main>header{grid-column:wider}main>header ul.timeline.terms{font-size:var(--txt-x-small);margin:0;max-width:none}main>header .buttons{margin-bottom:0}.timeline-point.timeline-point.row{--lineWidth:1px;--gap:2rem;background-color:rgb(var(--base));margin:0;max-width:100vw;padding:0;position:relative}.timeline-point.timeline-point.row img{border-radius:4px;padding:.5rem;position:sticky;width:40%}.timeline-point.timeline-point.row .info{padding:1rem .5rem .5rem;position:relative;width:60%}.timeline-point.timeline-point.row .info .icon-logo-triangle{--w:2.2rem;background-color:rgb(var(--action-100));right:-3rem;position:absolute;top:.25rem;transform:rotate(90deg)}.timeline-point.timeline-point.row .info h2{font-size:var(--txt-medium);margin:0 0 .5rem;position:relative}.timeline-point.timeline-point.row .term-list{font-size:var(--txt-x-small);margin:0}.timeline-point.timeline-point.row .term-list li{display:block}.timeline-point.timeline-point.row .term-list li a{vertical-align:top}.timeline-point.timeline-point.row:after,.timeline-point.timeline-point.row:before{background-color:rgb(var(--action-0));content:"";display:block;height:100%;right:45%;position:absolute;width:var(--lineWidth)}.timeline-point.timeline-point.row:before{height:1rem}.timeline-point.timeline-point.row:after{top:4.25rem}.timeline-point.timeline-point.row#before-treatment:before,.timeline-point.timeline-point.row:last-of-type:after{display:none}@media(min-width:768px){#at-a-glance h3{font-size:var(--txt-x-large)}.timeline-point.timeline-point.row{--gap:4rem}.timeline-point.timeline-point.row img{width:50%}.timeline-point.timeline-point.row .info{padding:25vh 1rem 1rem;width:50%}.timeline-point.timeline-point.row .info h2 .icon{--w:4rem;right:-6.15rem;top:0}.timeline-point.timeline-point.row .info small{align-items:center;display:inline-flex;flex-wrap:wrap;gap:.25rem}.timeline-point.timeline-point.row .info a{align-items:center;display:flex;flex-wrap:wrap}.timeline-point.timeline-point.row .info time{font-size:var(--txt-x-small);text-transform:uppercase}.timeline-point.timeline-point.row:after,.timeline-point.timeline-point.row:before{right:calc(50% + 2rem)}.timeline-point.timeline-point.row:before{height:calc(25vh - 2rem)}.timeline-point.timeline-point.row:after{top:calc(25vh + 6rem)}} |
| | |
| | | /*!************************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/timeline/style.scss ***! |
| | | \************************************************************************************************************************************************************************************************************************************************/ |
| | | main { |
| | | --gap: 0; |
| | | } |
| | | main section:last-of-type { |
| | | margin-bottom: 0; |
| | | } |
| | | #at-a-glance { |
| | | padding: 0 10vw; |
| | | --gap: 0; |
| | | } |
| | | #at-a-glance img { |
| | | width: 100%; |
| | | height: auto; |
| | | border: 2px solid rgb(var(--action-0)); |
| | | } |
| | | #at-a-glance h3 { |
| | | font-size: var(--txt-x-small); |
| | | } |
| | | #at-a-glance .before img { |
| | | border-right-width: 1px; |
| | | border-left: 0; |
| | | border-top: 0; |
| | | } |
| | | #at-a-glance .after img { |
| | | border-left-width: 1px; |
| | | border-right: 0; |
| | | border-bottom: 0; |
| | | } |
| | | .timeline-point.timeline-point { |
| | | --lineWidth: 1px; |
| | | --gap: 2rem; |
| | | padding: 0; |
| | | margin: 0; |
| | | background-color: rgb(var(--base)); |
| | | max-width: 100vw; |
| | | position: relative; |
| | | overflow: hidden; |
| | | } |
| | | .timeline-point.timeline-point img { |
| | | width: 40%; |
| | | border-radius: 4px; |
| | | position: sticky; |
| | | padding: 0.5rem; |
| | | } |
| | | .timeline-point.timeline-point .info { |
| | | padding: 1rem 0.5rem 0.5rem; |
| | | width: 60%; |
| | | position: relative; |
| | | } |
| | | .timeline-point.timeline-point .info h2 { |
| | | margin: 0 0 0.5rem; |
| | | font-size: var(--txt-medium); |
| | | position: relative; |
| | | } |
| | | .timeline-point.timeline-point .info h2 .icon { |
| | | --w: 2.5rem; |
| | | transform: rotate(-90deg); |
| | | position: absolute; |
| | | left: -2.5rem; |
| | | top: 0.25rem; |
| | | background-color: rgb(var(--action-100)); |
| | | } |
| | | .timeline-point.timeline-point::before, .timeline-point.timeline-point::after { |
| | | content: ""; |
| | | display: block; |
| | | position: absolute; |
| | | left: 45%; |
| | | height: 100%; |
| | | width: var(--lineWidth); |
| | | background-color: rgb(var(--action-0)); |
| | | } |
| | | .timeline-point.timeline-point::before { |
| | | height: 1rem; |
| | | } |
| | | .timeline-point.timeline-point::after { |
| | | top: 4rem; |
| | | } |
| | | .timeline-point.timeline-point#before-treatment::before, .timeline-point.timeline-point:last-of-type::after { |
| | | display: none; |
| | | } |
| | | @media (min-width: 768px) { |
| | | #at-a-glance h3 { |
| | | font-size: var(--txt-x-large); |
| | | } |
| | | .timeline-point.timeline-point { |
| | | --gap: 4rem; |
| | | } |
| | | .timeline-point.timeline-point img { |
| | | width: 50%; |
| | | } |
| | | .timeline-point.timeline-point .info { |
| | | width: 50%; |
| | | padding: 25vh 1rem 1rem; |
| | | } |
| | | .timeline-point.timeline-point .info h2 .icon { |
| | | --w: 4rem; |
| | | left: -6.15rem; |
| | | top: 0; |
| | | } |
| | | .timeline-point.timeline-point .info a { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | align-items: center; |
| | | } |
| | | .timeline-point.timeline-point .info time { |
| | | text-transform: uppercase; |
| | | font-size: var(--txt-x-small); |
| | | } |
| | | .timeline-point.timeline-point::before, .timeline-point.timeline-point::after { |
| | | left: calc(50% + 2rem); |
| | | } |
| | | .timeline-point.timeline-point::before { |
| | | height: calc(25vh - 2rem); |
| | | } |
| | | .timeline-point.timeline-point::after { |
| | | top: calc(25vh + 6rem); |
| | | } |
| | | } |
| | | |
| | | /*# sourceMappingURL=style-index.css.map*/ |
| | | main{--gap:0}main section:last-of-type{margin-bottom:0}#at-a-glance{padding:0 10vw;--gap:0}#at-a-glance img{border:2px solid rgb(var(--action-0));height:auto;width:100%}#at-a-glance h3{font-size:var(--txt-x-small)}#at-a-glance .before img{border-left:0;border-right-width:1px;border-top:0}#at-a-glance .after img{border-bottom:0;border-left-width:1px;border-right:0}main>header{grid-column:wider}main>header ul.timeline.terms{font-size:var(--txt-x-small);margin:0;max-width:none}main>header .buttons{margin-bottom:0}.timeline-point.timeline-point.row{--lineWidth:1px;--gap:2rem;background-color:rgb(var(--base));margin:0;max-width:100vw;padding:0;position:relative}.timeline-point.timeline-point.row img{border-radius:4px;padding:.5rem;position:sticky;width:40%}.timeline-point.timeline-point.row .info{padding:1rem .5rem .5rem;position:relative;width:60%}.timeline-point.timeline-point.row .info .icon-logo-triangle{--w:2.2rem;background-color:rgb(var(--action-100));left:-3rem;position:absolute;top:.25rem;transform:rotate(-90deg)}.timeline-point.timeline-point.row .info h2{font-size:var(--txt-medium);margin:0 0 .5rem;position:relative}.timeline-point.timeline-point.row .term-list{font-size:var(--txt-x-small);margin:0}.timeline-point.timeline-point.row .term-list li{display:block}.timeline-point.timeline-point.row .term-list li a{vertical-align:top}.timeline-point.timeline-point.row:after,.timeline-point.timeline-point.row:before{background-color:rgb(var(--action-0));content:"";display:block;height:100%;left:45%;position:absolute;width:var(--lineWidth)}.timeline-point.timeline-point.row:before{height:1rem}.timeline-point.timeline-point.row:after{top:4.25rem}.timeline-point.timeline-point.row#before-treatment:before,.timeline-point.timeline-point.row:last-of-type:after{display:none}@media(min-width:768px){#at-a-glance h3{font-size:var(--txt-x-large)}.timeline-point.timeline-point.row{--gap:4rem}.timeline-point.timeline-point.row img{width:50%}.timeline-point.timeline-point.row .info{padding:25vh 1rem 1rem;width:50%}.timeline-point.timeline-point.row .info h2 .icon{--w:4rem;left:-6.15rem;top:0}.timeline-point.timeline-point.row .info small{align-items:center;display:inline-flex;flex-wrap:wrap;gap:.25rem}.timeline-point.timeline-point.row .info a{align-items:center;display:flex;flex-wrap:wrap}.timeline-point.timeline-point.row .info time{font-size:var(--txt-x-small);text-transform:uppercase}.timeline-point.timeline-point.row:after,.timeline-point.timeline-point.row:before{left:calc(50% + 2rem)}.timeline-point.timeline-point.row:before{height:calc(25vh - 2rem)}.timeline-point.timeline-point.row:after{top:calc(25vh + 6rem)}} |
| | |
| | | <?php return array('dependencies' => array(), 'version' => '15793ef55a73b3a89877'); |
| | | <?php return array('dependencies' => array(), 'version' => '31d6cfe0d16ae931b73c'); |
| | |
| | | /******/ (() => { // webpackBootstrap |
| | | /*!******************************!*\ |
| | | !*** ./src/timeline/view.js ***! |
| | | \******************************/ |
| | | |
| | | /******/ })() |
| | | ; |
| | |
| | | /*!**********************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/video/editor.scss ***! |
| | | \**********************************************************************************************************************************************************************************************************************************************/ |
| | | /* editor.scss */ |
| | | .video-cover-editor { |
| | | position: relative; |
| | | min-height: 200px; |
| | | background: #f0f0f0; |
| | | border: 2px dashed #ccc; |
| | | border-radius: 4px; |
| | | } |
| | | .video-cover-editor .video-cover-preview { |
| | | position: relative; |
| | | width: 100%; |
| | | min-height: 300px; |
| | | } |
| | | .video-cover-editor .video-cover-preview img { |
| | | width: 100%; |
| | | height: auto; |
| | | display: block; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-overlay-preview { |
| | | position: absolute; |
| | | top: 0; |
| | | right: 0; |
| | | left: 0; |
| | | bottom: 0; |
| | | background: rgb(0, 0, 0); |
| | | pointer-events: none; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview { |
| | | position: absolute; |
| | | top: 0; |
| | | right: 0; |
| | | left: 0; |
| | | bottom: 0; |
| | | display: flex; |
| | | z-index: 2; |
| | | padding: 2rem; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview.align-top-left { |
| | | align-items: flex-start; |
| | | justify-content: flex-start; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview.align-top-center { |
| | | align-items: flex-start; |
| | | justify-content: center; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview.align-top-right { |
| | | align-items: flex-start; |
| | | justify-content: flex-end; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview.align-center-left { |
| | | align-items: center; |
| | | justify-content: flex-start; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview.align-center { |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview.align-center-right { |
| | | align-items: center; |
| | | justify-content: flex-end; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview.align-bottom-left { |
| | | align-items: flex-end; |
| | | justify-content: flex-start; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview.align-bottom-center { |
| | | align-items: flex-end; |
| | | justify-content: center; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview.align-bottom-right { |
| | | align-items: flex-end; |
| | | justify-content: flex-end; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content { |
| | | width: 100%; |
| | | max-width: 1200px; |
| | | color: white; |
| | | text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h1, .video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h2, .video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h3, .video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h4, .video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h5, .video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h6 { |
| | | color: white; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content p { |
| | | color: white; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-info { |
| | | position: absolute; |
| | | bottom: 0; |
| | | right: 0; |
| | | left: 0; |
| | | background: rgba(0, 0, 0, 0.7); |
| | | color: white; |
| | | padding: 10px; |
| | | font-size: 14px; |
| | | z-index: 3; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-info p { |
| | | margin: 0; |
| | | } |
| | | .video-cover-editor .video-cover-placeholder { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | min-height: 200px; |
| | | color: #666; |
| | | font-size: 16px; |
| | | } |
| | | .video-source-list { |
| | | list-style: none; |
| | | margin: 10px 0; |
| | | padding: 0; |
| | | } |
| | | .video-source-list .video-source-item { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 8px 12px; |
| | | background: #f5f5f5; |
| | | border-radius: 4px; |
| | | margin-bottom: 5px; |
| | | } |
| | | .video-source-list .video-source-item .video-source-mime { |
| | | font-family: monospace; |
| | | font-size: 13px; |
| | | } |
| | | .video-cover-editor{background:#f0f0f0;border:2px dashed #ccc;border-radius:4px;min-height:200px;position:relative}.video-cover-editor .video-cover-preview{min-height:300px;position:relative;width:100%}.video-cover-editor .video-cover-preview img{display:block;height:auto;width:100%}.video-cover-editor .video-cover-preview .video-overlay-preview{background:#000;bottom:0;right:0;pointer-events:none;position:absolute;left:0;top:0}.video-cover-editor .video-cover-preview .video-cover-content-preview{bottom:0;display:flex;right:0;padding:2rem;position:absolute;left:0;top:0;z-index:2}.video-cover-editor .video-cover-preview .video-cover-content-preview.align-top-left{align-items:flex-start;justify-content:flex-start}.video-cover-editor .video-cover-preview .video-cover-content-preview.align-top-center{align-items:flex-start;justify-content:center}.video-cover-editor .video-cover-preview .video-cover-content-preview.align-top-right{align-items:flex-start;justify-content:flex-end}.video-cover-editor .video-cover-preview .video-cover-content-preview.align-center-left{align-items:center;justify-content:flex-start}.video-cover-editor .video-cover-preview .video-cover-content-preview.align-center{align-items:center;justify-content:center}.video-cover-editor .video-cover-preview .video-cover-content-preview.align-center-right{align-items:center;justify-content:flex-end}.video-cover-editor .video-cover-preview .video-cover-content-preview.align-bottom-left{align-items:flex-end;justify-content:flex-start}.video-cover-editor .video-cover-preview .video-cover-content-preview.align-bottom-center{align-items:flex-end;justify-content:center}.video-cover-editor .video-cover-preview .video-cover-content-preview.align-bottom-right{align-items:flex-end;justify-content:flex-end}.video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content{color:#fff;max-width:1200px;text-shadow:0 2px 4px rgba(0,0,0,.5);width:100%}.video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h1,.video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h2,.video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h3,.video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h4,.video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h5,.video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h6,.video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content p{color:#fff}.video-cover-editor .video-cover-preview .video-info{background:rgba(0,0,0,.7);bottom:0;color:#fff;font-size:14px;right:0;padding:10px;position:absolute;left:0;z-index:3}.video-cover-editor .video-cover-preview .video-info p{margin:0}.video-cover-editor .video-cover-placeholder{align-items:center;color:#666;display:flex;font-size:16px;justify-content:center;min-height:200px}.video-source-list{list-style:none;margin:10px 0;padding:0}.video-source-list .video-source-item{align-items:center;background:#f5f5f5;border-radius:4px;display:flex;justify-content:space-between;margin-bottom:5px;padding:8px 12px}.video-source-list .video-source-item .video-source-mime{font-family:monospace;font-size:13px} |
| | |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '96181be3142bbc60239d'); |
| | | <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => 'c48f86c4435d0e281940'); |
| | |
| | | /*!**********************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/video/editor.scss ***! |
| | | \**********************************************************************************************************************************************************************************************************************************************/ |
| | | /* editor.scss */ |
| | | .video-cover-editor { |
| | | position: relative; |
| | | min-height: 200px; |
| | | background: #f0f0f0; |
| | | border: 2px dashed #ccc; |
| | | border-radius: 4px; |
| | | } |
| | | .video-cover-editor .video-cover-preview { |
| | | position: relative; |
| | | width: 100%; |
| | | min-height: 300px; |
| | | } |
| | | .video-cover-editor .video-cover-preview img { |
| | | width: 100%; |
| | | height: auto; |
| | | display: block; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-overlay-preview { |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background: rgb(0, 0, 0); |
| | | pointer-events: none; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview { |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | display: flex; |
| | | z-index: 2; |
| | | padding: 2rem; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview.align-top-left { |
| | | align-items: flex-start; |
| | | justify-content: flex-start; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview.align-top-center { |
| | | align-items: flex-start; |
| | | justify-content: center; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview.align-top-right { |
| | | align-items: flex-start; |
| | | justify-content: flex-end; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview.align-center-left { |
| | | align-items: center; |
| | | justify-content: flex-start; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview.align-center { |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview.align-center-right { |
| | | align-items: center; |
| | | justify-content: flex-end; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview.align-bottom-left { |
| | | align-items: flex-end; |
| | | justify-content: flex-start; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview.align-bottom-center { |
| | | align-items: flex-end; |
| | | justify-content: center; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview.align-bottom-right { |
| | | align-items: flex-end; |
| | | justify-content: flex-end; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content { |
| | | width: 100%; |
| | | max-width: 1200px; |
| | | color: white; |
| | | text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h1, .video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h2, .video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h3, .video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h4, .video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h5, .video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h6 { |
| | | color: white; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content p { |
| | | color: white; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-info { |
| | | position: absolute; |
| | | bottom: 0; |
| | | left: 0; |
| | | right: 0; |
| | | background: rgba(0, 0, 0, 0.7); |
| | | color: white; |
| | | padding: 10px; |
| | | font-size: 14px; |
| | | z-index: 3; |
| | | } |
| | | .video-cover-editor .video-cover-preview .video-info p { |
| | | margin: 0; |
| | | } |
| | | .video-cover-editor .video-cover-placeholder { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | min-height: 200px; |
| | | color: #666; |
| | | font-size: 16px; |
| | | } |
| | | .video-source-list { |
| | | list-style: none; |
| | | margin: 10px 0; |
| | | padding: 0; |
| | | } |
| | | .video-source-list .video-source-item { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 8px 12px; |
| | | background: #f5f5f5; |
| | | border-radius: 4px; |
| | | margin-bottom: 5px; |
| | | } |
| | | .video-source-list .video-source-item .video-source-mime { |
| | | font-family: monospace; |
| | | font-size: 13px; |
| | | } |
| | | |
| | | /*# sourceMappingURL=index.css.map*/ |
| | | .video-cover-editor{background:#f0f0f0;border:2px dashed #ccc;border-radius:4px;min-height:200px;position:relative}.video-cover-editor .video-cover-preview{min-height:300px;position:relative;width:100%}.video-cover-editor .video-cover-preview img{display:block;height:auto;width:100%}.video-cover-editor .video-cover-preview .video-overlay-preview{background:#000;bottom:0;left:0;pointer-events:none;position:absolute;right:0;top:0}.video-cover-editor .video-cover-preview .video-cover-content-preview{bottom:0;display:flex;left:0;padding:2rem;position:absolute;right:0;top:0;z-index:2}.video-cover-editor .video-cover-preview .video-cover-content-preview.align-top-left{align-items:flex-start;justify-content:flex-start}.video-cover-editor .video-cover-preview .video-cover-content-preview.align-top-center{align-items:flex-start;justify-content:center}.video-cover-editor .video-cover-preview .video-cover-content-preview.align-top-right{align-items:flex-start;justify-content:flex-end}.video-cover-editor .video-cover-preview .video-cover-content-preview.align-center-left{align-items:center;justify-content:flex-start}.video-cover-editor .video-cover-preview .video-cover-content-preview.align-center{align-items:center;justify-content:center}.video-cover-editor .video-cover-preview .video-cover-content-preview.align-center-right{align-items:center;justify-content:flex-end}.video-cover-editor .video-cover-preview .video-cover-content-preview.align-bottom-left{align-items:flex-end;justify-content:flex-start}.video-cover-editor .video-cover-preview .video-cover-content-preview.align-bottom-center{align-items:flex-end;justify-content:center}.video-cover-editor .video-cover-preview .video-cover-content-preview.align-bottom-right{align-items:flex-end;justify-content:flex-end}.video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content{color:#fff;max-width:1200px;text-shadow:0 2px 4px rgba(0,0,0,.5);width:100%}.video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h1,.video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h2,.video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h3,.video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h4,.video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h5,.video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content h6,.video-cover-editor .video-cover-preview .video-cover-content-preview .video-cover-content p{color:#fff}.video-cover-editor .video-cover-preview .video-info{background:rgba(0,0,0,.7);bottom:0;color:#fff;font-size:14px;left:0;padding:10px;position:absolute;right:0;z-index:3}.video-cover-editor .video-cover-preview .video-info p{margin:0}.video-cover-editor .video-cover-placeholder{align-items:center;color:#666;display:flex;font-size:16px;justify-content:center;min-height:200px}.video-source-list{list-style:none;margin:10px 0;padding:0}.video-source-list .video-source-item{align-items:center;background:#f5f5f5;border-radius:4px;display:flex;justify-content:space-between;margin-bottom:5px;padding:8px 12px}.video-source-list .video-source-item .video-source-mime{font-family:monospace;font-size:13px} |
| | |
| | | /******/ (() => { // webpackBootstrap |
| | | /******/ "use strict"; |
| | | /******/ var __webpack_modules__ = ({ |
| | | |
| | | /***/ "./src/video/edit.js" |
| | | /*!***************************!*\ |
| | | !*** ./src/video/edit.js ***! |
| | | \***************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| | | /* harmony export */ "default": () => (/* binding */ Edit) |
| | | /* harmony export */ }); |
| | | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| | | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); |
| | | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); |
| | | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); |
| | | /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor.scss */ "./src/video/editor.scss"); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__); |
| | | //edit.js |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | const ALLOWED_VIDEO_TYPES = ['video']; |
| | | const INNER_BLOCKS_TEMPLATE = [['core/heading', { |
| | | level: 1, |
| | | placeholder: 'Add heading...', |
| | | textAlign: 'center' |
| | | }], ['core/paragraph', { |
| | | placeholder: 'Add description...', |
| | | align: 'center' |
| | | }], ['core/buttons', { |
| | | layout: { |
| | | type: 'flex', |
| | | justifyContent: 'center' |
| | | } |
| | | }]]; |
| | | function Edit({ |
| | | attributes, |
| | | setAttributes |
| | | }) { |
| | | const { |
| | | posterId, |
| | | posterUrl, |
| | | videoSources, |
| | | fadeEffect, |
| | | overlayOpacity, |
| | | contentAlignment, |
| | | minHeight |
| | | } = attributes; |
| | | const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({ |
| | | className: 'video-cover-editor', |
| | | style: { |
| | | minHeight: minHeight ? `${minHeight}px` : undefined |
| | | } |
| | | }); |
| | | const innerBlocksProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useInnerBlocksProps)({ |
| | | className: 'video-cover-content' |
| | | }, { |
| | | template: INNER_BLOCKS_TEMPLATE, |
| | | templateLock: false |
| | | }); |
| | | const onSelectPoster = media => { |
| | | setAttributes({ |
| | | posterId: media.id, |
| | | posterUrl: media.url |
| | | }); |
| | | }; |
| | | const onSelectVideos = mediaItems => { |
| | | // multiple=true returns an array |
| | | const items = Array.isArray(mediaItems) ? mediaItems : [mediaItems]; |
| | | const newSources = items.filter(media => !videoSources.some(s => s.id === media.id)).map(media => ({ |
| | | id: media.id, |
| | | url: media.url, |
| | | mime: media.mime |
| | | })); |
| | | if (newSources.length) { |
| | | setAttributes({ |
| | | videoSources: [...videoSources, ...newSources] |
| | | }); |
| | | } |
| | | }; |
| | | const removeVideoSource = index => { |
| | | const updated = [...videoSources]; |
| | | updated.splice(index, 1); |
| | | setAttributes({ |
| | | videoSources: updated |
| | | }); |
| | | }; |
| | | const renderVideoSourceList = (sources, isMobile = false) => { |
| | | if (sources.length === 0) return null; |
| | | return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("ul", { |
| | | className: "video-source-list", |
| | | children: sources.map((source, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { |
| | | className: "video-source-item", |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", { |
| | | className: "video-source-mime", |
| | | children: source.mime |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { |
| | | isDestructive: true, |
| | | isSmall: true, |
| | | onClick: () => removeVideoSource(index, isMobile), |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Remove', 'jvb') |
| | | })] |
| | | }, index)) |
| | | }); |
| | | }; |
| | | return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, { |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, { |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { |
| | | title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Video Settings', 'jvb'), |
| | | initialOpen: true, |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.BaseControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Poster Image', 'jvb'), |
| | | help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Image shown while video loads', 'jvb'), |
| | | children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.MediaUploadCheck, { |
| | | children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.MediaUpload, { |
| | | onSelect: onSelectPoster, |
| | | allowedTypes: ['image'], |
| | | value: posterId, |
| | | render: ({ |
| | | open |
| | | }) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, { |
| | | children: [posterUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", { |
| | | src: posterUrl, |
| | | alt: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Poster preview', 'jvb'), |
| | | style: { |
| | | maxWidth: '100%', |
| | | marginBottom: '10px' |
| | | } |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { |
| | | onClick: open, |
| | | variant: posterUrl ? 'secondary' : 'primary', |
| | | children: posterUrl ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Change Poster', 'jvb') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select Poster', 'jvb') |
| | | }), posterUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { |
| | | isDestructive: true, |
| | | onClick: () => setAttributes({ |
| | | posterId: 0, |
| | | posterUrl: '' |
| | | }), |
| | | style: { |
| | | marginLeft: '10px' |
| | | }, |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Remove', 'jvb') |
| | | })] |
| | | }) |
| | | }) |
| | | }) |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.BaseControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Video Sources', 'jvb'), |
| | | help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add multiple formats for better browser support (mp4, webm, etc.)', 'jvb'), |
| | | children: [videoSources.length > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("ul", { |
| | | className: "video-source-list", |
| | | children: videoSources.map((source, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", { |
| | | className: "video-source-item", |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", { |
| | | className: "video-source-mime", |
| | | children: source.mime |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { |
| | | isDestructive: true, |
| | | isSmall: true, |
| | | onClick: () => removeVideoSource(index), |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Remove', 'jvb') |
| | | })] |
| | | }, index)) |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.MediaUploadCheck, { |
| | | children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.MediaUpload, { |
| | | multiple: true, |
| | | onSelect: onSelectVideos, |
| | | allowedTypes: ALLOWED_VIDEO_TYPES, |
| | | render: ({ |
| | | open |
| | | }) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { |
| | | onClick: open, |
| | | variant: "secondary", |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add Video', 'jvb') |
| | | }) |
| | | }) |
| | | })] |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ToggleControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fade Effect', 'jvb'), |
| | | help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add fade class to video element', 'jvb'), |
| | | checked: fadeEffect, |
| | | onChange: value => setAttributes({ |
| | | fadeEffect: value |
| | | }) |
| | | })] |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { |
| | | title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Overlay Settings', 'jvb'), |
| | | initialOpen: true, |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.RangeControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Overlay Opacity', 'jvb'), |
| | | help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Darken video for better text readability', 'jvb'), |
| | | value: overlayOpacity, |
| | | onChange: value => setAttributes({ |
| | | overlayOpacity: value |
| | | }), |
| | | min: 0, |
| | | max: 100, |
| | | step: 5 |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SelectControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Content Alignment', 'jvb'), |
| | | value: contentAlignment, |
| | | options: [{ |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top Left', 'jvb'), |
| | | value: 'top-left' |
| | | }, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top Center', 'jvb'), |
| | | value: 'top-center' |
| | | }, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top Right', 'jvb'), |
| | | value: 'top-right' |
| | | }, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Center Left', 'jvb'), |
| | | value: 'center-left' |
| | | }, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Center', 'jvb'), |
| | | value: 'center' |
| | | }, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Center Right', 'jvb'), |
| | | value: 'center-right' |
| | | }, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Bottom Left', 'jvb'), |
| | | value: 'bottom-left' |
| | | }, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Bottom Center', 'jvb'), |
| | | value: 'bottom-center' |
| | | }, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Bottom Right', 'jvb'), |
| | | value: 'bottom-right' |
| | | }], |
| | | onChange: value => setAttributes({ |
| | | contentAlignment: value |
| | | }) |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.RangeControl, { |
| | | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Minimum Height', 'jvb'), |
| | | help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Minimum height in pixels (leave 0 for auto)', 'jvb'), |
| | | value: minHeight, |
| | | onChange: value => setAttributes({ |
| | | minHeight: value |
| | | }), |
| | | min: 0, |
| | | max: 1000, |
| | | step: 50 |
| | | })] |
| | | })] |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", { |
| | | ...blockProps, |
| | | children: posterUrl || videoSources.length > 0 ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { |
| | | className: "video-cover-preview", |
| | | children: [posterUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, { |
| | | children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", { |
| | | src: posterUrl, |
| | | alt: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Video poster', 'jvb') |
| | | }), overlayOpacity > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", { |
| | | className: "video-overlay-preview", |
| | | style: { |
| | | opacity: overlayOpacity / 100 |
| | | } |
| | | })] |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", { |
| | | className: `video-cover-content-preview align-${contentAlignment}`, |
| | | children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", { |
| | | ...innerBlocksProps |
| | | }) |
| | | }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", { |
| | | className: "video-info", |
| | | children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("p", { |
| | | children: [videoSources.length, " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('desktop source(s)', 'jvb')] |
| | | }) |
| | | })] |
| | | }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", { |
| | | className: "video-cover-placeholder", |
| | | children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", { |
| | | children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Configure video sources in the sidebar →', 'jvb') |
| | | }) |
| | | }) |
| | | })] |
| | | }); |
| | | } |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/video/index.js" |
| | | /*!****************************!*\ |
| | | !*** ./src/video/index.js ***! |
| | | \****************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); |
| | | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); |
| | | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); |
| | | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./src/video/style.scss"); |
| | | /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./edit */ "./src/video/edit.js"); |
| | | /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/video/block.json"); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); |
| | | /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__); |
| | | /* index.js */ |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, { |
| | | edit: _edit__WEBPACK_IMPORTED_MODULE_3__["default"], |
| | | save: ({ |
| | | attributes |
| | | }) => { |
| | | const blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save({ |
| | | className: 'video-cover-wrapper-placeholder' |
| | | }); |
| | | return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { |
| | | ...blockProps, |
| | | children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, {}) |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/video/editor.scss" |
| | | /*!*******************************!*\ |
| | | !*** ./src/video/editor.scss ***! |
| | | \*******************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | // extracted by mini-css-extract-plugin |
| | | |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/video/style.scss" |
| | | /*!******************************!*\ |
| | | !*** ./src/video/style.scss ***! |
| | | \******************************/ |
| | | (__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| | | |
| | | __webpack_require__.r(__webpack_exports__); |
| | | // extracted by mini-css-extract-plugin |
| | | |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "react/jsx-runtime" |
| | | /*!**********************************!*\ |
| | | !*** external "ReactJSXRuntime" ***! |
| | | \**********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["ReactJSXRuntime"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/block-editor" |
| | | /*!*************************************!*\ |
| | | !*** external ["wp","blockEditor"] ***! |
| | | \*************************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blockEditor"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/blocks" |
| | | /*!********************************!*\ |
| | | !*** external ["wp","blocks"] ***! |
| | | \********************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["blocks"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/components" |
| | | /*!************************************!*\ |
| | | !*** external ["wp","components"] ***! |
| | | \************************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["components"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "@wordpress/i18n" |
| | | /*!******************************!*\ |
| | | !*** external ["wp","i18n"] ***! |
| | | \******************************/ |
| | | (module) { |
| | | |
| | | module.exports = window["wp"]["i18n"]; |
| | | |
| | | /***/ }, |
| | | |
| | | /***/ "./src/video/block.json" |
| | | /*!******************************!*\ |
| | | !*** ./src/video/block.json ***! |
| | | \******************************/ |
| | | (module) { |
| | | |
| | | module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"jvb/video","version":"1.0.0","title":"Video Cover","category":"jvb","icon":"video-alt3","description":"Self-hosted video cover with poster and multiple format support","supports":{"html":false,"align":["wide","full"],"spacing":{"margin":true,"padding":true},"color":{"background":true,"text":true}},"attributes":{"title":{"type":"string","default":""},"description":{"type":"string","default":""},"posterId":{"type":"number","default":0},"posterUrl":{"type":"string","default":""},"videoSources":{"type":"array","default":[],"items":{"type":"object","properties":{"id":{"type":"number"},"url":{"type":"string"},"mime":{"type":"string"}}}},"fadeEffect":{"type":"boolean","default":false},"overlayOpacity":{"type":"number","default":0},"contentAlignment":{"type":"string","default":"center"},"minHeight":{"type":"number","default":0}},"textdomain":"jvb","editorScript":"file:./index.js","viewScript":"file:./view.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'); |
| | | |
| | | /***/ } |
| | | |
| | | /******/ }); |
| | | /************************************************************************/ |
| | | /******/ // The module cache |
| | | /******/ var __webpack_module_cache__ = {}; |
| | | /******/ |
| | | /******/ // The require function |
| | | /******/ function __webpack_require__(moduleId) { |
| | | /******/ // Check if module is in cache |
| | | /******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| | | /******/ if (cachedModule !== undefined) { |
| | | /******/ return cachedModule.exports; |
| | | /******/ } |
| | | /******/ // Create a new module (and put it into the cache) |
| | | /******/ var module = __webpack_module_cache__[moduleId] = { |
| | | /******/ // no module.id needed |
| | | /******/ // no module.loaded needed |
| | | /******/ exports: {} |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // Execute the module function |
| | | /******/ if (!(moduleId in __webpack_modules__)) { |
| | | /******/ delete __webpack_module_cache__[moduleId]; |
| | | /******/ var e = new Error("Cannot find module '" + moduleId + "'"); |
| | | /******/ e.code = 'MODULE_NOT_FOUND'; |
| | | /******/ throw e; |
| | | /******/ } |
| | | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| | | /******/ |
| | | /******/ // Return the exports of the module |
| | | /******/ return module.exports; |
| | | /******/ } |
| | | /******/ |
| | | /******/ // expose the modules object (__webpack_modules__) |
| | | /******/ __webpack_require__.m = __webpack_modules__; |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ /* webpack/runtime/chunk loaded */ |
| | | /******/ (() => { |
| | | /******/ var deferred = []; |
| | | /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { |
| | | /******/ if(chunkIds) { |
| | | /******/ priority = priority || 0; |
| | | /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; |
| | | /******/ deferred[i] = [chunkIds, fn, priority]; |
| | | /******/ return; |
| | | /******/ } |
| | | /******/ var notFulfilled = Infinity; |
| | | /******/ for (var i = 0; i < deferred.length; i++) { |
| | | /******/ var [chunkIds, fn, priority] = deferred[i]; |
| | | /******/ var fulfilled = true; |
| | | /******/ for (var j = 0; j < chunkIds.length; j++) { |
| | | /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { |
| | | /******/ chunkIds.splice(j--, 1); |
| | | /******/ } else { |
| | | /******/ fulfilled = false; |
| | | /******/ if(priority < notFulfilled) notFulfilled = priority; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(fulfilled) { |
| | | /******/ deferred.splice(i--, 1) |
| | | /******/ var r = fn(); |
| | | /******/ if (r !== undefined) result = r; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ return result; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/compat get default export */ |
| | | /******/ (() => { |
| | | /******/ // getDefaultExport function for compatibility with non-harmony modules |
| | | /******/ __webpack_require__.n = (module) => { |
| | | /******/ var getter = module && module.__esModule ? |
| | | /******/ () => (module['default']) : |
| | | /******/ () => (module); |
| | | /******/ __webpack_require__.d(getter, { a: getter }); |
| | | /******/ return getter; |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/define property getters */ |
| | | /******/ (() => { |
| | | /******/ // define getter functions for harmony exports |
| | | /******/ __webpack_require__.d = (exports, definition) => { |
| | | /******/ for(var key in definition) { |
| | | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| | | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| | | /******/ } |
| | | /******/ } |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| | | /******/ (() => { |
| | | /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/make namespace object */ |
| | | /******/ (() => { |
| | | /******/ // define __esModule on exports |
| | | /******/ __webpack_require__.r = (exports) => { |
| | | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
| | | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| | | /******/ } |
| | | /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| | | /******/ }; |
| | | /******/ })(); |
| | | /******/ |
| | | /******/ /* webpack/runtime/jsonp chunk loading */ |
| | | /******/ (() => { |
| | | /******/ // no baseURI |
| | | /******/ |
| | | /******/ // object to store loaded and loading chunks |
| | | /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched |
| | | /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded |
| | | /******/ var installedChunks = { |
| | | /******/ "video/index": 0, |
| | | /******/ "video/style-index": 0 |
| | | /******/ }; |
| | | /******/ |
| | | /******/ // no chunk on demand loading |
| | | /******/ |
| | | /******/ // no prefetching |
| | | /******/ |
| | | /******/ // no preloaded |
| | | /******/ |
| | | /******/ // no HMR |
| | | /******/ |
| | | /******/ // no HMR manifest |
| | | /******/ |
| | | /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); |
| | | /******/ |
| | | /******/ // install a JSONP callback for chunk loading |
| | | /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { |
| | | /******/ var [chunkIds, moreModules, runtime] = data; |
| | | /******/ // add "moreModules" to the modules object, |
| | | /******/ // then flag all "chunkIds" as loaded and fire callback |
| | | /******/ var moduleId, chunkId, i = 0; |
| | | /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { |
| | | /******/ for(moduleId in moreModules) { |
| | | /******/ if(__webpack_require__.o(moreModules, moduleId)) { |
| | | /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; |
| | | /******/ } |
| | | /******/ } |
| | | /******/ if(runtime) var result = runtime(__webpack_require__); |
| | | /******/ } |
| | | /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); |
| | | /******/ for(;i < chunkIds.length; i++) { |
| | | /******/ chunkId = chunkIds[i]; |
| | | /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { |
| | | /******/ installedChunks[chunkId][0](); |
| | | /******/ } |
| | | /******/ installedChunks[chunkId] = 0; |
| | | /******/ } |
| | | /******/ return __webpack_require__.O(result); |
| | | /******/ } |
| | | /******/ |
| | | /******/ var chunkLoadingGlobal = globalThis["webpackChunkjvb"] = globalThis["webpackChunkjvb"] || []; |
| | | /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); |
| | | /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); |
| | | /******/ })(); |
| | | /******/ |
| | | /************************************************************************/ |
| | | /******/ |
| | | /******/ // startup |
| | | /******/ // Load entry module and return exports |
| | | /******/ // This entry module depends on other loaded chunks and execution need to be delayed |
| | | /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["video/style-index"], () => (__webpack_require__("./src/video/index.js"))) |
| | | /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); |
| | | /******/ |
| | | /******/ })() |
| | | ; |
| | | //# sourceMappingURL=index.js.map |
| | | (()=>{"use strict";var e,t={747(){const e=window.wp.blocks,t=window.wp.blockEditor,o=window.wp.i18n,l=window.wp.components,r=window.ReactJSXRuntime,i=["video"],n=[["core/heading",{level:1,placeholder:"Add heading...",textAlign:"center"}],["core/paragraph",{placeholder:"Add description...",align:"center"}],["core/buttons",{layout:{type:"flex",justifyContent:"center"}}]];(0,e.registerBlockType)("jvb/video",{edit:function({attributes:e,setAttributes:s}){const{posterId:a,posterUrl:c,videoSources:d,fadeEffect:v,overlayOpacity:p,contentAlignment:h,minHeight:j}=e,b=(0,t.useBlockProps)({className:"video-cover-editor",style:{minHeight:j?`${j}px`:void 0}}),m=(0,t.useInnerBlocksProps)({className:"video-cover-content"},{template:n,templateLock:!1});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.InspectorControls,{children:[(0,r.jsxs)(l.PanelBody,{title:(0,o.__)("Video Settings","jvb"),initialOpen:!0,children:[(0,r.jsx)(l.BaseControl,{label:(0,o.__)("Poster Image","jvb"),help:(0,o.__)("Image shown while video loads","jvb"),children:(0,r.jsx)(t.MediaUploadCheck,{children:(0,r.jsx)(t.MediaUpload,{onSelect:e=>{s({posterId:e.id,posterUrl:e.url})},allowedTypes:["image"],value:a,render:({open:e})=>(0,r.jsxs)(r.Fragment,{children:[c&&(0,r.jsx)("img",{src:c,alt:(0,o.__)("Poster preview","jvb"),style:{maxWidth:"100%",marginBottom:"10px"}}),(0,r.jsx)(l.Button,{onClick:e,variant:c?"secondary":"primary",children:c?(0,o.__)("Change Poster","jvb"):(0,o.__)("Select Poster","jvb")}),c&&(0,r.jsx)(l.Button,{isDestructive:!0,onClick:()=>s({posterId:0,posterUrl:""}),style:{marginLeft:"10px"},children:(0,o.__)("Remove","jvb")})]})})})}),(0,r.jsxs)(l.BaseControl,{label:(0,o.__)("Video Sources","jvb"),help:(0,o.__)("Add multiple formats for better browser support (mp4, webm, etc.)","jvb"),children:[d.length>0&&(0,r.jsx)("ul",{className:"video-source-list",children:d.map((e,t)=>(0,r.jsxs)("li",{className:"video-source-item",children:[(0,r.jsx)("span",{className:"video-source-mime",children:e.mime}),(0,r.jsx)(l.Button,{isDestructive:!0,isSmall:!0,onClick:()=>(e=>{const t=[...d];t.splice(e,1),s({videoSources:t})})(t),children:(0,o.__)("Remove","jvb")})]},t))}),(0,r.jsx)(t.MediaUploadCheck,{children:(0,r.jsx)(t.MediaUpload,{multiple:!0,onSelect:e=>{const t=(Array.isArray(e)?e:[e]).filter(e=>!d.some(t=>t.id===e.id)).map(e=>({id:e.id,url:e.url,mime:e.mime}));t.length&&s({videoSources:[...d,...t]})},allowedTypes:i,render:({open:e})=>(0,r.jsx)(l.Button,{onClick:e,variant:"secondary",children:(0,o.__)("Add Video","jvb")})})})]}),(0,r.jsx)(l.ToggleControl,{label:(0,o.__)("Fade Effect","jvb"),help:(0,o.__)("Add fade class to video element","jvb"),checked:v,onChange:e=>s({fadeEffect:e})})]}),(0,r.jsxs)(l.PanelBody,{title:(0,o.__)("Overlay Settings","jvb"),initialOpen:!0,children:[(0,r.jsx)(l.RangeControl,{label:(0,o.__)("Overlay Opacity","jvb"),help:(0,o.__)("Darken video for better text readability","jvb"),value:p,onChange:e=>s({overlayOpacity:e}),min:0,max:100,step:5}),(0,r.jsx)(l.SelectControl,{label:(0,o.__)("Content Alignment","jvb"),value:h,options:[{label:(0,o.__)("Top Left","jvb"),value:"top-left"},{label:(0,o.__)("Top Center","jvb"),value:"top-center"},{label:(0,o.__)("Top Right","jvb"),value:"top-right"},{label:(0,o.__)("Center Left","jvb"),value:"center-left"},{label:(0,o.__)("Center","jvb"),value:"center"},{label:(0,o.__)("Center Right","jvb"),value:"center-right"},{label:(0,o.__)("Bottom Left","jvb"),value:"bottom-left"},{label:(0,o.__)("Bottom Center","jvb"),value:"bottom-center"},{label:(0,o.__)("Bottom Right","jvb"),value:"bottom-right"}],onChange:e=>s({contentAlignment:e})}),(0,r.jsx)(l.RangeControl,{label:(0,o.__)("Minimum Height","jvb"),help:(0,o.__)("Minimum height in pixels (leave 0 for auto)","jvb"),value:j,onChange:e=>s({minHeight:e}),min:0,max:1e3,step:50})]})]}),(0,r.jsx)("div",{...b,children:c||d.length>0?(0,r.jsxs)("div",{className:"video-cover-preview",children:[c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("img",{src:c,alt:(0,o.__)("Video poster","jvb")}),p>0&&(0,r.jsx)("div",{className:"video-overlay-preview",style:{opacity:p/100}})]}),(0,r.jsx)("div",{className:`video-cover-content-preview align-${h}`,children:(0,r.jsx)("div",{...m})}),(0,r.jsx)("div",{className:"video-info",children:(0,r.jsxs)("p",{children:[d.length," ",(0,o.__)("desktop source(s)","jvb")]})})]}):(0,r.jsx)("div",{className:"video-cover-placeholder",children:(0,r.jsx)("p",{children:(0,o.__)("Configure video sources in the sidebar →","jvb")})})})]})},save:({attributes:e})=>{const o=t.useBlockProps.save({className:"video-cover-wrapper-placeholder"});return(0,r.jsx)("div",{...o,children:(0,r.jsx)(t.InnerBlocks.Content,{})})}})}},o={};function l(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,l),i.exports}l.m=t,e=[],l.O=(t,o,r,i)=>{if(!o){var n=1/0;for(d=0;d<e.length;d++){for(var[o,r,i]=e[d],s=!0,a=0;a<o.length;a++)(!1&i||n>=i)&&Object.keys(l.O).every(e=>l.O[e](o[a]))?o.splice(a--,1):(s=!1,i<n&&(n=i));if(s){e.splice(d--,1);var c=r();void 0!==c&&(t=c)}}return t}i=i||0;for(var d=e.length;d>0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[o,r,i]},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={205:0,601:0};l.O.j=t=>0===e[t];var t=(t,o)=>{var r,i,[n,s,a]=o,c=0;if(n.some(t=>0!==e[t])){for(r in s)l.o(s,r)&&(l.m[r]=s[r]);if(a)var d=a(l)}for(t&&t(o);c<n.length;c++)i=n[c],l.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return l.O(d)},o=globalThis.webpackChunkjvb=globalThis.webpackChunkjvb||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var r=l.O(void 0,[601],()=>l(747));r=l.O(r)})(); |
| | |
| | | /*!*********************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/video/style.scss ***! |
| | | \*********************************************************************************************************************************************************************************************************************************************/ |
| | | /** style.scss **/ |
| | | .video-cover { |
| | | position: relative; |
| | | width: 100%; |
| | | min-height: 75vh; |
| | | overflow: hidden; |
| | | display: flex; |
| | | } |
| | | .video-cover .wrap { |
| | | background-color: rgb(var(--contrast-200)); |
| | | } |
| | | .video-cover { |
| | | /* Video background */ |
| | | } |
| | | .video-cover .video-container { |
| | | position: absolute; |
| | | top: 0; |
| | | bottom: 0; |
| | | right: 0; |
| | | left: 0; |
| | | min-width: 100%; |
| | | min-height: 100%; |
| | | z-index: 0; |
| | | display: flex; |
| | | background-color: rgb(var(--action-50)); |
| | | } |
| | | .video-cover .video-container.fade { |
| | | animation: fadeIn 1s ease-in; |
| | | } |
| | | .video-cover .video-container video { |
| | | pointer-events: none; |
| | | opacity: 0.85; |
| | | mix-blend-mode: multiply; |
| | | filter: grayscale(100%) contrast(1); |
| | | flex: 1 0 100%; |
| | | -o-object-fit: cover; |
| | | object-fit: cover; |
| | | } |
| | | .video-cover .inner-wrap { |
| | | position: relative; |
| | | z-index: 2; |
| | | width: 100%; |
| | | padding: 2rem; |
| | | color: var(--action-contrast); |
| | | /* Better text readability */ |
| | | } |
| | | .video-cover .inner-wrap h1, .video-cover .inner-wrap h2, .video-cover .inner-wrap h3, .video-cover .inner-wrap h4, .video-cover .inner-wrap h5, .video-cover .inner-wrap h6 { |
| | | word-spacing: 100vw; |
| | | color: var(--action-contrast); |
| | | text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); |
| | | margin: 2rem 0 0; |
| | | } |
| | | .video-cover .inner-wrap p { |
| | | text-transform: uppercase; |
| | | letter-spacing: 2px; |
| | | margin: 0; |
| | | color: var(--action-contrast); |
| | | text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); |
| | | } |
| | | .video-cover .inner-wrap .media-text figure { |
| | | max-width: 50%; |
| | | } |
| | | @media (min-width: 768px) { |
| | | .video-cover .inner-wrap .media-text { |
| | | --align: flex-start; |
| | | gap: 3rem; |
| | | max-width: var(--content); |
| | | } |
| | | } |
| | | .video-cover .inner-wrap .media-text > div { |
| | | width: -moz-fit-content; |
| | | width: fit-content; |
| | | } |
| | | .video-cover .inner-wrap .buttons a { |
| | | font-weight: var(--fw-h-bold); |
| | | color: var(--action-contrast); |
| | | border-color: var(--action-contrast); |
| | | } |
| | | .video-cover .inner-wrap .buttons a:visited { |
| | | color: var(--action-contrast); |
| | | } |
| | | .video-cover .inner-wrap .buttons a:visited:hover { |
| | | color: var(--action-contrast); |
| | | } |
| | | .video-cover .inner-wrap .buttons a:hover { |
| | | background-color: rgb(var(--action-0)); |
| | | color: var(--action-contrast); |
| | | } |
| | | .video-cover .inner-wrap .outline a { |
| | | background-color: rgba(var(--base), rgba(var(--base), var(--op-3))); |
| | | } |
| | | .video-cover .inner-wrap .buttons { |
| | | margin: 3rem 0; |
| | | } |
| | | .video-cover .inner-wrap .buttons li { |
| | | background-color: rgba(var(--action-0), var(--op-4)); |
| | | } |
| | | .video-cover .inner-wrap { |
| | | /* Button styles */ |
| | | } |
| | | .video-cover .inner-wrap .wp-block-button__link { |
| | | text-shadow: none; |
| | | } |
| | | .video-cover { |
| | | /* Alignment classes */ |
| | | } |
| | | .video-cover.align-top-left { |
| | | align-items: flex-start; |
| | | justify-content: flex-start; |
| | | } |
| | | .video-cover.align-top-center { |
| | | align-items: flex-start; |
| | | justify-content: center; |
| | | } |
| | | .video-cover.align-top-right { |
| | | align-items: flex-start; |
| | | justify-content: flex-end; |
| | | } |
| | | .video-cover.align-center-left { |
| | | align-items: center; |
| | | justify-content: flex-start; |
| | | } |
| | | .video-cover.align-center { |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .video-cover.align-center-right { |
| | | align-items: center; |
| | | justify-content: flex-end; |
| | | } |
| | | .video-cover.align-bottom-left { |
| | | align-items: flex-end; |
| | | justify-content: flex-start; |
| | | } |
| | | .video-cover.align-bottom-center { |
| | | align-items: flex-end; |
| | | justify-content: center; |
| | | } |
| | | .video-cover.align-bottom-right { |
| | | align-items: flex-end; |
| | | justify-content: flex-end; |
| | | } |
| | | .video-cover { |
| | | /* Full-width alignment */ |
| | | } |
| | | .video-cover.alignfull { |
| | | width: 100vw; |
| | | max-width: none; |
| | | margin-right: calc(50% - 50vw); |
| | | margin-left: calc(50% - 50vw); |
| | | } |
| | | .video-cover { |
| | | /* Wide alignment */ |
| | | } |
| | | .video-cover.alignwide { |
| | | max-width: 1200px; |
| | | } |
| | | @keyframes fadeIn { |
| | | from { |
| | | opacity: 0; |
| | | } |
| | | to { |
| | | opacity: 1; |
| | | } |
| | | } |
| | | .video-cover{display:flex;min-height:75vh;overflow:hidden;position:relative;width:100%}.video-cover .wrap{background-color:rgb(var(--contrast-200))}.video-cover .video-container{background-color:rgb(var(--action-50));bottom:0;display:flex;right:0;min-height:100%;min-width:100%;position:absolute;left:0;top:0;z-index:0}.video-cover .video-container.fade{animation:fadeIn 1s ease-in}.video-cover .video-container video{filter:grayscale(100%) contrast(1);flex:1 0 100%;mix-blend-mode:multiply;-o-object-fit:cover;object-fit:cover;opacity:.85;pointer-events:none}.video-cover .inner-wrap{color:rgb(var(--action-contrast));padding:2rem;position:relative;width:100%;z-index:2}.video-cover .inner-wrap h1,.video-cover .inner-wrap h2,.video-cover .inner-wrap h3,.video-cover .inner-wrap h4,.video-cover .inner-wrap h5,.video-cover .inner-wrap h6{color:rgb(var(--action-contrast));margin:2rem 0 0;text-shadow:0 2px 4px rgba(0,0,0,.5);word-spacing:100vw}.video-cover .inner-wrap p{color:rgb(var(--action-contrast));letter-spacing:2px;margin:0;text-shadow:0 1px 2px rgba(0,0,0,.5);text-transform:uppercase}.video-cover .inner-wrap .media-text figure{max-width:50%}@media(min-width:768px){.video-cover .inner-wrap .media-text{--align:flex-start;gap:3rem;max-width:var(--content)}}.video-cover .inner-wrap .media-text>div{width:-moz-fit-content;width:fit-content}.video-cover .inner-wrap .buttons a{border-color:rgb(var(--action-contrast));color:rgb(var(--action-contrast));font-weight:var(--fw-h-bold)}.video-cover .inner-wrap .buttons a:visited,.video-cover .inner-wrap .buttons a:visited:hover{color:rgb(var(--action-contrast))}.video-cover .inner-wrap .buttons a:hover{background-color:rgb(var(--action-0));color:rgb(var(--action-contrast))}.video-cover .inner-wrap .outline a{background-color:rgba(var(--base),rgba(var(--base),var(--op-3)))}.video-cover .inner-wrap .buttons{margin:3rem 0}.video-cover .inner-wrap .buttons li{background-color:rgba(var(--action-0),var(--op-4))}.video-cover .inner-wrap .wp-block-button__link{text-shadow:none}.video-cover.align-top-left{align-items:flex-start;justify-content:flex-start}.video-cover.align-top-center{align-items:flex-start;justify-content:center}.video-cover.align-top-right{align-items:flex-start;justify-content:flex-end}.video-cover.align-center-left{align-items:center;justify-content:flex-start}.video-cover.align-center{align-items:center;justify-content:center}.video-cover.align-center-right{align-items:center;justify-content:flex-end}.video-cover.align-bottom-left{align-items:flex-end;justify-content:flex-start}.video-cover.align-bottom-center{align-items:flex-end;justify-content:center}.video-cover.align-bottom-right{align-items:flex-end;justify-content:flex-end}.video-cover.alignfull{margin-right:calc(50% - 50vw);margin-left:calc(50% - 50vw);max-width:none;width:100vw}.video-cover.alignwide{max-width:1200px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}} |
| | |
| | | /*!*********************************************************************************************************************************************************************************************************************************************!*\ |
| | | !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/video/style.scss ***! |
| | | \*********************************************************************************************************************************************************************************************************************************************/ |
| | | /** style.scss **/ |
| | | .video-cover { |
| | | position: relative; |
| | | width: 100%; |
| | | min-height: 75vh; |
| | | overflow: hidden; |
| | | display: flex; |
| | | } |
| | | .video-cover .wrap { |
| | | background-color: rgb(var(--contrast-200)); |
| | | } |
| | | .video-cover { |
| | | /* Video background */ |
| | | } |
| | | .video-cover .video-container { |
| | | position: absolute; |
| | | top: 0; |
| | | bottom: 0; |
| | | left: 0; |
| | | right: 0; |
| | | min-width: 100%; |
| | | min-height: 100%; |
| | | z-index: 0; |
| | | display: flex; |
| | | background-color: rgb(var(--action-50)); |
| | | } |
| | | .video-cover .video-container.fade { |
| | | animation: fadeIn 1s ease-in; |
| | | } |
| | | .video-cover .video-container video { |
| | | pointer-events: none; |
| | | opacity: 0.85; |
| | | mix-blend-mode: multiply; |
| | | filter: grayscale(100%) contrast(1); |
| | | flex: 1 0 100%; |
| | | -o-object-fit: cover; |
| | | object-fit: cover; |
| | | } |
| | | .video-cover .inner-wrap { |
| | | position: relative; |
| | | z-index: 2; |
| | | width: 100%; |
| | | padding: 2rem; |
| | | color: var(--action-contrast); |
| | | /* Better text readability */ |
| | | } |
| | | .video-cover .inner-wrap h1, .video-cover .inner-wrap h2, .video-cover .inner-wrap h3, .video-cover .inner-wrap h4, .video-cover .inner-wrap h5, .video-cover .inner-wrap h6 { |
| | | word-spacing: 100vw; |
| | | color: var(--action-contrast); |
| | | text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); |
| | | margin: 2rem 0 0; |
| | | } |
| | | .video-cover .inner-wrap p { |
| | | text-transform: uppercase; |
| | | letter-spacing: 2px; |
| | | margin: 0; |
| | | color: var(--action-contrast); |
| | | text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); |
| | | } |
| | | .video-cover .inner-wrap .media-text figure { |
| | | max-width: 50%; |
| | | } |
| | | @media (min-width: 768px) { |
| | | .video-cover .inner-wrap .media-text { |
| | | --align: flex-start; |
| | | gap: 3rem; |
| | | max-width: var(--content); |
| | | } |
| | | } |
| | | .video-cover .inner-wrap .media-text > div { |
| | | width: -moz-fit-content; |
| | | width: fit-content; |
| | | } |
| | | .video-cover .inner-wrap .buttons a { |
| | | font-weight: var(--fw-h-bold); |
| | | color: var(--action-contrast); |
| | | border-color: var(--action-contrast); |
| | | } |
| | | .video-cover .inner-wrap .buttons a:visited { |
| | | color: var(--action-contrast); |
| | | } |
| | | .video-cover .inner-wrap .buttons a:visited:hover { |
| | | color: var(--action-contrast); |
| | | } |
| | | .video-cover .inner-wrap .buttons a:hover { |
| | | background-color: rgb(var(--action-0)); |
| | | color: var(--action-contrast); |
| | | } |
| | | .video-cover .inner-wrap .outline a { |
| | | background-color: rgba(var(--base), rgba(var(--base), var(--op-3))); |
| | | } |
| | | .video-cover .inner-wrap .buttons { |
| | | margin: 3rem 0; |
| | | } |
| | | .video-cover .inner-wrap .buttons li { |
| | | background-color: rgba(var(--action-0), var(--op-4)); |
| | | } |
| | | .video-cover .inner-wrap { |
| | | /* Button styles */ |
| | | } |
| | | .video-cover .inner-wrap .wp-block-button__link { |
| | | text-shadow: none; |
| | | } |
| | | .video-cover { |
| | | /* Alignment classes */ |
| | | } |
| | | .video-cover.align-top-left { |
| | | align-items: flex-start; |
| | | justify-content: flex-start; |
| | | } |
| | | .video-cover.align-top-center { |
| | | align-items: flex-start; |
| | | justify-content: center; |
| | | } |
| | | .video-cover.align-top-right { |
| | | align-items: flex-start; |
| | | justify-content: flex-end; |
| | | } |
| | | .video-cover.align-center-left { |
| | | align-items: center; |
| | | justify-content: flex-start; |
| | | } |
| | | .video-cover.align-center { |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .video-cover.align-center-right { |
| | | align-items: center; |
| | | justify-content: flex-end; |
| | | } |
| | | .video-cover.align-bottom-left { |
| | | align-items: flex-end; |
| | | justify-content: flex-start; |
| | | } |
| | | .video-cover.align-bottom-center { |
| | | align-items: flex-end; |
| | | justify-content: center; |
| | | } |
| | | .video-cover.align-bottom-right { |
| | | align-items: flex-end; |
| | | justify-content: flex-end; |
| | | } |
| | | .video-cover { |
| | | /* Full-width alignment */ |
| | | } |
| | | .video-cover.alignfull { |
| | | width: 100vw; |
| | | max-width: none; |
| | | margin-left: calc(50% - 50vw); |
| | | margin-right: calc(50% - 50vw); |
| | | } |
| | | .video-cover { |
| | | /* Wide alignment */ |
| | | } |
| | | .video-cover.alignwide { |
| | | max-width: 1200px; |
| | | } |
| | | @keyframes fadeIn { |
| | | from { |
| | | opacity: 0; |
| | | } |
| | | to { |
| | | opacity: 1; |
| | | } |
| | | } |
| | | |
| | | /*# sourceMappingURL=style-index.css.map*/ |
| | | .video-cover{display:flex;min-height:75vh;overflow:hidden;position:relative;width:100%}.video-cover .wrap{background-color:rgb(var(--contrast-200))}.video-cover .video-container{background-color:rgb(var(--action-50));bottom:0;display:flex;left:0;min-height:100%;min-width:100%;position:absolute;right:0;top:0;z-index:0}.video-cover .video-container.fade{animation:fadeIn 1s ease-in}.video-cover .video-container video{filter:grayscale(100%) contrast(1);flex:1 0 100%;mix-blend-mode:multiply;-o-object-fit:cover;object-fit:cover;opacity:.85;pointer-events:none}.video-cover .inner-wrap{color:rgb(var(--action-contrast));padding:2rem;position:relative;width:100%;z-index:2}.video-cover .inner-wrap h1,.video-cover .inner-wrap h2,.video-cover .inner-wrap h3,.video-cover .inner-wrap h4,.video-cover .inner-wrap h5,.video-cover .inner-wrap h6{color:rgb(var(--action-contrast));margin:2rem 0 0;text-shadow:0 2px 4px rgba(0,0,0,.5);word-spacing:100vw}.video-cover .inner-wrap p{color:rgb(var(--action-contrast));letter-spacing:2px;margin:0;text-shadow:0 1px 2px rgba(0,0,0,.5);text-transform:uppercase}.video-cover .inner-wrap .media-text figure{max-width:50%}@media(min-width:768px){.video-cover .inner-wrap .media-text{--align:flex-start;gap:3rem;max-width:var(--content)}}.video-cover .inner-wrap .media-text>div{width:-moz-fit-content;width:fit-content}.video-cover .inner-wrap .buttons a{border-color:rgb(var(--action-contrast));color:rgb(var(--action-contrast));font-weight:var(--fw-h-bold)}.video-cover .inner-wrap .buttons a:visited,.video-cover .inner-wrap .buttons a:visited:hover{color:rgb(var(--action-contrast))}.video-cover .inner-wrap .buttons a:hover{background-color:rgb(var(--action-0));color:rgb(var(--action-contrast))}.video-cover .inner-wrap .outline a{background-color:rgba(var(--base),rgba(var(--base),var(--op-3)))}.video-cover .inner-wrap .buttons{margin:3rem 0}.video-cover .inner-wrap .buttons li{background-color:rgba(var(--action-0),var(--op-4))}.video-cover .inner-wrap .wp-block-button__link{text-shadow:none}.video-cover.align-top-left{align-items:flex-start;justify-content:flex-start}.video-cover.align-top-center{align-items:flex-start;justify-content:center}.video-cover.align-top-right{align-items:flex-start;justify-content:flex-end}.video-cover.align-center-left{align-items:center;justify-content:flex-start}.video-cover.align-center{align-items:center;justify-content:center}.video-cover.align-center-right{align-items:center;justify-content:flex-end}.video-cover.align-bottom-left{align-items:flex-end;justify-content:flex-start}.video-cover.align-bottom-center{align-items:flex-end;justify-content:center}.video-cover.align-bottom-right{align-items:flex-end;justify-content:flex-end}.video-cover.alignfull{margin-left:calc(50% - 50vw);margin-right:calc(50% - 50vw);max-width:none;width:100vw}.video-cover.alignwide{max-width:1200px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}} |
| | |
| | | <?php return array('dependencies' => array(), 'version' => 'ef402281b8b0f16a5412'); |
| | | <?php return array('dependencies' => array(), 'version' => 'e7b9a67683fd33c56748'); |
| | |
| | | /******/ (() => { // webpackBootstrap |
| | | /*!***************************!*\ |
| | | !*** ./src/video/view.js ***! |
| | | \***************************/ |
| | | /** view.js **/ |
| | | document.addEventListener("DOMContentLoaded", function () { |
| | | const lazyVideos = [].slice.call(document.querySelectorAll(".video-container video")); |
| | | |
| | | // Build a helper to actually set sources + load |
| | | function loadVideo(video) { |
| | | const sources = video.querySelectorAll("source[data-src]"); |
| | | sources.forEach(source => { |
| | | source.src = source.dataset.src; |
| | | }); |
| | | video.load(); |
| | | } |
| | | |
| | | // --- 1. IntersectionObserver (best case) --- |
| | | if ("IntersectionObserver" in window) { |
| | | const lazyVideoObserver = new IntersectionObserver(function (entries, observer) { |
| | | entries.forEach(entry => { |
| | | if (entry.isIntersecting) { |
| | | loadVideo(entry.target); |
| | | observer.unobserve(entry.target); |
| | | } |
| | | }); |
| | | }, { |
| | | rootMargin: "200px 0px", |
| | | threshold: 0.1 |
| | | }); |
| | | lazyVideos.forEach(video => lazyVideoObserver.observe(video)); |
| | | return; |
| | | } |
| | | |
| | | // --- 2. Fallback: requestIdleCallback --- |
| | | if ("requestIdleCallback" in window) { |
| | | requestIdleCallback(() => { |
| | | lazyVideos.forEach(video => loadVideo(video)); |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | // --- 3. Final fallback: load immediately --- |
| | | lazyVideos.forEach(video => loadVideo(video)); |
| | | }); |
| | | /******/ })() |
| | | ; |
| | | //# sourceMappingURL=view.js.map |
| | | document.addEventListener("DOMContentLoaded",function(){const e=[].slice.call(document.querySelectorAll(".video-container video"));function r(e){e.querySelectorAll("source[data-src]").forEach(e=>{e.src=e.dataset.src}),e.load()}if("IntersectionObserver"in window){const t=new IntersectionObserver(function(e,t){e.forEach(e=>{e.isIntersecting&&(r(e.target),t.unobserve(e.target))})},{rootMargin:"200px 0px",threshold:.1});return void e.forEach(e=>t.observe(e))}"requestIdleCallback"in window?requestIdleCallback(()=>{e.forEach(e=>r(e))}):e.forEach(e=>r(e))}); |
| | |
| | | 'jvb/summary', |
| | | 'jvb/feed', |
| | | 'jvb/forms', |
| | | 'jvb/gmbreviews', |
| | | 'jvb/timeline', |
| | | 'jvb/video', |
| | | ]; |
| | | if ($isPrerender) { |
| | | $base = array_merge($base, [ |
| | |
| | | |
| | | public function render(string $content, array $block):string |
| | | { |
| | | if ($block['blockName'] === 'jvb/feed') { |
| | | // Enqueue the feed block script (it will automatically load dependencies) |
| | | switch ($block['blockName']) { |
| | | case 'jvb/feed': |
| | | $this->localize_feedblock(); |
| | | } |
| | | if ($block['blockName'] === 'jvb/forms') { |
| | | break; |
| | | case 'jvb/forms': |
| | | wp_enqueue_style('jvb-form'); |
| | | break; |
| | | case 'jvb/timeline': |
| | | wp_enqueue_script('jvb-gallery'); |
| | | add_action('wp_footer', 'jvbRenderGallery'); |
| | | break; |
| | | } |
| | | |
| | | |
| | | |
| | | return $this->checkMethods($content, $block); |
| | | } |
| | | |
| | |
| | | '<table%s', |
| | | $this->getClassesAndStyles($attrs) |
| | | ), $table); |
| | | $caption = ''; |
| | | if (array_key_exists(1, $parts)) { |
| | | $caption = str_replace(strtok($parts[1], '>'), '<figcaption', $parts[1]); |
| | | } |
| | | |
| | | |
| | | return sprintf( |
| | | '<figure%s>%s%s</figure>', |
| | |
| | | ); |
| | | } |
| | | } |
| | | |
| | | return sprintf( |
| | | '<ul%s>%s</ul>', |
| | | $this->getClassesAndStyles($block['attrs']??[], ['loop']), |
| | |
| | | protected function buildQueryArgs(array $attrs): array |
| | | { |
| | | $queryID = $attrs['queryId'] ?? null; |
| | | $args = []; |
| | | $args = [ |
| | | 'post_status' => 'publish', |
| | | ]; |
| | | foreach (($attrs['query'] ?? []) as $key => $value) { |
| | | if (empty($value)) continue; |
| | | switch ($key) { |
| | |
| | | |
| | | $type = 'row'; |
| | | $isRow = true; |
| | | |
| | | //Determine type |
| | | if ((array_key_exists('type', $value) && !in_array($value['type'], ['flex', 'grid'])) || |
| | | if ((array_key_exists('type', $value) && !in_array($value['type'], ['flex', 'grid', 'default'])) || |
| | | (array_key_exists('orientation', $value) && $value['orientation'] === 'vertical')) { |
| | | $type = 'col'; |
| | | $isRow = false; |
| | |
| | | 'icon' => 'shuffle', |
| | | 'label' => 'Randomly' |
| | | ]; |
| | | |
| | | $custom = implode(',', array_map(function($ord) { |
| | | return $ord['slug']; |
| | | }, $custom)); |
| | |
| | | $this->cache->flush(); |
| | | } |
| | | add_action('init', [ $this, 'registerBlock' ]); |
| | | add_action('wp_footer', 'jvbRenderGallery'); |
| | | add_action('wp_footer', [$this, 'renderGallery']); |
| | | } |
| | | |
| | | public function registerBlock() |
| | |
| | | { |
| | | $this->renderHeader(); |
| | | $this->renderTimeline(); |
| | | ?> |
| | | <ul class="buttons"><li><a href="<?= get_post_type_archive_link(BASE.$this->content) ?>">See All Before & Afters</a></li></ul> |
| | | <?php |
| | | } |
| | | |
| | | protected function get_field(string $fieldName, array $fields) { |
| | |
| | | } |
| | | ?> |
| | | </ul> |
| | | <ul class="buttons"><li><a href="<?= get_post_type_archive_link(BASE.$this->content) ?>">See All Before & Afters</a></li></ul> |
| | | </header> |
| | | <section id="info"> |
| | | <?php |
| | |
| | | $title = ($i === 0) ? 'Before Laser Tattoo Removal' : 'After '.$i.' Treatment'.$plural; |
| | | $title = ($i > 0 && !str_contains('Treatment', $fields['post_title'])) ? $fields['post_title'] : $title; |
| | | ?> |
| | | <section id="<?= $i === 0 ? 'before-treatment' : 'treatment-'.$i ?>" class="timeline-point row a-start nowrap"> |
| | | <section id="<?= $i === 0 ? 'before-treatment' : 'treatment-'.$i ?>" class="timeline-point row top nowrap"> |
| | | <?php |
| | | $img = $this->get_field('post_thumbnail', $fields); |
| | | if (is_int($img)) { |
| | | echo jvbFormatImage($img); |
| | | echo str_replace('<img', '<img data-caption=".info header"', jvbFormatImage($img)); |
| | | } |
| | | ?> |
| | | <div class="info"> |
| | |
| | | $registrar = Registrar::getInstance('timeline'); |
| | | foreach ($timeline as $term) { |
| | | $link = get_term_link($term->term_id, BASE.'timeline'); |
| | | $out .= '<li><a href="'.$link.'" rel="tag" title="See more progressions at this timeline">'.jvbIcon($registrar->getIcon('hourglass')).html_entity_decode($term->name).'</a><small>after the treatment</small></li>'; |
| | | $out .= '<li><small><a href="'.$link.'" rel="tag" title="See more progressions at this timeline">'.jvbIcon($registrar->getIcon('hourglass')).html_entity_decode($term->name).'</a> after the treatment</small></li>'; |
| | | } |
| | | $out .='</ul>'; |
| | | return $out; |
| | | } |
| | | |
| | | public function renderGallery():void |
| | | { |
| | | jvbRenderGallery(true); |
| | | } |
| | | } |
| | |
| | | |
| | | $success = $this->createCode($user_id, $code); |
| | | if ($success) { |
| | | return $this->codes->pluck('code', ['user_id' => $user_id], 'created_at', 'DESC')[0]; |
| | | return $success; |
| | | } |
| | | |
| | | return false; |
| | |
| | | if (is_singular($this->types)) { |
| | | $type = get_post_type(); |
| | | $registrar = Registrar::getInstance($type); |
| | | if ($registrar) { |
| | | |
| | | $function = BASE.'build_singular_'.jvbNoBase($type).'_schema'; |
| | | if (function_exists($function)) { |
| | | $schema = $function(get_the_ID()); |
| | | } else if ($registrar) { |
| | | $seo = $registrar->getSEO(); |
| | | $schema[] = $seo->schema()->outputSingularSchema(); |
| | | } |
| | |
| | | $registrar = Registrar::getInstance($type); |
| | | if ($registrar ) { |
| | | $seo = $registrar->getSEO(); |
| | | error_log('SEO: '.print_r($seo->schema(), true)); |
| | | // error_log('SEO: '.print_r($seo->schema(), true)); |
| | | $schema[] = $seo->schema()->outputArchiveSchema(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?php |
| | | namespace JVBase\managers\SEO\render\Thing\CreativeWork\Article; |
| | | |
| | | use JVBase\managers\SEO\render\Thing\CreativeWork\CreativeWork; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | | } |
| | | |
| | | |
| | | class Article extends CreativeWork { |
| | | |
| | | } |
| | |
| | | <?php |
| | | require(JVB_DIR . '/inc/managers/SEO/render/Thing/CreativeWork/CreativeWork.php'); |
| | | require(JVB_DIR . '/inc/managers/SEO/render/Thing/CreativeWork/Article/_setup.php'); |
| | | require(JVB_DIR . '/inc/managers/SEO/render/Thing/CreativeWork/VisualArtwork/_setup.php'); |
| | | require(JVB_DIR . '/inc/managers/SEO/render/Thing/CreativeWork/DefinedTermSet.php'); |
| | | |
| New file |
| | |
| | | <?php |
| | | namespace JVBase\inc\managers\SEO\render\Traits\_Properties; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | | } |
| | | trait articleBodyTrait { |
| | | /** |
| | | * @var string The actual body of the article. |
| | | */ |
| | | protected string $articleBody; |
| | | |
| | | public function getArticleBody():?string |
| | | { |
| | | return $this->articleBody??null; |
| | | } |
| | | public function setArticleBody(string $articleBody):void |
| | | { |
| | | $this->articleBody = $articleBody; |
| | | } |
| | | } |
| | |
| | | protected string $slug; |
| | | |
| | | protected string $title; |
| | | protected array $titleConfig = [ |
| | | 'maxLength' => 60, |
| | | 'alts' => [] |
| | | ]; |
| | | protected string $description; |
| | | protected array $descriptionConfig = [ |
| | | 'maxLength' => 120, |
| | | 'alts' => [] |
| | | ]; |
| | | protected int $image; |
| | | protected int $twitterImage; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | public function setAlts(array $alts, string $type = 'title'):void |
| | | { |
| | | foreach (array_values($alts) as $i => $alt) { |
| | | if (!is_string($alt)) { |
| | | error_log('[Registrar.config.Meta]:setAlts invalid string attempted: '.print_r($alt, true)); |
| | | unset($alts[$i]); |
| | | } |
| | | } |
| | | switch ($type) { |
| | | case 'title': |
| | | $this->titleConfig['alts'] = $alts; |
| | | break; |
| | | case 'description': |
| | | $this->descriptionConfig['alts'] = $alts; |
| | | break; |
| | | default: |
| | | error_log('[Registrar.config.Meta]:setAlts invalid type attempted: '.print_r($type, true)); |
| | | |
| | | } |
| | | } |
| | | |
| | | public function hasTitle():bool |
| | | { |
| | | return !empty($this->title); |
| | |
| | | return !empty($this->twitterImage); |
| | | } |
| | | |
| | | public function testLength(int $ID, string $result, string $type):string |
| | | { |
| | | $maxLength = match($type) { |
| | | 'title' => $this->titleConfig['maxLength'], |
| | | 'description' => $this->descriptionConfig['alts'], |
| | | default => false |
| | | }; |
| | | if (!$maxLength) { |
| | | error_log('[Registrar.config.Meta]:testLength invalid type: '.$type); |
| | | return $result; |
| | | } |
| | | $alts = match($type) { |
| | | 'title' => $this->titleConfig['alts'], |
| | | 'description' => $this->descriptionConfig['alts'], |
| | | }; |
| | | |
| | | |
| | | usort($alts, fn($a, $b) => mb_strlen($b) <=> mb_strlen($a)); |
| | | |
| | | |
| | | $meta = new \JVBase\meta\Meta($ID, Registrar::getInstance($this->slug)->getType()); |
| | | foreach ($alts as $alt) { |
| | | $alt = Resolver::resolve($alt, $meta); |
| | | $r = $result.' '.trim($alt); |
| | | if (mb_strlen($r) <= $maxLength) { |
| | | return $r; |
| | | } |
| | | } |
| | | return rtrim($result, $maxLength - 3).'...'; |
| | | } |
| | | |
| | | public function filterTitle(string $title, ?array $args): string |
| | | { |
| | | error_log('Filtering title...'); |
| | |
| | | |
| | | |
| | | $meta = new \JVBase\meta\Meta($ID, Registrar::getInstance($this->slug)->getType()); |
| | | return Resolver::resolve($this->title, $meta); |
| | | $resolved = Resolver::resolve($this->title, $meta); |
| | | $resolved = $this->testLength($ID, $resolved, 'title'); |
| | | return $resolved; |
| | | } |
| | | |
| | | public function filterDescription(string $description, ?array $args): string |
| | |
| | | |
| | | $ignore = ['description', 'name']; |
| | | if (JVB_TESTING && !in_array($property, $ignore)) { |
| | | error_log('[SEO]Resolver - No method found for '.$property.' with value: '.print_r($value, true).'. Defaulting to base Resolver'); |
| | | // error_log('[SEO]Resolver - No method found for '.$property.' with value: '.print_r($value, true).'. Defaulting to base Resolver'); |
| | | } |
| | | |
| | | |
| | |
| | | jvbAddScriptDependency('jvb-forms-view-script', 'jvb-quill'); |
| | | jvbAddScriptDependency('jvb-forms-view-script', 'jvb-form'); |
| | | jvbAddScriptDependency('jvb-forms-view-script', 'jvb-tabs'); |
| | | |
| | | jvbAddScriptDependency('jvb-timeline-view-script', 'jvb-gallery'); |
| | | } |
| | | |
| | | function jvbAdminMap():void |
| | |
| | | ... this.container.dataset |
| | | }; |
| | | |
| | | console.log(this.config); |
| | | |
| | | this.init(); |
| | | } |
| | | init() { |
| | |
| | | |
| | | this.filters = defaults; |
| | | |
| | | console.log(this.filters); |
| | | this.defaults = {...defaults}; |
| | | } |
| | | updateFilterUI() { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | #at-a-glance { |
| | | padding: 0 10vw; |
| | | --gap: 0; |
| | |
| | | } |
| | | } |
| | | } |
| | | main > header { |
| | | grid-column: wider; |
| | | |
| | | .timeline-point.timeline-point { |
| | | ul.timeline.terms { |
| | | max-width: none; |
| | | margin: 0; |
| | | font-size: var(--txt-x-small); |
| | | } |
| | | .buttons { |
| | | margin-bottom: 0; |
| | | } |
| | | } |
| | | |
| | | .timeline-point.timeline-point.row { |
| | | --lineWidth: 1px; |
| | | --gap: 2rem; |
| | | padding: 0; |
| | |
| | | background-color: rgb(var(--base)); |
| | | max-width: 100vw; |
| | | position: relative; |
| | | overflow: hidden; |
| | | //overflow: hidden; |
| | | img { |
| | | width: 40%; |
| | | border-radius: 4px; |
| | |
| | | padding: 1rem .5rem .5rem; |
| | | width: 60%; |
| | | position: relative; |
| | | .icon-logo-triangle { |
| | | --w: 2.2rem; |
| | | transform: rotate(-90deg); |
| | | position: absolute; |
| | | left: -3rem; |
| | | top: .25rem; |
| | | background-color: rgb(var(--action-100)); |
| | | } |
| | | h2 { |
| | | margin: 0 0 .5rem; |
| | | font-size: var(--txt-medium); |
| | | position: relative; |
| | | .icon { |
| | | --w: 2.5rem; |
| | | transform: rotate(-90deg); |
| | | position: absolute; |
| | | left: -2.5rem; |
| | | top: .25rem; |
| | | background-color: rgb(var(--action-100)); |
| | | } |
| | | } |
| | | |
| | | } |
| | | .term-list { |
| | | margin: 0; |
| | | font-size: var(--txt-x-small); |
| | | |
| | | li { |
| | | display: block; |
| | | a { |
| | | vertical-align: top; |
| | | } |
| | | } |
| | | } |
| | | &::before, |
| | | &::after { |
| | | content: ''; |
| | |
| | | height: 1rem; |
| | | } |
| | | &::after { |
| | | top: 4rem; |
| | | top: 4.25rem; |
| | | } |
| | | &#before-treatment::before, |
| | | &:last-of-type::after { |
| | |
| | | font-size: var(--txt-x-large); |
| | | } |
| | | } |
| | | .timeline-point.timeline-point { |
| | | .timeline-point.timeline-point.row { |
| | | --gap: 4rem; |
| | | img { |
| | | width: 50%; |
| | |
| | | top: 0; |
| | | } |
| | | } |
| | | small { |
| | | display: inline-flex; |
| | | flex-wrap: wrap; |
| | | gap: .25rem; |
| | | align-items: center; |
| | | } |
| | | a { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | |
| | | z-index: 2; |
| | | width: 100%; |
| | | padding: 2rem; |
| | | color: var(--action-contrast); |
| | | color: rgb(var(--action-contrast)); |
| | | |
| | | /* Better text readability */ |
| | | h1, h2, h3, h4, h5, h6 { |
| | | word-spacing: 100vw; |
| | | color: var(--action-contrast); |
| | | color: rgb(var(--action-contrast)); |
| | | text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); |
| | | margin: 2rem 0 0; |
| | | } |
| | |
| | | text-transform: uppercase; |
| | | letter-spacing: 2px; |
| | | margin: 0; |
| | | color: var(--action-contrast); |
| | | color: rgb(var(--action-contrast)); |
| | | text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); |
| | | } |
| | | |
| | |
| | | } |
| | | .buttons a { |
| | | font-weight: var(--fw-h-bold); |
| | | color: var(--action-contrast); |
| | | border-color: var(--action-contrast); |
| | | color: rgb(var(--action-contrast)); |
| | | border-color: rgb(var(--action-contrast)); |
| | | &:visited { |
| | | color: var(--action-contrast); |
| | | color: rgb(var(--action-contrast)); |
| | | &:hover { |
| | | color: var(--action-contrast); |
| | | color: rgb(var(--action-contrast)); |
| | | } |
| | | } |
| | | &:hover { |
| | | background-color: rgb(var(--action-0)); |
| | | color: var(--action-contrast); |
| | | color: rgb(var(--action-contrast)); |
| | | } |
| | | } |
| | | |