{"size": 4010, "ext": "js", "max_stars_repo_path": "build/es5-amd/node_modules/@lrnwebcomponents/place-holder/place-holder.js", "max_stars_repo_name": "ChristianMurphy/HAXcms", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "build/es5-amd/node_modules/@lrnwebcomponents/place-holder/place-holder.js", "max_issues_repo_name": "ChristianMurphy/HAXcms", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "build/es5-amd/node_modules/@lrnwebcomponents/place-holder/place-holder.js", "max_forks_repo_name": "ChristianMurphy/HAXcms", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 4010.0, "max_line_length": 4010, "alphanum_fraction": 0.7251870324}
define(["exports","../../@polymer/polymer/polymer-legacy.js","../../@polymer/iron-icons/iron-icons.js","../../@polymer/iron-icons/editor-icons.js","../../@polymer/iron-icons/notification-icons.js","../../@polymer/iron-icons/av-icons.js","../../@polymer/iron-icons/device-icons.js","../../@polymer/iron-icons/image-icons.js","../simple-colors/simple-colors.js","../hax-body-behaviors/lib/HAXWiring.js"],function(_exports,_polymerLegacy){"use strict";Object.defineProperty(_exports,"__esModule",{value:!0});_exports.PlaceHolder=void 0;function _templateObject_fb3a974056d311e99e8143b72aec9f54(){var data=babelHelpers.taggedTemplateLiteral(["\n    <style include=\"simple-colors\">\n      :host {\n        display: block;\n        border: none;\n        transition: 0.2s all linear;\n      }\n      :host([drag-over]) {\n        border: 4px dashed #2196f3;\n      }\n      .placeholder-inner {\n        text-align: center;\n        padding: 16px;\n        color: var(--simple-colors-default-theme-grey-11, #222222);\n        background-color: var(--simple-colors-default-theme-grey-2, #eeeeee);\n      }\n      iron-icon.placeholder-icon {\n        margin: 0 auto;\n        width: 50%;\n        height: 50%;\n        display: block;\n      }\n      .placeholder-text {\n        line-height: 24px;\n        font-size: 24px;\n        font-style: italic;\n      }\n    </style>\n    <div class=\"placeholder-inner\">\n      <iron-icon icon=\"[[iconFromType]]\" class=\"placeholder-icon\"></iron-icon>\n      <span class=\"placeholder-text\">[[calcText]]</span>\n    </div>\n  "]);_templateObject_fb3a974056d311e99e8143b72aec9f54=function(){return data};return data}var PlaceHolder=(0,_polymerLegacy.Polymer)({_template:(0,_polymerLegacy.html)(_templateObject_fb3a974056d311e99e8143b72aec9f54()),is:"place-holder",behaviors:[HAXBehaviors.PropertiesBehaviors],listeners:{dblclick:"fireReplaceEvent"},properties:{iconFromType:{type:String,computed:"_getIconFromType(type, dragOver)"},text:{type:String,value:""},calcText:{type:String,computed:"_getCalcText(text, type, dragOver)"},type:{type:String,value:"text"},dragOver:{type:Boolean,value:!1,reflectToAttribute:!0}},fireReplaceEvent:function fireReplaceEvent(){this.fire("place-holder-replace",this.type)},_getCalcText:function _getCalcText(text,type,dragOver){if(dragOver){return"Upload file"}else if(""===text){return"Place holder for "+type+"."}else{return text}},_getIconFromType:function _getIconFromType(type,dragOver){if(!dragOver){switch(type){case"document":return"editor:insert-drive-file";break;case"audio":return"av:music-video";break;case"video":return"notification:ondemand-video";break;case"image":return"image:crop-original";break;case"math":return"editor:functions";break;case"text":default:return"editor:format-align-left";break;}}else{return"icons:file-upload"}},attached:function attached(){this.addEventListener("dragover",function(e){this.dragOver=!0;e.preventDefault();e.stopPropagation();this.classList.add("dragover")});this.addEventListener("dragleave",function(e){this.dragOver=!1;e.preventDefault();e.stopPropagation();this.classList.remove("dragover")});this.addEventListener("drop",function(e){this.dragOver=!1;e.preventDefault();e.stopPropagation();this.classList.remove("dragover");try{if("file"===e.dataTransfer.items[0].kind){e.placeHolderElement=this;this.fire("place-holder-file-drop",e)}}catch(e){}});this.setHaxProperties({canScale:!0,canPosition:!0,canEditSource:!1,gizmo:{title:"Placeholder",description:"A place holder that can be converted into the media type that's been selected",icon:"image:transform",color:"grey",groups:["Placeholder"],handles:[],meta:{author:"LRNWebComponents"}},settings:{quick:[],configure:[{property:"type",title:"Type",description:"Type of gizmo that this accepts for replacement.",inputMethod:"select",options:{text:"Text / content",document:"Document / file",audio:"Audio",video:"Video",image:"Image",math:"Math"}}],advanced:[]},saveOptions:{wipeSlot:!0}})}});_exports.PlaceHolder=PlaceHolder});