Skip to content

Commit

Permalink
Merge pull request #306 from searchspring/develop
Browse files Browse the repository at this point in the history
Snap v0.13.3 Release
  • Loading branch information
dkonieczek authored Jan 7, 2022
2 parents 3ea64ae + 2363873 commit 427f9a7
Show file tree
Hide file tree
Showing 10 changed files with 9,106 additions and 7,006 deletions.
15,950 changes: 9,025 additions & 6,925 deletions package-lock.json

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,26 @@
"devDependencies": {
"@searchspring/prettier": "^1.0.2",
"@searchspring/snapi-types": "^0.1.22",
"@types/jest": "^27.0.1",
"@types/jsdom": "^16.2.13",
"@types/jest": "^27.4.0",
"@types/jsdom": "^16.2.14",
"@types/seamless-immutable": "^7.1.16",
"@typescript-eslint/eslint-plugin": "^4.31.0",
"@typescript-eslint/parser": "^4.31.0",
"@typescript-eslint/eslint-plugin": "^5.9.0",
"@typescript-eslint/parser": "^5.9.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^7.32.0",
"eslint": "^8.6.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-react": "^7.25.1",
"husky": "^7.0.2",
"jest": "^27.1.1",
"jsdom": "^17.0.0",
"eslint-plugin-react": "^7.28.0",
"husky": "^7.0.4",
"jest": "^27.4.7",
"jsdom": "^19.0.0",
"lerna": "^4.0.0",
"lint-staged": "^11.1.2",
"prettier": "^2.4.0",
"serve": "^12.0.1",
"standard-version": "^9.3.1",
"ts-jest": "^27.0.5",
"typedoc": "^0.21.9",
"typescript": "^4.4.2",
"lint-staged": "^12.1.5",
"prettier": "^2.5.1",
"serve": "^13.0.2",
"standard-version": "^9.3.2",
"ts-jest": "^27.1.2",
"typedoc": "^0.22.10",
"typescript": "^4.5.4",
"whatwg-fetch": "^3.6.2"
},
"lint-staged": {
Expand Down
2 changes: 1 addition & 1 deletion packages/snap-client/src/Client/apis/Hybrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class HybridAPI extends API {
const suggestResults = await suggestRequester.getSuggest(suggestParams);
const transformedSuggestResults = transformSuggestResponse(suggestResults);

const q = transformedSuggestResults.correctedQuery || (suggestResults.suggested || {}).text || suggestResults.query;
const q = (suggestResults.suggested || {}).text || transformedSuggestResults.correctedQuery || suggestResults.query;

const queryParameters = {
...legacyRequestParameters,
Expand Down
36 changes: 18 additions & 18 deletions packages/snap-preact-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@emotion/react": "^11.4.1",
"@emotion/react": "^11.7.1",
"@searchspring/snap-preact": "^0.13.2",
"@searchspring/snap-toolbox": "^0.13.2",
"classnames": "^2.3.1",
"deepmerge": "^4.2.2",
"mobx-react-lite": "^3.2.1",
"mobx-react-lite": "^3.2.3",
"react-ranger": "^2.1.0",
"swiper": "^6.8.4"
},
"peerDependencies": {
"preact": "^10.5.14"
"preact": "^10.6.4"
},
"devDependencies": {
"@mdx-js/loader": "^1.6.22",
Expand All @@ -45,25 +45,25 @@
"@searchspring/snap-logger": "^0.13.2",
"@searchspring/snap-profiler": "^0.13.2",
"@searchspring/snap-store-mobx": "^0.13.2",
"@searchspring/snap-toolbox": "^0.3.11",
"@searchspring/snap-toolbox": "^0.13.2",
"@searchspring/snap-url-manager": "^0.13.2",
"@storybook/addon-actions": "^6.3.8",
"@storybook/addon-controls": "^6.3.8",
"@storybook/addon-docs": "^6.3.8",
"@storybook/addon-essentials": "^6.3.8",
"@storybook/addon-links": "^6.3.8",
"@storybook/builder-webpack5": "^6.3.8",
"@storybook/manager-webpack5": "^6.3.8",
"@storybook/preact": "^6.3.8",
"@storybook/theming": "^6.3.8",
"@testing-library/jest-dom": "^5.14.1",
"@storybook/addon-actions": "^6.4.9",
"@storybook/addon-controls": "^6.4.9",
"@storybook/addon-docs": "^6.4.9",
"@storybook/addon-essentials": "^6.4.9",
"@storybook/addon-links": "^6.4.9",
"@storybook/builder-webpack5": "^6.4.9",
"@storybook/manager-webpack5": "^6.4.9",
"@storybook/preact": "^6.4.9",
"@storybook/theming": "^6.4.9",
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/preact": "^2.0.1",
"@testing-library/user-event": "^13.2.1",
"mobx-react": "^7.2.0",
"preact": "^10.5.14",
"@testing-library/user-event": "^13.5.0",
"mobx-react": "^7.2.1",
"preact": "^10.6.4",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"ts-loader": "^9.2.5"
"ts-loader": "^9.2.6"
},
"sideEffects": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ export const Autocomplete = observer((properties: AutocompleteProps): JSX.Elemen
</div>
) : null}
<Facets {...subProps.facets} facets={facetsToShow} />
{!hideBanners ? <Banner content={merchandising.content} type={BannerType.LEFT} /> : null}
{!hideBanners ? <Banner {...subProps.banner} content={merchandising.content} type={BannerType.LEFT} /> : null}
</div>
</>
)
Expand All @@ -486,8 +486,8 @@ export const Autocomplete = observer((properties: AutocompleteProps): JSX.Elemen
</div>
) : results.length > 0 || Object.keys(merchandising.content).length > 0 || search?.query?.string ? (
<div className="ss__autocomplete__content">
{!hideBanners ? <Banner content={merchandising.content} type={BannerType.HEADER} /> : null}
{!hideBanners ? <Banner content={merchandising.content} type={BannerType.BANNER} /> : null}
{!hideBanners ? <Banner {...subProps.banner} content={merchandising.content} type={BannerType.HEADER} /> : null}
{!hideBanners ? <Banner {...subProps.banner} content={merchandising.content} type={BannerType.BANNER} /> : null}
{results.length > 0 ? (
<div className="ss__autocomplete__content__results">
{resultsSlot ? (
Expand Down Expand Up @@ -516,7 +516,7 @@ export const Autocomplete = observer((properties: AutocompleteProps): JSX.Elemen
</div>
)}

{!hideBanners ? <Banner content={merchandising.content} type={BannerType.FOOTER} /> : null}
{!hideBanners ? <Banner {...subProps.banner} content={merchandising.content} type={BannerType.FOOTER} /> : null}

{!hideLink ? (
linkSlot ? (
Expand Down
46 changes: 23 additions & 23 deletions packages/snap-preact-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,33 @@
"@searchspring/snap-preact": "^0.13.2",
"@searchspring/snap-preact-components": "^0.13.2",
"deepmerge": "^4.2.2",
"mobx": "^6.3.3",
"mobx-react": "^7.2.0",
"preact": "^10.5.14"
"mobx": "^6.3.12",
"mobx-react": "^7.2.1",
"preact": "^10.6.4"
},
"devDependencies": {
"@babel/core": "^7.15.5",
"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/plugin-proposal-decorators": "^7.15.4",
"@babel/plugin-transform-react-jsx": "^7.14.9",
"@babel/plugin-transform-runtime": "^7.15.0",
"@babel/preset-env": "^7.15.6",
"@babel/preset-react": "^7.14.5",
"@babel/runtime": "^7.15.4",
"@babel/core": "^7.16.7",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/plugin-proposal-decorators": "^7.16.7",
"@babel/plugin-transform-react-jsx": "^7.16.7",
"@babel/plugin-transform-runtime": "^7.16.7",
"@babel/preset-env": "^7.16.7",
"@babel/preset-react": "^7.16.7",
"@babel/runtime": "^7.16.7",
"@lhci/cli": "^0.8.2",
"@searchspring/browserslist-config-snap": "^1.0.4",
"babel-loader": "^8.2.2",
"core-js": "^3.19.0",
"css-loader": "^6.2.0",
"cypress": "8.5.0",
"@searchspring/browserslist-config-snap": "^1.0.5",
"babel-loader": "^8.2.3",
"core-js": "^3.20.2",
"css-loader": "^6.5.1",
"cypress": "9.2.0",
"file-loader": "^6.2.0",
"sass": "^1.44.0",
"sass-loader": "^12.1.0",
"style-loader": "^3.2.1",
"webpack": "^5.52.0",
"webpack-bundle-analyzer": "^4.4.2",
"webpack-cli": "^4.8.0",
"webpack-dev-server": "^4.2.0",
"sass": "^1.46.0",
"sass-loader": "^12.4.0",
"style-loader": "^3.3.1",
"webpack": "^5.65.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.7.2",
"webpack-merge": "^5.8.0"
},
"browserslist": {
Expand Down
26 changes: 13 additions & 13 deletions packages/snap-preact/src/Snap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,6 @@ export class Snap {
this._instantiatorPromises = {};
this.controllers = {};

if (window.searchspring && this.config.context) {
window.searchspring.context = this.config.context;
}

// autotrack shopper id from the context
if (this.config.context?.shopper?.id) {
this.tracker.track.shopper.login({
id: this.config.context.shopper.id,
});
}

// TODO environment switch using URL?
this.logger.setMode(process.env.NODE_ENV as LogMode);

Expand All @@ -209,7 +198,7 @@ export class Snap {
}

this.logger.setMode(LogMode.DEVELOPMENT);
this.logger.warn(`...loading '${branchParam}' build...`);
this.logger.warn(`...loading build... '${branchParam}'`);

// append script with new branch in path
const script = document.createElement('script');
Expand Down Expand Up @@ -238,11 +227,22 @@ export class Snap {
}
);

// prevent instantiation of config
// prevent further instantiation of config
return;
}
} catch (e) {}

if (window.searchspring && this.config.context) {
window.searchspring.context = this.config.context;
}

// autotrack shopper id from the context
if (this.config.context?.shopper?.id) {
this.tracker.track.shopper.login({
id: this.config.context.shopper.id,
});
}

Object.keys(this.config?.controllers || {}).forEach((type) => {
switch (type) {
case 'search': {
Expand Down
6 changes: 3 additions & 3 deletions packages/snap-preact/src/components/BranchOverride.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export const BranchOverride = (props: { branch: string; cookieName: string; bund
</div>

<div
style={`border-radius: 5px; padding: 6px; height: 100%; line-height: 14px; text-align: center; cursor: pointer; font-size: 11px; border: ${themes[themeName].top.button.border}; float: right; margin-right: 14px;`}
style={`border-radius: 5px; padding: 6px; height: 100%; line-height: 14px; text-align: center; cursor: pointer; font-size: 10px; border: ${themes[themeName].top.button.border}; float: right; margin-right: 14px;`}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
Expand All @@ -210,9 +210,9 @@ export const BranchOverride = (props: { branch: string; cookieName: string; bund
</div>
</div>

<div style="padding: 0px 15px;">
<div style="padding: 0px 15px; font-size: 12px;">
<span
style={`font-weight: bold; font-style: ${themes[themeName].details.branch.style}; color: ${themes[themeName].details.branch.color}; font-size: 16px; line-height: 20px; display: inline-block; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`}
style={`font-weight: bold; font-style: ${themes[themeName].details.branch.style}; color: ${themes[themeName].details.branch.color}; font-size: 14px; line-height: 20px; display: inline-block; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`}
>
{details == 'failure' ? (
<>
Expand Down
2 changes: 1 addition & 1 deletion packages/snap-store-mobx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"@searchspring/snap-toolbox": "^0.13.2",
"mobx": "^6.3.3"
"mobx": "^6.3.12"
},
"devDependencies": {
"@searchspring/snap-url-manager": "^0.13.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ export class UrlTranslator implements Translator {
[param.key[1]]: [
...(Array.isArray(currentValue) ? currentValue : [currentValue]),
{
[RangeValueProperties.LOW]: +param.value || null,
[RangeValueProperties.HIGH]: +nextRangeParam.value || null,
[RangeValueProperties.LOW]: isNaN(+param.value) ? null : +param.value,
[RangeValueProperties.HIGH]: isNaN(+nextRangeParam.value) ? null : +nextRangeParam.value,
},
],
},
Expand Down

0 comments on commit 427f9a7

Please sign in to comment.