grapesjs-tooltip
Advanced tools
Comparing version 0.1.2 to 0.1.5
@@ -1,3 +0,3 @@ | ||
/*! grapesjs-tooltip - 0.1.2 */ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["grapesjs-tooltip"]=e():t["grapesjs-tooltip"]=e()}(window,function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},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 o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},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=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},r=i(n(1)),a=i(n(2));function i(t){return t&&t.__esModule?t:{default:t}}e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=o({id:"tooltip",labelTooltip:"Tooltip",blockTooltip:{},propsTooltip:{},extendTraits:function(t){return t},attrTooltip:"data-tooltip",classTooltip:"tooltip-component",style:"",styleAdditional:"",privateClasses:1,stylableTooltip:["background-color","padding","padding-top","padding-right","padding-bottom","padding-left","font-family","font-size","font-weight","letter-spacing","color","line-height","text-align","border-radius","border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius","border","border-width","border-style","border-color"],showTooltipOnStyle:1},e);(0,r.default)(t,n),(0,a.default)(t,n)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t};e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.DomComponents,r=n.getType("default"),a=r.model,i=r.view,l=t.CssComposer,s=e.id,u=e.labelTooltip,f=e.propsTooltip,p=e.attrTooltip,d=e.classTooltip,c=e.style,m=e.styleAdditional,b=e.privateClasses,g=e.stylableTooltip,v=e.showTooltipOnStyle,h=e.extendTraits,y=d+"__body",x=d+"--empty",w=p+"-visible",T=p+"-pos",O=p+"-length";b&&t.SelectorManager.getAll().add([{private:1,name:d},{private:1,name:y},{private:1,name:x}]),v&&t.on("styleManager:update:target",function(e){var n=t.getSelected();if(n){var o=n.getEl();n.is(s)&&!n.getTrait(w).getTargetValue()&&e.getSelectors().getFullString().trim()=="."+y&&(o.setAttribute(w,"true"),t.once("styleManager:update:target",function(){o.removeAttribute(w)}))}});n.addType(s,{model:a.extend({defaults:o({},a.prototype.defaults,{name:u,classes:[d],attributes:function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},p,u),"style-signature":["["+p,"."+d],traits:h([{name:p,label:"Text"},{name:T,label:"Position",type:"select",options:[{value:"top",name:"Top"},{value:"right",name:"Right"},{value:"bottom",name:"Bottom"},{value:"left",name:"Left"}]},{name:O,label:"Lenght",type:"select",options:[{value:"",name:"One line"},{value:"small",name:"Small"},{value:"medium",name:"Medium"},{value:"large",name:"Large"},{value:"fit",name:"Fit"}]},{name:w,label:"Visible",type:"checkbox",valueTrue:"true"},{name:"style-tooltip",labelButton:"Style tooltip",type:"button",full:1,command:function(t,e){var n=t.Panels.getButton("views","open-sm");n&&n.set("active",1),t.StyleManager.setTarget("."+y,{targetIsClass:1,stylable:g})}}])},f),init:function(){this.listenTo(this.components(),"add remove",this.checkEmpty),this.checkEmpty()},checkEmpty:function(){this[!this.components().length?"addClass":"removeClass"](""+x)}},{isComponent:function(t){if(t.hasAttribute&&t.hasAttribute(p))return{type:s}}}),view:i.extend({init:function(){!l.getClassRule(d)&&function(){var t=c||"\n ."+d+" {\n position: relative;\n display: inline-block;\n vertical-align: top;\n }\n\n ."+x+" {\n width: 50px;\n height: 50px;\n }\n\n ."+y+",\n ["+p+"]::after {\n font-family: Helvetica, sans-serif;\n background: rgba(55, 61, 73, 0.95);\n border-radius: 3px;\n bottom: 100%;\n color: #fff;\n content: attr("+p+");\n display: block;\n font-size: 12px;\n left: 50%;\n line-height: normal;\n max-width: 32rem;\n opacity: 0;\n overflow: hidden;\n padding: 8px 16px;\n pointer-events: none;\n position: absolute;\n text-overflow: ellipsis;\n transform: translate(-50%, 0);\n transition: opacity 0.25s, transform 0.25s;\n white-space: nowrap;\n box-sizing: border-box;\n z-index: 10;\n }\n\n ["+w+"=true]::after,\n ["+p+"]:focus::after,\n ["+p+"]:hover::after {\n opacity: 1;\n transform: translate(-50%, -0.5rem);\n }\n\n ["+T+"=right]::after {\n bottom: 50%;\n left: 100%;\n transform: translate(0, 50%);\n }\n\n ["+T+"=right]:focus::after,\n ["+T+"=right]:hover::after,\n ["+w+"=true]["+T+"=right]::after {\n transform: translate(0.5rem, 50%);\n }\n\n ["+T+"=bottom]::after {\n bottom: auto;\n top: 100%;\n transform: translate(-50%, 0);\n }\n\n ["+T+"=bottom]:focus::after,\n ["+T+"=bottom]:hover::after,\n ["+w+"=true]["+T+"=bottom]::after {\n transform: translate(-50%, 0.5rem);\n }\n\n ["+T+"=left]::after {\n bottom: 50%;\n left: auto;\n right: 100%;\n transform: translate(0, 50%);\n }\n\n ["+T+"=left]:focus::after,\n ["+T+"=left]:hover::after,\n ["+w+"=true]["+T+"=left]::after {\n transform: translate(-0.5rem, 50%);\n }\n\n ["+O+"=small]::after {\n white-space: normal;\n width: 80px;\n }\n\n ["+O+"=medium]::after {\n white-space: normal;\n width: 150px;\n }\n\n ["+O+"=large]::after {\n white-space: normal;\n width: 300px;\n }\n\n ["+O+"=fit]::after {\n white-space: normal;\n width: 100%;\n }\n\n // IE 11 bugfix\n button["+p+"] {\n overflow: visible;\n }\n ";l.getAll().add(t+m)}()}})})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t};e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.blockTooltip,r=e.labelTooltip,a=e.id;n&&t.BlockManager.add(a,o({label:'<svg viewBox="0 0 24 24">\n <path d="M4 2h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2h-4l-4 4-4-4H4c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4z"></path>\n </svg>\n <div>'+r+"</div>",category:"Extra",select:!0,content:{type:a}},n))}}])}); | ||
/*! grapesjs-tooltip - 0.1.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-tooltip"]=e():t["grapesjs-tooltip"]=e()}(window,function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},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 o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},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=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},r=i(n(1)),a=i(n(2));function i(t){return t&&t.__esModule?t:{default:t}}e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=o({id:"tooltip",labelTooltip:"Tooltip",blockTooltip:{},propsTooltip:{},extendTraits:function(t){return t},attrTooltip:"data-tooltip",classTooltip:"tooltip-component",style:"",styleAdditional:"",privateClasses:1,stylableTooltip:["background-color","padding","padding-top","padding-right","padding-bottom","padding-left","font-family","font-size","font-weight","letter-spacing","color","line-height","text-align","border-radius","border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius","border","border-width","border-style","border-color"],showTooltipOnStyle:1},e);(0,r.default)(t,n),(0,a.default)(t,n)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t};e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.DomComponents,r=n.getType("default"),a=r.model,i=r.view,l=t.CssComposer,s=e.id,u=e.labelTooltip,f=e.propsTooltip,p=e.attrTooltip,d=e.classTooltip,c=e.style,m=e.styleAdditional,b=e.privateClasses,g=e.stylableTooltip,v=e.showTooltipOnStyle,h=e.extendTraits,y=d+"__body",x=d+"--empty",w=p+"-visible",T=p+"-pos",O=p+"-length";b&&t.SelectorManager.getAll().add([{private:1,name:d},{private:1,name:y},{private:1,name:x}]),v&&t.on("styleManager:update:target",function(e){var n=t.getSelected();if(n){var o=n.getEl();n.is(s)&&!n.getTrait(w).getTargetValue()&&e.getSelectors().getFullString().trim()=="."+y&&(o.setAttribute(w,"true"),t.once("styleManager:update:target",function(){o.removeAttribute(w)}))}});n.addType(s,{model:a.extend({defaults:o({},a.prototype.defaults,{name:u,classes:[d],attributes:function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},p,u),"style-signature":["["+p,"."+d],traits:h([{name:p,label:"Text"},{name:T,label:"Position",type:"select",options:[{value:"top",name:"Top"},{value:"right",name:"Right"},{value:"bottom",name:"Bottom"},{value:"left",name:"Left"}]},{name:O,label:"Length",type:"select",options:[{value:"",name:"One line"},{value:"small",name:"Small"},{value:"medium",name:"Medium"},{value:"large",name:"Large"},{value:"fit",name:"Fit"}]},{name:w,label:"Visible",type:"checkbox",valueTrue:"true"},{name:"style-tooltip",labelButton:"Style tooltip",type:"button",full:1,command:function(t,e){var n=t.Panels.getButton("views","open-sm");n&&n.set("active",1),t.StyleManager.setTarget("."+y,{targetIsClass:1,stylable:g})}}])},f),init:function(){this.listenTo(this.components(),"add remove",this.checkEmpty),this.checkEmpty()},checkEmpty:function(){this[!this.components().length?"addClass":"removeClass"](""+x)}},{isComponent:function(t){if(t.hasAttribute&&t.hasAttribute(p))return{type:s}}}),view:i.extend({init:function(){!l.getClassRule(d)&&function(){var t=c||"\n ."+d+" {\n position: relative;\n display: inline-block;\n vertical-align: top;\n }\n\n ."+x+" {\n width: 50px;\n height: 50px;\n }\n\n ."+y+",\n ["+p+"]::after {\n font-family: Helvetica, sans-serif;\n background: rgba(55, 61, 73, 0.95);\n border-radius: 3px;\n bottom: 100%;\n color: #fff;\n content: attr("+p+");\n display: block;\n font-size: 12px;\n left: 50%;\n line-height: normal;\n max-width: 32rem;\n opacity: 0;\n overflow: hidden;\n padding: 8px 16px;\n pointer-events: none;\n position: absolute;\n text-overflow: ellipsis;\n transform: translate(-50%, 0);\n transition: opacity 0.25s, transform 0.25s;\n white-space: nowrap;\n box-sizing: border-box;\n z-index: 10;\n }\n\n ["+w+"=true]::after,\n ["+p+"]:focus::after,\n ["+p+"]:hover::after {\n opacity: 1;\n transform: translate(-50%, -0.5rem);\n }\n\n ["+T+"=right]::after {\n bottom: 50%;\n left: 100%;\n transform: translate(0, 50%);\n }\n\n ["+T+"=right]:focus::after,\n ["+T+"=right]:hover::after,\n ["+w+"=true]["+T+"=right]::after {\n transform: translate(0.5rem, 50%);\n }\n\n ["+T+"=bottom]::after {\n bottom: auto;\n top: 100%;\n transform: translate(-50%, 0);\n }\n\n ["+T+"=bottom]:focus::after,\n ["+T+"=bottom]:hover::after,\n ["+w+"=true]["+T+"=bottom]::after {\n transform: translate(-50%, 0.5rem);\n }\n\n ["+T+"=left]::after {\n bottom: 50%;\n left: auto;\n right: 100%;\n transform: translate(0, 50%);\n }\n\n ["+T+"=left]:focus::after,\n ["+T+"=left]:hover::after,\n ["+w+"=true]["+T+"=left]::after {\n transform: translate(-0.5rem, 50%);\n }\n\n ["+O+"=small]::after {\n white-space: normal;\n width: 80px;\n }\n\n ["+O+"=medium]::after {\n white-space: normal;\n width: 150px;\n }\n\n ["+O+"=large]::after {\n white-space: normal;\n width: 300px;\n }\n\n ["+O+"=fit]::after {\n white-space: normal;\n width: 100%;\n }\n\n // IE 11 bugfix\n button["+p+"] {\n overflow: visible;\n }\n ";l.getAll().add(t+m)}()}})})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t};e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.blockTooltip,r=e.labelTooltip,a=e.id;n&&t.BlockManager.add(a,o({label:'<svg viewBox="0 0 24 24">\n <path d="M4 2h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2h-4l-4 4-4-4H4c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4z"></path>\n </svg>\n <div>'+r+"</div>",category:"Extra",select:!0,content:{type:a}},n))}}])}); | ||
//# sourceMappingURL=grapesjs-tooltip.min.js.map |
{ | ||
"name": "grapesjs-tooltip", | ||
"version": "0.1.2", | ||
"version": "0.1.5", | ||
"description": "GrapesJS Tooltip component", | ||
@@ -5,0 +5,0 @@ "main": "dist/grapesjs-tooltip.min.js", |
@@ -192,3 +192,3 @@ export default (editor, opts = {}) => { | ||
name: attrTooltipLen, | ||
label: 'Lenght', | ||
label: 'Length', | ||
type: 'select', | ||
@@ -195,0 +195,0 @@ options: [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package