@pepperi-addons/ngx-composite-lib 0.4.2-beta.75 → 0.4.2-beta.76

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.
@@ -173,6 +173,7 @@ class LayoutBuilderInternalService {
173
173
  // This configuration is for blocks behavior.
174
174
  this._blocksLimitNumber = 0;
175
175
  this._navigateToEditorAfterBlockAdded = false;
176
+ this._getBlockTitle = (blockKey) => { return blockKey; };
176
177
  this._editorsBreadCrumb = Array();
177
178
  this._editMode = false;
178
179
  this._editableState = false;
@@ -211,6 +212,7 @@ class LayoutBuilderInternalService {
211
212
  setBlocksConfig(value) {
212
213
  this._blocksLimitNumber = value.blocksLimitNumber || 0;
213
214
  this._navigateToEditorAfterBlockAdded = value.navigateToEditorAfterBlockAdded ?? false;
215
+ this._getBlockTitle = value.getBlockTitle ? value.getBlockTitle : (blockKey) => { return blockKey; };
214
216
  }
215
217
  get editMode() {
216
218
  return this._editMode;
@@ -347,8 +349,8 @@ class LayoutBuilderInternalService {
347
349
  return editor;
348
350
  }
349
351
  getBlockEditor(blockKey, title) {
350
- // TODO: Get block editor title.
351
- const blockTitle = title || this.translate.instant('LAYOUT_BUILDER.NO_TITLE');
352
+ // Get block editor title.
353
+ const blockTitle = title || this.getBlockTitle(blockKey); // this.translate.instant('LAYOUT_BUILDER.NO_TITLE');
352
354
  return {
353
355
  id: blockKey,
354
356
  type: 'block',
@@ -462,12 +464,12 @@ class LayoutBuilderInternalService {
462
464
  /***********************************************************************************************/
463
465
  /* Public functions
464
466
  /***********************************************************************************************/
467
+ getBlockTitle(blockKey) {
468
+ return this._getBlockTitle(blockKey) || blockKey;
469
+ }
465
470
  setSectionsColumnsDropListChange(sectionsColumnsDropList) {
466
471
  this.notifySectionsColumnsDropListChange(sectionsColumnsDropList);
467
472
  }
468
- setLockScreen(value) {
469
- this.notifyLockScreen(value);
470
- }
471
473
  changePreviewMode(value) {
472
474
  this.notifyPreviewModeChange(value);
473
475
  }
@@ -701,7 +703,8 @@ class LayoutBuilderInternalService {
701
703
  this.notifyBlockAdded(blockAddedEventData);
702
704
  if (this._navigateToEditorAfterBlockAdded) {
703
705
  // Navigate to the block editor.
704
- this.navigateToEditor('block', blockKey, draggableItem.data.title);
706
+ // this.navigateToEditor('block', blockKey, draggableItem.data.title);
707
+ this.navigateToEditor('block', blockKey, '');
705
708
  }
706
709
  }
707
710
  }
@@ -774,6 +777,9 @@ class LayoutBuilderInternalService {
774
777
  showSkeleton(show) {
775
778
  this._showSkeletonSubject.next(show);
776
779
  }
780
+ lockScreen(value) {
781
+ this.notifyLockScreen(value);
782
+ }
777
783
  loadLayoutBuilder(layoutView) {
778
784
  if (this.editMode) {
779
785
  if (this._editorsBreadCrumb.length === 0) {
@@ -836,7 +842,7 @@ class SectionBlockComponent extends BaseDestroyerDirective {
836
842
  this.layoutBuilderInternalService.getIsHidden(this.blockContainer.Hide, this.screenType) : false;
837
843
  }
838
844
  ngOnInit() {
839
- this.blockTitle = this.blockContainer?.BlockKey || '';
845
+ this.blockTitle = this.layoutBuilderInternalService.getBlockTitle(this.blockContainer?.BlockKey || '');
840
846
  //
841
847
  // this.layoutBuilderInternalService.availableBlocksForDragMapChange$.pipe(this.getDestroyer()).subscribe((availableBlocksForDragMap) => {
842
848
  // if (availableBlocksForDragMap && this.blockContainer) {
@@ -2128,6 +2134,9 @@ class PepLayoutBuilderService {
2128
2134
  showSkeleton(show) {
2129
2135
  return this.layoutBuilderInternalService.showSkeleton(show);
2130
2136
  }
2137
+ lockScreen(lock) {
2138
+ return this.layoutBuilderInternalService.lockScreen(lock);
2139
+ }
2131
2140
  }
2132
2141
  PepLayoutBuilderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderService, deps: [{ token: LayoutBuilderInternalService }], target: i0.ɵɵFactoryTarget.Injectable });
2133
2142
  PepLayoutBuilderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderService, providedIn: 'root' });