From 17a6fa76005d91d1a462a879211392e0822ac0f0 Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 22 Sep 2021 09:58:43 +0100 Subject: [PATCH] add middle size --- README.md | 29 ++++++++++++++++------------- assets/middleIcon.svg | 4 ++++ dist/bundle.js | 2 +- src/index.css | 8 ++++++++ src/index.js | 3 +++ src/ui.js | 7 ++++++- test/fixtures/toolData.js | 1 + test/fixtures/tunes.js | 3 +++ 8 files changed, 42 insertions(+), 15 deletions(-) create mode 100644 assets/middleIcon.svg diff --git a/README.md b/README.md index 8c269a3..f015a77 100644 --- a/README.md +++ b/README.md @@ -56,10 +56,10 @@ const editor = EditorJS({ ## Config Params -| Field | Type | Description | -| -------------- | --------- | ------------------------------- | -| embed | `{display: boolean}` | You could display or not the embed tab, If you don't fill the embed config by default the value is set on true -| unsplash | `{appName: string, clientId: string, maxResults: string}` | Config for **Unsplash API**. Contains 3 fields:

**appName**: Unspalsh `Application Name`.

**clientId**: Unsplash `Access Key`.

**maxResults**: Max number of images per search (default 30). | +| Field | Type | Description | +| -------- | --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| embed | `{display: boolean}` | You could display or not the embed tab, If you don't fill the embed config by default the value is set on true | +| unsplash | `{appName: string, clientId: string, maxResults: string}` | Config for **Unsplash API**. Contains 3 fields:

**appName**: Unspalsh `Application Name`.

**clientId**: Unsplash `Access Key`.

**maxResults**: Max number of images per search (default 30). | ## Tool's tunes @@ -71,14 +71,15 @@ const editor = EditorJS({ ## Output data -| Field | Type | Description | -| -------------- | --------- | ------------------------------- | -| url | `string` | Image's url | -| caption | `string` | Image's caption | -| withBorder | `boolean` | Add border to image | -| withBackground | `boolean` | Add background | -| stretched | `boolean` | Stretch image to screen's width | -| unsplash | `{author: string, profileLink: string}` | Unsplash image author information.

**author**: Author's name.

**profileLink**: Unsplash porfile link. +| Field | Type | Description | +| -------------- | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| url | `string` | Image's url | +| caption | `string` | Image's caption | +| withBorder | `boolean` | Add border to image | +| withBackground | `boolean` | Add background | +| stretched | `boolean` | Stretch image to screen's width | +| middle | `boolean` | Stretch image to screen's width middle | +| unsplash | `{author: string, profileLink: string}` | Unsplash image author information.

**author**: Author's name.

**profileLink**: Unsplash porfile link. | **Image** @@ -90,7 +91,8 @@ const editor = EditorJS({ "caption" : "An image", "withBorder" : false, "withBackground" : false, - "stretched" : true + "stretched" : true, + "middle" : true } } ``` @@ -106,6 +108,7 @@ const editor = EditorJS({ "withBorder": false, "withBackground": true, "stretched": false, + "middle" : false "unsplash": { "author": "John Doe", "profileLink": "https://unsplash.com/@john_doe_fake" diff --git a/assets/middleIcon.svg b/assets/middleIcon.svg new file mode 100644 index 0000000..7d8c973 --- /dev/null +++ b/assets/middleIcon.svg @@ -0,0 +1,4 @@ + + + diff --git a/dist/bundle.js b/dist/bundle.js index 7e5f1ec..8160c58 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.InlineImage=t():e.InlineImage=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=36)}([function(e,t,n){"use strict";var r=n(3),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===i.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var n=0,r=e.length;n'},function(e,t,n){e.exports=n(18)},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){c.headers[e]=r.merge(o)})),e.exports=c}).call(this,n(23))},function(e,t,n){"use strict";var r=n(0),i=n(25),o=n(27),s=n(4),a=n(28),c=n(31),u=n(32),l=n(8);e.exports=function(e){return new Promise((function(t,n){var d=e.data,f=e.headers;r.isFormData(d)&&delete f["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";f.Authorization="Basic "+btoa(h+":"+m)}var g=a(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),s(g,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in p?c(p.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:e,request:p};i(t,n,o),p=null}},p.onabort=function(){p&&(n(l("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){n(l("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var v=(e.withCredentials||u(g))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;v&&(f[e.xsrfHeaderName]=v)}if("setRequestHeader"in p&&r.forEach(f,(function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete f[t]:p.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),n(e),p=null)})),d||(d=null),p.send(d)}))}},function(e,t,n){"use strict";var r=n(26);e.exports=function(e,t,n,i,o){var s=new Error(e);return r(s,t,n,i,o)}},function(e,t,n){"use strict";var r=n(0);e.exports=function(e,t){t=t||{};var n={},i=["url","method","data"],o=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function c(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function u(i){r.isUndefined(t[i])?r.isUndefined(e[i])||(n[i]=c(void 0,e[i])):n[i]=c(e[i],t[i])}r.forEach(i,(function(e){r.isUndefined(t[e])||(n[e]=c(void 0,t[e]))})),r.forEach(o,u),r.forEach(s,(function(i){r.isUndefined(t[i])?r.isUndefined(e[i])||(n[i]=c(void 0,e[i])):n[i]=c(void 0,t[i])})),r.forEach(a,(function(r){r in t?n[r]=c(e[r],t[r]):r in e&&(n[r]=c(void 0,e[r]))}));var l=i.concat(o).concat(s).concat(a),d=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===l.indexOf(e)}));return r.forEach(d,u),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t,n){var r=n(14);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(16)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(15)(!1)).push([e.i,".cdx-loader {\n border: none;\n margin: auto;\n}\n\n.inline-image .cdx-loader {\n min-height: 200px;\n}\n\n.inline-image .cdx-input {\n margin-top: 10px;\n}\n\n.inline-image img {\n max-width: 100%;\n vertical-align: bottom;\n}\n\n.inline-image__caption[contentEditable=true][data-placeholder]:empty::before {\n position: absolute;\n content: attr(data-placeholder);\n color: #707684;\n font-weight: normal;\n opacity: 0;\n }\n\n.inline-image__caption[contentEditable=true][data-placeholder]:empty::before {\n opacity: 1;\n}\n\n.inline-image__caption[contentEditable=true][data-placeholder]:empty:focus::before {\n opacity: 0;\n}\n\n.inline-image__picture--withBackground {\n background: #eff2f5;\n padding: 10px;\n text-align: center;\n}\n\n.inline-image__picture--withBackground img {\n max-width: 60%;\n margin: 0 auto;\n}\n\n\n.inline-image__picture--withBorder {\n border: 1px solid #e8e8eb;\n padding: 1px;\n}\n\n.inline-image__picture--stretched img {\n max-width: none;\n width: 100%;\n}\n\n.inline-image__tab-wrapper {\n display: flex;\n margin-bottom: 5px;\n border-bottom-style: solid;\n border-bottom-width: 1px;\n border-bottom-color: lightgray;\n}\n\n.inline-image__tab {\n padding: 5px;\n cursor: pointer;\n}\n\n.inline-image__tab:hover {\n background: #eff2f5;\n}\n\n.inline-image__tab.active {\n border-width: 0 0 3px 0;\n border-style: solid;\n border-color: #388ae5;\n}\n\n.inline-image__embed-button {\n width: 50%;\n background-color: #388ae5;\n color: white;\n text-align: center;\n margin: auto;\n cursor: pointer;\n}\n\n.inline-image__embed-button:hover {\n opacity: 0.9;\n}\n\n.inline-image__control-panel {\n padding: 10px;\n border-radius: 4px;\n box-shadow: rgba(15, 15, 15, 0.05) 0px 0px 0px 1px,\n rgba(15, 15, 15, 0.1) 0px 3px 6px,\n rgba(15, 15, 15, 0.2) 0px 9px 24px;\n}\n\n.inline-image__image-gallery {\n max-height: 400px;\n display: flex;\n flex-wrap: wrap;\n align-content: flex-start;\n background: white;\n margin: 5px;\n}\n\n.inline-image__img-wrapper {\n width: 25%;\n}\n\n.inline-image__thumb {\n display: block;\n object-fit: cover;\n border-radius: 10px;\n width: 90%;\n height: 105px;\n padding: 5px;\n object-position: center 0%;\n cursor: pointer;\n}\n\n.inline-image__image-credits {\n font-size: 12px;\n text-align: center;\n margin-bottom: 5px;\n color: gray;\n}\n\n.inline-image__image-credits a {\n color: gray;\n}\n\n.inline-image__search {\n margin: 10px;\n width: 96%;\n}\n\n.inline-image__no-results{\n width: 100%;\n text-align: center;\n margin: 20px;\n}\n\n.hidden {\n display: none;\n}\n\n.scroll {\n overflow-y: scroll;\n}\n",""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=(s=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),o=r.sources.map((function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"}));return[n].concat(o).concat([i]).join("\n")}var s;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i=0&&d.splice(t,1)}function v(e){var t=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),b(t,e.attrs),m(e,t),t}function b(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function y(e,t){var n,r,i,o;if(t.transform&&e.css){if(!(o=t.transform(e.css)))return function(){};e.css=o}if(t.singleton){var s=l++;n=u||(u=v(t)),r=C.bind(null,n,s,!1),i=C.bind(null,n,s,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",b(t,e.attrs),m(e,t),t}(t),r=T.bind(null,n,t),i=function(){g(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(t),r=O.bind(null,n),i=function(){g(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=s()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=h(e,t);return p(n,t),function(e){for(var r=[],i=0;i1)for(var n=1;n=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},function(e,t,n){"use strict";var r=n(0);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";var r=n(10);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return I}));n(13);function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=document.createElement(e);Array.isArray(n)?(t=o.classList).add.apply(t,r(n)):n&&o.classList.add(n);return Object.keys(i).forEach((function(e){o[e]=i[e]})),o},s=function(e){var t=e.appName,n=e.author,r=e.profileLink,i=o("div","inline-image__image-credits"),s=o("div",null,{innerHTML:"by ",style:"display: inline;"}),a=o("a","",{href:"".concat(r,"?utm_source=").concat(t,"&utm_medium=referral"),innerHTML:n,target:"_blank"}),c=o("div",null,{innerHTML:" on ",style:"display: inline;"}),u=o("a","",{href:"https://unsplash.com/?utm_source=".concat(t,"&utm_medium=referral"),innerHTML:"Unsplash",target:"_blank"});return i.appendChild(s),i.appendChild(a),i.appendChild(c),i.appendChild(u),i};function a(e,t){for(var n=0;n'},function(e,t,n){e.exports=n(19)},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){c.headers[e]=r.merge(o)})),e.exports=c}).call(this,n(24))},function(e,t,n){"use strict";var r=n(0),i=n(26),o=n(28),s=n(4),a=n(29),c=n(32),u=n(33),l=n(8);e.exports=function(e){return new Promise((function(t,n){var d=e.data,f=e.headers;r.isFormData(d)&&delete f["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";f.Authorization="Basic "+btoa(h+":"+m)}var g=a(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),s(g,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in p?c(p.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:e,request:p};i(t,n,o),p=null}},p.onabort=function(){p&&(n(l("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){n(l("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var v=(e.withCredentials||u(g))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;v&&(f[e.xsrfHeaderName]=v)}if("setRequestHeader"in p&&r.forEach(f,(function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete f[t]:p.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),n(e),p=null)})),d||(d=null),p.send(d)}))}},function(e,t,n){"use strict";var r=n(27);e.exports=function(e,t,n,i,o){var s=new Error(e);return r(s,t,n,i,o)}},function(e,t,n){"use strict";var r=n(0);e.exports=function(e,t){t=t||{};var n={},i=["url","method","data"],o=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function c(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function u(i){r.isUndefined(t[i])?r.isUndefined(e[i])||(n[i]=c(void 0,e[i])):n[i]=c(e[i],t[i])}r.forEach(i,(function(e){r.isUndefined(t[e])||(n[e]=c(void 0,t[e]))})),r.forEach(o,u),r.forEach(s,(function(i){r.isUndefined(t[i])?r.isUndefined(e[i])||(n[i]=c(void 0,e[i])):n[i]=c(void 0,t[i])})),r.forEach(a,(function(r){r in t?n[r]=c(e[r],t[r]):r in e&&(n[r]=c(void 0,e[r]))}));var l=i.concat(o).concat(s).concat(a),d=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===l.indexOf(e)}));return r.forEach(d,u),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t){e.exports=''},function(e,t,n){var r=n(15);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(17)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(16)(!1)).push([e.i,".cdx-loader {\n border: none;\n margin: auto;\n}\n\n.inline-image .cdx-loader {\n min-height: 200px;\n}\n\n.inline-image .cdx-input {\n margin-top: 10px;\n}\n\n.inline-image img {\n max-width: 100%;\n vertical-align: bottom;\n}\n\n.inline-image__caption[contentEditable=true][data-placeholder]:empty::before {\n position: absolute;\n content: attr(data-placeholder);\n color: #707684;\n font-weight: normal;\n opacity: 0;\n }\n\n.inline-image__caption[contentEditable=true][data-placeholder]:empty::before {\n opacity: 1;\n}\n\n.inline-image__caption[contentEditable=true][data-placeholder]:empty:focus::before {\n opacity: 0;\n}\n\n.inline-image__picture--withBackground {\n background: #eff2f5;\n padding: 10px;\n text-align: center;\n}\n\n.inline-image__picture--withBackground img {\n max-width: 60%;\n margin: 0 auto;\n}\n\n\n.inline-image__picture--withBorder {\n border: 1px solid #e8e8eb;\n padding: 1px;\n}\n\n.inline-image__picture--stretched img {\n max-width: none;\n width: 100%;\n}\n.inline-image__picture--middle img {\n max-width: none;\n width: 50%;\n display: block;\n margin-left: auto;\n margin-right: auto;\n}\n\n\n.inline-image__tab-wrapper {\n display: flex;\n margin-bottom: 5px;\n border-bottom-style: solid;\n border-bottom-width: 1px;\n border-bottom-color: lightgray;\n}\n\n.inline-image__tab {\n padding: 5px;\n cursor: pointer;\n}\n\n.inline-image__tab:hover {\n background: #eff2f5;\n}\n\n.inline-image__tab.active {\n border-width: 0 0 3px 0;\n border-style: solid;\n border-color: #388ae5;\n}\n\n.inline-image__embed-button {\n width: 50%;\n background-color: #388ae5;\n color: white;\n text-align: center;\n margin: auto;\n cursor: pointer;\n}\n\n.inline-image__embed-button:hover {\n opacity: 0.9;\n}\n\n.inline-image__control-panel {\n padding: 10px;\n border-radius: 4px;\n box-shadow: rgba(15, 15, 15, 0.05) 0px 0px 0px 1px,\n rgba(15, 15, 15, 0.1) 0px 3px 6px,\n rgba(15, 15, 15, 0.2) 0px 9px 24px;\n}\n\n.inline-image__image-gallery {\n max-height: 400px;\n display: flex;\n flex-wrap: wrap;\n align-content: flex-start;\n background: white;\n margin: 5px;\n}\n\n.inline-image__img-wrapper {\n width: 25%;\n}\n\n.inline-image__thumb {\n display: block;\n object-fit: cover;\n border-radius: 10px;\n width: 90%;\n height: 105px;\n padding: 5px;\n object-position: center 0%;\n cursor: pointer;\n}\n\n.inline-image__image-credits {\n font-size: 12px;\n text-align: center;\n margin-bottom: 5px;\n color: gray;\n}\n\n.inline-image__image-credits a {\n color: gray;\n}\n\n.inline-image__search {\n margin: 10px;\n width: 96%;\n}\n\n.inline-image__no-results{\n width: 100%;\n text-align: center;\n margin: 20px;\n}\n\n.hidden {\n display: none;\n}\n\n.scroll {\n overflow-y: scroll;\n}\n",""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=(s=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),o=r.sources.map((function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"}));return[n].concat(o).concat([i]).join("\n")}var s;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i=0&&d.splice(t,1)}function v(e){var t=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),b(t,e.attrs),m(e,t),t}function b(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function y(e,t){var n,r,i,o;if(t.transform&&e.css){if(!(o=t.transform(e.css)))return function(){};e.css=o}if(t.singleton){var s=l++;n=u||(u=v(t)),r=C.bind(null,n,s,!1),i=C.bind(null,n,s,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",b(t,e.attrs),m(e,t),t}(t),r=T.bind(null,n,t),i=function(){g(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(t),r=O.bind(null,n),i=function(){g(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=s()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=h(e,t);return p(n,t),function(e){for(var r=[],i=0;i1)for(var n=1;n=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},function(e,t,n){"use strict";var r=n(0);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";var r=n(10);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return R}));n(14);function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=document.createElement(e);Array.isArray(n)?(t=o.classList).add.apply(t,r(n)):n&&o.classList.add(n);return Object.keys(i).forEach((function(e){o[e]=i[e]})),o},s=function(e){var t=e.appName,n=e.author,r=e.profileLink,i=o("div","inline-image__image-credits"),s=o("div",null,{innerHTML:"by ",style:"display: inline;"}),a=o("a","",{href:"".concat(r,"?utm_source=").concat(t,"&utm_medium=referral"),innerHTML:n,target:"_blank"}),c=o("div",null,{innerHTML:" on ",style:"display: inline;"}),u=o("a","",{href:"https://unsplash.com/?utm_source=".concat(t,"&utm_medium=referral"),innerHTML:"Unsplash",target:"_blank"});return i.appendChild(s),i.appendChild(a),i.appendChild(c),i.appendChild(u),i};function a(e,t){for(var n=0;n { const blockIndex = this.api.blocks.getCurrentBlockIndex(); this.api.blocks.stretchBlock(blockIndex, status); diff --git a/test/fixtures/toolData.js b/test/fixtures/toolData.js index 6214bd1..d51974f 100644 --- a/test/fixtures/toolData.js +++ b/test/fixtures/toolData.js @@ -7,6 +7,7 @@ export const data = { withBorder: false, withBackground: false, stretched: false, + middle: false, unsplash: { author: 'John Doe', profileLink: 'https://unsplash.com/@john_doe_fake', diff --git a/test/fixtures/tunes.js b/test/fixtures/tunes.js index c474a82..a07679f 100644 --- a/test/fixtures/tunes.js +++ b/test/fixtures/tunes.js @@ -12,6 +12,9 @@ const settings = [ { name: 'stretched', }, + { + name: 'middle', + }, { name: 'withBackground', },