From 7d6d428ad17b9964fdd3bf7e12da6412cf1ecc84 Mon Sep 17 00:00:00 2001 From: Vitaly Koiro Date: Sat, 17 May 2025 15:51:18 +0300 Subject: [PATCH] fix: themes --- CHANGELOG.md | 10 ++++++++++ package.json | 2 +- src/core/managers/DOMManager.mjs | 6 ++++-- src/types/index.d.ts | 14 -------------- src/types/modules/effectsModule.d.ts | 16 +++++++++++++++- src/types/react.d.ts | 1 + src/types/vue.d.ts | 1 + 7 files changed, 32 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3a5680..605b46a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## 4.1.4 - Released on 2025-05-17 + +### Fixes + +- Fixed incorrect import in Vue with TypeScript +- Fixed incorrect theme application in Vue with TypeScript +- Fixed incorrect theme application in React with TypeScript + +
+ ## 4.1.3 - Released on 2025-05-17 ### Features diff --git a/package.json b/package.json index a3dadbb..23c0f36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prismium-src", - "version": "4.1.3", + "version": "4.1.4", "description": "A modern JavaScript accordion library with smooth animations. Easily integrates with React, Vue, and vanilla JavaScript.", "type": "module", "scripts": { diff --git a/src/core/managers/DOMManager.mjs b/src/core/managers/DOMManager.mjs index 523e3d4..5e44ce9 100644 --- a/src/core/managers/DOMManager.mjs +++ b/src/core/managers/DOMManager.mjs @@ -93,15 +93,17 @@ export class DOMManager { */ setTheme(el) { const { theme } = this.instance.options; - if (theme) { - el.classList.add(`prismium_${theme}`); + console.log(el); + if (theme) { if (typeof theme === 'object') { Object.entries(theme).forEach(([key, value]) => { if (value) { el.classList.add(`prismium_${key}`); } }); + } else { + el.classList.add(`prismium_${theme}`); } } } diff --git a/src/types/index.d.ts b/src/types/index.d.ts index 6140d7d..85c0de4 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -86,17 +86,3 @@ export type PrismiumTheme = | 'ocean' | 'sunset' | { [key: string]: boolean }; - -/** - * Effect types available in Prismium - */ -export type PrismiumEffect = - | 'line-by-line' - | 'fade-scale' - | 'slide' - | 'stagger' - | 'wave' - | 'flip' - | 'zoom' - | 'cascade' - | 'custom'; diff --git a/src/types/modules/effectsModule.d.ts b/src/types/modules/effectsModule.d.ts index ad72a38..dc60f3c 100644 --- a/src/types/modules/effectsModule.d.ts +++ b/src/types/modules/effectsModule.d.ts @@ -1,6 +1,20 @@ -import { PrismiumEffect, PrismiumModule } from '../index'; +import { PrismiumModule } from '../index'; import Prismium from '../core'; +/** + * Effect types available in Prismium + */ +export type PrismiumEffect = + | 'line-by-line' + | 'fade-scale' + | 'slide' + | 'stagger' + | 'wave' + | 'flip' + | 'zoom' + | 'cascade' + | 'custom'; + /** * Options for the EffectsModule */ diff --git a/src/types/react.d.ts b/src/types/react.d.ts index b15dea2..78b7f41 100644 --- a/src/types/react.d.ts +++ b/src/types/react.d.ts @@ -1,3 +1,4 @@ +import { EffectsModule } from './modules/index'; import { PrismiumModule } from './index'; import { PrismiumOptions } from './options'; import Prismium from './core'; diff --git a/src/types/vue.d.ts b/src/types/vue.d.ts index c0db02b..e35aa1f 100644 --- a/src/types/vue.d.ts +++ b/src/types/vue.d.ts @@ -1,3 +1,4 @@ +import { EffectsModule } from './modules/index'; import { PrismiumModule } from './index'; import { PrismiumOptions } from './options'; import Prismium from './core';