Releases: WebCoder49/code-input
2.0.2
2.0.1
🆕 What's in this release?
This is a major release, with several aims:
- ⌨️ Make
<code-input>
work more like a<textarea>
, including more HTML form compatibility (demo) - thank you especially to @vanowm - 🧹 Add TypeScript support - please see WebCoder49/code-input-for-typescript
- 🎉 Keep adding optional plugins from the open-source community - please see plugins/README.md
(+bug fix for template not registering bug)
🔌 API Changes
⚠️ This section is only useful for library users transferring their code-input
version from v1.<something>
to v2.<something>
. If you're a new user, please see the README file; otherwise, please click.
code-input
version from v1.<something>
to v2.<something>
. If you're a new user, please see the README file; otherwise, please click.In order to carry out significant progress with the library, and in order to make the code cleaner, some changes have been made to how you should use the library. Methods from versions 1.*
still exist, but are deprecated so will not be improved.
General Changes
Reason | Old Usage | New Usage |
---|---|---|
To match <textarea> elements |
<code-input> value attribute for text content |
<code-input> inner HTML for text content (see README for usage) |
More intuitive for object-oriented programming and TypeScript | codeInput.templates.custom( ...) |
new codeInput.Template( ...) |
Clean, consistent code | codeInput.templates.character_limit() |
codeInput.templates.characterLimit() |
Clean, consistent code | codeInput.templates.rainbow_text( ...) |
codeInput.templates.rainbowText( ...) |
More Technical/Less-Used Changes
(click to view if you are building a code-input plugin or coming across bugs)
Reason | Old Usage | New Usage |
---|---|---|
Remove unnecessary function calls | <code-input element>.querySelector("textarea") |
<code-input element>.textareaElement |
Remove unnecessary function calls | <code-input element>.querySelector("pre") |
<code-input element>.preElement |
Remove unnecessary function calls | <code-input element>.querySelector("pre code") |
<code-input element>.codeElement |
More flexibility and fewer bugs when creating plugins | Plugin.observedAttributes = ["attrib1", "attrib2"] |
In constructor of plugin: super(["attrib1", "attrib2"]) |
More flexibility when creating plugins | All observed attributes detected exactly | * symbol represents wilcard = any piece of text (see Test plugin) |
Clean, consistent code | Other snake_case functions |
camelCase |
As always, if you find any bugs or have any ideas for new features, please submit an issue or pull request.
Full Changelog: v1.5.1...v2.0.1
2.0.0
1.5.1
📦 code-input
is now on NPM (link)!
Over time, this will allow the library to work better with people's ordinary workflow, and features like TypeScript compatibility.
As always, please submit an Issue or Pull Request if you find a bug or have an idea for a new feature.
1.5.0
🆕 What's in this release?
Thank you to @AzzaAzza69 for opening issue #40 . If you have an idea for a plugin, find a bug, or think that the <code-input>
element doesn't support something that a <textarea>
does and that would be useful, please contribute!
Full Changelog: v1.4.1...v1.5.0
1.4.1
🆕 What's in this release?
What's Changed
- Special character plugin in #37
- Very Quick Typo Fix
🎉 Thank you to @SArpnt for suggesting this feature. If you have any more ideas for features, plugins, or bug fixes, please open an issue or submit a pull request.
Full Changelog: v1.4.0...v1.4.1
1.4.0
🆕 What's in this release?
What's Changed
- Special character plugin in #37
Full Changelog: v1.3.1...v1.4.0
🎉 Thank you to @SArpnt for suggesting this feature. If you have any more ideas for features, plugins, or bug fixes, please open an issue or submit a pull request.
1.3.1
Bug Fix
What's Changed
- Remove selections after ENTER, so caret doesn't select new text. #35
Full Changelog: v1.3.0...v1.3.1
1.3.0
Bug Fixes / Optimisations
What's Changed
- Fix line-height bug & remove margin from code-input in #33 (issue #27)
- Change event transfer to work with add/removeEventListener in #34 (issue #28)
Full Changelog: v1.2.4...v1.3.0
🎉 Thank you to everyone who found bugs and contributed to this release. Please submit an issue or pull request if you find a bug or want a new feature / plugin.
1.2.4
Bug fixes for indent
plugin
What's Changed
- Tab and enter fixes by @WebCoder49 in #31
Full Changelog: v1.2.3...v1.2.4
Thank you to everyone who contributed code and issues for this. If you find any bugs or want any new features, please open an issue or pull request.