diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d065aff55..9b749ca672 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - **Clipboard** Add support for Quill v1 list attributes - Fix overload declarations for `quill.formatText()` and other methods +- Expose Bounds type for getBounds() # 2.0.0-rc.4 diff --git a/packages/quill/src/core.ts b/packages/quill/src/core.ts index 77816b5644..cdf5724768 100644 --- a/packages/quill/src/core.ts +++ b/packages/quill/src/core.ts @@ -1,5 +1,6 @@ import Quill, { Parchment, Range } from './core/quill.js'; import type { + Bounds, DebugLevel, EmitterSource, ExpandedQuillOptions, @@ -24,7 +25,13 @@ import Input from './modules/input.js'; import UINode from './modules/uiNode.js'; export { Delta, Op, OpIterator, AttributeMap, Parchment, Range }; -export type { DebugLevel, EmitterSource, ExpandedQuillOptions, QuillOptions }; +export type { + Bounds, + DebugLevel, + EmitterSource, + ExpandedQuillOptions, + QuillOptions, +}; Quill.register({ 'blots/block': Block, diff --git a/packages/quill/src/core/quill.ts b/packages/quill/src/core/quill.ts index 59da9d0513..b91403af65 100644 --- a/packages/quill/src/core/quill.ts +++ b/packages/quill/src/core/quill.ts @@ -1033,7 +1033,7 @@ function shiftRange( return new Range(start, end - start); } -export type { DebugLevel, EmitterSource }; +export type { Bounds, DebugLevel, EmitterSource }; export { Parchment, Range }; export { globalRegistry, expandConfig, overload, Quill as default }; diff --git a/packages/quill/src/quill.ts b/packages/quill/src/quill.ts index bc2535b1b8..0c3626fd8a 100644 --- a/packages/quill/src/quill.ts +++ b/packages/quill/src/quill.ts @@ -1,5 +1,6 @@ import Quill, { Parchment, Range } from './core.js'; import type { + Bounds, DebugLevel, EmitterSource, ExpandedQuillOptions, @@ -114,7 +115,13 @@ Quill.register( true, ); -export type { DebugLevel, EmitterSource, ExpandedQuillOptions, QuillOptions }; +export type { + Bounds, + DebugLevel, + EmitterSource, + 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 d7ae524188..1d65de3823 100644 --- a/packages/quill/test/types/quill.test-d.ts +++ b/packages/quill/test/types/quill.test-d.ts @@ -179,6 +179,9 @@ const quill = new Quill('#editor'); { quill.scrollRectIntoView({ left: 0, right: 0, top: 0, bottom: 0 }); + quill.scrollRectIntoView( + document.createElement('div').getBoundingClientRect(), + ); } {