@alfresco/adf-process-services-cloud 6.9.0-9113642727 → 6.9.0
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/esm2020/lib/form/components/widgets/display-rich-text/display-rich-text.widget.mjs +17 -7
- package/fesm2015/adf-process-services-cloud.mjs +15 -5
- package/fesm2015/adf-process-services-cloud.mjs.map +1 -1
- package/fesm2020/adf-process-services-cloud.mjs +15 -5
- package/fesm2020/adf-process-services-cloud.mjs.map +1 -1
- package/lib/form/components/widgets/display-rich-text/display-rich-text.widget.d.ts +4 -1
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { NgModule, EventEmitter, Component, ViewEncapsulation, Input, Output, Injectable, ContentChild, inject, Directive, InjectionToken, Inject, ViewChild, Pipe, ChangeDetectionStrategy, HostListener } from '@angular/core';
|
|
2
|
+
import { NgModule, EventEmitter, Component, ViewEncapsulation, Input, Output, Injectable, ContentChild, inject, Directive, InjectionToken, Inject, ViewChild, Pipe, SecurityContext, ChangeDetectionStrategy, HostListener } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@alfresco/adf-core';
|
|
4
4
|
import { CustomEmptyContentTemplateDirective, TemplateModule, CoreModule, AlfrescoApiService, AppConfigService, JwtHelperService, DataTableSchema, UserPreferenceValues, ObjectDataTableAdapter, AdfDateFnsAdapter, ADF_DATE_FORMATS, FullNamePipe, InitialUsernamePipe, TranslationService, UserPreferencesService, DateFnsUtils, FormModel, WidgetComponent, ContentLinkModel, UploadWidgetContentLinkModel, FormFieldEvent, FormFieldTypes, BaseViewerWidgetComponent, ErrorMessageModel, ObjectDataColumn, ObjectDataRow, DataTableModule, FormBaseModule, FormRenderingService, FormService, FormBaseComponent, FORM_FIELD_VALIDATORS, FormEvent, FormOutcomeModel, FormOutcomeEvent, ToolbarModule, FormatSpacePipe, CardViewTextItemModel, CardViewSelectItemModel, CardViewDatetimeItemModel, CardViewDateItemModel, CardViewArrayItemModel, CustomLoadingContentTemplateDirective, DataTableComponent, provideTranslations } from '@alfresco/adf-core';
|
|
5
5
|
import * as i2$1 from '@angular/material/autocomplete';
|
|
@@ -69,6 +69,7 @@ import * as i2$3 from '@alfresco/adf-content-services';
|
|
|
69
69
|
import { NodeAction, ContentNodeSelectorComponent, NewVersionUploaderDataAction, ConfirmDialogComponent, ContentNodeSelectorModule, ContentMetadataModule, UploadModule, AlfrescoViewerModule } from '@alfresco/adf-content-services';
|
|
70
70
|
import { v4 } from 'uuid';
|
|
71
71
|
import edjsHTML from 'editorjs-html';
|
|
72
|
+
import * as i2$4 from '@angular/platform-browser';
|
|
72
73
|
import { Overlay, OverlayModule } from '@angular/cdk/overlay';
|
|
73
74
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
74
75
|
import * as i11 from '@angular/cdk/a11y';
|
|
@@ -8308,16 +8309,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImpor
|
|
|
8308
8309
|
* limitations under the License.
|
|
8309
8310
|
*/
|
|
8310
8311
|
class DisplayRichTextWidgetComponent extends WidgetComponent {
|
|
8311
|
-
constructor(formService) {
|
|
8312
|
+
constructor(formService, sanitizer) {
|
|
8312
8313
|
super(formService);
|
|
8313
8314
|
this.formService = formService;
|
|
8315
|
+
this.sanitizer = sanitizer;
|
|
8314
8316
|
}
|
|
8315
8317
|
ngOnInit() {
|
|
8316
|
-
/* cspell:disable-next-line */
|
|
8317
8318
|
this.parsedHTML = edjsHTML().parseStrict(this.field.value);
|
|
8319
|
+
if (!(this.parsedHTML instanceof Error)) {
|
|
8320
|
+
this.sanitizeHtmlContent();
|
|
8321
|
+
}
|
|
8322
|
+
else {
|
|
8323
|
+
throw this.parsedHTML;
|
|
8324
|
+
}
|
|
8325
|
+
}
|
|
8326
|
+
sanitizeHtmlContent() {
|
|
8327
|
+
this.parsedHTML = this.sanitizer.sanitize(SecurityContext.HTML, this.parsedHTML.join(''));
|
|
8318
8328
|
}
|
|
8319
8329
|
}
|
|
8320
|
-
DisplayRichTextWidgetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: DisplayRichTextWidgetComponent, deps: [{ token: i1$1.FormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
8330
|
+
DisplayRichTextWidgetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: DisplayRichTextWidgetComponent, deps: [{ token: i1$1.FormService }, { token: i2$4.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
|
|
8321
8331
|
DisplayRichTextWidgetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: DisplayRichTextWidgetComponent, selector: "display-rich-text", host: { listeners: { "click": "event($event)", "blur": "event($event)", "change": "event($event)", "focus": "event($event)", "focusin": "event($event)", "focusout": "event($event)", "input": "event($event)", "invalid": "event($event)", "select": "event($event)" } }, usesInheritance: true, ngImport: i0, template: "<div class=\"adf-display-rich-text-widget\">\n <div class=\"adf-display-rich-text-widget-parsed-html\" [innerHTML]=\"parsedHTML\"></div>\n</div>\n", styles: [".adf-display-rich-text-widget{padding:10px}.adf-display-rich-text-widget pre{min-height:100px;font-family:Menlo,Monaco,Consolas,Courier New,monospace;color:#41314e;line-height:1.6em;font-size:12px;background:#f8f7fa;border:1px solid #f1f1f4;box-shadow:none;white-space:pre;word-wrap:normal;overflow-x:auto;resize:vertical;border-radius:3px;padding:10px 12px;outline:none;width:100%}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
8322
8332
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: DisplayRichTextWidgetComponent, decorators: [{
|
|
8323
8333
|
type: Component,
|
|
@@ -8332,7 +8342,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImpor
|
|
|
8332
8342
|
'(invalid)': 'event($event)',
|
|
8333
8343
|
'(select)': 'event($event)'
|
|
8334
8344
|
}, encapsulation: ViewEncapsulation.None, template: "<div class=\"adf-display-rich-text-widget\">\n <div class=\"adf-display-rich-text-widget-parsed-html\" [innerHTML]=\"parsedHTML\"></div>\n</div>\n", styles: [".adf-display-rich-text-widget{padding:10px}.adf-display-rich-text-widget pre{min-height:100px;font-family:Menlo,Monaco,Consolas,Courier New,monospace;color:#41314e;line-height:1.6em;font-size:12px;background:#f8f7fa;border:1px solid #f1f1f4;box-shadow:none;white-space:pre;word-wrap:normal;overflow-x:auto;resize:vertical;border-radius:3px;padding:10px 12px;outline:none;width:100%}\n"] }]
|
|
8335
|
-
}], ctorParameters: function () { return [{ type: i1$1.FormService }]; } });
|
|
8345
|
+
}], ctorParameters: function () { return [{ type: i1$1.FormService }, { type: i2$4.DomSanitizer }]; } });
|
|
8336
8346
|
|
|
8337
8347
|
/*!
|
|
8338
8348
|
* @license
|