From d69d5a9bc4d7e53d7a62e63a9be74a122f4def30 Mon Sep 17 00:00:00 2001 From: hoavm Date: Tue, 1 Oct 2024 17:41:46 +0700 Subject: [PATCH 1/8] minor update --- packages/quill/package.json | 4 +-- packages/quill/src/formats/video.ts | 43 +++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/packages/quill/package.json b/packages/quill/package.json index 1ce5f24dc5..dd2ff1884c 100644 --- a/packages/quill/package.json +++ b/packages/quill/package.json @@ -1,6 +1,6 @@ { - "name": "quill", - "version": "2.0.2", + "name": "hoavm-quill", + "version": "2.0.2-alpha1.13", "description": "Your powerful, rich text editor", "author": "Jason Chen ", "homepage": "https://quilljs.com", diff --git a/packages/quill/src/formats/video.ts b/packages/quill/src/formats/video.ts index 84d4bb15cf..b3e1db9b4b 100644 --- a/packages/quill/src/formats/video.ts +++ b/packages/quill/src/formats/video.ts @@ -1,22 +1,40 @@ import { BlockEmbed } from '../blots/block.js'; import Link from './link.js'; -const ATTRIBUTES = ['height', 'width']; +const ATTRIBUTES = [ + 'title', + 'sandbox', + 'referrerpolicy', + 'name', + 'src', + 'srcdoc', + 'width', + 'height', + 'frameborder', + 'allowfullscreen', + 'allow', + 'loading', + 'allowpaymentrequest', +]; class Video extends BlockEmbed { static blotName = 'video'; static className = 'ql-video'; static tagName = 'IFRAME'; - static create(value: string) { - const node = super.create(value) as Element; - node.setAttribute('frameborder', '0'); - node.setAttribute('allowfullscreen', 'true'); - node.setAttribute('src', this.sanitize(value)); + static create(value: any) { + console.log('formats', value); + const node = document.createElement('iframe'); + ATTRIBUTES.forEach((attr) => { + if (value[attr]) { + node.setAttribute(attr, value[attr]); + } + }); return node; } static formats(domNode: Element) { + console.log('formats', domNode); return ATTRIBUTES.reduce( (formats: Record, attribute) => { if (domNode.hasAttribute(attribute)) { @@ -33,12 +51,17 @@ class Video extends BlockEmbed { } static value(domNode: Element) { - return domNode.getAttribute('src'); + console.log('value', domNode); + return ATTRIBUTES.reduce((acc: any, attr) => { + acc[attr] = domNode.getAttribute(attr); + return acc; + }, {}); } domNode: HTMLVideoElement; format(name: string, value: string) { + console.log('format', name, value); if (ATTRIBUTES.indexOf(name) > -1) { if (value) { this.domNode.setAttribute(name, value); @@ -51,8 +74,10 @@ class Video extends BlockEmbed { } html() { - const { video } = this.value(); - return `${video}`; + console.log('html', this.value()); + console.log('html', this.domNode); + console.log('html', Video.create(this.value().video)); + return Video.create(this.value().video).outerHTML; } } From 7f5a1f090c3d074a4e70963932db5dae731de8a5 Mon Sep 17 00:00:00 2001 From: hoavm Date: Tue, 1 Oct 2024 17:42:52 +0700 Subject: [PATCH 2/8] minor update --- packages/quill/src/formats/video.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/quill/src/formats/video.ts b/packages/quill/src/formats/video.ts index b3e1db9b4b..742b3672e1 100644 --- a/packages/quill/src/formats/video.ts +++ b/packages/quill/src/formats/video.ts @@ -74,7 +74,7 @@ class Video extends BlockEmbed { } html() { - console.log('html', this.value()); + console.log('html1', this.value()); console.log('html', this.domNode); console.log('html', Video.create(this.value().video)); return Video.create(this.value().video).outerHTML; From 60ff1eccc1531436c1c8d4391c227ab7e9310c18 Mon Sep 17 00:00:00 2001 From: hoavm Date: Tue, 1 Oct 2024 18:02:59 +0700 Subject: [PATCH 3/8] minor clean --- packages/quill/src/formats/video.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/packages/quill/src/formats/video.ts b/packages/quill/src/formats/video.ts index 742b3672e1..fd9c1198a0 100644 --- a/packages/quill/src/formats/video.ts +++ b/packages/quill/src/formats/video.ts @@ -23,7 +23,6 @@ class Video extends BlockEmbed { static tagName = 'IFRAME'; static create(value: any) { - console.log('formats', value); const node = document.createElement('iframe'); ATTRIBUTES.forEach((attr) => { if (value[attr]) { @@ -34,7 +33,6 @@ class Video extends BlockEmbed { } static formats(domNode: Element) { - console.log('formats', domNode); return ATTRIBUTES.reduce( (formats: Record, attribute) => { if (domNode.hasAttribute(attribute)) { @@ -51,7 +49,6 @@ class Video extends BlockEmbed { } static value(domNode: Element) { - console.log('value', domNode); return ATTRIBUTES.reduce((acc: any, attr) => { acc[attr] = domNode.getAttribute(attr); return acc; @@ -61,7 +58,6 @@ class Video extends BlockEmbed { domNode: HTMLVideoElement; format(name: string, value: string) { - console.log('format', name, value); if (ATTRIBUTES.indexOf(name) > -1) { if (value) { this.domNode.setAttribute(name, value); @@ -74,9 +70,6 @@ class Video extends BlockEmbed { } html() { - console.log('html1', this.value()); - console.log('html', this.domNode); - console.log('html', Video.create(this.value().video)); return Video.create(this.value().video).outerHTML; } } From 91dbff785a40956fa61d7a74c1b88d7201002812 Mon Sep 17 00:00:00 2001 From: hoavm Date: Wed, 2 Oct 2024 09:46:22 +0700 Subject: [PATCH 4/8] minor update --- packages/quill/package.json | 2 +- packages/quill/src/formats/font.ts | 9 ++++- packages/quill/src/formats/image.ts | 48 +++++++++++++++++----- packages/quill/src/formats/link.ts | 54 ++++++++++++++++++++----- packages/quill/src/formats/list.ts | 52 +++++++++++++++--------- packages/quill/src/formats/scriptTag.ts | 28 +++++++++++++ packages/quill/src/formats/size.ts | 2 +- packages/quill/src/formats/video.ts | 18 ++++++--- packages/quill/src/quill.ts | 2 + 9 files changed, 170 insertions(+), 45 deletions(-) create mode 100644 packages/quill/src/formats/scriptTag.ts diff --git a/packages/quill/package.json b/packages/quill/package.json index dd2ff1884c..4d2a9d9c3b 100644 --- a/packages/quill/package.json +++ b/packages/quill/package.json @@ -1,6 +1,6 @@ { "name": "hoavm-quill", - "version": "2.0.2-alpha1.13", + "version": "2.0.2-alpha1.15", "description": "Your powerful, rich text editor", "author": "Jason Chen ", "homepage": "https://quilljs.com", diff --git a/packages/quill/src/formats/font.ts b/packages/quill/src/formats/font.ts index 3a08604e13..629ec972d4 100644 --- a/packages/quill/src/formats/font.ts +++ b/packages/quill/src/formats/font.ts @@ -2,7 +2,14 @@ import { ClassAttributor, Scope, StyleAttributor } from 'parchment'; const config = { scope: Scope.INLINE, - whitelist: ['serif', 'monospace'], + whitelist: [ + 'arial', + 'comic-sans', + 'courier-new', + 'georgia', + 'helvetica', + 'lucida', + ], }; const FontClass = new ClassAttributor('font', 'ql-font', config); diff --git a/packages/quill/src/formats/image.ts b/packages/quill/src/formats/image.ts index e68f56a0b3..81aaadc694 100644 --- a/packages/quill/src/formats/image.ts +++ b/packages/quill/src/formats/image.ts @@ -1,17 +1,44 @@ import { EmbedBlot } from 'parchment'; -import { sanitize } from './link.js'; +// import { sanitize } from './link.js'; -const ATTRIBUTES = ['alt', 'height', 'width']; +const ATTRIBUTES = [ + 'alt', + 'height', + 'width', + 'src', + 'srcset', + 'sizes', + 'crossorigin', + 'usemap', + 'ismap', + 'loading', + 'referrerpolicy', + 'decoding', + 'longdesc', + 'title', + 'class', + 'id', + 'style', + 'tabindex', + 'draggable', + 'align', + 'border', + 'hspace', + 'vspace', + 'accesskey', +]; class Image extends EmbedBlot { static blotName = 'image'; static tagName = 'IMG'; - static create(value: string) { - const node = super.create(value) as Element; - if (typeof value === 'string') { - node.setAttribute('src', this.sanitize(value)); - } + static create(value: any) { + const node = document.createElement('img'); + ATTRIBUTES.forEach((attr) => { + if (value[attr]) { + node.setAttribute(attr, value[attr]); + } + }); return node; } @@ -32,11 +59,14 @@ class Image extends EmbedBlot { } static sanitize(url: string) { - return sanitize(url, ['http', 'https', 'data']) ? url : '//:0'; + return url; } static value(domNode: Element) { - return domNode.getAttribute('src'); + return ATTRIBUTES.reduce((acc: any, attr) => { + acc[attr] = domNode.getAttribute(attr); + return acc; + }, {}); } domNode: HTMLImageElement; diff --git a/packages/quill/src/formats/link.ts b/packages/quill/src/formats/link.ts index 5412355b85..687a0fb790 100644 --- a/packages/quill/src/formats/link.ts +++ b/packages/quill/src/formats/link.ts @@ -7,29 +7,65 @@ class Link extends Inline { static PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel', 'sms']; static create(value: string) { - const node = super.create(value) as HTMLElement; - node.setAttribute('href', this.sanitize(value)); - node.setAttribute('rel', 'noopener noreferrer'); - node.setAttribute('target', '_blank'); + const node = super.create(); + let newValue; + if (isStringified(value)) { + newValue = JSON.parse(value); + } else { + newValue = value; + } + + if (typeof newValue !== 'string') { + ['href', 'target', 'title'].forEach((attr) => { + if (newValue[attr]) node.setAttribute(attr, newValue[attr]); + }); + return node; + } + + node.setAttribute('href', newValue); return node; } static formats(domNode: HTMLElement) { - return domNode.getAttribute('href'); + return JSON.stringify({ + href: domNode.getAttribute('href'), + target: domNode.getAttribute('target'), + title: domNode.getAttribute('title'), + }); } static sanitize(url: string) { return sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL; } - format(name: string, value: unknown) { + format(name: string, value: any) { if (name !== this.statics.blotName || !value) { - super.format(name, value); + return super.format(name, value); + } + let newValue; + if (isStringified(value)) { + newValue = JSON.parse(value); } else { - // @ts-expect-error - this.domNode.setAttribute('href', this.constructor.sanitize(value)); + newValue = value; } + + if (typeof newValue !== 'string') { + this.domNode.setAttribute('href', newValue.href); + this.domNode.setAttribute('target', newValue.target); + this.domNode.setAttribute('title', newValue.title); + } else { + this.domNode.setAttribute('href', newValue); + } + } +} + +function isStringified(value: any) { + try { + JSON.parse(value); + } catch (e) { + return false; } + return true; } function sanitize(url: string, protocols: string[]) { diff --git a/packages/quill/src/formats/list.ts b/packages/quill/src/formats/list.ts index ed1352fb19..ef9ffbf732 100644 --- a/packages/quill/src/formats/list.ts +++ b/packages/quill/src/formats/list.ts @@ -5,7 +5,7 @@ import Quill from '../core/quill.js'; class ListContainer extends Container {} ListContainer.blotName = 'list-container'; -ListContainer.tagName = 'OL'; +ListContainer.tagName = ['OL', 'UL']; // Support both ordered and unordered lists class ListItem extends Block { static create(value: string) { @@ -15,7 +15,11 @@ class ListItem extends Block { } static formats(domNode: HTMLElement) { - return domNode.getAttribute('data-list') || undefined; + // Handle more formats for list types: ordered, unordered, checked, unchecked + const format = domNode.getAttribute('data-list') || ''; + return ['ordered', 'bullet', 'checked', 'unchecked'].includes(format) + ? format + : undefined; } static register() { @@ -24,26 +28,37 @@ class ListItem extends Block { constructor(scroll: Scroll, domNode: HTMLElement) { super(scroll, domNode); - const ui = domNode.ownerDocument.createElement('span'); - const listEventHandler = (e: Event) => { - if (!scroll.isEnabled()) return; - const format = this.statics.formats(domNode, scroll); - if (format === 'checked') { - this.format('list', 'unchecked'); - e.preventDefault(); - } else if (format === 'unchecked') { - this.format('list', 'checked'); - e.preventDefault(); - } - }; - ui.addEventListener('mousedown', listEventHandler); - ui.addEventListener('touchstart', listEventHandler); - this.attachUI(ui); + const format = this.statics.formats(domNode); + + // Create UI for checkbox if the list format is checked or unchecked + if (['checked', 'unchecked'].includes(format)) { + const ui = domNode.ownerDocument.createElement('span'); + ui.classList.add('list-ui'); // Add a CSS class for styling + + const listEventHandler = (e: Event) => { + if (!scroll.isEnabled()) return; + + if (format === 'checked') { + this.format('list', 'unchecked'); + e.preventDefault(); + } else if (format === 'unchecked') { + this.format('list', 'checked'); + e.preventDefault(); + } + }; + + ui.addEventListener('mousedown', listEventHandler); + ui.addEventListener('touchstart', listEventHandler); + this.attachUI(ui); + } } format(name: string, value: string) { + // Extend format handling to include more list types if (name === this.statics.blotName && value) { - this.domNode.setAttribute('data-list', value); + if (['ordered', 'bullet', 'checked', 'unchecked'].includes(value)) { + this.domNode.setAttribute('data-list', value); + } } else { super.format(name, value); } @@ -52,6 +67,7 @@ class ListItem extends Block { ListItem.blotName = 'list'; ListItem.tagName = 'LI'; +// Allow both ordered (OL) and unordered (UL) containers ListContainer.allowedChildren = [ListItem]; ListItem.requiredContainer = ListContainer; diff --git a/packages/quill/src/formats/scriptTag.ts b/packages/quill/src/formats/scriptTag.ts new file mode 100644 index 0000000000..10d11251bd --- /dev/null +++ b/packages/quill/src/formats/scriptTag.ts @@ -0,0 +1,28 @@ +import Block from '../blots/block.js'; + +class ScriptTag extends Block { + static blotName = 'script'; + static tagName = 'SCRIPT'; + + static insertAt() { + return; + } + + static insertBefore() { + return; + } + + static replaceWith() { + return; + } + + format() { + return; + } + + formatAt() { + return; + } +} + +export default ScriptTag; diff --git a/packages/quill/src/formats/size.ts b/packages/quill/src/formats/size.ts index 1f84a6f4e4..b33b86d7a5 100644 --- a/packages/quill/src/formats/size.ts +++ b/packages/quill/src/formats/size.ts @@ -2,7 +2,7 @@ import { ClassAttributor, Scope, StyleAttributor } from 'parchment'; const SizeClass = new ClassAttributor('size', 'ql-size', { scope: Scope.INLINE, - whitelist: ['small', 'large', 'huge'], + whitelist: ['extra-small', 'small', 'medium', 'large'], }); const SizeStyle = new StyleAttributor('size', 'font-size', { scope: Scope.INLINE, diff --git a/packages/quill/src/formats/video.ts b/packages/quill/src/formats/video.ts index fd9c1198a0..551907f6e8 100644 --- a/packages/quill/src/formats/video.ts +++ b/packages/quill/src/formats/video.ts @@ -2,19 +2,25 @@ import { BlockEmbed } from '../blots/block.js'; import Link from './link.js'; const ATTRIBUTES = [ - 'title', - 'sandbox', - 'referrerpolicy', - 'name', 'src', 'srcdoc', + 'name', 'width', 'height', 'frameborder', - 'allowfullscreen', 'allow', + 'allowfullscreen', + 'sandbox', + 'referrerpolicy', 'loading', - 'allowpaymentrequest', + 'longdesc', + 'title', + 'class', + 'id', + 'style', + 'tabindex', + 'draggable', + 'scrolling', ]; class Video extends BlockEmbed { diff --git a/packages/quill/src/quill.ts b/packages/quill/src/quill.ts index 9ae4198430..0366c68512 100644 --- a/packages/quill/src/quill.ts +++ b/packages/quill/src/quill.ts @@ -30,6 +30,7 @@ import Link from './formats/link.js'; import Script from './formats/script.js'; import Strike from './formats/strike.js'; import Underline from './formats/underline.js'; +import ScriptTag from './formats/scriptTag.js'; import Formula from './formats/formula.js'; import Image from './formats/image.js'; @@ -98,6 +99,7 @@ Quill.register( 'formats/formula': Formula, 'formats/image': Image, 'formats/video': Video, + 'formats/scriptTag': ScriptTag, 'modules/syntax': Syntax, 'modules/table': Table, From fd5f44b3185aca186feffe46a240be0138cddf92 Mon Sep 17 00:00:00 2001 From: hoavm Date: Wed, 2 Oct 2024 10:17:07 +0700 Subject: [PATCH 5/8] minor update --- packages/quill/package.json | 2 +- packages/quill/src/formats/list.ts | 52 +++++++++++------------------- 2 files changed, 19 insertions(+), 35 deletions(-) diff --git a/packages/quill/package.json b/packages/quill/package.json index 4d2a9d9c3b..a2a69f6c03 100644 --- a/packages/quill/package.json +++ b/packages/quill/package.json @@ -1,6 +1,6 @@ { "name": "hoavm-quill", - "version": "2.0.2-alpha1.15", + "version": "2.0.2-alpha1.16", "description": "Your powerful, rich text editor", "author": "Jason Chen ", "homepage": "https://quilljs.com", diff --git a/packages/quill/src/formats/list.ts b/packages/quill/src/formats/list.ts index ef9ffbf732..ed1352fb19 100644 --- a/packages/quill/src/formats/list.ts +++ b/packages/quill/src/formats/list.ts @@ -5,7 +5,7 @@ import Quill from '../core/quill.js'; class ListContainer extends Container {} ListContainer.blotName = 'list-container'; -ListContainer.tagName = ['OL', 'UL']; // Support both ordered and unordered lists +ListContainer.tagName = 'OL'; class ListItem extends Block { static create(value: string) { @@ -15,11 +15,7 @@ class ListItem extends Block { } static formats(domNode: HTMLElement) { - // Handle more formats for list types: ordered, unordered, checked, unchecked - const format = domNode.getAttribute('data-list') || ''; - return ['ordered', 'bullet', 'checked', 'unchecked'].includes(format) - ? format - : undefined; + return domNode.getAttribute('data-list') || undefined; } static register() { @@ -28,37 +24,26 @@ class ListItem extends Block { constructor(scroll: Scroll, domNode: HTMLElement) { super(scroll, domNode); - const format = this.statics.formats(domNode); - - // Create UI for checkbox if the list format is checked or unchecked - if (['checked', 'unchecked'].includes(format)) { - const ui = domNode.ownerDocument.createElement('span'); - ui.classList.add('list-ui'); // Add a CSS class for styling - - const listEventHandler = (e: Event) => { - if (!scroll.isEnabled()) return; - - if (format === 'checked') { - this.format('list', 'unchecked'); - e.preventDefault(); - } else if (format === 'unchecked') { - this.format('list', 'checked'); - e.preventDefault(); - } - }; - - ui.addEventListener('mousedown', listEventHandler); - ui.addEventListener('touchstart', listEventHandler); - this.attachUI(ui); - } + const ui = domNode.ownerDocument.createElement('span'); + const listEventHandler = (e: Event) => { + if (!scroll.isEnabled()) return; + const format = this.statics.formats(domNode, scroll); + if (format === 'checked') { + this.format('list', 'unchecked'); + e.preventDefault(); + } else if (format === 'unchecked') { + this.format('list', 'checked'); + e.preventDefault(); + } + }; + ui.addEventListener('mousedown', listEventHandler); + ui.addEventListener('touchstart', listEventHandler); + this.attachUI(ui); } format(name: string, value: string) { - // Extend format handling to include more list types if (name === this.statics.blotName && value) { - if (['ordered', 'bullet', 'checked', 'unchecked'].includes(value)) { - this.domNode.setAttribute('data-list', value); - } + this.domNode.setAttribute('data-list', value); } else { super.format(name, value); } @@ -67,7 +52,6 @@ class ListItem extends Block { ListItem.blotName = 'list'; ListItem.tagName = 'LI'; -// Allow both ordered (OL) and unordered (UL) containers ListContainer.allowedChildren = [ListItem]; ListItem.requiredContainer = ListContainer; From b91c347d5a6e55b1f12b601b37910b2f855d591d Mon Sep 17 00:00:00 2001 From: hoavm Date: Wed, 2 Oct 2024 10:22:41 +0700 Subject: [PATCH 6/8] minor update --- packages/quill/src/formats/scriptTag.ts | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/packages/quill/src/formats/scriptTag.ts b/packages/quill/src/formats/scriptTag.ts index 10d11251bd..e8ed649ba2 100644 --- a/packages/quill/src/formats/scriptTag.ts +++ b/packages/quill/src/formats/scriptTag.ts @@ -3,26 +3,6 @@ import Block from '../blots/block.js'; class ScriptTag extends Block { static blotName = 'script'; static tagName = 'SCRIPT'; - - static insertAt() { - return; - } - - static insertBefore() { - return; - } - - static replaceWith() { - return; - } - - format() { - return; - } - - formatAt() { - return; - } } export default ScriptTag; From 9426ea4b96769fe85e04eec292e6f53748670841 Mon Sep 17 00:00:00 2001 From: hoavm Date: Wed, 2 Oct 2024 14:04:29 +0700 Subject: [PATCH 7/8] minor update --- packages/quill/package.json | 2 +- packages/quill/src/formats/scriptTag.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/quill/package.json b/packages/quill/package.json index a2a69f6c03..93d79b25e0 100644 --- a/packages/quill/package.json +++ b/packages/quill/package.json @@ -1,6 +1,6 @@ { "name": "hoavm-quill", - "version": "2.0.2-alpha1.16", + "version": "2.0.2-alpha1.18", "description": "Your powerful, rich text editor", "author": "Jason Chen ", "homepage": "https://quilljs.com", diff --git a/packages/quill/src/formats/scriptTag.ts b/packages/quill/src/formats/scriptTag.ts index e8ed649ba2..16f0304234 100644 --- a/packages/quill/src/formats/scriptTag.ts +++ b/packages/quill/src/formats/scriptTag.ts @@ -1,6 +1,6 @@ -import Block from '../blots/block.js'; +import Embed from '../blots/embed.js'; -class ScriptTag extends Block { +class ScriptTag extends Embed { static blotName = 'script'; static tagName = 'SCRIPT'; } From c8b4d3fd2d387c6c79fb95963da460f5c7b5f609 Mon Sep 17 00:00:00 2001 From: hoavm Date: Wed, 2 Oct 2024 14:45:42 +0700 Subject: [PATCH 8/8] minor fix --- packages/quill/package.json | 2 +- packages/quill/src/quill.ts | 13 +++---------- packages/quill/test/types/quill.test-d.ts | 3 ++- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/quill/package.json b/packages/quill/package.json index 93d79b25e0..dddecfdb46 100644 --- a/packages/quill/package.json +++ b/packages/quill/package.json @@ -1,6 +1,6 @@ { "name": "hoavm-quill", - "version": "2.0.2-alpha1.18", + "version": "2.0.2-alpha1.20", "description": "Your powerful, rich text editor", "author": "Jason Chen ", "homepage": "https://quilljs.com", diff --git a/packages/quill/src/quill.ts b/packages/quill/src/quill.ts index 0366c68512..80a5a06658 100644 --- a/packages/quill/src/quill.ts +++ b/packages/quill/src/quill.ts @@ -1,4 +1,4 @@ -import Quill from './core.js'; +import Quill, { Parchment, Range } from './core.js'; import type { Bounds, DebugLevel, @@ -117,15 +117,7 @@ Quill.register( true, ); -export { - AttributeMap, - Delta, - Module, - Op, - OpIterator, - Parchment, - Range, -} from './core.js'; +export { Module } from './core.js'; export type { Bounds, DebugLevel, @@ -133,5 +125,6 @@ export type { ExpandedQuillOptions, QuillOptions, }; +export { Parchment, Range }; export default Quill; diff --git a/packages/quill/test/types/quill.test-d.ts b/packages/quill/test/types/quill.test-d.ts index a46bc216d2..1a2ca74040 100644 --- a/packages/quill/test/types/quill.test-d.ts +++ b/packages/quill/test/types/quill.test-d.ts @@ -1,6 +1,7 @@ import { assertType, expectTypeOf } from 'vitest'; -import Quill, { Delta } from '../../src/quill.js'; +import Quill from '../../src/quill.js'; import type { EmitterSource, Parchment, Range } from '../../src/quill.js'; +import Delta from 'quill-delta'; import type { default as Block, BlockEmbed } from '../../src/blots/block.js'; import SnowTheme from '../../src/themes/snow.js'; import { LeafBlot } from 'parchment';