Releases: FIameCaster/prism-code-editor
Release 1.0.2
Version 1.0.1 gave the search widget and copy button the same z-index. This change has been reversed so the search widget is always on top.
Release 1.0.1
- The background image on the unfold button no longer repeats vertically in Safari.
- A read-only editor's textarea no longer has
user-select: none
in Safari. - Slightly improved styling for the search widget.
Release 1.0.0
New fatures
Added a code folding extension supporting read-only editors. You can see it in action in the last example on the demo page.
import "prism-code-editor/code-folding.css"
import { readOnlyCodeFolding } from "prism-code-editor/code-folding"
Added a read-only property extensions
to the PrismEditor
interface. This property can be used to access many of the extensions added to the editor.
Ctrl+] / [ can now also be used to indent/outdent lines (Cmd+] / [ on Mac).
Added tag matching, selection match highlighting and read-only code folding to the read-only setup.
Breaking changes
The numLines
signature has been changed from: numLines: (str: string, position?: number) => number
to numLines: (str: string, start?: number, end?: number) => number
. This means that you'll need to change all calls to numLines
with 2 arguments.
The defaultCommands
extension's first argument has been removed since it's no longer necessary to pass the cursor extension to it.
The deprecated matchBrackets
extension has been removed and replaced by the new bracket matcher. If you're already using the new bracket matcher, you'll need to rename it from bracketMatcher
to matchBrackets
. If you're using the old one, you might need to change the arguments and add the highlightBracketPairs
extension.
--widget__bg-find
custom property used to color search matches has been renamed to --search__bg-find
.
Bug fixes
prism-code-editor/prism-markdown
andprism-code-editor/prism-core
are now properly marked as having side-effects in package.json.- Cursor position extension could incorrectly position the cursor with word wrap enabled.
- Empty search matches could be incorrectly positioned with word wrap enabled.
editor.value
could be stale when accessed in an extension update callback. This wasn't causing issues, but had the potensial to.- Extensions no longer update if
setOptions
throws an error due to passing an invalid language
Release 0.3.0
New bracket matcher:
The old bracket matcher has been replaced with a faster and smaller one. Rainbow brackets are now optional and highlighting the closest bracket pair is handled by a separate extension.
import { bracketMatcher } from "prism-code-editor/match-brackets"
import { highlightBracketPairs } from "prism-code-editor/highlight-brackets"
I would've preferred to have highlightBracketPairs
in the same package, but tree-shaking didn't work as expected when I did.
The old bracket matcher is kept for backwards compatibility, but is marked as deprecated and will be removed in the future.
Release 0.2.0
New features
Added a tag's ending position, its tag name and whether it's a self-closing tag to the tag matcher.
Fixes
Removed default button border from the copy button. This default border would only be present if there was no other CSS removing the border.
Release 0.1.1
Capitalized tags and fragments can now be matched together in JSX.
Release 0.1.0
New features:
- Added
tokens
as a read-only property to thePrismEditor
interface - Added a tag matching extension
import { createTagMatcher, matchTags } from "prism-code-editor/match-tags"
Fixes:
- Indentation guides now work properly without a monospace font
Minor changes:
--bg-indent-guide-active
custom property has been removed. To color the active indentation guide, do something like this:
.guide-indents .active {
--bg-guide-indent: #999;
}
Release 0.0.6
Improved searching:
- The textarea could still steal focus from the search widget in Safari. This has been fixed
- Fixed a typo in the search widget
- The error message when typing an invalid regular expression can no longer overflow
- Selection matches are now no longer highlighted while interacting with the search widget
Returning true
inside key/input commands now also calls Event.stopImmediatePropagation
Release 0.0.5
Improved search widget:
- Improved logic for next/previous match buttons.
- Fixed issue where the editor's textarea could steal the keyboard focus while interating with the search widget. This was most prevalent in Safari.
- Fixed keyboard shortcuts for Mac.
Release 0.0.4
Fixed missing declaration for setups (2b0eb85)