@esfaenza/extensions 15.2.52 → 15.2.54

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.
@@ -3,7 +3,7 @@ import { InjectionToken, Injectable, Optional, Inject, Pipe, NgModule, Injector
3
3
  import * as i1 from '@esfaenza/localizations';
4
4
  import { LocalizationModule } from '@esfaenza/localizations';
5
5
  import { first, filter, take, map } from 'rxjs/operators';
6
- import { of, Subject, filter as filter$1 } from 'rxjs';
6
+ import { of, ReplaySubject, Subject, filter as filter$1 } from 'rxjs';
7
7
  import { ToastrService } from 'ngx-toastr';
8
8
  import swal from 'sweetalert2';
9
9
  import * as i2 from '@angular/router';
@@ -1057,6 +1057,7 @@ class AppEmbeddingExtensions {
1057
1057
  this.router = router;
1058
1058
  this.location = location;
1059
1059
  this.sidebarWidth = 230;
1060
+ this.EmbeddingSource = new ReplaySubject();
1060
1061
  this.Embedded = false;
1061
1062
  this.EmbeddingLevel = 0;
1062
1063
  this.MessageObserver = new Subject();
@@ -1111,6 +1112,9 @@ class AppEmbeddingExtensions {
1111
1112
  return `${JSON.parse(JSON.stringify(event?.data))}`;
1112
1113
  }
1113
1114
  configureEmbeddability() {
1115
+ if (this.Embedded) {
1116
+ this.MainWindow.postMessage({ type: "whois" }, "*");
1117
+ }
1114
1118
  window.onmessage = (event) => {
1115
1119
  // Ignoro i miei messaggi dato che mi interessano solo quelli degli altri iframe
1116
1120
  if (event.source == window && event?.data?.type != "modal-open")
@@ -1141,6 +1145,14 @@ class AppEmbeddingExtensions {
1141
1145
  break;
1142
1146
  }
1143
1147
  }
1148
+ else if (event?.data?.type == "whois") {
1149
+ console.log(`Window message - Whois?`);
1150
+ sourceWindow.postMessage({ type: "itsme", module: myconfig.AppData.ModuleId }, "*");
1151
+ }
1152
+ else if (event?.data?.type == "itsme") {
1153
+ console.log(`Window message - It'sme -> ` + event?.data?.module);
1154
+ this.EmbeddingSource.next(event?.data?.module);
1155
+ }
1144
1156
  else if (event?.data?.type == "replace-state") {
1145
1157
  console.log(`Window message - replace-state -> Url: ${event?.data?.url}`);
1146
1158
  this.location.replaceState(event?.data?.url);