diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bce1766ef..316071f6d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -129,9 +129,9 @@ importers: '@floating-ui/dom': specifier: ^1.5.3 version: 1.6.3 - deepmerge: - specifier: ^4.3.1 - version: 4.3.1 + deepmerge-ts: + specifier: ^5.1.0 + version: 5.1.0 devDependencies: '@babel/core': specifier: ^7.23.5 @@ -5649,9 +5649,15 @@ packages: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} dev: true + /deepmerge-ts@5.1.0: + resolution: {integrity: sha512-eS8dRJOckyo9maw9Tu5O5RUi/4inFLrnoLkBe3cPfDMx3WZioXtmOew4TXQaxq7Rhl4xjDtR7c6x8nNTxOvbFw==} + engines: {node: '>=16.0.0'} + dev: false + /deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} + dev: true /default-browser-id@5.0.0: resolution: {integrity: sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA==} diff --git a/shepherd.js/package.json b/shepherd.js/package.json index dfadded17..6873fd0a1 100644 --- a/shepherd.js/package.json +++ b/shepherd.js/package.json @@ -44,7 +44,7 @@ }, "dependencies": { "@floating-ui/dom": "^1.5.3", - "deepmerge": "^4.3.1" + "deepmerge-ts": "^5.1.0" }, "devDependencies": { "@babel/core": "^7.23.5", diff --git a/shepherd.js/rollup.config.mjs b/shepherd.js/rollup.config.mjs index 4558f88ff..733a59f87 100644 --- a/shepherd.js/rollup.config.mjs +++ b/shepherd.js/rollup.config.mjs @@ -7,7 +7,6 @@ import cssnanoPlugin from 'cssnano'; import { babel } from '@rollup/plugin-babel'; import serve from 'rollup-plugin-serve'; import livereload from 'rollup-plugin-livereload'; -import commonjs from '@rollup/plugin-commonjs'; import filesize from 'rollup-plugin-filesize'; import license from 'rollup-plugin-license'; import postcss from 'rollup-plugin-postcss'; @@ -28,7 +27,6 @@ const plugins = [ preprocess: sveltePreprocess({ typescript: true }), emitCss: true }), - commonjs(), nodeResolve({ extensions: ['.js', '.json', '.svelte', '.ts'], modulesOnly: true diff --git a/shepherd.js/src/step.ts b/shepherd.js/src/step.ts index ebfa3caea..78156c7fd 100644 --- a/shepherd.js/src/step.ts +++ b/shepherd.js/src/step.ts @@ -1,4 +1,4 @@ -import merge from 'deepmerge'; +import { deepmerge } from 'deepmerge-ts'; import { Evented } from './evented'; import autoBind from './utils/auto-bind'; import { @@ -514,7 +514,7 @@ export class Step extends Evented { let tourOptions = this.tour && this.tour.options && this.tour.options.defaultStepOptions; - tourOptions = merge({}, tourOptions || {}) as StepOptions; + tourOptions = deepmerge({}, tourOptions || {}); this.options = Object.assign( { diff --git a/shepherd.js/src/utils/floating-ui.ts b/shepherd.js/src/utils/floating-ui.ts index 8f9dabb7e..15dcd0f12 100644 --- a/shepherd.js/src/utils/floating-ui.ts +++ b/shepherd.js/src/utils/floating-ui.ts @@ -1,4 +1,4 @@ -import merge from 'deepmerge'; +import { deepmerge } from 'deepmerge-ts'; import { shouldCenterStep } from './general'; import { autoUpdate, @@ -65,7 +65,7 @@ export function mergeTooltipConfig( options: StepOptions ) { return { - floatingUIOptions: merge( + floatingUIOptions: deepmerge( tourOptions.floatingUIOptions || {}, options.floatingUIOptions || {} ) @@ -197,7 +197,7 @@ export function getFloatingUIOptions( options.placement = attachToOptions.on; } - return merge(step.options.floatingUIOptions || {}, options); + return deepmerge(step.options.floatingUIOptions || {}, options); } function addArrow(step: Step) { diff --git a/test/cypress/dummy/index.html b/test/cypress/dummy/index.html index 4317c7922..2a03cbc84 100644 --- a/test/cypress/dummy/index.html +++ b/test/cypress/dummy/index.html @@ -124,10 +124,10 @@