@luzmo/embed 5.0.11 → 5.0.13-alpha.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/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
 
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [5.0.12] - 2024-03-19
5
+
6
+ ### Bugfixes
7
+
8
+ - Fixed getAccessibleDashboards() to correctly work with embed tokens.
9
+
4
10
  ## [5.0.11] - 2024-03-18
5
11
 
6
12
  ### Updates
package/index.cjs CHANGED
@@ -54,7 +54,7 @@ var import_style_map = require("lit/directives/style-map.js");
54
54
  var import_shared_embed = require("@luzmo/shared-embed");
55
55
 
56
56
  // libs/embed-libs/embed/package.json
57
- var version = "5.0.11";
57
+ var version = "5.0.13-alpha.0";
58
58
 
59
59
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
60
60
  var LuzmoService = class {
@@ -356,6 +356,8 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
356
356
  this.browserNotSupported = [];
357
357
  this.VERSION = version + "-wc-luzmo";
358
358
  this.isLibraryLoaded = false;
359
+ this.currentAuthKey = null;
360
+ this.currentAuthToken = null;
359
361
  this.attributesMap = {
360
362
  dashboardId: "dashboard-id",
361
363
  dashboardSlug: "dashboard-slug",
@@ -503,11 +505,10 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
503
505
  this.dashboardReference = oldReference.cloneNode(true);
504
506
  oldReference.replaceWith(this.dashboardReference);
505
507
  this.dashboardReference.addEventListener("load", (payload) => {
506
- setTimeout(() => {
507
- this.containerWidth = this.dashboardReference.offsetWidth;
508
- this.dimensions = payload.detail.dimensions;
509
- SharedLib2._setCalculatedDimensions(this);
510
- });
508
+ this.containerWidth = this.dashboardReference.offsetWidth;
509
+ this.dimensions = payload.detail.dimensions;
510
+ SharedLib2._setCalculatedDimensions(this);
511
+ window.dispatchEvent(new Event("resize"));
511
512
  this.dispatchEvent(new CustomEvent("load", payload));
512
513
  });
513
514
  this.dashboardReference.addEventListener("itemsRendered", (payload) => this.dispatchEvent(new CustomEvent("itemsRendered", payload)));
@@ -687,6 +688,8 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
687
688
  this.apiHost = this.appServer.includes("luzmo.com") ? this.appServer.replace("app", "api") : this.appServer;
688
689
  defaultParameters.apiHost = this.apiHost;
689
690
  }
691
+ this.currentAuthKey = this.authKey;
692
+ this.currentAuthToken = this.authToken;
690
693
  return defaultParameters;
691
694
  }
692
695
  _updateIframeUrl() {
@@ -843,6 +846,8 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
843
846
  return Promise.reject();
844
847
  }
845
848
  setAuthorization(key, token) {
849
+ this.currentAuthKey = key;
850
+ this.currentAuthToken = token;
846
851
  if (this.getIsViewMode() && this.dashboardReference) {
847
852
  return this.dashboardReference.setAuthorization(key, token);
848
853
  }
@@ -879,13 +884,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
879
884
  return Promise.reject();
880
885
  }
881
886
  getAccessibleDashboards() {
882
- if (!this.getIsViewMode()) {
883
- return SharedLib2.getAccessibleDashboards(this, this.iframe);
884
- }
885
- if (this.getIsViewMode() && this.dashboardReference) {
886
- return this.dashboardReference.getAccessibleDashboards();
887
- }
888
- return Promise.reject();
887
+ return SharedLib2.getAccessibleDashboards(this);
889
888
  }
890
889
  addFilters(itemId, filters) {
891
890
  return this.dashboardReference.addFilters(itemId, filters);
@@ -1081,6 +1080,12 @@ __decorateClass([
1081
1080
  __decorateClass([
1082
1081
  (0, import_decorators.state)()
1083
1082
  ], LuzmoDashboard.prototype, "dashboardReference", 2);
1083
+ __decorateClass([
1084
+ (0, import_decorators.state)()
1085
+ ], LuzmoDashboard.prototype, "currentAuthKey", 2);
1086
+ __decorateClass([
1087
+ (0, import_decorators.state)()
1088
+ ], LuzmoDashboard.prototype, "currentAuthToken", 2);
1084
1089
 
1085
1090
  // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-component.ts
1086
1091
  var LuzmoDashboard2 = class extends LuzmoDashboard {
package/index.js CHANGED
@@ -37,7 +37,7 @@ import {
37
37
  } from "@luzmo/shared-embed";
38
38
 
39
39
  // libs/embed-libs/embed/package.json
40
- var version = "5.0.11";
40
+ var version = "5.0.13-alpha.0";
41
41
 
42
42
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
43
43
  var LuzmoService = class {
@@ -339,6 +339,8 @@ var LuzmoDashboard = class extends LitElement {
339
339
  this.browserNotSupported = [];
340
340
  this.VERSION = version + "-wc-luzmo";
341
341
  this.isLibraryLoaded = false;
342
+ this.currentAuthKey = null;
343
+ this.currentAuthToken = null;
342
344
  this.attributesMap = {
343
345
  dashboardId: "dashboard-id",
344
346
  dashboardSlug: "dashboard-slug",
@@ -486,11 +488,10 @@ var LuzmoDashboard = class extends LitElement {
486
488
  this.dashboardReference = oldReference.cloneNode(true);
487
489
  oldReference.replaceWith(this.dashboardReference);
488
490
  this.dashboardReference.addEventListener("load", (payload) => {
489
- setTimeout(() => {
490
- this.containerWidth = this.dashboardReference.offsetWidth;
491
- this.dimensions = payload.detail.dimensions;
492
- SharedLib2._setCalculatedDimensions(this);
493
- });
491
+ this.containerWidth = this.dashboardReference.offsetWidth;
492
+ this.dimensions = payload.detail.dimensions;
493
+ SharedLib2._setCalculatedDimensions(this);
494
+ window.dispatchEvent(new Event("resize"));
494
495
  this.dispatchEvent(new CustomEvent("load", payload));
495
496
  });
496
497
  this.dashboardReference.addEventListener("itemsRendered", (payload) => this.dispatchEvent(new CustomEvent("itemsRendered", payload)));
@@ -670,6 +671,8 @@ var LuzmoDashboard = class extends LitElement {
670
671
  this.apiHost = this.appServer.includes("luzmo.com") ? this.appServer.replace("app", "api") : this.appServer;
671
672
  defaultParameters.apiHost = this.apiHost;
672
673
  }
674
+ this.currentAuthKey = this.authKey;
675
+ this.currentAuthToken = this.authToken;
673
676
  return defaultParameters;
674
677
  }
675
678
  _updateIframeUrl() {
@@ -826,6 +829,8 @@ var LuzmoDashboard = class extends LitElement {
826
829
  return Promise.reject();
827
830
  }
828
831
  setAuthorization(key, token) {
832
+ this.currentAuthKey = key;
833
+ this.currentAuthToken = token;
829
834
  if (this.getIsViewMode() && this.dashboardReference) {
830
835
  return this.dashboardReference.setAuthorization(key, token);
831
836
  }
@@ -862,13 +867,7 @@ var LuzmoDashboard = class extends LitElement {
862
867
  return Promise.reject();
863
868
  }
864
869
  getAccessibleDashboards() {
865
- if (!this.getIsViewMode()) {
866
- return SharedLib2.getAccessibleDashboards(this, this.iframe);
867
- }
868
- if (this.getIsViewMode() && this.dashboardReference) {
869
- return this.dashboardReference.getAccessibleDashboards();
870
- }
871
- return Promise.reject();
870
+ return SharedLib2.getAccessibleDashboards(this);
872
871
  }
873
872
  addFilters(itemId, filters) {
874
873
  return this.dashboardReference.addFilters(itemId, filters);
@@ -1064,6 +1063,12 @@ __decorateClass([
1064
1063
  __decorateClass([
1065
1064
  state()
1066
1065
  ], LuzmoDashboard.prototype, "dashboardReference", 2);
1066
+ __decorateClass([
1067
+ state()
1068
+ ], LuzmoDashboard.prototype, "currentAuthKey", 2);
1069
+ __decorateClass([
1070
+ state()
1071
+ ], LuzmoDashboard.prototype, "currentAuthToken", 2);
1067
1072
 
1068
1073
  // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-component.ts
1069
1074
  var LuzmoDashboard2 = class extends LuzmoDashboard {