matcha-components 20.268.0 → 20.269.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.
@@ -15616,8 +15616,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
15616
15616
  class MatchaPageBuilderComponent {
15617
15617
  set text(value) {
15618
15618
  this._text = value;
15619
- if (this.isEditorInitialized && this.editor && value) {
15620
- this.editor.setComponents(value);
15619
+ if (this.isEditorInitialized && this.editor) {
15620
+ if (value) {
15621
+ this.editor.setComponents(value);
15622
+ }
15623
+ else {
15624
+ this.editor.runCommand('core:canvas-clear');
15625
+ }
15621
15626
  }
15622
15627
  }
15623
15628
  constructor(ngZone) {
@@ -15736,7 +15741,8 @@ class MatchaPageBuilderComponent {
15736
15741
  this.editor = grapesjs.init({
15737
15742
  height: '100%',
15738
15743
  container: `#${this.containerId}`,
15739
- fromElement: true, // Changed from false to true
15744
+ fromElement: true,
15745
+ storageManager: false,
15740
15746
  showOffsets: true,
15741
15747
  assetManager: {
15742
15748
  embedAsBase64: true,
@@ -16115,6 +16121,9 @@ class MatchaPageBuilderComponent {
16115
16121
  if (this._text) {
16116
16122
  this.editor.setComponents(this._text);
16117
16123
  }
16124
+ else {
16125
+ this.editor.runCommand('core:canvas-clear');
16126
+ }
16118
16127
  this.ngZone.run(() => { this.isLoading = false; });
16119
16128
  editor.on('update', () => {
16120
16129
  clearTimeout(this._changeDebounceTimer);
@@ -16152,11 +16161,11 @@ class MatchaPageBuilderComponent {
16152
16161
  }
16153
16162
  }
16154
16163
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: MatchaPageBuilderComponent, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
16155
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: MatchaPageBuilderComponent, isStandalone: false, selector: "matcha-page-builder", inputs: { showControls: "showControls", text: "text" }, outputs: { onSave: "onSave", onChange: "onChange" }, viewQueries: [{ propertyName: "gjsContainer", first: true, predicate: ["gjsContainer"], descendants: true }], ngImport: i0, template: "<div class=\"matcha-page-builder\">\n <matcha-spinner *ngIf=\"isLoading\"></matcha-spinner>\n <div class=\"editor-shell\" [style.display]=\"isLoading ? 'none' : 'block'\">\n <div [id]=\"containerId\"></div>\n </div>\n <div class=\"editor-controls\" *ngIf=\"showControls && !isLoading\">\n <button matcha-button (click)=\"save()\">Salvar</button>\n </div>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatchaButtonComponent, selector: "[matcha-button]", inputs: ["size", "size-xs", "size-sm", "size-md", "size-lg", "size-xl", "gap", "color", "basic", "outline", "alpha", "pill", "link", "icon", "badge"] }, { kind: "component", type: MatchaSpinnerComponent, selector: "matcha-spinner", inputs: ["progress", "color", "size", "size-xs", "size-sm", "size-md", "size-lg", "size-xl"] }], encapsulation: i0.ViewEncapsulation.None }); }
16164
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: MatchaPageBuilderComponent, isStandalone: false, selector: "matcha-page-builder", inputs: { showControls: "showControls", text: "text" }, outputs: { onSave: "onSave", onChange: "onChange" }, viewQueries: [{ propertyName: "gjsContainer", first: true, predicate: ["gjsContainer"], descendants: true }], ngImport: i0, template: "<div class=\"matcha-page-builder\">\n <matcha-skeleton *ngIf=\"isLoading\" height=\"600\" [amount]=\"1\" model=\"empty\"></matcha-skeleton>\n <div class=\"editor-shell\" [style.display]=\"isLoading ? 'none' : 'block'\">\n <div [id]=\"containerId\"></div>\n </div>\n <div class=\"editor-controls\" *ngIf=\"showControls && !isLoading\">\n <button matcha-button (click)=\"save()\">Salvar</button>\n </div>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatchaButtonComponent, selector: "[matcha-button]", inputs: ["size", "size-xs", "size-sm", "size-md", "size-lg", "size-xl", "gap", "color", "basic", "outline", "alpha", "pill", "link", "icon", "badge"] }, { kind: "component", type: MatchaSkeletonComponent, selector: "matcha-skeleton", inputs: ["amount", "grid", "height", "model", "gap"] }], encapsulation: i0.ViewEncapsulation.None }); }
16156
16165
  }
16157
16166
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: MatchaPageBuilderComponent, decorators: [{
16158
16167
  type: Component,
16159
- args: [{ selector: 'matcha-page-builder', encapsulation: ViewEncapsulation.None, standalone: false, template: "<div class=\"matcha-page-builder\">\n <matcha-spinner *ngIf=\"isLoading\"></matcha-spinner>\n <div class=\"editor-shell\" [style.display]=\"isLoading ? 'none' : 'block'\">\n <div [id]=\"containerId\"></div>\n </div>\n <div class=\"editor-controls\" *ngIf=\"showControls && !isLoading\">\n <button matcha-button (click)=\"save()\">Salvar</button>\n </div>\n</div>" }]
16168
+ args: [{ selector: 'matcha-page-builder', encapsulation: ViewEncapsulation.None, standalone: false, template: "<div class=\"matcha-page-builder\">\n <matcha-skeleton *ngIf=\"isLoading\" height=\"600\" [amount]=\"1\" model=\"empty\"></matcha-skeleton>\n <div class=\"editor-shell\" [style.display]=\"isLoading ? 'none' : 'block'\">\n <div [id]=\"containerId\"></div>\n </div>\n <div class=\"editor-controls\" *ngIf=\"showControls && !isLoading\">\n <button matcha-button (click)=\"save()\">Salvar</button>\n </div>\n</div>" }]
16160
16169
  }], ctorParameters: () => [{ type: i0.NgZone }], propDecorators: { gjsContainer: [{
16161
16170
  type: ViewChild,
16162
16171
  args: ['gjsContainer', { static: false }]
@@ -16174,10 +16183,10 @@ class MatchaPageBuilderModule {
16174
16183
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: MatchaPageBuilderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
16175
16184
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.19", ngImport: i0, type: MatchaPageBuilderModule, declarations: [MatchaPageBuilderComponent], imports: [CommonModule,
16176
16185
  MatchaButtonModule,
16177
- MatchaSpinnerModule], exports: [MatchaPageBuilderComponent] }); }
16186
+ MatchaSkeletonModule], exports: [MatchaPageBuilderComponent] }); }
16178
16187
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: MatchaPageBuilderModule, imports: [CommonModule,
16179
16188
  MatchaButtonModule,
16180
- MatchaSpinnerModule] }); }
16189
+ MatchaSkeletonModule] }); }
16181
16190
  }
16182
16191
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: MatchaPageBuilderModule, decorators: [{
16183
16192
  type: NgModule,
@@ -16186,7 +16195,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
16186
16195
  imports: [
16187
16196
  CommonModule,
16188
16197
  MatchaButtonModule,
16189
- MatchaSpinnerModule,
16198
+ MatchaSkeletonModule,
16190
16199
  ],
16191
16200
  exports: [MatchaPageBuilderComponent]
16192
16201
  }]