Comparing version 1.0.0-beta.4 to 1.0.0-beta.5
@@ -0,1 +1,20 @@ | ||
# 1.0.0-beta.5 | ||
Weekly beta preview release. | ||
### Features | ||
- Add blur() [#726](https://github.com/quilljs/quill/pull/726) | ||
### Bug Fixes | ||
- Fix null error [#728](https://github.com/quilljs/quill/issues/728) | ||
- Fix building with Node v6 [#732](https://github.com/quilljs/quill/issues/732) | ||
- Ensure button type for supplied buttons [#733](https://github.com/quilljs/quill/issues/733) | ||
- Fix line break pasting on Firefox [#735](https://github.com/quilljs/quill/issues/735) | ||
- Fix 'user' source on API calls [#739](https://github.com/quilljs/quill/issues/739) | ||
Thanks to [benbro](https://github.com/benbro), [lukechapman](https://github.com/lukechapman), [sachinrekhi](https://github.com/sachinrekhi), and [saw](https://github.com/saw) for their contributions to this release. | ||
# 1.0.0-beta.4 | ||
@@ -2,0 +21,0 @@ |
@@ -154,3 +154,3 @@ import Delta from 'rich-text/lib/delta'; | ||
removeFormat(index, length) { | ||
removeFormat(index, length, source) { | ||
let text = this.getText(index, length); | ||
@@ -166,3 +166,3 @@ let [line, offset] = this.scroll.line(index + length); | ||
let delta = new Delta().retain(index).concat(diff); | ||
this.applyDelta(delta); | ||
this.applyDelta(delta, source); | ||
} | ||
@@ -169,0 +169,0 @@ |
@@ -104,2 +104,6 @@ import './polyfill'; | ||
blur() { | ||
this.selection.setRange(null); | ||
} | ||
deleteText(index, length, source) { | ||
@@ -214,8 +218,8 @@ [index, length, , source] = overload(index, length, source); | ||
pasteHTML(index, html) { | ||
pasteHTML(index, html, source = Emitter.sources.API) { | ||
if (typeof index === 'string') { | ||
this.setContents(this.clipboard.convert(index)); | ||
this.setContents(this.clipboard.convert(index), html); | ||
} else { | ||
let paste = this.clipboard.convert(html); | ||
this.updateContents(new Delta().retain(index).concat(paste)); | ||
this.updateContents(new Delta().retain(index).concat(paste), source); | ||
} | ||
@@ -237,3 +241,3 @@ } | ||
delta.delete(this.getLength()); | ||
this.editor.applyDelta(delta); | ||
this.editor.applyDelta(delta, source); | ||
} | ||
@@ -240,0 +244,0 @@ |
@@ -82,2 +82,5 @@ import Parchment from 'parchment'; | ||
getBounds(index, length = 0) { | ||
let scrollLength = this.scroll.length(); | ||
index = Math.min(index, scrollLength - 1); | ||
length = Math.min(index + length, scrollLength - 1) - index; | ||
let bounds, node, [leaf, offset] = this.scroll.leaf(index); | ||
@@ -196,2 +199,3 @@ if (leaf == null) return null; | ||
let bounds = this.getBounds(range.index, range.length); | ||
if (bounds == null) return; | ||
if (this.root.offsetHeight < bounds.bottom) { | ||
@@ -198,0 +202,0 @@ let [line, offset] = this.scroll.line(range.index + range.length); |
@@ -170,2 +170,3 @@ import Delta from 'rich-text/lib/delta'; | ||
[Node.TEXT_NODE, matchText], | ||
['br', matchBreak], | ||
[Node.ELEMENT_NODE, matchNewline], | ||
@@ -246,2 +247,9 @@ [Node.ELEMENT_NODE, matchBlot], | ||
function matchBreak(node, delta) { | ||
if (!deltaEndsWith(delta, '\n')) { | ||
delta.insert('\n'); | ||
} | ||
return delta; | ||
} | ||
function matchNewline(node, delta) { | ||
@@ -248,0 +256,0 @@ if (!isLine(node)) return delta; |
@@ -191,5 +191,5 @@ import clone from 'clone'; | ||
function(range, context) { | ||
this.quill.format('list', false); | ||
this.quill.format('list', false, Quill.sources.USER); | ||
if (context.format.indent) { | ||
this.quill.format('indent', false); | ||
this.quill.format('indent', false, Quill.sources.USER); | ||
} | ||
@@ -196,0 +196,0 @@ } |
@@ -53,2 +53,5 @@ import extend from 'extend'; | ||
format = format.slice('ql-'.length); | ||
if (input.tagName === 'BUTTON') { | ||
input.setAttribute('type', 'button'); | ||
} | ||
if (this.handlers[format] == null) { | ||
@@ -86,2 +89,4 @@ if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) { | ||
} | ||
let [range, ] = this.quill.selection.getRange(); | ||
this.update(range); | ||
}); | ||
@@ -88,0 +93,0 @@ }); |
{ | ||
"name": "quill", | ||
"version": "1.0.0-beta.4", | ||
"version": "1.0.0-beta.5", | ||
"description": "Cross browser rich text editor", | ||
@@ -5,0 +5,0 @@ "author": "Jason Chen <jhchen7@gmail.com>", |
@@ -74,2 +74,3 @@ import DropdownIcon from '../assets/icons/dropdown.svg'; | ||
let selected = this.container.querySelector('.ql-selected'); | ||
if (item === selected) return this.close(); | ||
if (selected != null) { | ||
@@ -76,0 +77,0 @@ selected.classList.remove('ql-selected'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
611341
13500
134
1
0