@luzmo/embed 6.13.3 → 6.13.6-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 +18 -0
- package/README.md +54 -14
- package/index.cjs +186 -44
- package/index.js +185 -43
- package/luzmo-embed.min.js +211 -42
- package/package.json +9 -3
- package/src/lib/dashboard/dashboard-base.d.ts +6 -0
- package/src/lib/iq-components/luzmo-iq-chat.d.ts +11 -0
- package/src/lib/viz-item/viz-item.base.d.ts +9 -0
package/luzmo-embed.min.js
CHANGED
|
@@ -754,6 +754,30 @@ var getAccessibleDashboards = async (dashboardComponent) => {
|
|
|
754
754
|
throw new Error("No authKey or authToken found in the luzmo-dashboard component.");
|
|
755
755
|
};
|
|
756
756
|
|
|
757
|
+
// libs/embed-libs/shared-embed/src/lib/methods/get-dashboard-context.ts
|
|
758
|
+
var getDashboardContext = (dashboardComponent, iframe) => {
|
|
759
|
+
if (iframe?.contentWindow) {
|
|
760
|
+
const requestId = uuidv4();
|
|
761
|
+
iframe.contentWindow.postMessage(
|
|
762
|
+
{ action: "getDashboardContext", _version: dashboardComponent.libVersion, requestId },
|
|
763
|
+
"*"
|
|
764
|
+
);
|
|
765
|
+
return new Promise((resolve, reject) => {
|
|
766
|
+
dashboardComponent.promises[requestId] = { resolve, reject };
|
|
767
|
+
setTimeout(() => {
|
|
768
|
+
if (dashboardComponent.promises[requestId]) {
|
|
769
|
+
const errorMessage = "getDashboardContext request timed out.";
|
|
770
|
+
dashboardComponent.promises[requestId].reject(
|
|
771
|
+
new Error(errorMessage)
|
|
772
|
+
);
|
|
773
|
+
delete dashboardComponent.promises[requestId];
|
|
774
|
+
}
|
|
775
|
+
}, 2e3);
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
779
|
+
};
|
|
780
|
+
|
|
757
781
|
// libs/embed-libs/shared-embed/src/lib/methods/get-data.ts
|
|
758
782
|
var getData = (dashboardComponent, iframe, itemId) => {
|
|
759
783
|
if (iframe?.contentWindow) {
|
|
@@ -1255,6 +1279,7 @@ var libraryTypeToWebComponentTypeMapping = {
|
|
|
1255
1279
|
filters: "filters",
|
|
1256
1280
|
dashboardId: "dashboard-id",
|
|
1257
1281
|
itemId: "item-id",
|
|
1282
|
+
aiMessageAssetId: "ai-message-asset-id",
|
|
1258
1283
|
dashboardContentsVersion: "dashboard-contents-version",
|
|
1259
1284
|
libVersion: "lib-version"
|
|
1260
1285
|
};
|
|
@@ -2026,7 +2051,7 @@ function getGlobalFederationConstructor() {
|
|
|
2026
2051
|
function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
|
|
2027
2052
|
if (isDebug) {
|
|
2028
2053
|
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
|
|
2029
|
-
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.5.
|
|
2054
|
+
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.5.1";
|
|
2030
2055
|
}
|
|
2031
2056
|
}
|
|
2032
2057
|
function getInfoWithoutType(target, key) {
|
|
@@ -4841,7 +4866,7 @@ var ModuleFederation = class {
|
|
|
4841
4866
|
beforeInitContainer: new AsyncWaterfallHook("beforeInitContainer"),
|
|
4842
4867
|
initContainer: new AsyncWaterfallHook("initContainer")
|
|
4843
4868
|
});
|
|
4844
|
-
this.version = "2.5.
|
|
4869
|
+
this.version = "2.5.1";
|
|
4845
4870
|
this.moduleCache = /* @__PURE__ */ new Map();
|
|
4846
4871
|
this.loaderHook = new PluginSystem({
|
|
4847
4872
|
getModuleInfo: new SyncHook(),
|
|
@@ -5742,7 +5767,7 @@ var o6 = e6(class extends i5 {
|
|
|
5742
5767
|
});
|
|
5743
5768
|
|
|
5744
5769
|
// libs/embed-libs/embed/package.json
|
|
5745
|
-
var version = "6.13.
|
|
5770
|
+
var version = "6.13.6";
|
|
5746
5771
|
|
|
5747
5772
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
5748
5773
|
var LuzmoDashboardService = class {
|
|
@@ -5805,6 +5830,14 @@ var _setEventHandler = () => {
|
|
|
5805
5830
|
);
|
|
5806
5831
|
break;
|
|
5807
5832
|
}
|
|
5833
|
+
case "dashboardContext": {
|
|
5834
|
+
resolvePromise(
|
|
5835
|
+
dashboardComponent,
|
|
5836
|
+
event.data.requestId,
|
|
5837
|
+
event.data.context
|
|
5838
|
+
);
|
|
5839
|
+
break;
|
|
5840
|
+
}
|
|
5808
5841
|
case "getAccessibleDashboards": {
|
|
5809
5842
|
resolvePromise(
|
|
5810
5843
|
dashboardComponent,
|
|
@@ -5844,6 +5877,12 @@ var _setEventHandler = () => {
|
|
|
5844
5877
|
);
|
|
5845
5878
|
break;
|
|
5846
5879
|
}
|
|
5880
|
+
case "contextChanged": {
|
|
5881
|
+
dashboardComponent.dispatchEvent(
|
|
5882
|
+
new CustomEvent("contextChanged", { detail: { data: event.data } })
|
|
5883
|
+
);
|
|
5884
|
+
break;
|
|
5885
|
+
}
|
|
5847
5886
|
case "customEvent": {
|
|
5848
5887
|
dashboardComponent.dispatchEvent(
|
|
5849
5888
|
new CustomEvent("customEvent", { detail: { data: event.data } })
|
|
@@ -5885,6 +5924,14 @@ var _setEventHandler = () => {
|
|
|
5885
5924
|
_setCalculatedDimensions(dashboardComponent);
|
|
5886
5925
|
break;
|
|
5887
5926
|
}
|
|
5927
|
+
case "trackViewport": {
|
|
5928
|
+
if (event.data.enabled) {
|
|
5929
|
+
dashboardComponent._startViewportTracking();
|
|
5930
|
+
} else {
|
|
5931
|
+
dashboardComponent._stopViewportTracking();
|
|
5932
|
+
}
|
|
5933
|
+
break;
|
|
5934
|
+
}
|
|
5888
5935
|
case "setSelectedData":
|
|
5889
5936
|
case "setFilters": {
|
|
5890
5937
|
if (event.data.error) {
|
|
@@ -5970,6 +6017,24 @@ var dashboardStyles = i`
|
|
|
5970
6017
|
height: 100%;
|
|
5971
6018
|
}
|
|
5972
6019
|
|
|
6020
|
+
/*
|
|
6021
|
+
* Web component mode: the dashboard app renders directly (no iframe). Make its host fill the
|
|
6022
|
+
* sized .dashboard-container so the app's internal height:100% chain resolves to the calculated
|
|
6023
|
+
* dashboard height - exactly like the iframe gets its height. Without this the app collapses to
|
|
6024
|
+
* its intrinsic size and its inner scroll container produces a second scrollbar, and content can
|
|
6025
|
+
* spill outside the container.
|
|
6026
|
+
*/
|
|
6027
|
+
#dashboard-wc-container {
|
|
6028
|
+
width: 100%;
|
|
6029
|
+
height: 100%;
|
|
6030
|
+
}
|
|
6031
|
+
|
|
6032
|
+
#dashboard-wc-container dashboard-component {
|
|
6033
|
+
display: block;
|
|
6034
|
+
width: 100%;
|
|
6035
|
+
height: 100%;
|
|
6036
|
+
}
|
|
6037
|
+
|
|
5973
6038
|
.luzmo-container-loader {
|
|
5974
6039
|
width: 100%;
|
|
5975
6040
|
position: relative;
|
|
@@ -6094,6 +6159,12 @@ var LuzmoDashboard = class extends i4 {
|
|
|
6094
6159
|
this.loaderSize = 32;
|
|
6095
6160
|
this.borderWidth = 3;
|
|
6096
6161
|
this.minHeight = 400;
|
|
6162
|
+
this._viewportTrackingActive = false;
|
|
6163
|
+
// Post synchronously on scroll/resize (not via requestAnimationFrame) so the iframe receives the
|
|
6164
|
+
// new slice as early as possible in the frame, minimizing the lag of the pinned analyst panel.
|
|
6165
|
+
this._onViewportChange = () => {
|
|
6166
|
+
this._postViewport();
|
|
6167
|
+
};
|
|
6097
6168
|
this._containerId = uuidv4();
|
|
6098
6169
|
this._iframeId = `luzmo-dashboard-${this._containerId}`;
|
|
6099
6170
|
this.iframeLoaded = false;
|
|
@@ -6136,12 +6207,48 @@ var LuzmoDashboard = class extends i4 {
|
|
|
6136
6207
|
disconnectedCallback() {
|
|
6137
6208
|
super.disconnectedCallback();
|
|
6138
6209
|
this._resizeObserver.disconnect();
|
|
6210
|
+
this._stopViewportTracking();
|
|
6139
6211
|
for (const promiseKey of Object.keys(this.promises)) {
|
|
6140
6212
|
this.promises[promiseKey].reject(
|
|
6141
6213
|
new Error("Dashboard component was removed")
|
|
6142
6214
|
);
|
|
6143
6215
|
}
|
|
6144
6216
|
}
|
|
6217
|
+
// Relay the iframe's visible slice within the host viewport to the dashboard app, so embedded
|
|
6218
|
+
// overlays (e.g. the IQ analyst) can pin themselves to the visible area while the host page
|
|
6219
|
+
// scrolls the full-height iframe. Opt-in: started when the iframe requests it via 'trackViewport'.
|
|
6220
|
+
_startViewportTracking() {
|
|
6221
|
+
if (this.embedMode !== "iframe") {
|
|
6222
|
+
return;
|
|
6223
|
+
}
|
|
6224
|
+
if (!this._viewportTrackingActive) {
|
|
6225
|
+
this._viewportTrackingActive = true;
|
|
6226
|
+
window.addEventListener("scroll", this._onViewportChange, { passive: true, capture: true });
|
|
6227
|
+
window.addEventListener("resize", this._onViewportChange, { passive: true });
|
|
6228
|
+
}
|
|
6229
|
+
this._postViewport();
|
|
6230
|
+
}
|
|
6231
|
+
_stopViewportTracking() {
|
|
6232
|
+
if (!this._viewportTrackingActive) {
|
|
6233
|
+
return;
|
|
6234
|
+
}
|
|
6235
|
+
this._viewportTrackingActive = false;
|
|
6236
|
+
window.removeEventListener("scroll", this._onViewportChange, { capture: true });
|
|
6237
|
+
window.removeEventListener("resize", this._onViewportChange);
|
|
6238
|
+
}
|
|
6239
|
+
_postViewport() {
|
|
6240
|
+
const contentWindow = this.iframe?.contentWindow;
|
|
6241
|
+
if (!contentWindow) {
|
|
6242
|
+
return;
|
|
6243
|
+
}
|
|
6244
|
+
const rect = this.iframe.getBoundingClientRect();
|
|
6245
|
+
const viewportHeight = window.innerHeight || document.documentElement.clientHeight;
|
|
6246
|
+
const visibleTop = Math.max(rect.top, 0);
|
|
6247
|
+
const visibleBottom = Math.min(rect.bottom, viewportHeight);
|
|
6248
|
+
const visibleHeight = Math.max(visibleBottom - visibleTop, 0);
|
|
6249
|
+
const offsetTop = Math.min(Math.max(-rect.top, 0), rect.height);
|
|
6250
|
+
contentWindow.postMessage({ action: "setViewport", offsetTop, visibleHeight }, "*");
|
|
6251
|
+
}
|
|
6145
6252
|
firstUpdated() {
|
|
6146
6253
|
this._loaderMsg = getLoader(this)?.loadingMsg;
|
|
6147
6254
|
this._loaderStyles();
|
|
@@ -6170,6 +6277,7 @@ var LuzmoDashboard = class extends i4 {
|
|
|
6170
6277
|
el.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
|
|
6171
6278
|
el.addEventListener("dashboardAction", (payload) => this.dispatchEvent(new CustomEvent("dashboardAction", payload)));
|
|
6172
6279
|
el.addEventListener("export", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
|
|
6280
|
+
el.addEventListener("contextChanged", (payload) => this.dispatchEvent(new CustomEvent("contextChanged", payload)));
|
|
6173
6281
|
const container = this.renderRoot.querySelector("#dashboard-wc-container");
|
|
6174
6282
|
if (container) {
|
|
6175
6283
|
container.append(el);
|
|
@@ -6525,6 +6633,15 @@ var LuzmoDashboard = class extends i4 {
|
|
|
6525
6633
|
}
|
|
6526
6634
|
return Promise.reject();
|
|
6527
6635
|
}
|
|
6636
|
+
getDashboardContext() {
|
|
6637
|
+
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
6638
|
+
return this.dashboardReference.getDashboardContext();
|
|
6639
|
+
}
|
|
6640
|
+
if (!this.isWebComponentViewMode()) {
|
|
6641
|
+
return getDashboardContext(this, this.iframe);
|
|
6642
|
+
}
|
|
6643
|
+
return Promise.reject(new Error("getDashboardContext is not available: dashboard reference is not ready."));
|
|
6644
|
+
}
|
|
6528
6645
|
setSelectedData(itemId, filters) {
|
|
6529
6646
|
if (this.isWebComponentViewMode() && this.dashboardReference) {
|
|
6530
6647
|
return this.dashboardReference.setSelectedData(itemId, filters);
|
|
@@ -6801,6 +6918,19 @@ var CONTENTS_VERSION = "0.1.100";
|
|
|
6801
6918
|
// libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
|
|
6802
6919
|
var dashboardContentsVersion = CONTENTS_VERSION;
|
|
6803
6920
|
var vizItemRemote = "VizItemApp";
|
|
6921
|
+
function collectVizItemDatasetIds(slots) {
|
|
6922
|
+
const ids = /* @__PURE__ */ new Set();
|
|
6923
|
+
for (const slot of slots ?? []) {
|
|
6924
|
+
for (const content of slot?.content ?? []) {
|
|
6925
|
+
const column = content;
|
|
6926
|
+
const datasetId = column.datasetId ?? column.set;
|
|
6927
|
+
if (datasetId) {
|
|
6928
|
+
ids.add(datasetId);
|
|
6929
|
+
}
|
|
6930
|
+
}
|
|
6931
|
+
}
|
|
6932
|
+
return [...ids];
|
|
6933
|
+
}
|
|
6804
6934
|
var LuzmoBaseVizItem = class extends i4 {
|
|
6805
6935
|
constructor() {
|
|
6806
6936
|
super(...arguments);
|
|
@@ -6812,22 +6942,6 @@ var LuzmoBaseVizItem = class extends i4 {
|
|
|
6812
6942
|
this.libVersion = version + "-wc-luzmo";
|
|
6813
6943
|
this.postInitCallQueue = [];
|
|
6814
6944
|
}
|
|
6815
|
-
static {
|
|
6816
|
-
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
6817
|
-
this.styles = i`
|
|
6818
|
-
:host {
|
|
6819
|
-
display: block;
|
|
6820
|
-
width: 100%;
|
|
6821
|
-
height: 100%;
|
|
6822
|
-
}
|
|
6823
|
-
|
|
6824
|
-
luzmo-embed-viz-item {
|
|
6825
|
-
width: 100%;
|
|
6826
|
-
height: 1000%;
|
|
6827
|
-
display: block;
|
|
6828
|
-
}
|
|
6829
|
-
`;
|
|
6830
|
-
}
|
|
6831
6945
|
createRenderRoot() {
|
|
6832
6946
|
if (!this.style.display) {
|
|
6833
6947
|
this.style.display = "block";
|
|
@@ -6846,6 +6960,22 @@ var LuzmoBaseVizItem = class extends i4 {
|
|
|
6846
6960
|
getFilters() {
|
|
6847
6961
|
return this.chartElement.getFilters();
|
|
6848
6962
|
}
|
|
6963
|
+
/**
|
|
6964
|
+
* Snapshot of this flex chart's live context: its definition (type, slots,
|
|
6965
|
+
* options), current filters and the datasets it reads. Used by context-aware
|
|
6966
|
+
* embeds such as the Luzmo IQ chat component.
|
|
6967
|
+
*/
|
|
6968
|
+
getVizItemContext() {
|
|
6969
|
+
const slots = this.slots ?? [];
|
|
6970
|
+
return {
|
|
6971
|
+
id: this.contextId ?? this.getAttribute("context-id") ?? this.id ?? this.itemId ?? "",
|
|
6972
|
+
type: this.type,
|
|
6973
|
+
slots,
|
|
6974
|
+
options: this.options,
|
|
6975
|
+
filters: typeof this.chartElement?.getFilters === "function" ? this.getFilters() : this.filters ?? [],
|
|
6976
|
+
datasetIds: collectVizItemDatasetIds(slots)
|
|
6977
|
+
};
|
|
6978
|
+
}
|
|
6849
6979
|
export(type = "png") {
|
|
6850
6980
|
return this.chartElement.export(type);
|
|
6851
6981
|
}
|
|
@@ -6898,7 +7028,12 @@ var LuzmoBaseVizItem = class extends i4 {
|
|
|
6898
7028
|
}
|
|
6899
7029
|
this.dispatchEvent(new CustomEvent("rendered", payload));
|
|
6900
7030
|
});
|
|
6901
|
-
this.chartElement.addEventListener("changedFilters", (payload) =>
|
|
7031
|
+
this.chartElement.addEventListener("changedFilters", (payload) => {
|
|
7032
|
+
this.dispatchEvent(new CustomEvent("changedFilters", payload));
|
|
7033
|
+
this.dispatchEvent(new CustomEvent("contextChanged", {
|
|
7034
|
+
detail: { data: { type: "contextChanged", context: this.getVizItemContext() } }
|
|
7035
|
+
}));
|
|
7036
|
+
});
|
|
6902
7037
|
this.chartElement.addEventListener("exported", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
|
|
6903
7038
|
this.chartElement.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
|
|
6904
7039
|
this.chartElement.addEventListener("authorizationExpired", (payload) => this.dispatchEvent(new CustomEvent("authorizationExpired", payload)));
|
|
@@ -6938,6 +7073,20 @@ var LuzmoBaseVizItem = class extends i4 {
|
|
|
6938
7073
|
return b2` `;
|
|
6939
7074
|
}
|
|
6940
7075
|
};
|
|
7076
|
+
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
7077
|
+
LuzmoBaseVizItem.styles = i`
|
|
7078
|
+
:host {
|
|
7079
|
+
display: block;
|
|
7080
|
+
width: 100%;
|
|
7081
|
+
height: 100%;
|
|
7082
|
+
}
|
|
7083
|
+
|
|
7084
|
+
luzmo-embed-viz-item {
|
|
7085
|
+
width: 100%;
|
|
7086
|
+
height: 1000%;
|
|
7087
|
+
display: block;
|
|
7088
|
+
}
|
|
7089
|
+
`;
|
|
6941
7090
|
__decorateClass([
|
|
6942
7091
|
n4()
|
|
6943
7092
|
], LuzmoBaseVizItem.prototype, "appServer", 2);
|
|
@@ -6985,6 +7134,9 @@ __decorateClass([
|
|
|
6985
7134
|
__decorateClass([
|
|
6986
7135
|
n4()
|
|
6987
7136
|
], LuzmoBaseVizItem.prototype, "itemId", 2);
|
|
7137
|
+
__decorateClass([
|
|
7138
|
+
n4({ attribute: "ai-message-asset-id" })
|
|
7139
|
+
], LuzmoBaseVizItem.prototype, "aiMessageAssetId", 2);
|
|
6988
7140
|
__decorateClass([
|
|
6989
7141
|
n4({ type: Object })
|
|
6990
7142
|
], LuzmoBaseVizItem.prototype, "selectedData", 2);
|
|
@@ -7014,7 +7166,10 @@ var inputMap = {
|
|
|
7014
7166
|
version: "version",
|
|
7015
7167
|
libVersion: "lib-version",
|
|
7016
7168
|
aydHost: "ayd-host",
|
|
7017
|
-
availableDatasets: "available-datasets"
|
|
7169
|
+
availableDatasets: "available-datasets",
|
|
7170
|
+
dashboardContext: "dashboard-context",
|
|
7171
|
+
dashboardId: "dashboard-id",
|
|
7172
|
+
contextIds: "context-ids"
|
|
7018
7173
|
};
|
|
7019
7174
|
var embedChatTag = "luzmo-iq-embed-chat";
|
|
7020
7175
|
var chatComponentTag = "luzmo-iq-chat-component";
|
|
@@ -7028,16 +7183,6 @@ var LuzmoIQEmbedChatComponent = class extends i4 {
|
|
|
7028
7183
|
this.remoteEntryServer = "http://localhost:4202/";
|
|
7029
7184
|
this.aydHost = "https://ayd.luzmo.com/";
|
|
7030
7185
|
}
|
|
7031
|
-
static {
|
|
7032
|
-
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
7033
|
-
this.styles = i`
|
|
7034
|
-
:host {
|
|
7035
|
-
display: block;
|
|
7036
|
-
width: 100%;
|
|
7037
|
-
height: 100%;
|
|
7038
|
-
}
|
|
7039
|
-
`;
|
|
7040
|
-
}
|
|
7041
7186
|
createRenderRoot() {
|
|
7042
7187
|
return this;
|
|
7043
7188
|
}
|
|
@@ -7053,6 +7198,10 @@ var LuzmoIQEmbedChatComponent = class extends i4 {
|
|
|
7053
7198
|
if (!this.chartElement) {
|
|
7054
7199
|
this.chartElement = document.createElement(chatComponentTag);
|
|
7055
7200
|
this.chartElement.addEventListener("load", (payload) => this.dispatchEvent(new CustomEvent("load", payload)));
|
|
7201
|
+
this.chartElement.addEventListener(
|
|
7202
|
+
"connectionStatusChanged",
|
|
7203
|
+
(event) => this.dispatchEvent(new CustomEvent("connectionStatusChanged", { detail: event.detail }))
|
|
7204
|
+
);
|
|
7056
7205
|
this.updateVizItemProperties();
|
|
7057
7206
|
this.renderRoot.append(this.chartElement);
|
|
7058
7207
|
}
|
|
@@ -7075,7 +7224,12 @@ var LuzmoIQEmbedChatComponent = class extends i4 {
|
|
|
7075
7224
|
if (this.chartElement) {
|
|
7076
7225
|
for (const [propertyName] of changedProperties.entries()) {
|
|
7077
7226
|
const mappedAttributeName = inputMap[propertyName] ?? propertyName;
|
|
7078
|
-
const
|
|
7227
|
+
const propertyValue = this[propertyName];
|
|
7228
|
+
if (propertyValue == null) {
|
|
7229
|
+
this.chartElement.removeAttribute(mappedAttributeName);
|
|
7230
|
+
continue;
|
|
7231
|
+
}
|
|
7232
|
+
const attributeValue = typeof propertyValue === "object" ? JSON.stringify(propertyValue) : propertyValue.toString();
|
|
7079
7233
|
this.chartElement.setAttribute(mappedAttributeName, attributeValue);
|
|
7080
7234
|
}
|
|
7081
7235
|
} else {
|
|
@@ -7106,6 +7260,14 @@ var LuzmoIQEmbedChatComponent = class extends i4 {
|
|
|
7106
7260
|
observer.observe(embedChat, { childList: true, subtree: true });
|
|
7107
7261
|
}
|
|
7108
7262
|
};
|
|
7263
|
+
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
7264
|
+
LuzmoIQEmbedChatComponent.styles = i`
|
|
7265
|
+
:host {
|
|
7266
|
+
display: block;
|
|
7267
|
+
width: 100%;
|
|
7268
|
+
height: 100%;
|
|
7269
|
+
}
|
|
7270
|
+
`;
|
|
7109
7271
|
__decorateClass([
|
|
7110
7272
|
n4()
|
|
7111
7273
|
], LuzmoIQEmbedChatComponent.prototype, "appServer", 2);
|
|
@@ -7142,6 +7304,15 @@ __decorateClass([
|
|
|
7142
7304
|
__decorateClass([
|
|
7143
7305
|
n4({ type: Array })
|
|
7144
7306
|
], LuzmoIQEmbedChatComponent.prototype, "availableDatasets", 2);
|
|
7307
|
+
__decorateClass([
|
|
7308
|
+
n4({ type: Object })
|
|
7309
|
+
], LuzmoIQEmbedChatComponent.prototype, "dashboardContext", 2);
|
|
7310
|
+
__decorateClass([
|
|
7311
|
+
n4()
|
|
7312
|
+
], LuzmoIQEmbedChatComponent.prototype, "dashboardId", 2);
|
|
7313
|
+
__decorateClass([
|
|
7314
|
+
n4({ type: Array })
|
|
7315
|
+
], LuzmoIQEmbedChatComponent.prototype, "contextIds", 2);
|
|
7145
7316
|
if (!customElements.get(embedChatTag)) {
|
|
7146
7317
|
customElements.define(embedChatTag, LuzmoIQEmbedChatComponent);
|
|
7147
7318
|
}
|
|
@@ -7168,16 +7339,6 @@ var LuzmoIQEmbedAnswerComponent = class extends i4 {
|
|
|
7168
7339
|
this.libVersion = version + "-wc-luzmo";
|
|
7169
7340
|
this.remoteEntryServer = "http://localhost:4202";
|
|
7170
7341
|
}
|
|
7171
|
-
static {
|
|
7172
|
-
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
7173
|
-
this.styles = i`
|
|
7174
|
-
:host {
|
|
7175
|
-
display: block;
|
|
7176
|
-
width: 100%;
|
|
7177
|
-
height: 100%;
|
|
7178
|
-
}
|
|
7179
|
-
`;
|
|
7180
|
-
}
|
|
7181
7342
|
createRenderRoot() {
|
|
7182
7343
|
return this;
|
|
7183
7344
|
}
|
|
@@ -7228,6 +7389,14 @@ var LuzmoIQEmbedAnswerComponent = class extends i4 {
|
|
|
7228
7389
|
return b2` `;
|
|
7229
7390
|
}
|
|
7230
7391
|
};
|
|
7392
|
+
// Static styles to set host display to block, else it is not shown at all for some reason.
|
|
7393
|
+
LuzmoIQEmbedAnswerComponent.styles = i`
|
|
7394
|
+
:host {
|
|
7395
|
+
display: block;
|
|
7396
|
+
width: 100%;
|
|
7397
|
+
height: 100%;
|
|
7398
|
+
}
|
|
7399
|
+
`;
|
|
7231
7400
|
__decorateClass([
|
|
7232
7401
|
n4()
|
|
7233
7402
|
], LuzmoIQEmbedAnswerComponent.prototype, "appServer", 2);
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luzmo/embed",
|
|
3
|
-
"version": "6.13.
|
|
3
|
+
"version": "6.13.6-es2021",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"lit": "^3.3.1",
|
|
6
|
-
"@luzmo/shared-embed": "5.12.
|
|
6
|
+
"@luzmo/shared-embed": "5.12.3"
|
|
7
7
|
},
|
|
8
8
|
"keywords": [
|
|
9
|
+
"es2021",
|
|
10
|
+
"safari-compatible",
|
|
9
11
|
"es6",
|
|
10
12
|
"web-component",
|
|
11
13
|
"lit",
|
|
@@ -21,5 +23,9 @@
|
|
|
21
23
|
],
|
|
22
24
|
"module": "./index.js",
|
|
23
25
|
"types": "./src/index.d.ts",
|
|
24
|
-
"license": "SEE LICENSE IN LICENSE"
|
|
26
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
27
|
+
"description": "ES2021 build for Safari < 16.3 compatibility",
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"tag": "es2021"
|
|
30
|
+
}
|
|
25
31
|
}
|
|
@@ -65,9 +65,14 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.WebC
|
|
|
65
65
|
iframeHeight?: string;
|
|
66
66
|
iframeWidth?: string;
|
|
67
67
|
_resizeObserver: ResizeObserver;
|
|
68
|
+
private _viewportTrackingActive;
|
|
69
|
+
private _onViewportChange;
|
|
68
70
|
constructor();
|
|
69
71
|
connectedCallback(): void;
|
|
70
72
|
disconnectedCallback(): void;
|
|
73
|
+
_startViewportTracking(): void;
|
|
74
|
+
_stopViewportTracking(): void;
|
|
75
|
+
private _postViewport;
|
|
71
76
|
firstUpdated(): void;
|
|
72
77
|
initComponent(): void;
|
|
73
78
|
setAllAttributes(): void;
|
|
@@ -84,6 +89,7 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.WebC
|
|
|
84
89
|
getDashboards(): Promise<LuzmoDashboard[]>;
|
|
85
90
|
getData(itemId: string): Promise<SharedLib.ItemData>;
|
|
86
91
|
getFilters(): Promise<FilterGroup[]>;
|
|
92
|
+
getDashboardContext(): Promise<SharedLib.DashboardContext | undefined>;
|
|
87
93
|
setSelectedData<K extends CombinedSelectedDataInput>(itemId: string, filters: K): Promise<SharedLib.SetSelectedData>;
|
|
88
94
|
setAuthorization(key: string, token: string): Promise<void>;
|
|
89
95
|
refreshData(itemId?: string): Promise<void>;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import type { IQChatOptions } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import { type DashboardContext } from '@luzmo/shared-embed';
|
|
2
3
|
import { LitElement, PropertyValues } from 'lit';
|
|
3
4
|
import type { TemplateResult } from 'lit-html';
|
|
5
|
+
/**
|
|
6
|
+
* Dashboard context accepted by the embedded IQ chat. Alias of the shared embed
|
|
7
|
+
* {@link DashboardContext} so the published contract stays in lockstep with
|
|
8
|
+
* `getDashboardContext()` and the `contextChanged` event (including the typed
|
|
9
|
+
* `runtimeFilters`).
|
|
10
|
+
*/
|
|
11
|
+
export type SerializedDashboardContext = DashboardContext;
|
|
4
12
|
export declare class LuzmoIQEmbedChatComponent extends LitElement {
|
|
5
13
|
appServer?: string;
|
|
6
14
|
apiHost?: string;
|
|
@@ -14,6 +22,9 @@ export declare class LuzmoIQEmbedChatComponent extends LitElement {
|
|
|
14
22
|
remoteEntryServer: string;
|
|
15
23
|
aydHost: string;
|
|
16
24
|
availableDatasets?: string[];
|
|
25
|
+
dashboardContext?: SerializedDashboardContext;
|
|
26
|
+
dashboardId?: string;
|
|
27
|
+
contextIds?: string[];
|
|
17
28
|
chartElement: HTMLElement;
|
|
18
29
|
static styles: import("lit").CSSResult;
|
|
19
30
|
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
@@ -24,7 +24,9 @@ interface LuzmoVizItemComponentInterface extends HTMLElement {
|
|
|
24
24
|
authToken?: string;
|
|
25
25
|
dashboardId?: string;
|
|
26
26
|
itemId?: string;
|
|
27
|
+
aiMessageAssetId?: string;
|
|
27
28
|
getFilters: () => FilterGroup[];
|
|
29
|
+
getVizItemContext?: () => SharedLib.VizItemContext;
|
|
28
30
|
export: (type?: VizItemExportType) => Promise<string | void>;
|
|
29
31
|
refreshData: () => void;
|
|
30
32
|
getData: () => SharedLib.ItemData;
|
|
@@ -46,6 +48,7 @@ export declare class LuzmoBaseVizItem extends LitElement implements LuzmoVizItem
|
|
|
46
48
|
filters?: FilterGroup[];
|
|
47
49
|
dashboardId?: string;
|
|
48
50
|
itemId?: string;
|
|
51
|
+
aiMessageAssetId?: string;
|
|
49
52
|
selectedData: SharedLib.SelectedDataInput;
|
|
50
53
|
dashboardContentsVersion?: string;
|
|
51
54
|
libVersion?: string;
|
|
@@ -57,6 +60,12 @@ export declare class LuzmoBaseVizItem extends LitElement implements LuzmoVizItem
|
|
|
57
60
|
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
58
61
|
canInitializeVizItem(): boolean;
|
|
59
62
|
getFilters(): FilterGroup[];
|
|
63
|
+
/**
|
|
64
|
+
* Snapshot of this flex chart's live context: its definition (type, slots,
|
|
65
|
+
* options), current filters and the datasets it reads. Used by context-aware
|
|
66
|
+
* embeds such as the Luzmo IQ chat component.
|
|
67
|
+
*/
|
|
68
|
+
getVizItemContext(): SharedLib.VizItemContext;
|
|
60
69
|
export(type?: VizItemExportType): Promise<string | void>;
|
|
61
70
|
getData(): SharedLib.ItemData;
|
|
62
71
|
refreshData(): void;
|