@stratusjs/angular 0.2.82 → 0.2.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/package.json +1 -1
  2. package/src/base/base.component.js +2 -3
  3. package/src/base/base.component.js.map +1 -1
  4. package/src/base/base.component.min.js +1 -1
  5. package/src/base/base.component.ts +1 -2
  6. package/src/changeset-viewer/changeset-viewer-dialog.component.js +6 -4
  7. package/src/changeset-viewer/changeset-viewer-dialog.component.js.map +1 -1
  8. package/src/changeset-viewer/changeset-viewer-dialog.component.min.js +1 -1
  9. package/src/changeset-viewer/changeset-viewer.component.js +3 -4
  10. package/src/changeset-viewer/changeset-viewer.component.js.map +1 -1
  11. package/src/changeset-viewer/changeset-viewer.component.min.js +1 -1
  12. package/src/confirm-dialog/confirm-dialog.component.js +6 -4
  13. package/src/confirm-dialog/confirm-dialog.component.js.map +1 -1
  14. package/src/confirm-dialog/confirm-dialog.component.min.js +1 -1
  15. package/src/confirm-dialog/confirm-dialog.component.ts +2 -2
  16. package/src/editor/code-view-dialog.component.js +4 -4
  17. package/src/editor/code-view-dialog.component.js.map +1 -1
  18. package/src/editor/code-view-dialog.component.min.js +1 -1
  19. package/src/editor/code-view-dialog.component.ts +3 -6
  20. package/src/editor/editor.component.js +20 -14
  21. package/src/editor/editor.component.js.map +1 -1
  22. package/src/editor/editor.component.min.js +1 -1
  23. package/src/editor/editor.component.ts +38 -15
  24. package/src/editor/media-dialog.component.html +8 -8
  25. package/src/editor/media-dialog.component.js +4 -4
  26. package/src/editor/media-dialog.component.js.map +1 -1
  27. package/src/editor/media-dialog.component.min.html +4 -4
  28. package/src/editor/media-dialog.component.min.js +1 -1
  29. package/src/editor/media-dialog.component.ts +3 -6
  30. package/src/media-selector/media-selector-vanilla.component.html +7 -7
  31. package/src/media-selector/media-selector-vanilla.component.min.html +1 -1
  32. package/src/media-selector/media-selector.component.css +29 -45
  33. package/src/media-selector/media-selector.component.css.map +1 -1
  34. package/src/media-selector/media-selector.component.html +5 -5
  35. package/src/media-selector/media-selector.component.js +14 -18
  36. package/src/media-selector/media-selector.component.js.map +1 -1
  37. package/src/media-selector/media-selector.component.min.css +1 -1
  38. package/src/media-selector/media-selector.component.min.html +2 -2
  39. package/src/media-selector/media-selector.component.min.js +1 -1
  40. package/src/media-selector/media-selector.component.scss +23 -21
  41. package/src/media-selector/media-selector.component.ts +13 -13
  42. package/src/media-selector/media-selector.horizontal.component.html +5 -5
  43. package/src/media-selector/media-selector.horizontal.component.min.html +2 -2
  44. package/src/selector/selector-autocomplete.component.html +2 -2
  45. package/src/selector/selector-autocomplete.component.min.html +1 -1
  46. package/src/selector/selector.component.css +16 -16
  47. package/src/selector/selector.component.css.map +1 -1
  48. package/src/selector/selector.component.html +7 -7
  49. package/src/selector/selector.component.js +6 -6
  50. package/src/selector/selector.component.js.map +1 -1
  51. package/src/selector/selector.component.min.css +1 -1
  52. package/src/selector/selector.component.min.html +1 -1
  53. package/src/selector/selector.component.min.js +1 -1
  54. package/src/selector/selector.component.scss +5 -5
  55. package/src/selector/selector.component.ts +6 -4
  56. package/src/test/test.directive.js.map +1 -1
  57. package/src/test/test.directive.ts +0 -1
  58. package/src/tree/tree-dialog.component.html +2 -2
  59. package/src/tree/tree-dialog.component.js +4 -4
  60. package/src/tree/tree-dialog.component.js.map +1 -1
  61. package/src/tree/tree-dialog.component.min.html +1 -1
  62. package/src/tree/tree-dialog.component.min.js +1 -1
  63. package/src/tree/tree-dialog.component.ts +3 -6
  64. package/src/tree/tree-node.component.html +2 -2
  65. package/src/tree/tree-node.component.js +4 -4
  66. package/src/tree/tree-node.component.js.map +1 -1
  67. package/src/tree/tree-node.component.min.html +1 -1
  68. package/src/tree/tree-node.component.min.js +1 -1
  69. package/src/tree/tree-node.component.ts +3 -6
  70. package/src/tree/tree.component.js +9 -9
  71. package/src/tree/tree.component.js.map +1 -1
  72. package/src/tree/tree.component.min.js +1 -1
  73. package/src/tree/tree.component.ts +7 -7
@@ -1 +1 @@
1
- System.register(["@angular/core","@angular/forms","@angular/material/dialog","rxjs","rxjs/operators","@angular/platform-browser","@stratusjs/runtime/stratus","lodash","@stratusjs/angular/core/root.component","@stratusjs/angular/editor/media-dialog.component","@stratusjs/angularjs/services/registry","@stratusjs/core/environment","@stratusjs/core/events/eventManager","@stratusjs/angular/editor/code-view-dialog.component","codemirror/lib/codemirror","codemirror/mode/xml/xml","html2pdf","font-awesome","froala-plugins","froala-embedly","froala-font-awesome","froala-image-tui","@stratusjs/angular/froala/plugins/mediaManager"],function(e,t){"use strict";var i,a,r,o,n,s,l,d,c,u,h,p,f,g,m,b,y,v,k,S,x,w,C,M=this&&this.__decorate||function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n},T=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};t&&t.id;return{setters:[function(e){i=e},function(e){a=e},function(e){r=e},function(e){o=e},function(e){n=e},function(e){s=e},function(e){l=e},function(e){d=e},function(e){c=e},function(e){u=e},function(e){h=e},function(e){p=e},function(e){f=e},function(e){g=e},function(e){m=e},function(e){},function(e){},function(e){},function(e){},function(e){},function(e){},function(e){},function(e){}],execute:function(){b="/assets/1/0/bundles","@stratusjs/angular","froala-editor","codemirror",y="editor",v=p.cookie("env")?"":".min",k=`${b}/${boot.configuration.paths["@stratusjs/angular/*"].replace(/[^\/]*$/,"")}`,S=`${b}/${boot.configuration.paths["codemirror/*"].replace(/[^\/]*$/,"")}`,x=`${b}/${boot.configuration.paths["froala-editor"].replace(/js\/[^\/]*$/,"")}`,w=(e,t)=>d.default.has(e,t)&&!d.default.isEmpty(d.default.get(e,t)),C=class extends c.RootComponent{constructor(e,t,i,r,s){super(),this.sanitizer=e,this.ref=t,this.elementRef=i,this.fb=r,this.dialog=s,this.title="editor_component",this.dev=!!p.cookie("env"),this.editor="froala",this._=d.default,this.has=w,this.log=console.log,this.registry=new h.Registry,this.onChange=new o.Subject,this.svgIcons={},this.initialized=!1,this.styled=!1,this.blurred=!1,this.focused=!1,this.form=this.fb.group({dataString:new a.FormControl}),this.dataChangeLog=[],this.dataString="",this.froalaButtons=["bold","italic","underline","strikeThrough","subscript","superscript","|","formatBlock","blockStyle","inlineStyle","paragraphStyle","paragraphFormat","align","formatOL","formatUL","outdent","indent","|","insertLink","insertImage","insertVideo","insertFile","insertTable","|","undo","redo","removeFormat","wordPaste","help","html","fullscreen"],this.froalaStandardButtons={moreText:["bold","italic","underline","strikeThrough","subscript","superscript","fontFamily","fontSize","textColor","backgroundColor","inlineClass","inlineStyle","clearFormatting"],moreParagraph:["alignLeft","alignCenter","alignRight","alignJustify","indent","outdent","paragraphFormat","paragraphStyle","formatOL","formatUL","quote"],moreRich:["insertLink","insertImage","insertVideo","insertFile","insertTable","insertHR","specialCharacters","embedly"],moreMisc:["undo","redo","fullscreen","html","print","selectAll","help"]},this.froalaConfig={attribution:!1,key:l.Stratus.Environment.get("froalaKey"),zIndex:9999,events:{initialized:e=>{this.froalaEditorDirective=e}},codeBeautifierOptions:{end_with_newline:!0,indent_inner_html:!0,extra_liners:'["p", "h1", "h2", "h3", "h4", "h5", "h6", "blockquote", "pre", "ul", "ol", "table", "dl"]',brace_style:"expand",indent_char:" ",indent_size:4,wrap_line_length:0},codeMirror:m,codeMirrorOptions:{indentWithTabs:!1,lineNumbers:!0,lineWrapping:!0,mode:"text/html",tabMode:"space",tabSize:4},fileInsertButtons:["fileBack","|","mediaManager"],fileUploadURL:"https://app.sitetheory.io/?session="+p.cookie("SITETHEORY"),fontFamily:{"Arial,Helvetica,sans-serif":"Arial","Georgia,serif":"Georgia","Impact,Charcoal,sans-serif":"Impact","Tahoma,Geneva,sans-serif":"Tahoma",'"Times New Roman",Times,serif':"Times New Roman","Verdana,Geneva,sans-serif":"Verdana"},heightMax:window.innerHeight||document.documentElement.clientHeight||500,htmlAllowedAttrs:["aria-.+","data-.+","accept","accept-charset","accesskey","action","align","allowfullscreen","allowtransparency","alt","async","autocomplete","autofocus","autoplay","autosave","background","bgcolor","border","charset","cellpadding","cellspacing","checked","cite","class","color","cols","colspan","content","contenteditable","contextmenu","controls","coords","data","datetime","default","defer","dir","dirname","disabled","download","draggable","dropzone","enctype","for","form","formaction","frameborder","headers","height","hidden","high","href","hreflang","http-equiv","icon","id","ismap","itemprop","keytype","kind","label","lang","language","list","loop","low","max","maxlength","media","method","min","mozallowfullscreen","multiple","muted","name","novalidate","open","optimum","pattern","ping","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","reversed","rows","rowspan","sandbox","scope","scoped","scrolling","seamless","selected","shape","size","sizes","span","src","srcdoc","srclang","srcset","start","step","summary","spellcheck","style","tabindex","target","title","type","translate","usemap","value","valign","webkitallowfullscreen","width","wrap","xmlns","xmlns:xlink","accent-height","accumulate","additive","alignment-baseline","alphabetic","amplitude","arabic-form","ascent","attributeName","attributeType","azimuth","baseFrequency","baseline-shift","baseProfile","bbox","begin","bias","by","calcMode","cap-height","clip","clipPathUnits","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","contentScriptType","contentStyleType","crossorigin","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominant-baseline","dur","dx","dy","edgeMode","elevation","enable-background","end","exponent","externalResourcesRequired","fill","fill-opacity","fill-rule","filter","filterRes","filterUnits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","format","from","fr","fx","fy","g1","g2","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","glyphRef","gradientTransform","gradientUnits","hanging","horiz-adv-x","horiz-origin-x","ideographic","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letter-spacing","lighting-color","limitingConeAngle","local","marker-end","marker-mid","marker-start","markerHeight","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overline-position","overline-thickness","panose-1","paint-order","path","pathLength","patternContentUnits","patternTransform","patternUnits","pointer-events","points","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","referrerPolicy","refX","refY","rendering-intent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","scale","seed","shape-rendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","string","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","surfaceScale","systemLanguage","tableValues","targetX","targetY","text-anchor","text-decoration","text-rendering","textLength","to","transform","transform-origin","u1","u2","underline-position","underline-thickness","unicode","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","values","vector-effect","version","vert-adv-y","vert-origin-x","vert-origin-y","viewBox","viewTarget","visibility","widths","word-spacing","writing-mode","x","x-height","x1","x2","xChannelSelector","xlink:actuate","xlink:arcrole","xlink:href","xlink:role","xlink:show","xlink:title","xlink:type","xml:base","xml:lang","xml:space","y","y1","y2","yChannelSelector","z","zoomAndPan"],htmlAllowedEmptyTags:["textarea","a","iframe","object","video","style","script","hr","div","animate","animateMotion","animateTransform","circle","clipPath","defs","desc","discard","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tspan","unknown","use","view"],htmlAllowedStyleProps:[".*"],htmlAllowedTags:["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","br","button","canvas","caption","cite","code","col","colgroup","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meter","nav","noscript","object","ol","optgroup","option","output","p","param","pre","progress","queue","rp","rt","ruby","s","samp","script","style","section","select","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","animate","animateMotion","animateTransform","circle","clipPath","defs","desc","discard","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tspan","unknown","use","view"],htmlRemoveTags:[],htmlSimpleAmpersand:!1,imageInsertButtons:["imageBack","|","mediaManager","imageUpload","imageByURL"],imageUpload:!0,imageUploadRemoteUrls:!0,imageUploadURL:"https://app.sitetheory.io/?session="+p.cookie("SITETHEORY"),imageManagerPageSize:20,imageManagerScrollOffset:10,imageManagerLoadMethod:"GET",imageManagerLoadURL:"/Api/Media?payload-only=true",multiLine:!0,paragraphStyles:{btn:"Button",header:"Header",title:"Title","alt-title":"Alt Title (over)",subtitle:"Subtitle",pullout:"Pullout Quote"},pasteDeniedAttrs:["id","class","style","dir","data-.+","aria-.+","ng-.+"],pasteDeniedTags:["form","input","label","style"],pastePlain:!1,pluginsEnabled:["align","charCounter","codeBeautifier","codeView","colors","draggable","embedly","entities","file","fontAwesome","fontFamily","fontSize","fullscreen","help","image","imageTUI","inlineStyle","inlineClass","lineBreaker","link","lists","mediaManager","paragraphFormat","paragraphStyle","print","quickInsert","quote","save","specialCharacters","table","url","video","wordPaste"],quickInsertButtons:["image","video","media","embedly","table","ul","ol","hr"],scrollableContainer:l.Stratus.Environment.get("viewPort")||"body",spellcheck:!0,toolbarSticky:!0,toolbarButtons:{moreText:{buttons:this.froalaStandardButtons.moreText,buttonsVisible:0},moreParagraph:{buttons:this.froalaStandardButtons.moreParagraph,buttonsVisible:8},moreRich:{buttons:this.froalaStandardButtons.moreRich,buttonsVisible:5},moreMisc:{buttons:this.froalaStandardButtons.moreMisc,align:"right",buttonsVisible:4}},toolbarButtonsSM:{moreText:{buttons:this.froalaStandardButtons.moreText,buttonsVisible:3},moreParagraph:{buttons:this.froalaStandardButtons.moreParagraph,buttonsVisible:0},moreRich:{buttons:this.froalaStandardButtons.moreRich,buttonsVisible:3},moreMisc:{buttons:this.froalaStandardButtons.moreMisc,align:"right",buttonsVisible:4}},toolbarButtonsXS:{moreText:{buttons:this.froalaStandardButtons.moreText,buttonsVisible:0},moreParagraph:{buttons:this.froalaStandardButtons.moreParagraph,buttonsVisible:0},moreRich:{buttons:this.froalaStandardButtons.moreRich,buttonsVisible:0},moreMisc:{buttons:this.froalaStandardButtons.moreMisc,align:"right",buttonsVisible:2}},useClasses:!0,videoInsertButtons:["videoBack","|","mediaManager","videoByURL","videoEmbed","videoUpload"],videoUpload:!0,videoUploadURL:"https://app.sitetheory.io/?session="+p.cookie("SITETHEORY")},this.uid=d.default.uniqueId(`sa_${d.default.snakeCase(y)}_component_`),l.Stratus.Instances[this.uid]=this,l.Stratus.Internals.LoadCss([`${k}editor/editor.component${v}.css`,`${S}lib/codemirror.css`,`${x}css/froala_editor.pkgd${v}.css`,`${x}css/third_party/embedly${v}.css`,`${x}css/third_party/font_awesome${v}.css`,`${x}css/third_party/image_tui${v}.css`]).then(()=>{this.styled=!0,this.refresh()}).catch(e=>{console.error(e),console.warn("Issue detected in CSS Loader for Component:",this.uid),this.styled=!0,this.refresh()}),this.hydrate(i,e,["title","uid","dev","debug","editor","target","targetSuffix","id","manifest","decouple","direct","api","urlRoot","property","_","has","log","registry","fetched","data","collection","model","dataSub","onChange","subscriber","svgIcons","initialized","styled","blurred","focused","codeViewIsOpen","form","dataChangeLog","dataString","froalaEditorDirective","froalaButtons","froalaStandardButtons","froalaConfig","sanitizer","ref","elementRef","fb","dialog","ngOnInit","listDuplicates","normalizeIn","normalizeOut","changeImgSize","handleError","fetchData","dataDefer","dataRef","onDataChange","created","changedEditor","onChangeEvent","onFocus","onBlur","bypassHTML","trigger","openMediaDialog","openCodeViewDialog","hydrate","reloading","refresh","ngOnDestroy"]),this.fetchData().then(e=>{if(!(e&&e instanceof f.EventManager))return void console.warn("Unable to bind data from Registry!");const t=()=>{e.completed&&(this.dataDefer(this.subscriber),this.codeViewIsOpen)};e.on("change",t),t()}),this.dataSub=new o.Observable(e=>this.dataDefer(e)),this.dataSub.pipe(n.debounce(()=>o.timer(500)),n.catchError(this.handleError)).subscribe(e=>{if(this.focused)return void(this.dev&&console.warn(`[subscriber] waiting on updates due to focus on ${this.uid}`));const t=this.form.get("dataString");t.value!==e&&(t.patchValue(e),this.refresh())})}ngOnInit(){this.initialized=!0;this.form.get("dataString").valueChanges.forEach(e=>{if(!this.model.completed)return;let t=null;!this.froalaConfig.useClasses&&this.froalaEditorDirective&&this.froalaEditorDirective.getEditor()&&this.froalaEditorDirective.getEditor().el&&this.froalaEditorDirective.getEditor().el.innerHTML&&(t=this.froalaEditorDirective.getEditor().el.innerHTML),this.model.set(this.property,this.normalizeOut(t||e))}),this.dev&&this.listDuplicates(this.froalaConfig)}listDuplicates(e){return d.default.forEach(e,(e,t)=>{if(!d.default.isArray(e))return;const i={};e.forEach(e=>i[e]=(i[e]||0)+1);const a=d.default.filter(d.default.map(i,(e,t)=>e>1?t:null));a.length&&console.warn("Froala Config:",t,"has duplicates:",a)}),e}normalizeIn(e){return e&&d.default.isString(e)?this.changeImgSize(e,"hq"):""}normalizeOut(e){return null===e?"":d.default.isString(e)?this.changeImgSize(e,"xs"):e}changeImgSize(e,t){if(!e||!d.default.isString(e))return e;if(!t||!d.default.isString(t))return e;const i=/<img([\w\W]+?)>/gi;let a;for(;a=i.exec(e);){const i=a[0];if(i.includes("data:image"))continue;const r=/^(.+?)(-[A-Z]{2})?\.(?=[^.]*$)(.+)/gi.exec(i);null!==r?e=i.includes("data-stratus-src")?e.replace(i,`${r[1]}-${t}.${r[3]}`):e.replace(i,`${r[1]}.${r[3]}`):console.warn("Unable to find file name for image src:",i)}return e}handleError(e){return console.error(e),e}fetchData(){return this.fetched?this.fetched:this.fetched=this.registry.fetch(l.Stratus.Select(this.elementRef.nativeElement),this)}dataDefer(e){if(this.subscriber=this.subscriber||e,!this.subscriber)return;const t=this.dataString,i=this.dataRef();if(i){if(!this.froalaConfig.useClasses){if(t===this.dataString)return;this.dev&&console.log("changed value pushed to subscriber:",t,this.dataString)}this.subscriber.next(i)}else setTimeout(()=>{this.dataDefer(e)},500)}dataRef(){return this.model?this.dataString=this.normalizeIn(this.model.get(this.property)):""}onDataChange(){this.dataDefer(this.subscriber),this.refresh()}created(){}changedEditor(e){console.log("editor-change:",e)}onChangeEvent(e){console.log("change:",e)}onFocus(e){this.focused=!0,this.blurred=!1}onBlur(e){this.focused=!1,this.blurred=!0}bypassHTML(e){return this.sanitizer.bypassSecurityTrustHtml(e)}trigger(e,t,i){this.dev&&this.debug&&console.log("editor.trigger:",e,i),"media-library"===e?this.openMediaDialog(i):"code-view"===e&&this.openCodeViewDialog()}openMediaDialog(e){const t=this.dialog.open(u.MediaDialogComponent,{width:"1000px",data:{editor:this,eventManager:e,form:this.form,model:this.model,property:this.property}});this.refresh();const i=this;t.afterClosed().subscribe(e=>{e&&!d.default.isEmpty(e)&&(i.refresh(),this.dev&&e&&console.log("media dialog result:",e))})}openCodeViewDialog(){this.codeViewIsOpen=!0;const e=this.dialog.open(g.CodeViewDialogComponent,{width:"1000px",data:{form:this.form,model:this.model,property:this.property}});this.refresh(),e.afterClosed().subscribe(e=>{this.codeViewIsOpen=!1,e&&!d.default.isEmpty(e)&&(this.refresh(),this.dev&&e&&console.log("code view dialog result:",e))})}},M([i.Input(),T("design:type",String)],C.prototype,"target",void 0),M([i.Input(),T("design:type",String)],C.prototype,"targetSuffix",void 0),M([i.Input(),T("design:type",Number)],C.prototype,"id",void 0),M([i.Input(),T("design:type",Boolean)],C.prototype,"manifest",void 0),M([i.Input(),T("design:type",Boolean)],C.prototype,"decouple",void 0),M([i.Input(),T("design:type",Boolean)],C.prototype,"direct",void 0),M([i.Input(),T("design:type",Object)],C.prototype,"api",void 0),M([i.Input(),T("design:type",String)],C.prototype,"urlRoot",void 0),M([i.Input(),T("design:type",String)],C.prototype,"property",void 0),C=M([i.Component({selector:"sa-editor",templateUrl:`${k}/editor/editor.component${v}.html`}),T("design:paramtypes",[s.DomSanitizer,i.ChangeDetectorRef,i.ElementRef,a.FormBuilder,r.MatDialog])],C),e("EditorComponent",C)}}});
1
+ System.register(["@angular/core","@angular/forms","@angular/material/dialog","rxjs","rxjs/operators","@angular/platform-browser","@stratusjs/runtime/stratus","lodash","@stratusjs/angular/core/root.component","@stratusjs/angular/editor/media-dialog.component","@stratusjs/angularjs/services/registry","@stratusjs/core/environment","@stratusjs/core/events/eventManager","@stratusjs/angular/editor/code-view-dialog.component","codemirror/lib/codemirror","codemirror/mode/xml/xml","html2pdf","font-awesome","froala-plugins","froala-embedly","froala-font-awesome","froala-image-tui","@stratusjs/angular/froala/plugins/mediaManager"],function(e,t){"use strict";var i,a,r,o,n,s,l,d,c,u,h,p,f,g,m,b,y,v,S,k,x,w,C=this&&this.__decorate||function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n},M=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};t&&t.id;return{setters:[function(e){i=e},function(e){a=e},function(e){r=e},function(e){o=e},function(e){n=e},function(e){s=e},function(e){l=e},function(e){d=e},function(e){c=e},function(e){u=e},function(e){h=e},function(e){p=e},function(e){f=e},function(e){g=e},function(e){m=e},function(e){},function(e){},function(e){},function(e){},function(e){},function(e){},function(e){},function(e){}],execute:function(){"@stratusjs/angular","froala-editor","codemirror",b="editor",y=p.cookie("env")?"":".min",v=`${l.Stratus.BaseUrl}${boot.configuration.paths["@stratusjs/angular/*"].replace(/[^\/]*$/,"")}`,S=`${l.Stratus.BaseUrl}${boot.configuration.paths["codemirror/*"].replace(/[^\/]*$/,"")}`,k=`${l.Stratus.BaseUrl}${boot.configuration.paths["froala-editor"].replace(/js\/[^\/]*$/,"")}`,x=(e,t)=>d.default.has(e,t)&&!d.default.isEmpty(d.default.get(e,t)),w=class extends c.RootComponent{constructor(e,t,i,r,s){super(),this.sanitizer=e,this.ref=t,this.elementRef=i,this.fb=r,this.dialog=s,this.title="editor_component",this.dev=!!p.cookie("env"),this.editor="froala",this._=d.default,this.has=x,this.log=console.log,this.Stratus=l.Stratus,this.registry=new h.Registry,this.onChange=new o.Subject,this.svgIcons={},this.initialized=!1,this.styled=!1,this.blurred=!1,this.focused=!1,this.form=this.fb.group({dataString:new a.FormControl}),this.dataChangeLog=[],this.dataString="",this.froalaButtons=["bold","italic","underline","strikeThrough","subscript","superscript","|","formatBlock","blockStyle","inlineStyle","paragraphStyle","paragraphFormat","align","formatOL","formatUL","outdent","indent","|","insertLink","insertImage","insertVideo","insertFile","insertTable","|","undo","redo","removeFormat","wordPaste","help","html","fullscreen"],this.froalaStandardButtons={moreText:["bold","italic","underline","strikeThrough","subscript","superscript","fontFamily","fontSize","textColor","backgroundColor","inlineClass","inlineStyle","clearFormatting"],moreParagraph:["alignLeft","alignCenter","alignRight","alignJustify","indent","outdent","paragraphFormat","paragraphStyle","formatOL","formatUL","quote"],moreRich:["insertLink","insertImage","insertVideo","insertFile","insertTable","insertHR","specialCharacters","embedly"],moreMisc:["undo","redo","fullscreen","html","print","selectAll","help"]},this.froalaConfig={attribution:!1,key:l.Stratus.Environment.get("froalaKey"),zIndex:9999,events:{initialized:e=>{this.froalaEditorDirective=e}},codeBeautifierOptions:{end_with_newline:!0,indent_inner_html:!0,extra_liners:'["p", "h1", "h2", "h3", "h4", "h5", "h6", "blockquote", "pre", "ul", "ol", "table", "dl"]',brace_style:"expand",indent_char:" ",indent_size:4,wrap_line_length:0},codeMirror:m,codeMirrorOptions:{indentWithTabs:!1,lineNumbers:!0,lineWrapping:!0,mode:"text/html",tabMode:"space",tabSize:4},fileInsertButtons:["fileBack","|","mediaManager"],fileUploadURL:"https://app.sitetheory.io/?session="+p.cookie("SITETHEORY"),fontFamily:{"Arial,Helvetica,sans-serif":"Arial","Georgia,serif":"Georgia","Impact,Charcoal,sans-serif":"Impact","Tahoma,Geneva,sans-serif":"Tahoma",'"Times New Roman",Times,serif':"Times New Roman","Verdana,Geneva,sans-serif":"Verdana"},heightMax:window.innerHeight||document.documentElement.clientHeight||500,htmlAllowedAttrs:["aria-.+","data-.+","accept","accept-charset","accesskey","action","align","allowfullscreen","allowtransparency","alt","async","autocomplete","autofocus","autoplay","autosave","background","bgcolor","border","charset","cellpadding","cellspacing","checked","cite","class","color","cols","colspan","content","contenteditable","contextmenu","controls","coords","data","datetime","default","defer","dir","dirname","disabled","download","draggable","dropzone","enctype","for","form","formaction","frameborder","headers","height","hidden","high","href","hreflang","http-equiv","icon","id","ismap","itemprop","keytype","kind","label","lang","language","list","loop","low","max","maxlength","media","method","min","mozallowfullscreen","multiple","muted","name","novalidate","open","optimum","pattern","ping","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","reversed","rows","rowspan","sandbox","scope","scoped","scrolling","seamless","selected","shape","size","sizes","span","src","srcdoc","srclang","srcset","start","step","summary","spellcheck","style","tabindex","target","title","type","translate","usemap","value","valign","webkitallowfullscreen","width","wrap","xmlns","xmlns:xlink","accent-height","accumulate","additive","alignment-baseline","alphabetic","amplitude","arabic-form","ascent","attributeName","attributeType","azimuth","baseFrequency","baseline-shift","baseProfile","bbox","begin","bias","by","calcMode","cap-height","clip","clipPathUnits","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","contentScriptType","contentStyleType","crossorigin","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominant-baseline","dur","dx","dy","edgeMode","elevation","enable-background","end","exponent","externalResourcesRequired","fill","fill-opacity","fill-rule","filter","filterRes","filterUnits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","format","from","fr","fx","fy","g1","g2","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","glyphRef","gradientTransform","gradientUnits","hanging","horiz-adv-x","horiz-origin-x","ideographic","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letter-spacing","lighting-color","limitingConeAngle","local","marker-end","marker-mid","marker-start","markerHeight","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overline-position","overline-thickness","panose-1","paint-order","path","pathLength","patternContentUnits","patternTransform","patternUnits","pointer-events","points","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","referrerPolicy","refX","refY","rendering-intent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","scale","seed","shape-rendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","string","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","surfaceScale","systemLanguage","tableValues","targetX","targetY","text-anchor","text-decoration","text-rendering","textLength","to","transform","transform-origin","u1","u2","underline-position","underline-thickness","unicode","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","values","vector-effect","version","vert-adv-y","vert-origin-x","vert-origin-y","viewBox","viewTarget","visibility","widths","word-spacing","writing-mode","x","x-height","x1","x2","xChannelSelector","xlink:actuate","xlink:arcrole","xlink:href","xlink:role","xlink:show","xlink:title","xlink:type","xml:base","xml:lang","xml:space","y","y1","y2","yChannelSelector","z","zoomAndPan"],htmlAllowedEmptyTags:["textarea","a","iframe","object","video","style","script","hr","div","animate","animateMotion","animateTransform","circle","clipPath","defs","desc","discard","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tspan","unknown","use","view"],htmlAllowedStyleProps:[".*"],htmlAllowedTags:["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","br","button","canvas","caption","cite","code","col","colgroup","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meter","nav","noscript","object","ol","optgroup","option","output","p","param","pre","progress","queue","rp","rt","ruby","s","samp","script","style","section","select","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","animate","animateMotion","animateTransform","circle","clipPath","defs","desc","discard","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tspan","unknown","use","view"],htmlRemoveTags:[],htmlSimpleAmpersand:!1,imageInsertButtons:["imageBack","|","mediaManager","imageUpload","imageByURL"],imageUpload:!0,imageUploadRemoteUrls:!0,imageUploadURL:"https://app.sitetheory.io/?session="+p.cookie("SITETHEORY"),imageManagerPageSize:20,imageManagerScrollOffset:10,imageManagerLoadMethod:"GET",imageManagerLoadURL:"/Api/Media?payload-only=true",multiLine:!0,paragraphStyles:{btn:"Button",header:"Header",title:"Title","alt-title":"Alt Title (over)",subtitle:"Subtitle",pullout:"Pullout Quote"},pasteDeniedAttrs:["id","class","style","dir","data-.+","aria-.+","ng-.+"],pasteDeniedTags:["form","input","label","style"],pastePlain:!1,pluginsEnabled:["align","charCounter","codeBeautifier","codeView","colors","draggable","embedly","entities","file","fontAwesome","fontFamily","fontSize","fullscreen","help","image","imageTUI","inlineStyle","inlineClass","lineBreaker","link","lists","mediaManager","paragraphFormat","paragraphStyle","print","quickInsert","quote","save","specialCharacters","table","url","video","wordPaste"],quickInsertButtons:["image","video","media","embedly","table","ul","ol","hr"],scrollableContainer:l.Stratus.Environment.get("viewPort")||"body",spellcheck:!0,toolbarSticky:!0,toolbarButtons:{moreText:{buttons:this.froalaStandardButtons.moreText,buttonsVisible:0},moreParagraph:{buttons:this.froalaStandardButtons.moreParagraph,buttonsVisible:8},moreRich:{buttons:this.froalaStandardButtons.moreRich,buttonsVisible:5},moreMisc:{buttons:this.froalaStandardButtons.moreMisc,align:"right",buttonsVisible:4}},toolbarButtonsSM:{moreText:{buttons:this.froalaStandardButtons.moreText,buttonsVisible:3},moreParagraph:{buttons:this.froalaStandardButtons.moreParagraph,buttonsVisible:0},moreRich:{buttons:this.froalaStandardButtons.moreRich,buttonsVisible:3},moreMisc:{buttons:this.froalaStandardButtons.moreMisc,align:"right",buttonsVisible:4}},toolbarButtonsXS:{moreText:{buttons:this.froalaStandardButtons.moreText,buttonsVisible:0},moreParagraph:{buttons:this.froalaStandardButtons.moreParagraph,buttonsVisible:0},moreRich:{buttons:this.froalaStandardButtons.moreRich,buttonsVisible:0},moreMisc:{buttons:this.froalaStandardButtons.moreMisc,align:"right",buttonsVisible:2}},useClasses:!0,videoInsertButtons:["videoBack","|","mediaManager","videoByURL","videoEmbed","videoUpload"],videoUpload:!0,videoUploadURL:"https://app.sitetheory.io/?session="+p.cookie("SITETHEORY")},this.uid=d.default.uniqueId(`sa_${d.default.snakeCase(b)}_component_`),l.Stratus.Instances[this.uid]=this,l.Stratus.Internals.LoadCss([`${v}editor/editor.component${y}.css`,`${S}lib/codemirror.css`,`${k}css/froala_editor.pkgd${y}.css`,`${k}css/third_party/embedly${y}.css`,`${k}css/third_party/font_awesome${y}.css`,`${k}css/third_party/image_tui${y}.css`]).then(()=>{this.styled=!0,this.refresh()}).catch(e=>{console.error(e),console.warn("Issue detected in CSS Loader for Component:",this.uid),this.styled=!0,this.refresh()}),this.hydrate(i,e,["title","uid","dev","debug","editor","target","targetSuffix","id","manifest","decouple","direct","api","urlRoot","property","_","has","log","Stratus","registry","fetched","data","collection","model","dataSub","onChange","subscriber","svgIcons","initialized","styled","blurred","focused","codeViewIsOpen","form","dataChangeLog","dataString","froalaEditorDirective","froalaButtons","froalaStandardButtons","froalaConfig","sanitizer","ref","elementRef","fb","dialog","ngOnInit","listDuplicates","normalizeIn","normalizeOut","changeImgSize","handleError","fetchData","dataDefer","dataRef","onDataChange","created","changedEditor","onChangeEvent","onFocus","onBlur","bypassHTML","trigger","openMediaDialog","openCodeViewDialog","hydrate","reloading","refresh","ngOnDestroy"]),this.fetchData().then(e=>{if(!(e&&e instanceof f.EventManager))return void console.warn("Unable to bind data from Registry!");const t=()=>{e.completed&&(this.dataDefer(this.subscriber),this.codeViewIsOpen)};e.on("change",t),t()}),this.dataSub=new o.Observable(e=>this.dataDefer(e)),this.dataSub.pipe(n.debounce(()=>o.timer(500)),n.catchError(this.handleError)).subscribe(e=>{if(this.focused)return void(this.dev&&console.warn(`[subscriber] waiting on updates due to focus on ${this.uid}`));const t=this.form.get("dataString");t.value!==e&&(t.patchValue(e),this.refresh())})}ngOnInit(){this.initialized=!0;this.form.get("dataString").valueChanges.forEach(e=>{if(!this.model.completed)return;let t=null;!this.froalaConfig.useClasses&&this.froalaEditorDirective&&this.froalaEditorDirective.getEditor()&&this.froalaEditorDirective.getEditor().el&&this.froalaEditorDirective.getEditor().el.innerHTML&&(t=this.froalaEditorDirective.getEditor().el.innerHTML),this.model.set(this.property,this.normalizeOut(t||e))}),this.dev&&this.listDuplicates(this.froalaConfig)}listDuplicates(e){return d.default.forEach(e,(e,t)=>{if(!d.default.isArray(e))return;const i={};e.forEach(e=>i[e]=(i[e]||0)+1);const a=d.default.filter(d.default.map(i,(e,t)=>e>1?t:null));a.length&&console.warn("Froala Config:",t,"has duplicates:",a)}),e}normalizeIn(e){return e&&d.default.isString(e)?this.changeImgSize(e,"hq"):""}normalizeOut(e){return null===e?"":d.default.isString(e)?this.changeImgSize(e,"xs"):e}changeImgSize(e,t){if(!e||!d.default.isString(e))return e;if(!t||!d.default.isString(t))return e;const i=/<img([\w\W]+?)>/gi;let a;for(;a=i.exec(e);){const i=a[0];if(i.includes("data:image"))continue;const r=/^<img\s(.+?)(-[A-Z]{2})?\.(?=[^.]*$)(.+)>/gi.exec(i);if(null!==r)if(i.includes("data-stratus-src"))e=e.replace(i,`<img ${r[1]}-${t}.${r[3]}>`);else{if(!i.includes("cdn.sitetheory.io"))continue;if(d.default.isEmpty(r[2]))continue;e=e.replace(i,`<img data-stratus-src ${r[1]}-${t}.${r[3]}>`)}else console.warn("Unable to find file name for image src:",i)}return e}handleError(e){return console.error(e),e}fetchData(){return this.fetched?this.fetched:this.fetched=this.registry.fetch(l.Stratus.Select(this.elementRef.nativeElement),this)}dataDefer(e){if(this.subscriber=this.subscriber||e,!this.subscriber)return;const t=this.dataString,i=this.dataRef();if(i){if(!this.froalaConfig.useClasses){if(t===this.dataString)return;this.dev&&console.log("changed value pushed to subscriber:",t,this.dataString)}this.subscriber.next(i)}else setTimeout(()=>{this.dataDefer(e)},500)}dataRef(){return this.model?this.dataString=this.normalizeIn(this.model.get(this.property)):""}onDataChange(){this.dataDefer(this.subscriber),this.refresh()}created(){}changedEditor(e){console.log("editor-change:",e)}onChangeEvent(e){console.log("change:",e)}onFocus(e){this.focused=!0,this.blurred=!1}onBlur(e){this.focused=!1,this.blurred=!0}bypassHTML(e){return this.sanitizer.bypassSecurityTrustHtml(e)}trigger(e,t,i){this.dev&&this.debug&&console.log("editor.trigger:",e,i),"media-library"===e?this.openMediaDialog(i):"code-view"===e&&this.openCodeViewDialog()}openMediaDialog(e){const t=this.dialog.open(u.MediaDialogComponent,{width:"1000px",data:{editor:this,eventManager:e,form:this.form,model:this.model,property:this.property}});this.refresh();const i=this;t.afterClosed().subscribe(e=>{e&&!d.default.isEmpty(e)&&(i.refresh(),this.dev&&e&&console.log("media dialog result:",e))})}openCodeViewDialog(){this.codeViewIsOpen=!0;const e=this.dialog.open(g.CodeViewDialogComponent,{width:"1000px",data:{form:this.form,model:this.model,property:this.property}});this.refresh(),e.afterClosed().subscribe(e=>{this.codeViewIsOpen=!1,e&&!d.default.isEmpty(e)&&(this.refresh(),this.dev&&e&&console.log("code view dialog result:",e))})}},C([i.Input(),M("design:type",String)],w.prototype,"target",void 0),C([i.Input(),M("design:type",String)],w.prototype,"targetSuffix",void 0),C([i.Input(),M("design:type",Number)],w.prototype,"id",void 0),C([i.Input(),M("design:type",Boolean)],w.prototype,"manifest",void 0),C([i.Input(),M("design:type",Boolean)],w.prototype,"decouple",void 0),C([i.Input(),M("design:type",Boolean)],w.prototype,"direct",void 0),C([i.Input(),M("design:type",Object)],w.prototype,"api",void 0),C([i.Input(),M("design:type",String)],w.prototype,"urlRoot",void 0),C([i.Input(),M("design:type",String)],w.prototype,"property",void 0),w=C([i.Component({selector:"sa-editor",templateUrl:`${v}/editor/editor.component${y}.html`}),M("design:paramtypes",[s.DomSanitizer,i.ChangeDetectorRef,i.ElementRef,a.FormBuilder,r.MatDialog])],w),e("EditorComponent",w)}}});
@@ -162,7 +162,6 @@ import {FroalaEditorDirective} from 'angular-froala-wysiwyg'
162
162
  // import '@stratusjs/angular/froala/plugins/menuButton'
163
163
 
164
164
  // Local Setup
165
- const installDir = '/assets/1/0/bundles'
166
165
  const systemPackage = '@stratusjs/angular'
167
166
  const froalaPackage = 'froala-editor'
168
167
  const codeMirrorPackage = 'codemirror'
@@ -170,9 +169,9 @@ const moduleName = 'editor'
170
169
 
171
170
  // Directory Template
172
171
  const min = !cookie('env') ? '.min' : ''
173
- const localDir = `${installDir}/${boot.configuration.paths[`${systemPackage}/*`].replace(/[^\/]*$/, '')}`
174
- const codeMirrorDir = `${installDir}/${boot.configuration.paths[`${codeMirrorPackage}/*`].replace(/[^\/]*$/, '')}`
175
- const froalaDir = `${installDir}/${boot.configuration.paths[froalaPackage].replace(/js\/[^\/]*$/, '')}`
172
+ const localDir = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemPackage}/*`].replace(/[^\/]*$/, '')}`
173
+ const codeMirrorDir = `${Stratus.BaseUrl}${boot.configuration.paths[`${codeMirrorPackage}/*`].replace(/[^\/]*$/, '')}`
174
+ const froalaDir = `${Stratus.BaseUrl}${boot.configuration.paths[froalaPackage].replace(/js\/[^\/]*$/, '')}`
176
175
 
177
176
  // Utility Functions
178
177
  const has = (object: object, path: string) => _.has(object, path) && !_.isEmpty(_.get(object, path))
@@ -223,6 +222,7 @@ export class EditorComponent extends RootComponent implements OnInit, TriggerInt
223
222
  _ = _
224
223
  has = has
225
224
  log = console.log
225
+ Stratus = Stratus
226
226
 
227
227
  // Stratus Data Connectivity
228
228
  registry = new Registry()
@@ -907,7 +907,7 @@ export class EditorComponent extends RootComponent implements OnInit, TriggerInt
907
907
  // TODO: Allow more CSS files to get pulled and mark this.styled appropriately
908
908
  /* *
909
909
  if (_.has(boot.configuration.paths, 'quill')) {
910
- const quillDir = `/assets/1/0/bundles/${boot.configuration.paths.quill.replace(/[^/]*$/, '')}`
910
+ const quillDir = `${Stratus.BaseUrl}${boot.configuration.paths.quill.replace(/[^/]*$/, '')}`
911
911
  Stratus.Internals.CssLoader(`${quillDir}quill.core.css`)
912
912
  // Stratus.Internals.CssLoader(`${quillDir}quill.bubble.css`)
913
913
  Stratus.Internals.CssLoader(`${quillDir}quill.snow.css`)
@@ -1071,38 +1071,61 @@ export class EditorComponent extends RootComponent implements OnInit, TriggerInt
1071
1071
  if (!size || !_.isString(size)) {
1072
1072
  return data
1073
1073
  }
1074
+ // TODO: This currently peels back the image, but we can either do more here or add this format down below
1074
1075
  const imgRegex: RegExp = /<img([\w\W]+?)>/gi
1075
1076
  let imgMatch: RegExpExecArray
1076
1077
  // console.log('imgRegex:', data, imgRegex)
1077
1078
  // tslint:disable-next-line:no-conditional-assignment
1078
1079
  while (imgMatch = imgRegex.exec(data)) {
1079
- const src: string = imgMatch[0]
1080
+ // Store the entire element for later use
1081
+ const el: string = imgMatch[0]
1082
+
1080
1083
  // This skips elements with the entire image data in the src
1081
- if (src.includes('data:image')) {
1084
+ if (el.includes('data:image')) {
1082
1085
  continue
1083
1086
  }
1087
+
1084
1088
  // TODO: Analyze whether we will need to ensure `data-stratus-src` is available for all Sitetheory Assets.
1085
1089
  // if (src.includes('cdn.sitetheory.io')) {
1086
1090
  // console.log('sitetheory image:', src)
1087
1091
  // }
1092
+
1088
1093
  // This skips image sizing for elements without lazy loading
1089
1094
  // TODO: Enable this after things are normalized
1090
1095
  // if (!src.includes('data-stratus-src')) {
1091
1096
  // continue
1092
1097
  // }
1093
- const srcRegex: RegExp = /^(.+?)(-[A-Z]{2})?\.(?=[^.]*$)(.+)/gi
1094
- const srcMatch: RegExpExecArray = srcRegex.exec(src)
1098
+
1099
+ // Note: This regex may need further enhancements as more images enter the system.
1100
+ const srcRegex: RegExp = /^<img\s(.+?)(-[A-Z]{2})?\.(?=[^.]*$)(.+)>/gi
1101
+ const srcMatch: RegExpExecArray = srcRegex.exec(el)
1095
1102
  if (srcMatch === null) {
1096
- console.warn('Unable to find file name for image src:', src)
1103
+ console.warn('Unable to find file name for image src:', el)
1097
1104
  continue
1098
1105
  }
1099
- // This removes image sizing from elements without lazy loading
1100
- // TODO: Disable this after things are normalized
1101
- if (!src.includes('data-stratus-src')) {
1102
- data = data.replace(src, `${srcMatch[1]}.${srcMatch[3]}`)
1106
+ // Handle Images without Lazy Loading
1107
+ if (!el.includes('data-stratus-src')) {
1108
+ // Ensure we only normalize images from our CDN
1109
+ if (!el.includes('cdn.sitetheory.io')) {
1110
+ continue
1111
+ }
1112
+ // Ensure we only normalize images with our sizing format
1113
+ if (_.isEmpty(srcMatch[2])) {
1114
+ continue
1115
+ }
1116
+ // console.log('data-stratus-src not found:', {
1117
+ // data,
1118
+ // imgMatch,
1119
+ // el,
1120
+ // srcMatch
1121
+ // })
1122
+ // This adds lazy loading to elements that need it
1123
+ data = data.replace(el, `<img data-stratus-src ${srcMatch[1]}-${size}.${srcMatch[3]}>`)
1124
+ // This removes image sizing from elements without lazy loading
1125
+ // data = data.replace(el, `${srcMatch[1]}.${srcMatch[3]}`)
1103
1126
  continue
1104
1127
  }
1105
- data = data.replace(src, `${srcMatch[1]}-${size}.${srcMatch[3]}`)
1128
+ data = data.replace(el, `<img ${srcMatch[1]}-${size}.${srcMatch[3]}>`)
1106
1129
  }
1107
1130
  return data
1108
1131
  }
@@ -74,7 +74,7 @@
74
74
  && mediaEntity.mime === 'video'">
75
75
  <ng-container *ngIf="mediaEntity.service === 'vimeo'">
76
76
  <ng-container *ngIf="mediaEntity.meta && mediaEntity.meta.thumbnail_large; else basicVimeoButton">
77
- <!-- [src]="mediaEntity.meta.thumbnail_large || '/assets/1/0/bundles/sitetheorymedia/images/mediaTypeIcons/media-icon-video.png'" -->
77
+ <!-- [src]="mediaEntity.meta.thumbnail_large || Stratus.BaseUrl + 'sitetheorymedia/images/mediaTypeIcons/media-icon-video.png'" -->
78
78
  <img mat-card-image
79
79
  class="vimeo"
80
80
  [src]="mediaEntity.meta.thumbnail_large"
@@ -87,7 +87,7 @@
87
87
  <!-- TODO: make this a local file -->
88
88
  <img mat-card-image
89
89
  class="vimeo basic-image"
90
- src="/assets/1/0/bundles/sitetheorymedia/images/mediaTypeIcons/media-icon-video.png"
90
+ [src]="Stratus.BaseUrl + 'sitetheorymedia/images/mediaTypeIcons/media-icon-video.png'"
91
91
  style="background: #4e4e4e;"
92
92
  [alt]="mediaEntity.name"
93
93
  [ngClass]="{'selected' : isSelected(mediaEntity)}">
@@ -107,7 +107,7 @@
107
107
  <!-- TODO: make this a local file -->
108
108
  <img mat-card-image
109
109
  class="youtube basic-image"
110
- src="/assets/1/0/bundles/sitetheorymedia/images/mediaTypeIcons/media-icon-video.png"
110
+ [src]="Stratus.BaseUrl + 'sitetheorymedia/images/mediaTypeIcons/media-icon-video.png'"
111
111
  style="background: #4e4e4e;"
112
112
  [alt]="mediaEntity.name"
113
113
  [ngClass]="{'selected' : isSelected(mediaEntity)}">
@@ -119,7 +119,7 @@
119
119
  <!-- TODO: make this a local file -->
120
120
  <img mat-card-image
121
121
  class="facebook-video basic-image"
122
- src="/assets/1/0/bundles/sitetheorymedia/images/mediaTypeIcons/media-icon-video.png"
122
+ [src]="Stratus.BaseUrl + 'sitetheorymedia/images/mediaTypeIcons/media-icon-video.png'"
123
123
  style="background: #4e4e4e;"
124
124
  [alt]="mediaEntity.name"
125
125
  [ngClass]="{'selected' : isSelected(mediaEntity)}">
@@ -129,7 +129,7 @@
129
129
  <!-- TODO: make this a local file -->
130
130
  <img mat-card-image
131
131
  class="generic-video basic-image"
132
- src="/assets/1/0/bundles/sitetheorymedia/images/mediaTypeIcons/media-icon-video.png"
132
+ [src]="Stratus.BaseUrl + 'sitetheorymedia/images/mediaTypeIcons/media-icon-video.png'"
133
133
  style="background: #4e4e4e;"
134
134
  [alt]="mediaEntity.name"
135
135
  [ngClass]="{'selected' : isSelected(mediaEntity)}">
@@ -140,7 +140,7 @@
140
140
  <!-- TODO: make this a local file -->
141
141
  <img mat-card-image
142
142
  class="generic-audio"
143
- src="/assets/1/0/bundles/sitetheorymedia/images/mediaTypeGraphics/media-graphic-audio.png"
143
+ [src]="Stratus.BaseUrl + 'sitetheorymedia/images/mediaTypeGraphics/media-graphic-audio.png'"
144
144
  style="background: #4e4e4e;"
145
145
  [alt]="mediaEntity.name"
146
146
  [ngClass]="{'selected' : isSelected(mediaEntity)}">
@@ -150,7 +150,7 @@
150
150
  <!-- TODO: make this a local file -->
151
151
  <img mat-card-image
152
152
  class="generic-pdf basic-image"
153
- src="/assets/1/0/bundles/sitetheorymedia/images/mediaTypeGraphics/media-graphic-pdf.png"
153
+ [src]="Stratus.BaseUrl + 'sitetheorymedia/images/mediaTypeGraphics/media-graphic-pdf.png'"
154
154
  [alt]="mediaEntity.name"
155
155
  [ngClass]="{'selected' : isSelected(mediaEntity)}">
156
156
  </ng-container>
@@ -159,7 +159,7 @@
159
159
  <!-- TODO: make this a local file -->
160
160
  <img mat-card-image
161
161
  class="generic-word basic-image"
162
- src="/assets/1/0/bundles/sitetheorymedia/images/mediaTypeGraphics/media-graphic-doc.png"
162
+ [src]="Stratus.BaseUrl + 'sitetheorymedia/images/mediaTypeGraphics/media-graphic-doc.png'"
163
163
  [alt]="mediaEntity.name"
164
164
  [ngClass]="{'selected' : isSelected(mediaEntity)}">
165
165
  </ng-container>
@@ -12,7 +12,7 @@ System.register(["@angular/core", "@angular/forms", "@angular/material/dialog",
12
12
  var __param = (this && this.__param) || function (paramIndex, decorator) {
13
13
  return function (target, key) { decorator(target, key, paramIndex); }
14
14
  };
15
- var core_1, forms_1, dialog_1, snack_bar_1, operators_1, lodash_1, stratus_1, environment_1, backend_service_1, model_1, responsive_component_1, installDir, systemDir, moduleName, parentModuleName, min, localDir, MediaDialogComponent;
15
+ var core_1, forms_1, dialog_1, snack_bar_1, operators_1, lodash_1, stratus_1, environment_1, backend_service_1, model_1, responsive_component_1, systemDir, moduleName, parentModuleName, min, localDir, MediaDialogComponent;
16
16
  var __moduleName = context_1 && context_1.id;
17
17
  return {
18
18
  setters: [
@@ -51,12 +51,11 @@ System.register(["@angular/core", "@angular/forms", "@angular/material/dialog",
51
51
  }
52
52
  ],
53
53
  execute: function () {
54
- installDir = '/assets/1/0/bundles';
55
54
  systemDir = '@stratusjs/angular';
56
55
  moduleName = 'media-dialog';
57
56
  parentModuleName = 'editor';
58
57
  min = !environment_1.cookie('env') ? '.min' : '';
59
- localDir = `${installDir}/${boot.configuration.paths[`${systemDir}/*`].replace(/[^/]*$/, '')}`;
58
+ localDir = `${stratus_1.Stratus.BaseUrl}${boot.configuration.paths[`${systemDir}/*`].replace(/[^/]*$/, '')}`;
60
59
  MediaDialogComponent = class MediaDialogComponent extends responsive_component_1.ResponsiveComponent {
61
60
  constructor(dialogRef, data, fb, backend, snackBar, ref) {
62
61
  super();
@@ -67,6 +66,8 @@ System.register(["@angular/core", "@angular/forms", "@angular/material/dialog",
67
66
  this.snackBar = snackBar;
68
67
  this.ref = ref;
69
68
  this.title = moduleName + '_component';
69
+ this._ = lodash_1.default;
70
+ this.Stratus = stratus_1.Stratus;
70
71
  this.apiBase = '/Api/Media';
71
72
  this.mediaEntities = [];
72
73
  this.isMediaLoading = true;
@@ -78,7 +79,6 @@ System.register(["@angular/core", "@angular/forms", "@angular/material/dialog",
78
79
  ngOnInit() {
79
80
  this.uid = lodash_1.default.uniqueId(`sa_${lodash_1.default.snakeCase(moduleName)}_component_`);
80
81
  stratus_1.Stratus.Instances[this.uid] = this;
81
- this._ = lodash_1.default;
82
82
  stratus_1.Stratus.Internals.CssLoader(`${localDir}/${parentModuleName}/${moduleName}.component${min}.css`);
83
83
  this.model = this.data.model;
84
84
  this.property = this.data.property;
@@ -1 +1 @@
1
- {"version":3,"sources":["media-dialog.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA8DM,UAAU,GAAG,qBAAqB,CAAA;YAClC,SAAS,GAAG,oBAAoB,CAAA;YAChC,UAAU,GAAG,cAAc,CAAA;YAC3B,gBAAgB,GAAG,QAAQ,CAAA;YAG3B,GAAG,GAAG,CAAC,oBAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;YAClC,QAAQ,GAAG,GAAG,UAAU,IAAI,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,SAAS,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAA;YAUvF,oBAAoB,GAAjC,MAAa,oBAAqB,SAAQ,0CAAmB;gBAqCzD,YACW,SAA6C,EACpB,IAAqB,EAC7C,EAAe,EACf,OAAuB,EACvB,QAAqB,EACnB,GAAsB;oBAGhC,KAAK,EAAE,CAAA;oBARA,cAAS,GAAT,SAAS,CAAoC;oBACpB,SAAI,GAAJ,IAAI,CAAiB;oBAC7C,OAAE,GAAF,EAAE,CAAa;oBACf,YAAO,GAAP,OAAO,CAAgB;oBACvB,aAAQ,GAAR,QAAQ,CAAa;oBACnB,QAAG,GAAH,GAAG,CAAmB;oBAxCpC,UAAK,GAAG,UAAU,GAAG,YAAY,CAAA;oBAQjC,YAAO,GAAG,YAAY,CAAA;oBACtB,kB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CAAC,GAAG;;gDAE9B,KAAK,CAAC,GAAG;gCACzB,CAAA;yBACnB;wBAED,OAAO,mDAAmD,KAAK,CAAC,GAAG,mEAAmE,CAAA;qBACzI;oBACD,OAAO,CAAC,IAAI,CAAC,wCAAwC,KAAK,CAAC,IAAI,kBAAkB,KAAK,CAAC,EAAE,EAAE,CAAC,CAAA;oBAC5F,OAAO,IAAI,CAAA;gBACf,CAAC;aACJ,CAAA;YAjTY,oBAAoB;gBALhC,gBAAS,CAAC;oBACP,QAAQ,EAAE,MAAM,UAAU,EAAE;oBAC5B,WAAW,EAAE,GAAG,QAAQ,IAAI,gBAAgB,IAAI,UAAU,aAAa,GAAG,OAAO;iBAEpF,CAAC;gBAyCO,WAAA,aAAM,CAAC,wBAAe,CAAC,CAAA;iDADN,qBAAY,UAElB,mBAAW;oBACN,gCAAc;oBACb,uBAAW;oBACd,wBAAiB;eA5C3B,oBAAoB,CAiThC;;QA6DD,CAAC","file":"media-dialog.component.js"}
@@ -2,9 +2,9 @@
2
2
  && !_.startsWith(mediaEntity.mime, 'application')
3
3
  && !_.startsWith(mediaEntity.mime, 'image')
4
4
  && !_.startsWith(mediaEntity.mime, 'video')"><span [innerText]="mediaEntity.mime"></span></ng-container></mat-card-subtitle></mat-card-header><ng-container *ngIf="mediaEntity._thumbSrc"><img mat-card-image class="generic-thumb basic-image" [src]="mediaEntity.mime !== 'image/gif' ? mediaEntity._thumbSrc : mediaEntity._directUrl" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-container><ng-container *ngIf="!mediaEntity._thumbSrc
5
- && mediaEntity.mime === 'video'"><ng-container *ngIf="mediaEntity.service === 'vimeo'"><ng-container *ngIf="mediaEntity.meta && mediaEntity.meta.thumbnail_large; else basicVimeoButton"><img mat-card-image class="vimeo" [src]="mediaEntity.meta.thumbnail_large" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-container><ng-template #basicVimeoButton><img mat-card-image class="vimeo basic-image" src="/assets/1/0/bundles/sitetheorymedia/images/mediaTypeIcons/media-icon-video.png" style="background: #4e4e4e;" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-template></ng-container><ng-container *ngIf="mediaEntity.service === 'youtube'"><ng-container *ngIf="mediaEntity.serviceMediaId; else basicYoutubeButton"><img mat-card-image class="youtube" [src]="'https://img.youtube.com/vi/' + mediaEntity.serviceMediaId + '/hqdefault.jpg'" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-container><ng-template #basicYoutubeButton><img mat-card-image class="youtube basic-image" src="/assets/1/0/bundles/sitetheorymedia/images/mediaTypeIcons/media-icon-video.png" style="background: #4e4e4e;" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-template></ng-container><ng-container *ngIf="mediaEntity.service === 'facebook'"><img mat-card-image class="facebook-video basic-image" src="/assets/1/0/bundles/sitetheorymedia/images/mediaTypeIcons/media-icon-video.png" style="background: #4e4e4e;" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-container><ng-container *ngIf="!['vimeo', 'youtube', 'facebook'].includes(mediaEntity.service)"><img mat-card-image class="generic-video basic-image" src="/assets/1/0/bundles/sitetheorymedia/images/mediaTypeIcons/media-icon-video.png" style="background: #4e4e4e;" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-container></ng-container><ng-container *ngIf="!mediaEntity._thumbSrc
6
- && _.startsWith(mediaEntity.mime, 'audio')"><img mat-card-image class="generic-audio" src="/assets/1/0/bundles/sitetheorymedia/images/mediaTypeGraphics/media-graphic-audio.png" style="background: #4e4e4e;" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-container><ng-container *ngIf="!mediaEntity._thumbSrc
7
- && mediaEntity.mime === 'application/pdf'"><img mat-card-image class="generic-pdf basic-image" src="/assets/1/0/bundles/sitetheorymedia/images/mediaTypeGraphics/media-graphic-pdf.png" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-container><ng-container *ngIf="!mediaEntity._thumbSrc
8
- && mediaEntity.mime === 'application/msword'"><img mat-card-image class="generic-word basic-image" src="/assets/1/0/bundles/sitetheorymedia/images/mediaTypeGraphics/media-graphic-doc.png" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-container><ng-container *ngIf="!mediaEntity._thumbSrc
5
+ && mediaEntity.mime === 'video'"><ng-container *ngIf="mediaEntity.service === 'vimeo'"><ng-container *ngIf="mediaEntity.meta && mediaEntity.meta.thumbnail_large; else basicVimeoButton"><img mat-card-image class="vimeo" [src]="mediaEntity.meta.thumbnail_large" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-container><ng-template #basicVimeoButton><img mat-card-image class="vimeo basic-image" [src]="Stratus.BaseUrl + 'sitetheorymedia/images/mediaTypeIcons/media-icon-video.png'" style="background: #4e4e4e;" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-template></ng-container><ng-container *ngIf="mediaEntity.service === 'youtube'"><ng-container *ngIf="mediaEntity.serviceMediaId; else basicYoutubeButton"><img mat-card-image class="youtube" [src]="'https://img.youtube.com/vi/' + mediaEntity.serviceMediaId + '/hqdefault.jpg'" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-container><ng-template #basicYoutubeButton><img mat-card-image class="youtube basic-image" [src]="Stratus.BaseUrl + 'sitetheorymedia/images/mediaTypeIcons/media-icon-video.png'" style="background: #4e4e4e;" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-template></ng-container><ng-container *ngIf="mediaEntity.service === 'facebook'"><img mat-card-image class="facebook-video basic-image" [src]="Stratus.BaseUrl + 'sitetheorymedia/images/mediaTypeIcons/media-icon-video.png'" style="background: #4e4e4e;" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-container><ng-container *ngIf="!['vimeo', 'youtube', 'facebook'].includes(mediaEntity.service)"><img mat-card-image class="generic-video basic-image" [src]="Stratus.BaseUrl + 'sitetheorymedia/images/mediaTypeIcons/media-icon-video.png'" style="background: #4e4e4e;" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-container></ng-container><ng-container *ngIf="!mediaEntity._thumbSrc
6
+ && _.startsWith(mediaEntity.mime, 'audio')"><img mat-card-image class="generic-audio" [src]="Stratus.BaseUrl + 'sitetheorymedia/images/mediaTypeGraphics/media-graphic-audio.png'" style="background: #4e4e4e;" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-container><ng-container *ngIf="!mediaEntity._thumbSrc
7
+ && mediaEntity.mime === 'application/pdf'"><img mat-card-image class="generic-pdf basic-image" [src]="Stratus.BaseUrl + 'sitetheorymedia/images/mediaTypeGraphics/media-graphic-pdf.png'" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-container><ng-container *ngIf="!mediaEntity._thumbSrc
8
+ && mediaEntity.mime === 'application/msword'"><img mat-card-image class="generic-word basic-image" [src]="Stratus.BaseUrl + 'sitetheorymedia/images/mediaTypeGraphics/media-graphic-doc.png'" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-container><ng-container *ngIf="!mediaEntity._thumbSrc
9
9
  && mediaEntity.service === 'directlink'
10
10
  && mediaEntity.file"><img mat-card-image class="direct-link" [src]="mediaEntity.file" [alt]="mediaEntity.name" [ngClass]="{'selected' : isSelected(mediaEntity)}"></ng-container><mat-card-actions><button mat-button [disabled]="isSelected(mediaEntity)" (click)="select(mediaEntity)"><span [innerText]="isSelected(mediaEntity) ? 'Selected' : 'Insert'"></span></button></mat-card-actions></mat-card></div></div><mat-paginator [length]="(!meta || !meta.pagination) ? mediaEntities.length : (meta.pagination.countTotal || mediaEntities.length)" [pageSize]="(!meta || !meta.pagination) ? limit : (meta.pagination.limit || limit)" [pageSizeOptions]="[5, 10, 25, 50, 100]" (page)="onPage($event)"></mat-paginator></div>
@@ -1 +1 @@
1
- System.register(["@angular/core","@angular/forms","@angular/material/dialog","@angular/material/snack-bar","rxjs/operators","lodash","@stratusjs/runtime/stratus","@stratusjs/core/environment","@stratusjs/angular/backend.service","@stratusjs/angularjs/services/model","@stratusjs/angular/core/responsive.component"],function(e,t){"use strict";var i,a,s,r,d,n,o,l,c,u,m,h,f,g,p,b=this&&this.__decorate||function(e,t,i,a){var s,r=arguments.length,d=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)d=Reflect.decorate(e,t,i,a);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(d=(r<3?s(d):r>3?s(t,i,d):s(t,i))||d);return r>3&&d&&Object.defineProperty(t,i,d),d},v=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},y=this&&this.__param||function(e,t){return function(i,a){t(i,a,e)}};t&&t.id;return{setters:[function(e){i=e},function(e){a=e},function(e){s=e},function(e){r=e},function(e){d=e},function(e){n=e},function(e){o=e},function(e){l=e},function(e){c=e},function(e){u=e},function(e){m=e}],execute:function(){"/assets/1/0/bundles","@stratusjs/angular",h="media-dialog","editor",f=l.cookie("env")?"":".min",g=`/assets/1/0/bundles/${boot.configuration.paths["@stratusjs/angular/*"].replace(/[^/]*$/,"")}`,p=class extends m.ResponsiveComponent{constructor(e,t,i,a,s,r){super(),this.dialogRef=e,this.data=t,this.fb=i,this.backend=a,this.snackBar=s,this.ref=r,this.title=h+"_component",this.apiBase="/Api/Media",this.mediaEntities=[],this.isMediaLoading=!0,this.limit=20,this.eventInsert=!0,this.selected=[],this.embedly=!0}ngOnInit(){this.uid=n.default.uniqueId(`sa_${n.default.snakeCase(h)}_component_`),o.Stratus.Instances[this.uid]=this,this._=n.default,o.Stratus.Internals.CssLoader(`${g}/editor/media-dialog.component${f}.css`),this.model=this.data.model,this.property=this.data.property,this.editor=this.data.editor,this.eventManager=this.data.eventManager,n.default.isBoolean(this.data.eventInsert)&&(this.eventInsert=this.data.eventInsert),this.dialogMediaForm=this.fb.group({mediaQueryInput:""}),this.dialogMediaForm.get("mediaQueryInput").valueChanges.pipe(d.debounceTime(300),d.tap(()=>{}),d.switchMap(e=>this.getQuery(e))).subscribe(e=>this.processMedia(e)),this.getQuery().subscribe(e=>this.processMedia(e)),this.refresh()}onCancelClick(){this.dialogRef.close(),this.refresh()}onPage(e){this.pageEvent=e,this.getQuery(this.lastMediaQuery).subscribe(e=>this.processMedia(e))}getQueryUrl(e){let t=this.limit,i=1;return this.pageEvent&&(t=this.pageEvent.pageSize,i=this.pageEvent.pageIndex+1),e=n.default.isString(e)&&!n.default.isEmpty(e)?`"${e}"`:"",`${this.apiBase}?limit=${t}&p=${i}&q=${e}`}getQuery(e){return this.lastMediaQuery=e,this.isMediaLoading=!0,this.backend.get(this.getQueryUrl(e)).pipe(d.finalize(()=>this.isMediaLoading=!1))}processMedia(e){if(!e.ok||200!==e.status||n.default.isEmpty(e.body))return this.meta={},this.mediaEntities=[],this.refresh(),this.mediaEntities;this.meta=n.default.get(e.body,"meta")||{};const t=n.default.get(e.body,"payload")||e.body;return n.default.isEmpty(t)||!Array.isArray(t)?(this.mediaEntities=[],this.isMediaLoading=!1,this.refresh(),this.mediaEntities):(this.mediaEntities=t,this.isMediaLoading=!1,this.refresh(),this.mediaEntities)}select(e){if(n.default.isUndefined(e))return;const t=this.createEmbed(e);return t?(this.selected.push(e.id),this.eventInsert?void(this.eventManager?this.eventManager.trigger("media-insert",t,this.editor):console.warn("media-dialog: event manager is not set.")):this.model instanceof u.Model&&n.default.isString(this.property)?(console.warn("media-dialog: disabling eventInsert is not recommended."),void this.model.set(this.property,this.model.get(this.property)+t)):void console.warn("media-dialog: event manager not available.")):(console.warn(`media-dialog: unable to build embed for Media ID: ${e.id}`),void this.snackBar.open(`Unable to build embed for Media ID: ${e.id}.`,"dismiss",{duration:5e3,horizontalPosition:"right",verticalPosition:"bottom"}))}isSelected(e){if(!n.default.isUndefined(e))return n.default.includes(this.selected,e.id)}createEmbed(e){if(e._embedCode)return e._embedCode;if(n.default.startsWith(e.mime,"image"))return!e._thumbSrc||"directlink"===e.service&&!e.file?(console.warn(`media-dialog: unable to determine image source for media id: ${e.id}`),null):`<img src="${e._thumbSrc||e.file}" alt="${e.name||e.filename} ${"image/gif"!==e.mime?"data-stratus-src":""}">`;if("video"===e.mime){if(e.embed)return e.embed;const t='width="100%" scrolling="no" frameborder="0" allowTransparency="true" allowFullScreen="true" webkitAllowFullScreen="" mozAllowFullScreen=""';if("facebook"===e.service){const i=e.url||e.file;return i?this.embedly?`<div class="fr-embedly"\n data-original-embed="<a href='${i}' data-card-branding='0' class='embedly-card'></a>"\n style="height: 998px;">\n <a href="${i}" data-card-branding="0" class="embedly-card"></a>\n </div>`:`<iframe src="https://www.facebook.com/plugins/video.php?href=${i}" ${t}></iframe>`:(console.warn(`media-dialog: unable to find url for video with media id: ${e.id}`),null)}return e.serviceMediaId?"vimeo"===e.service?this.embedly?`<div class="fr-embedly"\n data-original-embed="<a href='https://vimeo.com/${e.serviceMediaId}' data-card-branding='0' class='embedly-card'></a>"\n style="height: 370px;">\n <a href="https://vimeo.com/${e.serviceMediaId}" data-card-branding="0" class="embedly-card"></a>\n </div>`:`<iframe src="https://player.vimeo.com/video/${e.serviceMediaId}" ${t}></iframe>`:"youtube"===e.service?this.embedly?`<div class="fr-embedly"\n data-original-embed="<a href='https://www.youtube.com/watch?v=${e.serviceMediaId}' data-card-branding='0' class='embedly-card'></a>"\n style="height: 370px;">\n <a href="https://www.youtube.com/watch?v=${e.serviceMediaId}" data-card-branding="0" class="embedly-card"></a>\n </div>`:`<iframe src="https://www.youtube.com/embed/${e.serviceMediaId}" ${t}></iframe>`:(console.warn(`media-dialog: unsupported service: ${e.service} for media id: ${e.id}`),null):(console.warn(`media-dialog: unable to find serviceMediaId for video with media id: ${e.id}`),null)}return n.default.startsWith(e.mime,"audio")?e.url?`<audio controls>\n <source src="https://${e.url}" type="${e.mime}">\n <p>\n Your browser doesn't support HTML5 audio, but you can <a href="https://${e.url}">download the audio here</a>.\n </p>\n </audio>`:(console.warn(`media-dialog: unable to determine audio source for media id: ${e.id}`),null):"application/pdf"===e.mime?e.url?this.embedly?`<div class="fr-embedly"\n data-original-embed="<a href='https://${e.url}' data-card-branding='0' class='embedly-card'></a>"\n style="height: 71px;">\n <a href="https://${e.url}" data-card-branding="0" class="embedly-card"></a>\n </div>`:`<iframe src="https://docs.google.com/viewer?url=${e.url}&embedded=true" style="min-height: 500px;" width="100%"></iframe>`:(console.warn(`media-dialog: unable to determine PDF source for media id: ${e.id}`),null):"application/msword"===e.mime?e.url?this.embedly?`<div class="fr-embedly"\n data-original-embed="<a href='https://${e.url}' data-card-branding='0' class='embedly-card'></a>"\n style="height: 71px;">\n <a href="https://${e.url}" data-card-branding="0" class="embedly-card"></a>\n </div>`:`<iframe src="https://docs.google.com/viewer?url=${e.url}&embedded=true" style="min-height: 500px;" width="100%"></iframe>`:(console.warn(`media-dialog: unable to determine Word Document source for media id: ${e.id}`),null):(console.warn(`media-dialog: unsupported mime type: ${e.mime} for media id: ${e.id}`),null)}},p=b([i.Component({selector:"sa-media-dialog",templateUrl:`${g}/editor/media-dialog.component${f}.html`}),y(1,i.Inject(s.MAT_DIALOG_DATA)),v("design:paramtypes",[s.MatDialogRef,Object,a.FormBuilder,c.BackendService,r.MatSnackBar,i.ChangeDetectorRef])],p),e("MediaDialogComponent",p)}}});
1
+ System.register(["@angular/core","@angular/forms","@angular/material/dialog","@angular/material/snack-bar","rxjs/operators","lodash","@stratusjs/runtime/stratus","@stratusjs/core/environment","@stratusjs/angular/backend.service","@stratusjs/angularjs/services/model","@stratusjs/angular/core/responsive.component"],function(e,t){"use strict";var i,a,s,r,d,n,o,l,c,u,m,h,f,g,p,b=this&&this.__decorate||function(e,t,i,a){var s,r=arguments.length,d=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)d=Reflect.decorate(e,t,i,a);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(d=(r<3?s(d):r>3?s(t,i,d):s(t,i))||d);return r>3&&d&&Object.defineProperty(t,i,d),d},v=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},y=this&&this.__param||function(e,t){return function(i,a){t(i,a,e)}};t&&t.id;return{setters:[function(e){i=e},function(e){a=e},function(e){s=e},function(e){r=e},function(e){d=e},function(e){n=e},function(e){o=e},function(e){l=e},function(e){c=e},function(e){u=e},function(e){m=e}],execute:function(){"@stratusjs/angular",h="media-dialog","editor",f=l.cookie("env")?"":".min",g=`${o.Stratus.BaseUrl}${boot.configuration.paths["@stratusjs/angular/*"].replace(/[^/]*$/,"")}`,p=class extends m.ResponsiveComponent{constructor(e,t,i,a,s,r){super(),this.dialogRef=e,this.data=t,this.fb=i,this.backend=a,this.snackBar=s,this.ref=r,this.title=h+"_component",this._=n.default,this.Stratus=o.Stratus,this.apiBase="/Api/Media",this.mediaEntities=[],this.isMediaLoading=!0,this.limit=20,this.eventInsert=!0,this.selected=[],this.embedly=!0}ngOnInit(){this.uid=n.default.uniqueId(`sa_${n.default.snakeCase(h)}_component_`),o.Stratus.Instances[this.uid]=this,o.Stratus.Internals.CssLoader(`${g}/editor/media-dialog.component${f}.css`),this.model=this.data.model,this.property=this.data.property,this.editor=this.data.editor,this.eventManager=this.data.eventManager,n.default.isBoolean(this.data.eventInsert)&&(this.eventInsert=this.data.eventInsert),this.dialogMediaForm=this.fb.group({mediaQueryInput:""}),this.dialogMediaForm.get("mediaQueryInput").valueChanges.pipe(d.debounceTime(300),d.tap(()=>{}),d.switchMap(e=>this.getQuery(e))).subscribe(e=>this.processMedia(e)),this.getQuery().subscribe(e=>this.processMedia(e)),this.refresh()}onCancelClick(){this.dialogRef.close(),this.refresh()}onPage(e){this.pageEvent=e,this.getQuery(this.lastMediaQuery).subscribe(e=>this.processMedia(e))}getQueryUrl(e){let t=this.limit,i=1;return this.pageEvent&&(t=this.pageEvent.pageSize,i=this.pageEvent.pageIndex+1),e=n.default.isString(e)&&!n.default.isEmpty(e)?`"${e}"`:"",`${this.apiBase}?limit=${t}&p=${i}&q=${e}`}getQuery(e){return this.lastMediaQuery=e,this.isMediaLoading=!0,this.backend.get(this.getQueryUrl(e)).pipe(d.finalize(()=>this.isMediaLoading=!1))}processMedia(e){if(!e.ok||200!==e.status||n.default.isEmpty(e.body))return this.meta={},this.mediaEntities=[],this.refresh(),this.mediaEntities;this.meta=n.default.get(e.body,"meta")||{};const t=n.default.get(e.body,"payload")||e.body;return n.default.isEmpty(t)||!Array.isArray(t)?(this.mediaEntities=[],this.isMediaLoading=!1,this.refresh(),this.mediaEntities):(this.mediaEntities=t,this.isMediaLoading=!1,this.refresh(),this.mediaEntities)}select(e){if(n.default.isUndefined(e))return;const t=this.createEmbed(e);return t?(this.selected.push(e.id),this.eventInsert?void(this.eventManager?this.eventManager.trigger("media-insert",t,this.editor):console.warn("media-dialog: event manager is not set.")):this.model instanceof u.Model&&n.default.isString(this.property)?(console.warn("media-dialog: disabling eventInsert is not recommended."),void this.model.set(this.property,this.model.get(this.property)+t)):void console.warn("media-dialog: event manager not available.")):(console.warn(`media-dialog: unable to build embed for Media ID: ${e.id}`),void this.snackBar.open(`Unable to build embed for Media ID: ${e.id}.`,"dismiss",{duration:5e3,horizontalPosition:"right",verticalPosition:"bottom"}))}isSelected(e){if(!n.default.isUndefined(e))return n.default.includes(this.selected,e.id)}createEmbed(e){if(e._embedCode)return e._embedCode;if(n.default.startsWith(e.mime,"image"))return!e._thumbSrc||"directlink"===e.service&&!e.file?(console.warn(`media-dialog: unable to determine image source for media id: ${e.id}`),null):`<img src="${e._thumbSrc||e.file}" alt="${e.name||e.filename} ${"image/gif"!==e.mime?"data-stratus-src":""}">`;if("video"===e.mime){if(e.embed)return e.embed;const t='width="100%" scrolling="no" frameborder="0" allowTransparency="true" allowFullScreen="true" webkitAllowFullScreen="" mozAllowFullScreen=""';if("facebook"===e.service){const i=e.url||e.file;return i?this.embedly?`<div class="fr-embedly"\n data-original-embed="<a href='${i}' data-card-branding='0' class='embedly-card'></a>"\n style="height: 998px;">\n <a href="${i}" data-card-branding="0" class="embedly-card"></a>\n </div>`:`<iframe src="https://www.facebook.com/plugins/video.php?href=${i}" ${t}></iframe>`:(console.warn(`media-dialog: unable to find url for video with media id: ${e.id}`),null)}return e.serviceMediaId?"vimeo"===e.service?this.embedly?`<div class="fr-embedly"\n data-original-embed="<a href='https://vimeo.com/${e.serviceMediaId}' data-card-branding='0' class='embedly-card'></a>"\n style="height: 370px;">\n <a href="https://vimeo.com/${e.serviceMediaId}" data-card-branding="0" class="embedly-card"></a>\n </div>`:`<iframe src="https://player.vimeo.com/video/${e.serviceMediaId}" ${t}></iframe>`:"youtube"===e.service?this.embedly?`<div class="fr-embedly"\n data-original-embed="<a href='https://www.youtube.com/watch?v=${e.serviceMediaId}' data-card-branding='0' class='embedly-card'></a>"\n style="height: 370px;">\n <a href="https://www.youtube.com/watch?v=${e.serviceMediaId}" data-card-branding="0" class="embedly-card"></a>\n </div>`:`<iframe src="https://www.youtube.com/embed/${e.serviceMediaId}" ${t}></iframe>`:(console.warn(`media-dialog: unsupported service: ${e.service} for media id: ${e.id}`),null):(console.warn(`media-dialog: unable to find serviceMediaId for video with media id: ${e.id}`),null)}return n.default.startsWith(e.mime,"audio")?e.url?`<audio controls>\n <source src="https://${e.url}" type="${e.mime}">\n <p>\n Your browser doesn't support HTML5 audio, but you can <a href="https://${e.url}">download the audio here</a>.\n </p>\n </audio>`:(console.warn(`media-dialog: unable to determine audio source for media id: ${e.id}`),null):"application/pdf"===e.mime?e.url?this.embedly?`<div class="fr-embedly"\n data-original-embed="<a href='https://${e.url}' data-card-branding='0' class='embedly-card'></a>"\n style="height: 71px;">\n <a href="https://${e.url}" data-card-branding="0" class="embedly-card"></a>\n </div>`:`<iframe src="https://docs.google.com/viewer?url=${e.url}&embedded=true" style="min-height: 500px;" width="100%"></iframe>`:(console.warn(`media-dialog: unable to determine PDF source for media id: ${e.id}`),null):"application/msword"===e.mime?e.url?this.embedly?`<div class="fr-embedly"\n data-original-embed="<a href='https://${e.url}' data-card-branding='0' class='embedly-card'></a>"\n style="height: 71px;">\n <a href="https://${e.url}" data-card-branding="0" class="embedly-card"></a>\n </div>`:`<iframe src="https://docs.google.com/viewer?url=${e.url}&embedded=true" style="min-height: 500px;" width="100%"></iframe>`:(console.warn(`media-dialog: unable to determine Word Document source for media id: ${e.id}`),null):(console.warn(`media-dialog: unsupported mime type: ${e.mime} for media id: ${e.id}`),null)}},p=b([i.Component({selector:"sa-media-dialog",templateUrl:`${g}/editor/media-dialog.component${f}.html`}),y(1,i.Inject(s.MAT_DIALOG_DATA)),v("design:paramtypes",[s.MatDialogRef,Object,a.FormBuilder,c.BackendService,r.MatSnackBar,i.ChangeDetectorRef])],p),e("MediaDialogComponent",p)}}});
@@ -60,14 +60,13 @@ import {
60
60
  } from '@stratusjs/angular/core/responsive.component'
61
61
 
62
62
  // Local Setup
63
- const installDir = '/assets/1/0/bundles'
64
63
  const systemDir = '@stratusjs/angular'
65
64
  const moduleName = 'media-dialog'
66
65
  const parentModuleName = 'editor'
67
66
 
68
67
  // Directory Template
69
68
  const min = !cookie('env') ? '.min' : ''
70
- const localDir = `${installDir}/${boot.configuration.paths[`${systemDir}/*`].replace(/[^/]*$/, '')}`
69
+ const localDir = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir}/*`].replace(/[^/]*$/, '')}`
71
70
 
72
71
  /**
73
72
  * @title Dialog for Nested Tree
@@ -84,7 +83,8 @@ export class MediaDialogComponent extends ResponsiveComponent implements OnInit
84
83
  uid: string
85
84
 
86
85
  // Dependencies
87
- _: any
86
+ _ = _
87
+ Stratus = Stratus
88
88
 
89
89
  // TODO: Move this to its own AutoComplete Component
90
90
  // AutoComplete Data
@@ -134,9 +134,6 @@ export class MediaDialogComponent extends ResponsiveComponent implements OnInit
134
134
  this.uid = _.uniqueId(`sa_${_.snakeCase(moduleName)}_component_`)
135
135
  Stratus.Instances[this.uid] = this
136
136
 
137
- // Dependencies
138
- this._ = _
139
-
140
137
  // TODO: Assess & Possibly Remove when the System.js ecosystem is complete
141
138
  // Load Component CSS until System.js can import CSS properly.
142
139
  Stratus.Internals.CssLoader(`${localDir}/${parentModuleName}/${moduleName}.component${min}.css`)
@@ -6,9 +6,9 @@
6
6
  <div class="media-selected-list-header border-default border-default-bottom">
7
7
  <h3 [textContent]="'Selected ' + (type || 'Items')"></h3>
8
8
  </div>
9
- <div class="media-selected-message-box">
10
- Nothing has been selected.
11
- </div>
9
+ <!--<div class="media-selected-message-box">-->
10
+ <!-- Nothing has been selected.-->
11
+ <!--</div>-->
12
12
  </ng-template>
13
13
 
14
14
 
@@ -39,7 +39,7 @@
39
39
  <!--<div class="image" no-flex stratus-src-->
40
40
  <!--[ngStyle]="{'background': 'url(' + findImage(selectedModel) + ') no-repeat center center', 'background-size': 'cover'}"-->
41
41
  <!--&gt;-->
42
- <!--<img class="shapeholder" src="/assets/1/0/bundles/sitetheorycore/images/shapeholder-square.png">-->
42
+ <!--<img class="shapeholder" [src]="Stratus.BaseUrl + 'sitetheorycore/images/shapeholder-square.png'">-->
43
43
  <!--</div>-->
44
44
 
45
45
  <!-- This only shows the bestImage if this isn't a Video, since images for Videos are not hosted by us, thus cannot lazy load a proper size -->
@@ -70,13 +70,13 @@
70
70
  [ngClass]="_.get(selectedModel, 'contentType.class') + '-background-color'">
71
71
 
72
72
  <mat-icon class="content-type-icon position-center"
73
- [svgIcon]="getSvg('/assets/1/0/bundles/' + (_.get(selectedModel, 'contentType.iconResourcePath') || _.get(selectedModel, 'iconResourcePath'))) | async">
73
+ [svgIcon]="getSvg(Stratus.BaseUrl + (_.get(selectedModel, 'contentType.iconResourcePath') || _.get(selectedModel, 'iconResourcePath'))) | async">
74
74
  Icon
75
75
  </mat-icon>
76
76
  </div>
77
77
 
78
78
  <!-- Shapeholder -->
79
- <img class="shapeholder" src="/assets/1/0/bundles/sitetheorycore/images/shapeholder-square.png">
79
+ <img class="shapeholder" [src]="Stratus.BaseUrl + 'sitetheorycore/images/shapeholder-square.png'">
80
80
 
81
81
  <!--(click)="remove(selectedModel)"-->
82
82
  <!--(click)="mediaDetails(selectedModel)"-->
@@ -90,7 +90,7 @@
90
90
  <!-- to break away from the div and float to the top of the selector container-->
91
91
  <!-- &ndash;&gt;-->
92
92
  <!-- <mat-icon class="content-type-icon"-->
93
- <!-- [svgIcon]="getSvg('/assets/1/0/bundles/' + _.get(selectedModel, 'contentType.iconResourcePath')) | async">-->
93
+ <!-- [svgIcon]="getSvg(Stratus.BaseUrl + _.get(selectedModel, 'contentType.iconResourcePath')) | async">-->
94
94
  <!-- ContentType Icon-->
95
95
  <!-- </mat-icon>-->
96
96
  <!-- <span class="comment content-type-name font-body"-->
@@ -1 +1 @@
1
- <mat-progress-bar mode="indeterminate" *ngIf="!styled"></mat-progress-bar><ng-template #emptyList><div class="media-selected-list-header border-default border-default-bottom"><h3 [textContent]="'Selected ' + (type || 'Items')"></h3></div><div class="media-selected-message-box">Nothing has been selected.</div></ng-template><div class="media-selector" *ngIf="styled"><div class="media-selected-list-header border-default border-default-bottom" *ngIf="!empty; else emptyList"><h3 [textContent]="'Selected ' + (type || 'Items')"></h3><p class="note">Drag to reorder</p></div><div cdkDropList cdkDropListOrientation="horizontal" class="media-selected-list" (cdkDropListDropped)="drop($event)"><div cdkDrag class="media-selected-box" [cdkDragDisabled]="_.get(selectedModel, 'status') < 1" [ngClass]="{'disabled': _.get(selectedModel, 'status') < 1}" *ngFor="let selectedModel of dataSub | async"><div class="media-selected-list-container full-width full-height"><div class="column-image position-anchor full-width full-height" [matTooltip]="selectedModel.name" matTooltipPosition="above" [attr.aria-label]="selectedModel.name"><div class="image position-all full-width full-height" *ngIf="has(selectedModel, '_thumbSrc') && !has(selectedModel, 'service')" data-stratus-src [ngStyle]="{'background': 'url(' + _.get(selectedModel, '_thumbSrc') + ') no-repeat center center', 'background-size': 'cover'}"></div><div class="image position-all full-width full-height" *ngIf="!has(selectedModel, '_thumbSrc') && has(selectedModel, 'service') && _.get(selectedModel, 'service') === 'vimeo'" [ngStyle]="{'background': 'url(' + _.get(selectedModel, 'meta.thumbnail_medium') + ') no-repeat center center', 'background-size': 'cover'}"></div><div class="image position-all full-width full-height" *ngIf="!has(selectedModel, '_thumbSrc') && has(selectedModel, 'service') && _.get(selectedModel, 'service') === 'youtube'" [ngStyle]="{'background': 'url(' + 'https://img.youtube.com/vi/' + _.get(selectedModel, 'serviceMediaId') + '/0.jpg' + ') no-repeat center center', 'background-size': 'cover'}"></div><div class="no-image-icon position-all full-width full-height" *ngIf="!has(selectedModel, '_thumbSrc') && !has(selectedModel, 'service')" [ngClass]="_.get(selectedModel, 'contentType.class') + '-background-color'"><mat-icon class="content-type-icon position-center" [svgIcon]="getSvg('/assets/1/0/bundles/' + (_.get(selectedModel, 'contentType.iconResourcePath') || _.get(selectedModel, 'iconResourcePath'))) | async">Icon</mat-icon></div><img class="shapeholder" src="/assets/1/0/bundles/sitetheorycore/images/shapeholder-square.png"></div></div></div><div class="media-selected-box"><a class="position-anchor accent-background-hover border-default border-default-all color-primary" [matTooltip]="(libraryDisplay ? 'Open' : 'Close') + ' Media Library'" (click)="toggleLibrary()" [ngClass]="{'library-toggle-open': libraryDisplay}"><mat-icon class="position-center" *ngIf="!libraryDisplay" svgIcon="media_selector_add" aria-hidden="false" aria-label="Add">Add</mat-icon><div class="btn-text small-all-caps position-center" *ngIf="libraryDisplay">Close Library</div></a></div></div></div>
1
+ <mat-progress-bar mode="indeterminate" *ngIf="!styled"></mat-progress-bar><ng-template #emptyList><div class="media-selected-list-header border-default border-default-bottom"><h3 [textContent]="'Selected ' + (type || 'Items')"></h3></div></ng-template><div class="media-selector" *ngIf="styled"><div class="media-selected-list-header border-default border-default-bottom" *ngIf="!empty; else emptyList"><h3 [textContent]="'Selected ' + (type || 'Items')"></h3><p class="note">Drag to reorder</p></div><div cdkDropList cdkDropListOrientation="horizontal" class="media-selected-list" (cdkDropListDropped)="drop($event)"><div cdkDrag class="media-selected-box" [cdkDragDisabled]="_.get(selectedModel, 'status') < 1" [ngClass]="{'disabled': _.get(selectedModel, 'status') < 1}" *ngFor="let selectedModel of dataSub | async"><div class="media-selected-list-container full-width full-height"><div class="column-image position-anchor full-width full-height" [matTooltip]="selectedModel.name" matTooltipPosition="above" [attr.aria-label]="selectedModel.name"><div class="image position-all full-width full-height" *ngIf="has(selectedModel, '_thumbSrc') && !has(selectedModel, 'service')" data-stratus-src [ngStyle]="{'background': 'url(' + _.get(selectedModel, '_thumbSrc') + ') no-repeat center center', 'background-size': 'cover'}"></div><div class="image position-all full-width full-height" *ngIf="!has(selectedModel, '_thumbSrc') && has(selectedModel, 'service') && _.get(selectedModel, 'service') === 'vimeo'" [ngStyle]="{'background': 'url(' + _.get(selectedModel, 'meta.thumbnail_medium') + ') no-repeat center center', 'background-size': 'cover'}"></div><div class="image position-all full-width full-height" *ngIf="!has(selectedModel, '_thumbSrc') && has(selectedModel, 'service') && _.get(selectedModel, 'service') === 'youtube'" [ngStyle]="{'background': 'url(' + 'https://img.youtube.com/vi/' + _.get(selectedModel, 'serviceMediaId') + '/0.jpg' + ') no-repeat center center', 'background-size': 'cover'}"></div><div class="no-image-icon position-all full-width full-height" *ngIf="!has(selectedModel, '_thumbSrc') && !has(selectedModel, 'service')" [ngClass]="_.get(selectedModel, 'contentType.class') + '-background-color'"><mat-icon class="content-type-icon position-center" [svgIcon]="getSvg(Stratus.BaseUrl + (_.get(selectedModel, 'contentType.iconResourcePath') || _.get(selectedModel, 'iconResourcePath'))) | async">Icon</mat-icon></div><img class="shapeholder" [src]="Stratus.BaseUrl + 'sitetheorycore/images/shapeholder-square.png'"></div></div></div><div class="media-selected-box"><a class="position-anchor accent-background-hover border-default border-default-all color-primary" [matTooltip]="(libraryDisplay ? 'Open' : 'Close') + ' Media Library'" (click)="toggleLibrary()" [ngClass]="{'library-toggle-open': libraryDisplay}"><mat-icon class="position-center" *ngIf="!libraryDisplay" svgIcon="media_selector_add" aria-hidden="false" aria-label="Add">Add</mat-icon><div class="btn-text small-all-caps position-center" *ngIf="libraryDisplay">Close Library</div></a></div></div></div>