Socket
Socket
Sign inDemoInstall

quill

Package Overview
Dependencies
29
Maintainers
1
Versions
94
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.7 to 1.1.8

11

CHANGELOG.md

@@ -0,1 +1,12 @@

# 1.1.8
- Support pasting italics from Google Docs [#1185](https://github.com/quilljs/quill/issues/1185)
- Fix setting dropdown picker back to default [#1191](https://github.com/quilljs/quill/issues/1191)
- Fix code-block formatting on empty first line in Firefox [#1195](https://github.com/quilljs/quill/issues/1195)
- Prevent formatting via keyboard shortcuts when not whitelisted [#1197](https://github.com/quilljs/quill/issues/1197)
- Fix select-all copy and overwrite paste in Firefox [#1202](https://github.com/quilljs/quill/issues/1202)
Thank you [@adfaure](https://github.com/adfaure), [@berndschimmer](https://github.com/berndschimmer), [@CoenWarmer](https://github.com/CoenWarmer), [@montlebalm](https://github.com/montlebalm), and [@TraceyYau](https://github.com/TraceyYau) for contributions to this release!
# 1.1.7

@@ -2,0 +13,0 @@

7

core/quill.js

@@ -56,2 +56,3 @@ import './polyfill';

this.container = this.options.container;
this.scrollingContainer = this.options.scrollingContainer || document.body;
if (this.container == null) {

@@ -137,3 +138,5 @@ return debug.error('Invalid Quill container', container);

focus() {
let scrollTop = this.scrollingContainer.scrollTop;
this.selection.focus();
this.scrollingContainer.scrollTop = scrollTop;
this.selection.scrollIntoView();

@@ -403,6 +406,2 @@ }

}
if (range.index === 0 && range.length === 0) {
// Fixes cursor render bug in Chrome for code-block and checklist
this.setSelection(null, Emitter.sources.SILENT);
}
this.setSelection(range, Emitter.sources.SILENT);

@@ -409,0 +408,0 @@ }

@@ -61,5 +61,3 @@ import Parchment from 'parchment';

if (this.hasFocus()) return;
let bodyTop = document.body.scrollTop;
this.root.focus();
document.body.scrollTop = bodyTop;
this.setRange(this.savedRange);

@@ -69,2 +67,3 @@ }

format(format, value) {
if (this.scroll.whitelist != null && !this.scroll.whitelist[format]) return;
this.scroll.update();

@@ -194,2 +193,3 @@ let nativeRange = this.getNativeRange();

let start = Math.min(...indexes), end = Math.max(...indexes);
end = Math.min(end, this.scroll.length() - 1);
return [new Range(start, end-start), range];

@@ -224,6 +224,6 @@ }

if (!this.hasFocus()) this.root.focus();
let nativeRange = this.getNativeRange();
if (nativeRange == null || force ||
startNode !== nativeRange.start.node || startOffset !== nativeRange.start.offset ||
endNode !== nativeRange.end.node || endOffset !== nativeRange.end.offset) {
let native = (this.getNativeRange() || {}).native;
if (native == null || force ||
startNode !== native.startContainer || startOffset !== native.startOffset ||
endNode !== native.endContainer || endOffset !== native.endOffset) {
let range = document.createRange();

@@ -230,0 +230,0 @@ range.setStart(startNode, startOffset);

@@ -17,2 +17,6 @@ import Parchment from 'parchment';

canAdd(node, value) {
return super.canAdd(node, value) || super.canAdd(node, parseInt(value));
}
value(node) {

@@ -19,0 +23,0 @@ return parseInt(super.value(node)) || undefined; // Don't return NaN

@@ -61,3 +61,2 @@ import Delta from 'quill-delta';

this.matchers = [];
this.scrollingContainer = quill.options.scrollingContainer || document.body;
CLIPBOARD_CONFIG.concat(this.options.matchers).forEach((pair) => {

@@ -99,12 +98,12 @@ this.addMatcher(...pair);

let range = this.quill.getSelection();
let delta = new Delta().retain(range.index).delete(range.length);
let scrollTop = this.scrollingContainer.scrollTop;
let delta = new Delta().retain(range.index);
let scrollTop = this.quill.scrollingContainer.scrollTop;
this.container.focus();
setTimeout(() => {
this.quill.selection.update(Quill.sources.SILENT);
delta = delta.concat(this.convert());
delta = delta.concat(this.convert()).delete(range.length);
this.quill.updateContents(delta, Quill.sources.USER);
// range.length contributes to delta.length()
this.quill.setSelection(delta.length() - range.length, Quill.sources.SILENT);
this.scrollingContainer.scrollTop = scrollTop;
this.quill.scrollingContainer.scrollTop = scrollTop;
this.quill.selection.scrollIntoView();

@@ -266,2 +265,5 @@ }, 1);

let style = node.style || {};
if (style.fontStyle && computeStyle(node).fontStyle === 'italic') {
formats.italic = true;
}
if (style.fontWeight && computeStyle(node).fontWeight === 'bold') {

@@ -268,0 +270,0 @@ formats.bold = true;

@@ -115,3 +115,5 @@ import Delta from 'quill-delta';

let option;
if (range == null || formats[format] == null) {
if (range == null) {
option = null;
} else if (formats[format] == null) {
option = input.querySelector('option[selected]');

@@ -118,0 +120,0 @@ } else if (!Array.isArray(formats[format])) {

{
"name": "quill",
"version": "1.1.7",
"version": "1.1.8",
"description": "Your powerful, rich text editor",

@@ -39,3 +39,3 @@ "author": "Jason Chen <jhchen7@gmail.com>",

"extend": "~3.0.0",
"parchment": "1.0.6",
"parchment": "1.0.7",
"quill-delta": "3.4.3"

@@ -42,0 +42,0 @@ },

@@ -72,29 +72,25 @@ import DropdownIcon from '../assets/icons/dropdown.svg';

}
if (item != null) {
item.classList.add('ql-selected');
this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item);
if (item.hasAttribute('data-value')) {
this.label.setAttribute('data-value', item.getAttribute('data-value'));
} else {
this.label.removeAttribute('data-value');
}
if (item.hasAttribute('data-label')) {
this.label.setAttribute('data-label', item.getAttribute('data-label'));
} else {
this.label.removeAttribute('data-label');
}
if (trigger) {
if (typeof Event === 'function') {
this.select.dispatchEvent(new Event('change'));
} else if (typeof Event === 'object') { // IE11
let event = document.createEvent('Event');
event.initEvent('change', true, true);
this.select.dispatchEvent(event);
}
this.close();
}
if (item == null) return;
item.classList.add('ql-selected');
this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item);
if (item.hasAttribute('data-value')) {
this.label.setAttribute('data-value', item.getAttribute('data-value'));
} else {
this.label.removeAttribute('data-value');
}
if (item.hasAttribute('data-label')) {
this.label.setAttribute('data-label', item.getAttribute('data-label'));
} else {
this.label.removeAttribute('data-label');
}
if (trigger) {
if (typeof Event === 'function') {
this.select.dispatchEvent(new Event('change'));
} else if (typeof Event === 'object') { // IE11
let event = document.createEvent('Event');
event.initEvent('change', true, true);
this.select.dispatchEvent(event);
}
this.close();
}
}

@@ -101,0 +97,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 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc