@luzmo/embed 5.1.3-beta.0 → 5.1.3-beta.2

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/index.cjs CHANGED
@@ -56,7 +56,7 @@ var import_style_map = require("lit/directives/style-map.js");
56
56
  var import_shared_embed = require("@luzmo/shared-embed");
57
57
 
58
58
  // libs/embed-libs/embed/package.json
59
- var version = "5.1.3-beta.0";
59
+ var version = "5.1.3-beta.2";
60
60
 
61
61
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
62
62
  var LuzmoService = class {
@@ -357,7 +357,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
357
357
  this.browserErrorMsg = "";
358
358
  this.dashboardError = false;
359
359
  this.browserNotSupported = [];
360
- this.version = version + "-wc-luzmo";
360
+ this.libVersion = version + "-wc-luzmo";
361
361
  this.isLibraryLoaded = false;
362
362
  this.currentAuthKey = null;
363
363
  this.currentAuthToken = null;
@@ -1031,7 +1031,7 @@ __decorateClass([
1031
1031
  ], LuzmoDashboard.prototype, "browserNotSupported", 2);
1032
1032
  __decorateClass([
1033
1033
  (0, import_decorators.property)()
1034
- ], LuzmoDashboard.prototype, "version", 2);
1034
+ ], LuzmoDashboard.prototype, "libVersion", 2);
1035
1035
  __decorateClass([
1036
1036
  (0, import_decorators.state)()
1037
1037
  ], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
@@ -1067,6 +1067,7 @@ var import_decorators4 = require("lit/decorators.js");
1067
1067
  var import_decorators3 = require("lit/decorators.js");
1068
1068
  var import_lit3 = require("lit");
1069
1069
  var SharedLib3 = __toESM(require("@luzmo/shared-embed"), 1);
1070
+ var import_zod_validation_error = require("zod-validation-error");
1070
1071
  var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1071
1072
  constructor() {
1072
1073
  super();
@@ -1111,6 +1112,7 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1111
1112
  for (const key in SharedLib3.libraryTypeToWebComponentTypeMapping) {
1112
1113
  const value = this[key];
1113
1114
  if (value) {
1115
+ this.parseAndValidate(key);
1114
1116
  const attributeValue = ["appServer", "apiHost"].includes(key) ? SharedLib3.removeTrailingSlash(value) : value;
1115
1117
  this.chartElement.setAttribute(
1116
1118
  SharedLib3.libraryTypeToWebComponentTypeMapping[key],
@@ -1124,16 +1126,33 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1124
1126
  if (this.chartElement) {
1125
1127
  for (const [propertyName] of changedProperties.entries()) {
1126
1128
  const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
1129
+ this.parseAndValidate(propertyName);
1127
1130
  const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
1128
1131
  this.chartElement.setAttribute(mappedAttributeName, attributeValue);
1129
1132
  }
1130
1133
  } else {
1131
1134
  if (this.type) {
1135
+ SharedLib3.itemTypeParser.parse(this.type);
1132
1136
  await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1133
1137
  this.createAndAppendElement();
1134
1138
  }
1135
1139
  }
1136
1140
  }
1141
+ parseAndValidate(key) {
1142
+ try {
1143
+ if (key === "slots") {
1144
+ SharedLib3.slotsParser.parse(this.slots);
1145
+ } else if (key === "options") {
1146
+ SharedLib3.vizItemOptionsParser.parse(this.options);
1147
+ } else if (key === "canFilter") {
1148
+ SharedLib3.canFilterParser.parse(this.canFilter);
1149
+ }
1150
+ } catch (err) {
1151
+ const validationError = (0, import_zod_validation_error.fromError)(err);
1152
+ console.error(err);
1153
+ console.error(validationError.toString());
1154
+ }
1155
+ }
1137
1156
  render() {
1138
1157
  return import_lit3.html` `;
1139
1158
  }
package/index.js CHANGED
@@ -34,7 +34,7 @@ import {
34
34
  } from "@luzmo/shared-embed";
35
35
 
36
36
  // libs/embed-libs/embed/package.json
37
- var version = "5.1.3-beta.0";
37
+ var version = "5.1.3-beta.2";
38
38
 
39
39
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
40
40
  var LuzmoService = class {
@@ -335,7 +335,7 @@ var LuzmoDashboard = class extends LitElement {
335
335
  this.browserErrorMsg = "";
336
336
  this.dashboardError = false;
337
337
  this.browserNotSupported = [];
338
- this.version = version + "-wc-luzmo";
338
+ this.libVersion = version + "-wc-luzmo";
339
339
  this.isLibraryLoaded = false;
340
340
  this.currentAuthKey = null;
341
341
  this.currentAuthToken = null;
@@ -1009,7 +1009,7 @@ __decorateClass([
1009
1009
  ], LuzmoDashboard.prototype, "browserNotSupported", 2);
1010
1010
  __decorateClass([
1011
1011
  property()
1012
- ], LuzmoDashboard.prototype, "version", 2);
1012
+ ], LuzmoDashboard.prototype, "libVersion", 2);
1013
1013
  __decorateClass([
1014
1014
  state()
1015
1015
  ], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
@@ -1039,12 +1039,13 @@ LuzmoEmbedDashboard = __decorateClass([
1039
1039
  ], LuzmoEmbedDashboard);
1040
1040
 
1041
1041
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-component.ts
1042
- import { customElement as customElement3 } from "lit/decorators.js";
1042
+ import { customElement as customElement2 } from "lit/decorators.js";
1043
1043
 
1044
1044
  // libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
1045
1045
  import { property as property2 } from "lit/decorators.js";
1046
1046
  import { LitElement as LitElement2, html as html2, css as css2 } from "lit";
1047
1047
  import * as SharedLib3 from "@luzmo/shared-embed";
1048
+ import { fromError } from "zod-validation-error";
1048
1049
  var LuzmoBaseVizItem = class extends LitElement2 {
1049
1050
  constructor() {
1050
1051
  super();
@@ -1089,6 +1090,7 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1089
1090
  for (const key in SharedLib3.libraryTypeToWebComponentTypeMapping) {
1090
1091
  const value = this[key];
1091
1092
  if (value) {
1093
+ this.parseAndValidate(key);
1092
1094
  const attributeValue = ["appServer", "apiHost"].includes(key) ? SharedLib3.removeTrailingSlash(value) : value;
1093
1095
  this.chartElement.setAttribute(
1094
1096
  SharedLib3.libraryTypeToWebComponentTypeMapping[key],
@@ -1102,16 +1104,33 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1102
1104
  if (this.chartElement) {
1103
1105
  for (const [propertyName] of changedProperties.entries()) {
1104
1106
  const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
1107
+ this.parseAndValidate(propertyName);
1105
1108
  const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
1106
1109
  this.chartElement.setAttribute(mappedAttributeName, attributeValue);
1107
1110
  }
1108
1111
  } else {
1109
1112
  if (this.type) {
1113
+ SharedLib3.itemTypeParser.parse(this.type);
1110
1114
  await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1111
1115
  this.createAndAppendElement();
1112
1116
  }
1113
1117
  }
1114
1118
  }
1119
+ parseAndValidate(key) {
1120
+ try {
1121
+ if (key === "slots") {
1122
+ SharedLib3.slotsParser.parse(this.slots);
1123
+ } else if (key === "options") {
1124
+ SharedLib3.vizItemOptionsParser.parse(this.options);
1125
+ } else if (key === "canFilter") {
1126
+ SharedLib3.canFilterParser.parse(this.canFilter);
1127
+ }
1128
+ } catch (err) {
1129
+ const validationError = fromError(err);
1130
+ console.error(err);
1131
+ console.error(validationError.toString());
1132
+ }
1133
+ }
1115
1134
  render() {
1116
1135
  return html2` `;
1117
1136
  }
@@ -1162,7 +1181,7 @@ __decorateClass([
1162
1181
  var LuzmoVizItem = class extends LuzmoBaseVizItem {
1163
1182
  };
1164
1183
  LuzmoVizItem = __decorateClass([
1165
- customElement3("luzmo-viz-item")
1184
+ customElement2("luzmo-viz-item")
1166
1185
  ], LuzmoVizItem);
1167
1186
  export {
1168
1187
  LuzmoDashboard2 as LuzmoDashboard,
package/index.libs.cjs CHANGED
@@ -55,7 +55,7 @@ var import_style_map = require("lit/directives/style-map.js");
55
55
  var import_shared_embed = require("@luzmo/shared-embed");
56
56
 
57
57
  // libs/embed-libs/embed/package.json
58
- var version = "5.1.3-beta.0";
58
+ var version = "5.1.3-beta.2";
59
59
 
60
60
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
61
61
  var LuzmoService = class {
@@ -356,7 +356,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
356
356
  this.browserErrorMsg = "";
357
357
  this.dashboardError = false;
358
358
  this.browserNotSupported = [];
359
- this.version = version + "-wc-luzmo";
359
+ this.libVersion = version + "-wc-luzmo";
360
360
  this.isLibraryLoaded = false;
361
361
  this.currentAuthKey = null;
362
362
  this.currentAuthToken = null;
@@ -1030,7 +1030,7 @@ __decorateClass([
1030
1030
  ], LuzmoDashboard.prototype, "browserNotSupported", 2);
1031
1031
  __decorateClass([
1032
1032
  (0, import_decorators.property)()
1033
- ], LuzmoDashboard.prototype, "version", 2);
1033
+ ], LuzmoDashboard.prototype, "libVersion", 2);
1034
1034
  __decorateClass([
1035
1035
  (0, import_decorators.state)()
1036
1036
  ], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
@@ -1061,6 +1061,7 @@ var import_decorators4 = require("lit/decorators.js");
1061
1061
  var import_decorators3 = require("lit/decorators.js");
1062
1062
  var import_lit3 = require("lit");
1063
1063
  var SharedLib3 = __toESM(require("@luzmo/shared-embed"), 1);
1064
+ var import_zod_validation_error = require("zod-validation-error");
1064
1065
  var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1065
1066
  constructor() {
1066
1067
  super();
@@ -1105,6 +1106,7 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1105
1106
  for (const key in SharedLib3.libraryTypeToWebComponentTypeMapping) {
1106
1107
  const value = this[key];
1107
1108
  if (value) {
1109
+ this.parseAndValidate(key);
1108
1110
  const attributeValue = ["appServer", "apiHost"].includes(key) ? SharedLib3.removeTrailingSlash(value) : value;
1109
1111
  this.chartElement.setAttribute(
1110
1112
  SharedLib3.libraryTypeToWebComponentTypeMapping[key],
@@ -1118,16 +1120,33 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1118
1120
  if (this.chartElement) {
1119
1121
  for (const [propertyName] of changedProperties.entries()) {
1120
1122
  const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
1123
+ this.parseAndValidate(propertyName);
1121
1124
  const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
1122
1125
  this.chartElement.setAttribute(mappedAttributeName, attributeValue);
1123
1126
  }
1124
1127
  } else {
1125
1128
  if (this.type) {
1129
+ SharedLib3.itemTypeParser.parse(this.type);
1126
1130
  await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1127
1131
  this.createAndAppendElement();
1128
1132
  }
1129
1133
  }
1130
1134
  }
1135
+ parseAndValidate(key) {
1136
+ try {
1137
+ if (key === "slots") {
1138
+ SharedLib3.slotsParser.parse(this.slots);
1139
+ } else if (key === "options") {
1140
+ SharedLib3.vizItemOptionsParser.parse(this.options);
1141
+ } else if (key === "canFilter") {
1142
+ SharedLib3.canFilterParser.parse(this.canFilter);
1143
+ }
1144
+ } catch (err) {
1145
+ const validationError = (0, import_zod_validation_error.fromError)(err);
1146
+ console.error(err);
1147
+ console.error(validationError.toString());
1148
+ }
1149
+ }
1131
1150
  render() {
1132
1151
  return import_lit3.html` `;
1133
1152
  }
package/index.libs.js CHANGED
@@ -32,7 +32,7 @@ import {
32
32
  } from "@luzmo/shared-embed";
33
33
 
34
34
  // libs/embed-libs/embed/package.json
35
- var version = "5.1.3-beta.0";
35
+ var version = "5.1.3-beta.2";
36
36
 
37
37
  // libs/embed-libs/embed/src/lib/luzmo-service.ts
38
38
  var LuzmoService = class {
@@ -333,7 +333,7 @@ var LuzmoDashboard = class extends LitElement {
333
333
  this.browserErrorMsg = "";
334
334
  this.dashboardError = false;
335
335
  this.browserNotSupported = [];
336
- this.version = version + "-wc-luzmo";
336
+ this.libVersion = version + "-wc-luzmo";
337
337
  this.isLibraryLoaded = false;
338
338
  this.currentAuthKey = null;
339
339
  this.currentAuthToken = null;
@@ -1007,7 +1007,7 @@ __decorateClass([
1007
1007
  ], LuzmoDashboard.prototype, "browserNotSupported", 2);
1008
1008
  __decorateClass([
1009
1009
  property()
1010
- ], LuzmoDashboard.prototype, "version", 2);
1010
+ ], LuzmoDashboard.prototype, "libVersion", 2);
1011
1011
  __decorateClass([
1012
1012
  state()
1013
1013
  ], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
@@ -1032,12 +1032,13 @@ LuzmoDashboardWebComponent = __decorateClass([
1032
1032
  ], LuzmoDashboardWebComponent);
1033
1033
 
1034
1034
  // libs/embed-libs/embed/src/lib/viz-item/viz-item-web-component.ts
1035
- import { customElement as customElement3 } from "lit/decorators.js";
1035
+ import { customElement as customElement2 } from "lit/decorators.js";
1036
1036
 
1037
1037
  // libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
1038
1038
  import { property as property2 } from "lit/decorators.js";
1039
1039
  import { LitElement as LitElement2, html as html2, css as css2 } from "lit";
1040
1040
  import * as SharedLib3 from "@luzmo/shared-embed";
1041
+ import { fromError } from "zod-validation-error";
1041
1042
  var LuzmoBaseVizItem = class extends LitElement2 {
1042
1043
  constructor() {
1043
1044
  super();
@@ -1082,6 +1083,7 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1082
1083
  for (const key in SharedLib3.libraryTypeToWebComponentTypeMapping) {
1083
1084
  const value = this[key];
1084
1085
  if (value) {
1086
+ this.parseAndValidate(key);
1085
1087
  const attributeValue = ["appServer", "apiHost"].includes(key) ? SharedLib3.removeTrailingSlash(value) : value;
1086
1088
  this.chartElement.setAttribute(
1087
1089
  SharedLib3.libraryTypeToWebComponentTypeMapping[key],
@@ -1095,16 +1097,33 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1095
1097
  if (this.chartElement) {
1096
1098
  for (const [propertyName] of changedProperties.entries()) {
1097
1099
  const mappedAttributeName = SharedLib3.libraryTypeToWebComponentTypeMapping[propertyName] ?? propertyName;
1100
+ this.parseAndValidate(propertyName);
1098
1101
  const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() ?? this[propertyName];
1099
1102
  this.chartElement.setAttribute(mappedAttributeName, attributeValue);
1100
1103
  }
1101
1104
  } else {
1102
1105
  if (this.type) {
1106
+ SharedLib3.itemTypeParser.parse(this.type);
1103
1107
  await SharedLib3.loadLibrary(this.appServer, "DashboardApp");
1104
1108
  this.createAndAppendElement();
1105
1109
  }
1106
1110
  }
1107
1111
  }
1112
+ parseAndValidate(key) {
1113
+ try {
1114
+ if (key === "slots") {
1115
+ SharedLib3.slotsParser.parse(this.slots);
1116
+ } else if (key === "options") {
1117
+ SharedLib3.vizItemOptionsParser.parse(this.options);
1118
+ } else if (key === "canFilter") {
1119
+ SharedLib3.canFilterParser.parse(this.canFilter);
1120
+ }
1121
+ } catch (err) {
1122
+ const validationError = fromError(err);
1123
+ console.error(err);
1124
+ console.error(validationError.toString());
1125
+ }
1126
+ }
1108
1127
  render() {
1109
1128
  return html2` `;
1110
1129
  }
@@ -1155,7 +1174,7 @@ __decorateClass([
1155
1174
  var LuzmoVizItemWebComponent = class extends LuzmoBaseVizItem {
1156
1175
  };
1157
1176
  LuzmoVizItemWebComponent = __decorateClass([
1158
- customElement3("luzmo-viz-item-web-component")
1177
+ customElement2("luzmo-viz-item-web-component")
1159
1178
  ], LuzmoVizItemWebComponent);
1160
1179
  export {
1161
1180
  LuzmoDashboardWebComponent,
@@ -51,7 +51,7 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.ES6L
51
51
  browserErrorMsg: string;
52
52
  dashboardError: boolean;
53
53
  browserNotSupported: any[];
54
- version: string;
54
+ libVersion: string;
55
55
  protected isLibraryLoaded: boolean;
56
56
  protected dashboardReference: SharedLib.LuzmoElement;
57
57
  currentAuthKey: string;
@@ -19,5 +19,6 @@ export declare class LuzmoBaseVizItem extends LitElement {
19
19
  private createAndAppendElement;
20
20
  private updateVizItemProperties;
21
21
  updated(changedProperties: PropertyValues): Promise<void>;
22
+ parseAndValidate(key: keyof this): void;
22
23
  protected render(): unknown;
23
24
  }