@luzmo/embed 7.0.0-es2021 → 7.1.0-es2021
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 +6 -1
- package/README.md +13 -0
- package/index.cjs +51 -11
- package/index.js +51 -11
- package/luzmo-embed.min.js +51 -11
- package/package.json +2 -2
- package/src/index.d.ts +1 -1
- package/src/lib/dashboard/dashboard-base.d.ts +5 -0
- package/src/lib/helper/embed-error.utils.d.ts +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
-
## [7.
|
|
5
|
+
## [7.1.0] - 2026-07-20
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- `error` event on `<luzmo-embed-dashboard>` and `<luzmo-embed-viz-item>`. Fires when the embed cannot be loaded or hits a fatal error (connectivity, permissions, invalid configuration, etc.), so you can handle it in your host app instead of showing a stuck loader.
|
|
9
|
+
|
|
10
|
+
## [7.0.0] - 2026-07-10
|
|
6
11
|
|
|
7
12
|
### Removed
|
|
8
13
|
- Removed the `accentColor` property and `accent-color` attribute from `<luzmo-embed-dashboard>`.
|
package/README.md
CHANGED
|
@@ -87,6 +87,7 @@ Below a list of available properties on the viz item web component
|
|
|
87
87
|
| changedFilters | Emitted when filters are changed |
|
|
88
88
|
| contextChanged | Emitted on any change, carries the full viz-item context |
|
|
89
89
|
| customEvent | Emitted when a custom event is fired |
|
|
90
|
+
| error | Emitted when the viz item cannot be loaded or encounters a fatal error. Check `event.detail.errorMsg` for details. |
|
|
90
91
|
| exported | Emitted when export completes or fails |
|
|
91
92
|
| rendered | Emitted when the item is rendered |
|
|
92
93
|
| load | Emitted when viz item is loaded |
|
|
@@ -195,6 +196,17 @@ Below a list of available properties on the dashboard web component
|
|
|
195
196
|
| `apiHost` | string | API server to connect to (Default: 'https://api.luzmo.com/' , for US set apiHost to 'https://api.us.luzmo.com/') |
|
|
196
197
|
| `editMode` | string | Specifies if the embedded dashboard should be editable or not. Accepted values: "view" , "editLimited" , "editFull" . Use "view" if you don't want the embedded dashboard to be editable. (Default: "view" ) |
|
|
197
198
|
| `mainColor` | string | Optional override of the main color used in the whitelabeling of the embedded dashboard editor. If not provided, the main color of the whitelabeling colors set on the organization will be used. Should be specified as a string of rgb values (i.e. "rgb(50,50,50)"). |
|
|
199
|
+
| `embedMode` | `'iframe' \| 'webComponent'` | How the dashboard is mounted inside your page. Defaults to `'iframe'` (rendered inside an `<iframe>`). Use `'webComponent'` to render the dashboard directly on your page (no iframe), which gives you full control over styling via CSS variables. `'webComponent'` is view-mode only; edit modes always fall back to iframe. See ["Embed modes and network requirements"](#embed-modes-and-network-requirements) below. |
|
|
200
|
+
|
|
201
|
+
<br/>
|
|
202
|
+
|
|
203
|
+
### Embed modes and network requirements
|
|
204
|
+
|
|
205
|
+
`embedMode="webComponent"` renders the dashboard directly on your page (no iframe), which gives you full control over styling via CSS variables. Because the dashboard then connects to your Luzmo API host directly from your domain, keep the following in mind:
|
|
206
|
+
|
|
207
|
+
- **WebSocket connectivity** to your Luzmo API host must be allowed by any reverse proxy, CSP or corporate firewall in front of your users. Your API host is whatever you set as `apiHost` (`api.luzmo.com` by default); make sure `wss://` connections to it are permitted. This lets the embed load reliably without relying on third-party cookies, which modern browsers and incognito windows block by default.
|
|
208
|
+
- **CNAME whitelabeling** (serving the Luzmo API from a subdomain of your own site) is still supported and is a good option if you want a fully first-party setup, but it is no longer required.
|
|
209
|
+
- **Error handling.** When the embed hits a fatal error (including connection failures after ~15 seconds), it fires an `error` event (see below) instead of showing an endless loader. Handle that event to show your own message.
|
|
198
210
|
|
|
199
211
|
<br/>
|
|
200
212
|
|
|
@@ -205,6 +217,7 @@ Below a list of available properties on the dashboard web component
|
|
|
205
217
|
| changedFilters | Emitted when filters are changed | `ChangedFiltersEvent` |
|
|
206
218
|
| contextChanged | Emitted on any dashboard change, carries the full context | `ContextChangedEvent` |
|
|
207
219
|
| customEvent | Emitted when a custom event is fired | `CustomEvent` |
|
|
220
|
+
| error | Emitted when the dashboard cannot be loaded or encounters a fatal error. Check `event.detail.errorMsg` for details. | `EmbedErrorEvent` |
|
|
208
221
|
| exported | Emitted when export completes or fails | `ExportedEvent` |
|
|
209
222
|
| itemsRendered | Emitted when all items are rendered | `ItemsRenderedEvent` |
|
|
210
223
|
| load | Emitted when dashboard is loaded | `LoadEvent` |
|
package/index.cjs
CHANGED
|
@@ -65,7 +65,26 @@ var import_decorators = require("lit/decorators.js");
|
|
|
65
65
|
var import_style_map = require("lit/directives/style-map.js");
|
|
66
66
|
|
|
67
67
|
// libs/embed-libs/embed/package.json
|
|
68
|
-
var version = "7.
|
|
68
|
+
var version = "7.1.0";
|
|
69
|
+
|
|
70
|
+
// libs/embed-libs/embed/src/lib/helper/embed-error.utils.ts
|
|
71
|
+
function buildEmbedErrorDetail(errorMsg) {
|
|
72
|
+
const payload = {
|
|
73
|
+
type: "error",
|
|
74
|
+
errorMsg,
|
|
75
|
+
error: { msg: errorMsg }
|
|
76
|
+
};
|
|
77
|
+
return { ...payload, data: payload };
|
|
78
|
+
}
|
|
79
|
+
function firstString(...values) {
|
|
80
|
+
return values.find((value) => typeof value === "string" && value.length > 0);
|
|
81
|
+
}
|
|
82
|
+
function normalizeEmbedErrorDetail(detail) {
|
|
83
|
+
const wrapped = detail;
|
|
84
|
+
const raw = wrapped?.data ?? detail ?? {};
|
|
85
|
+
const errorMsg = firstString(raw.errorMsg, raw.error?.msg) ?? "Unknown error";
|
|
86
|
+
return buildEmbedErrorDetail(errorMsg);
|
|
87
|
+
}
|
|
69
88
|
|
|
70
89
|
// libs/embed-libs/embed/src/lib/helper/event-bus-handler.ts
|
|
71
90
|
var SharedLib = __toESM(require("@luzmo/shared-embed"));
|
|
@@ -105,14 +124,7 @@ var _setEventHandler = () => {
|
|
|
105
124
|
break;
|
|
106
125
|
}
|
|
107
126
|
case "error": {
|
|
108
|
-
dashboardComponent.
|
|
109
|
-
if (dashboardComponent._loadTimeoutHandle) {
|
|
110
|
-
clearTimeout(dashboardComponent._loadTimeoutHandle);
|
|
111
|
-
dashboardComponent._loadTimeoutHandle = void 0;
|
|
112
|
-
}
|
|
113
|
-
dashboardComponent.iframeLoaded = true;
|
|
114
|
-
dashboardComponent._displayError();
|
|
115
|
-
console.error("Dashboard error:", event.data.errorMsg ?? event.data.error?.msg);
|
|
127
|
+
dashboardComponent._handleEmbedError(event.data);
|
|
116
128
|
break;
|
|
117
129
|
}
|
|
118
130
|
case "data": {
|
|
@@ -573,6 +585,9 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
573
585
|
this.dispatchEvent(new CustomEvent("load", payload));
|
|
574
586
|
});
|
|
575
587
|
el.addEventListener("itemsRendered", (payload) => this.dispatchEvent(new CustomEvent("itemsRendered", payload)));
|
|
588
|
+
el.addEventListener("error", (event) => {
|
|
589
|
+
this._handleEmbedError(event.detail);
|
|
590
|
+
});
|
|
576
591
|
el.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
|
|
577
592
|
el.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
|
|
578
593
|
el.addEventListener("dashboardAction", (payload) => this.dispatchEvent(new CustomEvent("dashboardAction", payload)));
|
|
@@ -790,10 +805,30 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
790
805
|
const data = SharedLib2.getLoader(this);
|
|
791
806
|
this._loaderMsg = data.loadingMsg;
|
|
792
807
|
if (data.errorMsg) {
|
|
808
|
+
this._handleEmbedError({ errorMsg: data.errorMsg }, "browser");
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* Switch the embed shell into its error state and emit the public `error` event.
|
|
813
|
+
* Used for iframe postMessage errors, webComponent CustomEvents, and browser checks.
|
|
814
|
+
*/
|
|
815
|
+
_handleEmbedError(detail, kind = "dashboard") {
|
|
816
|
+
const normalizedDetail = normalizeEmbedErrorDetail(detail);
|
|
817
|
+
const errorMsg = normalizedDetail.errorMsg;
|
|
818
|
+
if (kind === "browser") {
|
|
793
819
|
this.browserError = true;
|
|
794
|
-
this.browserErrorMsg =
|
|
795
|
-
|
|
820
|
+
this.browserErrorMsg = errorMsg;
|
|
821
|
+
} else {
|
|
822
|
+
this.dashboardError = true;
|
|
823
|
+
this.iframeLoaded = true;
|
|
824
|
+
}
|
|
825
|
+
if (this._loadTimeoutHandle) {
|
|
826
|
+
clearTimeout(this._loadTimeoutHandle);
|
|
827
|
+
this._loadTimeoutHandle = void 0;
|
|
796
828
|
}
|
|
829
|
+
this._displayError();
|
|
830
|
+
console.error("Dashboard error:", errorMsg);
|
|
831
|
+
this.dispatchEvent(new CustomEvent("error", { detail: normalizedDetail }));
|
|
797
832
|
}
|
|
798
833
|
_displayError() {
|
|
799
834
|
if (this.dashboardError) {
|
|
@@ -1324,6 +1359,11 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
|
|
|
1324
1359
|
});
|
|
1325
1360
|
this.chartElement.addEventListener("exported", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
|
|
1326
1361
|
this.chartElement.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
|
|
1362
|
+
this.chartElement.addEventListener("error", (event) => {
|
|
1363
|
+
this.dispatchEvent(new CustomEvent("error", {
|
|
1364
|
+
detail: normalizeEmbedErrorDetail(event.detail)
|
|
1365
|
+
}));
|
|
1366
|
+
});
|
|
1327
1367
|
this.chartElement.addEventListener("authorizationExpired", (payload) => this.dispatchEvent(new CustomEvent("authorizationExpired", payload)));
|
|
1328
1368
|
this.updateVizItemProperties();
|
|
1329
1369
|
this.renderRoot.append(this.chartElement);
|
package/index.js
CHANGED
|
@@ -23,7 +23,26 @@ import { property, query, state } from "lit/decorators.js";
|
|
|
23
23
|
import { styleMap } from "lit/directives/style-map.js";
|
|
24
24
|
|
|
25
25
|
// libs/embed-libs/embed/package.json
|
|
26
|
-
var version = "7.
|
|
26
|
+
var version = "7.1.0";
|
|
27
|
+
|
|
28
|
+
// libs/embed-libs/embed/src/lib/helper/embed-error.utils.ts
|
|
29
|
+
function buildEmbedErrorDetail(errorMsg) {
|
|
30
|
+
const payload = {
|
|
31
|
+
type: "error",
|
|
32
|
+
errorMsg,
|
|
33
|
+
error: { msg: errorMsg }
|
|
34
|
+
};
|
|
35
|
+
return { ...payload, data: payload };
|
|
36
|
+
}
|
|
37
|
+
function firstString(...values) {
|
|
38
|
+
return values.find((value) => typeof value === "string" && value.length > 0);
|
|
39
|
+
}
|
|
40
|
+
function normalizeEmbedErrorDetail(detail) {
|
|
41
|
+
const wrapped = detail;
|
|
42
|
+
const raw = wrapped?.data ?? detail ?? {};
|
|
43
|
+
const errorMsg = firstString(raw.errorMsg, raw.error?.msg) ?? "Unknown error";
|
|
44
|
+
return buildEmbedErrorDetail(errorMsg);
|
|
45
|
+
}
|
|
27
46
|
|
|
28
47
|
// libs/embed-libs/embed/src/lib/helper/event-bus-handler.ts
|
|
29
48
|
import * as SharedLib from "@luzmo/shared-embed";
|
|
@@ -63,14 +82,7 @@ var _setEventHandler = () => {
|
|
|
63
82
|
break;
|
|
64
83
|
}
|
|
65
84
|
case "error": {
|
|
66
|
-
dashboardComponent.
|
|
67
|
-
if (dashboardComponent._loadTimeoutHandle) {
|
|
68
|
-
clearTimeout(dashboardComponent._loadTimeoutHandle);
|
|
69
|
-
dashboardComponent._loadTimeoutHandle = void 0;
|
|
70
|
-
}
|
|
71
|
-
dashboardComponent.iframeLoaded = true;
|
|
72
|
-
dashboardComponent._displayError();
|
|
73
|
-
console.error("Dashboard error:", event.data.errorMsg ?? event.data.error?.msg);
|
|
85
|
+
dashboardComponent._handleEmbedError(event.data);
|
|
74
86
|
break;
|
|
75
87
|
}
|
|
76
88
|
case "data": {
|
|
@@ -531,6 +543,9 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
531
543
|
this.dispatchEvent(new CustomEvent("load", payload));
|
|
532
544
|
});
|
|
533
545
|
el.addEventListener("itemsRendered", (payload) => this.dispatchEvent(new CustomEvent("itemsRendered", payload)));
|
|
546
|
+
el.addEventListener("error", (event) => {
|
|
547
|
+
this._handleEmbedError(event.detail);
|
|
548
|
+
});
|
|
534
549
|
el.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
|
|
535
550
|
el.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
|
|
536
551
|
el.addEventListener("dashboardAction", (payload) => this.dispatchEvent(new CustomEvent("dashboardAction", payload)));
|
|
@@ -748,10 +763,30 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
748
763
|
const data = SharedLib2.getLoader(this);
|
|
749
764
|
this._loaderMsg = data.loadingMsg;
|
|
750
765
|
if (data.errorMsg) {
|
|
766
|
+
this._handleEmbedError({ errorMsg: data.errorMsg }, "browser");
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
/**
|
|
770
|
+
* Switch the embed shell into its error state and emit the public `error` event.
|
|
771
|
+
* Used for iframe postMessage errors, webComponent CustomEvents, and browser checks.
|
|
772
|
+
*/
|
|
773
|
+
_handleEmbedError(detail, kind = "dashboard") {
|
|
774
|
+
const normalizedDetail = normalizeEmbedErrorDetail(detail);
|
|
775
|
+
const errorMsg = normalizedDetail.errorMsg;
|
|
776
|
+
if (kind === "browser") {
|
|
751
777
|
this.browserError = true;
|
|
752
|
-
this.browserErrorMsg =
|
|
753
|
-
|
|
778
|
+
this.browserErrorMsg = errorMsg;
|
|
779
|
+
} else {
|
|
780
|
+
this.dashboardError = true;
|
|
781
|
+
this.iframeLoaded = true;
|
|
782
|
+
}
|
|
783
|
+
if (this._loadTimeoutHandle) {
|
|
784
|
+
clearTimeout(this._loadTimeoutHandle);
|
|
785
|
+
this._loadTimeoutHandle = void 0;
|
|
754
786
|
}
|
|
787
|
+
this._displayError();
|
|
788
|
+
console.error("Dashboard error:", errorMsg);
|
|
789
|
+
this.dispatchEvent(new CustomEvent("error", { detail: normalizedDetail }));
|
|
755
790
|
}
|
|
756
791
|
_displayError() {
|
|
757
792
|
if (this.dashboardError) {
|
|
@@ -1282,6 +1317,11 @@ var LuzmoBaseVizItem = class extends LitElement2 {
|
|
|
1282
1317
|
});
|
|
1283
1318
|
this.chartElement.addEventListener("exported", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
|
|
1284
1319
|
this.chartElement.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
|
|
1320
|
+
this.chartElement.addEventListener("error", (event) => {
|
|
1321
|
+
this.dispatchEvent(new CustomEvent("error", {
|
|
1322
|
+
detail: normalizeEmbedErrorDetail(event.detail)
|
|
1323
|
+
}));
|
|
1324
|
+
});
|
|
1285
1325
|
this.chartElement.addEventListener("authorizationExpired", (payload) => this.dispatchEvent(new CustomEvent("authorizationExpired", payload)));
|
|
1286
1326
|
this.updateVizItemProperties();
|
|
1287
1327
|
this.renderRoot.append(this.chartElement);
|
package/luzmo-embed.min.js
CHANGED
|
@@ -5881,7 +5881,26 @@ var o6 = e6(class extends i5 {
|
|
|
5881
5881
|
});
|
|
5882
5882
|
|
|
5883
5883
|
// libs/embed-libs/embed/package.json
|
|
5884
|
-
var version = "7.
|
|
5884
|
+
var version = "7.1.0";
|
|
5885
|
+
|
|
5886
|
+
// libs/embed-libs/embed/src/lib/helper/embed-error.utils.ts
|
|
5887
|
+
function buildEmbedErrorDetail(errorMsg) {
|
|
5888
|
+
const payload = {
|
|
5889
|
+
type: "error",
|
|
5890
|
+
errorMsg,
|
|
5891
|
+
error: { msg: errorMsg }
|
|
5892
|
+
};
|
|
5893
|
+
return { ...payload, data: payload };
|
|
5894
|
+
}
|
|
5895
|
+
function firstString(...values) {
|
|
5896
|
+
return values.find((value) => typeof value === "string" && value.length > 0);
|
|
5897
|
+
}
|
|
5898
|
+
function normalizeEmbedErrorDetail(detail) {
|
|
5899
|
+
const wrapped = detail;
|
|
5900
|
+
const raw = wrapped?.data ?? detail ?? {};
|
|
5901
|
+
const errorMsg = firstString(raw.errorMsg, raw.error?.msg) ?? "Unknown error";
|
|
5902
|
+
return buildEmbedErrorDetail(errorMsg);
|
|
5903
|
+
}
|
|
5885
5904
|
|
|
5886
5905
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
5887
5906
|
var LuzmoDashboardService = class {
|
|
@@ -5918,14 +5937,7 @@ var _setEventHandler = () => {
|
|
|
5918
5937
|
break;
|
|
5919
5938
|
}
|
|
5920
5939
|
case "error": {
|
|
5921
|
-
dashboardComponent.
|
|
5922
|
-
if (dashboardComponent._loadTimeoutHandle) {
|
|
5923
|
-
clearTimeout(dashboardComponent._loadTimeoutHandle);
|
|
5924
|
-
dashboardComponent._loadTimeoutHandle = void 0;
|
|
5925
|
-
}
|
|
5926
|
-
dashboardComponent.iframeLoaded = true;
|
|
5927
|
-
dashboardComponent._displayError();
|
|
5928
|
-
console.error("Dashboard error:", event.data.errorMsg ?? event.data.error?.msg);
|
|
5940
|
+
dashboardComponent._handleEmbedError(event.data);
|
|
5929
5941
|
break;
|
|
5930
5942
|
}
|
|
5931
5943
|
case "data": {
|
|
@@ -6385,6 +6397,9 @@ var LuzmoDashboard = class extends i4 {
|
|
|
6385
6397
|
this.dispatchEvent(new CustomEvent("load", payload));
|
|
6386
6398
|
});
|
|
6387
6399
|
el.addEventListener("itemsRendered", (payload) => this.dispatchEvent(new CustomEvent("itemsRendered", payload)));
|
|
6400
|
+
el.addEventListener("error", (event) => {
|
|
6401
|
+
this._handleEmbedError(event.detail);
|
|
6402
|
+
});
|
|
6388
6403
|
el.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
|
|
6389
6404
|
el.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
|
|
6390
6405
|
el.addEventListener("dashboardAction", (payload) => this.dispatchEvent(new CustomEvent("dashboardAction", payload)));
|
|
@@ -6602,10 +6617,30 @@ var LuzmoDashboard = class extends i4 {
|
|
|
6602
6617
|
const data = getLoader(this);
|
|
6603
6618
|
this._loaderMsg = data.loadingMsg;
|
|
6604
6619
|
if (data.errorMsg) {
|
|
6620
|
+
this._handleEmbedError({ errorMsg: data.errorMsg }, "browser");
|
|
6621
|
+
}
|
|
6622
|
+
}
|
|
6623
|
+
/**
|
|
6624
|
+
* Switch the embed shell into its error state and emit the public `error` event.
|
|
6625
|
+
* Used for iframe postMessage errors, webComponent CustomEvents, and browser checks.
|
|
6626
|
+
*/
|
|
6627
|
+
_handleEmbedError(detail, kind = "dashboard") {
|
|
6628
|
+
const normalizedDetail = normalizeEmbedErrorDetail(detail);
|
|
6629
|
+
const errorMsg = normalizedDetail.errorMsg;
|
|
6630
|
+
if (kind === "browser") {
|
|
6605
6631
|
this.browserError = true;
|
|
6606
|
-
this.browserErrorMsg =
|
|
6607
|
-
|
|
6632
|
+
this.browserErrorMsg = errorMsg;
|
|
6633
|
+
} else {
|
|
6634
|
+
this.dashboardError = true;
|
|
6635
|
+
this.iframeLoaded = true;
|
|
6636
|
+
}
|
|
6637
|
+
if (this._loadTimeoutHandle) {
|
|
6638
|
+
clearTimeout(this._loadTimeoutHandle);
|
|
6639
|
+
this._loadTimeoutHandle = void 0;
|
|
6608
6640
|
}
|
|
6641
|
+
this._displayError();
|
|
6642
|
+
console.error("Dashboard error:", errorMsg);
|
|
6643
|
+
this.dispatchEvent(new CustomEvent("error", { detail: normalizedDetail }));
|
|
6609
6644
|
}
|
|
6610
6645
|
_displayError() {
|
|
6611
6646
|
if (this.dashboardError) {
|
|
@@ -7135,6 +7170,11 @@ var LuzmoBaseVizItem = class extends i4 {
|
|
|
7135
7170
|
});
|
|
7136
7171
|
this.chartElement.addEventListener("exported", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
|
|
7137
7172
|
this.chartElement.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
|
|
7173
|
+
this.chartElement.addEventListener("error", (event) => {
|
|
7174
|
+
this.dispatchEvent(new CustomEvent("error", {
|
|
7175
|
+
detail: normalizeEmbedErrorDetail(event.detail)
|
|
7176
|
+
}));
|
|
7177
|
+
});
|
|
7138
7178
|
this.chartElement.addEventListener("authorizationExpired", (payload) => this.dispatchEvent(new CustomEvent("authorizationExpired", payload)));
|
|
7139
7179
|
this.updateVizItemProperties();
|
|
7140
7180
|
this.renderRoot.append(this.chartElement);
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type * from '@luzmo/dashboard-contents-types';
|
|
2
|
-
export type { LoadEvent, ChangedFiltersEvent, CustomEvent, ItemsRenderedEvent, ExportedEvent, DashboardActionEvent, SelectedDataInput, ExportType, DashboardExportType, ItemData, ExportDashboard, AccessibleDashboard, SetEditMode, SetSelectedData, DashboardEditMode, VizItemPostMessageLoadEvent, VizItemPostMessageRenderedEvent, VizItemPostMessageExportedEvent, VizItemPostMessageChangedFiltersEvent, VizItemPostMessageCustomEventEvent, VizItemPostMessageAuthorizationExpiredEvent } from '@luzmo/shared-embed';
|
|
2
|
+
export type { LoadEvent, ChangedFiltersEvent, CustomEvent, ItemsRenderedEvent, ExportedEvent, DashboardActionEvent, SelectedDataInput, ExportType, DashboardExportType, ItemData, ExportDashboard, AccessibleDashboard, SetEditMode, SetSelectedData, DashboardEditMode, VizItemPostMessageLoadEvent, VizItemPostMessageRenderedEvent, VizItemPostMessageExportedEvent, VizItemPostMessageChangedFiltersEvent, VizItemPostMessageCustomEventEvent, VizItemPostMessageAuthorizationExpiredEvent, VizItemPostMessageErrorEvent, EmbedErrorEvent, EmbedErrorEventData } from '@luzmo/shared-embed';
|
|
3
3
|
export { selectedDataUtils, preloadDashboard, preloadVizItem, preloadIQ } from '@luzmo/shared-embed';
|
|
4
4
|
export * from './lib/dashboard/dashboard-component';
|
|
5
5
|
export * from './lib/viz-item/viz-item-component';
|
|
@@ -79,6 +79,11 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.WebC
|
|
|
79
79
|
_setOptions(): SharedLib.DashboardContentParams;
|
|
80
80
|
_updateIframeUrl(): void;
|
|
81
81
|
_setupLoader(): void;
|
|
82
|
+
/**
|
|
83
|
+
* Switch the embed shell into its error state and emit the public `error` event.
|
|
84
|
+
* Used for iframe postMessage errors, webComponent CustomEvents, and browser checks.
|
|
85
|
+
*/
|
|
86
|
+
_handleEmbedError(detail: unknown, kind?: 'dashboard' | 'browser'): void;
|
|
82
87
|
_displayError(): void;
|
|
83
88
|
_calculateDimAfterDashboardLoaded(): void;
|
|
84
89
|
_loaderStyles(): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EmbedErrorEventData } from '@luzmo/shared-embed';
|
|
2
|
+
export type EmbedErrorDetail = EmbedErrorEventData & {
|
|
3
|
+
data: EmbedErrorEventData;
|
|
4
|
+
};
|
|
5
|
+
export declare function buildEmbedErrorDetail(errorMsg: string): EmbedErrorDetail;
|
|
6
|
+
/**
|
|
7
|
+
* Normalize any error payload shape (postMessage, CustomEvent detail, etc.)
|
|
8
|
+
* into the public `EmbedErrorEvent` detail contract.
|
|
9
|
+
*/
|
|
10
|
+
export declare function normalizeEmbedErrorDetail(detail?: unknown): EmbedErrorDetail;
|