Skip to content

Commit

Permalink
Merge pull request #1059 from searchspring/develop
Browse files Browse the repository at this point in the history
Release v0.56.4
  • Loading branch information
korgon authored May 28, 2024
2 parents adfae18 + f76b195 commit 37da89b
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 342 deletions.
331 changes: 12 additions & 319 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/snap-preact-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@emotion/react": "11.9.0",
"@searchspring/snap-toolbox": "^0.56.3",
"classnames": "^2.3.2",
"cypress": "^12.15.0",
"cypress": "^13.7.1",
"cypress-wait-until": "^1.7.2",
"deepmerge": "4.3.1",
"dequal": "2.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Fragment, h } from 'preact';

import { jsx, css } from '@emotion/react';
import classnames from 'classnames';
import { observer } from 'mobx-react-lite';
import { observer } from 'mobx-react';

import { Theme, useTheme, CacheProvider } from '../../../providers';
import { ComponentProps, StylingCSS } from '../../../types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Fragment, h } from 'preact';

import { jsx, css } from '@emotion/react';
import classnames from 'classnames';
import { observer } from 'mobx-react-lite';
import { observer } from 'mobx-react';
import { Theme, useTheme, CacheProvider } from '../../../providers';
import { ComponentProps, StylingCSS } from '../../../types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Fragment, h } from 'preact';

import { jsx, css } from '@emotion/react';
import classnames from 'classnames';
import { observer } from 'mobx-react-lite';
import { observer } from 'mobx-react';
import { Theme, useTheme, CacheProvider } from '../../../providers';
import { ComponentProps, StylingCSS } from '../../../types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Fragment, h } from 'preact';

import { jsx, css } from '@emotion/react';
import classnames from 'classnames';
import { observer } from 'mobx-react-lite';
import { observer } from 'mobx-react';
import { Theme, useTheme, CacheProvider } from '../../../providers';
import { ComponentProps, StylingCSS } from '../../../types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Fragment, h } from 'preact';

import { jsx, css } from '@emotion/react';
import classnames from 'classnames';
import { observer } from 'mobx-react-lite';
import { observer } from 'mobx-react';

import { Theme, useTheme, CacheProvider } from '../../../providers';
import { ComponentProps, StylingCSS, ComponentMap } from '../../../types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ComponentChildren, Fragment, h } from 'preact';

import { jsx, css } from '@emotion/react';
import classnames from 'classnames';
import { observer } from 'mobx-react-lite';
import { observer } from 'mobx-react';

import { Theme, useTheme, CacheProvider } from '../../../providers';
import { ComponentProps, StylingCSS, ComponentMap } from '../../../types';
Expand Down
35 changes: 19 additions & 16 deletions packages/snap-store-mobx/src/Search/Stores/SearchResultStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,20 @@ export class Banner {
export type VariantData = {
mappings: SearchResponseModelResultMappings;
attributes: Record<string, unknown>;
options: Record<
string,
{
value: string;
attributeId?: string;
optionId?: string;
}
>;
options: VariantDataOptions;
};

export type VariantDataOptions = Record<
string,
{
value: string;
background?: string;
backgroundImageUrl?: string;
attributeId?: string;
optionId?: string;
}
>;

type ProductMinimal = {
id: string;
attributes: Record<string, unknown>;
Expand Down Expand Up @@ -505,6 +509,12 @@ export class VariantSelection {

if (this.config.thumbnailBackgroundImages) {
mappedValue.backgroundImageUrl = thumbnailImageUrl;
} else if (variant.options[this.field].backgroundImageUrl) {
mappedValue.backgroundImageUrl = variant.options[this.field].backgroundImageUrl;
}

if (variant.options[this.field].background) {
mappedValue.background = variant.options[this.field].background;
}

if (this.config.mappings && this.config.mappings && this.config.mappings[value.toString().toLowerCase()]) {
Expand Down Expand Up @@ -580,14 +590,7 @@ export class Variant {
public type = 'variant';
public available: boolean;
public attributes: Record<string, unknown> = {};
public options: Record<
string,
{
value: string;
attributeId?: string;
optionId?: string;
}
>;
public options: VariantDataOptions;

public mappings: SearchResponseModelResultMappings = {
core: {},
Expand Down

0 comments on commit 37da89b

Please sign in to comment.