UNPKG

wanakana

Version:

Utility library for converting between Kanji, Hiragana, Katakana, and Romaji

300 lines (184 loc) 9.49 kB
<!-- markdownlint-disable MD024 --> # Change Log All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). <!-- - TITLE - Add link at EOF to compare changes: - [2.2.3]: https://github.com/WaniKani/WanaKana/compare/2.2.2...2.2.3 - List release date in YYYY-MM-DD format - DETAILS - Added: for new features. - Changed: for changes in existing functionality. - Deprecated: for once-stable features removed in upcoming releases. - Removed: for deprecated features removed in this release. - Fixed: for any bug fixes. - Security: to invite users to upgrade in case of vulnerabilities. --> <!-- ## [Unreleased] ### Add any unpublished changes here as they are made, for easy reference come release time. --> ## [5.3.1] - 2023-11-20 ### Fixed Wanakana will now report its version correctly, this was briefly incorrect in version `5.3.0`. ## [5.3.0] - 2023-11-19 ### Added Typescript definitions have been added 🎉 ## [5.2.0] - 2023-09-30 ### Fixed The iteration mark `々` was considered punctuation due to where it lies in unicode (alongside other punctuation). This caused some oddities in Wanakana when splitting characters. Since `々` acts like a kanji character in words, it is no longer considered punctuation in Wanakana. See #163 for further discussion. - `isKanji()` now returns true for `々` - `isPunctuation()` now returns false for `々` - `tokenize()` no longer splits on `々` - `stripOkurigana()` no longer splits on `々` ## [5.1.0] - 2023-02-03 ### Fixed - `bind()` could be used on the same element multiple times - `unbind()` now returns an element to its previous state (attributes etc) ### Changed - `unbind()` removes the attributes that were added by Wanakana ## [5.0.2] - 2022-05-17 ### Fixed - `bind()` was ignoring useObsoleteKana & customKanaMapping options - `ku` not converting immediately with `IMEMode` ## [5.0.!] - 2022-04-15 ### Fixed - Unpkg should now properly source the correct module for use in the browser as a script tag ## [5.0.0] - 2022-04-15 ### Fixed - When a custom mapping was provided in options and then a different one was given, we only replaced the mapping with the new one when a previous one did not exist. Now we will always replace the custom mapping when it changes. <https://github.com/WaniKani/WanaKana/pull/132> ### Added - Support for converting some k-- constructions. <https://github.com/WaniKani/WanaKana/issues/126> - Allow user to ignore converting long vowel mark in toHiragana. <https://github.com/WaniKani/WanaKana/issues/128> ### Changed - The UMD build now only includes polyfills for browserslist defaults (> 0.5%, last 2 versions, Firefox ESR, not dead - at time of writing) which drops support for IE. - Node support is now 12+ (though likely would continue to work fine on older versions) ## [4.0.2] - 2018-04-30 ### Added - react-native field in lib package.json ### Fixed - corrected recent dates in changelog (2017 -> 2018) ## [4.0.1] - 2018-04-30 ### Fixed - stripOkurigana(): If the input has the same kana at different locations, such as '申し申し', the inner kana was stripped instead ## [4.0.0] - 2018-04-26 ### Changed - stripOkurigana() options are now `{ leading: Boolean, matchKanji: String }` ### Removed - stripOkurigana() "all" option has been removed but can be easily reproduced via `[...text].filter(isKana)` ## [3.1.1] - 2018-03-26 ### Fixed - some versions of Android GBoard English keyboard entering 'n' followed by a consonant would block further conversion ## [3.1.0] - 2018-03-01 ### Changed - bind() now sets necessary attributes automatically (autocomplete, spellcheck etc) - toKana() no longer converts zenkaku latin toKana now: ('imi imi' => 'imi いみ') - toRomaji() extends vowels for katakana chōonpu, IE: ゲーム => geemu, toHiragana() converts to hyphen => ge-mu - toKana() **without** IME mode converts lone 'n' => 'ん', 'nn' => 'んん' _if no other chars present_ - isJapanese() now returns false for latin numbers (201) (still true for zenkaku 201) - tokenize() splits into finer categories, view API documentation and tests for full details - rewrite of conversion methods to allow custom mapping adapters ### Added - isJapanese and isRomaji now accept a second param, a regexp that will also pass the check - global option romanization for toRomaji() (currently only 'hepburn' however) - global option customKanaMapping for toKana() - global option customRomajiMapping for toRomaji() ### Fixed - inserting text between already existing characters in a bind() IME input field now properly sets cursor to correct position after conversion - toRomaji() little ヶヵ used in words like 一ヶ月 are no longer converted since they are used as symbols (like the kanji) and do not actually denote kana. Previous behaviour: 一ヶ月 => 一 ke 月 - toRomaji() no longer incorrectly duplicates non-glottal stops following っ. Previous behaviour: あっ、 -> a,, ## [2.3.4] - 2017-12-16 ### Fixed - _Uppercase_ input with toHiragana() including a double consonant was incorrectly producing a katakana ッ instead of っ ## [2.3.3] - 2017-12-12 ### Fixed - Add https to unpkg link ## [2.3.2] - 2017-12-12 ### Added - Specify minified bundle in package.json for easy use with unpkg ## [2.3.1] - 2017-10-17 ### Changed - Set cursor in IME mode to the current position after conversion (rather than the end of all input) ## [2.3.0] - 2017-08-28 ### Changed - Increase character coverage for isJapanese to include numbers and hankaku katakana ## [2.2.4] - 2017-08-24 ### Fixed - Pass through long vowel conversion using toHiragana with odd/mixed input ## [2.2.3] - 2017-08-05 ### Fixed - Mobile input not converting automatically during autosuggest (regression due to 2.2.1) ## [2.2.2] - 2017-07-30 ### Fixed - Keep track of event listeners by generated ids ## [2.2.1] - 2017-07-30 ### Fixed - [Microsoft IME input with 'tt' / っ](https://github.com/WaniKani/WanaKana/issues/48) ## [2.2.0] - 2017-07-13 ### Added - Options object setting `IMEMode` can now accept `'toHiragana'` or `'toKatakana'` to enforce specific conversion on input ## [2.1.0] - 2017-07-09 ### Added - Set `autocapitalize="none"` on bound input fields - Handle multiple event listeners with separate options - Increased test coverage ### Fixed - Hold onto merged options for dom utils via closure instead of global - Keep track of event listeners for removal on unbind ### Changed - `bind`, `unbind` are now named exports in 'wanakana/domUtils' ## [2.0.4] - 2017-07-07 ### Fixed - Wanakana website address in package.json ## [2.0.3] - 2017-07-07 ### Fixed - Missing description field in package.json ## [2.0.2] - 2017-06-30 ### Added - Documentation regarding recommended use of autocapitalize="none" on input fields ### Changed - Improve font readability on demo page ## [2.0.1] - 2017-06-17 ### Changed - Fixed some incorrect text references - Internal build modifications ## [2.0.0] - 2017-06-17 ### Added - Changelog! - Separate bundles for different environments (node, esmodules, browser) - New method: `stripOkurigana()` - New method: `tokenize()` - Default options extended with `passRomaji` and `upcaseKatakana` - [Extended docs](http://www.wanakana.com/docs) ### Fixed - [Ambiguous N](https://github.com/WaniKani/WanaKana/issues/38) thanks to @DTJB - [Mixed Case toHiragana](https://github.com/WaniKani/WanaKana/issues/39) thanks to @DTJB - [Katakana Long Vowels](https://github.com/WaniKani/WanaKana/issues/40) thanks to @dianahervascastillo @maesierra @codebar @ladieswhocode - [Missing Space](https://github.com/WaniKani/WanaKana/issues/50) thanks to @mimshwright ### Changed - Transliteration converts major punctuation marks both ways. - `isJapanese()` & `isRomaji()` check major punctuation. - `isRomaji()` allows hepburn romanisation long vowels. (IE. Tōkyō) [4.0.2]: https://github.com/WaniKani/WanaKana/compare/4.0.1...4.0.2 [4.0.1]: https://github.com/WaniKani/WanaKana/compare/4.0.0...4.0.1 [4.0.0]: https://github.com/WaniKani/WanaKana/compare/3.1.1...4.0.0 [3.1.1]: https://github.com/WaniKani/WanaKana/compare/3.1.0...3.1.1 [3.1.0]: https://github.com/WaniKani/WanaKana/compare/2.3.4...3.1.0 [2.3.4]: https://github.com/WaniKani/WanaKana/compare/2.3.3...2.3.4 [2.3.3]: https://github.com/WaniKani/WanaKana/compare/2.3.2...2.3.3 [2.3.2]: https://github.com/WaniKani/WanaKana/compare/2.3.1...2.3.2 [2.3.1]: https://github.com/WaniKani/WanaKana/compare/2.3.0...2.3.1 [2.3.0]: https://github.com/WaniKani/WanaKana/compare/2.2.4...2.3.0 [2.2.4]: https://github.com/WaniKani/WanaKana/compare/2.2.3...2.2.4 [2.2.3]: https://github.com/WaniKani/WanaKana/compare/2.2.2...2.2.3 [2.2.2]: https://github.com/WaniKani/WanaKana/compare/2.2.1...2.2.2 [2.2.1]: https://github.com/WaniKani/WanaKana/compare/2.2.0...2.2.1 [2.2.0]: https://github.com/WaniKani/WanaKana/compare/2.1.0...2.2.0 [2.1.0]: https://github.com/WaniKani/WanaKana/compare/2.0.4...2.1.0 [2.0.4]: https://github.com/WaniKani/WanaKana/compare/2.0.3...2.0.4 [2.0.3]: https://github.com/WaniKani/WanaKana/compare/2.0.2...2.0.3 [2.0.2]: https://github.com/WaniKani/WanaKana/compare/2.0.1...2.0.2 [2.0.1]: https://github.com/WaniKani/WanaKana/compare/2.0.0...2.0.1 [2.0.0]: https://github.com/WaniKani/WanaKana/compare/1.3.7...2.0.0