diff --git a/.gitignore b/.gitignore index 3ec9837..14f4758 100644 --- a/.gitignore +++ b/.gitignore @@ -4,11 +4,32 @@ /vendor/ /public/ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local +.rollup-cache + # IDE Files #------------------------- /nbproject/ .idea/* .vscode/* +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? ## Sublime Text cache files *.tmlanguage.cache diff --git a/.npmignore b/.npmignore index 9439b83..443ff59 100644 --- a/.npmignore +++ b/.npmignore @@ -8,6 +8,7 @@ .lock-wscript .svn .wafpickle-* +.rollup-cache CVS npm-debug.log @@ -71,3 +72,9 @@ Thumbs.db /gulpfile.js /karma.conf.js /.travis.yml +/playwright.config.js +/vitest.config.js +/vite.config.ts +/rollup.config.mjs +/tsconfig.json +/jest.config.js \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2197832..0000000 --- a/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "node" diff --git a/CHANGELOG.md b/CHANGELOG.md index 56aa4f4..18e7a25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,62 @@ CHANGELOG ========= +v7.0.1 +----- +**All new jQuery SmartWizard v7 — full TypeScript rewrite** + +- **Added:** Complete rewrite in TypeScript with bundled type declarations (`dist/types/`) +- **Added:** `displayMode` option — `auto` (follows system preference) | `dark` | `light` | `none` +- **Added:** `swipeNavigation` option — swipe left/right on touch devices to navigate steps (`enabled`, `threshold`) +- **Added:** Horizontal mouse-wheel scroll on the nav bar when steps overflow +- **Added:** `behavior.useUrlHash` and `behavior.supportBrowserHistory` options replace old `enableUrlHash` / `backButtonSupport` +- **Added:** `navigation.completed.clickable` option — control whether completed steps are re-clickable +- **Added:** `DATA_ATTRIBUTES` constants for `data-theme` attribute management +- **Added:** `contentLoader` callback for dynamic step content loading +- **Added:** CSS animation support for transitions via `transition.css` (`prefix`, `forward`, `backward` class groups) +- **Added:** Nav scroll buttons shown automatically when nav content overflows +- **Added:** UMD, ESM, and CJS build outputs +- **Added:** `scrollToView` option — scroll the active step anchor into view on step change + +- **Changed:** All options restructured with clearer namespacing (see README for full reference) + - `selected` → `initialStep` + - `autoAdjustHeight` → `behavior.autoHeight` + - `enableUrlHash` → `behavior.useUrlHash` + - `backButtonSupport` → `behavior.supportBrowserHistory` + - `anchor.enableNavigation` → `navigation.enabled` + - `anchor.enableNavigationAlways` → `navigation.alwaysClickable` + - `anchor.enableDoneState` → `navigation.completed.enabled` + - `anchor.markPreviousStepsAsDone` → `navigation.completed.completeAllPreviousSteps` + - `anchor.unDoneOnBackNavigation` → `navigation.completed.clearOnBack` + - `anchor.enableDoneStateNavigation` → `navigation.completed.clickable` + - `transition.animation` → `transition.effect` + - `toolbar.showNextButton` / `showPreviousButton` → `toolbar.buttons.showNext` / `showPrevious` + - `toolbar.extraHtml` → `toolbar.extraElements` + - `keyboard.keyNavigation` → `keyboardNavigation.enabled` + - `keyboard.keyLeft` / `keyRight` → `keyboardNavigation.keys.left` / `right` + - `lang` → `localization.buttons` + - `disabledSteps`, `errorSteps`, `warningSteps`, `hiddenSteps` → `stepStates.disabled`, `.error`, `.warning`, `.hidden` + - `getContent` → `contentLoader` +- **Changed:** Events renamed for consistency + - `leaveStep` → `leave.sw` + - `showStep` → `shown.sw` + - `initialized` → `initialized.sw` + - `loaded` → `loaded.sw` +- **Changed:** `reset()` no longer manipulates URL hash unless `useUrlHash` + `supportBrowserHistory` are both enabled +- **Changed:** `transition.css` animations require the element to be visible before class is applied (fixes `animationend` not firing) +- **Changed:** `this.default(...)` references inside transition handlers replaced with direct `transitions.default(...)` to prevent `TypeError` when handlers are invoked without object context +- **Changed:** Progressbar width uses `.toFixed(2)` for cleaner CSS values +- **Changed:** `ANIMATIONEND` / `ANIMATIONCANCEL` events are now namespaced (`.sw`) + +- **Fixed:** `this is undefined` TypeError in CSS / fade / slide transition fallbacks +- **Fixed:** `animationend` event not firing on hidden elements (element now shown before animation class is applied) +- **Fixed:** Double-invocation of transition `complete` callback (guard flag added) +- **Fixed:** URL hash incorrectly always set; now only when both `useUrlHash` and `supportBrowserHistory` are `true` + +- **Removed:** `justified` option (layout handled by CSS) +- **Removed:** `cycleNavigation` option +- **Removed:** `STEPCHANGE` and `RESET` events (use `shown.sw` and handle externally) + v6.0.6 ----- - **Fixed:** History back on step1 not working https://github.com/techlab/jquery-smartwizard/issues/152 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2f7de6c..0b63b09 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,7 +8,6 @@ - Add documentation. - Add a demo page. - [GitHub Sponsor](https://github.com/sponsors/techlab) - Sponsor on GitHub. -- [Donate on Paypal](https://www.paypal.me/dipuraj) ## How to contribute code? Here are the basic steps to get started contributing code: @@ -17,7 +16,7 @@ Here are the basic steps to get started contributing code: 2. Install the dependencies, run `npm install`. 3. Start the project, run `npm start`. 4. Replicate the issue you're trying to fix or spec out the feature you're trying to add. -5. Modify the code to fix the bug or to add the feature. All changes should happen in the relevant `src/js/*.js` and `src/scss/*.scss` files. +5. Modify the code to fix the bug or to add the feature. All changes should happen in the relevant `src/ts/*.js` and `src/styles/*.scss` files. 6. Verify that your fix or feature works. 7. Run the test cases by running `npm test`, you can also add more test cases based on your new change. 8. Build the code by running `npm run build`. diff --git a/LICENSE b/LICENSE index 2d8884c..226bc0e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Dipu Raj +Copyright (c) 2026 Dipu Raj http://techlaboratory.net Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/MIGRATING.md b/MIGRATING.md new file mode 100644 index 0000000..60a0531 --- /dev/null +++ b/MIGRATING.md @@ -0,0 +1,346 @@ +# Migrating from SmartWizard v6 to v7 + +This guide covers all the breaking changes and new features you need to be aware of when upgrading from SmartWizard v6 to v7. + +--- + +## Overview + +v7 is a **complete TypeScript rewrite** of the plugin. The core API surface has been redesigned for clarity and consistency. While the HTML structure remains the same, nearly all option names, event names, and public method signatures have changed. + +--- + +## 1. Installation + +Update the package: + +```bash +npm install smartwizard@latest +``` + +Update CDN links: + +```html + + + + + + + + +``` + +> **Note:** In v7, `smart_wizard_all.min.css` is split into a base CSS file and separate per-theme files. Include the base CSS and the theme CSS separately. + +--- + +## 2. HTML Structure + +The HTML structure is **unchanged**. Your existing markup will work as-is. + +```html +