@luzmo/embed 7.1.0-es2021 → 7.2.1-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 +11 -1
- package/index.cjs +87 -37
- package/index.js +74 -26
- package/luzmo-embed.min.js +183 -83
- package/package.json +2 -2
- package/src/lib/dashboard/dashboard-base.d.ts +8 -7
- package/src/lib/iq-components/luzmo-iq-answer.d.ts +3 -2
- package/src/lib/viz-item/viz-item.base.d.ts +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [7.2.1] - 2026-09-04
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- Fixed embedded dashboards failing to load in `editFull` mode when `appServer` is set without a trailing slash.
|
|
9
|
+
|
|
10
|
+
## [7.2.0] - 2026-09-02
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- Added `getInsights()` to `<luzmo-embed-dashboard>` and `<luzmo-embed-viz-item>`.
|
|
14
|
+
|
|
5
15
|
## [7.1.0] - 2026-07-20
|
|
6
16
|
|
|
7
17
|
### Added
|
|
8
18
|
- `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
19
|
|
|
10
|
-
## [7.0.0] - 2026-07-
|
|
20
|
+
## [7.0.0] - 2026-07-20
|
|
11
21
|
|
|
12
22
|
### Removed
|
|
13
23
|
- Removed the `accentColor` property and `accent-color` attribute from `<luzmo-embed-dashboard>`.
|
package/index.cjs
CHANGED
|
@@ -48,24 +48,23 @@ __export(index_exports, {
|
|
|
48
48
|
getCachedJSONSchemas: () => getCachedJSONSchemas,
|
|
49
49
|
getJSONSchemaUrl: () => getJSONSchemaUrl,
|
|
50
50
|
luzmoRefParserOptions: () => luzmoRefParserOptions,
|
|
51
|
-
preloadDashboard: () =>
|
|
52
|
-
preloadIQ: () =>
|
|
53
|
-
preloadVizItem: () =>
|
|
54
|
-
selectedDataUtils: () =>
|
|
51
|
+
preloadDashboard: () => import_shared_embed3.preloadDashboard,
|
|
52
|
+
preloadIQ: () => import_shared_embed3.preloadIQ,
|
|
53
|
+
preloadVizItem: () => import_shared_embed3.preloadVizItem,
|
|
54
|
+
selectedDataUtils: () => import_shared_embed3.selectedDataUtils
|
|
55
55
|
});
|
|
56
56
|
module.exports = __toCommonJS(index_exports);
|
|
57
|
-
var
|
|
57
|
+
var import_shared_embed3 = require("@luzmo/shared-embed");
|
|
58
58
|
var import_lit6 = require("lit");
|
|
59
59
|
|
|
60
60
|
// libs/embed-libs/embed/src/lib/dashboard/dashboard-base.ts
|
|
61
61
|
var SharedLib2 = __toESM(require("@luzmo/shared-embed"));
|
|
62
|
-
var import_shared_embed = require("@luzmo/shared-embed");
|
|
63
62
|
var import_lit2 = require("lit");
|
|
64
63
|
var import_decorators = require("lit/decorators.js");
|
|
65
64
|
var import_style_map = require("lit/directives/style-map.js");
|
|
66
65
|
|
|
67
66
|
// libs/embed-libs/embed/package.json
|
|
68
|
-
var version = "7.1
|
|
67
|
+
var version = "7.2.1";
|
|
69
68
|
|
|
70
69
|
// libs/embed-libs/embed/src/lib/helper/embed-error.utils.ts
|
|
71
70
|
function buildEmbedErrorDetail(errorMsg) {
|
|
@@ -143,6 +142,22 @@ var _setEventHandler = () => {
|
|
|
143
142
|
);
|
|
144
143
|
break;
|
|
145
144
|
}
|
|
145
|
+
case "insights": {
|
|
146
|
+
if (event.data.error) {
|
|
147
|
+
SharedLib.rejectPromise(
|
|
148
|
+
dashboardComponent,
|
|
149
|
+
event.data.requestId,
|
|
150
|
+
new Error(event.data.error.message)
|
|
151
|
+
);
|
|
152
|
+
} else {
|
|
153
|
+
SharedLib.resolvePromise(
|
|
154
|
+
dashboardComponent,
|
|
155
|
+
event.data.requestId,
|
|
156
|
+
event.data.summary
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
146
161
|
case "dashboardContext": {
|
|
147
162
|
SharedLib.resolvePromise(
|
|
148
163
|
dashboardComponent,
|
|
@@ -676,6 +691,16 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
676
691
|
return;
|
|
677
692
|
}
|
|
678
693
|
if (this.isWebComponentViewMode()) {
|
|
694
|
+
if (changedProperties.has("editMode") && !this.dashboardReference) {
|
|
695
|
+
this.iframeLoaded = false;
|
|
696
|
+
if (this._loadTimeoutHandle) {
|
|
697
|
+
clearTimeout(this._loadTimeoutHandle);
|
|
698
|
+
this._loadTimeoutHandle = void 0;
|
|
699
|
+
}
|
|
700
|
+
this.params = this._setOptions();
|
|
701
|
+
this.initComponent();
|
|
702
|
+
return;
|
|
703
|
+
}
|
|
679
704
|
if (this.dashboardReference) {
|
|
680
705
|
for (const [propertyName] of changedProperties.entries()) {
|
|
681
706
|
if (propertyName === "appSever") {
|
|
@@ -695,33 +720,46 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
695
720
|
} else {
|
|
696
721
|
for (const [propertyName] of changedProperties.entries()) {
|
|
697
722
|
if (triggerProperties.has(propertyName) && propertyName !== "editMode") {
|
|
698
|
-
this.
|
|
699
|
-
if (this._loadTimeoutHandle) {
|
|
700
|
-
clearTimeout(this._loadTimeoutHandle);
|
|
701
|
-
}
|
|
702
|
-
this._loadTimeoutHandle = setTimeout(() => {
|
|
703
|
-
console.warn(
|
|
704
|
-
"Failed to load dashboard, appServer is likely down or unreachable."
|
|
705
|
-
);
|
|
706
|
-
}, 15 * 1e3);
|
|
707
|
-
this.params = this._setOptions();
|
|
708
|
-
SharedLib2._extendAndValidate(this);
|
|
709
|
-
this._setupLoader();
|
|
710
|
-
this._loaderStyles();
|
|
711
|
-
this._iframeUrl = SharedLib2.createIframeUrl(this);
|
|
712
|
-
if (this.iframe) {
|
|
713
|
-
this._updateIframeUrl();
|
|
714
|
-
}
|
|
715
|
-
this.iframeStyle = SharedLib2.calculateIframeStyles(this);
|
|
723
|
+
this._reloadIframeContent();
|
|
716
724
|
} else if (triggerProperties.has(propertyName) && propertyName === "editMode") {
|
|
717
725
|
if (this.iframeLoaded) {
|
|
718
726
|
this.setEditMode(this.editMode);
|
|
727
|
+
this.params = this._setOptions();
|
|
728
|
+
} else {
|
|
729
|
+
this._reloadIframeContent();
|
|
719
730
|
}
|
|
720
|
-
this.params = this._setOptions();
|
|
721
731
|
}
|
|
722
732
|
}
|
|
723
733
|
}
|
|
724
734
|
}
|
|
735
|
+
_reloadIframeContent() {
|
|
736
|
+
this.params = this._setOptions();
|
|
737
|
+
SharedLib2._extendAndValidate(this);
|
|
738
|
+
this._setupLoader();
|
|
739
|
+
if (this.params.error) {
|
|
740
|
+
if (this._loadTimeoutHandle) {
|
|
741
|
+
clearTimeout(this._loadTimeoutHandle);
|
|
742
|
+
this._loadTimeoutHandle = void 0;
|
|
743
|
+
}
|
|
744
|
+
this._loaderStyles();
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
747
|
+
this.iframeLoaded = false;
|
|
748
|
+
if (this._loadTimeoutHandle) {
|
|
749
|
+
clearTimeout(this._loadTimeoutHandle);
|
|
750
|
+
}
|
|
751
|
+
this._loadTimeoutHandle = setTimeout(() => {
|
|
752
|
+
console.warn(
|
|
753
|
+
"Failed to load dashboard, appServer is likely down or unreachable."
|
|
754
|
+
);
|
|
755
|
+
}, 15 * 1e3);
|
|
756
|
+
this._loaderStyles();
|
|
757
|
+
this._iframeUrl = SharedLib2.createIframeUrl(this);
|
|
758
|
+
if (this.iframe) {
|
|
759
|
+
this._updateIframeUrl();
|
|
760
|
+
}
|
|
761
|
+
this.iframeStyle = SharedLib2.calculateIframeStyles(this);
|
|
762
|
+
}
|
|
725
763
|
// Set params
|
|
726
764
|
_setOptions() {
|
|
727
765
|
const defaultParameters = {
|
|
@@ -923,7 +961,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
923
961
|
`;
|
|
924
962
|
}
|
|
925
963
|
return import_lit2.html`
|
|
926
|
-
<div class="${
|
|
964
|
+
<div class="${SharedLib2.luzmoEmbedContainerClass} ${this.isWebComponentViewMode() ? "" : `${SharedLib2.luzmoEmbedContainerClass}-ede`}">
|
|
927
965
|
<div
|
|
928
966
|
class="dashboard-container"
|
|
929
967
|
style=${(0, import_style_map.styleMap)(Object.assign({}, this._containerStyle, {
|
|
@@ -961,6 +999,15 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
961
999
|
}
|
|
962
1000
|
return Promise.reject();
|
|
963
1001
|
}
|
|
1002
|
+
getInsights(options) {
|
|
1003
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
1004
|
+
return this.dashboardReference.getInsights(options);
|
|
1005
|
+
}
|
|
1006
|
+
if (!this.isWebComponentViewMode()) {
|
|
1007
|
+
return SharedLib2.getInsights(this, this.iframe, options);
|
|
1008
|
+
}
|
|
1009
|
+
return Promise.reject(new Error("getInsights is not available: dashboard reference is not ready."));
|
|
1010
|
+
}
|
|
964
1011
|
getDashboardContext() {
|
|
965
1012
|
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
966
1013
|
return this.dashboardReference.getDashboardContext();
|
|
@@ -1065,14 +1112,14 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
1065
1112
|
return Promise.reject();
|
|
1066
1113
|
}
|
|
1067
1114
|
isWebComponentViewMode() {
|
|
1068
|
-
return this.embedMode === "webComponent" && (this.
|
|
1115
|
+
return this.embedMode === "webComponent" && (this.editMode === "view" || this.editMode === void 0);
|
|
1069
1116
|
}
|
|
1070
1117
|
};
|
|
1071
1118
|
__decorateClass([
|
|
1072
1119
|
(0, import_decorators.query)(".dashboard-container")
|
|
1073
1120
|
], LuzmoDashboard.prototype, "container", 2);
|
|
1074
1121
|
__decorateClass([
|
|
1075
|
-
(0, import_decorators.query)(`.${
|
|
1122
|
+
(0, import_decorators.query)(`.${SharedLib2.luzmoEmbedContainerClass}`)
|
|
1076
1123
|
], LuzmoDashboard.prototype, "luzmoEmbedContainer", 2);
|
|
1077
1124
|
__decorateClass([
|
|
1078
1125
|
(0, import_decorators.query)("iframe")
|
|
@@ -1305,6 +1352,9 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
|
|
|
1305
1352
|
getData() {
|
|
1306
1353
|
return this.chartElement.getData();
|
|
1307
1354
|
}
|
|
1355
|
+
getInsights(options) {
|
|
1356
|
+
return this.chartElement.getInsights(options);
|
|
1357
|
+
}
|
|
1308
1358
|
refreshData() {
|
|
1309
1359
|
return this.chartElement.refreshData();
|
|
1310
1360
|
}
|
|
@@ -1483,7 +1533,7 @@ if (!customElements.get("luzmo-embed-viz-item")) {
|
|
|
1483
1533
|
}
|
|
1484
1534
|
|
|
1485
1535
|
// libs/embed-libs/embed/src/lib/iq-components/luzmo-iq-chat.ts
|
|
1486
|
-
var
|
|
1536
|
+
var import_shared_embed = require("@luzmo/shared-embed");
|
|
1487
1537
|
var import_lit4 = require("lit");
|
|
1488
1538
|
var import_decorators3 = require("lit/decorators.js");
|
|
1489
1539
|
var inputMap = {
|
|
@@ -1519,7 +1569,7 @@ var LuzmoIQEmbedChatComponent = class extends import_lit4.LitElement {
|
|
|
1519
1569
|
}
|
|
1520
1570
|
async firstUpdated(_changedProperties) {
|
|
1521
1571
|
super.firstUpdated(_changedProperties);
|
|
1522
|
-
await (0,
|
|
1572
|
+
await (0, import_shared_embed.loadLibrary)(this.calculatedAppServer, "IQApp");
|
|
1523
1573
|
this.createAndAppendElement();
|
|
1524
1574
|
}
|
|
1525
1575
|
get calculatedAppServer() {
|
|
@@ -1542,7 +1592,7 @@ var LuzmoIQEmbedChatComponent = class extends import_lit4.LitElement {
|
|
|
1542
1592
|
for (const key in inputMap) {
|
|
1543
1593
|
const value = this[key];
|
|
1544
1594
|
if (value) {
|
|
1545
|
-
const attributeValue = ["appServer", "apiHost", "aydHost"].includes(key) ? (0,
|
|
1595
|
+
const attributeValue = ["appServer", "apiHost", "aydHost"].includes(key) ? (0, import_shared_embed.removeTrailingSlash)(value) : value;
|
|
1546
1596
|
this.chartElement.setAttribute(
|
|
1547
1597
|
inputMap[key],
|
|
1548
1598
|
typeof attributeValue === "object" ? JSON.stringify(attributeValue) : attributeValue
|
|
@@ -1564,7 +1614,7 @@ var LuzmoIQEmbedChatComponent = class extends import_lit4.LitElement {
|
|
|
1564
1614
|
this.chartElement.setAttribute(mappedAttributeName, attributeValue);
|
|
1565
1615
|
}
|
|
1566
1616
|
} else {
|
|
1567
|
-
await (0,
|
|
1617
|
+
await (0, import_shared_embed.loadLibrary)(this.calculatedAppServer, "IQApp");
|
|
1568
1618
|
this.createAndAppendElement();
|
|
1569
1619
|
}
|
|
1570
1620
|
}
|
|
@@ -1651,7 +1701,7 @@ if (!customElements.get(embedChatTag)) {
|
|
|
1651
1701
|
// libs/embed-libs/embed/src/lib/iq-components/luzmo-iq-answer.ts
|
|
1652
1702
|
var import_lit5 = require("lit");
|
|
1653
1703
|
var import_decorators4 = require("lit/decorators.js");
|
|
1654
|
-
var
|
|
1704
|
+
var import_shared_embed2 = require("@luzmo/shared-embed");
|
|
1655
1705
|
var inputMap2 = {
|
|
1656
1706
|
aiEndPoint: "ai-end-point",
|
|
1657
1707
|
appServer: "app-server",
|
|
@@ -1678,7 +1728,7 @@ var LuzmoIQEmbedAnswerComponent = class extends import_lit5.LitElement {
|
|
|
1678
1728
|
}
|
|
1679
1729
|
async firstUpdated(_changedProperties) {
|
|
1680
1730
|
super.firstUpdated(_changedProperties);
|
|
1681
|
-
await (0,
|
|
1731
|
+
await (0, import_shared_embed2.loadLibrary)(this.calculatedAppServer, "IQApp");
|
|
1682
1732
|
this.createAndAppendElement();
|
|
1683
1733
|
}
|
|
1684
1734
|
get calculatedAppServer() {
|
|
@@ -1698,7 +1748,7 @@ var LuzmoIQEmbedAnswerComponent = class extends import_lit5.LitElement {
|
|
|
1698
1748
|
for (const key in inputMap2) {
|
|
1699
1749
|
const value = this[key];
|
|
1700
1750
|
if (value) {
|
|
1701
|
-
const attributeValue = ["appServer", "apiHost"].includes(key) ? (0,
|
|
1751
|
+
const attributeValue = ["appServer", "apiHost"].includes(key) ? (0, import_shared_embed2.removeTrailingSlash)(value) : value;
|
|
1702
1752
|
this.chartElement.setAttribute(
|
|
1703
1753
|
inputMap2[key],
|
|
1704
1754
|
typeof attributeValue === "object" ? JSON.stringify(attributeValue) : attributeValue
|
|
@@ -1715,7 +1765,7 @@ var LuzmoIQEmbedAnswerComponent = class extends import_lit5.LitElement {
|
|
|
1715
1765
|
this.chartElement.setAttribute(mappedAttributeName, attributeValue);
|
|
1716
1766
|
}
|
|
1717
1767
|
} else {
|
|
1718
|
-
await (0,
|
|
1768
|
+
await (0, import_shared_embed2.loadLibrary)(this.calculatedAppServer, "IQApp");
|
|
1719
1769
|
this.createAndAppendElement();
|
|
1720
1770
|
}
|
|
1721
1771
|
}
|
package/index.js
CHANGED
|
@@ -15,15 +15,12 @@ import { LitElement as LitElement5 } from "lit";
|
|
|
15
15
|
|
|
16
16
|
// libs/embed-libs/embed/src/lib/dashboard/dashboard-base.ts
|
|
17
17
|
import * as SharedLib2 from "@luzmo/shared-embed";
|
|
18
|
-
import {
|
|
19
|
-
luzmoEmbedContainerClass
|
|
20
|
-
} from "@luzmo/shared-embed";
|
|
21
18
|
import { html, LitElement } from "lit";
|
|
22
19
|
import { property, query, state } from "lit/decorators.js";
|
|
23
20
|
import { styleMap } from "lit/directives/style-map.js";
|
|
24
21
|
|
|
25
22
|
// libs/embed-libs/embed/package.json
|
|
26
|
-
var version = "7.1
|
|
23
|
+
var version = "7.2.1";
|
|
27
24
|
|
|
28
25
|
// libs/embed-libs/embed/src/lib/helper/embed-error.utils.ts
|
|
29
26
|
function buildEmbedErrorDetail(errorMsg) {
|
|
@@ -101,6 +98,22 @@ var _setEventHandler = () => {
|
|
|
101
98
|
);
|
|
102
99
|
break;
|
|
103
100
|
}
|
|
101
|
+
case "insights": {
|
|
102
|
+
if (event.data.error) {
|
|
103
|
+
SharedLib.rejectPromise(
|
|
104
|
+
dashboardComponent,
|
|
105
|
+
event.data.requestId,
|
|
106
|
+
new Error(event.data.error.message)
|
|
107
|
+
);
|
|
108
|
+
} else {
|
|
109
|
+
SharedLib.resolvePromise(
|
|
110
|
+
dashboardComponent,
|
|
111
|
+
event.data.requestId,
|
|
112
|
+
event.data.summary
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
104
117
|
case "dashboardContext": {
|
|
105
118
|
SharedLib.resolvePromise(
|
|
106
119
|
dashboardComponent,
|
|
@@ -634,6 +647,16 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
634
647
|
return;
|
|
635
648
|
}
|
|
636
649
|
if (this.isWebComponentViewMode()) {
|
|
650
|
+
if (changedProperties.has("editMode") && !this.dashboardReference) {
|
|
651
|
+
this.iframeLoaded = false;
|
|
652
|
+
if (this._loadTimeoutHandle) {
|
|
653
|
+
clearTimeout(this._loadTimeoutHandle);
|
|
654
|
+
this._loadTimeoutHandle = void 0;
|
|
655
|
+
}
|
|
656
|
+
this.params = this._setOptions();
|
|
657
|
+
this.initComponent();
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
637
660
|
if (this.dashboardReference) {
|
|
638
661
|
for (const [propertyName] of changedProperties.entries()) {
|
|
639
662
|
if (propertyName === "appSever") {
|
|
@@ -653,33 +676,46 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
653
676
|
} else {
|
|
654
677
|
for (const [propertyName] of changedProperties.entries()) {
|
|
655
678
|
if (triggerProperties.has(propertyName) && propertyName !== "editMode") {
|
|
656
|
-
this.
|
|
657
|
-
if (this._loadTimeoutHandle) {
|
|
658
|
-
clearTimeout(this._loadTimeoutHandle);
|
|
659
|
-
}
|
|
660
|
-
this._loadTimeoutHandle = setTimeout(() => {
|
|
661
|
-
console.warn(
|
|
662
|
-
"Failed to load dashboard, appServer is likely down or unreachable."
|
|
663
|
-
);
|
|
664
|
-
}, 15 * 1e3);
|
|
665
|
-
this.params = this._setOptions();
|
|
666
|
-
SharedLib2._extendAndValidate(this);
|
|
667
|
-
this._setupLoader();
|
|
668
|
-
this._loaderStyles();
|
|
669
|
-
this._iframeUrl = SharedLib2.createIframeUrl(this);
|
|
670
|
-
if (this.iframe) {
|
|
671
|
-
this._updateIframeUrl();
|
|
672
|
-
}
|
|
673
|
-
this.iframeStyle = SharedLib2.calculateIframeStyles(this);
|
|
679
|
+
this._reloadIframeContent();
|
|
674
680
|
} else if (triggerProperties.has(propertyName) && propertyName === "editMode") {
|
|
675
681
|
if (this.iframeLoaded) {
|
|
676
682
|
this.setEditMode(this.editMode);
|
|
683
|
+
this.params = this._setOptions();
|
|
684
|
+
} else {
|
|
685
|
+
this._reloadIframeContent();
|
|
677
686
|
}
|
|
678
|
-
this.params = this._setOptions();
|
|
679
687
|
}
|
|
680
688
|
}
|
|
681
689
|
}
|
|
682
690
|
}
|
|
691
|
+
_reloadIframeContent() {
|
|
692
|
+
this.params = this._setOptions();
|
|
693
|
+
SharedLib2._extendAndValidate(this);
|
|
694
|
+
this._setupLoader();
|
|
695
|
+
if (this.params.error) {
|
|
696
|
+
if (this._loadTimeoutHandle) {
|
|
697
|
+
clearTimeout(this._loadTimeoutHandle);
|
|
698
|
+
this._loadTimeoutHandle = void 0;
|
|
699
|
+
}
|
|
700
|
+
this._loaderStyles();
|
|
701
|
+
return;
|
|
702
|
+
}
|
|
703
|
+
this.iframeLoaded = false;
|
|
704
|
+
if (this._loadTimeoutHandle) {
|
|
705
|
+
clearTimeout(this._loadTimeoutHandle);
|
|
706
|
+
}
|
|
707
|
+
this._loadTimeoutHandle = setTimeout(() => {
|
|
708
|
+
console.warn(
|
|
709
|
+
"Failed to load dashboard, appServer is likely down or unreachable."
|
|
710
|
+
);
|
|
711
|
+
}, 15 * 1e3);
|
|
712
|
+
this._loaderStyles();
|
|
713
|
+
this._iframeUrl = SharedLib2.createIframeUrl(this);
|
|
714
|
+
if (this.iframe) {
|
|
715
|
+
this._updateIframeUrl();
|
|
716
|
+
}
|
|
717
|
+
this.iframeStyle = SharedLib2.calculateIframeStyles(this);
|
|
718
|
+
}
|
|
683
719
|
// Set params
|
|
684
720
|
_setOptions() {
|
|
685
721
|
const defaultParameters = {
|
|
@@ -881,7 +917,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
881
917
|
`;
|
|
882
918
|
}
|
|
883
919
|
return html`
|
|
884
|
-
<div class="${luzmoEmbedContainerClass} ${this.isWebComponentViewMode() ? "" : `${luzmoEmbedContainerClass}-ede`}">
|
|
920
|
+
<div class="${SharedLib2.luzmoEmbedContainerClass} ${this.isWebComponentViewMode() ? "" : `${SharedLib2.luzmoEmbedContainerClass}-ede`}">
|
|
885
921
|
<div
|
|
886
922
|
class="dashboard-container"
|
|
887
923
|
style=${styleMap(Object.assign({}, this._containerStyle, {
|
|
@@ -919,6 +955,15 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
919
955
|
}
|
|
920
956
|
return Promise.reject();
|
|
921
957
|
}
|
|
958
|
+
getInsights(options) {
|
|
959
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
960
|
+
return this.dashboardReference.getInsights(options);
|
|
961
|
+
}
|
|
962
|
+
if (!this.isWebComponentViewMode()) {
|
|
963
|
+
return SharedLib2.getInsights(this, this.iframe, options);
|
|
964
|
+
}
|
|
965
|
+
return Promise.reject(new Error("getInsights is not available: dashboard reference is not ready."));
|
|
966
|
+
}
|
|
922
967
|
getDashboardContext() {
|
|
923
968
|
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
924
969
|
return this.dashboardReference.getDashboardContext();
|
|
@@ -1023,14 +1068,14 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
1023
1068
|
return Promise.reject();
|
|
1024
1069
|
}
|
|
1025
1070
|
isWebComponentViewMode() {
|
|
1026
|
-
return this.embedMode === "webComponent" && (this.
|
|
1071
|
+
return this.embedMode === "webComponent" && (this.editMode === "view" || this.editMode === void 0);
|
|
1027
1072
|
}
|
|
1028
1073
|
};
|
|
1029
1074
|
__decorateClass([
|
|
1030
1075
|
query(".dashboard-container")
|
|
1031
1076
|
], LuzmoDashboard.prototype, "container", 2);
|
|
1032
1077
|
__decorateClass([
|
|
1033
|
-
query(`.${luzmoEmbedContainerClass}`)
|
|
1078
|
+
query(`.${SharedLib2.luzmoEmbedContainerClass}`)
|
|
1034
1079
|
], LuzmoDashboard.prototype, "luzmoEmbedContainer", 2);
|
|
1035
1080
|
__decorateClass([
|
|
1036
1081
|
query("iframe")
|
|
@@ -1263,6 +1308,9 @@ var LuzmoBaseVizItem = class extends LitElement2 {
|
|
|
1263
1308
|
getData() {
|
|
1264
1309
|
return this.chartElement.getData();
|
|
1265
1310
|
}
|
|
1311
|
+
getInsights(options) {
|
|
1312
|
+
return this.chartElement.getInsights(options);
|
|
1313
|
+
}
|
|
1266
1314
|
refreshData() {
|
|
1267
1315
|
return this.chartElement.refreshData();
|
|
1268
1316
|
}
|
package/luzmo-embed.min.js
CHANGED
|
@@ -397,9 +397,10 @@ var createIframeUrl = (dashboardContent) => {
|
|
|
397
397
|
}
|
|
398
398
|
const keyTokenUrlAnchor = key && token ? "#" + key + ":" + token : "";
|
|
399
399
|
searchString.push("version=" + (dashboardContent.libVersion || VERSION));
|
|
400
|
-
const
|
|
400
|
+
const appServerWithSlash = addTrailingSlash(appServer);
|
|
401
|
+
const iframeUrl = itemEmbedding ? `${appServerWithSlash}i/${dashboardId || dashboardSlug}/${itemId}?${encodeURIComponent(
|
|
401
402
|
searchString.join("&")
|
|
402
|
-
)}${keyTokenUrlAnchor}` : `${
|
|
403
|
+
)}${keyTokenUrlAnchor}` : `${appServerWithSlash}i/${dashboardId || dashboardSlug}?${encodeURIComponent(
|
|
403
404
|
searchString.join("&")
|
|
404
405
|
)}${keyTokenUrlAnchor}`;
|
|
405
406
|
return sanitizeUrl(iframeUrl);
|
|
@@ -821,6 +822,32 @@ var getFilters = (dashboardComponent, iframe) => {
|
|
|
821
822
|
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
822
823
|
};
|
|
823
824
|
|
|
825
|
+
// libs/embed-libs/shared-embed/src/lib/methods/get-insights.ts
|
|
826
|
+
var getInsights = (dashboardComponent, iframe, options = {}) => {
|
|
827
|
+
if (!iframe?.contentWindow) {
|
|
828
|
+
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
829
|
+
}
|
|
830
|
+
const requestId = uuidv4();
|
|
831
|
+
iframe.contentWindow.postMessage(
|
|
832
|
+
{
|
|
833
|
+
action: "getInsights",
|
|
834
|
+
options,
|
|
835
|
+
_version: dashboardComponent.libVersion,
|
|
836
|
+
requestId
|
|
837
|
+
},
|
|
838
|
+
"*"
|
|
839
|
+
);
|
|
840
|
+
return new Promise((resolve, reject) => {
|
|
841
|
+
dashboardComponent.promises[requestId] = { resolve, reject };
|
|
842
|
+
setTimeout(() => {
|
|
843
|
+
if (dashboardComponent.promises[requestId]) {
|
|
844
|
+
dashboardComponent.promises[requestId].reject(new Error("getInsights request timed out."));
|
|
845
|
+
delete dashboardComponent.promises[requestId];
|
|
846
|
+
}
|
|
847
|
+
}, 6e4);
|
|
848
|
+
});
|
|
849
|
+
};
|
|
850
|
+
|
|
824
851
|
// libs/embed-libs/shared-embed/src/lib/methods/refresh-data.ts
|
|
825
852
|
var refreshData = (dashboardComponent, iframe, itemId) => {
|
|
826
853
|
if (iframe) {
|
|
@@ -1335,7 +1362,7 @@ var composeKeyWithSeparator = function(...args) {
|
|
|
1335
1362
|
return `${sum}${SEPARATOR}${cur}`;
|
|
1336
1363
|
}, "");
|
|
1337
1364
|
};
|
|
1338
|
-
|
|
1365
|
+
function getResourceUrl(module2, sourceUrl) {
|
|
1339
1366
|
if ("getPublicPath" in module2) {
|
|
1340
1367
|
let publicPath;
|
|
1341
1368
|
if (!module2.getPublicPath.startsWith("function")) publicPath = new Function(module2.getPublicPath)();
|
|
@@ -1348,7 +1375,7 @@ var getResourceUrl = (module2, sourceUrl) => {
|
|
|
1348
1375
|
console.warn("Cannot get resource URL. If in debug mode, please ignore.", module2, sourceUrl);
|
|
1349
1376
|
return "";
|
|
1350
1377
|
}
|
|
1351
|
-
}
|
|
1378
|
+
}
|
|
1352
1379
|
var warn = (msg) => {
|
|
1353
1380
|
console.warn(`${LOG_CATEGORY}: ${msg}`);
|
|
1354
1381
|
};
|
|
@@ -2099,7 +2126,7 @@ function getGlobalFederationConstructor() {
|
|
|
2099
2126
|
function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
|
|
2100
2127
|
if (isDebug) {
|
|
2101
2128
|
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
|
|
2102
|
-
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.8.
|
|
2129
|
+
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.8.2";
|
|
2103
2130
|
}
|
|
2104
2131
|
}
|
|
2105
2132
|
function getInfoWithoutType(target, key) {
|
|
@@ -2783,18 +2810,46 @@ var errorDescMap = {
|
|
|
2783
2810
|
|
|
2784
2811
|
// node_modules/@module-federation/runtime-core/dist/utils/load.js
|
|
2785
2812
|
var importCallback = ".then(callbacks[0]).catch(callbacks[1])";
|
|
2786
|
-
|
|
2813
|
+
var esmRemoteEntryLoadErrorMessages = [
|
|
2814
|
+
"Failed to fetch dynamically imported module",
|
|
2815
|
+
"Importing a module script failed",
|
|
2816
|
+
"error loading dynamically imported module"
|
|
2817
|
+
];
|
|
2818
|
+
function isEsmRemoteEntryLoadError(err) {
|
|
2819
|
+
if (!(err instanceof TypeError)) return false;
|
|
2820
|
+
return esmRemoteEntryLoadErrorMessages.some((loadErrorMessage) => err.message.includes(loadErrorMessage));
|
|
2821
|
+
}
|
|
2822
|
+
function isEsmRemoteType(type) {
|
|
2823
|
+
return type === "esm" || type === "module";
|
|
2824
|
+
}
|
|
2825
|
+
async function loadEsmEntry({ entry, remoteEntryExports, name, getEntryUrl }) {
|
|
2787
2826
|
return new Promise((resolve, reject) => {
|
|
2827
|
+
const rejectEntry = (loadError) => {
|
|
2828
|
+
if (isEsmRemoteEntryLoadError(loadError)) {
|
|
2829
|
+
const originalMsg = loadError instanceof Error ? loadError.message : String(loadError);
|
|
2830
|
+
try {
|
|
2831
|
+
error2(RUNTIME_008, runtimeDescMap, {
|
|
2832
|
+
remoteName: name,
|
|
2833
|
+
resourceUrl: url
|
|
2834
|
+
}, originalMsg);
|
|
2835
|
+
} catch (runtimeError) {
|
|
2836
|
+
reject(runtimeError);
|
|
2837
|
+
return;
|
|
2838
|
+
}
|
|
2839
|
+
}
|
|
2840
|
+
reject(loadError);
|
|
2841
|
+
};
|
|
2842
|
+
const url = getEntryUrl ? getEntryUrl(entry) : entry;
|
|
2788
2843
|
try {
|
|
2789
|
-
if (!remoteEntryExports) if (typeof FEDERATION_ALLOW_NEW_FUNCTION !== "undefined") new Function("callbacks", `import("${
|
|
2844
|
+
if (!remoteEntryExports) if (typeof FEDERATION_ALLOW_NEW_FUNCTION !== "undefined") new Function("callbacks", `import("${url}")${importCallback}`)([resolve, rejectEntry]);
|
|
2790
2845
|
else import(
|
|
2791
2846
|
/* webpackIgnore: true */
|
|
2792
2847
|
/* @vite-ignore */
|
|
2793
|
-
|
|
2794
|
-
).then(resolve).catch(
|
|
2848
|
+
url
|
|
2849
|
+
).then(resolve).catch(rejectEntry);
|
|
2795
2850
|
else resolve(remoteEntryExports);
|
|
2796
2851
|
} catch (e7) {
|
|
2797
|
-
error2(`Failed to load ESM entry from "${
|
|
2852
|
+
error2(`Failed to load ESM entry from "${url}". ${e7 instanceof Error ? e7.message : String(e7)}`);
|
|
2798
2853
|
}
|
|
2799
2854
|
});
|
|
2800
2855
|
}
|
|
@@ -2850,29 +2905,25 @@ async function loadEntryScript({ name, globalName, entry, remoteInfo, loaderHook
|
|
|
2850
2905
|
}
|
|
2851
2906
|
async function loadEntryDom({ remoteInfo, remoteEntryExports, loaderHook, getEntryUrl, resourceContext }) {
|
|
2852
2907
|
const { entry, entryGlobalName: globalName, name, type } = remoteInfo;
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
getEntryUrl,
|
|
2873
|
-
resourceContext
|
|
2874
|
-
});
|
|
2875
|
-
}
|
|
2908
|
+
if (isEsmRemoteType(type)) return loadEsmEntry({
|
|
2909
|
+
entry,
|
|
2910
|
+
remoteEntryExports,
|
|
2911
|
+
name,
|
|
2912
|
+
getEntryUrl
|
|
2913
|
+
});
|
|
2914
|
+
if (type === "system") return loadSystemJsEntry({
|
|
2915
|
+
entry,
|
|
2916
|
+
remoteEntryExports
|
|
2917
|
+
});
|
|
2918
|
+
return loadEntryScript({
|
|
2919
|
+
entry,
|
|
2920
|
+
globalName,
|
|
2921
|
+
name,
|
|
2922
|
+
remoteInfo,
|
|
2923
|
+
loaderHook,
|
|
2924
|
+
getEntryUrl,
|
|
2925
|
+
resourceContext
|
|
2926
|
+
});
|
|
2876
2927
|
}
|
|
2877
2928
|
async function loadEntryNode({ remoteInfo, loaderHook, resourceContext }) {
|
|
2878
2929
|
const { entry, entryGlobalName: globalName, name, type } = remoteInfo;
|
|
@@ -3190,7 +3241,7 @@ function preloadAssets(remoteInfo, host, assets, useLinkPreload = true, baseCont
|
|
|
3190
3241
|
results.push(waitForRemoteEntryPreload(host, remoteInfo, entryRemoteInfo, createResourceContext(baseContext, "remoteEntry")));
|
|
3191
3242
|
});
|
|
3192
3243
|
if (useLinkPreload) {
|
|
3193
|
-
const
|
|
3244
|
+
const defaultAttrs2 = {
|
|
3194
3245
|
rel: "preload",
|
|
3195
3246
|
as: "style"
|
|
3196
3247
|
};
|
|
@@ -3199,12 +3250,12 @@ function preloadAssets(remoteInfo, host, assets, useLinkPreload = true, baseCont
|
|
|
3199
3250
|
host,
|
|
3200
3251
|
remoteInfo,
|
|
3201
3252
|
url: cssUrl,
|
|
3202
|
-
attrs:
|
|
3253
|
+
attrs: defaultAttrs2,
|
|
3203
3254
|
context: createResourceContext(baseContext, "css")
|
|
3204
3255
|
}));
|
|
3205
3256
|
});
|
|
3206
3257
|
} else {
|
|
3207
|
-
const
|
|
3258
|
+
const defaultAttrs2 = {
|
|
3208
3259
|
rel: "stylesheet",
|
|
3209
3260
|
type: "text/css"
|
|
3210
3261
|
};
|
|
@@ -3213,41 +3264,39 @@ function preloadAssets(remoteInfo, host, assets, useLinkPreload = true, baseCont
|
|
|
3213
3264
|
host,
|
|
3214
3265
|
remoteInfo,
|
|
3215
3266
|
url: cssUrl,
|
|
3216
|
-
attrs:
|
|
3267
|
+
attrs: defaultAttrs2,
|
|
3217
3268
|
needDeleteLink: false,
|
|
3218
3269
|
context: createResourceContext(baseContext, "css")
|
|
3219
3270
|
}));
|
|
3220
3271
|
});
|
|
3221
3272
|
}
|
|
3273
|
+
let preloadJsAsset = waitForScriptPreload;
|
|
3274
|
+
let defaultAttrs = {
|
|
3275
|
+
fetchpriority: "high",
|
|
3276
|
+
type: "text/javascript"
|
|
3277
|
+
};
|
|
3222
3278
|
if (useLinkPreload) {
|
|
3223
|
-
|
|
3279
|
+
preloadJsAsset = waitForLinkPreload;
|
|
3280
|
+
defaultAttrs = {
|
|
3224
3281
|
rel: "preload",
|
|
3225
3282
|
as: "script"
|
|
3226
3283
|
};
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
attrs: defaultAttrs,
|
|
3233
|
-
context: createResourceContext(baseContext, "js")
|
|
3234
|
-
}));
|
|
3235
|
-
});
|
|
3236
|
-
} else {
|
|
3237
|
-
const defaultAttrs = {
|
|
3238
|
-
fetchpriority: "high",
|
|
3239
|
-
type: remoteInfo?.type === "module" ? "module" : "text/javascript"
|
|
3284
|
+
} else if (isEsmRemoteType(remoteInfo.type)) {
|
|
3285
|
+
preloadJsAsset = waitForLinkPreload;
|
|
3286
|
+
defaultAttrs = {
|
|
3287
|
+
rel: "modulepreload",
|
|
3288
|
+
fetchpriority: "high"
|
|
3240
3289
|
};
|
|
3241
|
-
jsAssetsWithoutEntry.forEach((jsUrl) => {
|
|
3242
|
-
results.push(waitForScriptPreload({
|
|
3243
|
-
host,
|
|
3244
|
-
remoteInfo,
|
|
3245
|
-
url: jsUrl,
|
|
3246
|
-
attrs: defaultAttrs,
|
|
3247
|
-
context: createResourceContext(baseContext, "js")
|
|
3248
|
-
}));
|
|
3249
|
-
});
|
|
3250
3290
|
}
|
|
3291
|
+
jsAssetsWithoutEntry.forEach((jsUrl) => {
|
|
3292
|
+
results.push(preloadJsAsset({
|
|
3293
|
+
host,
|
|
3294
|
+
remoteInfo,
|
|
3295
|
+
url: jsUrl,
|
|
3296
|
+
attrs: defaultAttrs,
|
|
3297
|
+
context: createResourceContext(baseContext, "js")
|
|
3298
|
+
}));
|
|
3299
|
+
});
|
|
3251
3300
|
}
|
|
3252
3301
|
return Promise.all(results);
|
|
3253
3302
|
}
|
|
@@ -4990,7 +5039,7 @@ var ModuleFederation = class {
|
|
|
4990
5039
|
beforeInitContainer: new AsyncWaterfallHook("beforeInitContainer"),
|
|
4991
5040
|
initContainer: new AsyncWaterfallHook("initContainer")
|
|
4992
5041
|
});
|
|
4993
|
-
this.version = "2.8.
|
|
5042
|
+
this.version = "2.8.2";
|
|
4994
5043
|
this.moduleCache = /* @__PURE__ */ new Map();
|
|
4995
5044
|
this.loaderHook = new PluginSystem({
|
|
4996
5045
|
getModuleInfo: new SyncHook(),
|
|
@@ -5881,7 +5930,7 @@ var o6 = e6(class extends i5 {
|
|
|
5881
5930
|
});
|
|
5882
5931
|
|
|
5883
5932
|
// libs/embed-libs/embed/package.json
|
|
5884
|
-
var version = "7.1
|
|
5933
|
+
var version = "7.2.1";
|
|
5885
5934
|
|
|
5886
5935
|
// libs/embed-libs/embed/src/lib/helper/embed-error.utils.ts
|
|
5887
5936
|
function buildEmbedErrorDetail(errorMsg) {
|
|
@@ -5956,6 +6005,22 @@ var _setEventHandler = () => {
|
|
|
5956
6005
|
);
|
|
5957
6006
|
break;
|
|
5958
6007
|
}
|
|
6008
|
+
case "insights": {
|
|
6009
|
+
if (event.data.error) {
|
|
6010
|
+
rejectPromise(
|
|
6011
|
+
dashboardComponent,
|
|
6012
|
+
event.data.requestId,
|
|
6013
|
+
new Error(event.data.error.message)
|
|
6014
|
+
);
|
|
6015
|
+
} else {
|
|
6016
|
+
resolvePromise(
|
|
6017
|
+
dashboardComponent,
|
|
6018
|
+
event.data.requestId,
|
|
6019
|
+
event.data.summary
|
|
6020
|
+
);
|
|
6021
|
+
}
|
|
6022
|
+
break;
|
|
6023
|
+
}
|
|
5959
6024
|
case "dashboardContext": {
|
|
5960
6025
|
resolvePromise(
|
|
5961
6026
|
dashboardComponent,
|
|
@@ -6488,6 +6553,16 @@ var LuzmoDashboard = class extends i4 {
|
|
|
6488
6553
|
return;
|
|
6489
6554
|
}
|
|
6490
6555
|
if (this.isWebComponentViewMode()) {
|
|
6556
|
+
if (changedProperties.has("editMode") && !this.dashboardReference) {
|
|
6557
|
+
this.iframeLoaded = false;
|
|
6558
|
+
if (this._loadTimeoutHandle) {
|
|
6559
|
+
clearTimeout(this._loadTimeoutHandle);
|
|
6560
|
+
this._loadTimeoutHandle = void 0;
|
|
6561
|
+
}
|
|
6562
|
+
this.params = this._setOptions();
|
|
6563
|
+
this.initComponent();
|
|
6564
|
+
return;
|
|
6565
|
+
}
|
|
6491
6566
|
if (this.dashboardReference) {
|
|
6492
6567
|
for (const [propertyName] of changedProperties.entries()) {
|
|
6493
6568
|
if (propertyName === "appSever") {
|
|
@@ -6507,33 +6582,46 @@ var LuzmoDashboard = class extends i4 {
|
|
|
6507
6582
|
} else {
|
|
6508
6583
|
for (const [propertyName] of changedProperties.entries()) {
|
|
6509
6584
|
if (triggerProperties.has(propertyName) && propertyName !== "editMode") {
|
|
6510
|
-
this.
|
|
6511
|
-
if (this._loadTimeoutHandle) {
|
|
6512
|
-
clearTimeout(this._loadTimeoutHandle);
|
|
6513
|
-
}
|
|
6514
|
-
this._loadTimeoutHandle = setTimeout(() => {
|
|
6515
|
-
console.warn(
|
|
6516
|
-
"Failed to load dashboard, appServer is likely down or unreachable."
|
|
6517
|
-
);
|
|
6518
|
-
}, 15 * 1e3);
|
|
6519
|
-
this.params = this._setOptions();
|
|
6520
|
-
_extendAndValidate(this);
|
|
6521
|
-
this._setupLoader();
|
|
6522
|
-
this._loaderStyles();
|
|
6523
|
-
this._iframeUrl = createIframeUrl(this);
|
|
6524
|
-
if (this.iframe) {
|
|
6525
|
-
this._updateIframeUrl();
|
|
6526
|
-
}
|
|
6527
|
-
this.iframeStyle = calculateIframeStyles(this);
|
|
6585
|
+
this._reloadIframeContent();
|
|
6528
6586
|
} else if (triggerProperties.has(propertyName) && propertyName === "editMode") {
|
|
6529
6587
|
if (this.iframeLoaded) {
|
|
6530
6588
|
this.setEditMode(this.editMode);
|
|
6589
|
+
this.params = this._setOptions();
|
|
6590
|
+
} else {
|
|
6591
|
+
this._reloadIframeContent();
|
|
6531
6592
|
}
|
|
6532
|
-
this.params = this._setOptions();
|
|
6533
6593
|
}
|
|
6534
6594
|
}
|
|
6535
6595
|
}
|
|
6536
6596
|
}
|
|
6597
|
+
_reloadIframeContent() {
|
|
6598
|
+
this.params = this._setOptions();
|
|
6599
|
+
_extendAndValidate(this);
|
|
6600
|
+
this._setupLoader();
|
|
6601
|
+
if (this.params.error) {
|
|
6602
|
+
if (this._loadTimeoutHandle) {
|
|
6603
|
+
clearTimeout(this._loadTimeoutHandle);
|
|
6604
|
+
this._loadTimeoutHandle = void 0;
|
|
6605
|
+
}
|
|
6606
|
+
this._loaderStyles();
|
|
6607
|
+
return;
|
|
6608
|
+
}
|
|
6609
|
+
this.iframeLoaded = false;
|
|
6610
|
+
if (this._loadTimeoutHandle) {
|
|
6611
|
+
clearTimeout(this._loadTimeoutHandle);
|
|
6612
|
+
}
|
|
6613
|
+
this._loadTimeoutHandle = setTimeout(() => {
|
|
6614
|
+
console.warn(
|
|
6615
|
+
"Failed to load dashboard, appServer is likely down or unreachable."
|
|
6616
|
+
);
|
|
6617
|
+
}, 15 * 1e3);
|
|
6618
|
+
this._loaderStyles();
|
|
6619
|
+
this._iframeUrl = createIframeUrl(this);
|
|
6620
|
+
if (this.iframe) {
|
|
6621
|
+
this._updateIframeUrl();
|
|
6622
|
+
}
|
|
6623
|
+
this.iframeStyle = calculateIframeStyles(this);
|
|
6624
|
+
}
|
|
6537
6625
|
// Set params
|
|
6538
6626
|
_setOptions() {
|
|
6539
6627
|
const defaultParameters = {
|
|
@@ -6773,6 +6861,15 @@ var LuzmoDashboard = class extends i4 {
|
|
|
6773
6861
|
}
|
|
6774
6862
|
return Promise.reject();
|
|
6775
6863
|
}
|
|
6864
|
+
getInsights(options) {
|
|
6865
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
6866
|
+
return this.dashboardReference.getInsights(options);
|
|
6867
|
+
}
|
|
6868
|
+
if (!this.isWebComponentViewMode()) {
|
|
6869
|
+
return getInsights(this, this.iframe, options);
|
|
6870
|
+
}
|
|
6871
|
+
return Promise.reject(new Error("getInsights is not available: dashboard reference is not ready."));
|
|
6872
|
+
}
|
|
6776
6873
|
getDashboardContext() {
|
|
6777
6874
|
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
6778
6875
|
return this.dashboardReference.getDashboardContext();
|
|
@@ -6877,7 +6974,7 @@ var LuzmoDashboard = class extends i4 {
|
|
|
6877
6974
|
return Promise.reject();
|
|
6878
6975
|
}
|
|
6879
6976
|
isWebComponentViewMode() {
|
|
6880
|
-
return this.embedMode === "webComponent" && (this.
|
|
6977
|
+
return this.embedMode === "webComponent" && (this.editMode === "view" || this.editMode === void 0);
|
|
6881
6978
|
}
|
|
6882
6979
|
};
|
|
6883
6980
|
__decorateClass([
|
|
@@ -7047,7 +7144,7 @@ if (!customElements.get("luzmo-embed-dashboard")) {
|
|
|
7047
7144
|
}
|
|
7048
7145
|
|
|
7049
7146
|
// libs/dashboard-contents-types/src/lib/shared/version.ts
|
|
7050
|
-
var CONTENTS_VERSION = "0.1.
|
|
7147
|
+
var CONTENTS_VERSION = "0.1.103";
|
|
7051
7148
|
|
|
7052
7149
|
// libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
|
|
7053
7150
|
var dashboardContentsVersion = CONTENTS_VERSION;
|
|
@@ -7116,6 +7213,9 @@ var LuzmoBaseVizItem = class extends i4 {
|
|
|
7116
7213
|
getData() {
|
|
7117
7214
|
return this.chartElement.getData();
|
|
7118
7215
|
}
|
|
7216
|
+
getInsights(options) {
|
|
7217
|
+
return this.chartElement.getInsights(options);
|
|
7218
|
+
}
|
|
7119
7219
|
refreshData() {
|
|
7120
7220
|
return this.chartElement.refreshData();
|
|
7121
7221
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { FilterGroup } from '@luzmo/dashboard-contents-types';
|
|
2
2
|
import * as SharedLib from '@luzmo/shared-embed';
|
|
3
|
-
import {
|
|
4
|
-
import { LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
3
|
+
import { LitElement, type PropertyValues, type TemplateResult } from 'lit';
|
|
5
4
|
export declare class LuzmoDashboard extends LitElement implements SharedLib.WebComponentLuzmoDashboard {
|
|
6
5
|
container: HTMLElement;
|
|
7
6
|
luzmoEmbedContainer: HTMLElement;
|
|
@@ -26,7 +25,7 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.WebC
|
|
|
26
25
|
timezoneId?: SharedLib.DashboardInputs['timezoneId'];
|
|
27
26
|
apiHost?: SharedLib.DashboardInputs['apiHost'];
|
|
28
27
|
itemDimensions: SharedLib.DashboardInputs['itemDimensions'];
|
|
29
|
-
embedMode: DashboardInputs['embedMode'];
|
|
28
|
+
embedMode: SharedLib.DashboardInputs['embedMode'];
|
|
30
29
|
_containerId: string;
|
|
31
30
|
_iframeId: string;
|
|
32
31
|
params: SharedLib.DashboardContentParams;
|
|
@@ -50,7 +49,7 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.WebC
|
|
|
50
49
|
browserNotSupported: any[];
|
|
51
50
|
libVersion: string;
|
|
52
51
|
protected isLibraryLoaded: boolean;
|
|
53
|
-
protected dashboardReference: LuzmoElement;
|
|
52
|
+
protected dashboardReference: SharedLib.LuzmoElement;
|
|
54
53
|
currentAuthKey: string;
|
|
55
54
|
currentAuthToken: string;
|
|
56
55
|
isInitCalled: boolean;
|
|
@@ -74,8 +73,9 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.WebC
|
|
|
74
73
|
firstUpdated(): void;
|
|
75
74
|
initComponent(): void;
|
|
76
75
|
setAllAttributes(): void;
|
|
77
|
-
setAllAttributesOnElement(el: LuzmoElement): void;
|
|
76
|
+
setAllAttributesOnElement(el: SharedLib.LuzmoElement): void;
|
|
78
77
|
updated(changedProperties: PropertyValues): void;
|
|
78
|
+
_reloadIframeContent(): void;
|
|
79
79
|
_setOptions(): SharedLib.DashboardContentParams;
|
|
80
80
|
_updateIframeUrl(): void;
|
|
81
81
|
_setupLoader(): void;
|
|
@@ -92,8 +92,9 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.WebC
|
|
|
92
92
|
getDashboards(): Promise<LuzmoDashboard[]>;
|
|
93
93
|
getData(itemId: string): Promise<SharedLib.ItemData>;
|
|
94
94
|
getFilters(): Promise<FilterGroup[]>;
|
|
95
|
+
getInsights(options?: SharedLib.GetInsightsOptions): Promise<string>;
|
|
95
96
|
getDashboardContext(): Promise<SharedLib.DashboardContext | undefined>;
|
|
96
|
-
setSelectedData<K extends CombinedSelectedDataInput>(itemId: string, filters: K): Promise<SharedLib.SetSelectedData>;
|
|
97
|
+
setSelectedData<K extends SharedLib.CombinedSelectedDataInput>(itemId: string, filters: K): Promise<SharedLib.SetSelectedData>;
|
|
97
98
|
setAuthorization(key: string, token: string): Promise<void>;
|
|
98
99
|
refreshData(itemId?: string): Promise<void>;
|
|
99
100
|
reloadDashboard(): Promise<void>;
|
|
@@ -102,6 +103,6 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.WebC
|
|
|
102
103
|
addFilters(itemId: string, filters: FilterGroup[]): Promise<SharedLib.AddFilters>;
|
|
103
104
|
setEditMode(editMode?: SharedLib.DashboardEditMode): Promise<SharedLib.SetEditMode>;
|
|
104
105
|
setPreview(preview: boolean): Promise<SharedLib.SetPreview>;
|
|
105
|
-
sendExportEmail(type?: SharedLib.SendExportEmailType, subject?: PartialRecord<SupportedLanguage, string>, message?: PartialRecord<SupportedLanguage, string>): Promise<void>;
|
|
106
|
+
sendExportEmail(type?: SharedLib.SendExportEmailType, subject?: SharedLib.PartialRecord<SharedLib.SupportedLanguage, string>, message?: SharedLib.PartialRecord<SharedLib.SupportedLanguage, string>): Promise<void>;
|
|
106
107
|
isWebComponentViewMode(): boolean;
|
|
107
108
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { IQAnswerOptions, IQMessage } from '@luzmo/dashboard-contents-types';
|
|
2
|
-
import { LitElement
|
|
1
|
+
import type { IQAnswerOptions, IQMessage } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
import type { PropertyValues } from 'lit';
|
|
3
4
|
import type { TemplateResult } from 'lit-html';
|
|
4
5
|
export declare class LuzmoIQEmbedAnswerComponent extends LitElement {
|
|
5
6
|
appServer?: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { FilterGroup, VizItemExportType, VizItemOptions, VizItemSlot, VizItemType } from '@luzmo/dashboard-contents-types';
|
|
2
2
|
import * as SharedLib from '@luzmo/shared-embed';
|
|
3
|
-
import { LitElement
|
|
3
|
+
import { LitElement } from 'lit';
|
|
4
|
+
import type { PropertyValues } from 'lit';
|
|
4
5
|
/**
|
|
5
6
|
* The version of the dashboard contents that is linked to the current library.
|
|
6
7
|
*
|
|
@@ -9,7 +10,7 @@ import { LitElement, PropertyValues } from 'lit';
|
|
|
9
10
|
* together with this dashboard contents version are passed to the dashboard app (https://app.luzmo.com/dashboard-app/remoteEntry.js)
|
|
10
11
|
* and if needed the migration will be applied on the dashboard app level.
|
|
11
12
|
*/
|
|
12
|
-
export declare const dashboardContentsVersion = "0.1.
|
|
13
|
+
export declare const dashboardContentsVersion = "0.1.103";
|
|
13
14
|
type FunctionCall = [(...args: any) => any, any[]];
|
|
14
15
|
interface LuzmoVizItemComponentInterface extends HTMLElement {
|
|
15
16
|
options?: VizItemOptions;
|
|
@@ -30,6 +31,7 @@ interface LuzmoVizItemComponentInterface extends HTMLElement {
|
|
|
30
31
|
export: (type?: VizItemExportType) => Promise<string | void>;
|
|
31
32
|
refreshData: () => void;
|
|
32
33
|
getData: () => SharedLib.ItemData;
|
|
34
|
+
getInsights: (options?: SharedLib.GetInsightsOptions) => Promise<string>;
|
|
33
35
|
setSelectedData: (selectedDataInput: SharedLib.SelectedDataInput) => SharedLib.SetSelectedData;
|
|
34
36
|
setAuthorization: (key: string, token: string) => void;
|
|
35
37
|
}
|
|
@@ -68,6 +70,7 @@ export declare class LuzmoBaseVizItem extends LitElement implements LuzmoVizItem
|
|
|
68
70
|
getVizItemContext(): SharedLib.VizItemContext;
|
|
69
71
|
export(type?: VizItemExportType): Promise<string | void>;
|
|
70
72
|
getData(): SharedLib.ItemData;
|
|
73
|
+
getInsights(options?: SharedLib.GetInsightsOptions): Promise<string>;
|
|
71
74
|
refreshData(): void;
|
|
72
75
|
setSelectedData(selectedDataInput: SharedLib.SelectedDataInput): SharedLib.SetSelectedData;
|
|
73
76
|
setAuthorization(key: string, token: string): void;
|