@social-mail/social-mail-client 1.2.330 → 1.2.332

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-client",
3
- "version": "1.2.330",
3
+ "version": "1.2.332",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,7 +17,7 @@ import ToggleButtonBar from "@web-atoms/web-controls/dist/basic/ToggleButtonBar"
17
17
  const url = (window as any).pageUrl as URL;
18
18
 
19
19
 
20
- let {1: storeID = "4", 2: itemID = "1w" } = /^\/store\/([^\/]+)\/([^\/]+)\//.exec(url?.pathname) ?? {} as any;
20
+ let {1: storeID = "4", 2: itemID = "23" } = /^\/store\/([^\/]+)\/([^\/]+)\//.exec(url?.pathname) ?? {} as any;
21
21
 
22
22
  storeID = parseInt(storeID, 36);
23
23
  itemID = parseInt(itemID, 36);
@@ -53,6 +53,7 @@ const css = styled.css `
53
53
  display: flex;
54
54
  flex-direction: column;
55
55
  overflow: auto;
56
+ max-height: 500px;
56
57
  & > img {
57
58
  cursor: pointer;
58
59
  margin: 5px;
@@ -100,13 +101,11 @@ export default class StoreItemDetailView extends AtomControl {
100
101
  this.runAfterInit(() => this.app.runAsync(() => this.init()));
101
102
  }
102
103
 
103
- getFiles( ... items: IStoreItem[]) {
104
- const files = [];
105
- for (const iterator of items) {
106
- if(!iterator?.mediaFiles) {
107
- continue;
108
- }
109
- files.push(... iterator.mediaFiles);
104
+ getFiles(item: IStoreItem, varient: IStoreItem, size: IStoreItem) {
105
+ const varientFiles = varient?.mediaFiles?.filter((x) => x.isPreview);
106
+ const files = varientFiles ?? item.mediaFiles.filter((x) => x.isPreview);
107
+ if (size?.mediaFiles) {
108
+ files.push(... size.mediaFiles.filter((x) => x.isPreview));
110
109
  }
111
110
  this.selectedFile = files[0];
112
111
  return files;
@@ -120,9 +119,6 @@ export default class StoreItemDetailView extends AtomControl {
120
119
 
121
120
  this.model = await this.getItem();
122
121
 
123
- const images = this.model.mediaFiles.where((x) => x.isPreview);
124
- this.selectedFile = images[0];
125
-
126
122
  const offer = this.model.mediaFiles.find((x) => x.title === "offer.html");
127
123
  const specifications = this.model.mediaFiles.find((x) => x.title === "specs.html");
128
124
 
@@ -139,7 +135,7 @@ export default class StoreItemDetailView extends AtomControl {
139
135
 
140
136
  this.renderer = <div
141
137
  class={css}
142
- images={Bind.oneWay(() => this.getFiles(this.model, this.selectedSize, this.selectedVarient))}>
138
+ images={Bind.oneWay(() => this.getFiles(this.model, this.selectedVarient, this.selectedSize))}>
143
139
  <h2>{this.model.name}</h2>
144
140
 
145
141
  <section class="photos">