| 1 |
/* |
| 2 |
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). |
| 3 |
* This devtool is neither made for production nor for readable output files. |
| 4 |
* It uses "eval()" calls to create a separate source file in the browser devtools. |
| 5 |
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) |
| 6 |
* or disable the default devtool with "devtool: false". |
| 7 |
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). |
| 8 |
*/ |
| 9 |
(self["vcvWebpackJsonp4x"] = self["vcvWebpackJsonp4x"] || []).push([["element"],{ |
| 10 |
|
| 11 |
/***/ "./twitterGrid/component.js": |
| 12 |
/*!**********************************!*\ |
| 13 |
!*** ./twitterGrid/component.js ***! |
| 14 |
\**********************************/ |
| 15 |
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| 16 |
|
| 17 |
"use strict"; |
| 18 |
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ TwitterGrid; }\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ \"./node_modules/@babel/runtime/helpers/esm/extends.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/esm/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/esm/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/esm/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var vc_cake__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vc-cake */ \"./node_modules/vc-cake/index.js\");\n/* harmony import */ var vc_cake__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(vc_cake__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_10__);\n\n\n\n\n\n\n\n\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0,_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0,_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0,_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\n\n\n\nvar vcvAPI = vc_cake__WEBPACK_IMPORTED_MODULE_9___default().getService('api');\n\nvar TwitterGrid = /*#__PURE__*/function (_vcvAPI$elementCompon) {\n (0,_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(TwitterGrid, _vcvAPI$elementCompon);\n\n var _super = _createSuper(TwitterGrid);\n\n function TwitterGrid() {\n var _this;\n\n (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this, TwitterGrid);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__[\"default\"])((0,_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(_this), \"tweetCount\", '5');\n\n return _this;\n }\n\n (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(TwitterGrid, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this$props$atts = this.props.atts,\n gridUrl = _this$props$atts.gridUrl,\n tweetCount = _this$props$atts.tweetCount,\n width = _this$props$atts.width;\n\n if (!tweetCount) {\n tweetCount = this.tweetCount;\n }\n\n if (width) {\n this.checkCustomSize(width);\n }\n\n if (gridUrl) {\n this.insertTwitter(gridUrl, tweetCount);\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (!(0,lodash__WEBPACK_IMPORTED_MODULE_10__.isEqual)(prevProps.atts, this.props.atts)) {\n var _prevProps$atts = prevProps.atts,\n gridUrl = _prevProps$atts.gridUrl,\n tweetCount = _prevProps$atts.tweetCount;\n\n if (!tweetCount) {\n tweetCount = this.tweetCount;\n }\n\n var elementKey = \"customProps:\".concat(prevProps.id, \"-\").concat(gridUrl, \"-\").concat(tweetCount);\n var nextAtts = this.props.atts;\n\n if (!nextAtts.tweetCount) {\n nextAtts.tweetCount = this.tweetCount;\n }\n\n if (nextAtts.width) {\n this.checkCustomSize(nextAtts.width);\n } else {\n this.setState({\n size: null\n });\n }\n\n var nextElementKey = \"customProps:\".concat(this.props.id, \"-\").concat(nextAtts.gridUrl, \"-\").concat(nextAtts.tweetCount);\n\n if (nextAtts.gridUrl && elementKey !== nextElementKey) {\n this.insertTwitter(nextAtts.gridUrl, nextAtts.tweetCount);\n }\n }\n }\n }, {\n key: \"loadJSONP\",\n value: function loadJSONP(url, callback, context) {\n var name = '_jsonp_twitterGrid_' + TwitterGrid.unique++;\n\n if (url.indexOf('?') >= 0) {\n url += '&callback=' + name;\n } else {\n url += '?callback=' + name;\n }\n\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.async = true;\n script.src = url;\n\n var clearScript = function clearScript() {\n document.getElementsByTagName('head')[0].removeChild(script);\n script = null;\n delete window[name];\n };\n\n var timeout = 10; // 10 second by default\n\n var timeoutTrigger = window.setTimeout(function () {\n clearScript();\n }, timeout * 1000);\n\n window[name] = function (data) {\n window.clearTimeout(timeoutTrigger);\n callback.call(context || window, data);\n clearScript();\n };\n\n document.getElementsByTagName('head')[0].appendChild(script);\n }\n }, {\n key: \"insertTwitter\",\n value: function insertTwitter(url, tweetCount) {\n var _this2 = this;\n\n var createdUrl = 'https://publish.twitter.com/oembed.json?url=' + url + '&limit=' + tweetCount + '&widget_type=grid';\n this.loadJSONP(createdUrl, function (data) {\n _this2.appendTwitter(data.html);\n\n _this2.props.api.request('layout:rendered', true);\n });\n }\n }, {\n key: \"appendTwitter\",\n value: function appendTwitter() {\n var tagString = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var component = this.getDomNode().querySelector('.vce-twitter-grid-inner');\n this.updateInlineHtml(component, tagString);\n }\n }, {\n key: \"checkCustomSize\",\n value: function checkCustomSize(width) {\n width = this.validateSize(width);\n width = /^\\d+$/.test(width) ? width + 'px' : width;\n var size = {\n width: width\n };\n this.setSizeState(size);\n }\n }, {\n key: \"validateSize\",\n value: function validateSize(value) {\n var units = ['px', 'em', 'rem', '%', 'vw', 'vh'];\n var re = new RegExp('^-?\\\\d*(\\\\.\\\\d{0,9})?(' + units.join('|') + ')?$');\n\n if (value === '' || value.match(re)) {\n return value;\n } else {\n return null;\n }\n }\n }, {\n key: \"setSizeState\",\n value: function setSizeState(size) {\n this.setState({\n size: size\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n id = _this$props.id,\n atts = _this$props.atts,\n editor = _this$props.editor;\n var customClass = atts.customClass,\n alignment = atts.alignment,\n width = atts.width,\n metaCustomId = atts.metaCustomId;\n var classes = 'vce-twitter-grid';\n var innerClasses = 'vce-twitter-grid-inner';\n var wrapperClasses = 'vce-twitter-grid-wrapper vce';\n var customProps = {};\n var innerCustomProps = {};\n\n if (typeof customClass === 'string' && customClass) {\n classes += ' ' + customClass;\n }\n\n if (alignment) {\n classes += \" vce-twitter-grid--align-\".concat(alignment);\n }\n\n if (width) {\n innerCustomProps.style = this.state ? this.state.size : null;\n }\n\n customProps.key = \"customProps:\".concat(id);\n\n if (metaCustomId) {\n customProps.id = metaCustomId;\n }\n\n var doAll = this.applyDO('all');\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"div\", (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, customProps, {\n className: classes\n }, editor), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"div\", (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n className: wrapperClasses,\n id: 'el-' + id\n }, doAll), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"div\", (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n className: innerClasses\n }, innerCustomProps))));\n }\n }]);\n\n return TwitterGrid;\n}(vcvAPI.elementComponent);\n\n(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(TwitterGrid, \"unique\", 0);\n\n\n\n//# sourceURL=webpack:///./twitterGrid/component.js?"); |
| 19 |
|
| 20 |
/***/ }), |
| 21 |
|
| 22 |
/***/ "./twitterGrid/index.js": |
| 23 |
/*!******************************!*\ |
| 24 |
!*** ./twitterGrid/index.js ***! |
| 25 |
\******************************/ |
| 26 |
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
| 27 |
|
| 28 |
"use strict"; |
| 29 |
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vc_cake__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vc-cake */ \"./node_modules/vc-cake/index.js\");\n/* harmony import */ var vc_cake__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vc_cake__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./component */ \"./twitterGrid/component.js\");\n/* eslint-disable import/no-webpack-loader-syntax */\n\n\nvar vcvAddElement = vc_cake__WEBPACK_IMPORTED_MODULE_0___default().getService('cook').add;\nvcvAddElement(__webpack_require__(/*! ./settings.json */ \"./twitterGrid/settings.json\"), // Component callback\nfunction (component) {\n component.add(_component__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n}, // css settings // css for element\n{\n css: __webpack_require__(/*! raw-loader!./styles.css */ \"./node_modules/raw-loader/index.js!./twitterGrid/styles.css\"),\n editorCss: __webpack_require__(/*! raw-loader!./editor.css */ \"./node_modules/raw-loader/index.js!./twitterGrid/editor.css\"),\n mixins: {\n gridWidth: {\n mixin: __webpack_require__(/*! raw-loader!./cssMixins/gridWidth.pcss */ \"./node_modules/raw-loader/index.js!./twitterGrid/cssMixins/gridWidth.pcss\")\n }\n }\n}, '');\n\n//# sourceURL=webpack:///./twitterGrid/index.js?"); |
| 30 |
|
| 31 |
/***/ }), |
| 32 |
|
| 33 |
/***/ "./node_modules/raw-loader/index.js!./twitterGrid/cssMixins/gridWidth.pcss": |
| 34 |
/*!*************************************************************************************!*\ |
| 35 |
!*** ../../node_modules/raw-loader/index.js!./twitterGrid/cssMixins/gridWidth.pcss ***! |
| 36 |
\*************************************************************************************/ |
| 37 |
/***/ (function(module) { |
| 38 |
|
| 39 |
eval("module.exports = \".vce-twitter-grid {\\n &--width-$selector {\\n @if $width != false {\\n width: $(width)px;\\n }\\n }\\n}\"\n\n//# sourceURL=webpack:///./twitterGrid/cssMixins/gridWidth.pcss?../../node_modules/raw-loader/index.js"); |
| 40 |
|
| 41 |
/***/ }), |
| 42 |
|
| 43 |
/***/ "./node_modules/raw-loader/index.js!./twitterGrid/editor.css": |
| 44 |
/*!***********************************************************************!*\ |
| 45 |
!*** ../../node_modules/raw-loader/index.js!./twitterGrid/editor.css ***! |
| 46 |
\***********************************************************************/ |
| 47 |
/***/ (function(module) { |
| 48 |
|
| 49 |
eval("module.exports = \"[data-vcv-element-disable-interaction=\\\"true\\\"] .vce-twitter-grid-inner {\\n position: relative;\\n}\\n\\n[data-vcv-element-disable-interaction=\\\"true\\\"] .vce-twitter-grid-inner::after {\\n content: \\\"\\\";\\n position: absolute;\\n top: 0;\\n right: 0;\\n bottom: 0;\\n left: 0;\\n z-index: 999;\\n}\\n\\n.vce-twitter-grid {\\n min-height: 1em;\\n}\\n\"\n\n//# sourceURL=webpack:///./twitterGrid/editor.css?../../node_modules/raw-loader/index.js"); |
| 50 |
|
| 51 |
/***/ }), |
| 52 |
|
| 53 |
/***/ "./node_modules/raw-loader/index.js!./twitterGrid/styles.css": |
| 54 |
/*!***********************************************************************!*\ |
| 55 |
!*** ../../node_modules/raw-loader/index.js!./twitterGrid/styles.css ***! |
| 56 |
\***********************************************************************/ |
| 57 |
/***/ (function(module) { |
| 58 |
|
| 59 |
eval("module.exports = \".vce-twitter-grid iframe {\\n display: block;\\n vertical-align: top;\\n}\\n\\n.vce-twitter-grid-wrapper {\\n display: inline-block;\\n max-width: 100%;\\n}\\n\\n.vce-twitter-grid--align-center {\\n text-align: center;\\n}\\n\\n.vce-twitter-grid--align-right {\\n text-align: right;\\n}\\n\\n.vce-twitter-grid--align-left {\\n text-align: left;\\n}\\n\\n.vce-twitter-grid-inner {\\n vertical-align: top;\\n display: inline-block;\\n width: 100%;\\n min-width: 220px;\\n max-width: 100%;\\n}\\n\"\n\n//# sourceURL=webpack:///./twitterGrid/styles.css?../../node_modules/raw-loader/index.js"); |
| 60 |
|
| 61 |
/***/ }), |
| 62 |
|
| 63 |
/***/ "./twitterGrid/settings.json": |
| 64 |
/*!***********************************!*\ |
| 65 |
!*** ./twitterGrid/settings.json ***! |
| 66 |
\***********************************/ |
| 67 |
/***/ (function(module) { |
| 68 |
|
| 69 |
"use strict"; |
| 70 |
eval("module.exports = JSON.parse('{\"designOptions\":{\"type\":\"designOptions\",\"access\":\"public\",\"value\":{},\"options\":{\"label\":\"Design Options\"}},\"editFormTab1\":{\"type\":\"group\",\"access\":\"protected\",\"value\":[\"gridUrl\",\"width\",\"alignment\",\"tweetCount\",\"metaCustomId\",\"customClass\"],\"options\":{\"label\":\"General\"}},\"metaEditFormTabs\":{\"type\":\"group\",\"access\":\"protected\",\"value\":[\"editFormTab1\",\"designOptions\"]},\"relatedTo\":{\"type\":\"group\",\"access\":\"protected\",\"value\":[\"General\"]},\"customClass\":{\"type\":\"string\",\"access\":\"public\",\"value\":\"\",\"options\":{\"label\":\"Extra class name\",\"description\":\"Add an extra class name to the element and refer to it from the custom CSS option.\"}},\"assetsLibrary\":{\"access\":\"public\",\"type\":\"string\",\"value\":[\"animate\"]},\"gridUrl\":{\"type\":\"string\",\"access\":\"public\",\"value\":\"https://twitter.com/Twitter/timelines/539487832448843776\",\"options\":{\"label\":\"Twitter grid URL (Link)\",\"link\":true}},\"alignment\":{\"type\":\"buttonGroup\",\"access\":\"public\",\"value\":\"left\",\"options\":{\"label\":\"Alignment\",\"values\":[{\"label\":\"Left\",\"value\":\"left\",\"icon\":\"vcv-ui-icon-attribute-alignment-left\"},{\"label\":\"Center\",\"value\":\"center\",\"icon\":\"vcv-ui-icon-attribute-alignment-center\"},{\"label\":\"Right\",\"value\":\"right\",\"icon\":\"vcv-ui-icon-attribute-alignment-right\"}]}},\"tweetCount\":{\"type\":\"number\",\"access\":\"public\",\"value\":\"5\",\"options\":{\"min\":\"0\",\"label\":\"Count of visible tweets\"}},\"width\":{\"type\":\"string\",\"access\":\"public\",\"value\":\"500px\",\"options\":{\"label\":\"Width\",\"description\":\"Enter width in pixels. Minimum width 220px (example: 220px).\"}},\"metaDisableInteractionInEditor\":{\"type\":\"toggle\",\"access\":\"protected\",\"value\":true},\"metaBackendLabels\":{\"type\":\"group\",\"access\":\"protected\",\"value\":[{\"value\":[\"gridUrl\"]}]},\"metaCustomId\":{\"type\":\"customId\",\"access\":\"public\",\"value\":\"\",\"options\":{\"label\":\"Element ID\",\"description\":\"Apply a unique ID to the element to link it directly by using #your_id (for element ID use lowercase input only).\"}},\"tag\":{\"access\":\"protected\",\"type\":\"string\",\"value\":\"twitterGrid\"}}');\n\n//# sourceURL=webpack:///./twitterGrid/settings.json?"); |
| 71 |
|
| 72 |
/***/ }) |
| 73 |
|
| 74 |
},[['./twitterGrid/index.js']]]); |