![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mets.corals.io/wp-content/plugins/advanced-gutenberg/assets/blocks/ |
/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ({ /***/ "./node_modules/html-dom-parser/lib/constants.js": /*!*******************************************************!*\ !*** ./node_modules/html-dom-parser/lib/constants.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { /** * SVG elements are case-sensitive. * * @see {@link https://developer.mozilla.org/docs/Web/SVG/Element#SVG_elements_A_to_Z} */ var CASE_SENSITIVE_TAG_NAMES = [ 'animateMotion', 'animateTransform', 'clipPath', 'feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussainBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence', 'foreignObject', 'linearGradient', 'radialGradient', 'textPath' ]; module.exports = { CASE_SENSITIVE_TAG_NAMES: CASE_SENSITIVE_TAG_NAMES }; /***/ }), /***/ "./node_modules/html-dom-parser/lib/domparser.js": /*!*******************************************************!*\ !*** ./node_modules/html-dom-parser/lib/domparser.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var utilities = __webpack_require__(/*! ./utilities */ "./node_modules/html-dom-parser/lib/utilities.js"); // constants var HTML = 'html'; var HEAD = 'head'; var BODY = 'body'; var FIRST_TAG_REGEX = /<([a-zA-Z]+[0-9]?)/; // e.g., <h1> var HEAD_TAG_REGEX = /<head.*>/i; var BODY_TAG_REGEX = /<body.*>/i; // http://www.w3.org/TR/html/syntax.html#void-elements var VOID_ELEMENTS_REGEX = /<(area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)(.*?)\/?>/gi; // detect IE browser var isIE9 = utilities.isIE(9); var isIE = isIE9 || utilities.isIE(); /** * DOMParser (performance: slow). * * @see https://developer.mozilla.org/docs/Web/API/DOMParser#Parsing_an_SVG_or_HTML_document */ var parseFromString; if (typeof window.DOMParser === 'function') { var domParser = new window.DOMParser(); // IE9 does not support 'text/html' MIME type // https://msdn.microsoft.com/en-us/library/ff975278(v=vs.85).aspx var mimeType = isIE9 ? 'text/xml' : 'text/html'; /** * Creates an HTML document using `DOMParser.parseFromString`. * * @param {string} html - The HTML string. * @param {string} [tagName] - The element to render the HTML (with 'body' as fallback). * @return {HTMLDocument} */ parseFromString = function domStringParser(html, tagName) { if (tagName) { html = '<' + tagName + '>' + html + '</' + tagName + '>'; } // because IE9 only supports MIME type 'text/xml', void elements need to be self-closed if (isIE9) { html = html.replace(VOID_ELEMENTS_REGEX, '<$1$2$3/>'); } return domParser.parseFromString(html, mimeType); }; } /** * DOMImplementation (performance: fair). * * @see https://developer.mozilla.org/docs/Web/API/DOMImplementation/createHTMLDocument */ var parseFromDocument; if (typeof document.implementation === 'object') { // title parameter is required in IE // https://msdn.microsoft.com/en-us/library/ff975457(v=vs.85).aspx var doc = document.implementation.createHTMLDocument( isIE ? 'HTML_DOM_PARSER_TITLE' : undefined ); /** * Use HTML document created by `document.implementation.createHTMLDocument`. * * @param {string} html - The HTML string. * @param {string} [tagName] - The element to render the HTML (with 'body' as fallback). * @return {HTMLDocument} */ parseFromDocument = function createHTMLDocument(html, tagName) { if (tagName) { doc.documentElement.getElementsByTagName(tagName)[0].innerHTML = html; return doc; } try { doc.documentElement.innerHTML = html; return doc; // fallback when certain elements in `documentElement` are read-only (IE9) } catch (err) { if (parseFromString) { return parseFromString(html); } } }; } /** * Template (performance: fast). * * @see https://developer.mozilla.org/docs/Web/HTML/Element/template */ var parseFromTemplate; var template = document.createElement('template'); if (template.content) { /** * Uses a template element (content fragment) to parse HTML. * * @param {string} html - The HTML string. * @return {NodeList} */ parseFromTemplate = function templateParser(html) { template.innerHTML = html; return template.content.childNodes; }; } // fallback document parser var parseWithFallback = parseFromDocument || parseFromString; /** * Parses HTML string to DOM nodes. * * @param {string} html - The HTML string. * @return {NodeList|Array} */ function domparser(html) { var firstTagName; var match = html.match(FIRST_TAG_REGEX); if (match && match[1]) { firstTagName = match[1].toLowerCase(); } var doc; var element; var elements; switch (firstTagName) { case HTML: if (parseFromString) { doc = parseFromString(html); // the created document may come with filler head/body elements, // so make sure to remove them if they don't actually exist if (!HEAD_TAG_REGEX.test(html)) { element = doc.getElementsByTagName(HEAD)[0]; if (element) { element.parentNode.removeChild(element); } } if (!BODY_TAG_REGEX.test(html)) { element = doc.getElementsByTagName(BODY)[0]; if (element) { element.parentNode.removeChild(element); } } return doc.getElementsByTagName(HTML); } break; case HEAD: case BODY: if (parseWithFallback) { elements = parseWithFallback(html).getElementsByTagName(firstTagName); // account for possibility of sibling if (BODY_TAG_REGEX.test(html) && HEAD_TAG_REGEX.test(html)) { return elements[0].parentNode.childNodes; } return elements; } break; // low-level tag or text default: if (parseFromTemplate) { return parseFromTemplate(html); } if (parseWithFallback) { return parseWithFallback(html, BODY).getElementsByTagName(BODY)[0] .childNodes; } break; } return []; } module.exports = domparser; /***/ }), /***/ "./node_modules/html-dom-parser/lib/html-to-dom-client.js": /*!****************************************************************!*\ !*** ./node_modules/html-dom-parser/lib/html-to-dom-client.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var domparser = __webpack_require__(/*! ./domparser */ "./node_modules/html-dom-parser/lib/domparser.js"); var utilities = __webpack_require__(/*! ./utilities */ "./node_modules/html-dom-parser/lib/utilities.js"); var formatDOM = utilities.formatDOM; var isIE9 = utilities.isIE(9); var DIRECTIVE_REGEX = /<(![a-zA-Z\s]+)>/; // e.g., <!doctype html> /** * Parses HTML and reformats DOM nodes output. * * @param {String} html - The HTML string. * @return {Array} - The formatted DOM nodes. */ function parseDOM(html) { if (typeof html !== 'string') { throw new TypeError('First argument must be a string'); } if (!html) { return []; } // match directive var match = html.match(DIRECTIVE_REGEX); var directive; if (match && match[1]) { directive = match[1]; // remove directive in IE9 because DOMParser uses // MIME type 'text/xml' instead of 'text/html' if (isIE9) { html = html.replace(match[0], ''); } } return formatDOM(domparser(html), null, directive); } module.exports = parseDOM; /***/ }), /***/ "./node_modules/html-dom-parser/lib/utilities.js": /*!*******************************************************!*\ !*** ./node_modules/html-dom-parser/lib/utilities.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var CASE_SENSITIVE_TAG_NAMES = __webpack_require__(/*! ./constants */ "./node_modules/html-dom-parser/lib/constants.js").CASE_SENSITIVE_TAG_NAMES; var caseSensitiveTagNamesMap = {}; var tagName; for (var i = 0, len = CASE_SENSITIVE_TAG_NAMES.length; i < len; i++) { tagName = CASE_SENSITIVE_TAG_NAMES[i]; caseSensitiveTagNamesMap[tagName.toLowerCase()] = tagName; } /** * Gets case-sensitive tag name. * * @param {String} tagName - The lowercase tag name. * @return {String|undefined} */ function getCaseSensitiveTagName(tagName) { return caseSensitiveTagNamesMap[tagName]; } /** * Formats DOM attributes to a hash map. * * @param {NamedNodeMap} attributes - The list of attributes. * @return {Object} - A map of attribute name to value. */ function formatAttributes(attributes) { var result = {}; var attribute; // `NamedNodeMap` is array-like for (var i = 0, len = attributes.length; i < len; i++) { attribute = attributes[i]; result[attribute.name] = attribute.value; } return result; } /** * Corrects the tag name if it is case-sensitive (SVG). * Otherwise, returns the lowercase tag name (HTML). * * @param {String} tagName - The lowercase tag name. * @return {String} - The formatted tag name. */ function formatTagName(tagName) { tagName = tagName.toLowerCase(); var caseSensitiveTagName = getCaseSensitiveTagName(tagName); if (caseSensitiveTagName) { return caseSensitiveTagName; } return tagName; } /** * Formats the browser DOM nodes to mimic the output of `htmlparser2.parseDOM()`. * * @param {NodeList} nodes - The DOM nodes. * @param {Object} [parentObj] - The formatted parent node. * @param {String} [directive] - The directive. * @return {Object[]} - The formatted DOM object. */ function formatDOM(nodes, parentObj, directive) { parentObj = parentObj || null; var result = []; var node; var prevNode; var nodeObj; // `NodeList` is array-like for (var i = 0, len = nodes.length; i < len; i++) { node = nodes[i]; // reset nodeObj = { next: null, prev: result[i - 1] || null, parent: parentObj }; // set the next node for the previous node (if applicable) prevNode = result[i - 1]; if (prevNode) { prevNode.next = nodeObj; } // set the node name if it's not "#text" or "#comment" // e.g., "div" if (node.nodeName[0] !== '#') { nodeObj.name = formatTagName(node.nodeName); // also, nodes of type "tag" have "attribs" nodeObj.attribs = {}; // default if (node.attributes && node.attributes.length) { nodeObj.attribs = formatAttributes(node.attributes); } } // set the node type // e.g., "tag" switch (node.nodeType) { // 1 = element case 1: if (nodeObj.name === 'script' || nodeObj.name === 'style') { nodeObj.type = nodeObj.name; } else { nodeObj.type = 'tag'; } // recursively format the children nodeObj.children = formatDOM(node.childNodes, nodeObj); break; // 2 = attribute // 3 = text case 3: nodeObj.type = 'text'; nodeObj.data = node.nodeValue; break; // 8 = comment case 8: nodeObj.type = 'comment'; nodeObj.data = node.nodeValue; break; } result.push(nodeObj); } if (directive) { result.unshift({ name: directive.substring(0, directive.indexOf(' ')).toLowerCase(), data: directive, type: 'directive', next: result[0] ? result[0] : null, prev: null, parent: parentObj }); if (result[1]) { result[1].prev = result[0]; } } return result; } /** * Detects IE with or without version. * * @param {Number} [version] - The IE version to detect. * @return {Boolean} - Whether IE or the version has been detected. */ function isIE(version) { if (version) { return document.documentMode === version; } return /(MSIE |Trident\/|Edge\/)/.test(navigator.userAgent); } module.exports = { formatAttributes: formatAttributes, formatDOM: formatDOM, isIE: isIE }; /***/ }), /***/ "./node_modules/html-react-parser/index.js": /*!*************************************************!*\ !*** ./node_modules/html-react-parser/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var domToReact = __webpack_require__(/*! ./lib/dom-to-react */ "./node_modules/html-react-parser/lib/dom-to-react.js"); var htmlToDOM = __webpack_require__(/*! html-dom-parser */ "./node_modules/html-dom-parser/lib/html-to-dom-client.js"); // decode HTML entities by default for `htmlparser2` var domParserOptions = { decodeEntities: true, lowerCaseAttributeNames: false }; /** * Converts HTML string to React elements. * * @param {String} html - The HTML string to parse to React. * @param {Object} [options] - The parser options. * @param {Function} [options.replace] - The replace method. * @return {JSX.Element|JSX.Element[]|String} - Returns React element(s), string, or empty array. */ function HTMLReactParser(html, options) { if (typeof html !== 'string') { throw new TypeError('First argument must be a string'); } return domToReact(htmlToDOM(html, domParserOptions), options); } HTMLReactParser.domToReact = domToReact; HTMLReactParser.htmlToDOM = htmlToDOM; // support CommonJS and ES Modules module.exports = HTMLReactParser; module.exports.default = HTMLReactParser; /***/ }), /***/ "./node_modules/html-react-parser/lib/attributes-to-props.js": /*!*******************************************************************!*\ !*** ./node_modules/html-react-parser/lib/attributes-to-props.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var reactProperty = __webpack_require__(/*! react-property */ "./node_modules/react-property/index.js"); var styleToObject = __webpack_require__(/*! style-to-object */ "./node_modules/style-to-object/index.js"); var utilities = __webpack_require__(/*! ./utilities */ "./node_modules/html-react-parser/lib/utilities.js"); var camelCase = utilities.camelCase; var htmlProperties = reactProperty.html; var svgProperties = reactProperty.svg; var isCustomAttribute = reactProperty.isCustomAttribute; var hasOwnProperty = Object.prototype.hasOwnProperty; /** * Converts HTML/SVG DOM attributes to React props. * * @param {Object} [attributes={}] - The HTML/SVG DOM attributes. * @return {Object} - The React props. */ function attributesToProps(attributes) { attributes = attributes || {}; var attributeName; var attributeNameLowerCased; var attributeValue; var property; var props = {}; for (attributeName in attributes) { attributeValue = attributes[attributeName]; // ARIA (aria-*) or custom data (data-*) attribute if (isCustomAttribute(attributeName)) { props[attributeName] = attributeValue; continue; } // convert HTML attribute to React prop attributeNameLowerCased = attributeName.toLowerCase(); if (hasOwnProperty.call(htmlProperties, attributeNameLowerCased)) { property = htmlProperties[attributeNameLowerCased]; props[property.propertyName] = property.hasBooleanValue || (property.hasOverloadedBooleanValue && !attributeValue) ? true : attributeValue; continue; } // convert SVG attribute to React prop if (hasOwnProperty.call(svgProperties, attributeName)) { property = svgProperties[attributeName]; props[property.propertyName] = attributeValue; continue; } // preserve custom attribute if React >=16 if (utilities.PRESERVE_CUSTOM_ATTRIBUTES) { props[attributeName] = attributeValue; } } // convert inline style to object if (attributes.style != null) { props.style = cssToJs(attributes.style); } return props; } /** * Converts inline CSS style to POJO (Plain Old JavaScript Object). * * @param {String} style - The inline CSS style. * @return {Object} - The style object. */ function cssToJs(style) { var styleObject = {}; if (style) { styleToObject(style, function (property, value) { // skip CSS comment if (property && value) { styleObject[camelCase(property)] = value; } }); } return styleObject; } module.exports = attributesToProps; /***/ }), /***/ "./node_modules/html-react-parser/lib/dom-to-react.js": /*!************************************************************!*\ !*** ./node_modules/html-react-parser/lib/dom-to-react.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var attributesToProps = __webpack_require__(/*! ./attributes-to-props */ "./node_modules/html-react-parser/lib/attributes-to-props.js"); var utilities = __webpack_require__(/*! ./utilities */ "./node_modules/html-react-parser/lib/utilities.js"); /** * Converts DOM nodes to React elements. * * @param {DomElement[]} nodes - The DOM nodes. * @param {Object} [options={}] - The additional options. * @param {Function} [options.replace] - The replacer. * @param {Object} [options.library] - The library (React, Preact, etc.). * @return {String|ReactElement|ReactElement[]} */ function domToReact(nodes, options) { options = options || {}; var React = options.library || __webpack_require__(/*! react */ "./node_modules/react/index.js"); var cloneElement = React.cloneElement; var createElement = React.createElement; var isValidElement = React.isValidElement; var result = []; var node; var hasReplace = typeof options.replace === 'function'; var replaceElement; var props; var children; for (var i = 0, len = nodes.length; i < len; i++) { node = nodes[i]; // replace with custom React element (if present) if (hasReplace) { replaceElement = options.replace(node); if (isValidElement(replaceElement)) { // specify a "key" prop if element has siblings // https://fb.me/react-warning-keys if (len > 1) { replaceElement = cloneElement(replaceElement, { key: replaceElement.key || i }); } result.push(replaceElement); continue; } } if (node.type === 'text') { result.push(node.data); continue; } props = node.attribs; if (!shouldPassAttributesUnaltered(node)) { // update values props = attributesToProps(node.attribs); } children = null; // node type for <script> is "script" // node type for <style> is "style" if (node.type === 'script' || node.type === 'style') { // prevent text in <script> or <style> from being escaped // https://facebook.github.io/react/tips/dangerously-set-inner-html.html if (node.children[0]) { props.dangerouslySetInnerHTML = { __html: node.children[0].data }; } } else if (node.type === 'tag') { // setting textarea value in children is an antipattern in React // https://reactjs.org/docs/forms.html#the-textarea-tag if (node.name === 'textarea' && node.children[0]) { props.defaultValue = node.children[0].data; // continue recursion of creating React elements (if applicable) } else if (node.children && node.children.length) { children = domToReact(node.children, options); } // skip all other cases (e.g., comment) } else { continue; } // specify a "key" prop if element has siblings // https://fb.me/react-warning-keys if (len > 1) { props.key = i; } result.push(createElement(node.name, props, children)); } return result.length === 1 ? result[0] : result; } /** * @param {React.ReactElement} node * @return {Boolean} */ function shouldPassAttributesUnaltered(node) { return ( utilities.PRESERVE_CUSTOM_ATTRIBUTES && node.type === 'tag' && utilities.isCustomComponent(node.name, node.attribs) ); } module.exports = domToReact; /***/ }), /***/ "./node_modules/html-react-parser/lib/utilities.js": /*!*********************************************************!*\ !*** ./node_modules/html-react-parser/lib/utilities.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var React = __webpack_require__(/*! react */ "./node_modules/react/index.js"); var hyphenPatternRegex = /-([a-z])/g; var CUSTOM_PROPERTY_OR_NO_HYPHEN_REGEX = /^--[a-zA-Z0-9-]+$|^[^-]+$/; /** * Converts a string to camelCase. * * @param {String} string - The string. * @return {String} */ function camelCase(string) { if (typeof string !== 'string') { throw new TypeError('First argument must be a string'); } // custom property or no hyphen found if (CUSTOM_PROPERTY_OR_NO_HYPHEN_REGEX.test(string)) { return string; } // convert to camelCase return string .toLowerCase() .replace(hyphenPatternRegex, function (_, character) { return character.toUpperCase(); }); } /** * Swap key with value in an object. * * @param {Object} obj - The object. * @param {Function} [override] - The override method. * @return {Object} - The inverted object. */ function invertObject(obj, override) { if (!obj || typeof obj !== 'object') { throw new TypeError('First argument must be an object'); } var key; var value; var isOverridePresent = typeof override === 'function'; var overrides = {}; var result = {}; for (key in obj) { value = obj[key]; if (isOverridePresent) { overrides = override(key, value); if (overrides && overrides.length === 2) { result[overrides[0]] = overrides[1]; continue; } } if (typeof value === 'string') { result[value] = key; } } return result; } /** * Check if a given tag is a custom component. * * @see {@link https://github.com/facebook/react/blob/v16.6.3/packages/react-dom/src/shared/isCustomComponent.js} * * @param {string} tagName - The name of the html tag. * @param {Object} props - The props being passed to the element. * @return {boolean} */ function isCustomComponent(tagName, props) { if (tagName.indexOf('-') === -1) { return props && typeof props.is === 'string'; } switch (tagName) { // These are reserved SVG and MathML elements. // We don't mind this whitelist too much because we expect it to never grow. // The alternative is to track the namespace in a few places which is convoluted. // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts case 'annotation-xml': case 'color-profile': case 'font-face': case 'font-face-src': case 'font-face-uri': case 'font-face-format': case 'font-face-name': case 'missing-glyph': return false; default: return true; } } /** * @constant {Boolean} * @see {@link https://reactjs.org/blog/2017/09/08/dom-attributes-in-react-16.html} */ var PRESERVE_CUSTOM_ATTRIBUTES = React.version.split('.')[0] >= 16; module.exports = { PRESERVE_CUSTOM_ATTRIBUTES: PRESERVE_CUSTOM_ATTRIBUTES, camelCase: camelCase, invertObject: invertObject, isCustomComponent: isCustomComponent }; /***/ }), /***/ "./node_modules/inline-style-parser/index.js": /*!***************************************************!*\ !*** ./node_modules/inline-style-parser/index.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports) { // http://www.w3.org/TR/CSS21/grammar.html // https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027 var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g; var NEWLINE_REGEX = /\n/g; var WHITESPACE_REGEX = /^\s*/; // declaration var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/; var COLON_REGEX = /^:\s*/; var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/; var SEMICOLON_REGEX = /^[;\s]*/; // https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill var TRIM_REGEX = /^\s+|\s+$/g; // strings var NEWLINE = '\n'; var FORWARD_SLASH = '/'; var ASTERISK = '*'; var EMPTY_STRING = ''; // types var TYPE_COMMENT = 'comment'; var TYPE_DECLARATION = 'declaration'; /** * @param {String} style * @param {Object} [options] * @return {Object[]} * @throws {TypeError} * @throws {Error} */ module.exports = function(style, options) { if (typeof style !== 'string') { throw new TypeError('First argument must be a string'); } if (!style) return []; options = options || {}; /** * Positional. */ var lineno = 1; var column = 1; /** * Update lineno and column based on `str`. * * @param {String} str */ function updatePosition(str) { var lines = str.match(NEWLINE_REGEX); if (lines) lineno += lines.length; var i = str.lastIndexOf(NEWLINE); column = ~i ? str.length - i : column + str.length; } /** * Mark position and patch `node.position`. * * @return {Function} */ function position() { var start = { line: lineno, column: column }; return function(node) { node.position = new Position(start); whitespace(); return node; }; } /** * Store position information for a node. * * @constructor * @property {Object} start * @property {Object} end * @property {undefined|String} source */ function Position(start) { this.start = start; this.end = { line: lineno, column: column }; this.source = options.source; } /** * Non-enumerable source string. */ Position.prototype.content = style; var errorsList = []; /** * Error `msg`. * * @param {String} msg * @throws {Error} */ function error(msg) { var err = new Error( options.source + ':' + lineno + ':' + column + ': ' + msg ); err.reason = msg; err.filename = options.source; err.line = lineno; err.column = column; err.source = style; if (options.silent) { errorsList.push(err); } else { throw err; } } /** * Match `re` and return captures. * * @param {RegExp} re * @return {undefined|Array} */ function match(re) { var m = re.exec(style); if (!m) return; var str = m[0]; updatePosition(str); style = style.slice(str.length); return m; } /** * Parse whitespace. */ function whitespace() { match(WHITESPACE_REGEX); } /** * Parse comments. * * @param {Object[]} [rules] * @return {Object[]} */ function comments(rules) { var c; rules = rules || []; while ((c = comment())) { if (c !== false) { rules.push(c); } } return rules; } /** * Parse comment. * * @return {Object} * @throws {Error} */ function comment() { var pos = position(); if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return; var i = 2; while ( EMPTY_STRING != style.charAt(i) && (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1)) ) { ++i; } i += 2; if (EMPTY_STRING === style.charAt(i - 1)) { return error('End of comment missing'); } var str = style.slice(2, i - 2); column += 2; updatePosition(str); style = style.slice(i); column += 2; return pos({ type: TYPE_COMMENT, comment: str }); } /** * Parse declaration. * * @return {Object} * @throws {Error} */ function declaration() { var pos = position(); // prop var prop = match(PROPERTY_REGEX); if (!prop) return; comment(); // : if (!match(COLON_REGEX)) return error("property missing ':'"); // val var val = match(VALUE_REGEX); var ret = pos({ type: TYPE_DECLARATION, property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)), value: val ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING)) : EMPTY_STRING }); // ; match(SEMICOLON_REGEX); return ret; } /** * Parse declarations. * * @return {Object[]} */ function declarations() { var decls = []; comments(decls); // declarations var decl; while ((decl = declaration())) { if (decl !== false) { decls.push(decl); comments(decls); } } return decls; } whitespace(); return declarations(); }; /** * Trim `str`. * * @param {String} str * @return {String} */ function trim(str) { return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING; } /***/ }), /***/ "./node_modules/latinize/latinize.js": /*!*******************************************!*\ !*** ./node_modules/latinize/latinize.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(root, factory) { if (true) { // AMD. Register as an anonymous module. !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} })(this, function() { function latinize(str) { if (typeof str === 'string') { return str.replace(/[^A-Za-z0-9]/g, function(x) { return latinize.characters[x] || x; }); } else { return str; } } latinize.characters = { 'Á': 'A', 'Ă': 'A', 'Ắ': 'A', 'Ặ': 'A', 'Ằ': 'A', 'Ẳ': 'A', 'Ẵ': 'A', 'Ǎ': 'A', 'Â': 'A', 'Ấ': 'A', 'Ậ': 'A', 'Ầ': 'A', 'Ẩ': 'A', 'Ẫ': 'A', 'Ä': 'A', 'Ǟ': 'A', 'Ȧ': 'A', 'Ǡ': 'A', 'Ạ': 'A', 'Ȁ': 'A', 'À': 'A', 'Ả': 'A', 'Ȃ': 'A', 'Ā': 'A', 'Ą': 'A', 'Å': 'A', 'Ǻ': 'A', 'Ḁ': 'A', 'Ⱥ': 'A', 'Ã': 'A', 'Ꜳ': 'AA', 'Æ': 'AE', 'Ǽ': 'AE', 'Ǣ': 'AE', 'Ꜵ': 'AO', 'Ꜷ': 'AU', 'Ꜹ': 'AV', 'Ꜻ': 'AV', 'Ꜽ': 'AY', 'Ḃ': 'B', 'Ḅ': 'B', 'Ɓ': 'B', 'Ḇ': 'B', 'Ƀ': 'B', 'Ƃ': 'B', 'Ć': 'C', 'Č': 'C', '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', 'ᶍ': 'x', 'ý': 'y', 'ŷ': 'y', 'ÿ': 'y', 'ẏ': 'y', 'ỵ': 'y', 'ỳ': 'y', 'ƴ': 'y', 'ỷ': 'y', 'ỿ': 'y', 'ȳ': 'y', 'ẙ': 'y', 'ɏ': 'y', 'ỹ': 'y', 'ź': 'z', 'ž': 'z', 'ẑ': 'z', 'ʑ': 'z', 'ⱬ': 'z', 'ż': 'z', 'ẓ': 'z', 'ȥ': 'z', 'ẕ': 'z', 'ᵶ': 'z', 'ᶎ': 'z', 'ʐ': 'z', 'ƶ': 'z', 'ɀ': 'z', 'þ': 'th', 'ff': 'ff', 'ffi': 'ffi', 'ffl': 'ffl', 'fi': 'fi', 'fl': 'fl', 'ij': 'ij', 'œ': 'oe', 'st': 'st', 'ₐ': 'a', 'ₑ': 'e', 'ᵢ': 'i', 'ⱼ': 'j', 'ₒ': 'o', 'ᵣ': 'r', 'ᵤ': 'u', 'ᵥ': 'v', 'ₓ': 'x', 'Ё': 'YO', 'Й': 'I', 'Ц': 'TS', 'У': 'U', 'К': 'K', 'Е': 'E', 'Н': 'N', 'Г': 'G', 'Ш': 'SH', 'Щ': 'SCH', 'З': 'Z', 'Х': 'H', 'Ъ': "'", 'ё': 'yo', 'й': 'i', 'ц': 'ts', 'у': 'u', 'к': 'k', 'е': 'e', 'н': 'n', 'г': 'g', 'ш': 'sh', 'щ': 'sch', 'з': 'z', 'х': 'h', 'ъ': "'", 'Ф': 'F', 'Ы': 'I', 'В': 'V', 'А': 'a', 'П': 'P', 'Р': 'R', 'О': 'O', 'Л': 'L', 'Д': 'D', 'Ж': 'ZH', 'Э': 'E', 'ф': 'f', 'ы': 'i', 'в': 'v', 'а': 'a', 'п': 'p', 'р': 'r', 'о': 'o', 'л': 'l', 'д': 'd', 'ж': 'zh', 'э': 'e', 'Я': 'Ya', 'Ч': 'CH', 'С': 'S', 'М': 'M', 'И': 'I', 'Т': 'T', 'Ь': "'", 'Б': 'B', 'Ю': 'YU', 'я': 'ya', 'ч': 'ch', 'с': 's', 'м': 'm', 'и': 'i', 'т': 't', 'ь': "'", 'б': 'b', 'ю': 'yu' }; return latinize; }); /***/ }), /***/ "./node_modules/object-assign/index.js": /*!*********************************************!*\ !*** ./node_modules/object-assign/index.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* object-assign (c) Sindre Sorhus @license MIT */ /* eslint-disable no-unused-vars */ var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === undefined) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } // Detect buggy property enumeration order in older V8 versions. // https://bugs.chromium.org/p/v8/issues/detail?id=4118 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers test1[5] = 'de'; if (Object.getOwnPropertyNames(test1)[0] === '5') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test2 = {}; for (var i = 0; i < 10; i++) { test2['_' + String.fromCharCode(i)] = i; } var order2 = Object.getOwnPropertyNames(test2).map(function (n) { return test2[n]; }); if (order2.join('') !== '0123456789') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test3 = {}; 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { return false; } return true; } catch (err) { // We don't expect any of the above to throw, but better to be safe. return false; } } module.exports = shouldUseNative() ? Object.assign : function (target, source) { var from; var to = toObject(target); var symbols; for (var s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; } } } } return to; }; /***/ }), /***/ "./node_modules/prop-types/checkPropTypes.js": /*!***************************************************!*\ !*** ./node_modules/prop-types/checkPropTypes.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var printWarning = function() {}; if (true) { var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js"); var loggedTypeFailures = {}; var has = Function.call.bind(Object.prototype.hasOwnProperty); printWarning = function(text) { var message = 'Warning: ' + text; if (typeof console !== 'undefined') { console.error(message); } try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); } catch (x) {} }; } /** * Assert that the values match with the type specs. * Error messages are memorized and will only be shown once. * * @param {object} typeSpecs Map of name to a ReactPropType * @param {object} values Runtime values that need to be type-checked * @param {string} location e.g. "prop", "context", "child context" * @param {string} componentName Name of the component for error messages. * @param {?Function} getStack Returns the component stack. * @private */ function checkPropTypes(typeSpecs, values, location, componentName, getStack) { if (true) { for (var typeSpecName in typeSpecs) { if (has(typeSpecs, typeSpecName)) { var error; // Prop type validation may throw. In case they do, we don't want to // fail the render phase where it didn't fail before. So we log it. // After these have been cleaned up, we'll let them throw. try { // This is intentionally an invariant that gets caught. It's the same // behavior as without this statement except with a better message. if (typeof typeSpecs[typeSpecName] !== 'function') { var err = Error( (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' ); err.name = 'Invariant Violation'; throw err; } error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); } catch (ex) { error = ex; } if (error && !(error instanceof Error)) { printWarning( (componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).' ); } if (error instanceof Error && !(error.message in loggedTypeFailures)) { // Only monitor this failure once because there tends to be a lot of the // same error. loggedTypeFailures[error.message] = true; var stack = getStack ? getStack() : ''; printWarning( 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') ); } } } } } /** * Resets warning cache when testing. * * @private */ checkPropTypes.resetWarningCache = function() { if (true) { loggedTypeFailures = {}; } } module.exports = checkPropTypes; /***/ }), /***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js": /*!*************************************************************!*\ !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; module.exports = ReactPropTypesSecret; /***/ }), /***/ "./node_modules/react-property/index.js": /*!**********************************************!*\ !*** ./node_modules/react-property/index.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var HTMLDOMPropertyConfig = __webpack_require__(/*! ./lib/HTMLDOMPropertyConfig */ "./node_modules/react-property/lib/HTMLDOMPropertyConfig.js"); var SVGDOMPropertyConfig = __webpack_require__(/*! ./lib/SVGDOMPropertyConfig */ "./node_modules/react-property/lib/SVGDOMPropertyConfig.js"); var injection = __webpack_require__(/*! ./lib/injection */ "./node_modules/react-property/lib/injection.js"); var MUST_USE_PROPERTY = injection.MUST_USE_PROPERTY; var HAS_BOOLEAN_VALUE = injection.HAS_BOOLEAN_VALUE; var HAS_NUMERIC_VALUE = injection.HAS_NUMERIC_VALUE; var HAS_POSITIVE_NUMERIC_VALUE = injection.HAS_POSITIVE_NUMERIC_VALUE; var HAS_OVERLOADED_BOOLEAN_VALUE = injection.HAS_OVERLOADED_BOOLEAN_VALUE; /** * @see https://github.com/facebook/react/blob/15-stable/src/renderers/dom/shared/DOMProperty.js#L14-L16 * * @param {Number} value * @param {Number} bitmask * @return {Boolean} */ function checkMask(value, bitmask) { return (value & bitmask) === bitmask; } /** * @see https://github.com/facebook/react/blob/15-stable/src/renderers/dom/shared/DOMProperty.js#L57 * * @param {Object} domPropertyConfig - HTMLDOMPropertyConfig or SVGDOMPropertyConfig * @param {Object} config - The object to be mutated * @param {Boolean} isSVG - Whether the injected config is HTML or SVG (it assumes the default is HTML) */ function injectDOMPropertyConfig(domPropertyConfig, config, isSVG) { var Properties = domPropertyConfig.Properties; var DOMAttributeNames = domPropertyConfig.DOMAttributeNames; var attributeName; var propertyName; var propConfig; for (propertyName in Properties) { attributeName = DOMAttributeNames[propertyName] || (isSVG ? propertyName : propertyName.toLowerCase()); propConfig = Properties[propertyName]; config[attributeName] = { attributeName: attributeName, propertyName: propertyName, mustUseProperty: checkMask(propConfig, MUST_USE_PROPERTY), hasBooleanValue: checkMask(propConfig, HAS_BOOLEAN_VALUE), hasNumericValue: checkMask(propConfig, HAS_NUMERIC_VALUE), hasPositiveNumericValue: checkMask( propConfig, HAS_POSITIVE_NUMERIC_VALUE ), hasOverloadedBooleanValue: checkMask( propConfig, HAS_OVERLOADED_BOOLEAN_VALUE ) }; } } /** * HTML properties config. * * @type {Object} */ var html = {}; injectDOMPropertyConfig(HTMLDOMPropertyConfig, html); /** * SVG properties config. * * @type {Object} */ var svg = {}; injectDOMPropertyConfig(SVGDOMPropertyConfig, svg, true); /** * HTML and SVG properties config. * * @type {Object} */ var properties = {}; injectDOMPropertyConfig(HTMLDOMPropertyConfig, properties); injectDOMPropertyConfig(SVGDOMPropertyConfig, properties, true); var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD'; var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040'; module.exports = { html: html, svg: svg, properties: properties, /** * Checks whether a property name is a custom attribute. * * @see https://github.com/facebook/react/blob/15-stable/src/renderers/dom/shared/HTMLDOMPropertyConfig.js#L23-L25 * * @param {String} * @return {Boolean} */ isCustomAttribute: RegExp.prototype.test.bind( new RegExp('^(data|aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$') ) }; /***/ }), /***/ "./node_modules/react-property/lib/HTMLDOMPropertyConfig.js": /*!******************************************************************!*\ !*** ./node_modules/react-property/lib/HTMLDOMPropertyConfig.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = { Properties: { autoFocus: 4, accept: 0, acceptCharset: 0, accessKey: 0, action: 0, allowFullScreen: 4, allowTransparency: 0, alt: 0, as: 0, async: 4, autoComplete: 0, autoPlay: 4, capture: 4, cellPadding: 0, cellSpacing: 0, charSet: 0, challenge: 0, checked: 5, cite: 0, classID: 0, className: 0, cols: 24, colSpan: 0, content: 0, contentEditable: 0, contextMenu: 0, controls: 4, controlsList: 0, coords: 0, crossOrigin: 0, data: 0, dateTime: 0, default: 4, defer: 4, dir: 0, disabled: 4, download: 32, draggable: 0, encType: 0, form: 0, formAction: 0, formEncType: 0, formMethod: 0, formNoValidate: 4, formTarget: 0, frameBorder: 0, headers: 0, height: 0, hidden: 4, high: 0, href: 0, hrefLang: 0, htmlFor: 0, httpEquiv: 0, icon: 0, id: 0, inputMode: 0, integrity: 0, is: 0, keyParams: 0, keyType: 0, kind: 0, label: 0, lang: 0, list: 0, loop: 4, low: 0, manifest: 0, marginHeight: 0, marginWidth: 0, max: 0, maxLength: 0, media: 0, mediaGroup: 0, method: 0, min: 0, minLength: 0, multiple: 5, muted: 5, name: 0, nonce: 0, noValidate: 4, open: 4, optimum: 0, pattern: 0, placeholder: 0, playsInline: 4, poster: 0, preload: 0, profile: 0, radioGroup: 0, readOnly: 4, referrerPolicy: 0, rel: 0, required: 4, reversed: 4, role: 0, rows: 24, rowSpan: 8, sandbox: 0, scope: 0, scoped: 4, scrolling: 0, seamless: 4, selected: 5, shape: 0, size: 24, sizes: 0, span: 24, spellCheck: 0, src: 0, srcDoc: 0, srcLang: 0, srcSet: 0, start: 8, step: 0, style: 0, summary: 0, tabIndex: 0, target: 0, title: 0, type: 0, useMap: 0, value: 0, width: 0, wmode: 0, wrap: 0, about: 0, datatype: 0, inlist: 0, prefix: 0, property: 0, resource: 0, typeof: 0, vocab: 0, autoCapitalize: 0, autoCorrect: 0, autoSave: 0, color: 0, itemProp: 0, itemScope: 4, itemType: 0, itemID: 0, itemRef: 0, results: 0, security: 0, unselectable: 0 }, DOMAttributeNames: { acceptCharset: 'accept-charset', className: 'class', htmlFor: 'for', httpEquiv: 'http-equiv' } }; /***/ }), /***/ "./node_modules/react-property/lib/SVGDOMPropertyConfig.js": /*!*****************************************************************!*\ !*** ./node_modules/react-property/lib/SVGDOMPropertyConfig.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = { Properties: { accentHeight: 0, accumulate: 0, additive: 0, alignmentBaseline: 0, allowReorder: 0, alphabetic: 0, amplitude: 0, arabicForm: 0, ascent: 0, attributeName: 0, attributeType: 0, autoReverse: 0, azimuth: 0, baseFrequency: 0, baseProfile: 0, baselineShift: 0, bbox: 0, begin: 0, bias: 0, by: 0, calcMode: 0, capHeight: 0, clip: 0, clipPath: 0, clipRule: 0, clipPathUnits: 0, colorInterpolation: 0, colorInterpolationFilters: 0, colorProfile: 0, colorRendering: 0, contentScriptType: 0, contentStyleType: 0, cursor: 0, cx: 0, cy: 0, d: 0, decelerate: 0, descent: 0, diffuseConstant: 0, direction: 0, display: 0, divisor: 0, dominantBaseline: 0, dur: 0, dx: 0, dy: 0, edgeMode: 0, elevation: 0, enableBackground: 0, end: 0, exponent: 0, externalResourcesRequired: 0, fill: 0, fillOpacity: 0, fillRule: 0, filter: 0, filterRes: 0, filterUnits: 0, floodColor: 0, floodOpacity: 0, focusable: 0, fontFamily: 0, fontSize: 0, fontSizeAdjust: 0, fontStretch: 0, fontStyle: 0, fontVariant: 0, fontWeight: 0, format: 0, from: 0, fx: 0, fy: 0, g1: 0, g2: 0, glyphName: 0, glyphOrientationHorizontal: 0, glyphOrientationVertical: 0, glyphRef: 0, gradientTransform: 0, gradientUnits: 0, hanging: 0, horizAdvX: 0, horizOriginX: 0, ideographic: 0, imageRendering: 0, in: 0, in2: 0, intercept: 0, k: 0, k1: 0, k2: 0, k3: 0, k4: 0, kernelMatrix: 0, kernelUnitLength: 0, kerning: 0, keyPoints: 0, keySplines: 0, keyTimes: 0, lengthAdjust: 0, letterSpacing: 0, lightingColor: 0, limitingConeAngle: 0, local: 0, markerEnd: 0, markerMid: 0, markerStart: 0, markerHeight: 0, markerUnits: 0, markerWidth: 0, mask: 0, maskContentUnits: 0, maskUnits: 0, mathematical: 0, mode: 0, numOctaves: 0, offset: 0, opacity: 0, operator: 0, order: 0, orient: 0, orientation: 0, origin: 0, overflow: 0, overlinePosition: 0, overlineThickness: 0, paintOrder: 0, panose1: 0, pathLength: 0, patternContentUnits: 0, patternTransform: 0, patternUnits: 0, pointerEvents: 0, points: 0, pointsAtX: 0, pointsAtY: 0, pointsAtZ: 0, preserveAlpha: 0, preserveAspectRatio: 0, primitiveUnits: 0, r: 0, radius: 0, refX: 0, refY: 0, renderingIntent: 0, repeatCount: 0, repeatDur: 0, requiredExtensions: 0, requiredFeatures: 0, restart: 0, result: 0, rotate: 0, rx: 0, ry: 0, scale: 0, seed: 0, shapeRendering: 0, slope: 0, spacing: 0, specularConstant: 0, specularExponent: 0, speed: 0, spreadMethod: 0, startOffset: 0, stdDeviation: 0, stemh: 0, stemv: 0, stitchTiles: 0, stopColor: 0, stopOpacity: 0, strikethroughPosition: 0, strikethroughThickness: 0, string: 0, stroke: 0, strokeDasharray: 0, strokeDashoffset: 0, strokeLinecap: 0, strokeLinejoin: 0, strokeMiterlimit: 0, strokeOpacity: 0, strokeWidth: 0, surfaceScale: 0, systemLanguage: 0, tableValues: 0, targetX: 0, targetY: 0, textAnchor: 0, textDecoration: 0, textRendering: 0, textLength: 0, to: 0, transform: 0, u1: 0, u2: 0, underlinePosition: 0, underlineThickness: 0, unicode: 0, unicodeBidi: 0, unicodeRange: 0, unitsPerEm: 0, vAlphabetic: 0, vHanging: 0, vIdeographic: 0, vMathematical: 0, values: 0, vectorEffect: 0, version: 0, vertAdvY: 0, vertOriginX: 0, vertOriginY: 0, viewBox: 0, viewTarget: 0, visibility: 0, widths: 0, wordSpacing: 0, writingMode: 0, x: 0, xHeight: 0, x1: 0, x2: 0, xChannelSelector: 0, xlinkActuate: 0, xlinkArcrole: 0, xlinkHref: 0, xlinkRole: 0, xlinkShow: 0, xlinkTitle: 0, xlinkType: 0, xmlBase: 0, xmlns: 0, xmlnsXlink: 0, xmlLang: 0, xmlSpace: 0, y: 0, y1: 0, y2: 0, yChannelSelector: 0, z: 0, zoomAndPan: 0 }, DOMAttributeNames: { accentHeight: 'accent-height', alignmentBaseline: 'alignment-baseline', arabicForm: 'arabic-form', baselineShift: 'baseline-shift', capHeight: 'cap-height', clipPath: 'clip-path', clipRule: 'clip-rule', colorInterpolation: 'color-interpolation', colorInterpolationFilters: 'color-interpolation-filters', colorProfile: 'color-profile', colorRendering: 'color-rendering', dominantBaseline: 'dominant-baseline', enableBackground: 'enable-background', fillOpacity: 'fill-opacity', fillRule: 'fill-rule', floodColor: 'flood-color', floodOpacity: 'flood-opacity', fontFamily: 'font-family', fontSize: 'font-size', fontSizeAdjust: 'font-size-adjust', fontStretch: 'font-stretch', fontStyle: 'font-style', fontVariant: 'font-variant', fontWeight: 'font-weight', glyphName: 'glyph-name', glyphOrientationHorizontal: 'glyph-orientation-horizontal', glyphOrientationVertical: 'glyph-orientation-vertical', horizAdvX: 'horiz-adv-x', horizOriginX: 'horiz-origin-x', imageRendering: 'image-rendering', letterSpacing: 'letter-spacing', lightingColor: 'lighting-color', markerEnd: 'marker-end', markerMid: 'marker-mid', markerStart: 'marker-start', overlinePosition: 'overline-position', overlineThickness: 'overline-thickness', paintOrder: 'paint-order', panose1: 'panose-1', pointerEvents: 'pointer-events', renderingIntent: 'rendering-intent', shapeRendering: 'shape-rendering', stopColor: 'stop-color', stopOpacity: 'stop-opacity', strikethroughPosition: 'strikethrough-position', strikethroughThickness: 'strikethrough-thickness', strokeDasharray: 'stroke-dasharray', strokeDashoffset: 'stroke-dashoffset', strokeLinecap: 'stroke-linecap', strokeLinejoin: 'stroke-linejoin', strokeMiterlimit: 'stroke-miterlimit', strokeOpacity: 'stroke-opacity', strokeWidth: 'stroke-width', textAnchor: 'text-anchor', textDecoration: 'text-decoration', textRendering: 'text-rendering', underlinePosition: 'underline-position', underlineThickness: 'underline-thickness', unicodeBidi: 'unicode-bidi', unicodeRange: 'unicode-range', unitsPerEm: 'units-per-em', vAlphabetic: 'v-alphabetic', vHanging: 'v-hanging', vIdeographic: 'v-ideographic', vMathematical: 'v-mathematical', vectorEffect: 'vector-effect', vertAdvY: 'vert-adv-y', vertOriginX: 'vert-origin-x', vertOriginY: 'vert-origin-y', wordSpacing: 'word-spacing', writingMode: 'writing-mode', xHeight: 'x-height', xlinkActuate: 'xlink:actuate', xlinkArcrole: 'xlink:arcrole', xlinkHref: 'xlink:href', xlinkRole: 'xlink:role', xlinkShow: 'xlink:show', xlinkTitle: 'xlink:title', xlinkType: 'xlink:type', xmlBase: 'xml:base', xmlnsXlink: 'xmlns:xlink', xmlLang: 'xml:lang', xmlSpace: 'xml:space' } }; /***/ }), /***/ "./node_modules/react-property/lib/injection.js": /*!******************************************************!*\ !*** ./node_modules/react-property/lib/injection.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = { MUST_USE_PROPERTY: 1, HAS_BOOLEAN_VALUE: 4, HAS_NUMERIC_VALUE: 8, HAS_POSITIVE_NUMERIC_VALUE: 24, HAS_OVERLOADED_BOOLEAN_VALUE: 32 }; /***/ }), /***/ "./node_modules/react/cjs/react.development.js": /*!*****************************************************!*\ !*** ./node_modules/react/cjs/react.development.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** @license React v16.14.0 * react.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ if (true) { (function() { 'use strict'; var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); var checkPropTypes = __webpack_require__(/*! prop-types/checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js"); var ReactVersion = '16.14.0'; // The Symbol used to tag the ReactElement-like types. If there is no native Symbol // nor polyfill, then a plain number is used for performance. var hasSymbol = typeof Symbol === 'function' && Symbol.for; var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; function getIteratorFn(maybeIterable) { if (maybeIterable === null || typeof maybeIterable !== 'object') { return null; } var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; if (typeof maybeIterator === 'function') { return maybeIterator; } return null; } /** * Keeps track of the current dispatcher. */ var ReactCurrentDispatcher = { /** * @internal * @type {ReactComponent} */ current: null }; /** * Keeps track of the current batch's configuration such as how long an update * should suspend for if it needs to. */ var ReactCurrentBatchConfig = { suspense: null }; /** * Keeps track of the current owner. * * The current owner is the component who should own any components that are * currently being constructed. */ var ReactCurrentOwner = { /** * @internal * @type {ReactComponent} */ current: null }; var BEFORE_SLASH_RE = /^(.*)[\\\/]/; function describeComponentFrame (name, source, ownerName) { var sourceInfo = ''; if (source) { var path = source.fileName; var fileName = path.replace(BEFORE_SLASH_RE, ''); { // In DEV, include code for a common special case: // prefer "folder/index.js" instead of just "index.js". if (/^index\./.test(fileName)) { var match = path.match(BEFORE_SLASH_RE); if (match) { var pathBeforeSlash = match[1]; if (pathBeforeSlash) { var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); fileName = folderName + '/' + fileName; } } } } sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; } else if (ownerName) { sourceInfo = ' (created by ' + ownerName + ')'; } return '\n in ' + (name || 'Unknown') + sourceInfo; } var Resolved = 1; function refineResolvedLazyComponent(lazyComponent) { return lazyComponent._status === Resolved ? lazyComponent._result : null; } function getWrappedName(outerType, innerType, wrapperName) { var functionName = innerType.displayName || innerType.name || ''; return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); } function getComponentName(type) { if (type == null) { // Host root, text node or just invalid type. return null; } { if (typeof type.tag === 'number') { error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); } } if (typeof type === 'function') { return type.displayName || type.name || null; } if (typeof type === 'string') { return type; } switch (type) { case REACT_FRAGMENT_TYPE: return 'Fragment'; case REACT_PORTAL_TYPE: return 'Portal'; case REACT_PROFILER_TYPE: return "Profiler"; case REACT_STRICT_MODE_TYPE: return 'StrictMode'; case REACT_SUSPENSE_TYPE: return 'Suspense'; case REACT_SUSPENSE_LIST_TYPE: return 'SuspenseList'; } if (typeof type === 'object') { switch (type.$$typeof) { case REACT_CONTEXT_TYPE: return 'Context.Consumer'; case REACT_PROVIDER_TYPE: return 'Context.Provider'; case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, 'ForwardRef'); case REACT_MEMO_TYPE: return getComponentName(type.type); case REACT_BLOCK_TYPE: return getComponentName(type.render); case REACT_LAZY_TYPE: { var thenable = type; var resolvedThenable = refineResolvedLazyComponent(thenable); if (resolvedThenable) { return getComponentName(resolvedThenable); } break; } } } return null; } var ReactDebugCurrentFrame = {}; var currentlyValidatingElement = null; function setCurrentlyValidatingElement(element) { { currentlyValidatingElement = element; } } { // Stack implementation injected by the current renderer. ReactDebugCurrentFrame.getCurrentStack = null; ReactDebugCurrentFrame.getStackAddendum = function () { var stack = ''; // Add an extra top frame while an element is being validated if (currentlyValidatingElement) { var name = getComponentName(currentlyValidatingElement.type); var owner = currentlyValidatingElement._owner; stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type)); } // Delegate to the injected renderer-specific implementation var impl = ReactDebugCurrentFrame.getCurrentStack; if (impl) { stack += impl() || ''; } return stack; }; } /** * Used by act() to track whether you're inside an act() scope. */ var IsSomeRendererActing = { current: false }; var ReactSharedInternals = { ReactCurrentDispatcher: ReactCurrentDispatcher, ReactCurrentBatchConfig: ReactCurrentBatchConfig, ReactCurrentOwner: ReactCurrentOwner, IsSomeRendererActing: IsSomeRendererActing, // Used by renderers to avoid bundling object-assign twice in UMD bundles: assign: _assign }; { _assign(ReactSharedInternals, { // These should not be included in production. ReactDebugCurrentFrame: ReactDebugCurrentFrame, // Shim for React DOM 16.0.0 which still destructured (but not used) this. // TODO: remove in React 17.0. ReactComponentTreeHook: {} }); } // by calls to these methods by a Babel plugin. // // In PROD (or in packages without access to React internals), // they are left as they are instead. function warn(format) { { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } printWarning('warn', format, args); } } function error(format) { { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } printWarning('error', format, args); } } function printWarning(level, format, args) { // When changing this logic, you might want to also // update consoleWithStackDev.www.js as well. { var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0; if (!hasExistingStack) { var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; var stack = ReactDebugCurrentFrame.getStackAddendum(); if (stack !== '') { format += '%s'; args = args.concat([stack]); } } var argsWithFormat = args.map(function (item) { return '' + item; }); // Careful: RN currently depends on this prefix argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it // breaks IE9: https://github.com/facebook/react/issues/13610 // eslint-disable-next-line react-internal/no-production-logging Function.prototype.apply.call(console[level], console, argsWithFormat); try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. var argIndex = 0; var message = 'Warning: ' + format.replace(/%s/g, function () { return args[argIndex++]; }); throw new Error(message); } catch (x) {} } } var didWarnStateUpdateForUnmountedComponent = {}; function warnNoop(publicInstance, callerName) { { var _constructor = publicInstance.constructor; var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass'; var warningKey = componentName + "." + callerName; if (didWarnStateUpdateForUnmountedComponent[warningKey]) { return; } error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName); didWarnStateUpdateForUnmountedComponent[warningKey] = true; } } /** * This is the abstract API for an update queue. */ var ReactNoopUpdateQueue = { /** * Checks whether or not this composite component is mounted. * @param {ReactClass} publicInstance The instance we want to test. * @return {boolean} True if mounted, false otherwise. * @protected * @final */ isMounted: function (publicInstance) { return false; }, /** * Forces an update. This should only be invoked when it is known with * certainty that we are **not** in a DOM transaction. * * You may want to call this when you know that some deeper aspect of the * component's state has changed but `setState` was not called. * * This will not invoke `shouldComponentUpdate`, but it will invoke * `componentWillUpdate` and `componentDidUpdate`. * * @param {ReactClass} publicInstance The instance that should rerender. * @param {?function} callback Called after component is updated. * @param {?string} callerName name of the calling function in the public API. * @internal */ enqueueForceUpdate: function (publicInstance, callback, callerName) { warnNoop(publicInstance, 'forceUpdate'); }, /** * Replaces all of the state. Always use this or `setState` to mutate state. * You should treat `this.state` as immutable. * * There is no guarantee that `this.state` will be immediately updated, so * accessing `this.state` after calling this method may return the old value. * * @param {ReactClass} publicInstance The instance that should rerender. * @param {object} completeState Next state. * @param {?function} callback Called after component is updated. * @param {?string} callerName name of the calling function in the public API. * @internal */ enqueueReplaceState: function (publicInstance, completeState, callback, callerName) { warnNoop(publicInstance, 'replaceState'); }, /** * Sets a subset of the state. This only exists because _pendingState is * internal. This provides a merging strategy that is not available to deep * properties which is confusing. TODO: Expose pendingState or don't use it * during the merge. * * @param {ReactClass} publicInstance The instance that should rerender. * @param {object} partialState Next partial state to be merged with state. * @param {?function} callback Called after component is updated. * @param {?string} Name of the calling function in the public API. * @internal */ enqueueSetState: function (publicInstance, partialState, callback, callerName) { warnNoop(publicInstance, 'setState'); } }; var emptyObject = {}; { Object.freeze(emptyObject); } /** * Base class helpers for the updating state of a component. */ function Component(props, context, updater) { this.props = props; this.context = context; // If a component has string refs, we will assign a different object later. this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the // renderer. this.updater = updater || ReactNoopUpdateQueue; } Component.prototype.isReactComponent = {}; /** * Sets a subset of the state. Always use this to mutate * state. You should treat `this.state` as immutable. * * There is no guarantee that `this.state` will be immediately updated, so * accessing `this.state` after calling this method may return the old value. * * There is no guarantee that calls to `setState` will run synchronously, * as they may eventually be batched together. You can provide an optional * callback that will be executed when the call to setState is actually * completed. * * When a function is provided to setState, it will be called at some point in * the future (not synchronously). It will be called with the up to date * component arguments (state, props, context). These values can be different * from this.* because your function may be called after receiveProps but before * shouldComponentUpdate, and this new state, props, and context will not yet be * assigned to this. * * @param {object|function} partialState Next partial state or function to * produce next partial state to be merged with current state. * @param {?function} callback Called after state is updated. * @final * @protected */ Component.prototype.setState = function (partialState, callback) { if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) { { throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." ); } } this.updater.enqueueSetState(this, partialState, callback, 'setState'); }; /** * Forces an update. This should only be invoked when it is known with * certainty that we are **not** in a DOM transaction. * * You may want to call this when you know that some deeper aspect of the * component's state has changed but `setState` was not called. * * This will not invoke `shouldComponentUpdate`, but it will invoke * `componentWillUpdate` and `componentDidUpdate`. * * @param {?function} callback Called after update is complete. * @final * @protected */ Component.prototype.forceUpdate = function (callback) { this.updater.enqueueForceUpdate(this, callback, 'forceUpdate'); }; /** * Deprecated APIs. These APIs used to exist on classic React classes but since * we would like to deprecate them, we're not going to move them over to this * modern base class. Instead, we define a getter that warns if it's accessed. */ { var deprecatedAPIs = { isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] }; var defineDeprecationWarning = function (methodName, info) { Object.defineProperty(Component.prototype, methodName, { get: function () { warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); return undefined; } }); }; for (var fnName in deprecatedAPIs) { if (deprecatedAPIs.hasOwnProperty(fnName)) { defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); } } } function ComponentDummy() {} ComponentDummy.prototype = Component.prototype; /** * Convenience component with default shallow equality check for sCU. */ function PureComponent(props, context, updater) { this.props = props; this.context = context; // If a component has string refs, we will assign a different object later. this.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; } var pureComponentPrototype = PureComponent.prototype = new ComponentDummy(); pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods. _assign(pureComponentPrototype, Component.prototype); pureComponentPrototype.isPureReactComponent = true; // an immutable object with a single mutable value function createRef() { var refObject = { current: null }; { Object.seal(refObject); } return refObject; } var hasOwnProperty = Object.prototype.hasOwnProperty; var RESERVED_PROPS = { key: true, ref: true, __self: true, __source: true }; var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs; { didWarnAboutStringRefs = {}; } function hasValidRef(config) { { if (hasOwnProperty.call(config, 'ref')) { var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; if (getter && getter.isReactWarning) { return false; } } } return config.ref !== undefined; } function hasValidKey(config) { { if (hasOwnProperty.call(config, 'key')) { var getter = Object.getOwnPropertyDescriptor(config, 'key').get; if (getter && getter.isReactWarning) { return false; } } } return config.key !== undefined; } function defineKeyPropWarningGetter(props, displayName) { var warnAboutAccessingKey = function () { { if (!specialPropKeyWarningShown) { specialPropKeyWarningShown = true; error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName); } } }; warnAboutAccessingKey.isReactWarning = true; Object.defineProperty(props, 'key', { get: warnAboutAccessingKey, configurable: true }); } function defineRefPropWarningGetter(props, displayName) { var warnAboutAccessingRef = function () { { if (!specialPropRefWarningShown) { specialPropRefWarningShown = true; error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName); } } }; warnAboutAccessingRef.isReactWarning = true; Object.defineProperty(props, 'ref', { get: warnAboutAccessingRef, configurable: true }); } function warnIfStringRefCannotBeAutoConverted(config) { { if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) { var componentName = getComponentName(ReactCurrentOwner.current.type); if (!didWarnAboutStringRefs[componentName]) { error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref); didWarnAboutStringRefs[componentName] = true; } } } } /** * Factory method to create a new React element. This no longer adheres to * the class pattern, so do not use new to call it. Also, instanceof check * will not work. Instead test $$typeof field against Symbol.for('react.element') to check * if something is a React Element. * * @param {*} type * @param {*} props * @param {*} key * @param {string|object} ref * @param {*} owner * @param {*} self A *temporary* helper to detect places where `this` is * different from the `owner` when React.createElement is called, so that we * can warn. We want to get rid of owner and replace string `ref`s with arrow * functions, and as long as `this` and owner are the same, there will be no * change in behavior. * @param {*} source An annotation object (added by a transpiler or otherwise) * indicating filename, line number, and/or other information. * @internal */ var ReactElement = function (type, key, ref, self, source, owner, props) { var element = { // This tag allows us to uniquely identify this as a React Element $$typeof: REACT_ELEMENT_TYPE, // Built-in properties that belong on the element type: type, key: key, ref: ref, props: props, // Record the component responsible for creating this element. _owner: owner }; { // The validation flag is currently mutative. We put it on // an external backing store so that we can freeze the whole object. // This can be replaced with a WeakMap once they are implemented in // commonly used development environments. element._store = {}; // To make comparing ReactElements easier for testing purposes, we make // the validation flag non-enumerable (where possible, which should // include every environment we run tests in), so the test framework // ignores it. Object.defineProperty(element._store, 'validated', { configurable: false, enumerable: false, writable: true, value: false }); // self and source are DEV only properties. Object.defineProperty(element, '_self', { configurable: false, enumerable: false, writable: false, value: self }); // Two elements created in two different places should be considered // equal for testing purposes and therefore we hide it from enumeration. Object.defineProperty(element, '_source', { configurable: false, enumerable: false, writable: false, value: source }); if (Object.freeze) { Object.freeze(element.props); Object.freeze(element); } } return element; }; /** * Create and return a new ReactElement of the given type. * See https://reactjs.org/docs/react-api.html#createelement */ function createElement(type, config, children) { var propName; // Reserved names are extracted var props = {}; var key = null; var ref = null; var self = null; var source = null; if (config != null) { if (hasValidRef(config)) { ref = config.ref; { warnIfStringRefCannotBeAutoConverted(config); } } if (hasValidKey(config)) { key = '' + config.key; } self = config.__self === undefined ? null : config.__self; source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object for (propName in config) { if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { props[propName] = config[propName]; } } } // Children can be more than one argument, and those are transferred onto // the newly allocated props object. var childrenLength = arguments.length - 2; if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 2]; } { if (Object.freeze) { Object.freeze(childArray); } } props.children = childArray; } // Resolve default props if (type && type.defaultProps) { var defaultProps = type.defaultProps; for (propName in defaultProps) { if (props[propName] === undefined) { props[propName] = defaultProps[propName]; } } } { if (key || ref) { var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; if (key) { defineKeyPropWarningGetter(props, displayName); } if (ref) { defineRefPropWarningGetter(props, displayName); } } } return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); } function cloneAndReplaceKey(oldElement, newKey) { var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); return newElement; } /** * Clone and return a new ReactElement using element as the starting point. * See https://reactjs.org/docs/react-api.html#cloneelement */ function cloneElement(element, config, children) { if (!!(element === null || element === undefined)) { { throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." ); } } var propName; // Original props are copied var props = _assign({}, element.props); // Reserved names are extracted var key = element.key; var ref = element.ref; // Self is preserved since the owner is preserved. var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a // transpiler, and the original source is probably a better indicator of the // true owner. var source = element._source; // Owner will be preserved, unless ref is overridden var owner = element._owner; if (config != null) { if (hasValidRef(config)) { // Silently steal the ref from the parent. ref = config.ref; owner = ReactCurrentOwner.current; } if (hasValidKey(config)) { key = '' + config.key; } // Remaining properties override existing props var defaultProps; if (element.type && element.type.defaultProps) { defaultProps = element.type.defaultProps; } for (propName in config) { if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { if (config[propName] === undefined && defaultProps !== undefined) { // Resolve default props props[propName] = defaultProps[propName]; } else { props[propName] = config[propName]; } } } } // Children can be more than one argument, and those are transferred onto // the newly allocated props object. var childrenLength = arguments.length - 2; if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 2]; } props.children = childArray; } return ReactElement(element.type, key, ref, self, source, owner, props); } /** * Verifies the object is a ReactElement. * See https://reactjs.org/docs/react-api.html#isvalidelement * @param {?object} object * @return {boolean} True if `object` is a ReactElement. * @final */ function isValidElement(object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } var SEPARATOR = '.'; var SUBSEPARATOR = ':'; /** * Escape and wrap key so it is safe to use as a reactid * * @param {string} key to be escaped. * @return {string} the escaped key. */ function escape(key) { var escapeRegex = /[=:]/g; var escaperLookup = { '=': '=0', ':': '=2' }; var escapedString = ('' + key).replace(escapeRegex, function (match) { return escaperLookup[match]; }); return '$' + escapedString; } /** * TODO: Test that a single child and an array with one item have the same key * pattern. */ var didWarnAboutMaps = false; var userProvidedKeyEscapeRegex = /\/+/g; function escapeUserProvidedKey(text) { return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/'); } var POOL_SIZE = 10; var traverseContextPool = []; function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) { if (traverseContextPool.length) { var traverseContext = traverseContextPool.pop(); traverseContext.result = mapResult; traverseContext.keyPrefix = keyPrefix; traverseContext.func = mapFunction; traverseContext.context = mapContext; traverseContext.count = 0; return traverseContext; } else { return { result: mapResult, keyPrefix: keyPrefix, func: mapFunction, context: mapContext, count: 0 }; } } function releaseTraverseContext(traverseContext) { traverseContext.result = null; traverseContext.keyPrefix = null; traverseContext.func = null; traverseContext.context = null; traverseContext.count = 0; if (traverseContextPool.length < POOL_SIZE) { traverseContextPool.push(traverseContext); } } /** * @param {?*} children Children tree container. * @param {!string} nameSoFar Name of the key path so far. * @param {!function} callback Callback to invoke with each child found. * @param {?*} traverseContext Used to pass information throughout the traversal * process. * @return {!number} The number of children in this subtree. */ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) { var type = typeof children; if (type === 'undefined' || type === 'boolean') { // All of the above are perceived as null. children = null; } var invokeCallback = false; if (children === null) { invokeCallback = true; } else { switch (type) { case 'string': case 'number': invokeCallback = true; break; case 'object': switch (children.$$typeof) { case REACT_ELEMENT_TYPE: case REACT_PORTAL_TYPE: invokeCallback = true; } } } if (invokeCallback) { callback(traverseContext, children, // If it's the only child, treat the name as if it was wrapped in an array // so that it's consistent if the number of children grows. nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar); return 1; } var child; var nextName; var subtreeCount = 0; // Count of children found in the current subtree. var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; if (Array.isArray(children)) { for (var i = 0; i < children.length; i++) { child = children[i]; nextName = nextNamePrefix + getComponentKey(child, i); subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); } } else { var iteratorFn = getIteratorFn(children); if (typeof iteratorFn === 'function') { { // Warn about using Maps as children if (iteratorFn === children.entries) { if (!didWarnAboutMaps) { warn('Using Maps as children is deprecated and will be removed in ' + 'a future major release. Consider converting children to ' + 'an array of keyed ReactElements instead.'); } didWarnAboutMaps = true; } } var iterator = iteratorFn.call(children); var step; var ii = 0; while (!(step = iterator.next()).done) { child = step.value; nextName = nextNamePrefix + getComponentKey(child, ii++); subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); } } else if (type === 'object') { var addendum = ''; { addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum(); } var childrenString = '' + children; { { throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ")." + addendum ); } } } } return subtreeCount; } /** * Traverses children that are typically specified as `props.children`, but * might also be specified through attributes: * * - `traverseAllChildren(this.props.children, ...)` * - `traverseAllChildren(this.props.leftPanelChildren, ...)` * * The `traverseContext` is an optional argument that is passed through the * entire traversal. It can be used to store accumulations or anything else that * the callback might find relevant. * * @param {?*} children Children tree object. * @param {!function} callback To invoke upon traversing each child. * @param {?*} traverseContext Context for traversal. * @return {!number} The number of children in this subtree. */ function traverseAllChildren(children, callback, traverseContext) { if (children == null) { return 0; } return traverseAllChildrenImpl(children, '', callback, traverseContext); } /** * Generate a key string that identifies a component within a set. * * @param {*} component A component that could contain a manual key. * @param {number} index Index that is used if a manual key is not provided. * @return {string} */ function getComponentKey(component, index) { // Do some typechecking here since we call this blindly. We want to ensure // that we don't block potential future ES APIs. if (typeof component === 'object' && component !== null && component.key != null) { // Explicit key return escape(component.key); } // Implicit key determined by the index in the set return index.toString(36); } function forEachSingleChild(bookKeeping, child, name) { var func = bookKeeping.func, context = bookKeeping.context; func.call(context, child, bookKeeping.count++); } /** * Iterates through children that are typically specified as `props.children`. * * See https://reactjs.org/docs/react-api.html#reactchildrenforeach * * The provided forEachFunc(child, index) will be called for each * leaf child. * * @param {?*} children Children tree container. * @param {function(*, int)} forEachFunc * @param {*} forEachContext Context for forEachContext. */ function forEachChildren(children, forEachFunc, forEachContext) { if (children == null) { return children; } var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext); traverseAllChildren(children, forEachSingleChild, traverseContext); releaseTraverseContext(traverseContext); } function mapSingleChildIntoContext(bookKeeping, child, childKey) { var result = bookKeeping.result, keyPrefix = bookKeeping.keyPrefix, func = bookKeeping.func, context = bookKeeping.context; var mappedChild = func.call(context, child, bookKeeping.count++); if (Array.isArray(mappedChild)) { mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) { return c; }); } else if (mappedChild != null) { if (isValidElement(mappedChild)) { mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as // traverseAllChildren used to do for objects as children keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); } result.push(mappedChild); } } function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { var escapedPrefix = ''; if (prefix != null) { escapedPrefix = escapeUserProvidedKey(prefix) + '/'; } var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context); traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); releaseTraverseContext(traverseContext); } /** * Maps children that are typically specified as `props.children`. * * See https://reactjs.org/docs/react-api.html#reactchildrenmap * * The provided mapFunction(child, key, index) will be called for each * leaf child. * * @param {?*} children Children tree container. * @param {function(*, int)} func The map function. * @param {*} context Context for mapFunction. * @return {object} Object containing the ordered map of results. */ function mapChildren(children, func, context) { if (children == null) { return children; } var result = []; mapIntoWithKeyPrefixInternal(children, result, null, func, context); return result; } /** * Count the number of children that are typically specified as * `props.children`. * * See https://reactjs.org/docs/react-api.html#reactchildrencount * * @param {?*} children Children tree container. * @return {number} The number of children. */ function countChildren(children) { return traverseAllChildren(children, function () { return null; }, null); } /** * Flatten a children object (typically specified as `props.children`) and * return an array with appropriately re-keyed children. * * See https://reactjs.org/docs/react-api.html#reactchildrentoarray */ function toArray(children) { var result = []; mapIntoWithKeyPrefixInternal(children, result, null, function (child) { return child; }); return result; } /** * Returns the first child in a collection of children and verifies that there * is only one child in the collection. * * See https://reactjs.org/docs/react-api.html#reactchildrenonly * * The current implementation of this function assumes that a single child gets * passed without a wrapper, but the purpose of this helper function is to * abstract away the particular structure of children. * * @param {?object} children Child collection structure. * @return {ReactElement} The first and only `ReactElement` contained in the * structure. */ function onlyChild(children) { if (!isValidElement(children)) { { throw Error( "React.Children.only expected to receive a single React element child." ); } } return children; } function createContext(defaultValue, calculateChangedBits) { if (calculateChangedBits === undefined) { calculateChangedBits = null; } else { { if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') { error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits); } } } var context = { $$typeof: REACT_CONTEXT_TYPE, _calculateChangedBits: calculateChangedBits, // As a workaround to support multiple concurrent renderers, we categorize // some renderers as primary and others as secondary. We only expect // there to be two concurrent renderers at most: React Native (primary) and // Fabric (secondary); React DOM (primary) and React ART (secondary). // Secondary renderers store their context values on separate fields. _currentValue: defaultValue, _currentValue2: defaultValue, // Used to track how many concurrent renderers this context currently // supports within in a single renderer. Such as parallel server rendering. _threadCount: 0, // These are circular Provider: null, Consumer: null }; context.Provider = { $$typeof: REACT_PROVIDER_TYPE, _context: context }; var hasWarnedAboutUsingNestedContextConsumers = false; var hasWarnedAboutUsingConsumerProvider = false; { // A separate object, but proxies back to the original context object for // backwards compatibility. It has a different $$typeof, so we can properly // warn for the incorrect usage of Context as a Consumer. var Consumer = { $$typeof: REACT_CONTEXT_TYPE, _context: context, _calculateChangedBits: context._calculateChangedBits }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here Object.defineProperties(Consumer, { Provider: { get: function () { if (!hasWarnedAboutUsingConsumerProvider) { hasWarnedAboutUsingConsumerProvider = true; error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?'); } return context.Provider; }, set: function (_Provider) { context.Provider = _Provider; } }, _currentValue: { get: function () { return context._currentValue; }, set: function (_currentValue) { context._currentValue = _currentValue; } }, _currentValue2: { get: function () { return context._currentValue2; }, set: function (_currentValue2) { context._currentValue2 = _currentValue2; } }, _threadCount: { get: function () { return context._threadCount; }, set: function (_threadCount) { context._threadCount = _threadCount; } }, Consumer: { get: function () { if (!hasWarnedAboutUsingNestedContextConsumers) { hasWarnedAboutUsingNestedContextConsumers = true; error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?'); } return context.Consumer; } } }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty context.Consumer = Consumer; } { context._currentRenderer = null; context._currentRenderer2 = null; } return context; } function lazy(ctor) { var lazyType = { $$typeof: REACT_LAZY_TYPE, _ctor: ctor, // React uses these fields to store the result. _status: -1, _result: null }; { // In production, this would just set it on the object. var defaultProps; var propTypes; Object.defineProperties(lazyType, { defaultProps: { configurable: true, get: function () { return defaultProps; }, set: function (newDefaultProps) { error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); defaultProps = newDefaultProps; // Match production behavior more closely: Object.defineProperty(lazyType, 'defaultProps', { enumerable: true }); } }, propTypes: { configurable: true, get: function () { return propTypes; }, set: function (newPropTypes) { error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); propTypes = newPropTypes; // Match production behavior more closely: Object.defineProperty(lazyType, 'propTypes', { enumerable: true }); } } }); } return lazyType; } function forwardRef(render) { { if (render != null && render.$$typeof === REACT_MEMO_TYPE) { error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).'); } else if (typeof render !== 'function') { error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render); } else { if (render.length !== 0 && render.length !== 2) { error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.'); } } if (render != null) { if (render.defaultProps != null || render.propTypes != null) { error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?'); } } } return { $$typeof: REACT_FORWARD_REF_TYPE, render: render }; } function isValidElementType(type) { return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); } function memo(type, compare) { { if (!isValidElementType(type)) { error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type); } } return { $$typeof: REACT_MEMO_TYPE, type: type, compare: compare === undefined ? null : compare }; } function resolveDispatcher() { var dispatcher = ReactCurrentDispatcher.current; if (!(dispatcher !== null)) { { throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem." ); } } return dispatcher; } function useContext(Context, unstable_observedBits) { var dispatcher = resolveDispatcher(); { if (unstable_observedBits !== undefined) { error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : ''); } // TODO: add a more generic warning for invalid values. if (Context._context !== undefined) { var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs // and nobody should be using this in existing code. if (realContext.Consumer === Context) { error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?'); } else if (realContext.Provider === Context) { error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?'); } } } return dispatcher.useContext(Context, unstable_observedBits); } function useState(initialState) { var dispatcher = resolveDispatcher(); return dispatcher.useState(initialState); } function useReducer(reducer, initialArg, init) { var dispatcher = resolveDispatcher(); return dispatcher.useReducer(reducer, initialArg, init); } function useRef(initialValue) { var dispatcher = resolveDispatcher(); return dispatcher.useRef(initialValue); } function useEffect(create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useEffect(create, deps); } function useLayoutEffect(create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useLayoutEffect(create, deps); } function useCallback(callback, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useCallback(callback, deps); } function useMemo(create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useMemo(create, deps); } function useImperativeHandle(ref, create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useImperativeHandle(ref, create, deps); } function useDebugValue(value, formatterFn) { { var dispatcher = resolveDispatcher(); return dispatcher.useDebugValue(value, formatterFn); } } var propTypesMisspellWarningShown; { propTypesMisspellWarningShown = false; } function getDeclarationErrorAddendum() { if (ReactCurrentOwner.current) { var name = getComponentName(ReactCurrentOwner.current.type); if (name) { return '\n\nCheck the render method of `' + name + '`.'; } } return ''; } function getSourceInfoErrorAddendum(source) { if (source !== undefined) { var fileName = source.fileName.replace(/^.*[\\\/]/, ''); var lineNumber = source.lineNumber; return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; } return ''; } function getSourceInfoErrorAddendumForProps(elementProps) { if (elementProps !== null && elementProps !== undefined) { return getSourceInfoErrorAddendum(elementProps.__source); } return ''; } /** * Warn if there's no key explicitly set on dynamic arrays of children or * object keys are not valid. This allows us to keep track of children between * updates. */ var ownerHasKeyUseWarning = {}; function getCurrentComponentErrorInfo(parentType) { var info = getDeclarationErrorAddendum(); if (!info) { var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; if (parentName) { info = "\n\nCheck the top-level render call using <" + parentName + ">."; } } return info; } /** * Warn if the element doesn't have an explicit key assigned to it. * This element is in an array. The array could grow and shrink or be * reordered. All children that haven't already been validated are required to * have a "key" property assigned to it. Error statuses are cached so a warning * will only be shown once. * * @internal * @param {ReactElement} element Element that requires a key. * @param {*} parentType element's parent's type. */ function validateExplicitKey(element, parentType) { if (!element._store || element._store.validated || element.key != null) { return; } element._store.validated = true; var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { return; } ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a // property, it may be the creator of the child that's responsible for // assigning it a key. var childOwner = ''; if (element && element._owner && element._owner !== ReactCurrentOwner.current) { // Give the component that originally created this child. childOwner = " It was passed a child from " + getComponentName(element._owner.type) + "."; } setCurrentlyValidatingElement(element); { error('Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner); } setCurrentlyValidatingElement(null); } /** * Ensure that every element either is passed in a static location, in an * array with an explicit keys property defined, or in an object literal * with valid key property. * * @internal * @param {ReactNode} node Statically passed child of any type. * @param {*} parentType node's parent's type. */ function validateChildKeys(node, parentType) { if (typeof node !== 'object') { return; } if (Array.isArray(node)) { for (var i = 0; i < node.length; i++) { var child = node[i]; if (isValidElement(child)) { validateExplicitKey(child, parentType); } } } else if (isValidElement(node)) { // This element was passed in a valid location. if (node._store) { node._store.validated = true; } } else if (node) { var iteratorFn = getIteratorFn(node); if (typeof iteratorFn === 'function') { // Entry iterators used to provide implicit keys, // but now we print a separate warning for them later. if (iteratorFn !== node.entries) { var iterator = iteratorFn.call(node); var step; while (!(step = iterator.next()).done) { if (isValidElement(step.value)) { validateExplicitKey(step.value, parentType); } } } } } } /** * Given an element, validate that its props follow the propTypes definition, * provided by the type. * * @param {ReactElement} element */ function validatePropTypes(element) { { var type = element.type; if (type === null || type === undefined || typeof type === 'string') { return; } var name = getComponentName(type); var propTypes; if (typeof type === 'function') { propTypes = type.propTypes; } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. type.$$typeof === REACT_MEMO_TYPE)) { propTypes = type.propTypes; } else { return; } if (propTypes) { setCurrentlyValidatingElement(element); checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum); setCurrentlyValidatingElement(null); } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { propTypesMisspellWarningShown = true; error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown'); } if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); } } } /** * Given a fragment, validate that it can only be provided with fragment props * @param {ReactElement} fragment */ function validateFragmentProps(fragment) { { setCurrentlyValidatingElement(fragment); var keys = Object.keys(fragment.props); for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (key !== 'children' && key !== 'key') { error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); break; } } if (fragment.ref !== null) { error('Invalid attribute `ref` supplied to `React.Fragment`.'); } setCurrentlyValidatingElement(null); } } function createElementWithValidation(type, props, children) { var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to // succeed and there will likely be errors in render. if (!validType) { var info = ''; if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; } var sourceInfo = getSourceInfoErrorAddendumForProps(props); if (sourceInfo) { info += sourceInfo; } else { info += getDeclarationErrorAddendum(); } var typeString; if (type === null) { typeString = 'null'; } else if (Array.isArray(type)) { typeString = 'array'; } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; info = ' Did you accidentally export a JSX literal instead of a component?'; } else { typeString = typeof type; } { error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); } } var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used. // TODO: Drop this when these are no longer allowed as the type argument. if (element == null) { return element; } // Skip key warning if the type isn't valid since our key validation logic // doesn't expect a non-string/function type and can throw confusing errors. // We don't want exception behavior to differ between dev and prod. // (Rendering will throw with a helpful message and as soon as the type is // fixed, the key warnings will appear.) if (validType) { for (var i = 2; i < arguments.length; i++) { validateChildKeys(arguments[i], type); } } if (type === REACT_FRAGMENT_TYPE) { validateFragmentProps(element); } else { validatePropTypes(element); } return element; } var didWarnAboutDeprecatedCreateFactory = false; function createFactoryWithValidation(type) { var validatedFactory = createElementWithValidation.bind(null, type); validatedFactory.type = type; { if (!didWarnAboutDeprecatedCreateFactory) { didWarnAboutDeprecatedCreateFactory = true; warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.'); } // Legacy hook: remove it Object.defineProperty(validatedFactory, 'type', { enumerable: false, get: function () { warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); Object.defineProperty(this, 'type', { value: type }); return type; } }); } return validatedFactory; } function cloneElementWithValidation(element, props, children) { var newElement = cloneElement.apply(this, arguments); for (var i = 2; i < arguments.length; i++) { validateChildKeys(arguments[i], newElement.type); } validatePropTypes(newElement); return newElement; } { try { var frozenObject = Object.freeze({}); var testMap = new Map([[frozenObject, null]]); var testSet = new Set([frozenObject]); // This is necessary for Rollup to not consider these unused. // https://github.com/rollup/rollup/issues/1771 // TODO: we can remove these if Rollup fixes the bug. testMap.set(0, 0); testSet.add(0); } catch (e) { } } var createElement$1 = createElementWithValidation ; var cloneElement$1 = cloneElementWithValidation ; var createFactory = createFactoryWithValidation ; var Children = { map: mapChildren, forEach: forEachChildren, count: countChildren, toArray: toArray, only: onlyChild }; exports.Children = Children; exports.Component = Component; exports.Fragment = REACT_FRAGMENT_TYPE; exports.Profiler = REACT_PROFILER_TYPE; exports.PureComponent = PureComponent; exports.StrictMode = REACT_STRICT_MODE_TYPE; exports.Suspense = REACT_SUSPENSE_TYPE; exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals; exports.cloneElement = cloneElement$1; exports.createContext = createContext; exports.createElement = createElement$1; exports.createFactory = createFactory; exports.createRef = createRef; exports.forwardRef = forwardRef; exports.isValidElement = isValidElement; exports.lazy = lazy; exports.memo = memo; exports.useCallback = useCallback; exports.useContext = useContext; exports.useDebugValue = useDebugValue; exports.useEffect = useEffect; exports.useImperativeHandle = useImperativeHandle; exports.useLayoutEffect = useLayoutEffect; exports.useMemo = useMemo; exports.useReducer = useReducer; exports.useRef = useRef; exports.useState = useState; exports.version = ReactVersion; })(); } /***/ }), /***/ "./node_modules/react/index.js": /*!*************************************!*\ !*** ./node_modules/react/index.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; if (false) {} else { module.exports = __webpack_require__(/*! ./cjs/react.development.js */ "./node_modules/react/cjs/react.development.js"); } /***/ }), /***/ "./node_modules/style-to-object/index.js": /*!***********************************************!*\ !*** ./node_modules/style-to-object/index.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(/*! inline-style-parser */ "./node_modules/inline-style-parser/index.js"); /** * Parses inline style to object. * * @example * // returns { 'line-height': '42' } * StyleToObject('line-height: 42;'); * * @param {String} style - The inline style. * @param {Function} [iterator] - The iterator function. * @return {null|Object} */ function StyleToObject(style, iterator) { var output = null; if (!style || typeof style !== 'string') { return output; } var declaration; var declarations = parse(style); var hasIterator = typeof iterator === 'function'; var property; var value; for (var i = 0, len = declarations.length; i < len; i++) { declaration = declarations[i]; property = declaration.property; value = declaration.value; if (hasIterator) { iterator(property, value, declaration); } else if (value) { output || (output = {}); output[property] = value; } } return output; } module.exports = StyleToObject; /***/ }), /***/ "./src/assets/blocks/0-adv-components/components.jsx": /*!***********************************************************!*\ !*** ./src/assets/blocks/0-adv-components/components.jsx ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AdvColorControl = AdvColorControl; function AdvColorControl(props) { var _wp$components = wp.components, ColorIndicator = _wp$components.ColorIndicator, BaseControl = _wp$components.BaseControl; var _ref = wp.blockEditor || wp.editor, ColorPalette = _ref.ColorPalette; var BaseLabel = BaseControl.VisualLabel ? BaseControl.VisualLabel : "span"; var label = props.label, value = props.value, onChange = props.onChange; return React.createElement( BaseControl, { className: "editor-color-palette-control block-editor-color-palette-control" }, React.createElement( BaseLabel, { className: "components-base-control__label" }, label, value && React.createElement(ColorIndicator, { colorValue: value }) ), React.createElement(ColorPalette, { className: "editor-color-palette-control__color-palette block-editor-color-palette-control__color-palette", value: value, onChange: onChange }) ); } /***/ }), /***/ "./src/assets/blocks/0-adv-components/datetime.jsx": /*!*********************************************************!*\ !*** ./src/assets/blocks/0-adv-components/datetime.jsx ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); exports.AdvDateTimeControl = AdvDateTimeControl; function AdvDateTimeControl(props) { var _wp$components = wp.components, Button = _wp$components.Button, DateTimePicker = _wp$components.DateTimePicker, Popover = _wp$components.Popover, Tooltip = _wp$components.Tooltip; var _wp$element = wp.element, Fragment = _wp$element.Fragment, useState = _wp$element.useState; var __ = wp.i18n.__; var _useState = useState(false), _useState2 = _slicedToArray(_useState, 2), popupState = _useState2[0], setPopupState = _useState2[1]; var togglePopup = function togglePopup() { setPopupState(function (state) { return !state; }); }; var buttonLabel = props.buttonLabel, dateLabel = props.dateLabel, date = props.date, onChangeDate = props.onChangeDate, onDateClear = props.onDateClear, onInvalidDate = props.onInvalidDate; return React.createElement( Fragment, null, React.createElement( "div", { className: "advgb-advcalendar-control" }, React.createElement( "label", null, dateLabel ), React.createElement( "div", null, React.createElement( Button, { isLink: true, icon: "calendar", onClick: function onClick() { return setPopupState(togglePopup); } }, React.createElement( Tooltip, { text: __('Change date', 'advanced-gutenberg') }, React.createElement( "span", null, date ? moment(date).format("MMMM DD YYYY, h:mm a") : buttonLabel ) ) ), date && React.createElement(Button, { icon: "no-alt", className: "advgb-advcalendar-remove-icon", onClick: function onClick() { return onDateClear(); } }) ) ), popupState && React.createElement( Popover, { className: "advgb-advcalendar-popover", onClose: setPopupState.bind(null, false) }, React.createElement( "label", { className: "advgb-advcalendar-popover-label" }, dateLabel, React.createElement(Button, { icon: "no-alt", className: "advgb-advcalendar-remove-icon", onClick: function onClick() { return setPopupState(togglePopup); } }) ), React.createElement( "div", { className: "advgb-advcalendar-popover-timezone" }, typeof advgbBlocks.timezone !== 'undefined' && advgbBlocks.timezone.length ? advgbBlocks.timezone.replace(/_/g, ' ') + " " + __('time', 'advanced-gutenberg') : __('WordPress settings timezone', 'advanced-gutenberg') ), React.createElement(DateTimePicker, { currentDate: date, onChange: onChangeDate, is12Hour: true, isInvalidDate: onInvalidDate }) ) ); } /***/ }), /***/ "./src/assets/blocks/0-adv-components/icon-class.jsx": /*!***********************************************************!*\ !*** ./src/assets/blocks/0-adv-components/icon-class.jsx ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); exports.IconListPopupHook = IconListPopupHook; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var __ = wp.i18n.__; var _wp$element = wp.element, Component = _wp$element.Component, Fragment = _wp$element.Fragment; var _wp$components = wp.components, SelectControl = _wp$components.SelectControl, TextControl = _wp$components.TextControl; var IconListPopup = function (_Component) { _inherits(IconListPopup, _Component); function IconListPopup(props) { _classCallCheck(this, IconListPopup); var _this = _possibleConstructorReturn(this, (IconListPopup.__proto__ || Object.getPrototypeOf(IconListPopup)).call(this, props)); _this.handleClick = _this.handleClick.bind(_this); _this.state = { searchedText: '', selectedIcon: '', selectedIconTheme: 'outlined' }; return _this; } _createClass(IconListPopup, [{ key: 'componentWillMount', value: function componentWillMount() { var _state = this.state, searchedText = _state.searchedText, selectedIconTheme = _state.selectedIconTheme; if (this.props.selectedIcon !== searchedText) { this.setState({ selectedIcon: this.props.selectedIcon }); } if (this.props.selectedIconTheme !== selectedIconTheme) { this.setState({ selectedIconTheme: this.props.selectedIconTheme }); } document.addEventListener('click', this.handleClick); } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { // important document.removeEventListener('click', this.handleClick); } }, { key: 'handleClick', value: function handleClick(e) { // ignore clicks inside the popup and the click that launched the popup if (this.node.contains(e.target) || e.target.className.includes('advgb-browse-image-btn') || e.target.className.includes('advgb-browse-icon-btn')) { return; } this.props.closePopup(); } }, { key: 'render', value: function render() { var _this2 = this; var _state2 = this.state, searchedText = _state2.searchedText, selectedIcon = _state2.selectedIcon, selectedIconTheme = _state2.selectedIconTheme; var popUpTitle = __('Icon List', 'advanced-gutenberg'); var iconType = 'material'; var applyIconButtonClass = ['apply-btn', 'components-button', 'button button-large', 'advgb-icon-apply-btn', 'is-primary'].filter(Boolean).join(' '); var closeButtonClass = ['close-btn'].filter(Boolean).join(' '); return React.createElement( Fragment, null, React.createElement( 'div', { className: 'advgb-icon-popup' }, React.createElement( 'div', { className: 'popup-inner', ref: function ref(node) { _this2.node = node; } }, React.createElement( 'div', { className: 'popup-content' }, React.createElement( 'div', { className: 'popup-header' }, React.createElement( 'h3', null, popUpTitle ), React.createElement( 'button', { className: closeButtonClass, onClick: this.props.closePopup }, React.createElement( 'i', { className: 'material-icons' }, 'close' ) ) ), React.createElement( 'div', { className: 'popup-body' }, React.createElement(TextControl, { placeholder: __('Search icons', 'advanced-gutenberg'), value: searchedText, onChange: function onChange(value) { return _this2.setState({ searchedText: value }); } }), React.createElement(SelectControl, { label: __('Style', 'advanced-gutenberg'), value: selectedIconTheme, className: 'advgb-icon-style-select', options: [{ label: __('Filled', 'advanced-gutenberg'), value: '' }, { label: __('Outlined', 'advanced-gutenberg'), value: 'outlined' }, { label: __('Rounded', 'advanced-gutenberg'), value: 'round' }, { label: __('Two-Tone', 'advanced-gutenberg'), value: 'two-tone' }, { label: __('Sharp', 'advanced-gutenberg'), value: 'sharp' }], onChange: function onChange(value) { _this2.setState({ selectedIconTheme: value }); } }), React.createElement( 'div', { className: 'advgb-icon-items-wrapper button-icons-list', style: { maxHeight: 300, overflowY: 'auto', overflowX: 'hidden' } }, Object.keys(advgbBlocks.iconList[iconType]).filter(function (icon) { return icon.indexOf(searchedText.trim().split(' ').join('_')) > -1; }).map(function (icon, index) { var iconClass = [iconType === 'material' && 'material-icons', selectedIconTheme !== '' && '-' + selectedIconTheme].filter(Boolean).join(''); return React.createElement( 'div', { className: 'advgb-icon-item', key: index }, React.createElement( 'span', { onClick: function onClick() { _this2.setState({ selectedIcon: icon }); }, className: icon === selectedIcon && 'active', title: icon }, React.createElement( 'i', { className: iconClass }, icon ) ) ); }) ) ), React.createElement( 'div', { className: 'popup-footer' }, React.createElement( 'button', { disabled: selectedIcon === '', className: applyIconButtonClass, onClick: function onClick() { _this2.props.onSelectIcon(selectedIcon); _this2.props.onSelectIconTheme(selectedIconTheme); _this2.props.closePopup(); } }, __('Apply', 'advanced-gutenberg') ) ) ) ) ) ); } }]); return IconListPopup; }(Component); exports.default = IconListPopup; function IconListPopupHook(props) { var closePopup = props.closePopup, onSelectIcon = props.onSelectIcon, onSelectIconTheme = props.onSelectIconTheme, selectedIcon = props.selectedIcon, selectedIconTheme = props.selectedIconTheme; return React.createElement(IconListPopup, { closePopup: closePopup, onSelectIcon: onSelectIcon, onSelectIconTheme: onSelectIconTheme, selectedIcon: selectedIcon, selectedIconTheme: selectedIconTheme }); } /***/ }), /***/ "./src/assets/blocks/0-adv-components/utils.jsx": /*!******************************************************!*\ !*** ./src/assets/blocks/0-adv-components/utils.jsx ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Generate option title suggestions * * @since 3.1.1 * @param options Available options as objects with slug and title. e.g. [{slug: 'subscriber', title: 'Subscriber'}, {slug: 'new_customer', title: 'New Customer'}] * * @return {array} Option slugs. e.g. ['subscriber','new_customer'] */ var getOptionSuggestions = exports.getOptionSuggestions = function getOptionSuggestions(options) { return options.map(function (item) { return item.title; }); }; /** * Match option slugs with its option titles * to display as field value (but NOT saved!). * * @since 3.1.1 * @param slugs Option slugs. e.g. ['subscriber','new_customer'] * @param options Available options as objects with slug and title. e.g. [{slug: 'subscriber', title: 'Subscriber'}, {slug: 'new_customer', title: 'New Customer'}] * * @return {array} Option titles. e.g. ['Subscriber','New Customer'] */ var getOptionTitles = exports.getOptionTitles = function getOptionTitles(slugs, options) { var field_value = []; if (options !== null) { field_value = slugs.map(function (option_slug) { var find_option = options.find(function (item) { return item.slug === option_slug; }); if (find_option === undefined || !find_option) { return option_slug; // It should return false but creates empty selections } return find_option.title; }); } return field_value; }; /** * Match option titles with its slugs, and save slugs * * @since 3.1.1 * @param slugs Option slugs. e.g. ['subscriber','new_customer'] * @param options Available options as objects with slug and title. e.g. [{slug: 'subscriber', title: 'Subscriber'}, {slug: 'new_customer', title: 'New Customer'}] * * @return {array} Option slugs. e.g. ['subscriber','new_customer'] */ var getOptionSlugs = exports.getOptionSlugs = function getOptionSlugs(slugs, options) { var slugs_array = []; slugs.map(function (option_title) { var matching_slug = options.find(function (item) { return item.title === option_title; }); if (matching_slug !== undefined) { slugs_array.push(matching_slug.slug); } }); return slugs_array; }; /***/ }), /***/ "./src/assets/blocks/accordion/block.jsx": /*!***********************************************!*\ !*** ./src/assets/blocks/accordion/block.jsx ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType, createBlock = wpBlocks.createBlock; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, RichText = _wpBlockEditor.RichText, PanelColorSettings = _wpBlockEditor.PanelColorSettings, InnerBlocks = _wpBlockEditor.InnerBlocks; var RangeControl = wpComponents.RangeControl, PanelBody = wpComponents.PanelBody, BaseControl = wpComponents.BaseControl, SelectControl = wpComponents.SelectControl, ToggleControl = wpComponents.ToggleControl; var HEADER_ICONS = { plus: React.createElement( Fragment, null, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6V13z" }) ), plusCircle: React.createElement( Fragment, null, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M12,2C6.48,2,2,6.48,2,12s4.48,10,10,10s10-4.48,10-10S17.52,2,12,2z M17,13h-4v4h-2v-4H7v-2h4V7h2v4h4V13z" }) ), plusCircleOutline: React.createElement( Fragment, null, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M13,7h-2v4H7v2h4v4h2v-4h4v-2h-4V7z M12,2C6.48,2,2,6.48,2,12s4.48,10,10,10s10-4.48,10-10S17.52,2,12,2z M12,20 c-4.41,0-8-3.59-8-8s3.59-8,8-8s8,3.59,8,8S16.41,20,12,20z" }) ), plusBox: React.createElement( Fragment, null, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M19,3H5C3.89,3,3,3.9,3,5v14c0,1.1,0.89,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3z M19,19H5V5h14V19z" }), React.createElement("polygon", { points: "11,17 13,17 13,13 17,13 17,11 13,11 13,7 11,7 11,11 7,11 7,13 11,13" }) ), unfold: React.createElement( Fragment, null, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M12,5.83L15.17,9l1.41-1.41L12,3L7.41,7.59L8.83,9L12,5.83z M12,18.17L8.83,15l-1.41,1.41L12,21l4.59-4.59L15.17,15 L12,18.17z" }) ), threeDots: React.createElement( Fragment, null, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M6,10c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S7.1,10,6,10z M18,10c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S19.1,10,18,10z M12,10c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S13.1,10,12,10z" }) ), arrowDown: React.createElement( Fragment, null, React.createElement("path", { opacity: "0.87", fill: "none", d: "M24,24H0L0,0l24,0V24z" }), React.createElement("path", { d: "M16.59,8.59L12,13.17L7.41,8.59L6,10l6,6l6-6L16.59,8.59z" }) ) }; var AdvAccordion = function (_Component) { _inherits(AdvAccordion, _Component); function AdvAccordion() { _classCallCheck(this, AdvAccordion); var _this = _possibleConstructorReturn(this, (AdvAccordion.__proto__ || Object.getPrototypeOf(AdvAccordion)).apply(this, arguments)); _this.state = { currentAccordion: null }; return _this; } _createClass(AdvAccordion, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-accordion']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === "undefined" ? "undefined" : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: "render", value: function render() { var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes; var header = attributes.header, headerBgColor = attributes.headerBgColor, headerTextColor = attributes.headerTextColor, headerIcon = attributes.headerIcon, headerIconColor = attributes.headerIconColor, bodyBgColor = attributes.bodyBgColor, bodyTextColor = attributes.bodyTextColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, borderColor = attributes.borderColor, borderRadius = attributes.borderRadius, marginBottom = attributes.marginBottom, collapsedAll = attributes.collapsedAll; return React.createElement( Fragment, null, React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Notice', 'advanced-gutenberg') }, React.createElement( "p", { style: { color: '#ff0000', fontStyle: 'italic' } }, __("This accordion block has been replaced by a new and better one.\n This block will be removed in a future version.\n Please transform this to an Accordion Item block\n and drag them into new Adv. Accordion block as soon as possible.", 'advanced-gutenberg') ) ), React.createElement( PanelBody, { title: __('Accordion Settings', 'advanced-gutenberg') }, React.createElement(RangeControl, { label: __('Bottom spacing', 'advanced-gutenberg'), value: marginBottom, help: __('Define space to next block. This will override Block spacing option (Frontend view only)', 'advanced-gutenberg'), min: 0, max: 50, onChange: function onChange(value) { return setAttributes({ marginBottom: value }); } }) ), React.createElement( PanelBody, { title: __('Header Settings', 'advanced-gutenberg') }, React.createElement( BaseControl, { label: __('Header Icon Style', 'advanced-gutenberg') }, React.createElement( "div", { className: "advgb-icon-items-wrapper" }, Object.keys(HEADER_ICONS).map(function (key, index) { return React.createElement( "div", { className: "advgb-icon-item", key: index }, React.createElement( "span", { className: key === headerIcon ? 'active' : '', onClick: function onClick() { return setAttributes({ headerIcon: key }); } }, React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, HEADER_ICONS[key] ) ) ); }) ) ), React.createElement(PanelColorSettings, { title: __('Color Settings', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Background Color', 'advanced-gutenberg'), value: headerBgColor, onChange: function onChange(value) { return setAttributes({ headerBgColor: value === undefined ? '#000' : value }); } }, { label: __('Text Color', 'advanced-gutenberg'), value: headerTextColor, onChange: function onChange(value) { return setAttributes({ headerTextColor: value === undefined ? '#eee' : value }); } }, { label: __('Icon Color', 'advanced-gutenberg'), value: headerIconColor, onChange: function onChange(value) { return setAttributes({ headerIconColor: value === undefined ? '#fff' : value }); } }] }) ), React.createElement(PanelColorSettings, { title: __('Body Color Settings', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Background Color', 'advanced-gutenberg'), value: bodyBgColor, onChange: function onChange(value) { return setAttributes({ bodyBgColor: value }); } }, { label: __('Text Color', 'advanced-gutenberg'), value: bodyTextColor, onChange: function onChange(value) { return setAttributes({ bodyTextColor: value }); } }] }), React.createElement( PanelBody, { title: __('Border Settings', 'advanced-gutenberg'), initialOpen: false }, React.createElement(SelectControl, { label: __('Border Style', 'advanced-gutenberg'), value: borderStyle, options: [{ label: __('Solid', 'advanced-gutenberg'), value: 'solid' }, { label: __('Dashed', 'advanced-gutenberg'), value: 'dashed' }, { label: __('Dotted', 'advanced-gutenberg'), value: 'dotted' }], onChange: function onChange(value) { return setAttributes({ borderStyle: value }); } }), React.createElement(PanelColorSettings, { title: __('Color Settings', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Border Color', 'advanced-gutenberg'), value: borderColor, onChange: function onChange(value) { return setAttributes({ borderColor: value }); } }] }), React.createElement(RangeControl, { label: __('Border width', 'advanced-gutenberg'), value: borderWidth, min: 0, max: 10, onChange: function onChange(value) { return setAttributes({ borderWidth: value }); } }), React.createElement(RangeControl, { label: __('Border radius', 'advanced-gutenberg'), value: borderRadius, min: 0, max: 100, onChange: function onChange(value) { return setAttributes({ borderRadius: value }); } }) ), React.createElement( PanelBody, { title: __('Accordions State', 'advanced-gutenberg'), initialOpen: false }, React.createElement(ToggleControl, { label: __('Initial Collapsed', 'advanced-gutenberg'), help: __('Make all accordions collapsed by default, enable this setting to apply to all accordions.', 'advanced-gutenberg'), checked: collapsedAll, onChange: function onChange() { return setAttributes({ collapsedAll: !collapsedAll }); } }) ) ), React.createElement( "div", { className: "advgb-accordion-block" }, React.createElement( "div", { className: "advgb-accordion-header", style: { backgroundColor: headerBgColor, color: headerTextColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement( "span", { className: "advgb-accordion-header-icon" }, React.createElement( "svg", { fill: headerIconColor, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, HEADER_ICONS[headerIcon] ) ), React.createElement(RichText, { tagName: "h4", value: header, onChange: function onChange(value) { return setAttributes({ header: value }); }, unstableOnSplit: function unstableOnSplit() { return null; }, className: "advgb-accordion-header-title", placeholder: __('Enter header…', 'advanced-gutenberg') }) ), React.createElement( "div", { className: "advgb-accordion-body", style: { backgroundColor: bodyBgColor, color: bodyTextColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement(InnerBlocks, null) ) ) ); } }]); return AdvAccordion; }(Component); var accordionBlockIcon = React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "2 2 22 22" }, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("rect", { x: "3", y: "17", width: "18", height: "2" }), React.createElement("path", { d: "M19,12v1H5v-1H19 M21,10H3v5h18V10L21,10z" }), React.createElement("rect", { x: "3", y: "6", width: "18", height: "2" }) ); var accordionAttrs = { header: { type: 'string', default: 'Header text' }, headerBgColor: { type: 'string', default: '#000' }, headerTextColor: { type: 'string', default: '#eee' }, headerIcon: { type: 'string', default: 'unfold' }, headerIconColor: { type: 'string', default: '#fff' }, bodyBgColor: { type: 'string' }, bodyTextColor: { type: 'string' }, borderStyle: { type: 'string', default: 'solid' }, borderWidth: { type: 'number', default: 1 }, borderColor: { type: 'string' }, borderRadius: { type: 'number', default: 2 }, marginBottom: { type: 'number', default: 15 }, collapsedAll: { type: 'boolean', default: false }, changed: { type: 'boolean', default: false } }; registerBlockType('advgb/accordion', { title: __('Accordion (deprecated) - PublishPress', 'advanced-gutenberg'), description: __('Create a sliding accordion display for your content.', 'advanced-gutenberg'), icon: { src: accordionBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('accordion', 'advanced-gutenberg'), __('list', 'advanced-gutenberg'), __('faq', 'advanced-gutenberg')], attributes: accordionAttrs, supports: { inserter: false }, edit: AdvAccordion, save: function save(_ref) { var attributes = _ref.attributes; var header = attributes.header, headerBgColor = attributes.headerBgColor, headerTextColor = attributes.headerTextColor, headerIcon = attributes.headerIcon, headerIconColor = attributes.headerIconColor, bodyBgColor = attributes.bodyBgColor, bodyTextColor = attributes.bodyTextColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, borderColor = attributes.borderColor, borderRadius = attributes.borderRadius, marginBottom = attributes.marginBottom, collapsedAll = attributes.collapsedAll; return React.createElement( "div", { className: "advgb-accordion-block", style: { marginBottom: marginBottom }, "data-collapsed": collapsedAll ? collapsedAll : undefined }, React.createElement( "div", { className: "advgb-accordion-header", style: { backgroundColor: headerBgColor, color: headerTextColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement( "span", { className: "advgb-accordion-header-icon" }, React.createElement( "svg", { fill: headerIconColor, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, HEADER_ICONS[headerIcon] ) ), React.createElement( "h4", { className: "advgb-accordion-header-title" }, header ) ), React.createElement( "div", { className: "advgb-accordion-body", style: { backgroundColor: bodyBgColor, color: bodyTextColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement(InnerBlocks.Content, null) ) ); }, deprecated: [{ attributes: _extends({}, accordionAttrs, { borderWidth: { type: 'number', default: 0 } }), save: function save(_ref2) { var attributes = _ref2.attributes; var header = attributes.header, headerBgColor = attributes.headerBgColor, headerTextColor = attributes.headerTextColor, headerIcon = attributes.headerIcon, headerIconColor = attributes.headerIconColor, bodyBgColor = attributes.bodyBgColor, bodyTextColor = attributes.bodyTextColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, borderColor = attributes.borderColor, borderRadius = attributes.borderRadius, marginBottom = attributes.marginBottom, collapsedAll = attributes.collapsedAll; return React.createElement( "div", { className: "advgb-accordion-block", style: { marginBottom: marginBottom }, "data-collapsed": collapsedAll ? collapsedAll : undefined }, React.createElement( "div", { className: "advgb-accordion-header", style: { backgroundColor: headerBgColor, color: headerTextColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement( "span", { className: "advgb-accordion-header-icon" }, React.createElement( "svg", { fill: headerIconColor, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, HEADER_ICONS[headerIcon] ) ), React.createElement( "h4", { className: "advgb-accordion-header-title" }, header ) ), React.createElement( "div", { className: "advgb-accordion-body", style: { backgroundColor: bodyBgColor, color: bodyTextColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement(InnerBlocks.Content, null) ) ); }, supports: { inserter: false } }], transforms: { to: [{ type: 'block', blocks: ['advgb/accordions'], transform: function transform(attributes, innerBlocks) { var accordion = createBlock('advgb/accordion-item', _extends({}, attributes, { changed: false }), innerBlocks); return createBlock('advgb/accordions', _extends({}, attributes, { header: undefined, needUpdate: false }), [accordion]); } }] } }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/advaccordion/accordion.jsx": /*!******************************************************!*\ !*** ./src/assets/blocks/advaccordion/accordion.jsx ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents, wpCompose) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Fragment = wpElement.Fragment, Component = wpElement.Component; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, RichText = _wpBlockEditor.RichText, InnerBlocks = _wpBlockEditor.InnerBlocks, InspectorControls = _wpBlockEditor.InspectorControls, PanelColorSettings = _wpBlockEditor.PanelColorSettings; var RangeControl = wpComponents.RangeControl, PanelBody = wpComponents.PanelBody, BaseControl = wpComponents.BaseControl, SelectControl = wpComponents.SelectControl, ToggleControl = wpComponents.ToggleControl; var _wp$data = wp.data, withDispatch = _wp$data.withDispatch, select = _wp$data.select; var compose = wpCompose.compose; var _lodash = lodash, times = _lodash.times; var HEADER_ICONS = { plus: React.createElement( Fragment, null, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6V13z" }) ), plusCircle: React.createElement( Fragment, null, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M12,2C6.48,2,2,6.48,2,12s4.48,10,10,10s10-4.48,10-10S17.52,2,12,2z M17,13h-4v4h-2v-4H7v-2h4V7h2v4h4V13z" }) ), plusCircleOutline: React.createElement( Fragment, null, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M13,7h-2v4H7v2h4v4h2v-4h4v-2h-4V7z M12,2C6.48,2,2,6.48,2,12s4.48,10,10,10s10-4.48,10-10S17.52,2,12,2z M12,20 c-4.41,0-8-3.59-8-8s3.59-8,8-8s8,3.59,8,8S16.41,20,12,20z" }) ), plusBox: React.createElement( Fragment, null, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M19,3H5C3.89,3,3,3.9,3,5v14c0,1.1,0.89,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3z M19,19H5V5h14V19z" }), React.createElement("polygon", { points: "11,17 13,17 13,13 17,13 17,11 13,11 13,7 11,7 11,11 7,11 7,13 11,13" }) ), unfold: React.createElement( Fragment, null, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M12,5.83L15.17,9l1.41-1.41L12,3L7.41,7.59L8.83,9L12,5.83z M12,18.17L8.83,15l-1.41,1.41L12,21l4.59-4.59L15.17,15 L12,18.17z" }) ), threeDots: React.createElement( Fragment, null, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M6,10c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S7.1,10,6,10z M18,10c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S19.1,10,18,10z M12,10c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S13.1,10,12,10z" }) ), arrowDown: React.createElement( Fragment, null, React.createElement("path", { opacity: "0.87", fill: "none", d: "M24,24H0L0,0l24,0V24z" }), React.createElement("path", { d: "M16.59,8.59L12,13.17L7.41,8.59L6,10l6,6l6-6L16.59,8.59z" }) ) }; var AccordionItemEdit = function (_Component) { _inherits(AccordionItemEdit, _Component); function AccordionItemEdit() { _classCallCheck(this, AccordionItemEdit); return _possibleConstructorReturn(this, (AccordionItemEdit.__proto__ || Object.getPrototypeOf(AccordionItemEdit)).apply(this, arguments)); } _createClass(AccordionItemEdit, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes, clientId = _props.clientId; // Apply parent style if newly inserted if (attributes.changed !== true) { var _ref = !wp.blockEditor ? select('core/editor') : select('core/block-editor'), getBlockRootClientId = _ref.getBlockRootClientId, getBlockAttributes = _ref.getBlockAttributes; var rootBlockId = getBlockRootClientId(clientId); var rootBlockAttrs = getBlockAttributes(rootBlockId); if (rootBlockAttrs !== null && rootBlockAttrs.needUpdate !== false) { Object.keys(rootBlockAttrs).map(function (attribute) { attributes[attribute] = rootBlockAttrs[attribute]; }); // Done applied, we will not do this again setAttributes({ changed: true }); } } } }, { key: "render", value: function render() { var _this2 = this; var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes; var header = attributes.header, headerBgColor = attributes.headerBgColor, headerTextColor = attributes.headerTextColor, headerIcon = attributes.headerIcon, headerIconColor = attributes.headerIconColor, bodyBgColor = attributes.bodyBgColor, bodyTextColor = attributes.bodyTextColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, borderColor = attributes.borderColor, borderRadius = attributes.borderRadius, marginBottom = attributes.marginBottom, collapsedAll = attributes.collapsedAll, headerTag = attributes.headerTag; var htmlTags = [{ label: 'h1', value: 'h1' }, { label: 'h2', value: 'h2' }, { label: 'h3', value: 'h3' }, { label: 'h4', value: 'h4' }, { label: 'h5', value: 'h5' }, { label: 'h6', value: 'h6' }]; return React.createElement( Fragment, null, React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Accordion Settings', 'advanced-gutenberg') }, React.createElement(RangeControl, { label: __('Bottom spacing', 'advanced-gutenberg'), value: marginBottom, help: __('Define space between each accordion (Frontend view only)', 'advanced-gutenberg'), min: 0, max: 50, onChange: function onChange(value) { return _this2.props.updateRootBlockAttrs({ marginBottom: value }); } }), React.createElement(ToggleControl, { label: __('Initial Collapsed', 'advanced-gutenberg'), help: __('Make all accordions collapsed by default.', 'advanced-gutenberg'), checked: collapsedAll, onChange: function onChange() { return _this2.props.updateRootBlockAttrs({ collapsedAll: !collapsedAll }); } }), React.createElement(SelectControl, { label: __('Header Tag', 'advanced-gutenberg'), value: headerTag, options: htmlTags, onChange: function onChange(value) { return setAttributes({ headerTag: value }); } }) ), React.createElement( PanelBody, { title: __('Header Settings', 'advanced-gutenberg') }, React.createElement( BaseControl, { label: __('Header Icon Style', 'advanced-gutenberg') }, React.createElement( "div", { className: "advgb-icon-items-wrapper" }, Object.keys(HEADER_ICONS).map(function (key, index) { return React.createElement( "div", { className: "advgb-icon-item", key: index }, React.createElement( "span", { className: key === headerIcon ? 'active' : '', onClick: function onClick() { return _this2.props.updateRootBlockAttrs({ headerIcon: key }); } }, React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, HEADER_ICONS[key] ) ) ); }) ) ), React.createElement(PanelColorSettings, { title: __('Color Settings', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Background Color', 'advanced-gutenberg'), value: headerBgColor, onChange: function onChange(value) { return _this2.props.updateRootBlockAttrs({ headerBgColor: value === undefined ? '#000' : value }); } }, { label: __('Text Color', 'advanced-gutenberg'), value: headerTextColor, onChange: function onChange(value) { return _this2.props.updateRootBlockAttrs({ headerTextColor: value === undefined ? '#eee' : value }); } }, { label: __('Icon Color', 'advanced-gutenberg'), value: headerIconColor, onChange: function onChange(value) { return _this2.props.updateRootBlockAttrs({ headerIconColor: value === undefined ? '#fff' : value }); } }] }) ), React.createElement(PanelColorSettings, { title: __('Body Color Settings', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Background Color', 'advanced-gutenberg'), value: bodyBgColor, onChange: function onChange(value) { return _this2.props.updateRootBlockAttrs({ bodyBgColor: value }); } }, { label: __('Text Color', 'advanced-gutenberg'), value: bodyTextColor, onChange: function onChange(value) { return _this2.props.updateRootBlockAttrs({ bodyTextColor: value }); } }] }), React.createElement( PanelBody, { title: __('Border Settings', 'advanced-gutenberg'), initialOpen: false }, React.createElement(SelectControl, { label: __('Border Style', 'advanced-gutenberg'), value: borderStyle, options: [{ label: __('Solid', 'advanced-gutenberg'), value: 'solid' }, { label: __('Dashed', 'advanced-gutenberg'), value: 'dashed' }, { label: __('Dotted', 'advanced-gutenberg'), value: 'dotted' }], onChange: function onChange(value) { return _this2.props.updateRootBlockAttrs({ borderStyle: value }); } }), React.createElement(PanelColorSettings, { title: __('Color Settings', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Border Color', 'advanced-gutenberg'), value: borderColor, onChange: function onChange(value) { return _this2.props.updateRootBlockAttrs({ borderColor: value }); } }] }), React.createElement(RangeControl, { label: __('Border width', 'advanced-gutenberg'), value: borderWidth, min: 0, max: 10, onChange: function onChange(value) { return _this2.props.updateRootBlockAttrs({ borderWidth: value }); } }), React.createElement(RangeControl, { label: __('Border radius', 'advanced-gutenberg'), value: borderRadius, min: 0, max: 100, onChange: function onChange(value) { return _this2.props.updateRootBlockAttrs({ borderRadius: value }); } }) ) ), React.createElement( "div", { className: "advgb-accordion-item" }, React.createElement( "div", { className: "advgb-accordion-header", style: { backgroundColor: headerBgColor, color: headerTextColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement( "span", { className: "advgb-accordion-header-icon" }, React.createElement( "svg", { fill: headerIconColor, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, HEADER_ICONS[headerIcon] ) ), React.createElement(RichText, { tagName: headerTag, value: header, onChange: function onChange(value) { return setAttributes({ header: value }); }, unstableOnSplit: function unstableOnSplit() { return null; }, className: "advgb-accordion-header-title", placeholder: __('Enter header…', 'advanced-gutenberg'), style: { color: 'inherit' }, allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough', 'core/text-color'] }) ), React.createElement( "div", { className: "advgb-accordion-body", style: { backgroundColor: bodyBgColor, color: bodyTextColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement(InnerBlocks, null) ) ) ); } }]); return AccordionItemEdit; }(Component); var accordionBlockIcon = React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "2 2 22 22" }, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("rect", { x: "3", y: "17", width: "18", height: "2" }), React.createElement("path", { d: "M19,12v1H5v-1H19 M21,10H3v5h18V10L21,10z" }), React.createElement("rect", { x: "3", y: "6", width: "18", height: "2" }) ); registerBlockType('advgb/accordion-item', { title: __('Accordion Item - PublishPress', 'advanced-gutenberg'), description: __('Create a sliding accordion display for your content.', 'advanced-gutenberg'), icon: { src: accordionBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, parent: ['advgb/accordions'], category: 'advgb-category', keywords: [__('accordion', 'advanced-gutenberg'), __('list', 'advanced-gutenberg'), __('faq', 'advanced-gutenberg')], attributes: { header: { type: 'string', default: __('Header text', 'advanced-gutenberg') }, headerBgColor: { type: 'string', default: '#000' }, headerTextColor: { type: 'string', default: '#eee' }, headerIcon: { type: 'string', default: 'unfold' }, headerIconColor: { type: 'string', default: '#fff' }, bodyBgColor: { type: 'string' }, bodyTextColor: { type: 'string' }, borderStyle: { type: 'string', default: 'solid' }, borderWidth: { type: 'number', default: 1 }, borderColor: { type: 'string' }, borderRadius: { type: 'number', default: 2 }, marginBottom: { type: 'number', default: 15 }, collapsedAll: { type: 'boolean', default: false }, headerTag: { type: 'string', default: 'h4' }, changed: { type: 'boolean', default: false }, rootBlockId: { type: 'string', default: '' } }, supports: { anchor: true }, edit: compose([withDispatch(function (dispatch, _ref2, _ref3) { var clientId = _ref2.clientId; var select = _ref3.select; var _select = select('core/block-editor'), getBlockRootClientId = _select.getBlockRootClientId, getBlocksByClientId = _select.getBlocksByClientId; var _dispatch = dispatch('core/block-editor'), updateBlockAttributes = _dispatch.updateBlockAttributes; var rootID = getBlockRootClientId(clientId); var accordionBlock = getBlocksByClientId(rootID); return { updateRootBlockAttrs: function updateRootBlockAttrs(attrs) { updateBlockAttributes(rootID, attrs); times(accordionBlock[0].innerBlocks.length, function (n) { updateBlockAttributes(accordionBlock[0].innerBlocks[n].clientId, attrs); }); } }; })])(AccordionItemEdit), save: function save(_ref4) { var attributes = _ref4.attributes; var header = attributes.header, headerBgColor = attributes.headerBgColor, headerTextColor = attributes.headerTextColor, headerIcon = attributes.headerIcon, headerIconColor = attributes.headerIconColor, bodyBgColor = attributes.bodyBgColor, bodyTextColor = attributes.bodyTextColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, borderColor = attributes.borderColor, borderRadius = attributes.borderRadius, marginBottom = attributes.marginBottom, headerTag = attributes.headerTag; return React.createElement( "div", { className: "advgb-accordion-item", style: { marginBottom: marginBottom } }, React.createElement( "div", { className: "advgb-accordion-header", style: { backgroundColor: headerBgColor, color: headerTextColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: !!borderRadius ? borderRadius + 'px' : undefined } }, React.createElement( "span", { className: "advgb-accordion-header-icon" }, React.createElement( "svg", { fill: headerIconColor, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, HEADER_ICONS[headerIcon] ) ), React.createElement(RichText.Content, { tagName: headerTag, className: "advgb-accordion-header-title", style: { color: 'inherit' }, value: header }) ), React.createElement( "div", { className: "advgb-accordion-body", style: { backgroundColor: bodyBgColor, color: bodyTextColor, borderStyle: borderStyle + ' !important', borderWidth: borderWidth + 'px !important', borderColor: borderColor + ' !important', borderTop: 'none !important', borderRadius: !!borderRadius ? borderRadius + 'px !important' : undefined } }, React.createElement(InnerBlocks.Content, null) ) ); }, deprecated: [{ attributes: { header: { type: 'string', default: 'Header text' }, headerBgColor: { type: 'string', default: '#000' }, headerTextColor: { type: 'string', default: '#eee' }, headerIcon: { type: 'string', default: 'unfold' }, headerIconColor: { type: 'string', default: '#fff' }, bodyBgColor: { type: 'string' }, bodyTextColor: { type: 'string' }, borderStyle: { type: 'string', default: 'solid' }, borderWidth: { type: 'number', default: 0 }, borderColor: { type: 'string' }, borderRadius: { type: 'number', default: 2 }, marginBottom: { type: 'number', default: 15 }, collapsedAll: { type: 'boolean', default: false }, changed: { type: 'boolean', default: false }, rootBlockId: { type: 'string', default: '' } }, save: function save(_ref5) { var attributes = _ref5.attributes; var header = attributes.header, headerBgColor = attributes.headerBgColor, headerTextColor = attributes.headerTextColor, headerIcon = attributes.headerIcon, headerIconColor = attributes.headerIconColor, bodyBgColor = attributes.bodyBgColor, bodyTextColor = attributes.bodyTextColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, borderColor = attributes.borderColor, borderRadius = attributes.borderRadius, marginBottom = attributes.marginBottom; return React.createElement( "div", { className: "advgb-accordion-item", style: { marginBottom: marginBottom } }, React.createElement( "div", { className: "advgb-accordion-header", style: { backgroundColor: headerBgColor, color: headerTextColor, borderStyle: borderStyle, borderWidth: !!borderWidth ? borderWidth + 'px' : undefined, borderColor: borderColor, borderRadius: !!borderRadius ? borderRadius + 'px' : undefined } }, React.createElement( "span", { className: "advgb-accordion-header-icon" }, React.createElement( "svg", { fill: headerIconColor, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, HEADER_ICONS[headerIcon] ) ), React.createElement( "h4", { className: "advgb-accordion-header-title", style: { color: 'inherit' } }, header ) ), React.createElement( "div", { className: "advgb-accordion-body", style: { backgroundColor: bodyBgColor, color: bodyTextColor, borderStyle: borderStyle + ' !important', borderWidth: !!borderWidth ? borderWidth + 'px !important' : undefined, borderColor: borderColor + ' !important', borderTop: 'none !important', borderRadius: !!borderRadius ? borderRadius + 'px !important' : undefined } }, React.createElement(InnerBlocks.Content, null) ) ); }, supports: { anchor: true } }, { attributes: { header: { type: 'string', default: 'Header text' }, headerBgColor: { type: 'string', default: '#000' }, headerTextColor: { type: 'string', default: '#eee' }, headerIcon: { type: 'string', default: 'unfold' }, headerIconColor: { type: 'string', default: '#fff' }, bodyBgColor: { type: 'string' }, bodyTextColor: { type: 'string' }, borderStyle: { type: 'string', default: 'solid' }, borderWidth: { type: 'number', default: 0 }, borderColor: { type: 'string' }, borderRadius: { type: 'number', default: 2 }, marginBottom: { type: 'number', default: 15 }, collapsedAll: { type: 'boolean', default: false }, changed: { type: 'boolean', default: false }, rootBlockId: { type: 'string', default: '' } }, save: function save(_ref6) { var attributes = _ref6.attributes; var header = attributes.header, headerBgColor = attributes.headerBgColor, headerTextColor = attributes.headerTextColor, headerIcon = attributes.headerIcon, headerIconColor = attributes.headerIconColor, bodyBgColor = attributes.bodyBgColor, bodyTextColor = attributes.bodyTextColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, borderColor = attributes.borderColor, borderRadius = attributes.borderRadius, marginBottom = attributes.marginBottom; return React.createElement( "div", { className: "advgb-accordion-item", style: { marginBottom: marginBottom } }, React.createElement( "div", { className: "advgb-accordion-header", style: { backgroundColor: headerBgColor, color: headerTextColor, borderStyle: borderStyle, borderWidth: !!borderWidth ? borderWidth + 'px' : undefined, borderColor: borderColor, borderRadius: !!borderRadius ? borderRadius + 'px' : undefined } }, React.createElement( "span", { className: "advgb-accordion-header-icon" }, React.createElement( "svg", { fill: headerIconColor, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, HEADER_ICONS[headerIcon] ) ), React.createElement( "h4", { className: "advgb-accordion-header-title", style: { color: 'inherit' } }, header ) ), React.createElement( "div", { className: "advgb-accordion-body", style: { backgroundColor: bodyBgColor, color: bodyTextColor, borderStyle: borderStyle, borderWidth: !!borderWidth ? borderWidth + 'px' : undefined, borderColor: borderColor, borderRadius: !!borderRadius ? borderRadius + 'px' : undefined } }, React.createElement(InnerBlocks.Content, null) ) ); } }] }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components, wp.compose); /***/ }), /***/ "./src/assets/blocks/advaccordion/block.jsx": /*!**************************************************!*\ !*** ./src/assets/blocks/advaccordion/block.jsx ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents, wpCompose) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, BlockControls = _wpBlockEditor.BlockControls, PanelColorSettings = _wpBlockEditor.PanelColorSettings, InnerBlocks = _wpBlockEditor.InnerBlocks; var RangeControl = wpComponents.RangeControl, PanelBody = wpComponents.PanelBody, BaseControl = wpComponents.BaseControl, SelectControl = wpComponents.SelectControl, ToggleControl = wpComponents.ToggleControl, ToolbarGroup = wpComponents.ToolbarGroup, ToolbarButton = wpComponents.ToolbarButton; var _wp$data = wp.data, withDispatch = _wp$data.withDispatch, select = _wp$data.select, dispatch = _wp$data.dispatch; var compose = wpCompose.compose; var _lodash = lodash, times = _lodash.times; var HEADER_ICONS = { plus: React.createElement( Fragment, null, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6V13z" }) ), plusCircle: React.createElement( Fragment, null, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M12,2C6.48,2,2,6.48,2,12s4.48,10,10,10s10-4.48,10-10S17.52,2,12,2z M17,13h-4v4h-2v-4H7v-2h4V7h2v4h4V13z" }) ), plusCircleOutline: React.createElement( Fragment, null, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M13,7h-2v4H7v2h4v4h2v-4h4v-2h-4V7z M12,2C6.48,2,2,6.48,2,12s4.48,10,10,10s10-4.48,10-10S17.52,2,12,2z M12,20 c-4.41,0-8-3.59-8-8s3.59-8,8-8s8,3.59,8,8S16.41,20,12,20z" }) ), plusBox: React.createElement( Fragment, null, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M19,3H5C3.89,3,3,3.9,3,5v14c0,1.1,0.89,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3z M19,19H5V5h14V19z" }), React.createElement("polygon", { points: "11,17 13,17 13,13 17,13 17,11 13,11 13,7 11,7 11,11 7,11 7,13 11,13" }) ), unfold: React.createElement( Fragment, null, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M12,5.83L15.17,9l1.41-1.41L12,3L7.41,7.59L8.83,9L12,5.83z M12,18.17L8.83,15l-1.41,1.41L12,21l4.59-4.59L15.17,15 L12,18.17z" }) ), threeDots: React.createElement( Fragment, null, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M6,10c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S7.1,10,6,10z M18,10c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S19.1,10,18,10z M12,10c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S13.1,10,12,10z" }) ), arrowDown: React.createElement( Fragment, null, React.createElement("path", { opacity: "0.87", fill: "none", d: "M24,24H0L0,0l24,0V24z" }), React.createElement("path", { d: "M16.59,8.59L12,13.17L7.41,8.59L6,10l6,6l6-6L16.59,8.59z" }) ) }; var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAADzCAYAAACv4wv1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADZ9JREFUeNrsnd+L3Fwdh5PM/t7Z3emWoggFERHeK6/t0irFBS3UXgi9sb0Q7GW96J9QvRZ6UV57p+8rQsE/oFQogtBS9A8QS6UU1lK923ZndnZnEvMdJq/p2ZNMkkkyyTnPA2G77ezMdjLP+X7Oj5w4DgAAAAAAAAAAAAAAlINb5ZMvLS3xDgPkYDQaNVf0UGi3rtcCMJBg1r/P2wC4c8it+3kXuQFKlT4oQ3q3gOBJMrsID1C64EHCY3IJ7+YQXCezmyC7i+AAc8keaL6ekT+UPShNdEVyVxFdPdJER3yA7JVc/bN6ZK7ubgHJoz97CaJ7VHWAuaRPEtvXiB5kkT3L/FdaBY9k9+7fv791+/btve3t7e+G3y9PXjkI3OlXTiFAmmTuRJXx0dHRv54+ffrXO3fuvFfE9pVGIPo315k9ap9ebWMDbzrBJ8fjx4+/vr+///PNzc1feJ73NU4ZwJxlPQg+9vv9Pz1//vzza9eu/XMqtR+Te6wRPrWq5xXdix9hy/Oty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rTw5se8ped6dfl1dXVlYODg4c7Ozs/4RQAVEtYVP9z/vz5H/T7/RP5NjxOY4d8P54e/vQIwp8JUiu67MY6o7JLdPdfvHjx+zC+sw8zQLWMX79+/YdQ8nGsPx7MiPBz9dGDqLWQ4/r163979erVr33f5+4KABXx5s2b3928efMLjeSq8KmDch2t/Z7nxmK9qxxe9PXZs2f/uHLlyn8vXLjwPdd12boVoCQkLb99+/bL/f39B2FBHcbi+VgT1X1V/LAAp/fRp/10Ve5O7Jj006dfJ8elS5e6jx49+tnFixd/vLGx8VkoPXs/AeTHPz4+fvvu3bu/PHz48I8PHjw4iAk9Ug5d/zyI9dEzi+44nw7IqbKrR/QYT2kkACB79zjeTfY1oo+d5EG4ryq7KvpSygu6Svb3Y/L6yi/iKr+kTnSkB0gXXPUtLrr61XeSB+fOFm/dX0proOy8qj5h9IKfdO2n/xYlAIeqDlComscHvuN98pEupquy62bOljK+uBt74qTHdWKiu1R1gMLVPFBSs69IrhuE0z1fJtHV+K62NrqKHw3cqZIjOECx6B6P8Gkj7flWxn3SCnw6KKeulks64lNwDhUdIJPgui5yFN2DGdU8HttzV/R4VY//sK+JGLMkR3CAfH10ta/uZ+ibJ1b1VNGng3I62Z1YfHeV6O4T2wFK7asHKYIHaX3zXFE6dqGLo0jsxb7qYj6RHWA+0bMseQ0SrlHJL6BGdidFbqo5wPyyOymVO7PkuUVUZJ8lfuHXAbBccidN7PhjskheWMAU4ZOeE9EBiomu/besgpciYGz1nFv1awFYJHniY/IKXrp8ypJZ5AYoQfiiYgOAhfxPgAEAOtkwFDbwrbIAAAAASUVORK5CYII='; var AccordionsEdit = function (_Component) { _inherits(AccordionsEdit, _Component); function AccordionsEdit() { _classCallCheck(this, AccordionsEdit); var _this = _possibleConstructorReturn(this, (AccordionsEdit.__proto__ || Object.getPrototypeOf(AccordionsEdit)).apply(this, arguments)); _this.updateAccordionAttrs = _this.updateAccordionAttrs.bind(_this); return _this; } _createClass(AccordionsEdit, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-accordions']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === "undefined" ? "undefined" : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: "componentDidMount", value: function componentDidMount() { var _props2 = this.props, setAttributes = _props2.setAttributes, clientId = _props2.clientId; setAttributes({ rootBlockId: clientId }); this.props.updateAccordionAttributes({ rootBlockId: clientId }); } }, { key: "componentDidUpdate", value: function componentDidUpdate() { var clientId = this.props.clientId; var _ref = !wp.blockEditor ? dispatch('core/editor') : dispatch('core/block-editor'), removeBlock = _ref.removeBlock; var _ref2 = !wp.blockEditor ? select('core/editor') : select('core/block-editor'), getBlockOrder = _ref2.getBlockOrder; var childBlocks = getBlockOrder(clientId); if (childBlocks.length < 1) { // No accordion left, we will remove this block // removeBlock(clientId); } } }, { key: "updateAccordionAttrs", value: function updateAccordionAttrs(attrs) { var _props3 = this.props, setAttributes = _props3.setAttributes, clientId = _props3.clientId; var _ref3 = !wp.blockEditor ? dispatch('core/editor') : dispatch('core/block-editor'), updateBlockAttributes = _ref3.updateBlockAttributes; var _ref4 = !wp.blockEditor ? select('core/editor') : select('core/block-editor'), getBlockOrder = _ref4.getBlockOrder; var childBlocks = getBlockOrder(clientId); setAttributes(attrs); childBlocks.forEach(function (childBlockId) { return updateBlockAttributes(childBlockId, attrs); }); } }, { key: "resyncAccordions", value: function resyncAccordions() { var _props4 = this.props, attributes = _props4.attributes, clientId = _props4.clientId; var _ref5 = !wp.blockEditor ? dispatch('core/editor') : dispatch('core/block-editor'), updateBlockAttributes = _ref5.updateBlockAttributes; var _ref6 = !wp.blockEditor ? select('core/editor') : select('core/block-editor'), getBlockOrder = _ref6.getBlockOrder; var childBlocks = getBlockOrder(clientId); childBlocks.forEach(function (childBlockId) { return updateBlockAttributes(childBlockId, attributes); }); } }, { key: "render", value: function render() { var _this2 = this; var _props5 = this.props, attributes = _props5.attributes, setAttributes = _props5.setAttributes; var headerBgColor = attributes.headerBgColor, headerTextColor = attributes.headerTextColor, headerIcon = attributes.headerIcon, headerIconColor = attributes.headerIconColor, bodyBgColor = attributes.bodyBgColor, bodyTextColor = attributes.bodyTextColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, borderColor = attributes.borderColor, borderRadius = attributes.borderRadius, marginBottom = attributes.marginBottom, collapsedAll = attributes.collapsedAll, isPreview = attributes.isPreview; return isPreview ? React.createElement("img", { alt: __('Advanced Accordion', 'advanced-gutenberg'), width: "100%", src: previewImageData }) : React.createElement( Fragment, null, React.createElement( BlockControls, null, React.createElement( ToolbarGroup, null, React.createElement(ToolbarButton, { icon: "update", onClick: function onClick() { return _this2.resyncAccordions(); }, label: __('Refresh', 'advanced-gutenberg') }) ) ), React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Accordion Settings', 'advanced-gutenberg') }, React.createElement(RangeControl, { label: __('Bottom spacing', 'advanced-gutenberg'), value: marginBottom, help: __('Define space between each accordion (Frontend view only)', 'advanced-gutenberg'), min: 0, max: 50, onChange: function onChange(value) { return _this2.updateAccordionAttrs({ marginBottom: value }); } }), React.createElement(ToggleControl, { label: __('Initial Collapsed', 'advanced-gutenberg'), help: __('Make all accordions collapsed by default.', 'advanced-gutenberg'), checked: collapsedAll, onChange: function onChange() { setAttributes({ collapsedAll: !collapsedAll }); _this2.props.updateAccordionAttributes({ collapsedAll: !collapsedAll }); } }) ), React.createElement( PanelBody, { title: __('Header Settings', 'advanced-gutenberg') }, React.createElement( BaseControl, { label: __('Header Icon Style', 'advanced-gutenberg') }, React.createElement( "div", { className: "advgb-icon-items-wrapper" }, Object.keys(HEADER_ICONS).map(function (key, index) { return React.createElement( "div", { className: "advgb-icon-item", key: index }, React.createElement( "span", { className: key === headerIcon ? 'active' : '', onClick: function onClick() { return _this2.updateAccordionAttrs({ headerIcon: key }); } }, React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, HEADER_ICONS[key] ) ) ); }) ) ), React.createElement(PanelColorSettings, { title: __('Color Settings', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Background Color', 'advanced-gutenberg'), value: headerBgColor, onChange: function onChange(value) { return _this2.updateAccordionAttrs({ headerBgColor: value === undefined ? '#000' : value }); } }, { label: __('Text Color', 'advanced-gutenberg'), value: headerTextColor, onChange: function onChange(value) { return _this2.updateAccordionAttrs({ headerTextColor: value === undefined ? '#eee' : value }); } }, { label: __('Icon Color', 'advanced-gutenberg'), value: headerIconColor, onChange: function onChange(value) { return _this2.updateAccordionAttrs({ headerIconColor: value === undefined ? '#fff' : value }); } }] }) ), React.createElement(PanelColorSettings, { title: __('Body Color Settings', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Background Color', 'advanced-gutenberg'), value: bodyBgColor, onChange: function onChange(value) { return _this2.updateAccordionAttrs({ bodyBgColor: value }); } }, { label: __('Text Color', 'advanced-gutenberg'), value: bodyTextColor, onChange: function onChange(value) { return _this2.updateAccordionAttrs({ bodyTextColor: value }); } }] }), React.createElement( PanelBody, { title: __('Border Settings', 'advanced-gutenberg'), initialOpen: false }, React.createElement(SelectControl, { label: __('Border Style', 'advanced-gutenberg'), value: borderStyle, options: [{ label: __('Solid', 'advanced-gutenberg'), value: 'solid' }, { label: __('Dashed', 'advanced-gutenberg'), value: 'dashed' }, { label: __('Dotted', 'advanced-gutenberg'), value: 'dotted' }], onChange: function onChange(value) { return _this2.updateAccordionAttrs({ borderStyle: value }); } }), React.createElement(PanelColorSettings, { title: __('Color Settings', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Border Color', 'advanced-gutenberg'), value: borderColor, onChange: function onChange(value) { return _this2.updateAccordionAttrs({ borderColor: value }); } }] }), React.createElement(RangeControl, { label: __('Border width', 'advanced-gutenberg'), value: borderWidth, min: 0, max: 10, onChange: function onChange(value) { return _this2.updateAccordionAttrs({ borderWidth: value }); } }), React.createElement(RangeControl, { label: __('Border radius', 'advanced-gutenberg'), value: borderRadius, min: 0, max: 100, onChange: function onChange(value) { return _this2.updateAccordionAttrs({ borderRadius: value }); } }) ) ), React.createElement( "div", { className: "advgb-accordions-wrapper" }, React.createElement(InnerBlocks, { template: [['advgb/accordion-item']], templateLock: false, allowedBlocks: ['advgb/accordion-item'] }) ) ); } }]); return AccordionsEdit; }(Component); var accordionBlockIcon = React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "2 2 22 22" }, React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }), React.createElement("path", { d: "M2 20h20v-4H2v4zm2-3h2v2H4v-2zM2 4v4h20V4H2zm4 3H4V5h2v2zm-4 7h20v-4H2v4zm2-3h2v2H4v-2z" }) ); var blockAttrs = { headerBgColor: { type: 'string', default: '#000' }, headerTextColor: { type: 'string', default: '#eee' }, headerIcon: { type: 'string', default: 'unfold' }, headerIconColor: { type: 'string', default: '#fff' }, bodyBgColor: { type: 'string' }, bodyTextColor: { type: 'string' }, borderStyle: { type: 'string', default: 'solid' }, borderWidth: { type: 'number', default: 1 }, borderColor: { type: 'string' }, borderRadius: { type: 'number', default: 2 }, marginBottom: { type: 'number', default: 15 }, collapsedAll: { type: 'boolean', default: false }, changed: { type: 'boolean', default: false }, needUpdate: { type: 'boolean', default: true }, isPreview: { type: 'boolean', default: false }, rootBlockId: { type: 'string', default: '' } }; registerBlockType('advgb/accordions', { title: __('Accordion - PublishPress', 'advanced-gutenberg'), description: __('Create a sliding accordion display for your content.', 'advanced-gutenberg'), icon: { src: accordionBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('accordion', 'advanced-gutenberg'), __('advanced accordion', 'advanced-gutenberg'), __('list', 'advanced-gutenberg'), __('faq', 'advanced-gutenberg')], attributes: blockAttrs, example: { attributes: { isPreview: true } }, edit: compose(withDispatch(function (dispatch, _ref7, _ref8) { var clientId = _ref7.clientId; var select = _ref8.select; var _select = select('core/block-editor'), getBlock = _select.getBlock; var _dispatch = dispatch('core/block-editor'), updateBlockAttributes = _dispatch.updateBlockAttributes; var block = getBlock(clientId); return { updateAccordionAttributes: function updateAccordionAttributes(attrs) { times(block.innerBlocks.length, function (n) { updateBlockAttributes(block.innerBlocks[n].clientId, attrs); }); } }; }))(AccordionsEdit), save: function save(_ref9) { var attributes = _ref9.attributes; var collapsedAll = attributes.collapsedAll; return React.createElement( "div", { className: "advgb-accordion-wrapper", "data-collapsed": collapsedAll ? collapsedAll : undefined }, React.createElement(InnerBlocks.Content, null) ); }, deprecated: [{ attributes: _extends({}, blockAttrs, { borderWidth: { type: 'number', default: 0 } }), save: function save(_ref10) { var attributes = _ref10.attributes; var collapsedAll = attributes.collapsedAll; return React.createElement( "div", { className: "advgb-accordion-wrapper", "data-collapsed": collapsedAll ? collapsedAll : undefined }, React.createElement(InnerBlocks.Content, null) ); } }, { attributes: _extends({}, blockAttrs, { rootBlockId: { type: 'string', default: '' } }), save: function save(_ref11) { var attributes = _ref11.attributes; var collapsedAll = attributes.collapsedAll; return React.createElement( "div", { className: "advgb-accordion-wrapper", "data-collapsed": collapsedAll ? collapsedAll : undefined }, React.createElement(InnerBlocks.Content, null) ); } }] }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components, wp.compose); /***/ }), /***/ "./src/assets/blocks/advbutton/block.jsx": /*!***********************************************!*\ !*** ./src/assets/blocks/advbutton/block.jsx ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _components = __webpack_require__(/*! ../0-adv-components/components.jsx */ "./src/assets/blocks/0-adv-components/components.jsx"); var _iconClass = __webpack_require__(/*! ../0-adv-components/icon-class.jsx */ "./src/assets/blocks/0-adv-components/icon-class.jsx"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType, createBlock = wpBlocks.createBlock; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, RichText = _wpBlockEditor.RichText, PanelColorSettings = _wpBlockEditor.PanelColorSettings, URLInput = _wpBlockEditor.URLInput; var BaseControl = wpComponents.BaseControl, RangeControl = wpComponents.RangeControl, PanelBody = wpComponents.PanelBody, ToggleControl = wpComponents.ToggleControl, SelectControl = wpComponents.SelectControl, Button = wpComponents.Button; // Preview style images var previewImageData = ''; var previewImageDataDefault = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAABoCAYAAADYQu11AAAJXUlEQVR4nO3dW4gVdRwH8K/t5obm4hWvaGhuLrgUeuxJ66kLBt0eukBB9Va9FNlLl5eCHoqoHuyxpB66PWhBgr4l9lJrUBqaoqR4RVNxU3JbKb7L/8jZ8X88M7u//8x/Zr4fOCC77tzO/zvzv80MRERERERERERERERERERERERERERERERERERERERERESkniZZ7vXg4GDog9gNYA2AVQD6AfQBuAXALAC97vcilkYAXADwF4A/AewHsBfALwB+dr8PptFomAUndjMBPAFgPYC7AExTMZYcdbsyyM9yAPe0rHoIwA4AWwF8CeBsrF/MDRFsQzv3AtgM4DiAjQAeUMglMtNcudzoyulmV26jE1vQ2ZR4GMBPALa5f/dEsF0infS48rrNVekftm4aT0RMQR9w1aDNrh0uUlYNV453uHJduBiCzjPhe65zY20E2yNiZa0r1+8WXTMtOui3AtgJYIN6zKWiWK5fdeX81qJ2scigsxNjl6vmiFRdw5X3B4rYz6KC/gyALW7sW6Quel25fybv/S0i6C8D+ERVdampblf+X85z9/MO+lMA3o9p2EGkAJNcDp7Oa9V5Bv1BAJsUcpFRzMGnLhfB5RX0FQA+B9Cl71jkqi6Xi/7QhySPoN8E4Bt1vIl4MRdfu5wEk0fQ3wKwUt+xSFvMx9shD0/ooA/k3bsoUlIvhZwuGzLok9xdPRpGE+mMOfk4VGd1yKCzN3FdwOWLVM1ad9ebuZBBf13FUCSz10IcslBBv0e3moqMSyPEwytCBf35QMsVqQPz/IQI+qyi7tARqYj17hl1ZkIE/XEAk1XiRMZtssuRmRBBf0jfr8iEmfa+W49xcxrf3cbLDG716tWpVnHlyhWcOnUKly9fxtmz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rUSnDKyd58Da6D7d3DYBVAPoB3AaAbwGYxTcBWT8aS8QNif3tPofda5I4ZfUX9x4DdSKLiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIjUG4D/AWML67DzayWbAAAAAElFTkSuQmCC'; var previewImageDataOutlined = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAABoCAYAAADYQu11AAAKkElEQVR4nO2de4wdVR3Hv2trFR+ktyVgSUS6QimJBMJd6gvwD7tKSyJIUpQIWpq4hYJParYUTQ1KH2J9JRTYP2ojUXQ30cVojd39p7UkSrnE+kgL0qViUiKRLuligAquOfodM0zO7Ny5e87MmbnfTzI5d++dOXPm7O8755zfeUEIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCdCc9Lp+62Wz6zsS5AC4BcDGA8wEsAXA2gIUATuXvQrjkFQAnADwH4CiAJwAcAvAYgAP83RutVsuZcEJnAYCPA1gJ4HIAb5UZiwKZSxs0x7kA+mO3ngKwD8BuAD8GcDzUf0zIQv8QgJsBrADwhtj3jwPYC+AggCcBPA3gHwAmAbxaYnpFPZkDoAHgNABnATgHwIUsdJYCuJLHtwD8CsC9APaElhOhVd1Neq4CsJFVdFC843xjmgw8NvuUCuGEM1kgfYwl/RxG+iiAuwA8BGB6NjdyVXV/nZNY3HABq0E/o8iPUfDmLXoFgF0SuQiMY7TLFbTT2/ldH+14H+26dEIQuqmW303nxqUAngVwK4DFALZI3KIiGDvdSru9lXZ8Ke36G4nmZ+GULXTT3tkPYD3TYto35wG4B8DJktMmRCecpP0aO95Bu/4S7fycsnK0TKEbB0aL1ZynALwPwDoAz5eYJiFcYez4FgDvpX330d6vLCOHyxL6agCj7PseZb/470pKixA+eYT2Hbf31UXneBlC/wKAnezauxPANSrFRc15nnZ+Jz3zO6mDwiha6NcD2M7Ppo9802y7H4SoCNO093VMrtHBDUUlvUihf4RdET18m91X4L2FCAVj91+kDr5PXXinKKG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{ var values = [attributes.noreferrer ? 'noreferrer' : '', attributes.nofollow ? 'nofollow' : ''].filter(Boolean).join(' '); return values; } var AdvButton = function (_Component) { _inherits(AdvButton, _Component); function AdvButton() { _classCallCheck(this, AdvButton); var _this = _possibleConstructorReturn(this, (AdvButton.__proto__ || Object.getPrototypeOf(AdvButton)).apply(this, arguments)); _this.state = { showPopup: false, iconSelected: '', selectedIcon: false, iconThemeSelected: 'outlined', selectedIconTheme: false }; _this.togglePopup = _this.togglePopup.bind(_this); _this.handleIcon = _this.handleIcon.bind(_this); _this.handleIconTheme = _this.handleIconTheme.bind(_this); return _this; } _createClass(AdvButton, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-button']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === "undefined" ? "undefined" : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: "componentDidMount", value: function componentDidMount() { var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes, clientId = _props2.clientId; setAttributes({ id: 'advgbbtn-' + clientId }); // Reset attributes when Pro is not available if (advgbBlocks.advgb_pro !== 'undefined' && advgbBlocks.advgb_pro !== '1') { setAttributes({ noreferrer: true, nofollow: false }); } } }, { key: "componentDidUpdate", value: function componentDidUpdate() { var _state = this.state, iconSelected = _state.iconSelected, selectedIcon = _state.selectedIcon, iconThemeSelected = _state.iconThemeSelected, selectedIconTheme = _state.selectedIconTheme; var _props3 = this.props, attributes = _props3.attributes, setAttributes = _props3.setAttributes; if (selectedIcon) { this.setState({ selectedIcon: false }); setAttributes({ icon: iconSelected, iconTheme: iconThemeSelected }); } if (selectedIconTheme) { this.setState({ selectedIconTheme: false }); setAttributes({ iconTheme: iconThemeSelected }); } } }, { key: "togglePopup", value: function togglePopup() { var showPopup = this.state.showPopup; this.setState({ showPopup: !showPopup }); } }, { key: "handleIcon", value: function handleIcon(iconValue) { this.setState({ iconSelected: iconValue, selectedIcon: true }); } }, { key: "handleIconTheme", value: function handleIconTheme(iconThemeValue) { this.setState({ iconThemeSelected: iconThemeValue, selectedIconTheme: true }); } }, { key: "render", value: function render() { var _this2 = this; var listBorderStyles = [{ label: __('None', 'advanced-gutenberg'), value: 'none' }, { label: __('Solid', 'advanced-gutenberg'), value: 'solid' }, { label: __('Dotted', 'advanced-gutenberg'), value: 'dotted' }, { label: __('Dashed', 'advanced-gutenberg'), value: 'dashed' }, { label: __('Double', 'advanced-gutenberg'), value: 'double' }, { label: __('Groove', 'advanced-gutenberg'), value: 'groove' }, { label: __('Ridge', 'advanced-gutenberg'), value: 'ridge' }, { label: __('Inset', 'advanced-gutenberg'), value: 'inset' }, { label: __('Outset', 'advanced-gutenberg'), value: 'outset' }]; var _props4 = this.props, attributes = _props4.attributes, setAttributes = _props4.setAttributes, isSelected = _props4.isSelected, className = _props4.className, blockID = _props4.clientId; var showPopup = this.state.showPopup; var id = attributes.id, align = attributes.align, url = attributes.url, urlOpenNewTab = attributes.urlOpenNewTab, title = attributes.title, text = attributes.text, bgColor = attributes.bgColor, textColor = attributes.textColor, textSize = attributes.textSize, marginTop = attributes.marginTop, marginRight = attributes.marginRight, marginBottom = attributes.marginBottom, marginLeft = attributes.marginLeft, paddingTop = attributes.paddingTop, paddingRight = attributes.paddingRight, paddingBottom = attributes.paddingBottom, paddingLeft = attributes.paddingLeft, borderWidth = attributes.borderWidth, borderColor = attributes.borderColor, borderRadius = attributes.borderRadius, borderStyle = attributes.borderStyle, hoverTextColor = attributes.hoverTextColor, hoverBgColor = attributes.hoverBgColor, hoverShadowColor = attributes.hoverShadowColor, hoverShadowH = attributes.hoverShadowH, hoverShadowV = attributes.hoverShadowV, hoverShadowBlur = attributes.hoverShadowBlur, hoverShadowSpread = attributes.hoverShadowSpread, hoverOpacity = attributes.hoverOpacity, transitionSpeed = attributes.transitionSpeed, iconDisplay = attributes.iconDisplay, icon = attributes.icon, iconSize = attributes.iconSize, iconColor = attributes.iconColor, iconTheme = attributes.iconTheme, iconPosition = attributes.iconPosition, iconSpacing = attributes.iconSpacing, noreferrer = attributes.noreferrer, nofollow = attributes.nofollow, isPreview = attributes.isPreview; var isStyleSquared = className.indexOf('-squared') > -1; var isStyleOutlined = className.indexOf('-outlined') > -1; var isStyleSquaredOutline = className.indexOf('-squared-outline') > -1; var hoverColorSettings = [{ label: __('Background Color', 'advanced-gutenberg'), value: hoverBgColor, onChange: function onChange(value) { return setAttributes({ hoverBgColor: value === undefined ? '#2196f3' : value }); } }, { label: __('Text Color', 'advanced-gutenberg'), value: hoverTextColor, onChange: function onChange(value) { return setAttributes({ hoverTextColor: value === undefined ? '#fff' : value }); } }, { label: __('Shadow Color', 'advanced-gutenberg'), value: hoverShadowColor, onChange: function onChange(value) { return setAttributes({ hoverShadowColor: value === undefined ? '#ccc' : value }); } }]; if (isStyleSquaredOutline) { hoverColorSettings.shift(); previewImageData = previewImageDataSquaredOutline; } else if (isStyleOutlined) { hoverColorSettings.shift(); previewImageData = previewImageDataOutlined; } else if (isStyleSquared) { previewImageData = previewImageDataSquared; } else { previewImageData = previewImageDataDefault; } var iconClass = ['material-icons', iconTheme !== '' && "-" + iconTheme].filter(Boolean).join(''); return isPreview ? React.createElement("img", { alt: __('Advanced Button', 'advanced-gutenberg'), width: "100%", src: previewImageData }) : React.createElement( Fragment, null, React.createElement( "span", { className: className + " align" + align, style: { display: 'inline-block' } }, React.createElement( "span", { className: "wp-block-advgb-button_link " + id, rel: advgb_relAttribute(attributes) }, iconDisplay && React.createElement( "i", { className: iconClass }, icon ), React.createElement(RichText, { tagName: "span", placeholder: __('Add text…', 'advanced-gutenberg'), value: text, onChange: function onChange(value) { return setAttributes({ text: value }); }, allowedFormats: ['core/bold', 'core/italic', 'core/strikethrough'], isSelected: isSelected, keepPlaceholderOnFocus: true }) ) ), React.createElement( "style", null, "." + id + " {\n font-size: " + textSize + "px;\n color: " + textColor + " !important;\n background-color: " + bgColor + " !important;\n margin: " + marginTop + "px " + marginRight + "px " + marginBottom + "px " + marginLeft + "px;\n padding: " + paddingTop + "px " + paddingRight + "px " + paddingBottom + "px " + paddingLeft + "px;\n border-width: " + borderWidth + "px !important;\n border-color: " + borderColor + " !important;\n border-radius: " + borderRadius + "px !important;\n border-style: " + borderStyle + " " + (borderStyle !== 'none' && '!important') + ";\n }\n ." + id + ":hover {\n color: " + hoverTextColor + " !important;\n background-color: " + hoverBgColor + " !important;\n box-shadow: " + hoverShadowH + "px " + hoverShadowV + "px " + hoverShadowBlur + "px " + hoverShadowSpread + "px " + hoverShadowColor + ";\n transition: all " + transitionSpeed + "s ease;\n opacity: " + hoverOpacity / 100 + "\n }\n ." + id + " i {\n font-size: " + iconSize + "px;\n float: " + iconPosition + ";\n }", iconColor && "." + id + " i {\n color: " + iconColor + ";\n }", iconPosition === 'left' && "." + id + " i {\n margin-right: " + iconSpacing + "px;\n }", iconPosition === 'right' && "." + id + " i {\n margin-left: " + iconSpacing + "px;\n }", advgbBlocks.advgb_pro !== '1' && "." + id + " i {\n display: none !important;\n }" ), showPopup ? React.createElement(_iconClass.IconListPopupHook, { content: "iconpopup", closePopup: function closePopup() { if (showPopup) { _this2.togglePopup(); } }, onSelectIcon: this.handleIcon, onSelectIconTheme: this.handleIconTheme, selectedIcon: icon, selectedIconTheme: iconTheme }) : null, React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Button link', 'advanced-gutenberg') }, React.createElement( BaseControl, { label: [__('Link URL', 'advanced-gutenberg'), url && React.createElement( "a", { href: url || '#', key: "link_url", target: "_blank", style: { float: 'right' } }, __('Preview', 'advanced-gutenberg') )] }, React.createElement(URLInput, { value: url, onChange: function onChange(value) { return setAttributes({ url: value }); }, autoFocus: false, isFullWidth: true, hasBorder: true }) ), React.createElement(ToggleControl, { label: __('Open in new tab', 'advanced-gutenberg'), checked: !!urlOpenNewTab, onChange: function onChange() { return setAttributes({ urlOpenNewTab: !attributes.urlOpenNewTab }); } }) ), React.createElement( PanelBody, { title: __('Text/Color', 'advanced-gutenberg') }, React.createElement(RangeControl, { label: __('Text size', 'advanced-gutenberg'), value: textSize || '', onChange: function onChange(size) { return setAttributes({ textSize: size }); }, min: 10, max: 100, beforeIcon: "editor-textcolor", allowReset: true }), !isStyleOutlined && React.createElement(_components.AdvColorControl, { label: __('Background Color', 'advanced-gutenberg'), value: bgColor, onChange: function onChange(value) { return setAttributes({ bgColor: value }); } }), React.createElement(_components.AdvColorControl, { label: __('Text Color', 'advanced-gutenberg'), value: textColor, onChange: function onChange(value) { return setAttributes({ textColor: value }); } }) ), React.createElement( PanelBody, { title: __('Border', 'advanced-gutenberg'), initialOpen: false }, !isStyleSquared && React.createElement(RangeControl, { label: __('Border radius', 'advanced-gutenberg'), value: borderRadius || '', onChange: function onChange(value) { return setAttributes({ borderRadius: value }); }, min: 0, max: 100 }), React.createElement(SelectControl, { label: __('Border style', 'advanced-gutenberg'), value: borderStyle, options: listBorderStyles, onChange: function onChange(value) { return setAttributes({ borderStyle: value }); } }), borderStyle !== 'none' && React.createElement( Fragment, null, React.createElement(PanelColorSettings, { title: __('Border Color', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Border Color', 'advanced-gutenberg'), value: borderColor, onChange: function onChange(value) { return setAttributes({ borderColor: value === undefined ? '#2196f3' : value }); } }] }), React.createElement(RangeControl, { label: __('Border width', 'advanced-gutenberg'), value: borderWidth || '', onChange: function onChange(value) { return setAttributes({ borderWidth: value }); }, min: 0, max: 100 }) ) ), React.createElement( PanelBody, { title: __('Margin', 'advanced-gutenberg'), initialOpen: false }, React.createElement(RangeControl, { label: __('Margin top', 'advanced-gutenberg'), value: marginTop || '', onChange: function onChange(value) { return setAttributes({ marginTop: value }); }, min: 0, max: 100 }), React.createElement(RangeControl, { label: __('Margin right', 'advanced-gutenberg'), value: marginRight || '', onChange: function onChange(value) { return setAttributes({ marginRight: value }); }, min: 0, max: 100 }), React.createElement(RangeControl, { label: __('Margin bottom', 'advanced-gutenberg'), value: marginBottom || '', onChange: function onChange(value) { return setAttributes({ marginBottom: value }); }, min: 0, max: 100 }), React.createElement(RangeControl, { label: __('Margin left', 'advanced-gutenberg'), value: marginLeft || '', onChange: function onChange(value) { return setAttributes({ marginLeft: value }); }, min: 0, max: 100 }) ), React.createElement( PanelBody, { title: __('Padding', 'advanced-gutenberg'), initialOpen: false }, React.createElement(RangeControl, { label: __('Padding top', 'advanced-gutenberg'), value: paddingTop || '', onChange: function onChange(value) { return setAttributes({ paddingTop: value }); }, min: 0, max: 100 }), React.createElement(RangeControl, { label: __('Padding right', 'advanced-gutenberg'), value: paddingRight || '', onChange: function onChange(value) { return setAttributes({ paddingRight: value }); }, min: 0, max: 100 }), React.createElement(RangeControl, { label: __('Padding bottom', 'advanced-gutenberg'), value: paddingBottom || '', onChange: function onChange(value) { return setAttributes({ paddingBottom: value }); }, min: 0, max: 100 }), React.createElement(RangeControl, { label: __('Padding left', 'advanced-gutenberg'), value: paddingLeft || '', onChange: function onChange(value) { return setAttributes({ paddingLeft: value }); }, min: 0, max: 100 }) ), React.createElement( PanelBody, { title: __('Hover', 'advanced-gutenberg'), initialOpen: false }, React.createElement(PanelColorSettings, { title: __('Color Settings', 'advanced-gutenberg'), initialOpen: false, colorSettings: hoverColorSettings }), React.createElement( PanelBody, { title: __('Shadow', 'advanced-gutenberg'), initialOpen: false }, React.createElement(RangeControl, { label: __('Opacity (%)', 'advanced-gutenberg'), value: hoverOpacity, onChange: function onChange(value) { return setAttributes({ hoverOpacity: value }); }, min: 0, max: 100 }), React.createElement(RangeControl, { label: __('Transition speed (ms)', 'advanced-gutenberg'), value: transitionSpeed || '', onChange: function onChange(value) { return setAttributes({ transitionSpeed: value }); }, min: 0, max: 3000 }), React.createElement(RangeControl, { label: __('Shadow H offset', 'advanced-gutenberg'), value: hoverShadowH || '', onChange: function onChange(value) { return setAttributes({ hoverShadowH: value }); }, min: -50, max: 50 }), React.createElement(RangeControl, { label: __('Shadow V offset', 'advanced-gutenberg'), value: hoverShadowV || '', onChange: function onChange(value) { return setAttributes({ hoverShadowV: value }); }, min: -50, max: 50 }), React.createElement(RangeControl, { label: __('Shadow blur', 'advanced-gutenberg'), value: hoverShadowBlur || '', onChange: function onChange(value) { return setAttributes({ hoverShadowBlur: value }); }, min: 0, max: 50 }), React.createElement(RangeControl, { label: __('Shadow spread', 'advanced-gutenberg'), value: hoverShadowSpread || '', onChange: function onChange(value) { return setAttributes({ hoverShadowSpread: value }); }, min: 0, max: 50 }) ) ), advgbBlocks.advgb_pro === '1' && React.createElement( Fragment, null, React.createElement( PanelBody, { title: __('Icon', 'advanced-gutenberg'), initialOpen: false, className: "advgb-pro-icon" }, React.createElement(ToggleControl, { label: __('Display icon', 'advanced-gutenberg'), checked: iconDisplay, onChange: function onChange() { return setAttributes({ iconDisplay: !iconDisplay }); }, className: "advgb-child-toggle" }), iconDisplay && React.createElement( Fragment, null, React.createElement( BaseControl, { label: __('Icon Library (Material Icon)', 'advanced-gutenberg') }, React.createElement( Button, { className: "button button-large advgb-browse-icon-btn", onClick: function onClick() { if (!showPopup) { _this2.togglePopup(); } } }, __('Icon Selection', 'advanced-gutenberg') ) ), React.createElement(RangeControl, { label: __('Icon Size (px)', 'advanced-gutenberg'), value: iconSize, min: 1, max: 200, onChange: function onChange(value) { return setAttributes({ iconSize: value }); } }), React.createElement(_components.AdvColorControl, { label: __('Icon Color', 'advanced-gutenberg'), value: iconColor, onChange: function onChange(value) { return setAttributes({ iconColor: value }); } }), React.createElement(SelectControl, { label: __('Icon Position', 'advanced-gutenberg'), value: iconPosition, options: [{ label: __('Left', 'advanced-gutenberg'), value: 'left' }, { label: __('Right', 'advanced-gutenberg'), value: 'right' }], onChange: function onChange(value) { return setAttributes({ iconPosition: value }); } }), React.createElement(RangeControl, { label: __('Icon Spacing (px)', 'advanced-gutenberg'), value: iconSpacing, min: 0, max: 100, help: __('Spacing between icon and text', 'advanced-gutenberg'), onChange: function onChange(value) { return setAttributes({ iconSpacing: value }); } }) ) ) ) ) ); } }]); return AdvButton; }(Component); var buttonBlockIcon = React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "2 2 22 22" }, React.createElement("path", { fill: "none", d: "M0 0h24v24H0V0z" }), React.createElement("path", { d: "M19 7H5c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2zm0 8H5V9h14v6z" }) ); var blockAttrs = { id: { type: 'string' }, url: { type: 'string' }, urlOpenNewTab: { type: 'boolean', default: true }, title: { type: 'string' }, text: { selector: 'a', default: 'PUSH THE BUTTON' }, bgColor: { type: 'string' }, textColor: { type: 'string' }, textSize: { type: 'number', default: 18 }, marginTop: { type: 'number', default: 0 }, marginRight: { type: 'number', default: 0 }, marginBottom: { type: 'number', default: 0 }, marginLeft: { type: 'number', default: 0 }, paddingTop: { type: 'number', default: 10 }, paddingRight: { type: 'number', default: 30 }, paddingBottom: { type: 'number', default: 10 }, paddingLeft: { type: 'number', default: 30 }, borderWidth: { type: 'number', default: 1 }, borderColor: { type: 'string' }, borderStyle: { type: 'string', default: 'none' }, borderRadius: { type: 'number', default: 50 }, hoverTextColor: { type: 'string' }, hoverBgColor: { type: 'string' }, hoverShadowColor: { type: 'string', default: '#ccc' }, hoverShadowH: { type: 'number', default: 1 }, hoverShadowV: { type: 'number', default: 1 }, hoverShadowBlur: { type: 'number', default: 12 }, hoverShadowSpread: { type: 'number', default: 0 }, hoverOpacity: { type: 'number', default: 100 }, transitionSpeed: { type: 'number', default: 200 }, align: { type: 'string', default: 'none' }, iconDisplay: { type: 'boolean', default: false }, icon: { type: 'string', default: 'insert_link' }, iconSize: { type: 'number', default: 30 }, iconColor: { type: 'string' }, iconTheme: { type: 'string', default: 'outlined' }, iconPosition: { type: 'string', default: 'left' }, iconSpacing: { type: 'number', default: 7 }, noreferrer: { type: 'boolean', default: true }, nofollow: { type: 'boolean', default: false }, changed: { type: 'boolean', default: false }, isPreview: { type: 'boolean', default: false } }; registerBlockType('advgb/button', { title: __('Button - PublishPress', 'advanced-gutenberg'), description: __('Button block with more options and styles.', 'advanced-gutenberg'), icon: { src: buttonBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('button', 'advanced-gutenberg'), __('advanced button', 'advanced-gutenberg'), __('link', 'advanced-gutenberg')], attributes: blockAttrs, example: { attributes: { isPreview: true } }, transforms: { from: [{ type: 'block', blocks: ['core/button'], transform: function transform(attributes) { return createBlock('advgb/button', _extends({}, attributes, { bgColor: attributes.color })); } }], to: [{ type: 'block', blocks: ['core/button'], transform: function transform(attributes) { return createBlock('core/button', _extends({}, attributes, { color: attributes.bgColor })); } }] }, styles: [{ name: 'default', label: __('Default', 'advanced-gutenberg'), isDefault: true }, { name: 'outlined', label: __('Outlined', 'advanced-gutenberg') }, { name: 'squared', label: __('Squared', 'advanced-gutenberg') }, { name: 'squared-outline', label: __('Squared Outline', 'advanced-gutenberg') }], supports: { anchor: true, align: ['right', 'left', 'center', 'full'] }, edit: AdvButton, save: function save(_ref) { var attributes = _ref.attributes; var id = attributes.id, align = attributes.align, url = attributes.url, urlOpenNewTab = attributes.urlOpenNewTab, title = attributes.title, text = attributes.text, iconDisplay = attributes.iconDisplay, icon = attributes.icon, iconSize = attributes.iconSize, iconColor = attributes.iconColor, iconTheme = attributes.iconTheme, iconPosition = attributes.iconPosition, iconSpacing = attributes.iconSpacing, noreferrer = attributes.noreferrer, nofollow = attributes.nofollow; var iconClass = ['material-icons', iconTheme !== '' && "-" + iconTheme].filter(Boolean).join(''); return React.createElement( "div", { className: "align" + align }, React.createElement( "a", { className: "wp-block-advgb-button_link " + id, href: url || '#', title: title, target: !urlOpenNewTab ? '_self' : '_blank', rel: 'noopener ' + advgb_relAttribute(attributes) }, iconDisplay && React.createElement( "i", { className: iconClass }, icon ), React.createElement(RichText.Content, { tagName: "span", value: text }) ) ); }, getEditWrapperProps: function getEditWrapperProps(attributes) { var align = attributes.align; var props = { 'data-resized': true }; if ('left' === align || 'right' === align || 'center' === align) { props['data-align'] = align; } return props; }, deprecated: [{ attributes: _extends({}, blockAttrs, { text: { source: 'children', selector: 'a', default: 'PUSH THE BUTTON' } }), supports: { anchor: true, align: ['right', 'left', 'center', 'full'] }, save: function save(_ref2) { var attributes = _ref2.attributes; var id = attributes.id, align = attributes.align, url = attributes.url, urlOpenNewTab = attributes.urlOpenNewTab, title = attributes.title, text = attributes.text, icon = attributes.icon, iconSize = attributes.iconSize, iconColor = attributes.iconColor, iconTheme = attributes.iconTheme; return React.createElement( "div", { className: "align" + align }, React.createElement(RichText.Content, { tagName: "a", className: "wp-block-advgb-button_link " + id, href: url || '#', title: title, target: !urlOpenNewTab ? '_self' : '_blank', value: text, rel: "noopener noreferrer" }) ); } }, { attributes: _extends({}, blockAttrs, { transitionSpeed: { type: 'number', default: 0.2 } }), migrate: function migrate(attributes) { var transitionSpeed = attributes.transitionSpeed * 1000; return _extends({}, attributes, { transitionSpeed: transitionSpeed }); }, save: function save(_ref3) { var attributes = _ref3.attributes; var id = attributes.id, align = attributes.align, url = attributes.url, urlOpenNewTab = attributes.urlOpenNewTab, title = attributes.title, text = attributes.text; return React.createElement( "div", { className: "align" + align }, React.createElement(RichText.Content, { tagName: "a", className: "wp-block-advgb-button_link " + id, href: url || '#', title: title, target: !urlOpenNewTab ? '_self' : '_blank', value: text, rel: "noopener noreferrer" }) ); } }] }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/advicon/block.jsx": /*!*********************************************!*\ !*** ./src/assets/blocks/advicon/block.jsx ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _components = __webpack_require__(/*! ../0-adv-components/components.jsx */ "./src/assets/blocks/0-adv-components/components.jsx"); var _iconClass = __webpack_require__(/*! ../0-adv-components/icon-class.jsx */ "./src/assets/blocks/0-adv-components/icon-class.jsx"); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, BlockControls = _wpBlockEditor.BlockControls, AlignmentToolbar = _wpBlockEditor.AlignmentToolbar, URLInput = _wpBlockEditor.URLInput; var BaseControl = wpComponents.BaseControl, PanelBody = wpComponents.PanelBody, RangeControl = wpComponents.RangeControl, SelectControl = wpComponents.SelectControl, TextControl = wpComponents.TextControl, Button = wpComponents.Button; var _lodash = lodash, times = _lodash.times; var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAYAAADL1t+KAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAGVNJREFUeNrs3VuMXPV9wPEzs+sLDmu7BhIMNgWiUAtK4whQlRdLBUQiQOpD8oaUKqoqJZXymjyESijKU5QHpChPgYgkjSL1oYoipEo0JSoqQkSxlKiCchEFAgZsAnFtxxtfdqbzW3yc47Pn8j8zs8vuzucjjfYyOzNnZw3f8/+fW5YBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbT2+9L+D8/HzPnwmAdWR4/vz52Q76KM4bboUCAMaJfvGLtVgBWPWgXoh4b70sDwCsdsCbjOI+XI0FmGpACyPw3pReW+AB2KgBT/6ZaYzgpxbMlm3dvQ7f763VMgPAlAI+nOB7F++bJOwTxTFhRN4W7F6H5RFyANZr1IcTfj3xiH3sSDZsG08Ndq9D1MUcgPUc9WHL58PEn7+o67b2zqEcI+S9hJD3Joi52AOwViPxlBH3sCHmww6hX/46dbTeKYY1MW8Kc919qVEXcwDWY9RTR+TFj12j3ynsyUFMjHmvIexd7mt7LQBYD5FPCXjX+8aK+nxizJumwtsCXfn5ddddN/e1r31t14EDB3bv2bNn99atW3f0+/35wWDwwVIPh3G7+Lr51/ERANZKr9eL2zA+hqWlpfNnz549c/z48ROHDx9+75FHHvm/V155ZdAQ6vzzQcIKQ6/wsRz2XtPMQeuot2JknjKNXv66n39+3333bf3mN795yzXXXHP7jh077hg9/w2jkP/56LZndP82/3QAWOfOjAafJ0a3I6Owv7C4uPjCKOj/+f3vf//lRx999A8VMR82fK9tJWDFaL1uZ7nehCPz8ui8XxP3/re//e1dDzzwwN/u3r3770bPe4d/DwBsJqOR+yvvvPPOd5566qlffOELX3izMCKvCnjTfVnWMgVfFfXeBCPzqhF5+bYc+Jdffvmu/fv3/9Pc3NytWeI0PwBsQOdHYX/1hRde+PrBgwefbBiRF8PeNJJPjno/MeZZYrwvuf3gBz+4+ve///03rr/++n8dxfxTYg7AJjc/6t0nbrnlln85duzYQ9/61rf2jr43d+FWbGRtO7PqTdcruly+4Nlc1dL0+/260XnbqPzignz+85/f/tWvfvXrH/nIRx7o9Xrb/Y0BmCXbt2+/6eabb1549tlnn3799dcHpX6WOzusGEC36eU7kjcFvWnHt9YR+pe+9KXLR2slf79z585/HMV8pz8rALMmBrPbtm07cPfddy+++uqr//Piiy+e7zBYHtaEvVcegOdRTw166si8v7Cw0H/sscfuueqqq/5hbm7uOn9SAGY46ltHI/U9o5H62z/84Q//t3Qced0ovO7QtMpztuRB77ctS8PXlVH/4he/uDCK+d1btmz5K39KAGbd1q1b//K666678/7771/IVm4rr9uuXjV4brQi6BWHqrVtP79kIT772c/uG62N/HXCygIAzIJ+nHfl3nvvvTar3wGu+HXWEPMVo/R857jUvc6bThpzyfd37ty50O/39/r7AcDF6F69Z8+ehcJgd1ga+C6V4p4fzlbu8DBphF7aBb5urSBrGqFv2bIlTuH6Z/58APCBubm53du2bbssWznVXtXSphF67Si9X/NDWU28my6ksrwwS0tLLqICACWjPvaz6m3k/cTO9ho6PfaJXmoXxMVTAGClCxccK065D7I/Ta+3DZ5b49pvCHZTyOuG/UboAFBhMBg0HSnWda/2FffPJzygbi+7yr3di5c8BQAuCXpxhN7L0sNebmvxxDPDphF6ylpB5Ry/KX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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADBr/l+AAQCL/KXCjY+nXAAAAABJRU5ErkJggg=='; var MARGIN_PADDING_CONTROLS = [{ label: 'Top', icon: React.createElement( "svg", { width: "20px", height: "20px", viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", "fill-rule": "evenodd", "clip-rule": "evenodd", "stroke-linejoin": "round", "stroke-miterlimit": "1.414" }, React.createElement("rect", { x: "2.714", y: "5.492", width: "1.048", height: "9.017", fill: "#555d66" }), React.createElement("rect", { x: "16.265", y: "5.498", width: "1.023", height: "9.003", fill: "#555d66" }), React.createElement("rect", { x: "5.518", y: "2.186", width: "8.964", height: "2.482", fill: "#272b2f" }), React.createElement("rect", { x: "5.487", y: "16.261", width: "9.026", height: "1.037", fill: "#555d66" }) ) }, { label: 'Right', icon: React.createElement( "svg", { width: "20px", height: "20px", viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", "fill-rule": "evenodd", "clip-rule": "evenodd", "stroke-linejoin": "round", "stroke-miterlimit": "1.414" }, React.createElement("rect", { x: "2.714", y: "5.492", width: "1.046", height: "9.017", fill: "#555d66" }), React.createElement("rect", { x: "15.244", y: "5.498", width: "2.518", height: "9.003", fill: "#272b2f" }), React.createElement("rect", { x: "5.518", y: "2.719", width: "8.964", height: "0.954", fill: "#555d66" }), React.createElement("rect", { x: "5.487", y: "16.308", width: "9.026", height: "0.99", fill: "#555d66" }) ) }, { label: 'Bottom', icon: React.createElement( "svg", { width: "20px", height: "20px", viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", "fill-rule": "evenodd", "clip-rule": "evenodd", "stroke-linejoin": "round", "stroke-miterlimit": "1.414" }, React.createElement("rect", { x: "2.714", y: "5.492", width: "1", height: "9.017", fill: "#555d66" }), React.createElement("rect", { x: "16.261", y: "5.498", width: "1.027", height: "9.003", fill: "#555d66" }), React.createElement("rect", { x: "5.518", y: "2.719", width: "8.964", height: "0.968", fill: "#555d66" }), React.createElement("rect", { x: "5.487", y: "15.28", width: "9.026", height: "2.499", fill: "#272b2f" }) ) }, { label: 'Left', icon: React.createElement( "svg", { width: "20px", height: "20px", viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", "fill-rule": "evenodd", "clip-rule": "evenodd", "stroke-linejoin": "round", "stroke-miterlimit": "1.414" }, React.createElement("rect", { x: "2.202", y: "5.492", width: "2.503", height: "9.017", fill: "#272b2f" }), React.createElement("rect", { x: "16.276", y: "5.498", width: "1.012", height: "9.003", fill: "#555d66" }), React.createElement("rect", { x: "5.518", y: "2.719", width: "8.964", height: "0.966", fill: "#555d66" }), React.createElement("rect", { x: "5.487", y: "16.303", width: "9.026", height: "0.995", fill: "#555d66" }) ) }]; var blockIcon = React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, React.createElement("path", { fill: "none", d: "M0 0h24v24H0V0z" }), React.createElement("path", { d: "M19 1H5c-1.1 0-1.99.9-1.99 2L3 15.93c0 .69.35 1.3.88 1.66L12 23l8.11-5.41c.53-.36.88-.97.88-1.66L21 3c0-1.1-.9-2-2-2zm-7 19.6l-7-4.66V3h14v12.93l-7 4.67zm-2.01-7.42l-2.58-2.59L6 12l4 4 8-8-1.42-1.42z" }) ); var AdvIconEdit = function (_Component) { _inherits(AdvIconEdit, _Component); function AdvIconEdit() { _classCallCheck(this, AdvIconEdit); var _this = _possibleConstructorReturn(this, (AdvIconEdit.__proto__ || Object.getPrototypeOf(AdvIconEdit)).apply(this, arguments)); _this.state = { showPopup: false, currentItem: 0, iconSelected: '', selectedIcon: false, iconThemeSelected: 'outlined', selectedIconTheme: false }; _this.togglePopup = _this.togglePopup.bind(_this); _this.handleIcon = _this.handleIcon.bind(_this); _this.handleIconTheme = _this.handleIconTheme.bind(_this); return _this; } _createClass(AdvIconEdit, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-icon']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === "undefined" ? "undefined" : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: "componentDidMount", value: function componentDidMount() { var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes, clientId = _props2.clientId; var blockIDX = attributes.blockIDX; setAttributes({ blockIDX: "advgb-icon-" + clientId }); } }, { key: "componentDidUpdate", value: function componentDidUpdate() { var _state = this.state, currentItem = _state.currentItem, iconSelected = _state.iconSelected, selectedIcon = _state.selectedIcon, iconThemeSelected = _state.iconThemeSelected; if (selectedIcon) { this.setState({ selectedIcon: false, selectedIconTheme: false }); this.updateItems(parseInt(currentItem), { icon: iconSelected, iconTheme: iconThemeSelected }); } } }, { key: "handleIcon", value: function handleIcon(iconValue) { this.setState({ iconSelected: iconValue, selectedIcon: true }); } }, { key: "handleIconTheme", value: function handleIconTheme(iconThemeValue) { this.setState({ iconThemeSelected: iconThemeValue, selectedIconTheme: true }); } }, { key: "updateItems", value: function updateItems(idx, data) { var _props3 = this.props, attributes = _props3.attributes, setAttributes = _props3.setAttributes; var items = attributes.items; var newItems = items.map(function (item, index) { if (idx === index) { item = _extends({}, item, data); } return item; }); setAttributes({ items: newItems }); this.setState({ searchedText: '' }); } }, { key: "getItemData", value: function getItemData(idx, dataName) { var attributes = this.props.attributes; var items = attributes.items; var data = ''; items.map(function (item, index) { if (parseInt(idx) === index) { for (var key in item) { if (dataName === key && item.hasOwnProperty(key)) { data = item[key]; } } } }); return data; } }, { key: "togglePopup", value: function togglePopup() { var showPopup = this.state.showPopup; this.setState({ showPopup: !showPopup }); } }, { key: "render", value: function render() { var _this2 = this; var _props4 = this.props, attributes = _props4.attributes, setAttributes = _props4.setAttributes; var blockIDX = attributes.blockIDX, items = attributes.items, numberItem = attributes.numberItem, tAlign = attributes.tAlign, isPreview = attributes.isPreview; var _state2 = this.state, showPopup = _state2.showPopup, currentItem = _state2.currentItem; var blockWrapClass = ['advgb-icon-wrapper'].filter(Boolean).join(' '); var blockClass = ['advgb-icons'].filter(Boolean).join(' '); var i = 0; var j = 0; return isPreview ? React.createElement("img", { alt: __('Advanced Icon', 'advanced-gutenberg'), width: "100%", src: previewImageData }) : React.createElement( Fragment, null, React.createElement( BlockControls, null, React.createElement(AlignmentToolbar, { value: tAlign, onChange: function onChange(value) { return setAttributes({ tAlign: value }); } }) ), React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Icon Count', 'advanced-gutenberg') }, React.createElement(RangeControl, { label: __('Number of Icons', 'advanced-gutenberg'), min: 1, max: 10, value: numberItem, onChange: function onChange(value) { return setAttributes({ numberItem: value }); } }) ), items.map(function (item, idx) { i++; if (i > numberItem) return false; return React.createElement( Fragment, null, React.createElement( PanelBody, { title: __("Icon " + i + " Settings", 'advanced-gutenberg'), initialOpen: false }, React.createElement( BaseControl, { label: __('Icon Library (Material Icon)', 'advanced-gutenberg') }, React.createElement( Button, { className: "button button-large advgb-browse-image-btn", "data-currentItem": idx, onClick: function onClick(event) { if (!showPopup) { _this2.togglePopup(); _this2.setState({ currentItem: event.target.attributes.getNamedItem('data-currentItem').value }); } } }, __('Icon Selection', 'advanced-gutenberg') ) ), React.createElement(SelectControl, { label: __('Icon Style', 'advanced-gutenberg'), value: item.style, options: [{ label: __('Default', 'advanced-gutenberg'), value: 'default' }, { label: __('Stacked', 'advanced-gutenberg'), value: 'stacked' }], onChange: function onChange(value) { return _this2.updateItems(idx, { style: value }); } }), React.createElement(RangeControl, { label: __('Icon Size', 'advanced-gutenberg'), min: 10, max: 250, value: item.size, onChange: function onChange(value) { return _this2.updateItems(idx, { size: value }); } }), React.createElement(_components.AdvColorControl, { label: __('Icon Color', 'advanced-gutenberg'), value: item.color, onChange: function onChange(value) { return _this2.updateItems(idx, { color: value }); } }), React.createElement(_components.AdvColorControl, { label: __('Icon Background', 'advanced-gutenberg'), value: item.bgColor, onChange: function onChange(value) { return _this2.updateItems(idx, { bgColor: value }); } }), item.style && item.style === 'stacked' && React.createElement( Fragment, null, React.createElement(BaseControl, { label: __('Border', 'advanced-gutenberg'), className: "advgb-control-header" }), React.createElement(_components.AdvColorControl, { label: __('Border Color', 'advanced-gutenberg'), value: item.borderColor, onChange: function onChange(value) { return _this2.updateItems(idx, { borderColor: value }); } }), React.createElement(RangeControl, { label: __('Border Size(px)', 'advanced-gutenberg'), min: 0, max: 20, value: item.borderSize, onChange: function onChange(value) { return _this2.updateItems(idx, { borderSize: value }); } }), React.createElement(RangeControl, { label: __('Border Radius(%)', 'advanced-gutenberg'), min: 0, max: 50, value: item.borderRadius, onChange: function onChange(value) { return _this2.updateItems(idx, { borderRadius: value }); } }) ), React.createElement(BaseControl, { label: __('Link', 'advanced-gutenberg'), className: "advgb-control-header" }), React.createElement( BaseControl, { label: __('Link', 'advanced-gutenberg') }, React.createElement(URLInput, { value: item.link, onChange: function onChange(value) { return _this2.updateItems(idx, { link: value }); }, autoFocus: false, isFullWidth: true, hasBorder: true }) ), React.createElement(SelectControl, { label: __('Link Target', 'advanced-gutenberg'), value: item.linkTarget, options: [{ label: __('Same Window', 'advanced-gutenberg'), value: '_self' }, { label: __('New Window', 'advanced-gutenberg'), value: '_blank' }], onChange: function onChange(value) { return _this2.updateItems(idx, { linkTarget: value }); } }), React.createElement(TextControl, { label: __('Title for Accessibility', 'advanced-gutenberg'), value: item.title, onChange: function onChange(value) { return _this2.updateItems(idx, { title: value }); } }), item.style && item.style === 'stacked' && React.createElement( Fragment, null, React.createElement(BaseControl, { label: __('Padding', 'advanced-gutenberg'), className: "advgb-control-header" }), React.createElement( "div", { className: "advgb-controls-title" }, React.createElement( "span", null, __('Unit', 'advanced-gutenberg') ), React.createElement( "div", { className: "advgb-unit-wrapper", key: "unit" }, ['px', 'em', 'vh', '%'].map(function (unit, uIdx) { return React.createElement( "span", { className: "advgb-unit " + (item.paddingUnit === unit ? 'selected' : ''), key: uIdx, onClick: function onClick() { return _this2.updateItems(idx, { paddingUnit: unit }); } }, unit ); }) ) ), MARGIN_PADDING_CONTROLS.map(function (pos, mpIdx) { return React.createElement(RangeControl, { className: "advgb-padding-margin-control", key: mpIdx, label: pos.icon, beforeIcon: pos.icon, value: item['padding' + pos.label], min: 0, max: 180, onChange: function onChange(value) { return _this2.updateItems(idx, _defineProperty({}, 'padding' + pos.label, value)); } }); }) ), React.createElement(BaseControl, { label: __('Margin', 'advanced-gutenberg'), className: "advgb-control-header" }), React.createElement( "div", { className: "advgb-controls-title" }, React.createElement( "span", null, __('Unit', 'advanced-gutenberg') ), React.createElement( "div", { className: "advgb-unit-wrapper", key: "unit" }, ['px', 'em', 'vh', '%'].map(function (unit, uIdx) { return React.createElement( "span", { className: "advgb-unit " + (item.marginUnit === unit ? 'selected' : ''), key: uIdx, onClick: function onClick() { return _this2.updateItems(idx, { marginUnit: unit }); } }, unit ); }) ) ), MARGIN_PADDING_CONTROLS.map(function (pos, mpIdx) { return React.createElement(RangeControl, { className: "advgb-padding-margin-control", key: mpIdx, label: pos.icon, beforeIcon: pos.icon, value: item['margin' + pos.label], min: 0, max: 180, onChange: function onChange(value) { return _this2.updateItems(idx, _defineProperty({}, 'margin' + pos.label, value)); } }); }) ) ); }) ), React.createElement( "div", { className: blockWrapClass, id: blockIDX }, React.createElement( "div", { className: blockClass, style: { textAlign: tAlign } }, items.map(function (item, idx) { j++; if (j > numberItem) return false; var advgbIconClass = ["advgb-icon-style-" + item.style, 'advgb-icon-wrap', "advgb-item-" + idx].filter(Boolean).join(' '); var iconWrapClass = ['advgb-icon', "advgb-icon-" + item.icon].filter(Boolean).join(' '); var iconClass = [item.iconType === 'material' && 'material-icons', item.iconTheme !== '' && "-" + item.iconTheme].filter(Boolean).join(''); var iconWrapStyles = { display: 'flex', alignItems: 'center', marginTop: item.marginTop + item.marginUnit, marginBottom: item.marginBottom + item.marginUnit, marginLeft: item.marginLeft + item.marginUnit, marginRight: item.marginRight + item.marginUnit, paddingTop: item.style !== 'default' ? item.paddingTop + item.paddingUnit : 0, paddingBottom: item.style !== 'default' ? item.paddingBottom + item.paddingUnit : 0, paddingLeft: item.style !== 'default' ? item.paddingLeft + item.paddingUnit : 0, paddingRight: item.style !== 'default' ? item.paddingRight + item.paddingUnit : 0, borderWidth: item.style !== 'default' ? item.borderSize + 'px' : 0, borderStyle: 'solid', borderColor: item.borderColor, background: item.bgColor, borderRadius: item.borderRadius + '%' }; var iconStyles = { fontSize: item.size + 'px', color: item.color }; return React.createElement( Fragment, null, React.createElement( "div", { className: advgbIconClass }, React.createElement( "div", { className: iconWrapClass, style: iconWrapStyles }, React.createElement( "i", { className: iconClass, style: iconStyles }, item.icon ) ) ) ); }) ), showPopup ? React.createElement(_iconClass.IconListPopupHook, { content: "iconpopup", closePopup: function closePopup() { if (showPopup) { _this2.togglePopup(); } }, onSelectIcon: this.handleIcon, onSelectIconTheme: this.handleIconTheme, selectedIcon: this.getItemData(currentItem, 'icon'), selectedIconTheme: this.getItemData(currentItem, 'iconTheme') }) : null ) ); } }]); return AdvIconEdit; }(Component); var blockAttrs = { blockIDX: { type: 'string' }, items: { type: 'array', default: times(10, function () { return { icon: 'beenhere', iconType: 'material', iconTheme: 'outlined', size: 120, color: '#111111', style: 'default', bgColor: '', borderColor: '#111', borderSize: 2, borderRadius: 0, paddingTop: 20, paddingBottom: 20, paddingLeft: 20, paddingRight: 20, marginTop: 0, marginBottom: 0, marginLeft: 0, marginRight: 40, paddingUnit: 'px', marginUnit: 'px', link: '', linkTarget: '_self', title: '' }; }) }, numberItem: { type: 'number', default: 2 }, changed: { type: 'boolean', default: false }, tAlign: { type: 'string', default: 'center' }, isPreview: { type: 'boolean', default: false } }; registerBlockType('advgb/icon', { title: __('Icon - PublishPress', 'advanced-gutenberg'), description: __('Icon block with more options and styles.', 'advanced-gutenberg'), icon: { src: blockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('icon', 'advanced-gutenberg'), __('advanced icon', 'advanced-gutenberg')], attributes: blockAttrs, supports: { align: ["left", "center", "right"] }, example: { attributes: { isPreview: true } }, edit: AdvIconEdit, save: function save(_ref) { var attributes = _ref.attributes; var blockIDX = attributes.blockIDX, className = attributes.className, items = attributes.items, numberItem = attributes.numberItem; var blockWrapClass = ['wp-block-advgb-icon', 'icon-wrapper', className, blockIDX].filter(Boolean).join(' '); var blockClass = ['advgb-icons'].filter(Boolean).join(' '); var i = 0; return React.createElement( Fragment, null, React.createElement( "div", { className: blockWrapClass }, React.createElement( "div", { className: blockClass }, items.map(function (item, idx) { i++; if (i > numberItem) return false; var itemLink = item.link; if (!item.link.match(/^[a-zA-Z]+:\/\//)) { itemLink = 'http://' + item.link; } var advgbIconClass = ["advgb-icon-style-" + item.style, 'advgb-icon-wrap', "advgb-item-" + idx].filter(Boolean).join(' '); var iconWrapClass = ['advgb-icon', "advgb-icon-" + item.icon].filter(Boolean).join(' '); var iconClass = [item.iconType === 'material' && 'material-icons', item.iconTheme !== '' && "-" + item.iconTheme].filter(Boolean).join(''); return React.createElement( Fragment, null, React.createElement( "div", { className: advgbIconClass }, item.link !== '' && React.createElement( "a", { href: itemLink, target: item.linkTarget, title: item.title, rel: "noopener noreferrer" }, React.createElement( "span", { className: iconWrapClass }, React.createElement( "i", { className: iconClass }, item.icon ) ) ), item.link === '' && React.createElement( "span", { className: iconWrapClass }, React.createElement( "i", { className: iconClass }, item.icon ) ) ) ); }) ) ) ); }, deprecated: [{ attributes: blockAttrs, save: function save(_ref2) { var attributes = _ref2.attributes; var blockIDX = attributes.blockIDX, items = attributes.items, numberItem = attributes.numberItem; var blockWrapClass = ['wp-block-advgb-icon', 'icon-wrapper', blockIDX].filter(Boolean).join(' '); var blockClass = ['advgb-icons'].filter(Boolean).join(' '); var i = 0; return React.createElement( Fragment, null, React.createElement( "div", { className: blockWrapClass }, React.createElement( "div", { className: blockClass }, items.map(function (item, idx) { i++; if (i > numberItem) return false; var advgbIconClass = ["advgb-icon-style-" + item.style, 'advgb-icon-wrap', "advgb-item-" + idx].filter(Boolean).join(' '); var iconWrapClass = ['advgb-icon', "advgb-icon-" + item.icon].filter(Boolean).join(' '); var iconClass = [item.iconType === 'material' && 'material-icons', item.iconTheme !== '' && "-" + item.iconTheme].filter(Boolean).join(''); return React.createElement( Fragment, null, React.createElement( "div", { className: advgbIconClass }, item.link !== '' && React.createElement( "a", { href: item.link, title: item.title }, React.createElement( "div", { className: iconWrapClass }, React.createElement( "i", { className: iconClass }, item.icon ) ) ), item.link === '' && React.createElement( "div", { className: iconWrapClass }, React.createElement( "i", { className: iconClass }, item.icon ) ) ) ); }) ) ) ); } }, { attributes: blockAttrs, save: function save(_ref3) { var attributes = _ref3.attributes; var blockIDX = attributes.blockIDX, items = attributes.items, numberItem = attributes.numberItem; var blockWrapClass = ['wp-block-advgb-icon', 'icon-wrapper'].filter(Boolean).join(' '); var blockClass = ['advgb-icons'].filter(Boolean).join(' '); var i = 0; return React.createElement( Fragment, null, React.createElement( "div", { className: blockWrapClass, id: blockIDX }, React.createElement( "div", { className: blockClass }, items.map(function (item, idx) { i++; if (i > numberItem) return false; var advgbIconClass = ["advgb-icon-style-" + item.style, 'advgb-icon-wrap', "advgb-item-" + idx].filter(Boolean).join(' '); var iconWrapClass = ['advgb-icon', "advgb-icon-" + item.icon].filter(Boolean).join(' '); var iconClass = [item.iconType === 'material' && 'material-icons', item.iconTheme !== '' && "-" + item.iconTheme].filter(Boolean).join(''); return React.createElement( Fragment, null, React.createElement( "div", { className: advgbIconClass }, item.link !== '' && React.createElement( "a", { href: item.link, title: item.title }, React.createElement( "div", { className: iconWrapClass }, React.createElement( "i", { className: iconClass }, item.icon ) ) ), item.link === '' && React.createElement( "div", { className: iconWrapClass }, React.createElement( "i", { className: iconClass }, item.icon ) ) ) ); }) ) ) ); } }] }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/advimage/block.jsx": /*!**********************************************!*\ !*** ./src/assets/blocks/advimage/block.jsx ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, BlockControls = _wpBlockEditor.BlockControls, RichText = _wpBlockEditor.RichText, PanelColorSettings = _wpBlockEditor.PanelColorSettings, MediaUpload = _wpBlockEditor.MediaUpload; var RangeControl = wpComponents.RangeControl, PanelBody = wpComponents.PanelBody, ToggleControl = wpComponents.ToggleControl, SelectControl = wpComponents.SelectControl, TextControl = wpComponents.TextControl, Button = wpComponents.Button, ToolbarGroup = wpComponents.ToolbarGroup, ToolbarButton = wpComponents.ToolbarButton, FocalPointPicker = wpComponents.FocalPointPicker; var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD9CAYAAACV6WqFAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACp5JREFUeNrs3c2LFOkBwOGu7p4ZnYghhwRyiNEsKCGBSU5RmIDxJEHILX9BDgZWkPwDOex5vErIsIdlL4LecgjEm/EQyMlcdTEuCvEg6OBH7OmqdM12mbKmuqe7urq7uup5oJhxXZ22qn/1vm9/VLdaAAAAAAAAAAAAUCfBon9gt9u11yFlf39/dUMfBh0s6+dDxUVH/X6ZJ4Cg5LDz/s5A3DBV9FHZ0QclRh7k/L3BiJ8ldhgfeJT334oGH8wh8OCI74UOo+OOMt8fCn4QezR1qyVN/bNBZ7e88IHxYefGHg+w047shYMb/LC8yNuZwNtjogfyww6P+PXU0/igYOTZEbqdCbu9tbXV/fzz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='; var AdvImage = function (_Component) { _inherits(AdvImage, _Component); function AdvImage() { _classCallCheck(this, AdvImage); var _this = _possibleConstructorReturn(this, (AdvImage.__proto__ || Object.getPrototypeOf(AdvImage)).apply(this, arguments)); _this.state = { currentEdit: '' }; return _this; } _createClass(AdvImage, [{ key: 'componentWillMount', value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-image']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === 'undefined' ? 'undefined' : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: 'componentDidMount', value: function componentDidMount() { var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes, clientId = _props2.clientId; var blockIDX = attributes.blockIDX; setAttributes({ blockIDX: 'advgb-img-' + clientId }); // Reset attributes when Pro is not available if (advgbBlocks.advgb_pro !== 'undefined' && advgbBlocks.advgb_pro !== '1') { setAttributes({ titleTag: 'h4', subtitleTag: 'p' }); } } }, { key: 'render', value: function render() { var _this2 = this; var currentEdit = this.state.currentEdit; var _props3 = this.props, attributes = _props3.attributes, setAttributes = _props3.setAttributes, isSelected = _props3.isSelected; var blockIDX = attributes.blockIDX, openOnClick = attributes.openOnClick, openUrl = attributes.openUrl, linkInNewTab = attributes.linkInNewTab, imageUrl = attributes.imageUrl, imageID = attributes.imageID, title = attributes.title, titleColor = attributes.titleColor, subtitle = attributes.subtitle, subtitleColor = attributes.subtitleColor, overlayColor = attributes.overlayColor, defaultOpacity = attributes.defaultOpacity, fullWidth = attributes.fullWidth, width = attributes.width, height = attributes.height, vAlign = attributes.vAlign, hAlign = attributes.hAlign, overlayOpacity = attributes.overlayOpacity, focalPoint = attributes.focalPoint, isPreview = attributes.isPreview, titleTag = attributes.titleTag, subtitleTag = attributes.subtitleTag; var blockClassName = ['advgb-image-block', fullWidth && 'full-width', blockIDX].filter(Boolean).join(' '); return isPreview ? React.createElement('img', { alt: __('Advanced Image', 'advanced-gutenberg'), width: '100%', src: previewImageData }) : React.createElement( Fragment, null, imageID && React.createElement( BlockControls, null, React.createElement( ToolbarGroup, null, React.createElement(MediaUpload, { allowedTypes: ['image'], value: imageID, onSelect: function onSelect(image) { return setAttributes({ imageUrl: image.url, imageID: image.id }); }, render: function render(_ref) { var open = _ref.open; return React.createElement(ToolbarButton, { label: __('Change image', 'advanced-gutenberg'), icon: 'edit', onClick: open }); } }), React.createElement(ToolbarButton, { label: __('Remove image', 'advanced-gutenberg'), icon: 'no', onClick: function onClick() { return setAttributes({ imageUrl: undefined, imageID: undefined }); } }) ) ), React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Advanced Image', 'advanced-gutenberg') }, React.createElement(SelectControl, { label: __('Action on click', 'advanced-gutenberg'), value: openOnClick, options: [{ label: __('None', 'advanced-gutenberg'), value: 'none' }, { label: __('Open image in lightbox', 'advanced-gutenberg'), value: 'lightbox' }, { label: __('Open custom URL', 'advanced-gutenberg'), value: 'url' }], onChange: function onChange(value) { return setAttributes({ openOnClick: value }); } }), openOnClick === 'url' && React.createElement( Fragment, null, React.createElement(TextControl, { label: [__('Link URL', 'advanced-gutenberg'), openUrl && React.createElement( 'a', { href: openUrl || '#', key: 'advgb_image_link_url', target: '_blank', style: { float: 'right' } }, __('Preview', 'advanced-gutenberg') )], value: openUrl, placeholder: __('Enter URL…', 'advanced-gutenberg'), onChange: function onChange(text) { return setAttributes({ openUrl: text }); } }), React.createElement(ToggleControl, { label: __('Open link in new tab', 'advanced-gutenberg'), checked: linkInNewTab, onChange: function onChange() { return setAttributes({ linkInNewTab: !linkInNewTab }); } }) ), React.createElement( PanelBody, { title: __('Image Size', 'advanced-gutenberg') }, React.createElement(ToggleControl, { label: __('Full width', 'advanced-gutenberg'), checked: fullWidth, onChange: function onChange() { return setAttributes({ fullWidth: !fullWidth }); } }), React.createElement(RangeControl, { label: __('Height', 'advanced-gutenberg'), value: height, min: 100, max: 1000, onChange: function onChange(value) { return setAttributes({ height: value }); } }), !fullWidth && React.createElement(RangeControl, { label: __('Width', 'advanced-gutenberg'), value: width, min: 200, max: 1300, onChange: function onChange(value) { return setAttributes({ width: value }); } }), imageUrl && React.createElement(FocalPointPicker, { label: __('Focal Point Picker', 'advanced-gutenberg'), url: imageUrl, value: focalPoint, onChange: function onChange(value) { return setAttributes({ focalPoint: value }); } }), React.createElement(RangeControl, { label: __('Overlay opacity default', 'advanced-gutenberg'), value: defaultOpacity, min: 0, max: 100, onChange: function onChange(value) { return setAttributes({ defaultOpacity: value }); } }), React.createElement(RangeControl, { label: __('Overlay opacity hover', 'advanced-gutenberg'), value: overlayOpacity, min: 0, max: 100, onChange: function onChange(value) { return setAttributes({ overlayOpacity: value }); } }) ), React.createElement(PanelColorSettings, { title: __('Color Settings', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Title Color', 'advanced-gutenberg'), value: titleColor, onChange: function onChange(value) { return setAttributes({ titleColor: value === undefined ? '#fff' : value }); } }, { label: __('Subtitle Color', 'advanced-gutenberg'), value: subtitleColor, onChange: function onChange(value) { return setAttributes({ subtitleColor: value === undefined ? '#fff' : value }); } }, { label: __('Overlay Color', 'advanced-gutenberg'), value: overlayColor, onChange: function onChange(value) { return setAttributes({ overlayColor: value === undefined ? '#000' : value }); } }] }), React.createElement( PanelBody, { title: __('Text Alignment', 'advanced-gutenberg'), initialOpen: false }, React.createElement(SelectControl, { label: __('Vertical Alignment', 'advanced-gutenberg'), value: vAlign, options: [{ label: __('Top', 'advanced-gutenberg'), value: 'flex-start' }, { label: __('Center', 'advanced-gutenberg'), value: 'center' }, { label: __('Bottom', 'advanced-gutenberg'), value: 'flex-end' }], onChange: function onChange(value) { return setAttributes({ vAlign: value }); } }), React.createElement(SelectControl, { label: __('Horizontal Alignment', 'advanced-gutenberg'), value: hAlign, options: [{ label: __('Left', 'advanced-gutenberg'), value: 'flex-start' }, { label: __('Center', 'advanced-gutenberg'), value: 'center' }, { label: __('Right', 'advanced-gutenberg'), value: 'flex-end' }], onChange: function onChange(value) { return setAttributes({ hAlign: value }); } }) ) ) ), React.createElement( 'div', { className: blockClassName, style: { backgroundImage: 'url(' + (imageUrl || advgbBlocks.image_holder) + ')', backgroundPosition: focalPoint ? focalPoint.x * 100 + '% ' + focalPoint.y * 100 + '%' : undefined, height: height, width: width, justifyContent: vAlign, alignItems: hAlign } }, React.createElement('span', { className: 'advgb-image-overlay', style: { backgroundColor: overlayColor, opacity: defaultOpacity / 100 } }), !imageID && React.createElement(MediaUpload, { allowedTypes: ['image'], value: imageID, onSelect: function onSelect(image) { return setAttributes({ imageUrl: image.url, imageID: image.id, focalPoint: { "x": "0.50", "y": "0.50" } }); }, render: function render(_ref2) { var open = _ref2.open; return React.createElement( Button, { className: 'button button-large advgb-browse-image-btn', onClick: open }, __('Open media library', 'advanced-gutenberg') ); } }), React.createElement(RichText, { tagName: titleTag, className: 'advgb-image-title', value: title, onChange: function onChange(value) { return setAttributes({ title: value.trim() }); }, style: { color: titleColor }, isSelected: isSelected && currentEdit === 'title', unstableOnFocus: function unstableOnFocus() { return _this2.setState({ currentEdit: 'title' }); }, unstableOnSplit: function unstableOnSplit() { return null; }, placeholder: __('Enter title…', 'advanced-gutenberg'), allowedFormats: [] }), React.createElement(RichText, { tagName: subtitleTag, className: 'advgb-image-subtitle', value: subtitle, onChange: function onChange(value) { return setAttributes({ subtitle: value.trim() }); }, style: { color: subtitleColor }, isSelected: isSelected && currentEdit === 'subtitle', unstableOnFocus: function unstableOnFocus() { return _this2.setState({ currentEdit: 'subtitle' }); }, unstableOnSplit: function unstableOnSplit() { return null; }, placeholder: __('Enter subtitle…', 'advanced-gutenberg'), allowedFormats: [] }), React.createElement( 'style', null, '.' + blockIDX + '.advgb-image-block:hover .advgb-image-overlay {opacity: ' + overlayOpacity / 100 + ' !important;}' ) ) ); } }]); return AdvImage; }(Component); var advImageBlockIcon = React.createElement( 'svg', { height: '20', viewBox: '2 2 22 22', width: '20', xmlns: 'http://www.w3.org/2000/svg' }, React.createElement('path', { d: 'M0 0h24v24H0V0z', fill: 'none' }), React.createElement('path', { d: 'M1 5h2v14H1zm4 0h2v14H5zm17 0H10c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zM11 17l2.5-3.15L15.29 16l2.5-3.22L21 17H11z' }) ); var blockAttrs = { blockIDX: { type: 'string' }, openOnClick: { type: 'string', default: 'none' }, linkInNewTab: { type: 'boolean', default: true }, openUrl: { type: 'string' }, imageUrl: { type: 'string' }, imageID: { type: 'number' }, title: { type: 'string', default: 'Image title' }, titleColor: { type: 'string', default: '#fff' }, subtitle: { type: 'string', default: 'Your subtitle here' }, subtitleColor: { type: 'string', default: '#fff' }, overlayColor: { type: 'string', default: '#000' }, fullWidth: { type: 'boolean', default: true }, width: { type: 'number', default: 500 }, height: { type: 'number', default: 500 }, vAlign: { type: 'string', default: 'center' }, hAlign: { type: 'string', default: 'center' }, overlayOpacity: { type: 'number', default: 20 }, defaultOpacity: { type: 'number', default: 40 }, focalPoint: { type: 'object' }, changed: { type: 'boolean', default: false }, isPreview: { type: 'boolean', default: false }, titleTag: { type: 'string', default: 'h4' }, subtitleTag: { type: 'string', default: 'p' } }; registerBlockType('advgb/image', { title: __('Image - PublishPress', 'advanced-gutenberg'), description: __('Image/photo block with more options and styles.', 'advanced-gutenberg'), icon: { src: advImageBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('image', 'advanced-gutenberg'), __('advanced image', 'advanced-gutenberg'), __('photo', 'advanced-gutenberg'), __('box', 'advanced-gutenberg')], attributes: blockAttrs, example: { attributes: { isPreview: true } }, supports: { align: true, anchor: true }, edit: AdvImage, save: function save(_ref3) { var attributes = _ref3.attributes; var blockIDX = attributes.blockIDX, openOnClick = attributes.openOnClick, openUrl = attributes.openUrl, linkInNewTab = attributes.linkInNewTab, imageUrl = attributes.imageUrl, title = attributes.title, titleColor = attributes.titleColor, subtitle = attributes.subtitle, subtitleColor = attributes.subtitleColor, overlayColor = attributes.overlayColor, fullWidth = attributes.fullWidth, width = attributes.width, height = attributes.height, vAlign = attributes.vAlign, hAlign = attributes.hAlign, focalPoint = attributes.focalPoint, titleTag = attributes.titleTag, subtitleTag = attributes.subtitleTag; var linkURL = openOnClick === 'url' && !!openUrl ? openUrl : undefined; var blockClassName = ['advgb-image-block', fullWidth && 'full-width', openOnClick === 'lightbox' && !!imageUrl && 'advgb-lightbox', blockIDX].filter(Boolean).join(' '); return React.createElement( 'div', { className: blockClassName, style: { backgroundImage: 'url(' + imageUrl + ')', backgroundPosition: focalPoint ? focalPoint.x * 100 + '% ' + focalPoint.y * 100 + '%' : undefined, height: height, width: width, justifyContent: vAlign, alignItems: hAlign }, 'data-image': imageUrl }, React.createElement('a', { className: 'advgb-image-overlay', style: { backgroundColor: overlayColor }, target: linkInNewTab ? '_blank' : '_self', rel: 'noopener noreferrer', href: linkURL }), title && React.createElement(RichText.Content, { tagName: titleTag, className: 'advgb-image-title', style: { color: titleColor }, value: title }), subtitle && React.createElement(RichText.Content, { tagName: subtitleTag, className: 'advgb-image-subtitle', style: { color: subtitleColor }, value: subtitle }) ); }, deprecated: [{ attributes: _extends({}, blockAttrs, { overlayColor: { type: 'string', default: '#2196f3' }, fullWidth: { type: 'boolean', default: false } }), save: function save(_ref4) { var attributes = _ref4.attributes; var blockIDX = attributes.blockIDX, openOnClick = attributes.openOnClick, openUrl = attributes.openUrl, linkInNewTab = attributes.linkInNewTab, imageUrl = attributes.imageUrl, title = attributes.title, titleColor = attributes.titleColor, subtitle = attributes.subtitle, subtitleColor = attributes.subtitleColor, overlayColor = attributes.overlayColor, fullWidth = attributes.fullWidth, width = attributes.width, height = attributes.height, vAlign = attributes.vAlign, hAlign = attributes.hAlign, focalPoint = attributes.focalPoint; var linkURL = openOnClick === 'url' && !!openUrl ? openUrl : undefined; var blockClassName = ['advgb-image-block', fullWidth && 'full-width', openOnClick === 'lightbox' && !!imageUrl && 'advgb-lightbox', blockIDX].filter(Boolean).join(' '); return React.createElement( 'div', { className: blockClassName, style: { backgroundImage: 'url(' + imageUrl + ')', backgroundPosition: focalPoint ? focalPoint.x * 100 + '% ' + focalPoint.y * 100 + '%' : undefined, height: height, width: width, justifyContent: vAlign, alignItems: hAlign }, 'data-image': imageUrl }, React.createElement('a', { className: 'advgb-image-overlay', style: { backgroundColor: overlayColor }, target: linkInNewTab ? '_blank' : '_self', rel: 'noopener noreferrer', href: linkURL }), title && React.createElement( 'h4', { className: 'advgb-image-title', style: { color: titleColor } }, title ), subtitle && React.createElement( 'p', { className: 'advgb-image-subtitle', style: { color: subtitleColor } }, subtitle ) ); } }, { attributes: blockAttrs, save: function save(_ref5) { var attributes = _ref5.attributes; var openOnClick = attributes.openOnClick, openUrl = attributes.openUrl, linkInNewTab = attributes.linkInNewTab, imageUrl = attributes.imageUrl, title = attributes.title, titleColor = attributes.titleColor, subtitle = attributes.subtitle, subtitleColor = attributes.subtitleColor, overlayColor = attributes.overlayColor, fullWidth = attributes.fullWidth, width = attributes.width, height = attributes.height, vAlign = attributes.vAlign, hAlign = attributes.hAlign; var linkURL = openOnClick === 'url' && !!openUrl ? openUrl : undefined; var blockClassName = ['advgb-image-block', fullWidth && 'full-width', openOnClick === 'lightbox' && !!imageUrl && 'advgb-lightbox'].filter(Boolean).join(' '); return React.createElement( 'div', { className: blockClassName, style: { backgroundImage: 'url(' + imageUrl + ')', height: height, width: width, justifyContent: vAlign, alignItems: hAlign }, 'data-image': imageUrl }, React.createElement('a', { className: 'advgb-image-overlay', style: { backgroundColor: overlayColor }, target: linkInNewTab ? '_blank' : '_self', rel: 'noopener noreferrer', href: linkURL }), title && React.createElement( 'h4', { className: 'advgb-image-title', style: { color: titleColor } }, title ), subtitle && React.createElement( 'p', { className: 'advgb-image-subtitle', style: { color: subtitleColor } }, subtitle ) ); } }] }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/advlist/block.jsx": /*!*********************************************!*\ !*** ./src/assets/blocks/advlist/block.jsx ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType, createBlock = wpBlocks.createBlock; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, RichText = _wpBlockEditor.RichText, ColorPalette = _wpBlockEditor.ColorPalette, BlockControls = _wpBlockEditor.BlockControls; var BaseControl = wpComponents.BaseControl, RangeControl = wpComponents.RangeControl, PanelBody = wpComponents.PanelBody, Dashicon = wpComponents.Dashicon, ToolbarGroup = wpComponents.ToolbarGroup, ToolbarButton = wpComponents.ToolbarButton; var parse = __webpack_require__(/*! html-react-parser */ "./node_modules/html-react-parser/index.js"); var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAADzCAYAAACv4wv1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACRpJREFUeNrs3b+LFP0dwPGZ3b1f/qqexERUsDEBUZsUIUgiERP/AbG3EZQUgZBAqhRp0uQHBnwsIsFOsVUCD0kRCLHQVkQ5G6+IJEI89Lw7d3ey38vuPeM8M3P7Y+5ud329YHK6PrlbHN77+c7s7BhFAAAAAAAAAEBPXNU3ajQa2/J94ROVhP9pNpu7H3oq7ng7X0TgU4w8+9go0ccjRB4XfK+45PuLH8qjTnIeT0YNPh4i8LyY45zYY4HDwLGnQ0/K4h8k+MYIkWejjnOiFzv0H3o28t4W57wYxAVL/NEmek7kRVutZMoD5dO8aGsXTfl+Jnujgshr6a+3b9/++qlTp47Mzs7ub7fbUZIkcWfb/Ap8qVarJXEcRysrK28fP368dPXq1X9nom7nTPp2aqL3NdnjPkMvi3xju3v37jcvXLjwy07g3+08+SOdJ7/PboQ+x3qSvGu1Wi/X1tYe3rlz5zdXrlz5Vzfo7J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7ovfjTx/Tp/y9QvEqOciZ3Kyf0Zir0dr+hN/p8Ar0Xhd4TiVNPJBtyPbWsEDr0F3qvtbzQW5kJnnt8XhR5P6HnPZl07K1UxOk/N9GhutALJ3jU58m40tDDK0Rn+Z63tIhSAbdylh9loYsevnoiLTtI2wXTPBt63vcbaqInmamdDb73+3om8lomcrHDYKG3U4G3yqZ52bK9r9BzpnqUiTzKWbLnTXNxQ3n06ffM2yXbQNN8kGP03lTPiz39KpQXudBhsMneLog+GWaaDxRfd6rHmePz7CZyGG2iRwVRtzP/3eavKw19i9iL4s/7GaKH/CV3khNz3tn1gSIfKrqc2PPiz35vccNgUz3v60fL/H4jHzrATOxFvzbJYbipXhR/1D0mH/gjqyPFlxO8wKH64Aee4NF2RVgQfSR66DvuqMq4dzS87gsAUKKqoAEAgIn2PwEGAH9ZFbruawVFAAAAAElFTkSuQmCC'; var AdvList = function (_Component) { _inherits(AdvList, _Component); function AdvList() { _classCallCheck(this, AdvList); return _possibleConstructorReturn(this, (AdvList.__proto__ || Object.getPrototypeOf(AdvList)).apply(this, arguments)); } _createClass(AdvList, [{ key: 'componentWillMount', value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-list']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === 'undefined' ? 'undefined' : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: 'componentDidMount', value: function componentDidMount() { var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes, clientId = _props2.clientId; if (typeof attributes.values[0] !== 'undefined') { if (typeof attributes.values[0] === 'string' && attributes.values[0] !== '') { setAttributes({ values: parse(attributes.values[0]) }); } } setAttributes({ id: 'advgblist-' + clientId }); } }, { key: 'render', value: function render() { var listIcons = [{ label: __('None', 'advanced-gutenberg'), value: '' }, { label: __('Pushpin', 'advanced-gutenberg'), value: 'admin-post' }, { label: __('Configuration', 'advanced-gutenberg'), value: 'admin-generic' }, { label: __('Flag', 'advanced-gutenberg'), value: 'flag' }, { label: __('Star', 'advanced-gutenberg'), value: 'star-filled' }, { label: __('Checkmark', 'advanced-gutenberg'), value: 'yes' }, { label: __('Checkmark 2', 'advanced-gutenberg'), value: 'yes-alt' }, { label: __('Checkmark 3', 'advanced-gutenberg'), value: 'saved' }, { label: __('Minus', 'advanced-gutenberg'), value: 'minus' }, { label: __('Minus 2', 'advanced-gutenberg'), value: 'remove' }, { label: __('Plus', 'advanced-gutenberg'), value: 'plus' }, { label: __('Plus 2', 'advanced-gutenberg'), value: 'insert' }, { label: __('Play', 'advanced-gutenberg'), value: 'controls-play' }, { label: __('Arrow right', 'advanced-gutenberg'), value: 'arrow-right-alt' }, { label: __('Arrow right 2', 'advanced-gutenberg'), value: 'arrow-right-alt2' }, { label: __('X Cross 2', 'advanced-gutenberg'), value: 'no' }, { label: __('X Cross', 'advanced-gutenberg'), value: 'dismiss' }, { label: __('Warning', 'advanced-gutenberg'), value: 'warning' }, { label: __('Help', 'advanced-gutenberg'), value: 'editor-help' }, { label: __('Info', 'advanced-gutenberg'), value: 'info' }, { label: __('Info 2', 'advanced-gutenberg'), value: 'info-outline' }, { label: __('Circle', 'advanced-gutenberg'), value: 'marker' }]; var _props3 = this.props, attributes = _props3.attributes, isSelected = _props3.isSelected, insertBlocksAfter = _props3.insertBlocksAfter, mergeBlocks = _props3.mergeBlocks, setAttributes = _props3.setAttributes, onReplace = _props3.onReplace, className = _props3.className, blockID = _props3.clientId; var id = attributes.id, values = attributes.values, icon = attributes.icon, iconSize = attributes.iconSize, iconColor = attributes.iconColor, margin = attributes.margin, padding = attributes.padding, lineHeight = attributes.lineHeight, fontSize = attributes.fontSize, isPreview = attributes.isPreview; var listClassName = [className, id, icon && 'advgb-list', icon && 'advgb-list-' + icon].filter(Boolean).join(' '); var size = typeof iconSize != 'undefined' ? parseInt(iconSize) : 16; var marg = typeof margin != 'undefined' ? parseInt(margin) : 2; var padd = typeof padding != 'undefined' ? parseInt(padding) * 2 : 4; return isPreview ? React.createElement('img', { alt: __('Advanced List', 'advanced-gutenberg'), width: '100%', src: previewImageData }) : React.createElement( Fragment, null, React.createElement( BlockControls, null, React.createElement( ToolbarGroup, null, React.createElement(ToolbarButton, { label: __('Refresh this list when it conflict with other lists styles', 'advanced-gutenberg'), icon: 'update', onClick: function onClick() { return setAttributes({ id: 'advgblist-' + blockID }); } }) ) ), React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Text Settings', 'advanced-gutenberg'), initialOpen: false }, React.createElement(RangeControl, { label: __('Text size', 'advanced-gutenberg'), value: fontSize || '', onChange: function onChange(size) { return setAttributes({ fontSize: size }); }, min: 10, max: 100, beforeIcon: 'editor-textcolor', allowReset: true }) ), React.createElement( PanelBody, { title: __('Icon Settings', 'advanced-gutenberg') }, React.createElement( BaseControl, { label: __('List icon', 'advanced-gutenberg') }, React.createElement( 'div', { className: 'advgb-icon-items-wrapper' }, listIcons.map(function (item, index) { return React.createElement( 'div', { className: 'advgb-icon-item h20', key: index }, React.createElement( 'span', { onClick: function onClick() { return setAttributes({ icon: item.value }); }, className: [item.value === icon && 'active', item.value === '' && 'remove-icon'].filter(Boolean).join(' ') }, React.createElement(Dashicon, { icon: item.value }) ) ); }) ) ), icon && React.createElement( Fragment, null, React.createElement( PanelBody, { title: [__('Icon color', 'advanced-gutenberg'), React.createElement('span', { key: 'advgb-list-icon-color', className: 'dashicons dashicons-' + icon, style: { color: iconColor, marginLeft: '10px' } })], initialOpen: false }, React.createElement(ColorPalette, { value: iconColor, onChange: function onChange(value) { return setAttributes({ iconColor: value === undefined ? '#000' : value }); } }) ), React.createElement(RangeControl, { label: __('Icon size', 'advanced-gutenberg'), value: iconSize || '', onChange: function onChange(size) { return setAttributes({ iconSize: size }); }, min: 10, max: 100, allowReset: true }), React.createElement(RangeControl, { label: __('Line height', 'advanced-gutenberg'), value: lineHeight || '', onChange: function onChange(size) { return setAttributes({ lineHeight: size }); }, min: 0, max: 100, allowReset: true }), React.createElement(RangeControl, { label: __('Margin', 'advanced-gutenberg'), value: margin || '', onChange: function onChange(size) { return setAttributes({ margin: size }); }, min: 0, max: 100, allowReset: true }), React.createElement(RangeControl, { label: __('Padding', 'advanced-gutenberg'), value: padding || '', onChange: function onChange(size) { return setAttributes({ padding: size }); }, min: 0, max: 100, allowReset: true }) ) ) ), React.createElement(RichText, { multiline: 'li', tagName: 'ul', onChange: function onChange(value) { return setAttributes({ values: value }); }, value: values, className: listClassName, placeholder: __('Write advanced list…', 'advanced-gutenberg'), onMerge: mergeBlocks, unstableOnSplit: insertBlocksAfter ? function (before, after) { for (var _len = arguments.length, blocks = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { blocks[_key - 2] = arguments[_key]; } if (!blocks.length) { blocks.push(createBlock('core/paragraph')); } if (after.length) { blocks.push(createBlock('advgb/list', _extends({}, attributes, { values: after, id: undefined }))); } setAttributes({ values: before }); insertBlocksAfter(blocks); } : undefined, onRemove: function onRemove() { return onReplace([]); }, isSelected: isSelected }), React.createElement( 'div', null, React.createElement( 'style', null, '.' + id + ' li { font-size: ' + fontSize + 'px; }' ), icon && React.createElement( 'style', null, '.' + id + ' li {\n padding-left: ' + (size + padd) + 'px;\n margin-left: 0;\n }\n .' + id + ' li:before {\n font-size: ' + iconSize + 'px;\n color: ' + iconColor + ';\n line-height: ' + lineHeight + 'px;\n margin: ' + margin + 'px;\n padding: ' + padding + 'px;\n margin-left: -' + (size + padd + marg) + 'px\n }' ) ) ); } }]); return AdvList; }(Component); var listBlockIcon = React.createElement( 'svg', { height: '20', viewBox: '2 2 22 22', width: '20', xmlns: 'http://www.w3.org/2000/svg' }, React.createElement('path', { d: 'M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z' }), React.createElement('path', { d: 'M0 0h24v24H0z', fill: 'none' }) ); var listBlockAttrs = { id: { type: 'string' }, icon: { type: 'string' }, iconSize: { type: 'number', default: 16 }, iconColor: { type: 'string', default: '#000' }, fontSize: { type: 'number', default: 16 }, lineHeight: { type: 'number', default: 18 }, margin: { type: 'number', default: 2 }, padding: { type: 'number', default: 2 }, values: { type: 'array', source: 'children', selector: 'ul', default: [] }, changed: { type: 'boolean', default: false }, isPreview: { type: 'boolean', default: false } }; registerBlockType('advgb/list', { title: __('List - PublishPress', 'advanced-gutenberg'), description: __('List block with custom icons and styles.', 'advanced-gutenberg'), icon: { src: listBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('list', 'advanced-gutenberg'), __('advanced list', 'advanced-gutenberg'), __('icon', 'advanced-gutenberg')], attributes: listBlockAttrs, example: { attributes: { isPreview: true } }, transforms: { from: [{ type: 'block', blocks: ['core/list'], transform: function transform(_ref) { var values = _ref.values; return createBlock('advgb/list', { values: values, icon: 'controls-play', iconColor: '#ff0000' }); } }], to: [{ type: 'block', blocks: ['core/list'], transform: function transform(_ref2) { var values = _ref2.values; return createBlock('core/list', { nodeName: 'UL', values: values }); } }] }, merge: function merge(attributes, attributesToMerge) { var valuesToMerge = attributesToMerge.values || []; // Standard text-like block attribute. if (attributesToMerge.content) { valuesToMerge.push(attributesToMerge.content); } return _extends({}, attributes, { values: [].concat(_toConsumableArray(attributes.values), _toConsumableArray(valuesToMerge)) }); }, supports: { anchor: true }, edit: AdvList, save: function save(_ref3) { var attributes = _ref3.attributes; var id = attributes.id, values = attributes.values, icon = attributes.icon; var listClassName = [id, icon && 'advgb-list', icon && 'advgb-list-' + icon].filter(Boolean).join(' '); return React.createElement( 'div', null, React.createElement( 'ul', { className: listClassName }, values ) ); } }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/advtable/block.jsx": /*!**********************************************!*\ !*** ./src/assets/blocks/advtable/block.jsx ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType, createBlock = wpBlocks.createBlock; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, BlockControls = _wpBlockEditor.BlockControls, RichText = _wpBlockEditor.RichText, PanelColorSettings = _wpBlockEditor.PanelColorSettings; var PanelBody = wpComponents.PanelBody, BaseControl = wpComponents.BaseControl, RangeControl = wpComponents.RangeControl, SelectControl = wpComponents.SelectControl, ToggleControl = wpComponents.ToggleControl, TextControl = wpComponents.TextControl, Button = wpComponents.Button, ToolbarGroup = wpComponents.ToolbarGroup, ToolbarButton = wpComponents.ToolbarButton, DropdownMenu = wpComponents.DropdownMenu, Tooltip = wpComponents.Tooltip; var _lodash = lodash, times = _lodash.times; var tableBlockIcon = React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "2 2 22 22" }, React.createElement("path", { d: "M3 3v18h18V3H3zm8 16H5v-6h6v6zm0-8H5V5h6v6zm8 8h-6v-6h6v6zm0-8h-6V5h6v6z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ); var willSetContent = null; var lastValue = ''; var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAADxCAYAAADiK6r+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAB5NJREFUeNrs3M+LE/0dwPGZyUTR1gV/0PUiDx68tTyFHnpQilCfHnqueuhBEfwD2mOhh6L24qXQS499CsVLF6TtvZdipQ9alIeqbPEkRSi1uhalbjLTiU/izo7fxE0yyebJvF4wT9x9ds3E+M5nJjtfowgAAAAAAAAAAAAAABZLPMvfPE3Tud0XfEnlvf90Op0vX+hF4PEY9+MFgMYEv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+21hPaB2IdtIkfsO9umjry22AKxR0PCdl6O0MPn61EU/jHa1JHXHlv/QppoyOF5aJKLnSYGHoWCrn7dJBfGzCX0wHQfdj8CR/QjPq5jis8tuCHRR6JH3NvVOb0XJrL+CwA0Ut3TGgAAAAAAAAAAqPi/AAMAGqyWU8hzlH8AAAAASUVORK5CYII='; var AdvTable = function (_Component) { _inherits(AdvTable, _Component); function AdvTable() { _classCallCheck(this, AdvTable); var _this = _possibleConstructorReturn(this, (AdvTable.__proto__ || Object.getPrototypeOf(AdvTable)).apply(this, arguments)); _this.state = { initRow: 3, initCol: 3, selectedCell: null, rangeSelected: null, multiSelected: null, sectionSelected: null, updated: false }; _this.calculateRealColIndex = _this.calculateRealColIndex.bind(_this); _this.isMultiSelected = _this.isMultiSelected.bind(_this); _this.isRangeSelected = _this.isRangeSelected.bind(_this); return _this; } _createClass(AdvTable, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-table']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === "undefined" ? "undefined" : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: "componentDidMount", value: function componentDidMount() { this.calculateRealColIndex('head'); } }, { key: "componentDidUpdate", value: function componentDidUpdate() { var isSelected = this.props.isSelected; var _state = this.state, selectedCell = _state.selectedCell, updated = _state.updated; if (!isSelected && selectedCell) { this.setState({ selectedCell: null, rangeSelected: null, multiSelected: null }); } if (updated) { this.calculateRealColIndex(); this.setState({ updated: false }); } } }, { key: "createTable", value: function createTable() { var setAttributes = this.props.setAttributes; var _state2 = this.state, initRow = _state2.initRow, initCol = _state2.initCol; this.setState({ updated: true }); return setAttributes({ body: times(parseInt(initRow), function () { return { cells: times(parseInt(initCol), function () { return { content: '' }; }) }; }) }); } // Check if is multi cells selected }, { key: "isMultiSelected", value: function isMultiSelected() { var multiSelected = this.state.multiSelected; return multiSelected && multiSelected.length > 1; } // Check if is range cells selected }, { key: "isRangeSelected", value: function isRangeSelected() { var rangeSelected = this.state.rangeSelected; return rangeSelected && rangeSelected.toCell; } }, { key: "calculateRealColIndex", value: function calculateRealColIndex() { var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes; ['head', 'body', 'foot'].forEach(function (section) { if (!attributes[section].length) return null; var newSection = attributes[section].map(function (row, cRow) { return { cells: row.cells.map(function (cell, cCol) { cell.cI = cCol; for (var i = 0; i < cRow; i++) { for (var j = 0; j < attributes[section][i].cells.length; j++) { if (attributes[section][i].cells[j] && attributes[section][i].cells[j].colSpan) { if (attributes[section][i].cells[j].rowSpan && i + parseInt(attributes[section][i].cells[j].rowSpan) > cRow) { if (cCol === 0) { if (attributes[section][i].cells[j].cI <= cell.cI) { cell.cI += parseInt(attributes[section][i].cells[j].colSpan); } } else { var lastColSpan = !isNaN(parseInt(row.cells[cCol - 1].colSpan)) ? parseInt(row.cells[cCol - 1].colSpan) : 0; if (attributes[section][i].cells[j].cI === row.cells[cCol - 1].cI + 1 || attributes[section][i].cells[j].cI <= row.cells[cCol - 1].cI + lastColSpan) { cell.cI += parseInt(attributes[section][i].cells[j].colSpan); } } } } } } for (var _j = 0; _j < cCol; _j++) { if (row.cells[_j]) { if (row.cells[_j].colSpan) { cell.cI += parseInt(row.cells[_j].colSpan) - 1; } } } return cell; }) }; }); setAttributes(_defineProperty({}, section, newSection)); }); } }, { key: "insertRow", value: function insertRow(offset) { var _state3 = this.state, selectedCell = _state3.selectedCell, sectionSelected = _state3.sectionSelected; if (!selectedCell) { return null; } var _props3 = this.props, attributes = _props3.attributes, setAttributes = _props3.setAttributes; var currentSection = attributes[sectionSelected]; var rowIndex = selectedCell.rowIndex; var newRow = jQuery.extend(true, {}, currentSection[rowIndex]); newRow.cells.map(function (cell) { cell.content = ''; return cell; }); newRow.cells = newRow.cells.filter(function (cCell) { return !cCell.rowSpan; }); var newSection = [].concat(_toConsumableArray(currentSection.slice(0, rowIndex + offset)), [newRow], _toConsumableArray(currentSection.slice(rowIndex + offset))).map(function (row, rowIdx) { return { cells: row.cells.map(function (cell) { if (cell.rowSpan) { if (rowIdx <= rowIndex && rowIdx + parseInt(cell.rowSpan) - 1 >= rowIndex) { cell.rowSpan = parseInt(cell.rowSpan) + 1; } } return cell; }) }; }); this.setState({ selectedCell: null, sectionSelected: null, updated: true }); setAttributes(_defineProperty({}, sectionSelected, newSection)); } }, { key: "deleteRow", value: function deleteRow() { var _state4 = this.state, selectedCell = _state4.selectedCell, sectionSelected = _state4.sectionSelected; if (!selectedCell) { return null; } var _props4 = this.props, attributes = _props4.attributes, setAttributes = _props4.setAttributes; var currentSection = attributes[sectionSelected]; var rowIndex = selectedCell.rowIndex; var newSection = currentSection.map(function (row, cRowIdx) { return { cells: row.cells.map(function (cell) { if (cell.rowSpan) { if (cRowIdx <= rowIndex && parseInt(cell.rowSpan) + cRowIdx > rowIndex) { cell.rowSpan = parseInt(cell.rowSpan) - 1; if (cRowIdx === rowIndex) { var findColIdx = currentSection[cRowIdx + 1].cells.findIndex(function (elm) { return elm.cI === cell.cI || elm.cI > cell.cI; }); currentSection[cRowIdx + 1].cells.splice(findColIdx, 0, cell); } } } return cell; }) }; }); this.setState({ selectedCell: null, sectionSelected: null, updated: true }); if (newSection.length < 2) { alert(__('At least 1 row of current section must present.', 'advanced-gutenberg')); return false; } setAttributes(_defineProperty({}, sectionSelected, newSection.filter(function (row, index) { return index !== rowIndex; }))); } }, { key: "insertColumn", value: function insertColumn(offset) { var selectedCell = this.state.selectedCell; if (!selectedCell) { return null; } var _props5 = this.props, attributes = _props5.attributes, setAttributes = _props5.setAttributes; var cI = selectedCell.cI; var countRowSpan = 0; this.setState({ selectedCell: null, updated: true }); ['head', 'body', 'foot'].forEach(function (section) { return setAttributes(_defineProperty({}, section, attributes[section].map(function (row) { if (countRowSpan > 0) { // Skip if previous cell has row span countRowSpan--; return row; } var findColIdx = row.cells.findIndex(function (cell, idx) { return cell.cI === cI || row.cells[idx + 1] && row.cells[idx + 1].cI > cI; }); if (findColIdx === -1) { findColIdx = row.cells.length - 1; } if (row.cells[findColIdx].colSpan && row.cells[findColIdx].cI < cI + offset && row.cells[findColIdx].cI + parseInt(row.cells[findColIdx].colSpan) > cI + offset) { row.cells[findColIdx].colSpan++; if (row.cells[findColIdx].rowSpan) { countRowSpan = parseInt(row.cells[findColIdx].rowSpan) - 1; } return row; } else { var realOffset = offset; if (row.cells[findColIdx].cI > cI && offset === 1) { realOffset = 0; } else if (row.cells[findColIdx].cI < cI && offset === 0) { realOffset = 1; } return { cells: [].concat(_toConsumableArray(row.cells.slice(0, findColIdx + realOffset)), [{ content: '' }], _toConsumableArray(row.cells.slice(findColIdx + realOffset))) }; } }))); }); } }, { key: "deleteColumn", value: function deleteColumn() { var selectedCell = this.state.selectedCell; if (!selectedCell) { return null; } var _props6 = this.props, attributes = _props6.attributes, setAttributes = _props6.setAttributes; var cI = selectedCell.cI; var countRowSpan = 0; this.setState({ selectedCell: null, updated: true }); ['head', 'body', 'foot'].forEach(function (section) { return setAttributes(_defineProperty({}, section, attributes[section].map(function (row) { if (countRowSpan > 0) { countRowSpan--; return row; } var findColIdx = row.cells.findIndex(function (cell, idx) { return cell.cI === cI || row.cells[idx + 1] && row.cells[idx + 1].cI > cI; }); if (row.cells[findColIdx].rowSpan) { countRowSpan = parseInt(row.cells[findColIdx].rowSpan) - 1; } if (row.cells[findColIdx].colSpan) { row.cells[findColIdx].colSpan--; if (row.cells[findColIdx].colSpan <= 1) { delete row.cells[findColIdx].colSpan; } return row; } return { cells: row.cells.filter(function (cell, index) { return index !== findColIdx; }) }; }))); }); } }, { key: "mergeCells", value: function mergeCells() { var _state5 = this.state, rangeSelected = _state5.rangeSelected, sectionSelected = _state5.sectionSelected; if (!this.isRangeSelected()) { return null; } var _props7 = this.props, attributes = _props7.attributes, setAttributes = _props7.setAttributes; var fromCell = rangeSelected.fromCell, toCell = rangeSelected.toCell; var currentSection = attributes[sectionSelected]; var fCell = currentSection[fromCell.rowIdx].cells[fromCell.colIdx]; var tCell = currentSection[toCell.rowIdx].cells[toCell.colIdx]; var fcSpan = typeof fCell.colSpan === 'undefined' ? 0 : parseInt(fCell.colSpan) - 1; var frSpan = typeof fCell.rowSpan === 'undefined' ? 0 : parseInt(fCell.rowSpan) - 1; var tcSpan = typeof tCell.colSpan === 'undefined' ? 0 : parseInt(tCell.colSpan) - 1; var trSpan = typeof tCell.rowSpan === 'undefined' ? 0 : parseInt(tCell.rowSpan) - 1; var minRowIdx = Math.min(fromCell.rowIdx, toCell.rowIdx); var maxRowIdx = Math.max(fromCell.rowIdx + frSpan, toCell.rowIdx + trSpan); var minColIdx = Math.min(fromCell.RCI, toCell.RCI); var maxColIdx = Math.max(fromCell.RCI + fcSpan, toCell.RCI + tcSpan); var newSection = currentSection.map(function (row, curRowIndex) { if (curRowIndex < minRowIdx || curRowIndex > maxRowIdx) { return row; } return { cells: row.cells.map(function (cell, curColIndex) { if (curColIndex === Math.min(fromCell.colIdx, toCell.colIdx) && curRowIndex === Math.min(fromCell.rowIdx, toCell.rowIdx)) { var rowSpan = Math.abs(maxRowIdx - minRowIdx) + 1; var colSpan = Math.abs(maxColIdx - minColIdx) + 1; return _extends({}, cell, { rowSpan: rowSpan > 1 ? rowSpan : undefined, colSpan: colSpan > 1 ? colSpan : undefined }); } return cell; }).filter(function (cell, cCol) { return cell.cI < minColIdx || cCol === Math.min(fromCell.colIdx, toCell.colIdx) && curRowIndex === Math.min(fromCell.rowIdx, toCell.rowIdx) || cell.cI > maxColIdx; }) }; }); setAttributes(_defineProperty({}, sectionSelected, newSection)); this.setState({ selectedCell: null, sectionSelected: null, rangeSelected: null, updated: true }); } }, { key: "splitMergedCells", value: function splitMergedCells() { var _state6 = this.state, selectedCell = _state6.selectedCell, sectionSelected = _state6.sectionSelected; if (!selectedCell) { return null; } var _props8 = this.props, attributes = _props8.attributes, setAttributes = _props8.setAttributes; var colIndex = selectedCell.colIndex, rowIndex = selectedCell.rowIndex, cI = selectedCell.cI; var cellColSpan = attributes[sectionSelected][rowIndex].cells[colIndex].colSpan ? parseInt(attributes[sectionSelected][rowIndex].cells[colIndex].colSpan) : 1; var cellRowSpan = attributes[sectionSelected][rowIndex].cells[colIndex].rowSpan ? parseInt(attributes[sectionSelected][rowIndex].cells[colIndex].rowSpan) : 1; attributes[sectionSelected][rowIndex].cells[colIndex].colSpan = undefined; attributes[sectionSelected][rowIndex].cells[colIndex].rowSpan = undefined; var newSection = attributes[sectionSelected].map(function (row, curRowIndex) { if (curRowIndex >= rowIndex && curRowIndex < rowIndex + cellRowSpan) { var findColIdx = row.cells.findIndex(function (cell) { return cell.cI >= cI; }); var startRowFix = 0; if (curRowIndex === rowIndex) { startRowFix = 1; } return { cells: [].concat(_toConsumableArray(row.cells.slice(0, findColIdx + startRowFix)), _toConsumableArray(times(cellColSpan - startRowFix, function () { return { content: '' }; })), _toConsumableArray(row.cells.slice(findColIdx + startRowFix))) }; } return row; }); setAttributes(_defineProperty({}, sectionSelected, newSection)); this.setState({ selectedCell: null, sectionSelected: null, updated: true }); } // Parse styles from HTML form to React styles object }, { key: "getCellStyles", value: function getCellStyles(style) { var _state7 = this.state, selectedCell = _state7.selectedCell, sectionSelected = _state7.sectionSelected; var section = this.props.attributes[sectionSelected]; if (!selectedCell) return undefined; var rowIndex = selectedCell.rowIndex, colIndex = selectedCell.colIndex; if (style === 'borderColor') { return section[rowIndex].cells[colIndex].borderColorSaved; } var styles = AdvTable.parseStyles(section[rowIndex].cells[colIndex].styles); if ((typeof styles === "undefined" ? "undefined" : _typeof(styles)) === 'object') { var _convertedStyles = styles[style]; if (_convertedStyles && typeof _convertedStyles !== 'number' && _convertedStyles.indexOf('px')) { _convertedStyles = styles[style].replace(/px/g, ''); } return typeof _convertedStyles === 'undefined' && style === 'borderStyle' ? 'solid' : _convertedStyles; } else { if (typeof styles !== 'undefined') { var _convertedStyles2 = styles[style]; } return typeof convertedStyles === 'undefined' && style === 'borderStyle' ? 'solid' : undefined; } } }, { key: "updateCellsStyles", value: function updateCellsStyles(style) { var _this2 = this; var _state8 = this.state, selectedCell = _state8.selectedCell, rangeSelected = _state8.rangeSelected, multiSelected = _state8.multiSelected, sectionSelected = _state8.sectionSelected; if (!selectedCell && !this.isRangeSelected() && !this.isMultiSelected()) { return null; } var _props9 = this.props, attributes = _props9.attributes, setAttributes = _props9.setAttributes; var rowIndex = selectedCell.rowIndex, colIndex = selectedCell.colIndex; var section = attributes[sectionSelected]; var minRowIdx = void 0, maxRowIdx = void 0, minColIdx = void 0, maxColIdx = void 0; if (this.isRangeSelected()) { var fromCell = rangeSelected.fromCell, toCell = rangeSelected.toCell; var fCell = section[fromCell.rowIdx].cells[fromCell.colIdx]; var tCell = section[toCell.rowIdx].cells[toCell.colIdx]; var fcSpan = typeof fCell.colSpan === 'undefined' ? 0 : parseInt(fCell.colSpan) - 1; var frSpan = typeof fCell.rowSpan === 'undefined' ? 0 : parseInt(fCell.rowSpan) - 1; var tcSpan = typeof tCell.colSpan === 'undefined' ? 0 : parseInt(tCell.colSpan) - 1; var trSpan = typeof tCell.rowSpan === 'undefined' ? 0 : parseInt(tCell.rowSpan) - 1; minRowIdx = Math.min(fromCell.rowIdx, toCell.rowIdx); maxRowIdx = Math.max(fromCell.rowIdx + frSpan, toCell.rowIdx + trSpan); minColIdx = Math.min(fromCell.RCI, toCell.RCI); maxColIdx = Math.max(fromCell.RCI + fcSpan, toCell.RCI + tcSpan); } var newSection = section.map(function (row, curRowIndex) { if (!_this2.isRangeSelected() && !_this2.isMultiSelected() && curRowIndex !== rowIndex || _this2.isRangeSelected() && (curRowIndex < minRowIdx || curRowIndex > maxRowIdx) || _this2.isMultiSelected() && multiSelected.findIndex(function (c) { return c.rowIndex === curRowIndex; }) === -1) { return row; } return { cells: row.cells.map(function (cell, curColIndex) { if (!_this2.isRangeSelected() && !_this2.isMultiSelected() && curColIndex === colIndex || _this2.isRangeSelected() && cell.cI >= minColIdx && cell.cI <= maxColIdx || _this2.isMultiSelected() && multiSelected.findIndex(function (c) { return c.colIndex === curColIndex && c.rowIndex === curRowIndex; }) > -1) { cell.styles = AdvTable.parseStyles(cell.styles); if (style.borderColor) { // Set border color if (cell.styles.borderTopColor) { cell.styles = _extends({}, cell.styles, { borderTopColor: style.borderColor }); } if (cell.styles.borderRightColor) { cell.styles = _extends({}, cell.styles, { borderRightColor: style.borderColor }); } if (cell.styles.borderBottomColor) { cell.styles = _extends({}, cell.styles, { borderBottomColor: style.borderColor }); } if (cell.styles.borderLeftColor) { cell.styles = _extends({}, cell.styles, { borderLeftColor: style.borderColor }); } cell.borderColorSaved = style.borderColor; } else if (style.setBorder) { // Set border var cellBorderColor = cell.borderColorSaved || '#000'; var cellColSpan = !cell.colSpan ? 0 : parseInt(cell.colSpan) - 1; var cellRowSpan = !cell.rowSpan ? 0 : parseInt(cell.rowSpan) - 1; switch (style.setBorder) { case 'top': cell.styles = _extends({}, cell.styles, { borderTopColor: cellBorderColor }); break; case 'right': cell.styles = _extends({}, cell.styles, { borderRightColor: cellBorderColor }); break; case 'bottom': cell.styles = _extends({}, cell.styles, { borderBottomColor: cellBorderColor }); break; case 'left': cell.styles = _extends({}, cell.styles, { borderLeftColor: cellBorderColor }); break; case 'all': cell.styles = _extends({}, cell.styles, { borderTopColor: cellBorderColor, borderRightColor: cellBorderColor, borderBottomColor: cellBorderColor, borderLeftColor: cellBorderColor }); break; case 'none': cell.styles = _extends({}, cell.styles, { borderTopColor: undefined, borderRightColor: undefined, borderBottomColor: undefined, borderLeftColor: undefined }); break; case 'vert': if (cell.cI === minColIdx) { cell.styles = _extends({}, cell.styles, { borderRightColor: cellBorderColor }); } else if (cell.cI + cellColSpan === maxColIdx) { cell.styles = _extends({}, cell.styles, { borderLeftColor: cellBorderColor }); } else { cell.styles = _extends({}, cell.styles, { borderRightColor: cellBorderColor, borderLeftColor: cellBorderColor }); } break; case 'horz': if (curRowIndex === minRowIdx) { cell.styles = _extends({}, cell.styles, { borderBottomColor: cellBorderColor }); } else if (curRowIndex + cellRowSpan === maxRowIdx) { cell.styles = _extends({}, cell.styles, { borderTopColor: cellBorderColor }); } else { cell.styles = _extends({}, cell.styles, { borderTopColor: cellBorderColor, borderBottomColor: cellBorderColor }); } break; case 'inner': if (curRowIndex === minRowIdx) { cell.styles = _extends({}, cell.styles, { borderBottomColor: cellBorderColor }); } else if (curRowIndex + cellRowSpan === maxRowIdx) { cell.styles = _extends({}, cell.styles, { borderTopColor: cellBorderColor }); } else { cell.styles = _extends({}, cell.styles, { borderTopColor: cellBorderColor, borderBottomColor: cellBorderColor }); } if (cell.cI === minColIdx) { cell.styles = _extends({}, cell.styles, { borderRightColor: cellBorderColor }); } else if (cell.cI + cellColSpan === maxColIdx) { cell.styles = _extends({}, cell.styles, { borderLeftColor: cellBorderColor }); } else { cell.styles = _extends({}, cell.styles, { borderRightColor: cellBorderColor, borderLeftColor: cellBorderColor }); } break; case 'outer': if (curRowIndex === minRowIdx) { cell.styles = _extends({}, cell.styles, { borderTopColor: cellBorderColor }); } else if (curRowIndex + cellRowSpan === maxRowIdx) { cell.styles = _extends({}, cell.styles, { borderBottomColor: cellBorderColor }); } if (cell.cI === minColIdx) { cell.styles = _extends({}, cell.styles, { borderLeftColor: cellBorderColor }); } else if (cell.cI + cellColSpan === maxColIdx) { cell.styles = _extends({}, cell.styles, { borderRightColor: cellBorderColor }); } break; default: // Nothing break; } } else { cell.styles = _extends({}, cell.styles, style); } } return cell; }) }; }); setAttributes(_defineProperty({}, section, newSection)); } }, { key: "updateCellContent", value: function updateCellContent(content) { var cell = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var _state9 = this.state, selectedCell = _state9.selectedCell, sectionSelected = _state9.sectionSelected; if (!selectedCell && !cell) { return null; } var rowIndex = void 0, colIndex = void 0; if (cell) { rowIndex = cell.rowIndex; colIndex = cell.colIndex; } else { rowIndex = selectedCell.rowIndex; colIndex = selectedCell.colIndex; } var _props10 = this.props, attributes = _props10.attributes, setAttributes = _props10.setAttributes; var newSection = attributes[sectionSelected].map(function (row, curRowIndex) { if (curRowIndex !== rowIndex) { return row; } return { cells: row.cells.map(function (cell, curColIndex) { if (curColIndex !== colIndex) { return cell; } return _extends({}, cell, { content: content }); }) }; }); setAttributes(_defineProperty({}, sectionSelected, newSection)); } }, { key: "toggleSection", value: function toggleSection(section) { var _props11 = this.props, attributes = _props11.attributes, setAttributes = _props11.setAttributes; var sectionSelected = this.state.sectionSelected; var body = attributes.body; var cellsToAdd = [{ cells: body[0].cells.map(function (cell) { return { cI: cell.cI, colSpan: cell.colSpan }; }) }]; if (sectionSelected === section) { this.setState({ selectedCell: null, sectionSelected: null }); } if (!attributes[section].length) { return setAttributes(_defineProperty({}, section, cellsToAdd)); } return setAttributes(_defineProperty({}, section, [])); } }, { key: "renderSection", value: function renderSection(section) { var _this3 = this; var attributes = this.props.attributes; var _state10 = this.state, selectedCell = _state10.selectedCell, multiSelected = _state10.multiSelected, rangeSelected = _state10.rangeSelected, sectionSelected = _state10.sectionSelected; return attributes[section].map(function (_ref, rowIndex) { var cells = _ref.cells; return React.createElement( "tr", { key: rowIndex }, cells.map(function (_ref2, colIndex) { var content = _ref2.content, styles = _ref2.styles, colSpan = _ref2.colSpan, rowSpan = _ref2.rowSpan, cI = _ref2.cI; var cell = { rowIndex: rowIndex, colIndex: colIndex, cI: cI, section: section }; var isSelected = selectedCell && selectedCell.rowIndex === rowIndex && selectedCell.colIndex === colIndex && sectionSelected === section; if (_this3.isRangeSelected()) { var fromCell = rangeSelected.fromCell, toCell = rangeSelected.toCell; if (attributes[sectionSelected][fromCell.rowIdx] && attributes[sectionSelected][toCell.rowIdx]) { var fCell = attributes[sectionSelected][fromCell.rowIdx].cells[fromCell.colIdx]; var tCell = attributes[sectionSelected][toCell.rowIdx].cells[toCell.colIdx]; var fcSpan = typeof fCell.colSpan === 'undefined' ? 0 : parseInt(fCell.colSpan) - 1; var frSpan = typeof fCell.rowSpan === 'undefined' ? 0 : parseInt(fCell.rowSpan) - 1; var tcSpan = typeof tCell.colSpan === 'undefined' ? 0 : parseInt(tCell.colSpan) - 1; var trSpan = typeof tCell.rowSpan === 'undefined' ? 0 : parseInt(tCell.rowSpan) - 1; isSelected = rowIndex >= Math.min(fromCell.rowIdx, toCell.rowIdx) && rowIndex <= Math.max(fromCell.rowIdx + frSpan, toCell.rowIdx + trSpan) && cI >= Math.min(fromCell.RCI, toCell.RCI) && cI <= Math.max(fromCell.RCI + fcSpan, toCell.RCI + tcSpan) && section === sectionSelected; } } if (_this3.isMultiSelected()) { isSelected = multiSelected.findIndex(function (c) { return c.rowIndex === rowIndex && c.colIndex === colIndex; }) > -1 && multiSelected[0].section === section; } var cellClassName = [isSelected && 'cell-selected'].filter(Boolean).join(' '); styles = AdvTable.parseStyles(styles); return React.createElement( "td", { key: colIndex, className: cellClassName, style: styles, colSpan: colSpan, rowSpan: rowSpan, onClick: function onClick(e) { if (e.shiftKey) { if (!rangeSelected) return; if (!rangeSelected.fromCell) return; var _fromCell = rangeSelected.fromCell; if (section !== _fromCell.section) { alert(__('Cannot select multi cells from difference section!', 'advanced-gutenberg')); return; } var _toCell = { rowIdx: rowIndex, colIdx: colIndex, RCI: cI, section: section }; _this3.setState({ rangeSelected: { fromCell: _fromCell, toCell: _toCell }, multiSelected: null }); } else if (e.ctrlKey || e.metaKey) { var multiCells = multiSelected ? multiSelected : []; var existCell = multiCells.findIndex(function (cel) { return cel.rowIndex === rowIndex && cel.colIndex === colIndex; }); if (multiCells.length && section !== multiCells[0].section) { alert(__('Cannot select multi cells from difference section!', 'advanced-gutenberg')); return; } if (existCell === -1) { multiCells.push(cell); } else { multiCells.splice(existCell, 1); } _this3.setState({ multiSelected: multiCells, rangeSelected: null }); } else { _this3.setState({ rangeSelected: { fromCell: { rowIdx: rowIndex, colIdx: colIndex, RCI: cI, section: section } }, multiSelected: [cell] }); } } }, React.createElement(RichText, { className: "wp-block-table__cell-content", value: content, onChange: function onChange(value) { if (willSetContent) clearTimeout(willSetContent); lastValue = value; willSetContent = setTimeout(function () { return _this3.updateCellContent(value, selectedCell); }, 10); }, unstableOnFocus: function unstableOnFocus() { if (willSetContent) { _this3.updateCellContent(lastValue, selectedCell); clearTimeout(willSetContent); willSetContent = null; } _this3.setState({ selectedCell: cell, sectionSelected: section }); } /* onClick jump to the rescue in case unstableOnFocus * doesn't work due the cell is not focused */ , onClick: function onClick() { if (willSetContent) { _this3.updateCellContent(lastValue, selectedCell); clearTimeout(willSetContent); willSetContent = null; } _this3.setState({ selectedCell: cell, sectionSelected: section }); } }) ); }) ); }); } }, { key: "render", value: function render() { var _this4 = this; var _props12 = this.props, attributes = _props12.attributes, setAttributes = _props12.setAttributes, className = _props12.className; var head = attributes.head, body = attributes.body, foot = attributes.foot, maxWidth = attributes.maxWidth, tableCollapsed = attributes.tableCollapsed, hasFixedLayout = attributes.hasFixedLayout, isPreview = attributes.isPreview; var _state11 = this.state, initRow = _state11.initRow, initCol = _state11.initCol, selectedCell = _state11.selectedCell, rangeSelected = _state11.rangeSelected, multiSelected = _state11.multiSelected; var maxWidthVal = !!maxWidth ? maxWidth : undefined; var currentCell = selectedCell ? body[selectedCell.rowIndex].cells[selectedCell.colIndex] : null; // First time insert block, let user determine the table if (!body.length) { return isPreview ? React.createElement("img", { alt: __('Advanced Table', 'advanced-gutenberg'), width: "100%", src: previewImageData }) : React.createElement( Fragment, null, React.createElement( "div", { className: "advgb-init-table" }, React.createElement(TextControl, { type: "number", label: __('Column Count', 'advanced-gutenberg'), value: initCol, onChange: function onChange(value) { return _this4.setState({ initCol: value }); }, min: "1" }), React.createElement(TextControl, { type: "number", label: __('Row Count', 'advanced-gutenberg'), value: initRow, onChange: function onChange(value) { return _this4.setState({ initRow: value }); }, min: "1" }), React.createElement( Button, { isPrimary: true, onClick: function onClick() { return _this4.createTable(); } }, __('Create', 'advanced-gutenberg') ), React.createElement( "div", { style: { marginTop: 10 } }, React.createElement( "small", null, __('Hint: Hold CTRL key for multi cells selection. Hold SHIFT key for range cells selection.', 'advanced-gutenberg') ) ) ) ); } var TABLE_CONTROLS = [{ icon: 'table-row-before', title: __('Add Row Before', 'advanced-gutenberg'), isDisabled: !selectedCell || this.isRangeSelected() || this.isMultiSelected(), onClick: function onClick() { return _this4.insertRow(0); } }, { icon: 'table-row-after', title: __('Add Row After', 'advanced-gutenberg'), isDisabled: !selectedCell || this.isRangeSelected() || this.isMultiSelected(), onClick: function onClick() { return _this4.insertRow(1); } }, { icon: 'table-row-delete', title: __('Delete Row', 'advanced-gutenberg'), isDisabled: !selectedCell || this.isRangeSelected() || this.isMultiSelected(), onClick: function onClick() { return _this4.deleteRow(); } }, { icon: 'table-col-before', title: __('Add Column Before', 'advanced-gutenberg'), isDisabled: !selectedCell || this.isRangeSelected() || this.isMultiSelected(), onClick: function onClick() { return _this4.insertColumn(0); } }, { icon: 'table-col-after', title: __('Add Column After', 'advanced-gutenberg'), isDisabled: !selectedCell || this.isRangeSelected() || this.isMultiSelected(), onClick: function onClick() { return _this4.insertColumn(1); } }, { icon: 'table-col-delete', title: __('Delete Column', 'advanced-gutenberg'), isDisabled: !selectedCell || this.isRangeSelected() || this.isMultiSelected(), onClick: function onClick() { return _this4.deleteColumn(); } }, { icon: React.createElement( "svg", { width: "20", height: "20", viewBox: "4 2 18 18", className: "dashicon" }, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M4,5v13h17V5H4z M14,7v9h-3V7H14z M6,7h3v9H6V7z M19,16h-3V7h3V16z" }) ), title: __('Split Merged Cells', 'advanced-gutenberg'), isDisabled: !selectedCell || currentCell && !currentCell.rowSpan && !currentCell.colSpan || this.isRangeSelected() || this.isMultiSelected(), onClick: function onClick() { return _this4.splitMergedCells(); } }, { icon: React.createElement( "svg", { width: "20", height: "20", className: "dashicon", viewBox: "2 2 22 22" }, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("polygon", { points: "21,18 2,18 2,20 21,20 21,18" }), React.createElement("path", { d: "M19,10v4H4v-4H19 M20,8H3C2.45,8,2,8.45,2,9v6c0,0.55,0.45,1,1,1h17c0.55,0,1-0.45,1-1V9C21,8.45,20.55,8,20,8L20,8z" }), React.createElement("polygon", { points: "21,4 2,4 2,6 21,6 21,4" }) ), title: __('Merge Cells', 'advanced-gutenberg'), isDisabled: !this.isRangeSelected(), onClick: function onClick() { return _this4.mergeCells(); } }]; var BORDER_SELECT = [{ title: __('Border Top', 'advanced-gutenberg'), icon: React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, React.createElement("path", { d: "M7 21h2v-2H7v2zm0-8h2v-2H7v2zm4 0h2v-2h-2v2zm0 8h2v-2h-2v2zm-8-4h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2v-2H3v2zm0-4h2V7H3v2zm8 8h2v-2h-2v2zm8-8h2V7h-2v2zm0 4h2v-2h-2v2zM3 3v2h18V3H3zm16 14h2v-2h-2v2zm-4 4h2v-2h-2v2zM11 9h2V7h-2v2zm8 12h2v-2h-2v2zm-4-8h2v-2h-2v2z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ), onClick: function onClick() { return _this4.updateCellsStyles({ setBorder: 'top' }); } }, { title: __('Border Right', 'advanced-gutenberg'), icon: React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, React.createElement("path", { d: "M7 21h2v-2H7v2zM3 5h2V3H3v2zm4 0h2V3H7v2zm0 8h2v-2H7v2zm-4 8h2v-2H3v2zm8 0h2v-2h-2v2zm-8-8h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm8 8h2v-2h-2v2zm4-4h2v-2h-2v2zm4-10v18h2V3h-2zm-4 18h2v-2h-2v2zm0-16h2V3h-2v2zm-4 8h2v-2h-2v2zm0-8h2V3h-2v2zm0 4h2V7h-2v2z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ), onClick: function onClick() { return _this4.updateCellsStyles({ setBorder: 'right' }); } }, { title: __('Border Bottom', 'advanced-gutenberg'), icon: React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, React.createElement("path", { d: "M9 11H7v2h2v-2zm4 4h-2v2h2v-2zM9 3H7v2h2V3zm4 8h-2v2h2v-2zM5 3H3v2h2V3zm8 4h-2v2h2V7zm4 4h-2v2h2v-2zm-4-8h-2v2h2V3zm4 0h-2v2h2V3zm2 10h2v-2h-2v2zm0 4h2v-2h-2v2zM5 7H3v2h2V7zm14-4v2h2V3h-2zm0 6h2V7h-2v2zM5 11H3v2h2v-2zM3 21h18v-2H3v2zm2-6H3v2h2v-2z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ), onClick: function onClick() { return _this4.updateCellsStyles({ setBorder: 'bottom' }); } }, { title: __('Border Left', 'advanced-gutenberg'), icon: React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, React.createElement("path", { d: "M11 21h2v-2h-2v2zm0-4h2v-2h-2v2zm0-12h2V3h-2v2zm0 4h2V7h-2v2zm0 4h2v-2h-2v2zm-4 8h2v-2H7v2zM7 5h2V3H7v2zm0 8h2v-2H7v2zm-4 8h2V3H3v18zM19 9h2V7h-2v2zm-4 12h2v-2h-2v2zm4-4h2v-2h-2v2zm0-14v2h2V3h-2zm0 10h2v-2h-2v2zm0 8h2v-2h-2v2zm-4-8h2v-2h-2v2zm0-8h2V3h-2v2z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ), onClick: function onClick() { return _this4.updateCellsStyles({ setBorder: 'left' }); } }, { title: __('Border All', 'advanced-gutenberg'), icon: React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, React.createElement("path", { d: "M3 3v18h18V3H3zm8 16H5v-6h6v6zm0-8H5V5h6v6zm8 8h-6v-6h6v6zm0-8h-6V5h6v6z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ), onClick: function onClick() { return _this4.updateCellsStyles({ setBorder: 'all' }); } }, { title: __('Border None', 'advanced-gutenberg'), icon: React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, React.createElement("path", { d: "M7 5h2V3H7v2zm0 8h2v-2H7v2zm0 8h2v-2H7v2zm4-4h2v-2h-2v2zm0 4h2v-2h-2v2zm-8 0h2v-2H3v2zm0-4h2v-2H3v2zm0-4h2v-2H3v2zm0-4h2V7H3v2zm0-4h2V3H3v2zm8 8h2v-2h-2v2zm8 4h2v-2h-2v2zm0-4h2v-2h-2v2zm0 8h2v-2h-2v2zm0-12h2V7h-2v2zm-8 0h2V7h-2v2zm8-6v2h2V3h-2zm-8 2h2V3h-2v2zm4 16h2v-2h-2v2zm0-8h2v-2h-2v2zm0-8h2V3h-2v2z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ), onClick: function onClick() { return _this4.updateCellsStyles({ setBorder: 'none' }); } }]; if (this.isRangeSelected()) { var EXTRA_BORDER_SELECT = [{ title: __('Border Vertical', 'advanced-gutenberg'), icon: React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, React.createElement("path", { d: "M3 9h2V7H3v2zm0-4h2V3H3v2zm4 16h2v-2H7v2zm0-8h2v-2H7v2zm-4 0h2v-2H3v2zm0 8h2v-2H3v2zm0-4h2v-2H3v2zM7 5h2V3H7v2zm12 12h2v-2h-2v2zm-8 4h2V3h-2v18zm8 0h2v-2h-2v2zm0-8h2v-2h-2v2zm0-10v2h2V3h-2zm0 6h2V7h-2v2zm-4-4h2V3h-2v2zm0 16h2v-2h-2v2zm0-8h2v-2h-2v2z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ), onClick: function onClick() { return _this4.updateCellsStyles({ setBorder: 'vert' }); } }, { title: __('Border Horizontal', 'advanced-gutenberg'), icon: React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, React.createElement("path", { d: "M3 21h2v-2H3v2zM5 7H3v2h2V7zM3 17h2v-2H3v2zm4 4h2v-2H7v2zM5 3H3v2h2V3zm4 0H7v2h2V3zm8 0h-2v2h2V3zm-4 4h-2v2h2V7zm0-4h-2v2h2V3zm6 14h2v-2h-2v2zm-8 4h2v-2h-2v2zm-8-8h18v-2H3v2zM19 3v2h2V3h-2zm0 6h2V7h-2v2zm-8 8h2v-2h-2v2zm4 4h2v-2h-2v2zm4 0h2v-2h-2v2z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ), onClick: function onClick() { return _this4.updateCellsStyles({ setBorder: 'horz' }); } }, { title: __('Border Inner', 'advanced-gutenberg'), icon: React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, React.createElement("path", { d: "M3 21h2v-2H3v2zm4 0h2v-2H7v2zM5 7H3v2h2V7zM3 17h2v-2H3v2zM9 3H7v2h2V3zM5 3H3v2h2V3zm12 0h-2v2h2V3zm2 6h2V7h-2v2zm0-6v2h2V3h-2zm-4 18h2v-2h-2v2zM13 3h-2v8H3v2h8v8h2v-8h8v-2h-8V3zm6 18h2v-2h-2v2zm0-4h2v-2h-2v2z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ), onClick: function onClick() { return _this4.updateCellsStyles({ setBorder: 'inner' }); } }, { title: __('Border Outer', 'advanced-gutenberg'), icon: React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, React.createElement("path", { d: "M13 7h-2v2h2V7zm0 4h-2v2h2v-2zm4 0h-2v2h2v-2zM3 3v18h18V3H3zm16 16H5V5h14v14zm-6-4h-2v2h2v-2zm-4-4H7v2h2v-2z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ), onClick: function onClick() { return _this4.updateCellsStyles({ setBorder: 'outer' }); } }]; BORDER_SELECT = [].concat(_toConsumableArray(BORDER_SELECT), EXTRA_BORDER_SELECT); } var HORZ_ALIGNMENT_CONTROLS = [{ icon: 'editor-alignleft', title: __('Align left', 'advanced-gutenberg'), align: 'left' }, { icon: 'editor-aligncenter', title: __('Align center', 'advanced-gutenberg'), align: 'center' }, { icon: 'editor-alignright', title: __('Align right', 'advanced-gutenberg'), align: 'right' }, { icon: 'editor-justify', title: __('Align justify', 'advanced-gutenberg'), align: 'justify' }]; var VERT_ALIGNMENT_CONTROLS = [{ icon: React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24" }, React.createElement("path", { d: "M8 11h3v10h2V11h3l-4-4-4 4zM4 3v2h16V3H4z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ), title: __('Align top', 'advanced-gutenberg'), align: 'top' }, { icon: React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24" }, React.createElement("path", { d: "M8 19h3v4h2v-4h3l-4-4-4 4zm8-14h-3V1h-2v4H8l4 4 4-4zM4 11v2h16v-2H4z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ), title: __('Align middle', 'advanced-gutenberg'), align: 'middle' }, { icon: React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24" }, React.createElement("path", { d: "M16 13h-3V3h-2v10H8l4 4 4-4zM4 19v2h16v-2H4z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ), title: __('Align bottom', 'advanced-gutenberg'), align: 'bottom' }]; return isPreview ? React.createElement("img", { alt: __('Advanced Table', 'advanced-gutenberg'), width: "100%", src: previewImageData }) : React.createElement( Fragment, null, React.createElement( BlockControls, null, React.createElement( ToolbarGroup, null, React.createElement(DropdownMenu, { hasArrowIndicator: true, icon: "editor-table", label: __('Edit Table', 'advanced-gutenberg'), controls: TABLE_CONTROLS }), React.createElement(ToolbarButton, { icon: "update", label: __('Refresh table (Use this after using undo or redo)', 'advanced-gutenberg'), onClick: function onClick() { return _this4.calculateRealColIndex(); } }) ) ), React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Table Settings', 'advanced-gutenberg') }, React.createElement(RangeControl, { label: __('Max width (px)', 'advanced-gutenberg'), help: __('Set this to 0 to make max-width is 100%', 'advanced-gutenberg'), min: 0, max: 1999, value: maxWidth, onChange: function onChange(value) { return setAttributes({ maxWidth: value }); } }), React.createElement(ToggleControl, { label: __('Fixed width table cells', 'advanced-gutenberg'), checked: hasFixedLayout, onChange: function onChange() { return setAttributes({ hasFixedLayout: !hasFixedLayout }); } }), React.createElement(ToggleControl, { label: __('Table header', 'advanced-gutenberg'), checked: head && head.length, onChange: function onChange() { return _this4.toggleSection('head'); } }), React.createElement(ToggleControl, { label: __('Table footer', 'advanced-gutenberg'), checked: foot && foot.length, onChange: function onChange() { return _this4.toggleSection('foot'); } }), React.createElement(ToggleControl, { label: __('Border collapsed', 'advanced-gutenberg'), checked: tableCollapsed, onChange: function onChange() { return setAttributes({ tableCollapsed: !tableCollapsed }); } }) ), React.createElement( PanelBody, { title: __('Cell Settings', 'advanced-gutenberg') }, React.createElement(PanelColorSettings, { title: __('Color Settings', 'advanced-gutenberg'), colorSettings: [{ label: __('Background Color', 'advanced-gutenberg'), value: this.getCellStyles('backgroundColor'), onChange: function onChange(value) { return _this4.updateCellsStyles({ backgroundColor: value }); } }, { label: __('Text Color', 'advanced-gutenberg'), value: this.getCellStyles('color'), onChange: function onChange(value) { return _this4.updateCellsStyles({ color: value }); } }] }), React.createElement( PanelBody, { title: __('Border', 'advanced-gutenberg'), initialOpen: false }, React.createElement( "div", { className: "advgb-border-item-wrapper" }, BORDER_SELECT.map(function (item, index) { return React.createElement( "div", { className: "advgb-border-item", key: index }, React.createElement( Tooltip, { text: item.title }, React.createElement( "span", { onClick: item.onClick }, item.icon ) ) ); }) ), React.createElement(SelectControl, { label: __('Border Style', 'advanced-gutenberg'), value: this.getCellStyles('borderStyle'), options: [{ label: __('Solid', 'advanced-gutenberg'), value: 'solid' }, { label: __('Dashed', 'advanced-gutenberg'), value: 'dashed' }, { label: __('Dotted', 'advanced-gutenberg'), value: 'dotted' }, { label: __('None', 'advanced-gutenberg'), value: 'none' }], onChange: function onChange(value) { return _this4.updateCellsStyles({ borderStyle: value }); } }), React.createElement(RangeControl, { label: __('Border width', 'advanced-gutenberg'), value: this.getCellStyles('borderWidth') || 0, min: 0, max: 10, onChange: function onChange(value) { return _this4.updateCellsStyles({ borderWidth: value }); } }), React.createElement(PanelColorSettings, { title: __('Border Color', 'advanced-gutenberg'), colorSettings: [{ label: __('Border Color', 'advanced-gutenberg'), value: this.getCellStyles('borderColor'), onChange: function onChange(value) { return _this4.updateCellsStyles({ borderColor: value }); } }] }) ), React.createElement( PanelBody, { title: __('Padding', 'advanced-gutenberg'), initialOpen: false }, React.createElement(RangeControl, { label: __('Padding Top', 'advanced-gutenberg'), value: this.getCellStyles('paddingTop') || 0, min: 0, max: 100, onChange: function onChange(value) { return _this4.updateCellsStyles({ paddingTop: value }); } }), React.createElement(RangeControl, { label: __('Padding Right', 'advanced-gutenberg'), value: this.getCellStyles('paddingRight') || 0, min: 0, max: 100, onChange: function onChange(value) { return _this4.updateCellsStyles({ paddingRight: value }); } }), React.createElement(RangeControl, { label: __('Padding Bottom', 'advanced-gutenberg'), value: this.getCellStyles('paddingBottom') || 0, min: 0, max: 100, onChange: function onChange(value) { return _this4.updateCellsStyles({ paddingBottom: value }); } }), React.createElement(RangeControl, { label: __('Padding Left', 'advanced-gutenberg'), value: this.getCellStyles('paddingLeft') || 0, min: 0, max: 100, onChange: function onChange(value) { return _this4.updateCellsStyles({ paddingLeft: value }); } }) ), React.createElement( PanelBody, { title: __('Text Alignment', 'advanced-gutenberg'), initialOpen: false }, React.createElement( BaseControl, { help: __('Horizontal Align', 'advanced-gutenberg') }, React.createElement(ToolbarGroup, { controls: HORZ_ALIGNMENT_CONTROLS.map(function (control) { var isActive = _this4.getCellStyles('textAlign') === control.align; return _extends({}, control, { isActive: isActive, onClick: function onClick() { return _this4.updateCellsStyles({ textAlign: isActive ? undefined : control.align }); } }); }) }) ), React.createElement( BaseControl, { help: __('Vertical Align', 'advanced-gutenberg') }, React.createElement(ToolbarGroup, { controls: VERT_ALIGNMENT_CONTROLS.map(function (control) { var isActive = _this4.getCellStyles('verticalAlign') === control.align; return _extends({}, control, { isActive: isActive, onClick: function onClick() { return _this4.updateCellsStyles({ verticalAlign: isActive ? undefined : control.align }); } }); }) }) ) ) ) ), React.createElement( "table", { className: className, style: { maxWidth: maxWidthVal, borderCollapse: tableCollapsed ? 'collapse' : undefined, tableLayout: hasFixedLayout ? 'fixed' : undefined } }, !!head.length && React.createElement( "thead", null, this.renderSection('head') ), React.createElement( "tbody", null, this.renderSection('body') ), !!foot.length && React.createElement( "tfoot", null, this.renderSection('foot') ) ) ); } }], [{ key: "parseStyles", value: function parseStyles(styles) { if (typeof styles !== 'string') { return styles; } return styles.split(';').filter(function (style) { return style.split(':')[0] && style.split(':')[1]; }).map(function (style) { return [style.split(':')[0].trim().replace(/-./g, function (c) { return c.substr(1).toUpperCase(); }), style.split(':')[1].trim()]; }).reduce(function (styleObj, style) { return _extends({}, styleObj, _defineProperty({}, style[0], style[1])); }, {}); } }]); return AdvTable; }(Component); registerBlockType('advgb/table', { title: __('Table - PublishPress', 'advanced-gutenberg'), description: __('Table block with more styles and functions.', 'advanced-gutenberg'), icon: { src: tableBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('table', 'advanced-gutenberg'), __('advanced table', 'advanced-gutenberg'), __('cell', 'advanced-gutenberg'), __('data', 'advanced-gutenberg')], attributes: { head: { type: 'array', default: [], source: 'query', selector: 'thead tr', query: { cells: { type: 'array', default: [], source: 'query', selector: 'td, th', query: { content: { source: 'html' }, styles: { type: 'string', source: 'attribute', attribute: 'style' }, colSpan: { type: 'string', source: 'attribute', attribute: 'colspan' }, borderColorSaved: { type: 'string', source: 'attribute', attribute: 'data-border-color' } } } } }, body: { type: 'array', default: [], source: 'query', selector: 'tbody tr', query: { cells: { type: 'array', default: [], source: 'query', selector: 'td', query: { content: { source: 'html' }, styles: { type: 'string', source: 'attribute', attribute: 'style' }, colSpan: { type: 'string', source: 'attribute', attribute: 'colspan' }, rowSpan: { type: 'string', source: 'attribute', attribute: 'rowspan' }, borderColorSaved: { type: 'string', source: 'attribute', attribute: 'data-border-color' } } } } }, foot: { type: 'array', default: [], source: 'query', selector: 'tfoot tr', query: { cells: { type: 'array', default: [], source: 'query', selector: 'td, th', query: { content: { source: 'html' }, styles: { type: 'string', source: 'attribute', attribute: 'style' }, colSpan: { type: 'string', source: 'attribute', attribute: 'colspan' }, borderColorSaved: { type: 'string', source: 'attribute', attribute: 'data-border-color' } } } } }, maxWidth: { type: 'number', default: 0 }, hasFixedLayout: { type: 'boolean', default: false }, tableCollapsed: { type: 'boolean', default: false }, changed: { type: 'boolean', default: false }, isPreview: { type: 'boolean', default: false } }, example: { attributes: { isPreview: true } }, supports: { align: true, anchor: true }, styles: [{ name: 'default', label: __('Default', 'advanced-gutenberg'), isDefault: true }, { name: 'stripes', label: __('Stripes', 'advanced-gutenberg') }], edit: AdvTable, save: function save(_ref3) { var attributes = _ref3.attributes; var head = attributes.head, body = attributes.body, foot = attributes.foot, maxWidth = attributes.maxWidth, tableCollapsed = attributes.tableCollapsed, hasFixedLayout = attributes.hasFixedLayout; var maxWidthVal = !!maxWidth ? maxWidth : undefined; function renderSection(section) { var sectionTagName = section === 'head' ? 'th' : 'td'; return attributes[section].map(function (_ref4, rowIndex) { var cells = _ref4.cells; return React.createElement( "tr", { key: rowIndex }, cells.map(function (_ref5, colIndex) { var content = _ref5.content, styles = _ref5.styles, colSpan = _ref5.colSpan, rowSpan = _ref5.rowSpan, borderColorSaved = _ref5.borderColorSaved; return React.createElement(RichText.Content, { tagName: sectionTagName, value: content, key: colIndex, style: styles, colSpan: colSpan, rowSpan: rowSpan, "data-border-color": borderColorSaved }); }) ); }); } return React.createElement( "table", { className: "advgb-table-frontend", style: { maxWidth: maxWidthVal, borderCollapse: tableCollapsed ? 'collapse' : undefined, tableLayout: hasFixedLayout ? 'fixed' : undefined } }, !!head.length && React.createElement( "thead", null, renderSection('head') ), React.createElement( "tbody", null, renderSection('body') ), !!foot.length && React.createElement( "tfoot", null, renderSection('foot') ) ); }, transforms: { from: [{ type: 'block', blocks: ['core/table'], transform: function transform(attributes) { return createBlock('advgb/table', { body: attributes.body }); } }] }, deprecated: [{ attributes: { head: { type: 'array', default: [], source: 'query', selector: 'thead tr', query: { cells: { type: 'array', default: [], source: 'query', selector: 'td, th', query: { content: { source: 'html' }, styles: { type: 'string', source: 'attribute', attribute: 'style' }, colSpan: { type: 'string', source: 'attribute', attribute: 'colspan' }, borderColorSaved: { type: 'string', source: 'attribute', attribute: 'data-border-color' } } } } }, body: { type: 'array', default: [], source: 'query', selector: 'tbody tr', query: { cells: { type: 'array', default: [], source: 'query', selector: 'td', query: { content: { source: 'html' }, styles: { type: 'string', source: 'attribute', attribute: 'style' }, colSpan: { type: 'string', source: 'attribute', attribute: 'colspan' }, rowSpan: { type: 'string', source: 'attribute', attribute: 'rowspan' }, borderColorSaved: { type: 'string', source: 'attribute', attribute: 'data-border-color' } } } } }, foot: { type: 'array', default: [], source: 'query', selector: 'tfoot tr', query: { cells: { type: 'array', default: [], source: 'query', selector: 'td, th', query: { content: { source: 'html' }, styles: { type: 'string', source: 'attribute', attribute: 'style' }, colSpan: { type: 'string', source: 'attribute', attribute: 'colspan' }, borderColorSaved: { type: 'string', source: 'attribute', attribute: 'data-border-color' } } } } }, maxWidth: { type: 'number', default: 0 }, hasFixedLayout: { type: 'boolean', default: false }, tableCollapsed: { type: 'boolean', default: false }, changed: { type: 'boolean', default: false }, isPreview: { type: 'boolean', default: false } }, save: function save(_ref6) { var attributes = _ref6.attributes; var head = attributes.head, body = attributes.body, foot = attributes.foot, maxWidth = attributes.maxWidth, tableCollapsed = attributes.tableCollapsed, hasFixedLayout = attributes.hasFixedLayout; var maxWidthVal = !!maxWidth ? maxWidth : undefined; function renderSection(section) { return attributes[section].map(function (_ref7, rowIndex) { var cells = _ref7.cells; return React.createElement( "tr", { key: rowIndex }, cells.map(function (_ref8, colIndex) { var content = _ref8.content, styles = _ref8.styles, colSpan = _ref8.colSpan, rowSpan = _ref8.rowSpan, borderColorSaved = _ref8.borderColorSaved; return React.createElement(RichText.Content, { tagName: "td", value: content, key: colIndex, style: styles, colSpan: colSpan, rowSpan: rowSpan, "data-border-color": borderColorSaved }); }) ); }); } return React.createElement( "table", { className: "advgb-table-frontend", style: { maxWidth: maxWidthVal, borderCollapse: tableCollapsed ? 'collapse' : undefined, tableLayout: hasFixedLayout ? 'fixed' : undefined } }, !!head.length && React.createElement( "thead", null, renderSection('head') ), React.createElement( "tbody", null, renderSection('body') ), !!foot.length && React.createElement( "tfoot", null, renderSection('foot') ) ); } }] }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/advtabs/block.jsx": /*!*********************************************!*\ !*** ./src/assets/blocks/advtabs/block.jsx ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents, wpCompose) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType, createBlock = wpBlocks.createBlock, cloneBlock = wpBlocks.cloneBlock; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, RichText = _wpBlockEditor.RichText, PanelColorSettings = _wpBlockEditor.PanelColorSettings, InnerBlocks = _wpBlockEditor.InnerBlocks; var Dashicon = wpComponents.Dashicon, Tooltip = wpComponents.Tooltip, PanelBody = wpComponents.PanelBody, RangeControl = wpComponents.RangeControl, SelectControl = wpComponents.SelectControl, Button = wpComponents.Button, TextControl = wpComponents.TextControl; var _wp$data = wp.data, withDispatch = _wp$data.withDispatch, select = _wp$data.select, dispatch = _wp$data.dispatch; var compose = wpCompose.compose; var _lodash = lodash, times = _lodash.times; var svgPath = React.createElement( Fragment, null, React.createElement("path", { fill: "currentColor", d: "M491.2,474.55a1.93,1.93,0,0,1,0-2.84Z" }), React.createElement("path", { fill: "none", stroke: "currentColor", strokeMiterlimit: "10", strokeWidth: "7.43", d: "M248.71,475.78H34.46c-10.59,0-11.37-.8-11.37-11.22q0-206.92,0-413.84c0-4.89-.2-9.78-.08-14.66.21-8.43,3.91-12,12.18-12,41.14,0,82.29.08,123.44-.12,4.38,0,6.31,1.52,8,5.29,14.32,31.05,28.91,62,43.22,93,1.7,3.69,3.65,5,7.74,5q122.26-.18,244.52-.09c12.73,0,12.73,0,12.73,12.59V463.22c0,12.14-.4,12.56-12.39,12.56Z" }), React.createElement("path", { fill: "currentColor", d: "M257,24.15c23,0,46,.11,69-.09,4.67,0,6.33,1.24,6.29,6.12q-.33,37.57,0,75.17c0,4.52-1.39,6-5.93,6q-49.17-.24-98.34,0c-4.29,0-6.49-1.5-8.24-5.32C208,80.21,196,54.53,184.06,28.81c-2.08-4.48-2-4.64,3-4.65Q222.05,24.13,257,24.15Z" }), React.createElement("path", { fill: "currentColor", d: "M411.32,111.22c-18.92,0-37.85-.12-56.77.08-4.59,0-6.39-1.09-6.35-6q.33-37.6,0-75.21c0-4.53,1.41-6,5.95-6,36.43.15,72.85.07,109.27.1,6.91,0,9.69,2.29,11.09,9.08a27.87,27.87,0,0,1,.53,5.62q0,33.12,0,66.23c0,6.05-.13,6.13-6.05,6.13Z" }) ); var tabHorizontalIcon = React.createElement( "svg", { color: "#5954d6", xmlns: "http://www.w3.org/2000/svg", width: "50", height: "50", viewBox: "0 0 500 500", style: { backgroundColor: "#fff" } }, svgPath ); var tabVerticalIcon = React.createElement( "svg", { color: "#5954d6", xmlns: "http://www.w3.org/2000/svg", width: "50", height: "50", viewBox: "0 0 500 500", style: { backgroundColor: "#fff" }, transform: "rotate(-90) scale(-1, 1)" }, svgPath ); var TABS_STYLES = [{ name: 'horz', label: __('Horizontal', 'advanced-gutenberg'), icon: tabHorizontalIcon }, { name: 'vert', label: __('Vertical', 'advanced-gutenberg'), icon: tabVerticalIcon }]; var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAADzCAYAAACv4wv1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACiRJREFUeNrs3c1rHOcBwOGZ2V3JkoJcArEbKCWE4NC4EEMwlPYQY3qoaeihkEtPOZkGcogvaS7ufxCoIZReeuglh+BDC8WXkgRaSopPwW1CoDkEO20gbgyOYq0l7e5032U3jEaz0n7Maker54FhJVmRJjP6zfvO7GgVRQAAAAAAAAAAcIzEs/ii9Xr90L4XHHFp/gOtVqu6offjjgUO5QQfPlZW9PEM4o73+fqih+Fxp/v92zTRxyVFftCjyGH00LOPaRmxxxNGng84zsUdHxA9sH/caS70dJrY4ykiLwo7LEn/44nYYeTIR10mij2eMvIkF3jv8aWXXjrxyiuvnFlbW/tWmqZJp9Pp/Tf9Rzj24jjuLVtbW82bN29++tprr/1vY2Oj0485/5h/e+zY4zEiLxrFk8xj8swzz9Rv3Ljxk1OnTl3ufv5z3f+Rk0Zx2GdIT9Nmu93+tBv5n956663fv/rqq3czYeeXiUf2cUIfFnktvP3666+vX7169XdLS0s/s/tgfN0Z739v3br1y/Pnz/+9+247E3h7yCgfnnNPSws9M5rnz8V7kZ85c6bxwQcf/LnRaPzI7oKpRvjNd95556eXLl36Zz/wdi72bPAjj+rJhFP8JDtt767YL7qR/9BugqnP3Veff/753547d+5EfyCt5Xqb6MJ2Ms46FCy17pFnpXtO/mvn4lCO7qD5vWvXrv0gTKZzoSdDOpw+9IL71nedo7/88svfTZLktN0D5Xnqqad+nIm8V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/ePvtt//2xhtv3MnE3cotO/3HdlH8rVar9NDjfuj52OuZj9UyB4Vs6IKHvbPkPTPkgtBbBefrg8gPHOXrB31COFL0Y49y5wXZlYpzEaf92AefF4schgaf7Sl/AS5/Ea4zyfS9PsERKM6tXJyJPb/ySbT7ir1RHfYOmtmeBmG3ov2vtKfjnLPXx1ipuOAIFA85OiX9f09ysUdih4Mvbuem8EWxjzWqjxR6ZvqeZs4pBjFHBQeBpCByIzocPKIXXW0fGvlBF+EmnbrHBUeiqGCF4yGjucihOPZO7rG9T+Rj3/8+VnjdUT0fbDbkZMij0GG8UX2/x28+f9TRfNwRPTuqZx+z5+TZf+sIHUY+Tx+2dCYdxSce0QtG9mhIzAcFLngEvjf0KNrnVvPMeflMn14rWtk4t0LZEb0ocoHD8FF9WPTffM440/XSRtbMXXPRCFGLHA4e4Yf9GurEkZcWX0Hw4oaSpvXTBD7TEPcJHzgg9jLCBgAAAAAAZuX/AgwAYHi5yJYhRDUAAAAASUVORK5CYII='; /** * This allows for checking to see if the block needs to generate a new ID. */ var advgbTabsUniqueIDs = []; var AdvTabsWrapper = function (_Component) { _inherits(AdvTabsWrapper, _Component); function AdvTabsWrapper() { _classCallCheck(this, AdvTabsWrapper); var _this = _possibleConstructorReturn(this, (AdvTabsWrapper.__proto__ || Object.getPrototypeOf(AdvTabsWrapper)).apply(this, arguments)); _this.state = { viewport: 'desktop' }; return _this; } _createClass(AdvTabsWrapper, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-adv-tabs']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === "undefined" ? "undefined" : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: "componentDidUpdate", value: function componentDidUpdate() { var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes; var isTransform = attributes.isTransform; if (isTransform) { setAttributes({ isTransform: false }); this.props.updateTabActive(0); } } }, { key: "componentDidMount", value: function componentDidMount() { if (!this.props.attributes.uniqueID) { this.props.setAttributes({ uniqueID: '_' + this.props.clientId.substr(2, 9) }); advgbTabsUniqueIDs.push('_' + this.props.clientId.substr(2, 9)); } else if (advgbTabsUniqueIDs.includes(this.props.attributes.uniqueID)) { this.props.setAttributes({ uniqueID: '_' + this.props.clientId.substr(2, 9) }); advgbTabsUniqueIDs.push('_' + this.props.clientId.substr(2, 9)); } else { advgbTabsUniqueIDs.push(this.props.attributes.uniqueID); } this.props.setAttributes({ pid: "advgb-tabs-" + this.props.clientId }); this.updateTabHeaders(); this.updateTabAnchors(); this.props.resetOrder(); } }, { key: "updateTabsAttr", value: function updateTabsAttr(attrs) { var _props3 = this.props, setAttributes = _props3.setAttributes, clientId = _props3.clientId; var _ref = !wp.blockEditor ? dispatch('core/editor') : dispatch('core/block-editor'), updateBlockAttributes = _ref.updateBlockAttributes; var _ref2 = !wp.blockEditor ? select('core/editor') : select('core/block-editor'), getBlockOrder = _ref2.getBlockOrder; var childBlocks = getBlockOrder(clientId); setAttributes(attrs); childBlocks.forEach(function (childBlockId) { return updateBlockAttributes(childBlockId, attrs); }); this.props.resetOrder(); } }, { key: "updateTabsHeader", value: function updateTabsHeader(header, index) { var _props4 = this.props, attributes = _props4.attributes, setAttributes = _props4.setAttributes, clientId = _props4.clientId; var tabHeaders = attributes.tabHeaders; var _ref3 = !wp.blockEditor ? dispatch('core/editor') : dispatch('core/block-editor'), updateBlockAttributes = _ref3.updateBlockAttributes; var _ref4 = !wp.blockEditor ? select('core/editor') : select('core/block-editor'), getBlockOrder = _ref4.getBlockOrder; var childBlocks = getBlockOrder(clientId); var newHeaders = tabHeaders.map(function (item, idx) { if (index === idx) { item = header; } return item; }); setAttributes({ tabHeaders: newHeaders }); updateBlockAttributes(childBlocks[index], { header: header }); this.updateTabHeaders(); } }, { key: "updateTabHeaders", value: function updateTabHeaders() { var _props5 = this.props, attributes = _props5.attributes, clientId = _props5.clientId; var tabHeaders = attributes.tabHeaders; var _ref5 = !wp.blockEditor ? dispatch('core/editor') : dispatch('core/block-editor'), updateBlockAttributes = _ref5.updateBlockAttributes; var _ref6 = !wp.blockEditor ? select('core/editor') : select('core/block-editor'), getBlockOrder = _ref6.getBlockOrder; var childBlocks = getBlockOrder(clientId); childBlocks.forEach(function (childBlockId) { return updateBlockAttributes(childBlockId, { tabHeaders: tabHeaders }); }); } }, { key: "updateTabsAnchor", value: function updateTabsAnchor(anchor, index) { var _props6 = this.props, attributes = _props6.attributes, setAttributes = _props6.setAttributes, clientId = _props6.clientId; var tabAnchors = attributes.tabAnchors; var _ref7 = !wp.blockEditor ? dispatch('core/editor') : dispatch('core/block-editor'), updateBlockAttributes = _ref7.updateBlockAttributes; var _ref8 = !wp.blockEditor ? select('core/editor') : select('core/block-editor'), getBlockOrder = _ref8.getBlockOrder; var childBlocks = getBlockOrder(clientId); var newAnchors = tabAnchors.map(function (item, idx) { if (index === idx) { item = anchor; } return item; }); setAttributes({ tabAnchors: newAnchors }); updateBlockAttributes(childBlocks[index], { anchor: anchor }); this.updateTabAnchors(); } }, { key: "updateTabAnchors", value: function updateTabAnchors() { var _props7 = this.props, attributes = _props7.attributes, clientId = _props7.clientId; var tabAnchors = attributes.tabAnchors; var _ref9 = !wp.blockEditor ? dispatch('core/editor') : dispatch('core/block-editor'), updateBlockAttributes = _ref9.updateBlockAttributes; var _ref10 = !wp.blockEditor ? select('core/editor') : select('core/block-editor'), getBlockOrder = _ref10.getBlockOrder; var childBlocks = getBlockOrder(clientId); childBlocks.forEach(function (childBlockId) { return updateBlockAttributes(childBlockId, { tabAnchors: tabAnchors }); }); } }, { key: "duplicateTab", value: function duplicateTab(index) { var _props8 = this.props, attributes = _props8.attributes, setAttributes = _props8.setAttributes, clientId = _props8.clientId; var _ref11 = !wp.blockEditor ? dispatch('core/editor') : dispatch('core/block-editor'), insertBlock = _ref11.insertBlock; var _ref12 = !wp.blockEditor ? select('core/editor') : select('core/block-editor'), getBlockOrder = _ref12.getBlockOrder, getBlock = _ref12.getBlock; var childBlocks = getBlockOrder(clientId); var blockTab = getBlock(childBlocks[index]); var clonedTab = cloneBlock(blockTab); insertBlock(clonedTab, attributes.tabHeaders.length, clientId); setAttributes({ tabHeaders: [].concat(_toConsumableArray(attributes.tabHeaders), [attributes.tabHeaders[index] + " (" + __('copy', 'advanced-gutenberg') + ")"]), tabAnchors: [].concat(_toConsumableArray(attributes.tabAnchors), ['']) }); this.props.resetOrder(); } }, { key: "addTab", value: function addTab() { var _props9 = this.props, attributes = _props9.attributes, setAttributes = _props9.setAttributes, clientId = _props9.clientId; var _ref13 = !wp.blockEditor ? dispatch('core/editor') : dispatch('core/block-editor'), insertBlock = _ref13.insertBlock; var tabItemBlock = createBlock('advgb/tab'); insertBlock(tabItemBlock, attributes.tabHeaders.length, clientId); setAttributes({ tabHeaders: [].concat(_toConsumableArray(attributes.tabHeaders), [__('Tab Header', 'advanced-gutenberg')]), tabAnchors: [].concat(_toConsumableArray(attributes.tabAnchors), ['']) }); this.props.resetOrder(); } }, { key: "removeTab", value: function removeTab(index) { var _props10 = this.props, attributes = _props10.attributes, setAttributes = _props10.setAttributes, clientId = _props10.clientId; var _ref14 = !wp.blockEditor ? dispatch('core/editor') : dispatch('core/block-editor'), removeBlock = _ref14.removeBlock; var _ref15 = !wp.blockEditor ? select('core/editor') : select('core/block-editor'), getBlockOrder = _ref15.getBlockOrder; var childBlocks = getBlockOrder(clientId); removeBlock(childBlocks[index], false); setAttributes({ tabHeaders: attributes.tabHeaders.filter(function (vl, idx) { return idx !== index; }), tabAnchors: attributes.tabAnchors.filter(function (vl, idx) { return idx !== index; }) }); this.updateTabsAttr({ tabActive: 0 }); this.props.resetOrder(); } }, { key: "moveTab", value: function moveTab(index, direction) { var attributes = this.props.attributes; var headers = attributes.tabHeaders; var header = headers.splice(index, 1); var anchors = attributes.tabAnchors; var anchor = anchors.splice(index, 1); switch (direction) { case 'back': if (index === 0) { return; } this.onMove(index, index - 1, headers, header, anchors, anchor); break; case 'forward': if (index === headers.length) { return; } this.onMove(index, index + 1, headers, header, anchors, anchor); break; } } }, { key: "onMove", value: function onMove(index, newIndex, headers, header, anchors, anchor) { var _props11 = this.props, attributes = _props11.attributes, setAttributes = _props11.setAttributes, clientId = _props11.clientId; var _ref16 = !wp.blockEditor ? dispatch('core/editor') : dispatch('core/block-editor'), moveBlockToPosition = _ref16.moveBlockToPosition; var _ref17 = !wp.blockEditor ? select('core/editor') : select('core/block-editor'), getBlockOrder = _ref17.getBlockOrder; var childBlocks = getBlockOrder(clientId); headers.splice(newIndex, 0, header[0]); this.updateTabsHeader(attributes.tabHeaders[index], newIndex); this.updateTabsHeader(attributes.tabHeaders[newIndex], newIndex); anchors.splice(newIndex, 0, anchor[0]); moveBlockToPosition(childBlocks[index], clientId, clientId, newIndex); this.updateTabHeaders(); this.updateTabAnchors(); this.props.resetOrder(); this.props.updateTabActive(newIndex); } }, { key: "translatableText", value: function translatableText(text) { switch (text) { case 'desktop': return __('desktop', 'advanced-gutenberg'); break; case 'tablet': return __('tablet', 'advanced-gutenberg'); break; case 'mobile': return __('mobile', 'advanced-gutenberg'); break; } } }, { key: "render", value: function render() { var _this2 = this; var _props12 = this.props, attributes = _props12.attributes, setAttributes = _props12.setAttributes, clientId = _props12.clientId; var viewport = this.state.viewport; var tabHeaders = attributes.tabHeaders, tabAnchors = attributes.tabAnchors, tabActive = attributes.tabActive, tabActiveFrontend = attributes.tabActiveFrontend, tabsStyleD = attributes.tabsStyleD, tabsStyleT = attributes.tabsStyleT, tabsStyleM = attributes.tabsStyleM, headerBgColor = attributes.headerBgColor, headerTextColor = attributes.headerTextColor, bodyBgColor = attributes.bodyBgColor, bodyTextColor = attributes.bodyTextColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, borderColor = attributes.borderColor, borderRadius = attributes.borderRadius, pid = attributes.pid, activeTabBgColor = attributes.activeTabBgColor, activeTabTextColor = attributes.activeTabTextColor, isPreview = attributes.isPreview; var blockClass = ["advgb-tabs-wrapper", "advgb-tab-" + tabsStyleD + "-desktop", "advgb-tab-" + tabsStyleT + "-tablet", "advgb-tab-" + tabsStyleM + "-mobile"].filter(Boolean).join(' '); var deviceLetter = 'D'; if (viewport === 'tablet') deviceLetter = 'T'; if (viewport === 'mobile') deviceLetter = 'M'; return isPreview ? React.createElement("img", { alt: __('Advanced Tabs', 'advanced-gutenberg'), width: "100%", src: previewImageData }) : React.createElement( Fragment, null, React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Tabs Style', 'advanced-gutenberg') }, React.createElement( "div", { className: "advgb-columns-responsive-items" }, ['desktop', 'tablet', 'mobile'].map(function (device, index) { var itemClasses = ["advgb-columns-responsive-item", viewport === device && 'is-selected'].filter(Boolean).join(' '); return React.createElement( "div", { className: itemClasses, key: index, onClick: function onClick() { return _this2.setState({ viewport: device }); } }, _this2.translatableText(device) ); }) ), React.createElement( "div", { className: "advgb-tabs-styles" }, TABS_STYLES.map(function (style, index) { return React.createElement( Tooltip, { key: index, text: style.label }, React.createElement( Button, { className: 'advgb-tabs-style' + (style.name === attributes["tabsStyle" + deviceLetter] ? ' is-style-selected' : ''), isToggled: style.name === attributes["tabsStyle" + deviceLetter], onClick: function onClick() { return setAttributes(_defineProperty({}, "tabsStyle" + deviceLetter, style.name)); } }, style.icon ) ); }), viewport === 'mobile' && React.createElement( Tooltip, { text: __('Stacked', 'advanced-gutenberg') }, React.createElement( Button, { className: "advgb-tabs-style", isToggled: tabsStyleM === 'stack', onClick: function onClick() { return setAttributes({ tabsStyleM: 'stack' }); } }, React.createElement( "svg", { color: "#5954d6", width: "50px", height: "50px", viewBox: "0 0 26 26", xmlns: "http://www.w3.org/2000/svg", style: { backgroundColor: "#fff" } }, React.createElement("path", { fill: "currentColor", d: "M24.2480469,18.5H1.75C1.3359375,18.5,1,18.8359375,1,19.25v5C1,24.6640625,1.3359375,25,1.75,25 h22.4980469c0.4140625,0,0.75-0.3359375,0.75-0.75v-5C24.9980469,18.8359375,24.6621094,18.5,24.2480469,18.5z M23.4980469,23.5 H2.5V20h20.9980469V23.5z" }), React.createElement("path", { fill: "currentColor", d: "M24.25,9.75H1.75C1.3359375,9.75,1,10.0859375,1,10.5v5c0,0.4140625,0.3359375,0.75,0.75,0.75h22.5 c0.4140625,0,0.75-0.3359375,0.75-0.75v-5C25,10.0859375,24.6640625,9.75,24.25,9.75z M23.5,14.75h-21v-3.5h21V14.75z" }), React.createElement("path", { fill: "currentColor", d: "M1.75,7.5h22.4980469c0.4140625,0,0.75-0.3359375,0.75-0.75v-5c0-0.4140625-0.3359375-0.75-0.75-0.75H1.75 C1.3359375,1,1,1.3359375,1,1.75v5C1,7.1640625,1.3359375,7.5,1.75,7.5z M2.5,2.5h20.9980469V6H2.5V2.5z" }) ) ) ) ) ), React.createElement( PanelBody, { title: __('Tabs Settings', 'advanced-gutenberg') }, React.createElement(SelectControl, { label: __('Initial Open Tab', 'advanced-gutenberg'), value: tabActiveFrontend, options: tabHeaders.map(function (tab, index) { return { value: index, label: tab }; }), onChange: function onChange(value) { return setAttributes({ tabActiveFrontend: parseInt(value) }); } }) ), React.createElement(PanelColorSettings, { title: __('Tab Colors', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Background Color', 'advanced-gutenberg'), value: headerBgColor, onChange: function onChange(value) { return setAttributes({ headerBgColor: value === undefined ? '#e0e0e0' : value }); } }, { label: __('Text Color', 'advanced-gutenberg'), value: headerTextColor, onChange: function onChange(value) { return setAttributes({ headerTextColor: value === undefined ? '#fff' : value }); } }, { label: __('Active Tab Background Color', 'advanced-gutenberg'), value: activeTabBgColor, onChange: function onChange(value) { return setAttributes({ activeTabBgColor: value }); } }, { label: __('Active Tab Text Color', 'advanced-gutenberg'), value: activeTabTextColor, onChange: function onChange(value) { return setAttributes({ activeTabTextColor: value }); } }] }), React.createElement(PanelColorSettings, { title: __('Body Colors', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Background Color', 'advanced-gutenberg'), value: bodyBgColor, onChange: function onChange(value) { return setAttributes({ bodyBgColor: value }); } }, { label: __('Text Color', 'advanced-gutenberg'), value: bodyTextColor, onChange: function onChange(value) { return setAttributes({ bodyTextColor: value }); } }] }), React.createElement( PanelBody, { title: __('Border Settings', 'advanced-gutenberg'), initialOpen: false }, React.createElement(SelectControl, { label: __('Border Style', 'advanced-gutenberg'), value: borderStyle, options: [{ label: __('None', 'advanced-gutenberg'), value: 'none' }, { label: __('Solid', 'advanced-gutenberg'), value: 'solid' }, { label: __('Dashed', 'advanced-gutenberg'), value: 'dashed' }, { label: __('Dotted', 'advanced-gutenberg'), value: 'dotted' }], onChange: function onChange(value) { return setAttributes({ borderStyle: value }); } }), React.createElement(PanelColorSettings, { title: __('Border Color', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Border Color', 'advanced-gutenberg'), value: borderColor, onChange: function onChange(value) { return setAttributes({ borderColor: value }); } }] }), React.createElement(RangeControl, { label: __('Border width', 'advanced-gutenberg'), value: borderWidth, min: 1, max: 10, onChange: function onChange(value) { return setAttributes({ borderWidth: value }); } }), React.createElement(RangeControl, { label: __('Border radius', 'advanced-gutenberg'), value: borderRadius, min: 0, max: 100, onChange: function onChange(value) { return setAttributes({ borderRadius: value }); } }) ) ), React.createElement( "div", { className: blockClass, style: { border: 'none' } }, React.createElement( "ul", { className: "advgb-tabs-panel" }, tabHeaders.map(function (item, index) { return React.createElement( "li", { key: index, className: "advgb-tab " + (tabActive === index ? 'advgb-tab-active' : ''), style: { backgroundColor: headerBgColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement( "a", { id: tabAnchors[index], style: { color: headerTextColor }, onClick: function onClick() { _this2.props.updateTabActive(index); } }, React.createElement(RichText, { tagName: "p", value: item, onChange: function onChange(value) { return _this2.updateTabsHeader(value, index); }, unstableOnSplit: function unstableOnSplit() { return null; }, placeholder: __('Title…', 'advanced-gutenberg') }) ), advgbBlocks.advgb_pro === '1' && React.createElement( Fragment, null, React.createElement(TextControl, { placeholder: __('HTML Anchor', 'advanced-gutenberg'), value: tabAnchors[index], onChange: function onChange(value) { return _this2.updateTabsAnchor(value, index); }, className: "advgb-floating-anchor-field", style: { display: tabActive === index ? 'block' : 'none' } }), index > 0 && React.createElement( Tooltip, { text: __('Move back', 'advanced-gutenberg') }, React.createElement( "span", { className: "advgb-tab-move-back", onClick: function onClick() { return _this2.moveTab(index, 'back'); }, style: { display: tabActive === index ? 'block' : 'none' } }, React.createElement(Dashicon, { icon: "arrow-left-alt2" }) ) ), index < tabHeaders.length - 1 && React.createElement( Tooltip, { text: __('Move forward', 'advanced-gutenberg') }, React.createElement( "span", { className: "advgb-tab-move-forward", onClick: function onClick() { return _this2.moveTab(index, 'forward'); }, style: { display: tabActive === index ? 'block' : 'none' } }, React.createElement(Dashicon, { icon: "arrow-right-alt2" }) ) ), React.createElement( Tooltip, { text: __('Duplicate tab', 'advanced-gutenberg') }, React.createElement( "span", { className: "advgb-tab-duplicate", onClick: function onClick() { return _this2.duplicateTab(index); }, style: { display: tabActive === index ? 'block' : 'none' } }, React.createElement(Dashicon, { icon: "admin-page" }) ) ) ), tabHeaders.length > 1 && React.createElement( Tooltip, { text: __('Remove tab', 'advanced-gutenberg') }, React.createElement( "span", { className: "advgb-tab-remove", onClick: function onClick() { return _this2.removeTab(index); }, style: { display: tabActive === index ? 'block' : 'none' } }, React.createElement(Dashicon, { icon: "no" }) ) ) ); }), React.createElement( "li", { className: "advgb-tab advgb-add-tab", style: { borderRadius: borderRadius + 'px', borderWidth: borderWidth + 'px' } }, React.createElement( Tooltip, { text: __('Add tab', 'advanced-gutenberg') }, React.createElement( "span", { onClick: function onClick() { return _this2.addTab(); } }, React.createElement(Dashicon, { icon: "plus" }) ) ) ) ), React.createElement( "div", { className: "advgb-tab-body-wrapper", style: { backgroundColor: bodyBgColor, color: bodyTextColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement(InnerBlocks, { template: [['advgb/tab'], ['advgb/tab'], ['advgb/tab']], templateLock: false, allowedBlocks: ['advgb/tab'] }) ) ), !!pid && React.createElement( "style", null, activeTabBgColor && "#block-" + clientId + " li.advgb-tab.advgb-tab-active, #block-" + clientId + " li.advgb-tab.ui-tabs-active {\n background-color: " + activeTabBgColor + " !important;\n }", activeTabTextColor && "#block-" + clientId + " li.advgb-tab.advgb-tab-active a, #block-" + clientId + " li.advgb-tab.ui-tabs-active a {\n color: " + activeTabTextColor + " !important;\n }" ) ); } }]); return AdvTabsWrapper; }(Component); var tabsBlockIcon = React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24" }, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M21,3H3C1.9,3,1,3.9,1,5v14c0,1.1,0.9,2,2,2h18c1.1,0,2-0.9,2-2V5C23,3.9,22.1,3,21,3z M21,19H3V5h10v4h8V19z" }) ); var tabBlockAttrs = { tabHeaders: { type: 'array', default: [__('Tab 1', 'advanced-gutenberg'), __('Tab 2', 'advanced-gutenberg'), __('Tab 3', 'advanced-gutenberg')] }, tabActive: { type: 'number', default: 0 }, tabActiveFrontend: { type: 'number', default: 0 }, tabsStyleD: { type: 'string', default: 'horz' }, tabsStyleT: { type: 'string', default: 'vert' }, tabsStyleM: { type: 'string', default: 'stack' }, headerBgColor: { type: 'string', default: '#e0e0e0' }, headerTextColor: { type: 'string', default: '#fff' }, bodyBgColor: { type: 'string' }, bodyTextColor: { type: 'string' }, borderStyle: { type: 'string', default: 'solid' }, borderWidth: { type: 'number', default: 1 }, borderColor: { type: 'string' }, borderRadius: { type: 'number', default: 10 }, pid: { type: 'string' }, activeTabBgColor: { type: 'string' }, activeTabTextColor: { type: 'string' }, changed: { type: 'boolean', default: false }, isPreview: { type: 'boolean', default: false }, uniqueID: { type: 'string', default: '' }, isTransform: { type: 'boolean', default: false }, tabAnchors: { type: 'array', default: ['', '', ''] } }; registerBlockType('advgb/adv-tabs', { title: __('Tabs - PublishPress', 'advanced-gutenberg'), description: __('Create horizontal or vertical tabs to display your content.', 'advanced-gutenberg'), icon: { src: tabsBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: "advgb-category", keywords: [__('tabs', 'advanced-gutenberg'), __('advanced tabs', 'advanced-gutenberg'), __('cards', 'advanced-gutenberg')], attributes: tabBlockAttrs, example: { attributes: { isPreview: true } }, supports: { anchor: true }, edit: compose(withDispatch(function (dispatch, _ref18, _ref19) { var clientId = _ref18.clientId; var select = _ref19.select; var _select = select('core/block-editor'), getBlock = _select.getBlock; var _dispatch = dispatch('core/block-editor'), updateBlockAttributes = _dispatch.updateBlockAttributes; var block = getBlock(clientId); return { resetOrder: function resetOrder() { times(block.innerBlocks.length, function (n) { updateBlockAttributes(block.innerBlocks[n].clientId, { id: n }); }); }, updateTabActive: function updateTabActive(tabActive) { updateBlockAttributes(block.clientId, { tabActive: tabActive }); times(block.innerBlocks.length, function (n) { updateBlockAttributes(block.innerBlocks[n].clientId, { tabActive: tabActive }); }); this.resetOrder(); } }; }))(AdvTabsWrapper), save: function save(_ref20) { var attributes = _ref20.attributes; var tabHeaders = attributes.tabHeaders, tabAnchors = attributes.tabAnchors, tabActiveFrontend = attributes.tabActiveFrontend, tabsStyleD = attributes.tabsStyleD, tabsStyleT = attributes.tabsStyleT, tabsStyleM = attributes.tabsStyleM, headerBgColor = attributes.headerBgColor, headerTextColor = attributes.headerTextColor, bodyBgColor = attributes.bodyBgColor, bodyTextColor = attributes.bodyTextColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, borderColor = attributes.borderColor, borderRadius = attributes.borderRadius, pid = attributes.pid; var blockClass = ["advgb-tabs-wrapper", "advgb-tab-" + tabsStyleD + "-desktop", "advgb-tab-" + tabsStyleT + "-tablet", "advgb-tab-" + tabsStyleM + "-mobile", pid].filter(Boolean).join(' '); return React.createElement( "div", { className: blockClass, "data-tab-active": tabActiveFrontend }, React.createElement( "ul", { className: "advgb-tabs-panel" }, tabHeaders.map(function (header, index) { return React.createElement( "li", { key: index, className: "advgb-tab", style: { backgroundColor: headerBgColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement( "a", { id: tabAnchors[index], href: "#advgb-tabs-tab" + index, style: { color: headerTextColor } }, React.createElement(RichText.Content, { tagName: "span", value: header }) ) ); }) ), React.createElement( "div", { className: "advgb-tab-body-wrapper", style: { backgroundColor: bodyBgColor, color: bodyTextColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement(InnerBlocks.Content, null) ) ); }, deprecated: [{ attributes: _extends({}, tabBlockAttrs), save: function save(_ref21) { var attributes = _ref21.attributes; var tabHeaders = attributes.tabHeaders, tabActiveFrontend = attributes.tabActiveFrontend, tabsStyleD = attributes.tabsStyleD, tabsStyleT = attributes.tabsStyleT, tabsStyleM = attributes.tabsStyleM, headerBgColor = attributes.headerBgColor, headerTextColor = attributes.headerTextColor, bodyBgColor = attributes.bodyBgColor, bodyTextColor = attributes.bodyTextColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, borderColor = attributes.borderColor, borderRadius = attributes.borderRadius, pid = attributes.pid; var blockClass = ["advgb-tabs-wrapper", "advgb-tab-" + tabsStyleD + "-desktop", "advgb-tab-" + tabsStyleT + "-tablet", "advgb-tab-" + tabsStyleM + "-mobile", pid].filter(Boolean).join(' '); return React.createElement( "div", { className: blockClass, "data-tab-active": tabActiveFrontend }, React.createElement( "ul", { className: "advgb-tabs-panel" }, tabHeaders.map(function (header, index) { return React.createElement( "li", { key: index, className: "advgb-tab", style: { backgroundColor: headerBgColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement( "a", { href: "#advgb-tabs-tab" + index, style: { color: headerTextColor } }, React.createElement(RichText.Content, { tagName: "span", value: header }) ) ); }) ), React.createElement( "div", { className: "advgb-tab-body-wrapper", style: { backgroundColor: bodyBgColor, color: bodyTextColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement(InnerBlocks.Content, null) ) ); } }, { attributes: _extends({}, tabBlockAttrs, { isTransform: { type: 'boolean', default: false } }), save: function save(_ref22) { var attributes = _ref22.attributes; var tabHeaders = attributes.tabHeaders, tabActiveFrontend = attributes.tabActiveFrontend, tabsStyleD = attributes.tabsStyleD, tabsStyleT = attributes.tabsStyleT, tabsStyleM = attributes.tabsStyleM, headerBgColor = attributes.headerBgColor, headerTextColor = attributes.headerTextColor, bodyBgColor = attributes.bodyBgColor, bodyTextColor = attributes.bodyTextColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, borderColor = attributes.borderColor, borderRadius = attributes.borderRadius, pid = attributes.pid; var blockClass = ["advgb-tabs-wrapper", "advgb-tab-" + tabsStyleD + "-desktop", "advgb-tab-" + tabsStyleT + "-tablet", "advgb-tab-" + tabsStyleM + "-mobile", pid].filter(Boolean).join(' '); return React.createElement( "div", { className: blockClass, "data-tab-active": tabActiveFrontend }, React.createElement( "ul", { className: "advgb-tabs-panel" }, tabHeaders.map(function (header, index) { return React.createElement( "li", { key: index, className: "advgb-tab", style: { backgroundColor: headerBgColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement( "a", { href: "#advgb-tabs-tab" + index, style: { color: headerTextColor } }, React.createElement( "span", null, header ) ) ); }) ), React.createElement( "div", { className: "advgb-tab-body-wrapper", style: { backgroundColor: bodyBgColor, color: bodyTextColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement(InnerBlocks.Content, null) ) ); } }, { attributes: _extends({}, tabBlockAttrs, { uniqueID: { type: 'string', default: '' } }), save: function save(_ref23) { var attributes = _ref23.attributes; var tabHeaders = attributes.tabHeaders, tabActiveFrontend = attributes.tabActiveFrontend, tabsStyleD = attributes.tabsStyleD, tabsStyleT = attributes.tabsStyleT, tabsStyleM = attributes.tabsStyleM, headerBgColor = attributes.headerBgColor, headerTextColor = attributes.headerTextColor, bodyBgColor = attributes.bodyBgColor, bodyTextColor = attributes.bodyTextColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, borderColor = attributes.borderColor, borderRadius = attributes.borderRadius, pid = attributes.pid; var blockClass = ["advgb-tabs-wrapper", "advgb-tab-" + tabsStyleD + "-desktop", "advgb-tab-" + tabsStyleT + "-tablet", "advgb-tab-" + tabsStyleM + "-mobile"].filter(Boolean).join(' '); return React.createElement( "div", { id: pid, className: blockClass, "data-tab-active": tabActiveFrontend }, React.createElement( "ul", { className: "advgb-tabs-panel" }, tabHeaders.map(function (header, index) { return React.createElement( "li", { key: index, className: "advgb-tab", style: { backgroundColor: headerBgColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement( "a", { href: "#" + pid + "-" + index, style: { color: headerTextColor } }, React.createElement( "span", null, header ) ) ); }) ), React.createElement( "div", { className: "advgb-tab-body-wrapper", style: { backgroundColor: bodyBgColor, color: bodyTextColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement(InnerBlocks.Content, null) ) ); } }] }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components, wp.compose); /***/ }), /***/ "./src/assets/blocks/advtabs/tab.jsx": /*!*******************************************!*\ !*** ./src/assets/blocks/advtabs/tab.jsx ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, InnerBlocks = _wpBlockEditor.InnerBlocks; var select = wp.data.select; var tabsBlockIcon = React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24" }, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M21,3H3C1.9,3,1,3.9,1,5v14c0,1.1,0.9,2,2,2h18c1.1,0,2-0.9,2-2V5C23,3.9,22.1,3,21,3z M21,19H3V5h10v4h8V19z" }) ); /** * This allows for checking to see if the block needs to generate a new ID. */ var advgbTabsUniqueIDs = []; var TabItemEdit = function (_Component) { _inherits(TabItemEdit, _Component); function TabItemEdit() { _classCallCheck(this, TabItemEdit); return _possibleConstructorReturn(this, (TabItemEdit.__proto__ || Object.getPrototypeOf(TabItemEdit)).apply(this, arguments)); } _createClass(TabItemEdit, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes, clientId = _props.clientId; var _ref = !wp.blockEditor ? select('core/editor') : select('core/block-editor'), getBlockRootClientId = _ref.getBlockRootClientId, getBlockAttributes = _ref.getBlockAttributes; var rootBlockId = getBlockRootClientId(clientId); var rootBlockAttrs = getBlockAttributes(rootBlockId); // Apply parent style if newly inserted if (attributes.changed !== true) { if (rootBlockAttrs !== null && rootBlockAttrs.needUpdate !== false) { Object.keys(rootBlockAttrs).map(function (attribute) { attributes[attribute] = rootBlockAttrs[attribute]; }); // Done applied, we will not do this again setAttributes({ changed: true }); } } } }, { key: "componentDidMount", value: function componentDidMount() { var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes; var id = attributes.id, tabHeaders = attributes.tabHeaders, tabAnchors = attributes.tabAnchors; if (!this.props.attributes.uniqueID) { this.props.setAttributes({ uniqueID: '_' + this.props.clientId.substr(2, 9) }); advgbTabsUniqueIDs.push('_' + this.props.clientId.substr(2, 9)); } else if (advgbTabsUniqueIDs.includes(this.props.attributes.uniqueID)) { this.props.setAttributes({ uniqueID: '_' + this.props.clientId.substr(2, 9) }); advgbTabsUniqueIDs.push('_' + this.props.clientId.substr(2, 9)); } else { advgbTabsUniqueIDs.push(this.props.attributes.uniqueID); } setAttributes({ header: tabHeaders[id] }); if (typeof tabAnchors !== 'undefined') { setAttributes({ anchor: tabAnchors[id] }); } } }, { key: "render", value: function render() { var attributes = this.props.attributes; var tabActive = attributes.tabActive, id = attributes.id, uniqueID = attributes.uniqueID; var ALLOWED_BLOCKS = wp.blocks.getBlockTypes().map(function (block) { return block.name; }).filter(function (blockName) { return blockName !== 'advgb/adv-tabs' && blockName !== 'advgb/tab'; }); var tabClassName = ["advgb-tab-" + uniqueID, 'advgb-tab-body'].filter(Boolean).join(' '); return React.createElement( Fragment, null, React.createElement( "div", { className: tabClassName, style: { display: id === tabActive ? 'block' : 'none' } }, React.createElement(InnerBlocks, { template: [['core/paragraph']], templateLock: false, allowedBlocks: ALLOWED_BLOCKS }) ) ); } }]); return TabItemEdit; }(Component); registerBlockType('advgb/tab', { title: __('Tab Item - PublishPress', 'advanced-gutenberg'), parent: ['advgb/adv-tabs'], icon: { src: tabsBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', attributes: { id: { type: 'number', default: 0 }, pid: { type: 'string' }, header: { type: 'html' }, anchor: { type: 'string' }, tabActive: { type: 'number', default: 0 }, changed: { type: 'boolean', default: false }, tabHeaders: { type: 'array', default: [__('Tab 1', 'advanced-gutenberg'), __('Tab 2', 'advanced-gutenberg'), __('Tab 3', 'advanced-gutenberg')] }, tabAnchors: { type: 'array', default: ['', '', ''] }, uniqueID: { type: 'string', default: '' } }, supports: { reusable: false }, keywords: [__('tab', 'advanced-gutenberg')], edit: TabItemEdit, save: function save(_ref2) { var attributes = _ref2.attributes; var id = attributes.id, uniqueID = attributes.uniqueID, header = attributes.header, anchor = attributes.anchor; var tabClassName = ["advgb-tab-" + uniqueID, 'advgb-tab-body'].filter(Boolean).join(' '); return React.createElement( "div", { className: "advgb-tab-body-container" }, React.createElement( "div", { className: "advgb-tab-body-header advgb-tab-class-" + anchor }, header ), React.createElement( "div", { className: tabClassName, "aria-labelledby": "advgb-tabs-tab" + id }, React.createElement(InnerBlocks.Content, null) ) ); }, deprecated: [{ attributes: { id: { type: 'number', default: 0 }, pid: { type: 'string' }, header: { type: 'html' }, tabActive: { type: 'number', default: 0 }, changed: { type: 'boolean', default: false }, tabHeaders: { type: 'array', default: [__('Tab 1', 'advanced-gutenberg'), __('Tab 2', 'advanced-gutenberg'), __('Tab 3', 'advanced-gutenberg')] }, uniqueID: { type: 'string', default: '' } }, supports: { reusable: false }, save: function save(_ref3) { var attributes = _ref3.attributes; var id = attributes.id, uniqueID = attributes.uniqueID, header = attributes.header; var tabClassName = ["advgb-tab-" + uniqueID, 'advgb-tab-body'].filter(Boolean).join(' '); return React.createElement( "div", { className: "advgb-tab-body-container" }, React.createElement( "div", { className: "advgb-tab-body-header" }, header ), React.createElement( "div", { className: tabClassName, "aria-labelledby": "advgb-tabs-tab" + id }, React.createElement(InnerBlocks.Content, null) ) ); } }, { attributes: { pid: { type: 'string' }, header: { type: 'html' }, tabActive: { type: 'number', default: 0 }, changed: { type: 'boolean', default: false }, tabHeaders: { type: 'array', default: [__('Tab 1', 'advanced-gutenberg'), __('Tab 2', 'advanced-gutenberg'), __('Tab 3', 'advanced-gutenberg')] }, uniqueID: { type: 'string', default: '' } }, save: function save(_ref4) { var attributes = _ref4.attributes; var pid = attributes.pid, header = attributes.header; return React.createElement( "div", { className: "advgb-tab-body-container" }, React.createElement( "div", { className: "advgb-tab-body-header" }, header ), React.createElement( "div", { className: "advgb-tab-body", id: pid }, React.createElement(InnerBlocks.Content, null) ) ); } }] }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/advvideo/block.jsx": /*!**********************************************!*\ !*** ./src/assets/blocks/advvideo/block.jsx ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, BlockControls = _wpBlockEditor.BlockControls, PanelColorSettings = _wpBlockEditor.PanelColorSettings, MediaUpload = _wpBlockEditor.MediaUpload; var RangeControl = wpComponents.RangeControl, PanelBody = wpComponents.PanelBody, ToggleControl = wpComponents.ToggleControl, BaseControl = wpComponents.BaseControl, TextControl = wpComponents.TextControl, SelectControl = wpComponents.SelectControl, Button = wpComponents.Button, Dashicon = wpComponents.Dashicon, Spinner = wpComponents.Spinner, Toolbar = wpComponents.Toolbar, ToolbarGroup = wpComponents.ToolbarGroup, ToolbarButton = wpComponents.ToolbarButton, Disabled = wpComponents.Disabled; var PLAY_BUTTON_STYLE = { normal: [React.createElement("path", { key: "x", d: "M8 5v14l11-7z" }), React.createElement("path", { key: "y", d: "M0 0h24v24H0z", fill: "none" })], circleFill: [React.createElement("path", { key: "x", d: "M0 0h24v24H0z", fill: "none" }), React.createElement("path", { key: "y", d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5v-9l6 4.5-6 4.5z" })], circleOutline: [React.createElement("path", { key: "x", d: "M0 0h24v24H0z", fill: "none" }), React.createElement("path", { key: "y", d: "M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z" })], videoCam: [React.createElement("path", { key: "x", d: "M0 0h24v24H0z", fill: "none" }), React.createElement("path", { key: "y", d: "M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z" })], squareCurved: [React.createElement("path", { key: "x", d: "M20 8H4V6h16v2zm-2-6H6v2h12V2zm4 10v8c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2v-8c0-1.1.9-2 2-2h16c1.1 0 2 .9 2 2zm-6 4l-6-3.27v6.53L16 16z" }), React.createElement("path", { key: "y", fill: "none", d: "M0 0h24v24H0z" })], starSticker: [React.createElement("path", { key: "x", d: "M0 0h24v24H0z", fill: "none" }), React.createElement("path", { key: "y", d: "M20 12c0-1.1.9-2 2-2V6c0-1.1-.9-2-2-2H4c-1.1 0-1.99.9-1.99 2v4c1.1 0 1.99.9 1.99 2s-.89 2-2 2v4c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2v-4c-1.1 0-2-.9-2-2zm-4.42 4.8L12 14.5l-3.58 2.3 1.08-4.12-3.29-2.69 4.24-.25L12 5.8l1.54 3.95 4.24.25-3.29 2.69 1.09 4.11z" })] }; var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAEDCAYAAAAcBhlYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACu1JREFUeNrs3cuLG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PWdk7xt67ue6h98N3om999xdsxNs94lEPV9PekIXORSPPUnF2w25njNlb0YFj8BXCjyBOCPkrKvi0l8vpTYIschhpNCbBfbLC10SWxnxiSSp/YIo40mWeiI3qkPxtrKm78286Xr3McIsfKTQU9P39JNq5jzZUuo2bx9d7JA9AmddDJM1VU9HHhUZzYuO6N3pe/qBmn2eYJwxogschpu6997mTdsLndIqFF/qCHyUMSUv5dwXOow+fc+LPivypN+0faj4BsQeFwxc7JA/3U4GRD9S5EOHlxF71CdugcNoo3q/6KNhIx8pwJ7Y88LPemyxQ/GRvd/tUJGPHF/qSHy/mIUOJws992vDRD6W+DJGeGHDeMMfegSfeIw9590FDyMGfpKwAQAAAAAAAAAAAAAAYOb+J8AAxH4EURcdIEMAAAAASUVORK5CYII='; var AdvVideo = function (_Component) { _inherits(AdvVideo, _Component); function AdvVideo() { _classCallCheck(this, AdvVideo); var _this = _possibleConstructorReturn(this, (AdvVideo.__proto__ || Object.getPrototypeOf(AdvVideo)).apply(this, arguments)); _this.state = { fetching: false }; _this.fetchVideoInfo = _this.fetchVideoInfo.bind(_this); return _this; } _createClass(AdvVideo, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-video']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === "undefined" ? "undefined" : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: "fetchVideoInfo", value: function fetchVideoInfo() { var _this2 = this; var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes; var videoID = attributes.videoID, poster = attributes.poster, posterID = attributes.posterID; var realID = videoID; if (!!videoID) { this.setState({ fetching: true }); var url = ''; if (videoID.match(/^\d+$/g)) { url = "https://vimeo.com/" + videoID; } else { url = "https://www.youtube.com/watch?v=" + videoID; } if (videoID.indexOf('http') > -1) { url = videoID; } if (videoID.match(/youtube.com/)) { realID = videoID.split('v='); realID = realID[1]; } else if (videoID.match(/youtu.be|vimeo.com/)) { realID = videoID.split('/'); realID = realID[realID.length - 1]; } if (!realID) realID = ''; if (realID.indexOf('&') > -1) realID = realID.substring(0, realID.indexOf('&')); wp.apiFetch({ path: wp.url.addQueryArgs("/oembed/1.0/proxy?url=" + encodeURIComponent(url)) }).then(function (obj) { _this2.setState({ fetching: false }); if (!!obj.title && !!obj.provider_name) { setAttributes({ videoTitle: obj.title, poster: !!posterID ? poster : obj.thumbnail_url }); switch (obj.provider_name) { case 'YouTube': setAttributes({ videoSourceType: 'youtube', videoURL: "https://www.youtube.com/embed/" + realID + "?rel=0&wmode=transparent" }); break; case 'Vimeo': setAttributes({ videoSourceType: 'vimeo', videoURL: "https://player.vimeo.com/video/" + realID }); break; default: break; } } else { setAttributes({ videoTitle: 'ADVGB_FAIL_TO_LOAD', poster: '' }); } }).catch(function (error) { _this2.setState({ fetching: false }); setAttributes({ videoTitle: 'ADVGB_FAIL_TO_LOAD', poster: '' }); }); } } }, { key: "loadLocalVideo", value: function loadLocalVideo(video, blockId) { this.props.setAttributes({ videoURL: video.url, videoID: video.id, videoTitle: video.title, videoSourceType: 'local', openInLightbox: false }); if (document.querySelector('#' + blockId + ' video') != null) { document.querySelector('#' + blockId + ' video').pause(); document.querySelector('#' + blockId + ' video').load(); } } }, { key: "render", value: function render() { var _this3 = this; var _props3 = this.props, isSelected = _props3.isSelected, attributes = _props3.attributes, clientId = _props3.clientId, setAttributes = _props3.setAttributes; var videoURL = attributes.videoURL, videoID = attributes.videoID, videoSourceType = attributes.videoSourceType, videoTitle = attributes.videoTitle, videoFullWidth = attributes.videoFullWidth, videoWidth = attributes.videoWidth, videoHeight = attributes.videoHeight, playButtonIcon = attributes.playButtonIcon, playButtonSize = attributes.playButtonSize, playButtonColor = attributes.playButtonColor, overlayColor = attributes.overlayColor, poster = attributes.poster, posterID = attributes.posterID, openInLightbox = attributes.openInLightbox, autoPlay = attributes.autoPlay, loop = attributes.loop, muted = attributes.muted, playback = attributes.playback, playsinline = attributes.playsinline, preload = attributes.preload, isPreview = attributes.isPreview; var blockClassName = ['advgb-video-block', !!openInLightbox && !!videoURL && 'advgb-video-lightbox'].filter(Boolean).join(' '); var videoWrapperClass = ['advgb-video-wrapper', !!videoFullWidth && 'full-width', !openInLightbox && 'no-lightbox'].filter(Boolean).join(' '); var blockId = 'advgb-video-' + clientId; var videoHostIcon = { youtube: React.createElement( "svg", { id: "Social_Icons", version: "1.1", viewBox: "0 0 128 128", xmlns: "http://www.w3.org/2000/svg" }, React.createElement( "g", { id: "_x34__stroke" }, React.createElement( "g", { id: "Youtube_1_" }, React.createElement("rect", { clipRule: "evenodd", fill: "none", height: "128", width: "128" }), React.createElement("path", { clipRule: "evenodd", d: "M126.72,38.224c0,0-1.252-8.883-5.088-12.794 c-4.868-5.136-10.324-5.16-12.824-5.458c-17.912-1.305-44.78-1.305-44.78-1.305h-0.056c0,0-26.868,0-44.78,1.305 c-2.504,0.298-7.956,0.322-12.828,5.458C2.528,29.342,1.28,38.224,1.28,38.224S0,48.658,0,59.087v9.781 c0,10.433,1.28,20.863,1.28,20.863s1.248,8.883,5.084,12.794c4.872,5.136,11.268,4.975,14.116,5.511 c10.24,0.991,43.52,1.297,43.52,1.297s26.896-0.04,44.808-1.345c2.5-0.302,7.956-0.326,12.824-5.462 c3.836-3.912,5.088-12.794,5.088-12.794S128,79.302,128,68.868v-9.781C128,48.658,126.72,38.224,126.72,38.224z M50.784,80.72 L50.78,44.501l34.584,18.172L50.784,80.72z", fill: "#CE1312", fillRule: "evenodd", id: "Youtube" }) ) ) ), vimeo: React.createElement( "svg", { height: "25", viewBox: "0 0 32 32", width: "25", xmlns: "http://www.w3.org/2000/svg" }, React.createElement( "g", null, React.createElement("circle", { cx: "16", cy: "16", id: "BG", r: "16", fill: "#5FCCFF" }), React.createElement("path", { d: "M24,12.4c-0.1,1.6-1.2,3.7-3.3,6.4c-2.2,2.8-4,4.2-5.5,4.2 c-0.9,0-1.7-0.9-2.4-2.6c-0.4-1.6-0.9-3.2-1.3-4.7c-0.5-1.7-1-2.6-1.5-2.6c-0.1,0-0.5,0.3-1.3,0.8l-0.8-1 c0.8-0.7,1.6-1.4,2.3-2.1c1.1-0.9,1.8-1.4,2.4-1.4c1.2-0.1,2,0.7,2.3,2.5c0.3,2,0.5,3.2,0.6,3.7c0.4,1.6,0.8,2.4,1.2,2.4 c0.3,0,0.8-0.5,1.5-1.6c0.7-1.1,1-1.9,1.1-2.4c0.1-0.9-0.3-1.4-1.1-1.4c-0.4,0-0.8,0.1-1.2,0.3c0.8-2.6,2.3-3.8,4.5-3.7 C23.3,9.2,24.1,10.3,24,12.4", id: "Vimeo", fill: "#FFFFFF" }) ) ), local: React.createElement( "svg", { height: "25", id: "Layer_1", version: "1.1", viewBox: "0 0 24 24", width: "25", xmlns: "http://www.w3.org/2000/svg" }, React.createElement("path", { clipRule: "evenodd", d: "M22.506,21v0.016L17,15.511V19c0,1.105-0.896,2-2,2h-1.5H3H2c-1.104,0-2-0.895-2-2 v-1l0,0V6l0,0V5c0-1.104,0.896-1.999,2-1.999h1l0,0h10.5l0,0H15c1.104,0,2,0.895,2,1.999v3.516l5.5-5.5V3.001 c0.828,0,1.5,0.671,1.5,1.499v15C24,20.327,23.331,20.996,22.506,21z", fillRule: "evenodd" }) ) }; return isPreview ? React.createElement("img", { alt: __('Advanced Video', 'advanced-gutenberg'), width: "100%", src: previewImageData }) : React.createElement( Fragment, null, (!!poster && openInLightbox || !openInLightbox && videoSourceType === 'local') && React.createElement( BlockControls, null, React.createElement( ToolbarGroup, null, React.createElement(MediaUpload, { allowedTypes: ["image"], value: posterID, onSelect: function onSelect(image) { return setAttributes({ poster: image.url, posterID: image.id }); }, render: function render(_ref) { var open = _ref.open; return React.createElement(ToolbarButton, { className: "components-toolbar__control", label: __('Change image preview', 'advanced-gutenberg'), icon: "edit", onClick: open }); } }), React.createElement(ToolbarButton, { className: "components-toolbar__control", label: __('Remove image preview', 'advanced-gutenberg'), icon: "no", onClick: function onClick() { return setAttributes({ poster: undefined, posterID: undefined }); } }) ) ), React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Video Settings', 'advanced-gutenberg') }, React.createElement(ToggleControl, { label: __('Open video in light box', 'advanced-gutenberg'), help: __('Lightbox offers additional display options.', 'advanced-gutenberg'), checked: openInLightbox, onChange: function onChange() { return setAttributes({ openInLightbox: !openInLightbox }); } }), videoSourceType === 'local' && React.createElement( Fragment, null, React.createElement(ToggleControl, { label: __('Autoplay', 'advanced-gutenberg'), checked: autoPlay, onChange: function onChange() { return setAttributes({ autoPlay: !autoPlay }); } }), React.createElement(ToggleControl, { label: __('Loop', 'advanced-gutenberg'), checked: loop, onChange: function onChange() { return setAttributes({ loop: !loop }); } }), React.createElement(ToggleControl, { label: __('Muted', 'advanced-gutenberg'), checked: muted, onChange: function onChange() { return setAttributes({ muted: !muted }); } }), React.createElement(ToggleControl, { label: __('Playback Controls', 'advanced-gutenberg'), checked: playback, onChange: function onChange() { return setAttributes({ playback: !playback }); } }), React.createElement(ToggleControl, { label: __('Play inline', 'advanced-gutenberg'), checked: playsinline, onChange: function onChange() { return setAttributes({ playsinline: !playsinline }); } }), React.createElement(SelectControl, { label: __('Video preloading', 'advanced-gutenberg'), value: preload, options: [{ label: __('Auto', 'advanced-gutenberg'), value: 'auto' }, { label: __('Metadata', 'advanced-gutenberg'), value: 'metadata' }, { label: __('None', 'advanced-gutenberg'), value: 'none' }], onChange: function onChange(value) { return setAttributes({ preload: value }); } }) ), React.createElement(ToggleControl, { label: __('Full width', 'advanced-gutenberg'), checked: videoFullWidth, onChange: function onChange() { return setAttributes({ videoFullWidth: !videoFullWidth }); } }), !videoFullWidth && React.createElement(RangeControl, { label: __('Video width', 'advanced-gutenberg'), value: videoWidth, min: 100, max: 1000, onChange: function onChange(value) { return setAttributes({ videoWidth: value }); } }), React.createElement(RangeControl, { label: __('Video height', 'advanced-gutenberg'), value: videoHeight, min: 300, max: 700, onChange: function onChange(value) { return setAttributes({ videoHeight: value }); } }), !!openInLightbox && React.createElement( Fragment, null, React.createElement(PanelColorSettings, { title: __('Color Settings', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Overlay Color', 'advanced-gutenberg'), value: overlayColor, onChange: function onChange(value) { return setAttributes({ overlayColor: value === undefined ? '#EEEEEE' : value }); } }, { label: __('Play Button Color', 'advanced-gutenberg'), value: playButtonColor, onChange: function onChange(value) { return setAttributes({ playButtonColor: value === undefined ? '#fff' : value }); } }] }), React.createElement( PanelBody, { title: __('Play Button', 'advanced-gutenberg') }, React.createElement( BaseControl, { label: __('Icon Style', 'advanced-gutenberg') }, React.createElement( "div", { className: "advgb-icon-items-wrapper" }, Object.keys(PLAY_BUTTON_STYLE).map(function (key, index) { return React.createElement( "div", { className: "advgb-icon-item", key: index }, React.createElement( "span", { className: key === playButtonIcon ? 'active' : '', onClick: function onClick() { return setAttributes({ playButtonIcon: key }); } }, React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, PLAY_BUTTON_STYLE[key] ) ) ); }) ) ), React.createElement(RangeControl, { label: __('Play Button Size', 'advanced-gutenberg'), value: playButtonSize, min: 40, max: 200, onChange: function onChange(value) { return setAttributes({ playButtonSize: value }); } }) ) ) ) ), React.createElement( "div", { className: blockClassName, id: blockId }, !!openInLightbox && React.createElement( "div", { className: videoWrapperClass, style: { backgroundColor: overlayColor, width: videoWidth } }, React.createElement("div", { className: "advgb-video-poster", style: { backgroundImage: "url(" + poster + ")" } }), React.createElement( "div", { className: "advgb-button-wrapper", style: { height: videoHeight } }, !poster && React.createElement(MediaUpload, { allowedTypes: ["image"], onSelect: function onSelect(media) { return setAttributes({ poster: media.url, posterID: media.id }); }, value: posterID, render: function render(_ref2) { var open = _ref2.open; return React.createElement( Button, { className: "button button-large", onClick: open }, __('Select image preview', 'advanced-gutenberg') ); } }), React.createElement( "div", { className: "advgb-play-button", style: { color: playButtonColor } }, React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: playButtonSize, height: playButtonSize, viewBox: "0 0 24 24" }, PLAY_BUTTON_STYLE[playButtonIcon] ) ) ) ), !openInLightbox && React.createElement( "div", { className: videoWrapperClass }, (videoSourceType === 'youtube' || videoSourceType === 'vimeo') && React.createElement("iframe", { src: videoURL, frameBorder: "0", allowFullScreen: true, style: { width: videoWidth, height: videoHeight } }) || videoSourceType === 'local' && React.createElement( Disabled, null, React.createElement( "video", { width: videoWidth, height: videoHeight, poster: poster, controls: playback, muted: muted }, React.createElement("source", { src: videoURL }), 'Your browser does not support HTML5 video.' ) ) || !videoSourceType && React.createElement("div", { style: { width: videoWidth, height: videoHeight } }) ), isSelected && React.createElement( "div", { className: "advgb-video-input-block" }, React.createElement( "div", { className: "advgb-video-input" }, React.createElement(Dashicon, { className: "advgb-video-link-icon", icon: "admin-links" }), React.createElement(TextControl, { placeholder: __('Youtube/Vimeo video URL/ID…', 'advanced-gutenberg'), value: videoID, onChange: function onChange(value) { setAttributes({ videoID: value, videoURL: '', videoTitle: undefined, videoSourceType: '' }); } }), React.createElement( Button, { className: "button button-large", disabled: !videoID || videoSourceType === 'local', style: { height: '31px' }, onClick: this.fetchVideoInfo }, __('Fetch video content', 'advanced-gutenberg') ), React.createElement(MediaUpload, { allowedTypes: ["video"], value: videoID, onSelect: function onSelect(video) { return _this3.loadLocalVideo(video, blockId); }, render: function render(_ref3) { var open = _ref3.open; return React.createElement( Button, { className: "button button-large is-primary", onClick: open, style: { marginLeft: '5px' } }, __('Load local video', 'advanced-gutenberg') ); } }) ), React.createElement( "div", { className: "advgb-current-video-desc", style: { minWidth: '50%', margin: '10px auto', textAlign: 'center' } }, React.createElement( "strong", null, __('Current Video', 'advanced-gutenberg'), ":" ), React.createElement( "span", { title: videoSourceType, style: { width: '25px', height: '25px', margin: '-1px 5px 0', display: 'flex', alignItems: 'center', justifyContent: 'center' } }, videoHostIcon[videoSourceType] || this.state.fetching && React.createElement(Spinner, null) ), React.createElement( "span", null, videoTitle === 'ADVGB_FAIL_TO_LOAD' && React.createElement( "strong", { style: { color: 'red' } }, __('Wrong video URL/ID. Please try another.', 'advanced-gutenberg') ) || videoTitle || __('Not selected yet.', 'advanced-gutenberg') ) ) ) ) ); } }]); return AdvVideo; }(Component); var advVideoBlockIcon = React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "2 2 22 22" }, React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }), React.createElement("path", { d: "M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z" }) ); var blockAttrs = { videoURL: { type: 'string' }, videoID: { type: 'string' }, videoSourceType: { type: 'string' }, videoTitle: { type: 'string' }, videoFullWidth: { type: 'boolean', default: true }, videoWidth: { type: 'number' }, videoHeight: { type: 'number', default: 450 }, playButtonIcon: { type: 'string', default: 'normal' }, playButtonSize: { type: 'number', default: 80 }, playButtonColor: { type: 'string', default: '#fff' }, overlayColor: { type: 'string', default: '#EEEEEE' }, poster: { type: 'string' }, posterID: { type: 'number' }, openInLightbox: { type: 'boolean', default: true }, changed: { type: 'boolean', default: false }, autoPlay: { type: 'boolean', default: false }, loop: { type: 'boolean', default: false }, muted: { type: 'boolean', default: false }, playback: { type: 'boolean', default: true }, playsinline: { type: 'boolean', default: true }, preload: { type: 'string', default: 'metadata' }, isPreview: { type: 'boolean', default: false } }; registerBlockType('advgb/video', { title: __('Video - PublishPress', 'advanced-gutenberg'), description: __('Add more options and styles for videos in your Media Library.', 'advanced-gutenberg'), icon: { src: advVideoBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('video', 'advanced-gutenberg'), __('advanced video', 'advanced-gutenberg'), __('embed', 'advanced-gutenberg'), __('media', 'advanced-gutenberg')], attributes: blockAttrs, example: { attributes: { isPreview: true } }, supports: { anchor: true }, edit: AdvVideo, save: function save(_ref4) { var attributes = _ref4.attributes; var videoURL = attributes.videoURL, videoSourceType = attributes.videoSourceType, videoTitle = attributes.videoTitle, videoFullWidth = attributes.videoFullWidth, videoWidth = attributes.videoWidth, videoHeight = attributes.videoHeight, playButtonIcon = attributes.playButtonIcon, playButtonSize = attributes.playButtonSize, playButtonColor = attributes.playButtonColor, overlayColor = attributes.overlayColor, poster = attributes.poster, openInLightbox = attributes.openInLightbox, autoPlay = attributes.autoPlay, loop = attributes.loop, muted = attributes.muted, playback = attributes.playback, playsinline = attributes.playsinline, preload = attributes.preload; var blockClassName = ['advgb-video-block', !!videoFullWidth && 'full-width', !!openInLightbox && !!videoURL && 'advgb-video-lightbox'].filter(Boolean).join(' '); var videoWrapperClass = ['advgb-video-wrapper', !!videoFullWidth && 'full-width', !openInLightbox && 'no-lightbox'].filter(Boolean).join(' '); var videoAttributes = []; if (loop) videoAttributes.push('loop'); if (muted) videoAttributes.push('muted'); if (autoPlay) videoAttributes.push('autoplay'); if (playback) videoAttributes.push('controls'); if (playsinline) videoAttributes.push('playsinline'); return React.createElement( "div", { className: blockClassName, "data-video": videoURL, "data-source": videoSourceType, "data-video-attr": videoAttributes.join(','), "data-video-preload": preload }, !openInLightbox && React.createElement( "div", { className: videoWrapperClass }, (videoSourceType === 'youtube' || videoSourceType === 'vimeo') && React.createElement("iframe", { src: videoURL, width: videoWidth, height: videoHeight, frameBorder: "0", allowFullScreen: true }) || videoSourceType === 'local' && React.createElement( "video", { className: videoFullWidth && 'full-width', width: videoWidth, height: videoHeight, poster: poster, controls: playback, loop: loop, muted: muted, autoPlay: autoPlay, preload: preload, playsInline: playsinline }, React.createElement("source", { src: videoURL }), 'Your browser does not support HTML5 video.' ) || !videoSourceType && React.createElement("div", { style: { width: videoWidth, height: videoHeight } }) ), !!openInLightbox && React.createElement( "div", { className: videoWrapperClass, style: { backgroundColor: overlayColor, width: videoWidth } }, React.createElement("div", { className: "advgb-video-poster", style: { backgroundImage: "url(" + poster + ")" } }), React.createElement( "div", { className: "advgb-button-wrapper", style: { height: videoHeight } }, React.createElement( "div", { className: "advgb-play-button", style: { color: playButtonColor } }, React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: playButtonSize, height: playButtonSize, viewBox: "0 0 24 24" }, PLAY_BUTTON_STYLE[playButtonIcon] ) ) ) ) ); }, deprecated: [{ attributes: blockAttrs, save: function save(_ref5) { var attributes = _ref5.attributes; var videoURL = attributes.videoURL, videoSourceType = attributes.videoSourceType, videoTitle = attributes.videoTitle, videoFullWidth = attributes.videoFullWidth, videoWidth = attributes.videoWidth, videoHeight = attributes.videoHeight, playButtonIcon = attributes.playButtonIcon, playButtonSize = attributes.playButtonSize, playButtonColor = attributes.playButtonColor, overlayColor = attributes.overlayColor, poster = attributes.poster, openInLightbox = attributes.openInLightbox; var blockClassName = ['advgb-video-block', !!videoFullWidth && 'full-width', !!openInLightbox && !!videoURL && 'advgb-video-lightbox'].filter(Boolean).join(' '); var videoWrapperClass = ['advgb-video-wrapper', !!videoFullWidth && 'full-width', !openInLightbox && 'no-lightbox'].filter(Boolean).join(' '); return React.createElement( "div", { className: blockClassName, "data-video": videoURL, "data-source": videoSourceType }, !openInLightbox && React.createElement( "div", { className: videoWrapperClass }, (videoSourceType === 'youtube' || videoSourceType === 'vimeo') && React.createElement("iframe", { src: videoURL, width: videoWidth, height: videoHeight, frameBorder: "0", allowFullScreen: true }) || videoSourceType === 'local' && React.createElement( "video", { className: videoFullWidth && 'full-width', width: videoWidth, height: videoHeight, poster: poster, controls: true }, React.createElement("source", { src: videoURL }), 'Your browser does not support HTML5 video.' ) || !videoSourceType && React.createElement("div", { style: { width: videoWidth, height: videoHeight } }) ), !!openInLightbox && React.createElement( "div", { className: videoWrapperClass, style: { backgroundColor: overlayColor, width: videoWidth } }, React.createElement("div", { className: "advgb-video-poster", style: { backgroundImage: "url(" + poster + ")" } }), React.createElement( "div", { className: "advgb-button-wrapper", style: { height: videoHeight } }, React.createElement( "div", { className: "advgb-play-button", style: { color: playButtonColor } }, React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: playButtonSize, height: playButtonSize, viewBox: "0 0 24 24" }, PLAY_BUTTON_STYLE[playButtonIcon] ) ) ) ) ); } }] }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/columns/block.jsx": /*!*********************************************!*\ !*** ./src/assets/blocks/columns/block.jsx ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, BlockControls = _wpBlockEditor.BlockControls, PanelColorSettings = _wpBlockEditor.PanelColorSettings, InnerBlocks = _wpBlockEditor.InnerBlocks; var PanelBody = wpComponents.PanelBody, RangeControl = wpComponents.RangeControl, SelectControl = wpComponents.SelectControl, ToggleControl = wpComponents.ToggleControl, Tooltip = wpComponents.Tooltip, ToolbarGroup = wpComponents.ToolbarGroup; var _lodash = lodash, times = _lodash.times; var _wp$data = wp.data, dispatch = _wp$data.dispatch, select = _wp$data.select; var COLUMNS_LAYOUTS = [{ columns: 1, layout: '100', icon: '100', title: __('One column', 'advanced-gutenberg'), description: __('100', 'advanced-gutenberg') }, { columns: 2, layout: '12-12', icon: '12-12', title: __('Two columns; equal split', 'advanced-gutenberg'), description: __('50 / 50', 'advanced-gutenberg') }, { columns: 2, layout: '23-13', icon: '23-13', title: __('Two columns; two-thirds, one-third split', 'advanced-gutenberg'), description: __('66 / 33', 'advanced-gutenberg') }, { columns: 2, layout: '13-23', icon: '13-23', title: __('Two columns; one-third, two-thirds split', 'advanced-gutenberg'), description: __('33 / 66', 'advanced-gutenberg') }, { columns: 2, layout: '14-34', icon: '14-34', title: __('Two columns; one-quarter, three-quarters split', 'advanced-gutenberg'), description: __('25 / 75', 'advanced-gutenberg') }, { columns: 2, layout: '34-14', icon: '34-14', title: __('Two columns; three-quarters, one-quarter split', 'advanced-gutenberg'), description: __('75 / 25', 'advanced-gutenberg') }, { columns: 2, layout: '15-45', icon: '15-45', title: __('Two columns; one-fifth, four-fifths split', 'advanced-gutenberg'), description: __('20 / 80', 'advanced-gutenberg') }, { columns: 2, layout: '45-15', icon: '45-15', title: __('Two columns; four-fifths, one-fifth split', 'advanced-gutenberg'), description: __('80 / 20', 'advanced-gutenberg') }, { columns: 3, layout: '13-13-13', icon: '13-13-13', title: __('Three columns; equal split', 'advanced-gutenberg'), description: __('33 / 33 / 33', 'advanced-gutenberg') }, { columns: 3, layout: '12-14-14', icon: '12-14-14', title: __('Three columns; wider one-half left column', 'advanced-gutenberg'), description: __('50 / 25 / 25', 'advanced-gutenberg') }, { columns: 3, layout: '14-14-12', icon: '14-14-12', title: __('Three columns; wider one-half right column', 'advanced-gutenberg'), description: __('25 / 25 / 50', 'advanced-gutenberg') }, { columns: 3, layout: '14-12-14', icon: '14-12-14', title: __('Three columns; wider one-half center column', 'advanced-gutenberg'), description: __('25 / 50 / 25', 'advanced-gutenberg') }, { columns: 3, layout: '15-35-15', icon: '15-35-15', title: __('Three columns; wider three-fifths center column', 'advanced-gutenberg'), description: __('20 / 60 / 20', 'advanced-gutenberg') }, { columns: 3, layout: '35-15-15', icon: '35-15-15', title: __('Three columns; wider three-fifths left column', 'advanced-gutenberg'), description: __('60 / 20 / 20', 'advanced-gutenberg') }, { columns: 3, layout: '15-15-35', icon: '15-15-35', title: __('Three columns; wider three-fifths right column', 'advanced-gutenberg'), description: __('20 / 20 / 60', 'advanced-gutenberg') }, { columns: 3, layout: '16-46-16', icon: '16-46-16', title: __('Three columns; wider four-sixths center column', 'advanced-gutenberg'), description: __('16.6 / 66.6 / 16.6', 'advanced-gutenberg') }, { columns: 4, layout: '14-14-14-14', icon: '14-14-14-14', title: __('Four columns; equal split', 'advanced-gutenberg'), description: __('25 / 25 / 25 / 25', 'advanced-gutenberg') }, { columns: 4, layout: '36-16-16-16', icon: '36-16-16-16', title: __('Four columns; wider one-half left column', 'advanced-gutenberg'), description: __('50 / 16.6 / 16.6 / 16.6', 'advanced-gutenberg') }, { columns: 4, layout: '16-16-16-36', icon: '16-16-16-36', title: __('Four columns; wider one-half right column', 'advanced-gutenberg'), description: __('16.6 / 16.6 / 16.6 / 50', 'advanced-gutenberg') }, { columns: 4, layout: '15-15-15-25', icon: '15-15-15-25', title: __('Four columns; wider two-fifths right column', 'advanced-gutenberg'), description: __('20 / 20 / 20 / 40', 'advanced-gutenberg') }, { columns: 4, layout: '25-15-15-15', icon: '25-15-15-15', title: __('Four columns; wider two-fifths left column', 'advanced-gutenberg'), description: __('40 / 20 / 20 / 20', 'advanced-gutenberg') }, { columns: 5, layout: 'five', icon: '15-15-15-15-15', title: __('Five columns; equal split', 'advanced-gutenberg'), description: __('20 / 20 / 20 / 20 / 20', 'advanced-gutenberg') }, { columns: 6, layout: 'six', icon: '16-16-16-16-16-16', title: __('Six columns; equal split', 'advanced-gutenberg'), description: __('16.6 / 16.6 / 16.6 / 16.6 / 16.6 / 16.6', 'advanced-gutenberg') }]; var COLUMNS_LAYOUTS_RESPONSIVE = [{ columns: 3, layout: '1-12-12', icon: '100-12-12', title: __('Three: 100 - 1/2 - 1/2', 'advanced-gutenberg') }, { columns: 3, layout: '12-12-1', icon: '12-12-100', title: __('Three: 1/2 - 1/2 - 100', 'advanced-gutenberg') }, { columns: 4, layout: '12x4', icon: '12-12-12-12', title: __('Four: Two Columns', 'advanced-gutenberg') }, { columns: 6, layout: '12x6', icon: '12-12-12-12', title: __('Six: Two Columns', 'advanced-gutenberg') }, { columns: 6, layout: '13x6', icon: '13-13-13-13-13-13', title: __('Six: Three Columns', 'advanced-gutenberg') }]; var COLUMNS_LAYOUTS_STACKED = { columns: 1, layout: 'stacked', icon: 'stacked', title: __('Stacked', 'advanced-gutenberg') }; var GUTTER_OPTIONS = [{ label: __('None', 'advanced-gutenberg'), value: 0 }, { label: '10px', value: 10 }, { label: '20px', value: 20 }, { label: '30px', value: 30 }, { label: '40px', value: 40 }, { label: '50px', value: 50 }, { label: '70px', value: 70 }, { label: '90px', value: 90 }]; var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAADyCAYAAABkv9hQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADBRJREFUeNrs3U+IG9cdB3CNVmsT/ys28dI2UAg99GBaXHLpJbnlanJp7qXQSxuTnELaQBPoNZecenAvJpRAoG1yKhSS9tT60ktDKc0fUhoIces4OLFje3c11dtqnNm3b2Y00oy0u/58QGi1q9GMnvTV741WP81gAAAAAAAsRdbnjY9Go97XAYdQvrW1tX+CPg3yrLcj8NAQ8Fmv0/aFIFsg4NkMtyXc0E3o80UqfzZHyLOK5bPS5UzgobNwV50PptU97yzoURVPnVcFXchh/sCXw50nLs9U3bMFQ546NVV3YPaQp4KeCn1t2LM5Qp46DRtCD7QPexzqceLynheEVNhHC4S8CPfw/Pnzo8uXL393Y2PjO+vr6w9Ofnckz/Nscvr/mic/e+ygYT86y4qwjjc3N/977dq1f168ePEvb7311t1pkLNSwMfTDMYzgCyxr19fbUtvvKVCvnN67bXXvvb444//5NixYz+cbOgJDxd0VNbz/O6dO3d+Pwn6Ly5cuPBOKeBFZd9OVPtkVZ8l6MV1hqWQr4XzV1555atPPvnknycBf9DDAv0Yj8fX3n777R898sgjf5qGe1w6j8Nf/J99V1Vfa1HNi6CHZdaeeeaZE0899dTv1tbWvumhgF6n9MfOnj372NGjR38zqe63ogKd/NfacDgMLxDNFb0U9GE0Xd8J+gcffPD9hx566JKHAZbj+vXrv9rY2PjZtJpvTc/LFX7XFL5c1YdNLyaJqj58+umnT01W+GNDD8tz+vTpH7z44otfnxbbUan4Vv1re1Ab9MSn33a9EXfhwoWHJ9d52NDDUg2feOKJx6ZBHyZOWZTjwbwVfed0/Pjx05P9hq8Yd1iuU6dOfSPajW6s5k1BT07bw2myk7828EEYWLo8z9cSFT31obVyhhsrerKqb29vCzmsJuhZTbBTuW09dS/OQ0UXdFhd0IeD+o+ft5q6p0K/cxJ0WFn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U0fPE5fzq1aufjsfjTw07LNfHH3/8rziPUU7zRffR793Aq6+++u/bt2//w7DD8kyK683Lly9fqajoeauKvrW1FS+Yxz+/8cYbN999991fG3pYno8++ui3ly5d+k+imueJzC5c0Xdu+LnnnvvDpKr/zfBD/zY3N68+//zzv0wEPJ9ln30tWeaHw/C2evHWelY6DYvTe++9t33r1q03H3300e+tr69vlK4PdGhSUN9//fXXf/rCCy+8E2bwk9N26bz4uTjtCv1kuj9T0FOnIuzZlStXbt+8efOP586dG5w4ceJbWZYd8bBAN/I8v3vt2rU3X3755Z9fvHjx71G460J+L+xF0JNVeDQaZaWpfTZ9QRhOz0eT0/r0fOd0+vTp9Zdeeunbk8CfO378+JnJC8WRyUYOSjMCYPaAb3/++efXJ7Pm95999tm/fvjhh3ejcG9NT5vT8+J3e0JfvOdWFfRBVMGLsK+Vwl4+rZVeDIalZQQd5sh6MfOe/jyuCPpWKejbqcpeBH2UWkv44zTsxUqz0gqz0oqz0t/yadjz0jKCDvMFPS9lbpwIe+V0vZzje8V7hhVmFSvOpiss7+vnUUUvh1zgYbZKXlXRxxUVfDxI/zt8pqCXQz4orXAwXUmeeAWKQ56p7DBX0Ksqeqqy1/1PvTl8pTfl9vx7bfDlm3Pxz1nFPrqgw/wVPQ77OAr6rn+tTabt+awVvWpDxhW/GyeCLuTQPuiDqKLHYR837KPvmbo3BjCq6oMoxMOKc9N26CbocbUeV1XxQfROe9uKXt5XL78xVw5xcXks5NDLvnpV8CureKuKPq3qg4p97qyhgmfzrA/u82qeCntd8O8tk6rmrYIXhX2QCHbqZ+GGxabvVWHfdd34zbe5g57YZx/UVG+VHLqv7MkXg6oqvnAAS5+aawq0gEO3gd91eZaQdxbExLS+t3XBfRTuPX+fNdix/wkwAO6iOEPwu8dYAAAAAElFTkSuQmCC'; var AdvColumnsEdit = function (_Component) { _inherits(AdvColumnsEdit, _Component); function AdvColumnsEdit() { _classCallCheck(this, AdvColumnsEdit); var _this = _possibleConstructorReturn(this, (AdvColumnsEdit.__proto__ || Object.getPrototypeOf(AdvColumnsEdit)).apply(this, arguments)); _this.state = { tabSelected: 'desktop' }; return _this; } _createClass(AdvColumnsEdit, [{ key: 'componentWillMount', value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-columns']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === 'undefined' ? 'undefined' : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: 'componentDidMount', value: function componentDidMount() { var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes, clientId = _props2.clientId; if (!attributes.id) { setAttributes({ colId: 'advgb-cols-' + clientId }); } } }, { key: 'componentDidUpdate', value: function componentDidUpdate(prevProps) { var _prevProps$attributes = prevProps.attributes, prevLayout = _prevProps$attributes.columnsLayout, prevLayoutT = _prevProps$attributes.columnsLayoutT, prevLayoutM = _prevProps$attributes.columnsLayoutM; var _props3 = this.props, attributes = _props3.attributes, clientId = _props3.clientId; var columns = attributes.columns, columnsLayout = attributes.columnsLayout, columnsLayoutT = attributes.columnsLayoutT, columnsLayoutM = attributes.columnsLayoutM; var _ref = !wp.blockEditor ? select('core/editor') : select('core/block-editor'), getBlockOrder = _ref.getBlockOrder; var _ref2 = !wp.blockEditor ? dispatch('core/editor') : dispatch('core/block-editor'), updateBlockAttributes = _ref2.updateBlockAttributes; var childBlocks = getBlockOrder(clientId); var shouldUpdate = false; var classes = times(6, function () { return []; }); var extraClassD = !!columnsLayoutT ? '-desktop' : '-tablet'; var extraClassT = '-tablet'; var extraClassM = '-mobile'; if (prevLayout !== columnsLayout || prevLayoutT !== columnsLayoutT || prevLayoutM !== columnsLayoutM) { shouldUpdate = true; classes = AdvColumnsEdit.prepareColumnClass(columnsLayout, extraClassD, classes); classes = AdvColumnsEdit.prepareColumnClass(columnsLayoutT, extraClassT, classes); classes = AdvColumnsEdit.prepareColumnClass(columnsLayoutM, extraClassM, classes); } if (shouldUpdate) { classes = classes.map(function (cls) { return cls.filter(Boolean).join(' '); }); classes.map(function (cls, idx) { return !!childBlocks[idx] && updateBlockAttributes(childBlocks[idx], { columnClasses: cls, width: 0 }); }); } } }, { key: 'translatableText', value: function translatableText(text) { switch (text) { case 'desktop': return __('desktop', 'advanced-gutenberg'); break; case 'tablet': return __('tablet', 'advanced-gutenberg'); break; case 'mobile': return __('mobile', 'advanced-gutenberg'); break; } } }, { key: 'render', value: function render() { var _this2 = this; var _props4 = this.props, attributes = _props4.attributes, setAttributes = _props4.setAttributes, clientId = _props4.clientId, className = _props4.className; var tabSelected = this.state.tabSelected; var columns = attributes.columns, columnsLayout = attributes.columnsLayout, columnsLayoutT = attributes.columnsLayoutT, columnsLayoutM = attributes.columnsLayoutM, marginUnit = attributes.marginUnit, marginTop = attributes.marginTop, marginRight = attributes.marginRight, marginBottom = attributes.marginBottom, marginLeft = attributes.marginLeft, marginTopM = attributes.marginTopM, marginRightM = attributes.marginRightM, marginBottomM = attributes.marginBottomM, marginLeftM = attributes.marginLeftM, paddingUnit = attributes.paddingUnit, paddingTop = attributes.paddingTop, paddingRight = attributes.paddingRight, paddingBottom = attributes.paddingBottom, paddingLeft = attributes.paddingLeft, paddingTopM = attributes.paddingTopM, paddingRightM = attributes.paddingRightM, paddingBottomM = attributes.paddingBottomM, paddingLeftM = attributes.paddingLeftM, vAlign = attributes.vAlign, gutter = attributes.gutter, collapsedGutter = attributes.collapsedGutter, collapsedRtl = attributes.collapsedRtl, columnsWrapped = attributes.columnsWrapped, contentMaxWidth = attributes.contentMaxWidth, contentMaxWidthUnit = attributes.contentMaxWidthUnit, contentMinHeight = attributes.contentMinHeight, contentMinHeightUnit = attributes.contentMinHeightUnit, contentMaxHeight = attributes.contentMaxHeight, contentMaxHeightUnit = attributes.contentMaxHeightUnit, wrapperTag = attributes.wrapperTag, isPreview = attributes.isPreview; var blockClasses = ['advgb-columns', className, vAlign && 'columns-valign-' + vAlign, columns && 'advgb-columns-' + columns, columnsLayout && 'layout-' + columnsLayout, columnsLayoutT && 'tbl-layout-' + columnsLayoutT, columnsLayoutM && 'mbl-layout-' + columnsLayoutM, !!gutter && 'gutter-' + gutter, !!collapsedGutter && 'vgutter-' + collapsedGutter, collapsedRtl && 'order-rtl', columnsWrapped && 'columns-wrapped'].filter(Boolean).join(' '); if (!columns) { return isPreview ? React.createElement('img', { alt: __('Columns Manager', 'advanced-gutenberg'), width: '100%', src: previewImageData }) : React.createElement( 'div', { className: 'advgb-columns-select-wrapper' }, React.createElement( 'div', { className: 'advgb-columns-select-title' }, __('Choose a columns layout', 'advanced-gutenberg') ), React.createElement( 'div', { className: 'advgb-columns-select-layout' }, COLUMNS_LAYOUTS.map(function (layout, index) { return React.createElement( Tooltip, { text: layout.title, key: index }, React.createElement( 'div', { className: 'advgb-columns-layout', onClick: function onClick() { return setAttributes({ columns: layout.columns, columnsLayout: layout.layout }); } }, React.createElement('img', { src: advgbBlocks.pluginUrl + '/assets/blocks/columns/icons/' + layout.icon + '.png', alt: layout.layout }), React.createElement( 'div', { className: 'advgb-columns-layout-description' }, layout.description ) ) ); }) ) ); } var COLUMNS_LAYOUTS_FILTERED = COLUMNS_LAYOUTS.filter(function (item) { return item.columns === columns; }); var COLUMNS_LAYOUTS_RESPONSIVE_FILTERED = COLUMNS_LAYOUTS_RESPONSIVE.filter(function (item) { return item.columns === columns; }); COLUMNS_LAYOUTS_RESPONSIVE_FILTERED.push(COLUMNS_LAYOUTS_STACKED); var VERT_ALIGNMENT_CONTROLS = [{ icon: React.createElement( 'svg', { xmlns: 'http://www.w3.org/2000/svg', width: '20', height: '20', viewBox: '0 0 24 24' }, React.createElement('path', { d: 'M8 11h3v10h2V11h3l-4-4-4 4zM4 3v2h16V3H4z' }), React.createElement('path', { d: 'M0 0h24v24H0z', fill: 'none' }) ), title: __('Vertical Align Top', 'advanced-gutenberg'), isActive: vAlign === 'top', onClick: function onClick() { return setAttributes({ vAlign: 'top' }); } }, { icon: React.createElement( 'svg', { xmlns: 'http://www.w3.org/2000/svg', width: '20', height: '20', viewBox: '0 0 24 24' }, React.createElement('path', { d: 'M8 19h3v4h2v-4h3l-4-4-4 4zm8-14h-3V1h-2v4H8l4 4 4-4zM4 11v2h16v-2H4z' }), React.createElement('path', { d: 'M0 0h24v24H0z', fill: 'none' }) ), title: __('Vertical Align Middle', 'advanced-gutenberg'), isActive: vAlign === 'middle', onClick: function onClick() { return setAttributes({ vAlign: 'middle' }); } }, { icon: React.createElement( 'svg', { xmlns: 'http://www.w3.org/2000/svg', width: '20', height: '20', viewBox: '0 0 24 24' }, React.createElement('path', { d: 'M16 13h-3V3h-2v10H8l4 4 4-4zM4 19v2h16v-2H4z' }), React.createElement('path', { d: 'M0 0h24v24H0z', fill: 'none' }) ), title: __('Vertical Align Bottom', 'advanced-gutenberg'), isActive: vAlign === 'bottom', onClick: function onClick() { return setAttributes({ vAlign: 'bottom' }); } }, { icon: React.createElement( 'svg', { xmlns: 'http://www.w3.org/2000/svg', width: '20', height: '20', viewBox: '0 0 12 32' }, React.createElement('polygon', { points: '8,20 8,26 12,26 6,32 0,26 4,26 4,20' }), React.createElement('polygon', { points: '4,12 4,6 0,6 6,0 12,6 8,6 8,12' }) ), title: __('Inner Columns Full Height', 'advanced-gutenberg'), isActive: vAlign === 'full', onClick: function onClick() { return setAttributes({ vAlign: 'full' }); } }]; var MARGIN_PADDING_CONTROLS = [{ label: 'Top', icon: 'arrow-up-alt2' }, { label: 'Right', icon: 'arrow-right-alt2' }, { label: 'Bottom', icon: 'arrow-down-alt2' }, { label: 'Left', icon: 'arrow-left-alt2' }]; var deviceLetter = ''; if (tabSelected === 'tablet') deviceLetter = 'T'; if (tabSelected === 'mobile') deviceLetter = 'M'; return isPreview ? React.createElement('img', { alt: __('Columns Manager ', 'advanced-gutenberg'), width: '100%', src: previewImageData }) : React.createElement( Fragment, null, React.createElement( BlockControls, null, React.createElement(ToolbarGroup, { controls: VERT_ALIGNMENT_CONTROLS }) ), React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Columns Settings', 'advanced-gutenberg') }, React.createElement( PanelBody, { title: __('Responsive Settings', 'advanced-gutenberg') }, React.createElement( 'div', { className: 'advgb-columns-responsive-items' }, ['desktop', 'tablet', 'mobile'].map(function (device, index) { var itemClasses = ["advgb-columns-responsive-item", tabSelected === device && 'is-selected'].filter(Boolean).join(' '); return React.createElement( 'div', { className: itemClasses, key: index, onClick: function onClick() { return _this2.setState({ tabSelected: device }); } }, _this2.translatableText(device) ); }) ), React.createElement( 'div', { className: 'advgb-columns-select-layout on-inspector' }, COLUMNS_LAYOUTS_FILTERED.map(function (layout, index) { var layoutClasses = ['advgb-columns-layout', tabSelected === 'desktop' && layout.layout === columnsLayout && 'is-selected', tabSelected === 'tablet' && layout.layout === columnsLayoutT && 'is-selected', tabSelected === 'mobile' && layout.layout === columnsLayoutM && 'is-selected'].filter(Boolean).join(' '); return React.createElement( Tooltip, { text: layout.title, key: index }, React.createElement( 'div', { className: layoutClasses, onClick: function onClick() { setAttributes(_defineProperty({}, 'columnsLayout' + deviceLetter, layout.layout)); _this2.setState({ random: Math.random() }); } }, React.createElement('img', { src: advgbBlocks.pluginUrl + '/assets/blocks/columns/icons/' + layout.icon + '.png', alt: layout.layout }) ) ); }), tabSelected !== 'desktop' && COLUMNS_LAYOUTS_RESPONSIVE_FILTERED.map(function (layout, index) { var layoutClasses = ['advgb-columns-layout', tabSelected === 'tablet' && layout.layout === columnsLayoutT && 'is-selected', tabSelected === 'mobile' && layout.layout === columnsLayoutM && 'is-selected'].filter(Boolean).join(' '); return React.createElement( Tooltip, { text: layout.title, key: index }, React.createElement( 'div', { className: layoutClasses, onClick: function onClick() { setAttributes(_defineProperty({}, 'columnsLayout' + deviceLetter, layout.layout)); _this2.setState({ random: Math.random() }); } }, React.createElement('img', { src: advgbBlocks.pluginUrl + '/assets/blocks/columns/icons/' + layout.icon + '.png', alt: layout.layout }) ) ); }) ), tabSelected === 'desktop' && React.createElement(SelectControl, { label: __('Space between columns', 'advanced-gutenberg'), value: gutter, options: GUTTER_OPTIONS, onChange: function onChange(value) { return setAttributes({ gutter: parseInt(value) }); } }), tabSelected === 'mobile' && columnsLayoutM === 'stacked' && React.createElement( Fragment, null, React.createElement(SelectControl, { label: __('Vertical space when collapsed', 'advanced-gutenberg'), value: collapsedGutter, options: GUTTER_OPTIONS, onChange: function onChange(value) { return setAttributes({ collapsedGutter: parseInt(value) }); } }), React.createElement(ToggleControl, { label: __('Collapsed Order RTL', 'advanced-gutenberg'), checked: collapsedRtl, onChange: function onChange() { return setAttributes({ collapsedRtl: !collapsedRtl }); } }) ), React.createElement( PanelBody, { title: tabSelected !== 'desktop' ? AdvColumnsEdit.jsUcfirst(tabSelected) + __(' Padding', 'advanced-gutenberg') : __('Padding', 'advanced-gutenberg'), initialOpen: false }, React.createElement( 'div', { className: 'advgb-controls-title' }, React.createElement( 'span', null, __('Unit', 'advanced-gutenberg') ), React.createElement( 'div', { className: 'advgb-unit-wrapper', key: 'unit' }, ['px', 'em', 'vh', '%'].map(function (unit, idx) { return React.createElement( 'span', { className: 'advgb-unit ' + (paddingUnit === unit ? 'selected' : ''), key: idx, onClick: function onClick() { return setAttributes({ paddingUnit: unit }); } }, unit ); }) ) ), MARGIN_PADDING_CONTROLS.map(function (pos, idx) { return React.createElement(RangeControl, { key: idx, beforeIcon: pos.icon, value: attributes['padding' + pos.label + deviceLetter] || 0, min: 0, max: 200, onChange: function onChange(value) { return setAttributes(_defineProperty({}, 'padding' + pos.label + deviceLetter, value)); } }); }) ), React.createElement( PanelBody, { title: tabSelected !== 'desktop' ? AdvColumnsEdit.jsUcfirst(tabSelected) + __(' Margin', 'advanced-gutenberg') : __('Margin', 'advanced-gutenberg'), initialOpen: false }, React.createElement( 'div', { className: 'advgb-controls-title' }, React.createElement( 'span', null, __('Unit', 'advanced-gutenberg') ), React.createElement( 'div', { className: 'advgb-unit-wrapper', key: 'unit' }, ['px', 'em', 'vh', '%'].map(function (unit, idx) { return React.createElement( 'span', { className: 'advgb-unit ' + (marginUnit === unit ? 'selected' : ''), key: idx, onClick: function onClick() { return setAttributes({ marginUnit: unit }); } }, unit ); }) ) ), MARGIN_PADDING_CONTROLS.map(function (pos, idx) { return React.createElement(RangeControl, { key: idx, beforeIcon: pos.icon, value: attributes['margin' + pos.label + deviceLetter] || 0, min: 0, max: 200, onChange: function onChange(value) { return setAttributes(_defineProperty({}, 'margin' + pos.label + deviceLetter, value)); } }); }) ) ), React.createElement( PanelBody, { title: __('Row Settings', 'advanced-gutenberg'), initialOpen: false }, React.createElement(ToggleControl, { label: __('Columns Wrapped', 'advanced-gutenberg'), help: __('If your columns overflow they available space, they will be placed on a new line.', 'advanced-gutenberg'), checked: columnsWrapped, onChange: function onChange() { return setAttributes({ columnsWrapped: !columnsWrapped }); } }), React.createElement(SelectControl, { label: __('Wrapper Tag', 'advanced-gutenberg'), value: wrapperTag, options: [{ label: 'Div', value: 'div' }, { label: 'Header', value: 'header' }, { label: 'Section', value: 'section' }, { label: 'Main', value: 'main' }, { label: 'Article', value: 'article' }, { label: 'Aside', value: 'aside' }, { label: 'Footer', value: 'footer' }], onChange: function onChange(value) { return setAttributes({ wrapperTag: value }); } }), React.createElement(RangeControl, { label: [__('Content Max Width', 'advanced-gutenberg'), React.createElement( 'div', { className: 'advgb-unit-wrapper', key: 'unit' }, ['px', 'vw', '%'].map(function (unit, idx) { return React.createElement( 'span', { className: 'advgb-unit ' + (contentMaxWidthUnit === unit ? 'selected' : ''), key: idx, onClick: function onClick() { return setAttributes({ contentMaxWidthUnit: unit }); } }, unit ); }) )], value: contentMaxWidth, min: 0, max: contentMaxWidthUnit === 'px' ? 2000 : 100, onChange: function onChange(value) { return setAttributes({ contentMaxWidth: value }); } }), React.createElement(RangeControl, { label: [__('Content Min Height', 'advanced-gutenberg'), React.createElement( 'div', { className: 'advgb-unit-wrapper', key: 'unit' }, ['px', 'vw', 'vh'].map(function (unit, idx) { return React.createElement( 'span', { className: 'advgb-unit ' + (contentMinHeightUnit === unit ? 'selected' : ''), key: idx, onClick: function onClick() { return setAttributes({ contentMinHeightUnit: unit }); } }, unit ); }) )], value: contentMinHeight, min: 0, max: contentMinHeightUnit === 'px' ? 2000 : 200, onChange: function onChange(value) { return setAttributes({ contentMinHeight: value }); } }), React.createElement(RangeControl, { label: [__('Content Max Height', 'advanced-gutenberg'), React.createElement( 'div', { className: 'advgb-unit-wrapper', key: 'unit' }, ['px', 'vw', 'vh'].map(function (unit, idx) { return React.createElement( 'span', { className: 'advgb-unit ' + (contentMaxHeightUnit === unit ? 'selected' : ''), key: idx, onClick: function onClick() { return setAttributes({ contentMaxHeightUnit: unit }); } }, unit ); }) )], value: contentMaxHeight, min: 0, max: contentMaxHeightUnit === 'px' ? 2000 : 200, onChange: function onChange(value) { return setAttributes({ contentMaxHeight: value }); } }) ) ) ), React.createElement( 'span', { className: 'advgb-columns-spacing' }, '\xA0' ), React.createElement( 'div', { className: 'advgb-columns-wrapper' }, React.createElement( 'div', { className: blockClasses, style: { maxWidth: !!contentMaxWidth ? '' + contentMaxWidth + contentMaxWidthUnit : undefined, minHeight: !!contentMinHeight ? '' + contentMinHeight + contentMinHeightUnit : undefined, maxHeight: !!contentMaxHeight ? '' + contentMaxHeight + contentMaxHeightUnit : undefined } }, React.createElement(InnerBlocks, { template: times(parseInt(columns), function () { return ['advgb/column']; }), templateLock: 'all', allowedBlocks: ['advgb/column'], random: this.state.random }) ) ), React.createElement( 'style', null, '#block-' + clientId + ' .advgb-columns-wrapper .advgb-columns {\n margin-top: ' + (marginTop + marginUnit) + ';\n margin-right: ' + (marginRight + marginUnit) + ';\n margin-bottom: ' + (marginBottom + marginUnit) + ';\n margin-left: ' + (marginLeft + marginUnit) + ';\n padding-top: ' + (paddingTop + paddingUnit) + ';\n padding-right: ' + (paddingRight + paddingUnit) + ';\n padding-bottom: ' + (paddingBottom + paddingUnit) + ';\n padding-left: ' + (paddingLeft + paddingUnit) + ';\n }\n @media screen and (max-width: 767px) {\n #block-' + clientId + ' .advgb-columns-wrapper .advgb-columns {\n margin-top: ' + (marginTopM + marginUnit) + ';\n margin-right: ' + (marginRightM + marginUnit) + ';\n margin-bottom: ' + (marginBottomM + marginUnit) + ';\n margin-left: ' + (marginLeftM + marginUnit) + ';\n padding-top: ' + (paddingTopM + paddingUnit) + ';\n padding-right: ' + (paddingRightM + paddingUnit) + ';\n padding-bottom: ' + (paddingBottomM + paddingUnit) + ';\n padding-left: ' + (paddingLeftM + paddingUnit) + ';\n }\n }' ) ); } }], [{ key: 'prepareColumnClass', value: function prepareColumnClass(layout, extraClass, classObj) { switch (layout) { case '12-12': for (var i = 0; i < 2; i++) { classObj[i].push('advgb-is-half' + extraClass); } break; case '13-13-13': for (var _i = 0; _i < 3; _i++) { classObj[_i].push('advgb-is-one-third' + extraClass); } break; case '14-14-14-14': for (var _i2 = 0; _i2 < 4; _i2++) { classObj[_i2].push('advgb-is-one-quarter' + extraClass); } break; case 'five': for (var _i3 = 0; _i3 < 5; _i3++) { classObj[_i3].push('advgb-is-one-fifth' + extraClass); } break; case 'six': for (var _i4 = 0; _i4 < 6; _i4++) { classObj[_i4].push('advgb-is-2' + extraClass); } break; case '23-13': classObj[0].push('advgb-is-two-thirds' + extraClass); classObj[1].push('advgb-is-one-third' + extraClass); break; case '13-23': classObj[0].push('advgb-is-one-third' + extraClass); classObj[1].push('advgb-is-two-thirds' + extraClass); break; case '34-14': classObj[0].push('advgb-is-three-quarters' + extraClass); classObj[1].push('advgb-is-one-quarter' + extraClass); break; case '14-34': classObj[0].push('advgb-is-one-quarter' + extraClass); classObj[1].push('advgb-is-three-quarters' + extraClass); break; case '45-15': classObj[0].push('advgb-is-four-fifths' + extraClass); classObj[1].push('advgb-is-one-fifth' + extraClass); break; case '15-45': classObj[0].push('advgb-is-one-fifth' + extraClass); classObj[1].push('advgb-is-four-fifths' + extraClass); break; case '12-14-14': classObj[0].push('advgb-is-half' + extraClass); classObj[1].push('advgb-is-one-quarter' + extraClass); classObj[2].push('advgb-is-one-quarter' + extraClass); break; case '14-14-12': classObj[0].push('advgb-is-one-quarter' + extraClass); classObj[1].push('advgb-is-one-quarter' + extraClass); classObj[2].push('advgb-is-half' + extraClass); break; case '14-12-14': classObj[0].push('advgb-is-one-quarter' + extraClass); classObj[1].push('advgb-is-half' + extraClass); classObj[2].push('advgb-is-one-quarter' + extraClass); break; case '15-35-15': classObj[0].push('advgb-is-one-fifth' + extraClass); classObj[1].push('advgb-is-three-fifths' + extraClass); classObj[2].push('advgb-is-one-fifth' + extraClass); break; case '35-15-15': classObj[0].push('advgb-is-three-fifths' + extraClass); classObj[1].push('advgb-is-one-fifth' + extraClass); classObj[2].push('advgb-is-one-fifth' + extraClass); break; case '15-15-35': classObj[0].push('advgb-is-one-fifth' + extraClass); classObj[1].push('advgb-is-one-fifth' + extraClass); classObj[2].push('advgb-is-three-fifths' + extraClass); break; case '16-46-16': classObj[0].push('advgb-is-2' + extraClass); classObj[1].push('advgb-is-8' + extraClass); classObj[2].push('advgb-is-2' + extraClass); break; case '1-12-12': classObj[0].push('advgb-is-full' + extraClass); classObj[1].push('advgb-is-half' + extraClass); classObj[2].push('advgb-is-half' + extraClass); break; case '12-12-1': classObj[0].push('advgb-is-half' + extraClass); classObj[1].push('advgb-is-half' + extraClass); classObj[2].push('advgb-is-full' + extraClass); break; case '36-16-16-16': classObj[0].push('advgb-is-half' + extraClass); classObj[1].push('advgb-is-2' + extraClass); classObj[2].push('advgb-is-2' + extraClass); classObj[3].push('advgb-is-2' + extraClass); break; case '16-16-16-36': classObj[0].push('advgb-is-2' + extraClass); classObj[1].push('advgb-is-2' + extraClass); classObj[2].push('advgb-is-2' + extraClass); classObj[3].push('advgb-is-half' + extraClass); break; case '25-15-15-15': classObj[0].push('advgb-is-two-fifths' + extraClass); classObj[1].push('advgb-is-one-fifth' + extraClass); classObj[2].push('advgb-is-one-fifth' + extraClass); classObj[3].push('advgb-is-one-fifth' + extraClass); break; case '15-15-15-25': classObj[0].push('advgb-is-one-fifth' + extraClass); classObj[1].push('advgb-is-one-fifth' + extraClass); classObj[2].push('advgb-is-one-fifth' + extraClass); classObj[3].push('advgb-is-two-fifths' + extraClass); break; case '12x4': for (var _i5 = 0; _i5 < 4; _i5++) { classObj[_i5].push('advgb-is-half' + extraClass); } break; case '12x6': for (var _i6 = 0; _i6 < 6; _i6++) { classObj[_i6].push('advgb-is-half' + extraClass); } break; case '13x6': for (var _i7 = 0; _i7 < 6; _i7++) { classObj[_i7].push('advgb-is-one-third' + extraClass); } break; case 'stacked': for (var _i8 = 0; _i8 < 6; _i8++) { classObj[_i8].push('advgb-is-full' + extraClass); } break; default: break; } return classObj; } }, { key: 'jsUcfirst', value: function jsUcfirst(string) { return string.charAt(0).toUpperCase() + string.slice(1); } }]); return AdvColumnsEdit; }(Component); var blockAttrs = { columns: { type: 'number' }, columnsLayout: { type: 'string' }, columnsLayoutT: { type: 'string' }, columnsLayoutM: { type: 'string', default: 'stacked' }, marginTop: { type: 'number' }, marginTopT: { type: 'number' }, marginTopM: { type: 'number' }, marginRight: { type: 'number' }, marginRightT: { type: 'number' }, marginRightM: { type: 'number' }, marginBottom: { type: 'number' }, marginBottomT: { type: 'number' }, marginBottomM: { type: 'number' }, marginLeft: { type: 'number' }, marginLeftT: { type: 'number' }, marginLeftM: { type: 'number' }, marginUnit: { type: 'string', default: 'px' }, paddingTop: { type: 'number' }, paddingTopT: { type: 'number' }, paddingTopM: { type: 'number' }, paddingRight: { type: 'number' }, paddingRightT: { type: 'number' }, paddingRightM: { type: 'number' }, paddingBottom: { type: 'number' }, paddingBottomT: { type: 'number' }, paddingBottomM: { type: 'number' }, paddingLeft: { type: 'number' }, paddingLeftT: { type: 'number' }, paddingLeftM: { type: 'number' }, paddingUnit: { type: 'string', default: 'px' }, gutter: { type: 'number', default: 0 }, collapsedGutter: { type: 'number', default: 10 }, collapsedRtl: { type: 'boolean', default: false }, vAlign: { type: 'string' }, columnsWrapped: { type: 'boolean', default: false }, contentMaxWidth: { type: 'number' }, contentMaxWidthUnit: { type: 'string', default: 'px' }, contentMinHeight: { type: 'number' }, contentMinHeightUnit: { type: 'string', default: 'px' }, contentMaxHeight: { type: 'number' }, contentMaxHeightUnit: { type: 'string', default: 'px' }, wrapperTag: { type: 'string', default: 'div' }, colId: { type: 'string' }, changed: { type: 'boolean', default: false }, isPreview: { type: 'boolean', default: false } }; registerBlockType('advgb/columns', { title: __('Columns - PublishPress', 'advanced-gutenberg'), description: __('Create flexible layouts for your content with advanced options and styles.', 'advanced-gutenberg'), icon: { src: 'layout', foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('columns', 'advanced-gutenberg'), __('columns manager', 'advanced-gutenberg'), __('row', 'advanced-gutenberg'), __('layout', 'advanced-gutenberg')], supports: { align: ['wide', 'full'], html: false }, attributes: blockAttrs, example: { attributes: { isPreview: true } }, edit: AdvColumnsEdit, save: function save(_ref3) { var attributes = _ref3.attributes; var columns = attributes.columns, columnsLayout = attributes.columnsLayout, columnsLayoutT = attributes.columnsLayoutT, columnsLayoutM = attributes.columnsLayoutM, vAlign = attributes.vAlign, gutter = attributes.gutter, collapsedGutter = attributes.collapsedGutter, collapsedRtl = attributes.collapsedRtl, columnsWrapped = attributes.columnsWrapped, contentMaxWidth = attributes.contentMaxWidth, contentMaxWidthUnit = attributes.contentMaxWidthUnit, contentMinHeight = attributes.contentMinHeight, contentMinHeightUnit = attributes.contentMinHeightUnit, contentMaxHeight = attributes.contentMaxHeight, contentMaxHeightUnit = attributes.contentMaxHeightUnit, wrapperTag = attributes.wrapperTag, colId = attributes.colId; var Tag = wrapperTag; var blockClasses = ['advgb-columns', 'advgb-columns-row', 'advgb-is-mobile', vAlign && 'columns-valign-' + vAlign, columns && 'advgb-columns-' + columns, columnsLayout && 'layout-' + columnsLayout, columnsLayoutT && 'tbl-layout-' + columnsLayoutT, columnsLayoutM && 'mbl-layout-' + columnsLayoutM, !!gutter && 'gutter-' + gutter, !!collapsedGutter && 'vgutter-' + collapsedGutter, collapsedRtl && 'order-rtl', columnsWrapped && 'columns-wrapped'].filter(Boolean).join(' '); return React.createElement( Tag, { className: 'advgb-columns-wrapper', id: colId }, React.createElement( 'div', { className: 'advgb-columns-container' }, React.createElement( 'div', { className: blockClasses, style: { maxWidth: !!contentMaxWidth ? '' + contentMaxWidth + contentMaxWidthUnit : undefined, minHeight: !!contentMinHeight ? '' + contentMinHeight + contentMinHeightUnit : undefined, maxHeight: !!contentMaxHeight ? '' + contentMaxHeight + contentMaxHeightUnit : undefined } }, React.createElement(InnerBlocks.Content, null) ) ) ); }, deprecated: [{ attributes: blockAttrs, save: function save(_ref4) { var attributes = _ref4.attributes; var columns = attributes.columns, columnsLayout = attributes.columnsLayout, columnsLayoutT = attributes.columnsLayoutT, columnsLayoutM = attributes.columnsLayoutM, vAlign = attributes.vAlign, gutter = attributes.gutter, collapsedGutter = attributes.collapsedGutter, collapsedRtl = attributes.collapsedRtl, columnsWrapped = attributes.columnsWrapped, contentMaxWidth = attributes.contentMaxWidth, contentMaxWidthUnit = attributes.contentMaxWidthUnit, contentMinHeight = attributes.contentMinHeight, contentMinHeightUnit = attributes.contentMinHeightUnit, contentMaxHeight = attributes.contentMaxHeight, contentMaxHeightUnit = attributes.contentMaxHeightUnit, wrapperTag = attributes.wrapperTag, colId = attributes.colId; var Tag = wrapperTag; var blockClasses = ['advgb-columns', 'advgb-is-mobile', vAlign && 'columns-valign-' + vAlign, columns && 'advgb-columns-' + columns, columnsLayout && 'layout-' + columnsLayout, columnsLayoutT && 'tbl-layout-' + columnsLayoutT, columnsLayoutM && 'mbl-layout-' + columnsLayoutM, !!gutter && 'gutter-' + gutter, !!collapsedGutter && 'vgutter-' + collapsedGutter, collapsedRtl && 'order-rtl', columnsWrapped && 'columns-wrapped'].filter(Boolean).join(' '); return React.createElement( Tag, { className: 'advgb-columns-wrapper' }, React.createElement( 'div', { className: blockClasses, id: colId, style: { maxWidth: !!contentMaxWidth ? '' + contentMaxWidth + contentMaxWidthUnit : undefined, minHeight: !!contentMinHeight ? '' + contentMinHeight + contentMinHeightUnit : undefined, maxHeight: !!contentMaxHeight ? '' + contentMaxHeight + contentMaxHeightUnit : undefined } }, React.createElement(InnerBlocks.Content, null) ) ); } }, { attributes: blockAttrs, save: function save(_ref5) { var attributes = _ref5.attributes; var columns = attributes.columns, columnsLayout = attributes.columnsLayout, columnsLayoutT = attributes.columnsLayoutT, columnsLayoutM = attributes.columnsLayoutM, vAlign = attributes.vAlign, gutter = attributes.gutter, collapsedGutter = attributes.collapsedGutter, collapsedRtl = attributes.collapsedRtl, columnsWrapped = attributes.columnsWrapped, contentMaxWidth = attributes.contentMaxWidth, contentMaxWidthUnit = attributes.contentMaxWidthUnit, contentMinHeight = attributes.contentMinHeight, contentMinHeightUnit = attributes.contentMinHeightUnit, wrapperTag = attributes.wrapperTag, colId = attributes.colId; var Tag = wrapperTag; var blockClasses = ['advgb-columns', 'columns is-mobile', vAlign && 'columns-valign-' + vAlign, columns && 'advgb-columns-' + columns, columnsLayout && 'layout-' + columnsLayout, columnsLayoutT && 'tbl-layout-' + columnsLayoutT, columnsLayoutM && 'mbl-layout-' + columnsLayoutM, !!gutter && 'gutter-' + gutter, !!collapsedGutter && 'vgutter-' + collapsedGutter, collapsedRtl && 'order-rtl', columnsWrapped && 'columns-wrapped'].filter(Boolean).join(' '); return React.createElement( Tag, { className: 'advgb-columns-wrapper' }, React.createElement( 'div', { className: blockClasses, id: colId, style: { maxWidth: !!contentMaxWidth ? '' + contentMaxWidth + contentMaxWidthUnit : undefined, minHeight: !!contentMinHeight ? '' + contentMinHeight + contentMinHeightUnit : undefined } }, React.createElement(InnerBlocks.Content, null) ) ); } }] }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/columns/column.jsx": /*!**********************************************!*\ !*** ./src/assets/blocks/columns/column.jsx ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, PanelColorSettings = _wpBlockEditor.PanelColorSettings, AlignmentToolbar = _wpBlockEditor.AlignmentToolbar, InnerBlocks = _wpBlockEditor.InnerBlocks; var PanelBody = wpComponents.PanelBody, RangeControl = wpComponents.RangeControl, BaseControl = wpComponents.BaseControl, SelectControl = wpComponents.SelectControl; var select = wp.data.select; var columnsBlockIcon = React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24" }, React.createElement("path", { d: "M10 18h5V5h-5v13zm-6 0h5V5H4v13zM16 5v13h5V5h-5z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ); var listBorderStyles = [{ label: __('None', 'advanced-gutenberg'), value: 'none' }, { label: __('Solid', 'advanced-gutenberg'), value: 'solid' }, { label: __('Dotted', 'advanced-gutenberg'), value: 'dotted' }, { label: __('Dashed', 'advanced-gutenberg'), value: 'dashed' }, { label: __('Double', 'advanced-gutenberg'), value: 'double' }, { label: __('Groove', 'advanced-gutenberg'), value: 'groove' }, { label: __('Ridge', 'advanced-gutenberg'), value: 'ridge' }, { label: __('Inset', 'advanced-gutenberg'), value: 'inset' }, { label: __('Outset', 'advanced-gutenberg'), value: 'outset' }]; var MARGIN_PADDING_CONTROLS = [{ label: 'Top', icon: 'arrow-up-alt2' }, { label: 'Right', icon: 'arrow-right-alt2' }, { label: 'Bottom', icon: 'arrow-down-alt2' }, { label: 'Left', icon: 'arrow-left-alt2' }]; var AdvColumnEdit = function (_Component) { _inherits(AdvColumnEdit, _Component); function AdvColumnEdit() { _classCallCheck(this, AdvColumnEdit); var _this = _possibleConstructorReturn(this, (AdvColumnEdit.__proto__ || Object.getPrototypeOf(AdvColumnEdit)).apply(this, arguments)); _this.state = { tabSelected: 'desktop' }; return _this; } _createClass(AdvColumnEdit, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-column']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === "undefined" ? "undefined" : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: "componentDidMount", value: function componentDidMount() { var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes, clientId = _props2.clientId; if (!attributes.id) { setAttributes({ colId: 'advgb-col-' + clientId }); } } }, { key: "render", value: function render() { var _this2 = this; var tabSelected = this.state.tabSelected; var _props3 = this.props, attributes = _props3.attributes, setAttributes = _props3.setAttributes, clientId = _props3.clientId, className = _props3.className; var width = attributes.width, borderColor = attributes.borderColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, borderRadius = attributes.borderRadius, textAlign = attributes.textAlign, textAlignM = attributes.textAlignM, marginTop = attributes.marginTop, marginRight = attributes.marginRight, marginBottom = attributes.marginBottom, marginLeft = attributes.marginLeft, marginTopM = attributes.marginTopM, marginRightM = attributes.marginRightM, marginBottomM = attributes.marginBottomM, marginLeftM = attributes.marginLeftM, paddingTop = attributes.paddingTop, paddingRight = attributes.paddingRight, paddingBottom = attributes.paddingBottom, paddingLeft = attributes.paddingLeft, paddingTopM = attributes.paddingTopM, paddingRightM = attributes.paddingRightM, paddingBottomM = attributes.paddingBottomM, paddingLeftM = attributes.paddingLeftM; var _ref = !wp.blockEditor ? select('core/editor') : select('core/block-editor'), getBlockOrder = _ref.getBlockOrder, getBlockRootClientId = _ref.getBlockRootClientId, getBlockAttributes = _ref.getBlockAttributes; var hasChildBlocks = getBlockOrder(clientId).length > 0; var rootBlockId = getBlockRootClientId(clientId); var rootChildBlocks = getBlockOrder(rootBlockId).filter(function (blockId) { return blockId !== clientId; }); var avaiWidth = 100; rootChildBlocks.map(function (blockId) { var width = getBlockAttributes(blockId).width || 0; avaiWidth -= parseInt(width); }); var blockClasses = ['advgb-column', className].filter(Boolean).join(' '); var deviceLetter = ''; if (tabSelected === 'mobile') deviceLetter = 'M'; return React.createElement( Fragment, null, React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Column Settings', 'advanced-gutenberg') }, React.createElement(RangeControl, { label: [__('Width (%)', 'advanced-gutenberg'), React.createElement( "span", { key: "width", style: { color: '#555d66', marginLeft: 10 } }, __('Available: ', 'advanced-gutenberg') + avaiWidth + '%' )], help: __('Set to 0 = auto. This will override predefine layout styles. Recommend for experience users!', 'advanced-gutenberg'), value: width, min: 0, max: avaiWidth, onChange: function onChange(value) { return setAttributes({ width: value }); } }), React.createElement( PanelBody, { title: __('Border Settings', 'advanced-gutenberg') }, React.createElement(SelectControl, { label: __('Border style', 'advanced-gutenberg'), value: borderStyle, options: listBorderStyles, onChange: function onChange(value) { return setAttributes({ borderStyle: value }); } }), borderStyle !== 'none' && React.createElement( Fragment, null, React.createElement(PanelColorSettings, { title: __('Border Color', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Border Color', 'advanced-gutenberg'), value: borderColor, onChange: function onChange(value) { return setAttributes({ borderColor: value }); } }] }), React.createElement(RangeControl, { label: __('Border width', 'advanced-gutenberg'), value: borderWidth || '', onChange: function onChange(value) { return setAttributes({ borderWidth: value }); }, min: 0, max: 20 }), React.createElement(RangeControl, { label: __('Border radius (px)', 'advanced-gutenberg'), value: borderRadius || '', onChange: function onChange(value) { return setAttributes({ borderRadius: value }); }, min: 0, max: 100 }) ) ), React.createElement( "div", { className: "advgb-columns-responsive-items", style: { borderTop: '2px solid #aaa', paddingTop: 10 } }, ['desktop', 'mobile'].map(function (device, index) { var itemClasses = ["advgb-columns-responsive-item", tabSelected === device && 'is-selected'].filter(Boolean).join(' '); return React.createElement( "div", { className: itemClasses, key: index, onClick: function onClick() { return _this2.setState({ tabSelected: device }); } }, device ); }) ), React.createElement( BaseControl, { label: AdvColumnEdit.jsUcfirst(tabSelected) + __(' text alignment', 'advanced-gutenberg') }, React.createElement(AlignmentToolbar, { isCollapsed: false, value: attributes['textAlign' + deviceLetter], onChange: function onChange(align) { return setAttributes(_defineProperty({}, 'textAlign' + deviceLetter, align)); } }) ), React.createElement( PanelBody, { title: tabSelected !== 'desktop' ? AdvColumnEdit.jsUcfirst(tabSelected) + __(' Padding', 'advanced-gutenberg') : __('Padding', 'advanced-gutenberg'), initialOpen: false }, React.createElement( "div", { className: "advgb-controls-title" }, __('Unit (px)', 'advanced-gutenberg') ), MARGIN_PADDING_CONTROLS.map(function (pos, idx) { return React.createElement(RangeControl, { key: idx, beforeIcon: pos.icon, value: attributes['padding' + pos.label + deviceLetter] || '', min: 0, max: 200, onChange: function onChange(value) { return setAttributes(_defineProperty({}, 'padding' + pos.label + deviceLetter, value)); } }); }) ), React.createElement( PanelBody, { title: tabSelected !== 'desktop' ? AdvColumnEdit.jsUcfirst(tabSelected) + __(' Margin', 'advanced-gutenberg') : __('Margin', 'advanced-gutenberg'), initialOpen: false }, React.createElement( "div", { className: "advgb-controls-title" }, __('Unit (px)', 'advanced-gutenberg') ), MARGIN_PADDING_CONTROLS.map(function (pos, idx) { return React.createElement(RangeControl, { key: idx, beforeIcon: pos.icon, value: attributes['margin' + pos.label + deviceLetter] || '', min: 0, max: 200, onChange: function onChange(value) { return setAttributes(_defineProperty({}, 'margin' + pos.label + deviceLetter, value)); } }); }) ) ) ), React.createElement( "div", { className: blockClasses }, React.createElement( "div", { className: "advgb-column-inner", style: { borderStyle: borderStyle, borderColor: borderColor, borderWidth: borderWidth, borderRadius: borderRadius } }, React.createElement(InnerBlocks, { templateLock: false, renderAppender: hasChildBlocks ? undefined : function () { return React.createElement(InnerBlocks.ButtonBlockAppender, null); } }) ) ), React.createElement( "style", null, "#block-" + clientId + " .advgb-column > .advgb-column-inner {\n text-align: " + textAlign + ";\n margin-top: " + marginTop + "px;\n margin-right: " + marginRight + "px;\n margin-bottom: " + marginBottom + "px;\n margin-left: " + marginLeft + "px;\n padding-top: " + paddingTop + "px;\n padding-right: " + paddingRight + "px;\n padding-bottom: " + paddingBottom + "px;\n padding-left: " + paddingLeft + "px;\n }\n @media screen and (max-width: 767px) {\n #block-" + clientId + " .advgb-column > .advgb-column-inner {\n text-align: " + textAlignM + ";\n margin-top: " + marginTopM + "px;\n margin-right: " + marginRightM + "px;\n margin-bottom: " + marginBottomM + "px;\n margin-left: " + marginLeftM + "px;\n padding-top: " + paddingTopM + "px;\n padding-right: " + paddingRightM + "px;\n padding-bottom: " + paddingBottomM + "px;\n padding-left: " + paddingLeftM + "px;\n }\n }\n " + (width ? "#block-" + clientId + " {flex-basis: " + width + "%;}" : '') ) ); } }], [{ key: "jsUcfirst", value: function jsUcfirst(string) { return string.charAt(0).toUpperCase() + string.slice(1); } }]); return AdvColumnEdit; }(Component); var blockAttrs = { width: { type: 'number' }, columnClasses: { type: 'string' }, colId: { type: 'string' }, borderStyle: { type: 'string', default: 'none' }, borderColor: { type: 'string' }, borderWidth: { type: 'number', default: 1 }, borderRadius: { type: 'number' }, textAlign: { type: 'string' }, textAlignM: { type: 'string' }, marginTop: { type: 'number' }, marginTopM: { type: 'number' }, marginRight: { type: 'number' }, marginRightM: { type: 'number' }, marginBottom: { type: 'number' }, marginBottomM: { type: 'number' }, marginLeft: { type: 'number' }, marginLeftM: { type: 'number' }, paddingTop: { type: 'number' }, paddingTopM: { type: 'number' }, paddingRight: { type: 'number' }, paddingRightM: { type: 'number' }, paddingBottom: { type: 'number' }, paddingBottomM: { type: 'number' }, paddingLeft: { type: 'number' }, paddingLeftM: { type: 'number' }, changed: { type: 'boolean', default: false } }; registerBlockType('advgb/column', { title: __('Column - PublishPress', 'advanced-gutenberg'), parent: ['advgb/columns'], description: __('Column in row.', 'advanced-gutenberg'), icon: { src: columnsBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('columns', 'advanced-gutenberg'), __('row', 'advanced-gutenberg'), __('layout', 'advanced-gutenberg')], supports: { inserter: false, reusable: false, html: false }, attributes: blockAttrs, edit: AdvColumnEdit, save: function save(_ref2) { var attributes = _ref2.attributes; var width = attributes.width, columnClasses = attributes.columnClasses, colId = attributes.colId, borderColor = attributes.borderColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, borderRadius = attributes.borderRadius; var blockClasses = ['advgb-column', columnClasses].filter(Boolean).join(' '); return React.createElement( "div", { className: blockClasses, id: colId, style: { flex: width ? 'none' : undefined } }, React.createElement( "div", { className: "advgb-column-inner", style: { borderStyle: borderStyle, borderColor: borderColor, borderWidth: borderWidth, borderRadius: borderRadius } }, React.createElement(InnerBlocks.Content, null) ) ); }, deprecated: [{ attributes: blockAttrs, save: function save(_ref3) { var attributes = _ref3.attributes; var width = attributes.width, columnClasses = attributes.columnClasses, colId = attributes.colId, borderColor = attributes.borderColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, borderRadius = attributes.borderRadius; var blockClasses = ['advgb-column', columnClasses].filter(Boolean).join(' '); return React.createElement( "div", { className: blockClasses, id: colId, style: { width: width ? width + '%' : undefined, flex: width ? 'none' : undefined } }, React.createElement( "div", { className: "advgb-column-inner", style: { borderStyle: borderStyle, borderColor: borderColor, borderWidth: borderWidth, borderRadius: borderRadius } }, React.createElement(InnerBlocks.Content, null) ) ); } }, { attributes: blockAttrs, save: function save(_ref4) { var attributes = _ref4.attributes; var width = attributes.width, columnClasses = attributes.columnClasses, colId = attributes.colId, borderColor = attributes.borderColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, borderRadius = attributes.borderRadius; var blockClasses = ['advgb-column', 'column', columnClasses].filter(Boolean).join(' '); return React.createElement( "div", { className: blockClasses, id: colId, style: { width: width ? width + '%' : undefined, flex: width ? 'none' : undefined } }, React.createElement( "div", { className: "advgb-column-inner", style: { borderStyle: borderStyle, borderColor: borderColor, borderWidth: borderWidth, borderRadius: borderRadius } }, React.createElement(InnerBlocks.Content, null) ) ); } }] }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/contact-form/block.jsx": /*!**************************************************!*\ !*** ./src/assets/blocks/contact-form/block.jsx ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, PanelColorSettings = _wpBlockEditor.PanelColorSettings; var PanelBody = wpComponents.PanelBody, RangeControl = wpComponents.RangeControl, SelectControl = wpComponents.SelectControl, TextControl = wpComponents.TextControl; var contactBlockIcon = React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24" }, React.createElement("path", { fill: "none", d: "M0 0h24v24H0V0z" }), React.createElement("path", { d: "M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 4.99L4 6h16zm0 12H4V8l8 5 8-5v10z" }) ); var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAEBCAYAAABRzrhTAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACOxJREFUeNrs3c9rFO0BwPHZ2TUxiS5W8WAr1YMHLxZe6kVKaVEo3l4PvXgRqmChp4JXoccXevLie3mJ9B+QWovQU1E8FCmtp4jvwVNNJEYDJpJokt3pzrJrx8nMZnezO9m6nw8Mya5xJszku88z+zMIAAAAAAAAAAAA4EtSGuTKKpXK0LcBYyJKXtja2trb0Btxl8QNxQTfvq7X8Et9xp31f0sd1it86C/saKd/6yb60i4DT39fEjoMJfS8r12N8KVdRp6OOyt2kUN/sSe/pr/f9jOdYi/1EXlW2HmLER12F3oy6nrquq5jL/URedYSZlw2qsNgRvN04FnBd4y90sWG8yIPE1/Dp0+ffnXq1KnfTkxM/DIMwx85XtC3zUas379///7B/fv3/3Tt2rVXqcBLre/rGTcSpYzz/M4jbcZo/lnc8XL37t0fXrhw4XczMzO/d3xgsOr1+uL8/Pwfrl69eu/hw4cfG1fVEpHX86bzjRuKqJfQ06N5mFyuXLky/e233343OTn5tUMCQ5rLR9Ha4uLiNxcvXvxubm5uIxF7LSf4bVP4bkIvZYRejpeVlZXZqampXzsUMHS158+fXz9z5sxfW4Enl8zRPRl62MVoHmTFfu/evZMih8KUT5w48ZtDhw5VWgNtcna94yNdYQ8b+mzqfvbs2V/Z91CcxsD6s9u3b59uz6iDz+8z2/bQdvK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OO0ceZMTbTdzbpuy7GdGjnOvTkYsbBjOyBzlxR53Oy/seYVvn60FOyDtN1QUP/Y3swQ7T846R9x1f4g66vHWJGoY3uncd+MCCzBnlh7ItGLPRPPdnug18KPElohc4DDD4XsMGAAAAAAAAAACAL9t/BRgA+YcmXetsJFIAAAAASUVORK5CYII='; var AdvContactForm = function (_Component) { _inherits(AdvContactForm, _Component); function AdvContactForm() { _classCallCheck(this, AdvContactForm); return _possibleConstructorReturn(this, (AdvContactForm.__proto__ || Object.getPrototypeOf(AdvContactForm)).apply(this, arguments)); } _createClass(AdvContactForm, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-contact-form']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === "undefined" ? "undefined" : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: "render", value: function render() { var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes; var nameLabel = attributes.nameLabel, emailLabel = attributes.emailLabel, msgLabel = attributes.msgLabel, submitLabel = attributes.submitLabel, successLabel = attributes.successLabel, alertLabel = attributes.alertLabel, bgColor = attributes.bgColor, textColor = attributes.textColor, borderColor = attributes.borderColor, borderStyle = attributes.borderStyle, borderRadius = attributes.borderRadius, submitColor = attributes.submitColor, submitBgColor = attributes.submitBgColor, submitRadius = attributes.submitRadius, submitPosition = attributes.submitPosition, isPreview = attributes.isPreview; return isPreview ? React.createElement("img", { alt: __('Contact Form', 'advanced-gutenberg'), width: "100%", src: previewImageData }) : React.createElement( Fragment, null, React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Form Settings', 'advanced-gutenberg') }, typeof advgbBlocks !== 'undefined' && !parseInt(advgbBlocks.captchaEnabled) && React.createElement( PanelBody, { title: __('Notice', 'advanced-gutenberg') }, React.createElement( "p", { style: { fontStyle: 'italic' } }, __('We strongly recommend to enable Google reCAPTCHA to avoid spam.', 'advanced-gutenberg'), React.createElement("br", null), React.createElement( "a", { href: advgbBlocks.config_url + '&tab=recaptcha', target: "_blank" }, __('You can enable it in Settings', 'advanced-gutenberg') ) ) ), React.createElement( PanelBody, { title: __('Email sender', 'advanced-gutenberg'), initialOpen: false }, React.createElement( "p", { style: { fontStyle: 'italic' } }, __('An email will be sent to the admin email (by default) whenever a contact form is submitted. You can change it in ', 'advanced-gutenberg'), React.createElement( "a", { href: advgbBlocks.config_url + '&tab=forms', target: "_blank" }, " ", __('settings', 'advanced-gutenberg'), "." ) ) ), React.createElement( PanelBody, { title: __('Text Label', 'advanced-gutenberg') }, React.createElement(TextControl, { label: __('Name input placeholder', 'advanced-gutenberg'), value: nameLabel, onChange: function onChange(value) { return setAttributes({ nameLabel: value }); } }), React.createElement(TextControl, { label: __('Email input placeholder', 'advanced-gutenberg'), value: emailLabel, onChange: function onChange(value) { return setAttributes({ emailLabel: value }); } }), React.createElement(TextControl, { label: __('Message input placeholder', 'advanced-gutenberg'), value: msgLabel, onChange: function onChange(value) { return setAttributes({ msgLabel: value }); } }), React.createElement(TextControl, { label: __('Submit text', 'advanced-gutenberg'), value: submitLabel, onChange: function onChange(value) { return setAttributes({ submitLabel: value }); } }), React.createElement(TextControl, { label: __('Empty field warning text', 'advanced-gutenberg'), value: alertLabel, onChange: function onChange(value) { return setAttributes({ alertLabel: value }); } }), React.createElement(TextControl, { label: __('Submit success text', 'advanced-gutenberg'), value: successLabel, onChange: function onChange(value) { return setAttributes({ successLabel: value }); } }) ), React.createElement(PanelColorSettings, { title: __('Input Color', 'advanced-gutenberg'), colorSettings: [{ label: __('Background color', 'advanced-gutenberg'), value: bgColor, onChange: function onChange(value) { return setAttributes({ bgColor: value }); } }, { label: __('Text color', 'advanced-gutenberg'), value: textColor, onChange: function onChange(value) { return setAttributes({ textColor: value }); } }] }), React.createElement( PanelBody, { title: __('Border Settings', 'advanced-gutenberg'), initialOpen: false }, React.createElement(PanelColorSettings, { title: __('Border Color', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Border color', 'advanced-gutenberg'), value: borderColor, onChange: function onChange(value) { return setAttributes({ borderColor: value }); } }] }), React.createElement(SelectControl, { label: __('Border Style', 'advanced-gutenberg'), value: borderStyle, options: [{ label: __('Solid', 'advanced-gutenberg'), value: 'solid' }, { label: __('Dashed', 'advanced-gutenberg'), value: 'dashed' }, { label: __('Dotted', 'advanced-gutenberg'), value: 'dotted' }], onChange: function onChange(value) { return setAttributes({ borderStyle: value }); } }), React.createElement(RangeControl, { label: __('Border radius (px)', 'advanced-gutenberg'), value: borderRadius, onChange: function onChange(value) { return setAttributes({ borderRadius: value }); }, min: 0, max: 50 }) ), React.createElement( PanelBody, { title: __('Submit Button Settings', 'advanced-gutenberg') }, React.createElement(PanelColorSettings, { title: __('Color Settings', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Border and Text', 'advanced-gutenberg'), value: submitColor, onChange: function onChange(value) { return setAttributes({ submitColor: value }); } }, { label: __('Background', 'advanced-gutenberg'), value: submitBgColor, onChange: function onChange(value) { return setAttributes({ submitBgColor: value }); } }] }), React.createElement(RangeControl, { label: __('Button border radius', 'advanced-gutenberg'), value: submitRadius, onChange: function onChange(value) { return setAttributes({ submitRadius: value }); }, min: 0, max: 50 }), React.createElement(SelectControl, { label: __('Button position', 'advanced-gutenberg'), value: submitPosition, options: [{ label: __('Center', 'advanced-gutenberg'), value: 'center' }, { label: __('Left', 'advanced-gutenberg'), value: 'left' }, { label: __('Right', 'advanced-gutenberg'), value: 'right' }], onChange: function onChange(value) { return setAttributes({ submitPosition: value }); } }) ) ) ), React.createElement( "div", { className: "advgb-contact-form" }, React.createElement( "div", { className: "advgb-form-field advgb-form-field-half" }, React.createElement("input", { type: "text", disabled: true, className: "advgb-form-input", value: nameLabel ? nameLabel : 'Name', style: { backgroundColor: bgColor, color: textColor, borderColor: borderColor, borderStyle: borderStyle, borderRadius: borderRadius } }) ), React.createElement( "div", { className: "advgb-form-field advgb-form-field-half" }, React.createElement("input", { type: "text", disabled: true, className: "advgb-form-input", value: emailLabel ? emailLabel : 'Email address', style: { backgroundColor: bgColor, color: textColor, borderColor: borderColor, borderStyle: borderStyle, borderRadius: borderRadius } }) ), React.createElement( "div", { className: "advgb-form-field advgb-form-field-full" }, React.createElement("textarea", { className: "advgb-form-input", disabled: true, value: msgLabel ? msgLabel : 'Message', style: { backgroundColor: bgColor, color: textColor, borderColor: borderColor, borderStyle: borderStyle, borderRadius: borderRadius } }) ), React.createElement( "div", { className: "advgb-form-submit-wrapper", style: { textAlign: submitPosition } }, React.createElement( "button", { className: "advgb-form-submit", style: { borderColor: submitColor, color: submitColor, backgroundColor: submitBgColor, borderRadius: submitRadius } }, submitLabel ? submitLabel : 'Submit' ) ) ) ); } }]); return AdvContactForm; }(Component); var contactBlockAttrs = { nameLabel: { type: 'string' }, emailLabel: { type: 'string' }, msgLabel: { type: 'string' }, submitLabel: { type: 'string' }, successLabel: { type: 'string' }, alertLabel: { type: 'string' }, bgColor: { type: 'string' }, textColor: { type: 'string' }, borderStyle: { type: 'string' }, borderColor: { type: 'string' }, borderRadius: { type: 'number' }, submitColor: { type: 'string' }, submitBgColor: { type: 'string' }, submitRadius: { type: 'number' }, submitPosition: { type: 'string', default: 'right' }, changed: { type: 'boolean', default: false }, isPreview: { type: 'boolean', default: false } }; registerBlockType('advgb/contact-form', { title: __('Contact Form - PublishPress', 'advanced-gutenberg'), description: __('Fastest way to create a contact form for your page.', 'advanced-gutenberg'), icon: { src: contactBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('contact', 'advanced-gutenberg'), __('form', 'advanced-gutenberg')], attributes: contactBlockAttrs, example: { attributes: { isPreview: true } }, supports: { anchor: true }, edit: AdvContactForm, save: function save(_ref) { var attributes = _ref.attributes; var nameLabel = attributes.nameLabel, emailLabel = attributes.emailLabel, msgLabel = attributes.msgLabel, submitLabel = attributes.submitLabel, successLabel = attributes.successLabel, alertLabel = attributes.alertLabel, bgColor = attributes.bgColor, textColor = attributes.textColor, borderColor = attributes.borderColor, borderStyle = attributes.borderStyle, borderRadius = attributes.borderRadius, submitColor = attributes.submitColor, submitBgColor = attributes.submitBgColor, submitRadius = attributes.submitRadius, submitPosition = attributes.submitPosition; return React.createElement( "div", { className: "advgb-contact-form" }, React.createElement( "form", { method: "POST" }, React.createElement( "div", { className: "advgb-form-field advgb-form-field-half" }, React.createElement("input", { type: "text", className: "advgb-form-input advgb-form-input-name", placeholder: nameLabel ? nameLabel : 'Name', name: "contact_name", style: { backgroundColor: bgColor, color: textColor, borderColor: borderColor, borderStyle: borderStyle, borderRadius: borderRadius } }) ), React.createElement( "div", { className: "advgb-form-field advgb-form-field-half" }, React.createElement("input", { type: "email", className: "advgb-form-input advgb-form-input-email", placeholder: emailLabel ? emailLabel : 'Email address', name: "contact_email", style: { backgroundColor: bgColor, color: textColor, borderColor: borderColor, borderStyle: borderStyle, borderRadius: borderRadius } }) ), React.createElement( "div", { className: "advgb-form-field advgb-form-field-full" }, React.createElement("textarea", { className: "advgb-form-input advgb-form-input-msg", placeholder: msgLabel ? msgLabel : 'Message', name: "contact_message", style: { backgroundColor: bgColor, color: textColor, borderColor: borderColor, borderStyle: borderStyle, borderRadius: borderRadius } }) ), React.createElement("div", { className: "advgb-grecaptcha clearfix position-" + submitPosition }), React.createElement( "div", { className: "advgb-form-submit-wrapper", style: { textAlign: submitPosition } }, React.createElement( "button", { className: "advgb-form-submit", type: "submit", "data-success": successLabel ? successLabel : undefined, "data-alert": alertLabel ? alertLabel : undefined, style: { borderColor: submitColor, color: submitColor, backgroundColor: submitBgColor, borderRadius: submitRadius } }, submitLabel ? submitLabel : 'Submit' ) ) ) ); } }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/container/block.jsx": /*!***********************************************!*\ !*** ./src/assets/blocks/container/block.jsx ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; (function (wpI18n, wpBlocks, wpBlockEditor) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Fragment = wp.element.Fragment; var registerBlockType = wpBlocks.registerBlockType, createBlock = wpBlocks.createBlock; var _wpBlockEditor = wpBlockEditor, InnerBlocks = _wpBlockEditor.InnerBlocks, InspectorControls = _wpBlockEditor.InspectorControls; var _wp$components = wp.components, PanelBody = _wp$components.PanelBody, SelectControl = _wp$components.SelectControl; var containerBlockIcon = React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "2 2 22 22" }, React.createElement("path", { fill: "none", d: "M0 0h24v24H0V0z" }), React.createElement("path", { d: "M3 5v14h19V5H3zm2 2h15v4H5V7zm0 10v-4h4v4H5zm6 0v-4h9v4h-9z" }) ); registerBlockType('advgb/container', { title: __('Container - PublishPress', 'advanced-gutenberg'), description: __('Block for containing other blocks.', 'advanced-gutenberg'), icon: { src: containerBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('container', 'advanced-gutenberg'), __('row', 'advanced-gutenberg'), __('box', 'advanced-gutenberg')], attributes: { wrapperTag: { type: 'string', default: 'div' } }, supports: { align: true, className: true }, transforms: { to: [{ type: 'block', blocks: ['advgb/columns'], transform: function transform(attributes, innerBlocks) { var className = attributes.className, wrapperTag = attributes.wrapperTag; var columnBlock = createBlock('advgb/column', {}, innerBlocks); return createBlock('advgb/columns', { columns: 1, className: className, wrapperTag: wrapperTag }, [columnBlock]); } }] }, edit: function edit(props) { var attributes = props.attributes, setAttributes = props.setAttributes, className = props.className; var wrapperTag = attributes.wrapperTag; return React.createElement( Fragment, null, React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Container Settings', 'advanced-gutenberg') }, React.createElement(SelectControl, { label: __('Wrapper Tag', 'advanced-gutenberg'), value: wrapperTag, options: [{ label: 'Div', value: 'div' }, { label: 'Header', value: 'header' }, { label: 'Section', value: 'section' }, { label: 'Main', value: 'main' }, { label: 'Article', value: 'article' }, { label: 'Aside', value: 'aside' }, { label: 'Footer', value: 'footer' }], onChange: function onChange(value) { return setAttributes({ wrapperTag: value }); } }) ) ), React.createElement( "div", { className: "advgb-blocks-container " + className }, React.createElement(InnerBlocks, null) ) ); }, save: function save(_ref) { var attributes = _ref.attributes; var Tag = attributes.wrapperTag; return React.createElement( Tag, { className: "advgb-blocks-container" }, React.createElement(InnerBlocks.Content, null) ); } }); })(wp.i18n, wp.blocks, wp.blockEditor); /***/ }), /***/ "./src/assets/blocks/count-up/block.jsx": /*!**********************************************!*\ !*** ./src/assets/blocks/count-up/block.jsx ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, RichText = _wpBlockEditor.RichText, PanelColorSettings = _wpBlockEditor.PanelColorSettings; var RangeControl = wpComponents.RangeControl, PanelBody = wpComponents.PanelBody, TextControl = wpComponents.TextControl, FormToggle = wpComponents.FormToggle; var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAADvCAYAAADb98kVAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADX9JREFUeNrs3c2LFNsdxvGq6p43xxlfVgHBG4UQRdx4FxIjGEXw/8hCsgpkk4WLQFxFEpKFWVzIQrLNxlVEUPBlEVfeTRRBAi6SjTdBxhlnRqenu9JP3z565kxVd9fbmemq7wfqzrR6u7qr6qnfOadPVQcBAAAAAAAAAAAAAAAAAAAAMFXCqlfQbre9rg+YYrH+s729PR1BH4Y7zLAuTgBoVJgn/Lu4rNCHFQTcfd4w5SchB2Hf+ThO+TeFAx+WHPJwRLjDEScBoMmBT/q568+KhD2sKOTu7+5CZQfVPDnUaUuhsIcVhdws0YiwhwQchH1HmHtjHucOe1hRyCPrZ/TgwYOvTp069fXCwsLJMAzn4zgO+8v3r7r/O/sdTdLPwODg7/V6H9bX1//98OHDf1y/fv27YbB7Vsh7CYHPFfaygu4uLf28dOnS3J07d64cO3bsj1EUfcUuBnbrdDrfvnnz5taZM2ceWAHvDoPdTQp7P+ixl6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PV1ZW/sPuAvJ58uTJtwkFNC7ynK1c7f0oUtvcXiJraR05cuT9hQsXftJut3/AbgMmt7Gx8c/Lly9/0/+111+6w5/u8jn829vbXiu6fdaJb9269d/nz5//id0GTK7b7a49ffr0z26eUqp6pgqfa9SsX6ndaq6WQdtaZvXz1atX10+ePPnLfgtgid0IjA75s2fPftuv5n/vP9weLh1rMX9mV3lV9IkCX2Yf3T7rDF7I1atX//r48eNfbW1t0WcHUqyvr7+4f//+r/shvzeqmV6kn563ogcJFT2yKvqMXeEXFxdnbt68+aMrV678dH5+fjmO48F6+z/Zy2is1dXV/z169Oj5jRs3/mX1ybtW9d4eVc2zVPSygh6lNOHtxfy9O5AHNJH9UVnPCXo3IejdlKBPltk8r1BPPgx70mBBNyXI0fAFRgQdmCjo3VHN90lDnjvoY/rmgfWi3aC3hn/nBp3Ao2kBD5zc2B+ndRMqeC8oMGGmXfAFh85ZyehaL6ZnVfJuSkUn6GhiJY9Twt5N+L3QgFzuoDvN98AJvAnu9jDYsdWPT+ujE3Y0Leh2ZuIgfYJMUtBjL0F3qrpdvcOUZklENQdSq3rPyUsv4c8///9Z+uelhMwagQ+C3dNiQyfcESEHxoY9DpIH4eJhazpz872UoI0I+6iFJjuaHvIgGD3ddVdTPU/ISw1ZQtiDlGY6IQfS++txwuOgSMhLD5oT9rTgB4QdBHxkM35X1c/aJ6806CMCP8ljgNAnPC4aci9hSwl9QOhBsJP/voxg75uADU8AQGNVEWgAAAAAAAAAAFC1/wswAP2TeBEFzAqTAAAAAElFTkSuQmCC'; var AdvCountUp = function (_Component) { _inherits(AdvCountUp, _Component); function AdvCountUp() { _classCallCheck(this, AdvCountUp); var _this = _possibleConstructorReturn(this, (AdvCountUp.__proto__ || Object.getPrototypeOf(AdvCountUp)).apply(this, arguments)); _this.state = { currentEdit: '' }; return _this; } _createClass(AdvCountUp, [{ key: 'componentWillMount', value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-count-up']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === 'undefined' ? 'undefined' : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: 'componentDidMount', value: function componentDidMount() { var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes, clientId = _props2.clientId; setAttributes({ id: 'count-up-' + clientId }); } }, { key: 'render', value: function render() { var _this2 = this; var currentEdit = this.state.currentEdit; var _props3 = this.props, attributes = _props3.attributes, setAttributes = _props3.setAttributes, isSelected = _props3.isSelected; var id = attributes.id, headerText = attributes.headerText, headerText2 = attributes.headerText2, headerText3 = attributes.headerText3, headerTextColor = attributes.headerTextColor, countUpNumber = attributes.countUpNumber, countUpNumber2 = attributes.countUpNumber2, countUpNumber3 = attributes.countUpNumber3, countUpNumberColor = attributes.countUpNumberColor, countUpNumberSize = attributes.countUpNumberSize, countUpSymbol = attributes.countUpSymbol, countUpSymbol2 = attributes.countUpSymbol2, countUpSymbol3 = attributes.countUpSymbol3, countUpSymbolAfter = attributes.countUpSymbolAfter, countUpSymbolAfter2 = attributes.countUpSymbolAfter2, countUpSymbolAfter3 = attributes.countUpSymbolAfter3, descText = attributes.descText, descText2 = attributes.descText2, descText3 = attributes.descText3, descTextColor = attributes.descTextColor, columns = attributes.columns, isPreview = attributes.isPreview; var countUpNameClass = ['advgb-count-up advgb-column-' + columns, id].filter(Boolean).join(' '); return isPreview ? React.createElement('img', { alt: __('Count Up', 'advanced-gutenberg'), width: '100%', src: previewImageData }) : React.createElement( Fragment, null, React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Count Up Settings', 'advanced-gutenberg') }, React.createElement(PanelColorSettings, { title: __('Color Settings', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Header Color', 'advanced-gutenberg'), value: headerTextColor, onChange: function onChange(value) { return setAttributes({ headerTextColor: value }); } }, { label: __('Count Up Color', 'advanced-gutenberg'), value: countUpNumberColor, onChange: function onChange(value) { return setAttributes({ countUpNumberColor: value }); } }, { label: __('Description Color', 'advanced-gutenberg'), value: descTextColor, onChange: function onChange(value) { return setAttributes({ descTextColor: value }); } }] }), React.createElement(RangeControl, { label: __('Columns', 'advanced-gutenberg'), min: 1, max: 3, value: columns, onChange: function onChange(value) { return setAttributes({ columns: value }); } }), React.createElement(RangeControl, { label: __('Counter Number Size', 'advanced-gutenberg'), min: 10, max: 100, value: countUpNumberSize, onChange: function onChange(value) { return setAttributes({ countUpNumberSize: value }); } }), React.createElement( 'div', null, __('Counter Up Symbol', 'advanced-gutenberg') ), React.createElement( 'div', { className: 'advgb-col-3' }, React.createElement(TextControl, { value: countUpSymbol, onChange: function onChange(value) { return setAttributes({ countUpSymbol: value }); } }), React.createElement(FormToggle, { checked: countUpSymbolAfter, onChange: function onChange() { return setAttributes({ countUpSymbolAfter: !countUpSymbolAfter }); }, title: !!countUpSymbolAfter ? __('After', 'advanced-gutenberg') : __('Before', 'advanced-gutenberg') }) ), parseInt(columns) > 1 && React.createElement( 'div', { className: 'advgb-col-3' }, React.createElement(TextControl, { value: countUpSymbol2, onChange: function onChange(value) { return setAttributes({ countUpSymbol2: value }); } }), React.createElement(FormToggle, { checked: countUpSymbolAfter2, onChange: function onChange() { return setAttributes({ countUpSymbolAfter2: !countUpSymbolAfter2 }); }, title: !!countUpSymbolAfter2 ? __('After', 'advanced-gutenberg') : __('Before', 'advanced-gutenberg') }) ), parseInt(columns) > 2 && React.createElement( 'div', { className: 'advgb-col-3' }, React.createElement(TextControl, { value: countUpSymbol3, onChange: function onChange(value) { return setAttributes({ countUpSymbol3: value }); } }), React.createElement(FormToggle, { checked: countUpSymbolAfter3, onChange: function onChange() { return setAttributes({ countUpSymbolAfter3: !countUpSymbolAfter3 }); }, title: !!countUpSymbolAfter3 ? __('After', 'advanced-gutenberg') : __('Before', 'advanced-gutenberg') }) ), React.createElement( 'p', { className: 'components-base-control__help', style: { clear: 'both' } }, __('Use toggle buttons above to define symbol placement before/after the number (toggle on is after).', 'advanced-gutenberg') ) ) ), React.createElement( 'div', { className: countUpNameClass, style: { display: 'flex' } }, React.createElement( 'div', { className: 'advgb-count-up-columns-one' }, React.createElement(RichText, { tagName: 'h4', value: headerText, onChange: function onChange(value) { return setAttributes({ headerText: value }); }, isSelected: isSelected && currentEdit === 'header', unstableOnFocus: function unstableOnFocus() { return _this2.setState({ currentEdit: 'header' }); }, style: { color: headerTextColor }, placeholder: __('Enter text…', 'advanced-gutenberg'), className: 'advgb-count-up-header' }), React.createElement( 'div', { className: 'advgb-counter' }, countUpSymbol && !countUpSymbolAfter && React.createElement( 'span', { className: 'advgb-counter-symbol', style: { fontSize: countUpNumberSize, color: countUpNumberColor } }, countUpSymbol ), React.createElement(RichText, { tagName: 'div', value: countUpNumber, onChange: function onChange(value) { return setAttributes({ countUpNumber: value }); }, isSelected: isSelected && currentEdit === 'countUp', unstableOnFocus: function unstableOnFocus() { return _this2.setState({ currentEdit: 'countUp' }); }, style: { fontSize: countUpNumberSize + 'px', color: countUpNumberColor }, className: 'advgb-counter-number' }), countUpSymbol && countUpSymbolAfter && React.createElement( 'span', { className: 'advgb-counter-symbol', style: { fontSize: countUpNumberSize, color: countUpNumberColor } }, countUpSymbol ) ), React.createElement(RichText, { tagName: 'p', value: descText, onChange: function onChange(value) { return setAttributes({ descText: value }); }, isSelected: isSelected && currentEdit === 'desc', unstableOnFocus: function unstableOnFocus() { return _this2.setState({ currentEdit: 'desc' }); }, style: { color: descTextColor }, placeholder: __('Enter text…', 'advanced-gutenberg'), className: 'advgb-count-up-desc' }) ), React.createElement( 'div', { className: 'advgb-count-up-columns-two' }, React.createElement(RichText, { tagName: 'h4', value: headerText2, onChange: function onChange(value) { return setAttributes({ headerText2: value }); }, isSelected: isSelected && currentEdit === 'header2', unstableOnFocus: function unstableOnFocus() { return _this2.setState({ currentEdit: 'header2' }); }, style: { color: headerTextColor }, placeholder: __('Enter text…', 'advanced-gutenberg'), className: 'advgb-count-up-header' }), React.createElement( 'div', { className: 'advgb-counter' }, countUpSymbol2 && !countUpSymbolAfter2 && React.createElement( 'span', { className: 'advgb-counter-symbol', style: { fontSize: countUpNumberSize, color: countUpNumberColor } }, countUpSymbol2 ), React.createElement(RichText, { tagName: 'div', value: countUpNumber2, onChange: function onChange(value) { return setAttributes({ countUpNumber2: value }); }, isSelected: isSelected && currentEdit === 'countUp2', unstableOnFocus: function unstableOnFocus() { return _this2.setState({ currentEdit: 'countUp2' }); }, style: { fontSize: countUpNumberSize + 'px', color: countUpNumberColor }, className: 'advgb-counter-number' }), countUpSymbol2 && countUpSymbolAfter2 && React.createElement( 'span', { className: 'advgb-counter-symbol', style: { fontSize: countUpNumberSize, color: countUpNumberColor } }, countUpSymbol2 ) ), React.createElement(RichText, { tagName: 'p', value: descText2, onChange: function onChange(value) { return setAttributes({ descText2: value }); }, isSelected: isSelected && currentEdit === 'desc2', unstableOnFocus: function unstableOnFocus() { return _this2.setState({ currentEdit: 'desc2' }); }, style: { color: descTextColor }, placeholder: __('Enter text…', 'advanced-gutenberg'), className: 'advgb-count-up-desc' }) ), React.createElement( 'div', { className: 'advgb-count-up-columns-three' }, React.createElement(RichText, { tagName: 'h4', value: headerText3, onChange: function onChange(value) { return setAttributes({ headerText3: value }); }, isSelected: isSelected && currentEdit === 'header3', unstableOnFocus: function unstableOnFocus() { return _this2.setState({ currentEdit: 'header3' }); }, style: { color: headerTextColor }, placeholder: __('Enter text…', 'advanced-gutenberg'), className: 'advgb-count-up-header' }), React.createElement( 'div', { className: 'advgb-counter' }, countUpSymbol3 && !countUpSymbolAfter3 && React.createElement( 'span', { className: 'advgb-counter-symbol', style: { fontSize: countUpNumberSize, color: countUpNumberColor } }, countUpSymbol3 ), React.createElement(RichText, { tagName: 'div', value: countUpNumber3, onChange: function onChange(value) { return setAttributes({ countUpNumber3: value }); }, isSelected: isSelected && currentEdit === 'countUp3', unstableOnFocus: function unstableOnFocus() { return _this2.setState({ currentEdit: 'countUp3' }); }, style: { fontSize: countUpNumberSize + 'px', color: countUpNumberColor }, className: 'advgb-counter-number' }), countUpSymbol3 && countUpSymbolAfter3 && React.createElement( 'span', { className: 'advgb-counter-symbol', style: { fontSize: countUpNumberSize, color: countUpNumberColor } }, countUpSymbol3 ) ), React.createElement(RichText, { tagName: 'p', value: descText3, onChange: function onChange(value) { return setAttributes({ descText3: value }); }, isSelected: isSelected && currentEdit === 'desc3', unstableOnFocus: function unstableOnFocus() { return _this2.setState({ currentEdit: 'desc3' }); }, style: { color: descTextColor }, placeholder: __('Enter text…', 'advanced-gutenberg'), className: 'advgb-count-up-desc' }) ) ) ); } }]); return AdvCountUp; }(Component); var countUpBlockIcon = React.createElement( 'svg', { height: '20', viewBox: '2 2 22 22', width: '20', xmlns: 'http://www.w3.org/2000/svg' }, React.createElement('path', { d: 'M0 0h24v24H0zm0 0h24v24H0z', fill: 'none' }), React.createElement('path', { d: 'M16.05 16.29l2.86-3.07c.38-.39.72-.79 1.04-1.18.32-.39.59-.78.82-1.17.23-.39.41-.78.54-1.17.13-.39.19-.79.19-1.18 0-.53-.09-1.02-.27-1.46-.18-.44-.44-.81-.78-1.11-.34-.31-.77-.54-1.26-.71-.51-.16-1.08-.24-1.72-.24-.69 0-1.31.11-1.85.32-.54.21-1 .51-1.36.88-.37.37-.65.8-.84 1.3-.18.47-.27.97-.28 1.5h2.14c.01-.31.05-.6.13-.87.09-.29.23-.54.4-.75.18-.21.41-.37.68-.49.27-.12.6-.18.96-.18.31 0 .58.05.81.15.23.1.43.25.59.43.16.18.28.4.37.65.08.25.13.52.13.81 0 .22-.03.43-.08.65-.06.22-.15.45-.29.7-.14.25-.32.53-.56.83-.23.3-.52.65-.88 1.03l-4.17 4.55V18H22v-1.71h-5.95zM8 7H6v4H2v2h4v4h2v-4h4v-2H8V7z' }) ); var blockAttrs = { id: { type: 'string' }, headerText: { type: 'string', default: 'Header text' }, headerText2: { type: 'string', default: 'Header text' }, headerText3: { type: 'string', default: 'Header text' }, headerTextColor: { type: 'string' }, countUpNumber: { type: 'string', default: '56789' }, countUpNumber2: { type: 'string', default: '56789' }, countUpNumber3: { type: 'string', default: '56789' }, countUpNumberColor: { type: 'string' }, countUpNumberSize: { type: 'number', default: 55 }, countUpSymbol: { type: 'string' }, countUpSymbol2: { type: 'string' }, countUpSymbol3: { type: 'string' }, countUpSymbolAfter: { type: 'boolean', default: false }, countUpSymbolAfter2: { type: 'boolean', default: false }, countUpSymbolAfter3: { type: 'boolean', default: false }, descText: { type: 'string', default: 'and description' }, descText2: { type: 'string', default: 'and description' }, descText3: { type: 'string', default: 'and description' }, descTextColor: { type: 'string' }, columns: { type: 'number', default: 1 }, changed: { type: 'boolean', default: false }, isPreview: { type: 'boolean', default: false } }; registerBlockType('advgb/count-up', { title: __('Count Up - PublishPress', 'advanced-gutenberg'), description: __('Create an animated display for important numbers.', 'advanced-gutenberg'), icon: { src: countUpBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('numbers', 'advanced-gutenberg'), __('count', 'advanced-gutenberg'), __('increase', 'advanced-gutenberg')], attributes: blockAttrs, example: { attributes: { isPreview: true } }, supports: { anchor: true }, edit: AdvCountUp, save: function save(_ref) { var attributes = _ref.attributes; var id = attributes.id, headerText = attributes.headerText, headerText2 = attributes.headerText2, headerText3 = attributes.headerText3, headerTextColor = attributes.headerTextColor, countUpNumber = attributes.countUpNumber, countUpNumber2 = attributes.countUpNumber2, countUpNumber3 = attributes.countUpNumber3, countUpNumberColor = attributes.countUpNumberColor, countUpNumberSize = attributes.countUpNumberSize, countUpSymbol = attributes.countUpSymbol, countUpSymbol2 = attributes.countUpSymbol2, countUpSymbol3 = attributes.countUpSymbol3, countUpSymbolAfter = attributes.countUpSymbolAfter, countUpSymbolAfter2 = attributes.countUpSymbolAfter2, countUpSymbolAfter3 = attributes.countUpSymbolAfter3, descText = attributes.descText, descText2 = attributes.descText2, descText3 = attributes.descText3, descTextColor = attributes.descTextColor, columns = attributes.columns; var countSymbolElm = countUpSymbol ? React.createElement( 'span', { className: 'advgb-counter-symbol' }, countUpSymbol ) : ''; var countSymbolElm2 = countUpSymbol2 ? React.createElement( 'span', { className: 'advgb-counter-symbol' }, countUpSymbol2 ) : ''; var countSymbolElm3 = countUpSymbol3 ? React.createElement( 'span', { className: 'advgb-counter-symbol' }, countUpSymbol3 ) : ''; var countUpNameClass = ['advgb-count-up', id].filter(Boolean).join(' '); return React.createElement( 'div', { className: countUpNameClass, style: { display: 'flex' } }, React.createElement( 'div', { className: 'advgb-count-up-columns-one' }, React.createElement(RichText.Content, { tagName: 'h4', value: headerText, style: { color: headerTextColor }, className: 'advgb-count-up-header' }), React.createElement( 'div', { className: 'advgb-counter', style: { color: countUpNumberColor, fontSize: countUpNumberSize + 'px' } }, !countUpSymbolAfter && countSymbolElm, React.createElement(RichText.Content, { tagName: 'span', value: countUpNumber, className: 'advgb-counter-number' }), !!countUpSymbolAfter && countSymbolElm ), React.createElement(RichText.Content, { tagName: 'p', value: descText, style: { color: descTextColor }, className: 'advgb-count-up-desc' }) ), parseInt(columns) > 1 && React.createElement( 'div', { className: 'advgb-count-up-columns-two' }, React.createElement(RichText.Content, { tagName: 'h4', value: headerText2, style: { color: headerTextColor }, className: 'advgb-count-up-header' }), React.createElement( 'div', { className: 'advgb-counter', style: { color: countUpNumberColor, fontSize: countUpNumberSize + 'px' } }, !countUpSymbolAfter2 && countSymbolElm2, React.createElement(RichText.Content, { tagName: 'span', value: countUpNumber2, className: 'advgb-counter-number' }), !!countUpSymbolAfter2 && countSymbolElm2 ), React.createElement(RichText.Content, { tagName: 'p', value: descText2, style: { color: descTextColor }, className: 'advgb-count-up-desc' }) ), parseInt(columns) > 2 && React.createElement( 'div', { className: 'advgb-count-up-columns-three' }, React.createElement(RichText.Content, { tagName: 'h4', value: headerText3, style: { color: headerTextColor }, className: 'advgb-count-up-header' }), React.createElement( 'div', { className: 'advgb-counter', style: { color: countUpNumberColor, fontSize: countUpNumberSize + 'px' } }, !countUpSymbolAfter3 && countSymbolElm3, React.createElement(RichText.Content, { tagName: 'span', value: countUpNumber3, className: 'advgb-counter-number' }), !!countUpSymbolAfter3 && countSymbolElm3 ), React.createElement(RichText.Content, { tagName: 'p', value: descText3, style: { color: descTextColor }, className: 'advgb-count-up-desc' }) ) ); }, deprecated: [{ attributes: blockAttrs, save: function save(_ref2) { var attributes = _ref2.attributes; var headerText = attributes.headerText, headerText2 = attributes.headerText2, headerText3 = attributes.headerText3, headerTextColor = attributes.headerTextColor, countUpNumber = attributes.countUpNumber, countUpNumber2 = attributes.countUpNumber2, countUpNumber3 = attributes.countUpNumber3, countUpNumberColor = attributes.countUpNumberColor, countUpNumberSize = attributes.countUpNumberSize, countUpSymbol = attributes.countUpSymbol, countUpSymbol2 = attributes.countUpSymbol2, countUpSymbol3 = attributes.countUpSymbol3, countUpSymbolAfter = attributes.countUpSymbolAfter, countUpSymbolAfter2 = attributes.countUpSymbolAfter2, countUpSymbolAfter3 = attributes.countUpSymbolAfter3, descText = attributes.descText, descText2 = attributes.descText2, descText3 = attributes.descText3, descTextColor = attributes.descTextColor, columns = attributes.columns; var countSymbolElm = countUpSymbol ? React.createElement( 'span', { className: 'advgb-counter-symbol' }, countUpSymbol ) : ''; var countSymbolElm2 = countUpSymbol2 ? React.createElement( 'span', { className: 'advgb-counter-symbol' }, countUpSymbol2 ) : ''; var countSymbolElm3 = countUpSymbol3 ? React.createElement( 'span', { className: 'advgb-counter-symbol' }, countUpSymbol3 ) : ''; return React.createElement( 'div', { className: 'advgb-count-up', style: { display: 'flex' } }, React.createElement( 'div', { className: 'advgb-count-up-columns-one', style: { textAlign: 'center' } }, React.createElement(RichText.Content, { tagName: 'h4', value: headerText, style: { color: headerTextColor }, className: 'advgb-count-up-header' }), React.createElement( 'div', { className: 'advgb-counter', style: { color: countUpNumberColor, fontSize: countUpNumberSize + 'px' } }, !countUpSymbolAfter && countSymbolElm, React.createElement( 'span', { className: 'advgb-counter-number' }, countUpNumber ), !!countUpSymbolAfter && countSymbolElm ), React.createElement(RichText.Content, { tagName: 'p', value: descText, style: { color: descTextColor }, className: 'advgb-count-up-desc' }) ), parseInt(columns) > 1 && React.createElement( 'div', { className: 'advgb-count-up-columns-two', style: { textAlign: 'center' } }, React.createElement(RichText.Content, { tagName: 'h4', value: headerText2, style: { color: headerTextColor }, className: 'advgb-count-up-header' }), React.createElement( 'div', { className: 'advgb-counter', style: { color: countUpNumberColor, fontSize: countUpNumberSize + 'px' } }, !countUpSymbolAfter2 && countSymbolElm2, React.createElement( 'span', { className: 'advgb-counter-number' }, countUpNumber2 ), !!countUpSymbolAfter2 && countSymbolElm2 ), React.createElement(RichText.Content, { tagName: 'p', value: descText2, style: { color: descTextColor }, className: 'advgb-count-up-desc' }) ), parseInt(columns) > 2 && React.createElement( 'div', { className: 'advgb-count-up-columns-three', style: { textAlign: 'center' } }, React.createElement(RichText.Content, { tagName: 'h4', value: headerText3, style: { color: headerTextColor }, className: 'advgb-count-up-header' }), React.createElement( 'div', { className: 'advgb-counter', style: { color: countUpNumberColor, fontSize: countUpNumberSize + 'px' } }, !countUpSymbolAfter3 && countSymbolElm3, React.createElement( 'span', { className: 'advgb-counter-number' }, countUpNumber3 ), !!countUpSymbolAfter3 && countSymbolElm3 ), React.createElement(RichText.Content, { tagName: 'p', value: descText3, style: { color: descTextColor }, className: 'advgb-count-up-desc' }) ) ); } }] }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/images-slider/block.jsx": /*!***************************************************!*\ !*** ./src/assets/blocks/images-slider/block.jsx ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, PanelColorSettings = _wpBlockEditor.PanelColorSettings, MediaUpload = _wpBlockEditor.MediaUpload, RichText = _wpBlockEditor.RichText; var PanelBody = wpComponents.PanelBody, RangeControl = wpComponents.RangeControl, ToggleControl = wpComponents.ToggleControl, SelectControl = wpComponents.SelectControl, TextControl = wpComponents.TextControl, TextareaControl = wpComponents.TextareaControl, Button = wpComponents.Button, Placeholder = wpComponents.Placeholder, Tooltip = wpComponents.Tooltip; var $ = jQuery; var imageSliderBlockIcon = React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "2 2 22 22", className: "dashicon" }, React.createElement("path", { fill: "none", d: "M0 0h24v24H0V0z" }), React.createElement("path", { d: "M20 4h-3.17L15 2H9L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM9.88 4h4.24l1.83 2H20v12H4V6h4.05" }), React.createElement("path", { d: "M15 11H9V8.5L5.5 12 9 15.5V13h6v2.5l3.5-3.5L15 8.5z" }) ); var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD0CAYAAACy5jtNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADRRJREFUeNrsnU2P1MgZgG1393wyw4dACtIcIiEkNLMrsofVSkScWJQTo0j5D2T3mHMuicQxpxwCEdec5oCSAxLiQHLggpCCcoATgxaU5AARYQbmu9tOv73tTY273N22y91V9vNI1sz0uHs8th+/71tVLnseAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwITxp/FHm80mex5qTbvdro7ofaH9aW4DgEVEo35f1gXAn4DYPnIDjCV+VJb4fomS+5q/4SM7QKrgkeb3RmT3DUmeFNhPfO8PkR+gzrKrXyPNz0aEbxqUXCe3bhk3vQeociTXCR5pBI/X8ceo8cuJ6EMkDxJf1deJ7IDsx7+GiuDhCPlzRfZmAcl1tXigSr6+vj57+/btny8vL3/daDR+1H1tJl43iiIOOdQS3/e97vm/d3R09N3r16//fPny5ceK5OJPR/l5WG1fbkRPN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/+Gw4dwPg8ePDglzdu3PibONxdjhKLvCbPyQrjJYvojcwpQBDEoqtLoC7Pnz//x/r6+mezs7M/5vABjObVq1d3rly5stGXOBa6rfwcR/bQ+3972ERr9Ei9ysjy8OHDT9euXft2c3Pzd51O578cRoDUdP1f9+/f//bq1at/SHqUEDsqUqcXSd3VSJ5M3+Pvm2fPnp25c+fOVxcvXlxrtVqLyhM5eb4P1JVod3d3qxsQn9y6dWtzb2+v04/abeVrW0nZ49c7qvhl1+heiuiq7OoS/y5Q3oPoUGvRU7JhnegdTQof9kUf39usWygfrjy3S60bfGVjfEXkeJ34ohAqv0N2qLPk8dJR3OkkonfoDbbCZ6ZZcIP9hOyx5J3EeqrofkJwZIe6SZ4MkmFC9IEWdo3wExNdd3UKE5J7/bQ9SkgeIDog+rEGtzAlmmsb47Kk7UVEV6O5utGe5h/p9GX3Fdk9ojrUPG3Xyd7RRHid6Jmjem7BEo1yqX3qidf8ROqO4ECNPhjZ06J51I/mkxO9L3tS2GR6rvseyQHZB2VPCh/pJPcytrabrNF95WuoyBwpkkeK3IgOiD6e8APr5ZHcmGxKZNfJrJMbyQHZ02X3PM3tqXklNxHRkxutdrepUT1NcISHugo+SnjPlOTGRVMa6Eb9DQQHGGO2pqKClyqcMnJunL+B9FBXsVN/b0rwqUqWqOkBakeeLjIAAAAAAAAAAAAAAAAAAAAww/8EGAALGTR3RtBeSQAAAABJRU5ErkJggg=='; var AdvImageSlider = function (_Component) { _inherits(AdvImageSlider, _Component); function AdvImageSlider() { _classCallCheck(this, AdvImageSlider); var _this = _possibleConstructorReturn(this, (AdvImageSlider.__proto__ || Object.getPrototypeOf(AdvImageSlider)).apply(this, arguments)); _this.state = { currentSelected: 0, imageLoaded: false }; _this.initSlider = _this.initSlider.bind(_this); return _this; } _createClass(AdvImageSlider, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-images-slider']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === "undefined" ? "undefined" : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: "componentDidMount", value: function componentDidMount() { var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes, clientId = _props2.clientId; setAttributes({ id: 'advg-images-slider-' + clientId }); if (attributes.images.length) { this.initSlider(); } // Reset attributes when Pro is not available if (advgbBlocks.advgb_pro !== 'undefined' && advgbBlocks.advgb_pro !== '1') { setAttributes({ titleTag: 'h4', titleShow: true, textTag: 'p' }); } } }, { key: "componentWillUpdate", value: function componentWillUpdate(nextProps) { var _props3 = this.props, clientId = _props3.clientId, attributes = _props3.attributes; var images = attributes.images; var nextImages = nextProps.attributes.images; if (images.length !== nextImages.length) { $("#block-" + clientId + " .advgb-images-slider.slick-initialized").slick('unslick'); $("#block-" + clientId + " .advgb-image-slider-item").removeAttr('tabindex').removeAttr('role').removeAttr('aria-describedby'); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _props4 = this.props, attributes = _props4.attributes, clientId = _props4.clientId; var images = attributes.images, autoplay = attributes.autoplay, autoplaySpeed = attributes.autoplaySpeed; var prevImages = prevProps.attributes.images; if (images.length !== prevImages.length) { if (images.length) { this.initSlider(); } } // Autoplay if (autoplay && advgbBlocks.advgb_pro !== 'undefined' && advgbBlocks.advgb_pro === '1') { $("#block-" + clientId + " .advgb-images-slider.slick-initialized").slick('slickSetOption', 'autoplay', true, true); } else { $("#block-" + clientId + " .advgb-images-slider.slick-initialized").slick('slickSetOption', 'autoplay', false, true); } // Autoplay speed if (autoplay && autoplaySpeed && advgbBlocks.advgb_pro !== 'undefined' && advgbBlocks.advgb_pro === '1') { $("#block-" + clientId + " .advgb-images-slider.slick-initialized").slick('slickSetOption', 'autoplaySpeed', autoplaySpeed, true); } else { $("#block-" + clientId + " .advgb-images-slider.slick-initialized").slick('slickSetOption', 'autoplaySpeed', 3000, true); } if (this.state.imageLoaded) { $("#block-" + clientId + " .advgb-image-slider-image-list ").find('.advgb-image-slider-image-list-item:first-child').find('.advgb-image-slider-image-list-img').trigger('click'); this.setState({ imageLoaded: null }); } } }, { key: "initSlider", value: function initSlider() { var _this2 = this; var clientId = this.props.clientId; $("#block-" + clientId + " .advgb-images-slider:not(.slick-initialized)").slick({ dots: true, adaptiveHeight: true }); $("#block-" + clientId + " .advgb-images-slider").on('afterChange', function (e, s, currentSlide) { if (_this2.state.currentSelected !== currentSlide) { _this2.setState({ currentSelected: currentSlide }); } }); } }, { key: "moveImage", value: function moveImage(currentIndex, newIndex) { var _props5 = this.props, setAttributes = _props5.setAttributes, attributes = _props5.attributes; var images = attributes.images; var image = images[currentIndex]; setAttributes({ images: [].concat(_toConsumableArray(images.filter(function (img, idx) { return idx !== currentIndex; }).slice(0, newIndex)), [image], _toConsumableArray(images.filter(function (img, idx) { return idx !== currentIndex; }).slice(newIndex))) }); } }, { key: "updateImagesData", value: function updateImagesData(data) { var currentSelected = this.state.currentSelected; if (typeof currentSelected !== 'number') { return null; } var _props6 = this.props, attributes = _props6.attributes, setAttributes = _props6.setAttributes; var images = attributes.images; var newImages = images.map(function (image, index) { if (index === currentSelected) { image = _extends({}, image, data); } return image; }); setAttributes({ images: newImages }); } }, { key: "render", value: function render() { var _this3 = this; var _props7 = this.props, attributes = _props7.attributes, setAttributes = _props7.setAttributes, isSelected = _props7.isSelected, clientId = _props7.clientId; var _state = this.state, currentSelected = _state.currentSelected, imageLoaded = _state.imageLoaded; var images = attributes.images, actionOnClick = attributes.actionOnClick, fullWidth = attributes.fullWidth, autoHeight = attributes.autoHeight, width = attributes.width, height = attributes.height, alwaysShowOverlay = attributes.alwaysShowOverlay, rtl = attributes.rtl, hoverColor = attributes.hoverColor, titleColor = attributes.titleColor, textColor = attributes.textColor, hAlign = attributes.hAlign, vAlign = attributes.vAlign, isPreview = attributes.isPreview, autoplay = attributes.autoplay, autoplaySpeed = attributes.autoplaySpeed, id = attributes.id, titleTag = attributes.titleTag, titleShow = attributes.titleShow, textTag = attributes.textTag; if (images.length === 0) { return isPreview ? React.createElement("img", { alt: __('Images Slider', 'advanced-gutenberg'), width: "100%", src: previewImageData }) : React.createElement( Placeholder, { icon: imageSliderBlockIcon, label: __('Image Slider Block', 'advanced-gutenberg'), instructions: __('No images selected. Adding images to start using this block.', 'advanced-gutenberg') }, React.createElement(MediaUpload, { allowedTypes: ['image'], value: null, multiple: true, onSelect: function onSelect(image) { var imgInsert = image.map(function (img) { return { url: img.url, id: img.id, title: img.title || img.alt, text: img.caption || img.description }; }); setAttributes({ images: [].concat(_toConsumableArray(images), _toConsumableArray(imgInsert)) }); }, render: function render(_ref) { var open = _ref.open; return React.createElement( Button, { className: "button button-large button-primary", onClick: open }, __('Add images', 'advanced-gutenberg') ); } }) ); } var blockClass = ['advgb-images-slider-block', imageLoaded === false && 'advgb-ajax-loading', id].filter(Boolean).join(' '); return isPreview ? React.createElement("img", { alt: __('Images Slider', 'advanced-gutenberg'), width: "100%", src: previewImageData }) : React.createElement( Fragment, null, React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Image Settings', 'advanced-gutenberg') }, React.createElement(SelectControl, { label: __('Action on click', 'advanced-gutenberg'), value: actionOnClick, options: [{ label: __('None', 'advanced-gutenberg'), value: '' }, { label: __('Open image in lightbox', 'advanced-gutenberg'), value: 'lightbox' }, { label: __('Open custom link', 'advanced-gutenberg'), value: 'link' }], onChange: function onChange(value) { return setAttributes({ actionOnClick: value }); } }), React.createElement(ToggleControl, { label: __('Full width', 'advanced-gutenberg'), checked: fullWidth, onChange: function onChange() { return setAttributes({ fullWidth: !fullWidth }); } }), React.createElement(ToggleControl, { label: __('Auto height', 'advanced-gutenberg'), checked: autoHeight, onChange: function onChange() { return setAttributes({ autoHeight: !autoHeight }); } }), !fullWidth && React.createElement(RangeControl, { label: __('Width', 'advanced-gutenberg'), value: width, onChange: function onChange(value) { return setAttributes({ width: value }); }, min: 200, max: 1300 }), !autoHeight && React.createElement(RangeControl, { label: __('Height', 'advanced-gutenberg'), value: height, onChange: function onChange(value) { return setAttributes({ height: value }); }, min: 100, max: 1000 }), React.createElement(ToggleControl, { label: __('Always show overlay', 'advanced-gutenberg'), checked: alwaysShowOverlay, onChange: function onChange() { return setAttributes({ alwaysShowOverlay: !alwaysShowOverlay }); } }), React.createElement(ToggleControl, { label: __('Enable RTL', 'advanced-gutenberg'), checked: rtl, onChange: function onChange() { return setAttributes({ rtl: !rtl }); } }) ), React.createElement(PanelColorSettings, { title: __('Color Settings', 'advanced-gutenberg'), colorSettings: [{ label: __('Hover Color', 'advanced-gutenberg'), value: hoverColor, onChange: function onChange(value) { return setAttributes({ hoverColor: value }); } }, { label: __('Title Color', 'advanced-gutenberg'), value: titleColor, onChange: function onChange(value) { return setAttributes({ titleColor: value }); } }, { label: __('Text Color', 'advanced-gutenberg'), value: textColor, onChange: function onChange(value) { return setAttributes({ textColor: value }); } }] }), React.createElement( PanelBody, { title: __('Text Alignment', 'advanced-gutenberg'), initialOpen: false }, React.createElement(SelectControl, { label: __('Vertical Alignment', 'advanced-gutenberg'), value: vAlign, options: [{ label: __('Top', 'advanced-gutenberg'), value: 'flex-start' }, { label: __('Center', 'advanced-gutenberg'), value: 'center' }, { label: __('Bottom', 'advanced-gutenberg'), value: 'flex-end' }], onChange: function onChange(value) { return setAttributes({ vAlign: value }); } }), React.createElement(SelectControl, { label: __('Horizontal Alignment', 'advanced-gutenberg'), value: hAlign, options: [{ label: __('Left', 'advanced-gutenberg'), value: 'flex-start' }, { label: __('Center', 'advanced-gutenberg'), value: 'center' }, { label: __('Right', 'advanced-gutenberg'), value: 'flex-end' }], onChange: function onChange(value) { return setAttributes({ hAlign: value }); } }) ) ), React.createElement( "div", { className: blockClass }, React.createElement( "div", { className: "advgb-images-slider", dir: rtl ? 'rtl' : 'ltr' }, images.map(function (image, index) { return React.createElement( "div", { className: "advgb-image-slider-item", key: index }, React.createElement("img", { src: image.url, className: "advgb-image-slider-img", alt: image.title, style: { width: fullWidth ? '100%' : width, height: autoHeight ? 'auto' : height }, onLoad: function onLoad() { if (index === 0) { if (_this3.state.imageLoaded === false) { _this3.setState({ imageLoaded: true }); } } }, onError: function onError() { if (index === 0) { if (_this3.state.imageLoaded === false) { _this3.setState({ imageLoaded: true }); } } } }), React.createElement( "div", { className: "advgb-image-slider-item-info", style: { justifyContent: vAlign, alignItems: hAlign } }, (actionOnClick !== '' || alwaysShowOverlay) && React.createElement("span", { className: "advgb-image-slider-overlay", style: { backgroundColor: hoverColor, opacity: alwaysShowOverlay ? 0.5 : undefined } }), image.title && titleShow && React.createElement(RichText, { tagName: titleTag, className: "advgb-image-slider-title", style: { color: titleColor }, value: image.title, onChange: function onChange(value) { return _this3.updateImagesData({ title: value || '' }); }, allowedFormats: [] }), image.text && React.createElement(RichText, { tagName: textTag, className: "advgb-image-slider-text", style: { color: textColor }, value: image.text, onChange: function onChange(value) { return _this3.updateImagesData({ text: value || '' }); }, allowedFormats: [] }) ) ); }) ), isSelected && React.createElement( "div", { className: "advgb-image-slider-controls" }, React.createElement( "div", { className: "advgb-image-slider-control" }, React.createElement(TextControl, { label: __('Title', 'advanced-gutenberg'), value: images[currentSelected] ? images[currentSelected].title || '' : '', onChange: function onChange(value) { return _this3.updateImagesData({ title: value || '' }); } }) ), React.createElement( "div", { className: "advgb-image-slider-control" }, React.createElement(TextareaControl, { label: __('Text', 'advanced-gutenberg'), value: images[currentSelected] ? images[currentSelected].text || '' : '', onChange: function onChange(value) { return _this3.updateImagesData({ text: value || '' }); } }) ), actionOnClick === 'link' && React.createElement( "div", { className: "advgb-image-slider-control" }, React.createElement(TextControl, { label: __('Link', 'advanced-gutenberg'), value: images[currentSelected] ? images[currentSelected].link || '' : '', onChange: function onChange(value) { return _this3.updateImagesData({ link: value || '' }); } }) ), React.createElement( "div", { className: "advgb-image-slider-image-list" }, images.map(function (image, index) { return React.createElement( "div", { className: "advgb-image-slider-image-list-item", key: index }, index > 0 && React.createElement( Tooltip, { text: __('Move Left', 'advanced-gutenberg') }, React.createElement( "span", { className: "advgb-move-arrow advgb-move-left", onClick: function onClick() { return _this3.moveImage(index, index - 1); } }, React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, React.createElement("path", { fill: "none", d: "M0 0h24v24H0V0z" }), React.createElement("path", { d: "M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z" }) ) ) ), React.createElement("img", { src: image.url, className: "advgb-image-slider-image-list-img", alt: __('Image', 'advanced-gutenberg'), onClick: function onClick() { $("#block-" + clientId + " .advgb-images-slider").slick('slickGoTo', index, false); _this3.setState({ currentSelected: index }); } }), index + 1 < images.length && React.createElement( Tooltip, { text: __('Move Right', 'advanced-gutenberg') }, React.createElement( "span", { className: "advgb-move-arrow advgb-move-right", onClick: function onClick() { return _this3.moveImage(index, index + 1); } }, React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, React.createElement("path", { fill: "none", d: "M0 0h24v24H0V0z" }), React.createElement("path", { d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" }) ) ) ), React.createElement( Tooltip, { text: __('Remove image', 'advanced-gutenberg') }, React.createElement(Button, { className: "advgb-image-slider-image-list-item-remove", icon: "no", onClick: function onClick() { if (index === currentSelected) _this3.setState({ currentSelected: null }); setAttributes({ images: images.filter(function (img, idx) { return idx !== index; }) }); } }) ) ); }), React.createElement( "div", { className: "advgb-image-slider-add-item" }, React.createElement(MediaUpload, { allowedTypes: ['image'], value: currentSelected, multiple: true, onSelect: function onSelect(imgs) { setAttributes({ images: [].concat(_toConsumableArray(images), _toConsumableArray(imgs.map(function (img) { return { url: img.url, id: img.id, title: img.title || img.alt, text: img.caption || img.description }; }))) }); }, render: function render(_ref2) { var open = _ref2.open; return React.createElement(Button, { label: __('Add image', 'advanced-gutenberg'), icon: "plus", onClick: open }); } }) ) ) ) ) ); } }]); return AdvImageSlider; }(Component); var blockAttrs = { images: { type: 'array', default: [] // [ { id: int, url, title, text, link: string } ] }, actionOnClick: { type: 'string', default: '' }, fullWidth: { type: 'boolean', default: true }, autoHeight: { type: 'boolean', default: true }, width: { type: 'number', default: 700 }, height: { type: 'number', default: 500 }, alwaysShowOverlay: { type: 'boolean', default: false }, rtl: { type: 'boolean', default: false }, hoverColor: { type: 'string' }, titleColor: { type: 'string' }, textColor: { type: 'string' }, vAlign: { type: 'string', default: 'center' }, hAlign: { type: 'string', default: 'center' }, autoplay: { type: 'boolean', default: false }, autoplaySpeed: { type: 'number', default: 3000 }, changed: { type: 'boolean', default: false }, id: { type: 'string' }, isPreview: { type: 'boolean', default: false }, titleTag: { type: 'string', default: 'h4' }, titleShow: { type: 'boolean', default: true }, textTag: { type: 'string', default: 'p' } }; registerBlockType('advgb/images-slider', { title: __('Images Slider - PublishPress', 'advanced-gutenberg'), description: __('Display your images in a slider.', 'advanced-gutenberg'), icon: { src: imageSliderBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('slide', 'advanced-gutenberg'), __('gallery', 'advanced-gutenberg'), __('photos', 'advanced-gutenberg')], attributes: blockAttrs, example: { attributes: { isPreview: true } }, supports: { anchor: true }, edit: AdvImageSlider, save: function save(_ref3) { var attributes = _ref3.attributes; var images = attributes.images, actionOnClick = attributes.actionOnClick, fullWidth = attributes.fullWidth, autoHeight = attributes.autoHeight, width = attributes.width, height = attributes.height, alwaysShowOverlay = attributes.alwaysShowOverlay, rtl = attributes.rtl, hoverColor = attributes.hoverColor, titleColor = attributes.titleColor, textColor = attributes.textColor, hAlign = attributes.hAlign, vAlign = attributes.vAlign, id = attributes.id, titleTag = attributes.titleTag, titleShow = attributes.titleShow, textTag = attributes.textTag; var blockClassName = ['advgb-images-slider-block', actionOnClick === 'lightbox' && 'advgb-images-slider-lightbox', id].filter(Boolean).join(' '); return React.createElement( "div", { className: blockClassName }, React.createElement( "div", { className: "advgb-images-slider", dir: rtl ? 'rtl' : 'ltr' }, images.map(function (image, index) { return React.createElement( "div", { className: "advgb-image-slider-item", key: index }, React.createElement("img", { src: image.url, className: "advgb-image-slider-img", alt: image.title, style: { width: fullWidth ? '100%' : width, height: autoHeight ? 'auto' : height } }), React.createElement( "div", { className: "advgb-image-slider-item-info", style: { justifyContent: vAlign, alignItems: hAlign } }, (actionOnClick !== '' || alwaysShowOverlay) && React.createElement("a", { className: "advgb-image-slider-overlay", target: actionOnClick !== '' ? '_blank' : false, rel: "noopener noreferrer", href: actionOnClick === 'link' && !!image.link ? image.link : '#', style: { backgroundColor: hoverColor, opacity: alwaysShowOverlay ? 0.5 : undefined } }), image.title && titleShow && React.createElement(RichText.Content, { tagName: titleTag, className: "advgb-image-slider-title", style: { color: titleColor }, value: image.title }), image.text && React.createElement(RichText.Content, { tagName: textTag, className: "advgb-image-slider-text", style: { color: textColor }, value: image.text }) ) ); }) ) ); }, deprecated: [{ attributes: blockAttrs, supports: { anchor: true }, save: function save(_ref4) { var attributes = _ref4.attributes; var images = attributes.images, actionOnClick = attributes.actionOnClick, fullWidth = attributes.fullWidth, autoHeight = attributes.autoHeight, width = attributes.width, height = attributes.height, alwaysShowOverlay = attributes.alwaysShowOverlay, rtl = attributes.rtl, hoverColor = attributes.hoverColor, titleColor = attributes.titleColor, textColor = attributes.textColor, hAlign = attributes.hAlign, vAlign = attributes.vAlign; var blockClassName = ['advgb-images-slider-block', actionOnClick === 'lightbox' && 'advgb-images-slider-lightbox'].filter(Boolean).join(' '); return React.createElement( "div", { className: blockClassName }, React.createElement( "div", { className: "advgb-images-slider", "data-slick": "{\"rtl\": " + rtl + "}" }, images.map(function (image, index) { return React.createElement( "div", { className: "advgb-image-slider-item", key: index }, React.createElement("img", { src: image.url, className: "advgb-image-slider-img", alt: image.title, style: { width: fullWidth ? '100%' : width, height: autoHeight ? 'auto' : height } }), React.createElement( "div", { className: "advgb-image-slider-item-info", style: { justifyContent: vAlign, alignItems: hAlign } }, (actionOnClick !== '' || alwaysShowOverlay) && React.createElement("a", { className: "advgb-image-slider-overlay", target: actionOnClick !== '' ? '_blank' : false, rel: "noopener noreferrer", href: actionOnClick === 'link' && !!image.link ? image.link : '#', style: { backgroundColor: hoverColor, opacity: alwaysShowOverlay ? 0.5 : undefined } }), image.title && React.createElement( "h4", { className: "advgb-image-slider-title", style: { color: titleColor } }, image.title ), image.text && React.createElement( "p", { className: "advgb-image-slider-text", style: { color: textColor } }, image.text ) ) ); }) ) ); } }, { attributes: blockAttrs, save: function save(_ref5) { var attributes = _ref5.attributes; var images = attributes.images, actionOnClick = attributes.actionOnClick, fullWidth = attributes.fullWidth, autoHeight = attributes.autoHeight, width = attributes.width, height = attributes.height, alwaysShowOverlay = attributes.alwaysShowOverlay, rtl = attributes.rtl, hoverColor = attributes.hoverColor, titleColor = attributes.titleColor, textColor = attributes.textColor, hAlign = attributes.hAlign, vAlign = attributes.vAlign; var blockClassName = ['advgb-images-slider-block', actionOnClick === 'lightbox' && 'advgb-images-slider-lightbox'].filter(Boolean).join(' '); return React.createElement( "div", { className: blockClassName }, React.createElement( "div", { className: "advgb-images-slider", "data-slick": "{\"rtl\": " + rtl + "}" }, images.map(function (image, index) { return React.createElement( "div", { className: "advgb-image-slider-item", key: index }, React.createElement("img", { src: image.url, className: "advgb-image-slider-img", alt: 'Slider image', style: { width: fullWidth ? '100%' : width, height: autoHeight ? 'auto' : height } }), React.createElement( "div", { className: "advgb-image-slider-item-info", style: { justifyContent: vAlign, alignItems: hAlign } }, React.createElement("a", { className: "advgb-image-slider-overlay", target: "_blank", rel: "noopener noreferrer", href: actionOnClick === 'link' && !!image.link ? image.link : '#', style: { backgroundColor: hoverColor, opacity: alwaysShowOverlay ? 0.5 : undefined } }), image.title && React.createElement( "h4", { className: "advgb-image-slider-title", style: { color: titleColor } }, image.title ), image.text && React.createElement( "p", { className: "advgb-image-slider-text", style: { color: textColor } }, image.text ) ) ); }) ) ); } }, { attributes: blockAttrs, save: function save(_ref6) { var attributes = _ref6.attributes; var images = attributes.images, actionOnClick = attributes.actionOnClick, fullWidth = attributes.fullWidth, autoHeight = attributes.autoHeight, width = attributes.width, height = attributes.height, alwaysShowOverlay = attributes.alwaysShowOverlay, hoverColor = attributes.hoverColor, titleColor = attributes.titleColor, textColor = attributes.textColor, hAlign = attributes.hAlign, vAlign = attributes.vAlign; var blockClassName = ['advgb-images-slider-block', actionOnClick === 'lightbox' && 'advgb-images-slider-lightbox'].filter(Boolean).join(' '); return React.createElement( "div", { className: blockClassName }, React.createElement( "div", { className: "advgb-images-slider" }, images.map(function (image, index) { return React.createElement( "div", { className: "advgb-image-slider-item", key: index }, React.createElement("img", { src: image.url, className: "advgb-image-slider-img", alt: 'Slider image', style: { width: fullWidth ? '100%' : width, height: autoHeight ? 'auto' : height } }), React.createElement( "div", { className: "advgb-image-slider-item-info", style: { justifyContent: vAlign, alignItems: hAlign } }, React.createElement("a", { className: "advgb-image-slider-overlay", target: "_blank", rel: "noopener noreferrer", href: actionOnClick === 'link' && !!image.link ? image.link : '#', style: { backgroundColor: hoverColor, opacity: alwaysShowOverlay ? 0.5 : undefined } }), image.title && React.createElement( "h4", { className: "advgb-image-slider-title", style: { color: titleColor } }, image.title ), image.text && React.createElement( "p", { className: "advgb-image-slider-text", style: { color: textColor } }, image.text ) ) ); }) ) ); } }, { attributes: blockAttrs, save: function save(_ref7) { var attributes = _ref7.attributes; var images = attributes.images, actionOnClick = attributes.actionOnClick, fullWidth = attributes.fullWidth, autoHeight = attributes.autoHeight, width = attributes.width, height = attributes.height, alwaysShowOverlay = attributes.alwaysShowOverlay, hoverColor = attributes.hoverColor, titleColor = attributes.titleColor, textColor = attributes.textColor, hAlign = attributes.hAlign, vAlign = attributes.vAlign; var blockClassName = ['advgb-images-slider-block', actionOnClick === 'lightbox' && 'advgb-images-slider-lightbox'].filter(Boolean).join(' '); return React.createElement( "div", { className: blockClassName }, React.createElement( "div", { className: "advgb-images-slider" }, images.map(function (image, index) { return React.createElement( "div", { className: "advgb-image-slider-item", key: index }, React.createElement("img", { src: image.url, className: "advgb-image-slider-img", alt: 'Slider image', style: { width: fullWidth ? '100%' : width, height: autoHeight ? 'auto' : height } }), React.createElement( "div", { className: "advgb-image-slider-item-info", style: { justifyContent: vAlign, alignItems: hAlign } }, React.createElement("a", { className: "advgb-image-slider-overlay", target: "_blank", rel: "noopener noreferrer", href: actionOnClick === 'link' && !!image.link ? image.link : undefined, style: { backgroundColor: hoverColor, opacity: alwaysShowOverlay ? 0.5 : undefined } }), React.createElement( "h4", { className: "advgb-image-slider-title", style: { color: titleColor } }, image.title ), React.createElement( "p", { className: "advgb-image-slider-text", style: { color: textColor } }, image.text ) ) ); }) ) ); } }] }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/infobox/block.jsx": /*!*********************************************!*\ !*** ./src/assets/blocks/infobox/block.jsx ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _components = __webpack_require__(/*! ../0-adv-components/components.jsx */ "./src/assets/blocks/0-adv-components/components.jsx"); var _iconClass = __webpack_require__(/*! ../0-adv-components/icon-class.jsx */ "./src/assets/blocks/0-adv-components/icon-class.jsx"); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, BlockControls = _wpBlockEditor.BlockControls, AlignmentToolbar = _wpBlockEditor.AlignmentToolbar, RichText = _wpBlockEditor.RichText; var BaseControl = wpComponents.BaseControl, PanelBody = wpComponents.PanelBody, RangeControl = wpComponents.RangeControl, SelectControl = wpComponents.SelectControl, Button = wpComponents.Button; var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgIAAAD6CAYAAADTGy+RAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAEqNJREFUeNrs3W+IXOV+B/Azfza72SQbvdZoIBpF9Fal+CL2RaBgWsELteA7X+jVF9ZS8JWvInIFofgHS+G+tBRfWUu9N4gGiyAt1r7wRbgg1iZtNdd/tamm3OpudjfZv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GVKH2hYLcXHm+EgLgjVAgCAIxTEIgTCnmjS8FPWh+QeHrhLCEgbxBoL/xRx/20EJA02q92PF61o9MgDACwkwNA1KV+NlK6Ap1HEBRyMqFcQSAki421Ap3BIOrSCaj06AhUOroCaSFAKABguxf/fjoCjYRQ0LPwZ1kk2E9HoLMrUOnYgUaPgt05JdBoCwOVlO6BEADAOHQDugWBtM5AFBVw3YF6QS+qvWgnTQ9sBoC0QJEWBIQAAMYlCMRR+omEkjoCjS6Pm1nuQptwKGEUJZ9cqPOIgkrCbUVHAABBIHWtQNqZBZO6Ai15pgX66gh0rBXoXCeQ9GIb0ZVHCcQ9QoDiD8BODgRZwkDawsBGSsDI3Q3oKwh0CQCbGm3FPW1RYPv6gEgYAGAMuwK91gp0CwhXdAKijOcN6NR3se2YIoiiLtca6LGlFX9BAIBx6Ah06wx0u7hQ7gsMFdkRyNMliHOGAAEAAGGg+9e6dRuG0xFI6QokdQailOLfKwAIBADsxADQbyCIUsJAX1MChRbbLtMEvYp+1ikBoQCAnVD8k76eNOefJQD0PR1QSoHt0R3IGgIUfQB0BroHhsJCQClFt+0qhVGP0b4uAADj3h2Ic95v/XuQqYChFNuU7kCe0b8QAMC4hIFuXYIrvlZkCCi94HYJBEIAAAJBxq5B0cV/y4puwrTByO0jAAyx8Kd+f5nFfySKbMcljRV+AMY+GAyr+AMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA29D/CjAAQUImXS0JVv0AAAAASUVORK5CYII='; var blockIcon = React.createElement( "svg", { version: "1.1", id: "Layer_1", xmlns: "http://www.w3.org/2000/svg", x: "0px", y: "0px", viewBox: "0 0 250 250" }, React.createElement("path", { d: "M114,110h23v69.1h-23V110z M114,63.9v23h23v-23H114z M225,22v11v177v11h-11H37H26v-11V33V22h11h177H225z M214,33H37v177h177V33z" }) ); var MARGIN_PADDING_CONTROLS = [{ label: 'Top', icon: React.createElement( "svg", { width: "20px", height: "20px", viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", "fill-rule": "evenodd", "clip-rule": "evenodd", "stroke-linejoin": "round", "stroke-miterlimit": "1.414" }, React.createElement("rect", { x: "2.714", y: "5.492", width: "1.048", height: "9.017", fill: "#555d66" }), React.createElement("rect", { x: "16.265", y: "5.498", width: "1.023", height: "9.003", fill: "#555d66" }), React.createElement("rect", { x: "5.518", y: "2.186", width: "8.964", height: "2.482", fill: "#272b2f" }), React.createElement("rect", { x: "5.487", y: "16.261", width: "9.026", height: "1.037", fill: "#555d66" }) ) }, { label: 'Right', icon: React.createElement( "svg", { width: "20px", height: "20px", viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", "fill-rule": "evenodd", "clip-rule": "evenodd", "stroke-linejoin": "round", "stroke-miterlimit": "1.414" }, React.createElement("rect", { x: "2.714", y: "5.492", width: "1.046", height: "9.017", fill: "#555d66" }), React.createElement("rect", { x: "15.244", y: "5.498", width: "2.518", height: "9.003", fill: "#272b2f" }), React.createElement("rect", { x: "5.518", y: "2.719", width: "8.964", height: "0.954", fill: "#555d66" }), React.createElement("rect", { x: "5.487", y: "16.308", width: "9.026", height: "0.99", fill: "#555d66" }) ) }, { label: 'Bottom', icon: React.createElement( "svg", { width: "20px", height: "20px", viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", "fill-rule": "evenodd", "clip-rule": "evenodd", "stroke-linejoin": "round", "stroke-miterlimit": "1.414" }, React.createElement("rect", { x: "2.714", y: "5.492", width: "1", height: "9.017", fill: "#555d66" }), React.createElement("rect", { x: "16.261", y: "5.498", width: "1.027", height: "9.003", fill: "#555d66" }), React.createElement("rect", { x: "5.518", y: "2.719", width: "8.964", height: "0.968", fill: "#555d66" }), React.createElement("rect", { x: "5.487", y: "15.28", width: "9.026", height: "2.499", fill: "#272b2f" }) ) }, { label: 'Left', icon: React.createElement( "svg", { width: "20px", height: "20px", viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", "fill-rule": "evenodd", "clip-rule": "evenodd", "stroke-linejoin": "round", "stroke-miterlimit": "1.414" }, React.createElement("rect", { x: "2.202", y: "5.492", width: "2.503", height: "9.017", fill: "#272b2f" }), React.createElement("rect", { x: "16.276", y: "5.498", width: "1.012", height: "9.003", fill: "#555d66" }), React.createElement("rect", { x: "5.518", y: "2.719", width: "8.964", height: "0.966", fill: "#555d66" }), React.createElement("rect", { x: "5.487", y: "16.303", width: "9.026", height: "0.995", fill: "#555d66" }) ) }]; var InfoBoxEdit = function (_Component) { _inherits(InfoBoxEdit, _Component); function InfoBoxEdit() { _classCallCheck(this, InfoBoxEdit); var _this = _possibleConstructorReturn(this, (InfoBoxEdit.__proto__ || Object.getPrototypeOf(InfoBoxEdit)).apply(this, arguments)); _this.state = { showPopup: false, iconSelected: '', selectedIcon: false, iconThemeSelected: 'outlined', selectedIconTheme: false }; _this.togglePopup = _this.togglePopup.bind(_this); _this.handleIcon = _this.handleIcon.bind(_this); _this.handleIconTheme = _this.handleIconTheme.bind(_this); return _this; } _createClass(InfoBoxEdit, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-infobox']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === "undefined" ? "undefined" : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: "componentDidMount", value: function componentDidMount() { var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes, clientId = _props2.clientId; var blockIDX = attributes.blockIDX; setAttributes({ blockIDX: "advgb-infobox-" + clientId }); } }, { key: "componentDidUpdate", value: function componentDidUpdate() { var _state = this.state, iconSelected = _state.iconSelected, selectedIcon = _state.selectedIcon, iconThemeSelected = _state.iconThemeSelected, selectedIconTheme = _state.selectedIconTheme; var _props3 = this.props, attributes = _props3.attributes, setAttributes = _props3.setAttributes; if (selectedIcon) { this.setState({ selectedIcon: false }); setAttributes({ icon: iconSelected, iconTheme: iconThemeSelected }); } if (selectedIconTheme) { this.setState({ selectedIconTheme: false }); setAttributes({ iconTheme: iconThemeSelected }); } } }, { key: "togglePopup", value: function togglePopup() { var showPopup = this.state.showPopup; this.setState({ showPopup: !showPopup }); } }, { key: "handleIcon", value: function handleIcon(iconValue) { this.setState({ iconSelected: iconValue, selectedIcon: true }); } }, { key: "handleIconTheme", value: function handleIconTheme(iconThemeValue) { this.setState({ iconThemeSelected: iconThemeValue, selectedIconTheme: true }); } }, { key: "render", value: function render() { var _this2 = this; var _props4 = this.props, attributes = _props4.attributes, setAttributes = _props4.setAttributes; var blockIDX = attributes.blockIDX, isPreview = attributes.isPreview, align = attributes.align, containerBorderWidth = attributes.containerBorderWidth, containerBorderRadius = attributes.containerBorderRadius, containerPaddingTop = attributes.containerPaddingTop, containerPaddingBottom = attributes.containerPaddingBottom, containerPaddingLeft = attributes.containerPaddingLeft, containerPaddingRight = attributes.containerPaddingRight, containerBackground = attributes.containerBackground, containerBorderBackground = attributes.containerBorderBackground, containerPaddingUnit = attributes.containerPaddingUnit, iconBorderWidth = attributes.iconBorderWidth, iconBorderRadius = attributes.iconBorderRadius, iconPaddingTop = attributes.iconPaddingTop, iconPaddingBottom = attributes.iconPaddingBottom, iconPaddingLeft = attributes.iconPaddingLeft, iconPaddingRight = attributes.iconPaddingRight, iconMarginTop = attributes.iconMarginTop, iconMarginBottom = attributes.iconMarginBottom, iconMarginLeft = attributes.iconMarginLeft, iconMarginRight = attributes.iconMarginRight, iconBackground = attributes.iconBackground, iconBorderBackground = attributes.iconBorderBackground, iconPaddingUnit = attributes.iconPaddingUnit, iconMarginUnit = attributes.iconMarginUnit, icon = attributes.icon, iconSize = attributes.iconSize, iconColor = attributes.iconColor, iconTheme = attributes.iconTheme, title = attributes.title, titleColor = attributes.titleColor, titleSize = attributes.titleSize, titleSizeUnit = attributes.titleSizeUnit, titleLineHeight = attributes.titleLineHeight, titleLineHeightUnit = attributes.titleLineHeightUnit, titleHtmlTag = attributes.titleHtmlTag, titlePaddingTop = attributes.titlePaddingTop, titlePaddingBottom = attributes.titlePaddingBottom, titlePaddingLeft = attributes.titlePaddingLeft, titlePaddingRight = attributes.titlePaddingRight, titleMarginTop = attributes.titleMarginTop, titleMarginBottom = attributes.titleMarginBottom, titleMarginLeft = attributes.titleMarginLeft, titleMarginRight = attributes.titleMarginRight, titlePaddingUnit = attributes.titlePaddingUnit, titleMarginUnit = attributes.titleMarginUnit, text = attributes.text, textColor = attributes.textColor, textSize = attributes.textSize, textSizeUnit = attributes.textSizeUnit, textLineHeight = attributes.textLineHeight, textLineHeightUnit = attributes.textLineHeightUnit, textPaddingTop = attributes.textPaddingTop, textPaddingBottom = attributes.textPaddingBottom, textPaddingLeft = attributes.textPaddingLeft, textPaddingRight = attributes.textPaddingRight, textMarginTop = attributes.textMarginTop, textMarginBottom = attributes.textMarginBottom, textMarginLeft = attributes.textMarginLeft, textMarginRight = attributes.textMarginRight, textPaddingUnit = attributes.textPaddingUnit, textMarginUnit = attributes.textMarginUnit; var showPopup = this.state.showPopup; var blockWrapClass = ['advgb-infobox-wrapper', "has-text-align-" + align].filter(Boolean).join(' '); var blockClass = ['advgb-infobox-wrap'].filter(Boolean).join(' '); var iconClass = ['material-icons', iconTheme !== '' && "-" + iconTheme].filter(Boolean).join(''); var containerPadding = containerPaddingTop + containerPaddingUnit + ' ' + containerPaddingRight + containerPaddingUnit + ' ' + containerPaddingBottom + containerPaddingUnit + ' ' + containerPaddingLeft + containerPaddingUnit; var iconPadding = iconPaddingTop + iconPaddingUnit + ' ' + iconPaddingRight + iconPaddingUnit + ' ' + iconPaddingBottom + iconPaddingUnit + ' ' + iconPaddingLeft + iconPaddingUnit; var iconMargin = iconMarginTop + iconMarginUnit + ' ' + iconMarginRight + iconMarginUnit + ' ' + iconMarginBottom + iconMarginUnit + ' ' + iconMarginLeft + iconMarginUnit; var titlePadding = titlePaddingTop + titlePaddingUnit + ' ' + titlePaddingRight + titlePaddingUnit + ' ' + titlePaddingBottom + titlePaddingUnit + ' ' + titlePaddingLeft + titlePaddingUnit; var titleMargin = titleMarginTop + titleMarginUnit + ' ' + titleMarginRight + titleMarginUnit + ' ' + titleMarginBottom + titleMarginUnit + ' ' + titleMarginLeft + titleMarginUnit; var textPadding = textPaddingTop + textPaddingUnit + ' ' + textPaddingRight + textPaddingUnit + ' ' + textPaddingBottom + textPaddingUnit + ' ' + textPaddingLeft + textPaddingUnit; var textMargin = textMarginTop + textMarginUnit + ' ' + textMarginRight + textMarginUnit + ' ' + textMarginBottom + textMarginUnit + ' ' + textMarginLeft + textMarginUnit; return isPreview ? React.createElement("img", { alt: __('Info Box', 'advanced-gutenberg'), width: "100%", src: previewImageData }) : React.createElement( Fragment, null, React.createElement( BlockControls, null, React.createElement(AlignmentToolbar, { value: align, onChange: function onChange(newAlign) { return setAttributes({ align: newAlign }); } }) ), React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Container Settings', 'advanced-gutenberg') }, React.createElement(_components.AdvColorControl, { label: __('Background', 'advanced-gutenberg'), value: containerBackground, onChange: function onChange(value) { return setAttributes({ containerBackground: value }); } }), React.createElement(_components.AdvColorControl, { label: __('Border Color', 'advanced-gutenberg'), value: containerBorderBackground, onChange: function onChange(value) { return setAttributes({ containerBorderBackground: value }); } }), React.createElement(RangeControl, { label: __('Border Width (px)', 'advanced-gutenberg'), min: 0, max: 40, value: containerBorderWidth, onChange: function onChange(value) { return setAttributes({ containerBorderWidth: value }); } }), React.createElement(RangeControl, { label: __('Border Radius (px)', 'advanced-gutenberg'), min: 0, max: 200, value: containerBorderRadius, onChange: function onChange(value) { return setAttributes({ containerBorderRadius: value }); } }), React.createElement(BaseControl, { label: __('Padding', 'advanced-gutenberg'), className: "advgb-control-header" }), React.createElement( "div", { className: "advgb-controls-title" }, React.createElement( "span", null, __('Unit', 'advanced-gutenberg') ), React.createElement( "div", { className: "advgb-unit-wrapper", key: "unit" }, ['px', 'em', 'vh', '%'].map(function (unit, uIdx) { return React.createElement( "span", { className: "advgb-unit " + (containerPaddingUnit === unit ? 'selected' : ''), key: uIdx, onClick: function onClick() { return setAttributes({ containerPaddingUnit: unit }); } }, unit ); }) ) ), MARGIN_PADDING_CONTROLS.map(function (pos, mpIdx) { return React.createElement(RangeControl, { className: "advgb-padding-margin-control", key: mpIdx, beforeIcon: pos.icon, value: attributes['containerPadding' + pos.label], min: 0, max: 180, onChange: function onChange(value) { return setAttributes(_defineProperty({}, 'containerPadding' + pos.label, value)); } }); }) ), React.createElement( PanelBody, { title: __('Icon Settings', 'advanced-gutenberg'), initialOpen: false }, React.createElement( BaseControl, { label: __('Icon Library (Material Icon)', 'advanced-gutenberg') }, React.createElement( Button, { className: "button button-large advgb-browse-icon-btn", onClick: function onClick() { if (!showPopup) { _this2.togglePopup(); } } }, __('Icon Selection', 'advanced-gutenberg') ) ), React.createElement(_components.AdvColorControl, { label: __('Icon Color', 'advanced-gutenberg'), value: iconColor, onChange: function onChange(value) { return setAttributes({ iconColor: value }); } }), React.createElement(RangeControl, { label: __('Icon Size (px)', 'advanced-gutenberg'), value: iconSize, min: 1, max: 200, onChange: function onChange(value) { return setAttributes({ iconSize: value }); } }), React.createElement(_components.AdvColorControl, { label: __('Background', 'advanced-gutenberg'), value: iconBackground, onChange: function onChange(value) { return setAttributes({ iconBackground: value }); } }), React.createElement(_components.AdvColorControl, { label: __('Border Color', 'advanced-gutenberg'), value: iconBorderBackground, onChange: function onChange(value) { return setAttributes({ iconBorderBackground: value }); } }), React.createElement(RangeControl, { label: __('Border Width (px)', 'advanced-gutenberg'), min: 0, max: 40, value: iconBorderWidth, onChange: function onChange(value) { return setAttributes({ iconBorderWidth: value }); } }), React.createElement(RangeControl, { label: __('Border Radius (px)', 'advanced-gutenberg'), min: 0, max: 200, value: iconBorderRadius, onChange: function onChange(value) { return setAttributes({ iconBorderRadius: value }); } }), React.createElement(BaseControl, { label: __('Padding', 'advanced-gutenberg'), className: "advgb-control-header" }), React.createElement( "div", { className: "advgb-controls-title" }, React.createElement( "span", null, __('Unit', 'advanced-gutenberg') ), React.createElement( "div", { className: "advgb-unit-wrapper", key: "unit" }, ['px', 'em', 'vh', '%'].map(function (unit, uIdx) { return React.createElement( "span", { className: "advgb-unit " + (iconPaddingUnit === unit ? 'selected' : ''), key: uIdx, onClick: function onClick() { return setAttributes({ iconPaddingUnit: unit }); } }, unit ); }) ) ), MARGIN_PADDING_CONTROLS.map(function (pos, mpIdx) { return React.createElement(RangeControl, { className: "advgb-padding-margin-control", key: mpIdx, beforeIcon: pos.icon, value: attributes['iconPadding' + pos.label], min: 0, max: 180, onChange: function onChange(value) { return setAttributes(_defineProperty({}, 'iconPadding' + pos.label, value)); } }); }), React.createElement(BaseControl, { label: __('Margin', 'advanced-gutenberg'), className: "advgb-control-header" }), React.createElement( "div", { className: "advgb-controls-title" }, React.createElement( "span", null, __('Unit', 'advanced-gutenberg') ), React.createElement( "div", { className: "advgb-unit-wrapper", key: "unit" }, ['px', 'em', 'vh', '%'].map(function (unit, uIdx) { return React.createElement( "span", { className: "advgb-unit " + (iconMarginUnit === unit ? 'selected' : ''), key: uIdx, onClick: function onClick() { return setAttributes({ iconMarginUnit: unit }); } }, unit ); }) ) ), MARGIN_PADDING_CONTROLS.map(function (pos, mpIdx) { return React.createElement(RangeControl, { className: "advgb-padding-margin-control", key: mpIdx, beforeIcon: pos.icon, value: attributes['iconMargin' + pos.label], min: 0, max: 180, onChange: function onChange(value) { return setAttributes(_defineProperty({}, 'iconMargin' + pos.label, value)); } }); }) ), React.createElement( PanelBody, { title: __('Title Settings', 'advanced-gutenberg'), initialOpen: false }, React.createElement(_components.AdvColorControl, { label: __('Color', 'advanced-gutenberg'), value: titleColor, onChange: function onChange(value) { return setAttributes({ titleColor: value }); } }), React.createElement( "div", { className: "advgb-controls-title" }, React.createElement( "div", { className: "advgb-unit-wrapper advgb-unit-2", key: "unit" }, ['px', 'em'].map(function (unit, uIdx) { return React.createElement( "span", { className: "advgb-unit " + (titleSizeUnit === unit ? 'selected' : ''), key: uIdx, onClick: function onClick() { return setAttributes({ titleSizeUnit: unit }); } }, unit ); }) ) ), React.createElement(RangeControl, { label: __('Font Size', 'advanced-gutenberg'), value: titleSize, min: titleSizeUnit === 'px' ? 1 : 0.2, max: titleSizeUnit === 'px' ? 200 : 12.0, step: titleSizeUnit === 'px' ? 1 : 0.1, onChange: function onChange(value) { return setAttributes({ titleSize: value }); } }), React.createElement( "div", { className: "advgb-controls-title" }, React.createElement( "div", { className: "advgb-unit-wrapper advgb-unit-2", key: "unit" }, ['px', 'em'].map(function (unit, uIdx) { return React.createElement( "span", { className: "advgb-unit " + (titleLineHeightUnit === unit ? 'selected' : ''), key: uIdx, onClick: function onClick() { return setAttributes({ titleLineHeightUnit: unit }); } }, unit ); }) ) ), React.createElement(RangeControl, { label: __('Line Height', 'advanced-gutenberg'), value: titleLineHeight, min: titleLineHeightUnit === 'px' ? 1 : 0.2, max: titleLineHeightUnit === 'px' ? 200 : 12.0, step: titleLineHeightUnit === 'px' ? 1 : 0.1, onChange: function onChange(value) { return setAttributes({ titleLineHeight: value }); } }), React.createElement(SelectControl, { label: __('HTML Tag', 'advanced-gutenberg'), value: titleHtmlTag, options: [{ label: __('H1', 'advanced-gutenberg'), value: 'h1' }, { label: __('H2', 'advanced-gutenberg'), value: 'h2' }, { label: __('H3', 'advanced-gutenberg'), value: 'h3' }, { label: __('H4', 'advanced-gutenberg'), value: 'h4' }, { label: __('H5', 'advanced-gutenberg'), value: 'h5' }, { label: __('H6', 'advanced-gutenberg'), value: 'h6' }], onChange: function onChange(value) { return setAttributes({ titleHtmlTag: value }); } }), React.createElement(BaseControl, { label: __('Padding', 'advanced-gutenberg'), className: "advgb-control-header" }), React.createElement( "div", { className: "advgb-controls-title" }, React.createElement( "span", null, __('Unit', 'advanced-gutenberg') ), React.createElement( "div", { className: "advgb-unit-wrapper", key: "unit" }, ['px', 'em', 'vh', '%'].map(function (unit, uIdx) { return React.createElement( "span", { className: "advgb-unit " + (titlePaddingUnit === unit ? 'selected' : ''), key: uIdx, onClick: function onClick() { return setAttributes({ titlePaddingUnit: unit }); } }, unit ); }) ) ), MARGIN_PADDING_CONTROLS.map(function (pos, mpIdx) { return React.createElement(RangeControl, { className: "advgb-padding-margin-control", key: mpIdx, beforeIcon: pos.icon, value: attributes['titlePadding' + pos.label], min: 0, max: 180, onChange: function onChange(value) { return setAttributes(_defineProperty({}, 'titlePadding' + pos.label, value)); } }); }), React.createElement(BaseControl, { label: __('Margin', 'advanced-gutenberg'), className: "advgb-control-header" }), React.createElement( "div", { className: "advgb-controls-title" }, React.createElement( "span", null, __('Unit', 'advanced-gutenberg') ), React.createElement( "div", { className: "advgb-unit-wrapper", key: "unit" }, ['px', 'em', 'vh', '%'].map(function (unit, uIdx) { return React.createElement( "span", { className: "advgb-unit " + (titleMarginUnit === unit ? 'selected' : ''), key: uIdx, onClick: function onClick() { return setAttributes({ titleMarginUnit: unit }); } }, unit ); }) ) ), MARGIN_PADDING_CONTROLS.map(function (pos, mpIdx) { return React.createElement(RangeControl, { className: "advgb-padding-margin-control", key: mpIdx, beforeIcon: pos.icon, value: attributes['titleMargin' + pos.label], min: 0, max: 180, onChange: function onChange(value) { return setAttributes(_defineProperty({}, 'titleMargin' + pos.label, value)); } }); }) ), React.createElement( PanelBody, { title: __('Text Settings', 'advanced-gutenberg'), initialOpen: false }, React.createElement(_components.AdvColorControl, { label: __('Color', 'advanced-gutenberg'), value: textColor, onChange: function onChange(value) { return setAttributes({ textColor: value }); } }), React.createElement( "div", { className: "advgb-controls-title" }, React.createElement( "div", { className: "advgb-unit-wrapper advgb-unit-2", key: "unit" }, ['px', 'em'].map(function (unit, uIdx) { return React.createElement( "span", { className: "advgb-unit " + (textSizeUnit === unit ? 'selected' : ''), key: uIdx, onClick: function onClick() { return setAttributes({ textSizeUnit: unit }); } }, unit ); }) ) ), React.createElement(RangeControl, { label: __('Font Size', 'advanced-gutenberg'), value: textSize, min: textSizeUnit === 'px' ? 1 : 0.2, max: textSizeUnit === 'px' ? 200 : 12.0, step: textSizeUnit === 'px' ? 1 : 0.1, onChange: function onChange(value) { return setAttributes({ textSize: value }); } }), React.createElement( "div", { className: "advgb-controls-title" }, React.createElement( "div", { className: "advgb-unit-wrapper advgb-unit-2", key: "unit" }, ['px', 'em'].map(function (unit, uIdx) { return React.createElement( "span", { className: "advgb-unit " + (textLineHeightUnit === unit ? 'selected' : ''), key: uIdx, onClick: function onClick() { return setAttributes({ textLineHeightUnit: unit }); } }, unit ); }) ) ), React.createElement(RangeControl, { label: __('Line Height', 'advanced-gutenberg'), value: textLineHeight, min: textLineHeightUnit === 'px' ? 1 : 0.2, max: textLineHeightUnit === 'px' ? 200 : 12.0, step: textLineHeightUnit === 'px' ? 1 : 0.1, onChange: function onChange(value) { return setAttributes({ textLineHeight: value }); } }), React.createElement(BaseControl, { label: __('Padding', 'advanced-gutenberg'), className: "advgb-control-header" }), React.createElement( "div", { className: "advgb-controls-title" }, React.createElement( "span", null, __('Unit', 'advanced-gutenberg') ), React.createElement( "div", { className: "advgb-unit-wrapper", key: "unit" }, ['px', 'em', 'vh', '%'].map(function (unit, uIdx) { return React.createElement( "span", { className: "advgb-unit " + (textPaddingUnit === unit ? 'selected' : ''), key: uIdx, onClick: function onClick() { return setAttributes({ textPaddingUnit: unit }); } }, unit ); }) ) ), MARGIN_PADDING_CONTROLS.map(function (pos, mpIdx) { return React.createElement(RangeControl, { className: "advgb-padding-margin-control", key: mpIdx, beforeIcon: pos.icon, value: attributes['textPadding' + pos.label], min: 0, max: 180, onChange: function onChange(value) { return setAttributes(_defineProperty({}, 'textPadding' + pos.label, value)); } }); }), React.createElement(BaseControl, { label: __('Margin', 'advanced-gutenberg'), className: "advgb-control-header" }), React.createElement( "div", { className: "advgb-controls-title" }, React.createElement( "span", null, __('Unit', 'advanced-gutenberg') ), React.createElement( "div", { className: "advgb-unit-wrapper", key: "unit" }, ['px', 'em', 'vh', '%'].map(function (unit, uIdx) { return React.createElement( "span", { className: "advgb-unit " + (textMarginUnit === unit ? 'selected' : ''), key: uIdx, onClick: function onClick() { return setAttributes({ textMarginUnit: unit }); } }, unit ); }) ) ), MARGIN_PADDING_CONTROLS.map(function (pos, mpIdx) { return React.createElement(RangeControl, { className: "advgb-padding-margin-control", key: mpIdx, beforeIcon: pos.icon, value: attributes['textMargin' + pos.label], min: 0, max: 180, onChange: function onChange(value) { return setAttributes(_defineProperty({}, 'textMargin' + pos.label, value)); } }); }) ) ), React.createElement( "div", { className: blockWrapClass, style: { backgroundColor: containerBackground, padding: containerPadding, border: containerBorderWidth + "px solid " + containerBorderBackground, borderRadius: containerBorderRadius + "px" }, id: blockIDX }, React.createElement( "div", { className: blockClass }, React.createElement( "div", { className: "advgb-infobox-icon-container", style: { backgroundColor: iconBackground, padding: iconPadding, margin: iconMargin, border: iconBorderWidth + "px solid " + iconBorderBackground, borderRadius: iconBorderRadius + "px" } }, React.createElement( "div", { className: "advgb-infobox-icon-inner-container" }, React.createElement( "i", { className: iconClass, style: { color: iconColor, fontSize: iconSize, display: 'block' } }, icon ) ) ), React.createElement( "div", { className: "advgb-infobox-textcontent" }, React.createElement(RichText, { tagName: titleHtmlTag, className: "advgb-infobox-title", onChange: function onChange(value) { return setAttributes({ title: value }); }, value: title, style: { color: titleColor, fontSize: titleSize + titleSizeUnit, lineHeight: titleLineHeight + titleLineHeightUnit, padding: titlePadding, margin: titleMargin, whiteSpace: 'pre-wrap' } }), React.createElement(RichText, { tagName: "p", className: "advgb-infobox-text", onChange: function onChange(value) { return setAttributes({ text: value }); }, value: text, style: { color: textColor, fontSize: textSize + textSizeUnit, lineHeight: textLineHeight + textLineHeightUnit, padding: textPadding, margin: textMargin, whiteSpace: 'pre-wrap' } }) ) ), showPopup ? React.createElement(_iconClass.IconListPopupHook, { content: "iconpopup", closePopup: function closePopup() { if (showPopup) { _this2.togglePopup(); } }, onSelectIcon: this.handleIcon, onSelectIconTheme: this.handleIconTheme, selectedIcon: icon, selectedIconTheme: iconTheme }) : null ) ); } }]); return InfoBoxEdit; }(Component); var blockAttrs = { blockIDX: { type: 'string' }, align: { type: 'string', default: 'center' }, containerBorderWidth: { type: 'number', default: 0 }, containerBorderRadius: { type: 'number', default: 0 }, containerPaddingTop: { type: 'number', default: 20 }, containerPaddingBottom: { type: 'number', default: 20 }, containerPaddingLeft: { type: 'number', default: 20 }, containerPaddingRight: { type: 'number', default: 20 }, containerPaddingUnit: { type: 'string', default: 'px' }, containerBackground: { type: 'string', default: '#f5f5f5' }, containerBorderBackground: { type: 'string', default: '#e8e8e8' }, iconBorderWidth: { type: 'number', default: 0 }, iconBorderRadius: { type: 'number', default: 0 }, iconPaddingTop: { type: 'number', default: 0 }, iconPaddingBottom: { type: 'number', default: 0 }, iconPaddingLeft: { type: 'number', default: 0 }, iconPaddingRight: { type: 'number', default: 0 }, iconMarginTop: { type: 'number', default: 0 }, iconMarginBottom: { type: 'number', default: 0 }, iconMarginLeft: { type: 'number', default: 0 }, iconMarginRight: { type: 'number', default: 0 }, iconPaddingUnit: { type: 'string', default: 'px' }, iconMarginUnit: { type: 'string', default: 'px' }, iconBackground: { type: 'string', default: '#f5f5f5' }, iconBorderBackground: { type: 'string', default: '#e8e8e8' }, icon: { type: 'string', default: 'beenhere' }, iconSize: { type: 'number', default: 70 }, iconColor: { type: 'string', default: '#333' }, iconTheme: { type: 'string', default: 'outlined' }, title: { type: 'string', default: 'Title' }, titleColor: { type: 'string', default: '#333' }, titleSize: { type: 'number' }, titleSizeUnit: { type: 'string', default: 'px' }, titleLineHeight: { type: 'number' }, titleLineHeightUnit: { type: 'string', default: 'px' }, titleHtmlTag: { type: 'string', default: 'h3' }, titlePaddingTop: { type: 'number', default: 0 }, titlePaddingBottom: { type: 'number', default: 0 }, titlePaddingLeft: { type: 'number', default: 0 }, titlePaddingRight: { type: 'number', default: 0 }, titleMarginTop: { type: 'number', default: 5 }, titleMarginBottom: { type: 'number', default: 10 }, titleMarginLeft: { type: 'number', default: 0 }, titleMarginRight: { type: 'number', default: 0 }, titlePaddingUnit: { type: 'string', default: 'px' }, titleMarginUnit: { type: 'string', default: 'px' }, text: { type: 'string', default: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean diam dolor, accumsan sed rutrum vel, dapibus et leo.' }, textColor: { type: 'string', default: '#333' }, textSize: { type: 'number' }, textSizeUnit: { type: 'string', default: 'px' }, textLineHeight: { type: 'number' }, textLineHeightUnit: { type: 'string', default: 'px' }, textPaddingTop: { type: 'number', default: 0 }, textPaddingBottom: { type: 'number', default: 0 }, textPaddingLeft: { type: 'number', default: 0 }, textPaddingRight: { type: 'number', default: 0 }, textMarginTop: { type: 'number', default: 0 }, textMarginBottom: { type: 'number', default: 0 }, textMarginLeft: { type: 'number', default: 0 }, textMarginRight: { type: 'number', default: 0 }, textPaddingUnit: { type: 'string', default: 'px' }, textMarginUnit: { type: 'string', default: 'px' }, changed: { type: 'boolean', default: false }, isPreview: { type: 'boolean', default: false } }; registerBlockType('advgb/infobox', { title: __('Info Box - PublishPress', 'advanced-gutenberg'), description: __('Icon block with more options and styles.', 'advanced-gutenberg'), icon: { src: blockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('info', 'advanced-gutenberg'), __('icon', 'advanced-gutenberg'), __('box', 'advanced-gutenberg')], attributes: blockAttrs, example: { attributes: { isPreview: true } }, edit: InfoBoxEdit, save: function save(_ref) { var attributes = _ref.attributes; var blockIDX = attributes.blockIDX, className = attributes.className, title = attributes.title, titleHtmlTag = attributes.titleHtmlTag, text = attributes.text, icon = attributes.icon, iconTheme = attributes.iconTheme, align = attributes.align; var blockWrapClass = ['wp-block-advgb-infobox', 'advgb-infobox-wrapper', "has-text-align-" + align, className, blockIDX].filter(Boolean).join(' '); var blockClass = ['advgb-infobox-wrap'].filter(Boolean).join(' '); var iconClass = ['material-icons', iconTheme !== '' && "-" + iconTheme].filter(Boolean).join(''); return React.createElement( Fragment, null, React.createElement( "div", { className: blockWrapClass }, React.createElement( "div", { className: blockClass }, React.createElement( "div", { className: "advgb-infobox-icon-container" }, React.createElement( "div", { className: "advgb-infobox-icon-inner-container" }, React.createElement( "i", { className: iconClass }, icon ) ) ), React.createElement( "div", { className: "advgb-infobox-textcontent" }, React.createElement(RichText.Content, { tagName: titleHtmlTag, className: "advgb-infobox-title", value: title }), React.createElement(RichText.Content, { tagName: "p", className: "advgb-infobox-text", value: text }) ) ) ) ); }, deprecated: [{ attributes: blockAttrs, save: function save(_ref2) { var attributes = _ref2.attributes; var blockIDX = attributes.blockIDX, title = attributes.title, titleHtmlTag = attributes.titleHtmlTag, text = attributes.text, icon = attributes.icon, iconTheme = attributes.iconTheme, align = attributes.align; var blockWrapClass = ['wp-block-advgb-infobox', 'advgb-infobox-wrapper', "has-text-align-" + align].filter(Boolean).join(' '); var blockClass = ['advgb-infobox-wrap'].filter(Boolean).join(' '); var iconClass = ['material-icons', iconTheme !== '' && "-" + iconTheme].filter(Boolean).join(''); return React.createElement( Fragment, null, React.createElement( "div", { className: blockWrapClass, id: blockIDX }, React.createElement( "div", { className: blockClass }, React.createElement( "div", { className: "advgb-infobox-icon-container" }, React.createElement( "div", { className: "advgb-infobox-icon-inner-container" }, React.createElement( "i", { className: iconClass }, icon ) ) ), React.createElement( "div", { className: "advgb-infobox-textcontent" }, React.createElement(RichText.Content, { tagName: titleHtmlTag, className: "advgb-infobox-title", value: title }), React.createElement(RichText.Content, { tagName: "p", className: "advgb-infobox-text", value: text }) ) ) ) ); } }] }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/login-form/block.jsx": /*!************************************************!*\ !*** ./src/assets/blocks/login-form/block.jsx ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _components = __webpack_require__(/*! ../0-adv-components/components.jsx */ "./src/assets/blocks/0-adv-components/components.jsx"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, BlockControls = _wpBlockEditor.BlockControls, RichText = _wpBlockEditor.RichText, PanelColorSettings = _wpBlockEditor.PanelColorSettings, MediaUpload = _wpBlockEditor.MediaUpload; var RangeControl = wpComponents.RangeControl, PanelBody = wpComponents.PanelBody, TextControl = wpComponents.TextControl, SelectControl = wpComponents.SelectControl, ToggleControl = wpComponents.ToggleControl, Tooltip = wpComponents.Tooltip, ToolbarGroup = wpComponents.ToolbarGroup, ToolbarButton = wpComponents.ToolbarButton, Placeholder = wpComponents.Placeholder; var userIcon = React.createElement( "svg", { fill: "currentColor", width: "24", height: "24", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, React.createElement("path", { d: "M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ); var emailIcon = React.createElement( "svg", { fill: "currentColor", width: "24", height: "24", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, React.createElement("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10h5v-2h-5c-4.34 0-8-3.66-8-8s3.66-8 8-8 8 3.66 8 8v1.43c0 .79-.71 1.57-1.5 1.57s-1.5-.78-1.5-1.57V12c0-2.76-2.24-5-5-5s-5 2.24-5 5 2.24 5 5 5c1.38 0 2.64-.56 3.54-1.47.65.89 1.77 1.47 2.96 1.47 1.97 0 3.5-1.6 3.5-3.57V12c0-5.52-4.48-10-10-10zm0 13c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3z" }), React.createElement("path", { fill: "none", d: "M0 0h24v24H0z" }) ); var passwordIcon = React.createElement( "svg", { fill: "currentColor", width: "24", height: "24", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, React.createElement( "g", { fill: "none" }, React.createElement("path", { d: "M0 0h24v24H0V0z" }), React.createElement("path", { opacity: ".87", d: "M0 0h24v24H0V0z" }) ), React.createElement("path", { d: "M18 8h-1V6c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vb+8/t7e3/+vLLLz9/4403/ul0qr6dGZ3zI3k6wp492n6Si70zyFH3cUJv9gg9G/l8NvTcbMB0nusuBdoeIPT05/Q16esbg4Q+1Lrupz8wxZ6/s52CqUaz8duX2dLXtHKRi53rHHgjt799kmuondsIjHz0fX6MO9osODCQ7lgz87FZ8H0ih+J+ig7AFR6EG2o2PmbkjcwdbOZG8WZuJG/lpv1ix4h+cZA86fGxcESPWfYkR/ReW6Wi4LNf02w8/tq90Lnusffa9W2PO10fK/TMfnp+q5SfshdtCPL/XeiIvHfsRS+pjXQa7HyJd/z8KGDB/0y7x9TdyM51n7ZnG0kH5DqXjOpp2t6ZdOj5/fRGQehJijx9rak7FI/q+aPs/UbzoUb2kULv8zJbo2BUbxVM7UWO0HuP6kUvqY11Bdv8mHe02eMXZ2PuNC6eGy90hF48srcLRvkLkQ96tL2UqXPmTLlGQczNSwIXOkK/OH3vdx360PvmZYzo+Sl8p8eIP8hILnquY+BFI3qjUeJ16KWEngu6153oNC4eaRc29D4C3yvuzrBT9tKDO1tPrtFjet5rNBc8Ir889LEiLz203D5745JRXOQIvf/oXkrkE4stN7oLG4YPv5TAJx5f5iCdwGHI4MsK/MoiLJjew7U1yktlAAAAAAAAAAAAAAAAAAAAUJb/F2AAs10KNNnSQHQAAAAASUVORK5CYII='; var LoginFormEdit = function (_Component) { _inherits(LoginFormEdit, _Component); function LoginFormEdit() { _classCallCheck(this, LoginFormEdit); var _this = _possibleConstructorReturn(this, (LoginFormEdit.__proto__ || Object.getPrototypeOf(LoginFormEdit)).apply(this, arguments)); _this.state = { registerView: false }; return _this; } _createClass(LoginFormEdit, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-login-form']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === "undefined" ? "undefined" : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } // Change view to Register form regard to initial form option this.setState({ registerView: attributes.formType === 'register' }); } }, { key: "componentDidMount", value: function componentDidMount() { var _props2 = this.props, clientId = _props2.clientId, attributes = _props2.attributes, setAttributes = _props2.setAttributes; var submitButtonId = attributes.submitButtonId; if (!submitButtonId) { setAttributes({ submitButtonId: "advgb-submit-btn-" + clientId }); } } }, { key: "render", value: function render() { var _this2 = this; var registerView = this.state.registerView; var _props3 = this.props, attributes = _props3.attributes, setAttributes = _props3.setAttributes; var formType = attributes.formType, formWidth = attributes.formWidth, redirect = attributes.redirect, redirectLink = attributes.redirectLink, showLogo = attributes.showLogo, showInputFieldIcon = attributes.showInputFieldIcon, showRegisterLink = attributes.showRegisterLink, showLostPasswordLink = attributes.showLostPasswordLink, logoImg = attributes.logoImg, logoID = attributes.logoID, registerLogoImg = attributes.registerLogoImg, registerLogoID = attributes.registerLogoID, logoWidth = attributes.logoWidth, welcomeText = attributes.welcomeText, loginLabel = attributes.loginLabel, loginText = attributes.loginText, passwordText = attributes.passwordText, usernameLabel = attributes.usernameLabel, userText = attributes.userText, emailLabel = attributes.emailLabel, emailText = attributes.emailText, rememberMeText = attributes.rememberMeText, loginSubmitLabel = attributes.loginSubmitLabel, registerSubmitLabel = attributes.registerSubmitLabel, registerText = attributes.registerText, registerLinkText = attributes.registerLinkText, registerWelcome = attributes.registerWelcome, backToLoginText = attributes.backToLoginText, lostPasswordText = attributes.lostPasswordText, headerBgColor = attributes.headerBgColor, bgColor = attributes.bgColor, textColor = attributes.textColor, inputColor = attributes.inputColor, borderColor = attributes.borderColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, submitColor = attributes.submitColor, submitBgColor = attributes.submitBgColor, submitRadius = attributes.submitRadius, submitPosition = attributes.submitPosition, submitButtonId = attributes.submitButtonId, submitHoverColor = attributes.submitHoverColor, submitHoverBgColor = attributes.submitHoverBgColor, submitHoverShadow = attributes.submitHoverShadow, submitHoverShadowH = attributes.submitHoverShadowH, submitHoverShadowV = attributes.submitHoverShadowV, submitHoverShadowBlur = attributes.submitHoverShadowBlur, submitHoverShadowSpread = attributes.submitHoverShadowSpread, submitHoverOpacity = attributes.submitHoverOpacity, submitHoverTranSpeed = attributes.submitHoverTranSpeed, isPreview = attributes.isPreview; var logoElm = React.createElement(MediaUpload, { allowedTypes: ["image"], onSelect: function onSelect(media) { return setAttributes({ logoImg: media.sizes.medium ? media.sizes.medium.url : media.sizes.full.url, logoID: media.id }); }, value: logoID, render: function render(_ref) { var open = _ref.open; return React.createElement( "div", { className: "advgb-lores-form-logo-wrapper" }, React.createElement( Tooltip, { text: __('Click to change logo', 'advanced-gutenberg') }, React.createElement( "span", { style: { display: 'block' } }, React.createElement("img", { className: "advgb-lores-form-logo", onClick: open, src: logoImg, alt: 'Site logo', style: { width: logoWidth ? logoWidth + 'px' : undefined, cursor: 'pointer' } }) ) ) ); } }); var regLogoElm = React.createElement(MediaUpload, { allowedTypes: ["image"], onSelect: function onSelect(media) { return setAttributes({ registerLogoImg: media.sizes.medium ? media.sizes.medium.url : media.sizes.full.url, registerLogoID: media.id }); }, value: registerLogoID, render: function render(_ref2) { var open = _ref2.open; return React.createElement( "div", { className: "advgb-lores-form-logo-wrapper" }, React.createElement( Tooltip, { text: __('Click to change logo', 'advanced-gutenberg') }, React.createElement( "span", { style: { display: 'block' } }, React.createElement("img", { className: "advgb-lores-form-logo", onClick: open, src: registerLogoImg, alt: 'Site logo', style: { width: logoWidth ? logoWidth + 'px' : undefined, cursor: 'pointer' } }) ) ) ); } }); var loginForm = React.createElement( "div", { className: "advgb-login-form-wrapper advgb-lores-form" }, !!showRegisterLink && React.createElement( "div", { className: "advgb-register-link-wrapper advgb-header-navigation", style: { backgroundColor: headerBgColor } }, React.createElement(RichText, { tagName: "span", value: registerText, className: "advgb-register-text", onChange: function onChange(value) { return setAttributes({ registerText: value.trim() }); }, style: { color: textColor }, onReplace: function onReplace() { return null; }, onSplit: function onSplit() { return null; }, placeholder: __('Text…', 'advanced-gutenberg'), keepPlaceholderOnFocus: true, allowedFormats: ['core/bold', 'core/italic'] }), React.createElement(RichText, { tagName: "a", value: registerLinkText, className: "advgb-register-link", onChange: function onChange(value) { return setAttributes({ registerLinkText: value.trim() }); }, style: { color: submitBgColor }, onReplace: function onReplace() { return null; }, onSplit: function onSplit() { return null; }, placeholder: __('Register…', 'advanced-gutenberg'), keepPlaceholderOnFocus: true, allowedFormats: ['core/bold', 'core/italic'] }) ), React.createElement( "div", { className: "advgb-login-form advgb-form-inner" }, React.createElement( "div", { className: "advgb-lores-form-header" }, !!showLogo && logoElm, React.createElement(RichText, { tagName: "h3", value: welcomeText, className: "advgb-lores-form-welcome", onChange: function onChange(value) { return setAttributes({ welcomeText: value.trim() }); }, style: { color: textColor }, placeholder: __('Welcome text…', 'advanced-gutenberg'), keepPlaceholderOnFocus: true, allowedFormats: ['core/bold', 'core/italic'] }) ), React.createElement( "div", { className: "advgb-lores-field advgb-login-user" }, React.createElement( "div", { className: "advgb-lores-field-label" }, React.createElement(RichText, { tagName: "label", value: loginText, onChange: function onChange(value) { return setAttributes({ loginText: value.trim() }); }, style: { color: textColor }, onReplace: function onReplace() { return null; }, onSplit: function onSplit() { return null; }, placeholder: __('Username label…', 'advanced-gutenberg'), keepPlaceholderOnFocus: true, allowedFormats: ['core/bold', 'core/italic'] }) ), React.createElement( "div", { className: "advgb-lores-field-input", style: { backgroundColor: bgColor, color: inputColor, borderBottomColor: borderColor, borderStyle: borderStyle, borderWidth: borderWidth } }, !!showInputFieldIcon && React.createElement( "span", { className: "advgb-lores-input-icon", style: { color: textColor } }, emailIcon ), React.createElement("input", { type: "text", disabled: true, className: "advgb-lores-input", style: { color: inputColor }, value: loginLabel ? loginLabel : '[email protected]' }) ) ), React.createElement( "div", { className: "advgb-lores-field advgb-login-password" }, React.createElement( "div", { className: "advgb-lores-field-label" }, React.createElement(RichText, { tagName: "label", value: passwordText, onChange: function onChange(value) { return setAttributes({ passwordText: value.trim() }); }, style: { color: textColor }, onReplace: function onReplace() { return null; }, onSplit: function onSplit() { return null; }, placeholder: __('Password label…', 'advanced-gutenberg'), keepPlaceholderOnFocus: true, allowedFormats: ['core/bold', 'core/italic'] }) ), React.createElement( "div", { className: "advgb-lores-field-input", style: { backgroundColor: bgColor, color: inputColor, borderBottomColor: borderColor, borderStyle: borderStyle, borderWidth: borderWidth } }, !!showInputFieldIcon && React.createElement( "span", { className: "advgb-lores-input-icon", style: { color: textColor } }, passwordIcon ), React.createElement("input", { type: "password", disabled: true, className: "advgb-lores-input", style: { color: inputColor }, value: "password" }) ) ), React.createElement( "div", { className: "advgb-lores-field advgb-lores-submit-wrapper advgb-submit-align-" + submitPosition }, React.createElement( "label", { htmlFor: "rememberme", className: "remember-me-label" }, React.createElement("input", { type: "checkbox", checked: true, className: "advgb-lores-checkbox", style: { color: submitBgColor } }), React.createElement( "div", { className: "remember-me-switch", style: { color: submitBgColor } }, React.createElement( "span", null, React.createElement(RichText, { tagName: "span", value: rememberMeText, onChange: function onChange(value) { return setAttributes({ passwordText: value.trim() }); }, style: { color: textColor }, onReplace: function onReplace() { return null; }, onSplit: function onSplit() { return null; }, placeholder: __('Remember me…', 'advanced-gutenberg'), keepPlaceholderOnFocus: true, allowedFormats: ['core/bold', 'core/italic'] }) ) ) ), React.createElement( "div", { className: "advgb-lores-submit advgb-login-submit" }, React.createElement( "span", { className: "advgb-lores-submit-button " + submitButtonId, style: { borderColor: submitColor, color: submitColor, backgroundColor: submitBgColor, borderRadius: submitRadius } }, React.createElement(RichText, { tagName: "span", value: loginSubmitLabel, onChange: function onChange(value) { return setAttributes({ loginSubmitLabel: value.trim() }); }, onReplace: function onReplace() { return null; }, onSplit: function onSplit() { return null; }, placeholder: __('Login…', 'advanced-gutenberg'), keepPlaceholderOnFocus: true, allowedFormats: ['core/bold', 'core/italic'] }) ) ) ), !!showLostPasswordLink && React.createElement( "div", { className: "advgb-lores-field advgb-lost-password-field" }, React.createElement( "div", { className: "advgb-lost-password" }, React.createElement(RichText, { tagName: "a", value: lostPasswordText, className: "advgb-lost-password-link", onChange: function onChange(value) { return setAttributes({ lostPasswordText: value.trim() }); }, style: { color: submitBgColor }, onReplace: function onReplace() { return null; }, onSplit: function onSplit() { return null; }, placeholder: __('Lost password…', 'advanced-gutenberg'), keepPlaceholderOnFocus: true, allowedFormats: ['core/bold', 'core/italic'] }) ) ) ) ); var registerForm = React.createElement( "div", { className: "advgb-register-form-wrapper advgb-lores-form" }, !!showRegisterLink && React.createElement( "div", { className: "advgb-header-navigation advgb-back-to-login", style: { backgroundColor: headerBgColor } }, React.createElement( "div", { className: "advgb-back-to-login-link", style: { color: submitBgColor } }, React.createElement(RichText, { tagName: "span", value: backToLoginText, className: "advgb-register-text", onChange: function onChange(value) { return setAttributes({ backToLoginText: value.trim() }); }, style: { color: submitBgColor }, onReplace: function onReplace() { return null; }, onSplit: function onSplit() { return null; }, placeholder: __('Back…', 'advanced-gutenberg'), keepPlaceholderOnFocus: true, allowedFormats: ['core/bold', 'core/italic'] }) ) ), React.createElement( "div", { className: "advgb-register-form advgb-form-inner" }, React.createElement( "div", { className: "advgb-lores-form-header" }, !!showLogo && regLogoElm, React.createElement(RichText, { tagName: "h3", value: registerWelcome, className: "advgb-lores-form-welcome", onChange: function onChange(value) { return setAttributes({ registerWelcome: value.trim() }); }, style: { color: textColor }, placeholder: __('Register…', 'advanced-gutenberg'), keepPlaceholderOnFocus: true, allowedFormats: ['core/bold', 'core/italic'] }) ), React.createElement( "div", { className: "advgb-lores-field advgb-register-username" }, React.createElement( "div", { className: "advgb-lores-field-label" }, React.createElement(RichText, { tagName: "label", value: userText, onChange: function onChange(value) { return setAttributes({ userText: value.trim() }); }, style: { color: textColor }, onReplace: function onReplace() { return null; }, onSplit: function onSplit() { return null; }, placeholder: __('Username label…', 'advanced-gutenberg'), keepPlaceholderOnFocus: true, allowedFormats: ['core/bold', 'core/italic'] }) ), React.createElement( "div", { className: "advgb-lores-field-input", style: { backgroundColor: bgColor, color: inputColor, borderBottomColor: borderColor, borderStyle: borderStyle, borderWidth: borderWidth } }, !!showInputFieldIcon && React.createElement( "span", { className: "advgb-lores-input-icon", style: { color: textColor } }, userIcon ), React.createElement("input", { type: "text", disabled: true, className: "advgb-lores-input", style: { color: inputColor }, value: usernameLabel ? usernameLabel : 'username' }) ) ), React.createElement( "div", { className: "advgb-lores-field advgb-register-email" }, React.createElement( "div", { className: "advgb-lores-field-label" }, React.createElement(RichText, { tagName: "label", value: emailText, onChange: function onChange(value) { return setAttributes({ emailText: value.trim() }); }, style: { color: textColor }, onReplace: function onReplace() { return null; }, onSplit: function onSplit() { return null; }, placeholder: __('Email label…', 'advanced-gutenberg'), keepPlaceholderOnFocus: true, allowedFormats: ['core/bold', 'core/italic'] }) ), React.createElement( "div", { className: "advgb-lores-field-input", style: { backgroundColor: bgColor, color: inputColor, borderBottomColor: borderColor, borderStyle: borderStyle, borderWidth: borderWidth } }, !!showInputFieldIcon && React.createElement( "span", { className: "advgb-lores-input-icon", style: { color: textColor } }, emailIcon ), React.createElement("input", { type: "text", disabled: true, className: "advgb-lores-input", style: { color: inputColor }, value: emailLabel ? emailLabel : '[email protected]' }) ) ), React.createElement( "div", { className: "advgb-lores-field advgb-lores-submit-wrapper advgb-submit-align-" + submitPosition }, React.createElement( "div", { className: "advgb-lores-submit advgb-register-submit" }, React.createElement( "span", { className: "advgb-lores-submit-button " + submitButtonId, style: { borderColor: submitColor, color: submitColor, backgroundColor: submitBgColor, borderRadius: submitRadius } }, React.createElement(RichText, { tagName: "span", value: registerSubmitLabel, onChange: function onChange(value) { return setAttributes({ registerSubmitLabel: value.trim() }); }, onReplace: function onReplace() { return null; }, onSplit: function onSplit() { return null; }, placeholder: __('Register…', 'advanced-gutenberg'), keepPlaceholderOnFocus: true, allowedFormats: ['core/bold', 'core/italic'] }) ) ) ) ) ); return isPreview ? React.createElement("img", { alt: __('Login/Register Form', 'advanced-gutenberg'), width: "100%", src: previewImageData }) : React.createElement( Fragment, null, React.createElement( BlockControls, null, React.createElement( ToolbarGroup, { label: __('Options', 'advanced-gutenberg') }, React.createElement(ToolbarButton, { icon: "image-flip-horizontal", label: __('Switch View', 'advanced-gutenberg'), onClick: function onClick() { return _this2.setState({ registerView: !registerView }); } }) ) ), React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Form State', 'advanced-gutenberg') }, React.createElement(SelectControl, { label: __('Initial Form', 'advanced-gutenberg'), help: __('Form that show on load.', 'advanced-gutenberg'), value: formType, options: [{ label: __('Login', 'advanced-gutenberg'), value: 'login' }, { label: __('Register', 'advanced-gutenberg'), value: 'register' }], onChange: function onChange(value) { setAttributes({ formType: value }); _this2.setState({ registerView: value === 'register' }); } }), React.createElement(SelectControl, { label: __('Redirect After Login', 'advanced-gutenberg'), value: redirect, options: [{ label: __('Home', 'advanced-gutenberg'), value: 'home' }, { label: __('Dashboard', 'advanced-gutenberg'), value: 'dashboard' }, { label: __('Custom', 'advanced-gutenberg'), value: 'custom' }], onChange: function onChange(value) { return setAttributes({ redirect: value }); } }), redirect === 'custom' && React.createElement(TextControl, { label: __('Custom redirect link', 'advanced-gutenberg'), value: redirectLink, onChange: function onChange(value) { return setAttributes({ redirectLink: value }); } }), React.createElement(RangeControl, { label: __('Form Width (px)', 'advanced-gutenberg'), value: formWidth, onChange: function onChange(value) { return setAttributes({ formWidth: value }); }, min: 300, max: 1500 }), React.createElement(ToggleControl, { label: __('Show Logo', 'advanced-gutenberg'), checked: !!showLogo, onChange: function onChange() { return setAttributes({ showLogo: !showLogo }); } }), !!showLogo && React.createElement(RangeControl, { label: __('Logo Width (px)', 'advanced-gutenberg'), value: logoWidth, onChange: function onChange(value) { return setAttributes({ logoWidth: value }); }, min: 100, max: 1500 }), React.createElement(ToggleControl, { label: __('Show input field icon', 'advanced-gutenberg'), checked: !!showInputFieldIcon, onChange: function onChange() { return setAttributes({ showInputFieldIcon: !showInputFieldIcon }); } }), React.createElement(ToggleControl, { label: __('Show register/header link', 'advanced-gutenberg'), checked: !!showRegisterLink, onChange: function onChange() { return setAttributes({ showRegisterLink: !showRegisterLink }); } }), !!showRegisterLink && React.createElement(PanelColorSettings, { title: __('Header Color', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Header color', 'advanced-gutenberg'), value: headerBgColor, onChange: function onChange(value) { return setAttributes({ headerBgColor: value }); } }] }), React.createElement(ToggleControl, { label: __('Show lost password link', 'advanced-gutenberg'), checked: !!showLostPasswordLink, onChange: function onChange() { return setAttributes({ showLostPasswordLink: !showLostPasswordLink }); } }) ), React.createElement( PanelBody, { title: __('Input placeholder', 'advanced-gutenberg'), initialOpen: false }, React.createElement(TextControl, { label: __('Login input placeholder', 'advanced-gutenberg'), value: loginLabel, onChange: function onChange(value) { return setAttributes({ loginLabel: value }); } }), React.createElement(TextControl, { label: __('Username input placeholder', 'advanced-gutenberg'), help: __('Use in register form', 'advanced-gutenberg'), value: usernameLabel, onChange: function onChange(value) { return setAttributes({ usernameLabel: value }); } }), React.createElement(TextControl, { label: __('Email input placeholder', 'advanced-gutenberg'), help: __('Use in register form', 'advanced-gutenberg'), value: emailLabel, onChange: function onChange(value) { return setAttributes({ emailLabel: value }); } }) ), React.createElement(PanelColorSettings, { title: __('Text/Input Color', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Input background color', 'advanced-gutenberg'), value: bgColor, onChange: function onChange(value) { return setAttributes({ bgColor: value }); } }, { label: __('Input color', 'advanced-gutenberg'), value: inputColor, onChange: function onChange(value) { return setAttributes({ inputColor: value }); } }, { label: __('Text color', 'advanced-gutenberg'), value: textColor, onChange: function onChange(value) { return setAttributes({ textColor: value }); } }] }), React.createElement( PanelBody, { title: __('Border Settings', 'advanced-gutenberg'), initialOpen: false }, React.createElement(PanelColorSettings, { title: __('Border Color', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Border color', 'advanced-gutenberg'), value: borderColor, onChange: function onChange(value) { return setAttributes({ borderColor: value }); } }] }), React.createElement(SelectControl, { label: __('Border Style', 'advanced-gutenberg'), value: borderStyle, options: [{ label: __('Solid', 'advanced-gutenberg'), value: 'solid' }, { label: __('Dashed', 'advanced-gutenberg'), value: 'dashed' }, { label: __('Dotted', 'advanced-gutenberg'), value: 'dotted' }], onChange: function onChange(value) { return setAttributes({ borderStyle: value }); } }), React.createElement(RangeControl, { label: __('Border width', 'advanced-gutenberg'), value: borderWidth, onChange: function onChange(value) { return setAttributes({ borderWidth: value }); }, min: 0, max: 10 }) ), React.createElement( PanelBody, { title: __('Submit Button Settings', 'advanced-gutenberg') }, React.createElement(_components.AdvColorControl, { label: __('Border and Text', 'advanced-gutenberg'), value: submitColor, onChange: function onChange(value) { return setAttributes({ submitColor: value }); } }), React.createElement(_components.AdvColorControl, { label: __('Background', 'advanced-gutenberg'), value: submitBgColor, onChange: function onChange(value) { return setAttributes({ submitBgColor: value }); } }), React.createElement(RangeControl, { label: __('Button border radius', 'advanced-gutenberg'), value: submitRadius, onChange: function onChange(value) { return setAttributes({ submitRadius: value }); }, min: 0, max: 50 }), React.createElement(SelectControl, { label: __('Button position', 'advanced-gutenberg'), value: submitPosition, options: [{ label: __('Center', 'advanced-gutenberg'), value: 'center' }, { label: __('Left', 'advanced-gutenberg'), value: 'left' }, { label: __('Right', 'advanced-gutenberg'), value: 'right' }], onChange: function onChange(value) { return setAttributes({ submitPosition: value }); } }) ), React.createElement( PanelBody, { title: __('Submit Button Hover', 'advanced-gutenberg'), initialOpen: false }, React.createElement(PanelColorSettings, { title: __('Hover Colors', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Background color', 'advanced-gutenberg'), value: submitHoverBgColor, onChange: function onChange(value) { return setAttributes({ submitHoverBgColor: value }); } }, { label: __('Text color', 'advanced-gutenberg'), value: submitHoverColor, onChange: function onChange(value) { return setAttributes({ submitHoverColor: value }); } }, { label: __('Shadow color', 'advanced-gutenberg'), value: submitHoverShadow, onChange: function onChange(value) { return setAttributes({ submitHoverShadow: value }); } }] }), React.createElement( PanelBody, { title: __('Shadow', 'advanced-gutenberg'), initialOpen: false }, React.createElement(RangeControl, { label: __('Opacity (%)', 'advanced-gutenberg'), value: submitHoverOpacity, onChange: function onChange(value) { return setAttributes({ submitHoverOpacity: value }); }, min: 0, max: 100 }), React.createElement(RangeControl, { label: __('Transition speed (ms)', 'advanced-gutenberg'), value: submitHoverTranSpeed || '', onChange: function onChange(value) { return setAttributes({ submitHoverTranSpeed: value }); }, min: 0, max: 3000 }), React.createElement(RangeControl, { label: __('Shadow H offset', 'advanced-gutenberg'), value: submitHoverShadowH || '', onChange: function onChange(value) { return setAttributes({ submitHoverShadowH: value }); }, min: -50, max: 50 }), React.createElement(RangeControl, { label: __('Shadow V offset', 'advanced-gutenberg'), value: submitHoverShadowV || '', onChange: function onChange(value) { return setAttributes({ submitHoverShadowV: value }); }, min: -50, max: 50 }), React.createElement(RangeControl, { label: __('Shadow blur', 'advanced-gutenberg'), value: submitHoverShadowBlur || '', onChange: function onChange(value) { return setAttributes({ submitHoverShadowBlur: value }); }, min: 0, max: 50 }), React.createElement(RangeControl, { label: __('Shadow spread', 'advanced-gutenberg'), value: submitHoverShadowSpread || '', onChange: function onChange(value) { return setAttributes({ submitHoverShadowSpread: value }); }, min: 0, max: 50 }) ) ), typeof advgbBlocks !== 'undefined' && !parseInt(advgbBlocks.captchaEnabled) && React.createElement( PanelBody, { title: __('Notice', 'advanced-gutenberg') }, React.createElement( "p", { style: { fontStyle: 'italic' } }, __('We strongly recommend to enable Google reCAPTCHA to avoid spam.', 'advanced-gutenberg'), React.createElement("br", null), React.createElement( "a", { href: advgbBlocks.config_url + '&tab=recaptcha', target: "_blank" }, __('You can enable it in Settings', 'advanced-gutenberg') ) ) ) ), React.createElement( "div", { className: "advgb-lores-form-wrapper", style: { width: formWidth } }, !registerView ? loginForm : typeof advgbBlocks !== 'undefined' && !parseInt(advgbBlocks.registerEnabled) ? React.createElement(Placeholder, { icon: userIcon, label: __('Registration Form', 'advanced-gutenberg'), instructions: __('Registration for your website is currently disabled, enable it in WordPress General settings to use registration form', 'advanced-gutenberg') }) : registerForm, React.createElement( "style", null, "." + submitButtonId + ":hover {\n color: " + submitHoverColor + " !important;\n background-color: " + submitHoverBgColor + " !important;\n box-shadow: " + submitHoverShadowH + "px " + submitHoverShadowV + "px " + submitHoverShadowBlur + "px " + submitHoverShadowSpread + "px " + submitHoverShadow + ";\n transition: all " + submitHoverTranSpeed + "s ease;\n opacity: " + submitHoverOpacity / 100 + "\n }" ) ) ); } }]); return LoginFormEdit; }(Component); var loginFormBlockIcon = React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "2 2 22 22" }, React.createElement("path", { fill: "none", d: "M0 0h24v24H0V0z" }), React.createElement("path", { d: "M11 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zM5 18c.2-.63 2.57-1.68 4.96-1.94l2.04-2c-.39-.04-.68-.06-1-.06-2.67 0-8 1.34-8 4v2h9l-2-2H5zm15.6-5.5l-5.13 5.17-2.07-2.08L12 17l3.47 3.5L22 13.91z" }) ); var blockAttrs = { formType: { type: 'string', default: 'login' }, formWidth: { type: 'number', default: 500 }, redirect: { type: 'string', default: 'home' }, redirectLink: { type: 'string' }, showLogo: { type: 'boolean', default: true }, showInputFieldIcon: { type: 'boolean', default: true }, showRegisterLink: { type: 'boolean', default: true }, showLostPasswordLink: { type: 'boolean', default: true }, logoImg: { type: 'string', default: advgbBlocks.login_logo }, logoID: { type: 'number' }, registerLogoImg: { type: 'string', default: advgbBlocks.reg_logo }, registerLogoID: { type: 'number' }, logoWidth: { type: 'number', default: 150 }, welcomeText: { type: 'string', default: 'Welcome back' }, loginLabel: { type: 'string' }, loginText: { type: 'string', default: 'Username or Email' }, passwordText: { type: 'string', default: 'Password' }, usernameLabel: { type: 'string' }, userText: { type: 'string', default: 'Username' }, emailLabel: { type: 'string' }, emailText: { type: 'string', default: 'Email' }, rememberMeText: { type: 'string', default: 'Remember me' }, loginSubmitLabel: { type: 'string', default: 'LOGIN' }, registerSubmitLabel: { type: 'string', default: 'REGISTER' }, registerText: { type: 'string', default: "Don't have an account?" }, registerLinkText: { type: 'string', default: 'Register now' }, registerWelcome: { type: 'string', default: 'Register new account' }, backToLoginText: { type: 'string', default: 'Login' }, lostPasswordText: { type: 'string', default: 'Lost your password?' }, headerBgColor: { type: 'string' }, bgColor: { type: 'string' }, textColor: { type: 'string' }, inputColor: { type: 'string' }, borderStyle: { type: 'string' }, borderColor: { type: 'string' }, borderWidth: { type: 'number' }, submitButtonId: { type: 'string' }, submitColor: { type: 'string' }, submitBgColor: { type: 'string' }, submitRadius: { type: 'number' }, submitPosition: { type: 'string', default: 'right' }, submitHoverColor: { type: 'string' }, submitHoverBgColor: { type: 'string' }, submitHoverShadow: { type: 'string' }, submitHoverShadowH: { type: 'number', default: 1 }, submitHoverShadowV: { type: 'number', default: 1 }, submitHoverShadowBlur: { type: 'number', default: 12 }, submitHoverShadowSpread: { type: 'number', default: 0 }, submitHoverOpacity: { type: 'number', default: 100 }, submitHoverTranSpeed: { type: 'number', default: 200 }, changed: { type: 'boolean', default: false }, isPreview: { type: 'boolean', default: false } }; registerBlockType('advgb/login-form', { title: __('Login and Register - PublishPress', 'advanced-gutenberg'), description: __('Create a login form for your post/page.', 'advanced-gutenberg'), icon: { src: loginFormBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('accordion', 'advanced-gutenberg'), __('list', 'advanced-gutenberg'), __('faq', 'advanced-gutenberg')], attributes: blockAttrs, example: { attributes: { isPreview: true } }, supports: { anchor: true }, edit: LoginFormEdit, save: function save(_ref3) { var attributes = _ref3.attributes; var formType = attributes.formType, formWidth = attributes.formWidth, redirect = attributes.redirect, redirectLink = attributes.redirectLink, showLogo = attributes.showLogo, showInputFieldIcon = attributes.showInputFieldIcon, showRegisterLink = attributes.showRegisterLink, showLostPasswordLink = attributes.showLostPasswordLink, logoImg = attributes.logoImg, registerLogoImg = attributes.registerLogoImg, logoWidth = attributes.logoWidth, welcomeText = attributes.welcomeText, loginLabel = attributes.loginLabel, loginText = attributes.loginText, passwordText = attributes.passwordText, usernameLabel = attributes.usernameLabel, userText = attributes.userText, emailLabel = attributes.emailLabel, emailText = attributes.emailText, rememberMeText = attributes.rememberMeText, loginSubmitLabel = attributes.loginSubmitLabel, registerSubmitLabel = attributes.registerSubmitLabel, registerText = attributes.registerText, registerLinkText = attributes.registerLinkText, registerWelcome = attributes.registerWelcome, backToLoginText = attributes.backToLoginText, lostPasswordText = attributes.lostPasswordText, headerBgColor = attributes.headerBgColor, bgColor = attributes.bgColor, textColor = attributes.textColor, inputColor = attributes.inputColor, borderColor = attributes.borderColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, submitColor = attributes.submitColor, submitBgColor = attributes.submitBgColor, submitRadius = attributes.submitRadius, submitPosition = attributes.submitPosition, submitButtonId = attributes.submitButtonId; var logoElmSave = React.createElement( "div", { className: "advgb-lores-form-logo-wrapper" }, React.createElement( "span", { style: { display: 'block' } }, React.createElement("img", { className: "advgb-lores-form-logo", src: logoImg, alt: 'Site logo', style: { width: logoWidth ? logoWidth + 'px' : undefined, cursor: 'pointer' } }) ) ); var regLogoElmSave = React.createElement( "div", { className: "advgb-lores-form-logo-wrapper" }, React.createElement( "span", { style: { display: 'block' } }, React.createElement("img", { className: "advgb-lores-form-logo", src: registerLogoImg, alt: 'Site logo', style: { width: logoWidth ? logoWidth + 'px' : undefined, cursor: 'pointer' } }) ) ); var loginFormSave = React.createElement( "div", { className: "advgb-login-form-wrapper advgb-lores-form", style: { display: formType === 'login' ? 'block' : 'none' } }, !!showRegisterLink && React.createElement( "div", { className: "advgb-register-link-wrapper advgb-header-navigation", style: { backgroundColor: headerBgColor } }, React.createElement(RichText.Content, { tagName: "span", className: "advgb-register-text", value: registerText, style: { color: textColor } }), React.createElement(RichText.Content, { tagName: "a", href: "#", className: "advgb-register-link", value: registerLinkText, style: { color: submitBgColor } }) ), React.createElement( "form", { action: "", className: "advgb-form-login", method: "post" }, React.createElement( "div", { className: "advgb-login-form advgb-form-inner" }, React.createElement( "div", { className: "advgb-lores-form-header" }, !!showLogo && logoElmSave, React.createElement(RichText.Content, { tagName: "h3", className: "advgb-lores-form-welcome", value: welcomeText, style: { color: textColor } }) ), React.createElement( "div", { className: "advgb-lores-field advgb-login-user", style: { borderColor: textColor } }, React.createElement( "div", { className: "advgb-lores-field-label" }, React.createElement(RichText.Content, { tagName: "label", htmlFor: "advgb-login-user", value: loginText, style: { color: textColor } }) ), React.createElement( "div", { className: "advgb-lores-field-input", style: { backgroundColor: bgColor, color: inputColor, borderBottomColor: borderColor, borderStyle: borderStyle, borderWidth: borderWidth } }, !!showInputFieldIcon && React.createElement( "span", { className: "advgb-lores-input-icon", style: { color: textColor } }, emailIcon ), React.createElement("input", { type: "text", id: "advgb-login-user", className: "advgb-lores-input", name: "log", style: { color: inputColor }, placeholder: loginLabel ? loginLabel : '[email protected]' }) ) ), React.createElement( "div", { className: "advgb-lores-field advgb-login-password", style: { borderColor: textColor } }, React.createElement( "div", { className: "advgb-lores-field-label" }, React.createElement(RichText.Content, { tagName: "label", htmlFor: "advgb-login-password", value: passwordText, style: { color: textColor } }) ), React.createElement( "div", { className: "advgb-lores-field-input", style: { backgroundColor: bgColor, color: inputColor, borderBottomColor: borderColor, borderStyle: borderStyle, borderWidth: borderWidth } }, !!showInputFieldIcon && React.createElement( "span", { className: "advgb-lores-input-icon", style: { color: textColor } }, passwordIcon ), React.createElement("input", { type: "password", id: "advgb-login-password", className: "advgb-lores-input", name: "pwd", style: { color: inputColor }, placeholder: "password" }) ) ), React.createElement("div", { className: "advgb-grecaptcha clearfix position-" + submitPosition }), React.createElement( "div", { className: "advgb-lores-field advgb-lores-submit-wrapper advgb-submit-align-" + submitPosition }, React.createElement( "label", { htmlFor: "rememberme", className: "remember-me-label" }, React.createElement("input", { type: "checkbox", value: "forever", id: "rememberme", name: "rememberme", className: "advgb-lores-checkbox" }), React.createElement( "div", { style: { color: submitBgColor }, className: "remember-me-switch" }, React.createElement(RichText.Content, { tagName: "span", style: { color: textColor }, value: rememberMeText }) ) ), React.createElement( "div", { className: "advgb-lores-submit advgb-login-submit" }, React.createElement(RichText.Content, { tagName: "button", value: loginSubmitLabel, className: "advgb-lores-submit-button " + submitButtonId, type: "submit", name: "wp-submit", style: { borderColor: submitColor, color: submitColor, backgroundColor: submitBgColor, borderRadius: submitRadius } }), React.createElement("input", { type: "hidden", name: "redirect_to", "data-redirect": redirect, className: "redirect_to", value: redirectLink }), React.createElement("input", { type: "hidden", name: "testcookie", value: "1" }), React.createElement("input", { type: "hidden", name: "advgb_login_form", value: "1" }) ) ), !!showLostPasswordLink && React.createElement( "div", { className: "advgb-lores-field advgb-lost-password-field" }, React.createElement( "div", { className: "advgb-lost-password" }, React.createElement(RichText.Content, { tagName: "a", href: "#", className: "advgb-lost-password", style: { color: submitBgColor }, value: lostPasswordText }) ) ) ) ) ); var registerFormSave = React.createElement( "div", { className: "advgb-register-form-wrapper advgb-lores-form", style: { display: formType === 'register' ? 'block' : 'none' } }, !!showRegisterLink && React.createElement( "div", { className: "advgb-header-navigation advgb-back-to-login", style: { backgroundColor: headerBgColor } }, React.createElement( "div", { className: "advgb-back-to-login-link", style: { color: submitBgColor } }, React.createElement(RichText.Content, { tagName: "span", className: "advgb-register-text", style: { color: submitBgColor }, value: backToLoginText }) ) ), React.createElement( "form", { action: "", className: "advgb-form-register", method: "post" }, React.createElement( "div", { className: "advgb-register-form advgb-form-inner" }, React.createElement( "div", { className: "advgb-lores-form-header" }, !!showLogo && regLogoElmSave, React.createElement(RichText.Content, { tagName: "h3", className: "advgb-lores-form-welcome", style: { color: textColor }, value: registerWelcome }) ), React.createElement( "div", { className: "advgb-lores-field advgb-register-username", style: { borderColor: textColor } }, React.createElement( "div", { className: "advgb-lores-field-label" }, React.createElement(RichText.Content, { tagName: "label", htmlFor: "advgb-register-username", style: { color: textColor }, value: userText }) ), React.createElement( "div", { className: "advgb-lores-field-input", style: { backgroundColor: bgColor, color: inputColor, borderBottomColor: borderColor, borderStyle: borderStyle, borderWidth: borderWidth } }, !!showInputFieldIcon && React.createElement( "span", { className: "advgb-lores-input-icon", style: { color: textColor } }, userIcon ), React.createElement("input", { type: "text", id: "advgb-register-username", className: "advgb-lores-input", name: "user_login", style: { color: inputColor }, placeholder: usernameLabel ? usernameLabel : 'username' }) ) ), React.createElement( "div", { className: "advgb-lores-field advgb-register-email", style: { borderColor: textColor } }, React.createElement( "div", { className: "advgb-lores-field-label" }, React.createElement(RichText.Content, { tagName: "label", htmlFor: "advgb-register-email", style: { color: textColor }, value: emailText }) ), React.createElement( "div", { className: "advgb-lores-field-input", style: { backgroundColor: bgColor, color: inputColor, borderBottomColor: borderColor, borderStyle: borderStyle, borderWidth: borderWidth } }, !!showInputFieldIcon && React.createElement( "span", { className: "advgb-lores-input-icon", style: { color: textColor } }, emailIcon ), React.createElement("input", { type: "email", id: "advgb-register-email", className: "advgb-lores-input", name: "user_email", style: { color: inputColor }, placeholder: emailLabel ? emailLabel : '[email protected]' }) ) ), React.createElement("div", { className: "advgb-grecaptcha clearfix position-" + submitPosition }), React.createElement( "div", { className: "advgb-lores-field advgb-lores-submit-wrapper advgb-submit-align-" + submitPosition }, React.createElement( "div", { className: "advgb-lores-submit advgb-register-submit" }, React.createElement(RichText.Content, { tagName: "button", value: registerSubmitLabel, className: "advgb-lores-submit-button " + submitButtonId, type: "submit", name: "wp-submit", style: { borderColor: submitColor, color: submitColor, backgroundColor: submitBgColor, borderRadius: submitRadius } }) ) ) ) ) ); return React.createElement( "div", { className: "advgb-lores-form-wrapper", style: { width: formWidth } }, loginFormSave, registerFormSave ); } }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/map/block.jsx": /*!*****************************************!*\ !*** ./src/assets/blocks/map/block.jsx ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, MediaUpload = _wpBlockEditor.MediaUpload; var PanelBody = wpComponents.PanelBody, TextControl = wpComponents.TextControl, TextareaControl = wpComponents.TextareaControl, RangeControl = wpComponents.RangeControl, SelectControl = wpComponents.SelectControl, ToggleControl = wpComponents.ToggleControl, BaseControl = wpComponents.BaseControl, Button = wpComponents.Button, Placeholder = wpComponents.Placeholder, Spinner = wpComponents.Spinner; var mapWillUpdate = null; var mapBlockIcon = React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "2 2 22 22", className: "dashicon" }, React.createElement("path", { d: "M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM15 19l-6-2.11V5l6 2.11V19z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ); var MAP_STYLES = { silver: [{ "elementType": "geometry", "stylers": [{ "color": "#f5f5f5" }] }, { "elementType": "labels.icon", "stylers": [{ "visibility": "off" }] }, { "elementType": "labels.text.fill", "stylers": [{ "color": "#616161" }] }, { "elementType": "labels.text.stroke", "stylers": [{ "color": "#f5f5f5" }] }, { "featureType": "administrative.land_parcel", "elementType": "labels.text.fill", "stylers": [{ "color": "#bdbdbd" }] }, { "featureType": "poi", "elementType": "geometry", "stylers": [{ "color": "#eeeeee" }] }, { "featureType": "poi", "elementType": "labels.text.fill", "stylers": [{ "color": "#757575" }] }, { "featureType": "poi.park", "elementType": "geometry", "stylers": [{ "color": "#e5e5e5" }] }, { "featureType": "poi.park", "elementType": "labels.text.fill", "stylers": [{ "color": "#9e9e9e" }] }, { "featureType": "road", "elementType": "geometry", "stylers": [{ "color": "#ffffff" }] }, { "featureType": "road.arterial", "elementType": "labels.text.fill", "stylers": [{ "color": "#757575" }] }, { "featureType": "road.highway", "elementType": "geometry", "stylers": [{ "color": "#dadada" }] }, { "featureType": "road.highway", "elementType": "labels.text.fill", "stylers": [{ "color": "#616161" }] }, { "featureType": "road.local", "elementType": "labels.text.fill", "stylers": [{ "color": "#9e9e9e" }] }, { "featureType": "transit.line", "elementType": "geometry", "stylers": [{ "color": "#e5e5e5" }] }, { "featureType": "transit.station", "elementType": "geometry", "stylers": [{ "color": "#eeeeee" }] }, { "featureType": "water", "elementType": "geometry", "stylers": [{ "color": "#c9c9c9" }] }, { "featureType": "water", "elementType": "labels.text.fill", "stylers": [{ "color": "#9e9e9e" }] }], retro: [{ "elementType": "geometry", "stylers": [{ "color": "#ebe3cd" }] }, { "elementType": "labels.text.fill", "stylers": [{ "color": "#523735" }] }, { "elementType": "labels.text.stroke", "stylers": [{ "color": "#f5f1e6" }] }, { "featureType": "administrative", "elementType": "geometry.stroke", "stylers": [{ "color": "#c9b2a6" }] }, { "featureType": "administrative.land_parcel", "elementType": "geometry.stroke", "stylers": [{ "color": "#dcd2be" }] }, { "featureType": "administrative.land_parcel", "elementType": "labels.text.fill", "stylers": [{ "color": "#ae9e90" }] }, { "featureType": "landscape.natural", "elementType": "geometry", "stylers": [{ "color": "#dfd2ae" }] }, { "featureType": "poi", "elementType": "geometry", "stylers": [{ "color": "#dfd2ae" }] }, { "featureType": "poi", "elementType": "labels.text.fill", "stylers": [{ "color": "#93817c" }] }, { "featureType": "poi.park", "elementType": "geometry.fill", "stylers": [{ "color": "#a5b076" }] }, { "featureType": "poi.park", "elementType": "labels.text.fill", "stylers": [{ "color": "#447530" }] }, { "featureType": "road", "elementType": "geometry", "stylers": [{ "color": "#f5f1e6" }] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers": [{ "color": "#fdfcf8" }] }, { "featureType": "road.highway", "elementType": "geometry", "stylers": [{ "color": "#f8c967" }] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [{ "color": "#e9bc62" }] }, { "featureType": "road.highway.controlled_access", "elementType": "geometry", "stylers": [{ "color": "#e98d58" }] }, { "featureType": "road.highway.controlled_access", "elementType": "geometry.stroke", "stylers": [{ "color": "#db8555" }] }, { "featureType": "road.local", "elementType": "labels.text.fill", "stylers": [{ "color": "#806b63" }] }, { "featureType": "transit.line", "elementType": "geometry", "stylers": [{ "color": "#dfd2ae" }] }, { "featureType": "transit.line", "elementType": "labels.text.fill", "stylers": [{ "color": "#8f7d77" }] }, { "featureType": "transit.line", "elementType": "labels.text.stroke", "stylers": [{ "color": "#ebe3cd" }] }, { "featureType": "transit.station", "elementType": "geometry", "stylers": [{ "color": "#dfd2ae" }] }, { "featureType": "water", "elementType": "geometry.fill", "stylers": [{ "color": "#b9d3c2" }] }, { "featureType": "water", "elementType": "labels.text.fill", "stylers": [{ "color": "#92998d" }] }], dark: [{ "elementType": "geometry", "stylers": [{ "color": "#212121" }] }, { "elementType": "labels.icon", "stylers": [{ "visibility": "off" }] }, { "elementType": "labels.text.fill", "stylers": [{ "color": "#757575" }] }, { "elementType": "labels.text.stroke", "stylers": [{ "color": "#212121" }] }, { "featureType": "administrative", "elementType": "geometry", "stylers": [{ "color": "#757575" }] }, { "featureType": "administrative.country", "elementType": "labels.text.fill", "stylers": [{ "color": "#9e9e9e" }] }, { "featureType": "administrative.land_parcel", "stylers": [{ "visibility": "off" }] }, { "featureType": "administrative.locality", "elementType": "labels.text.fill", "stylers": [{ "color": "#bdbdbd" }] }, { "featureType": "poi", "elementType": "labels.text.fill", "stylers": [{ "color": "#757575" }] }, { "featureType": "poi.park", "elementType": "geometry", "stylers": [{ "color": "#181818" }] }, { "featureType": "poi.park", "elementType": "labels.text.fill", "stylers": [{ "color": "#616161" }] }, { "featureType": "poi.park", "elementType": "labels.text.stroke", "stylers": [{ "color": "#1b1b1b" }] }, { "featureType": "road", "elementType": "geometry.fill", "stylers": [{ "color": "#2c2c2c" }] }, { "featureType": "road", "elementType": "labels.text.fill", "stylers": [{ "color": "#8a8a8a" }] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers": [{ "color": "#373737" }] }, { "featureType": "road.highway", "elementType": "geometry", "stylers": [{ "color": "#3c3c3c" }] }, { "featureType": "road.highway.controlled_access", "elementType": "geometry", "stylers": [{ "color": "#4e4e4e" }] }, { "featureType": "road.local", "elementType": "labels.text.fill", "stylers": [{ "color": "#616161" }] }, { "featureType": "transit", "elementType": "labels.text.fill", "stylers": [{ "color": "#757575" }] }, { "featureType": "water", "elementType": "geometry", "stylers": [{ "color": "#000000" }] }, { "featureType": "water", "elementType": "labels.text.fill", "stylers": [{ "color": "#3d3d3d" }] }], night: [{ "elementType": "geometry", "stylers": [{ "color": "#242f3e" }] }, { "elementType": "labels.text.fill", "stylers": [{ "color": "#746855" }] }, { "elementType": "labels.text.stroke", "stylers": [{ "color": "#242f3e" }] }, { "featureType": "administrative.locality", "elementType": "labels.text.fill", "stylers": [{ "color": "#d59563" }] }, { "featureType": "poi", "elementType": "labels.text.fill", "stylers": [{ "color": "#d59563" }] }, { "featureType": "poi.park", "elementType": "geometry", "stylers": [{ "color": "#263c3f" }] }, { "featureType": "poi.park", "elementType": "labels.text.fill", "stylers": [{ "color": "#6b9a76" }] }, { "featureType": "road", "elementType": "geometry", "stylers": [{ "color": "#38414e" }] }, { "featureType": "road", "elementType": "geometry.stroke", "stylers": [{ "color": "#212a37" }] }, { "featureType": "road", "elementType": "labels.text.fill", "stylers": [{ "color": "#9ca5b3" }] }, { "featureType": "road.highway", "elementType": "geometry", "stylers": [{ "color": "#746855" }] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [{ "color": "#1f2835" }] }, { "featureType": "road.highway", "elementType": "labels.text.fill", "stylers": [{ "color": "#f3d19c" }] }, { "featureType": "transit", "elementType": "geometry", "stylers": [{ "color": "#2f3948" }] }, { "featureType": "transit.station", "elementType": "labels.text.fill", "stylers": [{ "color": "#d59563" }] }, { "featureType": "water", "elementType": "geometry", "stylers": [{ "color": "#17263c" }] }, { "featureType": "water", "elementType": "labels.text.fill", "stylers": [{ "color": "#515c6d" }] }, { "featureType": "water", "elementType": "labels.text.stroke", "stylers": [{ "color": "#17263c" }] }], aubergine: [{ "elementType": "geometry", "stylers": [{ "color": "#1d2c4d" }] }, { "elementType": "labels.text.fill", "stylers": [{ "color": "#8ec3b9" }] }, { "elementType": "labels.text.stroke", "stylers": [{ "color": "#1a3646" }] }, { "featureType": "administrative.country", "elementType": "geometry.stroke", "stylers": [{ "color": "#4b6878" }] }, { "featureType": "administrative.land_parcel", "elementType": "labels.text.fill", "stylers": [{ "color": "#64779e" }] }, { "featureType": "administrative.province", "elementType": "geometry.stroke", "stylers": [{ "color": "#4b6878" }] }, { "featureType": "landscape.man_made", "elementType": "geometry.stroke", "stylers": [{ "color": "#334e87" }] }, { "featureType": "landscape.natural", "elementType": "geometry", "stylers": [{ "color": "#023e58" }] }, { "featureType": "poi", "elementType": "geometry", "stylers": [{ "color": "#283d6a" }] }, { "featureType": "poi", "elementType": "labels.text.fill", "stylers": [{ "color": "#6f9ba5" }] }, { "featureType": "poi", "elementType": "labels.text.stroke", "stylers": [{ "color": "#1d2c4d" }] }, { "featureType": "poi.park", "elementType": "geometry.fill", "stylers": [{ "color": "#023e58" }] }, { "featureType": "poi.park", "elementType": "labels.text.fill", "stylers": [{ "color": "#3C7680" }] }, { "featureType": "road", "elementType": "geometry", "stylers": [{ "color": "#304a7d" }] }, { "featureType": "road", "elementType": "labels.text.fill", "stylers": [{ "color": "#98a5be" }] }, { "featureType": "road", "elementType": "labels.text.stroke", "stylers": [{ "color": "#1d2c4d" }] }, { "featureType": "road.highway", "elementType": "geometry", "stylers": [{ "color": "#2c6675" }] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [{ "color": "#255763" }] }, { "featureType": "road.highway", "elementType": "labels.text.fill", "stylers": [{ "color": "#b0d5ce" }] }, { "featureType": "road.highway", "elementType": "labels.text.stroke", "stylers": [{ "color": "#023e58" }] }, { "featureType": "transit", "elementType": "labels.text.fill", "stylers": [{ "color": "#98a5be" }] }, { "featureType": "transit", "elementType": "labels.text.stroke", "stylers": [{ "color": "#1d2c4d" }] }, { "featureType": "transit.line", "elementType": "geometry.fill", "stylers": [{ "color": "#283d6a" }] }, { "featureType": "transit.station", "elementType": "geometry", "stylers": [{ "color": "#3a4762" }] }, { "featureType": "water", "elementType": "geometry", "stylers": [{ "color": "#0e1626" }] }, { "featureType": "water", "elementType": "labels.text.fill", "stylers": [{ "color": "#4e6d70" }] }] }; var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD8CAYAAABetbkgAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAANOZJREFUeNrsfUuMJNl1XWRmfTqrurqqf1PTX45kwDMCCa482tgLesiFCIIwvCDgBcUxuPJQlO2FaQsUuTMswCANiyDgLWUJXhCQx6a5MCCRgOmNSXlhUgA1NilAnJnu6Z6enu7qqu76ZGWm47yMk33z5XsR70VEZmVU3TPIya6qzPi8eOf+3n33JolCoVAoFAqFQqFQKBQKhUKhUCgUCoVCoVAoFAqFQqFQKBQKhUKhUCgUCoVCoVAoFHWjdRInXVpaOrFzKxSLhOPj42GjiZ6ROeQcSnjFWcQw5O+pIFhMoju0dSvnfEpyhZJ9+uep31clfGsOBPe9K9EVSnQ/yV2kL0341gxILt9bjp9VsyuU4H5NPnT8PPGZMmRvzYDkoS8lukKJPk3wolcpsrdmSPK29S7/neRod4XiLJHdR+iB9V6J7EszIHmbr49+9KNLb7755t/d3t7+7Llz536r3W5/JPubQqEAW4fDRwcHB//j8ePHf/aNb3zje9/61rd2M3K3svdEvEsh0UqKI/fVNXpK9FySf+1rX7vwla985Wvdbvf1Vqt1Xh+pQpGPo6OjH/34xz/++muvvfaXGbn72bt8TWj3UK3eKkly+d22RfLOyy+/vJRe8B+sr6+/oY9PoQhHStxffP/73//C5z73uf8niC7fpTkf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qFQKBQKhWK2+P8CDADnrohUaZrGeAAAAABJRU5ErkJggg=='; var AdvMap = function (_Component) { _inherits(AdvMap, _Component); function AdvMap() { _classCallCheck(this, AdvMap); var _this = _possibleConstructorReturn(this, (AdvMap.__proto__ || Object.getPrototypeOf(AdvMap)).apply(this, arguments)); _this.state = { currentAddress: '', currentMap: null, currentMarker: null, currentInfo: null, fetching: false, invalidStyle: false }; _this.initMap = _this.initMap.bind(_this); _this.fetchLocation = _this.fetchLocation.bind(_this); return _this; } _createClass(AdvMap, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-map']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === "undefined" ? "undefined" : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: "componentDidMount", value: function componentDidMount() { var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes, clientId = _props2.clientId; if (!attributes.mapID) { setAttributes({ mapID: 'advgbmap-' + clientId }); } this.initMap(); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps, prevState) { var _prevProps$attributes = prevProps.attributes, prevAddr = _prevProps$attributes.address, prevUseLatLng = _prevProps$attributes.useLatLng; var _props$attributes = this.props.attributes, address = _props$attributes.address, useLatLng = _props$attributes.useLatLng; if (prevAddr !== address || prevUseLatLng !== useLatLng || prevState !== this.state) return null; if (prevProps.attributes !== this.props.attributes) { clearTimeout(mapWillUpdate); mapWillUpdate = setTimeout(this.initMap, 1000); } } }, { key: "initMap", value: function initMap() { if (typeof google === "undefined" || !this.props.attributes.mapID) return null; var DEFAULT_MARKER = 'https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi2.png'; var _state = this.state, currentMap = _state.currentMap, currentMarker = _state.currentMarker, currentInfo = _state.currentInfo, invalidStyle = _state.invalidStyle; var _props$attributes2 = this.props.attributes, mapID = _props$attributes2.mapID, lat = _props$attributes2.lat, lng = _props$attributes2.lng, zoom = _props$attributes2.zoom, markerTitle = _props$attributes2.markerTitle, markerIcon = _props$attributes2.markerIcon, markerDesc = _props$attributes2.markerDesc, mapStyle = _props$attributes2.mapStyle, mapStyleCustom = _props$attributes2.mapStyleCustom, infoWindowDefaultShown = _props$attributes2.infoWindowDefaultShown; var location = { lat: parseFloat(lat), lng: parseFloat(lng) }; var that = this; var formattedDesc = markerDesc.replace(/\n/g, '<br/>'); var map = currentMap; var marker = currentMarker; var infoWindow = currentInfo; var customStyleParsed = ''; if (mapStyle === 'custom') { try { customStyleParsed = JSON.parse(mapStyleCustom); if (invalidStyle) that.setState({ invalidStyle: false }); } catch (e) { that.setState({ invalidStyle: true }); } } if (!map) { map = new google.maps.Map(document.getElementById(mapID), { zoom: zoom, center: location, gestureHandling: 'cooperative' }); this.setState({ currentMap: map }); } map.setCenter(location); map.setZoom(zoom); map.setOptions({ styles: !!mapStyle ? mapStyle !== 'custom' ? MAP_STYLES[mapStyle] : customStyleParsed : undefined }); if (!infoWindow) { infoWindow = new google.maps.InfoWindow({ content: "<div class=\"advgbmap-wrapper\">\n <h3 class=\"advgbmap-title\">" + markerTitle + "</h3>\n <p class=\"advgbmap-desc\">" + (formattedDesc || '') + "</p>\n </div>", maxWidth: 500 }); this.setState({ currentInfo: infoWindow }); } infoWindow.setContent("<div class=\"advgbmap-wrapper\">\n <h3 class=\"advgbmap-title\">" + markerTitle + "</h3>\n <p class=\"advgbmap-desc\">" + (formattedDesc || '') + "</p>\n </div>"); if (!marker) { marker = new google.maps.Marker({ position: location, map: map, title: markerTitle, draggable: true, animation: google.maps.Animation.DROP, icon: { url: markerIcon || DEFAULT_MARKER, scaledSize: new google.maps.Size(27, 43) } }); this.setState({ currentMarker: marker }); } marker.setPosition(location); marker.setTitle(markerTitle); marker.setIcon({ url: markerIcon || DEFAULT_MARKER, scaledSize: new google.maps.Size(27, 43) }); if (!!markerTitle || !!markerDesc) { marker.addListener('click', function () { infoWindow.open(map, marker); }); if (infoWindowDefaultShown) { infoWindow.open(map, marker); } } else { infoWindow.close(); } marker.addListener('dragend', function () { var newLocation = marker.getPosition(); var newLat = newLocation.lat(); var newLng = newLocation.lng(); that.props.setAttributes({ lat: newLat, lng: newLng }); }); } }, { key: "fetchLocation", value: function fetchLocation() { if (typeof google === "undefined") return null; var _props3 = this.props, attributes = _props3.attributes, setAttributes = _props3.setAttributes; var address = attributes.address; var geoCoder = new google.maps.Geocoder(); var _google$maps$Geocoder = google.maps.GeocoderStatus, OK = _google$maps$Geocoder.OK, ZERO_RESULTS = _google$maps$Geocoder.ZERO_RESULTS; var that = this; if (geoCoder) { that.setState({ fetching: true }); geoCoder.geocode({ address: address }, function (res, stt) { if (stt === OK) { var location = res[0].geometry.location; setAttributes({ lat: location.lat().toString(), lng: location.lng().toString(), currentAddress: res[0].formatted_address }); } else if (stt === ZERO_RESULTS) { setAttributes({ currentAddress: __('No matching address found!', 'advanced-gutenberg') }); } else { setAttributes({ currentAddress: stt }); } that.setState({ fetching: false }); }); } } }, { key: "render", value: function render() { var _state2 = this.state, fetching = _state2.fetching, invalidStyle = _state2.invalidStyle; var _props4 = this.props, attributes = _props4.attributes, setAttributes = _props4.setAttributes; var mapID = attributes.mapID, useLatLng = attributes.useLatLng, address = attributes.address, currentAddress = attributes.currentAddress, lat = attributes.lat, lng = attributes.lng, zoom = attributes.zoom, height = attributes.height, markerIcon = attributes.markerIcon, markerIconID = attributes.markerIconID, markerTitle = attributes.markerTitle, markerDesc = attributes.markerDesc, mapStyle = attributes.mapStyle, mapStyleCustom = attributes.mapStyleCustom, infoWindowDefaultShown = attributes.infoWindowDefaultShown, isPreview = attributes.isPreview; var listStyles = Object.keys(MAP_STYLES).map(function (style) { return { label: style[0].toUpperCase() + style.slice(1), value: style }; }); return isPreview ? React.createElement("img", { alt: __('Map', 'advanced-gutenberg'), width: "100%", src: previewImageData }) : React.createElement( Fragment, null, typeof google !== 'undefined' && React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Map settings', 'advanced-gutenberg') }, !useLatLng && React.createElement( Fragment, null, React.createElement(TextControl, { label: [__('Address', 'advanced-gutenberg'), React.createElement( "a", { key: "switch-type", style: { marginLeft: '10px' }, onClick: function onClick() { return setAttributes({ useLatLng: !useLatLng }); } }, __('Use Lat/Lng', 'advanced-gutenberg') )], value: address, placeholder: __('Enter address…', 'advanced-gutenberg'), onChange: function onChange(value) { return setAttributes({ address: value }); } }), React.createElement( "div", null, React.createElement( Button, { className: "button button-large", onClick: this.fetchLocation }, __('Fetch Location', 'advanced-gutenberg') ), fetching && React.createElement(Spinner, null), React.createElement( "div", { style: { margin: '10px auto' } }, React.createElement( "strong", { style: { marginRight: '5px' } }, __('Current', 'advanced-gutenberg'), ":" ), React.createElement( "span", null, currentAddress ) ) ) ), !!useLatLng && React.createElement( Fragment, null, React.createElement(TextControl, { label: [__('Location', 'advanced-gutenberg'), React.createElement( "a", { key: "switch-type", style: { marginLeft: '10px' }, onClick: function onClick() { return setAttributes({ useLatLng: !useLatLng }); } }, __('Use Address', 'advanced-gutenberg') )], value: lat, placeholder: __('Enter latitude…', 'advanced-gutenberg'), title: __('Latitude', 'advanced-gutenberg'), onChange: function onChange(value) { return setAttributes({ lat: value }); } }), React.createElement(TextControl, { value: lng, placeholder: __('Enter longitude…', 'advanced-gutenberg'), title: __('Longitude', 'advanced-gutenberg'), onChange: function onChange(value) { return setAttributes({ lng: value }); } }) ), React.createElement(RangeControl, { label: __('Zoom level', 'advanced-gutenberg'), value: zoom, min: 0, max: 25, onChange: function onChange(value) { return setAttributes({ zoom: value }); } }), React.createElement(RangeControl, { label: __('Height', 'advanced-gutenberg'), value: height, min: 300, max: 1000, onChange: function onChange(value) { return setAttributes({ height: value }); } }), React.createElement(MediaUpload, { allowedTypes: ["image"], value: markerIconID, onSelect: function onSelect(image) { return setAttributes({ markerIcon: image.sizes.thumbnail ? image.sizes.thumbnail.url : image.sizes.full.url, markerIconID: image.id }); }, render: function render(_ref) { var open = _ref.open; return React.createElement( BaseControl, { label: [__('Marker Icon (27x43 px)', 'advanced-gutenberg'), markerIcon && React.createElement( "a", { key: "marker-icon-remove", style: { marginLeft: '10px', cursor: 'pointer' }, onClick: function onClick() { return setAttributes({ markerIcon: undefined, markerIconID: undefined }); } }, __('Remove', 'advanced-gutenberg') )] }, React.createElement( Button, { className: "button button-large", onClick: open }, __('Choose icon', 'advanced-gutenberg') ), !!markerIcon && React.createElement("img", { style: { maxHeight: '30px', marginLeft: '10px' }, src: markerIcon, alt: __('Marker icon', 'advanced-gutenberg') }) ); } }), React.createElement(TextControl, { label: __('Marker Title', 'advanced-gutenberg'), value: markerTitle, placeholder: __('Enter custom title…', 'advanced-gutenberg'), onChange: function onChange(value) { return setAttributes({ markerTitle: value }); } }), React.createElement(TextareaControl, { label: __('Marker description', 'advanced-gutenberg'), value: markerDesc, placeholder: __('Enter custom description…', 'advanced-gutenberg'), onChange: function onChange(value) { return setAttributes({ markerDesc: value }); } }), React.createElement(ToggleControl, { label: __('Open marker tooltip', 'advanced-gutenberg'), checked: infoWindowDefaultShown, onChange: function onChange() { return setAttributes({ infoWindowDefaultShown: !infoWindowDefaultShown }); } }), React.createElement(SelectControl, { label: __('Map styles', 'advanced-gutenberg'), help: __('Custom map style is recommended for experienced users only.', 'advanced-gutenberg'), value: mapStyle, onChange: function onChange(value) { return setAttributes({ mapStyle: value }); }, options: [{ label: __('Standard', 'advanced-gutenberg'), value: '' }].concat(_toConsumableArray(listStyles), [{ label: __('Custom', 'advanced-gutenberg'), value: 'custom' }]) }), mapStyle === 'custom' && React.createElement(TextareaControl, { label: [__('Custom code', 'advanced-gutenberg'), invalidStyle && React.createElement( "span", { key: "invalid-json", style: { fontWeight: 'bold', color: '#ff0000', marginLeft: 5 } }, __('Invalid JSON', 'advanced-gutenberg') )], help: [__('Paste your custom map styles in json format into the text field. You can create your own map styles by follow one of these links: ', 'advanced-gutenberg'), React.createElement( "a", { href: "https://mapstyle.withgoogle.com/", target: "_blank", key: "gg-map" }, "Google Map" ), ' - ', React.createElement( "a", { href: "https://snazzymaps.com/", target: "_blank", key: "snazzy-map" }, "Snazzy Map" )], value: mapStyleCustom, placeholder: __('Enter your json code here…', 'advanced-gutenberg'), onChange: function onChange(value) { return setAttributes({ mapStyleCustom: value }); } }) ) ), typeof google !== 'undefined' ? React.createElement( "div", { className: "advgb-map-block" }, React.createElement("div", { className: "advgb-map-content", id: mapID, style: { height: height } }) ) : React.createElement( Placeholder, { icon: mapBlockIcon, label: __('No API Key Provided!', 'advanced-gutenberg'), instructions: __('Opps! Look like you have not configured your Google API Key yet. ' + 'Add an API Key and refresh the page to start using Map Block. ' + 'This is a requirement enforced by Google.') }, React.createElement( "a", { target: "_blank", className: "button button-large", href: advgbBlocks.config_url + '&tab=maps' }, __('Add Google API Key in Settings', 'advanced-gutenberg') ) ) ); } }]); return AdvMap; }(Component); var mapBlockAttrs = { mapID: { type: 'string' }, useLatLng: { type: 'boolean', default: false }, address: { type: 'string', default: '' }, currentAddress: { type: 'string' }, lat: { type: 'string', default: '48.858370' }, lng: { type: 'string', default: '2.294471' }, zoom: { type: 'number', default: 14 }, height: { type: 'number', default: 350 }, markerIcon: { type: 'string' }, markerIconID: { type: 'number' }, markerTitle: { type: 'string', default: 'Eiffel Tower' }, markerDesc: { type: 'string', default: '' }, changed: { type: 'boolean', default: false }, isPreview: { type: 'boolean', default: false } }; registerBlockType('advgb/map', { title: __('Map - PublishPress', 'advanced-gutenberg'), description: __('Display a location using Google Maps.', 'advanced-gutenberg'), icon: { src: mapBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('google map', 'advanced-gutenberg'), __('location', 'advanced-gutenberg'), __('address', 'advanced-gutenberg')], attributes: _extends({}, mapBlockAttrs, { mapStyle: { type: 'string' }, mapStyleCustom: { type: 'string' }, infoWindowDefaultShown: { type: 'boolean', default: true } }), example: { attributes: { isPreview: true } }, supports: { anchor: true }, edit: AdvMap, save: function save(_ref2) { var attributes = _ref2.attributes; var mapID = attributes.mapID, lat = attributes.lat, lng = attributes.lng, zoom = attributes.zoom, height = attributes.height, markerIcon = attributes.markerIcon, markerTitle = attributes.markerTitle, markerDesc = attributes.markerDesc, mapStyle = attributes.mapStyle, mapStyleCustom = attributes.mapStyleCustom, infoWindowDefaultShown = attributes.infoWindowDefaultShown; var formattedDesc = markerDesc.replace(/\n/g, '<br/>').replace(/'/, '\\\''); var formattedTitle = markerTitle.replace(/'/, '\\\''); var DEFAULT_MARKER = 'https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi2.png'; var mapStyleApply = MAP_STYLES[mapStyle]; if (mapStyle === 'custom') { try { mapStyleApply = JSON.parse(mapStyleCustom); } catch (e) { mapStyleApply = ''; } } if (mapStyleApply) { mapStyleApply = JSON.stringify(mapStyleApply); } else { mapStyleApply = ''; } return React.createElement( "div", { className: "advgb-map-block", style: { margin: '10px auto' } }, React.createElement("div", { className: "advgb-map-content", id: mapID, style: { height: height }, "data-default": DEFAULT_MARKER, "data-lat": lat, "data-lng": lng, "data-zoom": zoom, "data-title": formattedTitle, "data-desc": formattedDesc, "data-icon": markerIcon, "data-shown": infoWindowDefaultShown, "data-style": encodeURIComponent(mapStyleApply) }) ); }, deprecated: [{ attributes: _extends({}, mapBlockAttrs, { mapStyle: { type: 'string' }, mapStyleCustom: { type: 'string' } }), save: function save(_ref3) { var attributes = _ref3.attributes; var mapID = attributes.mapID, lat = attributes.lat, lng = attributes.lng, zoom = attributes.zoom, height = attributes.height, markerIcon = attributes.markerIcon, markerTitle = attributes.markerTitle, markerDesc = attributes.markerDesc, mapStyle = attributes.mapStyle, mapStyleCustom = attributes.mapStyleCustom; var formattedDesc = markerDesc.replace(/\n/g, '<br/>').replace(/'/, '\\\''); var formattedTitle = markerTitle.replace(/'/, '\\\''); var DEFAULT_MARKER = 'https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi2.png'; var mapStyleApply = MAP_STYLES[mapStyle]; if (mapStyle === 'custom') { try { mapStyleApply = JSON.parse(mapStyleCustom); } catch (e) { mapStyleApply = ''; } } if (mapStyleApply) { mapStyleApply = JSON.stringify(mapStyleApply); } else { mapStyleApply = ''; } return React.createElement( "div", { className: "advgb-map-block", style: { margin: '10px auto' } }, React.createElement("div", { className: "advgb-map-content", id: mapID, style: { height: height }, "data-default": DEFAULT_MARKER, "data-lat": lat, "data-lng": lng, "data-zoom": zoom, "data-title": formattedTitle, "data-desc": formattedDesc, "data-icon": markerIcon, "data-style": encodeURIComponent(mapStyleApply) }) ); } }] }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/newsletter/block.jsx": /*!************************************************!*\ !*** ./src/assets/blocks/newsletter/block.jsx ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, PanelColorSettings = _wpBlockEditor.PanelColorSettings; var PanelBody = wpComponents.PanelBody, RangeControl = wpComponents.RangeControl, SelectControl = wpComponents.SelectControl, TextControl = wpComponents.TextControl; var newsletterBlockIcon = React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24" }, React.createElement("path", { fill: "none", d: "M0 0h24v24H0V0z" }), React.createElement("path", { "fill-opacity": ".9", d: "M12 1.95c-5.52 0-10 4.48-10 10s4.48 10 10 10h5v-2h-5c-4.34 0-8-3.66-8-8s3.66-8 8-8 8 3.66 8 8v1.43c0 .79-.71 1.57-1.5 1.57s-1.5-.78-1.5-1.57v-1.43c0-2.76-2.24-5-5-5s-5 2.24-5 5 2.24 5 5 5c1.38 0 2.64-.56 3.54-1.47.65.89 1.77 1.47 2.96 1.47 1.97 0 3.5-1.6 3.5-3.57v-1.43c0-5.52-4.48-10-10-10zm0 13c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3z" }) ); var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD5CAYAAAAOeCiTAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACchJREFUeNrs3T2IHOcdwOGZ3T1JPkm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WjjwFhE0AAAAAAAAAAAAAOwT/xNgAPfkiOqfebQ/AAAAAElFTkSuQmCC'; var AdvNewsletter = function (_Component) { _inherits(AdvNewsletter, _Component); function AdvNewsletter() { _classCallCheck(this, AdvNewsletter); return _possibleConstructorReturn(this, (AdvNewsletter.__proto__ || Object.getPrototypeOf(AdvNewsletter)).apply(this, arguments)); } _createClass(AdvNewsletter, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-newsletter']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === "undefined" ? "undefined" : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: "render", value: function render() { var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes; var formStyle = attributes.formStyle, formWidth = attributes.formWidth, fnameLabel = attributes.fnameLabel, lnameLabel = attributes.lnameLabel, emailLabel = attributes.emailLabel, submitLabel = attributes.submitLabel, successLabel = attributes.successLabel, alertLabel = attributes.alertLabel, bgColor = attributes.bgColor, textColor = attributes.textColor, borderColor = attributes.borderColor, borderStyle = attributes.borderStyle, borderRadius = attributes.borderRadius, submitColor = attributes.submitColor, submitBgColor = attributes.submitBgColor, submitRadius = attributes.submitRadius, isPreview = attributes.isPreview; return isPreview ? React.createElement("img", { alt: __('Newsletter', 'advanced-gutenberg'), width: "100%", src: previewImageData }) : React.createElement( Fragment, null, React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Newsletter Settings', 'advanced-gutenberg') }, typeof advgbBlocks !== 'undefined' && !parseInt(advgbBlocks.captchaEnabled) && React.createElement( PanelBody, { title: __('Notice', 'advanced-gutenberg') }, React.createElement( "p", { style: { fontStyle: 'italic' } }, __('We strongly recommend to enable Google reCAPTCHA to avoid spam.', 'advanced-gutenberg'), React.createElement("br", null), React.createElement( "a", { href: advgbBlocks.config_url + '&tab=recaptcha', target: "_blank" }, __('You can enable it in Settings', 'advanced-gutenberg') ) ) ), React.createElement( PanelBody, { title: __('Form Settings', 'advanced-gutenberg') }, React.createElement(SelectControl, { label: __('Form style', 'advanced-gutenberg'), value: formStyle, options: [{ label: __('Default', 'advanced-gutenberg'), value: 'default' }, { label: __('Alternative', 'advanced-gutenberg'), value: 'alt' }], onChange: function onChange(value) { return setAttributes({ formStyle: value }); } }), React.createElement(RangeControl, { label: __('Form width (px)', 'advanced-gutenberg'), value: formWidth, onChange: function onChange(value) { return setAttributes({ formWidth: value }); }, min: 200, max: 1000 }) ), React.createElement( PanelBody, { title: __('Text Label', 'advanced-gutenberg') }, formStyle === 'alt' && React.createElement( Fragment, null, React.createElement(TextControl, { label: __('First Name input placeholder', 'advanced-gutenberg'), value: fnameLabel, onChange: function onChange(value) { return setAttributes({ fnameLabel: value }); } }), React.createElement(TextControl, { label: __('Last Name input placeholder', 'advanced-gutenberg'), value: lnameLabel, onChange: function onChange(value) { return setAttributes({ lnameLabel: value }); } }) ), React.createElement(TextControl, { label: __('Email input placeholder', 'advanced-gutenberg'), value: emailLabel, onChange: function onChange(value) { return setAttributes({ emailLabel: value }); } }), React.createElement(TextControl, { label: __('Submit text', 'advanced-gutenberg'), value: submitLabel, onChange: function onChange(value) { return setAttributes({ submitLabel: value }); } }), React.createElement(TextControl, { label: __('Empty field warning text', 'advanced-gutenberg'), value: alertLabel, onChange: function onChange(value) { return setAttributes({ alertLabel: value }); } }), React.createElement(TextControl, { label: __('Submit success text', 'advanced-gutenberg'), value: successLabel, onChange: function onChange(value) { return setAttributes({ successLabel: value }); } }) ), React.createElement(PanelColorSettings, { title: __('Input Color', 'advanced-gutenberg'), colorSettings: [{ label: __('Background color', 'advanced-gutenberg'), value: bgColor, onChange: function onChange(value) { return setAttributes({ bgColor: value }); } }, { label: __('Text color', 'advanced-gutenberg'), value: textColor, onChange: function onChange(value) { return setAttributes({ textColor: value }); } }] }), React.createElement( PanelBody, { title: __('Border Settings', 'advanced-gutenberg'), initialOpen: false }, React.createElement(PanelColorSettings, { title: __('Border Color', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Border color', 'advanced-gutenberg'), value: borderColor, onChange: function onChange(value) { return setAttributes({ borderColor: value }); } }] }), React.createElement(SelectControl, { label: __('Border Style', 'advanced-gutenberg'), value: borderStyle, options: [{ label: __('Solid', 'advanced-gutenberg'), value: 'solid' }, { label: __('Dashed', 'advanced-gutenberg'), value: 'dashed' }, { label: __('Dotted', 'advanced-gutenberg'), value: 'dotted' }], onChange: function onChange(value) { return setAttributes({ borderStyle: value }); } }), React.createElement(RangeControl, { label: __('Border radius (px)', 'advanced-gutenberg'), value: borderRadius, onChange: function onChange(value) { return setAttributes({ borderRadius: value }); }, min: 0, max: 50 }) ), React.createElement( PanelBody, { title: __('Submit Button Settings', 'advanced-gutenberg') }, React.createElement(PanelColorSettings, { title: __('Color Settings', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Border and Text', 'advanced-gutenberg'), value: submitColor, onChange: function onChange(value) { return setAttributes({ submitColor: value }); } }, { label: __('Background', 'advanced-gutenberg'), value: submitBgColor, onChange: function onChange(value) { return setAttributes({ submitBgColor: value }); } }] }), React.createElement(RangeControl, { label: __('Button border radius', 'advanced-gutenberg'), value: submitRadius, onChange: function onChange(value) { return setAttributes({ submitRadius: value }); }, min: 0, max: 50 }) ) ) ), React.createElement( "div", { className: "advgb-newsletter-wrapper" }, React.createElement( "div", { className: "advgb-newsletter clearfix style-" + formStyle, style: { maxWidth: formWidth } }, formStyle === 'default' && React.createElement( "div", { className: "advgb-form-field" }, React.createElement("input", { type: "text", disabled: true, className: "advgb-form-input", value: emailLabel ? emailLabel : 'Email address', style: { backgroundColor: bgColor, color: textColor, borderColor: borderColor, borderStyle: borderStyle, borderRadius: borderRadius } }), React.createElement( "div", { className: "advgb-form-submit-wrapper" }, React.createElement( "button", { className: "advgb-form-submit", type: "button", style: { borderColor: submitColor, color: submitColor, backgroundColor: submitBgColor, borderRadius: submitRadius } }, submitLabel ? submitLabel : 'Submit' ) ) ), formStyle === 'alt' && React.createElement( Fragment, null, React.createElement( "div", { className: "advgb-form-field advgb-form-field-full" }, React.createElement("input", { type: "text", disabled: true, className: "advgb-form-input", value: fnameLabel ? fnameLabel : __('First Name', 'advanced-gutenberg'), style: { backgroundColor: bgColor, color: textColor, borderColor: borderColor, borderStyle: borderStyle, borderRadius: borderRadius } }) ), React.createElement( "div", { className: "advgb-form-field advgb-form-field-full" }, React.createElement("input", { type: "text", disabled: true, className: "advgb-form-input", value: lnameLabel ? lnameLabel : __('Last Name', 'advanced-gutenberg'), style: { backgroundColor: bgColor, color: textColor, borderColor: borderColor, borderStyle: borderStyle, borderRadius: borderRadius } }) ), React.createElement( "div", { className: "advgb-form-field advgb-form-field-full" }, React.createElement("input", { type: "text", disabled: true, className: "advgb-form-input", value: emailLabel ? emailLabel : 'Email address', style: { backgroundColor: bgColor, color: textColor, borderColor: borderColor, borderStyle: borderStyle, borderRadius: borderRadius } }) ), React.createElement( "div", { className: "advgb-form-submit-wrapper" }, React.createElement( "button", { className: "advgb-form-submit", type: "button", style: { borderColor: submitColor, color: submitColor, backgroundColor: submitBgColor, borderRadius: submitRadius } }, submitLabel ? submitLabel : 'Submit' ) ) ) ) ) ); } }]); return AdvNewsletter; }(Component); registerBlockType('advgb/newsletter', { title: __('Newsletter - PublishPress', 'advanced-gutenberg'), description: __('Fastest way to create a newsletter form for your page.', 'advanced-gutenberg'), icon: { src: newsletterBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('newsletter', 'advanced-gutenberg'), __('form', 'advanced-gutenberg'), __('email', 'advanced-gutenberg')], attributes: { formStyle: { type: 'string', default: 'default' }, formWidth: { type: 'number', default: 400 }, fnameLabel: { type: 'string' }, lnameLabel: { type: 'string' }, emailLabel: { type: 'string' }, submitLabel: { type: 'string' }, successLabel: { type: 'string' }, alertLabel: { type: 'string' }, bgColor: { type: 'string' }, textColor: { type: 'string' }, borderStyle: { type: 'string' }, borderColor: { type: 'string' }, borderRadius: { type: 'number' }, submitColor: { type: 'string' }, submitBgColor: { type: 'string' }, submitRadius: { type: 'number' }, changed: { type: 'boolean', default: false }, isPreview: { type: 'boolean', default: false } }, example: { attributes: { isPreview: true } }, supports: { anchor: true }, edit: AdvNewsletter, save: function save(_ref) { var attributes = _ref.attributes; var formStyle = attributes.formStyle, formWidth = attributes.formWidth, fnameLabel = attributes.fnameLabel, lnameLabel = attributes.lnameLabel, emailLabel = attributes.emailLabel, submitLabel = attributes.submitLabel, successLabel = attributes.successLabel, alertLabel = attributes.alertLabel, bgColor = attributes.bgColor, textColor = attributes.textColor, borderColor = attributes.borderColor, borderStyle = attributes.borderStyle, borderRadius = attributes.borderRadius, submitColor = attributes.submitColor, submitBgColor = attributes.submitBgColor, submitRadius = attributes.submitRadius; return React.createElement( "div", { className: "advgb-newsletter clearfix style-" + formStyle, style: { maxWidth: formWidth } }, React.createElement( "form", { method: "POST", className: "clearfix" }, formStyle === 'default' && React.createElement( "div", { className: "advgb-form-field" }, React.createElement("input", { type: "email", className: "advgb-form-input advgb-form-input-email", placeholder: emailLabel ? emailLabel : 'Email address', style: { backgroundColor: bgColor, color: textColor, borderColor: borderColor, borderStyle: borderStyle, borderRadius: borderRadius } }), React.createElement( "div", { className: "advgb-form-submit-wrapper" }, React.createElement( "button", { className: "advgb-form-submit", type: "submit", "data-success": successLabel ? successLabel : undefined, "data-alert": alertLabel ? alertLabel : undefined, style: { borderColor: submitColor, color: submitColor, backgroundColor: submitBgColor, borderRadius: submitRadius } }, submitLabel ? submitLabel : 'Submit' ) ) ), formStyle === 'alt' && React.createElement( Fragment, null, React.createElement( "div", { className: "advgb-form-field advgb-form-field-full" }, React.createElement("input", { type: "text", className: "advgb-form-input advgb-form-input-fname", placeholder: fnameLabel ? fnameLabel : __('First Name', 'advanced-gutenberg'), style: { backgroundColor: bgColor, color: textColor, borderColor: borderColor, borderStyle: borderStyle, borderRadius: borderRadius } }) ), React.createElement( "div", { className: "advgb-form-field advgb-form-field-full" }, React.createElement("input", { type: "text", className: "advgb-form-input advgb-form-input-lname", placeholder: lnameLabel ? lnameLabel : __('Last Name', 'advanced-gutenberg'), style: { backgroundColor: bgColor, color: textColor, borderColor: borderColor, borderStyle: borderStyle, borderRadius: borderRadius } }) ), React.createElement( "div", { className: "advgb-form-field advgb-form-field-full" }, React.createElement("input", { type: "email", className: "advgb-form-input advgb-form-input-email", placeholder: emailLabel ? emailLabel : 'Email address', style: { backgroundColor: bgColor, color: textColor, borderColor: borderColor, borderStyle: borderStyle, borderRadius: borderRadius } }) ), React.createElement( "div", { className: "advgb-form-submit-wrapper" }, React.createElement( "button", { className: "advgb-form-submit", type: "submit", "data-success": successLabel ? successLabel : undefined, "data-alert": alertLabel ? alertLabel : undefined, style: { borderColor: submitColor, color: submitColor, backgroundColor: submitBgColor, borderRadius: submitRadius } }, submitLabel ? submitLabel : 'Submit' ) ) ), React.createElement("div", { className: "advgb-grecaptcha clearfix" }) ) ); } }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/recent-posts/block.jsx": /*!**************************************************!*\ !*** ./src/assets/blocks/recent-posts/block.jsx ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _queryControls = __webpack_require__(/*! ./query-controls.jsx */ "./src/assets/blocks/recent-posts/query-controls.jsx"); var _queryControls2 = _interopRequireDefault(_queryControls); var _components = __webpack_require__(/*! ../0-adv-components/components.jsx */ "./src/assets/blocks/0-adv-components/components.jsx"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents, wpData, lodash, wpHtmlEntities, wpDate) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment, RawHTML = wpElement.RawHTML; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, BlockControls = _wpBlockEditor.BlockControls; var PanelBody = wpComponents.PanelBody, RangeControl = wpComponents.RangeControl, ToggleControl = wpComponents.ToggleControl, TextControl = wpComponents.TextControl, TextareaControl = wpComponents.TextareaControl, FormTokenField = wpComponents.FormTokenField, Spinner = wpComponents.Spinner, ToolbarGroup = wpComponents.ToolbarGroup, ToolbarButton = wpComponents.ToolbarButton, Placeholder = wpComponents.Placeholder, Tooltip = wpComponents.Tooltip, SelectControl = wpComponents.SelectControl; var withSelect = wpData.withSelect; var pickBy = lodash.pickBy, isUndefined = lodash.isUndefined, isArray = lodash.isArray, isNull = lodash.isNull, uniqWith = lodash.uniqWith, isEqual = lodash.isEqual, omit = lodash.omit, union = lodash.union, sortBy = lodash.sortBy, unset = lodash.unset, set = lodash.set, find = lodash.find; var decodeEntities = wpHtmlEntities.decodeEntities; var dateI18n = wpDate.dateI18n; var advRecentPostsBlockIcon = React.createElement( 'svg', { width: '20', height: '20', viewBox: '2 2 22 22' }, React.createElement('path', { fill: 'none', d: 'M0,0h24v24H0V0z' }), React.createElement('rect', { x: '13', y: '7.5', width: '5', height: '2' }), React.createElement('rect', { x: '13', y: '14.5', width: '5', height: '2' }), React.createElement('path', { d: 'M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3z M19,19H5V5h14V19z' }), React.createElement('path', { d: 'M11,6H6v5h5V6z M10,10H7V7h3V10z' }), React.createElement('path', { d: 'M11,13H6v5h5V13z M10,17H7v-3h3V17z' }) ); var INBUILT_POST_TYPES = ['page', 'post']; var PP_SERIES_POST_TYPES = typeof advgbBlocks.pp_series_post_types !== 'undefined' ? advgbBlocks.pp_series_post_types : ['post']; var MAX_CATEGORIES_SUGGESTIONS = 20; var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD+CAYAAAATfRgrAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAD7dJREFUeNrsnc1rHOcdx3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0AEB0A0QEA0QEA0QEA0QEA0QEA0QEA0QEA0QGcI8j59UTR086n6VPeAPUKPhgMCp8blRbRg6h/7+7ufkm5A9RHv9/f297e3jM8DGL8DMqk7uYLBB999NHfMkR9ABgTT548+fedO3e28shtEnmy3OzsrDf63syoMtDjrHHN7+3t/XZpaek7fAQA1XPv3r3r165d+/3wqY667Y0ew+fhNRhdEn/Q6/UKR/Rn1yeffPKL4Qv9h48AoFq63e4/33///b9GeZg1ovsZBe9Yj8Frr732948//vhnpPAA1XF4ePjw3Xff/emnn37aNaJ1nOS2q8+IPAzb9/0wdY+6/NHl3bp168u1tbU/vfTSS9+cm5tb8zxvho8GoDyDweBgc3Pz9nvvvffz27dv74wk74+unvF8YKXsgfEamdvopthhO12Pc2ab/fXXX1995513vr2+vv6NYbt9VT8fBEHiewDAafr9/tPd3d3/fvbZZw8++OCDfw2f9yy5e0Yb3RS+b0d8s42eJHqY2nuG6DOW6Kb8M2a0t5oFyA6Qjpl6h9L2jWhudrz1R7Kb3zclP5G+zya8oRfxxmGU7xvyesbPzBi/O0BwgEKyB4ZzAytqR4pt/e7p4F3wzfuWxKbkvtWmJ6ID5IvmHavtHSf7oJPcKZcsunL7YfreifjlgSFuP6Ii8BEdoLTodkQfxEhuyv7sNcy2eZaIHlhpuS26LfgA0QHGLrqZRQ8Sonns0Fqi6FZU96yUwv4P+TGSIzpAcdHtTjnzMSl1P0WqgEYPfNR4utc53dOO5ADVRPWoxxPRPCptT0vd7RTerjEGxtcHRvpuC47oAOOL7HEz42IlzyzhKIWPEjjuinpthAdIljtN9qivh03tcql7Btmj5EdugPLSR42Pn3pMiuSFRLRk7ySk6MgOMN7IHlkRZJG8sIQxwpOuA4xf9tgKIKvkYxPR6Jmv/L0AWiL3qZ/JI3at8o0iPwDkoIzQAAAAAAAAAAAAAABQNf8TYAABwfBjL/dDRAAAAABJRU5ErkJggg=='; var FRONTPAGE_LAYOUTS = [{ layout: '1-2', icon: '1-2', title: __('The leading post on top, the rest in 2 columns below', 'advanced-gutenberg') }, { layout: '1-3', icon: '1-3', title: __('The leading post on top, the rest in 3 columns below', 'advanced-gutenberg') }, { layout: '1-4', icon: '1-4', title: __('The leading post on top, the rest in 4 columns below', 'advanced-gutenberg') }, { layout: '1-5', icon: '1-5', title: __('The leading post on top, the rest in 5 columns below', 'advanced-gutenberg') }, { layout: 'stacked', icon: 'stacked', title: __('Stacked', 'advanced-gutenberg') }, { layout: '2-2', icon: '2-2', title: __('All posts in 2 columns grid', 'advanced-gutenberg') }, { layout: '3-3', icon: '3-3', title: __('All posts in 3 columns grid', 'advanced-gutenberg') }, { layout: '4-4', icon: '4-4', title: __('All posts in 4 columns grid', 'advanced-gutenberg') }, { layout: '5-5', icon: '5-5', title: __('All posts in 5 columns grid', 'advanced-gutenberg') }]; // @TODO fix duplicated code from FRONTPAGE_LAYOUTS var FRONTPAGE_LAYOUTS_TABLET = [{ layout: '1-2', icon: '1-2', title: __('The leading post on top, the rest in 2 columns below', 'advanced-gutenberg') }, { layout: '1-3', icon: '1-3', title: __('The leading post on top, the rest in 3 columns below', 'advanced-gutenberg') }, { layout: '1-4', icon: '1-4', title: __('The leading post on top, the rest in 4 columns below', 'advanced-gutenberg') }, { layout: '1-5', icon: '1-5', title: __('The leading post on top, the rest in 5 columns below', 'advanced-gutenberg') }, { layout: 'stacked', icon: 'stacked', title: __('Stacked', 'advanced-gutenberg') }, { layout: '2-2', icon: '2-2', title: __('All posts in 2 columns grid', 'advanced-gutenberg') }, { layout: '3-3', icon: '3-3', title: __('All posts in 3 columns grid', 'advanced-gutenberg') }, { layout: '4-4', icon: '4-4', title: __('All posts in 4 columns grid', 'advanced-gutenberg') }, { layout: '5-5', icon: '5-5', title: __('All posts in 5 columns grid', 'advanced-gutenberg') }]; var FRONTPAGE_LAYOUTS_MOBILE = [{ layout: '1-2', icon: '1-2', title: __('The leading post on top, the rest in 2 columns below', 'advanced-gutenberg') }, { layout: 'stacked', icon: 'stacked', title: __('Stacked', 'advanced-gutenberg') }, { layout: '2-2', icon: '2-2', title: __('All posts in 2 columns grid', 'advanced-gutenberg') }]; var GAP_OPTIONS = [{ label: __('None', 'advanced-gutenberg'), value: 0 }, { label: '5px', value: 5 }, { label: '10px', value: 10 }, { label: '20px', value: 20 }, { label: '30px', value: 30 }, { label: '40px', value: 40 }, { label: '50px', value: 50 }]; var NEWSPAPER_LAYOUTS = [{ layout: 'np-1-1', icon: 'np-1-1', items: 2, title: __('The leading post in the left, 1 post in the right', 'advanced-gutenberg') }, { layout: 'np-1-2', icon: 'np-1-2', items: 3, title: __('The leading post in the left, 2 posts in the right', 'advanced-gutenberg') }, { layout: 'np-1-3', icon: 'np-1-3', items: 4, title: __('The leading post in the left, 3 posts in the right', 'advanced-gutenberg') }, { layout: 'np-1-4', icon: 'np-1-4', items: 5, title: __('The leading post in the left, 4 posts in the right', 'advanced-gutenberg') }, { layout: 'np-1-5', icon: 'np-1-5', items: 6, title: __('The leading post in the left, 5 posts in the right', 'advanced-gutenberg') }, { layout: 'np-1-1-r', icon: 'np-1-1-r', items: 2, title: __('The leading post in the right, 1 post in the left', 'advanced-gutenberg') }, { layout: 'np-1-2-r', icon: 'np-1-2-r', items: 3, title: __('The leading post in the right, 2 posts in the left', 'advanced-gutenberg') }, { layout: 'np-1-3-r', icon: 'np-1-3-r', items: 4, title: __('The leading post in the right, 3 posts in the left', 'advanced-gutenberg') }, { layout: 'np-1-4-r', icon: 'np-1-4-r', items: 5, title: __('The leading post in the right, 4 posts in the left', 'advanced-gutenberg') }, { layout: 'np-1-5-r', icon: 'np-1-5-r', items: 6, title: __('The leading post in the right, 5 posts in the left', 'advanced-gutenberg') }, { layout: 'np-2', icon: 'np-2', items: 3, title: __('The leading post on top, the rest of posts below', 'advanced-gutenberg') }, { layout: 'np-3-1', icon: 'np-3-1', items: 3, title: __('The leading post on top, below 2 columns with 1 post in the left and 1 post in the right', 'advanced-gutenberg') }, { layout: 'np-3-2', icon: 'np-3-2', items: 4, title: __('The leading post on top, below 2 columns with 1 post in the left and 2 posts in the right', 'advanced-gutenberg') }, { layout: 'np-3-3', icon: 'np-3-3', items: 5, title: __('The leading post on top, below 2 columns with 1 post in the left and 3 posts in the right', 'advanced-gutenberg') }]; var ORDER_SECTIONS = [{ label: 'Default', value: 'default' }, { label: 'Title, Image, Info, Text', value: 'title-image-info-text' }, { label: 'Image, Title, Text, Info', value: 'image-title-text-info' }, { label: 'Title, Image, Text, Info', value: 'title-image-text-info' }, { label: 'Title, Info, Text, Image', value: 'title-info-text-image' }, { label: 'Title, Text, Info, Image', value: 'title-text-info-image' }, { label: 'Title, Text, Image, Info', value: 'title-text-image-info' }]; var DISPLAY_FOR = [{ label: __('For all posts', 'advanced-gutenberg'), value: 'all' }, { label: __('For the first post', 'advanced-gutenberg'), value: 1 }, { label: __('For the first 2 posts', 'advanced-gutenberg'), value: 2 }, { label: __('For the first 3 posts', 'advanced-gutenberg'), value: 3 }, { label: __('For the first 4 posts', 'advanced-gutenberg'), value: 4 }, { label: __('For the first 5 posts', 'advanced-gutenberg'), value: 5 }]; var CUSTOM_TAX_PREFIX = 'custom-tax-'; var initSlider = null; var initMasonry = null; var RecentPostsEdit = function (_Component) { _inherits(RecentPostsEdit, _Component); function RecentPostsEdit() { _classCallCheck(this, RecentPostsEdit); var _this = _possibleConstructorReturn(this, (RecentPostsEdit.__proto__ || Object.getPrototypeOf(RecentPostsEdit)).apply(this, arguments)); _this.state = { categoriesList: [], tagsList: [], catIdVsName: [], tagNameVsId: [], postTypeList: [], updating: false, tabSelected: 'desktop', updatePostSuggestions: true, // Backward compatibility 2.13.2 and lower authorList: [] }; _this.selectCategories = _this.selectCategories.bind(_this); _this.selectTags = _this.selectTags.bind(_this); _this.getTagIdsForTags = _this.getTagIdsForTags.bind(_this); _this.getCategoryForBkwrdCompat = _this.getCategoryForBkwrdCompat.bind(_this); _this.selectPostByTitle = _this.selectPostByTitle.bind(_this); // Backward compatibility 2.13.1 and lower _this.updatePostType = _this.updatePostType.bind(_this); _this.getPostIds = _this.getPostIds.bind(_this); _this.getPostTitles = _this.getPostTitles.bind(_this); return _this; } _createClass(RecentPostsEdit, [{ key: 'componentWillMount', value: function componentWillMount() { var _this2 = this; var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-recent-posts']; var tagsAndcategoriesListQuery = { per_page: -1, hide_empty: true }; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === 'undefined' ? 'undefined' : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } if (!attributes.searchString) { setAttributes({ searchString: '' }); } wp.apiFetch({ path: wp.url.addQueryArgs('advgb/v1/exclude_post_types') }).then(function (excludePostTypes) { wp.apiFetch({ path: wp.url.addQueryArgs('wp/v2/types', { context: 'edit' }) }).then(function (list) { var types = []; Object.keys(list).forEach(function (type) { if (list[type].viewable && !excludePostTypes.includes(type)) { types.push({ label: list[type].name, value: list[type].slug }); } }); _this2.setState({ postTypeList: types }); }); }); wp.apiFetch({ path: wp.url.addQueryArgs('wp/v2/categories', tagsAndcategoriesListQuery) }).then(function (list) { var suggestions = []; var catIdVsName = []; list.forEach(function (cat) { suggestions[cat.name] = cat; catIdVsName[cat.id] = cat.name; }); _this2.setState({ categoriesList: suggestions, catIdVsName: catIdVsName }); // for backward compatibility, extract the (single select) category and set it as the (mutli select) categories // and make the (single select) category empty var categories = attributes.category && attributes.category !== undefined && attributes.category.length > 0 ? [_this2.getCategoryForBkwrdCompat(attributes.category)] : attributes.categories; setAttributes({ categories: categories, category: '' }); }); wp.apiFetch({ path: wp.url.addQueryArgs('wp/v2/tags', tagsAndcategoriesListQuery) }).then(function (list) { var suggestions = []; var tagNameVsId = []; list.forEach(function (tag) { suggestions.push(tag.name); tagNameVsId[tag.name] = tag.id; }); _this2.setState({ tagsList: suggestions, tagNameVsId: tagNameVsId }); var tagIds = attributes.tags && attributes.tags.length > 0 ? _this2.getTagIdsForTags(attributes.tags) : []; setAttributes({ tagIds: tagIds }); }); wp.apiFetch({ path: wp.url.addQueryArgs('advgb/v1/authors') }).then(function (list) { _this2.setState({ authorList: list }); }); // migrate from displayDate to postDate var postDateDisplay = attributes.displayDate ? 'created' : attributes.postDate; setAttributes({ postDate: postDateDisplay, displayDate: false }); var postType = attributes.postType === undefined ? 'post' : attributes.postType; this.generateTaxFilters(postType); } }, { key: 'componentWillUpdate', value: function componentWillUpdate(nextProps) { var nextPosts = nextProps.recentPosts; var nextView = nextProps.attributes.postView; var _props2 = this.props, attributes = _props2.attributes, clientId = _props2.clientId, recentPosts = _props2.recentPosts; var $ = jQuery; if (nextView !== 'slider' || nextPosts && recentPosts && nextPosts.length !== recentPosts.length) { $('#block-' + clientId + ' .advgb-recent-posts.slick-initialized').slick('unslick'); $('#block-' + clientId + ' .advgb-recent-post').removeAttr('tabindex').removeAttr('role').removeAttr('aria-describedby'); if (nextView === 'slider' && nextPosts && recentPosts && nextPosts.length !== recentPosts.length) { if (!this.state.updating) { this.setState({ updating: true }); } } if (initSlider) { clearTimeout(initSlider); } } if (nextView !== 'masonry' || nextPosts && recentPosts && nextPosts.length !== recentPosts.length) { $('#block-' + clientId + ' .masonry-view .advgb-recent-posts').isotope('destroy'); if (nextView === 'masonry' && nextPosts && recentPosts && nextPosts.length !== recentPosts.length) { if (!this.state.updating) { this.setState({ updating: true }); } } if (initMasonry) { clearTimeout(initMasonry); } } } }, { key: 'componentDidMount', value: function componentDidMount() { var _props3 = this.props, attributes = _props3.attributes, setAttributes = _props3.setAttributes, clientId = _props3.clientId; setAttributes({ id: 'recent-posts-' + clientId }); // Reset attributes when Pro is not available if (!this.isPro() && this.checkIncludeEnabled()) { setAttributes({ includePosts: [] }); } } }, { key: 'componentDidUpdate', value: function componentDidUpdate(prevProps) { var that = this; var _props4 = this.props, attributes = _props4.attributes, clientId = _props4.clientId, postList = _props4.postList; var postView = attributes.postView, sliderAutoplay = attributes.sliderAutoplay, sliderAutoplaySpeed = attributes.sliderAutoplaySpeed; var $ = jQuery; if (postView === 'slider') { // Autoplay initSlider = setTimeout(function () { $('#block-' + clientId + ' .advgb-recent-posts-block.slider-view .advgb-recent-posts:not(.slick-initialized)').slick({ dots: true, adaptiveHeight: true, autoplay: sliderAutoplay }); $('#block-' + clientId + ' .advgb-recent-posts-block.slider-view .advgb-recent-posts.slick-initialized').slick('slickSetOption', 'autoplay', sliderAutoplay, true); if (that.state.updating) { that.setState({ updating: false }); } }, 100); // Autoplay speed if (sliderAutoplay && sliderAutoplaySpeed && advgbBlocks.advgb_pro !== 'undefined' && advgbBlocks.advgb_pro === '1') { $('#block-' + clientId + ' .advgb-recent-posts-block.slider-view .advgb-recent-posts.slick-initialized').slick('slickSetOption', 'autoplaySpeed', sliderAutoplaySpeed, true); } else { $('#block-' + clientId + ' .advgb-recent-posts-block.slider-view .advgb-recent-posts.slick-initialized').slick('slickSetOption', 'autoplaySpeed', 3000, true); } } else { $('#block-' + clientId + ' .advgb-recent-posts.slick-initialized').slick('unslick'); } if (postView === 'masonry') { initMasonry = setTimeout(function () { var $masonry = $('#block-' + clientId + ' .masonry-view .advgb-recent-posts'); $masonry.isotope({ itemSelector: '.advgb-recent-post', percentPosition: true }); $(window).resize(function () { $masonry.isotope(); }); if (that.state.updating) { that.setState({ updating: false }); } }, 100); } else { $('#block-' + clientId + ' .masonry-view .advgb-recent-posts').isotope('destroy'); } // Backward compatibility 2.13.1 and lower if (this.state.updatePostSuggestions && attributes.exclude && attributes.exclude.length > 0 && postList) { var postSuggestions = []; var postTitleVsIdMap = []; postList.forEach(function (post) { postSuggestions.push(post.title.raw); postTitleVsIdMap[post.title.raw] = post.id; }); this.setState({ postTitleVsIdMap: postTitleVsIdMap, updatePostSuggestions: false }, function () { if (!attributes.excludeIds) { this.selectPostByTitle(attributes.exclude, 'exclude'); } }); } } }, { key: 'translatableText', value: function translatableText(text) { switch (text) { case 'desktop': return __('desktop', 'advanced-gutenberg'); break; case 'tablet': return __('tablet', 'advanced-gutenberg'); break; case 'mobile': return __('mobile', 'advanced-gutenberg'); break; } } }, { key: 'isPro', value: function isPro() { return advgbBlocks.advgb_pro !== 'undefined' && advgbBlocks.advgb_pro === '1'; } }, { key: 'checkIncludeEnabled', value: function checkIncludeEnabled() { return typeof this.props.attributes.includePosts !== 'undefined' && this.props.attributes.includePosts.length > 0; } }, { key: 'render', value: function render() { var _this3 = this; var _state = this.state, categoriesList = _state.categoriesList, tagsList = _state.tagsList, postTypeList = _state.postTypeList, tabSelected = _state.tabSelected, authorList = _state.authorList, postSuggestions = _state.postSuggestions, taxonomyList = _state.taxonomyList; var _props5 = this.props, attributes = _props5.attributes, setAttributes = _props5.setAttributes, recentPostsList = _props5.recentPosts, postsToSearch = _props5.postsToSearch, postsToSearchResolved = _props5.postsToSearchResolved, postsToInclude = _props5.postsToInclude, postsToIncludeResolved = _props5.postsToIncludeResolved, postsToExclude = _props5.postsToExclude, postsToExcludeResolved = _props5.postsToExcludeResolved, postList = _props5.postList; var id = attributes.id, postView = attributes.postView, order = attributes.order, orderBy = attributes.orderBy, numberOfPosts = attributes.numberOfPosts, columns = attributes.columns, columnsT = attributes.columnsT, columnsM = attributes.columnsM, displayFeaturedImage = attributes.displayFeaturedImage, displayFeaturedImageFor = attributes.displayFeaturedImageFor, displayFeaturedImageCaption = attributes.displayFeaturedImageCaption, enablePlaceholderImage = attributes.enablePlaceholderImage, imageOpacity = attributes.imageOpacity, imageOverlayColor = attributes.imageOverlayColor, displayAuthor = attributes.displayAuthor, displayAuthorFor = attributes.displayAuthorFor, authorLinkNewTab = attributes.authorLinkNewTab, displayDate = attributes.displayDate, postDate = attributes.postDate, postDateFor = attributes.postDateFor, postDateFormat = attributes.postDateFormat, displayTime = attributes.displayTime, displayExcerpt = attributes.displayExcerpt, displayExcerptFor = attributes.displayExcerptFor, postTextAsExcerpt = attributes.postTextAsExcerpt, postTextExcerptLength = attributes.postTextExcerptLength, displayReadMore = attributes.displayReadMore, displayReadMoreFor = attributes.displayReadMoreFor, readMoreLbl = attributes.readMoreLbl, isPreview = attributes.isPreview, categories = attributes.categories, tags = attributes.tags, frontpageLayout = attributes.frontpageLayout, frontpageLayoutT = attributes.frontpageLayoutT, frontpageLayoutM = attributes.frontpageLayoutM, gap = attributes.gap, frontpageStyle = attributes.frontpageStyle, sliderStyle = attributes.sliderStyle, newspaperLayout = attributes.newspaperLayout, excludeCurrentPost = attributes.excludeCurrentPost, showCategories = attributes.showCategories, showCategoriesFor = attributes.showCategoriesFor, showTags = attributes.showTags, showTagsFor = attributes.showTagsFor, displayCommentCount = attributes.displayCommentCount, displayCommentCountFor = attributes.displayCommentCountFor, textAfterTitle = attributes.textAfterTitle, textBeforeReadmore = attributes.textBeforeReadmore, includePosts = attributes.includePosts, excludePosts = attributes.excludePosts, offset = attributes.offset, selectedAuthorId = attributes.author, sliderAutoplay = attributes.sliderAutoplay, linkCustomTax = attributes.linkCustomTax, showCustomTaxList = attributes.showCustomTaxList, showCustomTaxListFor = attributes.showCustomTaxListFor, imagePosition = attributes.imagePosition, onlyFromCurrentUser = attributes.onlyFromCurrentUser, orderSections = attributes.orderSections; var recentPosts = this.props.recentPosts; var mergedPosts = this.getMergedPosts(); var postSuggestionsExclude = this.getPostSuggestions(postList, 'exclude'); var postSuggestionsInclude = this.getPostSuggestions(mergedPosts, 'include'); // We need to check if we're in post edit or widgets screen var isInPost = wp.data.select('core/editor') && wp.data.select('core/editor').getCurrentPostType() === 'post'; var postType = attributes.postType; if (postType === undefined) { postType = 'post'; } var deviceLetter = ''; if (tabSelected === 'tablet') deviceLetter = 'T'; if (tabSelected === 'mobile') deviceLetter = 'M'; var inspectorControls = React.createElement( InspectorControls, null, postView === 'slider' && React.createElement( PanelBody, { title: __('Slider View Settings', 'advanced-gutenberg') }, React.createElement(SelectControl, { label: __('Style', 'advanced-gutenberg'), value: sliderStyle, options: [{ label: __('Default', 'advanced-gutenberg'), value: 'default' }, { label: __('Headline', 'advanced-gutenberg'), value: 'headline' }], onChange: function onChange(value) { return setAttributes({ sliderStyle: value }); } }), React.createElement(ToggleControl, { label: __('Autoplay', 'advanced-gutenberg'), checked: sliderAutoplay, onChange: function onChange() { return setAttributes({ sliderAutoplay: !sliderAutoplay }); } }) ), postView === 'frontpage' && React.createElement( PanelBody, { title: __('Frontpage View Settings', 'advanced-gutenberg') }, React.createElement( 'div', { className: 'advgb-recent-posts-responsive-items' }, ['desktop', 'tablet', 'mobile'].map(function (device, index) { var itemClasses = ["advgb-recent-posts-responsive-item", tabSelected === device && 'is-selected'].filter(Boolean).join(' '); return React.createElement( 'div', { className: itemClasses, key: index, onClick: function onClick() { return _this3.setState({ tabSelected: device }); } }, _this3.translatableText(device) ); }) ), React.createElement( 'div', { className: 'advgb-recent-posts-select-layout on-inspector' }, tabSelected === 'desktop' && FRONTPAGE_LAYOUTS.map(function (layout, index) { var layoutClasses = ['advgb-recent-posts-layout', tabSelected === 'desktop' && layout.layout === frontpageLayout && 'is-selected'].filter(Boolean).join(' '); return React.createElement( Tooltip, { text: layout.title, key: index }, React.createElement( 'div', { className: layoutClasses, onClick: function onClick() { setAttributes(_defineProperty({}, 'frontpageLayout' + deviceLetter, layout.layout)); _this3.setState({ random: Math.random() }); } }, React.createElement('img', { src: advgbBlocks.pluginUrl + '/assets/blocks/recent-posts/icons/' + layout.icon + '.png', alt: layout.layout }) ) ); }), tabSelected === 'tablet' && FRONTPAGE_LAYOUTS_TABLET.map(function (layout, index) { var layoutClasses = ['advgb-recent-posts-layout', tabSelected === 'tablet' && layout.layout === frontpageLayoutT && 'is-selected'].filter(Boolean).join(' '); return React.createElement( Tooltip, { text: layout.title, key: index }, React.createElement( 'div', { className: layoutClasses, onClick: function onClick() { setAttributes(_defineProperty({}, 'frontpageLayout' + deviceLetter, layout.layout)); _this3.setState({ random: Math.random() }); } }, React.createElement('img', { src: advgbBlocks.pluginUrl + '/assets/blocks/recent-posts/icons/' + layout.icon + '.png', alt: layout.layout }) ) ); }), tabSelected === 'mobile' && FRONTPAGE_LAYOUTS_MOBILE.map(function (layout, index) { var layoutClasses = ['advgb-recent-posts-layout', tabSelected === 'mobile' && layout.layout === frontpageLayoutM && 'is-selected'].filter(Boolean).join(' '); return React.createElement( Tooltip, { text: layout.title, key: index }, React.createElement( 'div', { className: layoutClasses, onClick: function onClick() { setAttributes(_defineProperty({}, 'frontpageLayout' + deviceLetter, layout.layout)); _this3.setState({ random: Math.random() }); } }, React.createElement('img', { src: advgbBlocks.pluginUrl + '/assets/blocks/recent-posts/icons/' + layout.icon + '.png', alt: layout.layout }) ) ); }) ), React.createElement(SelectControl, { label: __('Style', 'advanced-gutenberg'), value: frontpageStyle, options: [{ label: __('Default', 'advanced-gutenberg'), value: 'default' }, { label: __('Headline', 'advanced-gutenberg'), value: 'headline' }, { label: __('Boxed', 'advanced-gutenberg'), value: 'boxed' }], onChange: function onChange(value) { return setAttributes({ frontpageStyle: value }); } }), React.createElement(SelectControl, { label: __('Space between columns and rows', 'advanced-gutenberg'), value: gap, options: GAP_OPTIONS, onChange: function onChange(value) { return setAttributes({ gap: parseInt(value) }); } }) ), postView === 'newspaper' && React.createElement( PanelBody, { title: __('Newspaper View Settings', 'advanced-gutenberg') }, React.createElement( 'div', { className: 'advgb-recent-posts-select-layout on-inspector' }, NEWSPAPER_LAYOUTS.map(function (layout, index) { var layoutClasses = ['advgb-recent-posts-layout', layout.layout === newspaperLayout && 'is-selected'].filter(Boolean).join(' '); return React.createElement( Tooltip, { text: layout.title, key: index }, React.createElement( 'div', { className: layoutClasses, onClick: function onClick() { setAttributes({ newspaperLayout: layout.layout }); _this3.setState({ random: Math.random() }); _this3.newspaperOnChangeLayout(layout.layout); } }, React.createElement('img', { src: advgbBlocks.pluginUrl + '/assets/blocks/recent-posts/icons/' + layout.icon + '.png', alt: layout.layout }) ) ); }) ) ), postView === 'masonry' && React.createElement( PanelBody, { title: __('Masonry View Settings', 'advanced-gutenberg') }, React.createElement(SelectControl, { label: __('Space between columns and rows', 'advanced-gutenberg'), value: gap, options: GAP_OPTIONS, onChange: function onChange(value) { return setAttributes({ gap: parseInt(value) }); } }) ), React.createElement( PanelBody, { title: __('Post Settings', 'advanced-gutenberg') }, React.createElement(SelectControl, { label: __('Post Type', 'advanced-gutenberg'), value: postType, options: postTypeList, onChange: function onChange(value) { return _this3.updatePostType(value); } }), React.createElement(_queryControls2.default, _extends({ order: order, orderBy: orderBy, postType: postType }, { numberOfItems: numberOfPosts, onOrderChange: function onOrderChange(value) { return setAttributes({ order: value }); }, onOrderByChange: function onOrderByChange(value) { return setAttributes({ orderBy: value }); }, onNumberOfItemsChange: function onNumberOfItemsChange(value) { return _this3.refreshOnChangeItems(value); } })) ), React.createElement( PanelBody, { title: __('Filters', 'advanced-gutenberg') }, this.isPro() && this.checkIncludeEnabled() && React.createElement( 'div', { className: 'advgb-wrapper-disabled-msg notice notice-info' }, React.createElement( 'p', null, __('To enable filters, clear Advanced Filters > Display these posts only', 'advanced-gutenberg') ) ), React.createElement( Fragment, null, React.createElement( 'div', { className: this.isPro() && this.checkIncludeEnabled() ? 'advgb-wrapper-disabled' : '' }, this.isPro() && this.checkIncludeEnabled() && React.createElement('div', { className: 'advgb-wrapper-disabled-overlay' }), postType === 'post' && React.createElement( Fragment, null, React.createElement(FormTokenField, { key: 'query-controls-categories-select', label: __('Show content with these Categories', 'advanced-gutenberg'), value: categories && categories.map(function (item) { return { id: item.id, value: item.name || item.value }; }), suggestions: Object.keys(categoriesList), onChange: function onChange(value) { _this3.selectCategories(value); }, maxSuggestions: MAX_CATEGORIES_SUGGESTIONS }), React.createElement(FormTokenField, { multiple: true, suggestions: tagsList, value: tags, label: __('Show content with these Tags', 'advanced-gutenberg'), placeholder: __('Type a tag', 'advanced-gutenberg'), onChange: function onChange(value) { _this3.selectTags(value); } }) ), taxonomyList && taxonomyList.length > 0 && taxonomyList.map(function (tax) { return React.createElement(FormTokenField, { multiple: true, suggestions: tax.suggestions, value: _this3.populateTaxTerms(tax), onChange: function onChange(value) { return _this3.selectTaxTerms(tax, value); }, key: 'query-controls-`${tax.slug}`-select', label: __('Show content with these ', 'advanced-gutenberg') + decodeEntities('' + tax.name) }); }), !onlyFromCurrentUser && React.createElement(_queryControls.AuthorSelect, { key: 'query-controls-author-select', authorList: authorList, label: __('Author', 'advanced-gutenberg'), noOptionLabel: __('All', 'advanced-gutenberg'), selectedAuthorId: selectedAuthorId, onChange: function onChange(value) { return setAttributes({ author: value }); } }), React.createElement(ToggleControl, { label: __('Only shows posts written by the user viewing the block', 'advanced-gutenberg'), checked: onlyFromCurrentUser, onChange: function onChange() { return setAttributes({ onlyFromCurrentUser: !onlyFromCurrentUser }); } }), isInPost && postType === 'post' && React.createElement(ToggleControl, { label: __('Exclude current post', 'advanced-gutenberg'), help: __('If this post is listed in the block, you can exclude it.', 'advanced-gutenberg'), checked: excludeCurrentPost, onChange: function onChange() { return setAttributes({ excludeCurrentPost: !excludeCurrentPost }); } }), React.createElement(FormTokenField, { multiple: true, suggestions: postSuggestionsExclude, value: this.getPostTitles(excludePosts, postList), label: __('Exclude these posts', 'advanced-gutenberg'), placeholder: __('Search by title', 'advanced-gutenberg'), onChange: function onChange(excludePosts) { return _this3.getPostIds(excludePosts, postList, 'exclude'); } }), React.createElement(RangeControl, { label: __('Offset the first posts', 'advanced-gutenberg'), value: offset, min: 0, max: 10, onChange: function onChange(value) { return setAttributes({ offset: value }); } }) ) ) ), this.isPro() && React.createElement( Fragment, null, React.createElement( PanelBody, { title: __('Advanced Filters', 'advanced-gutenberg'), className: 'advgb-pro-icon' }, React.createElement(FormTokenField, { multiple: true, suggestions: postSuggestionsInclude, onInputChange: function onInputChange(value) { setAttributes({ searchString: value }); }, maxSuggestions: 10, value: this.getPostTitles(includePosts, mergedPosts), label: __('Display these posts only', 'advanced-gutenberg'), placeholder: __('Search by title', 'advanced-gutenberg'), onChange: function onChange(includePosts) { return _this3.getPostIds(includePosts, mergedPosts, 'include'); } }) ) ), React.createElement( PanelBody, { title: __('Display Settings', 'advanced-gutenberg') }, (postView === 'grid' || postView === 'masonry') && React.createElement(RangeControl, { label: __('Columns', 'advanced-gutenberg'), value: columns, min: 1, max: 4, onChange: function onChange(value) { return setAttributes({ columns: value }); } }), postView === 'masonry' && React.createElement( Fragment, null, React.createElement(RangeControl, { label: __('Columns (Tablet)', 'advanced-gutenberg'), value: columnsT, min: 1, max: 4, onChange: function onChange(value) { return setAttributes({ columnsT: value }); } }), React.createElement(RangeControl, { label: __('Columns (Mobile)', 'advanced-gutenberg'), value: columnsM, min: 1, max: 4, onChange: function onChange(value) { return setAttributes({ columnsM: value }); } }) ), React.createElement(ToggleControl, { label: __('Display Featured Image', 'advanced-gutenberg'), checked: displayFeaturedImage, onChange: function onChange() { return setAttributes({ displayFeaturedImage: !displayFeaturedImage }); } }), displayFeaturedImage && React.createElement( Fragment, null, React.createElement(SelectControl, { value: displayFeaturedImageFor, options: DISPLAY_FOR, onChange: function onChange(value) { setAttributes({ displayFeaturedImageFor: value }); }, className: 'advgb-child-select' }), React.createElement(ToggleControl, { label: __('Enable Placeholder Image', 'advanced-gutenberg'), checked: enablePlaceholderImage, onChange: function onChange() { return setAttributes({ enablePlaceholderImage: !enablePlaceholderImage }); }, className: 'advgb-child-toggle', help: __('If a post doesn\'t have a featured image, the placeholder image will be displayed instead', 'advanced-gutenberg') }), postView === 'list' && React.createElement(SelectControl, { label: __('Position', 'advanced-gutenberg'), value: imagePosition, options: [{ label: __('Left', 'advanced-gutenberg'), value: 'left' }, { label: __('Right', 'advanced-gutenberg'), value: 'right' }], onChange: function onChange(value) { return setAttributes({ imagePosition: value }); }, className: 'advgb-child-select' }), (postView === 'frontpage' && frontpageStyle === 'headline' || postView === 'slider' && sliderStyle === 'headline') && React.createElement( Fragment, null, React.createElement(RangeControl, { label: __('Image opacity', 'advanced-gutenberg'), value: imageOpacity, min: 0, max: 1, step: 0.1, onChange: function onChange(value) { return setAttributes({ imageOpacity: value }); }, className: 'advgb-child-range' }), React.createElement( 'div', { className: 'advgb-child-advcolor' }, React.createElement(_components.AdvColorControl, { label: __('Overlay Color', 'advanced-gutenberg'), value: imageOverlayColor, onChange: function onChange(value) { return setAttributes({ imageOverlayColor: value }); } }) ) ), React.createElement(ToggleControl, { label: __('Display Caption', 'advanced-gutenberg'), checked: displayFeaturedImageCaption, onChange: function onChange() { return setAttributes({ displayFeaturedImageCaption: !displayFeaturedImageCaption }); }, className: 'advgb-child-toggle' }) ), React.createElement(ToggleControl, { label: __('Display Post Author', 'advanced-gutenberg'), checked: displayAuthor, onChange: function onChange() { return setAttributes({ displayAuthor: !displayAuthor }); } }), displayAuthor && React.createElement( Fragment, null, React.createElement(SelectControl, { value: displayAuthorFor, options: DISPLAY_FOR, onChange: function onChange(value) { setAttributes({ displayAuthorFor: value }); }, className: 'advgb-child-select' }), React.createElement(ToggleControl, { label: __('Open link in new tab', 'advanced-gutenberg'), checked: !!authorLinkNewTab, onChange: function onChange() { return setAttributes({ authorLinkNewTab: !authorLinkNewTab }); }, className: 'advgb-child-toggle' }) ), React.createElement(SelectControl, { label: __('Display Post Date', 'advanced-gutenberg'), value: postDate, options: [{ label: __('Hide', 'advanced-gutenberg'), value: 'hide' }, { label: __('Created Date', 'advanced-gutenberg'), value: 'created' }, { label: __('Updated Date', 'advanced-gutenberg'), value: 'updated' }], onChange: function onChange(value) { setAttributes({ postDate: value }); } }), postDate !== 'hide' && React.createElement( Fragment, null, React.createElement(SelectControl, { value: postDateFor, options: DISPLAY_FOR, onChange: function onChange(value) { setAttributes({ postDateFor: value }); }, className: 'advgb-child-select' }), React.createElement(SelectControl, { label: __('Post Date Format', 'advanced-gutenberg'), value: postDateFormat, options: [{ label: __('Absolute', 'advanced-gutenberg'), value: 'absolute' }, { label: __('Relative', 'advanced-gutenberg'), value: 'relative' }], onChange: function onChange(value) { setAttributes({ postDateFormat: value }); }, className: 'advgb-child-select' }), postDateFormat === 'absolute' && React.createElement(ToggleControl, { label: __('Display Post Time', 'advanced-gutenberg'), checked: displayTime, onChange: function onChange() { return setAttributes({ displayTime: !displayTime }); }, className: 'advgb-child-toggle' }) ), postType === 'post' && React.createElement( Fragment, null, React.createElement(ToggleControl, { label: __('Display Comment Counts', 'advanced-gutenberg'), checked: displayCommentCount, onChange: function onChange() { return setAttributes({ displayCommentCount: !displayCommentCount }); } }), displayCommentCount && React.createElement(SelectControl, { value: displayCommentCountFor, options: DISPLAY_FOR, onChange: function onChange(value) { setAttributes({ displayCommentCountFor: value }); }, className: 'advgb-child-select' }) ), postType === 'post' && React.createElement( Fragment, null, React.createElement(SelectControl, { label: __('Display Category', 'advanced-gutenberg'), value: showCategories, options: [{ label: __('Hide', 'advanced-gutenberg'), value: 'hide' }, { label: __('Show', 'advanced-gutenberg'), value: 'show' }, { label: __('Show & Link', 'advanced-gutenberg'), value: 'link' }], onChange: function onChange(value) { setAttributes({ showCategories: value }); } }), showCategories !== 'hide' && React.createElement(SelectControl, { value: showCategoriesFor, options: DISPLAY_FOR, onChange: function onChange(value) { setAttributes({ showCategoriesFor: value }); }, className: 'advgb-child-select' }), React.createElement(SelectControl, { label: __('Display Tags', 'advanced-gutenberg'), value: showTags, options: [{ label: __('Hide', 'advanced-gutenberg'), value: 'hide' }, { label: __('Show', 'advanced-gutenberg'), value: 'show' }, { label: __('Show & Link', 'advanced-gutenberg'), value: 'link' }], onChange: function onChange(value) { setAttributes({ showTags: value }); } }), showTags !== 'hide' && React.createElement(SelectControl, { value: showTagsFor, options: DISPLAY_FOR, onChange: function onChange(value) { setAttributes({ showTagsFor: value }); }, className: 'advgb-child-select' }) ), !INBUILT_POST_TYPES.includes(postType) && taxonomyList && taxonomyList.length > 0 && React.createElement( Fragment, null, React.createElement(FormTokenField, { multiple: true, suggestions: taxonomyList && taxonomyList.length > 0 && taxonomyList.map(function (tax) { return decodeEntities(tax.name); }), value: showCustomTaxList, label: __('Display these taxonomies', 'advanced-gutenberg'), onChange: function onChange(value) { _this3.selectTaxonomies(value); } }), showCustomTaxList.length > 0 && React.createElement( Fragment, null, React.createElement(SelectControl, { value: showCustomTaxListFor, options: DISPLAY_FOR, onChange: function onChange(value) { setAttributes({ showCustomTaxListFor: value }); }, className: 'advgb-child-select' }), React.createElement(ToggleControl, { label: __('Link above taxonomies', 'advanced-gutenberg'), checked: linkCustomTax, onChange: function onChange() { return setAttributes({ linkCustomTax: !linkCustomTax }); }, className: 'advgb-child-toggle' }) ) ), React.createElement(ToggleControl, { label: __('Display Read More Link', 'advanced-gutenberg'), checked: displayReadMore, onChange: function onChange() { return setAttributes({ displayReadMore: !displayReadMore }); } }), displayReadMore && React.createElement( Fragment, null, React.createElement(SelectControl, { value: displayReadMoreFor, options: DISPLAY_FOR, onChange: function onChange(value) { setAttributes({ displayReadMoreFor: value }); }, className: 'advgb-child-select' }), React.createElement(TextControl, { label: __('Read more text', 'advanced-gutenberg'), value: readMoreLbl, onChange: function onChange(value) { return setAttributes({ readMoreLbl: value }); }, className: 'advgb-child-select' }) ), React.createElement(ToggleControl, { label: __('Display Post Excerpt', 'advanced-gutenberg'), checked: displayExcerpt, onChange: function onChange() { return setAttributes({ displayExcerpt: !displayExcerpt }); } }), displayExcerpt && React.createElement( Fragment, null, React.createElement(SelectControl, { value: displayExcerptFor, options: DISPLAY_FOR, onChange: function onChange(value) { setAttributes({ displayExcerptFor: value }); }, className: 'advgb-child-select' }), React.createElement(ToggleControl, { label: __('First Post text as Excerpt', 'advanced-gutenberg'), help: __('Display some part of first text found in post as excerpt.', 'advanced-gutenberg'), checked: postTextAsExcerpt, onChange: function onChange() { return setAttributes({ postTextAsExcerpt: !postTextAsExcerpt }); }, className: 'advgb-child-toggle' }), postTextAsExcerpt && React.createElement(RangeControl, { label: __('Post Text Excerpt length', 'advanced-gutenberg'), min: 50, max: 300, value: postTextExcerptLength, onChange: function onChange(value) { return setAttributes({ postTextExcerptLength: value }); }, className: 'advgb-child-range' }) ), React.createElement(TextareaControl, { label: __('Text after title', 'advanced-gutenberg'), help: __('Include text/HTML after title', 'advanced-gutenberg'), value: textAfterTitle, onChange: function onChange(value) { return setAttributes({ textAfterTitle: value }); } }), React.createElement(TextareaControl, { label: __('Text before read more', 'advanced-gutenberg'), help: __('Include text/HTML before read more', 'advanced-gutenberg'), value: textBeforeReadmore, onChange: function onChange(value) { return setAttributes({ textBeforeReadmore: value }); } }) ), this.isPro() && React.createElement( Fragment, null, React.createElement( PanelBody, { title: __('Reorder Sections', 'advanced-gutenberg'), initialOpen: false, className: 'advgb-pro-icon' }, React.createElement(SelectControl, { label: __('Sections order', 'advanced-gutenberg'), help: __('When the image in desktop floats next to the content, or is displayed as background, the image order is ignored. Also the image order in mobile can be ignored for some views.', 'advanced-gutenberg'), value: orderSections, options: ORDER_SECTIONS, onChange: function onChange(value) { return setAttributes({ orderSections: value }); } }) ) ) ); var hasPosts = Array.isArray(recentPosts) && recentPosts.length; // If no posts found we show this notice if (!hasPosts) { return isPreview ? React.createElement('img', { alt: __('Content Display', 'advanced-gutenberg'), width: '100%', src: previewImageData }) : React.createElement( Fragment, null, inspectorControls, React.createElement( Placeholder, { icon: advRecentPostsBlockIcon, label: __('Content Display Block', 'advanced-gutenberg') }, !Array.isArray(recentPosts) ? React.createElement(Spinner, null) : __('No posts found! Try to change filters or publish posts.', 'advanced-gutenberg') ) ); } var postViewControls = [{ icon: 'grid-view', title: __('Grid View', 'advanced-gutenberg'), onClick: function onClick() { return setAttributes({ postView: 'grid' }); }, isActive: postView === 'grid' }, { icon: 'list-view', title: __('List View', 'advanced-gutenberg'), onClick: function onClick() { return setAttributes({ postView: 'list' }); }, isActive: postView === 'list' }, { icon: 'slides', title: __('Slider View', 'advanced-gutenberg'), onClick: function onClick() { return setAttributes({ postView: 'slider' }); }, isActive: postView === 'slider' }, { icon: 'table-row-before', title: __('Frontpage View', 'advanced-gutenberg'), onClick: function onClick() { return setAttributes({ postView: 'frontpage' }); }, isActive: postView === 'frontpage' }, { icon: 'admin-site-alt3', title: __('Newspaper View', 'advanced-gutenberg'), onClick: function onClick() { setAttributes({ postView: 'newspaper' }); _this3.newspaperOnChangeLayout(newspaperLayout); }, isActive: postView === 'newspaper' }, { icon: 'tagcloud', title: __('Masonry View', 'advanced-gutenberg'), onClick: function onClick() { return setAttributes({ postView: 'masonry' }); }, isActive: postView === 'masonry' }]; var blockClassName = [id, 'advgb-recent-posts-block', this.state.updating && 'loading', postView && postView + '-view', postView === 'list' && imagePosition !== 'left' && 'image-' + imagePosition, (postView === 'grid' || postView === 'masonry') && 'columns-' + columns, postView === 'masonry' && 'tbl-columns-' + columnsT + ' ' + 'mbl-columns-' + columnsM, postView === 'slider' && sliderStyle && 'style-' + sliderStyle, postView === 'frontpage' && frontpageLayout && 'layout-' + frontpageLayout, postView === 'frontpage' && frontpageLayoutT && 'tbl-layout-' + frontpageLayoutT, postView === 'frontpage' && frontpageLayoutM && 'mbl-layout-' + frontpageLayoutM, (postView === 'frontpage' || postView === 'masonry') && gap && 'gap-' + gap, postView === 'frontpage' && frontpageStyle && 'style-' + frontpageStyle, postView === 'newspaper' && newspaperLayout && 'layout-' + newspaperLayout, advgbBlocks.advgb_pro === '1' && orderSections && 'sections-' + orderSections].filter(Boolean).join(' '); return isPreview ? React.createElement('img', { alt: __('Content Display', 'advanced-gutenberg'), width: '100%', src: previewImageData }) : React.createElement( Fragment, null, inspectorControls, React.createElement( BlockControls, null, React.createElement(ToolbarGroup, { controls: postViewControls }), React.createElement( ToolbarGroup, null, React.createElement(ToolbarButton, { icon: 'update', label: __('Refresh', 'advanced-gutenberg'), onClick: function onClick() { return setAttributes({ myToken: Math.floor(Math.random() * Math.floor(999)) }); } }) ) ), React.createElement( 'div', { className: blockClassName }, this.state.updating && React.createElement('div', { className: 'advgb-recent-posts-loading' }), React.createElement( 'div', { className: 'advgb-recent-posts' }, recentPosts.map(function (post, index) { return React.createElement( 'article', { key: index, className: 'advgb-recent-post ' + (_this3.checkElementDisplay('image', index) && (post.featured_img || enablePlaceholderImage) ? "" : "advgb-recent-post--no-image") }, function () { if (_this3.checkElementDisplay('image', index) && (post.featured_img || enablePlaceholderImage) && _this3.getDisplayImageVsOrder(attributes, index) === 'ignore-order') { return React.createElement( 'div', { className: 'advgb-post-thumbnail' }, React.createElement( 'a', { href: post.link, target: '_blank' }, React.createElement('img', { src: post.featured_img ? post.featured_img : advgbBlocks.post_thumb, alt: __('Post Image', 'advanced-gutenberg') }), displayFeaturedImageCaption && post.featured_img_caption.length > 0 && React.createElement( 'span', { 'class': 'advgb-post-caption' }, post.featured_img_caption ) ) ); } else if (postView === 'frontpage' && frontpageStyle === 'headline' || postView === 'slider' && sliderStyle === 'headline' && _this3.getDisplayImageVsOrder(attributes, index) === 'ignore-order') { return React.createElement( 'div', { className: 'advgb-post-thumbnail advgb-post-thumbnail-no-image' }, React.createElement('a', { href: post.link, target: '_blank' }) ); } else { {/* Nothing to do here */} } }(), React.createElement( 'div', { className: 'advgb-post-wrapper' }, function () { if (_this3.checkElementDisplay('image', index) && (post.featured_img || enablePlaceholderImage) && _this3.getDisplayImageVsOrder(attributes, index) === 'apply-order') { return React.createElement( 'div', { className: 'advgb-post-thumbnail' }, React.createElement( 'a', { href: post.link, target: '_blank' }, React.createElement('img', { src: post.featured_img ? post.featured_img : advgbBlocks.post_thumb, alt: __('Post Image', 'advanced-gutenberg') }), displayFeaturedImageCaption && post.featured_img_caption.length > 0 && React.createElement( 'span', { 'class': 'advgb-post-caption' }, post.featured_img_caption ) ) ); } }(), React.createElement( 'h2', { className: 'advgb-post-title' }, React.createElement( 'a', { href: post.link, target: '_blank' }, decodeEntities(post.title.rendered) ) ), textAfterTitle && React.createElement( RawHTML, { className: 'advgb-text-after-title' }, textAfterTitle ), (_this3.checkElementDisplay('author', index) && (post.coauthors && post.coauthors.length > 0 || !post.coauthors || post.coauthors.length === 0) || _this3.checkElementDisplay('date', index) || postType === 'post' && _this3.checkElementDisplay('comments', index)) && React.createElement( Fragment, null, React.createElement( 'div', { className: 'advgb-post-info' }, _this3.checkElementDisplay('author', index) && post.coauthors && post.coauthors.length > 0 && post.coauthors.map(function (coauthor, coauthor_indx) { return React.createElement( Fragment, null, React.createElement( 'a', { href: coauthor.link, target: '_blank', className: 'advgb-post-author' }, coauthor.display_name ), coauthor_indx < post.coauthors.length - 1 && React.createElement( 'span', null, ', ' ) ); }), _this3.checkElementDisplay('author', index) && (!post.coauthors || post.coauthors.length === 0) && React.createElement( 'a', { href: post.author_meta.author_link, target: '_blank', className: 'advgb-post-author' }, post.author_meta.display_name ), _this3.checkElementDisplay('date', index) && React.createElement( 'span', { className: 'advgb-post-datetime' }, _this3.getDateTime(post) ), postType === 'post' && _this3.checkElementDisplay('comments', index) && React.createElement( 'span', { className: 'advgb-post-comments' }, React.createElement('span', { 'class': 'dashicons dashicons-admin-comments' }), '(', post.comment_count, ')' ) ) ), (_this3.checkElementDisplay('categories', index) && post.tax_additional && post.tax_additional.categories || _this3.checkElementDisplay('tags', index) && post.tax_additional && post.tax_additional.tags || !INBUILT_POST_TYPES.includes(postType) && post.tax_additional && _this3.checkElementDisplay('customtax', index)) && React.createElement( Fragment, null, React.createElement( 'div', { className: 'advgb-post-tax-info' }, _this3.checkElementDisplay('categories', index) && post.tax_additional && post.tax_additional.categories && React.createElement( 'div', { className: 'advgb-post-tax advgb-post-category' }, showCategories === 'show' && post.tax_additional.categories.unlinked.map(function (cat, index) { return React.createElement( RawHTML, null, cat ); }), showCategories === 'link' && post.tax_additional.categories.linked.map(function (cat, index) { return React.createElement( RawHTML, null, cat ); }) ), _this3.checkElementDisplay('tags', index) && post.tax_additional && post.tax_additional.tags && React.createElement( 'div', { className: 'advgb-post-tax advgb-post-tag' }, showTags === 'show' && post.tax_additional.tags.unlinked.map(function (tag, index) { return React.createElement( RawHTML, null, tag ); }), showTags === 'link' && post.tax_additional.tags.linked.map(function (tag, index) { return React.createElement( RawHTML, null, tag ); }) ), !INBUILT_POST_TYPES.includes(postType) && post.tax_additional && _this3.getTaxSlugs().map(function (taxSlug) { return React.createElement( 'div', { className: "advgb-post-tax advgb-post-cpt advgb-post-" + taxSlug }, !linkCustomTax && post.tax_additional[taxSlug] && post.tax_additional[taxSlug].unlinked.map(function (tag, index) { return React.createElement( RawHTML, null, tag ); }), linkCustomTax && post.tax_additional[taxSlug] && post.tax_additional[taxSlug].linked.map(function (tag, index) { return React.createElement( RawHTML, null, tag ); }) ); }) ) ), React.createElement( 'div', { className: 'advgb-post-content' }, _this3.checkElementDisplay('excerpt', index) && React.createElement('div', { className: 'advgb-post-excerpt', dangerouslySetInnerHTML: { __html: postTextAsExcerpt ? RecentPostsEdit.extractContent(post.content.rendered, postTextExcerptLength) : post.excerpt ? post.excerpt.raw : '' } }), textBeforeReadmore && React.createElement( 'div', { className: 'advgb-text-before-readmore' }, React.createElement( RawHTML, null, textBeforeReadmore ) ), _this3.checkElementDisplay('readmore', index) && React.createElement( 'div', { className: 'advgb-post-readmore' }, React.createElement( 'a', { href: post.link, target: '_blank' }, readMoreLbl ? readMoreLbl : __('Read More', 'advanced-gutenberg') ) ) ) ) ); }) ) ), React.createElement( 'div', null, React.createElement( 'style', null, '.' + id + '.advgb-recent-posts-block.style-headline .advgb-recent-posts .advgb-recent-post .advgb-post-thumbnail {\n background: ' + imageOverlayColor + ';\n }\n .' + id + '.advgb-recent-posts-block.style-headline .advgb-recent-posts .advgb-recent-post .advgb-post-thumbnail a img {\n opacity: ' + imageOpacity + ';\n }' ) ) ); } /** * Get current include/exclude posts merged with the ones from search */ }, { key: 'getMergedPosts', value: function getMergedPosts() { var _props6 = this.props, postsToSearch = _props6.postsToSearch, postsToSearchResolved = _props6.postsToSearchResolved, postsToInclude = _props6.postsToInclude, postsToIncludeResolved = _props6.postsToIncludeResolved, postsToExclude = _props6.postsToExclude, postsToExcludeResolved = _props6.postsToExcludeResolved; var mergedPosts = null; if (postsToSearchResolved && !postsToIncludeResolved && !postsToExcludeResolved) { // Get only searchString mergedPosts = postsToSearch; } else if (postsToSearchResolved && postsToIncludeResolved && !postsToExcludeResolved) { // Get searchString and includePosts mergedPosts = postsToSearch.concat(postsToInclude); } else if (postsToSearchResolved && !postsToIncludeResolved && postsToExcludeResolved) { // Get searchString and excludePosts mergedPosts = postsToSearch.concat(postsToExclude); } else if (!postsToSearchResolved && postsToIncludeResolved && !postsToExcludeResolved) { // Get only includePosts mergedPosts = postsToInclude; } else if (!postsToSearchResolved && !postsToIncludeResolved && postsToExcludeResolved) { // Get only excludePosts mergedPosts = postsToExclude; } else { // Nothing to do here. mergedPosts is null } return mergedPosts; } /** * Get post titles for include and exclude */ }, { key: 'getPostSuggestions', value: function getPostSuggestions(posts, type) { var _props7 = this.props, postsToSearchResolved = _props7.postsToSearchResolved, postsToIncludeResolved = _props7.postsToIncludeResolved, postsToExcludeResolved = _props7.postsToExcludeResolved; if ('exclude' === type) { return posts !== null ? posts.map(function (post) { return post.title.raw; }) : []; } else if ('include' === type && this.isPro()) { return posts !== null && (postsToSearchResolved || postsToIncludeResolved) ? posts.map(function (post) { return post.title.raw; }) : []; } else { return null; } } }, { key: 'selectCategories', value: function selectCategories(tokens) { var categoriesList = this.state.categoriesList; var hasNoSuggestion = tokens.some(function (token) { return typeof token === 'string' && !categoriesList[token]; }); if (hasNoSuggestion) { return; } var categories = tokens.map(function (token) { return typeof token === 'string' ? categoriesList[token] : token; }); this.props.setAttributes({ categories: categories }); } }, { key: 'selectTags', value: function selectTags(tokens) { var _state2 = this.state, tagsList = _state2.tagsList, tagNameVsId = _state2.tagNameVsId; var hasNoSuggestion = tokens.some(function (token) { return typeof token === 'string' && !tagNameVsId[token]; }); if (hasNoSuggestion) { return; } var tags = tokens.map(function (token) { return typeof token === 'string' && tagNameVsId[token] ? token : token; }); var tagIds = tokens.map(function (token) { return typeof token === 'string' ? tagNameVsId[token] : token.id; }); this.props.setAttributes({ tags: tags, tagIds: tagIds }); } }, { key: 'getTagIdsForTags', value: function getTagIdsForTags(tags) { var tagNameVsId = this.state.tagNameVsId; return tags.map(function (tag) { return tagNameVsId[tag]; }); } }, { key: 'getCategoryForBkwrdCompat', value: function getCategoryForBkwrdCompat(id) { var catIdVsName = this.state.catIdVsName; return { id: id, name: catIdVsName[id] }; } }, { key: 'getPostTitles', value: function getPostTitles(posts, postsToSelect) { var field_value = []; if (typeof posts !== 'undefined' && postsToSelect !== null) { field_value = posts.map(function (post_id) { var find_post = postsToSelect.find(function (post) { return post.id === post_id; }); if (find_post === undefined || !find_post) { return post_id; // It should return false but creates empty selections } return find_post.title.raw; }); } return field_value; } }, { key: 'getPostIds', value: function getPostIds(posts, postsToSelect, type) { var posts_array = []; posts.map(function (post_title) { var matching_post = postsToSelect.find(function (post) { return post.title.raw === post_title; }); if (matching_post !== undefined) { posts_array.push(matching_post.id); } }); var selectType = type + 'Posts'; this.props.setAttributes(_defineProperty({}, selectType, posts_array)); if ('include' === type) { this.props.setAttributes({ excludePosts: [], showCustomTaxList: [], taxonomies: {}, categories: [], tags: [], author: '', onlyFromCurrentUser: false, offset: 0 }); } } }, { key: 'selectPostByTitle', value: function selectPostByTitle(tokens, type) { var _props$setAttributes2; var postTitleVsIdMap = this.state.postTitleVsIdMap; var hasNoSuggestion = tokens.some(function (token) { return typeof token === 'string' && (typeof postTitleVsIdMap === 'undefined' || !postTitleVsIdMap[token]); }); if (hasNoSuggestion) { return; } var ids = tokens.map(function (token) { return typeof token === 'string' ? postTitleVsIdMap[token] : token.id; }); var typeForQuery = type + 'Ids'; this.props.setAttributes((_props$setAttributes2 = {}, _defineProperty(_props$setAttributes2, type, tokens), _defineProperty(_props$setAttributes2, typeForQuery, ids), _props$setAttributes2)); // Exclude posts, backward compatibility 2.13.1 and lower this.props.setAttributes({ exclude: [], excludeIds: [], excludePosts: ids }); } }, { key: 'updatePostType', value: function updatePostType(postType) { this.setState({ taxonomyList: null }); this.generateTaxFilters(postType); this.props.setAttributes({ postType: postType, excludePosts: [], includePosts: [], offset: 0, showCustomTaxList: [], taxonomies: {}, categories: [] }); } /* Check if PP Series plugin is active and enabled for current postType or if is a CPT to call sidebar filters */ }, { key: 'generateTaxFilters', value: function generateTaxFilters(postType) { if (typeof advgbBlocks.pp_series_active !== 'undefined' && parseInt(advgbBlocks.pp_series_active) && (postType === 'post' || postType === 'page') && PP_SERIES_POST_TYPES.includes(postType)) { // Enable PublishPress Series taxonomy filter in post/page when enabled through Series plugin this.generateSeriesTax(postType); } else if (!INBUILT_POST_TYPES.includes(postType)) { // Enable CPT taxonomy filters (may include Series taxonomy) this.generateTaxTerms(postType); } else { // Nothing to do here } } /** * Generates PublishPress Series taxonomy list for 'post' and sets it in the state as "taxonomyList". */ }, { key: 'generateSeriesTax', value: function generateSeriesTax(postType) { var _this4 = this; if (!postType) { return; } // fetch series taxonomy wp.apiFetch({ path: wp.url.addQueryArgs('wp/v2/types/' + postType, { context: 'edit' }) }).then(function (typeAttributes) { var taxonomy = []; var taxId = {}; var seriesSlug = typeof advgbBlocks.pp_series_slug !== 'undefined' ? advgbBlocks.pp_series_slug : 'series'; wp.apiFetch({ path: wp.url.addQueryArgs('wp/v2/taxonomies/' + seriesSlug, { context: 'edit' }) }).then(function (taxAttributes) { // fetch all terms wp.apiFetch({ path: wp.url.addQueryArgs('wp/v2/' + taxAttributes.rest_base + '?per_page=-1&hide_empty=true', { context: 'edit' }) }).then(function (terms) { var suggestions = []; var map = []; terms.forEach(function (term) { suggestions.push(decodeEntities(term.name)); map[decodeEntities(term.name)] = term.id; }); var preselectedName = _this4.props.attributes.taxonomies ? _this4.props.attributes.taxonomies[seriesSlug] : []; if (preselectedName) { var preselectedId = preselectedName.map(function (name) { return map[name]; }); set(taxId, seriesSlug, preselectedId); _this4.props.setAttributes({ taxIds: taxId }); } taxonomy.push({ slug: seriesSlug, name: decodeEntities(taxAttributes.name), suggestions: suggestions, map: map, hierarchical: taxAttributes.hierarchical }); _this4.setState({ updating: true }); // length === 1 due we only get the series taxonomy if (taxonomy.length === 1) { _this4.setState({ taxonomyList: taxonomy, updating: false }); } }); }); }); } /** * Generates taxonomy list for a post type and sets it in the state as "taxonomyList". */ }, { key: 'generateTaxTerms', value: function generateTaxTerms(postType) { var _this5 = this; if (!postType) { return; } // fetch all taxonomies wp.apiFetch({ path: wp.url.addQueryArgs('wp/v2/types/' + postType, { context: 'edit' }) }).then(function (typeAttributes) { var taxonomies = []; var taxIds = {}; typeAttributes.taxonomies.forEach(function (tax) { // fetch taxonomy attributes wp.apiFetch({ path: wp.url.addQueryArgs('wp/v2/taxonomies/' + tax, { context: 'edit' }) }).then(function (taxAttributes) { // fetch all terms wp.apiFetch({ path: wp.url.addQueryArgs('wp/v2/' + taxAttributes.rest_base + '?per_page=-1&hide_empty=true', { context: 'edit' }) }).then(function (terms) { var suggestions = []; var map = []; terms.forEach(function (term) { suggestions.push(decodeEntities(term.name)); map[decodeEntities(term.name)] = term.id; }); var preselectedNames = _this5.props.attributes.taxonomies ? _this5.props.attributes.taxonomies[tax] : []; if (preselectedNames) { var preselectedIds = preselectedNames.map(function (name) { return map[name]; }); set(taxIds, tax, preselectedIds); _this5.props.setAttributes({ taxIds: taxIds }); } taxonomies.push({ slug: tax, name: decodeEntities(taxAttributes.name), suggestions: suggestions, map: map, hierarchical: taxAttributes.hierarchical }); _this5.setState({ updating: true }); if (typeAttributes.taxonomies.length === taxonomies.length) { // set state only when all taxonomies have been fetched // otherwise the taxonomy boxes will appear one at a time making the page jittery // we will sort the taxonomies so that the boxes are always in a predictable, consistent order _this5.setState({ taxonomyList: sortBy(taxonomies, ['slug']), updating: false }); } }); }); }); }); } /** * Populates the taxonomy terms in the suggestions box. */ }, { key: 'populateTaxTerms', value: function populateTaxTerms(tax) { var taxonomies = this.props.attributes.taxonomies; return taxonomies && taxonomies[tax.slug]; } /** * Selects the correct the taxonomy term from the suggestions and updates the "taxonomies" attribute. */ }, { key: 'selectTaxTerms', value: function selectTaxTerms(tax, tokens) { var _props$setAttributes3; var hasNoSuggestion = tokens.some(function (token) { return typeof token === 'string' && !tax.map[token]; }); if (hasNoSuggestion) { return; } var suggestions = tokens.map(function (token) { return typeof token === 'string' && tax.map[token] ? token : token; }); var ids = tokens.map(function (token) { return typeof token === 'string' ? tax.map[token] : token.id; }); var taxonomies = this.props.attributes.taxonomies || {}; unset(taxonomies, tax.slug); if (suggestions) { set(taxonomies, tax.slug, suggestions); } var taxIds = this.props.attributes.taxIds || {}; unset(taxIds, tax.slug); if (ids) { set(taxIds, tax.slug, ids); } this.props.setAttributes((_props$setAttributes3 = { taxonomies: taxonomies }, _defineProperty(_props$setAttributes3, tax.slug, suggestions), _defineProperty(_props$setAttributes3, 'taxIds', taxIds), _props$setAttributes3)); } /** * Selects the correct taxonomy from the suggestions and updates the "showCustomTaxList" attribute. */ }, { key: 'selectTaxonomies', value: function selectTaxonomies(tokens) { var taxonomyList = this.state.taxonomyList; if (!taxonomyList) { return; } var taxList = taxonomyList && taxonomyList.length > 0 && taxonomyList.map(function (tax) { return decodeEntities(tax.name); }); var hasNoSuggestion = tokens.some(function (token) { return typeof token === 'string' && !taxList.includes(token); }); if (hasNoSuggestion) { return; } var taxes = tokens.map(function (token) { return typeof token === 'string' && taxList[token] ? token : token; }); this.props.setAttributes({ showCustomTaxList: taxes }); } /** * Returns the tax slugs corresponding to the tax names that appear in the suggestions. */ }, { key: 'getTaxSlugs', value: function getTaxSlugs() { var taxonomyList = this.state.taxonomyList; var showCustomTaxList = this.props.attributes.showCustomTaxList; if (!taxonomyList || !showCustomTaxList || showCustomTaxList.length === 0) { return []; } var slugs = showCustomTaxList.map(function (taxName) { var tax = find(taxonomyList, { name: decodeEntities(taxName) }); if (tax) { return tax.slug; } }); return slugs; } /** * Check if elementFor is within the index range. */ }, { key: 'checkElementForDisplay', value: function checkElementForDisplay(elementFor, index) { return elementFor === 'all' || index < elementFor; } /** * Check if an element is enabled for each post. */ }, { key: 'checkElementDisplay', value: function checkElementDisplay(element, index) { var _props$attributes = this.props.attributes, displayFeaturedImage = _props$attributes.displayFeaturedImage, displayFeaturedImageFor = _props$attributes.displayFeaturedImageFor, displayAuthor = _props$attributes.displayAuthor, displayAuthorFor = _props$attributes.displayAuthorFor, displayReadMore = _props$attributes.displayReadMore, displayReadMoreFor = _props$attributes.displayReadMoreFor, displayExcerpt = _props$attributes.displayExcerpt, displayExcerptFor = _props$attributes.displayExcerptFor, displayCommentCount = _props$attributes.displayCommentCount, displayCommentCountFor = _props$attributes.displayCommentCountFor, postDate = _props$attributes.postDate, postDateFor = _props$attributes.postDateFor, showCategories = _props$attributes.showCategories, showCategoriesFor = _props$attributes.showCategoriesFor, showTags = _props$attributes.showTags, showTagsFor = _props$attributes.showTagsFor, showCustomTaxList = _props$attributes.showCustomTaxList, showCustomTaxListFor = _props$attributes.showCustomTaxListFor; switch (element) { case 'image': return displayFeaturedImage && this.checkElementForDisplay(displayFeaturedImageFor, index); case 'author': return displayAuthor && this.checkElementForDisplay(displayAuthorFor, index); break; case 'readmore': return displayReadMore && this.checkElementForDisplay(displayReadMoreFor, index); break; case 'excerpt': return displayExcerpt && this.checkElementForDisplay(displayExcerptFor, index); break; case 'comments': return displayCommentCount && this.checkElementForDisplay(displayCommentCountFor, index); break; case 'date': return postDate !== 'hide' && this.checkElementForDisplay(postDateFor, index); break; case 'categories': return showCategories !== 'hide' && this.checkElementForDisplay(showCategoriesFor, index); break; case 'tags': return showTags !== 'hide' && this.checkElementForDisplay(showTagsFor, index); break; case 'customtax': return this.getTaxSlugs().length > 0 && this.checkElementForDisplay(showCustomTaxListFor, index); break; default: return false; break; } } // Skip images floating on left or right, and with headline style }, { key: 'getDisplayImageVsOrder', value: function getDisplayImageVsOrder(attributes, index) { if (attributes.orderSections === 'default' || attributes.orderSections === 'image-title-info-text' || attributes.postView === 'frontpage' && attributes.frontpageStyle === 'headline' || attributes.postView === 'slider' && attributes.sliderStyle === 'headline' || attributes.postView === 'list' || attributes.postView === 'newspaper' && (['np-2', 'np-3-1', 'np-3-2', 'np-3-3'].indexOf(attributes.newspaperLayout) > -1 || index > 0) || advgbBlocks.advgb_pro === '0') { return 'ignore-order'; } else { return 'apply-order'; } } }, { key: 'refreshOnChangeItems', value: function refreshOnChangeItems(numberOfPosts) { var _props$attributes2 = this.props.attributes, postView = _props$attributes2.postView, myToken = _props$attributes2.myToken; this.props.setAttributes({ numberOfPosts: numberOfPosts }); if (postView === 'masonry') { this.props.setAttributes({ myToken: Math.floor(Math.random() * Math.floor(999)) }); } } }, { key: 'newspaperOnChangeLayout', value: function newspaperOnChangeLayout(newspaperLayout) { var numberOfPosts = this.props.attributes.numberOfPosts; var currentLayout = NEWSPAPER_LAYOUTS.find(function (layout) { return layout.layout === newspaperLayout; }); this.props.setAttributes({ numberOfPosts: currentLayout.items }); } }, { key: 'getDateTime', value: function getDateTime(post) { var _props$attributes3 = this.props.attributes, postDate = _props$attributes3.postDate, postDateFormat = _props$attributes3.postDateFormat, displayTime = _props$attributes3.displayTime; if (postDateFormat === 'absolute') { if (postDate === 'created') { return displayTime ? post.absolute_dates_time.created : post.absolute_dates.created; } else { return displayTime ? post.absolute_dates_time.modified : post.absolute_dates.modified; } } else { return postDate === 'created' ? post.relative_dates.created : post.relative_dates.modified; } } }], [{ key: 'extractContent', value: function extractContent(html, length) { var span = document.createElement('span'); span.innerHTML = html; // Remove script tag var scripts = span.getElementsByTagName('script'); var j = scripts.length; while (j--) { scripts[j].parentNode.removeChild(scripts[j]); } // Remove style tag var styles = span.getElementsByTagName('style'); var k = styles.length; while (k--) { styles[k].parentNode.removeChild(styles[k]); } // Remove PublishPress Series box var seriesbox = span.getElementsByClassName('seriesmeta'); if (seriesbox.length === 1) { seriesbox[0].parentNode.removeChild(seriesbox[0]); } var children = span.querySelectorAll('*'); for (var i = 0; i < children.length; i++) { if (children[i].textContent) children[i].textContent += ' ';else children[i].innerText += ' '; } var text = [span.textContent || span.innerText].toString().replace(/\s\s+/g, ' '); text = text.slice(0, length).trim(); if (text.length) text += '…'; return text; } }]); return RecentPostsEdit; }(Component); registerBlockType('advgb/recent-posts', { title: __('Content Display - PublishPress', 'advanced-gutenberg'), description: __('Displays your content in grid, list, slider, frontpage, newspaper, and masonry views with beautiful layouts and styles.', 'advanced-gutenberg'), icon: { src: advRecentPostsBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('recent posts', 'advanced-gutenberg'), __('latest posts', 'advanced-gutenberg'), __('posts slide', 'advanced-gutenberg'), __('posts grid', 'advanced-gutenberg'), __('posts', 'advanced-gutenberg'), __('pages', 'advanced-gutenberg')], supports: { html: false }, example: { attributes: { isPreview: true } }, edit: withSelect(function (select, props) { var _select = select('core'), getEntityRecords = _select.getEntityRecords, hasFinishedResolution = _select.hasFinishedResolution; var _props$attributes4 = props.attributes, categories = _props$attributes4.categories, tagIds = _props$attributes4.tagIds, tags = _props$attributes4.tags, category = _props$attributes4.category, order = _props$attributes4.order, orderBy = _props$attributes4.orderBy, numberOfPosts = _props$attributes4.numberOfPosts, myToken = _props$attributes4.myToken, postType = _props$attributes4.postType, excludeCurrentPost = _props$attributes4.excludeCurrentPost, excludePosts = _props$attributes4.excludePosts, includePosts = _props$attributes4.includePosts, offset = _props$attributes4.offset, author = _props$attributes4.author, taxonomies = _props$attributes4.taxonomies, taxIds = _props$attributes4.taxIds, onlyFromCurrentUser = _props$attributes4.onlyFromCurrentUser, searchString = _props$attributes4.searchString; var catIds = categories && categories.length > 0 ? categories.map(function (cat) { return cat.id; }) : []; // We need to check if we're in post edit or widgets screen var postId = wp.data.select('core/editor') && wp.data.select('core/editor').getCurrentPostId(); var recentPostsQuery = pickBy({ categories: catIds, tags: tagIds, order: order, orderby: orderBy, per_page: numberOfPosts, token: myToken, exclude: excludeCurrentPost ? excludePosts ? union(excludePosts, [postId]) : postId : excludePosts, include: includePosts, offset: offset, author: onlyFromCurrentUser ? wp.data.select('core').getCurrentUser().id : author }, function (value) { return !isUndefined(value) && !(isArray(value) && (isNull(value) || value.length === 0)); }); var filterTaxNames = []; if (taxIds) { Object.keys(taxIds).map(function (taxSlug) { filterTaxNames.push(taxSlug); recentPostsQuery[taxSlug] = taxIds[taxSlug]; }); } var queryFields = ['id', 'title']; // Search posts var postsToSearchQuery = pickBy({ _fields: queryFields, per_page: 10, search: '"' + searchString + '"', orderby: 'title', order: 'desc' }, function (value) { return !isUndefined(value); }); var postsToSearch = advgbBlocks.advgb_pro !== 'undefined' && advgbBlocks.advgb_pro === '1' && typeof searchString !== 'undefined' && searchString.length > 0 ? getEntityRecords('postType', postType ? postType : 'post', postsToSearchQuery) : null; var postsToSearchResolved = hasFinishedResolution('getEntityRecords', ['postType', postType ? postType : 'post', postsToSearchQuery]); // Include posts var postsToIncludeQuery = pickBy({ _fields: queryFields, per_page: -1, include: includePosts }, function (value) { return !isUndefined(value); }); var postsToInclude = advgbBlocks.advgb_pro !== 'undefined' && advgbBlocks.advgb_pro === '1' && typeof includePosts !== 'undefined' && includePosts.length > 0 ? getEntityRecords('postType', postType ? postType : 'post', postsToIncludeQuery) : null; var postsToIncludeResolved = hasFinishedResolution('getEntityRecords', ['postType', postType ? postType : 'post', postsToIncludeQuery]); // Exclude posts var postsToExcludeQuery = pickBy({ _fields: queryFields, per_page: -1, include: excludePosts }, function (value) { return !isUndefined(value); }); var postsToExclude = typeof excludePosts !== 'undefined' && excludePosts.length > 0 ? getEntityRecords('postType', postType ? postType : 'post', postsToExcludeQuery) : null; var postsToExcludeResolved = hasFinishedResolution('getEntityRecords', ['postType', postType ? postType : 'post', postsToExcludeQuery]); // Modifying filters from main query for Exclude post suggestions var postSuggestionsQuery = omit(recentPostsQuery, ['exclude']); postSuggestionsQuery.per_page = typeof excludePosts !== 'undefined' && excludePosts.length > 0 ? numberOfPosts + excludePosts.length : numberOfPosts; postSuggestionsQuery._fields = queryFields; return { recentPosts: getEntityRecords('postType', postType ? postType : 'post', recentPostsQuery), postList: getEntityRecords('postType', postType ? postType : 'post', postSuggestionsQuery), postsToSearch: postsToSearch, postsToSearchResolved: postsToSearchResolved, postsToInclude: postsToInclude, postsToIncludeResolved: postsToIncludeResolved, postsToExclude: postsToExclude, postsToExcludeResolved: postsToExcludeResolved }; })(RecentPostsEdit), save: function save() { // Render in PHP return null; } }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components, wp.data, lodash, wp.htmlEntities, wp.date); /***/ }), /***/ "./src/assets/blocks/recent-posts/query-controls.jsx": /*!***********************************************************!*\ !*** ./src/assets/blocks/recent-posts/query-controls.jsx ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } var __ = wp.i18n.__; var _wp$element = wp.element, Component = _wp$element.Component, Fragment = _wp$element.Fragment; var _wp$components = wp.components, TreeSelect = _wp$components.TreeSelect, SelectControl = _wp$components.SelectControl, FormTokenField = _wp$components.FormTokenField, RangeControl = _wp$components.RangeControl; var _lodash = lodash, pickBy = _lodash.pickBy, isUndefined = _lodash.isUndefined; var _lodash2 = lodash, groupBy = _lodash2.groupBy; /** * Returns terms in a tree form. * * @param {Array} flatTerms Array of terms in flat format. * * @return {Array} Array of terms in tree format. */ function buildTermsTree(flatTerms) { var flatTermsWithParentAndChildren = flatTerms.map(function (term) { return _extends({ children: [], parent: null }, term); }); var termsByParent = groupBy(flatTermsWithParentAndChildren, 'parent'); if (termsByParent.null && termsByParent.null.length) { return flatTermsWithParentAndChildren; } var fillWithChildren = function fillWithChildren(terms) { return terms.map(function (term) { var children = termsByParent[term.id]; return _extends({}, term, { children: children && children.length ? fillWithChildren(children) : [] }); }); }; return fillWithChildren(termsByParent['0'] || []); } function AuthorSelect(_ref) { var label = _ref.label, noOptionLabel = _ref.noOptionLabel, authorList = _ref.authorList, selectedAuthorId = _ref.selectedAuthorId, onChange = _ref.onChange; var termsTree = buildTermsTree(authorList); return React.createElement(TreeSelect, _extends({ label: label, noOptionLabel: noOptionLabel, onChange: onChange }, { tree: termsTree, selectedId: selectedAuthorId })); } function CategorySelect(_ref2) { var label = _ref2.label, noOptionLabel = _ref2.noOptionLabel, categoriesList = _ref2.categoriesList, selectedCategoryId = _ref2.selectedCategoryId, onChange = _ref2.onChange, props = _objectWithoutProperties(_ref2, ['label', 'noOptionLabel', 'categoriesList', 'selectedCategoryId', 'onChange']); var termsTree = buildTermsTree(categoriesList); return React.createElement(TreeSelect, _extends({ label: label, noOptionLabel: noOptionLabel, onChange: onChange }, { tree: termsTree, selectedId: selectedCategoryId }, props)); } var DEFAULT_MIN_ITEMS = 1; var DEFAULT_MAX_ITEMS = 100; var PP_SERIES_POST_TYPES = typeof advgbBlocks.pp_series_post_types !== 'undefined' ? advgbBlocks.pp_series_post_types : ['post']; function AdvQueryControls(_ref3) { var categoriesList = _ref3.categoriesList, selectedCategoryId = _ref3.selectedCategoryId, numberOfItems = _ref3.numberOfItems, order = _ref3.order, orderBy = _ref3.orderBy, postType = _ref3.postType, _ref3$maxItems = _ref3.maxItems, maxItems = _ref3$maxItems === undefined ? DEFAULT_MAX_ITEMS : _ref3$maxItems, _ref3$minItems = _ref3.minItems, minItems = _ref3$minItems === undefined ? DEFAULT_MIN_ITEMS : _ref3$minItems, onCategoryChange = _ref3.onCategoryChange, onNumberOfItemsChange = _ref3.onNumberOfItemsChange, onOrderChange = _ref3.onOrderChange, onOrderByChange = _ref3.onOrderByChange; var orderParams = [{ label: __('Created: Newest to oldest', 'advanced-gutenberg'), value: 'date/desc' }, { label: __('Created: Oldest to newest', 'advanced-gutenberg'), value: 'date/asc' }, { /* translators: label for ordering posts by title in ascending order */ label: __('A → Z', 'advanced-gutenberg'), value: 'title/asc' }, { /* translators: label for ordering posts by title in descending order */ label: __('Z → A', 'advanced-gutenberg'), value: 'title/desc' }, { label: __('Author', 'advanced-gutenberg') + ' ' + __('A → Z', 'advanced-gutenberg'), value: 'author/asc' }, { label: __('Author', 'advanced-gutenberg') + ' ' + __('Z → A', 'advanced-gutenberg'), value: 'author/desc' }, { label: __('Modified: Newest to oldest', 'advanced-gutenberg'), value: 'modified/desc' }, { label: __('Modified: Oldest to newest', 'advanced-gutenberg'), value: 'modified/asc' }, { label: __('Post ID Descending', 'advanced-gutenberg'), value: 'id/desc' }, { label: __('Post ID Ascending', 'advanced-gutenberg'), value: 'id/asc' }]; // post and page supports more orderBy parameters if (postType === 'post' || postType === 'page') { orderParams = _.union(orderParams, [{ label: __('Randomize', 'advanced-gutenberg'), value: 'rand/asc' }]); } // post support more orderBy parameters if (postType === 'post') { orderParams = _.union(orderParams, [{ label: __('Comments, decreasing order', 'advanced-gutenberg'), value: 'comment_count/desc' }, { label: __('Comments, increasing order', 'advanced-gutenberg'), value: 'comment_count/asc' }]); } if (typeof advgbBlocks.pp_series_active !== 'undefined' && parseInt(advgbBlocks.pp_series_active) && PP_SERIES_POST_TYPES.includes(postType)) { orderParams = _.union(orderParams, [{ label: __('Series order', 'advanced-gutenberg'), value: 'series_order/asc' }]); } return [onOrderChange && onOrderByChange && React.createElement(SelectControl, { key: 'query-controls-order-select', label: __('Order by', 'advanced-gutenberg'), value: orderBy + '/' + order, options: orderParams, onChange: function onChange(value) { var _value$split = value.split('/'), _value$split2 = _slicedToArray(_value$split, 2), newOrderBy = _value$split2[0], newOrder = _value$split2[1]; if (newOrder !== order) { onOrderChange(newOrder); } if (newOrderBy !== orderBy) { onOrderByChange(newOrderBy); } } }), categoriesList && onCategoryChange && React.createElement(CategorySelect, { key: 'query-controls-category-select', categoriesList: categoriesList, label: __('Category', 'advanced-gutenberg'), noOptionLabel: __('All', 'advanced-gutenberg'), selectedCategoryId: selectedCategoryId, onChange: onCategoryChange }), onNumberOfItemsChange && React.createElement(RangeControl, { key: 'query-controls-range-control', label: __('Number of items', 'advanced-gutenberg'), value: numberOfItems, onChange: onNumberOfItemsChange, min: minItems, max: maxItems, required: true })]; } exports.default = AdvQueryControls; exports.AuthorSelect = AuthorSelect; /***/ }), /***/ "./src/assets/blocks/search-bar/block.jsx": /*!************************************************!*\ !*** ./src/assets/blocks/search-bar/block.jsx ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _components = __webpack_require__(/*! ../0-adv-components/components.jsx */ "./src/assets/blocks/0-adv-components/components.jsx"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, RichText = _wpBlockEditor.RichText, PanelColorSettings = _wpBlockEditor.PanelColorSettings; var RangeControl = wpComponents.RangeControl, PanelBody = wpComponents.PanelBody, TextControl = wpComponents.TextControl, ToggleControl = wpComponents.ToggleControl; var searchBlockIcon = React.createElement( "svg", { fill: "none", height: "20", width: "20", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, React.createElement("circle", { fill: "none", cx: "11", cy: "11", r: "8" }), React.createElement("line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65" }) ); var SEARCH_ICONS = { icon1: searchBlockIcon, icon2: React.createElement( "svg", { fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24" }, React.createElement("path", { fill: "none", d: "M0 0h24v24H0V0zm0 0h24v24H0V0z" }), React.createElement("path", { d: "M17.01 14h-.8l-.27-.27c.98-1.14 1.57-2.61 1.57-4.23 0-3.59-2.91-6.5-6.5-6.5s-6.5 3-6.5 6.5H2l3.84 4 4.16-4H6.51C6.51 7 8.53 5 11.01 5s4.5 2.01 4.5 4.5c0 2.48-2.02 4.5-4.5 4.5-.65 0-1.26-.14-1.82-.38L7.71 15.1c.97.57 2.09.9 3.3.9 1.61 0 3.08-.59 4.22-1.57l.27.27v.79l5.01 4.99L22 19l-4.99-5z" }) ), icon3: React.createElement( "svg", { fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24" }, React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }), React.createElement("path", { d: "M20.94 11c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z" }) ), icon4: React.createElement( "svg", { fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24" }, React.createElement("path", { fill: "none", d: "M0 0h24v24H0V0z" }), React.createElement("path", { d: "M18 13v7H4V6h5.02c.05-.71.22-1.38.48-2H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-5l-2-2zm-1.5 5h-11l2.75-3.53 1.96 2.36 2.75-3.54zm2.8-9.11c.44-.7.7-1.51.7-2.39C20 4.01 17.99 2 15.5 2S11 4.01 11 6.5s2.01 4.5 4.49 4.5c.88 0 1.7-.26 2.39-.7L21 13.42 22.42 12 19.3 8.89zM15.5 9C14.12 9 13 7.88 13 6.5S14.12 4 15.5 4 18 5.12 18 6.5 16.88 9 15.5 9z" }), React.createElement("path", { fill: "none", d: "M0 0h24v24H0z" }) ), icon5: React.createElement( "svg", { fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "2 2 22 22" }, React.createElement("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ), icon6: React.createElement( "svg", { width: "20", height: "20", viewBox: "0 0 26 26", xmlns: "http://www.w3.org/2000/svg" }, React.createElement("path", { d: "M14.9462891,1C9.4033203,1,4.8935547,5.5097656,4.8935547,11.0532227 c0,2.5022583,0.9248047,4.7885132,2.4428101,6.5498657l-6.1166382,6.1166382c-0.2929688,0.2929688-0.2929688,0.7675781,0,1.0605469 C1.3662109,24.9267578,1.5576172,25,1.75,25s0.3837891-0.0732422,0.5302734-0.2197266l6.1165771-6.1165771 c1.7612305,1.5180054,4.0474243,2.442749,6.5494385,2.442749C20.4902344,21.1064453,25,16.5966797,25,11.0532227 S20.4902344,1,14.9462891,1z M14.9462891,19.6064453c-4.7158203,0-8.5527344-3.8369141-8.5527344-8.5532227 S10.2304688,2.5,14.9462891,2.5C19.6630859,2.5,23.5,6.3369141,23.5,11.0532227S19.6630859,19.6064453,14.9462891,19.6064453z", fill: "currentColor" }) ) }; var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAABNCAYAAACPI3nwAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABcFJREFUeNrs3T1P61Ycx/Fj5wHCQyqBEMoVS1VVYu9WYEDqWFhKN4TEHvUV8AaQEHNfwR0qITZadezUW3ViYkSCwsDj5SlAiN38c+3IOCexA45jw/cjHQUCN8kN/vl/zrGdoxQAAAAAAAAAAAAAAAAAAAAAAAAAAFEzoniQbDbLOwn0wNPTU/xB9wTa6OWOA4Cy293/kvAbXQTc8P07g5ADsYbd9t0XOvRGlyE3NE1pbgFEE3LbF3LbF/hQYTdChtzfzIDAA4gu6N5m6UIfFHajy5Cbbtve3v4wPT39jW3bWcuyVP3WqDf+PEAEDMOQTNX29/f/W1xc3HcC7m+hw94p6O7PTE/Is+vr61+Vy+Vf8/n8In8OoPeq1eq/a2trP21ubn6uf1vzNMtT5WWGvm2lzYSo5m4Vz25tbU0tL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t/zc7O5orF4ne8/UDvnZyc/L60tPTLp0+fbtSX5ZKflH75ZLvd0QTtgMVZG927KoSM5eWg+IBzmyuXy6WZmZmv5Wf1B3cXd+Cz34FoSGit3d3d442NjQMn0FUn5I9Oq/pCb7dbIz0o6M210d2Ae5p3RccXf/47AH3QvcNmX9Crnvbk7cq3C3rYWXf3ibxhtp37Mqp11QgArwu5N3/ebvqTp4pbSj85Fy7oMqB31mDzB937Qix37E7QgdiCXmsT9I4fbJEN8YS60b2l9AuxA4i++255iq2lnk/CWSrEsfRswJMYmsDbTrgtxudArON0f7M1vQCtziswfum+e7vk/mAbBB2IJej+0D87YSbo8+iCF1BvDXunlVYJOxDtON0feNVtyEMH0wm7P/Aq4GsA0QVde1/YT5btKpiawL/6MQF0DHnLz9KyTBkAAAAAAAAAAAAAAAAAAAAAAAAAAABS738BBgAbjEeHhJ/yegAAAABJRU5ErkJggg=='; var SearchBarEdit = function (_Component) { _inherits(SearchBarEdit, _Component); function SearchBarEdit() { _classCallCheck(this, SearchBarEdit); return _possibleConstructorReturn(this, (SearchBarEdit.__proto__ || Object.getPrototypeOf(SearchBarEdit)).apply(this, arguments)); } _createClass(SearchBarEdit, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-search-bar']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === "undefined" ? "undefined" : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: "componentDidMount", value: function componentDidMount() { var _props2 = this.props, clientId = _props2.clientId, attributes = _props2.attributes, setAttributes = _props2.setAttributes; var searchBtnId = attributes.searchBtnId; setAttributes({ searchBtnId: "advgb-search-btn-" + clientId }); } }, { key: "render", value: function render() { var _props3 = this.props, attributes = _props3.attributes, setAttributes = _props3.setAttributes, className = _props3.className; var fullWidth = attributes.fullWidth, width = attributes.width, textColor = attributes.textColor, backgroundColor = attributes.backgroundColor, searchIcon = attributes.searchIcon, searchIconOnRight = attributes.searchIconOnRight, searchPlaceholder = attributes.searchPlaceholder, searchButtonEnabled = attributes.searchButtonEnabled, searchButtonText = attributes.searchButtonText, searchButtonTextColor = attributes.searchButtonTextColor, searchButtonBgColor = attributes.searchButtonBgColor, searchButtonRadius = attributes.searchButtonRadius, searchButtonOnLeft = attributes.searchButtonOnLeft, searchBtnId = attributes.searchBtnId, searchBtnHoverColor = attributes.searchBtnHoverColor, searchBtnHoverBgColor = attributes.searchBtnHoverBgColor, searchBtnHoverShadow = attributes.searchBtnHoverShadow, searchBtnHoverShadowH = attributes.searchBtnHoverShadowH, searchBtnHoverShadowV = attributes.searchBtnHoverShadowV, searchBtnHoverShadowBlur = attributes.searchBtnHoverShadowBlur, searchBtnHoverShadowSpread = attributes.searchBtnHoverShadowSpread, searchBtnHoverOpacity = attributes.searchBtnHoverOpacity, searchBtnHoverTranSpeed = attributes.searchBtnHoverTranSpeed, isPreview = attributes.isPreview; var searchBarIcon = React.createElement( "span", { className: "advgb-search-bar-icon" }, searchIcon ? SEARCH_ICONS[searchIcon] : searchBlockIcon ); var searchBarButton = !searchButtonEnabled ? '' : React.createElement( "div", { className: "advgb-search-button-wrapper" }, React.createElement( "span", { className: "advgb-search-bar-button", style: { color: searchButtonTextColor, borderColor: searchButtonTextColor, backgroundColor: searchButtonBgColor, borderRadius: searchButtonRadius } }, React.createElement(RichText, { tagName: "span", value: searchButtonText, onChange: function onChange(value) { return setAttributes({ searchButtonText: value.trim() }); }, onReplace: function onReplace() { return null; }, onSplit: function onSplit() { return null; }, placeholder: 'Search', keepPlaceholderOnFocus: true }) ) ); return isPreview ? React.createElement("img", { alt: __('Search Bar', 'advanced-gutenberg'), width: "100%", src: previewImageData }) : React.createElement( Fragment, null, React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Search Bar State', 'advanced-gutenberg') }, React.createElement(ToggleControl, { label: __('Full width', 'advanced-gutenberg'), checked: fullWidth, onChange: function onChange() { return setAttributes({ fullWidth: !fullWidth }); } }), !fullWidth && React.createElement(RangeControl, { label: __('Width', 'advanced-gutenberg'), value: width, onChange: function onChange(value) { return setAttributes({ width: value }); }, min: 300, max: 2000 }) ), React.createElement( PanelBody, { title: __('Search Icon Settings', 'advanced-gutenberg') }, React.createElement(ToggleControl, { label: __('Search icon on the right', 'advanced-gutenberg'), checked: searchIconOnRight, onChange: function onChange() { return setAttributes({ searchIconOnRight: !searchIconOnRight }); } }), React.createElement( "div", { className: "advgb-icon-items" }, React.createElement( "div", { className: "advgb-icon-items-header" }, __('Search icon', 'advanced-gutenberg') ), React.createElement( "div", { className: "advgb-icon-items-wrapper" }, Object.keys(SEARCH_ICONS).map(function (icon, idx) { return React.createElement( "div", { className: "advgb-icon-item", key: idx }, React.createElement( "span", { className: icon === searchIcon ? 'active' : '', onClick: function onClick() { return setAttributes({ searchIcon: icon }); } }, SEARCH_ICONS[icon] ) ); }) ) ) ), React.createElement( PanelBody, { title: __('Search Input Settings', 'advanced-gutenberg'), initialOpen: false }, React.createElement(TextControl, { label: __('Search placeholder', 'advanced-gutenberg'), value: searchPlaceholder, onChange: function onChange(value) { return setAttributes({ searchPlaceholder: value }); } }), React.createElement(PanelColorSettings, { title: __('Input Color', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Background color', 'advanced-gutenberg'), value: backgroundColor, onChange: function onChange(value) { return setAttributes({ backgroundColor: value }); } }, { label: __('Text color', 'advanced-gutenberg'), value: textColor, onChange: function onChange(value) { return setAttributes({ textColor: value }); } }] }) ), React.createElement( PanelBody, { title: __('Search Button Settings', 'advanced-gutenberg'), initialOpen: false }, React.createElement(ToggleControl, { label: __('Show submit button', 'advanced-gutenberg'), checked: searchButtonEnabled, onChange: function onChange() { return setAttributes({ searchButtonEnabled: !searchButtonEnabled }); } }), React.createElement(ToggleControl, { label: __('Search button on the left', 'advanced-gutenberg'), checked: searchButtonOnLeft, onChange: function onChange() { return setAttributes({ searchButtonOnLeft: !searchButtonOnLeft }); } }), searchButtonEnabled && React.createElement( Fragment, null, React.createElement(_components.AdvColorControl, { label: __('Background color', 'advanced-gutenberg'), value: searchButtonBgColor, onChange: function onChange(value) { return setAttributes({ searchButtonBgColor: value }); } }), React.createElement(_components.AdvColorControl, { label: __('Text color', 'advanced-gutenberg'), value: searchButtonTextColor, onChange: function onChange(value) { return setAttributes({ searchButtonTextColor: value }); } }), React.createElement(RangeControl, { label: __('Border radius (px)', 'advanced-gutenberg'), help: __('Affect both input and button.', 'advanced-gutenberg'), value: searchButtonRadius, onChange: function onChange(value) { return setAttributes({ searchButtonRadius: value }); }, min: 0, max: 100 }), React.createElement(PanelColorSettings, { title: __('Hover Colors', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Background color', 'advanced-gutenberg'), value: searchBtnHoverBgColor, onChange: function onChange(value) { return setAttributes({ searchBtnHoverBgColor: value }); } }, { label: __('Text color', 'advanced-gutenberg'), value: searchBtnHoverColor, onChange: function onChange(value) { return setAttributes({ searchBtnHoverColor: value }); } }, { label: __('Shadow color', 'advanced-gutenberg'), value: searchBtnHoverShadow, onChange: function onChange(value) { return setAttributes({ searchBtnHoverShadow: value }); } }] }), React.createElement( PanelBody, { title: __('Hover Shadow', 'advanced-gutenberg'), initialOpen: false }, React.createElement(RangeControl, { label: __('Opacity (%)', 'advanced-gutenberg'), value: searchBtnHoverOpacity, onChange: function onChange(value) { return setAttributes({ searchBtnHoverOpacity: value }); }, min: 0, max: 100 }), React.createElement(RangeControl, { label: __('Transition speed (ms)', 'advanced-gutenberg'), value: searchBtnHoverTranSpeed || '', onChange: function onChange(value) { return setAttributes({ searchBtnHoverTranSpeed: value }); }, min: 0, max: 3000 }), React.createElement(RangeControl, { label: __('Shadow H offset', 'advanced-gutenberg'), value: searchBtnHoverShadowH || '', onChange: function onChange(value) { return setAttributes({ searchBtnHoverShadowH: value }); }, min: -50, max: 50 }), React.createElement(RangeControl, { label: __('Shadow V offset', 'advanced-gutenberg'), value: searchBtnHoverShadowV || '', onChange: function onChange(value) { return setAttributes({ searchBtnHoverShadowV: value }); }, min: -50, max: 50 }), React.createElement(RangeControl, { label: __('Shadow blur', 'advanced-gutenberg'), value: searchBtnHoverShadowBlur || '', onChange: function onChange(value) { return setAttributes({ searchBtnHoverShadowBlur: value }); }, min: 0, max: 50 }), React.createElement(RangeControl, { label: __('Shadow spread', 'advanced-gutenberg'), value: searchBtnHoverShadowSpread || '', onChange: function onChange(value) { return setAttributes({ searchBtnHoverShadowSpread: value }); }, min: 0, max: 50 }) ) ) ) ), React.createElement( "div", { className: "advgb-search-bar-wrapper " + className }, React.createElement( "div", { className: "advgb-search-bar-inner", style: { width: fullWidth ? '100%' : width } }, searchButtonOnLeft && searchBarButton, React.createElement( "div", { className: "advgb-search-bar", style: { backgroundColor: backgroundColor, color: textColor, borderRadius: searchButtonRadius } }, !searchIconOnRight && searchBarIcon, React.createElement("input", { type: "text", disabled: true, className: "advgb-search-bar-input", value: searchPlaceholder ? searchPlaceholder : 'Type to search…' }), searchIconOnRight && searchBarIcon ), !searchButtonOnLeft && searchBarButton ), React.createElement( "style", null, "." + searchBtnId + ":hover {\n color: " + searchBtnHoverColor + " !important;\n background-color: " + searchBtnHoverBgColor + " !important;\n box-shadow: " + searchBtnHoverShadowH + "px " + searchBtnHoverShadowV + "px " + searchBtnHoverShadowBlur + "px " + searchBtnHoverShadowSpread + "px " + searchBtnHoverShadow + ";\n transition: all " + searchBtnHoverTranSpeed + "s ease;\n opacity: " + searchBtnHoverOpacity / 100 + "\n }" ) ) ); } }]); return SearchBarEdit; }(Component); var blockAttrs = { fullWidth: { type: 'boolean', default: false }, width: { type: 'number', default: 500 }, textColor: { type: 'string' }, backgroundColor: { type: 'string' }, searchIcon: { type: 'string', default: 'icon1' }, searchIconOnRight: { type: 'boolean' }, searchPlaceholder: { type: 'string' }, searchButtonEnabled: { type: 'boolean', default: true }, searchButtonText: { type: 'string', default: 'SEARCH' }, searchButtonTextColor: { type: 'string' }, searchButtonBgColor: { type: 'string' }, searchButtonRadius: { type: 'number', default: 0 }, searchButtonOnLeft: { type: 'boolean', default: false }, searchBtnId: { type: 'string' }, searchBtnHoverColor: { type: 'string' }, searchBtnHoverBgColor: { type: 'string' }, searchBtnHoverShadow: { type: 'string' }, searchBtnHoverShadowH: { type: 'number', default: 1 }, searchBtnHoverShadowV: { type: 'number', default: 1 }, searchBtnHoverShadowBlur: { type: 'number', default: 12 }, searchBtnHoverShadowSpread: { type: 'number', default: 0 }, searchBtnHoverOpacity: { type: 'number', default: 100 }, searchBtnHoverTranSpeed: { type: 'number', default: 200 }, changed: { type: 'boolean', default: false }, isPreview: { type: 'boolean', default: false } }; registerBlockType('advgb/search-bar', { title: __('Search Bar - PublishPress', 'advanced-gutenberg'), description: __('Easy to create a search bar for your site.', 'advanced-gutenberg'), icon: { src: searchBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('accordion', 'advanced-gutenberg'), __('list', 'advanced-gutenberg'), __('faq', 'advanced-gutenberg')], attributes: blockAttrs, example: { attributes: { isPreview: true } }, supports: { align: true, anchor: true }, styles: [{ name: 'default', label: __('Default', 'advanced-gutenberg'), isDefault: true }, { name: 'classic', label: __('Classic', 'advanced-gutenberg') }], edit: SearchBarEdit, save: function save(_ref) { var attributes = _ref.attributes, className = _ref.className; var fullWidth = attributes.fullWidth, width = attributes.width, textColor = attributes.textColor, backgroundColor = attributes.backgroundColor, searchIcon = attributes.searchIcon, searchIconOnRight = attributes.searchIconOnRight, searchPlaceholder = attributes.searchPlaceholder, searchButtonEnabled = attributes.searchButtonEnabled, searchButtonText = attributes.searchButtonText, searchButtonTextColor = attributes.searchButtonTextColor, searchButtonBgColor = attributes.searchButtonBgColor, searchButtonRadius = attributes.searchButtonRadius, searchButtonOnLeft = attributes.searchButtonOnLeft, searchBtnId = attributes.searchBtnId; var searchBarIcon = React.createElement( "span", { className: "advgb-search-bar-icon" }, searchIcon ? SEARCH_ICONS[searchIcon] : searchBlockIcon ); var searchBarButton = !searchButtonEnabled ? '' : React.createElement( "div", { className: "advgb-search-button-wrapper" }, React.createElement( "button", { type: "submit", className: "advgb-search-bar-button " + searchBtnId, style: { color: searchButtonTextColor, borderColor: searchButtonTextColor, backgroundColor: searchButtonBgColor, borderRadius: searchButtonRadius } }, searchButtonText ) ); return React.createElement( "div", { className: "advgb-search-bar-wrapper " + className }, React.createElement( "form", { method: "get", action: advgbBlocks.home_url, className: "advgb-search-bar-form", role: "search" }, React.createElement( "div", { className: "advgb-search-bar-inner", style: { width: fullWidth ? '100%' : width } }, searchButtonOnLeft && searchBarButton, React.createElement( "div", { className: "advgb-search-bar", style: { backgroundColor: backgroundColor, color: textColor, borderRadius: searchButtonRadius } }, !searchIconOnRight && searchBarIcon, React.createElement("input", { type: "text", className: "advgb-search-bar-input", name: "s", placeholder: searchPlaceholder ? searchPlaceholder : 'Type to search…' }), searchIconOnRight && searchBarIcon ), !searchButtonOnLeft && searchBarButton ) ) ); } }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/social-links/block.jsx": /*!**************************************************!*\ !*** ./src/assets/blocks/social-links/block.jsx ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, BlockControls = _wpBlockEditor.BlockControls, MediaUpload = _wpBlockEditor.MediaUpload, AlignmentToolbar = _wpBlockEditor.AlignmentToolbar, PanelColorSettings = _wpBlockEditor.PanelColorSettings; var RangeControl = wpComponents.RangeControl, BaseControl = wpComponents.BaseControl, PanelBody = wpComponents.PanelBody, TextControl = wpComponents.TextControl, ToolbarButton = wpComponents.ToolbarButton, Button = wpComponents.Button, ToolbarGroup = wpComponents.ToolbarGroup, Tooltip = wpComponents.Tooltip; var socialBlockIconContent = React.createElement( "g", { fill: "currentColor" }, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M18,16.08c-0.76,0-1.44,0.3-1.96,0.77L8.91,12.7C8.96,12.47,9,12.24,9,12s-0.04-0.47-0.09-0.7l7.05-4.11 C16.5,7.69,17.21,8,18,8c1.66,0,3-1.34,3-3c0-1.66-1.34-3-3-3s-3,1.34-3,3c0,0.24,0.04,0.47,0.09,0.7L8.04,9.81 C7.5,9.31,6.79,9,6,9c-1.66,0-3,1.34-3,3c0,1.66,1.34,3,3,3c0.79,0,1.5-0.31,2.04-0.81l7.12,4.16c-0.05,0.21-0.08,0.43-0.08,0.65 c0,1.61,1.31,2.92,2.92,2.92s2.92-1.31,2.92-2.92C20.92,17.39,19.61,16.08,18,16.08z M18,4c0.55,0,1,0.45,1,1s-0.45,1-1,1 s-1-0.45-1-1S17.45,4,18,4z M6,13c-0.55,0-1-0.45-1-1s0.45-1,1-1s1,0.45,1,1S6.55,13,6,13z M18,20.02c-0.55,0-1-0.45-1-1 s0.45-1,1-1s1,0.45,1,1S18.55,20.02,18,20.02z" }) ); var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAACDCAYAAACkwQY0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACNxJREFUeNrs3U1oFGkex/GqfplOogYTkawYQhBBZkTmIARkEHYQL173sCfPC54WPOxeFvYgzGluioNXLyMMc/UwexFnRy/DwrI6BxUkG5WY+P4S81JdU7+arvj4THX1U9XVHdP9/UCRpNOpp9Pdv+f5P09Vd3seAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAw+d3uoFarZe3H5y4GcgnbXb6xsdH/oFsB91P2R8iB7sMe2l+LBN4vIeBpG2EHug96mLJtXp4n8H7BkJtbpbX5xlfCDpQb8qaxbYY+CntYatCtkbxibqdOnWqcP3/+y/Hx8c9932+EYehHGw8ZUGQ+7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gJ6W7I/OnTv3z1agAzPcZY7oZqdgjuqVy5cv///AgQM/zszM/KHRaOz3fb/KwwKUIwiClw8ePPj+7Nmzf7906dLD1giubd0Y1ZPQe81ms+2+/E6NtT4TKgm4gqwL6tH2SbJNT0+PXrx48YvZ2dnPqtVq47fFQQBFra6uvr558+bPZ86c+Z8V8DX9uvX9uhn2rNLdd2k0Crtvhb1ubJ+0wl9r/c43NgD5JSNl0yjX11M25zl6LWfDodGwGeSksarRIXiEHSgc8jAl6BvG9sEcPSvkzkE3PqjdDLrd8wQEHSgt7GbQm1bIA6Nkd1qQqxXoaTwr6KH3foGO0h0ov3Q3V9vtVfeOo3nuEbc1V/eMIFeMzTe+EnSgnKCHVrDtkDutfOcOo7EKn/ytHW6fsh0obZ7ebot/7zKaFw5jK+yeFWo/5TIAxYPu2cHOG3CvjDCmBJ6AA70JfKGA9zSURgcAoKCioQYAAAAAAAAAAAAAAAAAAAAAAAAAAABK8qsAAwCESp+/PGzWsQAAAABJRU5ErkJggg=='; var socialBlockIcon = React.createElement( "svg", { width: "20", height: "20", viewBox: "0 0 24 24" }, socialBlockIconContent ); var ICONS_SET_NEW = { blogger: React.createElement( Fragment, null, React.createElement( "g", { fill: "currentColor", "fill-rule": "evenodd", stroke: "none", "stroke-width": "1" }, React.createElement("path", { d: "M50,25 C50,11.1928806 38.8071194,0 25,0 C11.1928806,0 0,11.1928806 0,25 C0,38.8071194 11.1928806,50 25,50 C38.8071194,50 50,38.8071194 50,25 Z M47,25 C47,12.8497349 37.1502651,3 25,3 C12.8497349,3 3,12.8497349 3,25 C3,37.1502651 12.8497349,47 25,47 C37.1502651,47 47,37.1502651 47,25 Z M14,28.8986406 C14,32.8228477 17.2049102,36 21.1539531,36 L28.8544258,36 C32.8063906,36 36,32.8228477 36,28.8986406 L36,23.8630898 C36,23.0788672 35.3675,22.4423281 34.5776484,22.4423281 L33.3700977,22.4423281 C32.5888398,22.4423281 31.9736563,21.8570938 31.9220508,21.121082 C31.9136289,17.1796445 28.7112969,14 24.7595898,14 L21.1539531,14 C17.2049102,14 14.002793,17.1796875 14,21.1041523 L14,28.8986406 Z M27,21.5001179 C27,22.3263074 26.3641346,23 25.5840879,23 L21.4159121,23 C20.6359096,23 20,22.3264017 20,21.5001179 C19.9999116,20.6705805 20.6358212,20 21.4159121,20 L25.5840879,20 C26.3641346,20 27,20.6705805 27,21.5001179 Z M31,28.4932201 C31,29.3206654 30.3988164,30 29.6624116,30 L21.3288673,30 C20.5925066,30 20,29.3206654 20,28.4932201 C20,27.6657749 20.5925947,27 21.3288673,27 L29.6624116,27 C30.3988164,27 31,27.665725 31,28.4932201 Z M31,28.4932201" }) ) ), facebook: React.createElement( Fragment, null, React.createElement( "g", { fill: "currentColor", "fill-rule": "evenodd", stroke: "none", "stroke-width": "1" }, React.createElement("path", { d: "M25,50 C38.8071194,50 50,38.8071194 50,25 C50,11.1928806 38.8071194,0 25,0 C11.1928806,0 0,11.1928806 0,25 C0,38.8071194 11.1928806,50 25,50 Z M25,47 C37.1502651,47 47,37.1502651 47,25 C47,12.8497349 37.1502651,3 25,3 C12.8497349,3 3,12.8497349 3,25 C3,37.1502651 12.8497349,47 25,47 Z M26.8145197,36 L26.8145197,24.998712 L30.0687449,24.998712 L30.5,21.2076072 L26.8145197,21.2076072 L26.8200486,19.3101227 C26.8200486,18.3213442 26.9207209,17.7915341 28.4425538,17.7915341 L30.4769629,17.7915341 L30.4769629,14 L27.2222769,14 C23.3128757,14 21.9368678,15.8390937 21.9368678,18.9318709 L21.9368678,21.2080366 L19.5,21.2080366 L19.5,24.9991413 L21.9368678,24.9991413 L21.9368678,36 L26.8145197,36 Z M26.8145197,36" }) ) ), flickr: React.createElement( Fragment, null, React.createElement( "g", { fill: "currentColor", "fill-rule": "evenodd", stroke: "none", "stroke-width": "1" }, React.createElement("path", { d: "M0,25 C0,38.8071194 11.1928806,50 25,50 C38.8071194,50 50,38.8071194 50,25 C50,11.1928806 38.8071194,0 25,0 C11.1928806,0 0,11.1928806 0,25 Z M3,25 C3,37.1502651 12.8497349,47 25,47 C37.1502651,47 47,37.1502651 47,25 C47,12.8497349 37.1502651,3 25,3 C12.8497349,3 3,12.8497349 3,25 Z M11,24.3933898 C11,27.9245881 13.8664452,30.7868324 17.4026552,30.7868852 C20.9389182,30.7868852 23.8053634,27.9245881 23.8053634,24.3933898 C23.8053634,20.8622443 20.9389711,17.9999472 17.4026552,18 C13.8664452,18 11,20.8622443 11,24.3933898 Z M33.4026552,30.7868852 C36.9389711,30.7868852 39.8053634,27.9245881 39.8053634,24.3933898 C39.8053634,20.8622971 36.9389182,18 33.4026552,18 C29.8663923,18 27,20.8622971 27,24.3933898 C27,27.9245881 29.8664452,30.7868852 33.4026552,30.7868852 Z M33.394864,19.9672131 C35.8394032,19.9672131 37.8210935,21.9489034 37.8210935,24.3934426 C37.8210935,26.8379818 35.8394032,28.8196721 33.394864,28.8196721 C30.9503248,28.8196721 28.9686345,26.8379818 28.9686345,24.3934426 C28.9686345,21.9489034 30.9503248,19.9672131 33.394864,19.9672131 Z M33.394864,19.9672131" }) ) ), instagram: React.createElement( Fragment, null, React.createElement( "g", { fill: "currentColor", "fill-rule": "evenodd", stroke: "none", "stroke-width": "1" }, React.createElement("path", { d: "M25,0 C11.1928806,0 0,11.1928806 0,25 C0,38.8071194 11.1928806,50 25,50 C38.8071194,50 50,38.8071194 50,25 C50,11.1928806 38.8071194,0 25,0 Z M25,3 C12.8497349,3 3,12.8497349 3,25 C3,37.1502651 12.8497349,47 25,47 C37.1502651,47 47,37.1502651 47,25 C47,12.8497349 37.1502651,3 25,3 Z M35.9513128,34.5096659 C35.9701595,34.4075385 35.9839804,34.3037693 36,34.2013135 L36,15.7986865 C35.9846086,15.6978726 35.9714159,15.5967304 35.9525693,15.496245 C35.7600194,14.4654483 34.9467868,13.6655054 33.9482288,13.5226585 C33.9067662,13.517076 33.8662459,13.5075528 33.8254116,13.5 L16.1745884,13.5 C16.0681049,13.5200314 15.9609932,13.5351371 15.8560802,13.5600942 C14.8813947,13.7922616 14.1601965,14.6128926 14.0213595,15.6453312 C14.0157055,15.6883495 14.0072245,15.7310394 14,15.7740577 L14,34.2269275 C14.0201031,34.3438321 14.0361227,34.4617219 14.0612516,34.5779697 C14.2767315,35.5742861 15.0902783,36.3466448 16.0580534,36.4766848 C16.1048559,36.4825957 16.1519725,36.4921188 16.198775,36.5 L33.801225,36.5 C33.9155613,36.4796402 34.0302117,36.4628926 34.1432916,36.4372787 C35.0416482,36.2379497 35.775725,35.454426 35.9513128,34.5096659 Z M16.380331,33.0989292 C16.380331,33.5885494 16.7858479,34.0095374 17.254187,34.0095374 C22.4169106,34.0098658 27.5793201,34.0098658 32.7420437,34.0095374 C33.2147803,34.0095374 33.6180985,33.5892062 33.6180985,33.0959737 C33.6184126,29.6962164 33.6180985,26.2967875 33.6180985,22.8973587 L33.6180985,22.8267561 L31.5179543,22.8267561 C31.8144748,23.81749 31.9055669,24.8252998 31.7893459,25.8524843 C31.6724968,26.8799971 31.3558732,27.8362507 30.8401034,28.7192747 C30.3240195,29.6032838 29.6549637,30.3355797 28.8357629,30.9184609 C26.7123745,32.4303398 23.9167892,32.5633352 21.6636731,31.2412621 C20.5247077,30.5736579 19.6304345,29.6426899 19.0069247,28.4431039 C18.0768429,26.653084 17.9282685,24.7744003 18.4738788,22.8251142 C17.7771813,22.825771 17.0833107,22.825771 16.3800168,22.825771 L16.3800168,22.8878355 C16.3800168,26.2915334 16.3797027,29.6952313 16.380331,33.0989292 Z M24.897757,29.6581239 C27.3886549,29.7139492 29.403361,27.6333095 29.4558175,25.1027841 C29.5095304,22.4931182 27.4960808,20.3376071 25.0001571,20.339249 C22.5601451,20.3376071 20.5765359,22.3900057 20.5422979,24.9293975 C20.5071175,27.5370931 22.5039192,29.604269 24.897757,29.6581239 Z M33.6177844,18.481582 C33.6180985,17.7555254 33.6180985,17.0291405 33.6177844,16.303084 C33.6177844,15.7822673 33.2235754,15.3678469 32.7260241,15.3675186 C32.03341,15.3671902 31.3407958,15.3668618 30.6478676,15.3675186 C30.1515727,15.3681753 29.7561073,15.7835808 29.7557932,16.3043975 C29.7554791,17.0242147 29.7535944,17.744032 29.7583061,18.4641776 C29.7589343,18.5715591 29.7784092,18.6832096 29.8110767,18.7850086 C29.9354645,19.1682324 30.2712489,19.4033552 30.6824198,19.4053255 C31.0166336,19.4059823 31.3508474,19.4049971 31.6853753,19.4049971 C32.0472308,19.4007282 32.4103428,19.4079526 32.7725125,19.3987579 C33.2383386,19.3866077 33.6177844,18.9692319 33.6177844,18.481582 Z M33.6177844,18.481582" }) ) ), linkedin: React.createElement( Fragment, null, React.createElement( "g", { fill: "currentColor", "fill-rule": "evenodd", stroke: "none", "stroke-width": "1" }, React.createElement("path", { d: "M25,50 C38.8071194,50 50,38.8071194 50,25 C50,11.1928806 38.8071194,0 25,0 C11.1928806,0 0,11.1928806 0,25 C0,38.8071194 11.1928806,50 25,50 Z M25,47 C37.1502651,47 47,37.1502651 47,25 C47,12.8497349 37.1502651,3 25,3 C12.8497349,3 3,12.8497349 3,25 C3,37.1502651 12.8497349,47 25,47 Z M14,20.1180479 L14,34.6581834 L18.7100851,34.6581834 L18.7100851,20.1180479 L14,20.1180479 Z M16.6646962,13 C15.0534058,13 14,14.0858611 14,15.5115122 C14,16.9076331 15.0222711,18.0247614 16.6035556,18.0247614 L16.6336556,18.0247614 C18.2759867,18.0247614 19.2988222,16.9076331 19.2988222,15.5115122 C19.2682519,14.0858611 18.2759867,13 16.6646962,13 Z M30.5769213,20.1180479 C28.076176,20.1180479 26.9565501,21.5293199 26.3314108,22.5193527 L26.3314108,20.4598644 L21.6207614,20.4598644 C21.6828427,21.8242356 21.6207614,35 21.6207614,35 L26.3314108,35 L26.3314108,26.8795887 C26.3314108,26.445032 26.3619812,26.0115368 26.4865199,25.7004084 C26.826932,24.83226 27.6020069,23.9334233 28.9032674,23.9334233 C30.6083381,23.9334233 31.2899149,25.2667202 31.2899149,27.2206333 L31.2899149,34.999614 L35.9998119,34.999614 L36,26.6627446 C36,22.1966439 33.6763743,20.1180479 30.5769213,20.1180479 Z M30.5769213,20.1180479" }) ) ), mail: React.createElement( Fragment, null, React.createElement( "g", { fill: "currentColor", "fill-rule": "evenodd", stroke: "none", "stroke-width": "1" }, React.createElement("path", { d: "M25,0 C11.1928806,0 0,11.1928806 0,25 C0,38.8071194 11.1928806,50 25,50 C38.8071194,50 50,38.8071194 50,25 C50,11.1928806 38.8071194,0 25,0 Z M25,3 C12.8497349,3 3,12.8497349 3,25 C3,37.1502651 12.8497349,47 25,47 C37.1502651,47 47,37.1502651 47,25 C47,12.8497349 37.1502651,3 25,3 Z M37,31.9646738 L37,17 L28.262875,25.4642914 L37,31.9646738 Z M13,31.9646738 L21.7369375,25.4633812 L13,17 L13,31.9646738 Z M22.9140156,26.604743 L13,33 L37,33 L27.08575,26.604743 L25,28.625083 L22.9140156,26.604743 Z M13.72,17 L25,26.0581312 L36.28,17 L13.72,17 Z M13.72,17" }) ) ), picasa: React.createElement( Fragment, null, React.createElement( "g", { fill: "currentColor", "fill-rule": "evenodd", stroke: "none", "stroke-width": "1" }, React.createElement("path", { d: "M25,50 C38.8071194,50 50,38.8071194 50,25 C50,11.1928806 38.8071194,0 25,0 C11.1928806,0 0,11.1928806 0,25 C0,38.8071194 11.1928806,50 25,50 Z M25,47 C37.1502651,47 47,37.1502651 47,25 C47,12.8497349 37.1502651,3 25,3 C12.8497349,3 3,12.8497349 3,25 C3,37.1502651 12.8497349,47 25,47 Z M18.3081608,24.9268242 L18.3081608,36.1026094 C15.8801013,34.6339648 13.9785429,32.4174648 12.9377792,29.8090352 L18.3081608,24.9268242 Z M20.4591064,12.8520586 C21.9243514,12.297832 23.4480966,12 24.9979941,12 C26.8609587,12 28.6590247,12.3973125 30.3579148,13.1656836 L30.3579148,21.8322148 L20.4591064,12.8520586 Z M12.4719619,28.3769023 C12.1682386,27.2530625 12,26.1186602 12,25 C12,20.096918 14.7097944,15.6850937 19.0744513,13.4426953 L23.9947578,17.9067734 L12.4719619,28.3769023 Z M36.6723724,30.6506328 C34.5083252,35.1147617 29.9554726,38 24.9979941,38 C23.1521937,38 21.3633699,37.6133008 19.6735189,36.8500586 L19.6735189,30.6506328 L36.6723724,30.6506328 Z M37.257729,29.2811133 L31.727437,29.2811133 L31.727437,13.9131836 C35.5955539,16.2654219 38.0001016,20.483668 38,25.0000508 C38,26.4583867 37.7438081,27.8959531 37.257729,29.2811133 Z M37.257729,29.2811133" }) ) ), pinterest: React.createElement( Fragment, null, React.createElement( "g", { fill: "currentColor", "fill-rule": "evenodd", stroke: "none", "stroke-width": "1" }, React.createElement("path", { d: "M25,0 C11.1928806,0 0,11.1928806 0,25 C0,38.8071194 11.1928806,50 25,50 C38.8071194,50 50,38.8071194 50,25 C50,11.1928806 38.8071194,0 25,0 Z M25,3 C12.8497349,3 3,12.8497349 3,25 C3,37.1502651 12.8497349,47 25,47 C37.1502651,47 47,37.1502651 47,25 C47,12.8497349 37.1502651,3 25,3 Z M15.5,21.3293651 C15.5,23.8979841 16.4179886,26.1831362 18.3868965,27.0346983 C18.7097504,27.1745243 18.9989411,27.0395084 19.0925718,26.6608336 C19.1577063,26.3987635 19.3117743,25.737617 19.3805099,25.4622774 C19.4749236,25.0877494 19.4382854,24.9563826 19.1777477,24.629956 C18.6100133,23.9205421 18.2472332,23.0021355 18.2472332,21.7012393 C18.2472332,17.9270976 20.9127352,14.5483833 25.1881227,14.5483833 C28.9739058,14.5483833 31.0538241,16.9989049 31.0538241,20.2716301 C31.0538241,24.5777078 29.2549547,28.2120235 26.5844424,28.2120235 C25.1096795,28.2120235 24.005682,26.9199182 24.3595374,25.3352232 C24.7832244,23.4433422 25.6039811,21.4015173 25.6039811,20.0359328 C25.6039811,18.8134918 24.9845775,17.7939063 23.7027128,17.7939063 C22.1950696,17.7939063 20.983976,19.4461092 20.983976,21.6594407 C20.983976,23.0691459 21.4336542,24.0225504 21.4336542,24.0225504 C21.4336542,24.0225504 19.890782,30.9476708 19.6203801,32.1604915 C19.0817683,34.5758493 19.5394317,37.5367443 19.5781053,37.8358028 C19.6008084,38.0129489 19.8157834,38.0550792 19.9131719,37.9212244 C20.0522089,37.7289843 21.8477903,35.3806369 22.4582691,33.0341139 C22.6309694,32.36965 23.4498471,28.9290673 23.4498471,28.9290673 C23.9396081,29.9187967 25.3711567,30.7905945 26.8935179,30.7905945 C31.4253723,30.7905945 34.5,26.4138574 34.5,20.5554288 C34.5,16.1256142 30.9581579,12 25.575015,12 C18.8771271,12 15.5,17.0871462 15.5,21.3293651 Z M15.5,21.3293651" }) ) ), reddit: React.createElement( Fragment, null, React.createElement( "g", { fill: "currentColor", "fill-rule": "evenodd", stroke: "none", "stroke-width": "1" }, React.createElement("path", { d: "M50,25 C50,11.1928806 38.8071194,0 25,0 C11.1928806,0 0,11.1928806 0,25 C0,38.8071194 11.1928806,50 25,50 C38.8071194,50 50,38.8071194 50,25 Z M47,25 C47,12.8497349 37.1502651,3 25,3 C12.8497349,3 3,12.8497349 3,25 C3,37.1502651 12.8497349,47 25,47 C37.1502651,47 47,37.1502651 47,25 Z M29.285672,25.1142857 C28.1613122,25.1142857 27.25,26.0886553 27.25,27.2907328 C27.25,28.4931237 28.1613122,29.4676812 29.285672,29.4676812 C30.4097389,29.4676812 31.3211097,28.4931237 31.3211097,27.2907328 C31.3211097,26.0886553 30.4097389,25.1142857 29.285672,25.1142857 L29.285672,25.1142857 Z M40,25.1842541 C40,23.1661499 38.4647792,21.5245722 36.5778773,21.5245722 C35.7246903,21.5245722 34.9441013,21.8609333 34.344099,22.4154154 C32.0204962,20.8025988 29.01275,19.8611259 25.7938312,19.7275339 L27.4944043,13.7975395 L32.4418455,14.9819468 C32.4417283,14.9962334 32.4399119,15.0100187 32.4399119,15.0243053 C32.4399119,16.6918871 33.7087059,18.0486732 35.2680089,18.0486732 C36.8273118,18.0486732 38.0961058,16.6919498 38.0961058,15.0243053 C38.0961058,13.3566608 36.827429,12 35.2680089,12 C34.0961293,12 33.0888402,12.7662743 32.6602252,13.8548112 L27.2437392,12.5581164 C26.969285,12.4923856 26.6939519,12.6634486 26.6115688,12.9510599 L24.6717565,19.7148765 C21.2781691,19.773088 18.0911839,20.7250878 15.6557838,22.4155407 C15.0558987,21.8611213 14.2751339,21.5246975 13.4220056,21.5246975 C11.5351037,21.5246975 10,23.1663379 10,25.1843795 C10,26.5078929 10.6604127,27.6694291 11.6472525,28.3122624 C11.5968617,28.6558922 11.5703186,29.0034695 11.5703186,29.3544932 C11.5703186,31.9771452 12.997375,34.4258518 15.5885179,36.2485809 C18.110227,38.0226854 21.4524861,39 24.9999414,39 C28.5471037,39 31.8895972,38.0224974 34.4113063,36.2485809 C37.0025078,34.4256639 38.429447,31.9771452 38.429447,29.3544932 C38.429447,29.0034695 38.4030211,28.6560801 38.3525131,28.3122624 C39.3394701,27.6693665 40,26.5077049 40,25.1842541 L40,25.1842541 Z M35.2678917,13.1509466 C36.2337548,13.1509466 37.0196173,13.9912229 37.0196173,15.0242426 C37.0196173,16.0570117 36.2337548,16.8975386 35.2678917,16.8975386 C34.3021457,16.8975386 33.5161661,16.0570117 33.5161661,15.0242426 C33.5161075,13.9912856 34.3019699,13.1509466 35.2678917,13.1509466 L35.2678917,13.1509466 Z M11.076137,25.1842541 C11.076137,23.8009626 12.1284263,22.6755815 13.4218884,22.6755815 C13.9116754,22.6755815 14.3665405,22.8374333 14.7430654,23.1128259 C13.3654038,24.2769312 12.4090914,25.6430537 11.9283278,27.1170775 C11.4083063,26.6566487 11.076137,25.9612434 11.076137,25.1842541 L11.076137,25.1842541 Z M24.9999414,37.8488654 C18.1882742,37.8488654 12.6466314,34.0382971 12.6466314,29.3543679 C12.6466314,29.15304 12.6575885,28.9535918 12.6776862,28.7556476 C12.7167684,28.3727297 12.7922961,27.9965165 12.9030387,27.6288878 C13.3168294,26.2557474 14.2139618,25.0028522 15.4665839,23.9584283 C15.7443779,23.7265221 16.0403361,23.5054561 16.3517045,23.295293 C18.5818499,21.7901897 21.6355923,20.8602464 24.9999414,20.8602464 C28.3641147,20.8602464 31.4179743,21.790315 33.6479439,23.295293 C33.9593123,23.5054561 34.2553877,23.7265847 34.5331232,23.9584283 C35.7858039,25.0027895 36.6829949,26.2557474 37.0967269,27.6288878 C37.2075282,27.9965165 37.2830558,28.3727297 37.3220794,28.7556476 C37.3423529,28.9534039 37.3530756,29.15304 37.3530756,29.3543679 C37.3530756,34.0383598 31.8114915,37.8488654 24.9999414,37.8488654 L24.9999414,37.8488654 Z M38.071555,27.1172028 C37.5909086,25.6432417 36.6344204,24.2769312 35.2567588,23.1128886 C35.6332837,22.837496 36.0880902,22.6756441 36.5778773,22.6756441 C37.8713979,22.6756441 38.9236872,23.8009626 38.9236872,25.1843168 C38.9236872,25.9612434 38.5916937,26.6566487 38.071555,27.1172028 L38.071555,27.1172028 Z M29.1000551,33.0352917 C28.0801683,33.929456 26.815593,34.3281642 24.9999414,34.3281642 C23.1841726,34.3281642 21.9196559,33.929456 20.8995934,33.0352917 C20.6583619,32.8238128 20.3022277,32.8616597 20.1045317,33.1195073 C19.9066598,33.3776056 19.9419334,33.7583304 20.183282,33.9699346 C21.4026227,35.0389841 22.9330974,35.5366958 24.9999414,35.5366958 C27.0667854,35.5366958 28.5972016,35.0389841 29.8166008,33.9699346 C30.0578323,33.7583304 30.093223,33.3776056 29.8953512,33.1195073 C29.6971863,32.8611584 29.3412865,32.8238128 29.1000551,33.0352917 L29.1000551,33.0352917 Z M22.3208167,27.2907328 C22.3208167,26.0886553 21.4096217,25.1142857 20.2855548,25.1142857 C19.1613122,25.1142857 18.25,26.0886553 18.25,27.2907328 C18.25,28.4931237 19.1613707,29.4676812 20.2855548,29.4676812 C21.4096217,29.4675559 22.3208167,28.4931237 22.3208167,27.2907328 L22.3208167,27.2907328 Z M22.3208167,27.2907328" }) ) ), skype: React.createElement( Fragment, null, React.createElement( "g", { fill: "currentColor", "fill-rule": "evenodd", stroke: "none", "stroke-width": "1" }, React.createElement("path", { d: "M50,25 C50,11.1928806 38.8071194,0 25,0 C11.1928806,0 0,11.1928806 0,25 C0,38.8071194 11.1928806,50 25,50 C38.8071194,50 50,38.8071194 50,25 Z M47,25 C47,12.8497349 37.1502651,3 25,3 C12.8497349,3 3,12.8497349 3,25 C3,37.1502651 12.8497349,47 25,47 C37.1502651,47 47,37.1502651 47,25 Z M25.4397706,13.975276 C24.8096937,13.975276 24.1919703,14.0277875 23.5908485,14.1278564 C22.5130674,13.4152862 21.2304038,13 19.8499866,13 C16.0647401,13 13,16.1114511 13,19.9506313 C13,21.3475345 13.4052238,22.6452605 14.1030252,23.7348727 C14.0090312,24.330184 13.9609845,24.939812 13.9609845,25.5608835 C13.9609845,31.9601448 19.0985232,37.1471351 25.4397218,37.1471351 C26.1553942,37.1471351 26.8521702,37.0764923 27.5293662,36.9523474 C28.5816102,37.6146354 29.8210609,38 31.1497692,38 C34.9340392,38 38,34.8877563 38,31.0489724 C37.9998535,29.5978238 37.5625009,28.2486268 36.8112328,27.1332542 C36.879885,26.6180477 36.9193869,26.0942709 36.9193869,25.5610817 C36.9193869,19.1628112 31.7792114,13.975276 25.4397706,13.975276 Z M19.9677886,28.6935701 C21.3911596,28.5966276 22.2458078,30.338952 23.0054897,30.8236149 C23.7642429,31.3064835 26.6513076,32.4065946 28.1762921,30.6288326 C29.836859,28.6935701 27.0719846,27.6921461 25.0453354,27.3890074 C22.1517212,26.9520931 18.4983763,25.3558056 18.7825911,22.210082 C19.0669036,19.066352 21.4014725,17.454464 23.8583783,17.2270851 C26.9902148,16.9371546 29.0290341,17.7109007 30.6416535,19.1141006 C32.5063271,20.7354087 31.497377,22.5479106 30.3093446,22.693748 C29.1260044,22.8387382 27.7969155,20.0270054 25.187565,19.9847394 C22.4980576,19.941676 20.6803539,22.8387382 24.000559,23.6622764 C27.3224748,24.4849175 30.8798758,24.8228956 32.1609683,27.9196246 C33.4429406,31.0166527 30.1690701,34.305622 26.5147477,34.4997563 C22.8634067,34.6936913 21.1547457,33.8699039 19.5894873,32.3719545 C17.8414321,30.6988605 18.5436356,28.7905625 19.9677886,28.6935701 Z M19.9677886,28.6935701" }) ) ), soundcloud: React.createElement( Fragment, null, React.createElement( "g", { fill: "currentColor", "fill-rule": "evenodd", stroke: "none", "stroke-width": "1" }, React.createElement("path", { d: "M25,0 C11.1928806,0 0,11.1928806 0,25 C0,38.8071194 11.1928806,50 25,50 C38.8071194,50 50,38.8071194 50,25 C50,11.1928806 38.8071194,0 25,0 Z M25,3 C12.8497349,3 3,12.8497349 3,25 C3,37.1502651 12.8497349,47 25,47 C37.1502651,47 47,37.1502651 47,25 C47,12.8497349 37.1502651,3 25,3 Z M11.2046957,26.4994198 L11,28.2899843 L11.2046957,30.0498224 C11.2122973,30.1238678 11.258563,30.1755611 11.3170241,30.1755611 C11.3736257,30.1755611 11.4197274,30.1243715 11.4286961,30.0505779 L11.6713997,28.2899843 L11.4286961,26.4989161 C11.4200555,26.4251226 11.3733523,26.3731145 11.3170241,26.3731145 C11.2586177,26.3731145 11.2122426,26.4251226 11.2046957,26.4994198 Z M12.8503005,25.3946571 C12.8503005,25.3952867 12.5750031,28.2897324 12.5750031,28.2897324 L12.8503005,31.1207736 C12.8580661,31.1967079 12.9071756,31.2514864 12.9668398,31.2514864 C13.0253555,31.2514864 13.0733712,31.1979672 13.0829963,31.1215921 L13.3961375,28.2897324 L13.0833791,25.3946571 C13.0737541,25.3177153 13.0258477,25.2645739 12.9668398,25.2645739 C12.9075037,25.2645739 12.8583943,25.3194783 12.8503005,25.3946571 Z M14.396866,24.761745 L14.1500608,28.2908658 L14.396866,31.7053294 C14.4034832,31.8110456 14.4745771,31.8908837 14.5613116,31.8908837 C14.6470618,31.8908837 14.7178823,31.8109197 14.7254838,31.7053294 L15.0061953,28.2908658 L14.7254838,24.7609894 C14.7179369,24.6552103 14.6471712,24.5753722 14.5613116,24.5753722 C14.4745771,24.5753722 14.403866,24.6552732 14.396866,24.761745 Z M15.9578691,25.0172521 L15.7251733,28.2909287 L15.9578691,31.7335372 C15.9645956,31.8549944 16.0449317,31.9468586 16.1461038,31.9468586 C16.2457993,31.9468586 16.3264635,31.8549314 16.3339557,31.733852 L16.5983703,28.2909287 L16.3339557,25.0157409 C16.3268463,24.8947875 16.2460727,24.8036159 16.1461038,24.8036159 C16.044877,24.8036159 15.9642128,24.8955431 15.9578691,25.0172521 Z M17.5195284,22.9658916 L17.3001764,28.292251 L17.5195284,31.7345446 C17.5252159,31.8690983 17.6326223,31.9751293 17.7456069,31.9751293 C17.85799,31.9751293 17.972123,31.8685946 17.972123,31.7337261 L18.205475,28.292251 L17.950412,22.9658916 C17.9436307,22.8306454 17.8434977,22.7241106 17.7311147,22.7241106 C17.6182395,22.7241106 17.5248877,22.8305824 17.5195284,22.9658916 Z M19.0799298,21.7485496 C19.0799298,21.7489903 18.8752888,28.2933213 18.8752888,28.2933213 L19.0803673,31.7138925 C19.085508,31.8633686 19.1890863,31.9816775 19.3161256,31.9816775 C19.4420165,31.9816775 19.5458683,31.8633686 19.5518839,31.7126332 L19.7832125,28.2933213 L19.5518839,21.7485496 C19.5455948,21.5974994 19.4419618,21.4795682 19.3160709,21.4795682 C19.1890863,21.4795682 19.085508,21.5977513 19.0799298,21.7485496 Z M20.6267141,20.9640207 L20.4502919,28.2940139 L20.6269329,31.6585473 C20.6312532,31.8388756 20.7830113,31.9814257 20.9374491,31.9814257 C21.0916135,31.9814257 21.2481294,31.8388756 21.2481294,31.657477 L21.4195204,28.2942028 L21.2073871,20.9639577 C21.2024652,20.7820553 21.064215,20.6391905 20.9103787,20.6391905 C20.7556128,20.6391905 20.6309251,20.7816146 20.6267141,20.9640207 Z M22.1736078,21.4133933 L22.025459,28.2954621 L22.1736078,31.6071059 C22.1771625,31.8179717 22.3266784,31.9846998 22.5091162,31.9846998 C22.6910072,31.9846998 22.8440778,31.8182235 22.8440778,31.6048392 L23.0066094,28.2958399 L22.8385544,21.4128896 C22.8341794,21.1998201 22.6872885,21.032966 22.5053975,21.032966 C22.3232331,21.032966 22.1771625,21.1997571 22.1736078,21.4133933 Z M23.7558296,19.3647403 L23.6005168,28.2972251 L23.7562671,31.5388532 C23.7590015,31.7759119 23.947455,31.9709107 24.1542288,31.9709107 C24.3605652,31.9709107 24.5521358,31.7757859 24.5521358,31.5353272 L24.7023627,28.2972251 L24.5239717,19.3640477 C24.5209639,19.1245334 24.341862,18.9290938 24.1355257,18.9290938 C23.9286971,18.9290938 23.7589468,19.1245334 23.7558296,19.3647403 Z M34.2236391,24.3767843 C33.9495448,20.8031482 31.3466882,18 28.1717992,18 C27.3948523,18 26.641093,18.1759838 25.9723183,18.4738655 C25.7124428,18.589593 25.6441927,18.7089094 25.6441927,18.9399865 L25.6441927,31.5248122 C25.6441927,31.7674747 25.8069977,31.9696515 26.0125684,31.9933888 C26.0213184,31.9945221 35.4956182,32 35.5570323,32 C37.4589032,32 39,30.2245469 39,28.0346031 C39,25.8446593 37.4574267,24.0688914 35.5556651,24.0688914 C35.0838752,24.0688914 34.6335774,24.1788262 34.2236391,24.3767843 Z M34.2236391,24.3767843" }) ) ), tumblr: React.createElement( Fragment, null, React.createElement( "g", { fill: "currentColor", "fill-rule": "evenodd", stroke: "none", "stroke-width": "1" }, React.createElement("path", { d: "M25,50 C38.8071194,50 50,38.8071194 50,25 C50,11.1928806 38.8071194,0 25,0 C11.1928806,0 0,11.1928806 0,25 C0,38.8071194 11.1928806,50 25,50 Z M25,47 C37.1502651,47 47,37.1502651 47,25 C47,12.8497349 37.1502651,3 25,3 C12.8497349,3 3,12.8497349 3,25 C3,37.1502651 12.8497349,47 25,47 Z M20.1212122,23.428572 L20.1212122,29.5776397 C20.2888032,34.6055735 23.1493975,35.6536697 26.4848488,36 C28.4239345,35.9068215 30.7994507,35.2128501 32,34.291925 L32,30.807453 C30.4550907,32.2576564 26.3092334,33.6801939 25.5656572,29.5776397 L25.4949496,23.3602485 L32,23.428572 L32,19.2608705 L25.4949496,19.2608705 L25.6363634,14 L23.0202023,14.0683235 C23.2002807,18.5559785 20.7320276,19.156712 18,19.3291926 L18,23.428572 L20.1212122,23.428572 Z M20.1212122,23.428572" }) ) ), twitter: React.createElement( Fragment, null, React.createElement( "g", { fill: "currentColor", "fill-rule": "evenodd", stroke: "none", "stroke-width": "1" }, React.createElement("path", { d: "M25,50 C38.8071194,50 50,38.8071194 50,25 C50,11.1928806 38.8071194,0 25,0 C11.1928806,0 0,11.1928806 0,25 C0,38.8071194 11.1928806,50 25,50 Z M25,47 C37.1502651,47 47,37.1502651 47,25 C47,12.8497349 37.1502651,3 25,3 C12.8497349,3 3,12.8497349 3,25 C3,37.1502651 12.8497349,47 25,47 Z M24.6822554,20.5542975 L24.729944,21.3761011 L23.9351333,21.2754721 C21.0420225,20.8897275 18.5145246,19.5815504 16.3685358,17.3844837 L15.3193857,16.2943361 L15.0491501,17.0993681 C14.4768864,18.8939188 14.8424993,20.7890985 16.0347153,22.0637326 C16.6705638,22.7681357 16.5274979,22.8687647 15.4306592,22.4494772 C15.0491501,22.3153051 14.7153296,22.2146761 14.6835371,22.2649907 C14.5722637,22.3823912 14.9537728,23.9085978 15.2558008,24.5123719 C15.6691024,25.350947 16.5116017,26.1727505 17.433582,26.6591241 L18.2124965,27.0448686 L17.2905161,27.0616401 C16.4003282,27.0616401 16.3685358,27.0784116 16.4639131,27.4306131 C16.7818374,28.5207608 18.0376382,29.6779944 19.436505,30.1811394 L20.4220701,30.533341 L19.5636746,31.070029 C18.2919776,31.8415181 16.7977335,32.2775772 15.3034895,32.3111202 C14.5881599,32.3278916 14,32.3949776 14,32.4452922 C14,32.6130071 15.939338,33.5522113 17.0679692,33.9211843 C20.4538626,35.0113319 24.4756046,34.5417298 27.4958851,32.6800932 C29.6418739,31.3551445 31.7878628,28.7220188 32.7893242,26.1727505 C33.3297954,24.8142589 33.8702667,22.3320767 33.8702667,21.1413 C33.8702667,20.369811 33.9179553,20.269182 34.8081432,19.3467494 C35.3327183,18.8100613 35.8255009,18.2230588 35.9208782,18.0553437 C36.0798403,17.7366852 36.0639442,17.7366852 35.2532373,18.0218007 C33.9020591,18.5249458 33.7113045,18.4578598 34.3789455,17.7031422 C34.8717281,17.1664541 35.459888,16.1937071 35.459888,15.9085915 C35.459888,15.858277 35.2214448,15.9421346 34.9512092,16.093078 C34.6650773,16.2607931 34.0292288,16.5123656 33.5523424,16.6633091 L32.6939469,16.9484246 L31.9150324,16.394965 C31.4858346,16.093078 30.8817786,15.757648 30.5638543,15.657019 C29.7531474,15.422218 28.5132428,15.455761 27.7820169,15.724105 C25.7949903,16.4788226 24.5391894,18.4243168 24.6822554,20.5542975 C24.6822554,20.5542975 24.5391894,18.4243168 24.6822554,20.5542975 Z M24.6822554,20.5542975" }) ) ), vimeo: React.createElement( Fragment, null, React.createElement( "g", { fill: "currentColor", "fill-rule": "evenodd", stroke: "none", "stroke-width": "1" }, React.createElement("path", { d: "M50,25 C50,11.1928806 38.8071194,0 25,0 C11.1928806,0 0,11.1928806 0,25 C0,38.8071194 11.1928806,50 25,50 C38.8071194,50 50,38.8071194 50,25 Z M47,25 C47,12.8497349 37.1502651,3 25,3 C12.8497349,3 3,12.8497349 3,25 C3,37.1502651 12.8497349,47 25,47 C37.1502651,47 47,37.1502651 47,25 Z M17.315812,20.9060694 C17.9328006,21.6627251 20.2884417,30.7991385 21.0747632,32.4845455 C21.7610734,33.9625783 23.6542105,35.9166045 25.7302773,34.5211721 C27.8051355,33.1256949 34.7049271,27.0158598 35.9400265,19.8005667 C37.1740468,12.5875569 27.6369679,14.0985404 26.6267538,20.382799 C29.1516416,18.8105703 30.4993563,21.0216204 29.2073234,23.5249731 C27.9176213,26.0259082 26.7391965,27.657054 26.1221216,27.657054 C25.5062553,27.657054 25.0324423,25.9834215 24.3267945,23.0582023 C23.5973201,20.0339521 23.6018092,14.5864425 20.5690087,15.204043 C17.7089081,15.7862753 13.95,20.4417609 13.95,20.4417609 L14.8476851,21.6627251 C14.8476851,21.6627251 16.6987803,20.1493241 17.315812,20.9060694 Z M17.315812,20.9060694" }) ) ), youtube: React.createElement( Fragment, null, React.createElement( "g", { fill: "currentColor", "fill-rule": "evenodd", stroke: "none", "stroke-width": "1" }, React.createElement("path", { d: "M50,25 C50,11.1928806 38.8071194,0 25,0 C11.1928806,0 0,11.1928806 0,25 C0,38.8071194 11.1928806,50 25,50 C38.8071194,50 50,38.8071194 50,25 Z M47,25 C47,12.8497349 37.1502651,3 25,3 C12.8497349,3 3,12.8497349 3,25 C3,37.1502651 12.8497349,47 25,47 C37.1502651,47 47,37.1502651 47,25 Z M36.768327,30.7654774 C36.4698281,32.0627028 35.4087162,33.0191862 34.1319129,33.1618614 C31.1074781,33.4998058 28.0463955,33.5014844 24.9984613,33.4998058 C21.9508068,33.5014844 18.8894444,33.4998058 15.8652894,33.1618614 C14.5882064,33.0191862 13.5276539,32.0627028 13.2294348,30.7654774 C12.8047662,28.9179732 12.8047662,26.9020564 12.8047662,25.0002798 C12.8047662,23.0982233 12.8098018,21.0820268 13.2341906,19.2345226 C13.5326895,17.9372972 14.5932419,16.980534 15.8700452,16.8381386 C18.89448,16.5001942 21.9555627,16.4985156 25.0034969,16.5001942 C28.0511513,16.4985156 31.1125137,16.5001942 34.1366687,16.8381386 C35.4137518,16.980534 36.4748637,17.9372972 36.7730829,19.2345226 C37.1977514,21.0820268 37.1952336,23.0982233 37.1952336,25.0002798 C37.1952336,26.9020564 37.1927158,28.9179732 36.768327,30.7654774 Z M22.8047662,20.5 L29.5547662,24.3971143 L22.8047662,28.2942286 L22.8047662,20.5 Z M22.8047662,20.5" }) ) ) }; var AdvSocialBlock = function (_Component) { _inherits(AdvSocialBlock, _Component); function AdvSocialBlock() { _classCallCheck(this, AdvSocialBlock); var _this = _possibleConstructorReturn(this, (AdvSocialBlock.__proto__ || Object.getPrototypeOf(AdvSocialBlock)).apply(this, arguments)); _this.state = { currentSelected: 0, searchedText: '' }; return _this; } _createClass(AdvSocialBlock, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-social-links']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === "undefined" ? "undefined" : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: "render", value: function render() { var _this2 = this; var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes, isSelected = _props2.isSelected; var items = attributes.items, align = attributes.align, iconSize = attributes.iconSize, iconSpace = attributes.iconSpace, isPreview = attributes.isPreview; var _state = this.state, currentSelected = _state.currentSelected, searchedText = _state.searchedText; var matchedIcons = Object.keys(ICONS_SET_NEW).filter(function (key) { return key.indexOf(searchedText.toLowerCase().trim()) > -1; }); return isPreview ? React.createElement("img", { alt: __('Social Links', 'advanced-gutenberg'), width: "100%", src: previewImageData }) : React.createElement( Fragment, null, React.createElement( BlockControls, null, React.createElement( ToolbarGroup, null, React.createElement(ToolbarButton, { className: "components-toolbar__control", icon: "plus", label: __('Add item', 'advanced-gutenberg'), onClick: function onClick() { return setAttributes({ items: [].concat(_toConsumableArray(items), [{ icon: '', iconID: '', link: '#' }]) }); } }), React.createElement(ToolbarButton, { className: "components-toolbar__control", icon: "no", label: __('Remove selected item', 'advanced-gutenberg'), onClick: function onClick() { _this2.setState({ currentSelected: Math.max(currentSelected - 1, 0) }); if (items.length > 1) { setAttributes({ items: items.filter(function (item, index) { return index !== currentSelected; }) }); } else { setAttributes({ items: [{ icon: '', iconID: '', iconColor: '', link: '#' }] }); } } }) ), React.createElement(AlignmentToolbar, { value: align, onChange: function onChange(value) { return setAttributes({ align: value === undefined ? 'center' : value }); } }) ), React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Preset Icons', 'advanced-gutenberg') }, React.createElement(TextControl, { placeholder: __('Type here to search…', 'advanced-gutenberg'), value: searchedText, onChange: function onChange(value) { return _this2.setState({ searchedText: value }); } }), React.createElement( "div", { className: "advgb-icon-items-wrapper" }, matchedIcons.map(function (key, index) { return React.createElement( "div", { className: "advgb-icon-item", key: index }, React.createElement( Tooltip, { text: key }, React.createElement( "span", { className: key === items[currentSelected].icon ? 'active' : '', onClick: function onClick() { var newItems = items.map(function (item, index) { if (index === currentSelected) { item = _extends({}, item, { icon: key, iconID: '' }); } return item; }); setAttributes({ items: newItems }); } }, React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 50 50" }, ICONS_SET_NEW[key] ) ) ) ); }) ), React.createElement( BaseControl, { label: __('Custom icon', 'advanced-gutenberg') }, React.createElement(MediaUpload, { allowedTypes: ["image"], value: items[currentSelected].iconID, onSelect: function onSelect(media) { var newItems = items.map(function (item, index) { if (index === currentSelected) { item = _extends({}, item, { icon: media.sizes.thumbnail ? media.sizes.thumbnail.url : media.sizes.full.url, iconID: media.id }); } return item; }); setAttributes({ items: newItems }); }, render: function render(_ref) { var open = _ref.open; return React.createElement( Button, { className: "button button-large", onClick: open }, __('Upload/Choose', 'advanced-gutenberg') ); } }) ), React.createElement(PanelColorSettings, { title: __('Preset Icon Color', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Preset Icon Color', 'advanced-gutenberg'), value: items[currentSelected].iconColor, onChange: function onChange(value) { var newItems = items.map(function (item, index) { if (index === currentSelected) { item = _extends({}, item, { iconColor: value }); } return item; }); setAttributes({ items: newItems }); } }] }) ), React.createElement( PanelBody, { title: __('Icons settings', 'advanced-gutenberg') }, React.createElement(RangeControl, { label: __('Icon size', 'advanced-gutenberg'), value: iconSize, min: 20, max: 60, onChange: function onChange(value) { return setAttributes({ iconSize: value }); } }), React.createElement(RangeControl, { label: __('Icon space', 'advanced-gutenberg'), value: iconSpace, min: 0, max: 30, onChange: function onChange(value) { return setAttributes({ iconSpace: value }); } }) ) ), React.createElement( "div", { className: "advgb-social-links-block", style: { textAlign: align } }, React.createElement( "div", { className: "advgb-social-icons" }, items.map(function (item, index) { return React.createElement( "span", { key: index, className: "advgb-social-icon " + (currentSelected === index ? 'selected' : ''), onClick: function onClick() { return _this2.setState({ currentSelected: index }); }, style: { width: iconSize + 'px', height: iconSize + 'px', marginLeft: iconSpace + 'px', marginRight: iconSpace + 'px', color: item.iconColor } }, !!item.icon ? item.icon in ICONS_SET_NEW ? React.createElement( "svg", { width: iconSize - 6, height: iconSize - 6, viewBox: "0 0 50 50" }, ICONS_SET_NEW[item.icon] ) : React.createElement("img", { src: item.icon, alt: __('Social link icon', 'advanced-gutenberg') }) : React.createElement( "svg", { width: iconSize - 6, height: iconSize - 6, viewBox: "0 0 24 24" }, socialBlockIconContent ) ); }) ), isSelected && React.createElement( Fragment, null, React.createElement( "div", { className: "advgb-social-link" }, React.createElement( "strong", null, __('Social link:', 'advanced-gutenberg') ), React.createElement(TextControl, { placeholder: __('Enter social link…', 'advanced-gutenberg'), value: items[currentSelected].link, onChange: function onChange(value) { var newItems = items.map(function (vl, idx) { if (idx === parseInt(currentSelected)) vl = _extends({}, vl, { link: value }); return vl; }); return setAttributes({ items: newItems }); } }) ) ) ) ); } }]); return AdvSocialBlock; }(Component); var socialBlockAttrs = { items: { type: 'array', default: [{ icon: '', iconID: '', iconColor: '', link: '#' }, { icon: '', iconID: '', iconColor: '', link: '#' }, { icon: '', iconID: '', iconColor: '', link: '#' }] }, align: { type: 'string' }, iconSize: { type: 'number', default: 48 }, iconSpace: { type: 'number', default: 5 }, changed: { type: 'boolean', default: false }, isPreview: { type: 'boolean', default: false } }; registerBlockType('advgb/social-links', { title: __('Social Links - PublishPress', 'advanced-gutenberg'), description: __('Create a styling display of links to your social media profiles.', 'advanced-gutenberg'), icon: { src: socialBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('social icons', 'advanced-gutenberg'), __('shares', 'advanced-gutenberg'), __('icon link', 'advanced-gutenberg')], attributes: socialBlockAttrs, example: { attributes: { isPreview: true } }, supports: { anchor: true }, edit: AdvSocialBlock, save: function save(_ref2) { var attributes = _ref2.attributes; var items = attributes.items, align = attributes.align, iconSize = attributes.iconSize, iconSpace = attributes.iconSpace; return React.createElement( "div", { className: "advgb-social-links-block", style: { textAlign: align } }, React.createElement( "div", { className: "advgb-social-icons" }, items.map(function (item, index) { return React.createElement( "a", { key: index, className: "advgb-social-icon", href: item.link || '#', target: "_blank", rel: "noopener noreferrer", style: { width: iconSize + 'px', height: iconSize + 'px', marginLeft: iconSpace + 'px', marginRight: iconSpace + 'px', color: item.iconColor } }, !!item.icon ? item.icon in ICONS_SET_NEW ? React.createElement( "svg", { width: iconSize - 6, height: iconSize - 6, viewBox: "0 0 50 50" }, ICONS_SET_NEW[item.icon] ) : React.createElement("img", { src: item.icon, alt: __('Social link icon', 'advanced-gutenberg') }) : React.createElement( "svg", { width: iconSize - 6, height: iconSize - 6, viewBox: "0 0 24 24" }, socialBlockIconContent ) ); }) ) ); }, deprecated: [{ attributes: _extends({}, socialBlockAttrs, { iconSize: { type: "number", default: 24 } }), save: function save(_ref3) { var attributes = _ref3.attributes; var items = attributes.items, align = attributes.align, iconSize = attributes.iconSize, iconSpace = attributes.iconSpace; return React.createElement( "div", { className: "advgb-social-links-block", style: { textAlign: align } }, React.createElement( "div", { className: "advgb-social-icons" }, items.map(function (item, index) { return React.createElement( "a", { key: index, className: "advgb-social-icon", href: item.link || '#', target: "_blank", rel: "noopener noreferrer", style: { width: iconSize + 'px', height: iconSize + 'px', marginLeft: iconSpace + 'px', marginRight: iconSpace + 'px', color: item.iconColor } }, !!item.icon ? item.icon in ICONS_SET_NEW ? React.createElement( "svg", { width: iconSize - 6, height: iconSize - 6, viewBox: "0 0 50 50" }, ICONS_SET_NEW[item.icon] ) : React.createElement("img", { src: item.icon, alt: __('Social link icon', 'advanced-gutenberg') }) : React.createElement( "svg", { width: iconSize - 6, height: iconSize - 6, viewBox: "0 0 24 24" }, React.createElement(Fragment, null, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M18,16.08c-0.76,0-1.44,0.3-1.96,0.77L8.91,12.7C8.96,12.47,9,12.24,9,12s-0.04-0.47-0.09-0.7l7.05-4.11\r C16.5,7.69,17.21,8,18,8c1.66,0,3-1.34,3-3c0-1.66-1.34-3-3-3s-3,1.34-3,3c0,0.24,0.04,0.47,0.09,0.7L8.04,9.81\r C7.5,9.31,6.79,9,6,9c-1.66,0-3,1.34-3,3c0,1.66,1.34,3,3,3c0.79,0,1.5-0.31,2.04-0.81l7.12,4.16c-0.05,0.21-0.08,0.43-0.08,0.65\r c0,1.61,1.31,2.92,2.92,2.92s2.92-1.31,2.92-2.92C20.92,17.39,19.61,16.08,18,16.08z M18,4c0.55,0,1,0.45,1,1s-0.45,1-1,1\r s-1-0.45-1-1S17.45,4,18,4z M6,13c-0.55,0-1-0.45-1-1s0.45-1,1-1s1,0.45,1,1S6.55,13,6,13z M18,20.02c-0.55,0-1-0.45-1-1\r s0.45-1,1-1s1,0.45,1,1S18.55,20.02,18,20.02z" })) ) ); }) ) ); } }] }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/summary/block.jsx": /*!*********************************************!*\ !*** ./src/assets/blocks/summary/block.jsx ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _latinize = __webpack_require__(/*! latinize */ "./node_modules/latinize/latinize.js"); var _latinize2 = _interopRequireDefault(_latinize); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents, wpData, wpHooks) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType, getBlockContent = wpBlocks.getBlockContent, createBlock = wpBlocks.createBlock; var _wpBlockEditor = wpBlockEditor, BlockControls = _wpBlockEditor.BlockControls, InspectorControls = _wpBlockEditor.InspectorControls, InspectorAdvancedControls = _wpBlockEditor.InspectorAdvancedControls, PanelColorSettings = _wpBlockEditor.PanelColorSettings, BlockAlignmentToolbar = _wpBlockEditor.BlockAlignmentToolbar; var ToolbarButton = wpComponents.ToolbarButton, Placeholder = wpComponents.Placeholder, Button = wpComponents.Button, ToolbarGroup = wpComponents.ToolbarGroup, ToggleControl = wpComponents.ToggleControl, TextControl = wpComponents.TextControl, PanelBody = wpComponents.PanelBody; var select = wpData.select, dispatch = wpData.dispatch; var addFilter = wpHooks.addFilter; var summaryBlockIcon = React.createElement( "svg", { height: "20", viewBox: "2 2 22 22", width: "20", xmlns: "http://www.w3.org/2000/svg" }, React.createElement("path", { d: "M14 17H4v2h10v-2zm6-8H4v2h16V9zM4 15h16v-2H4v2zM4 5v2h16V5H4z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ); var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAADyCAYAAABkv9hQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACKpJREFUeNrs3UFsFHsdwPGZ3e0rrRRIm5VHrL1xIkFOpiaUePTg1USNB48kJiQeXvTGwZjAkQOBCDdCTOSuROVEMATlYEE4gKQmJYZUStxaamE7407fgtNlZtud3YVt9/NJJm3hPXaZ6be//+zsLkEAAAAAAAAAAABDJOzXH1ypVPp+G7CHxO8+qdfrgx16M+6wg9vwQ4ChDXoHvxf3KvrwIwQe5tyWyBH71q/jjN+PezHlwz5EHrbEnRW6yBH71s+zYo97Nd3DHkYe5myCh+0neesWZH1dNPawj5GXtgkfRP9h4FFO+F3FXunBsj8r7uRjaWZmpnzz5s3ZarX6zVKp9JU4jsPG9uW9bXzuWDOMwjDcDHp1dfXvly9f/v25c+dqqcjDluCjlh8OYdD+Ab3eTfTGNM+LfHM7derUZzdu3PjxoUOHftYI/HOHFnLGehy/WV9fv3n9+vWfnz59+p/NsLO2LZO9MdXjvoaeWrJnRV5OPq6srPxq375933cYYWeiKPrXvXv3fjQ3N/fnxpcbzbg38mLvNPRyp3eoMaHT0zy9VE/+rPLS0tIX+/fv/4lDBx0t58ePHDny7YWFhV/Pz8+/bXM+/77Dxg+HnXfbxfn5B9P8ypUrnx88ePCnDht0rlwuT589e/Z774Zm+nQ4yH5Quz8TvWXZXmpZspcvXbr0w8Y0/65DBsWMj4/PNJblv71z587r1iketFxbb0z1YKdTvdOJnvVst/fBT0xMfMuhguIaw3R6dnb26xlTPX2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fQQMAAAAAAAAAAA3/E2AAgLPse1bmMt4AAAAASUVORK5CYII='; var summaryBlockTitle = __('Table of Contents - PublishPress', 'advanced-gutenberg'); // Add button to insert summary inside table of contents component (function () { jQuery(window).on('load', function () { if (!dispatch('core/editor') || typeof dispatch('core/editor') === 'undefined') { return false; } var $ = jQuery; var _dispatch = dispatch('core/editor'), insertBlock = _dispatch.insertBlock; if (select('core/blocks').getBlockType('advgb/summary')) { var _summaryBlock = createBlock('advgb/summary'); } $('#editor').find('.table-of-contents').click(function () { var allBlocks = select('core/block-editor').getBlocks(); var summaryBlockExist = !!allBlocks.filter(function (block) { return block.name === 'advgb/summary'; }).length; setTimeout(function () { var summaryButton = $('<button class="button" style="position: absolute; bottom: 10px; right: 15px">' + __('Insert Table of Contents', 'advanced-gutenberg') + '</button>'); $('#editor').find('.table-of-contents__popover').find('.document-outline').append(summaryButton); summaryButton.unbind('click').click(function () { insertBlock(summaryBlock, 0); $('.table-of-contents__popover').hide(); }); if (summaryBlockExist) { summaryButton.prop('disabled', true); } }, 100); }); }); })(); // Add notice for user to refresh summary if manually change heading anchor addFilter('editor.BlockEdit', 'advgb/addHeadingNotice', function (BlockEdit) { return function (props) { var isSelected = props.isSelected, blockType = props.name, attributes = props.attributes; return [React.createElement(BlockEdit, _extends({ key: "block-edit-summary" }, props)), isSelected && blockType === 'core/heading' && attributes.nodeName !== 'H1' && React.createElement( InspectorAdvancedControls, { key: "advgb-summary-controls-hint" }, React.createElement( "p", { style: { color: 'red', fontStyle: 'italic' } }, __('After manually changing the anchor, remember to refresh Table of Contents block to make the links work!', 'advanced-gutenberg') ) )]; }; }); var SummaryBlock = function (_Component) { _inherits(SummaryBlock, _Component); function SummaryBlock() { _classCallCheck(this, SummaryBlock); var _this = _possibleConstructorReturn(this, (SummaryBlock.__proto__ || Object.getPrototypeOf(SummaryBlock)).apply(this, arguments)); _this.updateSummary = _this.updateSummary.bind(_this); _this.latinise = _this.latinise.bind(_this); return _this; } _createClass(SummaryBlock, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-summary']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === "undefined" ? "undefined" : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: "componentDidMount", value: function componentDidMount() { this.updateSummary(); } }, { key: "latinise", value: function latinise(str) { var lettersArr = str.split(''); var result = []; lettersArr.map(function (letter) { if (typeof latinMap[letter] === "undefined") { result.push(letter); } else { result.push(latinMap[letter]); } }); return result.join(''); } }, { key: "updateSummary", value: function updateSummary() { var headingDatas = []; var headingBlocks = []; var allBlocks = select('core/block-editor').getBlocks(); var filteredBlocks = allBlocks.filter(function (block) { return block.name === 'core/heading' || block.name === 'core/columns' || block.name === 'core/cover' || block.name === 'core/group'; }); filteredBlocks.map(function (block) { if (block.name === 'core/columns' || block.name === 'core/cover' || block.name === 'core/group') { SummaryBlock.getHeadingBlocksFromColumns(block, headingBlocks); } else { headingBlocks.push(block); } return block; }); headingBlocks.map(function (heading) { var thisHead = {}; thisHead['level'] = parseInt(heading.attributes.level); // We only get heading from h2 if (thisHead['level'] > 1) { thisHead['level'] -= 1; thisHead['content'] = heading.attributes.content.length ? getBlockContent(heading).replace(/<(?:.|\n)*?>/gm, '') : ''; var lowerHead = unescape(thisHead['content'].toLowerCase()); var headId = lowerHead.replace(/[!@#$%^&*()\/\\,?":{}|<>]/g, ""); headId = headId.replace(/(amp;)+/g, ""); headId = (0, _latinize2.default)(headId).replace(/\./g, ' ').replace(/[^\w ]+/g, '').replace(/ +/g, '-'); headId = headId + '-' + heading.clientId; thisHead['clientId'] = heading.clientId; if (heading.attributes.anchor) { thisHead['anchor'] = heading.attributes.anchor; } else { // Generate a random anchor for headings without it thisHead['anchor'] = headId; heading.attributes.anchor = thisHead['anchor']; } headingDatas.push(thisHead); } return heading; }); this.props.setAttributes({ headings: headingDatas }); } }, { key: "render", value: function render() { var _props2 = this.props, attributes = _props2.attributes, isSelected = _props2.isSelected, setAttributes = _props2.setAttributes; var headings = attributes.headings, loadMinimized = attributes.loadMinimized, anchorColor = attributes.anchorColor, align = attributes.align, headerTitle = attributes.headerTitle, isPreview = attributes.isPreview; // No heading blocks var summaryContent = isPreview ? React.createElement("img", { alt: __('Table of Contents', 'advanced-gutenberg'), width: "100%", src: previewImageData }) : React.createElement( Placeholder, { icon: summaryBlockIcon, label: summaryBlockTitle, instructions: __('Your current post/page has no headings. Try add some headings and update this block later', 'advanced-gutenberg') }, React.createElement( Button, { onClick: this.updateSummary, className: 'button' }, __('Update', 'advanced-gutenberg') ) ); // Having heading blocks if (headings.length > 0) { var _dispatch2 = dispatch('core/block-editor'), selectBlock = _dispatch2.selectBlock; summaryContent = React.createElement( "ul", { className: "advgb-toc" }, headings.map(function (heading) { return React.createElement( "li", { className: 'toc-level-' + heading.level, style: { marginLeft: heading.level * 20 }, key: heading.anchor }, React.createElement( "a", { href: '#' + heading.anchor, onClick: function onClick() { return selectBlock(heading.clientId); }, style: { color: anchorColor } }, heading.content ) ); }) ); } return React.createElement( Fragment, null, !!headings.length && React.createElement( BlockControls, null, React.createElement(BlockAlignmentToolbar, { value: align, onChange: function onChange(align) { return setAttributes({ align: align }); } }), React.createElement( ToolbarGroup, null, React.createElement(ToolbarButton, { className: 'components-icon-button components-toolbar__control', icon: 'update', label: __('Update Table of Contents', 'advanced-gutenberg'), onClick: this.updateSummary }) ) ), React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Table of Contents settings', 'advanced-gutenberg') }, React.createElement(ToggleControl, { label: __('Load minimized', 'advanced-gutenberg'), checked: !!loadMinimized, onChange: function onChange() { return setAttributes({ loadMinimized: !loadMinimized, postTitle: select('core/editor').getEditedPostAttribute('title') }); } }), loadMinimized && React.createElement(TextControl, { label: __('Table of Contents header title', 'advanced-gutenberg'), value: headerTitle || '', placeholder: __('Enter header…', 'advanced-gutenberg'), onChange: function onChange(value) { return setAttributes({ headerTitle: value }); } }), React.createElement(PanelColorSettings, { title: __('Anchor Color', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Anchor Color', 'advanced-gutenberg'), value: anchorColor, onChange: function onChange(value) { return setAttributes({ anchorColor: value }); } }] }) ) ), summaryContent ); } }], [{ key: "getHeadingBlocksFromColumns", /** * Function to get heading blocks from columns blocks * * @param block array Columns block to get data * @param storeData array Data array to store heading blocks * * @returns array array Heading blocks from block given */ value: function getHeadingBlocksFromColumns(block, storeData) { if (block.name === 'core/columns' || block.name === 'core/column' || block.name === 'core/cover' || block.name === 'core/group') { block.innerBlocks.map(function (bl) { SummaryBlock.getHeadingBlocksFromColumns(bl, storeData); return bl; }); } else if (block.name === 'core/heading') { storeData.push(block); } return storeData; } }]); return SummaryBlock; }(Component); var blockAttrs = { headings: { type: 'array', default: [] }, loadMinimized: { type: 'boolean', default: false }, anchorColor: { type: 'string' }, align: { type: 'string', default: 'none' }, postTitle: { type: 'string' }, headerTitle: { type: 'string' }, changed: { type: 'boolean', default: false }, isPreview: { type: 'boolean', default: false } }; registerBlockType('advgb/summary', { title: summaryBlockTitle, description: __('Show the table of contents of current post/page.', 'advanced-gutenberg'), icon: { src: summaryBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('summary', 'advanced-gutenberg'), __('table of content', 'advanced-gutenberg'), __('table of contents', 'advanced-gutenberg'), __('list', 'advanced-gutenberg')], attributes: blockAttrs, example: { attributes: { isPreview: true } }, supports: { multiple: false, anchor: true }, edit: SummaryBlock, save: function save(_ref) { var attributes = _ref.attributes; var headings = attributes.headings, loadMinimized = attributes.loadMinimized, anchorColor = attributes.anchorColor, _attributes$align = attributes.align, align = _attributes$align === undefined ? 'none' : _attributes$align, postTitle = attributes.postTitle, headerTitle = attributes.headerTitle; // No heading blocks if (headings.length < 1) { return null; } var blockStyle = undefined; if (loadMinimized) blockStyle = { display: 'none' }; var summary = React.createElement( "ul", { className: "advgb-toc align" + align, style: blockStyle }, headings.map(function (heading, index) { return React.createElement( "li", { className: 'toc-level-' + heading.level, key: "summary-save-" + index }, React.createElement( "a", { href: '#' + heading.anchor, style: { color: anchorColor } }, heading.content ) ); }) ); if (loadMinimized) { return React.createElement( "div", { className: "align" + align }, React.createElement( "div", { className: 'advgb-toc-header collapsed' }, headerTitle || postTitle ), summary ); } return summary; }, getEditWrapperProps: function getEditWrapperProps(attributes) { var align = attributes.align; var props = { 'data-resized': true }; if ('left' === align || 'right' === align || 'center' === align) { props['data-align'] = align; } return props; }, deprecated: [{ attributes: blockAttrs, save: function save(_ref2) { var attributes = _ref2.attributes; var headings = attributes.headings, loadMinimized = attributes.loadMinimized, anchorColor = attributes.anchorColor, _attributes$align2 = attributes.align, align = _attributes$align2 === undefined ? 'none' : _attributes$align2, postTitle = attributes.postTitle, headerTitle = attributes.headerTitle; // No heading blocks if (headings.length < 1) { return null; } var blockStyle = undefined; if (loadMinimized) blockStyle = { display: 'none' }; var summary = React.createElement( "ul", { className: "advgb-toc align" + align, style: blockStyle }, headings.map(function (heading, index) { return React.createElement( "li", { className: 'toc-level-' + heading.level, key: "summary-save-" + index, style: { marginLeft: heading.level * 20 } }, React.createElement( "a", { href: '#' + heading.anchor }, heading.content ) ); }), anchorColor && React.createElement( "style", null, ".advgb-toc li a {\n color: " + anchorColor + ";\n }" ) ); if (loadMinimized) { return React.createElement( "div", { className: "align" + align }, React.createElement( "div", { className: 'advgb-toc-header collapsed' }, headerTitle || postTitle ), summary ); } return summary; } }, { attributes: blockAttrs, save: function save(_ref3) { var attributes = _ref3.attributes; var summary = React.createElement( "ul", { className: "advgb-toc align" + align, style: blockStyle }, headings.map(function (heading, index) { return React.createElement( "li", { className: 'toc-level-' + heading.level, key: "summary-save-" + index, style: { marginLeft: heading.level * 20 } }, React.createElement( "a", { href: '#' + heading.anchor, style: { color: anchorColor } }, heading.content ) ); }) ); } }] }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components, wp.data, wp.hooks); /***/ }), /***/ "./src/assets/blocks/tabs/block.jsx": /*!******************************************!*\ !*** ./src/assets/blocks/tabs/block.jsx ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType, createBlock = wpBlocks.createBlock; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, RichText = _wpBlockEditor.RichText, PanelColorSettings = _wpBlockEditor.PanelColorSettings; var Dashicon = wpComponents.Dashicon, Tooltip = wpComponents.Tooltip, PanelBody = wpComponents.PanelBody, RangeControl = wpComponents.RangeControl, SelectControl = wpComponents.SelectControl; var AdvTabsBlock = function (_Component) { _inherits(AdvTabsBlock, _Component); function AdvTabsBlock() { _classCallCheck(this, AdvTabsBlock); return _possibleConstructorReturn(this, (AdvTabsBlock.__proto__ || Object.getPrototypeOf(AdvTabsBlock)).apply(this, arguments)); } _createClass(AdvTabsBlock, [{ key: 'componentWillMount', value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-tabs']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === 'undefined' ? 'undefined' : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: 'componentDidMount', value: function componentDidMount() { var _this2 = this; setTimeout(function () { return _this2.initTabs(); }, 100); if (!this.props.attributes.blockID) { this.props.setAttributes({ blockID: this.props.clientId }); } } }, { key: 'componentDidUpdate', value: function componentDidUpdate(prevProps) { var prevItems = prevProps.attributes.tabItems; var tabItems = this.props.attributes.tabItems; if (prevItems !== tabItems) { this.initTabs(true); } if (tabItems.length === 0) { this.props.setAttributes({ tabItems: [{ header: 'Tab 1', body: 'At least one tab must remaining, to remove block use "Remove Block" button from right menu.' }] }); } } }, { key: 'initTabs', value: function initTabs() { var refresh = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (typeof jQuery !== "undefined") { if (!refresh) { jQuery('#block-' + this.props.clientId + ' .advgb-tabs-block').tabs(); } else { jQuery('#block-' + this.props.clientId + ' .advgb-tabs-block').tabs('refresh'); } jQuery('#block-' + this.props.clientId + ' .advgb-tabs-block a').on('keydown', function (e) { e.stopPropagation(); }); } } }, { key: 'updateTabs', value: function updateTabs(value, index) { var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes; var tabItems = attributes.tabItems; var newItems = tabItems.map(function (item, thisIndex) { if (index === thisIndex) { item = _extends({}, item, value); } return item; }); setAttributes({ tabItems: newItems }); } }, { key: 'render', value: function render() { var _this3 = this; var _props3 = this.props, attributes = _props3.attributes, setAttributes = _props3.setAttributes, clientId = _props3.clientId; var tabItems = attributes.tabItems, headerBgColor = attributes.headerBgColor, headerTextColor = attributes.headerTextColor, bodyBgColor = attributes.bodyBgColor, bodyTextColor = attributes.bodyTextColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, borderColor = attributes.borderColor, borderRadius = attributes.borderRadius, blockID = attributes.blockID, activeTabBgColor = attributes.activeTabBgColor, activeTabTextColor = attributes.activeTabTextColor; return React.createElement( Fragment, null, React.createElement( InspectorControls, null, React.createElement(PanelColorSettings, { title: __('Tab Colors', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Background Color', 'advanced-gutenberg'), value: headerBgColor, onChange: function onChange(value) { return setAttributes({ headerBgColor: value === undefined ? '#000' : value }); } }, { label: __('Text Color', 'advanced-gutenberg'), value: headerTextColor, onChange: function onChange(value) { return setAttributes({ headerTextColor: value === undefined ? '#fff' : value }); } }, { label: __('Active Tab Background Color', 'advanced-gutenberg'), value: activeTabBgColor, onChange: function onChange(value) { return setAttributes({ activeTabBgColor: value }); } }, { label: __('Active Tab Text Color', 'advanced-gutenberg'), value: activeTabTextColor, onChange: function onChange(value) { return setAttributes({ activeTabTextColor: value }); } }] }), React.createElement(PanelColorSettings, { title: __('Body Colors', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Background Color', 'advanced-gutenberg'), value: bodyBgColor, onChange: function onChange(value) { return setAttributes({ bodyBgColor: value }); } }, { label: __('Text Color', 'advanced-gutenberg'), value: bodyTextColor, onChange: function onChange(value) { return setAttributes({ bodyTextColor: value }); } }] }), React.createElement( PanelBody, { title: __('Border Settings', 'advanced-gutenberg'), initialOpen: false }, React.createElement(SelectControl, { label: __('Border Style', 'advanced-gutenberg'), value: borderStyle, options: [{ label: __('Solid', 'advanced-gutenberg'), value: 'solid' }, { label: __('Dashed', 'advanced-gutenberg'), value: 'dashed' }, { label: __('Dotted', 'advanced-gutenberg'), value: 'dotted' }], onChange: function onChange(value) { return setAttributes({ borderStyle: value }); } }), React.createElement(PanelColorSettings, { title: __('Border Color', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Border Color', 'advanced-gutenberg'), value: borderColor, onChange: function onChange(value) { return setAttributes({ borderColor: value }); } }] }), React.createElement(RangeControl, { label: __('Border width', 'advanced-gutenberg'), value: borderWidth, min: 1, max: 10, onChange: function onChange(value) { return setAttributes({ borderWidth: value }); } }), React.createElement(RangeControl, { label: __('Border radius', 'advanced-gutenberg'), value: borderRadius, min: 0, max: 100, onChange: function onChange(value) { return setAttributes({ borderRadius: value }); } }) ) ), React.createElement( 'div', { className: 'advgb-tabs-block', style: { border: 'none' } }, React.createElement( 'ul', { className: 'advgb-tabs-panel' }, tabItems.map(function (item, index) { return React.createElement( 'li', { key: index, className: 'advgb-tab', style: { backgroundColor: headerBgColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px', margin: '-' + borderWidth + 'px 0 -' + borderWidth + 'px -' + borderWidth + 'px' } }, React.createElement( 'a', { href: '#advgb-tab-' + blockID + '-' + index, style: { color: headerTextColor } }, React.createElement(RichText, { tagName: 'p', value: item.header, onChange: function onChange(value) { return _this3.updateTabs({ header: value || '' }, index); }, unstableOnSplit: function unstableOnSplit() { return null; }, placeholder: __('Title…', 'advanced-gutenberg') }) ), React.createElement( Tooltip, { text: __('Remove tab', 'advanced-gutenberg') }, React.createElement( 'span', { className: 'advgb-tab-remove', onClick: function onClick() { return setAttributes({ tabItems: tabItems.filter(function (vl, idx) { return idx !== index; }) }); } }, React.createElement(Dashicon, { icon: 'no' }) ) ) ); }), React.createElement( 'li', { className: 'advgb-tab advgb-add-tab ui-state-default', style: { borderRadius: borderRadius + 'px', borderWidth: borderWidth + 'px', margin: '-' + borderWidth + 'px 0 -' + borderWidth + 'px -' + borderWidth + 'px' } }, React.createElement( Tooltip, { text: __('Add tab', 'advanced-gutenberg') }, React.createElement( 'span', { onClick: function onClick() { return setAttributes({ tabItems: [].concat(_toConsumableArray(tabItems), [{ header: __('New Tab', 'advanced-gutenberg'), body: __('Enter your content.', 'advanced-gutenberg') }]) }); } }, React.createElement(Dashicon, { icon: 'plus-alt' }) ) ) ) ), tabItems.map(function (item, index) { return React.createElement( 'div', { key: index, id: 'advgb-tab-' + blockID + '-' + index, className: 'advgb-tab-body', style: { backgroundColor: bodyBgColor, color: bodyTextColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement(RichText, { tagName: 'p', value: item.body, onChange: function onChange(value) { return _this3.updateTabs({ body: value }, index); }, placeholder: __('Enter text…', 'advanced-gutenberg') }) ); }) ), !!blockID && React.createElement( 'style', null, activeTabBgColor && '#block-' + clientId + ' li.advgb-tab.ui-tabs-active {\n background-color: ' + activeTabBgColor + ' !important;\n }', activeTabTextColor && '#block-' + clientId + ' li.advgb-tab.ui-tabs-active a {\n color: ' + activeTabTextColor + ' !important;\n }' ) ); } }]); return AdvTabsBlock; }(Component); var tabsBlockIcon = React.createElement( 'svg', { xmlns: 'http://www.w3.org/2000/svg', width: '20', height: '20', viewBox: '0 0 24 24' }, React.createElement('path', { fill: 'none', d: 'M0,0h24v24H0V0z' }), React.createElement('path', { fill: 'none', d: 'M0,0h24v24H0V0z' }), React.createElement('path', { d: 'M21,3H3C1.9,3,1,3.9,1,5v14c0,1.1,0.9,2,2,2h18c1.1,0,2-0.9,2-2V5C23,3.9,22.1,3,21,3z M21,19H3V5h10v4h8V19z' }) ); var tabBlockAttrs = { tabItems: { type: "array", default: [{ header: __('Tab 1', 'advanced-gutenberg'), body: __('Filler text (also placeholder text or dummy text) is text that shares some characteristics of a real written text, but is random or otherwise generated.', 'advanced-gutenberg') }, { header: __('Tab 2', 'advanced-gutenberg'), body: __('Filler text (also placeholder text or dummy text) is text that shares some characteristics of a real written text, but is random or otherwise generated.', 'advanced-gutenberg') }, { header: __('Tab 3', 'advanced-gutenberg'), body: __('Filler text (also placeholder text or dummy text) is text that shares some characteristics of a real written text, but is random or otherwise generated.', 'advanced-gutenberg') }] }, headerBgColor: { type: 'string', default: '#000' }, headerTextColor: { type: 'string', default: '#fff' }, bodyBgColor: { type: 'string' }, bodyTextColor: { type: 'string' }, borderStyle: { type: 'string', default: 'solid' }, borderWidth: { type: 'number', default: 1 }, borderColor: { type: 'string' }, borderRadius: { type: 'number', default: 2 }, blockID: { type: 'string' }, activeTabBgColor: { type: 'string' }, activeTabTextColor: { type: 'string' }, changed: { type: 'boolean', default: false } }; registerBlockType('advgb/tabs', { title: __('Tabs (deprecated) - PublishPress', 'advanced-gutenberg'), description: __('Create horizontal or vertical tabs to display your content.', 'advanced-gutenberg'), icon: { src: tabsBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: "advgb-category", keywords: [__('tabs', 'advanced-gutenberg'), __('cards', 'advanced-gutenberg')], attributes: tabBlockAttrs, supports: { inserter: false }, edit: AdvTabsBlock, save: function save(_ref) { var attributes = _ref.attributes; var tabItems = attributes.tabItems, headerBgColor = attributes.headerBgColor, headerTextColor = attributes.headerTextColor, bodyBgColor = attributes.bodyBgColor, bodyTextColor = attributes.bodyTextColor, borderStyle = attributes.borderStyle, borderWidth = attributes.borderWidth, borderColor = attributes.borderColor, borderRadius = attributes.borderRadius, blockID = attributes.blockID, activeTabBgColor = attributes.activeTabBgColor, activeTabTextColor = attributes.activeTabTextColor; return React.createElement( 'div', { id: 'advgb-tabs-' + blockID, className: 'advgb-tabs-block', style: { border: 'none' } }, React.createElement( 'ul', { className: 'advgb-tabs-panel' }, tabItems.map(function (item, index) { return React.createElement( 'li', { key: index, className: 'advgb-tab', style: { backgroundColor: headerBgColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px', margin: '-' + borderWidth + 'px 0 -' + borderWidth + 'px -' + borderWidth + 'px' } }, React.createElement( 'a', { href: '#advgb-tab-' + blockID + '-' + index, style: { color: headerTextColor } }, React.createElement(RichText.Content, { tagName: 'span', value: item.header }) ) ); }) ), tabItems.map(function (item, index) { return React.createElement( 'div', { key: index, id: 'advgb-tab-' + blockID + '-' + index, className: 'advgb-tab-body', style: { backgroundColor: bodyBgColor, color: bodyTextColor, borderStyle: borderStyle, borderWidth: borderWidth + 'px', borderColor: borderColor, borderRadius: borderRadius + 'px' } }, React.createElement(RichText.Content, { tagName: 'p', value: item.body }) ); }), !!blockID && React.createElement( 'style', null, activeTabBgColor && '#advgb-tabs-' + blockID + ' li.advgb-tab.ui-tabs-active {\n background-color: ' + activeTabBgColor + ' !important;\n }\n ', activeTabTextColor && '#advgb-tabs-' + blockID + ' li.advgb-tab.ui-tabs-active a {\n color: ' + activeTabTextColor + ' !important;\n }' ) ); }, transforms: { to: [{ type: 'block', blocks: ['advgb/adv-tabs'], transform: function transform(attributes) { var innerTabs = []; var tabHeaders = []; attributes.tabItems.map(function (item) { var tabContent = createBlock('core/paragraph', { content: item.body }); var tab = createBlock('advgb/tab', { tabActive: 0 }, [tabContent]); tabHeaders.push(item.header); innerTabs.push(tab); }); attributes.tabItems = undefined; return createBlock('advgb/adv-tabs', _extends({}, attributes, { tabHeaders: tabHeaders, pid: 'advgb-tabs-' + attributes.blockID, changed: false, isTransform: true }), innerTabs); } }] } }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/testimonial/block.jsx": /*!*************************************************!*\ !*** ./src/assets/blocks/testimonial/block.jsx ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, RichText = _wpBlockEditor.RichText, PanelColorSettings = _wpBlockEditor.PanelColorSettings, MediaUpload = _wpBlockEditor.MediaUpload; var RangeControl = wpComponents.RangeControl, ToggleControl = wpComponents.ToggleControl, SelectControl = wpComponents.SelectControl, PanelBody = wpComponents.PanelBody, Tooltip = wpComponents.Tooltip; var _lodash = lodash, times = _lodash.times; var PREV_ARROW = React.createElement( "svg", { fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", width: "100%", height: "100%", viewBox: "0 0 24 24" }, React.createElement("path", { d: "M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z" }), React.createElement("path", { fill: "none", d: "M0 0h24v24H0V0z" }) ); var NEXT_ARROW = React.createElement( "svg", { fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", width: "100%", height: "100%", viewBox: "0 0 24 24" }, React.createElement("path", { d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" }), React.createElement("path", { fill: "none", d: "M0 0h24v24H0V0z" }) ); var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAACECAYAAAC5xDaMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAB2tJREFUeNrs3c9rFGccx/FndmYTVzdiE5cQEVEoiPTQU3to8FAogrQUL9VbLyXn2kPv/hVCSU+C4CVCS/HQij2m1BakF6FQk0OqqCSGTdxhs9mZ7nc7I8+OM7szs7M7++P9gseJu5NdneQz3+d55scqBQAAAAAAAAAAAAAAAEwRo59vtiwrk9cB0JMrfxweHg4v6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Or0VNwqUZoxvaHsbfgwS76wYVHci0oruBsboTyKFSMc6Oix1GbQZehQSbkAODHadHnQ3ndhubq7SBjAh88LUIOpBNVQ+r8LED3ncgA4En4MCQQp8k4JkG0ws9YQcGFPA04QYAAAAAAAAAAAAAAAAAAAAAAAAAAAD69J8AAwDy4cOYWRT5RgAAAABJRU5ErkJggg=='; var AdvTestimonial = function (_Component) { _inherits(AdvTestimonial, _Component); function AdvTestimonial() { _classCallCheck(this, AdvTestimonial); var _this = _possibleConstructorReturn(this, (AdvTestimonial.__proto__ || Object.getPrototypeOf(AdvTestimonial)).apply(this, arguments)); _this.state = { currentEdit: '' }; return _this; } _createClass(AdvTestimonial, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-testimonial']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === "undefined" ? "undefined" : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } } }, { key: "componentDidMount", value: function componentDidMount() { var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes, clientId = _props2.clientId; var pid = attributes.pid, sliderView = attributes.sliderView, sliderColumn = attributes.sliderColumn, sliderCenterMode = attributes.sliderCenterMode, sliderPauseOnHover = attributes.sliderPauseOnHover, sliderInfiniteLoop = attributes.sliderInfiniteLoop, sliderDotsShown = attributes.sliderDotsShown, sliderSpeed = attributes.sliderSpeed, sliderArrowShown = attributes.sliderArrowShown, sliderItemsToScroll = attributes.sliderItemsToScroll; setAttributes({ pid: "advgb-testimonial-" + clientId }); if (sliderView) { jQuery("#block-" + clientId + " .advgb-testimonial.slider-view").slick({ infinite: sliderInfiniteLoop, centerMode: sliderCenterMode, slidesToShow: sliderColumn, slidesToScroll: Math.min(sliderItemsToScroll, sliderColumn), pauseOnHover: sliderPauseOnHover, dots: sliderDotsShown, arrows: sliderArrowShown, speed: sliderSpeed, prevArrow: jQuery("#block-" + clientId + " .advgb-slider-prev"), nextArrow: jQuery("#block-" + clientId + " .advgb-slider-next") }); } } }, { key: "componentWillUpdate", value: function componentWillUpdate(nextProps) { var _props3 = this.props, attributes = _props3.attributes, clientId = _props3.clientId; var sliderView = attributes.sliderView; if (this.sliderNeedReload(nextProps.attributes, this.props.attributes)) { if (sliderView) { jQuery("#block-" + clientId + " .advgb-testimonial.slick-initialized").slick('unslick'); jQuery("#block-" + clientId + " .advgb-testimonial").removeAttr('tabindex').removeAttr('role').removeAttr('aria-describedby'); } } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _props4 = this.props, attributes = _props4.attributes, clientId = _props4.clientId; var sliderView = attributes.sliderView, sliderColumn = attributes.sliderColumn, sliderCenterMode = attributes.sliderCenterMode, sliderPauseOnHover = attributes.sliderPauseOnHover, sliderInfiniteLoop = attributes.sliderInfiniteLoop, sliderDotsShown = attributes.sliderDotsShown, sliderSpeed = attributes.sliderSpeed, sliderArrowShown = attributes.sliderArrowShown, sliderItemsToScroll = attributes.sliderItemsToScroll; var needReload = this.sliderNeedReload(prevProps.attributes, this.props.attributes); var needUpdate = this.sliderNeedUpdate(prevProps.attributes, this.props.attributes); var slider = jQuery("#block-" + clientId + " .advgb-testimonial.slider-view"); var prevElm = jQuery("#block-" + clientId + " .advgb-slider-prev"); var nextElm = jQuery("#block-" + clientId + " .advgb-slider-next"); if (needReload) { if (sliderView) { slider.slick({ infinite: sliderInfiniteLoop, centerMode: sliderCenterMode, slidesToShow: sliderColumn, slidesToScroll: Math.min(sliderItemsToScroll, sliderColumn), pauseOnHover: sliderPauseOnHover, dots: sliderDotsShown, arrows: sliderArrowShown, speed: sliderSpeed, prevArrow: prevElm, nextArrow: nextElm }); } } if (needUpdate && sliderView) { slider.slick('slickSetOption', 'slidesToShow', sliderColumn); slider.slick('slickSetOption', 'slidesToScroll', sliderItemsToScroll); slider.slick('slickSetOption', 'centerMode', sliderCenterMode); slider.slick('slickSetOption', 'pauseOnHover', sliderPauseOnHover); slider.slick('slickSetOption', 'infinite', sliderInfiniteLoop); slider.slick('slickSetOption', 'dots', sliderDotsShown); slider.slick('slickSetOption', 'arrows', sliderArrowShown); slider.slick('slickSetOption', 'speed', sliderSpeed); slider.slick('slickSetOption', 'prevArrow', prevElm); slider.slick('slickSetOption', 'nextArrow', nextElm, true); } } }, { key: "sliderNeedReload", value: function sliderNeedReload(pa, ca) { var checkReload = ['sliderView', 'columns', 'avatarPosition', 'sliderCenterMode']; var reload = false; var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = checkReload[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var checkProp = _step.value; if (pa[checkProp] !== ca[checkProp]) { reload = true; break; } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } return reload; } }, { key: "sliderNeedUpdate", value: function sliderNeedUpdate(pa, ca) { var checkUpdate = ['sliderColumn', 'sliderItemsToScroll', 'sliderPauseOnHover', 'sliderAutoPlay', 'sliderInfiniteLoop', 'sliderDotsShown', 'sliderSpeed', 'sliderAutoPlaySpeed', 'sliderArrowShown']; var update = false; var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = checkUpdate[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { var checkItem = _step2.value; if (pa[checkItem] !== ca[checkItem]) { update = true; break; } } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } return update; } }, { key: "updateItems", value: function updateItems(idx, data) { var _props5 = this.props, attributes = _props5.attributes, setAttributes = _props5.setAttributes; var items = attributes.items; var newItems = items.map(function (item, index) { if (idx === index) item = _extends({}, item, data); return item; }); setAttributes({ items: newItems }); } }, { key: "render", value: function render() { var _this2 = this; var currentEdit = this.state.currentEdit; var _props6 = this.props, attributes = _props6.attributes, setAttributes = _props6.setAttributes, isSelected = _props6.isSelected; var pid = attributes.pid, items = attributes.items, sliderView = attributes.sliderView, enableAvatar = attributes.enableAvatar, avatarColor = attributes.avatarColor, avatarBorderRadius = attributes.avatarBorderRadius, avatarBorderWidth = attributes.avatarBorderWidth, avatarBorderColor = attributes.avatarBorderColor, avatarSize = attributes.avatarSize, nameColor = attributes.nameColor, positionColor = attributes.positionColor, descColor = attributes.descColor, columns = attributes.columns, sliderColumn = attributes.sliderColumn, sliderItemsToScroll = attributes.sliderItemsToScroll, sliderCenterMode = attributes.sliderCenterMode, sliderPauseOnHover = attributes.sliderPauseOnHover, sliderAutoPlay = attributes.sliderAutoPlay, sliderInfiniteLoop = attributes.sliderInfiniteLoop, sliderDotsShown = attributes.sliderDotsShown, sliderDotsColor = attributes.sliderDotsColor, sliderSpeed = attributes.sliderSpeed, sliderAutoPlaySpeed = attributes.sliderAutoPlaySpeed, sliderArrowShown = attributes.sliderArrowShown, sliderArrowSize = attributes.sliderArrowSize, sliderArrowBorderSize = attributes.sliderArrowBorderSize, sliderArrowBorderRadius = attributes.sliderArrowBorderRadius, sliderArrowColor = attributes.sliderArrowColor, avatarPosition = attributes.avatarPosition, isPreview = attributes.isPreview; var blockClass = ['advgb-testimonial', sliderView && 'slider-view', "advgb-avatar-" + avatarPosition].filter(Boolean).join(' '); var maxCols = sliderView ? 10 : 3; var minCols = sliderView ? 4 : 1; var i = 0; var validCols = columns; if (columns < 1) { validCols = 1; } else if (columns > 3 && !sliderView) { validCols = 3; setAttributes({ columns: 3 }); } else if (columns < 4 && sliderView) { validCols = 4; setAttributes({ columns: 4 }); } else if (columns > 10) { validCols = 10; setAttributes({ columns: 10 }); } else if (columns === '' || !columns) { validCols = sliderView ? 4 : 1; } var arrowStyle = { color: sliderArrowColor, borderColor: sliderArrowColor, borderWidth: sliderArrowBorderSize, borderRadius: sliderArrowBorderRadius ? sliderArrowBorderRadius + "%" : undefined, width: sliderArrowSize }; return isPreview ? React.createElement("img", { alt: __('Testimonial', 'advanced-gutenberg'), width: "100%", src: previewImageData }) : React.createElement( Fragment, null, React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Testimonial Settings', 'advanced-gutenberg') }, React.createElement(ToggleControl, { label: __('Slider view', 'advanced-gutenberg'), checked: sliderView, onChange: function onChange() { return setAttributes({ sliderView: !sliderView }); } }), React.createElement(RangeControl, { label: !sliderView ? __('Columns', 'advanced-gutenberg') : __('Number of items', 'advanced-gutenberg'), help: __('Range in Normal view is 1-3, and in Slider view is 4-10.', 'advanced-gutenberg'), min: minCols, max: maxCols, value: columns, onChange: function onChange(value) { return setAttributes({ columns: value }); } }), sliderView && React.createElement( Fragment, null, React.createElement(RangeControl, { label: __('Items to show', 'advanced-gutenberg'), min: 1, max: columns, value: sliderColumn, onChange: function onChange(value) { return setAttributes({ sliderColumn: value }); } }), React.createElement(RangeControl, { label: __('Items to scroll', 'advanced-gutenberg'), min: 1, max: sliderColumn, value: sliderItemsToScroll, onChange: function onChange(value) { return setAttributes({ sliderItemsToScroll: value }); } }), React.createElement( PanelBody, { title: __('Slider Settings', 'advanced-gutenberg'), initialOpen: false }, React.createElement(ToggleControl, { label: __('Center mode', 'advanced-gutenberg'), checked: sliderCenterMode, onChange: function onChange() { return setAttributes({ sliderCenterMode: !sliderCenterMode }); } }), React.createElement(ToggleControl, { label: __('Pause on hover', 'advanced-gutenberg'), checked: sliderPauseOnHover, onChange: function onChange() { return setAttributes({ sliderPauseOnHover: !sliderPauseOnHover }); } }), React.createElement(ToggleControl, { label: __('Auto play', 'advanced-gutenberg'), checked: sliderAutoPlay, onChange: function onChange() { return setAttributes({ sliderAutoPlay: !sliderAutoPlay }); } }), sliderAutoPlay && React.createElement(RangeControl, { label: __('Autoplay speed (ms)', 'advanced-gutenberg'), min: 0, max: 10000, value: sliderAutoPlaySpeed, onChange: function onChange(value) { return setAttributes({ sliderAutoPlaySpeed: value }); } }), React.createElement(ToggleControl, { label: __('Infinite Loop', 'advanced-gutenberg'), checked: sliderInfiniteLoop, onChange: function onChange() { return setAttributes({ sliderInfiniteLoop: !sliderInfiniteLoop }); } }), React.createElement(RangeControl, { label: __('Transition speed (ms)', 'advanced-gutenberg'), min: 0, max: 5000, value: sliderSpeed, onChange: function onChange(value) { return setAttributes({ sliderSpeed: value }); } }), React.createElement(ToggleControl, { label: __('Show dots', 'advanced-gutenberg'), checked: sliderDotsShown, onChange: function onChange() { return setAttributes({ sliderDotsShown: !sliderDotsShown }); } }), React.createElement(ToggleControl, { label: __('Show arrows', 'advanced-gutenberg'), checked: sliderArrowShown, onChange: function onChange() { return setAttributes({ sliderArrowShown: !sliderArrowShown }); } }), sliderArrowShown && React.createElement( Fragment, null, React.createElement(RangeControl, { label: __('Arrow size', 'advanced-gutenberg'), min: 40, max: 150, value: sliderArrowSize, onChange: function onChange(value) { return setAttributes({ sliderArrowSize: value }); } }), React.createElement(RangeControl, { label: __('Arrow border size', 'advanced-gutenberg'), min: 0, max: 15, value: sliderArrowBorderSize, onChange: function onChange(value) { return setAttributes({ sliderArrowBorderSize: value }); } }), React.createElement(RangeControl, { label: __('Arrow border radius (%)', 'advanced-gutenberg'), min: 0, max: 100, value: sliderArrowBorderRadius, onChange: function onChange(value) { return setAttributes({ sliderArrowBorderRadius: value }); } }) ) ), React.createElement(PanelColorSettings, { title: __('Slider Colors', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Arrow and Border Color', 'advanced-gutenberg'), value: sliderArrowColor, onChange: function onChange(value) { return setAttributes({ sliderArrowColor: value }); } }, { label: __('Dots Color', 'advanced-gutenberg'), value: sliderDotsColor, onChange: function onChange(value) { return setAttributes({ sliderDotsColor: value }); } }] }) ), React.createElement( PanelBody, { title: __('Avatar', 'advanced-gutenberg'), initialOpen: false }, React.createElement(ToggleControl, { label: __('Display Avatar', 'advanced-gutenberg'), checked: enableAvatar, onChange: function onChange() { return setAttributes({ enableAvatar: !enableAvatar }); } }), enableAvatar && React.createElement( Fragment, null, React.createElement(PanelColorSettings, { title: __('Avatar Colors', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Background Color', 'advanced-gutenberg'), value: avatarColor, onChange: function onChange(value) { return setAttributes({ avatarColor: value }); } }, { label: __('Border Color', 'advanced-gutenberg'), value: avatarBorderColor, onChange: function onChange(value) { return setAttributes({ avatarBorderColor: value }); } }] }), React.createElement(RangeControl, { label: __('Border Radius (%)', 'advanced-gutenberg'), min: 0, max: 50, value: avatarBorderRadius, onChange: function onChange(value) { return setAttributes({ avatarBorderRadius: value }); } }), React.createElement(RangeControl, { label: __('Border Width', 'advanced-gutenberg'), min: 0, max: 5, value: avatarBorderWidth, onChange: function onChange(value) { return setAttributes({ avatarBorderWidth: value }); } }), React.createElement(RangeControl, { label: __('Avatar Size', 'advanced-gutenberg'), min: 50, max: 130, value: avatarSize, onChange: function onChange(value) { return setAttributes({ avatarSize: value }); } }), React.createElement(SelectControl, { label: __('Avatar Position', 'advanced-gutenberg'), value: avatarPosition, options: [{ label: __('Top', 'advanced-gutenberg'), value: 'top' }, { label: __('Bottom', 'advanced-gutenberg'), value: 'bottom' }, { label: __('Left', 'advanced-gutenberg'), value: 'left' }, { label: __('right', 'advanced-gutenberg'), value: 'right' }], onChange: function onChange(value) { return setAttributes({ avatarPosition: value }); } }) ) ), React.createElement(PanelColorSettings, { title: __('Text Colors', 'advanced-gutenberg'), initialOpen: false, colorSettings: [{ label: __('Name Color', 'advanced-gutenberg'), value: nameColor, onChange: function onChange(value) { return setAttributes({ nameColor: value }); } }, { label: __('Position Color', 'advanced-gutenberg'), value: positionColor, onChange: function onChange(value) { return setAttributes({ positionColor: value }); } }, { label: __('Description Color', 'advanced-gutenberg'), value: descColor, onChange: function onChange(value) { return setAttributes({ descColor: value }); } }] }) ) ), React.createElement( "div", { className: "advgb-testimonial-wrapper", id: pid }, React.createElement( "div", { className: blockClass }, items.map(function (item, idx) { i++; if (i > validCols) return false; return React.createElement( "div", { className: "advgb-testimonial-item", key: idx }, enableAvatar && React.createElement(MediaUpload, { allowedTypes: ["image"], onSelect: function onSelect(media) { return _this2.updateItems(idx, { avatarUrl: media.sizes.thumbnail ? media.sizes.thumbnail.url : media.sizes.full.url, avatarID: media.id }); }, value: item.avatarID, render: function render(_ref) { var open = _ref.open; return React.createElement( "div", { className: "advgb-testimonial-avatar-group" }, React.createElement( Tooltip, { text: __('Click to change avatar', 'advanced-gutenberg') }, React.createElement("div", { className: "advgb-testimonial-avatar", onClick: open, style: { backgroundImage: "url(" + (item.avatarUrl ? item.avatarUrl : advgbBlocks.avatarHolder) + ")", backgroundColor: avatarColor, borderRadius: avatarBorderRadius + '%', borderWidth: avatarBorderWidth + 'px', borderColor: avatarBorderColor, width: avatarSize + 'px', height: avatarSize + 'px' } }) ), React.createElement( Tooltip, { text: __('Show default avatar', 'advanced-gutenberg') }, React.createElement("span", { className: "dashicons dashicons-update-alt advgb-testimonial-avatar-clear", onClick: function onClick() { return _this2.updateItems(idx, { avatarUrl: undefined, avatarID: undefined }); } }) ) ); } }), React.createElement( "div", { className: "advgb-testimonial-info" }, React.createElement(RichText, { tagName: "h4", className: "advgb-testimonial-name", value: item.name, isSelected: isSelected && currentEdit === 'name' + idx, unstableOnFocus: function unstableOnFocus() { return _this2.setState({ currentEdit: 'name' + idx }); }, onChange: function onChange(value) { return _this2.updateItems(idx, { name: value }); }, style: { color: nameColor }, placeholder: __('Text…', 'advanced-gutenberg'), allowedFormats: ['core/bold', 'core/italic'] }), React.createElement(RichText, { tagName: "p", className: "advgb-testimonial-position", value: item.position, isSelected: isSelected && currentEdit === 'pos' + idx, unstableOnFocus: function unstableOnFocus() { return _this2.setState({ currentEdit: 'pos' + idx }); }, onChange: function onChange(value) { return _this2.updateItems(idx, { position: value }); }, style: { color: positionColor }, placeholder: __('Text…', 'advanced-gutenberg'), allowedFormats: ['core/bold', 'core/italic'] }), React.createElement(RichText, { tagName: "p", className: "advgb-testimonial-desc", value: item.desc, isSelected: isSelected && currentEdit === 'desc' + idx, unstableOnFocus: function unstableOnFocus() { return _this2.setState({ currentEdit: 'desc' + idx }); }, onChange: function onChange(value) { return _this2.updateItems(idx, { desc: value }); }, style: { color: descColor }, placeholder: __('Text…', 'advanced-gutenberg') }) ) ); }) ), sliderView && React.createElement( Fragment, null, sliderArrowShown && React.createElement( Fragment, null, React.createElement( "button", { className: "advgb-slider-arrow advgb-slider-prev", style: arrowStyle }, PREV_ARROW ), React.createElement( "button", { className: "advgb-slider-arrow advgb-slider-next", style: arrowStyle }, NEXT_ARROW ) ), React.createElement( "style", null, "#" + pid + " .slick-dots li.slick-active button:before {color: " + sliderDotsColor + "}", "#" + pid + " .slick-dots li button:before {color: " + sliderDotsColor + "}" ) ) ) ); } }]); return AdvTestimonial; }(Component); var testimonialBlockIcon = React.createElement( "svg", { height: "20", viewBox: "2 2 22 22", width: "20", xmlns: "http://www.w3.org/2000/svg" }, React.createElement("path", { d: "M19 2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h4l3 3 3-3h4c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 3.3c1.49 0 2.7 1.21 2.7 2.7 0 1.49-1.21 2.7-2.7 2.7-1.49 0-2.7-1.21-2.7-2.7 0-1.49 1.21-2.7 2.7-2.7zM18 16H6v-.9c0-2 4-3.1 6-3.1s6 1.1 6 3.1v.9z" }), React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }) ); var blockAttrs = { items: { type: 'array', default: times(10, function () { return { avatarUrl: advgbBlocks.avatarHolder, avatarID: undefined, name: 'Person Name', position: 'Job Position', desc: 'A little description about this person will show up here.' }; }) }, pid: { type: 'string' }, sliderView: { type: 'boolean', default: false }, enableAvatar: { type: 'boolean', default: true }, avatarColor: { type: 'string' }, avatarBorderRadius: { type: 'number', default: 50 }, avatarBorderWidth: { type: 'number' }, avatarBorderColor: { type: 'string' }, avatarSize: { type: 'number', default: 120 }, avatarPosition: { type: 'string', default: 'top' }, nameColor: { type: 'string' }, positionColor: { type: 'string' }, descColor: { type: 'string' }, columns: { type: 'number', default: 1 }, sliderColumn: { type: 'number', default: 1 }, sliderItemsToScroll: { type: 'number', default: 1 }, sliderCenterMode: { type: 'boolean', default: false }, sliderPauseOnHover: { type: 'boolean', default: true }, sliderAutoPlay: { type: 'boolean', default: true }, sliderAutoPlaySpeed: { type: 'number', default: 2500 }, sliderInfiniteLoop: { type: 'boolean', default: true }, sliderDotsShown: { type: 'boolean', default: true }, sliderDotsColor: { type: 'string' }, sliderArrowShown: { type: 'boolean', default: true }, sliderArrowSize: { type: 'number', default: 50 }, sliderArrowBorderSize: { type: 'number' }, sliderArrowBorderRadius: { type: 'number' }, sliderArrowColor: { type: 'string' }, sliderSpeed: { type: 'number', default: 500 }, changed: { type: 'boolean', default: false }, isPreview: { type: 'boolean', default: false } }; registerBlockType('advgb/testimonial', { title: __('Testimonial - PublishPress', 'advanced-gutenberg'), description: __('Block for creating personal or team/group information.', 'advanced-gutenberg'), icon: { src: testimonialBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('testimonial', 'advanced-gutenberg'), __('personal', 'advanced-gutenberg'), __('about', 'advanced-gutenberg')], attributes: blockAttrs, example: { attributes: { isPreview: true } }, edit: AdvTestimonial, save: function save(_ref2) { var attributes = _ref2.attributes; var pid = attributes.pid, items = attributes.items, sliderView = attributes.sliderView, enableAvatar = attributes.enableAvatar, avatarColor = attributes.avatarColor, avatarBorderRadius = attributes.avatarBorderRadius, avatarBorderWidth = attributes.avatarBorderWidth, avatarBorderColor = attributes.avatarBorderColor, avatarSize = attributes.avatarSize, nameColor = attributes.nameColor, positionColor = attributes.positionColor, descColor = attributes.descColor, columns = attributes.columns, sliderColumn = attributes.sliderColumn, sliderItemsToScroll = attributes.sliderItemsToScroll, sliderCenterMode = attributes.sliderCenterMode, sliderPauseOnHover = attributes.sliderPauseOnHover, sliderAutoPlay = attributes.sliderAutoPlay, sliderInfiniteLoop = attributes.sliderInfiniteLoop, sliderDotsShown = attributes.sliderDotsShown, avatarPosition = attributes.avatarPosition, sliderSpeed = attributes.sliderSpeed, sliderAutoPlaySpeed = attributes.sliderAutoPlaySpeed, sliderArrowShown = attributes.sliderArrowShown, sliderArrowSize = attributes.sliderArrowSize, sliderArrowBorderSize = attributes.sliderArrowBorderSize, sliderArrowBorderRadius = attributes.sliderArrowBorderRadius, sliderArrowColor = attributes.sliderArrowColor; var blockClass = ['advgb-testimonial', sliderView && 'slider-view', "advgb-avatar-" + avatarPosition].filter(Boolean).join(' '); var i = 0; var validCols = columns; if (columns < 1) { validCols = 1; } else if (columns > 3 && !sliderView) { validCols = 3; } else if (columns < 4 && sliderView) { validCols = 4; } else if (columns > 10) { validCols = 10; } var arrowStyle = { color: sliderArrowColor, borderColor: sliderArrowColor, borderWidth: sliderArrowBorderSize, borderRadius: sliderArrowBorderRadius ? sliderArrowBorderRadius + "%" : undefined, width: sliderArrowSize }; return React.createElement( "div", { className: "advgb-testimonial-wrapper", id: pid, "data-col": sliderView ? sliderColumn : undefined, "data-scroll": sliderView ? sliderItemsToScroll : undefined, "data-pause": sliderView ? sliderPauseOnHover : undefined, "data-autoplay": sliderView ? sliderAutoPlay : undefined, "data-apspeed": sliderView ? sliderAutoPlaySpeed : undefined, "data-loop": sliderView ? sliderInfiniteLoop : undefined, "data-dots": sliderView ? sliderDotsShown : undefined, "data-speed": sliderView ? sliderSpeed : undefined, "data-arrows": sliderView ? sliderArrowShown : undefined, "data-center": sliderView ? sliderCenterMode : undefined }, React.createElement( "div", { className: blockClass }, items.map(function (item, idx) { i++; if (i > validCols) return false; return React.createElement( "div", { className: "advgb-testimonial-item", key: idx }, enableAvatar && React.createElement( "div", { className: "advgb-testimonial-avatar-group" }, React.createElement("div", { className: "advgb-testimonial-avatar", style: { backgroundImage: "url(" + (item.avatarUrl ? item.avatarUrl : advgbBlocks.avatarHolder) + ")", backgroundColor: avatarColor, borderRadius: avatarBorderRadius + '%', borderWidth: avatarBorderWidth + 'px', borderColor: avatarBorderColor, width: avatarSize + 'px', height: avatarSize + 'px' } }) ), React.createElement( "div", { className: "advgb-testimonial-info" }, React.createElement(RichText.Content, { tagName: "h4", className: "advgb-testimonial-name", style: { color: nameColor }, value: item.name }), React.createElement(RichText.Content, { tagName: "p", className: "advgb-testimonial-position", style: { color: positionColor }, value: item.position }), React.createElement(RichText.Content, { tagName: "p", className: "advgb-testimonial-desc", style: { color: descColor }, value: item.desc }) ) ); }) ), sliderView && React.createElement( Fragment, null, React.createElement( "button", { className: "advgb-slider-arrow advgb-slider-prev", style: arrowStyle }, PREV_ARROW ), React.createElement( "button", { className: "advgb-slider-arrow advgb-slider-next", style: arrowStyle }, NEXT_ARROW ) ) ); }, deprecated: [{ attributes: _extends({}, blockAttrs, { avatarSize: { type: 'number', default: 70 } }), save: function save(_ref3) { var attributes = _ref3.attributes; var items = attributes.items, sliderView = attributes.sliderView, avatarColor = attributes.avatarColor, avatarBorderRadius = attributes.avatarBorderRadius, avatarBorderWidth = attributes.avatarBorderWidth, avatarBorderColor = attributes.avatarBorderColor, avatarSize = attributes.avatarSize, nameColor = attributes.nameColor, positionColor = attributes.positionColor, descColor = attributes.descColor, columns = attributes.columns; var blockClass = ['advgb-testimonial', sliderView && 'slider-view'].filter(Boolean).join(' '); var i = 0; var validCols = columns; if (columns < 1) { validCols = 1; } else if (columns > 3 && !sliderView) { validCols = 3; } else if (columns < 4 && sliderView) { validCols = 4; } else if (columns > 10) { validCols = 10; } return React.createElement( "div", { className: blockClass }, items.map(function (item, idx) { i++; if (i > validCols) return false; return React.createElement( "div", { className: "advgb-testimonial-item", key: idx }, React.createElement( "div", { className: "advgb-testimonial-avatar-group" }, React.createElement("div", { className: "advgb-testimonial-avatar", style: { backgroundImage: "url(" + (item.avatarUrl ? item.avatarUrl : advgbBlocks.avatarHolder) + ")", backgroundColor: avatarColor, borderRadius: avatarBorderRadius + '%', borderWidth: avatarBorderWidth + 'px', borderColor: avatarBorderColor, width: avatarSize + 'px', height: avatarSize + 'px' } }) ), React.createElement( "h4", { className: "advgb-testimonial-name", style: { color: nameColor } }, item.name ), React.createElement( "p", { className: "advgb-testimonial-position", style: { color: positionColor } }, item.position ), React.createElement( "p", { className: "advgb-testimonial-desc", style: { color: descColor } }, item.desc ) ); }) ); } }] }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ "./src/assets/blocks/woo-products/block.jsx": /*!**************************************************!*\ !*** ./src/assets/blocks/woo-products/block.jsx ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } (function (wpI18n, wpBlocks, wpElement, wpBlockEditor, wpComponents) { wpBlockEditor = wp.blockEditor || wp.editor; var __ = wpI18n.__; var Component = wpElement.Component, Fragment = wpElement.Fragment; var registerBlockType = wpBlocks.registerBlockType; var _wpBlockEditor = wpBlockEditor, InspectorControls = _wpBlockEditor.InspectorControls, BlockControls = _wpBlockEditor.BlockControls; var RangeControl = wpComponents.RangeControl, PanelBody = wpComponents.PanelBody, CheckboxControl = wpComponents.CheckboxControl, SelectControl = wpComponents.SelectControl, Spinner = wpComponents.Spinner, ToolbarGroup = wpComponents.ToolbarGroup, Placeholder = wpComponents.Placeholder, Button = wpComponents.Button; var addQueryArgs = wp.url.addQueryArgs; var fetchingQueue = null; var previewImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD8CAYAAABetbkgAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAEtNJREFUeNrsnc9rHOcZx2d217Zix7EdYwXbiZ3QuBAcamwoOeQSCDaUuufQU26lvfR/aG4NuaWGQA+FnnrsoRBICRRDcXIpxhAamoAV21hEiWwpkhzF0u5W3+mOOx7P7M7Mvjt6f3w+MKyktXfnnff5vs/zPu+vKAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABombitL+r1eq1+H4AjDLe3t90R+kjIVT8TwUPwAq/yvqlGIDYk8HjM5yJqgPrCH5r0+vGUAi8TdZz7GW8OMF7cwwmvUwk+nkLkeYHnRR7j3QFqi32YE/kTwm8i9nhKkReJW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r7/11lu/+eijj1ZGolY4vTW6tjNXPy/6nQZiaFLocYHQs2JP/vbuu++euXz58s+OHTt2bica2F/1ewAC9OAPdrq9/95xkH9/5513/rMTtmfFnBV3Vuypd0+9+nBMF7ux0OOM0LNiz17pe53c/0PwAP8nO2yd7Y/3c2Lfyv0+yPfdJwm9V/OGsr8PRsLtF4g4vfFsXz5C6ACF2ioSej8Xqhcl5dKoYLKznvLmBiMRpzeXijkr9E6mUYgQPMAT3jzKeel+rh8+KBB6kQOeTuhqMUb7fQ1zHj3KCDzbAHRH73dLQneEDgj9Sac5jB7Prm8XiH3YROy9mjcWF9zkoOTmOxmPnxc4QgeEXhy6D6Mnh9P6uYbgkdCrhO21hF7g1aMCkXdzITveHKCZVx+UhO2N6DW4sbhE7HGJyDt4c4DKXr1I8IXz3SeNnWepLbqRV8/PlMtf44bVEDrAeKFPupL/UzVsbyy6ErFHY0J1vDlAudCjqDjJVpZ4qyXyqYSXE3uZly/6DsQOUCz0Ii//xL+rK3IjohvNmotKBI/AAaqLvUz0jQVuVHyZM7XiWX0HQKiin0bgMxdhgacHgApiNyFsAAAAAAAAAAAAAAAAAAAAAAAAAAAAx/mvAAMAfkZbyu3sQ/cAAAAASUVORK5CYII='; var advProductsBlockIcon = React.createElement( "svg", { width: "20", height: "20", viewBox: "0 0 24 24" }, React.createElement("path", { fill: "none", d: "M0,0h24v24H0V0z" }), React.createElement("path", { d: "M15.55,13c0.75,0,1.41-0.41,1.75-1.03l3.58-6.49C21.25,4.82,20.77,4,20.01,4H5.21L4.27,2H1v2h2l3.6,7.59l-1.35,2.44 C4.52,15.37,5.48,17,7,17h12v-2H7l1.1-2H15.55z M6.16,6h12.15l-2.76,5H8.53L6.16,6z" }), React.createElement("path", { d: "M7,18c-1.1,0-1.99,0.9-1.99,2c0,1.1,0.89,2,1.99,2c1.1,0,2-0.9,2-2C9,18.9,8.1,18,7,18z" }), React.createElement("path", { d: "M17,18c-1.1,0-1.99,0.9-1.99,2c0,1.1,0.89,2,1.99,2c1.1,0,2-0.9,2-2C19,18.9,18.1,18,17,18z" }) ); var AdvProductsEdit = function (_Component) { _inherits(AdvProductsEdit, _Component); function AdvProductsEdit() { _classCallCheck(this, AdvProductsEdit); var _this = _possibleConstructorReturn(this, (AdvProductsEdit.__proto__ || Object.getPrototypeOf(AdvProductsEdit)).apply(this, arguments)); _this.state = { categoriesList: [], productsList: [], loading: true, error: false }; _this.fetchProducts = _this.fetchProducts.bind(_this); return _this; } _createClass(AdvProductsEdit, [{ key: "componentWillMount", value: function componentWillMount() { var _props = this.props, attributes = _props.attributes, setAttributes = _props.setAttributes; var currentBlockConfig = advgbDefaultConfig['advgb-woo-products']; // No override attributes of blocks inserted before if (attributes.changed !== true) { if ((typeof currentBlockConfig === "undefined" ? "undefined" : _typeof(currentBlockConfig)) === 'object' && currentBlockConfig !== null) { Object.keys(currentBlockConfig).map(function (attribute) { if (typeof attributes[attribute] === 'boolean') { attributes[attribute] = !!currentBlockConfig[attribute]; } else { attributes[attribute] = currentBlockConfig[attribute]; } }); } // Finally set changed attribute to true, so we don't modify anything again setAttributes({ changed: true }); } this.fetchProducts(); } }, { key: "componentWillUpdate", value: function componentWillUpdate(nextProps, nextState) { var clientId = this.props.clientId; var $ = jQuery; if (this.checkAttrChanged(nextProps.attributes, this.props.attributes)) { $("#block-" + clientId + " .advgb-products-wrapper.slick-initialized").slick('unslick'); $("#block-" + clientId + " .advgb-product").removeAttr('tabindex').removeAttr('role').removeAttr('aria-describedby'); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _this2 = this; var categoriesList = this.state.categoriesList; var attributes = this.props.attributes; var category = attributes.category; if (category === 'selected' && categoriesList.length === 0) { wp.apiFetch({ path: addQueryArgs('/wc/v2/products/categories', { per_page: -1 }) }).then(function (obj) { _this2.setState({ categoriesList: obj }); }); } if (this.checkAttrChanged(prevProps.attributes, attributes)) { this.fetchProducts(); } } }, { key: "checkAttrChanged", value: function checkAttrChanged(prevAttrs, curAttrs) { var prevView = prevAttrs.viewType, prevCat = prevAttrs.category, prevCats = prevAttrs.categories, prevStatus = prevAttrs.status, prevOrder = prevAttrs.order, prevOrderBy = prevAttrs.orderBy, prevLength = prevAttrs.numberOfProducts; var viewType = curAttrs.viewType, category = curAttrs.category, categories = curAttrs.categories, status = curAttrs.status, order = curAttrs.order, orderBy = curAttrs.orderBy, numberOfProducts = curAttrs.numberOfProducts; return category !== prevCat || categories !== prevCats || status !== prevStatus || order !== prevOrder || orderBy !== prevOrderBy || numberOfProducts !== prevLength || prevView !== viewType; } }, { key: "fetchProducts", value: function fetchProducts() { var self = this; var _props$attributes = this.props.attributes, viewType = _props$attributes.viewType, category = _props$attributes.category, categories = _props$attributes.categories, status = _props$attributes.status, order = _props$attributes.order, orderBy = _props$attributes.orderBy, numberOfProducts = _props$attributes.numberOfProducts; var query = addQueryArgs('/agwc/v1/products', { order: order || undefined, orderby: orderBy || undefined, per_page: numberOfProducts, category: category === 'selected' ? categories.join(',') : undefined, featured: status === 'featured' ? 1 : undefined, on_sale: status === 'on_sale' ? 1 : undefined }); if (fetchingQueue) { clearTimeout(fetchingQueue); } if (this.state.error) { this.setState({ error: false }); } fetchingQueue = setTimeout(function () { if (!self.state.loading) { self.setState({ loading: true }); } wp.apiFetch({ path: query }).then(function (obj) { self.setState({ productsList: obj, loading: false }); }).catch(function (error) { self.setState({ loading: false, error: true }); }).then(function () { if (viewType === 'slider') { jQuery("#block-" + self.props.clientId + " .advgb-products-block.slider-view .advgb-products-wrapper:not(.slick-initialized)").slick({ dots: true, adaptiveHeight: true }); } }); }, 500); } }, { key: "setCategories", value: function setCategories(catID, willAdd) { var _props2 = this.props, attributes = _props2.attributes, setAttributes = _props2.setAttributes; var categories = attributes.categories; if (willAdd) { setAttributes({ categories: [].concat(_toConsumableArray(categories), [catID]) }); } else { setAttributes({ categories: categories.filter(function (cat) { return cat !== catID; }) }); } this.fetchProducts(); } }, { key: "render", value: function render() { var _this3 = this; var _state = this.state, categoriesList = _state.categoriesList, productsList = _state.productsList, loading = _state.loading, error = _state.error; var _props3 = this.props, attributes = _props3.attributes, setAttributes = _props3.setAttributes; var viewType = attributes.viewType, category = attributes.category, categories = attributes.categories, status = attributes.status, order = attributes.order, orderBy = attributes.orderBy, numberOfProducts = attributes.numberOfProducts, columns = attributes.columns, isPreview = attributes.isPreview; var viewControls = [{ icon: 'grid-view', title: __('Normal View', 'advanced-gutenberg'), onClick: function onClick() { return setAttributes({ viewType: 'normal' }); }, isActive: viewType === 'normal' }, { icon: 'slides', title: __('Slider View', 'advanced-gutenberg'), onClick: function onClick() { return setAttributes({ viewType: 'slider' }); }, isActive: viewType === 'slider' }]; var blockClassName = ["advgb-products-block", viewType === 'slider' && 'slider-view'].filter(Boolean).join(' '); var blockWrapperClassName = ["advgb-products-wrapper", viewType === 'normal' && "columns-" + columns].filter(Boolean).join(' '); return isPreview ? React.createElement("img", { alt: __('Woo Products', 'advanced-gutenberg'), width: "100%", src: previewImageData }) : React.createElement( Fragment, null, React.createElement( BlockControls, null, React.createElement(ToolbarGroup, { controls: viewControls }) ), React.createElement( InspectorControls, null, React.createElement( PanelBody, { title: __('Products Settings', 'advanced-gutenberg') }, React.createElement(SelectControl, { label: __('Product Status', 'advanced-gutenberg'), value: status, options: [{ label: __('All', 'advanced-gutenberg'), value: '' }, { label: __('Featured', 'advanced-gutenberg'), value: 'featured' }, { label: __('On Sale', 'advanced-gutenberg'), value: 'on_sale' }], onChange: function onChange(value) { return setAttributes({ status: value }); } }), React.createElement(SelectControl, { label: __('Category', 'advanced-gutenberg'), value: category, options: [{ label: __('All', 'advanced-gutenberg'), value: '' }, { label: __('Selected', 'advanced-gutenberg'), value: 'selected' }], onChange: function onChange(value) { return setAttributes({ category: value }); } }), category === 'selected' && React.createElement( "div", { className: "advgb-woo-categories-list" }, categoriesList.map(function (cat, index) { return React.createElement(CheckboxControl, { key: index, label: [cat.name, React.createElement( "span", { key: "cat-count", style: { fontSize: 'small', color: '#999', marginLeft: 5 } }, "(", cat.count, ")" )], checked: jQuery.inArray(cat.id, categories) > -1, onChange: function onChange(checked) { return _this3.setCategories(cat.id, checked); } }); }) ) ), React.createElement( PanelBody, { title: __('Layout Settings', 'advanced-gutenberg') }, viewType !== 'slider' && React.createElement(RangeControl, { label: __('Columns', 'advanced-gutenberg'), value: columns, min: 1, max: 4, onChange: function onChange(value) { return setAttributes({ columns: value }); } }), React.createElement(RangeControl, { label: __('Number of Products', 'advanced-gutenberg'), value: numberOfProducts, min: 1, max: 48, onChange: function onChange(value) { return setAttributes({ numberOfProducts: value }); } }), React.createElement(SelectControl, { label: __('Order', 'advanced-gutenberg'), value: orderBy + "-" + order, options: [{ label: __('Newest to oldest', 'advanced-gutenberg'), value: 'date-desc' }, { label: __('Oldest to newest', 'advanced-gutenberg'), value: 'date-asc' }, { label: __('Price: high to low', 'advanced-gutenberg'), value: 'price-desc' }, { label: __('Price: low to high', 'advanced-gutenberg'), value: 'price-asc' }, { label: __('Highest Rating first', 'advanced-gutenberg'), value: 'rating-desc' }, { label: __('Most sale first', 'advanced-gutenberg'), value: 'popularity-desc' }, { label: __('Title: Alphabetical', 'advanced-gutenberg'), value: 'title-asc' }, { label: __('Title: Alphabetical reversed', 'advanced-gutenberg'), value: 'title-desc' }], onChange: function onChange(value) { var splitedVal = value.split('-'); return setAttributes({ orderBy: splitedVal[0], order: splitedVal[1] }); } }) ) ), React.createElement( "div", { className: blockClassName }, !error ? !loading ? productsList.length > 0 ? React.createElement( "div", { className: blockWrapperClassName }, productsList.map(function (product, idx) { return React.createElement( "div", { key: idx, className: "advgb-product" }, React.createElement( "div", { className: "advgb-product-img" }, React.createElement("img", { src: product.images.length ? product.images[0].src : advgbBlocks.post_thumb, alt: product.name }) ), React.createElement( "div", { className: "advgb-product-title" }, product.name ), React.createElement("div", { className: "advgb-product-price", dangerouslySetInnerHTML: { __html: product.price_html } }), React.createElement( "div", { className: "advgb-product-add-to-cart" }, React.createElement( "span", null, __('Add to cart', 'advanced-gutenberg') ) ) ); }) ) : // When no products found React.createElement( "div", null, __('No products found.', 'advanced-gutenberg') ) : // When products is fetching React.createElement( "div", null, React.createElement( "span", null, __('Loading', 'advanced-gutenberg') ), React.createElement(Spinner, null) ) : // When error React.createElement( Placeholder, { icon: advProductsBlockIcon, label: __('Woo Products Block', 'advanced-gutenberg') }, React.createElement( "div", { style: { marginBottom: 10 } }, __('WooCommerce has not been detected, make sure WooCommerce is installed and activated.', 'advanced-gutenberg') ), React.createElement( Button, { className: "button button-large", onClick: function onClick() { return _this3.fetchProducts(); } }, __('Try again', 'advanced-gutenberg') ) ) ) ); } }]); return AdvProductsEdit; }(Component); var attributes = { viewType: { type: 'string', default: 'normal' }, category: { type: 'string' }, categories: { type: 'array', default: [] }, status: { type: 'string' }, order: { type: 'string', default: 'desc' }, orderBy: { type: 'string', default: 'date' }, numberOfProducts: { type: 'number', default: 6 }, columns: { type: 'number', default: 3 }, changed: { type: 'boolean', default: false }, isPreview: { type: 'boolean', default: false } }; registerBlockType('advgb/woo-products', { title: __('Woo Products - PublishPress', 'advanced-gutenberg'), description: __('Listing your products in a easy way.', 'advanced-gutenberg'), icon: { src: advProductsBlockIcon, foreground: typeof advgbBlocks !== 'undefined' ? advgbBlocks.color : undefined }, category: 'advgb-category', keywords: [__('woo commerce', 'advanced-gutenberg'), __('products list', 'advanced-gutenberg'), __('price list', 'advanced-gutenberg')], attributes: attributes, example: { attributes: { isPreview: true } }, supports: { anchor: true }, edit: AdvProductsEdit, save: function save(_ref) { var attributes = _ref.attributes; var viewType = attributes.viewType, category = attributes.category, categories = attributes.categories, status = attributes.status, order = attributes.order, orderBy = attributes.orderBy, numberOfProducts = attributes.numberOfProducts, columns = attributes.columns; var listCats = categories.join(','); var shortCode = ['[products', "limit=\"" + numberOfProducts + "\"", "columns=\"" + columns + "\"", "orderby=\"" + orderBy + "\"", "order=\"" + order + "\"", category === 'selected' && "category=\"" + listCats + "\"", status === 'featured' && 'visibility="featured"', status === 'on_sale' && 'on_sale="1"', ']'].filter(Boolean).join(' '); var blockClassName = ['advgb-woo-products', viewType === 'slider' && 'slider-view'].filter(Boolean).join(' '); return React.createElement( "div", { className: blockClassName }, shortCode ); }, deprecated: [{ attributes: attributes, save: function save(_ref2) { var attributes = _ref2.attributes; var viewType = attributes.viewType, category = attributes.category, categories = attributes.categories, status = attributes.status, order = attributes.order, orderBy = attributes.orderBy, numberOfProducts = attributes.numberOfProducts, columns = attributes.columns; var listCats = categories.join(','); var shortCode = ['[products', "limit=\"" + numberOfProducts + "\"", "columns=\"" + columns + "\"", "orderby=\"" + orderBy + "\"", "order=\"" + order + "\"", category === 'selected' && "category=\"" + listCats + "\"", status === 'featured' && 'featured="1"', status === 'on_sale' && 'on_sale="1"', ']'].filter(Boolean).join(' '); var blockClassName = ['advgb-woo-products', viewType === 'slider' && 'slider-view'].filter(Boolean).join(' '); return React.createElement( "div", { className: blockClassName }, shortCode ); } }] }); })(wp.i18n, wp.blocks, wp.element, wp.blockEditor, wp.components); /***/ }), /***/ 0: /*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** multi ./src/assets/blocks/0-adv-components/components.jsx ./src/assets/blocks/0-adv-components/datetime.jsx ./src/assets/blocks/0-adv-components/icon-class.jsx ./src/assets/blocks/0-adv-components/utils.jsx ./src/assets/blocks/accordion/block.jsx ./src/assets/blocks/advaccordion/accordion.jsx ./src/assets/blocks/advaccordion/block.jsx ./src/assets/blocks/advbutton/block.jsx ./src/assets/blocks/advicon/block.jsx ./src/assets/blocks/advimage/block.jsx ./src/assets/blocks/advlist/block.jsx ./src/assets/blocks/advtable/block.jsx ./src/assets/blocks/advtabs/block.jsx ./src/assets/blocks/advtabs/tab.jsx ./src/assets/blocks/advvideo/block.jsx ./src/assets/blocks/columns/block.jsx ./src/assets/blocks/columns/column.jsx ./src/assets/blocks/contact-form/block.jsx ./src/assets/blocks/container/block.jsx ./src/assets/blocks/count-up/block.jsx ./src/assets/blocks/images-slider/block.jsx ./src/assets/blocks/infobox/block.jsx ./src/assets/blocks/login-form/block.jsx ./src/assets/blocks/map/block.jsx ./src/assets/blocks/newsletter/block.jsx ./src/assets/blocks/recent-posts/block.jsx ./src/assets/blocks/recent-posts/query-controls.jsx ./src/assets/blocks/search-bar/block.jsx ./src/assets/blocks/social-links/block.jsx ./src/assets/blocks/summary/block.jsx ./src/assets/blocks/tabs/block.jsx ./src/assets/blocks/testimonial/block.jsx ./src/assets/blocks/woo-products/block.jsx ***! \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(/*! ./src/assets/blocks/0-adv-components/components.jsx */"./src/assets/blocks/0-adv-components/components.jsx"); __webpack_require__(/*! ./src/assets/blocks/0-adv-components/datetime.jsx */"./src/assets/blocks/0-adv-components/datetime.jsx"); __webpack_require__(/*! ./src/assets/blocks/0-adv-components/icon-class.jsx */"./src/assets/blocks/0-adv-components/icon-class.jsx"); __webpack_require__(/*! ./src/assets/blocks/0-adv-components/utils.jsx */"./src/assets/blocks/0-adv-components/utils.jsx"); __webpack_require__(/*! ./src/assets/blocks/accordion/block.jsx */"./src/assets/blocks/accordion/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/advaccordion/accordion.jsx */"./src/assets/blocks/advaccordion/accordion.jsx"); __webpack_require__(/*! ./src/assets/blocks/advaccordion/block.jsx */"./src/assets/blocks/advaccordion/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/advbutton/block.jsx */"./src/assets/blocks/advbutton/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/advicon/block.jsx */"./src/assets/blocks/advicon/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/advimage/block.jsx */"./src/assets/blocks/advimage/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/advlist/block.jsx */"./src/assets/blocks/advlist/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/advtable/block.jsx */"./src/assets/blocks/advtable/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/advtabs/block.jsx */"./src/assets/blocks/advtabs/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/advtabs/tab.jsx */"./src/assets/blocks/advtabs/tab.jsx"); __webpack_require__(/*! ./src/assets/blocks/advvideo/block.jsx */"./src/assets/blocks/advvideo/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/columns/block.jsx */"./src/assets/blocks/columns/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/columns/column.jsx */"./src/assets/blocks/columns/column.jsx"); __webpack_require__(/*! ./src/assets/blocks/contact-form/block.jsx */"./src/assets/blocks/contact-form/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/container/block.jsx */"./src/assets/blocks/container/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/count-up/block.jsx */"./src/assets/blocks/count-up/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/images-slider/block.jsx */"./src/assets/blocks/images-slider/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/infobox/block.jsx */"./src/assets/blocks/infobox/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/login-form/block.jsx */"./src/assets/blocks/login-form/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/map/block.jsx */"./src/assets/blocks/map/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/newsletter/block.jsx */"./src/assets/blocks/newsletter/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/recent-posts/block.jsx */"./src/assets/blocks/recent-posts/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/recent-posts/query-controls.jsx */"./src/assets/blocks/recent-posts/query-controls.jsx"); __webpack_require__(/*! ./src/assets/blocks/search-bar/block.jsx */"./src/assets/blocks/search-bar/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/social-links/block.jsx */"./src/assets/blocks/social-links/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/summary/block.jsx */"./src/assets/blocks/summary/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/tabs/block.jsx */"./src/assets/blocks/tabs/block.jsx"); __webpack_require__(/*! ./src/assets/blocks/testimonial/block.jsx */"./src/assets/blocks/testimonial/block.jsx"); module.exports = __webpack_require__(/*! ./src/assets/blocks/woo-products/block.jsx */"./src/assets/blocks/woo-products/block.jsx"); /***/ }) /******/ }); //# sourceMappingURL=blocks.js.map