Tumbili: Mailchimp Signup for Gutenberg - Version 0.6

Version Description

  • Added custom field support!
Download this release

Release Info

Developer gubbigubbi
Plugin Icon 128x128 Tumbili: Mailchimp Signup for Gutenberg
Version 0.6
Comparing to
See all releases

Code changes from version 0.5 to 0.6

dist/blocks.build.js CHANGED
@@ -1 +1,134 @@
1
- !function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(1)},function(e,t,n){"use strict";var r=n(2),o=(n.n(r),n(3)),l=(n.n(o),n(4)),a=n(5),i=wp.i18n.__;(0,wp.blocks.registerBlockType)("cgb/tumbili-mailchimp-for-gutenberg",{title:i("Tumbili: Mailchimp for Gutenberg"),icon:"email-alt",category:"common",keywords:[i("tumbili"),i("mailchimp")],attributes:l.a,edit:a.a,save:function(e){return e.attributes,e.className,null}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var r={apiKey:{type:"string",default:""},listID:{type:"string",default:""},showFirstName:{type:"boolean",default:!1},showLastName:{type:"boolean",default:!1},buttonBackground:{type:"string",default:""},buttonColor:{type:"string",default:""}}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=wp.element.Component,u=wp.editor,c=u.InspectorControls,m=u.PanelColorSettings,s=wp.components,p=s.PanelBody,f=s.TextControl,b=s.ToggleControl,w=wp.i18n.__,d=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.state={},e}return l(t,e),a(t,[{key:"render",value:function(){var e=this.props,t=e.attributes,n=t.showFirstName,r=t.showLastName,o=t.apiKey,l=t.listID,a=t.buttonBackground,i=t.buttonColor,u=e.className,s=e.setAttributes,d=void 0;n&&(d=wp.element.createElement("div",{className:"tumbili-form-control flex-grow"},wp.element.createElement("label",{htmlFor:"firstName"},"First Name",wp.element.createElement("input",{name:"firstName",type:"text"}))));var y=void 0;r&&(y=wp.element.createElement("div",{className:"tumbili-form-control flex-grow"},wp.element.createElement("label",{htmlFor:"lasttName"},"Last Name",wp.element.createElement("input",{name:"lastName",type:"text"}))));var g=wp.element.createElement("input",{style:{color:i,background:a},className:"tumbili-submit",type:"submit",value:"Submit"}),h=void 0;return h=o&&l?wp.element.createElement("div",{className:"display-flex tumbili-container"},d,y,wp.element.createElement("div",{className:"tumbili-form-control flex-grow"},wp.element.createElement("label",{htmlFor:"email"},"Email",wp.element.createElement("input",{name:"email",type:"email"}))),wp.element.createElement("div",{className:"tumbili-form-control flex-grow flex-is-at-bottom"},g)):wp.element.createElement("div",{className:u},"To get started please add an API Key & List ID."),wp.element.createElement("div",{className:u},wp.element.createElement(c,null,wp.element.createElement(p,{title:w("Form Options")},wp.element.createElement(f,{label:w("Mailchimp API Key"),value:o,onChange:function(e){return s({apiKey:e})}}),wp.element.createElement(f,{label:w("Mailchimp List ID"),value:l,onChange:function(e){return s({listID:e})}}),wp.element.createElement(b,{label:w("Show First Name?"),checked:n,onChange:function(e){return s({showFirstName:e})}}),wp.element.createElement(b,{label:w("Show Last Name?"),checked:r,onChange:function(e){return s({showLastName:e})}}),wp.element.createElement(m,{title:w("Color Settings"),colorSettings:[{value:a,onChange:function(e){return s({buttonBackground:e})},label:w("Button Background Color")},{value:i,onChange:function(e){return s({buttonColor:e})},label:w("Button Text Color")}]}))),h)}}]),t}(i);t.a=d}]);
1
+ /******/ (function(modules) { // webpackBootstrap
2
+ /******/ // The module cache
3
+ /******/ var installedModules = {};
4
+ /******/
5
+ /******/ // The require function
6
+ /******/ function __webpack_require__(moduleId) {
7
+ /******/
8
+ /******/ // Check if module is in cache
9
+ /******/ if(installedModules[moduleId]) {
10
+ /******/ return installedModules[moduleId].exports;
11
+ /******/ }
12
+ /******/ // Create a new module (and put it into the cache)
13
+ /******/ var module = installedModules[moduleId] = {
14
+ /******/ i: moduleId,
15
+ /******/ l: false,
16
+ /******/ exports: {}
17
+ /******/ };
18
+ /******/
19
+ /******/ // Execute the module function
20
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21
+ /******/
22
+ /******/ // Flag the module as loaded
23
+ /******/ module.l = true;
24
+ /******/
25
+ /******/ // Return the exports of the module
26
+ /******/ return module.exports;
27
+ /******/ }
28
+ /******/
29
+ /******/
30
+ /******/ // expose the modules object (__webpack_modules__)
31
+ /******/ __webpack_require__.m = modules;
32
+ /******/
33
+ /******/ // expose the module cache
34
+ /******/ __webpack_require__.c = installedModules;
35
+ /******/
36
+ /******/ // define getter function for harmony exports
37
+ /******/ __webpack_require__.d = function(exports, name, getter) {
38
+ /******/ if(!__webpack_require__.o(exports, name)) {
39
+ /******/ Object.defineProperty(exports, name, {
40
+ /******/ configurable: false,
41
+ /******/ enumerable: true,
42
+ /******/ get: getter
43
+ /******/ });
44
+ /******/ }
45
+ /******/ };
46
+ /******/
47
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
48
+ /******/ __webpack_require__.n = function(module) {
49
+ /******/ var getter = module && module.__esModule ?
50
+ /******/ function getDefault() { return module['default']; } :
51
+ /******/ function getModuleExports() { return module; };
52
+ /******/ __webpack_require__.d(getter, 'a', getter);
53
+ /******/ return getter;
54
+ /******/ };
55
+ /******/
56
+ /******/ // Object.prototype.hasOwnProperty.call
57
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
58
+ /******/
59
+ /******/ // __webpack_public_path__
60
+ /******/ __webpack_require__.p = "";
61
+ /******/
62
+ /******/ // Load entry module and return exports
63
+ /******/ return __webpack_require__(__webpack_require__.s = 0);
64
+ /******/ })
65
+ /************************************************************************/
66
+ /******/ ([
67
+ /* 0 */
68
+ /*!***********************!*\
69
+ !*** ./src/blocks.js ***!
70
+ \***********************/
71
+ /*! no exports provided */
72
+ /*! all exports used */
73
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
74
+
75
+ "use strict";
76
+ eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__block_block_js__ = __webpack_require__(/*! ./block/block.js */ 1);\n/**\n * Gutenberg Blocks\n *\n * All blocks related JavaScript files should be imported here.\n * You can create a new block folder in this dir and include code\n * for that block here as well.\n *\n * All blocks should be included here since this is the file that\n * Webpack is compiling as the input file.\n */\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3NyYy9ibG9ja3MuanM/N2I1YiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEd1dGVuYmVyZyBCbG9ja3NcbiAqXG4gKiBBbGwgYmxvY2tzIHJlbGF0ZWQgSmF2YVNjcmlwdCBmaWxlcyBzaG91bGQgYmUgaW1wb3J0ZWQgaGVyZS5cbiAqIFlvdSBjYW4gY3JlYXRlIGEgbmV3IGJsb2NrIGZvbGRlciBpbiB0aGlzIGRpciBhbmQgaW5jbHVkZSBjb2RlXG4gKiBmb3IgdGhhdCBibG9jayBoZXJlIGFzIHdlbGwuXG4gKlxuICogQWxsIGJsb2NrcyBzaG91bGQgYmUgaW5jbHVkZWQgaGVyZSBzaW5jZSB0aGlzIGlzIHRoZSBmaWxlIHRoYXRcbiAqIFdlYnBhY2sgaXMgY29tcGlsaW5nIGFzIHRoZSBpbnB1dCBmaWxlLlxuICovXG5cbmltcG9ydCAnLi9ibG9jay9ibG9jay5qcyc7XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9zcmMvYmxvY2tzLmpzXG4vLyBtb2R1bGUgaWQgPSAwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///0\n");
77
+
78
+ /***/ }),
79
+ /* 1 */
80
+ /*!****************************!*\
81
+ !*** ./src/block/block.js ***!
82
+ \****************************/
83
+ /*! no exports provided */
84
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
85
+
86
+ "use strict";
87
+ eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__style_scss__ = __webpack_require__(/*! ./style.scss */ 2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__style_scss___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__style_scss__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__editor_scss__ = __webpack_require__(/*! ./editor.scss */ 3);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__editor_scss___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__editor_scss__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__attributes__ = __webpack_require__(/*! ./attributes */ 4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__edit__ = __webpack_require__(/*! ./edit */ 5);\n/**\n * BLOCK: tumbili: mailchimp for Gutenberg\n */\n\n// Import CSS.\n\n\n\n\n\n\nvar __ = wp.i18n.__; // Import __() from wp.i18n\n\nvar registerBlockType = wp.blocks.registerBlockType; // Import registerBlockType() from wp.blocks\n\n/**\n * Register: aa Gutenberg Block.\n *\n * @link https://wordpress.org/gutenberg/handbook/block-api/\n * @param {string} name Block name.\n * @param {Object} settings Block settings.\n * @return {?WPBlock} The block, if it has been successfully\n * registered; otherwise `undefined`.\n */\n\nregisterBlockType('cgb/tumbili-mailchimp-for-gutenberg', {\n\t// Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.\n\ttitle: __('Tumbili: Mailchimp for Gutenberg'), // Block title.\n\ticon: 'email-alt', // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/.\n\tcategory: 'common', // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.\n\tkeywords: [__('tumbili'), __('mailchimp')],\n\tattributes: __WEBPACK_IMPORTED_MODULE_2__attributes__[\"a\" /* attributes */],\n\n\t/**\n * Edit\n * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/\n */\n\tedit: __WEBPACK_IMPORTED_MODULE_3__edit__[\"a\" /* default */],\n\t/**\n * Save\n * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/\n * @return {null} null\n */\n\tsave: function save(_ref) {\n\t\tvar attributes = _ref.attributes,\n\t\t className = _ref.className;\n\n\t\t//gutenberg will save attributes we can use in server-side callback\n\t\treturn null;\n\t}\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3NyYy9ibG9jay9ibG9jay5qcz85MjFk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NzTmFtZSA9IF9yZWYuY2xhc3NOYW1lO1xuXG5cdFx0Ly9ndXRlbmJlcmcgd2lsbCBzYXZlIGF0dHJpYnV0ZXMgd2UgY2FuIHVzZSBpbiBzZXJ2ZXItc2lkZSBjYWxsYmFja1xuXHRcdHJldHVybiBudWxsO1xuXHR9XG59KTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL3NyYy9ibG9jay9ibG9jay5qc1xuLy8gbW9kdWxlIGlkID0gMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///1\n");
88
+
89
+ /***/ }),
90
+ /* 2 */
91
+ /*!******************************!*\
92
+ !*** ./src/block/style.scss ***!
93
+ \******************************/
94
+ /*! dynamic exports provided */
95
+ /***/ (function(module, exports) {
96
+
97
+ eval("// removed by extract-text-webpack-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3NyYy9ibG9jay9zdHlsZS5zY3NzPzgwZjMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gcmVtb3ZlZCBieSBleHRyYWN0LXRleHQtd2VicGFjay1wbHVnaW5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL3NyYy9ibG9jay9zdHlsZS5zY3NzXG4vLyBtb2R1bGUgaWQgPSAyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///2\n");
98
+
99
+ /***/ }),
100
+ /* 3 */
101
+ /*!*******************************!*\
102
+ !*** ./src/block/editor.scss ***!
103
+ \*******************************/
104
+ /*! dynamic exports provided */
105
+ /***/ (function(module, exports) {
106
+
107
+ eval("// removed by extract-text-webpack-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3NyYy9ibG9jay9lZGl0b3Iuc2Nzcz80OWQyIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIHJlbW92ZWQgYnkgZXh0cmFjdC10ZXh0LXdlYnBhY2stcGx1Z2luXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9zcmMvYmxvY2svZWRpdG9yLnNjc3Ncbi8vIG1vZHVsZSBpZCA9IDNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///3\n");
108
+
109
+ /***/ }),
110
+ /* 4 */
111
+ /*!*********************************!*\
112
+ !*** ./src/block/attributes.js ***!
113
+ \*********************************/
114
+ /*! exports provided: attributes */
115
+ /*! exports used: attributes */
116
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
117
+
118
+ "use strict";
119
+ eval("/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return attributes; });\nvar attributes = {\n\tapiKey: {\n\t\ttype: 'string',\n\t\tdefault: ''\n\t},\n\tlistID: {\n\t\ttype: 'string',\n\t\tdefault: ''\n\t},\n\tshowFirstName: {\n\t\ttype: 'boolean',\n\t\tdefault: false\n\t},\n\tshowLastName: {\n\t\ttype: 'boolean',\n\t\tdefault: false\n\t},\n\tbuttonBackground: {\n\t\ttype: 'string',\n\t\tdefault: ''\n\t},\n\tbuttonColor: {\n\t\ttype: 'string',\n\t\tdefault: ''\n\t},\n\tfields: {\n\t\ttype: 'array',\n\t\tdefault: []\n\t}\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3NyYy9ibG9jay9hdHRyaWJ1dGVzLmpzPzg4MDEiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHZhciBhdHRyaWJ1dGVzID0ge1xuXHRhcGlLZXk6IHtcblx0XHR0eXBlOiAnc3RyaW5nJyxcblx0XHRkZWZhdWx0OiAnJ1xuXHR9LFxuXHRsaXN0SUQ6IHtcblx0XHR0eXBlOiAnc3RyaW5nJyxcblx0XHRkZWZhdWx0OiAnJ1xuXHR9LFxuXHRzaG93Rmlyc3ROYW1lOiB7XG5cdFx0dHlwZTogJ2Jvb2xlYW4nLFxuXHRcdGRlZmF1bHQ6IGZhbHNlXG5cdH0sXG5cdHNob3dMYXN0TmFtZToge1xuXHRcdHR5cGU6ICdib29sZWFuJyxcblx0XHRkZWZhdWx0OiBmYWxzZVxuXHR9LFxuXHRidXR0b25CYWNrZ3JvdW5kOiB7XG5cdFx0dHlwZTogJ3N0cmluZycsXG5cdFx0ZGVmYXVsdDogJydcblx0fSxcblx0YnV0dG9uQ29sb3I6IHtcblx0XHR0eXBlOiAnc3RyaW5nJyxcblx0XHRkZWZhdWx0OiAnJ1xuXHR9LFxuXHRmaWVsZHM6IHtcblx0XHR0eXBlOiAnYXJyYXknLFxuXHRcdGRlZmF1bHQ6IFtdXG5cdH1cbn07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9zcmMvYmxvY2svYXR0cmlidXRlcy5qc1xuLy8gbW9kdWxlIGlkID0gNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///4\n");
120
+
121
+ /***/ }),
122
+ /* 5 */
123
+ /*!***************************!*\
124
+ !*** ./src/block/edit.js ***!
125
+ \***************************/
126
+ /*! exports provided: default */
127
+ /*! exports used: default */
128
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
129
+
130
+ "use strict";
131
+ eval("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\"); } }; }();\n\nvar _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; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\n//import Inspector from './inspector';\nvar Component = wp.element.Component;\nvar _wp$editor = wp.editor,\n InspectorControls = _wp$editor.InspectorControls,\n PanelColorSettings = _wp$editor.PanelColorSettings;\nvar _wp$components = wp.components,\n PanelBody = _wp$components.PanelBody,\n TextControl = _wp$components.TextControl,\n ToggleControl = _wp$components.ToggleControl,\n Button = _wp$components.Button,\n SelectControl = _wp$components.SelectControl,\n Icon = _wp$components.Icon;\nvar __ = wp.i18n.__;\n\nvar mailchimpEdit = function (_Component) {\n\t_inherits(mailchimpEdit, _Component);\n\n\tfunction mailchimpEdit() {\n\t\t_classCallCheck(this, mailchimpEdit);\n\n\t\tvar _this = _possibleConstructorReturn(this, (mailchimpEdit.__proto__ || Object.getPrototypeOf(mailchimpEdit)).apply(this, arguments));\n\n\t\t_this.addField = function () {\n\n\t\t\tvar newField = {\n\t\t\t\tlabel: _this.state.newFieldLabel,\n\t\t\t\tvalue: _this.state.newFieldValue,\n\t\t\t\ttype: _this.state.newFieldType,\n\t\t\t\toptions: _this.state.newFieldOptions,\n\t\t\t\tfullWidth: _this.state.newFieldFullWidth\n\t\t\t};\n\n\t\t\tif (!newField.label && !newField.value) {\n\t\t\t\talert('Please add a label and MERGE tag first');\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t_this.props.setAttributes({\n\t\t\t\tfields: _this.props.attributes.fields.concat(newField)\n\t\t\t});\n\n\t\t\t_this.setState({\n\t\t\t\tnewFieldLabel: '',\n\t\t\t\tnewFieldValue: '',\n\t\t\t\tnewFieldOptions: [],\n\t\t\t\tnewFieldOptionLabel: '',\n\t\t\t\tnewFieldFullWidth: false\n\t\t\t});\n\t\t};\n\n\t\t_this.addFieldOption = function () {\n\t\t\tvar newOption = {\n\t\t\t\tlabel: _this.state.newFieldOptionLabel\n\t\t\t};\n\n\t\t\t_this.setState({\n\t\t\t\tnewFieldOptions: _this.state.newFieldOptions.concat(newOption),\n\t\t\t\tnewFieldOptionLabel: '' // effectively reset the form\n\t\t\t});\n\t\t};\n\n\t\t_this.removeField = function (index) {\n\t\t\tvar newFields = _this.props.attributes.fields.filter(function (item, i) {\n\t\t\t\treturn i !== index;\n\t\t\t});\n\n\t\t\t_this.props.setAttributes({\n\t\t\t\tfields: newFields\n\t\t\t});\n\t\t};\n\n\t\t_this.removeFieldOption = function (index) {\n\t\t\tvar newOptions = _this.state.newFieldOptions.filter(function (item, i) {\n\t\t\t\treturn i !== index;\n\t\t\t});\n\n\t\t\t_this.setState({\n\t\t\t\tnewFieldOptions: newOptions\n\t\t\t});\n\t\t};\n\n\t\t_this.onReorder = function () {\n\t\t\tvar type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'options';\n\t\t\tvar list = arguments[1];\n\t\t\tvar startIndex = arguments[2];\n\t\t\tvar endIndex = arguments[3];\n\n\t\t\tvar result = Array.from(list);\n\n\t\t\tvar _result$splice = result.splice(startIndex, 1),\n\t\t\t _result$splice2 = _slicedToArray(_result$splice, 1),\n\t\t\t removed = _result$splice2[0];\n\n\t\t\tresult.splice(endIndex, 0, removed);\n\n\t\t\tif (type === 'options') {\n\t\t\t\t_this.setState({\n\t\t\t\t\tnewFieldOptions: result\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t_this.props.setAttributes({\n\t\t\t\t\tfields: result\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\t_this.state = {\n\t\t\tnewFieldLabel: '',\n\t\t\tnewFieldValue: '',\n\t\t\tnewFieldType: 'text',\n\t\t\tnewFieldFullWidth: false,\n\t\t\tnewFieldOptions: [],\n\t\t\tnewFieldOptionLabel: ''\n\t\t};\n\t\treturn _this;\n\t}\n\n\t_createClass(mailchimpEdit, [{\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar _this2 = this;\n\n\t\t\tvar _props = this.props,\n\t\t\t _props$attributes = _props.attributes,\n\t\t\t showFirstName = _props$attributes.showFirstName,\n\t\t\t showLastName = _props$attributes.showLastName,\n\t\t\t apiKey = _props$attributes.apiKey,\n\t\t\t listID = _props$attributes.listID,\n\t\t\t buttonBackground = _props$attributes.buttonBackground,\n\t\t\t buttonColor = _props$attributes.buttonColor,\n\t\t\t fields = _props$attributes.fields,\n\t\t\t className = _props.className,\n\t\t\t setAttributes = _props.setAttributes;\n\t\t\tvar _state = this.state,\n\t\t\t newFieldLabel = _state.newFieldLabel,\n\t\t\t newFieldValue = _state.newFieldValue,\n\t\t\t newFieldType = _state.newFieldType,\n\t\t\t newFieldOptionLabel = _state.newFieldOptionLabel,\n\t\t\t newFieldFullWidth = _state.newFieldFullWidth;\n\n\n\t\t\tvar firstNameInput = void 0;\n\n\t\t\tif (showFirstName) {\n\t\t\t\tfirstNameInput = wp.element.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'tumbili-form-control flex-grow' },\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t'label',\n\t\t\t\t\t\t{ htmlFor: 'firstName' },\n\t\t\t\t\t\t'First Name',\n\t\t\t\t\t\twp.element.createElement('input', { name: 'firstName', type: 'text' })\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tvar lastNameInput = void 0;\n\n\t\t\tif (showLastName) {\n\t\t\t\tlastNameInput = wp.element.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'tumbili-form-control flex-grow' },\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t'label',\n\t\t\t\t\t\t{ htmlFor: 'lasttName' },\n\t\t\t\t\t\t'Last Name',\n\t\t\t\t\t\twp.element.createElement('input', { name: 'lastName', type: 'text' })\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tvar button = wp.element.createElement('input', {\n\t\t\t\tstyle: { color: buttonColor, background: buttonBackground },\n\t\t\t\tclassName: 'tumbili-submit',\n\t\t\t\ttype: 'submit',\n\t\t\t\tvalue: 'Submit'\n\t\t\t});\n\n\t\t\tvar fieldsHTML = fields.map(function (f, index) {\n\t\t\t\tvar widthClass = f.fullWidth ? 'is-full-width' : '';\n\n\t\t\t\tvar input = f.type === 'text' ? wp.element.createElement('input', { name: f.value, type: 'text' }) : wp.element.createElement(\n\t\t\t\t\t'select',\n\t\t\t\t\t{ name: f.value },\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t'option',\n\t\t\t\t\t\t{ value: f.options[0].label },\n\t\t\t\t\t\tf.options[0].label\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\tvar up = index > 0 ? wp.element.createElement(\n\t\t\t\t\t'span',\n\t\t\t\t\t{\n\t\t\t\t\t\tonClick: function onClick() {\n\t\t\t\t\t\t\treturn _this2.onReorder('fields', _this2.props.attributes.fields, index, index - 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\twp.element.createElement(Icon, { icon: 'arrow-up' })\n\t\t\t\t) : '';\n\n\t\t\t\tvar down = index < fields.length - 1 ? wp.element.createElement(\n\t\t\t\t\t'span',\n\t\t\t\t\t{\n\t\t\t\t\t\tonClick: function onClick() {\n\t\t\t\t\t\t\treturn _this2.onReorder('fields', _this2.props.attributes.fields, index, index + 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\twp.element.createElement(Icon, { icon: 'arrow-down' })\n\t\t\t\t) : '';\n\n\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{\n\t\t\t\t\t\tkey: index,\n\t\t\t\t\t\tclassName: 'tumbili-form-control flex-grow ' + widthClass\n\t\t\t\t\t},\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t'label',\n\t\t\t\t\t\t{ htmlFor: f.value },\n\t\t\t\t\t\tf.label,\n\t\t\t\t\t\tinput\n\t\t\t\t\t),\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t'div',\n\t\t\t\t\t\t{ className: 'tumbili-field-action' },\n\t\t\t\t\t\tup,\n\t\t\t\t\t\tdown,\n\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t'span',\n\t\t\t\t\t\t\t{ onClick: function onClick() {\n\t\t\t\t\t\t\t\t\treturn _this2.removeField(index);\n\t\t\t\t\t\t\t\t} },\n\t\t\t\t\t\t\twp.element.createElement(Icon, { icon: 'dismiss' })\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t});\n\n\t\t\tvar container = void 0;\n\n\t\t\tif (apiKey && listID) {\n\t\t\t\tcontainer = wp.element.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'display-flex tumbili-container' },\n\t\t\t\t\tfirstNameInput,\n\t\t\t\t\tlastNameInput,\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t'div',\n\t\t\t\t\t\t{ className: 'tumbili-form-control flex-grow' },\n\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t'label',\n\t\t\t\t\t\t\t{ htmlFor: 'email' },\n\t\t\t\t\t\t\t'Email',\n\t\t\t\t\t\t\twp.element.createElement('input', { name: 'email', type: 'email' })\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\tfieldsHTML,\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t'div',\n\t\t\t\t\t\t{ className: 'tumbili-form-control flex-grow flex-is-at-bottom' },\n\t\t\t\t\t\tbutton\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcontainer = wp.element.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: className },\n\t\t\t\t\t'To get started please add an API Key & List ID.'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tvar newFieldOptionHTML = void 0;\n\n\t\t\tif (newFieldType === 'select') {\n\t\t\t\tvar fieldOptions = this.state.newFieldOptions.map(function (option, index) {\n\t\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t\t'div',\n\t\t\t\t\t\t{ key: index, className: 'tumbili-field-option' },\n\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t'span',\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\toption.label\n\t\t\t\t\t\t),\n\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t'div',\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t'span',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tonClick: function onClick() {\n\t\t\t\t\t\t\t\t\t\treturn _this2.onReorder('options', _this2.state.newFieldOptions, index, index - 1);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\twp.element.createElement(Icon, { icon: 'arrow-up' })\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t'span',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tonClick: function onClick() {\n\t\t\t\t\t\t\t\t\t\treturn _this2.onReorder('options', _this2.state.newFieldOptions, index, index + 1);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\twp.element.createElement(Icon, { icon: 'arrow-down' })\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t\t'span',\n\t\t\t\t\t\t\t\t{ onClick: function onClick() {\n\t\t\t\t\t\t\t\t\t\treturn _this2.removeFieldOption(index);\n\t\t\t\t\t\t\t\t\t} },\n\t\t\t\t\t\t\t\twp.element.createElement(Icon, { icon: 'dismiss' })\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t});\n\n\t\t\t\tnewFieldOptionHTML = wp.element.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: 'tumbili-type-options' },\n\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\tlabel: 'Option',\n\t\t\t\t\t\tvalue: newFieldOptionLabel,\n\t\t\t\t\t\tonChange: function onChange(label) {\n\t\t\t\t\t\t\treturn _this2.setState({ newFieldOptionLabel: label });\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\tButton,\n\t\t\t\t\t\t{ isOutline: true, isSmall: true, onClick: this.addFieldOption },\n\t\t\t\t\t\t'Add Option'\n\t\t\t\t\t),\n\t\t\t\t\tfieldOptions\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn wp.element.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ className: className },\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tInspectorControls,\n\t\t\t\t\tnull,\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\tPanelBody,\n\t\t\t\t\t\t{ title: __('Form Options') },\n\t\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\t\tlabel: __('Mailchimp API Key'),\n\t\t\t\t\t\t\tvalue: apiKey,\n\t\t\t\t\t\t\tonChange: function onChange(apiKey) {\n\t\t\t\t\t\t\t\treturn setAttributes({ apiKey: apiKey });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}),\n\t\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\t\tlabel: __('Mailchimp List ID'),\n\t\t\t\t\t\t\tvalue: listID,\n\t\t\t\t\t\t\tonChange: function onChange(listID) {\n\t\t\t\t\t\t\t\treturn setAttributes({ listID: listID });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}),\n\t\t\t\t\t\twp.element.createElement(ToggleControl, {\n\t\t\t\t\t\t\tlabel: __('Show First Name?'),\n\t\t\t\t\t\t\tchecked: showFirstName,\n\t\t\t\t\t\t\tonChange: function onChange(showFirstName) {\n\t\t\t\t\t\t\t\treturn setAttributes({ showFirstName: showFirstName });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}),\n\t\t\t\t\t\twp.element.createElement(ToggleControl, {\n\t\t\t\t\t\t\tlabel: __('Show Last Name?'),\n\t\t\t\t\t\t\tchecked: showLastName,\n\t\t\t\t\t\t\tonChange: function onChange(showLastName) {\n\t\t\t\t\t\t\t\treturn setAttributes({ showLastName: showLastName });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}),\n\t\t\t\t\t\twp.element.createElement(PanelColorSettings, {\n\t\t\t\t\t\t\ttitle: __('Color Settings'),\n\t\t\t\t\t\t\tcolorSettings: [{\n\t\t\t\t\t\t\t\tvalue: buttonBackground,\n\t\t\t\t\t\t\t\tonChange: function onChange(buttonBackground) {\n\t\t\t\t\t\t\t\t\treturn setAttributes({ buttonBackground: buttonBackground });\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tlabel: __('Button Background Color')\n\t\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t\tvalue: buttonColor,\n\t\t\t\t\t\t\t\tonChange: function onChange(buttonColor) {\n\t\t\t\t\t\t\t\t\treturn setAttributes({ buttonColor: buttonColor });\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tlabel: __('Button Text Color')\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t})\n\t\t\t\t\t),\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\tPanelBody,\n\t\t\t\t\t\t{ title: __(' Custom Fields ') },\n\t\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\t\tlabel: 'Field label',\n\t\t\t\t\t\t\tvalue: newFieldLabel,\n\t\t\t\t\t\t\tonChange: function onChange(label) {\n\t\t\t\t\t\t\t\treturn _this2.setState({ newFieldLabel: label });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}),\n\t\t\t\t\t\twp.element.createElement(TextControl, {\n\t\t\t\t\t\t\tlabel: '*|MERGE|* Tag',\n\t\t\t\t\t\t\tvalue: newFieldValue,\n\t\t\t\t\t\t\thelp: __('the *|MERGE|* tag value corresponding with that field, in your MailChimp audience'),\n\t\t\t\t\t\t\tonChange: function onChange(label) {\n\t\t\t\t\t\t\t\treturn _this2.setState({ newFieldValue: label });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}),\n\t\t\t\t\t\twp.element.createElement(ToggleControl, {\n\t\t\t\t\t\t\tlabel: 'Full width',\n\t\t\t\t\t\t\tchecked: newFieldFullWidth,\n\t\t\t\t\t\t\tonChange: function onChange() {\n\t\t\t\t\t\t\t\treturn _this2.setState(function (state) {\n\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\tnewFieldFullWidth: !state.newFieldFullWidth\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}),\n\t\t\t\t\t\twp.element.createElement(SelectControl, {\n\t\t\t\t\t\t\tlabel: 'Field type (more coming soon)',\n\t\t\t\t\t\t\tvalue: newFieldType,\n\t\t\t\t\t\t\toptions: [{ label: 'Text', value: 'text' }, { label: 'Select', value: 'select' }],\n\t\t\t\t\t\t\tonChange: function onChange(newFieldType) {\n\t\t\t\t\t\t\t\t_this2.setState({ newFieldType: newFieldType });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tnewFieldOptionHTML,\n\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\tButton,\n\t\t\t\t\t\t\t{ isDefault: true, onClick: this.addField },\n\t\t\t\t\t\t\t'Add Custom Field'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tcontainer\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn mailchimpEdit;\n}(Component);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (mailchimpEdit);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3NyYy9ibG9jay9lZGl0LmpzPzNmZTEiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIF9zbGljZWRUb0FycmF5ID0gZnVuY3Rpb24gKCkgeyBmdW5jdGlvbiBzbGljZUl0ZXJhdG9yKGFyciwgaSkgeyB2YXIgX2FyciA9IFtdOyB2YXIgX24gPSB0cnVlOyB2YXIgX2QgPSBmYWxzZTsgdmFyIF9lID0gdW5kZWZpbmVkOyB0cnkgeyBmb3IgKHZhciBfaSA9IGFycltTeW1ib2wuaXRlcmF0b3JdKCksIF9zOyAhKF9uID0gKF9zID0gX2kubmV4dCgpKS5kb25lKTsgX24gPSB0cnVlKSB7IF9hcnIucHVzaChfcy52YWx1ZSk7IGlmIChpICYmIF9hcnIubGVuZ3RoID09PSBpKSBicmVhazsgfSB9IGNhdGNoIChlcnIpIHsgX2QgPSB0cnVlOyBfZSA9IGVycjsgfSBmaW5hbGx5IHsgdHJ5IHsgaWYgKCFfbiAmJiBfaVtcInJldHVyblwiXSkgX2lbXCJyZXR1cm5cIl0oKTsgfSBmaW5hbGx5IHsgaWYgKF9kKSB0aHJvdyBfZTsgfSB9IHJldHVybiBfYXJyO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all 0.5s ease;border-width:0px}.tumbili-submit:hover,.tumbili-submit:active{background-color:#753a10}
1
+ /**
2
+ * #.# Common SCSS
3
+ *
4
+ * Can include things like variables and mixins
5
+ * that are used across the project.
6
+ */
7
+ /**
8
+ * #.# Editor Styles
9
+ *
10
+ * CSS for just Backend enqueued after style.scss
11
+ * which makes it higher in priority.
12
+ */
13
+ .tumbili-submit {
14
+ color: #fff;
15
+ padding: 6px 9px;
16
+ font-size: 13px;
17
+ -webkit-transition: all 0.5s ease;
18
+ -o-transition: all 0.5s ease;
19
+ transition: all 0.5s ease;
20
+ border-width: 0px; }
21
+ .tumbili-submit:hover, .tumbili-submit:active {
22
+ background-color: #753a10; }
23
+
24
+ .tumbili-form-control {
25
+ position: relative; }
26
+
27
+ .tumbili-type-options {
28
+ padding: 8px;
29
+ margin-bottom: 19.5px;
30
+ border: 1px solid #ccc;
31
+ border-radius: 5px; }
32
+
33
+ .tumbili-field-option {
34
+ padding: 5px;
35
+ margin-top: 5px;
36
+ background-color: #f1f1f1;
37
+ border-radius: 5px;
38
+ font-size: 12px;
39
+ display: -ms-flexbox;
40
+ display: flex;
41
+ -ms-flex-pack: justify;
42
+ justify-content: space-between;
43
+ -ms-flex-align: center;
44
+ align-items: center; }
45
+
46
+ .tumbili-field-action {
47
+ position: absolute;
48
+ top: 6px;
49
+ right: 5px; }
50
+ .tumbili-field-action > * {
51
+ opacity: 0.5; }
52
+ .tumbili-field-action > *:hover {
53
+ opacity: 1; }
dist/blocks.style.build.css CHANGED
@@ -1 +1,174 @@
1
- .tumbili-form,.wp-block-cgb-tumbili-mailchimp-for-gutenberg{margin:0 auto;position:relative}.display-flex{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.display-flex>*{padding-left:.6rem;padding-right:.6rem}.flex-grow{-ms-flex-positive:1;flex-grow:1}.flex-is-at-bottom{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:end}.tumbili-form-control{margin-bottom:1rem}.tumbili-form-control input,.tumbili-form-control label{display:block}.tumbili-form-control input{width:100%}.tumbili-submit{width:100%;background-color:#8b4513;border-color:#8b4513}.tumbili-submit .tumbili-loader{display:inline-block;margin-right:0.5rem}.tumbili-submit .tumbili-loader.is-hiding{width:0;margin-right:0;display:none}.tumbili-response{text-align:center;position:absolute;width:100%;max-width:440px;top:50%;left:50%;-webkit-transform:translateY(-50%) translateX(-50%);-ms-transform:translateY(-50%) translateX(-50%);transform:translateY(-50%) translateX(-50%);padding:0.5rem;-webkit-box-shadow:0 4px 8px 0 rgba(0,0,0,0.12),0 2px 4px 0 rgba(0,0,0,0.08);box-shadow:0 4px 8px 0 rgba(0,0,0,0.12),0 2px 4px 0 rgba(0,0,0,0.08);border-radius:0.25rem}.tumbili-response:after{content:'';background-image:url("../assets/reload.svg");background-size:24px 24px;height:24px;width:24px;margin-left:0.5rem;display:inline-block;vertical-align:middle}.tumbili-container{-webkit-transition:all 0.3s ease;-o-transition:all 0.3s ease;transition:all 0.3s ease;margin-bottom:-1rem}.isSubmitting input{-webkit-filter:blur(1px);filter:blur(1px)}.will-animate{-webkit-transition:all 400ms;-o-transition:all 400ms;transition:all 400ms}.is-showing{opacity:1}.is-hiding{opacity:0;visibility:hidden}@-webkit-keyframes ball-pulse-sync{33%{-webkit-transform:translateY(7px);transform:translateY(7px)}66%{-webkit-transform:translateY(-7px);transform:translateY(-7px)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes ball-pulse-sync{33%{-webkit-transform:translateY(7px);transform:translateY(7px)}66%{-webkit-transform:translateY(-7px);transform:translateY(-7px)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}.ball-pulse-sync>div:nth-child(1){-webkit-animation:ball-pulse-sync 0.7s -.14s infinite ease-in-out;animation:ball-pulse-sync 0.7s -.14s infinite ease-in-out}.ball-pulse-sync>div:nth-child(2){-webkit-animation:ball-pulse-sync 0.7s -.07s infinite ease-in-out;animation:ball-pulse-sync 0.7s -.07s infinite ease-in-out}.ball-pulse-sync>div:nth-child(3){-webkit-animation:ball-pulse-sync 0.7s 0s infinite ease-in-out;animation:ball-pulse-sync 0.7s 0s infinite ease-in-out}.ball-pulse-sync>div{background-color:#fff;width:8px;height:8px;border-radius:100%;margin:2px;-webkit-animation-fill-mode:both;animation-fill-mode:both;display:inline-block}
1
+ /**
2
+ * #.# Common SCSS
3
+ *
4
+ * Can include things like variables and mixins
5
+ * that are used across the project.
6
+ */
7
+ /**
8
+ * #.# Styles
9
+ *
10
+ * CSS for both Frontend+Backend.
11
+ */
12
+ .tumbili-form,
13
+ .wp-block-cgb-tumbili-mailchimp-for-gutenberg {
14
+ margin: 0 auto;
15
+ position: relative; }
16
+
17
+ .display-flex {
18
+ display: -ms-flexbox;
19
+ display: flex;
20
+ -ms-flex-wrap: wrap;
21
+ flex-wrap: wrap; }
22
+ .display-flex > * {
23
+ padding-left: 0.6rem;
24
+ padding-right: 0.6rem; }
25
+
26
+ .flex-grow {
27
+ -ms-flex-positive: 1;
28
+ flex-grow: 1; }
29
+
30
+ .flex-is-at-bottom {
31
+ display: -ms-flexbox;
32
+ display: flex;
33
+ -ms-flex-align: end;
34
+ align-items: end; }
35
+
36
+ /**
37
+ Labels
38
+ **/
39
+ .tumbili-form-control {
40
+ margin-bottom: 1rem; }
41
+ .tumbili-form-control input,
42
+ .tumbili-form-control select,
43
+ .tumbili-form-control label {
44
+ display: block; }
45
+ .tumbili-form-control input,
46
+ .tumbili-form-control select {
47
+ width: 100%; }
48
+ .tumbili-form-control.is-full-width {
49
+ -ms-flex-preferred-size: 100%;
50
+ flex-basis: 100%; }
51
+
52
+ /**
53
+ Submit
54
+ **/
55
+ .tumbili-submit {
56
+ width: 100%;
57
+ background-color: saddlebrown;
58
+ border-color: saddlebrown; }
59
+ .tumbili-submit .tumbili-loader {
60
+ display: inline-block;
61
+ margin-right: 0.5rem; }
62
+ .tumbili-submit .tumbili-loader.is-hiding {
63
+ width: 0;
64
+ margin-right: 0;
65
+ display: none; }
66
+
67
+ /**
68
+ Response
69
+ **/
70
+ .tumbili-response {
71
+ text-align: center;
72
+ position: absolute;
73
+ width: 100%;
74
+ max-width: 440px;
75
+ top: 50%;
76
+ left: 50%;
77
+ -webkit-transform: translateY(-50%) translateX(-50%);
78
+ -ms-transform: translateY(-50%) translateX(-50%);
79
+ transform: translateY(-50%) translateX(-50%);
80
+ padding: 0.5rem;
81
+ -webkit-box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.12), 0 2px 4px 0 rgba(0, 0, 0, 0.08);
82
+ box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.12), 0 2px 4px 0 rgba(0, 0, 0, 0.08);
83
+ border-radius: 0.25rem; }
84
+ .tumbili-response:after {
85
+ content: '';
86
+ background-image: url("../assets/reload.svg");
87
+ background-size: 24px 24px;
88
+ height: 24px;
89
+ width: 24px;
90
+ margin-left: 0.5rem;
91
+ display: inline-block;
92
+ vertical-align: middle; }
93
+
94
+ /**
95
+ Interactivity
96
+ **/
97
+ .tumbili-container {
98
+ -webkit-transition: all 0.3s ease;
99
+ -o-transition: all 0.3s ease;
100
+ transition: all 0.3s ease;
101
+ margin-bottom: -1rem; }
102
+
103
+ .isSubmitting input {
104
+ -webkit-filter: blur(1px);
105
+ filter: blur(1px); }
106
+
107
+ .will-animate {
108
+ -webkit-transition: all 400ms;
109
+ -o-transition: all 400ms;
110
+ transition: all 400ms; }
111
+
112
+ .is-showing {
113
+ opacity: 1; }
114
+
115
+ .is-hiding {
116
+ opacity: 0;
117
+ visibility: hidden; }
118
+
119
+ /**
120
+ * Copyright (c) 2016 Connor Atherton
121
+ *
122
+ * All animations must live in their own file
123
+ * in the animations directory and be included
124
+ * here.
125
+ *
126
+ */
127
+ /**
128
+ * Styles shared by multiple animations
129
+ */
130
+ /**
131
+ * Dots
132
+ */
133
+ @-webkit-keyframes ball-pulse-sync {
134
+ 33% {
135
+ -webkit-transform: translateY(7px);
136
+ transform: translateY(7px); }
137
+ 66% {
138
+ -webkit-transform: translateY(-7px);
139
+ transform: translateY(-7px); }
140
+ 100% {
141
+ -webkit-transform: translateY(0);
142
+ transform: translateY(0); } }
143
+ @keyframes ball-pulse-sync {
144
+ 33% {
145
+ -webkit-transform: translateY(7px);
146
+ transform: translateY(7px); }
147
+ 66% {
148
+ -webkit-transform: translateY(-7px);
149
+ transform: translateY(-7px); }
150
+ 100% {
151
+ -webkit-transform: translateY(0);
152
+ transform: translateY(0); } }
153
+
154
+ .ball-pulse-sync > div:nth-child(1) {
155
+ -webkit-animation: ball-pulse-sync 0.7s -0.14s infinite ease-in-out;
156
+ animation: ball-pulse-sync 0.7s -0.14s infinite ease-in-out; }
157
+
158
+ .ball-pulse-sync > div:nth-child(2) {
159
+ -webkit-animation: ball-pulse-sync 0.7s -0.07s infinite ease-in-out;
160
+ animation: ball-pulse-sync 0.7s -0.07s infinite ease-in-out; }
161
+
162
+ .ball-pulse-sync > div:nth-child(3) {
163
+ -webkit-animation: ball-pulse-sync 0.7s 0s infinite ease-in-out;
164
+ animation: ball-pulse-sync 0.7s 0s infinite ease-in-out; }
165
+
166
+ .ball-pulse-sync > div {
167
+ background-color: #fff;
168
+ width: 8px;
169
+ height: 8px;
170
+ border-radius: 100%;
171
+ margin: 2px;
172
+ -webkit-animation-fill-mode: both;
173
+ animation-fill-mode: both;
174
+ display: inline-block; }
dist/client.babel.js CHANGED
@@ -1,5 +1,13 @@
1
"use strict";
2
3
//
4
// DOM READY SCRIPT
5
//
@@ -35,13 +43,22 @@ var domIsReady = function (domIsReady) {
35
(function (document, window, domIsReady, undefined) {
36
domIsReady(function () {
37
function tumbiliSubmitForm(evt) {
38
- var form = evt.target; // console.log( form.querySelectorAll( '.tumbili-loader' ) );
39
-
40
var loader = form.querySelector('.tumbili-loader');
41
var data = {};
42
data.fname = form.querySelector('.tumbiliFName') ? form.querySelector('.tumbiliFName').value : '';
43
data.lname = form.querySelector('.tumbiliLName') ? form.querySelector('.tumbiliLName').value : '';
44
data.email = form.querySelector('.tumbiliEmail') ? form.querySelector('.tumbiliEmail').value : '';
45
data.apikey = form.dataset.apikey;
46
data.listID = form.dataset.listid;
47
data.dc = form.dataset.apikey.split('-')[1];
@@ -49,7 +66,17 @@ var domIsReady = function (domIsReady) {
49
}
50
51
function sendRequestViaAJAX(formData, form, loader) {
52
- var data = 'action=tumbili_mailchimp_add_subscriber&formData[apikey]=' + formData.apikey + '&formData[listID]=' + formData.listID + '&formData[dc]=' + formData.dc + '&formData[fname]=' + formData.fname + '&formData[lname]=' + formData.lname + '&formData[email]=' + formData.email;
53
var serializedData = encodeURI(data);
54
var xhr = new XMLHttpRequest();
55
var url = tumbili.ajax_url;
@@ -119,7 +146,6 @@ var domIsReady = function (domIsReady) {
119
var formTumbili = document.querySelectorAll('.tumbili-form');
120
121
for (var i = 0; i < formTumbili.length; i++) {
122
- console.log('docForms[i]: ', formTumbili[i]);
123
formTumbili[i].addEventListener('submit', function (evt) {
124
evt.preventDefault();
125
tumbiliSubmitForm(evt);
1
"use strict";
2
3
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
4
+
5
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
6
+
7
+ function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
8
+
9
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
10
+
11
//
12
// DOM READY SCRIPT
13
//
43
(function (document, window, domIsReady, undefined) {
44
domIsReady(function () {
45
function tumbiliSubmitForm(evt) {
46
+ var form = evt.target;
47
var loader = form.querySelector('.tumbili-loader');
48
var data = {};
49
data.fname = form.querySelector('.tumbiliFName') ? form.querySelector('.tumbiliFName').value : '';
50
data.lname = form.querySelector('.tumbiliLName') ? form.querySelector('.tumbiliLName').value : '';
51
data.email = form.querySelector('.tumbiliEmail') ? form.querySelector('.tumbiliEmail').value : '';
52
+ var fields = form.querySelectorAll('.tumbili-custom-field') ? form.querySelectorAll('.tumbili-custom-field') : [];
53
+ data.fields = _toConsumableArray(fields).map(function (field) {
54
+ var type = field.dataset.type;
55
+ var value = type === 'select' ? field.options[field.selectedIndex].text : field.value;
56
+ return {
57
+ mergeField: field.name,
58
+ value: value,
59
+ type: type
60
+ };
61
+ });
62
data.apikey = form.dataset.apikey;
63
data.listID = form.dataset.listid;
64
data.dc = form.dataset.apikey.split('-')[1];
66
}
67
68
function sendRequestViaAJAX(formData, form, loader) {
69
+ var fields = '';
70
+
71
+ if (formData.fields) {
72
+ formData.fields.map(function (field) {
73
+ if (field.value) {
74
+ fields += "&formCustomFields[".concat(field.mergeField, "]=").concat(field.value);
75
+ }
76
+ });
77
+ }
78
+
79
+ var data = "action=tumbili_mailchimp_add_subscriber&formData[apikey]=".concat(formData.apikey, "&formData[listID]=").concat(formData.listID, "&formData[dc]=").concat(formData.dc, "&formData[fname]=").concat(formData.fname, "&formData[lname]=").concat(formData.lname, "&formData[email]=").concat(formData.email).concat(fields);
80
var serializedData = encodeURI(data);
81
var xhr = new XMLHttpRequest();
82
var url = tumbili.ajax_url;
146
var formTumbili = document.querySelectorAll('.tumbili-form');
147
148
for (var i = 0; i < formTumbili.length; i++) {
149
formTumbili[i].addEventListener('submit', function (evt) {
150
evt.preventDefault();
151
tumbiliSubmitForm(evt);
plugin.php CHANGED
@@ -5,7 +5,7 @@
5
* Description: Easily add a mailchimp signup form to your editor.
6
* Author: gubbigubbi
7
* Author URI: https://github.com/gubbigubbi/
8
- * Version: 0.5
9
* License: GPL2+
10
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
11
*
5
* Description: Easily add a mailchimp signup form to your editor.
6
* Author: gubbigubbi
7
* Author URI: https://github.com/gubbigubbi/
8
+ * Version: 0.6
9
* License: GPL2+
10
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
11
*
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
Contributors: gubbigubbi
3
Tags: gutenberg, mailchimp, mailchimp signup, mailchimp form
4
Requires at least: 4.9.6
5
- Tested up to: 5.0
6
- Stable tag: 0.5
7
- Requires PHP: 5.4
8
License: GPLv2 or later
9
License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
@@ -46,6 +46,9 @@ This plugin is laid out using Flexbox, we do not have plans to support older bro
46
47
== Changelog ==
48
49
= 0.5 =
50
* Fixed client issue with multiple forms using vanilla js
51
2
Contributors: gubbigubbi
3
Tags: gutenberg, mailchimp, mailchimp signup, mailchimp form
4
Requires at least: 4.9.6
5
+ Tested up to: 5.3
6
+ Stable tag: 0.6
7
+ Requires PHP: 5.6
8
License: GPLv2 or later
9
License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
46
47
== Changelog ==
48
49
+ = 0.6 =
50
+ * Added custom field support!
51
+
52
= 0.5 =
53
* Fixed client issue with multiple forms using vanilla js
54
src/client.js CHANGED
@@ -36,7 +36,7 @@ var domIsReady = ( function( domIsReady ) {
36
domIsReady( function() {
37
function tumbiliSubmitForm( evt ) {
38
const form = evt.target;
39
- // console.log( form.querySelectorAll( '.tumbili-loader' ) );
40
const loader = form.querySelector( '.tumbili-loader' );
41
const data = {};
42
@@ -52,6 +52,24 @@ var domIsReady = ( function( domIsReady ) {
52
form.querySelector( '.tumbiliEmail' ).value :
53
'';
54
55
data.apikey = form.dataset.apikey;
56
data.listID = form.dataset.listid;
57
data.dc = form.dataset.apikey.split( '-' )[ 1 ];
@@ -60,19 +78,17 @@ var domIsReady = ( function( domIsReady ) {
60
}
61
62
function sendRequestViaAJAX( formData, form, loader ) {
63
- const data =
64
- 'action=tumbili_mailchimp_add_subscriber&formData[apikey]=' +
65
- formData.apikey +
66
- '&formData[listID]=' +
67
- formData.listID +
68
- '&formData[dc]=' +
69
- formData.dc +
70
- '&formData[fname]=' +
71
- formData.fname +
72
- '&formData[lname]=' +
73
- formData.lname +
74
- '&formData[email]=' +
75
- formData.email;
76
77
const serializedData = encodeURI( data );
78
@@ -160,8 +176,6 @@ var domIsReady = ( function( domIsReady ) {
160
const formTumbili = document.querySelectorAll( '.tumbili-form' );
161
162
for ( let i = 0; i < formTumbili.length; i++ ) {
163
- console.log( 'docForms[i]: ', formTumbili[ i ] );
164
-
165
formTumbili[ i ].addEventListener( 'submit', function( evt ) {
166
evt.preventDefault();
167
tumbiliSubmitForm( evt );
36
domIsReady( function() {
37
function tumbiliSubmitForm( evt ) {
38
const form = evt.target;
39
+
40
const loader = form.querySelector( '.tumbili-loader' );
41
const data = {};
42
52
form.querySelector( '.tumbiliEmail' ).value :
53
'';
54
55
+ const fields = form.querySelectorAll( '.tumbili-custom-field' ) ?
56
+ form.querySelectorAll( '.tumbili-custom-field' ) :
57
+ [];
58
+
59
+ data.fields = [ ...fields ].map( field => {
60
+ const type = field.dataset.type;
61
+ const value =
62
+ type === 'select' ?
63
+ field.options[ field.selectedIndex ].text :
64
+ field.value;
65
+
66
+ return {
67
+ mergeField: field.name,
68
+ value,
69
+ type,
70
+ };
71
+ } );
72
+
73
data.apikey = form.dataset.apikey;
74
data.listID = form.dataset.listid;
75
data.dc = form.dataset.apikey.split( '-' )[ 1 ];
78
}
79
80
function sendRequestViaAJAX( formData, form, loader ) {
81
+ let fields = '';
82
+
83
+ if ( formData.fields ) {
84
+ formData.fields.map( field => {
85
+ if ( field.value ) {
86
+ fields += `&formCustomFields[${ field.mergeField }]=${ field.value }`;
87
+ }
88
+ } );
89
+ }
90
+
91
+ const data = `action=tumbili_mailchimp_add_subscriber&formData[apikey]=${ formData.apikey }&formData[listID]=${ formData.listID }&formData[dc]=${ formData.dc }&formData[fname]=${ formData.fname }&formData[lname]=${ formData.lname }&formData[email]=${ formData.email }${ fields }`;
92
93
const serializedData = encodeURI( data );
94
176
const formTumbili = document.querySelectorAll( '.tumbili-form' );
177
178
for ( let i = 0; i < formTumbili.length; i++ ) {
179
formTumbili[ i ].addEventListener( 'submit', function( evt ) {
180
evt.preventDefault();
181
tumbiliSubmitForm( evt );
src/server.php CHANGED
@@ -30,6 +30,10 @@ register_block_type('cgb/tumbili-mailchimp-for-gutenberg', array(
30
'type' => 'string',
31
'default' => '',
32
),
33
)
34
)
35
);
@@ -59,6 +63,21 @@ function tumbili_mailchimp_add_subscriber( ) {
59
// $status = $_POST['status'];
60
// }
61
62
$url = "https://{$datacenter}.api.mailchimp.com/3.0/lists/{$list_id}/members/";
63
$auth = base64_encode( 'user:'.esc_attr($api_key) );
64
$response = [];
@@ -66,10 +85,7 @@ function tumbili_mailchimp_add_subscriber( ) {
66
$data = array(
67
'email_address' => esc_attr($email),
68
'status' => esc_attr($status),
69
- 'merge_fields' => array(
70
- 'FNAME' => esc_attr($first_name),
71
- 'LNAME' => esc_attr($last_name)
72
- )
73
);
74
75
$response = json_encode(tumbili_fetchData(esc_attr($url), $data, $auth));
@@ -106,16 +122,18 @@ function tumbili_fetchData($url, $data, $auth) {
106
*/
107
function tumbili_render_callback( array $attributes ){
108
109
- $formAction = $attributes[ 'formAction' ];
110
- $apiKey = $attributes[ 'apiKey' ];
111
- $listID = $attributes[ 'listID' ] ;
112
- $showFirstName = $attributes[ 'showFirstName' ];
113
- $showLastName = $attributes[ 'showLastName' ];
114
$buttonBackground = $attributes[ 'buttonBackground' ];
115
- $buttonColor = $attributes[ 'buttonColor' ];
116
117
$firstName = '';
118
$lastName = '';
119
120
if($showFirstName) {
121
$firstName .= '
@@ -131,6 +149,24 @@ function tumbili_render_callback( array $attributes ){
131
</div>';
132
}
133
134
$markup = '<form class="tumbili-form" id="tumbili-form-'.rand(0, 1000).'" data-apikey="'.$apiKey.'" data-listid="'.$listID.'" action="'.$formAction.'" method="post" class="wp-block-cgb-tumbili-mailchimp-for-gutenberg">';
135
136
$markup .= '<a class="tumbili-response will-animate is-hiding"></a>';
@@ -142,7 +178,7 @@ function tumbili_render_callback( array $attributes ){
142
$markup .= '
143
<div class="tumbili-form-control flex-grow">
144
<label for="email">Email<input class="tumbiliEmail" name="email" type="email"></label>
145
- </div>
146
<div class="flex-grow flex-is-at-bottom tumbili-form-control">
147
<button style="background-color: '.$buttonBackground.'; color: '.$buttonColor.'; border-color: '.$buttonBackground.'" class="tumbili-submit" value="Submit" type="submit">
148
<div class="tumbili-loader will-animate is-hiding">
@@ -155,8 +191,6 @@ function tumbili_render_callback( array $attributes ){
155
Submit
156
</button>
157
</div>
158
-
159
-
160
';
161
162
30
'type' => 'string',
31
'default' => '',
32
),
33
+ 'fields' => array(
34
+ 'type' => 'array',
35
+ 'default' => []
36
+ ),
37
)
38
)
39
);
63
// $status = $_POST['status'];
64
// }
65
66
+ $fields = $_POST['formCustomFields'];
67
+
68
+ $mergeFields = array(
69
+ 'FNAME' => esc_attr($first_name),
70
+ 'LNAME' => esc_attr($last_name)
71
+ );
72
+
73
+ if($fields) {
74
+ foreach($fields as $key => $field) {
75
+ $fieldsArr[$key] = esc_attr($field);
76
+ }
77
+
78
+ $mergeFields = array_merge($mergeFields, $fieldsArr);
79
+ }
80
+
81
$url = "https://{$datacenter}.api.mailchimp.com/3.0/lists/{$list_id}/members/";
82
$auth = base64_encode( 'user:'.esc_attr($api_key) );
83
$response = [];
85
$data = array(
86
'email_address' => esc_attr($email),
87
'status' => esc_attr($status),
88
+ 'merge_fields' => $mergeFields,
89
);
90
91
$response = json_encode(tumbili_fetchData(esc_attr($url), $data, $auth));
122
*/
123
function tumbili_render_callback( array $attributes ){
124
125
+ $formAction = $attributes[ 'formAction' ];
126
+ $apiKey = $attributes[ 'apiKey' ];
127
+ $listID = $attributes[ 'listID' ] ;
128
+ $showFirstName = $attributes[ 'showFirstName' ];
129
+ $showLastName = $attributes[ 'showLastName' ];
130
$buttonBackground = $attributes[ 'buttonBackground' ];
131
+ $buttonColor = $attributes[ 'buttonColor' ];
132
+ $fields = $attributes[ 'fields' ];
133
134
$firstName = '';
135
$lastName = '';
136
+ $fieldsHTML = '';
137
138
if($showFirstName) {
139
$firstName .= '
149
</div>';
150
}
151
152
+ foreach ($fields as $field) {
153
+
154
+ $width = $field['fullWidth'] ? 'is-full-width' : '';
155
+
156
+ $fieldsHTML .= '<div class="tumbili-form-control flex-grow '.$width.'"><label for="'.$field['value'].'">'.$field['label'];
157
+
158
+ if( $field['type'] == 'text' ) {
159
+ $fieldsHTML .= '<input name="'.$field['value'].'" class="tumbili-custom-field" type="text" data-type="'.$field['type'].'"></label>';
160
+ } else {
161
+ $fieldsHTML .= '<select name="'.$field['value'].'" class="tumbili-custom-field" data-type="'.$field['type'].'">';
162
+ foreach($field['options'] as $option) {
163
+ $fieldsHTML .= '<option value="'.$option['value'].'">'.$option['label'].'</option>';
164
+ }
165
+ $fieldsHTML .= '</select>';
166
+ }
167
+ $fieldsHTML .= '</label></div>';
168
+ }
169
+
170
$markup = '<form class="tumbili-form" id="tumbili-form-'.rand(0, 1000).'" data-apikey="'.$apiKey.'" data-listid="'.$listID.'" action="'.$formAction.'" method="post" class="wp-block-cgb-tumbili-mailchimp-for-gutenberg">';
171
172
$markup .= '<a class="tumbili-response will-animate is-hiding"></a>';
178
$markup .= '
179
<div class="tumbili-form-control flex-grow">
180
<label for="email">Email<input class="tumbiliEmail" name="email" type="email"></label>
181
+ </div>'.$fieldsHTML.'
182
<div class="flex-grow flex-is-at-bottom tumbili-form-control">
183
<button style="background-color: '.$buttonBackground.'; color: '.$buttonColor.'; border-color: '.$buttonBackground.'" class="tumbili-submit" value="Submit" type="submit">
184
<div class="tumbili-loader will-animate is-hiding">
191
Submit
192
</button>
193
</div>
194
';
195
196