@stratusjs/angular 0.6.8 → 0.7.1
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/dist/angular.bundle.js +119126 -119958
- package/dist/angular.bundle.min.js +1 -1
- package/package.json +1 -1
- package/src/core/dialog.interface.js.map +1 -0
- package/src/core/root.component.js +8 -5
- package/src/core/root.component.js.map +1 -1
- package/src/core/root.component.min.js +1 -1
- package/src/core/root.component.ts +6 -3
- package/src/editor/editor.component.js +8 -1
- package/src/editor/editor.component.js.map +1 -1
- package/src/editor/editor.component.min.js +1 -1
- package/src/editor/editor.component.ts +11 -0
- package/src/editor/link-dialog.component.html +4 -2
- package/src/editor/link-dialog.component.js +2 -1
- package/src/editor/link-dialog.component.js.map +1 -1
- package/src/editor/link-dialog.component.min.html +1 -1
- package/src/editor/link-dialog.component.min.js +1 -1
- package/src/editor/link-dialog.component.ts +2 -1
- package/src/editor/quill-break-blot.plugin.js +0 -38
- package/src/editor/quill-break-blot.plugin.js.map +0 -1
- package/src/editor/quill-break-blot.plugin.min.js +0 -1
- package/src/editor/quill-html-edit.plugin.js +0 -164
- package/src/editor/quill-html-edit.plugin.js.map +0 -1
- package/src/editor/quill-html-edit.plugin.min.js +0 -1
- package/src/editor/quill-image-format.plugin.js +0 -50
- package/src/editor/quill-image-format.plugin.js.map +0 -1
- package/src/editor/quill-image-format.plugin.min.js +0 -1
- package/src/editor/quill-input-button.plugin.js +0 -98
- package/src/editor/quill-input-button.plugin.js.map +0 -1
- package/src/editor/quill-input-button.plugin.min.js +0 -1
- package/src/froala/editor/froala-editor.directive.js +0 -328
- package/src/froala/editor/froala-editor.directive.js.map +0 -1
- package/src/froala/editor/froala-editor.directive.min.js +0 -1
- package/src/froala/editor/froala-editor.module.js +0 -37
- package/src/froala/editor/froala-editor.module.js.map +0 -1
- package/src/froala/editor/froala-editor.module.min.js +0 -1
- package/src/froala/editor/index.js +0 -22
- package/src/froala/editor/index.js.map +0 -1
- package/src/froala/editor/index.min.js +0 -1
- package/src/froala/plugins/image_manager.js +0 -364
- package/src/froala/plugins/image_manager.js.map +0 -1
- package/src/froala/plugins/image_manager.min.js +0 -1
- package/src/froala/view/froala-view.directive.js +0 -49
- package/src/froala/view/froala-view.directive.js.map +0 -1
- package/src/froala/view/froala-view.directive.min.js +0 -1
- package/src/froala/view/froala-view.module.js +0 -37
- package/src/froala/view/froala-view.module.js.map +0 -1
- package/src/froala/view/froala-view.module.min.js +0 -1
- package/src/froala/view/index.js +0 -22
- package/src/froala/view/index.js.map +0 -1
- package/src/froala/view/index.min.js +0 -1
- package/src/root/root.component.js +0 -43
- package/src/root/root.component.js.map +0 -1
- package/src/root/root.component.min.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
<h1 mat-dialog-title>Link Selector</h1><div mat-dialog-content class="link-dialog-content"><form class="dialog-form" *ngIf="isStyled" [formGroup]="dialogContentForm"><mat-form-field class="form-field"
|
|
1
|
+
<h1 mat-dialog-title>Link Selector</h1><div mat-dialog-content class="link-dialog-content"><form class="dialog-form" *ngIf="isStyled" [formGroup]="dialogContentForm"><mat-form-field class="form-field"><mat-label>Link Text</mat-label><input matInput aria-label="Link Text" formControlName="linkTextInput"></mat-form-field><h4><label id="link-type-label">Link Type:</label></h4><mat-radio-group class="radio-group" aria-labelledby="link-type-label" formControlName="linkTypeRadio"><mat-radio-button class="radio-button" value="content">Website Page</mat-radio-button><mat-radio-button class="radio-button" value="url">Custom Link</mat-radio-button></mat-radio-group><mat-form-field class="form-field" *ngIf="linkType == 'content'"><input matInput placeholder="Search Content" aria-label="Search Content" [matAutocomplete]="auto" formControlName="contentSelectorInput"></mat-form-field><mat-autocomplete autoActiveFirstOption #auto="matAutocomplete" [displayWith]="displayContentText"><mat-option *ngIf="isContentLoading || isSingleContentLoading" class="is-loading"><mat-progress-bar mode="indeterminate"></mat-progress-bar></mat-option><ng-container *ngIf="!isContentLoading"><mat-option *ngFor="let model of contentEntities" [value]="model"><mat-icon aria-hidden="true" *ngIf="_.get(model, 'contentType.iconResourcePath')" [svgIcon]="getSvg(Stratus.BaseUrl + _.get(model, 'contentType.iconResourcePath')) | async">Icon</mat-icon>{{(model && model.version) ? model.version.title : 'Untitled'}} <small *ngIf="model.routing && model.routing.length">{{'/' + model.routing[0].url}}</small></mat-option></ng-container></mat-autocomplete><mat-form-field class="form-field" *ngIf="linkType == 'url'"><input matInput placeholder="Edit URL" aria-label="Edit URL" formControlName="linkURLInput"></mat-form-field><br><mat-checkbox formControlName="linkTargetCheckbox">Open in new tab</mat-checkbox></form><mat-progress-bar mode="indeterminate" *ngIf="!isListView && !isStyled"></mat-progress-bar><mat-progress-bar mode="indeterminate" *ngIf="isListView && (isContentLoading || !isStyled)"></mat-progress-bar><div class="content-list" *ngIf="isListView && isStyled"><div class="content-list-row content-box" [ngClass]="{'active': _.get(model, 'status') === 1, 'inactive' : _.get(model, 'status') !== 1, 'published': _.get(model, 'version.published') === 1, 'unpublished': _.get(model, 'version.published') !== 1, 'selected': isSelected(model)}" (click)="select(model)" *ngFor="let model of contentEntities"><div class="content-list-container"><div class="column-image position-anchor"><div class="image position-all" *ngIf="_.has(model, 'version.bestImage._thumbnailUrl')" [attr.data-stratus-src]="!_.get(model, 'version.bestImage.service') ? true : false" [ngStyle]="{'background': 'url(' + _.get(model, 'version.bestImage._thumbnailUrl') + ') no-repeat center center', 'background-size': 'cover'}"></div><div class="no-image-icon position-all" *ngIf="!_.has(model, 'version.bestImage._thumbnailUrl')" [ngClass]="_.get(model, 'contentType.class') + '-background-color'"><mat-icon class="content-type-icon position-center" [svgIcon]="getSvg(Stratus.BaseUrl + (_.get(model, 'contentType.iconResourcePath') || _.get(model, 'iconResourcePath'))) | async">Icon</mat-icon></div><img class="shapeholder" [src]="Stratus.BaseUrl + 'sitetheorycore/images/shapeholder-square.png'"></div><div class="column-title"><div class="content-type" *ngIf="_.has(model, 'contentType.iconResourcePath')"><mat-icon class="content-type-icon" [svgIcon]="getSvg(Stratus.BaseUrl + _.get(model, 'contentType.iconResourcePath')) | async">ContentType Icon</mat-icon><span class="comment content-type-name font-body" [ngClass]="((_.get(model, 'contentType.name') || _.get(model, 'name')) | lowercase) + '-color'" [textContent]="(_.get(model, 'contentType.name') || _.get(model, 'name')) + ((_.get(model, 'status') !== 1) ? ' (hidden)' : '') + ((_.get(model, 'version.published') !== 1) ? ' (unpublished)' : '')"></span></div><h3 [innerHTML]="_.get(model, 'version.bestIdentifier') || _.get(model, 'name') || (_.get(model, 'contentType.controller') === 'Content\\Module' ? _.get(model, 'version.internalIdentifier') : 'Untitled ' + _.get(model, 'contentType.name') + ' (' + _.get(model, 'id') + ')')"></h3><span class="routing" [textContent]="(_.has(model, 'routing') ? '/' + _.get(model, 'routing[0].url') : null) || _.get(model, 'description') || ''"></span></div><div class="column-action"><a mat-button *ngIf="_.has(model, 'contentType.editUrl')" [matTooltip]="'Edit ' + (_.get(model, 'contentType.name') || _.get(model, 'name'))" aria-label="Edit Item in New Window" class="btn btn-edit" (click)="goToUrl(model, '_blank');"><mat-icon svgIcon="selector_edit" aria-hidden="false" aria-label="Edit Item">Edit</mat-icon></a></div></div></div></div></div><div mat-dialog-actions><mat-progress-bar mode="indeterminate" *ngIf="isSingleContentLoading"></mat-progress-bar><button mat-button mat-dialog-close (click)="onCancelClick()">Cancel</button> <button mat-button (click)="onAcceptClick()">Ok</button></div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["@angular/core","@angular/forms","@angular/material/dialog","@angular/material/snack-bar","rxjs","rxjs/operators","lodash","@stratusjs/runtime/stratus","@stratusjs/core/environment","../backend.service","@stratusjs/angularjs/services/model","../core/responsive.component","@angular/material/icon","@angular/platform-browser"],function(t,e){"use strict";var n,i,s,o,r,a,l,h,c,u,d,g,p,f,m,y,b,k,v=this&&this.__decorate||function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r},C=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},T=this&&this.__param||function(t,e){return function(n,i){e(n,i,t)}};e&&e.id;return{setters:[function(t){n=t},function(t){i=t},function(t){s=t},function(t){o=t},function(t){r=t},function(t){a=t},function(t){l=t},function(t){h=t},function(t){c=t},function(t){u=t},function(t){d=t},function(t){g=t},function(t){p=t},function(t){f=t}],execute:function(){"@stratusjs/angular",m="link-dialog","editor",y=c.cookie("env")?"":".min",b=`${h.Stratus.BaseUrl}${boot.configuration.paths["@stratusjs/angular/*"].replace(/[^/]*$/,"").replace(/\/dist\/$/,"/src/")}`,k=class extends g.ResponsiveComponent{constructor(t,e,n,i,s,o,r,a){super(),this.dialogRef=t,this.data=e,this.fb=n,this.backend=i,this.snackBar=s,this.iconRegistry=o,this.sanitizer=r,this.ref=a,this.title=m+"_component",this._=l.default,this.Stratus=h.Stratus,this.apiBase="/Api/Content",this.contentEntities=[],this.isContentLoading=!0,this.isSingleContentLoading=!1,this.limit=20,this.eventInsert=!0,this.isListView=!1,this.selected=[],this.linkType="",this.linkText="",this.linkURL="",this.linkTarget=!1,this.svgIcons={},this.isInitialized=!1,this.isDestroyed=!1,this.isStyled=!1}ngOnInit(){this.uid=l.default.uniqueId(`sa_${l.default.snakeCase(m)}_component_`),h.Stratus.Instances[this.uid]=this,h.Stratus.Internals.CssLoader(`${b}editor/${m}.component${y}.css`).then(()=>{this.isStyled=!0,this.refresh()}).catch(t=>{console.warn("Issue detected in CSS Loader for Component:",this),console.error(t),this.isStyled=!0,this.refresh()}),l.default.forEach({selector_delete:h.Stratus.BaseUrl+"sitetheorycore/images/icons/actionButtons/delete.svg",selector_edit:h.Stratus.BaseUrl+"sitetheorycore/images/icons/actionButtons/edit.svg"},(t,e)=>this.iconRegistry.addSvgIcon(e,this.sanitizer.bypassSecurityTrustResourceUrl(t)).getNamedSvgIcon(e)),this.model=this.data.model,this.property=this.data.property,this.editor=this.data.editor,this.eventManager=this.data.eventManager,this.element=this.data.element,l.default.isBoolean(this.data.eventInsert)&&(this.eventInsert=this.data.eventInsert),this.dialogContentForm=this.fb.group({contentSelectorInput:"",linkTypeRadio:"",linkTextInput:"",linkURLInput:"",linkTargetCheckbox:""}),this.dialogContentForm.get("contentSelectorInput").valueChanges.pipe(a.debounceTime(300),a.tap(()=>this.isContentLoading=!0),a.switchMap(t=>l.default.isUndefined(t)?this.getQuery():l.default.isString(t)?this.getQuery(t):(this.content=t,this.getQuery()))).subscribe(t=>this.processContent(t)),this.backend.get(this.getQueryUrl()).pipe(a.finalize(()=>this.isContentLoading=!1)).subscribe(t=>this.processContent(t)),this.dialogContentForm.get("linkTypeRadio").valueChanges.pipe(a.debounceTime(300)).subscribe(t=>this.linkType=t),this.linkType=this.element&&this.element.hasAttribute("data-content-id")?"content":"url",this.dialogContentForm.get("linkTypeRadio").patchValue(this.linkType),this.dialogContentForm.get("linkTextInput").valueChanges.pipe(a.debounceTime(300)).subscribe(t=>this.linkText=t),this.linkText=this.element?this.element.textContent:"",this.dialogContentForm.get("linkTextInput").patchValue(this.linkText),this.dialogContentForm.get("linkURLInput").valueChanges.pipe(a.debounceTime(300)).subscribe(t=>this.linkURL=t),this.linkURL=this.element&&this.element.hasAttribute("href")?this.element.getAttribute("href"):"",this.dialogContentForm.get("linkURLInput").patchValue(this.linkURL),this.dialogContentForm.get("linkTargetCheckbox").valueChanges.pipe(a.debounceTime(300)).subscribe(t=>this.linkTarget=t),this.linkTarget=!!this.element&&this.element.hasAttribute("target"),this.dialogContentForm.get("linkTargetCheckbox").patchValue(this.linkTarget),this.element&&this.element.hasAttribute("data-content-id")&&(this.isSingleContentLoading=!0,this.backend.get(this.getQueryUrl(null,this.element.getAttribute("data-content-id"))).pipe(a.finalize(()=>this.isSingleContentLoading=!1)).subscribe(t=>{if(!t.ok||200!==t.status||l.default.isEmpty(t.body))return null;const e=l.default.get(t.body,"payload")||t.body;return l.default.isEmpty(e)||Array.isArray(e)||!l.default.isObject(e)?null:(this.contentEntity=e,this.isSingleContentLoading=!1,this.dialogContentForm.get("contentSelectorInput").patchValue(this.contentEntity),this.refresh(),this.contentEntity)})),this.isInitialized=!0}ngOnDestroy(){this.isDestroyed=!0}refresh(){return this.isDestroyed?new Promise(t=>t()):super.refresh()}onCancelClick(){this.eventManager?(this.eventManager.trigger("restore",null,this.editor),this.dialogRef.close(),this.refresh()):console.warn(m+": event manager is not set.")}onPage(t){this.pageEvent=t,this.getQuery(this.lastContentQuery).subscribe(t=>this.processContent(t))}getQueryUrl(t,e){return t=!l.default.isString(t)||l.default.isEmpty(t)?"":`"${t}"`,e=l.default.isEmpty(e)?"":"/"+e,`${this.apiBase}${e}?limit=${this.limit}&options[isContent]=null&options[isCollection]=null&options[showRoutable]=true&options[showRouting]=true&q=${t}`}getQuery(t){return this.lastContentQuery=t,this.isContentLoading=!0,this.backend.get(this.getQueryUrl(t)).pipe(a.finalize(()=>this.isContentLoading=!1))}processContent(t){if(!t.ok||200!==t.status||l.default.isEmpty(t.body))return this.meta={},this.contentEntities=[],this.refresh(),this.contentEntities;this.meta=l.default.get(t.body,"meta")||{};const e=l.default.get(t.body,"payload")||t.body;return l.default.isEmpty(e)||!Array.isArray(e)?(this.contentEntities=[],this.isContentLoading=!1,this.refresh(),this.contentEntities):(this.contentEntities=e,this.isContentLoading=!1,this.refresh(),this.contentEntities)}onAcceptClick(){const t="content"===this.linkType?this.createLink(this.content):{url:this.linkURL,text:this.linkText,target:this.linkTarget};if(!t){const t=this.content&&this.content.id?`for Content ID: ${this.content.id}.`:"without Content Selected or URL Input.";return console.warn(`${m}: unable to build link ${t}`),void this.snackBar.open("Unable to build link "+t,"dismiss",{duration:5e3,horizontalPosition:"right",verticalPosition:"bottom"})}if(this.content&&this.content.id&&this.selected.push(this.content.id),!this.eventInsert)return this.model instanceof d.Model&&l.default.isString(this.property)?(console.warn(m+": disabling eventInsert is not recommended."),void this.model.set(this.property,this.model.get(this.property)+t)):void console.warn(m+": event manager not available.");this.eventManager?(this.eventManager.trigger("insert",t,this.editor),this.onCancelClick()):console.warn(m+": event manager is not set.")}isSelected(t){if(!l.default.isUndefined(t))return l.default.includes(this.selected,t.id)}createLink(t){return t?t.id?t.contentType&&t.contentType.name?t.routing&&t.routing.length&&t.routing[0]?t.routing[0].url?t.version?t.version.title&&t.version.title.length?{url:"/"+t.routing[0].url,title:t.version.title,text:this.linkText,target:this.linkTarget,id:t.id}:(console.warn(`${m}: unable to find title for ${t.contentType.name} id: ${t.id}`),null):(console.warn(`${m}: unable to find content version for ${t.contentType.name} id: ${t.id}`),null):(console.warn(`${m}: unable to find url for ${t.contentType.name} id: ${t.id}`),null):(console.warn(`${m}: unable to find routing for ${t.contentType.name} id: ${t.id}`),null):(console.warn(`${m}: unable to find content type for content id: ${t.id}`),null):(console.warn(m+": unable to find content id for content:",t),null):(console.warn(m+": unable to create link for empty content"),null)}getSvg(t,e){const n=this.addSvgIcon(t,e);return new r.Observable(e=>{this.iconRegistry.getNamedSvgIcon(n).subscribe({error(e){console.error(`getSvg(${t}): ${e}`)},complete(){e.next(n)}})})}addSvgIcon(t,e){if(t in this.svgIcons)return this.svgIcons[t];e||(e={});const n=this.svgIcons[t]=l.default.uniqueId("selector_svg");return this.iconRegistry.addSvgIcon(n,this.sanitizer.bypassSecurityTrustResourceUrl(t),e),n}displayContentText(t){if(!t)return;const e=l.default.get(t,"routing[0].url"),n=l.default.isUndefined(e)?" (No route!)":` (/${e})`,i=l.default.get(t,"id"),s=l.default.isUndefined(i)?null:"Content: "+i;return(l.default.get(t,"version.title")||s)+n}goToUrl(t){t&&t.contentType?window.open(t.contentType.editUrl+"?id="+t.id,"_blank"):console.error("unable to execute goToUrl() because a valid model content was not provided.")}},k=v([n.Component({selector:"sa-"+m,templateUrl:`${b}/editor/${m}.component${y}.html`}),T(1,n.Inject(s.MAT_DIALOG_DATA)),C("design:paramtypes",[s.MatDialogRef,Object,i.FormBuilder,u.BackendService,o.MatSnackBar,p.MatIconRegistry,f.DomSanitizer,n.ChangeDetectorRef])],k),t("LinkDialogComponent",k)}}});
|
|
1
|
+
System.register(["@angular/core","@angular/forms","@angular/material/dialog","@angular/material/snack-bar","rxjs","rxjs/operators","lodash","@stratusjs/runtime/stratus","@stratusjs/core/environment","../backend.service","@stratusjs/angularjs/services/model","../core/responsive.component","@angular/material/icon","@angular/platform-browser"],function(t,e){"use strict";var n,i,s,o,r,a,l,h,c,u,d,g,p,f,m,y,b,k,v=this&&this.__decorate||function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r},C=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},T=this&&this.__param||function(t,e){return function(n,i){e(n,i,t)}};e&&e.id;return{setters:[function(t){n=t},function(t){i=t},function(t){s=t},function(t){o=t},function(t){r=t},function(t){a=t},function(t){l=t},function(t){h=t},function(t){c=t},function(t){u=t},function(t){d=t},function(t){g=t},function(t){p=t},function(t){f=t}],execute:function(){"@stratusjs/angular",m="link-dialog","editor",y=c.cookie("env")?"":".min",b=`${h.Stratus.BaseUrl}${boot.configuration.paths["@stratusjs/angular/*"].replace(/[^/]*$/,"").replace(/\/dist\/$/,"/src/")}`,k=class extends g.ResponsiveComponent{constructor(t,e,n,i,s,o,r,a){super(),this.dialogRef=t,this.data=e,this.fb=n,this.backend=i,this.snackBar=s,this.iconRegistry=o,this.sanitizer=r,this.ref=a,this.title=m+"_component",this._=l.default,this.Stratus=h.Stratus,this.apiBase="/Api/Content",this.contentEntities=[],this.isContentLoading=!0,this.isSingleContentLoading=!1,this.limit=20,this.eventInsert=!0,this.isListView=!1,this.selected=[],this.linkType="",this.linkText="",this.linkInitText="",this.linkURL="",this.linkTarget=!1,this.svgIcons={},this.isInitialized=!1,this.isDestroyed=!1,this.isStyled=!1}ngOnInit(){this.uid=l.default.uniqueId(`sa_${l.default.snakeCase(m)}_component_`),h.Stratus.Instances[this.uid]=this,h.Stratus.Internals.CssLoader(`${b}editor/${m}.component${y}.css`).then(()=>{this.isStyled=!0,this.refresh()}).catch(t=>{console.warn("Issue detected in CSS Loader for Component:",this),console.error(t),this.isStyled=!0,this.refresh()}),l.default.forEach({selector_delete:h.Stratus.BaseUrl+"sitetheorycore/images/icons/actionButtons/delete.svg",selector_edit:h.Stratus.BaseUrl+"sitetheorycore/images/icons/actionButtons/edit.svg"},(t,e)=>this.iconRegistry.addSvgIcon(e,this.sanitizer.bypassSecurityTrustResourceUrl(t)).getNamedSvgIcon(e)),this.model=this.data.model,this.property=this.data.property,this.editor=this.data.editor,this.eventManager=this.data.eventManager,this.element=this.data.element,l.default.isBoolean(this.data.eventInsert)&&(this.eventInsert=this.data.eventInsert),this.dialogContentForm=this.fb.group({contentSelectorInput:"",linkTypeRadio:"",linkTextInput:"",linkURLInput:"",linkTargetCheckbox:""}),this.dialogContentForm.get("contentSelectorInput").valueChanges.pipe(a.debounceTime(300),a.tap(()=>this.isContentLoading=!0),a.switchMap(t=>l.default.isUndefined(t)?this.getQuery():l.default.isString(t)?this.getQuery(t):(this.content=t,this.getQuery()))).subscribe(t=>this.processContent(t)),this.backend.get(this.getQueryUrl()).pipe(a.finalize(()=>this.isContentLoading=!1)).subscribe(t=>this.processContent(t)),this.dialogContentForm.get("linkTypeRadio").valueChanges.pipe(a.debounceTime(300)).subscribe(t=>this.linkType=t),this.linkType=this.element&&this.element.hasAttribute("data-content-id")?"content":"url",this.dialogContentForm.get("linkTypeRadio").patchValue(this.linkType),this.dialogContentForm.get("linkTextInput").valueChanges.pipe(a.debounceTime(300)).subscribe(t=>this.linkText=t),this.linkInitText=this.linkText=this.element?this.element.textContent:"",this.dialogContentForm.get("linkTextInput").patchValue(this.linkText),this.dialogContentForm.get("linkURLInput").valueChanges.pipe(a.debounceTime(300)).subscribe(t=>this.linkURL=t),this.linkURL=this.element&&this.element.hasAttribute("href")?this.element.getAttribute("href"):"",this.dialogContentForm.get("linkURLInput").patchValue(this.linkURL),this.dialogContentForm.get("linkTargetCheckbox").valueChanges.pipe(a.debounceTime(300)).subscribe(t=>this.linkTarget=t),this.linkTarget=!!this.element&&this.element.hasAttribute("target"),this.dialogContentForm.get("linkTargetCheckbox").patchValue(this.linkTarget),this.element&&this.element.hasAttribute("data-content-id")&&(this.isSingleContentLoading=!0,this.backend.get(this.getQueryUrl(null,this.element.getAttribute("data-content-id"))).pipe(a.finalize(()=>this.isSingleContentLoading=!1)).subscribe(t=>{if(!t.ok||200!==t.status||l.default.isEmpty(t.body))return null;const e=l.default.get(t.body,"payload")||t.body;return l.default.isEmpty(e)||Array.isArray(e)||!l.default.isObject(e)?null:(this.contentEntity=e,this.isSingleContentLoading=!1,this.dialogContentForm.get("contentSelectorInput").patchValue(this.contentEntity),this.refresh(),this.contentEntity)})),this.isInitialized=!0}ngOnDestroy(){this.isDestroyed=!0}refresh(){return this.isDestroyed?new Promise(t=>t()):super.refresh()}onCancelClick(){this.eventManager?(this.eventManager.trigger("restore",null,this.editor),this.dialogRef.close(),this.refresh()):console.warn(m+": event manager is not set.")}onPage(t){this.pageEvent=t,this.getQuery(this.lastContentQuery).subscribe(t=>this.processContent(t))}getQueryUrl(t,e){return t=!l.default.isString(t)||l.default.isEmpty(t)?"":`"${t}"`,e=l.default.isEmpty(e)?"":"/"+e,`${this.apiBase}${e}?limit=${this.limit}&options[isContent]=null&options[isCollection]=null&options[showRoutable]=true&options[showRouting]=true&q=${t}`}getQuery(t){return this.lastContentQuery=t,this.isContentLoading=!0,this.backend.get(this.getQueryUrl(t)).pipe(a.finalize(()=>this.isContentLoading=!1))}processContent(t){if(!t.ok||200!==t.status||l.default.isEmpty(t.body))return this.meta={},this.contentEntities=[],this.refresh(),this.contentEntities;this.meta=l.default.get(t.body,"meta")||{};const e=l.default.get(t.body,"payload")||t.body;return l.default.isEmpty(e)||!Array.isArray(e)?(this.contentEntities=[],this.isContentLoading=!1,this.refresh(),this.contentEntities):(this.contentEntities=e,this.isContentLoading=!1,this.refresh(),this.contentEntities)}onAcceptClick(){const t="content"===this.linkType?this.createLink(this.content):{url:this.linkURL,text:this.linkText,target:this.linkTarget};if(!t){const t=this.content&&this.content.id?`for Content ID: ${this.content.id}.`:"without Content Selected or URL Input.";return console.warn(`${m}: unable to build link ${t}`),void this.snackBar.open("Unable to build link "+t,"dismiss",{duration:5e3,horizontalPosition:"right",verticalPosition:"bottom"})}if(this.content&&this.content.id&&this.selected.push(this.content.id),!this.eventInsert)return this.model instanceof d.Model&&l.default.isString(this.property)?(console.warn(m+": disabling eventInsert is not recommended."),void this.model.set(this.property,this.model.get(this.property)+t)):void console.warn(m+": event manager not available.");this.eventManager?(this.eventManager.trigger("insert",t,this.editor),this.onCancelClick()):console.warn(m+": event manager is not set.")}isSelected(t){if(!l.default.isUndefined(t))return l.default.includes(this.selected,t.id)}createLink(t){return t?t.id?t.contentType&&t.contentType.name?t.routing&&t.routing.length&&t.routing[0]?t.routing[0].url?t.version?t.version.title&&t.version.title.length?{url:"/"+t.routing[0].url,title:t.version.title,text:this.linkText,target:this.linkTarget,id:t.id}:(console.warn(`${m}: unable to find title for ${t.contentType.name} id: ${t.id}`),null):(console.warn(`${m}: unable to find content version for ${t.contentType.name} id: ${t.id}`),null):(console.warn(`${m}: unable to find url for ${t.contentType.name} id: ${t.id}`),null):(console.warn(`${m}: unable to find routing for ${t.contentType.name} id: ${t.id}`),null):(console.warn(`${m}: unable to find content type for content id: ${t.id}`),null):(console.warn(m+": unable to find content id for content:",t),null):(console.warn(m+": unable to create link for empty content"),null)}getSvg(t,e){const n=this.addSvgIcon(t,e);return new r.Observable(e=>{this.iconRegistry.getNamedSvgIcon(n).subscribe({error(e){console.error(`getSvg(${t}): ${e}`)},complete(){e.next(n)}})})}addSvgIcon(t,e){if(t in this.svgIcons)return this.svgIcons[t];e||(e={});const n=this.svgIcons[t]=l.default.uniqueId("selector_svg");return this.iconRegistry.addSvgIcon(n,this.sanitizer.bypassSecurityTrustResourceUrl(t),e),n}displayContentText(t){if(!t)return;const e=l.default.get(t,"routing[0].url"),n=l.default.isUndefined(e)?" (No route!)":` (/${e})`,i=l.default.get(t,"id"),s=l.default.isUndefined(i)?null:"Content: "+i;return(l.default.get(t,"version.title")||s)+n}goToUrl(t){t&&t.contentType?window.open(t.contentType.editUrl+"?id="+t.id,"_blank"):console.error("unable to execute goToUrl() because a valid model content was not provided.")}},k=v([n.Component({selector:"sa-"+m,templateUrl:`${b}/editor/${m}.component${y}.html`}),T(1,n.Inject(s.MAT_DIALOG_DATA)),C("design:paramtypes",[s.MatDialogRef,Object,i.FormBuilder,u.BackendService,o.MatSnackBar,p.MatIconRegistry,f.DomSanitizer,n.ChangeDetectorRef])],k),t("LinkDialogComponent",k)}}});
|
|
@@ -124,6 +124,7 @@ export class LinkDialogComponent extends ResponsiveComponent implements OnInit,
|
|
|
124
124
|
content: ContentEntity
|
|
125
125
|
linkType = ''
|
|
126
126
|
linkText = ''
|
|
127
|
+
linkInitText = ''
|
|
127
128
|
linkURL = ''
|
|
128
129
|
linkTarget = false
|
|
129
130
|
|
|
@@ -251,7 +252,7 @@ export class LinkDialogComponent extends ResponsiveComponent implements OnInit,
|
|
|
251
252
|
.subscribe((response: string) => this.linkText = response)
|
|
252
253
|
|
|
253
254
|
// Populate Data from Froala Element
|
|
254
|
-
this.linkText = this.element ? this.element.textContent : ''
|
|
255
|
+
this.linkInitText = this.linkText = this.element ? this.element.textContent : ''
|
|
255
256
|
this.dialogContentForm
|
|
256
257
|
.get('linkTextInput')
|
|
257
258
|
.patchValue(this.linkText)
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
System.register(["quill", "@stratusjs/core/environment"], function (exports_1, context_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
var quill_1, environment_1, Break, Embed, QuillBreak;
|
|
4
|
-
var __moduleName = context_1 && context_1.id;
|
|
5
|
-
return {
|
|
6
|
-
setters: [
|
|
7
|
-
function (quill_1_1) {
|
|
8
|
-
quill_1 = quill_1_1;
|
|
9
|
-
},
|
|
10
|
-
function (environment_1_1) {
|
|
11
|
-
environment_1 = environment_1_1;
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
execute: function () {
|
|
15
|
-
Break = quill_1.default.import('blots/break');
|
|
16
|
-
Embed = quill_1.default.import('blots/embed');
|
|
17
|
-
QuillBreak = class QuillBreak extends Break {
|
|
18
|
-
length() {
|
|
19
|
-
return 1;
|
|
20
|
-
}
|
|
21
|
-
value() {
|
|
22
|
-
return '\n';
|
|
23
|
-
}
|
|
24
|
-
insertInto(parent, ref) {
|
|
25
|
-
if (environment_1.cookie('env')) {
|
|
26
|
-
console.log('insertInto:', parent, ref);
|
|
27
|
-
}
|
|
28
|
-
Embed.prototype.insertInto.call(this, parent, ref);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
exports_1("QuillBreak", QuillBreak);
|
|
32
|
-
QuillBreak.blotName = 'break';
|
|
33
|
-
QuillBreak.tagName = 'BR';
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
//# sourceMappingURL=quill-break-blot.plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["quill-break-blot.plugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;YAKM,KAAK,GAAG,eAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;YACnC,KAAK,GAAG,eAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;YAWzC,aAAA,MAAa,UAAW,SAAQ,KAAK;gBACjC,MAAM;oBACF,OAAO,CAAC,CAAA;gBACZ,CAAC;gBACD,KAAK;oBACD,OAAO,IAAI,CAAA;gBACf,CAAC;gBAED,UAAU,CAAC,MAAW,EAAE,GAAQ;oBAC5B,IAAI,oBAAM,CAAC,KAAK,CAAC,EAAE;wBACf,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,CAAC,CAAA;qBAC1C;oBACD,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,CAAA;gBACtD,CAAC;aACJ,CAAA;;YAED,UAAU,CAAC,QAAQ,GAAG,OAAO,CAAA;YAC7B,UAAU,CAAC,OAAO,GAAG,IAAI,CAAA;QACzB,CAAC","file":"quill-break-blot.plugin.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["quill","@stratusjs/core/environment"],function(t,e){"use strict";var n,r,o,s,i;e&&e.id;return{setters:[function(t){n=t},function(t){r=t}],execute:function(){o=n.default.import("blots/break"),s=n.default.import("blots/embed"),t("QuillBreak",i=class extends o{length(){return 1}value(){return"\n"}insertInto(t,e){r.cookie("env")&&console.log("insertInto:",t,e),s.prototype.insertInto.call(this,t,e)}}),i.blotName="break",i.tagName="BR"}}});
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
System.register(["quill"], function (exports_1, context_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
var quill_1, debug, Logger, QuillHtmlEditPlugin;
|
|
4
|
-
var __moduleName = context_1 && context_1.id;
|
|
5
|
-
function $create(elName) {
|
|
6
|
-
return document.createElement(elName);
|
|
7
|
-
}
|
|
8
|
-
function $setAttr(el, key, value) {
|
|
9
|
-
return el.setAttribute(key, value);
|
|
10
|
-
}
|
|
11
|
-
function launchPopupEditor(quill, options) {
|
|
12
|
-
const htmlFromEditor = quill.container.querySelector('.ql-editor').innerHTML;
|
|
13
|
-
const popupContainer = $create('div');
|
|
14
|
-
const overlayContainer = $create('div');
|
|
15
|
-
const msg = options.msg || 'Edit HTML here, when you click "OK" the quill editor\'s contents will be replaced';
|
|
16
|
-
const cancelText = options.cancelText || 'Cancel';
|
|
17
|
-
const okText = options.okText || 'Ok';
|
|
18
|
-
$setAttr(overlayContainer, 'class', 'ql-html-overlayContainer');
|
|
19
|
-
$setAttr(popupContainer, 'class', 'ql-html-popupContainer');
|
|
20
|
-
const popupTitle = $create('i');
|
|
21
|
-
$setAttr(popupTitle, 'class', 'ql-html-popupTitle');
|
|
22
|
-
popupTitle.innerText = msg;
|
|
23
|
-
const textContainer = $create('div');
|
|
24
|
-
textContainer.appendChild(popupTitle);
|
|
25
|
-
$setAttr(textContainer, 'class', 'ql-html-textContainer');
|
|
26
|
-
const textArea = $create('textarea');
|
|
27
|
-
$setAttr(textArea, 'class', 'ql-html-textArea');
|
|
28
|
-
textArea.value = formatHTML(htmlFromEditor);
|
|
29
|
-
const buttonCancel = $create('button');
|
|
30
|
-
buttonCancel.innerHTML = cancelText;
|
|
31
|
-
$setAttr(buttonCancel, 'class', 'ql-html-buttonCancel');
|
|
32
|
-
const buttonOk = $create('button');
|
|
33
|
-
buttonOk.innerHTML = okText;
|
|
34
|
-
const buttonGroup = $create('div');
|
|
35
|
-
$setAttr(buttonGroup, 'class', 'ql-html-buttonGroup');
|
|
36
|
-
buttonGroup.appendChild(buttonCancel);
|
|
37
|
-
buttonGroup.appendChild(buttonOk);
|
|
38
|
-
textContainer.appendChild(textArea);
|
|
39
|
-
textContainer.appendChild(buttonGroup);
|
|
40
|
-
popupContainer.appendChild(textContainer);
|
|
41
|
-
overlayContainer.appendChild(popupContainer);
|
|
42
|
-
document.body.appendChild(overlayContainer);
|
|
43
|
-
buttonCancel.onclick = () => {
|
|
44
|
-
document.body.removeChild(overlayContainer);
|
|
45
|
-
};
|
|
46
|
-
overlayContainer.onclick = buttonCancel.onclick;
|
|
47
|
-
popupContainer.onclick = (e) => {
|
|
48
|
-
e.preventDefault();
|
|
49
|
-
e.stopPropagation();
|
|
50
|
-
};
|
|
51
|
-
buttonOk.onclick = () => {
|
|
52
|
-
const output = textArea.value.split(/\r?\n/g).map((el) => el.trim());
|
|
53
|
-
const noNewlines = output.join('');
|
|
54
|
-
quill.container.querySelector('.ql-editor').innerHTML = noNewlines;
|
|
55
|
-
document.body.removeChild(overlayContainer);
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
function formatHTML(code) {
|
|
59
|
-
'use strict';
|
|
60
|
-
const stripWhiteSpaces = true;
|
|
61
|
-
const stripEmptyLines = true;
|
|
62
|
-
const whitespace = ' '.repeat(2);
|
|
63
|
-
let currentIndent = 0;
|
|
64
|
-
const newlineChar = '\n';
|
|
65
|
-
let char = null;
|
|
66
|
-
let nextChar = null;
|
|
67
|
-
let result = '';
|
|
68
|
-
for (let pos = 0; pos <= code.length; pos++) {
|
|
69
|
-
char = code.substr(pos, 1);
|
|
70
|
-
nextChar = code.substr(pos + 1, 1);
|
|
71
|
-
const isBrTag = code.substr(pos, 4) === '<br>';
|
|
72
|
-
const isOpeningTag = char === '<' && nextChar !== '/' && !isBrTag;
|
|
73
|
-
const isClosingTag = char === '<' && nextChar === '/' && !isBrTag;
|
|
74
|
-
if (isBrTag) {
|
|
75
|
-
result += newlineChar;
|
|
76
|
-
currentIndent--;
|
|
77
|
-
pos += 4;
|
|
78
|
-
}
|
|
79
|
-
if (isOpeningTag) {
|
|
80
|
-
result += newlineChar + whitespace.repeat(currentIndent);
|
|
81
|
-
currentIndent++;
|
|
82
|
-
}
|
|
83
|
-
else if (isClosingTag) {
|
|
84
|
-
if (--currentIndent < 0) {
|
|
85
|
-
currentIndent = 0;
|
|
86
|
-
}
|
|
87
|
-
result += newlineChar + whitespace.repeat(currentIndent);
|
|
88
|
-
}
|
|
89
|
-
else if (stripWhiteSpaces === true && char === ' ' && nextChar === ' ') {
|
|
90
|
-
char = '';
|
|
91
|
-
}
|
|
92
|
-
else if (stripEmptyLines === true && char === newlineChar) {
|
|
93
|
-
if (code.substr(pos, code.substr(pos).indexOf('<')).trim() === '') {
|
|
94
|
-
char = '';
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
result += char;
|
|
98
|
-
}
|
|
99
|
-
Logger.log('formatHTML', {
|
|
100
|
-
before: code,
|
|
101
|
-
after: result
|
|
102
|
-
});
|
|
103
|
-
return result;
|
|
104
|
-
}
|
|
105
|
-
return {
|
|
106
|
-
setters: [
|
|
107
|
-
function (quill_1_1) {
|
|
108
|
-
quill_1 = quill_1_1;
|
|
109
|
-
}
|
|
110
|
-
],
|
|
111
|
-
execute: function () {
|
|
112
|
-
debug = false;
|
|
113
|
-
Logger = {
|
|
114
|
-
prefixString() {
|
|
115
|
-
return `</> quill-html-edit-button: `;
|
|
116
|
-
},
|
|
117
|
-
get log() {
|
|
118
|
-
if (!debug) {
|
|
119
|
-
return () => { };
|
|
120
|
-
}
|
|
121
|
-
const boundLogFn = console.log.bind(console, this.prefixString());
|
|
122
|
-
return boundLogFn;
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
QuillHtmlEditPlugin = class QuillHtmlEditPlugin {
|
|
126
|
-
constructor(quill, options) {
|
|
127
|
-
debug = options && options.debug;
|
|
128
|
-
Logger.log('logging enabled');
|
|
129
|
-
const toolbarModule = quill.getModule('toolbar');
|
|
130
|
-
if (!toolbarModule) {
|
|
131
|
-
throw new Error('quill.htmlEditButton requires the "toolbar" module to be included too');
|
|
132
|
-
}
|
|
133
|
-
this.registerDivModule();
|
|
134
|
-
const toolbarEl = toolbarModule.container;
|
|
135
|
-
const buttonContainer = $create('span');
|
|
136
|
-
$setAttr(buttonContainer, 'class', 'ql-formats');
|
|
137
|
-
const button = $create('button');
|
|
138
|
-
button.innerHTML = options.buttonHTML || '<>';
|
|
139
|
-
button.title = options.buttonTitle || 'Show HTML source';
|
|
140
|
-
button.onclick = (e) => {
|
|
141
|
-
e.preventDefault();
|
|
142
|
-
launchPopupEditor(quill, options);
|
|
143
|
-
};
|
|
144
|
-
buttonContainer.appendChild(button);
|
|
145
|
-
toolbarEl.appendChild(buttonContainer);
|
|
146
|
-
}
|
|
147
|
-
registerDivModule() {
|
|
148
|
-
const Block = quill_1.default.import('blots/block');
|
|
149
|
-
class Div extends Block {
|
|
150
|
-
}
|
|
151
|
-
Div.tagName = 'div';
|
|
152
|
-
Div.blotName = 'div';
|
|
153
|
-
Div.allowedChildren = Block.allowedChildren;
|
|
154
|
-
Div.allowedChildren.push(Block);
|
|
155
|
-
quill_1.default.register(Div);
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
exports_1("QuillHtmlEditPlugin", QuillHtmlEditPlugin);
|
|
159
|
-
exports_1("default", QuillHtmlEditPlugin);
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
//# sourceMappingURL=quill-html-edit.plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["quill-html-edit.plugin.ts"],"names":[],"mappings":";;;;IAQA,SAAS,OAAO,CAAC,MAAW;QACxB,OAAO,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;IACzC,CAAC;IACD,SAAS,QAAQ,CAAC,EAAO,EAAE,GAAQ,EAAE,KAAU;QAC3C,OAAO,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IACtC,CAAC;IAuDD,SAAS,iBAAiB,CAAC,KAAU,EAAE,OAAY;QAC/C,MAAM,cAAc,GAAQ,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,SAAS,CAAA;QACjF,MAAM,cAAc,GAAQ,OAAO,CAAC,KAAK,CAAC,CAAA;QAC1C,MAAM,gBAAgB,GAAQ,OAAO,CAAC,KAAK,CAAC,CAAA;QAC5C,MAAM,GAAG,GAAQ,OAAO,CAAC,GAAG,IAAI,mFAAmF,CAAA;QACnH,MAAM,UAAU,GAAQ,OAAO,CAAC,UAAU,IAAI,QAAQ,CAAA;QACtD,MAAM,MA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M,eAAe,GAAQ,OAAO,CAAC,MAAM,CAAC,CAAA;oBAC5C,QAAQ,CAAC,eAAe,EAAE,OAAO,EAAE,YAAY,CAAC,CAAA;oBAChD,MAAM,MAAM,GAAQ,OAAO,CAAC,QAAQ,CAAC,CAAA;oBACrC,MAAM,CAAC,SAAS,GAAG,OAAO,CAAC,UAAU,IAAI,UAAU,CAAA;oBACnD,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,WAAW,IAAI,kBAAkB,CAAA;oBACxD,MAAM,CAAC,OAAO,GAAG,CAAC,CAAM,EAAE,EAAE;wBACxB,CAAC,CAAC,cAAc,EAAE,CAAA;wBAClB,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;oBACrC,CAAC,CAAA;oBACD,eAAe,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;oBACnC,SAAS,CAAC,WAAW,CAAC,eAAe,CAAC,CAAA;gBAC1C,CAAC;gBAED,iBAAiB;oBAGb,MAAM,KAAK,GAAG,eAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;oBACzC,MAAM,GAAI,SAAQ,KAAK;qBAAG;oBAC1B,GAAG,CAAC,OAAO,GAAG,KAAK,CAAA;oBACnB,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAA;oBACpB,GAAG,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,CAAA;oBAC3C,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;oBAC/B,eAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;gBACvB,CAAC;aACJ,CAAA;;iCA6Gc,mBAAmB;QAElC,CAAC","file":"quill-html-edit.plugin.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["quill"],function(t,e){"use strict";var n,l,o,i;e&&e.id;function r(t){return document.createElement(t)}function s(t,e,n){return t.setAttribute(e,n)}function c(t,e){const n=t.container.querySelector(".ql-editor").innerHTML,l=r("div"),i=r("div"),c=e.msg||'Edit HTML here, when you click "OK" the quill editor\'s contents will be replaced',u=e.cancelText||"Cancel",d=e.okText||"Ok";s(i,"class","ql-html-overlayContainer"),s(l,"class","ql-html-popupContainer");const a=r("i");s(a,"class","ql-html-popupTitle"),a.innerText=c;const p=r("div");p.appendChild(a),s(p,"class","ql-html-textContainer");const h=r("textarea");s(h,"class","ql-html-textArea"),h.value=function(t){const e=" ".repeat(2);let n=0;let l=null,i=null,r="";for(let o=0;o<=t.length;o++){l=t.substr(o,1),i=t.substr(o+1,1);const s="<br>"===t.substr(o,4),c="<"===l&&"/"===i&&!s;s&&(r+="\n",n--,o+=4),"<"===l&&"/"!==i&&!s?(r+="\n"+e.repeat(n),n++):c?(--n<0&&(n=0),r+="\n"+e.repeat(n)):(" "===l&&" "===i||"\n"===l&&""===t.substr(o,t.substr(o).indexOf("<")).trim())&&(l=""),r+=l}return o.log("formatHTML",{before:t,after:r}),r}(n);const b=r("button");b.innerHTML=u,s(b,"class","ql-html-buttonCancel");const m=r("button");m.innerHTML=d;const g=r("div");s(g,"class","ql-html-buttonGroup"),g.appendChild(b),g.appendChild(m),p.appendChild(h),p.appendChild(g),l.appendChild(p),i.appendChild(l),document.body.appendChild(i),b.onclick=()=>{document.body.removeChild(i)},i.onclick=b.onclick,l.onclick=t=>{t.preventDefault(),t.stopPropagation()},m.onclick=()=>{const e=h.value.split(/\r?\n/g).map(t=>t.trim()).join("");t.container.querySelector(".ql-editor").innerHTML=e,document.body.removeChild(i)}}return{setters:[function(t){n=t}],execute:function(){l=!1,o={prefixString:()=>"</> quill-html-edit-button: ",get log(){if(!l)return()=>{};return console.log.bind(console,this.prefixString())}},t("QuillHtmlEditPlugin",i=class{constructor(t,e){l=e&&e.debug,o.log("logging enabled");const n=t.getModule("toolbar");if(!n)throw new Error('quill.htmlEditButton requires the "toolbar" module to be included too');this.registerDivModule();const i=n.container,u=r("span");s(u,"class","ql-formats");const d=r("button");d.innerHTML=e.buttonHTML||"<>",d.title=e.buttonTitle||"Show HTML source",d.onclick=n=>{n.preventDefault(),c(t,e)},u.appendChild(d),i.appendChild(u)}registerDivModule(){const t=n.default.import("blots/block");class e extends t{}e.tagName="div",e.blotName="div",e.allowedChildren=t.allowedChildren,e.allowedChildren.push(t),n.default.register(e)}}),t("default",i)}}});
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
System.register(["quill"], function (exports_1, context_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
var quill_1, BaseImage, ATTRIBUTES, QuillImageFormatPlugin;
|
|
4
|
-
var __moduleName = context_1 && context_1.id;
|
|
5
|
-
return {
|
|
6
|
-
setters: [
|
|
7
|
-
function (quill_1_1) {
|
|
8
|
-
quill_1 = quill_1_1;
|
|
9
|
-
}
|
|
10
|
-
],
|
|
11
|
-
execute: function () {
|
|
12
|
-
BaseImage = quill_1.default.import('formats/image');
|
|
13
|
-
ATTRIBUTES = [
|
|
14
|
-
'alt',
|
|
15
|
-
'height',
|
|
16
|
-
'width',
|
|
17
|
-
'stratus-src',
|
|
18
|
-
'stratusSrc'
|
|
19
|
-
];
|
|
20
|
-
QuillImageFormatPlugin = class QuillImageFormatPlugin extends BaseImage {
|
|
21
|
-
constructor() {
|
|
22
|
-
super(...arguments);
|
|
23
|
-
this.blotName = 'imageCustom';
|
|
24
|
-
this.tagName = 'IMG';
|
|
25
|
-
}
|
|
26
|
-
format(name, value) {
|
|
27
|
-
console.log('format:', name, value, this.domNode.getAttribute('src'));
|
|
28
|
-
if (ATTRIBUTES.indexOf(name) === -1) {
|
|
29
|
-
super.format(name, value);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (!value) {
|
|
33
|
-
this.domNode.removeAttribute(name);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
if (name === 'stratus-src') {
|
|
37
|
-
console.log('stratus-src:', value);
|
|
38
|
-
}
|
|
39
|
-
if (name === 'stratusSrc') {
|
|
40
|
-
console.log('stratusSrc:', value);
|
|
41
|
-
}
|
|
42
|
-
this.domNode.setAttribute(name, value);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
exports_1("QuillImageFormatPlugin", QuillImageFormatPlugin);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
//# sourceMappingURL=quill-image-format.plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["quill-image-format.plugin.ts"],"names":[],"mappings":";;;;;;;;;;;YACM,SAAS,GAAG,eAAK,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;YAEzC,UAAU,GAAG;gBACf,KAAK;gBACL,QAAQ;gBACR,OAAO;gBACP,aAAa;gBACb,YAAY;aACf,CAAA;YAED,yBAAA,MAAa,sBAAuB,SAAQ,SAAS;gBAArD;;oBAGI,aAAQ,GAAG,aAAa,CAAA;oBACxB,YAAO,GAAG,KAAK,CAAA;gBA2DnB,CAAC;gBApBG,MAAM,CAAC,IAAS,EAAE,KAAU;oBACxB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAA;oBACrE,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;wBACjC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;wBACzB,OAAM;qBACT;oBACD,IAAI,CAAC,KAAK,EAAE;wBACR,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;wBAClC,OAAM;qBACT;oBACD,IAAI,IAAI,KAAK,aAAa,EAAE;wBACxB,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,KAAK,CAAC,CAAA;qBAErC;oBACD,IAAI,IAAI,KAAK,YAAY,EAAE;wBACvB,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,KAAK,CAAC,CAAA;qBAEpC;oBACD,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;gBAC1C,CAAC;aACJ,CAAA;;QACD,CAAC","file":"quill-image-format.plugin.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["quill"],function(t,s){"use strict";var e,r,o;s&&s.id;return{setters:[function(t){e=t}],execute:function(){r=e.default.import("formats/image"),o=["alt","height","width","stratus-src","stratusSrc"],t("QuillImageFormatPlugin",class extends r{constructor(){super(...arguments),this.blotName="imageCustom",this.tagName="IMG"}format(t,s){console.log("format:",t,s,this.domNode.getAttribute("src")),-1!==o.indexOf(t)?s?("stratus-src"===t&&console.log("stratus-src:",s),"stratusSrc"===t&&console.log("stratusSrc:",s),this.domNode.setAttribute(t,s)):this.domNode.removeAttribute(t):super.format(t,s)}})}}});
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
System.register(["@stratusjs/runtime/stratus", "lodash", "quill"], function (exports_1, context_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
var stratus_1, lodash_1, quill_1, QuillInputButtonPlugin;
|
|
4
|
-
var __moduleName = context_1 && context_1.id;
|
|
5
|
-
return {
|
|
6
|
-
setters: [
|
|
7
|
-
function (stratus_1_1) {
|
|
8
|
-
stratus_1 = stratus_1_1;
|
|
9
|
-
},
|
|
10
|
-
function (lodash_1_1) {
|
|
11
|
-
lodash_1 = lodash_1_1;
|
|
12
|
-
},
|
|
13
|
-
function (quill_1_1) {
|
|
14
|
-
quill_1 = quill_1_1;
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
execute: function () {
|
|
18
|
-
QuillInputButtonPlugin = class QuillInputButtonPlugin {
|
|
19
|
-
constructor(quill, options) {
|
|
20
|
-
this.debug = false;
|
|
21
|
-
this.buttonHTML = '<i class="fas fa-carrot"></i>';
|
|
22
|
-
this.buttonTitle = 'Input Button';
|
|
23
|
-
this.name = 'inputButton';
|
|
24
|
-
this.eventName = 'input-button';
|
|
25
|
-
this.uid = lodash_1.default.uniqueId(`quill_input_button_`);
|
|
26
|
-
stratus_1.Stratus.Instances[this.uid] = this;
|
|
27
|
-
this.debug = options && options.debug;
|
|
28
|
-
if (!options || typeof options !== 'object') {
|
|
29
|
-
options = {};
|
|
30
|
-
}
|
|
31
|
-
this.buttonHTML = options.buttonHTML || this.buttonHTML;
|
|
32
|
-
this.buttonTitle = options.buttonTitle || this.buttonTitle;
|
|
33
|
-
this.name = options.name || this.name;
|
|
34
|
-
this.eventName = options.eventName || this.eventName;
|
|
35
|
-
this.createToolbarModule(quill);
|
|
36
|
-
}
|
|
37
|
-
createToolbarModule(quill) {
|
|
38
|
-
const toolbarModule = quill.getModule('toolbar');
|
|
39
|
-
if (!toolbarModule) {
|
|
40
|
-
throw new Error(`quill.${this.name} requires the "toolbar" module`);
|
|
41
|
-
}
|
|
42
|
-
this.registerDivModule();
|
|
43
|
-
const toolbarEl = toolbarModule.container;
|
|
44
|
-
const buttonContainer = document.createElement('span');
|
|
45
|
-
buttonContainer.setAttribute('class', 'ql-formats');
|
|
46
|
-
const button = document.createElement('button');
|
|
47
|
-
button.innerHTML = this.buttonHTML;
|
|
48
|
-
button.title = this.buttonTitle;
|
|
49
|
-
button.onclick = (e) => {
|
|
50
|
-
e.preventDefault();
|
|
51
|
-
this.onClick(quill);
|
|
52
|
-
};
|
|
53
|
-
buttonContainer.appendChild(button);
|
|
54
|
-
toolbarEl.appendChild(buttonContainer);
|
|
55
|
-
}
|
|
56
|
-
registerDivModule() {
|
|
57
|
-
const Block = quill_1.default.import('blots/block');
|
|
58
|
-
class Div extends Block {
|
|
59
|
-
}
|
|
60
|
-
Div.tagName = 'div';
|
|
61
|
-
Div.blotName = 'div';
|
|
62
|
-
Div.allowedChildren = Block.allowedChildren;
|
|
63
|
-
Div.allowedChildren.push(Block);
|
|
64
|
-
quill_1.default.register(Div);
|
|
65
|
-
}
|
|
66
|
-
findUID(el) {
|
|
67
|
-
if ('uid' in el.dataset) {
|
|
68
|
-
return el.dataset.uid;
|
|
69
|
-
}
|
|
70
|
-
return this.findUID(el.parentElement);
|
|
71
|
-
}
|
|
72
|
-
getInstance(uid) {
|
|
73
|
-
if (!(uid in stratus_1.Stratus.Instances)) {
|
|
74
|
-
return undefined;
|
|
75
|
-
}
|
|
76
|
-
return stratus_1.Stratus.Instances[uid];
|
|
77
|
-
}
|
|
78
|
-
onClick(quill) {
|
|
79
|
-
const container = quill.container;
|
|
80
|
-
const uid = this.findUID(container);
|
|
81
|
-
const instance = this.getInstance(uid);
|
|
82
|
-
if (!instance) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
instance.trigger(this.eventName, null, this);
|
|
86
|
-
}
|
|
87
|
-
trigger(name, data, callee) {
|
|
88
|
-
if (this.debug) {
|
|
89
|
-
console.log(`quill.${this.name}.trigger:`, name, data, callee);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
exports_1("QuillInputButtonPlugin", QuillInputButtonPlugin);
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
//# sourceMappingURL=quill-input-button.plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["quill-input-button.plugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;YAeA,yBAAA,MAAa,sBAAsB;gBAY/B,YAAY,KAAU,EAAE,OAAY;oBAPpC,UAAK,GAAG,KAAK,CAAA;oBACb,eAAU,GAAG,+BAA+B,CAAA;oBAC5C,gBAAW,GAAG,cAAc,CAAA;oBAC5B,SAAI,GAAG,aAAa,CAAA;oBACpB,cAAS,GAAG,cAAc,CAAA;oBAKtB,IAAI,CAAC,GAAG,GAAG,gBAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAA;oBAC5C,iBAAO,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAA;oBAElC,IAAI,CAAC,KAAK,GAAG,OAAO,IAAI,OAAO,CAAC,KAAK,CAAA;oBA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CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;gBAChD,CAAC;gBAED,OAAO,CAAC,IAAY,EAAE,IAAS,EAAE,MAAwB;oBAErD,IAAI,IAAI,CAAC,KAAK,EAAE;wBACZ,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,IAAI,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;qBACjE;gBACL,CAAC;aACJ,CAAA;;QAID,CAAC","file":"quill-input-button.plugin.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["@stratusjs/runtime/stratus","lodash","quill"],function(t,e){"use strict";var n,i,s;e&&e.id;return{setters:[function(t){n=t},function(t){i=t},function(t){s=t}],execute:function(){t("QuillInputButtonPlugin",class{constructor(t,e){this.debug=!1,this.buttonHTML='<i class="fas fa-carrot"></i>',this.buttonTitle="Input Button",this.name="inputButton",this.eventName="input-button",this.uid=i.default.uniqueId("quill_input_button_"),n.Stratus.Instances[this.uid]=this,this.debug=e&&e.debug,e&&"object"==typeof e||(e={}),this.buttonHTML=e.buttonHTML||this.buttonHTML,this.buttonTitle=e.buttonTitle||this.buttonTitle,this.name=e.name||this.name,this.eventName=e.eventName||this.eventName,this.createToolbarModule(t)}createToolbarModule(t){const e=t.getModule("toolbar");if(!e)throw new Error(`quill.${this.name} requires the "toolbar" module`);this.registerDivModule();const n=e.container,i=document.createElement("span");i.setAttribute("class","ql-formats");const s=document.createElement("button");s.innerHTML=this.buttonHTML,s.title=this.buttonTitle,s.onclick=e=>{e.preventDefault(),this.onClick(t)},i.appendChild(s),n.appendChild(i)}registerDivModule(){const t=s.default.import("blots/block");class e extends t{}e.tagName="div",e.blotName="div",e.allowedChildren=t.allowedChildren,e.allowedChildren.push(t),s.default.register(e)}findUID(t){return"uid"in t.dataset?t.dataset.uid:this.findUID(t.parentElement)}getInstance(t){if(t in n.Stratus.Instances)return n.Stratus.Instances[t]}onClick(t){const e=t.container,n=this.findUID(e),i=this.getInstance(n);i&&i.trigger(this.eventName,null,this)}trigger(t,e,n){this.debug&&console.log(`quill.${this.name}.trigger:`,t,e,n)}})}}});
|