From cc8cfb485fd1f6d81a15b73cc74827efaaee93bd Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 17 Feb 2021 01:12:46 +0100 Subject: [PATCH] Build --- dist/grapesjs-tabs.min.js | 4 ++-- dist/grapesjs-tabs.min.js.map | 2 +- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/grapesjs-tabs.min.js b/dist/grapesjs-tabs.min.js index 9affa0f..ab25901 100644 --- a/dist/grapesjs-tabs.min.js +++ b/dist/grapesjs-tabs.min.js @@ -1,3 +1,3 @@ -/*! grapesjs-tabs - 1.0.5 */ -!function(t,e){'object'==typeof exports&&'object'==typeof module?module.exports=e():'function'==typeof define&&define.amd?define([],e):'object'==typeof exports?exports["grapesjs-tabs"]=e():t["grapesjs-tabs"]=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){'undefined'!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:'Module'}),Object.defineProperty(t,'__esModule',{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&'object'==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,'default',{enumerable:!0,value:t}),2&e&&'string'!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,'a',e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){var r=n(2);t.exports=function(t,e){if(null==t)return{};var n,o,a=r(t,e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}},function(t,e){t.exports=function(t,e){if(null==t)return{};var n,r,o={},a=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}},function(t,e,n){"use strict";n.r(e);var r=n(0),o=n.n(r),a=n(1),c=n.n(a);function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e".concat(i(s),"")]},s.tabsProps),init:function(){this.findTabs().map(this.__onTab),this.listenTo(this.getTabContainerType().components(),'add',this.__onTab)},__onTab:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!n.avoidStore&&!n.temporary&&t.__initTab&&t.__initTab()},getTabContainerType:function(){return this.findType(a)[0]},getContentsType:function(){return this.findType(o)[0]||this},findTabs:function(){return this.findType(n)},findContents:function(){return this.findType(r)},addTab:function(t){this.getTabContainerType().append({type:n,components:t})}}})};function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function y(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},n=t.DomComponents,r=P(P({},e),{},{defaultModel:n.getType('default').model,editor:t});[b,u,d,v,h].map((function(t){return t(n,r)}))};function C(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var S=function(t,e){var n=e.tabsBlock,r=e.typeTabs,a=t.BlockManager;n&&a.add(r,function(t){for(var e=1;e\n \n \n ",label:'Tabs',content:{type:r}},n))},D={tabsBlock:{},tabsProps:{},tabContainerProps:{},tabProps:{},tabContentProps:{},tabContentsProps:{},classTab:'tab',classTabContainer:'tab-container',classTabActive:'tab-active',classTabContent:'tab-content',classTabContents:'tab-contents',selectorTab:'aria-controls',selectorTabPrev:'href',typeTabs:'tabs',typeTabContainer:'tab-container',typeTab:'tab',typeTabContent:'tab-content',typeTabContents:'tab-contents',templateTab:function(t){return'Tab'},templateTabContent:function(t){return'
Tab Content
'},style:function(t){return"\n .".concat(t.classTab," {\n padding: 7px 14px;\n display: inline-block;\n border-radius: 3px;\n margin-right: 10px;\n }\n\n .").concat(t.classTab,":focus {\n outline: none;\n }\n\n .").concat(t.classTab,".").concat(t.classTabActive," {\n background-color: #0d94e6;\n color: white;\n }\n\n .").concat(t.classTabContainer," {\n display: inline-block;\n }\n\n .").concat(t.classTabContent," {\n animation: fadeEffect 1s;\n }\n\n .").concat(t.classTabContents," {\n min-height: 100px;\n padding: 10px;\n }\n\n @keyframes fadeEffect {\n from {opacity: 0;}\n to {opacity: 1;}\n }\n ")}};function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},n=_(_({},D),e);w(t,n),S(t,n)}}])})); +/*! grapesjs-tabs - 1.0.6 */ +!function(t,e){'object'==typeof exports&&'object'==typeof module?module.exports=e():'function'==typeof define&&define.amd?define([],e):'object'==typeof exports?exports["grapesjs-tabs"]=e():t["grapesjs-tabs"]=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){'undefined'!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:'Module'}),Object.defineProperty(t,'__esModule',{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&'object'==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,'default',{enumerable:!0,value:t}),2&e&&'string'!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,'a',e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){var r=n(2);t.exports=function(t,e){if(null==t)return{};var n,o,a=r(t,e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}},function(t,e){t.exports=function(t,e){if(null==t)return{};var n,r,o={},a=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o}},function(t,e,n){"use strict";n.r(e);var r=n(0),o=n.n(r),a=n(1),c=n.n(a);function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e".concat(i(s),"")]},s.tabsProps),init:function(){this.findTabs().map(this.__onTab),this.listenTo(this.getTabContainerType().components(),'add',this.__onTab)},__onTab:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!n.avoidStore&&!n.temporary&&t.__initTab&&t.__initTab()},getTabContainerType:function(){return this.findType(a)[0]},getContentsType:function(){return this.findType(o)[0]||this},findTabs:function(){return this.findType(n)},findContents:function(){return this.findType(r)},addTab:function(t){this.getTabContainerType().append({type:n,components:t})}}})};function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function y(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},n=t.DomComponents,r=P(P({},e),{},{defaultModel:n.getType('default').model,editor:t});[b,u,d,j,T].map((function(t){return t(n,r)}))};function C(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var S=function(t,e){var n=e.tabsBlock,r=e.typeTabs,a=t.BlockManager;n&&a.add(r,function(t){for(var e=1;e\n \n \n ",label:'Tabs',content:{type:r}},n))},D={tabsBlock:{},tabsProps:{},tabContainerProps:{},tabProps:{},tabContentProps:{},tabContentsProps:{},classTab:'tab',classTabContainer:'tab-container',classTabActive:'tab-active',classTabContent:'tab-content',classTabContents:'tab-contents',selectorTab:'aria-controls',typeTabs:'tabs',typeTabContainer:'tab-container',typeTab:'tab',typeTabContent:'tab-content',typeTabContents:'tab-contents',templateTab:function(t){return'Tab'},templateTabContent:function(t){return'
Tab Content
'},style:function(t){return"\n .".concat(t.classTab," {\n padding: 7px 14px;\n display: inline-block;\n border-radius: 3px;\n margin-right: 10px;\n }\n\n .").concat(t.classTab,":focus {\n outline: none;\n }\n\n .").concat(t.classTab,".").concat(t.classTabActive," {\n background-color: #0d94e6;\n color: white;\n }\n\n .").concat(t.classTabContainer," {\n display: inline-block;\n }\n\n .").concat(t.classTabContent," {\n animation: fadeEffect 1s;\n }\n\n .").concat(t.classTabContents," {\n min-height: 100px;\n padding: 10px;\n }\n\n @keyframes fadeEffect {\n from {opacity: 0;}\n to {opacity: 1;}\n }\n ")}};function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},n=_(_({},D),e);w(t,n),S(t,n)}}])})); //# sourceMappingURL=grapesjs-tabs.min.js.map \ No newline at end of file diff --git a/dist/grapesjs-tabs.min.js.map b/dist/grapesjs-tabs.min.js.map index eb22b5a..bf5cbce 100644 --- a/dist/grapesjs-tabs.min.js.map +++ b/dist/grapesjs-tabs.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://grapesjs-tabs/webpack/universalModuleDefinition","webpack://grapesjs-tabs/webpack/bootstrap","webpack://grapesjs-tabs/./node_modules/@babel/runtime/helpers/defineProperty.js","webpack://grapesjs-tabs/./node_modules/@babel/runtime/helpers/objectWithoutProperties.js","webpack://grapesjs-tabs/./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","webpack://grapesjs-tabs/./src/components/Tab.js","webpack://grapesjs-tabs/./src/components/Tabs.js","webpack://grapesjs-tabs/./src/components/TabContent.js","webpack://grapesjs-tabs/./src/components/TabContents.js","webpack://grapesjs-tabs/./src/components/TabContainer.js","webpack://grapesjs-tabs/./src/components/index.js","webpack://grapesjs-tabs/./src/blocks.js","webpack://grapesjs-tabs/./src/options.js","webpack://grapesjs-tabs/./src/index.js"],"names":["root","factory","exports","module","define","amd","window","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","obj","configurable","writable","objectWithoutPropertiesLoose","source","excluded","target","getOwnPropertySymbols","sourceSymbolKeys","length","indexOf","propertyIsEnumerable","sourceKeys","keys","dc","defaultModel","typeTabs","selectorTab","config","editor","prvSel","selectorTabPrev","traits","full","type","label","text","command","ed","openSm","Panels","getButton","set","cls","classTab","classTabActive","StyleManager","setTarget","targetIsClass","addType","typeTab","model","defaults","draggable","typeTabContainer","attributes","role","components","templateTab","classes","tabProps","init","this","on","__onRemove","__initTab","tabContent","content","getTabContent","id","getTabsType","getContentsType","append","typeTabContent","templateTabContent","getId","tabId","addAttributes","hidden","remove","trigger","closestType","attrs","getAttributes","tabs","findContents","filter","clone","cloned","apply","arguments","typeTabContents","style","defTabs","map","classactive","selectortab","prevsel","script","props","hashId","qrStr","el","history","_isEditor","roleTab","document","body","location","matches","matchesSelector","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","each","items","clb","arr","getTabId","item","getAttribute","qS","elem","qs","querySelector","getAllTabs","querySelectorAll","upTabIdx","val","activeTab","tabEl","className","replace","trim","tabContentId","tabToActive","hash","att","addEventListener","ev","found","contains","getSelectedTab","__trg","preventDefault","pushState","e","sel","getSelected","addTab","tabsProps","findTabs","__onTab","listenTo","getTabContainerType","tab","v","opts","avoidStore","temporary","findType","copyable","removable","highlightable","classTabContent","tabContentProps","droppable","classTabContents","tabContentsProps","classTabContainer","tabContainerProps","DomComponents","getType","Tab","Tabs","TabContent","TabContents","TabContainer","tabsBlock","bm","BlockManager","add","media","options","defOptions","loadComponents","loadBlocks"],"mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAQ,iBAAmBD,IAE3BD,EAAK,iBAAmBC,IAR1B,CASGK,QAAQ,WACX,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUP,QAGnC,IAAIC,EAASI,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHT,QAAS,IAUV,OANAU,EAAQH,GAAUI,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASM,GAG/DL,EAAOQ,GAAI,EAGJR,EAAOD,QA0Df,OArD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AsB,IAAdgI,EAAc,uDAAP,GACvB0B,EAAU,OACXC,GACA3B,GAIL4B,EAAe5J,EAAQ0J,GAGvBG,EAAW7J,EAAQ0J","file":"grapesjs-tabs.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"grapesjs-tabs\"] = factory();\n\telse\n\t\troot[\"grapesjs-tabs\"] = factory();\n})(window, function() {\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 = 3);\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","var objectWithoutPropertiesLoose = require(\"./objectWithoutPropertiesLoose\");\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutProperties;","function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutPropertiesLoose;","export const role = 'tab';\n\nexport default (dc, {\n defaultModel, typeTabs, selectorTab, editor, ...config\n}) => {\n const prvSel = config.selectorTabPrev;\n const traits = [\n {\n full: 1,\n type: 'button',\n label: false,\n text: 'Style Active',\n command: (ed) => {\n const openSm = ed.Panels.getButton('views', 'open-sm');\n openSm && openSm.set('active', 1);\n const cls = `.${config.classTab}.${config.classTabActive}`;\n ed.StyleManager.setTarget(cls, { targetIsClass: 1 })\n },\n },\n ];\n\n dc.addType(config.typeTab, {\n model: {\n defaults: {\n name: 'Tab',\n draggable: `[data-gjs-type=\"${config.typeTabContainer}\"]`,\n attributes: { role },\n components: config.templateTab,\n classes: config.classTab,\n traits,\n ...config.tabProps\n },\n\n init() {\n this.on('removed', this.__onRemove);\n },\n\n __initTab() {\n if (this.tabContent) return;\n let content = this.getTabContent();\n\n // If the tab content was found I'll attach it to the tab model\n // otherwise I'll create e new one\n if (!content) {\n const tabs = this.getTabsType();\n const cnts = tabs.getContentsType();\n content = cnts.append({\n type: config.typeTabContent,\n components: config.templateTabContent(this),\n })[0];\n const id = content.getId();\n const tabId = this.getId();\n content.addAttributes({ id, 'aria-labelledby': tabId, hidden: true });\n this.addAttributes({ [selectorTab]: id, id: tabId });\n this.tabContent = content;\n }\n\n this.tabContent = content;\n },\n\n __onRemove() {\n const content = this.getTabContent();\n content && content.remove();\n this.getTabsType().trigger('rerender')\n },\n\n getTabsType() {\n return this.closestType(typeTabs);\n },\n\n getTabContent() {\n const attrs = this.getAttributes();\n const id = attrs[prvSel] || attrs[selectorTab];\n const tabs = this.getTabsType();\n if (!tabs || !id) return;\n const contents = tabs.findContents();\n return contents.filter(c => c.getId() == id)[0];\n },\n\n clone() {\n const cloned = defaultModel.prototype.clone.apply(this, arguments);\n cloned.addAttributes({ [selectorTab]: '' });\n return cloned;\n }\n },\n });\n}\n","export default (dc, {\n typeTab, typeTabContent, typeTabContents, typeTabContainer, style, ...config\n}) => {\n const type = config.typeTabs;\n\n const script = function(props) {\n const el = this;\n const classTabActive = props.classactive;\n const selectorTab = props.selectortab;\n const prevsel = props.prevsel;\n const { history, _isEditor } = window;\n const attrTabindex = 'tabIndex';\n const attrSelected = 'ariaSelected';\n const roleTab = '[role=tab]';\n const roleTabContent = '[role=tabpanel]';\n const { body, location } = document;\n const matches = body.matchesSelector || body.webkitMatchesSelector\n || body.mozMatchesSelector || body.msMatchesSelector;\n const each = (items, clb) => {\n const arr = items || [];\n for (let i = 0; i < arr.length; i++) clb(arr[i], i)\n }\n\n const hideContents = () => {\n each(el.querySelectorAll(roleTabContent), i => i.hidden = true);\n }\n\n const getTabId = (item) => {\n return (prevsel && item.getAttribute(prevsel)) || item.getAttribute(selectorTab);\n }\n\n const qS = (elem, qs) => elem.querySelector(qs);\n const getAllTabs = () => el.querySelectorAll(roleTab);\n const upTabIdx = (item, val) => !_isEditor && (item[attrTabindex] = val);\n\n const activeTab = (tabEl) => {\n each(getAllTabs(), (item) => {\n item.className = item.className.replace(classTabActive, '').trim();\n item[attrSelected] = 'false';\n upTabIdx(item, '-1');\n });\n hideContents();\n tabEl.className += ' ' + classTabActive;\n tabEl[attrSelected] = 'true';\n upTabIdx(tabEl, '0');\n const tabContentId = getTabId(tabEl);\n const tabContent = tabContentId && qS(el, `#${tabContentId}`);\n tabContent && (tabContent.hidden = false);\n };\n\n const getTabByHash = () => {\n const hashId = (location.hash || '').replace('#', '');\n const qrStr = att => `${roleTab}[${att}=${hashId}]`;\n return hashId && (qS(el, qrStr(prevsel)) || qS(el, qrStr(selectorTab)));\n };\n\n const getSelectedTab = (target) => {\n let found;\n each(getAllTabs(), (item) => {\n if (found) return;\n if (item.contains(target)) found = item;\n });\n return found;\n };\n\n let tabToActive = qS(el, `.${classTabActive}${roleTab}`);\n tabToActive = tabToActive || getTabByHash() || qS(el, roleTab);\n tabToActive && activeTab(tabToActive);\n\n el.addEventListener('click', (ev) => {\n let { target } = ev;\n let found = matches.call(target, roleTab);\n\n if (!found) {\n target = getSelectedTab(target);\n if (target) found = 1;\n }\n\n if (found && !ev.__trg && target.className.indexOf(classTabActive) < 0) {\n ev.preventDefault();\n ev.__trg = 1;\n activeTab(target);\n const id = getTabId(target);\n try {\n history && history.pushState(null, null, `#${id}`);\n } catch (e) {}\n }\n });\n };\n const defTabs = [1, 2, 3].map(i => ({ type: typeTab }));\n const traits = [\n {\n full: 1,\n type: 'button',\n label: false,\n text: 'Add Tab',\n command: ed => {\n const sel = ed.getSelected();\n sel && sel.addTab();\n },\n }\n ];\n\n dc.addType(type, {\n model: {\n defaults: {\n name: 'Tabs',\n classactive: config.classTabActive,\n selectortab: config.selectorTab,\n prevsel: config.selectorTabPrev,\n 'script-props': ['classactive', 'selectortab'],\n script,\n traits,\n components: [\n { type: typeTabContainer, components: defTabs },\n { type: typeTabContents },\n style && ``\n ],\n ...config.tabsProps\n },\n\n init() {\n this.findTabs().map(this.__onTab);\n this.listenTo(this.getTabContainerType().components(), 'add', this.__onTab);\n },\n\n __onTab(tab, v, opts = {}) {\n !opts.avoidStore && !opts.temporary && tab.__initTab && tab.__initTab();\n },\n\n getTabContainerType() {\n return this.findType(typeTabContainer)[0];\n },\n\n getContentsType() {\n return this.findType(typeTabContents)[0] || this;\n },\n\n findTabs() {\n return this.findType(typeTab);\n },\n\n findContents() {\n return this.findType(typeTabContent);\n },\n\n addTab(content) {\n const cnt = this.getTabContainerType();\n cnt.append({\n type: typeTab,\n components: content,\n });\n },\n },\n });\n}\n","export const role = 'tabpanel';\n\nexport default (dc, config) => {\n\n dc.addType(config.typeTabContent, {\n model: {\n defaults: {\n name: 'Tab Content',\n draggable: false,\n copyable: false,\n removable: false,\n highlightable: false,\n attributes: { role },\n classes: config.classTabContent,\n traits: [],\n ...config.tabContentProps\n },\n },\n });\n}\n","export default (dc, config) => {\n\n dc.addType(config.typeTabContents, {\n model: {\n defaults: {\n name: 'Tab Contents',\n draggable: false,\n droppable: false,\n copyable: false,\n removable: false,\n classes: config.classTabContents,\n ...config.tabContentsProps\n }\n },\n });\n}\n","export const role = 'tablist';\n\nexport default (dc, config) => {\n\n dc.addType(config.typeTabContainer, {\n model: {\n defaults: {\n name: 'Tab Container',\n draggable: `[data-gjs-type=\"${config.typeTabs}\"]`,\n droppable: `[data-gjs-type=\"${config.typeTab}\"]`,\n copyable: false,\n removable: false,\n highlightable: false,\n attributes: { role },\n classes: config.classTabContainer,\n ...config.tabContainerProps\n },\n },\n });\n}\n","import Tab from './Tab';\nimport Tabs from './Tabs';\nimport TabContent from './TabContent';\nimport TabContents from './TabContents';\nimport TabContainer from './TabContainer';\n\nexport default (editor, config = {}) => {\n const dc = editor.DomComponents;\n const opts = {\n ...config,\n defaultModel: dc.getType('default').model,\n editor,\n };\n\n [\n Tab,\n Tabs,\n TabContent,\n TabContents,\n TabContainer,\n ].map(c => c(dc, opts));\n}\n","export default (editor, { tabsBlock, typeTabs }) => {\n const bm = editor.BlockManager;\n\n tabsBlock && bm.add(typeTabs, {\n media: `\n \n \n \n `,\n label: 'Tabs',\n content: { type: typeTabs },\n ...tabsBlock\n });\n}\n","export default {\n // Object to extend the default tabs block, eg. `{ label: 'Tabs', attributes: { ... } }`\n // Pass a falsy value to avoid adding the block\n tabsBlock: {},\n\n // Object to extend the default tabs properties, eg. `{ name: 'My Tabs', droppable: false, ... }`\n tabsProps: {},\n\n // Object to extend the default tab container properties\n tabContainerProps: {},\n\n // Object to extend the default tab properties\n tabProps: {},\n\n // Object to extend the default tab content properties\n tabContentProps: {},\n\n // Object to extend the default tab contents properties\n tabContentsProps: {},\n\n // Default class to use on tab\n classTab: 'tab',\n\n // Default class to use on tab container\n classTabContainer: 'tab-container',\n\n // Class used on tabs when active\n classTabActive: 'tab-active',\n\n // Default class to use on tab content\n classTabContent: 'tab-content',\n\n // Default class to use on tab contents\n classTabContents: 'tab-contents',\n\n // The attribute used inside tabs as a selector for tab contents\n selectorTab: 'aria-controls',\n\n // Special option, used mainly to support previous plugin version\n selectorTabPrev: 'href',\n\n // Tabs component id\n typeTabs: 'tabs',\n\n // TabContainer component id\n typeTabContainer: 'tab-container',\n\n // Tab component id\n typeTab: 'tab',\n\n // TabContent component id\n typeTabContent: 'tab-content',\n\n // TabContents component id\n typeTabContents: 'tab-contents',\n\n // Default template for new tabs\n templateTab: tab => 'Tab',\n\n // Default template for new tab contents\n templateTabContent: tab => '
Tab Content
',\n\n // Default style for tabs\n style: (config) => `\n .${config.classTab} {\n padding: 7px 14px;\n display: inline-block;\n border-radius: 3px;\n margin-right: 10px;\n }\n\n .${config.classTab}:focus {\n outline: none;\n }\n\n .${config.classTab}.${config.classTabActive} {\n background-color: #0d94e6;\n color: white;\n }\n\n .${config.classTabContainer} {\n display: inline-block;\n }\n\n .${config.classTabContent} {\n animation: fadeEffect 1s;\n }\n\n .${config.classTabContents} {\n min-height: 100px;\n padding: 10px;\n }\n\n @keyframes fadeEffect {\n from {opacity: 0;}\n to {opacity: 1;}\n }\n `\n};","import loadComponents from './components/index';\nimport loadBlocks from './blocks';\nimport defOptions from './options';\n\nexport default (editor, opts = {}) => {\n const options = {\n ...defOptions,\n ...opts\n };\n\n // Add components\n loadComponents(editor, options);\n\n // Add blocks\n loadBlocks(editor, options);\n};\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://grapesjs-tabs/webpack/universalModuleDefinition","webpack://grapesjs-tabs/webpack/bootstrap","webpack://grapesjs-tabs/./node_modules/@babel/runtime/helpers/defineProperty.js","webpack://grapesjs-tabs/./node_modules/@babel/runtime/helpers/objectWithoutProperties.js","webpack://grapesjs-tabs/./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","webpack://grapesjs-tabs/./src/components/Tab.js","webpack://grapesjs-tabs/./src/components/Tabs.js","webpack://grapesjs-tabs/./src/components/TabContent.js","webpack://grapesjs-tabs/./src/components/TabContents.js","webpack://grapesjs-tabs/./src/components/TabContainer.js","webpack://grapesjs-tabs/./src/components/index.js","webpack://grapesjs-tabs/./src/blocks.js","webpack://grapesjs-tabs/./src/options.js","webpack://grapesjs-tabs/./src/index.js"],"names":["root","factory","exports","module","define","amd","window","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","obj","configurable","writable","objectWithoutPropertiesLoose","source","excluded","target","getOwnPropertySymbols","sourceSymbolKeys","length","indexOf","propertyIsEnumerable","sourceKeys","keys","dc","defaultModel","typeTabs","selectorTab","config","editor","traits","full","type","label","text","command","ed","openSm","Panels","getButton","set","cls","classTab","classTabActive","StyleManager","setTarget","targetIsClass","addType","typeTab","model","defaults","draggable","typeTabContainer","attributes","role","components","templateTab","classes","tabProps","init","this","on","__onRemove","__initTab","tabContent","content","getTabContent","id","getTabsType","getContentsType","append","typeTabContent","templateTabContent","getId","tabId","addAttributes","hidden","remove","trigger","closestType","getAttributes","tabs","findContents","filter","clone","cloned","apply","arguments","typeTabContents","style","defTabs","map","classactive","selectortab","script","props","att","hashId","el","history","_isEditor","roleTab","document","body","location","matches","matchesSelector","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","each","items","clb","arr","getTabId","item","getAttribute","qS","elem","qs","querySelector","getAllTabs","querySelectorAll","upTabIdx","val","activeTab","tabEl","className","replace","trim","tabContentId","tabToActive","hash","addEventListener","ev","found","contains","getSelectedTab","__trg","preventDefault","pushState","e","sel","getSelected","addTab","tabsProps","findTabs","__onTab","listenTo","getTabContainerType","tab","v","opts","avoidStore","temporary","findType","copyable","removable","highlightable","classTabContent","tabContentProps","droppable","classTabContents","tabContentsProps","classTabContainer","tabContainerProps","DomComponents","getType","Tab","Tabs","TabContent","TabContents","TabContainer","tabsBlock","bm","BlockManager","add","media","options","defOptions","loadComponents","loadBlocks"],"mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAQ,iBAAmBD,IAE3BD,EAAK,iBAAmBC,IAR1B,CASGK,QAAQ,WACX,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUP,QAGnC,IAAIC,EAASI,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHT,QAAS,IAUV,OANAU,EAAQH,GAAUI,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASM,GAG/DL,EAAOQ,GAAI,EAGJR,EAAOD,QA0Df,OArDAM,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASd,EAASe,EAAMC,GAC3CV,EAAoBW,EAAEjB,EAASe,IAClCG,OAAOC,eAAenB,EAASe,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAAStB,GACX,oBAAXuB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAenB,EAASuB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAenB,EAAS,aAAc,CAAEyB,OAAO,KAQvDnB,EAAoBoB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQnB,EAAoBmB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFAxB,EAAoBgB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA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S,MAGTuB,eAAgB,cAGhBiB,gBAAiB,eAGjBhC,YAAa,SAAA8F,GAAG,MAAI,mDAGpB9E,mBAAoB,SAAA8E,GAAG,MAAI,0BAG3B7D,MAAO,SAAC7D,GAAD,2BACAA,EAAOc,SADP,2KAQAd,EAAOc,SARP,uEAYAd,EAAOc,SAZP,YAYmBd,EAAOe,eAZ1B,wGAiBAf,EAAOwI,kBAjBP,yEAqBAxI,EAAOmI,gBArBP,4EAyBAnI,EAAOsI,iBAzBP,iM,ikBCxDI,mBAACrI,GAAsB,IAAd2H,EAAc,uDAAP,GACvB0B,EAAU,OACXC,GACA3B,GAIL4B,EAAevJ,EAAQqJ,GAGvBG,EAAWxJ,EAAQqJ","file":"grapesjs-tabs.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"grapesjs-tabs\"] = factory();\n\telse\n\t\troot[\"grapesjs-tabs\"] = factory();\n})(window, function() {\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 = 3);\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","var objectWithoutPropertiesLoose = require(\"./objectWithoutPropertiesLoose\");\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutProperties;","function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutPropertiesLoose;","export const role = 'tab';\n\nexport default (dc, {\n defaultModel, typeTabs, selectorTab, editor, ...config\n}) => {\n const traits = [\n {\n full: 1,\n type: 'button',\n label: false,\n text: 'Style Active',\n command: (ed) => {\n const openSm = ed.Panels.getButton('views', 'open-sm');\n openSm && openSm.set('active', 1);\n const cls = `.${config.classTab}.${config.classTabActive}`;\n ed.StyleManager.setTarget(cls, { targetIsClass: 1 })\n },\n },\n ];\n\n dc.addType(config.typeTab, {\n model: {\n defaults: {\n name: 'Tab',\n draggable: `[data-gjs-type=\"${config.typeTabContainer}\"]`,\n attributes: { role },\n components: config.templateTab,\n classes: config.classTab,\n traits,\n ...config.tabProps\n },\n\n init() {\n this.on('removed', this.__onRemove);\n },\n\n __initTab() {\n if (this.tabContent) return;\n let content = this.getTabContent();\n\n // If the tab content was found I'll attach it to the tab model\n // otherwise I'll create e new one\n if (!content) {\n const tabs = this.getTabsType();\n const cnts = tabs.getContentsType();\n content = cnts.append({\n type: config.typeTabContent,\n components: config.templateTabContent(this),\n })[0];\n const id = content.getId();\n const tabId = this.getId();\n content.addAttributes({ id, 'aria-labelledby': tabId, hidden: true });\n this.addAttributes({ [selectorTab]: id, id: tabId });\n this.tabContent = content;\n }\n\n this.tabContent = content;\n },\n\n __onRemove() {\n const content = this.getTabContent();\n content && content.remove();\n this.getTabsType().trigger('rerender')\n },\n\n getTabsType() {\n return this.closestType(typeTabs);\n },\n\n getTabContent() {\n const id = this.getAttributes()[selectorTab];\n const tabs = this.getTabsType();\n if (!tabs || !id) return;\n const contents = tabs.findContents();\n return contents.filter(c => c.getId() == id)[0];\n },\n\n clone() {\n const cloned = defaultModel.prototype.clone.apply(this, arguments);\n cloned.addAttributes({ [selectorTab]: '' });\n return cloned;\n }\n },\n });\n}\n","export default (dc, {\n typeTab, typeTabContent, typeTabContents, typeTabContainer, style, ...config\n}) => {\n const type = config.typeTabs;\n\n const script = function(props) {\n const el = this;\n const classTabActive = props.classactive;\n const selectorTab = props.selectortab;\n const { history, _isEditor } = window;\n const attrTabindex = 'tabIndex';\n const attrSelected = 'ariaSelected';\n const roleTab = '[role=tab]';\n const roleTabContent = '[role=tabpanel]';\n const { body, location } = document;\n const matches = body.matchesSelector || body.webkitMatchesSelector\n || body.mozMatchesSelector || body.msMatchesSelector;\n const each = (items, clb) => {\n const arr = items || [];\n for (let i = 0; i < arr.length; i++) clb(arr[i], i)\n }\n\n const hideContents = () => {\n each(el.querySelectorAll(roleTabContent), i => i.hidden = true);\n }\n\n const getTabId = item => item.getAttribute(selectorTab)\n const qS = (elem, qs) => elem.querySelector(qs);\n const getAllTabs = () => el.querySelectorAll(roleTab);\n const upTabIdx = (item, val) => !_isEditor && (item[attrTabindex] = val);\n\n const activeTab = (tabEl) => {\n each(getAllTabs(), (item) => {\n item.className = item.className.replace(classTabActive, '').trim();\n item[attrSelected] = 'false';\n upTabIdx(item, '-1');\n });\n hideContents();\n tabEl.className += ' ' + classTabActive;\n tabEl[attrSelected] = 'true';\n upTabIdx(tabEl, '0');\n const tabContentId = getTabId(tabEl);\n const tabContent = tabContentId && qS(el, `#${tabContentId}`);\n tabContent && (tabContent.hidden = false);\n };\n\n const getTabByHash = () => {\n const hashId = (location.hash || '').replace('#', '');\n const qrStr = att => `${roleTab}[${att}=${hashId}]`;\n return hashId && qS(el, qrStr(selectorTab));\n };\n\n const getSelectedTab = (target) => {\n let found;\n each(getAllTabs(), (item) => {\n if (found) return;\n if (item.contains(target)) found = item;\n });\n return found;\n };\n\n let tabToActive = qS(el, `.${classTabActive}${roleTab}`);\n tabToActive = tabToActive || getTabByHash() || qS(el, roleTab);\n tabToActive && activeTab(tabToActive);\n\n el.addEventListener('click', (ev) => {\n let { target } = ev;\n let found = matches.call(target, roleTab);\n\n if (!found) {\n target = getSelectedTab(target);\n if (target) found = 1;\n }\n\n if (found && !ev.__trg && target.className.indexOf(classTabActive) < 0) {\n ev.preventDefault();\n ev.__trg = 1;\n activeTab(target);\n const id = getTabId(target);\n try {\n history && history.pushState(null, null, `#${id}`);\n } catch (e) {}\n }\n });\n };\n const defTabs = [1, 2, 3].map(i => ({ type: typeTab }));\n const traits = [\n {\n full: 1,\n type: 'button',\n label: false,\n text: 'Add Tab',\n command: ed => {\n const sel = ed.getSelected();\n sel && sel.addTab();\n },\n }\n ];\n\n dc.addType(type, {\n model: {\n defaults: {\n name: 'Tabs',\n classactive: config.classTabActive,\n selectortab: config.selectorTab,\n 'script-props': ['classactive', 'selectortab'],\n script,\n traits,\n components: [\n { type: typeTabContainer, components: defTabs },\n { type: typeTabContents },\n style && ``\n ],\n ...config.tabsProps\n },\n\n init() {\n this.findTabs().map(this.__onTab);\n this.listenTo(this.getTabContainerType().components(), 'add', this.__onTab);\n },\n\n __onTab(tab, v, opts = {}) {\n !opts.avoidStore && !opts.temporary && tab.__initTab && tab.__initTab();\n },\n\n getTabContainerType() {\n return this.findType(typeTabContainer)[0];\n },\n\n getContentsType() {\n return this.findType(typeTabContents)[0] || this;\n },\n\n findTabs() {\n return this.findType(typeTab);\n },\n\n findContents() {\n return this.findType(typeTabContent);\n },\n\n addTab(content) {\n const cnt = this.getTabContainerType();\n cnt.append({\n type: typeTab,\n components: content,\n });\n },\n },\n });\n}\n","export const role = 'tabpanel';\n\nexport default (dc, config) => {\n\n dc.addType(config.typeTabContent, {\n model: {\n defaults: {\n name: 'Tab Content',\n draggable: false,\n copyable: false,\n removable: false,\n highlightable: false,\n attributes: { role },\n classes: config.classTabContent,\n traits: [],\n ...config.tabContentProps\n },\n },\n });\n}\n","export default (dc, config) => {\n\n dc.addType(config.typeTabContents, {\n model: {\n defaults: {\n name: 'Tab Contents',\n draggable: false,\n droppable: false,\n copyable: false,\n removable: false,\n classes: config.classTabContents,\n ...config.tabContentsProps\n }\n },\n });\n}\n","export const role = 'tablist';\n\nexport default (dc, config) => {\n\n dc.addType(config.typeTabContainer, {\n model: {\n defaults: {\n name: 'Tab Container',\n draggable: `[data-gjs-type=\"${config.typeTabs}\"]`,\n droppable: `[data-gjs-type=\"${config.typeTab}\"]`,\n copyable: false,\n removable: false,\n highlightable: false,\n attributes: { role },\n classes: config.classTabContainer,\n ...config.tabContainerProps\n },\n },\n });\n}\n","import Tab from './Tab';\nimport Tabs from './Tabs';\nimport TabContent from './TabContent';\nimport TabContents from './TabContents';\nimport TabContainer from './TabContainer';\n\nexport default (editor, config = {}) => {\n const dc = editor.DomComponents;\n const opts = {\n ...config,\n defaultModel: dc.getType('default').model,\n editor,\n };\n\n [\n Tab,\n Tabs,\n TabContent,\n TabContents,\n TabContainer,\n ].map(c => c(dc, opts));\n}\n","export default (editor, { tabsBlock, typeTabs }) => {\n const bm = editor.BlockManager;\n\n tabsBlock && bm.add(typeTabs, {\n media: `\n \n \n \n `,\n label: 'Tabs',\n content: { type: typeTabs },\n ...tabsBlock\n });\n}\n","export default {\n // Object to extend the default tabs block, eg. `{ label: 'Tabs', attributes: { ... } }`\n // Pass a falsy value to avoid adding the block\n tabsBlock: {},\n\n // Object to extend the default tabs properties, eg. `{ name: 'My Tabs', droppable: false, ... }`\n tabsProps: {},\n\n // Object to extend the default tab container properties\n tabContainerProps: {},\n\n // Object to extend the default tab properties\n tabProps: {},\n\n // Object to extend the default tab content properties\n tabContentProps: {},\n\n // Object to extend the default tab contents properties\n tabContentsProps: {},\n\n // Default class to use on tab\n classTab: 'tab',\n\n // Default class to use on tab container\n classTabContainer: 'tab-container',\n\n // Class used on tabs when active\n classTabActive: 'tab-active',\n\n // Default class to use on tab content\n classTabContent: 'tab-content',\n\n // Default class to use on tab contents\n classTabContents: 'tab-contents',\n\n // The attribute used inside tabs as a selector for tab contents\n selectorTab: 'aria-controls',\n\n // Tabs component id\n typeTabs: 'tabs',\n\n // TabContainer component id\n typeTabContainer: 'tab-container',\n\n // Tab component id\n typeTab: 'tab',\n\n // TabContent component id\n typeTabContent: 'tab-content',\n\n // TabContents component id\n typeTabContents: 'tab-contents',\n\n // Default template for new tabs\n templateTab: tab => 'Tab',\n\n // Default template for new tab contents\n templateTabContent: tab => '
Tab Content
',\n\n // Default style for tabs\n style: (config) => `\n .${config.classTab} {\n padding: 7px 14px;\n display: inline-block;\n border-radius: 3px;\n margin-right: 10px;\n }\n\n .${config.classTab}:focus {\n outline: none;\n }\n\n .${config.classTab}.${config.classTabActive} {\n background-color: #0d94e6;\n color: white;\n }\n\n .${config.classTabContainer} {\n display: inline-block;\n }\n\n .${config.classTabContent} {\n animation: fadeEffect 1s;\n }\n\n .${config.classTabContents} {\n min-height: 100px;\n padding: 10px;\n }\n\n @keyframes fadeEffect {\n from {opacity: 0;}\n to {opacity: 1;}\n }\n `\n};","import loadComponents from './components/index';\nimport loadBlocks from './blocks';\nimport defOptions from './options';\n\nexport default (editor, opts = {}) => {\n const options = {\n ...defOptions,\n ...opts\n };\n\n // Add components\n loadComponents(editor, options);\n\n // Add blocks\n loadBlocks(editor, options);\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index f93cd62..79000e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "grapesjs-tabs", - "version": "1.0.5", + "version": "1.0.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6b34fb2..923d1a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grapesjs-tabs", - "version": "1.0.5", + "version": "1.0.6", "description": "Simple tabs component plugin for GrapesJS", "main": "dist/grapesjs-tabs.min.js", "scripts": {