@stratusjs/angular 0.4.2 → 0.4.3
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.
- package/package.json +1 -1
- package/src/editor/citation-dialog.component.html +8 -11
- package/src/editor/citation-dialog.component.js +26 -12
- package/src/editor/citation-dialog.component.js.map +1 -1
- package/src/editor/citation-dialog.component.min.html +1 -1
- package/src/editor/citation-dialog.component.min.js +1 -1
- package/src/editor/citation-dialog.component.ts +34 -20
- package/src/editor/editor.component.css +5 -0
- package/src/editor/editor.component.css.map +1 -1
- package/src/editor/editor.component.js +2 -1
- package/src/editor/editor.component.js.map +1 -1
- package/src/editor/editor.component.min.css +1 -1
- package/src/editor/editor.component.min.js +1 -1
- package/src/editor/editor.component.scss +6 -0
- package/src/editor/editor.component.ts +3 -1
- package/src/froala/plugins/citationManager.css +18 -7
- package/src/froala/plugins/citationManager.css.map +1 -1
- package/src/froala/plugins/citationManager.js +106 -9
- package/src/froala/plugins/citationManager.js.map +1 -1
- package/src/froala/plugins/citationManager.min.css +1 -1
- package/src/froala/plugins/citationManager.min.js +1 -1
- package/src/froala/plugins/citationManager.scss +18 -7
- package/src/froala/plugins/citationManager.ts +166 -13
|
@@ -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/citation-dialog.component","@stratusjs/angular/editor/link-dialog.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/citationManager","@stratusjs/angular/froala/plugins/linkManager","@stratusjs/angular/froala/plugins/mediaManager"],function(e,t){"use strict";var i,n,a,o,r,s,l,d,c,g,u,m,p,h,f,b,y,v,k,w,S,x,C,M,D=this&&this.__decorate||function(e,t,i,n){var a,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(r=(o<3?a(r):o>3?a(t,i,r):a(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},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){n=e},function(e){a=e},function(e){o=e},function(e){r=e},function(e){s=e},function(e){l=e},function(e){d=e},function(e){c=e},function(e){g=e},function(e){u=e},function(e){m=e},function(e){p=e},function(e){h=e},function(e){f=e},function(e){b=e},function(e){y=e},function(e){},function(e){},function(e){},function(e){},function(e){},function(e){},function(e){},function(e){},function(e){},function(e){}],execute:function(){"@stratusjs/angular","froala-editor","codemirror",v="editor",k=h.cookie("env")?"":".min",w=`${l.Stratus.BaseUrl}${boot.configuration.paths["@stratusjs/angular/*"].replace(/[^\/]*$/,"")}`,S=`${l.Stratus.BaseUrl}${boot.configuration.paths["codemirror/*"].replace(/[^\/]*$/,"")}`,x=`${l.Stratus.BaseUrl}${boot.configuration.paths["froala-editor"].replace(/js\/[^\/]*$/,"")}`,C=(e,t)=>d.default.has(e,t)&&!d.default.isEmpty(d.default.get(e,t)),M=class extends c.RootComponent{constructor(e,t,i,a,s){super(),this.sanitizer=e,this.ref=t,this.elementRef=i,this.fb=a,this.dialog=s,this.title="editor_component",this.dev=!!h.cookie("env"),this.editor="froala",this._=d.default,this.has=C,this.log=console.log,this.Stratus=l.Stratus,this.registry=new p.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 n.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:["linkManager","formatOL","formatUL","indent","outdent","quote","paragraphFormat","paragraphStyle","alignLeft","alignCenter","alignRight","alignJustify"],moreRich:["insertImage","insertTable","insertVideo","insertFile","citationManager","insertHR","specialCharacters"],moreMisc:["html","undo","redo","fullscreen","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:y,codeMirrorOptions:{indentWithTabs:!1,lineNumbers:!0,lineWrapping:!0,mode:"text/html",tabMode:"space",tabSize:4},fileInsertButtons:["fileBack","|","mediaManager"],fileUploadURL:"https://app.sitetheory.io/?session="+h.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-.+","ng-.+","stratus-.+","sa-.+","accept","accept-charset","accesskey","action","align","allow","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","ng-app","ng-bind","ng-bind-html","ng-bind-template","ng-blur","ng-change","ng-checked","ng-class","ng-class-even","ng-class-odd","ng-click","ng-cloak","ng-controller","ng-copy","ng-csp","ng-cut","ng-dblclick","ng-disabled","ng-focus","ng-form","ng-hide","ng-href","ng-if","ng-include","ng-init","ng-jq","ng-keydown","ng-keypress","ng-keyup","ng-list","ng-maxlength","ng-minlength","ng-model","ng-model-options","ng-mousedown","ng-mouseenter","ng-mouseleave","ng-mousemove","ng-mouseover","ng-mouseup","ng-non-bindable","ng-on","ng-open","ng-options","ng-paste","ng-pattern","ng-pluralize","ng-prop","ng-readonly","ng-ref","ng-repeat","ng-required","ng-selected","ng-show","ng-src","ng-srcset","ng-style","ng-submit","ng-switch","ng-transclude","ng-value","ng-animate-children","ng-animate-swap","ng-outlet","ng-message","ng-message-default","ng-message-exp","ng-messages","ng-messages-include","ng-view","ng-swipe-left","ng-swipe-right","md-autocomplete","md-autofocus","md-button","md-calendar","md-card","md-checkbox","md-chip","md-chip-remove","md-chips","md-colors","md-contact-chips","md-content","md-datepicker","md-dialog","md-divider","md-fab-actions","md-fab-speed-dial","md-fab-toolbar","md-force-height","md-grid-list","md-grid-tile","md-highlight-text","md-icon","md-ink-ripple","md-input","md-input-container","md-list","md-list-item","md-menu","md-menu-bar","md-nav-bar","md-nav-item","md-optgroup","md-option","md-progress-circular","md-progress-linear","md-radio-button","md-radio-group","md-select","md-select-on-focus","md-sidenav","md-slider","md-slider-container","md-subheader","md-swipe-down","md-swipe-left","md-swipe-right","md-swipe-up","md-switch","md-tab","md-tabs","md-toolbar","md-tooltip","md-truncate","md-virtual-repeat","md-virtual-repeat-container","md-whiteframe","md-svg-src","sa-boot","sa-editor","sa-map","sa-media-selector","sa-selector","sa-stripe-payment-method-list","sa-stripe-payment-method-selector","sa-tree"],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","ng-app","ng-bind","ng-bind-html","ng-bind-template","ng-blur","ng-change","ng-checked","ng-class","ng-class-even","ng-class-odd","ng-click","ng-cloak","ng-controller","ng-copy","ng-csp","ng-cut","ng-dblclick","ng-disabled","ng-focus","ng-form","ng-hide","ng-href","ng-if","ng-include","ng-init","ng-jq","ng-keydown","ng-keypress","ng-keyup","ng-list","ng-maxlength","ng-minlength","ng-model","ng-model-options","ng-mousedown","ng-mouseenter","ng-mouseleave","ng-mousemove","ng-mouseover","ng-mouseup","ng-non-bindable","ng-on","ng-open","ng-options","ng-paste","ng-pattern","ng-pluralize","ng-prop","ng-readonly","ng-ref","ng-repeat","ng-required","ng-selected","ng-show","ng-src","ng-srcset","ng-style","ng-submit","ng-switch","ng-transclude","ng-value","ng-animate-children","ng-animate-swap","ng-outlet","ng-message","ng-message-default","ng-message-exp","ng-messages","ng-messages-include","ng-view","ng-swipe-left","ng-swipe-right","md-autocomplete","md-autofocus","md-button","md-calendar","md-card","md-checkbox","md-chip","md-chip-remove","md-chips","md-colors","md-contact-chips","md-content","md-datepicker","md-dialog","md-divider","md-fab-actions","md-fab-speed-dial","md-fab-toolbar","md-force-height","md-grid-list","md-grid-tile","md-highlight-text","md-icon","md-ink-ripple","md-input","md-input-container","md-list","md-list-item","md-menu","md-menu-bar","md-nav-bar","md-nav-item","md-optgroup","md-option","md-progress-circular","md-progress-linear","md-radio-button","md-radio-group","md-select","md-select-on-focus","md-sidenav","md-slider","md-slider-container","md-subheader","md-swipe-down","md-swipe-left","md-swipe-right","md-swipe-up","md-switch","md-tab","md-tabs","md-toolbar","md-tooltip","md-truncate","md-virtual-repeat","md-virtual-repeat-container","md-whiteframe","md-svg-src","sa-boot","sa-editor","sa-map","sa-media-selector","sa-selector","sa-stripe-payment-method-list","sa-stripe-payment-method-selector","sa-tree","stratus-.+"],htmlRemoveTags:[],htmlSimpleAmpersand:!1,imageInsertButtons:["imageBack","|","mediaManager","imageUpload","imageByURL"],imageUpload:!0,imageUploadRemoteUrls:!0,imageUploadURL:"https://app.sitetheory.io/?session="+h.cookie("SITETHEORY"),imageManagerPageSize:20,imageManagerScrollOffset:10,imageManagerLoadMethod:"GET",imageManagerLoadURL:"/Api/Media?payload-only=true",linkInsertButtons:["linkBack","|","linkList","linkManager"],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-.+","stratus-.+","sa-.+"],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","linkManager","citationManager","lists","mediaManager","paragraphFormat","paragraphStyle","print","quickInsert","quote","save","specialCharacters","table","url","video","wordPaste"],quickInsertButtons:["image","video","media","link","embedly","table","ul","ol","hr"],scrollableContainer:l.Stratus.Environment.get("viewPort")||"body",spellcheck:!0,toolbarSticky:!0,toolbarButtons:{moreText:{buttons:this.froalaStandardButtons.moreText,buttonsVisible:3},moreParagraph:{buttons:this.froalaStandardButtons.moreParagraph,buttonsVisible:8},moreRich:{buttons:this.froalaStandardButtons.moreRich,buttonsVisible:1},moreMisc:{buttons:this.froalaStandardButtons.moreMisc,align:"right",buttonsVisible:1}},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:0}},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:0}},useClasses:!0,videoInsertButtons:["videoBack","|","mediaManager","videoByURL","videoEmbed","videoUpload"],videoUpload:!0,videoUploadURL:"https://app.sitetheory.io/?session="+h.cookie("SITETHEORY")},this.uid=d.default.uniqueId(`sa_${d.default.snakeCase(v)}_component_`),l.Stratus.Instances[this.uid]=this,l.Stratus.Internals.LoadCss([`${w}editor/editor.component${k}.css`,`${S}lib/codemirror.css`,`${x}css/froala_editor.pkgd${k}.css`,`${x}css/third_party/embedly${k}.css`,`${x}css/third_party/font_awesome${k}.css`,`${x}css/third_party/image_tui${k}.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","openCitationDialog","openLinkDialog","openMediaDialog","openCodeViewDialog","hydrate","disableRefresh","stagger","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.dev&&console.warn(`[observable] creating subscriber on ${this.uid}`,e),this.dataDefer(e))),this.dataSub.pipe(r.debounce(()=>o.timer(250)),r.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()):this.initialized&&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 n=d.default.filter(d.default.map(i,(e,t)=>e>1?t:null));n.length&&console.warn("Froala Config:",t,"has duplicates:",n)}),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 n;for(;n=i.exec(e);){const i=n[0];if(i.includes("data:image"))continue;const a=/^<img\s(.+?)(-[A-Z]{2})?\.(?=[^.]*$)(.+)>/gi.exec(i);if(null!==a)if(i.includes("data-stratus-src"))e=e.replace(i,`<img ${a[1]}-${t}.${a[3]}>`);else{if(!i.includes("cdn.sitetheory.io"))continue;if(d.default.isEmpty(a[2]))continue;e=e.replace(i,`<img data-stratus-src ${a[1]}-${t}.${a[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 this.dev&&console.warn(`[defer] debouncing due to empty subscriber on ${this.uid}`),void setTimeout(()=>{this.dev&&console.warn(`[defer] debounced subscriber returned on ${this.uid}`),this.dataDefer(e)},250);const t=d.default.clone(this.dataString),i=this.dataRef();return t!==i?i||this.data&&this.data.completed?void((this.froalaConfig.useClasses||t!==i)&&(this.dev&&console.warn(`[subscriber] new value submitted on ${this.uid}:`,i),this.subscriber.next(i))):(this.dev&&console.warn(`[defer] debouncing subscriber due to unavailable data on ${this.uid}`,this.data),void setTimeout(()=>{this.dev&&console.warn(`[defer] debounced subscriber returned on ${this.uid}`),this.dataDefer(e)},250)):void 0}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):"citation-input"===e?this.openCitationDialog(i):"link-library"===e?this.openLinkDialog(i):"code-view"===e&&this.openCodeViewDialog()}openCitationDialog(e){const t=this.dialog.open(g.CitationDialogComponent,{width:"1000px",data:{editor:this,eventManager:e,form:this.form,model:this.model,property:this.property}}),i=this;t.afterClosed().subscribe(e=>{e&&!d.default.isEmpty(e)&&(i.refresh(),this.dev&&e&&console.log("citation dialog result:",e))})}openLinkDialog(e){const t=this.dialog.open(u.LinkDialogComponent,{width:"450px",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("link dialog result:",e))})}openMediaDialog(e){const t=this.dialog.open(m.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(b.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))})}},D([i.Input(),T("design:type",String)],M.prototype,"target",void 0),D([i.Input(),T("design:type",String)],M.prototype,"targetSuffix",void 0),D([i.Input(),T("design:type",Number)],M.prototype,"id",void 0),D([i.Input(),T("design:type",Boolean)],M.prototype,"manifest",void 0),D([i.Input(),T("design:type",Boolean)],M.prototype,"decouple",void 0),D([i.Input(),T("design:type",Boolean)],M.prototype,"direct",void 0),D([i.Input(),T("design:type",Object)],M.prototype,"api",void 0),D([i.Input(),T("design:type",String)],M.prototype,"urlRoot",void 0),D([i.Input(),T("design:type",String)],M.prototype,"property",void 0),M=D([i.Component({selector:"sa-editor",templateUrl:`${w}/editor/editor.component${k}.html`}),T("design:paramtypes",[s.DomSanitizer,i.ChangeDetectorRef,i.ElementRef,n.FormBuilder,a.MatDialog])],M),e("EditorComponent",M)}}});
|
|
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/citation-dialog.component","@stratusjs/angular/editor/link-dialog.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/citationManager","@stratusjs/angular/froala/plugins/linkManager","@stratusjs/angular/froala/plugins/mediaManager"],function(e,t){"use strict";var i,n,a,o,r,s,l,d,c,g,u,m,p,h,f,b,y,v,k,w,S,x,C,M,D=this&&this.__decorate||function(e,t,i,n){var a,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(r=(o<3?a(r):o>3?a(t,i,r):a(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},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){n=e},function(e){a=e},function(e){o=e},function(e){r=e},function(e){s=e},function(e){l=e},function(e){d=e},function(e){c=e},function(e){g=e},function(e){u=e},function(e){m=e},function(e){p=e},function(e){h=e},function(e){f=e},function(e){b=e},function(e){y=e},function(e){},function(e){},function(e){},function(e){},function(e){},function(e){},function(e){},function(e){},function(e){},function(e){}],execute:function(){"@stratusjs/angular","froala-editor","codemirror",v="editor",k=h.cookie("env")?"":".min",w=`${l.Stratus.BaseUrl}${boot.configuration.paths["@stratusjs/angular/*"].replace(/[^\/]*$/,"")}`,S=`${l.Stratus.BaseUrl}${boot.configuration.paths["codemirror/*"].replace(/[^\/]*$/,"")}`,x=`${l.Stratus.BaseUrl}${boot.configuration.paths["froala-editor"].replace(/js\/[^\/]*$/,"")}`,C=(e,t)=>d.default.has(e,t)&&!d.default.isEmpty(d.default.get(e,t)),M=class extends c.RootComponent{constructor(e,t,i,a,s){super(),this.sanitizer=e,this.ref=t,this.elementRef=i,this.fb=a,this.dialog=s,this.title="editor_component",this.dev=!!h.cookie("env"),this.editor="froala",this._=d.default,this.has=C,this.log=console.log,this.Stratus=l.Stratus,this.registry=new p.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 n.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:["linkManager","formatOL","formatUL","indent","outdent","quote","paragraphFormat","paragraphStyle","alignLeft","alignCenter","alignRight","alignJustify"],moreRich:["insertImage","insertTable","insertVideo","insertFile","citationInsert","insertHR","specialCharacters"],moreMisc:["html","undo","redo","fullscreen","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:y,codeMirrorOptions:{indentWithTabs:!1,lineNumbers:!0,lineWrapping:!0,mode:"text/html",tabMode:"space",tabSize:4},fileInsertButtons:["fileBack","|","mediaManager"],fileUploadURL:"https://app.sitetheory.io/?session="+h.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-.+","ng-.+","stratus-.+","sa-.+","accept","accept-charset","accesskey","action","align","allow","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","ng-app","ng-bind","ng-bind-html","ng-bind-template","ng-blur","ng-change","ng-checked","ng-class","ng-class-even","ng-class-odd","ng-click","ng-cloak","ng-controller","ng-copy","ng-csp","ng-cut","ng-dblclick","ng-disabled","ng-focus","ng-form","ng-hide","ng-href","ng-if","ng-include","ng-init","ng-jq","ng-keydown","ng-keypress","ng-keyup","ng-list","ng-maxlength","ng-minlength","ng-model","ng-model-options","ng-mousedown","ng-mouseenter","ng-mouseleave","ng-mousemove","ng-mouseover","ng-mouseup","ng-non-bindable","ng-on","ng-open","ng-options","ng-paste","ng-pattern","ng-pluralize","ng-prop","ng-readonly","ng-ref","ng-repeat","ng-required","ng-selected","ng-show","ng-src","ng-srcset","ng-style","ng-submit","ng-switch","ng-transclude","ng-value","ng-animate-children","ng-animate-swap","ng-outlet","ng-message","ng-message-default","ng-message-exp","ng-messages","ng-messages-include","ng-view","ng-swipe-left","ng-swipe-right","md-autocomplete","md-autofocus","md-button","md-calendar","md-card","md-checkbox","md-chip","md-chip-remove","md-chips","md-colors","md-contact-chips","md-content","md-datepicker","md-dialog","md-divider","md-fab-actions","md-fab-speed-dial","md-fab-toolbar","md-force-height","md-grid-list","md-grid-tile","md-highlight-text","md-icon","md-ink-ripple","md-input","md-input-container","md-list","md-list-item","md-menu","md-menu-bar","md-nav-bar","md-nav-item","md-optgroup","md-option","md-progress-circular","md-progress-linear","md-radio-button","md-radio-group","md-select","md-select-on-focus","md-sidenav","md-slider","md-slider-container","md-subheader","md-swipe-down","md-swipe-left","md-swipe-right","md-swipe-up","md-switch","md-tab","md-tabs","md-toolbar","md-tooltip","md-truncate","md-virtual-repeat","md-virtual-repeat-container","md-whiteframe","md-svg-src","stratus-citation-notitle","sa-boot","sa-editor","sa-map","sa-media-selector","sa-selector","sa-stripe-payment-method-list","sa-stripe-payment-method-selector","sa-tree"],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","ng-app","ng-bind","ng-bind-html","ng-bind-template","ng-blur","ng-change","ng-checked","ng-class","ng-class-even","ng-class-odd","ng-click","ng-cloak","ng-controller","ng-copy","ng-csp","ng-cut","ng-dblclick","ng-disabled","ng-focus","ng-form","ng-hide","ng-href","ng-if","ng-include","ng-init","ng-jq","ng-keydown","ng-keypress","ng-keyup","ng-list","ng-maxlength","ng-minlength","ng-model","ng-model-options","ng-mousedown","ng-mouseenter","ng-mouseleave","ng-mousemove","ng-mouseover","ng-mouseup","ng-non-bindable","ng-on","ng-open","ng-options","ng-paste","ng-pattern","ng-pluralize","ng-prop","ng-readonly","ng-ref","ng-repeat","ng-required","ng-selected","ng-show","ng-src","ng-srcset","ng-style","ng-submit","ng-switch","ng-transclude","ng-value","ng-animate-children","ng-animate-swap","ng-outlet","ng-message","ng-message-default","ng-message-exp","ng-messages","ng-messages-include","ng-view","ng-swipe-left","ng-swipe-right","md-autocomplete","md-autofocus","md-button","md-calendar","md-card","md-checkbox","md-chip","md-chip-remove","md-chips","md-colors","md-contact-chips","md-content","md-datepicker","md-dialog","md-divider","md-fab-actions","md-fab-speed-dial","md-fab-toolbar","md-force-height","md-grid-list","md-grid-tile","md-highlight-text","md-icon","md-ink-ripple","md-input","md-input-container","md-list","md-list-item","md-menu","md-menu-bar","md-nav-bar","md-nav-item","md-optgroup","md-option","md-progress-circular","md-progress-linear","md-radio-button","md-radio-group","md-select","md-select-on-focus","md-sidenav","md-slider","md-slider-container","md-subheader","md-swipe-down","md-swipe-left","md-swipe-right","md-swipe-up","md-switch","md-tab","md-tabs","md-toolbar","md-tooltip","md-truncate","md-virtual-repeat","md-virtual-repeat-container","md-whiteframe","md-svg-src","sa-boot","sa-editor","sa-map","sa-media-selector","sa-selector","sa-stripe-payment-method-list","sa-stripe-payment-method-selector","sa-tree","stratus-.+"],htmlRemoveTags:[],htmlSimpleAmpersand:!1,imageInsertButtons:["imageBack","|","mediaManager","imageUpload","imageByURL"],imageUpload:!0,imageUploadRemoteUrls:!0,imageUploadURL:"https://app.sitetheory.io/?session="+h.cookie("SITETHEORY"),imageManagerPageSize:20,imageManagerScrollOffset:10,imageManagerLoadMethod:"GET",imageManagerLoadURL:"/Api/Media?payload-only=true",linkInsertButtons:["linkBack","|","linkList","linkManager"],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-.+","stratus-.+","sa-.+"],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","linkManager","citationManager","lists","mediaManager","paragraphFormat","paragraphStyle","print","quickInsert","quote","save","specialCharacters","table","url","video","wordPaste"],quickInsertButtons:["image","video","media","link","embedly","table","ul","ol","hr"],scrollableContainer:l.Stratus.Environment.get("viewPort")||"body",spellcheck:!0,toolbarSticky:!0,toolbarButtons:{moreText:{buttons:this.froalaStandardButtons.moreText,buttonsVisible:3},moreParagraph:{buttons:this.froalaStandardButtons.moreParagraph,buttonsVisible:8},moreRich:{buttons:this.froalaStandardButtons.moreRich,buttonsVisible:1},moreMisc:{buttons:this.froalaStandardButtons.moreMisc,align:"right",buttonsVisible:1}},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:0}},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:0}},useClasses:!0,videoInsertButtons:["videoBack","|","mediaManager","videoByURL","videoEmbed","videoUpload"],videoUpload:!0,videoUploadURL:"https://app.sitetheory.io/?session="+h.cookie("SITETHEORY")},this.uid=d.default.uniqueId(`sa_${d.default.snakeCase(v)}_component_`),l.Stratus.Instances[this.uid]=this,l.Stratus.Internals.LoadCss([`${w}editor/editor.component${k}.css`,`${S}lib/codemirror.css`,`${x}css/froala_editor.pkgd${k}.css`,`${x}css/third_party/embedly${k}.css`,`${x}css/third_party/font_awesome${k}.css`,`${x}css/third_party/image_tui${k}.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","openCitationDialog","openLinkDialog","openMediaDialog","openCodeViewDialog","hydrate","disableRefresh","stagger","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.dev&&console.warn(`[observable] creating subscriber on ${this.uid}`,e),this.dataDefer(e))),this.dataSub.pipe(r.debounce(()=>o.timer(250)),r.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()):this.initialized&&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 n=d.default.filter(d.default.map(i,(e,t)=>e>1?t:null));n.length&&console.warn("Froala Config:",t,"has duplicates:",n)}),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 n;for(;n=i.exec(e);){const i=n[0];if(i.includes("data:image"))continue;const a=/^<img\s(.+?)(-[A-Z]{2})?\.(?=[^.]*$)(.+)>/gi.exec(i);if(null!==a)if(i.includes("data-stratus-src"))e=e.replace(i,`<img ${a[1]}-${t}.${a[3]}>`);else{if(!i.includes("cdn.sitetheory.io"))continue;if(d.default.isEmpty(a[2]))continue;e=e.replace(i,`<img data-stratus-src ${a[1]}-${t}.${a[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 this.dev&&console.warn(`[defer] debouncing due to empty subscriber on ${this.uid}`),void setTimeout(()=>{this.dev&&console.warn(`[defer] debounced subscriber returned on ${this.uid}`),this.dataDefer(e)},250);const t=d.default.clone(this.dataString),i=this.dataRef();return t!==i?i||this.data&&this.data.completed?void((this.froalaConfig.useClasses||t!==i)&&(this.dev&&console.warn(`[subscriber] new value submitted on ${this.uid}:`,i),this.subscriber.next(i))):(this.dev&&console.warn(`[defer] debouncing subscriber due to unavailable data on ${this.uid}`,this.data),void setTimeout(()=>{this.dev&&console.warn(`[defer] debounced subscriber returned on ${this.uid}`),this.dataDefer(e)},250)):void 0}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):"citation-input"===e?this.openCitationDialog(i):"link-library"===e?this.openLinkDialog(i):"code-view"===e&&this.openCodeViewDialog()}openCitationDialog(e){const t=this.dialog.open(g.CitationDialogComponent,{width:"1000px",data:{editor:this,eventManager:e,form:this.form,model:this.model,property:this.property}}),i=this;t.afterClosed().subscribe(e=>{e&&!d.default.isEmpty(e)&&(i.refresh(),this.dev&&e&&console.log("citation dialog result:",e))})}openLinkDialog(e){const t=this.dialog.open(u.LinkDialogComponent,{width:"450px",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("link dialog result:",e))})}openMediaDialog(e){const t=this.dialog.open(m.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(b.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))})}},D([i.Input(),T("design:type",String)],M.prototype,"target",void 0),D([i.Input(),T("design:type",String)],M.prototype,"targetSuffix",void 0),D([i.Input(),T("design:type",Number)],M.prototype,"id",void 0),D([i.Input(),T("design:type",Boolean)],M.prototype,"manifest",void 0),D([i.Input(),T("design:type",Boolean)],M.prototype,"decouple",void 0),D([i.Input(),T("design:type",Boolean)],M.prototype,"direct",void 0),D([i.Input(),T("design:type",Object)],M.prototype,"api",void 0),D([i.Input(),T("design:type",String)],M.prototype,"urlRoot",void 0),D([i.Input(),T("design:type",String)],M.prototype,"property",void 0),M=D([i.Component({selector:"sa-editor",templateUrl:`${w}/editor/editor.component${k}.html`}),T("design:paramtypes",[s.DomSanitizer,i.ChangeDetectorRef,i.ElementRef,n.FormBuilder,a.MatDialog])],M),e("EditorComponent",M)}}});
|
|
@@ -430,7 +430,7 @@ export class EditorComponent extends RootComponent implements OnInit, TriggerInt
|
|
|
430
430
|
'insertTable',
|
|
431
431
|
'insertVideo',
|
|
432
432
|
'insertFile',
|
|
433
|
-
'
|
|
433
|
+
'citationInsert',
|
|
434
434
|
'insertHR',
|
|
435
435
|
'specialCharacters',
|
|
436
436
|
// 'insertLink',
|
|
@@ -634,6 +634,8 @@ export class EditorComponent extends RootComponent implements OnInit, TriggerInt
|
|
|
634
634
|
'md-virtual-repeat', 'md-virtual-repeat-container', 'md-whiteframe',
|
|
635
635
|
// AngularJS Material Secondary Tags
|
|
636
636
|
'md-svg-src',
|
|
637
|
+
// Stratus AngularJS Tags
|
|
638
|
+
'stratus-citation-notitle',
|
|
637
639
|
// Stratus Angular+ Tags
|
|
638
640
|
'sa-boot',
|
|
639
641
|
'sa-editor',
|
|
@@ -4,20 +4,31 @@
|
|
|
4
4
|
.editor-component stratus-citation {
|
|
5
5
|
position: relative;
|
|
6
6
|
display: inline-block;
|
|
7
|
-
counter-increment: stratus-citation-counter;
|
|
8
|
-
color: transparent;
|
|
9
7
|
border-style: dotted;
|
|
10
8
|
border-color: cornflowerblue;
|
|
9
|
+
border-width: 2px;
|
|
10
|
+
color: #f85b3b; /* handle generic color better */
|
|
11
11
|
cursor: pointer;
|
|
12
|
-
height:
|
|
13
|
-
width: 20px;
|
|
14
|
-
|
|
12
|
+
min-height: 17px;
|
|
13
|
+
min-width: 20px;
|
|
14
|
+
}
|
|
15
|
+
.editor-component stratus-citation stratus-citation-content {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
.editor-component stratus-citation stratus-citation-title {
|
|
19
|
+
display: block;
|
|
20
|
+
position: relative;
|
|
21
|
+
top: -4px;
|
|
22
|
+
margin-bottom: -6px;
|
|
23
|
+
padding-top: 4px;
|
|
24
|
+
padding-right: 1px;
|
|
25
|
+
font-size: 0.75em;
|
|
15
26
|
}
|
|
16
|
-
.editor-component stratus-citation::before {
|
|
27
|
+
.editor-component stratus-citation stratus-citation-notitle::before {
|
|
28
|
+
counter-increment: stratus-citation-counter;
|
|
17
29
|
content: counter(stratus-citation-counter);
|
|
18
30
|
position: absolute;
|
|
19
31
|
left: 2px;
|
|
20
32
|
font-size: 0.75em;
|
|
21
|
-
color: #f85b3b; /* handle generic color better */
|
|
22
33
|
}
|
|
23
34
|
/*# sourceMappingURL=citationManager.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["packages/angular/src/froala/plugins/citationManager.scss"],"names":[],"mappings":"AAAA;EACE;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;
|
|
1
|
+
{"version":3,"sources":["packages/angular/src/froala/plugins/citationManager.scss"],"names":[],"mappings":"AAAA;EACE;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA","file":"citationManager.css","sourcesContent":[".editor-component {\n counter-reset: stratus-citation-counter;\n stratus-citation {\n position: relative;\n display: inline-block;\n border-style: dotted;\n border-color: cornflowerblue;\n border-width: 2px;\n color: #f85b3b; /* handle generic color better */\n cursor: pointer;\n min-height: 17px;\n min-width: 20px;\n stratus-citation-content {\n display: none;\n }\n stratus-citation-title {\n display: block;\n position: relative;\n top: -4px;\n margin-bottom: -6px;\n padding-top: 4px;\n padding-right: 1px;\n font-size: 0.75em;\n }\n stratus-citation-notitle::before {\n counter-increment: stratus-citation-counter;\n content: counter(stratus-citation-counter);\n position: absolute;\n left: 2px;\n font-size: 0.75em;\n }\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
System.register(["@stratusjs/core/environment", "@stratusjs/runtime/stratus", "@stratusjs/angular/froala/plugins/inputButton", "froala-editor"], function (exports_1, context_1) {
|
|
1
|
+
System.register(["@stratusjs/core/environment", "@stratusjs/runtime/stratus", "lodash", "@stratusjs/angular/froala/plugins/inputButton", "froala-editor"], function (exports_1, context_1) {
|
|
2
2
|
"use strict";
|
|
3
|
-
var environment_1, stratus_1, inputButton_1, froala_editor_1, systemDir, moduleName, parentModuleName, min, localDir;
|
|
3
|
+
var environment_1, stratus_1, lodash_1, inputButton_1, froala_editor_1, systemDir, moduleName, parentModuleName, min, localDir;
|
|
4
4
|
var __moduleName = context_1 && context_1.id;
|
|
5
5
|
return {
|
|
6
6
|
setters: [
|
|
@@ -10,6 +10,9 @@ System.register(["@stratusjs/core/environment", "@stratusjs/runtime/stratus", "@
|
|
|
10
10
|
function (stratus_1_1) {
|
|
11
11
|
stratus_1 = stratus_1_1;
|
|
12
12
|
},
|
|
13
|
+
function (lodash_1_1) {
|
|
14
|
+
lodash_1 = lodash_1_1;
|
|
15
|
+
},
|
|
13
16
|
function (inputButton_1_1) {
|
|
14
17
|
inputButton_1 = inputButton_1_1;
|
|
15
18
|
},
|
|
@@ -23,12 +26,15 @@ System.register(["@stratusjs/core/environment", "@stratusjs/runtime/stratus", "@
|
|
|
23
26
|
parentModuleName = 'froala/plugins';
|
|
24
27
|
min = !environment_1.cookie('env') ? '.min' : '';
|
|
25
28
|
localDir = `${stratus_1.Stratus.BaseUrl}${boot.configuration.paths[`${systemDir}/*`].replace(/[^/]*$/, '')}`;
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
lodash_1.extend(froala_editor_1.default.POPUP_TEMPLATES, {
|
|
30
|
+
'citationManager.toolbar': '[_BUTTONS_]'
|
|
31
|
+
});
|
|
32
|
+
lodash_1.extend(froala_editor_1.default.DEFAULTS, {
|
|
33
|
+
citationToolbarButtons: ['citationEdit', 'citationDelete']
|
|
28
34
|
});
|
|
29
35
|
froala_editor_1.default.PLUGINS.citationManager = function citationManager(editor) {
|
|
30
36
|
let inputButton;
|
|
31
|
-
const debug =
|
|
37
|
+
const debug = false;
|
|
32
38
|
function _init() {
|
|
33
39
|
stratus_1.Stratus.Internals.CssLoader(`${localDir}${parentModuleName}/${moduleName}${min}.css`);
|
|
34
40
|
inputButton = new inputButton_1.InputButtonPlugin({
|
|
@@ -41,10 +47,19 @@ System.register(["@stratusjs/core/environment", "@stratusjs/runtime/stratus", "@
|
|
|
41
47
|
});
|
|
42
48
|
if (debug) {
|
|
43
49
|
console.log('initialized:', {
|
|
44
|
-
options: editor.opts.endpoint,
|
|
45
50
|
instance: this
|
|
46
51
|
});
|
|
47
52
|
}
|
|
53
|
+
editor.events.on('click', (clickEvent) => {
|
|
54
|
+
if (clickEvent.hasOwnProperty('target') &&
|
|
55
|
+
(clickEvent.target.nodeName === 'STRATUS-CITATION' ||
|
|
56
|
+
clickEvent.target.nodeName === 'STRATUS-CITATION-TITLE')) {
|
|
57
|
+
const citation = getSelectedCitation();
|
|
58
|
+
if (citation) {
|
|
59
|
+
editor.citationManager.showToolbar(clickEvent, citation);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
48
63
|
}
|
|
49
64
|
function onClick() {
|
|
50
65
|
if (!editor.el) {
|
|
@@ -53,12 +68,80 @@ System.register(["@stratusjs/core/environment", "@stratusjs/runtime/stratus", "@
|
|
|
53
68
|
}
|
|
54
69
|
inputButton.onClick(editor.el);
|
|
55
70
|
}
|
|
71
|
+
function getSelectedCitation() {
|
|
72
|
+
let containedElement = editor.selection.endElement();
|
|
73
|
+
if (containedElement.tagName === 'STRATUS-CITATION') {
|
|
74
|
+
return containedElement;
|
|
75
|
+
}
|
|
76
|
+
containedElement = editor.selection.element();
|
|
77
|
+
if (containedElement.tagName === 'STRATUS-CITATION') {
|
|
78
|
+
return containedElement;
|
|
79
|
+
}
|
|
80
|
+
containedElement = containedElement.parentElement;
|
|
81
|
+
if (containedElement.tagName === 'STRATUS-CITATION') {
|
|
82
|
+
return containedElement;
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
function getLastKnownCitation() {
|
|
87
|
+
return editor.citationManager.lastCitation || null;
|
|
88
|
+
}
|
|
89
|
+
function setLastKnownCitation(el) {
|
|
90
|
+
editor.citationManager.lastCitation = el;
|
|
91
|
+
}
|
|
92
|
+
function initToolbar() {
|
|
93
|
+
let citationToolbarButtons = '';
|
|
94
|
+
if (editor.opts.citationToolbarButtons.length > 1) {
|
|
95
|
+
citationToolbarButtons += '<div class="fr-buttons">';
|
|
96
|
+
citationToolbarButtons += editor.button.buildList(editor.opts.citationToolbarButtons);
|
|
97
|
+
citationToolbarButtons += '</div>';
|
|
98
|
+
}
|
|
99
|
+
const template = {
|
|
100
|
+
buttons: citationToolbarButtons
|
|
101
|
+
};
|
|
102
|
+
return editor.popups.create('citationManager.toolbar', template);
|
|
103
|
+
}
|
|
104
|
+
function showToolbar(clickEvent, citation) {
|
|
105
|
+
const popup = editor.popups.get('citationManager.toolbar');
|
|
106
|
+
if (!popup)
|
|
107
|
+
initToolbar();
|
|
108
|
+
editor.popups.setContainer('citationManager.toolbar', editor.$tb);
|
|
109
|
+
const btn = editor.$tb.find('.fr-command[data-cmd="myButton"]');
|
|
110
|
+
const left = clickEvent.pageX;
|
|
111
|
+
const top = clickEvent.pageY;
|
|
112
|
+
editor.popups.show('citationManager.toolbar', left, top, btn.outerHeight());
|
|
113
|
+
editor.citationManager.setLastKnownCitation(citation);
|
|
114
|
+
}
|
|
115
|
+
function hideToolbar() {
|
|
116
|
+
editor.citationManager.setLastKnownCitation(null);
|
|
117
|
+
editor.popups.hide('citationManager.toolbar');
|
|
118
|
+
}
|
|
56
119
|
return {
|
|
57
120
|
_init,
|
|
58
|
-
onClick
|
|
121
|
+
onClick,
|
|
122
|
+
showToolbar,
|
|
123
|
+
hideToolbar,
|
|
124
|
+
getSelectedCitation,
|
|
125
|
+
getLastKnownCitation,
|
|
126
|
+
setLastKnownCitation
|
|
59
127
|
};
|
|
60
128
|
};
|
|
61
|
-
froala_editor_1.default.
|
|
129
|
+
froala_editor_1.default.DefineIcon('citationDelete', { NAME: 'citationDelete', SVG_KEY: 'remove' });
|
|
130
|
+
froala_editor_1.default.RegisterCommand('citationDelete', {
|
|
131
|
+
title: 'Delete Citation',
|
|
132
|
+
undo: false,
|
|
133
|
+
focus: false,
|
|
134
|
+
callback() {
|
|
135
|
+
const containedElement = this.citationManager.getSelectedCitation();
|
|
136
|
+
if (containedElement) {
|
|
137
|
+
containedElement.remove();
|
|
138
|
+
}
|
|
139
|
+
this.citationManager.hideToolbar();
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
froala_editor_1.default.DefineIcon('citationManager', { NAME: 'citationManager', SVG_KEY: 'imageCaption' });
|
|
143
|
+
froala_editor_1.default.RegisterCommand('citationInsert', {
|
|
144
|
+
icon: 'citationManager',
|
|
62
145
|
title: 'Insert Citation',
|
|
63
146
|
undo: false,
|
|
64
147
|
focus: false,
|
|
@@ -72,7 +155,21 @@ System.register(["@stratusjs/core/environment", "@stratusjs/runtime/stratus", "@
|
|
|
72
155
|
},
|
|
73
156
|
plugin: 'citationManager',
|
|
74
157
|
});
|
|
75
|
-
froala_editor_1.default.
|
|
158
|
+
froala_editor_1.default.RegisterCommand('citationEdit', {
|
|
159
|
+
icon: 'citationManager',
|
|
160
|
+
title: 'Edit Citation',
|
|
161
|
+
undo: false,
|
|
162
|
+
focus: false,
|
|
163
|
+
modal: true,
|
|
164
|
+
callback(cmd, _val, _params) {
|
|
165
|
+
const debug = false;
|
|
166
|
+
if (debug) {
|
|
167
|
+
console.log('clicked:', this.citationManager);
|
|
168
|
+
}
|
|
169
|
+
this.citationManager.onClick();
|
|
170
|
+
},
|
|
171
|
+
plugin: 'citationManager',
|
|
172
|
+
});
|
|
76
173
|
froala_editor_1.default.RegisterQuickInsertButton('citation', {
|
|
77
174
|
icon: 'citationManager',
|
|
78
175
|
title: 'Insert Citation',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["citationManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["citationManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;YAaM,SAAS,GAAG,oBAAoB,CAAA;YAChC,UAAU,GAAG,iBAAiB,CAAA;YAC9B,gBAAgB,GAAG,gBAAgB,CAAA;YAGnC,GAAG,GAAG,CAAC,oBAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;YAClC,QAAQ,GAAG,GAAG,iBAAO,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,SAAS,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAA;YAGxG,eAAM,CAAC,uBAAY,CAAC,eAAe,EAAC;gBAChC,yBAAyB,EAAE,aAAa;aAC3C,CAAC,CAAA;YAGF,eAAM,CAAC,uBAAY,CAAC,QAAQ,EAAC;gBACzB,sBAAsB,EAAE,CAAC,cAAc,EAAE,gBAAgB,CAAC;aAC7D,CAAC,CAAA;YAKF,uBAAY,CAAC,OAAO,CAAC,eAAe,GAAG,SAAS,eAAe,CAAC,MAAW;gBACvE,IAAI,WAA8B,CAAA;gBAElC,MAAM,KAAK,GAAG,KAAK,CAAA;gBAGnB,SAAS,KAAK;oBACV,iBAAO,CAAC,SAAS,CAAC,SAAS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M,WAAW,GAAG,IAAI,+BAAiB,CAAC;wBACtC,IAAI,EAAE,kBAAkB;wBACxB,SAAS,EAAE,gBAAgB;wBAE3B,MAAM,EAAE,IAAI;wBACZ,iBAAiB,EAAE,IAAI;wBACvB,oBAAoB,EAAE,IAAI;wBAC1B,KAAK;qBACR,CAAC,CAAA;oBACF,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE;wBACV,OAAO,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAA;wBACjE,OAAM;qBACT;oBACD,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;gBAChC,CAAC;gBAGD,IAAI,EAAE,IAAI;aACb,CAAC,CAAA;QACF,CAAC","file":"citationManager.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.editor-component{counter-reset:stratus-citation-counter}.editor-component stratus-citation{position:relative;display:inline-block;
|
|
1
|
+
.editor-component{counter-reset:stratus-citation-counter}.editor-component stratus-citation{position:relative;display:inline-block;border-style:dotted;border-color:#6495ed;border-width:2px;color:#f85b3b;cursor:pointer;min-height:17px;min-width:20px}.editor-component stratus-citation stratus-citation-content{display:none}.editor-component stratus-citation stratus-citation-title{display:block;position:relative;top:-4px;margin-bottom:-6px;padding-top:4px;padding-right:1px;font-size:.75em}.editor-component stratus-citation stratus-citation-notitle::before{counter-increment:stratus-citation-counter;content:counter(stratus-citation-counter);position:absolute;left:2px;font-size:.75em}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["@stratusjs/core/environment","@stratusjs/runtime/stratus","@stratusjs/angular/froala/plugins/inputButton","froala-editor"],function(t,n){"use strict";var e,i,
|
|
1
|
+
System.register(["@stratusjs/core/environment","@stratusjs/runtime/stratus","lodash","@stratusjs/angular/froala/plugins/inputButton","froala-editor"],function(t,n){"use strict";var a,e,i,o,c,r,l;n&&n.id;return{setters:[function(t){a=t},function(t){e=t},function(t){i=t},function(t){o=t},function(t){c=t}],execute:function(){"@stratusjs/angular","citationManager","froala/plugins",r=a.cookie("env")?"":".min",l=`${e.Stratus.BaseUrl}${boot.configuration.paths["@stratusjs/angular/*"].replace(/[^/]*$/,"")}`,i.extend(c.default.POPUP_TEMPLATES,{"citationManager.toolbar":"[_BUTTONS_]"}),i.extend(c.default.DEFAULTS,{citationToolbarButtons:["citationEdit","citationDelete"]}),c.default.PLUGINS.citationManager=function(t){let n;function a(){let n=t.selection.endElement();return"STRATUS-CITATION"===n.tagName?n:(n=t.selection.element(),"STRATUS-CITATION"===n.tagName?n:(n=n.parentElement,"STRATUS-CITATION"===n.tagName?n:null))}return{_init:function(){e.Stratus.Internals.CssLoader(`${l}froala/plugins/citationManager${r}.css`),n=new o.InputButtonPlugin({name:"Citation Manager",eventName:"citation-input",editor:t,autoSaveSelection:!0,autoRestoreSelection:!0,debug:false}),t.events.on("click",n=>{if(n.hasOwnProperty("target")&&("STRATUS-CITATION"===n.target.nodeName||"STRATUS-CITATION-TITLE"===n.target.nodeName)){const e=a();e&&t.citationManager.showToolbar(n,e)}})},onClick:function(){t.el?n.onClick(t.el):console.warn("citationManager.onClick(): unable to find element")},showToolbar:function(n,a){t.popups.get("citationManager.toolbar")||function(){let n="";t.opts.citationToolbarButtons.length>1&&(n+='<div class="fr-buttons">',n+=t.button.buildList(t.opts.citationToolbarButtons),n+="</div>");const a={buttons:n};t.popups.create("citationManager.toolbar",a)}(),t.popups.setContainer("citationManager.toolbar",t.$tb);const e=t.$tb.find('.fr-command[data-cmd="myButton"]'),i=n.pageX,o=n.pageY;t.popups.show("citationManager.toolbar",i,o,e.outerHeight()),t.citationManager.setLastKnownCitation(a)},hideToolbar:function(){t.citationManager.setLastKnownCitation(null),t.popups.hide("citationManager.toolbar")},getSelectedCitation:a,getLastKnownCitation:function(){return t.citationManager.lastCitation||null},setLastKnownCitation:function(n){t.citationManager.lastCitation=n}}},c.default.DefineIcon("citationDelete",{NAME:"citationDelete",SVG_KEY:"remove"}),c.default.RegisterCommand("citationDelete",{title:"Delete Citation",undo:!1,focus:!1,callback(){const t=this.citationManager.getSelectedCitation();t&&t.remove(),this.citationManager.hideToolbar()}}),c.default.DefineIcon("citationManager",{NAME:"citationManager",SVG_KEY:"imageCaption"}),c.default.RegisterCommand("citationInsert",{icon:"citationManager",title:"Insert Citation",undo:!1,focus:!1,modal:!0,callback(t,n,a){this.citationManager.onClick()},plugin:"citationManager"}),c.default.RegisterCommand("citationEdit",{icon:"citationManager",title:"Edit Citation",undo:!1,focus:!1,modal:!0,callback(t,n,a){this.citationManager.onClick()},plugin:"citationManager"}),c.default.RegisterQuickInsertButton("citation",{icon:"citationManager",title:"Insert Citation",callback:function(){const t=new o.InputButtonPlugin({name:"Citation Manager",eventName:"citation-input",editor:this,autoSaveSelection:!0,autoRestoreSelection:!0,debug:!1});this.el?t.onClick(this.el):console.warn("citationManager.onClick(): unable to find element")},undo:!0})}}});
|
|
@@ -3,20 +3,31 @@
|
|
|
3
3
|
stratus-citation {
|
|
4
4
|
position: relative;
|
|
5
5
|
display: inline-block;
|
|
6
|
-
counter-increment: stratus-citation-counter;
|
|
7
|
-
color: transparent;
|
|
8
6
|
border-style: dotted;
|
|
9
7
|
border-color: cornflowerblue;
|
|
8
|
+
border-width: 2px;
|
|
9
|
+
color: #f85b3b; /* handle generic color better */
|
|
10
10
|
cursor: pointer;
|
|
11
|
-
height:
|
|
12
|
-
width: 20px;
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
min-height: 17px;
|
|
12
|
+
min-width: 20px;
|
|
13
|
+
stratus-citation-content {
|
|
14
|
+
display: none;
|
|
15
|
+
}
|
|
16
|
+
stratus-citation-title {
|
|
17
|
+
display: block;
|
|
18
|
+
position: relative;
|
|
19
|
+
top: -4px;
|
|
20
|
+
margin-bottom: -6px;
|
|
21
|
+
padding-top: 4px;
|
|
22
|
+
padding-right: 1px;
|
|
23
|
+
font-size: 0.75em;
|
|
24
|
+
}
|
|
25
|
+
stratus-citation-notitle::before {
|
|
26
|
+
counter-increment: stratus-citation-counter;
|
|
15
27
|
content: counter(stratus-citation-counter);
|
|
16
28
|
position: absolute;
|
|
17
29
|
left: 2px;
|
|
18
30
|
font-size: 0.75em;
|
|
19
|
-
color: #f85b3b; /* handle generic color better */
|
|
20
31
|
}
|
|
21
32
|
}
|
|
22
33
|
}
|