@alfresco/adf-process-services-cloud 8.4.0-21831030013 → 8.4.0-21841784975

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.
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { inject, Injectable, EventEmitter, DestroyRef, Output, Input, ContentChild, Directive, InjectionToken, Inject, ViewEncapsulation, Component, NgModule, effect, ViewChild, Optional, ChangeDetectorRef, HostListener, ViewContainerRef, ChangeDetectionStrategy, input, output, signal, SecurityContext } from '@angular/core';
3
3
  import * as i2 from '@alfresco/adf-core';
4
- import { AppConfigService, JwtHelperService, TranslationService, DataTableSchema, UserPreferenceValues, CustomEmptyContentTemplateDirective, ObjectDataTableAdapter, ColumnsSelectorComponent, MainMenuDataTableTemplateDirective, EmptyContentComponent, NoContentTemplateDirective, LoadingContentTemplateDirective, DataTableComponent, AdfDateFnsAdapter, MOMENT_DATE_FORMATS, IconModule, UserPreferencesService, DateFnsUtils, ADF_DATE_FORMATS, FullNamePipe, InitialUsernamePipe, FormService, FormModel, FormBaseComponent, WidgetVisibilityService, UploadWidgetContentLinkModel, FormEvent, FormOutcomeModel, ConfirmDialogComponent, FormOutcomeEvent, FormatSpacePipe, FormRendererComponent, ToolbarDividerComponent, ToolbarComponent, WidgetComponent, ThumbnailService, NotificationService, ErrorWidgetComponent, LocalizedDatePipe, UploadDirective, ContentLinkModel, ErrorMessageModel, DEFAULT_DATE_FORMAT, FormFieldEvent, FormFieldTypes, SelectFilterInputComponent, DynamicComponentMapper, CardViewTextItemModel, CardViewSelectItemModel, CardViewDatetimeItemModel, CardViewDateItemModel, CardViewArrayItemModel, CardViewComponent, CustomLoadingContentTemplateDirective, isOutcomeButtonVisible, InplaceFormInputComponent, BaseViewerWidgetComponent, ObjectDataColumn, ObjectDataRow, FormBaseModule, FormRenderingService, provideTranslations } from '@alfresco/adf-core';
4
+ import { AppConfigService, JwtHelperService, TranslationService, DataTableSchema, UserPreferenceValues, CustomEmptyContentTemplateDirective, ObjectDataTableAdapter, ColumnsSelectorComponent, MainMenuDataTableTemplateDirective, EmptyContentComponent, NoContentTemplateDirective, LoadingContentTemplateDirective, DataTableComponent, AdfDateFnsAdapter, MOMENT_DATE_FORMATS, IconModule, UserPreferencesService, DateFnsUtils, ADF_DATE_FORMATS, FullNamePipe, InitialUsernamePipe, FormService, FormModel, FormBaseComponent, WidgetVisibilityService, UploadWidgetContentLinkModel, FormEvent, FormOutcomeModel, ConfirmDialogComponent, FormOutcomeEvent, FormatSpacePipe, FormRendererComponent, ToolbarDividerComponent, ToolbarComponent, WidgetComponent, ThumbnailService, NotificationService, ErrorWidgetComponent, LocalizedDatePipe, UploadDirective, ContentLinkModel, ErrorMessageModel, DEFAULT_DATE_FORMAT, FormFieldEvent, FormFieldTypes, SelectFilterInputComponent, DynamicComponentMapper, CardViewTextItemModel, CardViewSelectItemModel, CardViewDatetimeItemModel, CardViewDateItemModel, CardViewArrayItemModel, CardViewComponent, CustomLoadingContentTemplateDirective, isOutcomeButtonVisible, InplaceFormInputComponent, BaseViewerWidgetComponent, BaseDisplayTextWidgetComponent, ObjectDataColumn, ObjectDataRow, FormBaseModule, FormRenderingService, provideTranslations } from '@alfresco/adf-core';
5
5
  import { from, EMPTY, Subject, throwError, of, BehaviorSubject, combineLatest, firstValueFrom, forkJoin, catchError as catchError$1 } from 'rxjs';
6
6
  import { map, take, tap, filter, switchMap, debounceTime, finalize, mergeMap, distinctUntilChanged, expand, reduce, mapTo, catchError, concatMap } from 'rxjs/operators';
7
7
  import * as i1$4 from '@alfresco/adf-content-services';
@@ -14391,13 +14391,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
14391
14391
  const RICH_TEXT_PARSER_TOKEN = new InjectionToken('RichTextParserService', {
14392
14392
  factory: () => new RichTextParserService()
14393
14393
  });
14394
- class DisplayRichTextWidgetComponent extends WidgetComponent {
14394
+ class DisplayRichTextWidgetComponent extends BaseDisplayTextWidgetComponent {
14395
14395
  constructor() {
14396
14396
  super(...arguments);
14397
14397
  this.richTextParserService = inject(RICH_TEXT_PARSER_TOKEN);
14398
14398
  this.sanitizer = inject(DomSanitizer);
14399
14399
  }
14400
14400
  ngOnInit() {
14401
+ this.parseAndSanitize();
14402
+ // Re-parse when field changes (after expressions are evaluated)
14403
+ this.fieldChangedSubscription = this.fieldChanged.subscribe(() => {
14404
+ this.parseAndSanitize();
14405
+ });
14406
+ }
14407
+ ngOnDestroy() {
14408
+ this.fieldChangedSubscription?.unsubscribe();
14409
+ }
14410
+ storeOriginalValue() {
14411
+ if (this.field) {
14412
+ this.originalFieldValue = JSON.stringify(this.field.value);
14413
+ }
14414
+ }
14415
+ evaluateExpressions() {
14416
+ if (!this.field) {
14417
+ return;
14418
+ }
14419
+ const value = JSON.parse(JSON.stringify(this.field.value));
14420
+ this.applyExpressionsToBlocks(value);
14421
+ }
14422
+ reevaluateExpressions() {
14423
+ if (!this.field || !this.originalFieldValue) {
14424
+ return;
14425
+ }
14426
+ const value = JSON.parse(this.originalFieldValue);
14427
+ this.applyExpressionsToBlocks(value);
14428
+ }
14429
+ applyExpressionsToBlocks(value) {
14430
+ for (const block of value.blocks) {
14431
+ block.data.text = this.resolveExpressions(block.data.text);
14432
+ }
14433
+ this.field.value = value;
14434
+ }
14435
+ parseAndSanitize() {
14401
14436
  this.parsedHTML = this.richTextParserService.parse(this.field.value);
14402
14437
  if (this.parsedHTML instanceof Error) {
14403
14438
  throw this.parsedHTML;