From 4011d40fc8b5ef8852d9c908e390c53f87d09b25 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 1 May 2019 22:09:00 +0200 Subject: [PATCH] Bump 0.1.2 --- dist/grapesjs-custom-code.min.js | 4 ++-- dist/grapesjs-custom-code.min.js.map | 2 +- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/grapesjs-custom-code.min.js b/dist/grapesjs-custom-code.min.js index c921f48..8929b5b 100644 --- a/dist/grapesjs-custom-code.min.js +++ b/dist/grapesjs-custom-code.min.js @@ -1,3 +1,3 @@ -/*! grapesjs-custom-code - 0.1.1 */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("grapesjs")):"function"==typeof define&&define.amd?define(["grapesjs"],t):"object"==typeof exports?exports["grapesjs-custom-code"]=t(require("grapesjs")):e["grapesjs-custom-code"]=t(e.grapesjs)}(window,function(e){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=1)}([function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.keyCustomCode="custom-code-plugin__code",t.typeCustomCode="custom-code",t.commandNameCustomCode="custom-code:open-modal"},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},o=n({blockLabel:"Custom Code",blockCustomCode:{},propsCustomCode:{},placeholderContent:"Insert here your custom code",toolbarBtnCustomCode:{},placeholderScript:'
\n \n \n \n Custom code with <script> can\'t be rendered on the canvas\n
',modalTitle:"Insert your code",codeViewOptions:{},buttonLabel:"Save",commandCustomCode:{}},t);(0,i.default)(e,o),(0,s.default)(e,o),(0,a.default)(e,o)})},function(t,o){t.exports=e},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},o=e.DomComponents,i=o.getType("default"),s=i.model,a=t.toolbarBtnCustomCode,d=void 0;o.addType(r.typeCustomCode,{model:s.extend({defaults:n({},s.prototype.defaults,{name:"Custom Code",editable:!0},t.propsCustomCode),init:function(){this.listenTo(this,"change:"+r.keyCustomCode,this.onCustomCodeChange);var e=this.get(r.keyCustomCode)||t.placeholderContent;!this.components().length&&this.components(e);var o=this.get("toolbar"),i="custom-code";a&&!o.filter(function(e){return e.id===i}).length&&o.unshift(n({id:i,command:r.commandNameCustomCode,label:'\n \n '},a))},onCustomCodeChange:function(){this.components(this.get(r.keyCustomCode))}},{isComponent:function(){return!1}}),view:i.view.extend({events:{dblclick:"onActive"},init:function(){this.listenTo(this.model.components(),"add remove reset",this.onComponentsChange),this.onComponentsChange()},onComponentsChange:function(){var e=this;d&&clearInterval(d),d=setTimeout(function(){var o=e.model,n=1;(o.get(r.keyCustomCode)||"").indexOf("=0&&(e.el.innerHTML=t.placeholderScript,n=0),o.set({droppable:n})},0)},onActive:function(){var e=this.model;this.em.get("Commands").run(r.commandNameCustomCode,{target:e})}})})}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},o=e.BlockManager,i=t.blockCustomCode,s=t.blockLabel;i&&o.add(r.typeCustomCode,n({label:'\n \n \n
'+s+"
",category:"Extra",activate:!0,select:!0,content:{type:r.typeCustomCode}},i))}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},o=e.Commands,i=t.modalTitle,s=t.codeViewOptions,a=t.commandCustomCode,d=function(e,t){t instanceof HTMLElement?e.appendChild(t):t&&e.insertAdjacentHTML("beforeend",t)};o.add(r.commandNameCustomCode,n({keyCustomCode:r.keyCustomCode,run:function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.editor=e,this.options=o,this.target=o.target||e.getSelected();var n=this.target;n&&n.get("editable")&&this.showCustomCode(n)},stop:function(e){e.Modal.close()},showCustomCode:function(e){var t=this.editor,o=this.options.title||i,n=this.getContent(),s=e.get(r.keyCustomCode)||"";t.Modal.open({title:o,content:n}),this.getCodeViewer().setContent(s)},getPreContent:function(){},getPostContent:function(){},getContent:function(){var e=this.editor,t=(this.options,this.target,document.createElement("div")),o=this.getCodeViewer(),n=e.getConfig("stylePrefix");return t.className=n+"custom-code",d(t,this.getPreContent()),t.appendChild(o.getElement()),d(t,this.getPostContent()),d(t,this.getContentActions()),o.refresh(),setTimeout(function(){return o.focus()},0),t},getContentActions:function(){var e=this,o=this.editor,n=document.createElement("button"),r=o.getConfig("stylePrefix");return n.innerHTML=t.buttonLabel,n.className=r+"btn-prim "+r+"btn-import__custom-code",n.onclick=function(){return e.handleSave()},n},handleSave:function(){var e=this.editor,t=this.target,o=this.getCodeViewer().getContent();t.set(r.keyCustomCode,o),e.Modal.close()},getCodeViewer:function(){var e=this.editor;return this.codeViewer||(this.codeViewer=e.CodeManager.createViewer(n({codeName:"htmlmixed",theme:"hopscotch",readOnly:0},s))),this.codeViewer}},a))}}])}); +/*! grapesjs-custom-code - 0.1.2 */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["grapesjs-custom-code"]=t():e["grapesjs-custom-code"]=t()}(window,function(){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=1)}([function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.keyCustomCode="custom-code-plugin__code",t.typeCustomCode="custom-code",t.commandNameCustomCode="custom-code:open-modal"},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},o=n({blockLabel:"Custom Code",blockCustomCode:{},propsCustomCode:{},placeholderContent:"Insert here your custom code",toolbarBtnCustomCode:{},placeholderScript:'
\n \n \n \n Custom code with <script> can\'t be rendered on the canvas\n
',modalTitle:"Insert your code",codeViewOptions:{},buttonLabel:"Save",commandCustomCode:{}},t);(0,r.default)(e,o),(0,i.default)(e,o),(0,s.default)(e,o)}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},o=e.DomComponents,i=o.getType("default"),s=i.model,d=t.toolbarBtnCustomCode,a=void 0;o.addType(r.typeCustomCode,{model:s.extend({defaults:n({},s.prototype.defaults,{name:"Custom Code",editable:!0},t.propsCustomCode),init:function(){this.listenTo(this,"change:"+r.keyCustomCode,this.onCustomCodeChange);var e=this.get(r.keyCustomCode)||t.placeholderContent;!this.components().length&&this.components(e);var o=this.get("toolbar"),i="custom-code";d&&!o.filter(function(e){return e.id===i}).length&&o.unshift(n({id:i,command:r.commandNameCustomCode,label:'\n \n '},d))},onCustomCodeChange:function(){this.components(this.get(r.keyCustomCode))}},{isComponent:function(){return!1}}),view:i.view.extend({events:{dblclick:"onActive"},init:function(){this.listenTo(this.model.components(),"add remove reset",this.onComponentsChange),this.onComponentsChange()},onComponentsChange:function(){var e=this;a&&clearInterval(a),a=setTimeout(function(){var o=e.model,n=1;(o.get(r.keyCustomCode)||"").indexOf("=0&&(e.el.innerHTML=t.placeholderScript,n=0),o.set({droppable:n})},0)},onActive:function(){var e=this.model;this.em.get("Commands").run(r.commandNameCustomCode,{target:e})}})})}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},o=e.BlockManager,i=t.blockCustomCode,s=t.blockLabel;i&&o.add(r.typeCustomCode,n({label:'\n \n \n
'+s+"
",category:"Extra",activate:!0,select:!0,content:{type:r.typeCustomCode}},i))}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},o=e.Commands,i=t.modalTitle,s=t.codeViewOptions,d=t.commandCustomCode,a=function(e,t){t instanceof HTMLElement?e.appendChild(t):t&&e.insertAdjacentHTML("beforeend",t)};o.add(r.commandNameCustomCode,n({keyCustomCode:r.keyCustomCode,run:function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.editor=e,this.options=o,this.target=o.target||e.getSelected();var n=this.target;n&&n.get("editable")&&this.showCustomCode(n)},stop:function(e){e.Modal.close()},showCustomCode:function(e){var t=this,o=this.editor,n=this.options.title||i,s=this.getContent(),d=e.get(r.keyCustomCode)||"";o.Modal.open({title:n,content:s}).getModel().once("change:open",function(){return o.stopCommand(t.id)}),this.getCodeViewer().setContent(d)},getPreContent:function(){},getPostContent:function(){},getContent:function(){var e=this.editor,t=document.createElement("div"),o=this.getCodeViewer(),n=e.getConfig("stylePrefix");return t.className=n+"custom-code",a(t,this.getPreContent()),t.appendChild(o.getElement()),a(t,this.getPostContent()),a(t,this.getContentActions()),o.refresh(),setTimeout(function(){return o.focus()},0),t},getContentActions:function(){var e=this,o=this.editor,n=document.createElement("button"),r=o.getConfig("stylePrefix");return n.innerHTML=t.buttonLabel,n.className=r+"btn-prim "+r+"btn-import__custom-code",n.onclick=function(){return e.handleSave()},n},handleSave:function(){var e=this.editor,t=this.target,o=this.getCodeViewer().getContent();t.set(r.keyCustomCode,o),e.Modal.close()},getCodeViewer:function(){var e=this.editor;return this.codeViewer||(this.codeViewer=e.CodeManager.createViewer(n({codeName:"htmlmixed",theme:"hopscotch",readOnly:0},s))),this.codeViewer}},d))}}])}); //# sourceMappingURL=grapesjs-custom-code.min.js.map \ No newline at end of file diff --git a/dist/grapesjs-custom-code.min.js.map b/dist/grapesjs-custom-code.min.js.map index 32c90a2..7ee5b54 100644 --- a/dist/grapesjs-custom-code.min.js.map +++ b/dist/grapesjs-custom-code.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://grapesjs-custom-code/webpack/universalModuleDefinition","webpack://grapesjs-custom-code/webpack/bootstrap","webpack://grapesjs-custom-code/./src/config.js","webpack://grapesjs-custom-code/./src/index.js","webpack://grapesjs-custom-code/external \"grapesjs\"","webpack://grapesjs-custom-code/./src/components.js","webpack://grapesjs-custom-code/./src/blocks.js","webpack://grapesjs-custom-code/./src/commands.js"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__2__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","keyCustomCode","typeCustomCode","commandNameCustomCode","grapesjs","plugins","add","editor","opts","arguments","length","undefined","options","blockLabel","blockCustomCode","propsCustomCode","placeholderContent","toolbarBtnCustomCode","placeholderScript","modalTitle","codeViewOptions","buttonLabel","commandCustomCode","_components2","default","_blocks2","_commands2","_config","dc","DomComponents","defaultType","getType","defaultModel","model","timedInterval","addType","extend","defaults","editable","init","this","listenTo","onCustomCodeChange","initialCode","components","toolbar","id","filter","tlb","unshift","_extends","command","label","isComponent","view","events","dblclick","onComponentsChange","_this","clearInterval","setTimeout","droppable","indexOf","el","innerHTML","set","onActive","target","em","run","bm","BlockManager","category","activate","select","content","type","cmd","Commands","appendToContent","HTMLElement","appendChild","insertAdjacentHTML","sender","getSelected","showCustomCode","stop","Modal","close","title","getContent","code","open","getCodeViewer","setContent","getPreContent","getPostContent","document","createElement","codeViewer","pfx","getConfig","className","getElement","getContentActions","refresh","focus","btn","onclick","handleSave","CodeManager","createViewer","codeName","theme","readOnly"],"mappings":";CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,EAAAG,QAAA,aACA,mBAAAC,eAAAC,IACAD,QAAA,YAAAJ,GACA,iBAAAC,QACAA,QAAA,wBAAAD,EAAAG,QAAA,aAEAJ,EAAA,wBAAAC,EAAAD,EAAA,UARA,CASCO,OAAA,SAAAC,GACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAT,QAGA,IAAAC,EAAAM,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAX,YAUA,OANAY,EAAAH,GAAAI,KAAAZ,EAAAD,QAA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OF,IAAIhE,gBAAe0F,GAC1BpF,EAAOgF,MAAMC,SAOfK,cA1FF,WA0FkB,IACNtF,EAAWiC,KAAXjC,OAWR,OATKiC,KAAK2D,aACR3D,KAAK2D,WAAa5F,EAAOuG,YAAYC,aAAnB7D,GAChB8D,SAAU,YACVC,MAAO,YACPC,SAAU,GACP9F,KAIAoB,KAAK2D,aAGX7E","file":"dist/grapesjs-custom-code.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"grapesjs\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"grapesjs\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"grapesjs-custom-code\"] = factory(require(\"grapesjs\"));\n\telse\n\t\troot[\"grapesjs-custom-code\"] = factory(root[\"grapesjs\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__2__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","const keyCustomCode = 'custom-code-plugin__code';\nconst typeCustomCode = 'custom-code';\nconst commandNameCustomCode = 'custom-code:open-modal';\n\nexport {\n keyCustomCode,\n typeCustomCode,\n commandNameCustomCode,\n}\n","import grapesjs from 'grapesjs';\nimport loadComponents from './components';\nimport loadBlocks from './blocks';\nimport loadCommands from './commands';\n\nexport default grapesjs.plugins.add('grapesjs-custom-code', (editor, opts = {}) => {\n const options = { ...{\n // Label of the custom code block\n blockLabel: 'Custom Code',\n\n // Object to extend the default custom code block, eg. { label: 'Custom Code', category: 'Extra', ... }.\n // Pass a falsy value to avoid adding the block\n blockCustomCode: {},\n\n // Object to extend the default custom code properties, eg. `{ name: 'Custom Code', droppable: false, ... }`\n propsCustomCode: {},\n\n // Initial content of the custom code component\n placeholderContent: 'Insert here your custom code',\n\n // Object to extend the default component's toolbar button for the code, eg. `{ label: '', attributes: { title: 'Open custom code' } }`\n // Pass a falsy value to avoid adding the button\n toolbarBtnCustomCode: {},\n\n // Content to show when the custom code contains `