react-quill
Version:
The Quill rich-text editor as a React component.
1 lines • 27.3 kB
Source Map (JSON)
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";AAAA;;;EAGE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,gDAA0B;AAC1B,wDAAiC;AACjC,2DAAqC;AAErC,gDAOe;AA2Ef;IAAyB,8BAAiD;IAyFxE,oBAAY,KAAsB;QAAlC,YACE,kBAAM,KAAK,CAAC,SAGb;QApFD;;;UAGE;QACF,gBAAU,GAA8B;YACtC,SAAS;YACT,SAAS;YACT,QAAQ;YACR,OAAO;YACP,UAAU;SACX,CAAA;QAED;;;UAGE;QACF,gBAAU,GAA8B;YACtC,IAAI;YACJ,WAAW;YACX,OAAO;YACP,aAAa;YACb,UAAU;YACV,UAAU;YACV,mBAAmB;YACnB,SAAS;YACT,QAAQ;YACR,YAAY;YACZ,WAAW;YACX,SAAS;SACV,CAAA;QAQD,WAAK,GAAoB;YACvB,UAAU,EAAE,CAAC;SACd,CAAA;QAiBD;;UAEE;QACF,eAAS,GAAU,IAAI,CAAA;QA2UvB,oBAAc,GAAG,UACf,SAA6C,EAC7C,YAAiC,EACjC,eAAoC,EACpC,MAAe;;YAEf,IAAI,SAAS,KAAK,aAAa,EAAE;gBAC/B,MAAA,MAAA,KAAI,EAAC,kBAAkB,mDACrB,KAAI,CAAC,MAAO,CAAC,IAAI,CAAC,SAAS,EAC3B,YAA2B,EAC3B,MAAM,EACN,KAAI,CAAC,kBAAmB,EACxB;aACH;iBAAM,IAAI,SAAS,KAAK,kBAAkB,EAAE;gBAC3C,MAAA,MAAA,KAAI,EAAC,uBAAuB,mDAC1B,YAA2B,EAC3B,MAAM,EACN,KAAI,CAAC,kBAAmB,EACxB;aACH;QACH,CAAC,CAAC;QAxUA,IAAM,KAAK,GAAG,KAAI,CAAC,YAAY,EAAE,CAAA,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CA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S,QAAQ,CAAC,EAAyB;IACzC,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC7B,CAAC;AAID,iBAAS,UAAU,CAAC","sourcesContent":["/*\nReact-Quill\nhttps://github.com/zenoamaro/react-quill\n*/\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport isEqual from 'lodash/isEqual';\n\nimport Quill, {\n QuillOptionsStatic,\n DeltaStatic,\n RangeStatic,\n BoundsStatic,\n StringMap,\n Sources,\n} from 'quill';\n\n// Merged namespace hack to export types along with default object\n// See: https://github.com/Microsoft/TypeScript/issues/2719\nnamespace ReactQuill {\n export type Value = string | DeltaStatic;\n export type Range = RangeStatic | null;\n\n export interface QuillOptions extends QuillOptionsStatic {\n tabIndex?: number,\n }\n\n export interface ReactQuillProps {\n bounds?: string | HTMLElement,\n children?: React.ReactElement<any>,\n className?: string,\n defaultValue?: Value,\n formats?: string[],\n id?: string,\n modules?: StringMap,\n onChange?(\n value: string,\n delta: DeltaStatic,\n source: Sources,\n editor: UnprivilegedEditor,\n ): void,\n onChangeSelection?(\n selection: Range,\n source: Sources,\n editor: UnprivilegedEditor,\n ): void,\n onFocus?(\n selection: Range,\n source: Sources,\n editor: UnprivilegedEditor,\n ): void,\n onBlur?(\n previousSelection: Range,\n source: Sources,\n editor: UnprivilegedEditor,\n ): void,\n onKeyDown?: React.EventHandler<any>,\n onKeyPress?: React.EventHandler<any>,\n onKeyUp?: React.EventHandler<any>,\n placeholder?: string,\n preserveWhitespace?: boolean,\n readOnly?: boolean,\n scrollingContainer?: string | HTMLElement,\n style?: React.CSSProperties,\n tabIndex?: number,\n theme?: string,\n value?: Value,\n }\n\n export interface UnprivilegedEditor {\n getLength(): number;\n getText(index?: number, length?: number): string;\n getHTML(): string;\n getBounds(index: number, length?: number): BoundsStatic;\n getSelection(focus?: boolean): RangeStatic;\n getContents(index?: number, length?: number): DeltaStatic;\n }\n}\n\n// Re-import everything from namespace into scope for comfort\nimport Value = ReactQuill.Value;\nimport Range = ReactQuill.Range;\nimport QuillOptions = ReactQuill.QuillOptions;\nimport ReactQuillProps = ReactQuill.ReactQuillProps;\nimport UnprivilegedEditor = ReactQuill.UnprivilegedEditor;\n\ninterface ReactQuillState {\n generation: number,\n}\n\nclass ReactQuill extends React.Component<ReactQuillProps, ReactQuillState> {\n\n static displayName = 'React Quill'\n\n /*\n Export Quill to be able to call `register`\n */\n static Quill = Quill;\n\n /*\n Changing one of these props should cause a full re-render and a\n re-instantiation of the Quill editor.\n */\n dirtyProps: (keyof ReactQuillProps)[] = [\n 'modules',\n 'formats',\n 'bounds',\n 'theme',\n 'children',\n ]\n\n /*\n Changing one of these props should cause a regular update. These are mostly\n props that act on the container, rather than the quillized editing area.\n */\n cleanProps: (keyof ReactQuillProps)[] = [\n 'id',\n 'className',\n 'style',\n 'placeholder',\n 'tabIndex',\n 'onChange',\n 'onChangeSelection',\n 'onFocus',\n 'onBlur',\n 'onKeyPress',\n 'onKeyDown',\n 'onKeyUp',\n ]\n\n static defaultProps = {\n theme: 'snow',\n modules: {},\n readOnly: false,\n }\n\n state: ReactQuillState = {\n generation: 0,\n }\n\n /*\n The Quill Editor instance.\n */\n editor?: Quill\n\n /*\n Reference to the element holding the Quill editing area.\n */\n editingArea?: React.ReactInstance | null\n\n /*\n Tracks the internal value of the Quill editor\n */\n value: Value\n\n /*\n Tracks the internal selection of the Quill editor\n */\n selection: Range = null\n\n /*\n Used to compare whether deltas from `onChange` are being used as `value`.\n */\n lastDeltaChangeSet?: DeltaStatic\n\n /*\n Stores the contents of the editor to be restored after regeneration.\n */\n regenerationSnapshot?: {\n delta: DeltaStatic,\n selection: Range,\n }\n\n /*\n A weaker, unprivileged proxy for the editor that does not allow accidentally\n modifying editor state.\n */\n unprivilegedEditor?: UnprivilegedEditor\n\n constructor(props: ReactQuillProps) {\n super(props);\n const value = this.isControlled()? props.value : props.defaultValue;\n this.value = value ?? '';\n }\n\n validateProps(props: ReactQuillProps): void {\n if (React.Children.count(props.children) > 1) throw new Error(\n 'The Quill editing area can only be composed of a single React element.'\n );\n\n if (React.Children.count(props.children)) {\n const child = React.Children.only(props.children);\n if (child?.type === 'textarea') throw new Error(\n 'Quill does not support editing on a <textarea>. Use a <div> instead.'\n );\n }\n\n if (\n this.lastDeltaChangeSet &&\n props.value === this.lastDeltaChangeSet\n ) throw new Error(\n 'You are passing the `delta` object from the `onChange` event back ' +\n 'as `value`. You most probably want `editor.getContents()` instead. ' +\n 'See: https://github.com/zenoamaro/react-quill#using-deltas'\n );\n }\n\n shouldComponentUpdate(nextProps: ReactQuillProps, nextState: ReactQuillState) {\n this.validateProps(nextProps);\n\n // If the editor hasn't been instantiated yet, or the component has been\n // regenerated, we already know we should update.\n if (!this.editor || this.state.generation !== nextState.generation) {\n return true;\n }\n\n // Handle value changes in-place\n if ('value' in nextProps) {\n const prevContents = this.getEditorContents();\n const nextContents = nextProps.value ?? '';\n\n // NOTE: Seeing that Quill is missing a way to prevent edits, we have to\n // settle for a hybrid between controlled and uncontrolled mode. We\n // can't prevent the change, but we'll still override content\n // whenever `value` differs from current state.\n // NOTE: Comparing an HTML string and a Quill Delta will always trigger a\n // change, regardless of whether they represent the same document.\n if (!this.isEqualValue(nextContents, prevContents)) {\n this.setEditorContents(this.editor, nextContents);\n }\n }\n\n // Handle read-only changes in-place\n if (nextProps.readOnly !== this.props.readOnly) {\n this.setEditorReadOnly(this.editor, nextProps.readOnly!);\n }\n\n // Clean and Dirty props require a render\n return [...this.cleanProps, ...this.dirtyProps].some((prop) => {\n return !isEqual(nextProps[prop], this.props[prop]);\n });\n }\n\n shouldComponentRegenerate(nextProps: ReactQuillProps): boolean {\n // Whenever a `dirtyProp` changes, the editor needs reinstantiation.\n return this.dirtyProps.some((prop) => {\n return !isEqual(nextProps[prop], this.props[prop]);\n });\n }\n\n componentDidMount() {\n this.instantiateEditor();\n this.setEditorContents(this.editor!, this.getEditorContents());\n }\n\n componentWillUnmount() {\n this.destroyEditor();\n }\n\n componentDidUpdate(prevProps: ReactQuillProps, prevState: ReactQuillState) {\n // If we're changing one of the `dirtyProps`, the entire Quill Editor needs\n // to be re-instantiated. Regenerating the editor will cause the whole tree,\n // including the container, to be cleaned up and re-rendered from scratch.\n // Store the contents so they can be restored later.\n if (this.editor && this.shouldComponentRegenerate(prevProps)) {\n const delta = this.editor.getContents();\n const selection = this.editor.getSelection();\n this.regenerationSnapshot = {delta, selection};\n this.setState({generation: this.state.generation + 1});\n this.destroyEditor();\n }\n\n // The component has been regenerated, so it must be re-instantiated, and\n // its content must be restored to the previous values from the snapshot.\n if (this.state.generation !== prevState.generation) {\n const {delta, selection} = this.regenerationSnapshot!;\n delete this.regenerationSnapshot;\n this.instantiateEditor();\n const editor = this.editor!;\n editor.setContents(delta);\n postpone(() => this.setEditorSelection(editor, selection));\n }\n }\n\n instantiateEditor(): void {\n if (this.editor) {\n this.hookEditor(this.editor);\n } else {\n this.editor = this.createEditor(\n this.getEditingArea(),\n this.getEditorConfig()\n );\n }\n }\n\n destroyEditor(): void {\n if (!this.editor) return;\n this.unhookEditor(this.editor);\n }\n\n /*\n We consider the component to be controlled if `value` is being sent in props.\n */\n isControlled(): boolean {\n return 'value' in this.props;\n }\n\n getEditorConfig(): QuillOptions {\n return {\n bounds: this.props.bounds,\n formats: this.props.formats,\n modules: this.props.modules,\n placeholder: this.props.placeholder,\n readOnly: this.props.readOnly,\n scrollingContainer: this.props.scrollingContainer,\n tabIndex: this.props.tabIndex,\n theme: this.props.theme,\n };\n }\n\n getEditor(): Quill {\n if (!this.editor) throw new Error('Accessing non-instantiated editor');\n return this.editor;\n }\n\n /**\n Creates an editor on the given element. The editor will be passed the\n configuration, have its events bound,\n */\n createEditor(element: Element, config: QuillOptions) {\n const editor = new Quill(element, config);\n if (config.tabIndex != null) {\n this.setEditorTabIndex(editor, config.tabIndex);\n }\n this.hookEditor(editor);\n return editor;\n }\n\n hookEditor(editor: Quill) {\n // Expose the editor on change events via a weaker, unprivileged proxy\n // object that does not allow accidentally modifying editor state.\n this.unprivilegedEditor = this.makeUnprivilegedEditor(editor);\n // Using `editor-change` allows picking up silent updates, like selection\n // changes on typing.\n editor.on('editor-change', this.onEditorChange);\n }\n\n unhookEditor(editor: Quill) {\n editor.off('editor-change', this.onEditorChange);\n }\n\n getEditorContents(): Value {\n return this.value;\n }\n\n getEditorSelection(): Range {\n return this.selection;\n }\n\n /*\n True if the value is a Delta instance or a Delta look-alike.\n */\n isDelta(value: any): boolean {\n return value && value.ops;\n }\n\n /*\n Special comparison function that knows how to compare Deltas.\n */\n isEqualValue(value: any, nextValue: any): boolean {\n if (this.isDelta(value) && this.isDelta(nextValue)) {\n return isEqual(value.ops, nextValue.ops);\n } else {\n return isEqual(value, nextValue);\n }\n }\n\n /*\n Replace the contents of the editor, but keep the previous selection hanging\n around so that the cursor won't move.\n */\n setEditorContents(editor: Quill, value: Value) {\n this.value = value;\n const sel = this.getEditorSelection();\n if (typeof value === 'string') {\n editor.setContents(editor.clipboard.convert(value));\n } else {\n editor.setContents(value);\n }\n postpone(() => this.setEditorSelection(editor, sel));\n }\n\n setEditorSelection(editor: Quill, range: Range) {\n this.selection = range;\n if (range) {\n // Validate bounds before applying.\n const length = editor.getLength();\n range.index = Math.max(0, Math.min(range.index, length-1));\n range.length = Math.max(0, Math.min(range.length, (length-1) - range.index));\n editor.setSelection(range);\n }\n }\n\n setEditorTabIndex(editor: Quill, tabIndex: number) {\n if (editor?.scroll?.domNode) {\n (editor.scroll.domNode as HTMLElement).tabIndex = tabIndex;\n }\n }\n\n setEditorReadOnly(editor: Quill, value: boolean) {\n if (value) {\n editor.disable();\n } else {\n editor.enable();\n }\n }\n\n /*\n Returns a weaker, unprivileged proxy object that only exposes read-only\n accessors found on the editor instance, without any state-modifying methods.\n */\n makeUnprivilegedEditor(editor: Quill) {\n const e = editor;\n return {\n getHTML: () => e.root.innerHTML,\n getLength: e.getLength.bind(e),\n getText: e.getText.bind(e),\n getContents: e.getContents.bind(e),\n getSelection: e.getSelection.bind(e),\n getBounds: e.getBounds.bind(e),\n };\n }\n\n getEditingArea(): Element {\n if (!this.editingArea) {\n throw new Error('Instantiating on missing editing area');\n }\n const element = ReactDOM.findDOMNode(this.editingArea);\n if (!element) {\n throw new Error('Cannot find element for editing area');\n }\n if (element.nodeType === 3) {\n throw new Error('Editing area cannot be a text node');\n }\n return element as Element;\n }\n\n /*\n Renders an editor area, unless it has been provided one to clone.\n */\n renderEditingArea(): JSX.Element {\n const {children, preserveWhitespace} = this.props;\n const {generation} = this.state;\n\n const properties = {\n key: generation,\n ref: (instance: React.ReactInstance | null) => {\n this.editingArea = instance\n },\n };\n\n if (React.Children.count(children)) {\n return React.cloneElement(\n React.Children.only(children)!,\n properties\n );\n }\n\n return preserveWhitespace ?\n <pre {...properties}/> :\n <div {...properties}/>;\n }\n\n render() {\n return (\n <div\n id={this.props.id}\n style={this.props.style}\n key={this.state.generation}\n className={`quill ${this.props.className ?? ''}`}\n onKeyPress={this.props.onKeyPress}\n onKeyDown={this.props.onKeyDown}\n onKeyUp={this.props.onKeyUp}\n >\n {this.renderEditingArea()}\n </div>\n );\n }\n\n onEditorChange = (\n eventName: 'text-change' | 'selection-change',\n rangeOrDelta: Range | DeltaStatic,\n oldRangeOrDelta: Range | DeltaStatic,\n source: Sources,\n ) => {\n if (eventName === 'text-change') {\n this.onEditorChangeText?.(\n this.editor!.root.innerHTML,\n rangeOrDelta as DeltaStatic,\n source,\n this.unprivilegedEditor!\n );\n } else if (eventName === 'selection-change') {\n this.onEditorChangeSelection?.(\n rangeOrDelta as RangeStatic,\n source,\n this.unprivilegedEditor!\n );\n }\n };\n\n onEditorChangeText(\n value: string,\n delta: DeltaStatic,\n source: Sources,\n editor: UnprivilegedEditor,\n ): void {\n if (!this.editor) return;\n\n // We keep storing the same type of value as what the user gives us,\n // so that value comparisons will be more stable and predictable.\n const nextContents = this.isDelta(this.value)\n ? editor.getContents()\n : editor.getHTML();\n\n if (nextContents !== this.getEditorContents()) {\n // Taint this `delta` object, so we can recognize whether the user\n // is trying to send it back as `value`, preventing a likely loop.\n this.lastDeltaChangeSet = delta;\n\n this.value = nextContents;\n this.props.onChange?.(value, delta, source, editor);\n }\n }\n\n onEditorChangeSelection(\n nextSelection: RangeStatic,\n source: Sources,\n editor: UnprivilegedEditor,\n ): void {\n if (!this.editor) return;\n const currentSelection = this.getEditorSelection();\n const hasGainedFocus = !currentSelection && nextSelection;\n const hasLostFocus = currentSelection && !nextSelection;\n\n if (isEqual(nextSelection, currentSelection)) return;\n\n this.selection = nextSelection;\n this.props.onChangeSelection?.(nextSelection, source, editor);\n\n if (hasGainedFocus) {\n this.props.onFocus?.(nextSelection, source, editor);\n } else if (hasLostFocus) {\n this.props.onBlur?.(currentSelection, source, editor);\n }\n }\n\n focus(): void {\n if (!this.editor) return;\n this.editor.focus();\n }\n\n blur(): void {\n if (!this.editor) return;\n this.selection = null;\n this.editor.blur();\n }\n}\n\n/*\nSmall helper to execute a function in the next micro-tick.\n*/\nfunction postpone(fn: (value: void) => void) {\n Promise.resolve().then(fn);\n}\n\n// Compatibility Export to avoid `require(...).default` on CommonJS.\n// See: https://github.com/Microsoft/TypeScript/issues/2719\nexport = ReactQuill;\n"]}