@miso.ai/client-sdk-ui 1.11.5-beta.7 → 1.11.5-beta.9
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.
|
@@ -198,8 +198,7 @@ class GalleryLayout extends _collection.default {
|
|
|
198
198
|
_syncCssVariables() {
|
|
199
199
|
const context = this._galleryContext;
|
|
200
200
|
let {
|
|
201
|
-
itemAspectRatio = 1
|
|
202
|
-
height = DEFAULT_HEIGHT
|
|
201
|
+
itemAspectRatio = 1
|
|
203
202
|
} = this.options;
|
|
204
203
|
itemAspectRatio = context.itemAspectRatio = (0, _dom.cssAspectRatio)(itemAspectRatio);
|
|
205
204
|
const {
|
|
@@ -209,7 +208,6 @@ class GalleryLayout extends _collection.default {
|
|
|
209
208
|
return;
|
|
210
209
|
}
|
|
211
210
|
// TODO: skip if equal to default values
|
|
212
|
-
element.style.setProperty('--miso-gallery-height', `${height}`);
|
|
213
211
|
element.style.setProperty('--miso-gallery-item-1x1-aspect-ratio', `${itemAspectRatio}`);
|
|
214
212
|
element.style.setProperty('--miso-gallery-item-1x2-aspect-ratio', `${itemAspectRatio.scaleBy([1, 2])}`);
|
|
215
213
|
}
|
|
@@ -234,7 +232,7 @@ class GalleryLayout extends _collection.default {
|
|
|
234
232
|
|
|
235
233
|
// update DOM
|
|
236
234
|
listElement.style.aspectRatio = `${columnCount} / 2`;
|
|
237
|
-
listElement.style.height = 'auto';
|
|
235
|
+
listElement.style.height = itemCount > 0 ? 'auto' : '0';
|
|
238
236
|
}
|
|
239
237
|
_syncItemCount() {
|
|
240
238
|
let {
|
|
@@ -269,7 +269,8 @@ function tagPair(_ref13, _ref14) {
|
|
|
269
269
|
const roleAttrs = role ? `data-role="${role}"` : '';
|
|
270
270
|
return [`<${tag} class="${className}__${classSuffix}" ${roleAttrs} ${productAttrs} ${urlAttrs}>`, `</${tag}>`];
|
|
271
271
|
}
|
|
272
|
-
function linkAttrs(
|
|
272
|
+
function linkAttrs() {
|
|
273
|
+
let link = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
273
274
|
const {
|
|
274
275
|
target = '_blank',
|
|
275
276
|
rel = 'noopener',
|
package/dist/cjs/version.js
CHANGED
package/package.json
CHANGED
|
@@ -170,14 +170,13 @@ export default class GalleryLayout extends CollectionLayout {
|
|
|
170
170
|
|
|
171
171
|
_syncCssVariables() {
|
|
172
172
|
const context = this._galleryContext;
|
|
173
|
-
let { itemAspectRatio = 1
|
|
173
|
+
let { itemAspectRatio = 1 } = this.options;
|
|
174
174
|
itemAspectRatio = context.itemAspectRatio = cssAspectRatio(itemAspectRatio);
|
|
175
175
|
const { element } = this._view;
|
|
176
176
|
if (!element) {
|
|
177
177
|
return;
|
|
178
178
|
}
|
|
179
179
|
// TODO: skip if equal to default values
|
|
180
|
-
element.style.setProperty('--miso-gallery-height', `${height}`);
|
|
181
180
|
element.style.setProperty('--miso-gallery-item-1x1-aspect-ratio', `${itemAspectRatio}`);
|
|
182
181
|
element.style.setProperty('--miso-gallery-item-1x2-aspect-ratio', `${itemAspectRatio.scaleBy([1, 2])}`);
|
|
183
182
|
}
|
|
@@ -198,7 +197,7 @@ export default class GalleryLayout extends CollectionLayout {
|
|
|
198
197
|
|
|
199
198
|
// update DOM
|
|
200
199
|
listElement.style.aspectRatio = `${columnCount} / 2`;
|
|
201
|
-
listElement.style.height = 'auto';
|
|
200
|
+
listElement.style.height = itemCount > 0 ? 'auto' : '0';
|
|
202
201
|
}
|
|
203
202
|
|
|
204
203
|
_syncItemCount({ state } = {}) {
|
package/src/layout/templates.js
CHANGED
|
@@ -194,7 +194,7 @@ function tagPair({ className, options = {} }, { product_id, url }, { classSuffix
|
|
|
194
194
|
return [`<${tag} class="${className}__${classSuffix}" ${roleAttrs} ${productAttrs} ${urlAttrs}>`, `</${tag}>`];
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
function linkAttrs(link) {
|
|
197
|
+
function linkAttrs(link = {}) {
|
|
198
198
|
const { target = '_blank', rel = 'noopener', open = true } = link; // TODO: other properties
|
|
199
199
|
let attrs = '';
|
|
200
200
|
if (open) {
|
package/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.11.5-beta.
|
|
1
|
+
export default '1.11.5-beta.9';
|