@luzmo/embed 5.1.4 → 5.1.6
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 +10 -0
- package/MIGRATIONS.md +6 -0
- package/index.cjs +31 -62
- package/index.js +31 -61
- package/lib/dashboard-component/dashboard-base.d.ts +2 -2
- package/lib/dashboard-component/dashboard-component.d.ts +2 -10
- package/luzmo-embed.min.js +31 -61
- package/package.json +1 -1
- package/index.libs.cjs +0 -1104
- package/index.libs.d.ts +0 -1
- package/index.libs.js +0 -1084
- package/lib/dashboard-component/dashboard-web-component.d.ts +0 -3
- package/luzmo-embed.libs.js +0 -3088
- package/src/index.d.ts +0 -2
- package/src/lib/dashboard-component/dashboard-base.d.ts +0 -98
- package/src/lib/dashboard-component/dashboard-component.d.ts +0 -16
- package/src/lib/dashboard-component/dashboard-styles.d.ts +0 -1
- package/src/lib/helper/event-bus-handler.d.ts +0 -1
- package/src/lib/luzmo-service.d.ts +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
|
+
## [5.1.6] - 2024-07-11
|
|
5
|
+
|
|
6
|
+
- Fix for loader color when embedding dashboard as a web component, and other bug fixes
|
|
7
|
+
|
|
8
|
+
## [5.1.5] - 2024-05-03
|
|
9
|
+
|
|
10
|
+
### Bugfixes
|
|
11
|
+
|
|
12
|
+
- Fix bugs in experimental=true, dashboard not loading at times.
|
|
13
|
+
|
|
4
14
|
## [5.1.4] - 2024-05-02
|
|
5
15
|
|
|
6
16
|
### Bugfixes
|
package/MIGRATIONS.md
CHANGED
package/index.cjs
CHANGED
|
@@ -39,7 +39,6 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
39
39
|
// libs/embed-libs/embed/src/index.ts
|
|
40
40
|
var src_exports = {};
|
|
41
41
|
__export(src_exports, {
|
|
42
|
-
LuzmoDashboard: () => LuzmoDashboard2,
|
|
43
42
|
LuzmoEmbedDashboard: () => LuzmoEmbedDashboard
|
|
44
43
|
});
|
|
45
44
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -55,7 +54,7 @@ var import_style_map = require("lit/directives/style-map.js");
|
|
|
55
54
|
var import_shared_embed = require("@luzmo/shared-embed");
|
|
56
55
|
|
|
57
56
|
// libs/embed-libs/embed/package.json
|
|
58
|
-
var version = "5.1.
|
|
57
|
+
var version = "5.1.6";
|
|
59
58
|
|
|
60
59
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
61
60
|
var LuzmoService = class {
|
|
@@ -100,7 +99,7 @@ var _setEventHandler = () => {
|
|
|
100
99
|
}
|
|
101
100
|
dashboardComponent.iframeLoaded = true;
|
|
102
101
|
dashboardComponent._displayError();
|
|
103
|
-
console.error("Dashboard error: ", event.data.errorMsg);
|
|
102
|
+
console.error("Dashboard error: ", event.data.errorMsg ?? event.data.error?.msg);
|
|
104
103
|
break;
|
|
105
104
|
}
|
|
106
105
|
case "data": {
|
|
@@ -341,7 +340,7 @@ var dashboardStyles = import_lit.css`
|
|
|
341
340
|
|
|
342
341
|
// libs/embed-libs/embed/src/lib/dashboard-component/dashboard-base.ts
|
|
343
342
|
var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
344
|
-
constructor(
|
|
343
|
+
constructor() {
|
|
345
344
|
super();
|
|
346
345
|
this.language = "auto";
|
|
347
346
|
this.screenMode = "auto";
|
|
@@ -364,6 +363,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
364
363
|
this.isLibraryLoaded = false;
|
|
365
364
|
this.currentAuthKey = null;
|
|
366
365
|
this.currentAuthToken = null;
|
|
366
|
+
this.isInitCalled = false;
|
|
367
367
|
this.attributesMap = {
|
|
368
368
|
dashboardId: "dashboard-id",
|
|
369
369
|
dashboardSlug: "dashboard-slug",
|
|
@@ -393,7 +393,6 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
393
393
|
this._iframeId = `luzmo-dashboard-${this._containerId}`;
|
|
394
394
|
this.iframeLoaded = false;
|
|
395
395
|
this.promises = {};
|
|
396
|
-
this.setInputParameters(inputParameters);
|
|
397
396
|
this.params = this._setOptions();
|
|
398
397
|
this._onResize = () => {
|
|
399
398
|
if (this.shadowRoot?.querySelector(".dashboard-container")) {
|
|
@@ -440,44 +439,6 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
440
439
|
return wrappedModule;
|
|
441
440
|
});
|
|
442
441
|
}
|
|
443
|
-
setInputParameters(inputParameters) {
|
|
444
|
-
if (!inputParameters) {
|
|
445
|
-
return;
|
|
446
|
-
}
|
|
447
|
-
const params = [
|
|
448
|
-
"dashboardId",
|
|
449
|
-
"dashboardSlug",
|
|
450
|
-
"itemId",
|
|
451
|
-
"language",
|
|
452
|
-
"qeVersion",
|
|
453
|
-
"screenMode",
|
|
454
|
-
"switchScreenModeOnResize",
|
|
455
|
-
"accentColor",
|
|
456
|
-
"mainColor",
|
|
457
|
-
"authToken",
|
|
458
|
-
"authKey",
|
|
459
|
-
"editMode",
|
|
460
|
-
"loaderBackground",
|
|
461
|
-
"loaderFontColor",
|
|
462
|
-
"loaderSpinnerColor",
|
|
463
|
-
"loaderSpinnerBackground",
|
|
464
|
-
"timezoneId",
|
|
465
|
-
"itemDimensions",
|
|
466
|
-
"apiHost"
|
|
467
|
-
];
|
|
468
|
-
for (const key of params) {
|
|
469
|
-
const value = inputParameters[key];
|
|
470
|
-
if (value) {
|
|
471
|
-
this[key] = value;
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
if (inputParameters.experimental) {
|
|
475
|
-
this.experimental = inputParameters.experimental;
|
|
476
|
-
}
|
|
477
|
-
if (inputParameters.appServer) {
|
|
478
|
-
this.appServer = SharedLib2.addTrailingSlash(inputParameters.appServer);
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
442
|
// Set resize event listener
|
|
482
443
|
connectedCallback() {
|
|
483
444
|
super.connectedCallback();
|
|
@@ -496,7 +457,6 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
496
457
|
this._loaderMsg = SharedLib2.getLoader(this)?.loadingMsg;
|
|
497
458
|
this._loaderStyles();
|
|
498
459
|
luzmo_service_default._components.push(this);
|
|
499
|
-
this.initComponent();
|
|
500
460
|
if (this.luzmoEmbedContainer) {
|
|
501
461
|
this._resizeObserver.observe(this.luzmoEmbedContainer);
|
|
502
462
|
}
|
|
@@ -504,6 +464,8 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
504
464
|
initComponent() {
|
|
505
465
|
this.params = this._setOptions();
|
|
506
466
|
if (this.getIsViewMode()) {
|
|
467
|
+
this._setupLoader();
|
|
468
|
+
this._loaderStyles();
|
|
507
469
|
this.loadLibrary(this.params.appServer).then(async () => {
|
|
508
470
|
this.isLibraryLoaded = true;
|
|
509
471
|
await this.updateComplete;
|
|
@@ -544,18 +506,18 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
544
506
|
if (!["authKey", "authToken", "apiHost", "itemDimensions"].includes(key) && this.params[key]) {
|
|
545
507
|
this.dashboardReference.setAttribute(this.attributesMap[key], this.params[key]);
|
|
546
508
|
}
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
509
|
+
}
|
|
510
|
+
if (this.params.itemDimensions) {
|
|
511
|
+
this.dashboardReference.setAttribute("item-dimensions", JSON.stringify(this.params.itemDimensions));
|
|
512
|
+
}
|
|
513
|
+
if (this.params.apiHost) {
|
|
514
|
+
this.dashboardReference.setAttribute("api-host", SharedLib2.removeTrailingSlash(this.params.apiHost));
|
|
515
|
+
}
|
|
516
|
+
if (this.params.key) {
|
|
517
|
+
this.dashboardReference.setAttribute("auth-key", this.params.key);
|
|
518
|
+
}
|
|
519
|
+
if (this.params.token) {
|
|
520
|
+
this.dashboardReference.setAttribute("auth-token", this.params.token);
|
|
559
521
|
}
|
|
560
522
|
}
|
|
561
523
|
}
|
|
@@ -576,6 +538,16 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
|
|
|
576
538
|
"timezoneId",
|
|
577
539
|
"itemDimensions"
|
|
578
540
|
]);
|
|
541
|
+
const conditionsToCheck = ["dashboardId", "dashboardSlug", "itemId"];
|
|
542
|
+
let callInitComponent = false;
|
|
543
|
+
for (const condition of conditionsToCheck) {
|
|
544
|
+
callInitComponent = callInitComponent || changedProperties.get(condition) === void 0 && this[condition] !== void 0;
|
|
545
|
+
}
|
|
546
|
+
if (callInitComponent && !this.isInitCalled) {
|
|
547
|
+
this.initComponent();
|
|
548
|
+
this.isInitCalled = true;
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
579
551
|
if (this.getIsViewMode()) {
|
|
580
552
|
if (this.dashboardReference) {
|
|
581
553
|
for (const [propertyName] of changedProperties.entries()) {
|
|
@@ -1092,13 +1064,11 @@ __decorateClass([
|
|
|
1092
1064
|
__decorateClass([
|
|
1093
1065
|
(0, import_decorators.state)()
|
|
1094
1066
|
], LuzmoDashboard.prototype, "currentAuthToken", 2);
|
|
1067
|
+
__decorateClass([
|
|
1068
|
+
(0, import_decorators.state)()
|
|
1069
|
+
], LuzmoDashboard.prototype, "isInitCalled", 2);
|
|
1095
1070
|
|
|
1096
1071
|
// libs/embed-libs/embed/src/lib/dashboard-component/dashboard-component.ts
|
|
1097
|
-
var LuzmoDashboard2 = class extends LuzmoDashboard {
|
|
1098
|
-
};
|
|
1099
|
-
LuzmoDashboard2 = __decorateClass([
|
|
1100
|
-
(0, import_decorators2.customElement)("luzmo-dashboard")
|
|
1101
|
-
], LuzmoDashboard2);
|
|
1102
1072
|
var LuzmoEmbedDashboard = class extends LuzmoDashboard {
|
|
1103
1073
|
};
|
|
1104
1074
|
LuzmoEmbedDashboard = __decorateClass([
|
|
@@ -1106,6 +1076,5 @@ LuzmoEmbedDashboard = __decorateClass([
|
|
|
1106
1076
|
], LuzmoEmbedDashboard);
|
|
1107
1077
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1108
1078
|
0 && (module.exports = {
|
|
1109
|
-
LuzmoDashboard,
|
|
1110
1079
|
LuzmoEmbedDashboard
|
|
1111
1080
|
});
|
package/index.js
CHANGED
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
} from "@luzmo/shared-embed";
|
|
38
38
|
|
|
39
39
|
// libs/embed-libs/embed/package.json
|
|
40
|
-
var version = "5.1.
|
|
40
|
+
var version = "5.1.6";
|
|
41
41
|
|
|
42
42
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
43
43
|
var LuzmoService = class {
|
|
@@ -82,7 +82,7 @@ var _setEventHandler = () => {
|
|
|
82
82
|
}
|
|
83
83
|
dashboardComponent.iframeLoaded = true;
|
|
84
84
|
dashboardComponent._displayError();
|
|
85
|
-
console.error("Dashboard error: ", event.data.errorMsg);
|
|
85
|
+
console.error("Dashboard error: ", event.data.errorMsg ?? event.data.error?.msg);
|
|
86
86
|
break;
|
|
87
87
|
}
|
|
88
88
|
case "data": {
|
|
@@ -323,7 +323,7 @@ var dashboardStyles = css`
|
|
|
323
323
|
|
|
324
324
|
// libs/embed-libs/embed/src/lib/dashboard-component/dashboard-base.ts
|
|
325
325
|
var LuzmoDashboard = class extends LitElement {
|
|
326
|
-
constructor(
|
|
326
|
+
constructor() {
|
|
327
327
|
super();
|
|
328
328
|
this.language = "auto";
|
|
329
329
|
this.screenMode = "auto";
|
|
@@ -346,6 +346,7 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
346
346
|
this.isLibraryLoaded = false;
|
|
347
347
|
this.currentAuthKey = null;
|
|
348
348
|
this.currentAuthToken = null;
|
|
349
|
+
this.isInitCalled = false;
|
|
349
350
|
this.attributesMap = {
|
|
350
351
|
dashboardId: "dashboard-id",
|
|
351
352
|
dashboardSlug: "dashboard-slug",
|
|
@@ -375,7 +376,6 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
375
376
|
this._iframeId = `luzmo-dashboard-${this._containerId}`;
|
|
376
377
|
this.iframeLoaded = false;
|
|
377
378
|
this.promises = {};
|
|
378
|
-
this.setInputParameters(inputParameters);
|
|
379
379
|
this.params = this._setOptions();
|
|
380
380
|
this._onResize = () => {
|
|
381
381
|
if (this.shadowRoot?.querySelector(".dashboard-container")) {
|
|
@@ -422,44 +422,6 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
422
422
|
return wrappedModule;
|
|
423
423
|
});
|
|
424
424
|
}
|
|
425
|
-
setInputParameters(inputParameters) {
|
|
426
|
-
if (!inputParameters) {
|
|
427
|
-
return;
|
|
428
|
-
}
|
|
429
|
-
const params = [
|
|
430
|
-
"dashboardId",
|
|
431
|
-
"dashboardSlug",
|
|
432
|
-
"itemId",
|
|
433
|
-
"language",
|
|
434
|
-
"qeVersion",
|
|
435
|
-
"screenMode",
|
|
436
|
-
"switchScreenModeOnResize",
|
|
437
|
-
"accentColor",
|
|
438
|
-
"mainColor",
|
|
439
|
-
"authToken",
|
|
440
|
-
"authKey",
|
|
441
|
-
"editMode",
|
|
442
|
-
"loaderBackground",
|
|
443
|
-
"loaderFontColor",
|
|
444
|
-
"loaderSpinnerColor",
|
|
445
|
-
"loaderSpinnerBackground",
|
|
446
|
-
"timezoneId",
|
|
447
|
-
"itemDimensions",
|
|
448
|
-
"apiHost"
|
|
449
|
-
];
|
|
450
|
-
for (const key of params) {
|
|
451
|
-
const value = inputParameters[key];
|
|
452
|
-
if (value) {
|
|
453
|
-
this[key] = value;
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
if (inputParameters.experimental) {
|
|
457
|
-
this.experimental = inputParameters.experimental;
|
|
458
|
-
}
|
|
459
|
-
if (inputParameters.appServer) {
|
|
460
|
-
this.appServer = SharedLib2.addTrailingSlash(inputParameters.appServer);
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
425
|
// Set resize event listener
|
|
464
426
|
connectedCallback() {
|
|
465
427
|
super.connectedCallback();
|
|
@@ -478,7 +440,6 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
478
440
|
this._loaderMsg = SharedLib2.getLoader(this)?.loadingMsg;
|
|
479
441
|
this._loaderStyles();
|
|
480
442
|
luzmo_service_default._components.push(this);
|
|
481
|
-
this.initComponent();
|
|
482
443
|
if (this.luzmoEmbedContainer) {
|
|
483
444
|
this._resizeObserver.observe(this.luzmoEmbedContainer);
|
|
484
445
|
}
|
|
@@ -486,6 +447,8 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
486
447
|
initComponent() {
|
|
487
448
|
this.params = this._setOptions();
|
|
488
449
|
if (this.getIsViewMode()) {
|
|
450
|
+
this._setupLoader();
|
|
451
|
+
this._loaderStyles();
|
|
489
452
|
this.loadLibrary(this.params.appServer).then(async () => {
|
|
490
453
|
this.isLibraryLoaded = true;
|
|
491
454
|
await this.updateComplete;
|
|
@@ -526,18 +489,18 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
526
489
|
if (!["authKey", "authToken", "apiHost", "itemDimensions"].includes(key) && this.params[key]) {
|
|
527
490
|
this.dashboardReference.setAttribute(this.attributesMap[key], this.params[key]);
|
|
528
491
|
}
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
492
|
+
}
|
|
493
|
+
if (this.params.itemDimensions) {
|
|
494
|
+
this.dashboardReference.setAttribute("item-dimensions", JSON.stringify(this.params.itemDimensions));
|
|
495
|
+
}
|
|
496
|
+
if (this.params.apiHost) {
|
|
497
|
+
this.dashboardReference.setAttribute("api-host", SharedLib2.removeTrailingSlash(this.params.apiHost));
|
|
498
|
+
}
|
|
499
|
+
if (this.params.key) {
|
|
500
|
+
this.dashboardReference.setAttribute("auth-key", this.params.key);
|
|
501
|
+
}
|
|
502
|
+
if (this.params.token) {
|
|
503
|
+
this.dashboardReference.setAttribute("auth-token", this.params.token);
|
|
541
504
|
}
|
|
542
505
|
}
|
|
543
506
|
}
|
|
@@ -558,6 +521,16 @@ var LuzmoDashboard = class extends LitElement {
|
|
|
558
521
|
"timezoneId",
|
|
559
522
|
"itemDimensions"
|
|
560
523
|
]);
|
|
524
|
+
const conditionsToCheck = ["dashboardId", "dashboardSlug", "itemId"];
|
|
525
|
+
let callInitComponent = false;
|
|
526
|
+
for (const condition of conditionsToCheck) {
|
|
527
|
+
callInitComponent = callInitComponent || changedProperties.get(condition) === void 0 && this[condition] !== void 0;
|
|
528
|
+
}
|
|
529
|
+
if (callInitComponent && !this.isInitCalled) {
|
|
530
|
+
this.initComponent();
|
|
531
|
+
this.isInitCalled = true;
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
561
534
|
if (this.getIsViewMode()) {
|
|
562
535
|
if (this.dashboardReference) {
|
|
563
536
|
for (const [propertyName] of changedProperties.entries()) {
|
|
@@ -1074,19 +1047,16 @@ __decorateClass([
|
|
|
1074
1047
|
__decorateClass([
|
|
1075
1048
|
state()
|
|
1076
1049
|
], LuzmoDashboard.prototype, "currentAuthToken", 2);
|
|
1050
|
+
__decorateClass([
|
|
1051
|
+
state()
|
|
1052
|
+
], LuzmoDashboard.prototype, "isInitCalled", 2);
|
|
1077
1053
|
|
|
1078
1054
|
// libs/embed-libs/embed/src/lib/dashboard-component/dashboard-component.ts
|
|
1079
|
-
var LuzmoDashboard2 = class extends LuzmoDashboard {
|
|
1080
|
-
};
|
|
1081
|
-
LuzmoDashboard2 = __decorateClass([
|
|
1082
|
-
customElement("luzmo-dashboard")
|
|
1083
|
-
], LuzmoDashboard2);
|
|
1084
1055
|
var LuzmoEmbedDashboard = class extends LuzmoDashboard {
|
|
1085
1056
|
};
|
|
1086
1057
|
LuzmoEmbedDashboard = __decorateClass([
|
|
1087
1058
|
customElement("luzmo-embed-dashboard")
|
|
1088
1059
|
], LuzmoEmbedDashboard);
|
|
1089
1060
|
export {
|
|
1090
|
-
LuzmoDashboard2 as LuzmoDashboard,
|
|
1091
1061
|
LuzmoEmbedDashboard
|
|
1092
1062
|
};
|
|
@@ -56,6 +56,7 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.ES6L
|
|
|
56
56
|
protected dashboardReference: SharedLib.LuzmoElement;
|
|
57
57
|
currentAuthKey: string;
|
|
58
58
|
currentAuthToken: string;
|
|
59
|
+
isInitCalled: boolean;
|
|
59
60
|
private attributesMap;
|
|
60
61
|
_loadTimeoutHandle?: number;
|
|
61
62
|
_onResize: () => void;
|
|
@@ -65,9 +66,8 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.ES6L
|
|
|
65
66
|
iframeHeight?: string;
|
|
66
67
|
iframeWidth?: string;
|
|
67
68
|
_resizeObserver: ResizeObserver;
|
|
68
|
-
constructor(
|
|
69
|
+
constructor();
|
|
69
70
|
private loadLibrary;
|
|
70
|
-
private setInputParameters;
|
|
71
71
|
connectedCallback(): void;
|
|
72
72
|
disconnectedCallback(): void;
|
|
73
73
|
firstUpdated(): void;
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import { LuzmoDashboard
|
|
2
|
-
/**!
|
|
3
|
-
* @element luzmo-dashboard
|
|
4
|
-
* @description Exposed by @luzmo/embed lib to everyone.
|
|
5
|
-
*
|
|
6
|
-
* @deprecated Will be removed in next major release. Switch to <luzmo-embed-dashboard> instead.
|
|
7
|
-
*/
|
|
8
|
-
export declare class LuzmoDashboard extends LuzmoBaseDashboard {
|
|
9
|
-
}
|
|
1
|
+
import { LuzmoDashboard } from './dashboard-base';
|
|
10
2
|
/**!
|
|
11
3
|
* @element luzmo-embed-dashboard
|
|
12
4
|
* @description Exposed by @luzmo/embed lib to everyone.
|
|
13
5
|
*
|
|
14
6
|
*/
|
|
15
|
-
export declare class LuzmoEmbedDashboard extends
|
|
7
|
+
export declare class LuzmoEmbedDashboard extends LuzmoDashboard {
|
|
16
8
|
}
|
package/luzmo-embed.min.js
CHANGED
|
@@ -42,7 +42,6 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
42
42
|
// libs/embed-libs/embed/src/index.ts
|
|
43
43
|
var src_exports2 = {};
|
|
44
44
|
__export(src_exports2, {
|
|
45
|
-
LuzmoDashboard: () => LuzmoDashboard2,
|
|
46
45
|
LuzmoEmbedDashboard: () => LuzmoEmbedDashboard
|
|
47
46
|
});
|
|
48
47
|
module.exports = __toCommonJS(src_exports2);
|
|
@@ -1907,7 +1906,7 @@ var o5 = e6(class extends i4 {
|
|
|
1907
1906
|
});
|
|
1908
1907
|
|
|
1909
1908
|
// libs/embed-libs/embed/package.json
|
|
1910
|
-
var version = "5.1.
|
|
1909
|
+
var version = "5.1.6";
|
|
1911
1910
|
|
|
1912
1911
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
1913
1912
|
var LuzmoService = class {
|
|
@@ -1951,7 +1950,7 @@ var _setEventHandler = () => {
|
|
|
1951
1950
|
}
|
|
1952
1951
|
dashboardComponent.iframeLoaded = true;
|
|
1953
1952
|
dashboardComponent._displayError();
|
|
1954
|
-
console.error("Dashboard error: ", event.data.errorMsg);
|
|
1953
|
+
console.error("Dashboard error: ", event.data.errorMsg ?? event.data.error?.msg);
|
|
1955
1954
|
break;
|
|
1956
1955
|
}
|
|
1957
1956
|
case "data": {
|
|
@@ -2191,7 +2190,7 @@ var dashboardStyles = i`
|
|
|
2191
2190
|
|
|
2192
2191
|
// libs/embed-libs/embed/src/lib/dashboard-component/dashboard-base.ts
|
|
2193
2192
|
var LuzmoDashboard = class extends s3 {
|
|
2194
|
-
constructor(
|
|
2193
|
+
constructor() {
|
|
2195
2194
|
super();
|
|
2196
2195
|
this.language = "auto";
|
|
2197
2196
|
this.screenMode = "auto";
|
|
@@ -2214,6 +2213,7 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2214
2213
|
this.isLibraryLoaded = false;
|
|
2215
2214
|
this.currentAuthKey = null;
|
|
2216
2215
|
this.currentAuthToken = null;
|
|
2216
|
+
this.isInitCalled = false;
|
|
2217
2217
|
this.attributesMap = {
|
|
2218
2218
|
dashboardId: "dashboard-id",
|
|
2219
2219
|
dashboardSlug: "dashboard-slug",
|
|
@@ -2243,7 +2243,6 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2243
2243
|
this._iframeId = `luzmo-dashboard-${this._containerId}`;
|
|
2244
2244
|
this.iframeLoaded = false;
|
|
2245
2245
|
this.promises = {};
|
|
2246
|
-
this.setInputParameters(inputParameters);
|
|
2247
2246
|
this.params = this._setOptions();
|
|
2248
2247
|
this._onResize = () => {
|
|
2249
2248
|
if (this.shadowRoot?.querySelector(".dashboard-container")) {
|
|
@@ -2290,44 +2289,6 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2290
2289
|
return wrappedModule;
|
|
2291
2290
|
});
|
|
2292
2291
|
}
|
|
2293
|
-
setInputParameters(inputParameters) {
|
|
2294
|
-
if (!inputParameters) {
|
|
2295
|
-
return;
|
|
2296
|
-
}
|
|
2297
|
-
const params = [
|
|
2298
|
-
"dashboardId",
|
|
2299
|
-
"dashboardSlug",
|
|
2300
|
-
"itemId",
|
|
2301
|
-
"language",
|
|
2302
|
-
"qeVersion",
|
|
2303
|
-
"screenMode",
|
|
2304
|
-
"switchScreenModeOnResize",
|
|
2305
|
-
"accentColor",
|
|
2306
|
-
"mainColor",
|
|
2307
|
-
"authToken",
|
|
2308
|
-
"authKey",
|
|
2309
|
-
"editMode",
|
|
2310
|
-
"loaderBackground",
|
|
2311
|
-
"loaderFontColor",
|
|
2312
|
-
"loaderSpinnerColor",
|
|
2313
|
-
"loaderSpinnerBackground",
|
|
2314
|
-
"timezoneId",
|
|
2315
|
-
"itemDimensions",
|
|
2316
|
-
"apiHost"
|
|
2317
|
-
];
|
|
2318
|
-
for (const key of params) {
|
|
2319
|
-
const value = inputParameters[key];
|
|
2320
|
-
if (value) {
|
|
2321
|
-
this[key] = value;
|
|
2322
|
-
}
|
|
2323
|
-
}
|
|
2324
|
-
if (inputParameters.experimental) {
|
|
2325
|
-
this.experimental = inputParameters.experimental;
|
|
2326
|
-
}
|
|
2327
|
-
if (inputParameters.appServer) {
|
|
2328
|
-
this.appServer = addTrailingSlash(inputParameters.appServer);
|
|
2329
|
-
}
|
|
2330
|
-
}
|
|
2331
2292
|
// Set resize event listener
|
|
2332
2293
|
connectedCallback() {
|
|
2333
2294
|
super.connectedCallback();
|
|
@@ -2346,7 +2307,6 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2346
2307
|
this._loaderMsg = getLoader(this)?.loadingMsg;
|
|
2347
2308
|
this._loaderStyles();
|
|
2348
2309
|
luzmo_service_default._components.push(this);
|
|
2349
|
-
this.initComponent();
|
|
2350
2310
|
if (this.luzmoEmbedContainer) {
|
|
2351
2311
|
this._resizeObserver.observe(this.luzmoEmbedContainer);
|
|
2352
2312
|
}
|
|
@@ -2354,6 +2314,8 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2354
2314
|
initComponent() {
|
|
2355
2315
|
this.params = this._setOptions();
|
|
2356
2316
|
if (this.getIsViewMode()) {
|
|
2317
|
+
this._setupLoader();
|
|
2318
|
+
this._loaderStyles();
|
|
2357
2319
|
this.loadLibrary(this.params.appServer).then(async () => {
|
|
2358
2320
|
this.isLibraryLoaded = true;
|
|
2359
2321
|
await this.updateComplete;
|
|
@@ -2394,18 +2356,18 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2394
2356
|
if (!["authKey", "authToken", "apiHost", "itemDimensions"].includes(key) && this.params[key]) {
|
|
2395
2357
|
this.dashboardReference.setAttribute(this.attributesMap[key], this.params[key]);
|
|
2396
2358
|
}
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2359
|
+
}
|
|
2360
|
+
if (this.params.itemDimensions) {
|
|
2361
|
+
this.dashboardReference.setAttribute("item-dimensions", JSON.stringify(this.params.itemDimensions));
|
|
2362
|
+
}
|
|
2363
|
+
if (this.params.apiHost) {
|
|
2364
|
+
this.dashboardReference.setAttribute("api-host", removeTrailingSlash(this.params.apiHost));
|
|
2365
|
+
}
|
|
2366
|
+
if (this.params.key) {
|
|
2367
|
+
this.dashboardReference.setAttribute("auth-key", this.params.key);
|
|
2368
|
+
}
|
|
2369
|
+
if (this.params.token) {
|
|
2370
|
+
this.dashboardReference.setAttribute("auth-token", this.params.token);
|
|
2409
2371
|
}
|
|
2410
2372
|
}
|
|
2411
2373
|
}
|
|
@@ -2426,6 +2388,16 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2426
2388
|
"timezoneId",
|
|
2427
2389
|
"itemDimensions"
|
|
2428
2390
|
]);
|
|
2391
|
+
const conditionsToCheck = ["dashboardId", "dashboardSlug", "itemId"];
|
|
2392
|
+
let callInitComponent = false;
|
|
2393
|
+
for (const condition of conditionsToCheck) {
|
|
2394
|
+
callInitComponent = callInitComponent || changedProperties.get(condition) === void 0 && this[condition] !== void 0;
|
|
2395
|
+
}
|
|
2396
|
+
if (callInitComponent && !this.isInitCalled) {
|
|
2397
|
+
this.initComponent();
|
|
2398
|
+
this.isInitCalled = true;
|
|
2399
|
+
return;
|
|
2400
|
+
}
|
|
2429
2401
|
if (this.getIsViewMode()) {
|
|
2430
2402
|
if (this.dashboardReference) {
|
|
2431
2403
|
for (const [propertyName] of changedProperties.entries()) {
|
|
@@ -2942,13 +2914,11 @@ __decorateClass([
|
|
|
2942
2914
|
__decorateClass([
|
|
2943
2915
|
r4()
|
|
2944
2916
|
], LuzmoDashboard.prototype, "currentAuthToken", 2);
|
|
2917
|
+
__decorateClass([
|
|
2918
|
+
r4()
|
|
2919
|
+
], LuzmoDashboard.prototype, "isInitCalled", 2);
|
|
2945
2920
|
|
|
2946
2921
|
// libs/embed-libs/embed/src/lib/dashboard-component/dashboard-component.ts
|
|
2947
|
-
var LuzmoDashboard2 = class extends LuzmoDashboard {
|
|
2948
|
-
};
|
|
2949
|
-
LuzmoDashboard2 = __decorateClass([
|
|
2950
|
-
t("luzmo-dashboard")
|
|
2951
|
-
], LuzmoDashboard2);
|
|
2952
2922
|
var LuzmoEmbedDashboard = class extends LuzmoDashboard {
|
|
2953
2923
|
};
|
|
2954
2924
|
LuzmoEmbedDashboard = __decorateClass([
|