Comparing version 1.0.0-rc.2 to 1.0.0-rc.3
@@ -5,2 +5,3 @@ import Parchment from 'parchment'; | ||
import Container from './container'; | ||
import CodeBlock from '../formats/code'; | ||
@@ -32,6 +33,9 @@ | ||
!(first instanceof BlockEmbed) && !(last instanceof BlockEmbed)) { | ||
last.moveChildren(first); | ||
last.remove(); | ||
this.optimize(); | ||
if (last instanceof CodeBlock) { | ||
last.deleteAt(last.length() - 1, 1); | ||
} | ||
first.moveChildren(last, last.children.head); | ||
first.remove(); | ||
} | ||
this.optimize(); | ||
} | ||
@@ -42,2 +46,3 @@ | ||
super.formatAt(index, length, format, value); | ||
this.optimize(); | ||
} | ||
@@ -59,6 +64,6 @@ | ||
} | ||
this.optimize(); | ||
} else { | ||
super.insertAt(index, value, def); | ||
} | ||
this.optimize(); | ||
} | ||
@@ -65,0 +70,0 @@ |
@@ -0,1 +1,17 @@ | ||
# 1.0.0-rc.3 | ||
A few bug fixes, one with with possibly significant implications. See the [issue #889](https://github.com/quilljs/quill/issues/889) and [commit fix](https://github.com/quilljs/quill/commit/be24c62a6234818548658fcb5e1935a0c07b4eb7) for more details. | ||
### Bug Fixes | ||
- Fix indenting beyond first level with toolbar [#882](https://github.com/quilljs/quill/issues/882) | ||
- Fix toolbar font/size display on Safari [#884](https://github.com/quilljs/quill/issues/884) | ||
- Fix pasting from Gmail from on different browser [#886](https://github.com/quilljs/quill/issues/886) | ||
- Fix undo/redo consistency [#889](https://github.com/quilljs/quill/issues/889) | ||
- Fix null error when selecting all on Firefox [#891](https://github.com/quilljs/quill/issues/891) | ||
- Fix merging keyboard options twice [#897](https://github.com/quilljs/quill/issues/897) | ||
Thank you [@benbro](https://github.com/benbro), [@cgilboy](https://github.com/cgilboy), [@cutteroid](https://github.com/cutteroid), and [@routman](https://github.com/routman) for contributions to this release! | ||
# 1.0.0-rc.2 | ||
@@ -2,0 +18,0 @@ |
@@ -81,3 +81,3 @@ import './polyfill'; | ||
if (options.placeholder) { | ||
this.root.dataset.placeholder = options.placeholder; | ||
this.root.setAttribute('data-placeholder', options.placeholder); | ||
} | ||
@@ -84,0 +84,0 @@ this.root.classList.toggle('ql-blank', this.editor.isBlank()); |
@@ -198,6 +198,6 @@ import Parchment from 'parchment'; | ||
if (this.root.offsetHeight < bounds.bottom) { | ||
let [line, ] = this.scroll.line(range.index + range.length); | ||
let [line, ] = this.scroll.line(Math.min(range.index + range.length, this.scroll.length()-1)); | ||
this.root.scrollTop = line.domNode.offsetTop + line.domNode.offsetHeight - this.root.offsetHeight; | ||
} else if (bounds.top < 0) { | ||
let [line, ] = this.scroll.line(range.index); | ||
let [line, ] = this.scroll.line(Math.min(range.index, this.scroll.length()-1)); | ||
this.root.scrollTop = line.domNode.offsetTop; | ||
@@ -204,0 +204,0 @@ } |
@@ -119,18 +119,6 @@ import Delta from 'rich-text/lib/delta'; | ||
let delta = new Delta().retain(range.index).delete(range.length); | ||
let types = e.clipboardData.types; | ||
if ((types instanceof DOMStringList && types.contains("text/html")) || | ||
(types.indexOf && types.indexOf('text/html') !== -1)) { | ||
this.container.innerHTML = e.clipboardData.getData('text/html'); | ||
paste.call(this); | ||
e.preventDefault(); | ||
} else { | ||
let bodyTop = document.body.scrollTop; | ||
this.container.focus(); | ||
setTimeout(() => { | ||
paste.call(this); | ||
document.body.scrollTop = bodyTop; | ||
this.quill.selection.scrollIntoView(); | ||
}, 1); | ||
} | ||
function paste() { | ||
let types = e.clipboardData ? e.clipboardData.types : null; | ||
let bodyTop = document.body.scrollTop; | ||
this.container.focus(); | ||
setTimeout(() => { | ||
delta = delta.concat(this.convert()); | ||
@@ -140,3 +128,5 @@ this.quill.updateContents(delta, Quill.sources.USER); | ||
this.quill.setSelection(delta.length() - range.length, Quill.sources.SILENT); | ||
} | ||
document.body.scrollTop = bodyTop; | ||
this.quill.selection.scrollIntoView(); | ||
}, 1); | ||
} | ||
@@ -143,0 +133,0 @@ } |
@@ -10,3 +10,3 @@ import Embed from '../blots/embed'; | ||
katex.render(value, node); | ||
node.dataset.value = value; | ||
node.setAttribute('data-value', value); | ||
} | ||
@@ -18,3 +18,3 @@ node.setAttribute('contenteditable', false); | ||
static value(domNode) { | ||
return domNode.dataset.value; | ||
return domNode.getAttribute('data-value'); | ||
} | ||
@@ -21,0 +21,0 @@ |
@@ -30,3 +30,2 @@ import clone from 'clone'; | ||
super(quill, options); | ||
this.options.bindings = extend({}, Keyboard.DEFAULTS.bindings, options.bindings); | ||
this.bindings = {}; | ||
@@ -33,0 +32,0 @@ Object.keys(this.options.bindings).forEach((name) => { |
@@ -126,3 +126,3 @@ import extend from 'extend'; | ||
if (typeof value === 'string') { | ||
value = value.replace(/\"/g, '"'); | ||
value = value.replace(/\"/g, '\\"'); | ||
} | ||
@@ -143,3 +143,6 @@ option = input.querySelector(`option[value="${value}"]`); | ||
// '1' should match with 1 (headers) | ||
input.classList.toggle('ql-active', formats[format] == input.value || (formats[format] == null && !input.value)); | ||
let isActive = formats[format] === input.getAttribute('value') || | ||
(formats[format] != null && formats[format].toString() === input.getAttribute('value')) || | ||
(formats[format] == null && !input.getAttribute('value')); | ||
input.classList.toggle('ql-active', isActive); | ||
} else { | ||
@@ -146,0 +149,0 @@ input.classList.toggle('ql-active', formats[format] != null); |
{ | ||
"name": "quill", | ||
"version": "1.0.0-rc.2", | ||
"version": "1.0.0-rc.3", | ||
"description": "Cross browser rich text editor", | ||
@@ -39,11 +39,11 @@ "author": "Jason Chen <jhchen7@gmail.com>", | ||
"extend": "~3.0.0", | ||
"parchment": "1.0.0-rc.1", | ||
"parchment": "1.0.0-rc.2", | ||
"rich-text": "~3.0.2" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.10.4", | ||
"babel-loader": "^6.2.4", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.10.3", | ||
"babel-preset-es2015": "^6.9.0", | ||
"css-loader": "~0.23.1", | ||
"babel-core": "^6.14.0", | ||
"babel-loader": "^6.2.5", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.11.5", | ||
"babel-preset-es2015": "^6.14.0", | ||
"css-loader": "~0.24.0", | ||
"extract-text-webpack-plugin": "^1.0.1", | ||
@@ -54,19 +54,19 @@ "html-loader": "~0.4.3", | ||
"jasmine-core": "^2.4.1", | ||
"karma": "^1.1.1", | ||
"karma-chrome-launcher": "^1.0.1", | ||
"karma-coverage": "^1.1.0", | ||
"karma": "^1.2.0", | ||
"karma-chrome-launcher": "^2.0.0", | ||
"karma-coverage": "^1.1.1", | ||
"karma-jasmine": "^1.0.2", | ||
"karma-sauce-launcher": "^1.0.0", | ||
"lodash": "^4.13.1", | ||
"lodash": "^4.15.0", | ||
"quill-docs": "quilljs/quilljs.github.io.git#1.0", | ||
"style-loader": "~0.13.1", | ||
"stylus": "~0.54.5", | ||
"stylus-loader": "^2.1.1", | ||
"stylus-loader": "^2.3.1", | ||
"ts-loader": "~0.8.2", | ||
"typescript": "^1.8.10", | ||
"wdio-jasmine-framework": "~0.2.3", | ||
"webdriver-manager": "^10.2.0", | ||
"webdriverio": "^4.1.1", | ||
"webpack": "^1.13.1", | ||
"webpack-dev-server": "^1.14.1" | ||
"wdio-jasmine-framework": "~0.2.5", | ||
"webdriver-manager": "^10.2.3", | ||
"webdriverio": "^4.2.8", | ||
"webpack": "^1.13.2", | ||
"webpack-dev-server": "^1.15.0" | ||
}, | ||
@@ -73,0 +73,0 @@ "license": "BSD-3-Clause", |
@@ -186,3 +186,3 @@ import extend from 'extend'; | ||
this.textbox.value = preview; | ||
} else if (mode !== this.root.dataset.mode) { | ||
} else if (mode !== this.root.getAttribute('data-mode')) { | ||
this.textbox.value = ''; | ||
@@ -192,4 +192,4 @@ } | ||
this.textbox.select(); | ||
this.textbox.setAttribute('placeholder', this.textbox.dataset[mode] || ''); | ||
this.root.dataset.mode = mode; | ||
this.textbox.setAttribute('placeholder', this.textbox.getAttribute(`data-${mode}`) || ''); | ||
this.root.setAttribute('data-mode', mode); | ||
} | ||
@@ -205,3 +205,3 @@ | ||
let value = this.textbox.value; | ||
switch(this.root.dataset.mode) { | ||
switch(this.root.getAttribute('data-mode')) { | ||
case 'link': | ||
@@ -231,4 +231,4 @@ let scrollTop = this.quill.root.scrollTop; | ||
if (range != null) { | ||
this.quill.insertEmbed(index, this.root.dataset.mode, value, Emitter.sources.USER); | ||
if (this.root.dataset.mode === 'formula') { | ||
this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, Emitter.sources.USER); | ||
if (this.root.getAttribute('data-mode') === 'formula') { | ||
this.quill.insertText(index + 1, ' ', Emitter.sources.USER); | ||
@@ -235,0 +235,0 @@ } |
@@ -106,5 +106,3 @@ import extend from 'extend'; | ||
super.show(); | ||
if (this.root.dataset.mode) { | ||
delete this.root.dataset.mode; | ||
} | ||
this.root.removeAttribute('data-mode'); | ||
} | ||
@@ -111,0 +109,0 @@ } |
@@ -23,3 +23,3 @@ import Picker from './picker'; | ||
let colorLabel = this.label.querySelector('.ql-color-label'); | ||
let value = item ? item.dataset.value || '' : ''; | ||
let value = item ? item.getAttribute('data-value') || '' : ''; | ||
if (colorLabel) { | ||
@@ -26,0 +26,0 @@ if (colorLabel.tagName === 'line') { |
@@ -9,3 +9,3 @@ import Picker from './picker'; | ||
[].forEach.call(this.container.querySelectorAll('.ql-picker-item'), (item) => { | ||
item.innerHTML = icons[item.dataset.value || '']; | ||
item.innerHTML = icons[item.getAttribute('data-value') || '']; | ||
}); | ||
@@ -12,0 +12,0 @@ this.defaultItem = this.container.querySelector('.ql-selected'); |
@@ -21,6 +21,6 @@ import DropdownIcon from '../assets/icons/dropdown.svg'; | ||
if (option.hasAttribute('value')) { | ||
item.dataset.value = option.getAttribute('value'); | ||
item.setAttribute('data-value', option.getAttribute('value')); | ||
} | ||
if (option.textContent) { | ||
item.dataset.label = option.textContent; | ||
item.setAttribute('data-label', option.textContent); | ||
} | ||
@@ -76,11 +76,11 @@ item.addEventListener('click', (event) => { | ||
this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item); | ||
if (item.dataset.value) { | ||
this.label.dataset.value = item.dataset.value; | ||
} else if (this.label.dataset.value) { | ||
delete this.label.dataset.value; | ||
if (item.hasAttribute('data-value')) { | ||
this.label.setAttribute('data-value', item.getAttribute('data-value')); | ||
} else { | ||
this.label.removeAttribute('data-value'); | ||
} | ||
if (item.dataset.label) { | ||
this.label.dataset.label = item.dataset.label; | ||
} else if (this.label.dataset.label) { | ||
delete this.label.dataset.label; | ||
if (item.hasAttribute('data-label')) { | ||
this.label.setAttribute('data-label', item.getAttribute('data-label')); | ||
} else { | ||
this.label.removeAttribute('data-label'); | ||
} | ||
@@ -98,4 +98,4 @@ if (trigger) { | ||
} else { | ||
if (this.label.dataset.value) delete this.label.dataset.value; | ||
if (this.label.dataset.label) delete this.label.dataset.label; | ||
this.label.removeAttribute('data-value'); | ||
this.label.removeAttribute('data-label'); | ||
} | ||
@@ -102,0 +102,0 @@ } |
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 too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
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
2021153
21406
+ Addedparchment@1.0.0-rc.2(transitive)
- Removedparchment@1.0.0-rc.1(transitive)
Updatedparchment@1.0.0-rc.2