Plugin Directory

Changeset 3436888


Ignore:
Timestamp:
01/11/2026 02:43:10 AM (3 days ago)
Author:
indithemes
Message:

removed width options from blocks

Location:
it-listings/trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • it-listings/trunk/assets/blocks/js/featured-locations/index.asset.php

    r3200014 r3436888  
    1 <?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => '6c1809b1adcd89a7b415');
     1<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '6b130e6631dfbd29a2a5');
  • it-listings/trunk/assets/blocks/js/featured-locations/index.js

    r3200014 r3436888  
    33/******/    var __webpack_modules__ = ({
    44
    5 /***/ "./assets/blocks/jsx/featured-locations/index.js":
     5/***/ "./assets/blocks/jsx/featured-locations/index.js"
    66/*!*******************************************************!*\
    77  !*** ./assets/blocks/jsx/featured-locations/index.js ***!
    88  \*******************************************************/
    9 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
     9(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
    1010
    1111__webpack_require__.r(__webpack_exports__);
     
    1313/* harmony export */   attsContext: () => (/* binding */ attsContext)
    1414/* harmony export */ });
    15 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
    16 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
    17 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
    18 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
    19 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
    20 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
    21 /* harmony import */ var _section__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./section */ "./assets/blocks/jsx/featured-locations/section.js");
    22 /* harmony import */ var _title__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./title */ "./assets/blocks/jsx/featured-locations/title.js");
    23 /* harmony import */ var _inc_blocks_featured_locations_block_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../inc/blocks/featured-locations/block.json */ "./inc/blocks/featured-locations/block.json");
    24 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
    25 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
     15/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
     16/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
     17/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
     18/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
     19/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
     20/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);
     21/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "react");
     22/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
     23/* harmony import */ var _section__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./section */ "./assets/blocks/jsx/featured-locations/section.js");
     24/* harmony import */ var _title__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./title */ "./assets/blocks/jsx/featured-locations/title.js");
     25/* harmony import */ var _inc_blocks_featured_locations_block_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../inc/blocks/featured-locations/block.json */ "./inc/blocks/featured-locations/block.json");
    2626
    2727
     
    3232
    3333const slug = 'it-listings/featured-locations';
    34 const attsContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)();
     34const attsContext = (0,react__WEBPACK_IMPORTED_MODULE_3__.createContext)();
    3535const blockData = {
    3636  icon: {
    37     src: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("svg", {
     37    src: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
    3838      xmlns: "http://www.w3.org/2000/svg",
    3939      height: "24px",
    4040      viewBox: "0 0 24 24",
    4141      width: "24px",
    42       fill: "#000000",
    43       children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("path", {
    44         d: "M0 0h24v24H0z",
    45         fill: "none"
    46       }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("path", {
    47         d: "M12 12c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm6-1.8C18 6.57 15.35 4 12 4s-6 2.57-6 6.2c0 2.34 1.95 5.44 6 9.14 4.05-3.7 6-6.8 6-9.14zM12 2c4.2 0 8 3.22 8 8.2 0 3.32-2.67 7.25-8 11.8-5.33-4.55-8-8.48-8-11.8C4 5.22 7.8 2 12 2z"
    48       })]
    49     })
     42      fill: "#000000"
     43    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
     44      d: "M0 0h24v24H0z",
     45      fill: "none"
     46    }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
     47      d: "M12 12c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm6-1.8C18 6.57 15.35 4 12 4s-6 2.57-6 6.2c0 2.34 1.95 5.44 6 9.14 4.05-3.7 6-6.8 6-9.14zM12 2c4.2 0 8 3.22 8 8.2 0 3.32-2.67 7.25-8 11.8-5.33-4.55-8-8.48-8-11.8C4 5.22 7.8 2 12 2z"
     48    }))
    5049  },
    5150  edit: props => {
     
    5756      sections
    5857    } = attributes;
    59     return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("section", {
    60       ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
    61         className: 'itre-editor-featured-locations section'
    62       }),
    63       children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(attsContext.Provider, {
    64         value: {
    65           attributes,
    66           setAttributes
    67         },
    68         children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_title__WEBPACK_IMPORTED_MODULE_4__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
    69           className: "itre-editor-featured-locations__sections",
    70           children: sections.map(section => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_section__WEBPACK_IMPORTED_MODULE_3__["default"], {
    71             order: section['order'],
    72             media: section['mediaId']
    73           }))
    74         })]
    75       })
    76     });
     58    return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)({
     59      className: 'itre-editor-featured-locations section'
     60    }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(attsContext.Provider, {
     61      value: {
     62        attributes,
     63        setAttributes
     64      }
     65    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_title__WEBPACK_IMPORTED_MODULE_5__["default"], null), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
     66      className: "itre-editor-featured-locations__sections"
     67    }, sections.map(section => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_section__WEBPACK_IMPORTED_MODULE_4__["default"], {
     68      order: section['order'],
     69      media: section['mediaId']
     70    })))));
    7771  },
    7872  save: () => null,
    79   ..._inc_blocks_featured_locations_block_json__WEBPACK_IMPORTED_MODULE_5__
     73  ..._inc_blocks_featured_locations_block_json__WEBPACK_IMPORTED_MODULE_6__
    8074};
    81 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(slug, blockData);
    82 
    83 /***/ }),
    84 
    85 /***/ "./assets/blocks/jsx/featured-locations/section.js":
     75(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)(slug, blockData);
     76
     77/***/ },
     78
     79/***/ "./assets/blocks/jsx/featured-locations/section.js"
    8680/*!*********************************************************!*\
    8781  !*** ./assets/blocks/jsx/featured-locations/section.js ***!
    8882  \*********************************************************/
    89 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
     83(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
    9084
    9185__webpack_require__.r(__webpack_exports__);
     
    9387/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
    9488/* harmony export */ });
    95 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
    96 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
    97 /* harmony import */ var _wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blockEditor */ "@wordpress/block-editor");
    98 /* harmony import */ var _wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_1__);
    99 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
    100 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
    101 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
    102 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
    103 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
    104 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__);
    105 /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./index */ "./assets/blocks/jsx/featured-locations/index.js");
    106 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
    107 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
     89/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
     90/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
     91/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
     92/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
     93/* harmony import */ var _wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/blockEditor */ "@wordpress/block-editor");
     94/* harmony import */ var _wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_2__);
     95/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
     96/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
     97/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
     98/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
     99/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
     100/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__);
     101/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./index */ "./assets/blocks/jsx/featured-locations/index.js");
    108102
    109103
     
    123117    },
    124118    setAttributes
    125   } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_index__WEBPACK_IMPORTED_MODULE_5__.attsContext);
     119  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_index__WEBPACK_IMPORTED_MODULE_6__.attsContext);
    126120  const section = sections.filter(item => item['order'] === order)[0];
    127   const allTerms = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select('core').getEntityRecords('taxonomy', 'location', {
     121  const allTerms = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select('core').getEntityRecords('taxonomy', 'location', {
    128122    per_page: -1
    129123  }), []);
    130   const image = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => media !== undefined && select('core').getMedia(media), [media]);
     124  const image = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => media !== undefined && select('core').getMedia(media), [media]);
    131125  const onSelectMedia = media => {
    132126    const newSections = sections.map(item => {
     
    143137    });
    144138  };
    145   return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
    146     className: "itre-editor-featured-locations__section",
    147     children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, {
    148       children: [allTerms !== null && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", {
    149         children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.SelectControl, {
    150           label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Location"),
    151           value: section['location'],
    152           onChange: value => {
    153             const newSections = sections.map(item => {
    154               if (item['order'] === order) {
    155                 return {
    156                   ...item,
    157                   location: parseInt(value)
    158                 };
    159               }
    160               return item;
    161             });
    162             setAttributes({
    163               sections: newSections
    164             });
    165           },
    166           children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("option", {
    167             value: 0,
    168             children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Select Location")
    169           }), allTerms.map(term => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("option", {
    170             value: term.id,
    171             children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)(term.name)
    172           }))]
    173         })
    174       }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", {
    175         children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_1__.MediaUploadCheck, {
    176           children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_1__.MediaUpload, {
    177             allowed: ALLOWED_TYPES,
    178             multiple: false,
    179             render: ({
    180               open
    181             }) => {
    182               return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, {
    183                 children: [section.mediaId === 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("p", {
    184                   children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span", {
    185                     class: "dashicons dashicons-format-image"
    186                   }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span", {
    187                     class: "placeholder-text",
    188                     children: "Image"
    189                   })]
    190                 }), image !== undefined && Object.keys(image).length !== 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.ResponsiveWrapper, {
    191                   naturalWidth: image.media_details.width,
    192                   naturalHeight: image.media_details.height,
    193                   children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("img", {
    194                     src: image.source_url
    195                   })
    196                 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", {
    197                   children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.Button, {
    198                     className: image === undefined || Object.keys(image).length === 0 ? 'is-primary' : 'is-secondary',
    199                     onClick: open,
    200                     children: section.mediaId === 0 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Choose an Image', 'it-listings') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Replace Image', 'it-listings')
    201                   })
    202                 })]
    203               });
    204             },
    205             value: section['mediaId'],
    206             onSelect: onSelectMedia
    207           })
    208         })
    209       })]
    210     })
    211   });
     139  return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
     140    className: "itre-editor-featured-locations__section"
     141  }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, allTerms !== null && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.SelectControl, {
     142    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("Location"),
     143    value: section['location'],
     144    onChange: value => {
     145      const newSections = sections.map(item => {
     146        if (item['order'] === order) {
     147          return {
     148            ...item,
     149            location: parseInt(value)
     150          };
     151        }
     152        return item;
     153      });
     154      setAttributes({
     155        sections: newSections
     156      });
     157    }
     158  }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("option", {
     159    value: 0
     160  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("Select Location")), allTerms.map(term => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("option", {
     161    value: term.id
     162  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)(term.name))))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_2__.MediaUploadCheck, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_2__.MediaUpload, {
     163    allowed: ALLOWED_TYPES,
     164    multiple: false,
     165    render: ({
     166      open
     167    }) => {
     168      return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, section.mediaId === 0 && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
     169        class: "dashicons dashicons-format-image"
     170      }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
     171        class: "placeholder-text"
     172      }, "Image")), image !== undefined && Object.keys(image).length !== 0 && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ResponsiveWrapper, {
     173        naturalWidth: image.media_details.width,
     174        naturalHeight: image.media_details.height
     175      }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
     176        src: image.source_url
     177      })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.Button, {
     178        className: image === undefined || Object.keys(image).length === 0 ? 'is-primary' : 'is-secondary',
     179        onClick: open
     180      }, section.mediaId === 0 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Choose an Image', 'it-listings') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Replace Image', 'it-listings'))));
     181    },
     182    value: section['mediaId'],
     183    onSelect: onSelectMedia
     184  })))));
    212185};
    213186/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Section);
    214187
    215 /***/ }),
    216 
    217 /***/ "./assets/blocks/jsx/featured-locations/title.js":
     188/***/ },
     189
     190/***/ "./assets/blocks/jsx/featured-locations/title.js"
    218191/*!*******************************************************!*\
    219192  !*** ./assets/blocks/jsx/featured-locations/title.js ***!
    220193  \*******************************************************/
    221 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
     194(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
    222195
    223196__webpack_require__.r(__webpack_exports__);
     
    225198/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
    226199/* harmony export */ });
    227 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
    228 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
    229 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
    230 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
    231 /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index */ "./assets/blocks/jsx/featured-locations/index.js");
    232 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
    233 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
    234 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
    235 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
     200/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
     201/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
     202/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
     203/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
     204/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
     205/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
     206/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./index */ "./assets/blocks/jsx/featured-locations/index.js");
     207/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
     208/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
    236209
    237210
     
    243216    attributes,
    244217    setAttributes
    245   } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_index__WEBPACK_IMPORTED_MODULE_2__.attsContext);
     218  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_index__WEBPACK_IMPORTED_MODULE_3__.attsContext);
    246219  const {
    247220    title,
    248221    description
    249222  } = attributes;
    250   return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
    251     children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("h2", {
    252       children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Featured Locations")
    253     }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
    254       children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, {
    255         label: "Title",
    256         value: title,
    257         onChange: value => setAttributes({
    258           title: value
    259         })
    260       })
    261     }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
    262       children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, {
    263         label: "Description",
    264         value: description,
    265         onChange: value => setAttributes({
    266           description: value
    267         })
    268       })
    269     })]
    270   });
     223  return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("h2", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("Featured Locations")), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.TextControl, {
     224    label: "Title",
     225    value: title,
     226    onChange: value => setAttributes({
     227      title: value
     228    })
     229  })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.TextControl, {
     230    label: "Description",
     231    value: description,
     232    onChange: value => setAttributes({
     233      description: value
     234    })
     235  })));
    271236};
    272237/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Title);
    273238
    274 /***/ }),
    275 
    276 /***/ "react":
     239/***/ },
     240
     241/***/ "./inc/blocks/featured-locations/block.json"
     242/*!**************************************************!*\
     243  !*** ./inc/blocks/featured-locations/block.json ***!
     244  \**************************************************/
     245(module) {
     246
     247module.exports = /*#__PURE__*/JSON.parse('{"apiVersion":3,"name":"it-listings/featured-locations","title":"Featured Locations","description":"Featured Area to highlight properties based on Location","category":"it-listings","keywords":["featured locations","properties","property"],"attributes":{"title":{"type":"string","default":""},"description":{"type":"string","default":""},"align":{"type":"string","default":"center"},"sections":{"type":"array","default":[{"order":1,"mediaId":0,"location":0},{"order":2,"mediaId":0,"location":0},{"order":3,"mediaId":0,"location":0},{"order":4,"mediaId":0,"location":0}]}},"editorStyle":"itre-editor-featured-locations-css","style":"itre-featured-locations-css","editorScript":"itre-featured-locations-js","render":"./featured-locations.php"}');
     248
     249/***/ },
     250
     251/***/ "@wordpress/block-editor"
     252/*!*************************************!*\
     253  !*** external ["wp","blockEditor"] ***!
     254  \*************************************/
     255(module) {
     256
     257module.exports = window["wp"]["blockEditor"];
     258
     259/***/ },
     260
     261/***/ "@wordpress/blocks"
     262/*!********************************!*\
     263  !*** external ["wp","blocks"] ***!
     264  \********************************/
     265(module) {
     266
     267module.exports = window["wp"]["blocks"];
     268
     269/***/ },
     270
     271/***/ "@wordpress/components"
     272/*!************************************!*\
     273  !*** external ["wp","components"] ***!
     274  \************************************/
     275(module) {
     276
     277module.exports = window["wp"]["components"];
     278
     279/***/ },
     280
     281/***/ "@wordpress/data"
     282/*!******************************!*\
     283  !*** external ["wp","data"] ***!
     284  \******************************/
     285(module) {
     286
     287module.exports = window["wp"]["data"];
     288
     289/***/ },
     290
     291/***/ "@wordpress/element"
     292/*!*********************************!*\
     293  !*** external ["wp","element"] ***!
     294  \*********************************/
     295(module) {
     296
     297module.exports = window["wp"]["element"];
     298
     299/***/ },
     300
     301/***/ "@wordpress/i18n"
     302/*!******************************!*\
     303  !*** external ["wp","i18n"] ***!
     304  \******************************/
     305(module) {
     306
     307module.exports = window["wp"]["i18n"];
     308
     309/***/ },
     310
     311/***/ "react"
    277312/*!************************!*\
    278313  !*** external "React" ***!
    279314  \************************/
    280 /***/ ((module) => {
     315(module) {
    281316
    282317module.exports = window["React"];
    283318
    284 /***/ }),
    285 
    286 /***/ "react/jsx-runtime":
    287 /*!**********************************!*\
    288   !*** external "ReactJSXRuntime" ***!
    289   \**********************************/
    290 /***/ ((module) => {
    291 
    292 module.exports = window["ReactJSXRuntime"];
    293 
    294 /***/ }),
    295 
    296 /***/ "@wordpress/block-editor":
    297 /*!*************************************!*\
    298   !*** external ["wp","blockEditor"] ***!
    299   \*************************************/
    300 /***/ ((module) => {
    301 
    302 module.exports = window["wp"]["blockEditor"];
    303 
    304 /***/ }),
    305 
    306 /***/ "@wordpress/blocks":
    307 /*!********************************!*\
    308   !*** external ["wp","blocks"] ***!
    309   \********************************/
    310 /***/ ((module) => {
    311 
    312 module.exports = window["wp"]["blocks"];
    313 
    314 /***/ }),
    315 
    316 /***/ "@wordpress/components":
    317 /*!************************************!*\
    318   !*** external ["wp","components"] ***!
    319   \************************************/
    320 /***/ ((module) => {
    321 
    322 module.exports = window["wp"]["components"];
    323 
    324 /***/ }),
    325 
    326 /***/ "@wordpress/data":
    327 /*!******************************!*\
    328   !*** external ["wp","data"] ***!
    329   \******************************/
    330 /***/ ((module) => {
    331 
    332 module.exports = window["wp"]["data"];
    333 
    334 /***/ }),
    335 
    336 /***/ "@wordpress/i18n":
    337 /*!******************************!*\
    338   !*** external ["wp","i18n"] ***!
    339   \******************************/
    340 /***/ ((module) => {
    341 
    342 module.exports = window["wp"]["i18n"];
    343 
    344 /***/ }),
    345 
    346 /***/ "./inc/blocks/featured-locations/block.json":
    347 /*!**************************************************!*\
    348   !*** ./inc/blocks/featured-locations/block.json ***!
    349   \**************************************************/
    350 /***/ ((module) => {
    351 
    352 module.exports = /*#__PURE__*/JSON.parse('{"apiVersion":3,"name":"it-listings/featured-locations","title":"Featured Locations","description":"Featured Area to highlight properties based on Location","category":"it-listings","keywords":["featured locations","properties","property"],"attributes":{"title":{"type":"string","default":""},"description":{"type":"string","default":""},"align":{"type":"string","default":"center"},"sections":{"type":"array","default":[{"order":1,"mediaId":0,"location":0},{"order":2,"mediaId":0,"location":0},{"order":3,"mediaId":0,"location":0},{"order":4,"mediaId":0,"location":0}]}},"supports":{"align":["full","wide"],"alignWide":true},"editorStyle":"itre-editor-featured-locations-css","style":"itre-featured-locations-css","editorScript":"itre-featured-locations-js","render":"./featured-locations.php"}');
    353 
    354 /***/ })
     319/***/ }
    355320
    356321/******/    });
     
    365330/******/        if (cachedModule !== undefined) {
    366331/******/            return cachedModule.exports;
     332/******/        }
     333/******/        // Check if module exists (development only)
     334/******/        if (__webpack_modules__[moduleId] === undefined) {
     335/******/            var e = new Error("Cannot find module '" + moduleId + "'");
     336/******/            e.code = 'MODULE_NOT_FOUND';
     337/******/            throw e;
    367338/******/        }
    368339/******/        // Create a new module (and put it into the cache)
  • it-listings/trunk/assets/blocks/js/featured-locations/index.js.map

    r3200014 r3436888  
    1 {"version":3,"file":"./featured-locations/index.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Aa;WAC7D;;;;;UENA;UACA;UACA;UACA","sources":["webpack://it-listings/./assets/blocks/jsx/featured-locations/index.js","webpack://it-listings/./assets/blocks/jsx/featured-locations/section.js","webpack://it-listings/./assets/blocks/jsx/featured-locations/title.js","webpack://it-listings/external window \"React\"","webpack://it-listings/external window \"ReactJSXRuntime\"","webpack://it-listings/external window [\"wp\",\"blockEditor\"]","webpack://it-listings/external window [\"wp\",\"blocks\"]","webpack://it-listings/external window [\"wp\",\"components\"]","webpack://it-listings/external window [\"wp\",\"data\"]","webpack://it-listings/external window [\"wp\",\"i18n\"]","webpack://it-listings/webpack/bootstrap","webpack://it-listings/webpack/runtime/compat get default export","webpack://it-listings/webpack/runtime/define property getters","webpack://it-listings/webpack/runtime/hasOwnProperty shorthand","webpack://it-listings/webpack/runtime/make namespace object","webpack://it-listings/webpack/before-startup","webpack://it-listings/webpack/startup","webpack://it-listings/webpack/after-startup"],"sourcesContent":["import { registerBlockType } from '@wordpress/blocks';\nimport { useBlockProps } from '@wordpress/block-editor';\nimport { createContext } from 'react';\nimport Section from './section';\nimport Title from './title';\nimport metadata from '../../../../inc/blocks/featured-locations/block.json';\n\nconst slug = 'it-listings/featured-locations';\nexport const attsContext = createContext();\n\nconst blockData = {\n    icon: {\n        src: <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M12 12c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm6-1.8C18 6.57 15.35 4 12 4s-6 2.57-6 6.2c0 2.34 1.95 5.44 6 9.14 4.05-3.7 6-6.8 6-9.14zM12 2c4.2 0 8 3.22 8 8.2 0 3.32-2.67 7.25-8 11.8-5.33-4.55-8-8.48-8-11.8C4 5.22 7.8 2 12 2z\"/></svg>\n    },\n    edit: (props) => {\n        const { attributes, setAttributes } = props;\n        const { sections } = attributes;\n        return (\n            <section {...useBlockProps({ className: 'itre-editor-featured-locations section' })}>\n                <attsContext.Provider value={{ attributes, setAttributes }}>\n                    <Title />\n                    <div className=\"itre-editor-featured-locations__sections\">\n                        {sections.map((section) => (\n                            <Section order={section['order']} media={section['mediaId']} />\n                        ))}\n                    </div>\n                </attsContext.Provider>\n            </section>\n        )\n    },\n    save: () => null,\n    ...metadata\n};\nregisterBlockType(slug, blockData);","import { useContext } from 'react';\nimport { MediaUpload, MediaUploadCheck } from '@wordpress/blockEditor';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { SelectControl, ResponsiveWrapper, Button } from '@wordpress/components';\nimport { attsContext } from './index';\nconst ALLOWED_TYPES = ['image'];\n\nconst Section = ({ order, media }) => {\n    const { attributes: { sections }, setAttributes } = useContext(attsContext);\n    const section = sections.filter(item => item['order'] === order)[0];\n\n    const allTerms = useSelect(select => (\n        select('core').getEntityRecords('taxonomy', 'location', {per_page: -1})\n    ), []);\n\n    const image = useSelect(select => (\n        media !== undefined &&\n        select('core').getMedia(media)\n    ), [media]);\n\n    const onSelectMedia = (media) => {\n        const newSections = sections.map(item => {\n            if(item['order'] === order) {\n               return {...item, mediaId: media.id }\n            }\n            return item;\n        });\n        setAttributes({sections: newSections});\n    }\n    \n    return (\n        <div className=\"itre-editor-featured-locations__section\">\n            <>\n                {allTerms !== null &&\n                    <p>\n                        <SelectControl\n                            label={__(\"Location\")}\n                            value={section['location']}\n                            onChange={(value) => {\n                                const newSections = sections.map(item => {\n                                    if (item['order'] === order) {\n                                        return {...item, location: parseInt(value)}\n                                    }\n                                    return item;\n                                });\n                                setAttributes({sections: newSections})\n                            }}\n                        >\n                            <option value={0}>{__(\"Select Location\")}</option>\n                            {allTerms.map( term => <option value={term.id}>{__(term.name)}</option> )}\n                        </SelectControl>\n                    </p>\n                }\n\n                <p>\n                    <MediaUploadCheck>\n                        <MediaUpload\n                            allowed={ALLOWED_TYPES}\n                            multiple={false}\n                            render={({open})=> {\n                                return (\n                                    <>\n                                        {\n                                            section.mediaId === 0 &&\n                                            <p>\n                                                <span class=\"dashicons dashicons-format-image\"></span><span class=\"placeholder-text\">Image</span>\n                                            </p>\n                                        }\n\n                                        {   \n                                        image !== undefined &&    \n                                            Object.keys(image).length !== 0 &&\n                                            <ResponsiveWrapper\n                                                naturalWidth={ image.media_details.width }\n                                                naturalHeight={ image.media_details.height }\n                                            >\n                                                <img src={ image.source_url } />\n                                            </ResponsiveWrapper>\n                                        }\n\n                                        <p>\n                                            <Button\n                                                className={image === undefined || Object.keys(image).length === 0 ? 'is-primary' : 'is-secondary'}\n                                                onClick={open}\n                                            >\n                                                {section.mediaId === 0 ? __('Choose an Image', 'it-listings') : __('Replace Image', 'it-listings')}\n                                            </Button>\n                                        </p>\n                                    </>\n                                )\n                            }}\n                            value={section['mediaId']}\n                            onSelect={ onSelectMedia }\n                        >\n                        </MediaUpload>\n                    </MediaUploadCheck>\n                </p>\n            </>\n        </div>\n    )\n}\n\nexport default Section;","import { useContext } from 'react';\nimport { TextControl } from '@wordpress/components';\nimport { attsContext } from './index';\nimport {__} from '@wordpress/i18n';\n\nconst Title = () => {\n    const { attributes, setAttributes } = useContext(attsContext);\n    const { title, description } = attributes;\n\n    return (\n        <>\n            <h2>{__(\"Featured Locations\")}</h2>\n            <p>\n                <TextControl\n                label=\"Title\"\n                    value={title}\n                    onChange={value => setAttributes({title: value})}\n                />\n            </p>\n\n            <p>\n                <TextControl\n                    label=\"Description\"\n                    value={description}\n                    onChange={value => setAttributes({description: value})}\n                />\n            </p>\n        </>\n    )\n};\n\nexport default Title;","module.exports = window[\"React\"];","module.exports = window[\"ReactJSXRuntime\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./assets/blocks/jsx/featured-locations/index.js\");\n",""],"names":["registerBlockType","useBlockProps","createContext","Section","Title","metadata","jsx","_jsx","jsxs","_jsxs","slug","attsContext","blockData","icon","src","xmlns","height","viewBox","width","fill","children","d","edit","props","attributes","setAttributes","sections","className","Provider","value","map","section","order","media","save","useContext","MediaUpload","MediaUploadCheck","useSelect","__","SelectControl","ResponsiveWrapper","Button","Fragment","_Fragment","ALLOWED_TYPES","filter","item","allTerms","select","getEntityRecords","per_page","image","undefined","getMedia","onSelectMedia","newSections","mediaId","id","label","onChange","location","parseInt","term","name","allowed","multiple","render","open","class","Object","keys","length","naturalWidth","media_details","naturalHeight","source_url","onClick","onSelect","TextControl","title","description"],"sourceRoot":""}
     1{"version":3,"file":"./featured-locations/index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAsD;AACE;AAClB;AACN;AACJ;AACgD;AAE5E,MAAMM,IAAI,GAAG,gCAAgC;AACtC,MAAMC,WAAW,GAAGL,oDAAa,CAAC,CAAC;AAE1C,MAAMM,SAAS,GAAG;EACdC,IAAI,EAAE;IACFC,GAAG,EAAEC,iEAAA;MAAKC,KAAK,EAAC,4BAA4B;MAACC,MAAM,EAAC,MAAM;MAACC,OAAO,EAAC,WAAW;MAACC,KAAK,EAAC,MAAM;MAACC,IAAI,EAAC;IAAS,GAACL,iEAAA;MAAMM,CAAC,EAAC,eAAe;MAACD,IAAI,EAAC;IAAM,CAAC,CAAC,EAAAL,iEAAA;MAAMM,CAAC,EAAC;IAAuO,CAAC,CAAM;EAC1Y,CAAC;EACDC,IAAI,EAAGC,KAAK,IAAK;IACb,MAAM;MAAEC,UAAU;MAAEC;IAAc,CAAC,GAAGF,KAAK;IAC3C,MAAM;MAAEG;IAAS,CAAC,GAAGF,UAAU;IAC/B,OACIT,iEAAA,YAAaV,sEAAa,CAAC;MAAEsB,SAAS,EAAE;IAAyC,CAAC,CAAC,EAC/EZ,iEAAA,CAACJ,WAAW,CAACiB,QAAQ;MAACC,KAAK,EAAE;QAAEL,UAAU;QAAEC;MAAc;IAAE,GACvDV,iEAAA,CAACP,8CAAK,MAAE,CAAC,EACTO,iEAAA;MAAKY,SAAS,EAAC;IAA0C,GACpDD,QAAQ,CAACI,GAAG,CAAEC,OAAO,IAClBhB,iEAAA,CAACR,gDAAO;MAACyB,KAAK,EAAED,OAAO,CAAC,OAAO,CAAE;MAACE,KAAK,EAAEF,OAAO,CAAC,SAAS;IAAE,CAAE,CACjE,CACA,CACa,CACjB,CAAC;EAElB,CAAC;EACDG,IAAI,EAAEA,CAAA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7B,KAAK,EAAEkD,KAAM;IACbpB,QAAQ,EAAE9B,KAAK,IAAIJ,aAAa,CAAC;MAACsD,KAAK,EAAElD;IAAK,CAAC;EAAE,CACpD,CACF,CAAC,EAEJd,iEAAA,YACIA,iEAAA,CAAC+D,8DAAW;IACRpB,KAAK,EAAC,aAAa;IACnB7B,KAAK,EAAEmD,WAAY;IACnBrB,QAAQ,EAAE9B,KAAK,IAAIJ,aAAa,CAAC;MAACuD,WAAW,EAAEnD;IAAK,CAAC;EAAE,CAC1D,CACF,CACL,CAAC;AAEX,CAAC;AAED,iEAAerB,KAAK,E;;;;;;;;;;;;;;;;;;;;AC/BpB,6C;;;;;;;;;;ACAA,wC;;;;;;;;;;ACAA,4C;;;;;;;;;;ACAA,sC;;;;;;;;;;ACAA,yC;;;;;;;;;;ACAA,sC;;;;;;;;;;ACAA,iC;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WC5BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA,E;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA,E;;;;;WCPA,wF;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;UENA;UACA;UACA;UACA","sources":["webpack://it-listings/./assets/blocks/jsx/featured-locations/index.js","webpack://it-listings/./assets/blocks/jsx/featured-locations/section.js","webpack://it-listings/./assets/blocks/jsx/featured-locations/title.js","webpack://it-listings/external window [\"wp\",\"blockEditor\"]","webpack://it-listings/external window [\"wp\",\"blocks\"]","webpack://it-listings/external window [\"wp\",\"components\"]","webpack://it-listings/external window [\"wp\",\"data\"]","webpack://it-listings/external window [\"wp\",\"element\"]","webpack://it-listings/external window [\"wp\",\"i18n\"]","webpack://it-listings/external window \"React\"","webpack://it-listings/webpack/bootstrap","webpack://it-listings/webpack/runtime/compat get default export","webpack://it-listings/webpack/runtime/define property getters","webpack://it-listings/webpack/runtime/hasOwnProperty shorthand","webpack://it-listings/webpack/runtime/make namespace object","webpack://it-listings/webpack/before-startup","webpack://it-listings/webpack/startup","webpack://it-listings/webpack/after-startup"],"sourcesContent":["import { registerBlockType } from '@wordpress/blocks';\nimport { useBlockProps } from '@wordpress/block-editor';\nimport { createContext } from 'react';\nimport Section from './section';\nimport Title from './title';\nimport metadata from '../../../../inc/blocks/featured-locations/block.json';\n\nconst slug = 'it-listings/featured-locations';\nexport const attsContext = createContext();\n\nconst blockData = {\n    icon: {\n        src: <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M12 12c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm6-1.8C18 6.57 15.35 4 12 4s-6 2.57-6 6.2c0 2.34 1.95 5.44 6 9.14 4.05-3.7 6-6.8 6-9.14zM12 2c4.2 0 8 3.22 8 8.2 0 3.32-2.67 7.25-8 11.8-5.33-4.55-8-8.48-8-11.8C4 5.22 7.8 2 12 2z\"/></svg>\n    },\n    edit: (props) => {\n        const { attributes, setAttributes } = props;\n        const { sections } = attributes;\n        return (\n            <section {...useBlockProps({ className: 'itre-editor-featured-locations section' })}>\n                <attsContext.Provider value={{ attributes, setAttributes }}>\n                    <Title />\n                    <div className=\"itre-editor-featured-locations__sections\">\n                        {sections.map((section) => (\n                            <Section order={section['order']} media={section['mediaId']} />\n                        ))}\n                    </div>\n                </attsContext.Provider>\n            </section>\n        )\n    },\n    save: () => null,\n    ...metadata\n};\nregisterBlockType(slug, blockData);","import { useContext } from 'react';\nimport { MediaUpload, MediaUploadCheck } from '@wordpress/blockEditor';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { SelectControl, ResponsiveWrapper, Button } from '@wordpress/components';\nimport { attsContext } from './index';\nconst ALLOWED_TYPES = ['image'];\n\nconst Section = ({ order, media }) => {\n    const { attributes: { sections }, setAttributes } = useContext(attsContext);\n    const section = sections.filter(item => item['order'] === order)[0];\n\n    const allTerms = useSelect(select => (\n        select('core').getEntityRecords('taxonomy', 'location', {per_page: -1})\n    ), []);\n\n    const image = useSelect(select => (\n        media !== undefined &&\n        select('core').getMedia(media)\n    ), [media]);\n\n    const onSelectMedia = (media) => {\n        const newSections = sections.map(item => {\n            if(item['order'] === order) {\n               return {...item, mediaId: media.id }\n            }\n            return item;\n        });\n        setAttributes({sections: newSections});\n    }\n    \n    return (\n        <div className=\"itre-editor-featured-locations__section\">\n            <>\n                {allTerms !== null &&\n                    <p>\n                        <SelectControl\n                            label={__(\"Location\")}\n                            value={section['location']}\n                            onChange={(value) => {\n                                const newSections = sections.map(item => {\n                                    if (item['order'] === order) {\n                                        return {...item, location: parseInt(value)}\n                                    }\n                                    return item;\n                                });\n                                setAttributes({sections: newSections})\n                            }}\n                        >\n                            <option value={0}>{__(\"Select Location\")}</option>\n                            {allTerms.map( term => <option value={term.id}>{__(term.name)}</option> )}\n                        </SelectControl>\n                    </p>\n                }\n\n                <p>\n                    <MediaUploadCheck>\n                        <MediaUpload\n                            allowed={ALLOWED_TYPES}\n                            multiple={false}\n                            render={({open})=> {\n                                return (\n                                    <>\n                                        {\n                                            section.mediaId === 0 &&\n                                            <p>\n                                                <span class=\"dashicons dashicons-format-image\"></span><span class=\"placeholder-text\">Image</span>\n                                            </p>\n                                        }\n\n                                        {   \n                                        image !== undefined &&    \n                                            Object.keys(image).length !== 0 &&\n                                            <ResponsiveWrapper\n                                                naturalWidth={ image.media_details.width }\n                                                naturalHeight={ image.media_details.height }\n                                            >\n                                                <img src={ image.source_url } />\n                                            </ResponsiveWrapper>\n                                        }\n\n                                        <p>\n                                            <Button\n                                                className={image === undefined || Object.keys(image).length === 0 ? 'is-primary' : 'is-secondary'}\n                                                onClick={open}\n                                            >\n                                                {section.mediaId === 0 ? __('Choose an Image', 'it-listings') : __('Replace Image', 'it-listings')}\n                                            </Button>\n                                        </p>\n                                    </>\n                                )\n                            }}\n                            value={section['mediaId']}\n                            onSelect={ onSelectMedia }\n                        >\n                        </MediaUpload>\n                    </MediaUploadCheck>\n                </p>\n            </>\n        </div>\n    )\n}\n\nexport default Section;","import { useContext } from 'react';\nimport { TextControl } from '@wordpress/components';\nimport { attsContext } from './index';\nimport {__} from '@wordpress/i18n';\n\nconst Title = () => {\n    const { attributes, setAttributes } = useContext(attsContext);\n    const { title, description } = attributes;\n\n    return (\n        <>\n            <h2>{__(\"Featured Locations\")}</h2>\n            <p>\n                <TextControl\n                label=\"Title\"\n                    value={title}\n                    onChange={value => setAttributes({title: value})}\n                />\n            </p>\n\n            <p>\n                <TextControl\n                    label=\"Description\"\n                    value={description}\n                    onChange={value => setAttributes({description: value})}\n                />\n            </p>\n        </>\n    )\n};\n\nexport default Title;","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"React\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Check if module exists (development only)\n\tif (__webpack_modules__[moduleId] === undefined) {\n\t\tvar e = new Error(\"Cannot find module '\" + moduleId + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./assets/blocks/jsx/featured-locations/index.js\");\n",""],"names":["registerBlockType","useBlockProps","createContext","Section","Title","metadata","slug","attsContext","blockData","icon","src","createElement","xmlns","height","viewBox","width","fill","d","edit","props","attributes","setAttributes","sections","className","Provider","value","map","section","order","media","save","useContext","MediaUpload","MediaUploadCheck","useSelect","__","SelectControl","ResponsiveWrapper","Button","ALLOWED_TYPES","filter","item","allTerms","select","getEntityRecords","per_page","image","undefined","getMedia","onSelectMedia","newSections","mediaId","id","Fragment","label","onChange","location","parseInt","term","name","allowed","multiple","render","open","class","Object","keys","length","naturalWidth","media_details","naturalHeight","source_url","onClick","onSelect","TextControl","title","description"],"ignoreList":[],"sourceRoot":""}
  • it-listings/trunk/assets/blocks/js/featured-types/index.asset.php

    r3200014 r3436888  
    1 <?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => '602b5c0701979f30cfd1');
     1<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '4abb7d5caa856ff8c393');
  • it-listings/trunk/assets/blocks/js/featured-types/index.js

    r3200014 r3436888  
    33/******/    var __webpack_modules__ = ({
    44
    5 /***/ "./assets/blocks/jsx/featured-types/index.js":
     5/***/ "./assets/blocks/jsx/featured-types/index.js"
    66/*!***************************************************!*\
    77  !*** ./assets/blocks/jsx/featured-types/index.js ***!
    88  \***************************************************/
    9 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
     9(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
    1010
    1111__webpack_require__.r(__webpack_exports__);
     
    1313/* harmony export */   attsContext: () => (/* binding */ attsContext)
    1414/* harmony export */ });
    15 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
    16 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
    17 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
    18 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
    19 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
    20 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
    21 /* harmony import */ var _section__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./section */ "./assets/blocks/jsx/featured-types/section.js");
    22 /* harmony import */ var _title__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./title */ "./assets/blocks/jsx/featured-types/title.js");
    23 /* harmony import */ var _inc_blocks_featured_types_block_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../inc/blocks/featured-types/block.json */ "./inc/blocks/featured-types/block.json");
    24 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
    25 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
     15/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
     16/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
     17/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
     18/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
     19/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
     20/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);
     21/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "react");
     22/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
     23/* harmony import */ var _section__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./section */ "./assets/blocks/jsx/featured-types/section.js");
     24/* harmony import */ var _title__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./title */ "./assets/blocks/jsx/featured-types/title.js");
     25/* harmony import */ var _inc_blocks_featured_types_block_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../inc/blocks/featured-types/block.json */ "./inc/blocks/featured-types/block.json");
    2626
    2727
     
    3232
    3333const slug = 'it-listings/featured-types';
    34 const attsContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)();
     34const attsContext = (0,react__WEBPACK_IMPORTED_MODULE_3__.createContext)();
    3535const blockData = {
    3636  icon: {
    37     src: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("svg", {
     37    src: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
    3838      xmlns: "http://www.w3.org/2000/svg",
    3939      "enable-background": "new 0 0 24 24",
     
    4141      viewBox: "0 0 24 24",
    4242      width: "24px",
    43       fill: "#000000",
    44       children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("g", {
    45         children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("rect", {
    46           fill: "none",
    47           height: "24",
    48           width: "24"
    49         })
    50       }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("g", {
    51         children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("g", {
    52           children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("path", {
    53             d: "M19,9.3V4h-3v2.6L12,3L2,12h3v8h6v-6h2v6h6v-8h3L19,9.3z M17,18h-2v-6H9v6H7v-7.81l5-4.5l5,4.5V18z"
    54           }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("path", {
    55             d: "M10,10h4c0-1.1-0.9-2-2-2S10,8.9,10,10z"
    56           })]
    57         })
    58       })]
    59     })
     43      fill: "#000000"
     44    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", {
     45      fill: "none",
     46      height: "24",
     47      width: "24"
     48    })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
     49      d: "M19,9.3V4h-3v2.6L12,3L2,12h3v8h6v-6h2v6h6v-8h3L19,9.3z M17,18h-2v-6H9v6H7v-7.81l5-4.5l5,4.5V18z"
     50    }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
     51      d: "M10,10h4c0-1.1-0.9-2-2-2S10,8.9,10,10z"
     52    }))))
    6053  },
    6154  edit: props => {
     
    6760      sections
    6861    } = attributes;
    69     return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("section", {
    70       ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
    71         className: 'itre-editor-featured-types section'
    72       }),
    73       children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(attsContext.Provider, {
    74         value: {
    75           attributes,
    76           setAttributes
    77         },
    78         children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_title__WEBPACK_IMPORTED_MODULE_4__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
    79           className: "itre-editor-featured-types__sections",
    80           children: sections.map(section => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_section__WEBPACK_IMPORTED_MODULE_3__["default"], {
    81             order: section.order
    82           }))
    83         })]
    84       })
    85     });
     62    return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)({
     63      className: 'itre-editor-featured-types section'
     64    }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(attsContext.Provider, {
     65      value: {
     66        attributes,
     67        setAttributes
     68      }
     69    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_title__WEBPACK_IMPORTED_MODULE_5__["default"], null), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
     70      className: "itre-editor-featured-types__sections"
     71    }, sections.map(section => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_section__WEBPACK_IMPORTED_MODULE_4__["default"], {
     72      order: section.order
     73    })))));
    8674  },
    8775  save: () => null,
    88   ..._inc_blocks_featured_types_block_json__WEBPACK_IMPORTED_MODULE_5__
     76  ..._inc_blocks_featured_types_block_json__WEBPACK_IMPORTED_MODULE_6__
    8977};
    90 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(slug, blockData);
    91 
    92 /***/ }),
    93 
    94 /***/ "./assets/blocks/jsx/featured-types/section.js":
     78(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)(slug, blockData);
     79
     80/***/ },
     81
     82/***/ "./assets/blocks/jsx/featured-types/section.js"
    9583/*!*****************************************************!*\
    9684  !*** ./assets/blocks/jsx/featured-types/section.js ***!
    9785  \*****************************************************/
    98 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
     86(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
    9987
    10088__webpack_require__.r(__webpack_exports__);
     
    10290/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
    10391/* harmony export */ });
    104 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
    105 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
    106 /* harmony import */ var _wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blockEditor */ "@wordpress/block-editor");
    107 /* harmony import */ var _wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_1__);
    108 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
    109 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
    110 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
    111 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
    112 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
    113 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__);
    114 /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./index */ "./assets/blocks/jsx/featured-types/index.js");
    115 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
    116 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
     92/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
     93/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
     94/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
     95/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
     96/* harmony import */ var _wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/blockEditor */ "@wordpress/block-editor");
     97/* harmony import */ var _wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_2__);
     98/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
     99/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
     100/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
     101/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
     102/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
     103/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__);
     104/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./index */ "./assets/blocks/jsx/featured-types/index.js");
    117105
    118106
     
    129117    attributes,
    130118    setAttributes
    131   } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_index__WEBPACK_IMPORTED_MODULE_5__.attsContext);
     119  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_index__WEBPACK_IMPORTED_MODULE_6__.attsContext);
    132120  const {
    133121    sections
    134122  } = attributes;
    135123  const section = sections.filter(item => item['order'] === order)[0];
    136   const allTerms = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select('core').getEntityRecords('taxonomy', 'property-type', {
     124  const allTerms = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select('core').getEntityRecords('taxonomy', 'property-type', {
    137125    per_page: -1
    138126  }));
     
    146134    });
    147135  };
    148   const image = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => section.mediaId !== 0 ? select('core').getMedia(section.mediaId) : {}, [section]);
    149   return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
    150     className: "itre-editor-featured-types__section",
    151     children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, {
    152       children: [allTerms !== null && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", {
    153         children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.SelectControl, {
    154           label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Property Type"),
    155           value: section['type'],
    156           onChange: value => {
    157             const newSections = sections.map(item => item['order'] === order ? {
    158               ...item,
    159               type: parseInt(value)
    160             } : item);
    161             setAttributes({
    162               sections: newSections
    163             });
    164           },
    165           children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("option", {
    166             value: 0,
    167             children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Select Property Type")
    168           }), allTerms.map(term => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("option", {
    169             value: term.id,
    170             children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)(term.name)
    171           }))]
    172         })
    173       }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", {
    174         children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_1__.MediaUploadCheck, {
    175           children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_1__.MediaUpload, {
    176             allowed: ALLOWED_TYPES,
    177             multiple: false,
    178             render: ({
    179               open
    180             }) => {
    181               return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, {
    182                 children: [section.mediaId === 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("p", {
    183                   children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span", {
    184                     class: "dashicons dashicons-format-image"
    185                   }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span", {
    186                     class: "placeholder-text",
    187                     children: "Image"
    188                   })]
    189                 }), image !== undefined && Object.keys(image).length !== 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.ResponsiveWrapper, {
    190                   naturalWidth: image.media_details.width,
    191                   naturalHeight: image.media_details.height,
    192                   children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("img", {
    193                     src: image.source_url
    194                   })
    195                 }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", {
    196                   children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.Button, {
    197                     className: image === undefined || Object.keys(image).length === 0 ? 'is-primary' : 'is-secondary',
    198                     onClick: open,
    199                     children: section.mediaId === 0 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Choose an Image', 'it-listings') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Replace Image', 'it-listings')
    200                   })
    201                 })]
    202               });
    203             },
    204             value: section['mediaId'],
    205             onSelect: onSelectMedia
    206           })
    207         })
    208       })]
    209     })
    210   });
     136  const image = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => section.mediaId !== 0 ? select('core').getMedia(section.mediaId) : {}, [section]);
     137  return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
     138    className: "itre-editor-featured-types__section"
     139  }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, allTerms !== null && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.SelectControl, {
     140    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("Property Type"),
     141    value: section['type'],
     142    onChange: value => {
     143      const newSections = sections.map(item => item['order'] === order ? {
     144        ...item,
     145        type: parseInt(value)
     146      } : item);
     147      setAttributes({
     148        sections: newSections
     149      });
     150    }
     151  }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("option", {
     152    value: 0
     153  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("Select Property Type")), allTerms.map(term => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("option", {
     154    value: term.id
     155  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)(term.name))))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_2__.MediaUploadCheck, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_blockEditor__WEBPACK_IMPORTED_MODULE_2__.MediaUpload, {
     156    allowed: ALLOWED_TYPES,
     157    multiple: false,
     158    render: ({
     159      open
     160    }) => {
     161      return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, section.mediaId === 0 && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
     162        class: "dashicons dashicons-format-image"
     163      }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
     164        class: "placeholder-text"
     165      }, "Image")), image !== undefined && Object.keys(image).length !== 0 && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ResponsiveWrapper, {
     166        naturalWidth: image.media_details.width,
     167        naturalHeight: image.media_details.height
     168      }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
     169        src: image.source_url
     170      })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.Button, {
     171        className: image === undefined || Object.keys(image).length === 0 ? 'is-primary' : 'is-secondary',
     172        onClick: open
     173      }, section.mediaId === 0 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Choose an Image', 'it-listings') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Replace Image', 'it-listings'))));
     174    },
     175    value: section['mediaId'],
     176    onSelect: onSelectMedia
     177  })))));
    211178};
    212179/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Section);
    213180
    214 /***/ }),
    215 
    216 /***/ "./assets/blocks/jsx/featured-types/title.js":
     181/***/ },
     182
     183/***/ "./assets/blocks/jsx/featured-types/title.js"
    217184/*!***************************************************!*\
    218185  !*** ./assets/blocks/jsx/featured-types/title.js ***!
    219186  \***************************************************/
    220 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
     187(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
    221188
    222189__webpack_require__.r(__webpack_exports__);
     
    224191/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
    225192/* harmony export */ });
    226 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
    227 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
    228 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
    229 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
    230 /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index */ "./assets/blocks/jsx/featured-types/index.js");
    231 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
    232 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
    233 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
    234 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
     193/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
     194/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
     195/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
     196/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
     197/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
     198/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
     199/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./index */ "./assets/blocks/jsx/featured-types/index.js");
     200/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
     201/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
    235202
    236203
     
    242209    attributes,
    243210    setAttributes
    244   } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_index__WEBPACK_IMPORTED_MODULE_2__.attsContext);
     211  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_index__WEBPACK_IMPORTED_MODULE_3__.attsContext);
    245212  const {
    246213    title,
    247214    description
    248215  } = attributes;
    249   return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
    250     children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("h2", {
    251       children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Featured Property Types")
    252     }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
    253       children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, {
    254         label: "Title",
    255         value: title,
    256         onChange: value => setAttributes({
    257           title: value
    258         })
    259       })
    260     }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
    261       children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, {
    262         label: "Description",
    263         value: description,
    264         onChange: value => setAttributes({
    265           description: value
    266         })
    267       })
    268     })]
    269   });
     216  return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("h2", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("Featured Property Types")), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.TextControl, {
     217    label: "Title",
     218    value: title,
     219    onChange: value => setAttributes({
     220      title: value
     221    })
     222  })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.TextControl, {
     223    label: "Description",
     224    value: description,
     225    onChange: value => setAttributes({
     226      description: value
     227    })
     228  })));
    270229};
    271230/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Title);
    272231
    273 /***/ }),
    274 
    275 /***/ "react":
     232/***/ },
     233
     234/***/ "./inc/blocks/featured-types/block.json"
     235/*!**********************************************!*\
     236  !*** ./inc/blocks/featured-types/block.json ***!
     237  \**********************************************/
     238(module) {
     239
     240module.exports = /*#__PURE__*/JSON.parse('{"apiVersion":3,"name":"it-listings/featured-types","title":"Featured Property Types","description":"Featured Area to showcase properties based on type - Apartment, Studio, Villa etc.","category":"it-listings","keywords":["featured area","properties","categories","types","property"],"attributes":{"title":{"type":"string","default":""},"description":{"type":"string","default":""},"align":{"type":"string","default":"center"},"sections":{"type":"array","default":[{"order":1,"mediaId":0,"type":0,"label":""},{"order":2,"mediaId":0,"type":0,"label":""},{"order":3,"mediaId":0,"type":0,"label":""},{"order":4,"mediaId":0,"type":0,"label":""}]}},"editorStyle":"itre-editor-featured-types-css","style":"itre-featured-types-css","editorScript":"itre-featured-types-js","render":"./featured-types.php"}');
     241
     242/***/ },
     243
     244/***/ "@wordpress/block-editor"
     245/*!*************************************!*\
     246  !*** external ["wp","blockEditor"] ***!
     247  \*************************************/
     248(module) {
     249
     250module.exports = window["wp"]["blockEditor"];
     251
     252/***/ },
     253
     254/***/ "@wordpress/blocks"
     255/*!********************************!*\
     256  !*** external ["wp","blocks"] ***!
     257  \********************************/
     258(module) {
     259
     260module.exports = window["wp"]["blocks"];
     261
     262/***/ },
     263
     264/***/ "@wordpress/components"
     265/*!************************************!*\
     266  !*** external ["wp","components"] ***!
     267  \************************************/
     268(module) {
     269
     270module.exports = window["wp"]["components"];
     271
     272/***/ },
     273
     274/***/ "@wordpress/data"
     275/*!******************************!*\
     276  !*** external ["wp","data"] ***!
     277  \******************************/
     278(module) {
     279
     280module.exports = window["wp"]["data"];
     281
     282/***/ },
     283
     284/***/ "@wordpress/element"
     285/*!*********************************!*\
     286  !*** external ["wp","element"] ***!
     287  \*********************************/
     288(module) {
     289
     290module.exports = window["wp"]["element"];
     291
     292/***/ },
     293
     294/***/ "@wordpress/i18n"
     295/*!******************************!*\
     296  !*** external ["wp","i18n"] ***!
     297  \******************************/
     298(module) {
     299
     300module.exports = window["wp"]["i18n"];
     301
     302/***/ },
     303
     304/***/ "react"
    276305/*!************************!*\
    277306  !*** external "React" ***!
    278307  \************************/
    279 /***/ ((module) => {
     308(module) {
    280309
    281310module.exports = window["React"];
    282311
    283 /***/ }),
    284 
    285 /***/ "react/jsx-runtime":
    286 /*!**********************************!*\
    287   !*** external "ReactJSXRuntime" ***!
    288   \**********************************/
    289 /***/ ((module) => {
    290 
    291 module.exports = window["ReactJSXRuntime"];
    292 
    293 /***/ }),
    294 
    295 /***/ "@wordpress/block-editor":
    296 /*!*************************************!*\
    297   !*** external ["wp","blockEditor"] ***!
    298   \*************************************/
    299 /***/ ((module) => {
    300 
    301 module.exports = window["wp"]["blockEditor"];
    302 
    303 /***/ }),
    304 
    305 /***/ "@wordpress/blocks":
    306 /*!********************************!*\
    307   !*** external ["wp","blocks"] ***!
    308   \********************************/
    309 /***/ ((module) => {
    310 
    311 module.exports = window["wp"]["blocks"];
    312 
    313 /***/ }),
    314 
    315 /***/ "@wordpress/components":
    316 /*!************************************!*\
    317   !*** external ["wp","components"] ***!
    318   \************************************/
    319 /***/ ((module) => {
    320 
    321 module.exports = window["wp"]["components"];
    322 
    323 /***/ }),
    324 
    325 /***/ "@wordpress/data":
    326 /*!******************************!*\
    327   !*** external ["wp","data"] ***!
    328   \******************************/
    329 /***/ ((module) => {
    330 
    331 module.exports = window["wp"]["data"];
    332 
    333 /***/ }),
    334 
    335 /***/ "@wordpress/i18n":
    336 /*!******************************!*\
    337   !*** external ["wp","i18n"] ***!
    338   \******************************/
    339 /***/ ((module) => {
    340 
    341 module.exports = window["wp"]["i18n"];
    342 
    343 /***/ }),
    344 
    345 /***/ "./inc/blocks/featured-types/block.json":
    346 /*!**********************************************!*\
    347   !*** ./inc/blocks/featured-types/block.json ***!
    348   \**********************************************/
    349 /***/ ((module) => {
    350 
    351 module.exports = /*#__PURE__*/JSON.parse('{"apiVersion":3,"name":"it-listings/featured-types","title":"Featured Property Types","description":"Featured Area to showcase properties based on type - Apartment, Studio,z Villa etc.","category":"it-listings","keywords":["featured area","properties","categories","types","property"],"attributes":{"title":{"type":"string","default":""},"description":{"type":"string","default":""},"align":{"type":"string","default":"center"},"sections":{"type":"array","default":[{"order":1,"mediaId":0,"type":0,"label":""},{"order":2,"mediaId":0,"type":0,"label":""},{"order":3,"mediaId":0,"type":0,"label":""},{"order":4,"mediaId":0,"type":0,"label":""}]}},"supports":{"align":["full","wide"],"alignWide":true},"editorStyle":"itre-editor-featured-types-css","style":"itre-featured-types-css","editorScript":"itre-featured-types-js","render":"./featured-types.php"}');
    352 
    353 /***/ })
     312/***/ }
    354313
    355314/******/    });
     
    364323/******/        if (cachedModule !== undefined) {
    365324/******/            return cachedModule.exports;
     325/******/        }
     326/******/        // Check if module exists (development only)
     327/******/        if (__webpack_modules__[moduleId] === undefined) {
     328/******/            var e = new Error("Cannot find module '" + moduleId + "'");
     329/******/            e.code = 'MODULE_NOT_FOUND';
     330/******/            throw e;
    366331/******/        }
    367332/******/        // Create a new module (and put it into the cache)
  • it-listings/trunk/assets/blocks/js/featured-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iC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;UENA;UACA;UACA;UACA","sources":["webpack://it-listings/./assets/blocks/jsx/featured-types/index.js","webpack://it-listings/./assets/blocks/jsx/featured-types/section.js","webpack://it-listings/./assets/blocks/jsx/featured-types/title.js","webpack://it-listings/external window \"React\"","webpack://it-listings/external window \"ReactJSXRuntime\"","webpack://it-listings/external window [\"wp\",\"blockEditor\"]","webpack://it-listings/external window [\"wp\",\"blocks\"]","webpack://it-listings/external window [\"wp\",\"components\"]","webpack://it-listings/external window [\"wp\",\"data\"]","webpack://it-listings/external window [\"wp\",\"i18n\"]","webpack://it-listings/webpack/bootstrap","webpack://it-listings/webpack/runtime/compat get default export","webpack://it-listings/webpack/runtime/define property getters","webpack://it-listings/webpack/runtime/hasOwnProperty shorthand","webpack://it-listings/webpack/runtime/make namespace object","webpack://it-listings/webpack/before-startup","webpack://it-listings/webpack/startup","webpack://it-listings/webpack/after-startup"],"sourcesContent":["import { registerBlockType } from '@wordpress/blocks';\nimport { useBlockProps } from '@wordpress/block-editor';\nimport { createContext } from 'react';\nimport Section from './section';\nimport Title from './title';\nimport metadata from '../../../../inc/blocks/featured-types/block.json';\n\nconst slug = 'it-listings/featured-types';\nexport const attsContext = createContext();\n\nconst blockData = {\n    icon: {\n        src: <svg xmlns=\"http://www.w3.org/2000/svg\" enable-background=\"new 0 0 24 24\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\"><g><rect fill=\"none\" height=\"24\" width=\"24\"/></g><g><g><path d=\"M19,9.3V4h-3v2.6L12,3L2,12h3v8h6v-6h2v6h6v-8h3L19,9.3z M17,18h-2v-6H9v6H7v-7.81l5-4.5l5,4.5V18z\"/><path d=\"M10,10h4c0-1.1-0.9-2-2-2S10,8.9,10,10z\"/></g></g></svg>\n    },\n    edit: (props) => {\n        const { attributes, setAttributes } = props;\n        const { sections } = attributes;\n\n        return (\n            <section {...useBlockProps({ className: 'itre-editor-featured-types section' })}>\n                <attsContext.Provider value={{ attributes, setAttributes }}>\n                    <Title />\n                    <div className=\"itre-editor-featured-types__sections\">\n                        {sections.map(section => (\n                            <Section order={section.order} />\n                        ))}\n                    </div>\n                </attsContext.Provider>\n            </section>\n        )\n    },\n    save: () => null,\n    ...metadata\n};\nregisterBlockType(slug, blockData);","import { useContext } from 'react';\nimport { MediaUpload, MediaUploadCheck } from '@wordpress/blockEditor';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { SelectControl, ResponsiveWrapper, Button } from '@wordpress/components';\nimport { attsContext } from './index';\nconst ALLOWED_TYPES = ['image'];\n\nconst Section = ({ order }) => {\n    const { attributes, setAttributes } = useContext(attsContext);\n    const { sections } = attributes;\n    const section = sections.filter(item => item['order'] === order)[0];\n\n    const allTerms = useSelect(select => select('core').getEntityRecords('taxonomy', 'property-type', {per_page: -1}));\n\n    const onSelectMedia = (media) => {\n        const newSections = sections.map(item => item['order'] === order ? {...item, mediaId: media.id } : item);\n        return setAttributes({sections: newSections});\n    }\n\n    const image = useSelect(select => (\n        section.mediaId !== 0 ? select('core').getMedia(section.mediaId) : {}\n    ), [section]);\n\n    return (\n        <div className=\"itre-editor-featured-types__section\">\n            <>\n                {allTerms !== null &&\n                    <p>\n                        <SelectControl\n                            label={__(\"Property Type\")}\n                            value={section['type']}\n                            onChange={(value) => {\n                                const newSections = sections.map(item => (\n                                    item['order'] === order ? {...item, type: parseInt(value)} : item\n                                ));\n                                setAttributes({sections: newSections})\n                            }}\n                        >\n                            <option value={0}>{__(\"Select Property Type\")}</option>\n                            {allTerms.map( term => <option value={term.id}>{__(term.name)}</option> )}\n                        </SelectControl>\n                    </p>\n                }\n\n                <p>\n                    <MediaUploadCheck>\n                        <MediaUpload\n                            allowed={ALLOWED_TYPES}\n                            multiple={false}\n                            render={({open})=> {\n                                return (\n                                    <>\n                                    {\n                                        section.mediaId === 0 &&\n                                        <p>\n                                            <span class=\"dashicons dashicons-format-image\"></span><span class=\"placeholder-text\">Image</span>\n                                        </p>\n                                    }\n\n                                    {   \n                                    image !== undefined &&    \n                                        Object.keys(image).length !== 0 &&\n                                        <ResponsiveWrapper\n                                            naturalWidth={ image.media_details.width }\n                                            naturalHeight={ image.media_details.height }\n                                        >\n                                            <img src={ image.source_url } />\n                                        </ResponsiveWrapper>\n                                    }\n\n                                    <p>\n                                        <Button\n                                            className={image === undefined || Object.keys(image).length === 0 ? 'is-primary' : 'is-secondary'}\n                                            onClick={open}\n                                        >\n                                            {section.mediaId === 0 ? __('Choose an Image', 'it-listings') : __('Replace Image', 'it-listings')}\n                                        </Button>\n                                    </p>\n                                    </>\n                                )\n                            }}\n                            value={section['mediaId']}\n                            onSelect={ onSelectMedia }\n                        >\n                        </MediaUpload>\n                    </MediaUploadCheck>\n                </p>\n            </>\n        </div>\n    )\n}\n\nexport default Section;","import { useContext } from 'react';\nimport { TextControl } from '@wordpress/components';\nimport { attsContext } from './index';\nimport {__} from '@wordpress/i18n';\n\nconst Title = () => {\n    const { attributes, setAttributes } = useContext(attsContext);\n    const { title, description } = attributes;\n\n    return (\n        <>\n            <h2>{__(\"Featured Property Types\")}</h2>\n            <p>\n                <TextControl\n                label=\"Title\"\n                    value={title}\n                    onChange={value => setAttributes({title: value})}\n                />\n            </p>\n\n            <p>\n                <TextControl\n                    label=\"Description\"\n                    value={description}\n                    onChange={value => setAttributes({description: value})}\n                />\n            </p>\n        </>\n    )\n};\n\nexport default Title;","module.exports = window[\"React\"];","module.exports = window[\"ReactJSXRuntime\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./assets/blocks/jsx/featured-types/index.js\");\n",""],"names":["registerBlockType","useBlockProps","createContext","Section","Title","metadata","jsx","_jsx","jsxs","_jsxs","slug","attsContext","blockData","icon","src","xmlns","height","viewBox","width","fill","children","d","edit","props","attributes","setAttributes","sections","className","Provider","value","map","section","order","save","useContext","MediaUpload","MediaUploadCheck","useSelect","__","SelectControl","ResponsiveWrapper","Button","Fragment","_Fragment","ALLOWED_TYPES","filter","item","allTerms","select","getEntityRecords","per_page","onSelectMedia","media","newSections","mediaId","id","image","getMedia","label","onChange","type","parseInt","term","name","allowed","multiple","render","open","class","undefined","Object","keys","length","naturalWidth","media_details","naturalHeight","source_url","onClick","onSelect","TextControl","title","description"],"sourceRoot":""}
     1{"version":3,"file":"./featured-types/index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAsD;AACE;AAClB;AACN;AACJ;AAC4C;AAExE,MAAMM,IAAI,GAAG,4BAA4B;AAClC,MAAMC,WAAW,GAAGL,oDAAa,CAAC,CAAC;AAE1C,MAAMM,SAAS,GAAG;EACdC,IAAI,EAAE;IACFC,GAAG,EAAEC,iEAAA;MAAKC,KAAK,EAAC,4BAA4B;MAAC,qBAAkB,eAAe;MAACC,MAAM,EAAC,MAAM;MAACC,OAAO,EAAC,WAAW;MAACC,KAAK,EAAC,MAAM;MAACC,IAAI,EAAC;IAAS,GAACL,iEAAA,YAAGA,iEAAA;MAAMK,IAAI,EAAC,MAAM;MAACH,MAAM,EAAC,IAAI;MAACE,KAAK,EAAC;IAAI,CAAC,CAAI,CAAC,EAAAJ,iEAAA,YAAGA,iEAAA,YAAGA,iEAAA;MAAMM,CAAC,EAAC;IAAiG,CAAC,CAAC,EAAAN,iEAAA;MAAMM,CAAC,EAAC;IAAwC,CAAC,CAAI,CAAI,CAAM;EAClX,CAAC;EACDC,IAAI,EAAGC,KAAK,IAAK;IACb,MAAM;MAAEC,UAAU;MAAEC;IAAc,CAAC,GAAGF,KAAK;IAC3C,MAAM;MAAEG;IAAS,CAAC,GAAGF,UAAU;IAE/B,OACIT,iEAAA,YAAaV,sEAAa,CAAC;MAAEsB,SAAS,EAAE;IAAqC,CAAC,CAAC,EAC3EZ,iEAAA,CAACJ,WAAW,CAACiB,QAAQ;MAACC,KAAK,EAAE;QAAEL,UAAU;QAAEC;MAAc;IAAE,GACvDV,iEAAA,CAACP,8CAAK,MAAE,CAAC,EACTO,iEAAA;MAAKY,SAAS,EAAC;IAAsC,GAChDD,QAAQ,CAACI,G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AyB,CAAM,CAAC,EACxCvB,iEAAA,YACIA,iEAAA,CAAC+D,8DAAW;IACZrB,KAAK,EAAC,OAAO;IACT5B,KAAK,EAAEkD,KAAM;IACbrB,QAAQ,EAAE7B,KAAK,IAAIJ,aAAa,CAAC;MAACsD,KAAK,EAAElD;IAAK,CAAC;EAAE,CACpD,CACF,CAAC,EAEJd,iEAAA,YACIA,iEAAA,CAAC+D,8DAAW;IACRrB,KAAK,EAAC,aAAa;IACnB5B,KAAK,EAAEmD,WAAY;IACnBtB,QAAQ,EAAE7B,KAAK,IAAIJ,aAAa,CAAC;MAACuD,WAAW,EAAEnD;IAAK,CAAC;EAAE,CAC1D,CACF,CACL,CAAC;AAEX,CAAC;AAED,iEAAerB,KAAK,E;;;;;;;;;;;;;;;;;;;;AC/BpB,6C;;;;;;;;;;ACAA,wC;;;;;;;;;;ACAA,4C;;;;;;;;;;ACAA,sC;;;;;;;;;;ACAA,yC;;;;;;;;;;ACAA,sC;;;;;;;;;;ACAA,iC;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WC5BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA,E;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA,E;;;;;WCPA,wF;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;UENA;UACA;UACA;UACA","sources":["webpack://it-listings/./assets/blocks/jsx/featured-types/index.js","webpack://it-listings/./assets/blocks/jsx/featured-types/section.js","webpack://it-listings/./assets/blocks/jsx/featured-types/title.js","webpack://it-listings/external window [\"wp\",\"blockEditor\"]","webpack://it-listings/external window [\"wp\",\"blocks\"]","webpack://it-listings/external window [\"wp\",\"components\"]","webpack://it-listings/external window [\"wp\",\"data\"]","webpack://it-listings/external window [\"wp\",\"element\"]","webpack://it-listings/external window [\"wp\",\"i18n\"]","webpack://it-listings/external window \"React\"","webpack://it-listings/webpack/bootstrap","webpack://it-listings/webpack/runtime/compat get default export","webpack://it-listings/webpack/runtime/define property getters","webpack://it-listings/webpack/runtime/hasOwnProperty shorthand","webpack://it-listings/webpack/runtime/make namespace object","webpack://it-listings/webpack/before-startup","webpack://it-listings/webpack/startup","webpack://it-listings/webpack/after-startup"],"sourcesContent":["import { registerBlockType } from '@wordpress/blocks';\nimport { useBlockProps } from '@wordpress/block-editor';\nimport { createContext } from 'react';\nimport Section from './section';\nimport Title from './title';\nimport metadata from '../../../../inc/blocks/featured-types/block.json';\n\nconst slug = 'it-listings/featured-types';\nexport const attsContext = createContext();\n\nconst blockData = {\n    icon: {\n        src: <svg xmlns=\"http://www.w3.org/2000/svg\" enable-background=\"new 0 0 24 24\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\"><g><rect fill=\"none\" height=\"24\" width=\"24\"/></g><g><g><path d=\"M19,9.3V4h-3v2.6L12,3L2,12h3v8h6v-6h2v6h6v-8h3L19,9.3z M17,18h-2v-6H9v6H7v-7.81l5-4.5l5,4.5V18z\"/><path d=\"M10,10h4c0-1.1-0.9-2-2-2S10,8.9,10,10z\"/></g></g></svg>\n    },\n    edit: (props) => {\n        const { attributes, setAttributes } = props;\n        const { sections } = attributes;\n\n        return (\n            <section {...useBlockProps({ className: 'itre-editor-featured-types section' })}>\n                <attsContext.Provider value={{ attributes, setAttributes }}>\n                    <Title />\n                    <div className=\"itre-editor-featured-types__sections\">\n                        {sections.map(section => (\n                            <Section order={section.order} />\n                        ))}\n                    </div>\n                </attsContext.Provider>\n            </section>\n        )\n    },\n    save: () => null,\n    ...metadata\n};\nregisterBlockType(slug, blockData);","import { useContext } from 'react';\nimport { MediaUpload, MediaUploadCheck } from '@wordpress/blockEditor';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { SelectControl, ResponsiveWrapper, Button } from '@wordpress/components';\nimport { attsContext } from './index';\nconst ALLOWED_TYPES = ['image'];\n\nconst Section = ({ order }) => {\n    const { attributes, setAttributes } = useContext(attsContext);\n    const { sections } = attributes;\n    const section = sections.filter(item => item['order'] === order)[0];\n\n    const allTerms = useSelect(select => select('core').getEntityRecords('taxonomy', 'property-type', {per_page: -1}));\n\n    const onSelectMedia = (media) => {\n        const newSections = sections.map(item => item['order'] === order ? {...item, mediaId: media.id } : item);\n        return setAttributes({sections: newSections});\n    }\n\n    const image = useSelect(select => (\n        section.mediaId !== 0 ? select('core').getMedia(section.mediaId) : {}\n    ), [section]);\n\n    return (\n        <div className=\"itre-editor-featured-types__section\">\n            <>\n                {allTerms !== null &&\n                    <p>\n                        <SelectControl\n                            label={__(\"Property Type\")}\n                            value={section['type']}\n                            onChange={(value) => {\n                                const newSections = sections.map(item => (\n                                    item['order'] === order ? {...item, type: parseInt(value)} : item\n                                ));\n                                setAttributes({sections: newSections})\n                            }}\n                        >\n                            <option value={0}>{__(\"Select Property Type\")}</option>\n                            {allTerms.map( term => <option value={term.id}>{__(term.name)}</option> )}\n                        </SelectControl>\n                    </p>\n                }\n\n                <p>\n                    <MediaUploadCheck>\n                        <MediaUpload\n                            allowed={ALLOWED_TYPES}\n                            multiple={false}\n                            render={({open})=> {\n                                return (\n                                    <>\n                                    {\n                                        section.mediaId === 0 &&\n                                        <p>\n                                            <span class=\"dashicons dashicons-format-image\"></span><span class=\"placeholder-text\">Image</span>\n                                        </p>\n                                    }\n\n                                    {   \n                                    image !== undefined &&    \n                                        Object.keys(image).length !== 0 &&\n                                        <ResponsiveWrapper\n                                            naturalWidth={ image.media_details.width }\n                                            naturalHeight={ image.media_details.height }\n                                        >\n                                            <img src={ image.source_url } />\n                                        </ResponsiveWrapper>\n                                    }\n\n                                    <p>\n                                        <Button\n                                            className={image === undefined || Object.keys(image).length === 0 ? 'is-primary' : 'is-secondary'}\n                                            onClick={open}\n                                        >\n                                            {section.mediaId === 0 ? __('Choose an Image', 'it-listings') : __('Replace Image', 'it-listings')}\n                                        </Button>\n                                    </p>\n                                    </>\n                                )\n                            }}\n                            value={section['mediaId']}\n                            onSelect={ onSelectMedia }\n                        >\n                        </MediaUpload>\n                    </MediaUploadCheck>\n                </p>\n            </>\n        </div>\n    )\n}\n\nexport default Section;","import { useContext } from 'react';\nimport { TextControl } from '@wordpress/components';\nimport { attsContext } from './index';\nimport {__} from '@wordpress/i18n';\n\nconst Title = () => {\n    const { attributes, setAttributes } = useContext(attsContext);\n    const { title, description } = attributes;\n\n    return (\n        <>\n            <h2>{__(\"Featured Property Types\")}</h2>\n            <p>\n                <TextControl\n                label=\"Title\"\n                    value={title}\n                    onChange={value => setAttributes({title: value})}\n                />\n            </p>\n\n            <p>\n                <TextControl\n                    label=\"Description\"\n                    value={description}\n                    onChange={value => setAttributes({description: value})}\n                />\n            </p>\n        </>\n    )\n};\n\nexport default Title;","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"React\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Check if module exists (development only)\n\tif (__webpack_modules__[moduleId] === undefined) {\n\t\tvar e = new Error(\"Cannot find module '\" + moduleId + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./assets/blocks/jsx/featured-types/index.js\");\n",""],"names":["registerBlockType","useBlockProps","createContext","Section","Title","metadata","slug","attsContext","blockData","icon","src","createElement","xmlns","height","viewBox","width","fill","d","edit","props","attributes","setAttributes","sections","className","Provider","value","map","section","order","save","useContext","MediaUpload","MediaUploadCheck","useSelect","__","SelectControl","ResponsiveWrapper","Button","ALLOWED_TYPES","filter","item","allTerms","select","getEntityRecords","per_page","onSelectMedia","media","newSections","mediaId","id","image","getMedia","Fragment","label","onChange","type","parseInt","term","name","allowed","multiple","render","open","class","undefined","Object","keys","length","naturalWidth","media_details","naturalHeight","source_url","onClick","onSelect","TextControl","title","description"],"ignoreList":[],"sourceRoot":""}
  • it-listings/trunk/assets/blocks/js/testimonials/index.asset.php

    r3200014 r3436888  
    1 <?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => 'e7d84a10275f2a1bd24c');
     1<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'a675007d9b78512dfdce');
  • it-listings/trunk/assets/blocks/js/testimonials/index.js

    r3200014 r3436888  
    33/******/    var __webpack_modules__ = ({
    44
    5 /***/ "./assets/blocks/jsx/testimonials/index.js":
     5/***/ "./assets/blocks/jsx/testimonials/index.js"
    66/*!*************************************************!*\
    77  !*** ./assets/blocks/jsx/testimonials/index.js ***!
    88  \*************************************************/
    9 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
     9(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
    1010
    1111__webpack_require__.r(__webpack_exports__);
     
    1313/* harmony export */   attsContext: () => (/* binding */ attsContext)
    1414/* harmony export */ });
    15 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
    16 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
    17 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
    18 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
    19 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
    20 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);
    21 /* harmony import */ var _title__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./title */ "./assets/blocks/jsx/testimonials/title.js");
    22 /* harmony import */ var _testimonials__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./testimonials */ "./assets/blocks/jsx/testimonials/testimonials.js");
    23 /* harmony import */ var _inc_blocks_testimonials_block_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../inc/blocks/testimonials/block.json */ "./inc/blocks/testimonials/block.json");
    24 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
    25 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
    26 
    27 
    28 
    29 
    30 
    31 
    32 
    33 const attsContext = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)();
     15/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
     16/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
     17/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
     18/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
     19/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
     20/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
     21/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
     22/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__);
     23/* harmony import */ var _title__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./title */ "./assets/blocks/jsx/testimonials/title.js");
     24/* harmony import */ var _testimonials__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./testimonials */ "./assets/blocks/jsx/testimonials/testimonials.js");
     25/* harmony import */ var _inc_blocks_testimonials_block_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../inc/blocks/testimonials/block.json */ "./inc/blocks/testimonials/block.json");
     26
     27
     28
     29
     30
     31
     32
     33const attsContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)();
    3434const slug = 'it-listings/testimonials';
    3535const blockData = {
    3636  icon: {
    37     src: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("svg", {
     37    src: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
    3838      xmlns: "http://www.w3.org/2000/svg",
    3939      "enable-background": "new 0 0 24 24",
     
    4141      viewBox: "0 0 24 24",
    4242      width: "24px",
    43       fill: "#000000",
    44       children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("g", {
    45         children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("path", {
    46           d: "M0,0h24v24H0V0z",
    47           fill: "none"
    48         })
    49       }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("g", {
    50         children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("g", {
    51           children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("path", {
    52             d: "M20,2H4C2.9,2,2,2.9,2,4v18l4-4h14c1.1,0,2-0.9,2-2V4C22,2.9,21.1,2,20,2z M20,16H5.17L4,17.17V4h16V16z"
    53           }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("polygon", {
    54             points: "12,15 13.57,11.57 17,10 13.57,8.43 12,5 10.43,8.43 7,10 10.43,11.57"
    55           })]
    56         })
    57       })]
    58     })
     43      fill: "#000000"
     44    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
     45      d: "M0,0h24v24H0V0z",
     46      fill: "none"
     47    })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
     48      d: "M20,2H4C2.9,2,2,2.9,2,4v18l4-4h14c1.1,0,2-0.9,2-2V4C22,2.9,21.1,2,20,2z M20,16H5.17L4,17.17V4h16V16z"
     49    }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("polygon", {
     50      points: "12,15 13.57,11.57 17,10 13.57,8.43 12,5 10.43,8.43 7,10 10.43,11.57"
     51    }))))
    5952  },
    6053  edit: ({
     
    6255    setAttributes
    6356  }) => {
    64     return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(attsContext.Provider, {
     57    return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(attsContext.Provider, {
    6558      value: {
    6659        attributes,
    6760        setAttributes
    68       },
    69       children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("section", {
    70         ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)({
    71           className: 'itre-editor-testimonials'
    72         }),
    73         children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_title__WEBPACK_IMPORTED_MODULE_3__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_testimonials__WEBPACK_IMPORTED_MODULE_4__["default"], {})]
    74       })
    75     });
     61      }
     62    }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps)({
     63      className: 'itre-editor-testimonials'
     64    }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_title__WEBPACK_IMPORTED_MODULE_4__["default"], null), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_testimonials__WEBPACK_IMPORTED_MODULE_5__["default"], null)));
    7665  },
    7766  save: () => null,
    78   ..._inc_blocks_testimonials_block_json__WEBPACK_IMPORTED_MODULE_5__
     67  ..._inc_blocks_testimonials_block_json__WEBPACK_IMPORTED_MODULE_6__
    7968};
    80 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(slug, blockData);
    81 
    82 /***/ }),
    83 
    84 /***/ "./assets/blocks/jsx/testimonials/testimonials.js":
     69(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)(slug, blockData);
     70
     71/***/ },
     72
     73/***/ "./assets/blocks/jsx/testimonials/testimonials.js"
    8574/*!********************************************************!*\
    8675  !*** ./assets/blocks/jsx/testimonials/testimonials.js ***!
    8776  \********************************************************/
    88 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
     77(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
    8978
    9079__webpack_require__.r(__webpack_exports__);
     
    9281/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
    9382/* harmony export */ });
    94 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
    95 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
    96 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
    97 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
    98 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
    99 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
    100 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
    101 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
    102 /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! . */ "./assets/blocks/jsx/testimonials/index.js");
    103 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
    104 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
     83/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
     84/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
     85/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
     86/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
     87/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
     88/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
     89/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
     90/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);
     91/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
     92/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
     93/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! . */ "./assets/blocks/jsx/testimonials/index.js");
    10594
    10695
     
    113102    attributes,
    114103    setAttributes
    115   } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(___WEBPACK_IMPORTED_MODULE_4__.attsContext);
     104  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(___WEBPACK_IMPORTED_MODULE_5__.attsContext);
    116105  let allTestimonials = [];
    117   allTestimonials = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select('core').getEntityRecords('postType', 'testimonial', {
     106  allTestimonials = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select('core').getEntityRecords('postType', 'testimonial', {
    118107    per_page: -1
    119108  }), []);
     
    121110    testimonials
    122111  } = attributes;
    123   return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("p", {
    124     children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SelectControl, {
    125       label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Select Testimonials"),
    126       multiple: true,
    127       autoFocus: true,
    128       value: testimonials,
    129       onChange: value => {
    130         setAttributes({
    131           testimonials: [...value]
    132         });
    133       },
    134       children: allTestimonials !== null && allTestimonials.map(item => {
    135         return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("option", {
    136           value: item.id,
    137           children: item.title.rendered
    138         });
    139       })
    140     })
    141   });
     112  return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.SelectControl, {
     113    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("Select Testimonials"),
     114    multiple: true,
     115    autoFocus: true,
     116    value: testimonials,
     117    onChange: value => {
     118      setAttributes({
     119        testimonials: [...value]
     120      });
     121    }
     122  }, allTestimonials !== null && allTestimonials.map(item => {
     123    return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("option", {
     124      value: item.id
     125    }, item.title.rendered);
     126  })));
    142127};
    143128/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Testimonials);
    144129
    145 /***/ }),
    146 
    147 /***/ "./assets/blocks/jsx/testimonials/title.js":
     130/***/ },
     131
     132/***/ "./assets/blocks/jsx/testimonials/title.js"
    148133/*!*************************************************!*\
    149134  !*** ./assets/blocks/jsx/testimonials/title.js ***!
    150135  \*************************************************/
    151 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
     136(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
    152137
    153138__webpack_require__.r(__webpack_exports__);
     
    155140/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
    156141/* harmony export */ });
    157 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
    158 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
    159 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
    160 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
    161 /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index */ "./assets/blocks/jsx/testimonials/index.js");
    162 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
    163 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
    164 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
    165 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
     142/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
     143/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
     144/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
     145/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
     146/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
     147/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
     148/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./index */ "./assets/blocks/jsx/testimonials/index.js");
     149/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
     150/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
    166151
    167152
     
    173158    attributes,
    174159    setAttributes
    175   } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_index__WEBPACK_IMPORTED_MODULE_2__.attsContext);
     160  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_index__WEBPACK_IMPORTED_MODULE_3__.attsContext);
    176161  const {
    177162    title
    178163  } = attributes;
    179   return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
    180     children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("h2", {
    181       children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Testimonials")
    182     }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
    183       children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, {
    184         label: "Title",
    185         value: title,
    186         onChange: value => setAttributes({
    187           title: value
    188         })
    189       })
    190     })]
    191   });
     164  return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("h2", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("Testimonials")), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.TextControl, {
     165    label: "Title",
     166    value: title,
     167    onChange: value => setAttributes({
     168      title: value
     169    })
     170  })));
    192171};
    193172/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Title);
    194173
    195 /***/ }),
    196 
    197 /***/ "react":
     174/***/ },
     175
     176/***/ "./inc/blocks/testimonials/block.json"
     177/*!********************************************!*\
     178  !*** ./inc/blocks/testimonials/block.json ***!
     179  \********************************************/
     180(module) {
     181
     182module.exports = /*#__PURE__*/JSON.parse('{"apiVersion":3,"name":"it-listings/testimonials","title":"Testimonials","description":"Featured area to showcase testimonials from clients","category":"it-listings","keywords":["testimonials","reviews","users","ratings","property"],"attributes":{"title":{"type":"string","default":""},"align":{"type":"string","default":"center"},"testimonials":{"type":"array","default":[]}},"style":["itre-swiper-css","itre-testimonials-css"],"editorScript":"itre-testimonials-js","viewScript":["itre-swiper-js","itre-front.testimonials-js"],"render":"./testimonials.php"}');
     183
     184/***/ },
     185
     186/***/ "@wordpress/block-editor"
     187/*!*************************************!*\
     188  !*** external ["wp","blockEditor"] ***!
     189  \*************************************/
     190(module) {
     191
     192module.exports = window["wp"]["blockEditor"];
     193
     194/***/ },
     195
     196/***/ "@wordpress/blocks"
     197/*!********************************!*\
     198  !*** external ["wp","blocks"] ***!
     199  \********************************/
     200(module) {
     201
     202module.exports = window["wp"]["blocks"];
     203
     204/***/ },
     205
     206/***/ "@wordpress/components"
     207/*!************************************!*\
     208  !*** external ["wp","components"] ***!
     209  \************************************/
     210(module) {
     211
     212module.exports = window["wp"]["components"];
     213
     214/***/ },
     215
     216/***/ "@wordpress/data"
     217/*!******************************!*\
     218  !*** external ["wp","data"] ***!
     219  \******************************/
     220(module) {
     221
     222module.exports = window["wp"]["data"];
     223
     224/***/ },
     225
     226/***/ "@wordpress/element"
     227/*!*********************************!*\
     228  !*** external ["wp","element"] ***!
     229  \*********************************/
     230(module) {
     231
     232module.exports = window["wp"]["element"];
     233
     234/***/ },
     235
     236/***/ "@wordpress/i18n"
     237/*!******************************!*\
     238  !*** external ["wp","i18n"] ***!
     239  \******************************/
     240(module) {
     241
     242module.exports = window["wp"]["i18n"];
     243
     244/***/ },
     245
     246/***/ "react"
    198247/*!************************!*\
    199248  !*** external "React" ***!
    200249  \************************/
    201 /***/ ((module) => {
     250(module) {
    202251
    203252module.exports = window["React"];
    204253
    205 /***/ }),
    206 
    207 /***/ "react/jsx-runtime":
    208 /*!**********************************!*\
    209   !*** external "ReactJSXRuntime" ***!
    210   \**********************************/
    211 /***/ ((module) => {
    212 
    213 module.exports = window["ReactJSXRuntime"];
    214 
    215 /***/ }),
    216 
    217 /***/ "@wordpress/block-editor":
    218 /*!*************************************!*\
    219   !*** external ["wp","blockEditor"] ***!
    220   \*************************************/
    221 /***/ ((module) => {
    222 
    223 module.exports = window["wp"]["blockEditor"];
    224 
    225 /***/ }),
    226 
    227 /***/ "@wordpress/blocks":
    228 /*!********************************!*\
    229   !*** external ["wp","blocks"] ***!
    230   \********************************/
    231 /***/ ((module) => {
    232 
    233 module.exports = window["wp"]["blocks"];
    234 
    235 /***/ }),
    236 
    237 /***/ "@wordpress/components":
    238 /*!************************************!*\
    239   !*** external ["wp","components"] ***!
    240   \************************************/
    241 /***/ ((module) => {
    242 
    243 module.exports = window["wp"]["components"];
    244 
    245 /***/ }),
    246 
    247 /***/ "@wordpress/data":
    248 /*!******************************!*\
    249   !*** external ["wp","data"] ***!
    250   \******************************/
    251 /***/ ((module) => {
    252 
    253 module.exports = window["wp"]["data"];
    254 
    255 /***/ }),
    256 
    257 /***/ "@wordpress/i18n":
    258 /*!******************************!*\
    259   !*** external ["wp","i18n"] ***!
    260   \******************************/
    261 /***/ ((module) => {
    262 
    263 module.exports = window["wp"]["i18n"];
    264 
    265 /***/ }),
    266 
    267 /***/ "./inc/blocks/testimonials/block.json":
    268 /*!********************************************!*\
    269   !*** ./inc/blocks/testimonials/block.json ***!
    270   \********************************************/
    271 /***/ ((module) => {
    272 
    273 module.exports = /*#__PURE__*/JSON.parse('{"apiVersion":3,"name":"it-listings/testimonials","title":"Testimonials","description":"Featured area to showcase testimonials from clients","category":"it-listings","keywords":["testimonials","reviews","users","ratings","property"],"attributes":{"title":{"type":"string","default":""},"align":{"type":"string","default":"center"},"testimonials":{"type":"array","default":[]}},"supports":{"align":["full","wide"],"alignWide":true},"editorStyle":"itre-editor-testimonials-css","style":["itre-swiper-css","itre-testimonials-css"],"editorScript":"itre-testimonials-js","viewScript":["itre-swiper-js","itre-front.testimonials-js"],"render":"./testimonials.php"}');
    274 
    275 /***/ })
     254/***/ }
    276255
    277256/******/    });
     
    286265/******/        if (cachedModule !== undefined) {
    287266/******/            return cachedModule.exports;
     267/******/        }
     268/******/        // Check if module exists (development only)
     269/******/        if (__webpack_modules__[moduleId] === undefined) {
     270/******/            var e = new Error("Cannot find module '" + moduleId + "'");
     271/******/            e.code = 'MODULE_NOT_FOUND';
     272/******/            throw e;
    288273/******/        }
    289274/******/        // Create a new module (and put it into the cache)
  • it-listings/trunk/assets/blocks/js/testimonials/index.js.map

    r3200014 r3436888  
    1 {"version":3,"file":"./testimonials/index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAsD;AAChB;AACkB;AAC5B;AACc;AAC4B;AAAA;AAE/D,MAAMU,WAAW,GAAGT,oDAAa,CAAC,CAAC;AAC1C,MAAMU,IAAI,GAA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C,eAC7B1B,sDAAA;MAAAa,QAAA,eACIb,sDAAA,CAACyC,8DAAW;QACZT,KAAK,EAAC,OAAO;QACTZ,KAAK,EAAEmB,KAAM;QACbJ,QAAQ,EAAEf,KAAK,IAAIF,aAAa,CAAC;UAACqB,KAAK,EAAEnB;QAAK,CAAC;MAAE,CACpD;IAAC,CACH,CAAC;EAAA,CACN,CAAC;AAEX,CAAC;AAED,iEAAexB,KAAK;;;;;;;;;;ACvBpB;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;UENA;UACA;UACA;UACA","sources":["webpack://it-listings/./assets/blocks/jsx/testimonials/index.js","webpack://it-listings/./assets/blocks/jsx/testimonials/testimonials.js","webpack://it-listings/./assets/blocks/jsx/testimonials/title.js","webpack://it-listings/external window \"React\"","webpack://it-listings/external window \"ReactJSXRuntime\"","webpack://it-listings/external window [\"wp\",\"blockEditor\"]","webpack://it-listings/external window [\"wp\",\"blocks\"]","webpack://it-listings/external window [\"wp\",\"components\"]","webpack://it-listings/external window [\"wp\",\"data\"]","webpack://it-listings/external window [\"wp\",\"i18n\"]","webpack://it-listings/webpack/bootstrap","webpack://it-listings/webpack/runtime/compat get default export","webpack://it-listings/webpack/runtime/define property getters","webpack://it-listings/webpack/runtime/hasOwnProperty shorthand","webpack://it-listings/webpack/runtime/make namespace object","webpack://it-listings/webpack/before-startup","webpack://it-listings/webpack/startup","webpack://it-listings/webpack/after-startup"],"sourcesContent":["import { registerBlockType } from '@wordpress/blocks';\nimport { createContext } from 'react';\nimport { useBlockProps } from '@wordpress/block-editor';\nimport Title from './title';\nimport Testimonials from './testimonials';\nimport metadata from '../../../../inc/blocks/testimonials/block.json';\n\nexport const attsContext = createContext();\nconst slug = 'it-listings/testimonials';\n\nconst blockData = {\n    icon: {\n        src: <svg xmlns=\"http://www.w3.org/2000/svg\" enable-background=\"new 0 0 24 24\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\"><g><path d=\"M0,0h24v24H0V0z\" fill=\"none\"/></g><g><g><path d=\"M20,2H4C2.9,2,2,2.9,2,4v18l4-4h14c1.1,0,2-0.9,2-2V4C22,2.9,21.1,2,20,2z M20,16H5.17L4,17.17V4h16V16z\"/><polygon points=\"12,15 13.57,11.57 17,10 13.57,8.43 12,5 10.43,8.43 7,10 10.43,11.57\"/></g></g></svg>\n    },\n    edit: ({ attributes, setAttributes }) => {\n        return(\n            <attsContext.Provider value={{ attributes, setAttributes }}>\n                <section {...useBlockProps({className: 'itre-editor-testimonials'})}>\n                    <Title/>\n                    <Testimonials/>\n                </section>\n            </attsContext.Provider>\n        )\n    },\n    save: () => null,\n    ...metadata\n};\nregisterBlockType(slug, blockData);","import { useContext } from 'react';\nimport { useSelect } from '@wordpress/data';\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { attsContext } from \".\";\n\nconst Testimonials = () => {\n    const { attributes, setAttributes } = useContext(attsContext);\n    let allTestimonials = [];\n\n    allTestimonials = useSelect(select => select('core').getEntityRecords('postType', 'testimonial', {per_page: -1}), []);\n\n    const { testimonials } = attributes;\n    return(\n        <p>\n            <SelectControl\n                label={__(\"Select Testimonials\")}\n                multiple={true}\n                autoFocus={true}\n                value={testimonials}\n                onChange={value => {\n                    setAttributes({testimonials: [...value]})\n                }}\n                >   \n                {\n                    allTestimonials !== null &&\n                    allTestimonials.map(item => {\n                        return <option value={item.id}>{item.title.rendered}</option>\n                    })\n                }\n\n             </SelectControl>\n        </p>\n    )\n}\n \nexport default Testimonials;","import { useContext } from 'react';\nimport { TextControl } from '@wordpress/components';\nimport { attsContext } from './index';\nimport { __ } from '@wordpress/i18n';\n\nconst Title = () => {\n    const { attributes, setAttributes } = useContext(attsContext);\n    const { title } = attributes;\n\n    return (\n        <>\n            <h2>{__(\"Testimonials\")}</h2>\n            <p>\n                <TextControl\n                label=\"Title\"\n                    value={title}\n                    onChange={value => setAttributes({title: value})}\n                />\n            </p>\n        </>\n    )\n};\n\nexport default Title;","module.exports = window[\"React\"];","module.exports = window[\"ReactJSXRuntime\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./assets/blocks/jsx/testimonials/index.js\");\n",""],"names":["registerBlockType","createContext","useBlockProps","Title","Testimonials","metadata","jsx","_jsx","jsxs","_jsxs","attsContext","slug","blockData","icon","src","xmlns","height","viewBox","width","fill","children","d","points","edit","attributes","setAttributes","Provider","value","className","save","useContext","useSelect","SelectControl","__","allTestimonials","select","getEntityRecords","per_page","testimonials","label","multiple","autoFocus","onChange","map","item","id","title","rendered","TextControl","Fragment","_Fragment"],"sourceRoot":""}
     1{"version":3,"file":"./testimonials/index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAsD;AAChB;AACkB;AAC5B;AACc;AAC4B;AAE/D,MAAMM,WAAW,GAAGL,oDAAa,CAAC,CAAC;AAC1C,MAAMM,IAAI,GAAG,0BAA0B;AAEvC,MAAMC,SAAS,GAAG;EACdC,IAAI,EAAE;IACFC,GAAG,EAAEC,iEAAA;MAAKC,KAAK,EAAC,4BAA4B;MAAC,qBAAkB,eAAe;MAACC,MAAM,EAAC,MAAM;MAACC,OAAO,EAAC,WAAW;MAACC,KAAK,EAAC,MAAM;MAACC,IAAI,EAAC;IAAS,GAACL,iEAAA,YAAGA,iEAAA;MAAMM,CAAC,EAAC,iBAAiB;MAACD,IAAI,EAAC;IAAM,CAAC,CAAI,CAAC,EAAAL,iEAAA,YAAGA,iEAAA,YAAGA,iEAAA;MAAMM,CAAC,EAAC;IAAsG,CAAC,CAAC,EAAAN,iEAAA;MAASO,MAAM,EAAC;IAAqE,CAAC,CAAI,CAA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,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;UENA;UACA;UACA;UACA","sources":["webpack://it-listings/./assets/blocks/jsx/testimonials/index.js","webpack://it-listings/./assets/blocks/jsx/testimonials/testimonials.js","webpack://it-listings/./assets/blocks/jsx/testimonials/title.js","webpack://it-listings/external window [\"wp\",\"blockEditor\"]","webpack://it-listings/external window [\"wp\",\"blocks\"]","webpack://it-listings/external window [\"wp\",\"components\"]","webpack://it-listings/external window [\"wp\",\"data\"]","webpack://it-listings/external window [\"wp\",\"element\"]","webpack://it-listings/external window [\"wp\",\"i18n\"]","webpack://it-listings/external window \"React\"","webpack://it-listings/webpack/bootstrap","webpack://it-listings/webpack/runtime/compat get default export","webpack://it-listings/webpack/runtime/define property getters","webpack://it-listings/webpack/runtime/hasOwnProperty shorthand","webpack://it-listings/webpack/runtime/make namespace object","webpack://it-listings/webpack/before-startup","webpack://it-listings/webpack/startup","webpack://it-listings/webpack/after-startup"],"sourcesContent":["import { registerBlockType } from '@wordpress/blocks';\nimport { createContext } from 'react';\nimport { useBlockProps } from '@wordpress/block-editor';\nimport Title from './title';\nimport Testimonials from './testimonials';\nimport metadata from '../../../../inc/blocks/testimonials/block.json';\n\nexport const attsContext = createContext();\nconst slug = 'it-listings/testimonials';\n\nconst blockData = {\n    icon: {\n        src: <svg xmlns=\"http://www.w3.org/2000/svg\" enable-background=\"new 0 0 24 24\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\"><g><path d=\"M0,0h24v24H0V0z\" fill=\"none\"/></g><g><g><path d=\"M20,2H4C2.9,2,2,2.9,2,4v18l4-4h14c1.1,0,2-0.9,2-2V4C22,2.9,21.1,2,20,2z M20,16H5.17L4,17.17V4h16V16z\"/><polygon points=\"12,15 13.57,11.57 17,10 13.57,8.43 12,5 10.43,8.43 7,10 10.43,11.57\"/></g></g></svg>\n    },\n    edit: ({ attributes, setAttributes }) => {\n        return(\n            <attsContext.Provider value={{ attributes, setAttributes }}>\n                <section {...useBlockProps({className: 'itre-editor-testimonials'})}>\n                    <Title/>\n                    <Testimonials/>\n                </section>\n            </attsContext.Provider>\n        )\n    },\n    save: () => null,\n    ...metadata\n};\nregisterBlockType(slug, blockData);","import { useContext } from 'react';\nimport { useSelect } from '@wordpress/data';\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { attsContext } from \".\";\n\nconst Testimonials = () => {\n    const { attributes, setAttributes } = useContext(attsContext);\n    let allTestimonials = [];\n\n    allTestimonials = useSelect(select => select('core').getEntityRecords('postType', 'testimonial', {per_page: -1}), []);\n\n    const { testimonials } = attributes;\n    return(\n        <p>\n            <SelectControl\n                label={__(\"Select Testimonials\")}\n                multiple={true}\n                autoFocus={true}\n                value={testimonials}\n                onChange={value => {\n                    setAttributes({testimonials: [...value]})\n                }}\n                >   \n                {\n                    allTestimonials !== null &&\n                    allTestimonials.map(item => {\n                        return <option value={item.id}>{item.title.rendered}</option>\n                    })\n                }\n\n             </SelectControl>\n        </p>\n    )\n}\n \nexport default Testimonials;","import { useContext } from 'react';\nimport { TextControl } from '@wordpress/components';\nimport { attsContext } from './index';\nimport { __ } from '@wordpress/i18n';\n\nconst Title = () => {\n    const { attributes, setAttributes } = useContext(attsContext);\n    const { title } = attributes;\n\n    return (\n        <>\n            <h2>{__(\"Testimonials\")}</h2>\n            <p>\n                <TextControl\n                label=\"Title\"\n                    value={title}\n                    onChange={value => setAttributes({title: value})}\n                />\n            </p>\n        </>\n    )\n};\n\nexport default Title;","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"React\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Check if module exists (development only)\n\tif (__webpack_modules__[moduleId] === undefined) {\n\t\tvar e = new Error(\"Cannot find module '\" + moduleId + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./assets/blocks/jsx/testimonials/index.js\");\n",""],"names":["registerBlockType","createContext","useBlockProps","Title","Testimonials","metadata","attsContext","slug","blockData","icon","src","createElement","xmlns","height","viewBox","width","fill","d","points","edit","attributes","setAttributes","Provider","value","className","save","useContext","useSelect","SelectControl","__","allTestimonials","select","getEntityRecords","per_page","testimonials","label","multiple","autoFocus","onChange","map","item","id","title","rendered","TextControl","Fragment"],"ignoreList":[],"sourceRoot":""}
  • it-listings/trunk/assets/css/global.css

    r3029056 r3436888  
    3131}
    3232
    33 section:not(.alignfull) {
     33section:not(.alignfull) body:not(.single-property) {
    3434  padding-right: 1.25rem;
    3535  padding-left: 1.25rem;
  • it-listings/trunk/assets/js/demo-importer.js

    r3072881 r3436888  
    3232        } catch (error) {
    3333            this.innerHTML = 'Error!'
    34             console.log(error);
    3534        }
    3635    }
  • it-listings/trunk/assets/js/demo-updates.js

    r3049898 r3436888  
    127127     */
    128128    wp.updates.importDemoError = function( response ) {
    129         console.log( response )
    130129        var $card, $button,
    131130            errorMessage = sprintf(
     
    326325     */
    327326    wp.updates.isValidResponse = function( response, action ) {
    328         console.log( response )
    329327        var error = __( 'Something went wrong.', 'indi-demo-importer' ),
    330328            errorMessage;
  • it-listings/trunk/assets/scss/global.scss

    r3029056 r3436888  
    3838
    3939    &:not(.alignfull) {
    40         padding-right: 1.25rem;
    41         padding-left: 1.25rem;
     40
     41        body:not(.single-property) {
     42            padding-right: 1.25rem;
     43            padding-left: 1.25rem;
     44        }
    4245    }
    4346}
  • it-listings/trunk/inc/blocks/featured-locations/block.json

    r3049732 r3436888  
    4949      }
    5050    },
    51     "supports": {
    52       "align": ["full", "wide"],
    53       "alignWide": true
    54     },
    5551    "editorStyle": "itre-editor-featured-locations-css",
    5652    "style": "itre-featured-locations-css",
  • it-listings/trunk/inc/blocks/featured-types/block.json

    r3049732 r3436888  
    33    "name": "it-listings/featured-types",
    44    "title": "Featured Property Types",
    5     "description": "Featured Area to showcase properties based on type - Apartment, Studio,z Villa etc.",
     5    "description": "Featured Area to showcase properties based on type - Apartment, Studio, Villa etc.",
    66    "category": "it-listings",
    77    "keywords": [
     
    5555      }
    5656    },
    57     "supports": {
    58       "align": ["full", "wide"],
    59       "alignWide": true
    60     },
    6157    "editorStyle": "itre-editor-featured-types-css",
    6258    "style": "itre-featured-types-css",
  • it-listings/trunk/inc/blocks/testimonials/block.json

    r3049898 r3436888  
    2626        }
    2727    },
    28     "supports": {
    29       "align": ["full", "wide"],
    30       "alignWide": true
    31     },
    32     "editorStyle": "itre-editor-testimonials-css",
    3328    "style": ["itre-swiper-css", "itre-testimonials-css"],
    3429    "editorScript": "itre-testimonials-js",
  • it-listings/trunk/inc/class-demo-importer.php

    r3049898 r3436888  
    265265        $template = strtolower( str_replace( ['-pro', '-plus'], '', get_option( 'template' ) ) );
    266266        $packages = isset( $this->demo_packages->demos ) ? json_decode( wp_json_encode( $this->demo_packages->demos ), true ) : array();
    267         var_dump("https://storage.googleapis.com/indithemes/packages/{$template}/{$slug}.zip");
    268267        $result   = $upgrader->install( "https://storage.googleapis.com/indithemes/packages/{$template}/{$slug}.zip" );
    269268
  • it-listings/trunk/inc/listings-cpt.php

    r2715962 r3436888  
    4040        'label'                 => __( 'Property', 'itlst' ),
    4141        'labels'                => $labels,
    42         'supports'              => array( 'title', 'editor', 'thumbnail' ),
     42        'supports'              => array( 'title', 'editor', 'thumbnail', 'custom-fields' ),
    4343        'taxonomies'            => array( 'property-type' ),
    4444        'hierarchical'          => false,
     
    148148add_action( 'init', 'itlst_property_tax_location', 0 );
    149149}
     150
     151
     152function itlst_register_post_meta() {
     153    $fields = ['streetName', 'city', 'province', 'country', 'zip', 'lat', 'long'];
     154    foreach($fields as $field) {
     155        register_post_meta('property', $field, array(
     156            'show_in_rest' => true
     157        ));
     158    }
     159}
     160add_action('init', 'itlst_register_post_meta');
  • it-listings/trunk/inc/notice.php

    r2812450 r3436888  
    66if (!function_exists('itlst_admin_notice')) {
    77    function itlst_admin_notice() { ?>
    8         <div class="notice notice-error is-dismissable">
     8        <div class="notice notice-error is-dismissible">
    99            <p><?php _e('The activated theme does not support <b>IT Listings</b> plugin. If you want to use <b>IT Listings</b> plugin, consider switching to <a href="https://www.wordpress.org/themes/it-residence">IT Residence</a> WordPress Theme.</p>', 'it-listings'); ?></p>
    1010        </div>
  • it-listings/trunk/it-listings.php

    r3200021 r3436888  
    33 *
    44 *  Plugin Name: IT Listings
    5  *  Plugin URI:
     5 *  Plugin URI: https://wordpress.org/plugins/it-listings/
    66 *  Description: Listings Plugin for IT Residence WordPress Theme
    7  *  Version: 1.5.1
     7 *  Version: 1.5.2
    88 *  Requires at least: 6.0
    99 *  Requres PHP: 8.0
     
    3434 class IT_Listings {
    3535
     36    static $instance;
     37
    3638    public function __construct() {
    3739        $theme = wp_get_theme();
    3840        $isChild = $theme->parent();
    39        
    4041        if ( "IT Residence" == $theme->get('Name') || "IT Residence Pro" == $theme->get('Name') || ( !empty($isChild) && ( "IT Residence" == $theme->parent()->get('Name') || "IT Residence Pro" == $theme->parent()->get('Name') ) ) ) {
    4142            // Updating the body_class filter
     
    5859    }
    5960
     61    public static function get_instance() {
     62        if ( !isset( self::$instance ) ) {
     63            self::$instance = new IT_Listings();
     64        }
     65        return self::$instance;
     66    }
     67
    6068    public function itlst_register_blocks() {
    6169        $block_paths = glob(ITL_PATH . 'assets/blocks/js/**/index.js', GLOB_BRACE);
    62        
    6370        // Regsitering JS files for blocks
    6471        foreach($block_paths as $block) {
     
    6673            preg_match( '/([a-z0-9_+-]*)\/index.js/i', $block, $match);
    6774            $id = $match[1];
    68             wp_register_script("itre-{$id}-js", $block, array(), ITL_VERSION, true);
     75            wp_register_script("itre-{$id}-js", esc_url($block), array(), ITL_VERSION);
    6976        }
    7077   
     
    203210}
    204211
    205 $itlisting = new IT_Listings();
     212$itlisting = IT_Listings::get_instance();
  • it-listings/trunk/readme.txt

    r3200021 r3436888  
    22Contributors: indithemes
    33Tags: gutenberg, blocks, custom-post-types, it-residence, metabox
    4 Tested up to: 6.4
    5 Stable Tag: 1.5.1
     4Tested up to: 6.9
     5Stable Tag: 1.5.2
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6969= 1.5.1 =
    7070* Fixed global variable error
     71
     72= 1.5.2 =
     73* Removed Wide and full width for blocks
Note: See TracChangeset for help on using the changeset viewer.