From a62470d8fbca8118a0a0d64638aaf44008274c9f Mon Sep 17 00:00:00 2001 From: Taylor Reece Date: Wed, 21 Dec 2022 12:59:03 -0600 Subject: [PATCH 1/3] screenConfiguration options set at .showMarketplace should inherit from .init options --- package-lock.json | 17 +++++++++++++++-- package.json | 5 ++++- src/index.ts | 7 ++++++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 540dcfa..22d09fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,16 @@ { "name": "@prismatic-io/marketplace", - "version": "3.4.4", + "version": "3.4.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@prismatic-io/marketplace", - "version": "3.4.4", + "version": "3.4.5", "license": "MIT", + "dependencies": { + "lodash": "4.17.21" + }, "devDependencies": { "@types/node": "18.11.17", "prettier": "2.8.1", @@ -860,6 +863,11 @@ "node": ">=8" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -2201,6 +2209,11 @@ "p-locate": "^4.1.0" } }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", diff --git a/package.json b/package.json index b404caf..40facaf 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "url": "https://github.com/prismatic-io/marketplace.git" }, "license": "MIT", - "version": "3.4.4", + "version": "3.4.5", "main": "dist/index.js", "types": "dist/index.d.ts", "files": [ @@ -37,5 +37,8 @@ "typescript": "4.9.4", "webpack": "5.75.0", "webpack-cli": "5.0.1" + }, + "dependencies": { + "lodash": "4.17.21" } } diff --git a/src/index.ts b/src/index.ts index 6e736ba..1a60f82 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,4 @@ +import _ from "lodash"; import init from "./init"; import authenticate from "./authenticate"; import { modalSelector, iframeContainerSelector } from "./selectors"; @@ -151,7 +152,11 @@ const setIframe = ( if (options) { Object.entries(options).forEach(([key, value]) => { if (key in state) { - state[key] = value; + if (state[key] instanceof Object) { + state[key] = _.merge(state[key], value); + } else { + state[key] = value; + } } }); } From 231370c534ae57a18a2ca3808fef7ebf1f46cc70 Mon Sep 17 00:00:00 2001 From: Taylor Reece Date: Wed, 21 Dec 2022 13:04:30 -0600 Subject: [PATCH 2/3] Add notes about what each property represents. --- src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.ts b/src/index.ts index 1a60f82..43e15da 100644 --- a/src/index.ts +++ b/src/index.ts @@ -29,7 +29,9 @@ interface MarketplaceConfiguration { } interface InitializingConfiguration { + /** The background color of the loading screen */ background: string; + /** The font color of the loading screen text and loading icon */ color: string; } From c282757ef49e0d4bd5ce969c545a70431caafb78 Mon Sep 17 00:00:00 2001 From: Taylor Reece Date: Wed, 21 Dec 2022 15:45:14 -0600 Subject: [PATCH 3/3] Import lodash.merge to minimize build size. --- package-lock.json | 18 +++++++++--------- package.json | 2 +- src/index.ts | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 22d09fc..b587034 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "3.4.5", "license": "MIT", "dependencies": { - "lodash": "4.17.21" + "lodash.merge": "4.6.2" }, "devDependencies": { "@types/node": "18.11.17", @@ -863,10 +863,10 @@ "node": ">=8" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, "node_modules/lru-cache": { "version": "6.0.0", @@ -2209,10 +2209,10 @@ "p-locate": "^4.1.0" } }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, "lru-cache": { "version": "6.0.0", diff --git a/package.json b/package.json index 40facaf..ddc357d 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,6 @@ "webpack-cli": "5.0.1" }, "dependencies": { - "lodash": "4.17.21" + "lodash.merge": "4.6.2" } } diff --git a/src/index.ts b/src/index.ts index 43e15da..48d6e6a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -import _ from "lodash"; +import merge from "lodash.merge"; import init from "./init"; import authenticate from "./authenticate"; import { modalSelector, iframeContainerSelector } from "./selectors"; @@ -155,7 +155,7 @@ const setIframe = ( Object.entries(options).forEach(([key, value]) => { if (key in state) { if (state[key] instanceof Object) { - state[key] = _.merge(state[key], value); + state[key] = merge(state[key], value); } else { state[key] = value; }