@social-mail/social-mail-client 1.2.384 → 1.2.385

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.
@@ -19773,16 +19773,16 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
19773
19773
  _export("default", StoreItemDetailView = class StoreItemDetailView extends AtomControl {
19774
19774
  constructor(app, e) {
19775
19775
  super(app, e);
19776
- this.selectedVarient = null;
19776
+ this.selectedVariant = null;
19777
19777
  this.selectedSize = null;
19778
19778
  this.selectedFile = null;
19779
19779
  this.images = [];
19780
19780
  this.runAfterInit(() => this.app.runAsync(() => this.init()));
19781
19781
  }
19782
- getFiles(item, varient, size) {
19782
+ getFiles(item, variant, size) {
19783
19783
  var _a;
19784
- const varientFiles = (_a = varient === null || varient === void 0 ? void 0 : varient.mediaFiles) === null || _a === void 0 ? void 0 : _a.filter(x => x.isPreview);
19785
- const files = varientFiles !== null && varientFiles !== void 0 ? varientFiles : item.mediaFiles.filter(x => x.isPreview);
19784
+ const variantFiles = (_a = variant === null || variant === void 0 ? void 0 : variant.mediaFiles) === null || _a === void 0 ? void 0 : _a.filter(x => x.isPreview);
19785
+ const files = variantFiles !== null && variantFiles !== void 0 ? variantFiles : item.mediaFiles.filter(x => x.isPreview);
19786
19786
  if (size === null || size === void 0 ? void 0 : size.mediaFiles) {
19787
19787
  files.push(...size.mediaFiles.filter(x => x.isPreview));
19788
19788
  }
@@ -19790,7 +19790,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
19790
19790
  return files;
19791
19791
  }
19792
19792
  init() {
19793
- var _a, _b, _c, _d, _e, _f;
19793
+ var _a, _b, _c, _d, _e, _f, _g;
19794
19794
  return __awaiter(this, void 0, void 0, function* () {
19795
19795
  this.renderer = XNode.create("div", null, XNode.create("label", {
19796
19796
  text: "..."
@@ -19798,14 +19798,13 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
19798
19798
  this.model = yield this.getItem();
19799
19799
  const offer = this.model.mediaFiles.find(x => x.title === "offer.html");
19800
19800
  const specifications = this.model.mediaFiles.find(x => x.title === "specs.html");
19801
- const price = this.model.storeItemPrices[0];
19802
- const maxPrice = price.maxAmount ? price.maxAmount : Math.ceil(price.amount * 1.1);
19801
+ const price = (_a = this.model.storeItemPrices) === null || _a === void 0 ? void 0 : _a[0];
19803
19802
  const [offerHtml, specHtml] = yield Promise.all([offer ? FetchBuilder.get(signedUrl(offer)).responseAsText() : Promise.resolve(""), specifications ? FetchBuilder.get(signedUrl(specifications)).responseAsText() : Promise.resolve("")]);
19804
- this.selectedSize = (_b = (_a = this.model.sizes) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : null;
19805
- this.selectedVarient = (_d = (_c = this.model.variants) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : null;
19803
+ this.selectedSize = (_c = (_b = this.model.sizes) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : null;
19804
+ this.selectedVariant = (_e = (_d = this.model.variants) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : null;
19806
19805
  this.renderer = XNode.create("div", {
19807
19806
  class: css,
19808
- images: Bind.oneWay(() => this.getFiles(this.model, this.selectedVarient, this.selectedSize))
19807
+ images: Bind.oneWay(() => this.getFiles(this.model, this.selectedVariant, this.selectedSize))
19809
19808
  }, XNode.create("h2", null, this.model.name), XNode.create("section", {
19810
19809
  class: "product"
19811
19810
  }, XNode.create("section", {
@@ -19831,7 +19830,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
19831
19830
  innerHTML: offerHtml
19832
19831
  }), XNode.create("p", null, this.model.description), XNode.create("p", null, XNode.create("label", {
19833
19832
  text: formatPrice(price)
19834
- })), XNode.create("button", null, "Buy"), ((_e = this.model.sizes) === null || _e === void 0 ? void 0 : _e.length) && XNode.create(ToggleButtonBar, {
19833
+ })), XNode.create("button", null, "Buy"), ((_f = this.model.sizes) === null || _f === void 0 ? void 0 : _f.length) && XNode.create(ToggleButtonBar, {
19835
19834
  items: this.model.sizes,
19836
19835
  selectedItem: Bind.twoWaysImmediate(() => this.selectedSize),
19837
19836
  itemRenderer: x => XNode.create("div", {
@@ -19839,9 +19838,9 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
19839
19838
  }, XNode.create("label", {
19840
19839
  text: x.name
19841
19840
  }))
19842
- }), ((_f = this.model.variants) === null || _f === void 0 ? void 0 : _f.length) && XNode.create(ToggleButtonBar, {
19841
+ }), ((_g = this.model.variants) === null || _g === void 0 ? void 0 : _g.length) && XNode.create(ToggleButtonBar, {
19843
19842
  items: this.model.variants,
19844
- selectedItem: Bind.twoWaysImmediate(() => this.selectedVarient),
19843
+ selectedItem: Bind.twoWaysImmediate(() => this.selectedVariant),
19845
19844
  itemRenderer: x => XNode.create("div", {
19846
19845
  "data-item-type": "toggle-button"
19847
19846
  }, XNode.create("label", {