/*
* Adapted from https://raw.githubusercontent.com/chanzuckerberg/czi-prosemirror/master/src/isTextStyleMarkCommandEnabled.js
*
* MIT License
*
* Copyright (c) 2018 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/CursorPlaceholderPlugin.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ImageFromURLCommand.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ImageNodeSpec.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ImageSourceCommand.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ImageUploadCommand.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ImageUploadPlaceholderPlugin.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/LinkSetURLCommand.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/LinkTooltipPlugin.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/SelectionPlaceholderPlugin.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/TableCellMenuPlugin.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/TextAlignCommand.js
*
* MIT License
*
* Copyright (c) 2018 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/applyMark.js
*
* MIT License
*
* Copyright (c) 2018 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/findActiveMark.js
*
* MIT License
*
* Copyright (c) 2018 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/findNodesWithSameMark.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/lookUpElement.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/sanitizeURL.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ui/CustomButton.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ui/CustomNodeView.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ui/EditorFrameset.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ui/ImageInlineEditor.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ui/ImageNodeView.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ui/ImageResizeBox.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ui/ImageURLEditor.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ui/ImageUploadEditor.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ui/LinkTooltip.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ui/LinkURLEditor.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ui/PointerSurface.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ui/PopUp.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ui/PopUpManager.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ui/PopUpPosition.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ui/TooltipSurface.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ui/bindScrollHandler.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ui/isElementFullyVisible.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ui/rects.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://github.com/chanzuckerberg/czi-prosemirror/blob/master/src/ui/resolveImage.js
*
* MIT License
*
* Copyright (c) 2019 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://raw.githubusercontent.com/chanzuckerberg/czi-prosemirror/master/src/HeadingNodeSpec.js
*
* MIT License
*
* Copyright (c) 2018 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* Adapted from: https://raw.githubusercontent.com/chanzuckerberg/czi-prosemirror/master/src/ListItemNodeSpec.js
*
* MIT License
*
* Copyright (c) 2018 Chan Zuckerberg Initiative
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/* Inspired by snippet shared by Jeremy Crane at: https://github.com/mzabriskie/react-draggable/issues/402 */

/* WEBPACK VAR INJECTION */

/* eslint-disable class-methods-use-this */

/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */

/* eslint-disable react/no-danger */

/* eslint-disable require-jsdoc, valid-jsdoc */

/* eslint-disable-next-line */

/* eslint-enable */

/* eslint-enable jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/no-static-element-interactions */

/* eslint-enable react/no-danger */

/* harmony default export */

/* harmony export (binding) */

/* harmony import */

/* harmony reexport (safe) */

/* import() */

/*! https://mths.be/punycode v1.4.1 by @mathias */

/*#__PURE__*/

/**
		 * A string representing the current Punycode.js version number.
		 * @memberOf punycode
		 * @type String
		 */

/**
		 * An object of methods to convert from JavaScript's internal character
		 * representation (UCS-2) to Unicode code points, and back.
		 * @see <https://mathiasbynens.be/notes/javascript-encoding>
		 * @memberOf punycode
		 * @type Object
		 */

/**
	 * A generic `Array#map` utility function.
	 * @private
	 * @param {Array} array The array to iterate over.
	 * @param {Function} callback The function that gets called for every array
	 * item.
	 * @returns {Array} A new array of values returned by the callback function.
	 */

/**
	 * A generic error utility function.
	 * @private
	 * @param {String} type The error type.
	 * @returns {Error} Throws a `RangeError` with the applicable error message.
	 */

/**
	 * A simple `Array#map`-like wrapper to work with domain name strings or email
	 * addresses.
	 * @private
	 * @param {String} domain The domain name or email address.
	 * @param {Function} callback The function that gets called for every
	 * character.
	 * @returns {Array} A new string of characters returned by the callback
	 * function.
	 */

/**
	 * Bias adaptation function as per section 3.4 of RFC 3492.
	 * https://tools.ietf.org/html/rfc3492#section-3.4
	 * @private
	 */

/**
	 * Converts a Punycode string of ASCII-only symbols to a string of Unicode
	 * symbols.
	 * @memberOf punycode
	 * @param {String} input The Punycode string of ASCII-only symbols.
	 * @returns {String} The resulting string of Unicode symbols.
	 */

/**
	 * Converts a Punycode string representing a domain name or an email address
	 * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
	 * it doesn't matter if you call it on a string that has already been
	 * converted to Unicode.
	 * @memberOf punycode
	 * @param {String} input The Punycoded domain name or email address to
	 * convert to Unicode.
	 * @returns {String} The Unicode representation of the given Punycode
	 * string.
	 */

/**
	 * Converts a Unicode string representing a domain name or an email address to
	 * Punycode. Only the non-ASCII parts of the domain name will be converted,
	 * i.e. it doesn't matter if you call it with a domain that's already in
	 * ASCII.
	 * @memberOf punycode
	 * @param {String} input The domain name or email address to convert, as a
	 * Unicode string.
	 * @returns {String} The Punycode representation of the given domain name or
	 * email address.
	 */

/**
	 * Converts a basic code point into a digit/integer.
	 * @see `digitToBasic()`
	 * @private
	 * @param {Number} codePoint The basic numeric code point value.
	 * @returns {Number} The numeric value of a basic code point (for use in
	 * representing integers) in the range `0` to `base - 1`, or `base` if
	 * the code point does not represent a value.
	 */

/**
	 * Converts a digit/integer into a basic code point.
	 * @see `basicToDigit()`
	 * @private
	 * @param {Number} digit The numeric value of a basic code point.
	 * @returns {Number} The basic code point whose value (when used for
	 * representing integers) is `digit`, which needs to be in the range
	 * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
	 * used; else, the lowercase form is used. The behavior is undefined
	 * if `flag` is non-zero and `digit` has no uppercase form.
	 */

/**
	 * Converts a string of Unicode symbols (e.g. a domain name label) to a
	 * Punycode string of ASCII-only symbols.
	 * @memberOf punycode
	 * @param {String} input The string of Unicode symbols.
	 * @returns {String} The resulting Punycode string of ASCII-only symbols.
	 */

/**
	 * Creates a string based on an array of numeric code points.
	 * @see `punycode.ucs2.decode`
	 * @memberOf punycode.ucs2
	 * @name encode
	 * @param {Array} codePoints The array of numeric code points.
	 * @returns {String} The new Unicode string (UCS-2).
	 */

/**
	 * Creates an array containing the numeric code points of each Unicode
	 * character in the string. While JavaScript uses UCS-2 internally,
	 * this function will convert a pair of surrogate halves (each of which
	 * UCS-2 exposes as separate characters) into a single code point,
	 * matching UTF-16.
	 * @see `punycode.ucs2.encode`
	 * @see <https://mathiasbynens.be/notes/javascript-encoding>
	 * @memberOf punycode.ucs2
	 * @name decode
	 * @param {String} string The Unicode input string (UCS-2).
	 * @returns {Array} The new array of code points.
	 */

/**
	 * The `punycode` object.
	 * @name punycode
	 * @type Object
	 */

/**
	* Samples elements from a population.
	*
	* @private
	* @param {Options} [options] - function options
	* @param {NonNegativeInteger} [options.size] - sample size
	* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement
	* @param {boolean} [options.mutate=false] - boolean indicating whether to mutate the `pool` when sampling without replacement
	* @throws {TypeError} options argument must be an object
	* @throws {TypeError} must provide valid options
	* @throws {RangeError} `size` option must be less than or equal to the population when the `replace` option is `false`
	* @returns {Array} sample
	*/

/**
	* Samples elements from an array-like object.
	*
	* @private
	* @param {ArrayLike} x - array-like object from which to sample elements
	* @param {Options} [options] - function options
	* @param {NonNegativeInteger} [options.size] - sample size
	* @param {ProbabilityArray} [options.probs] - element probabilities
	* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement
	* @throws {TypeError} first argument must be array-like
	* @throws {TypeError} options argument must be an object
	* @throws {TypeError} must provide valid options
	* @throws {RangeError} `size` option must be less than or equal to the length of `x` when the `replace` option is `false`
	* @returns {Array} sample
	*/

/**
             * @returns {boolean}
             */

/**
         * @param {*} key
         * @param {*} value
         * @returns {void}
         */

/**
         * @param {*} key
         * @returns {*}
         */

/**
         * @param {*} key
         * @returns {void}
         */

/**
         * @param {Function} callback
         * @param {*} [ctx=null]
         * @returns {void}
         */

/**
         * @returns {void}
         */

/**
         * A list of connected observers.
         *
         * @private {Array<ResizeObserverSPI>}
         */

/**
         * Broadcasted height of content rectangle.
         *
         * @type {number}
         */

/**
         * Broadcasted width of content rectangle.
         *
         * @type {number}
         */

/**
         * Collection of resize observations that have detected changes in dimensions
         * of elements.
         *
         * @private {Array<ResizeObservation>}
         */

/**
         * If a prop switches from controlled to Uncontrolled
         * reset its value to the defaultValue
         */

/**
         * Indicates whether DOM listeners have been added.
         *
         * @private {boolean}
         */

/**
         * Keeps reference to the instance of MutationObserver.
         *
         * @private {MutationObserver}
         */

/**
         * Reference to the last observed content rectangle.
         *
         * @private {DOMRectInit}
         */

/**
         * Registry of the ResizeObservation instances.
         *
         * @private {Map<Element, ResizeObservation>}
         */

/**
         * Tells that controller has subscribed for Mutation Events.
         *
         * @private {boolean}
         */

/**
     * "Transitionend" event handler.
     *
     * @private
     * @param {TransitionEvent} event
     * @returns {void}
     */

/**
     * Adds observer to observers list.
     *
     * @param {ResizeObserverSPI} observer - Observer to be added.
     * @returns {void}
     */

/**
     * Callback invoked after the specified delay. It will further postpone
     * invocation of the original function delegating it to the
     * requestAnimationFrame.
     *
     * @returns {void}
     */

/**
     * Clears the collection of active observations.
     *
     * @returns {void}
     */

/**
     * Collects observation instances the associated element of which has changed
     * it's content rectangle.
     *
     * @returns {void}
     */

/**
     * Creates a new instance of ResizeObserver.
     *
     * @param {ResizeObserverCallback} callback - Callback function that is invoked
     *      when one of the observed elements changes it's content dimensions.
     * @param {ResizeObserverController} controller - Controller instance which
     *      is responsible for the updates of observer.
     * @param {ResizeObserver} callbackCtx - Reference to the public
     *      ResizeObserver instance which will be passed to callback function.
     */

/**
     * Creates a new instance of ResizeObserver.
     *
     * @param {ResizeObserverCallback} callback - Callback that is invoked when
     *      dimensions of the observed elements change.
     */

/**
     * Creates a new instance of ResizeObserverController.
     *
     * @private
     */

/**
     * Creates an instance of ResizeObservation.
     *
     * @param {Element} target - Element to be observed.
     */

/**
     * Creates an instance of ResizeObserverEntry.
     *
     * @param {Element} target - Element that is being observed.
     * @param {DOMRectInit} rectInit - Data of the element's content rectangle.
     */

/**
     * Holds reference to the controller's instance.
     *
     * @private {ResizeObserverController}
     */

/**
     * Initializes DOM listeners.
     *
     * @private
     * @returns {void}
     */

/**
     * Invokes initial callback function with a list of ResizeObserverEntry
     * instances collected from active resize observations.
     *
     * @returns {void}
     */

/**
     * Invokes the original callback function and schedules new invocation if
     * the "proxy" was called during current request.
     *
     * @returns {void}
     */

/**
     * Invokes the update of observers. It will continue running updates insofar
     * it detects changes.
     *
     * @returns {void}
     */

/**
     * Removes DOM listeners.
     *
     * @private
     * @returns {void}
     */

/**
     * Removes observer from observers list.
     *
     * @param {ResizeObserverSPI} observer - Observer to be removed.
     * @returns {void}
     */

/**
     * Returns index in provided array that matches the specified key.
     *
     * @param {Array<Array>} arr
     * @param {*} key
     * @returns {number}
     */

/**
     * Returns instance of the ResizeObserverController.
     *
     * @returns {ResizeObserverController}
     */

/**
     * Schedules invocation of the original function.
     *
     * @returns {void}
     */

/**
     * Starts observing provided element.
     *
     * @param {Element} target - Element to be observed.
     * @returns {void}
     */

/**
     * Stops observing all elements.
     *
     * @returns {void}
     */

/**
     * Stops observing provided element.
     *
     * @param {Element} target - Element to stop observing.
     * @returns {void}
     */

/**
     * Tells whether observer has active observations.
     *
     * @returns {boolean}
     */

/**
     * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data
     * from the corresponding properties of the last observed content rectangle.
     *
     * @returns {DOMRectInit} Last observed content rectangle.
     */

/**
     * Updates content rectangle and tells whether it's width or height properties
     * have changed since the last broadcast.
     *
     * @returns {boolean}
     */

/**
     * Updates every observer from observers list and notifies them of queued
     * entries.
     *
     * @private
     * @returns {boolean} Returns "true" if any observer has detected changes in
     *      dimensions of it's elements.
     */

/**
   *  Which event when fired outside the component will cause it to be closed.
   *
   * _see [DropdownMenu](#menu-props) for more details_
   */

/**
   * A callback fired when the Dropdown wishes to change visibility. Called with the requested
   * `show` value, the DOM event, and the source that fired it: `'click'`,`'keydown'`,`'rootClose'`, or `'select'`.
   *
   * ```ts static
   * function(
   *   isOpen: boolean,
   *   event: SyntheticEvent,
   * ): void
   * ```
   *
   * @controllable show
   */

/**
   * A css slector string that will return __focusable__ menu items.
   * Selectors should be relative to the menu component:
   * e.g. ` > li:not('.disabled')`
   */

/**
   * A render prop that returns a Menu element. The `props`
   * argument should spread through to **a component that can accept a ref**.
   *
   * @type {Function ({
   *   show: boolean,
   *   alignEnd: boolean,
   *   close: (?SyntheticEvent) => void,
   *   placement: Placement,
   *   update: () => void,
   *   forceUpdate: () => void,
   *   props: {
   *     ref: (?HTMLElement) => void,
   *     style: { [string]: string | number },
   *     aria-labelledby: ?string
   *   },
   *   arrowProps: {
   *     ref: (?HTMLElement) => void,
   *     style: { [string]: string | number },
   *   },
   * }) => React.Element}
   */

/**
   * A render prop that returns a Toggle element. The `props`
   * argument should spread through to **a component that can accept a ref**. Use
   * the `onToggle` argument to toggle the menu open or closed
   *
   * @type {Function ({
   *   show: boolean,
   *   toggle: (show: boolean) => void,
   *   props: {
   *     ref: (?HTMLElement) => void,
   *     aria-haspopup: true
   *     aria-expanded: boolean
   *   },
   * }) => React.Element}
   */

/**
   * A render prop that returns the root dropdown element. The `props`
   * argument should spread through to an element containing _both_ the
   * menu and toggle in order to handle keyboard events for focus management.
   *
   * @type {Function ({
   *   props: {
   *     onKeyDown: (SyntheticEvent) => void,
   *   },
   * }) => React.Element}
   */

/**
   * A set of popper options and props passed directly to react-popper's Popper component.
   */

/**
   * Align the menu to the 'end' side of the placement side of the Dropdown toggle. The default placement is `top-start` or `bottom-start`.
   */

/**
   * Aligns the dropdown menu to the 'end' of it's placement position.
   * Generally this is provided by the parent `Dropdown` component,
   * but may also be specified as a prop directly.
   */

/**
   * An html id attribute for the Toggle button, necessary for assistive technologies, such as screen readers.
   * @type {string|number}
   * @required
   */

/**
   * Controls the focus behavior for when the Dropdown is opened. Set to
   * `true` to always focus the first menu item, `keyboard` to focus only when
   * navigating via the keyboard, or `false` to disable completely
   *
   * The Default behavior is `false` **unless** the Menu has a `role="menu"`
   * where it will default to `keyboard` to match the recommended [ARIA Authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#menubutton).
   */

/**
   * Controls the visible state of the menu, generally this is
   * provided by the parent `Dropdown` component,
   * but may also be specified as a prop directly.
   */

/**
   * Determines the direction and location of the Menu in relation to it's Toggle.
   */

/**
   * Enables the Popper.js `flip` modifier, allowing the Dropdown to
   * automatically adjust it's placement in case of overlap with the viewport or toggle.
   * Refer to the [flip docs](https://popper.js.org/popper-documentation.html#modifiers..flip.enabled) for more info
   */

/**
   * If a prop switches from controlled to Uncontrolled
   * reset its value to the defaultValue
   */

/**
   * Override the default event used by RootCloseWrapper.
   */

/**
   * Sets the initial show position of the Dropdown.
   */

/**
   * Whether or not the Dropdown is visible.
   *
   * @controllable onToggle
   */

/**
   * useful when wrapping a Component and you want to control
   * everything
   */

/**
 * @displayName Dropdown
 */

/**
 * @memberOf Dropdown
 * @param {object}  options
 * @param {boolean} options.flip Automatically adjust the menu `drop` position based on viewport edge detection
 * @param {[number, number]} options.offset Define an offset distance between the Menu and the Toggle
 * @param {boolean} options.show Display the menu manually, ignored in the context of a `Dropdown`
 * @param {boolean} options.usePopper opt in/out of using PopperJS to position menus. When disabled you must position it yourself.
 * @param {string}  options.rootCloseEvent The pointer event to listen for when determining "clicks outside" the menu for triggering a close.
 * @param {object}  options.popperConfig Options passed to the [`usePopper`](/api/usePopper) hook.
 */

/**
 * A collection of shims that provide minimal functionality of the ES6 collections.
 *
 * These implementations are not meant to be used outside of the ResizeObserver
 * modules as they cover only a limited range of use cases.
 */

/**
 * Also exported as `<Dropdown.Menu>` from `Dropdown`.
 *
 * @displayName DropdownMenu
 * @memberOf Dropdown
 */

/**
 * Also exported as `<Dropdown.Toggle>` from `Dropdown`.
 *
 * @displayName DropdownToggle
 * @memberOf Dropdown
 */

/**
 * Calculates an appropriate content rectangle for provided html or svg element.
 *
 * @param {Element} target - Element content rectangle of which needs to be calculated.
 * @returns {DOMRectInit}
 */

/**
 * Calculates content rectangle of provided HTMLElement.
 *
 * @param {HTMLElement} target - Element for which to calculate the content rectangle.
 * @returns {DOMRectInit}
 */

/**
 * Calculates content rectangle of provided SVG element.
 *
 * @param {SVGGraphicsElement} target - Element content rectangle of which needs
 *      to be calculated.
 * @returns {DOMRectInit}
 */

/**
 * Checks whether provided element is a document element (<html>).
 *
 * @param {Element} target - Element to be checked.
 * @returns {boolean}
 */

/**
 * Checks whether provided element is an instance of the SVGGraphicsElement.
 *
 * @param {Element} target - Element to be checked.
 * @returns {boolean}
 */

/**
 * Class that is responsible for computations of the content rectangle of
 * provided DOM element and for keeping track of it's changes.
 */

/**
 * Converts provided string to a number.
 *
 * @param {number|string} value
 * @returns {number}
 */

/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Copyright (c) 2013-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */

/**
 * Copyright (c) 2014-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.
 * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit
 *
 * @param {number} x - X coordinate.
 * @param {number} y - Y coordinate.
 * @param {number} width - Rectangle's width.
 * @param {number} height - Rectangle's height.
 * @returns {DOMRectInit}
 */

/**
 * Creates a wrapper function which ensures that provided callback will be
 * invoked only once during the specified delay period.
 *
 * @param {Function} callback - Function to be invoked after the delay period.
 * @param {number} delay - Delay after which to invoke callback.
 * @returns {Function}
 */

/**
 * Creates rectangle with an interface of the DOMRectReadOnly.
 * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly
 *
 * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.
 * @returns {DOMRectReadOnly}
 */

/**
 * Detects whether window and document objects are available in current environment.
 */

/**
 * Extracts borders size from provided styles.
 *
 * @param {CSSStyleDeclaration} styles
 * @param {...string} positions - Borders positions (top, right, ...)
 * @returns {number}
 */

/**
 * Extracts paddings sizes from provided styles.
 *
 * @param {CSSStyleDeclaration} styles
 * @returns {Object} Paddings box.
 */

/**
 * Iterates through children that are "valid elements".
 *
 * The provided forEachFunc(child, index) will be called for each
 * leaf child with the index reflecting the position relative to "valid components".
 */

/**
 * Iterates through children that are typically specified as `props.children`,
 * but only maps over children that are "valid elements".
 *
 * The mapFunction provided index will be normalised to the components mapped,
 * so an invalid component would not increase the index.
 *
 */

/**
 * Returns a function that triggers a component update. the hook equivalent to
 * `this.forceUpdate()` in a class component. In most cases using a state value directly
 * is preferable but may be required in some advanced usages of refs for interop or
 * when direct DOM manipulation is required.
 *
 * ```ts
 * const forceUpdate = useForceUpdate();
 *
 * const updateOnClick = useCallback(() => {
 *  forceUpdate()
 * }, [forceUpdate])
 *
 * return <button type="button" onClick={updateOnClick}>Hi there</button>
 * ```
 */

/**
 * Store the last of some value. Tracked via a `Ref` only updating it
 * after the component renders.
 *
 * Helpful if you need to compare a prop value to it's previous value during render.
 *
 * ```ts
 * function Component(props) {
 *   const lastProps = usePrevious(props)
 *
 *   if (lastProps.foo !== props.foo)
 *     resetValueFromProps(props.foo)
 * }
 * ```
 *
 * @param value the value to track
 */

/**
 * Use invariant() to assert state which your program assumes to be true.
 *
 * Provide sprintf-style format (only %s is supported) and arguments
 * to provide information about what broke and what you were
 * expecting.
 *
 * The invariant message will be stripped in production, but the invariant
 * will remain to ensure logic does not differ in production.
 */

/**
 * Wires up Dropdown toggle functionality, returning a set a props to attach
 * to the element that functions as the dropdown toggle (generally a button).
 *
 * @memberOf Dropdown
 */

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* A component for making a child component draggable and optionally resizable.
*
* @property {boolean} disabled - whether dragging should be disabled
* @property {boolean} resizable - whether resize handlers should be attached to the edges of the child element
* @property {Function} onStop - event handler called when dragging is stopped
* @property {Function} onEscape - event handler called when the escape key is pressed
* @property {Object} style - CSS inline styles
*/

/**
* Adapted from:
*
* simplemde v1.11.2
* Copyright Next Step Webs, Inc.
* @link https://github.com/NextStepWebs/simplemde-markdown-editor
* @license MIT
*/

/**
* Animates a position property of a specified DOM element.
*
* @param {Node} element - DOM node
* @param {string} prop - property name
* @param {number} to - target value for property
* @param {integer} duration - number of milliseconds for the animation to complete
*/

/**
* Attempts to call a `RegExp` method.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating if able to call a `RegExp` method
*/

/**
* Casts a pixel string to a number.
*
* @private
* @param {(string|number)} x - input value
* @param {number} cast number (in px)
*/

/**
* Compute the absolute difference.
*
* @module @stdlib/math/base/utils/absolute-difference
*
* @example
* var diff = require( '@stdlib/math/base/utils/absolute-difference' );
*
* var d = diff( 2.0, 5.0 );
* // returns 3.0
*
* d = diff( -1.0, 3.14 );
* // returns ~4.14
*
* d = diff( 10.1, -2.05 );
* // returns ~12.15
*
* d = diff( -0.0, 0.0 );
* // returns +0.0
*
* d = diff( NaN, 5.0 );
* // returns NaN
*
* d = diff( Infinity, -Infinity  );
* // returns Infinity
*
* d = diff( Infinity, Infinity  );
* // returns NaN
*/

/**
* Computes the absolute difference.
*
* @param {number} x - first number
* @param {number} y - second number
* @returns {number} absolute difference
*
* @example
* var d = absoluteDifference( 2.0, 5.0 );
* // returns 3.0
*
* @example
* var d = absoluteDifference( -1.0, 3.14 );
* // returns ~4.14
*
* @example
* var d = absoluteDifference( 10.1, -2.05 );
* // returns ~12.15
*
* @example
* var d = absoluteDifference( -0.0, 0.0 );
* // returns +0.0
*
* @example
* var d = absoluteDifference( NaN, 5.0 );
* // returns NaN
*
* @example
* var d = absoluteDifference( Infinity, -Infinity  );
* // returns Infinity
*
* @example
* var d = absoluteDifference( Infinity, Infinity  );
* // returns NaN
*/

/**
* Detects a JSON string.
*
* Regular expression: `/^\{[\s\S]*\}$|^\[[\s\S]*\]$/`
*
* -   `^\{`
*
*     -   match a `{` literal which is the first character
*
* -   `[\s\S]*`
*
*     -   match any whitespace and non-whitespace characters which occur `0` or more times
*
* -   `\}$`
*
*     -   match a `}` literal which is the last character
*
* -   `|`
*
*     -   alternatively
*
* -   `^\[`
*
*     -   match a `[` literal which is the first character
*
* -   `[\s\S]*`
*
*     -   match any whitespace and non-whitespace characters which occur `0` or more times
*
* -   `\]$`
*
*     -   match a `]` literal which is the last character
*
*
* Example matching strings:
*
* -   `'{}'`
* -   `'[]'`
* -   `'{adjlkfaj3743.,><\n\t\rdf}'`
* -   `'[adjlkfaj3743.,><\n\t\rdf]'`
* -   `'{"a":5}'`
*
* @constant
* @type {RegExp}
* @default /^\{[\s\S]*\}$|^\[[\s\S]*\]$/
*/

/**
* Escape a regular expression string or pattern.
*
* @module @stdlib/utils/escape-regexp-string
*
* @example
* var rescape = require( '@stdlib/utils/escape-regexp-string' );
*
* var str = rescape( '[A-Z]*' );
* // returns '\\[A\\-Z\\]\\*'
*/

/**
* Escapes a regular expression string.
*
* @param {string} str - regular expression string
* @throws {TypeError} first argument must be a string primitive
* @returns {string} escaped string
*
* @example
* var str = rescape( '[A-Z]*' );
* // returns '\\[A\\-Z\\]\\*'
*/

/**
* Replace search occurrences with a replacement string.
*
* @module @stdlib/string/replace
*
* @example
* var replace = require( '@stdlib/string/replace' );
*
* var str = 'beep';
* var out = replace( str, 'e', 'o' );
* // returns 'boop'
*
* str = 'Hello World';
* out = replace( str, /world/i, 'Mr. President' );
* // returns 'Hello Mr. President'
*/

/**
* Replace search occurrences with a replacement string.
*
* @param {string} str - input string
* @param {(string|RegExp)} search - search expression
* @param {(string|Function)} newval - replacement value or function
* @throws {TypeError} first argument must be a string primitive
* @throws {TypeError} second argument argument must be a string primitive or regular expression
* @throws {TypeError} third argument must be a string primitive or function
* @returns {string} new string containing replacement(s)
*
* @example
* var str = 'beep';
* var out = replace( str, 'e', 'o' );
* // returns 'boop'
*
* @example
* var str = 'Hello World';
* var out = replace( str, /world/i, 'Mr. President' );
* // returns 'Hello Mr. President'
*
* @example
* var capitalize = require( '@stdlib/string/capitalize' );
*
* var str = 'Oranges and lemons say the bells of St. Clement\'s';
*
* function replacer( match, p1 ) {
*     return capitalize( p1 );
* }
*
* var out = replace( str, /([^\s]*)/gi, replacer);
* // returns 'Oranges And Lemons Say The Bells Of St. Clement\'s'
*/

/**
* Restrict a value to a specified range.
*
* @module @stdlib/math/base/special/clamp
*
* @example
* var clamp = require( '@stdlib/math/base/special/clamp' );
*
* var v = clamp( 3.14, 0.0, 5.0 );
* // returns 3.14
*
* v = clamp( -3.14, 0.0, 5.0 );
* // returns 0.0
*
* v = clamp( 10.0, 0.0, 5.0 );
* // returns 5.0
*
* v = clamp( -0.0, 0.0, 5.0 );
* // returns 0.0
*
* v = clamp( 0.0, -0.0, 5.0 );
* // returns 0.0
*
* v = clamp( NaN, 0.0, 5.0 );
* // returns NaN
*
* v = clamp( 0.0, NaN, 5.0 );
* // returns NaN
*
* v = clamp( 3.14, 0.0, NaN );
* // returns NaN
*/

/**
* Restricts a value to a specified range.
*
* @param {number} v - input value
* @param {number} min - minimum value
* @param {number} max - maximum value
* @returns {number} value restricted to a specified range
*
* @example
* var v = clamp( 3.14, 0.0, 5.0 );
* // returns 3.14
*
* v = clamp( -3.14, 0.0, 5.0 );
* // returns 0.0
*
* v = clamp( 10.0, 0.0, 5.0 );
* // returns 5.0
*
* v = clamp( -0.0, 0.0, 5.0 );
* // returns 0.0
*
* v = clamp( 0.0, -0.0, 5.0 );
* // returns 0.0
*
* v = clamp( NaN, 0.0, 5.0 );
* // returns NaN
*
* v = clamp( 0.0, NaN, 5.0 );
* // returns NaN
*
* v = clamp( 3.14, 0.0, NaN );
* // returns NaN
*/

/**
* Return a partial object copy excluding specified keys.
*
* @module @stdlib/utils/omit
*
* @example
* var omit = require( '@stdlib/utils/omit' );
*
* var obj1 = {
*     'a': 1,
*     'b': 2
* };
*
* var obj2 = omit( obj1, 'b' );
* // returns { 'a': 1 }
*/

/**
* Return the minimum value.
*
* @module @stdlib/math/base/special/min
*
* @example
* var min = require( '@stdlib/math/base/special/min' );
*
* var v = min( 3.14, 4.2 );
* // returns 3.14
*
* v = min( 5.9, 3.14, 4.2 );
* // returns 3.14
*
* v = min( 3.14, NaN );
* // returns NaN
*
* v = min( +0.0, -0.0 );
* // returns -0.0
*/

/**
* Returns a function to sample elements from an array-like object.
*
* @param {ArrayLike} [pool] - array-like object from which to sample
* @param {Options} [options] - function options
* @param {PositiveInteger} [options.seed] - integer-valued seed
* @param {NonNegativeInteger} [options.size] - sample size
* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement
* @param {boolean} [options.mutate=false] - boolean indicating whether to mutate the `pool` when sampling without replacement
* @throws {TypeError} `pool` must be an array-like object
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {Function} function to sample elements from an array-like object
*
* @example
* var sample = factory({
*     'seed': 232
* });
* var out = sample( 'abcdefg' );
* // e.g., returns [ 'g', 'd', 'g', 'f', 'c', 'e', 'f' ]
*
* @example
* var sample = factory( [ 1, 2, 3, 4, 5, 6 ], {
*     'seed': 232,
*     'size': 2
* });
* var out = sample();
* // e.g., returns [ 6, 4 ]
*
* out = sample();
* // e.g., returns [ 6, 5 ]
*
* @example
* var sample = factory( [ 1, 2, 3, 4, 5, 6 ], {
*     'seed': 474,
*     'size': 3,
*     'mutate': true,
*     'replace': false
* });
* var out = sample();
* // e.g., returns [ 4, 3, 6 ]
*
* out = sample();
* // e.g., returns [ 1, 5, 2 ]
*
* out = sample();
* // returns null
*
* @example
* var sample = factory( [ 0, 1 ], {
*     'size': 2
* });
*
* var out = sample();
* // e.g., returns [ 1, 1 ]
*
* out = sample({
*     'size': 10
* });
* // e.g., returns [ 0, 1, 1, 1, 0, 1, 0, 0, 1, 1 ]
*
* @example
* var sample = factory( [ 0, 1 ], {
*     'size': 2
* });
*
* var out = sample();
* // e.g., returns [ 1, 1 ]
*
* out = sample({
*     'replace': false
* });
* // e.g., returns [ 0, 1 ] or [ 1, 0 ]
*
* out = sample();
* // e.g., returns [ 1, 1 ]
*
* @example
* var sample = factory( [ 0, 1 ], {
*     'size': 2,
*     'mutate': true
* });
*
* var out = sample();
* // e.g., returns [ 1, 1 ]
*
* out = sample({
*     'replace': false
* });
* // e.g., returns [ 0, 1 ] or [ 1, 0 ]
*
* out = sample();
* // returns null
*/

/**
* Returns a partial object copy excluding specified keys.
*
* @param {Object} obj - source object
* @param {(string|StringArray)} keys - keys to exclude
* @throws {TypeError} first argument must be an object
* @throws {TypeError} second argument must be either a string or an array of strings
* @returns {Object} new object
*
* @example
* var obj1 = {
*     'a': 1,
*     'b': 2
* };
*
* var obj2 = omit( obj1, 'b' );
* // returns { 'a': 1 }
*/

/**
* Returns the minimum value.
*
* @param {number} [x] - first number
* @param {number} [y] - second number
* @param {...number} [args] - numbers
* @returns {number} minimum value
*
* @example
* var v = min( 3.14, 4.2 );
* // returns 3.14
*
* @example
* var v = min( 5.9, 3.14, 4.2 );
* // returns 3.14
*
* @example
* var v = min( 3.14, NaN );
* // returns NaN
*
* @example
* var v = min( +0.0, -0.0 );
* // returns -0.0
*/

/**
* Round a numeric value toward positive infinity.
*
* @module @stdlib/math/base/special/ceil
*
* @example
* var ceil = require( '@stdlib/math/base/special/ceil' );
*
* var v = ceil( -4.2 );
* // returns -4.0
*
* v = ceil( 9.99999 );
* // returns 10.0
*
* v = ceil( 0.0 );
* // returns 0.0
*
* v = ceil( NaN );
* // returns NaN
*/

/**
* Rounds a numeric value toward positive infinity.
*
* @param {number} x - input value
* @returns {number} rounded value
*
* @example
* var v = ceil( -4.2 );
* // returns -4.0
*
* @example
* var v = ceil( 9.99999 );
* // returns 10.0
*
* @example
* var v = ceil( 0.0 );
* // returns 0.0
*
* @example
* var v = ceil( NaN );
* // returns NaN
*/

/**
* Sample elements from an array-like object.
*
* @module @stdlib/random/sample
*
* @example
* var sample = require( '@stdlib/random/sample' );
*
* var out = sample( 'abc' );
* // e.g., returns [ 'a', 'a', 'b' ]
*
* out = sample( [ 3, 6, 9 ] );
* // e.g., returns [ 3, 9, 6 ]
*
* var bool = ( out.length === 3 );
* // returns true
*
* @example
* var sample = require( '@stdlib/random/sample' );
*
* var mysample = sample.factory({
*     'seed': 323
* });
* var out = mysample( [ 3, 6, 9 ], {
*     'size': 10
* });
* // e.g., returns [ 3, 9, 3, 3, 3, 6, 3, 3, 3, 6 ]
*/

/**
* Samples elements from an array-like object.
*
* @name sample
* @type {Function}
* @param {ArrayLike} x - array-like object from which to sample
* @param {Options} [options] - function options
* @param {NonNegativeInteger} [options.size] - sample size
* @param {ProbabilityArray} [options.probs] - element probabilities
* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement
* @throws {TypeError} first argument must be array-like
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {RangeError} `size` option must be less than or equal to the length of `x` when the `replace` option is `false`
* @returns {Array} sample
*
* @example
* var out = sample( [ 3, null, NaN, 'abc', function(){} ] );
* // e.g., returns [ 3, 'abc', null, 3, null ]
*/

/**
* Samples from a discrete uniform distribution (equal probabilities and with replacement).
*
* @private
* @param {ArrayLike} x - array-like object from which to sample
* @param {NonNegativeInteger} size - sample size
* @param {Function} rand - PRNG for generating uniformly distributed numbers
* @returns {Array} sample
*/

/**
* Samples uniformly without replacement using the Fisher-Yates shuffle.
*
* ## References
*
* -   Knuth, Donald E. 1997. _The Art of Computer Programming, Volume 2 (3rd Ed.): Seminumerical Algorithms_. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc.
*
* @private
* @param {ArrayLike} x - array-like object from which to sample
* @param {NonNegativeInteger} size - sample size
* @param {Function} rand - PRNG for generating uniformly distributed numbers
* @returns {Array} sample
*/

/**
* Samples with replacement and non-uniform probabilities using Vose's [alias method][alias-method].
*
* ## References
*
* -   Vose, Michael D. 1991. "A linear algorithm for generating random numbers with a given distribution." _IEEE Transactions on Software Engineering_ 17 (9): 972–75. doi:[10.1109/32.92917][@vose:1991].
*
* [alias-method]: http://keithschwarz.com/darts-dice-coins/
* [@vose:1991]: https://doi.org/10.1109/32.92917
*
*
* @private
* @param {ArrayLike} x - array-like object from which to sample
* @param {NonNegativeInteger} size - sample size
* @param {Function} rand - PRNG for generating uniformly distributed numbers
* @param {ProbabilityArray} probabilities - element probabilities
* @returns {Array} sample
*/

/**
* Samples without replacement from a discrete set using custom probabilities.
*
* ## Notes
*
* -   After each draw, the probabilities of the remaining observations are renormalized so that they sum to one.
*
*
* @private
* @param {ArrayLike} x - array-like object from which to sample
* @param {NonNegativeInteger} size - sample size
* @param {Function} rand - PRNG for generating uniformly distributed numbers
* @param {ProbabilityArray} probabilities - element probabilities
* @returns {Array} sample
*/

/**
* Scrolls a vertical scrollbar to the specified position.
*
* @param {Node} element - DOM node with the scrollbar to change
* @param {number} to - vertical position of the scroll bar after animation
* @param {integer} duration - number of milliseconds until animation shall be complete
* @returns {void}
*/

/**
* Square root of double-precision floating-point epsilon.
*
* @module @stdlib/constants/math/float64-sqrt-eps
* @type {number}
*
* @example
* var FLOAT64_SQRT_EPSILON = require( '@stdlib/constants/math/float64-sqrt-eps' );
* // returns 0.14901161193847656e-7
*/

/**
* Square root of double-precision floating-point epsilon.
*
* ```tex
* \sqrt{\frac{1}{2^{52}}}
* ```
*
* @constant
* @type {number}
* @default 0.14901161193847656e-7
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
* @see [Machine Epsilon]{@link https://en.wikipedia.org/wiki/Machine_epsilon}
*/

/**
* Test if a double-precision floating-point numeric value is negative zero.
*
* @module @stdlib/math/base/assert/is-negative-zero
*
* @example
* var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );
*
* var bool = isNegativeZero( -0.0 );
* // returns true
*
* bool = isNegativeZero( 0.0 );
* // returns false
*/

/**
* Test if a string ends with the characters of another string.
*
* @module @stdlib/string/ends-with
*
* @example
* var endsWith = require( '@stdlib/string/ends-with' );
*
* var str = 'Fair is foul, and foul is fair, hover through fog and filthy air';
*
* var bool = endsWith( str, 'air' );
* // returns true
*
* bool = endsWith( str, 'fair' );
* // returns false
*
* bool = endsWith( str, 'fair', 30 );
* // returns true
*
* bool = endsWith( str, 'fair', -34 );
* // returns true
*/

/**
* Test if a string ends with the characters of another string.
*
* @param {string} str - input string
* @param {string} search - search string
* @param {integer} [len=str.length] - substring length
* @throws {TypeError} first argument must be a string primitive
* @throws {TypeError} second argument must be a string primitive
* @throws {TypeError} third argument must be an integer
* @returns {boolean} boolean indicating if the input string ends with the search string
*
* @example
* var bool = endsWith( 'Remember the story I used to tell you when you were a boy?', 'boy?' );
* // returns true
*
* @example
* var bool = endsWith( 'Remember the story I used to tell you when you were a boy?', 'Boy?' );
* // returns false
*
* @example
* var bool = endsWith( 'To be, or not to be, that is the question.', 'to be' );
* // returns false
*
* @example
* var bool = endsWith( 'To be, or not to be, that is the question.', 'to be', 19 );
* // returns true
*
* @example
* var bool = endsWith( 'To be, or not to be, that is the question.', 'to be', -23 );
* // returns true
*/

/**
* Test if a value is `null`.
*
* @module @stdlib/assert/is-null
*
* @example
* var isNull = require( '@stdlib/assert/is-null' );
*
* var value = null;
*
* var bool = isNull( value );
* // returns true
*/

/**
* Test if a value is `undefined` or `null`.
*
* @module @stdlib/assert/is-undefined-or-null
*
* @example
* var isUndefinedOrNull = require( '@stdlib/assert/is-undefined-or-null' );
*
* var bool = isUndefinedOrNull( void 0 );
* // returns true
*
* bool = isUndefinedOrNull( null );
* // returns true
*
* bool = isUndefinedOrNull( false );
* // returns false
*/

/**
* Test if a value is `undefined`.
*
* @module @stdlib/assert/is-undefined
*
* @example
* var isUndefined = require( '@stdlib/assert/is-undefined' );
*
* var bool = isUndefined( void 0 );
* // returns true
*
* bool = isUndefined( null );
* // returns false
*/

/**
* Test if a value is a parseable JSON string.
*
* @module @stdlib/assert/is-json
*
* @example
* var isJSON = require( '@stdlib/assert/is-json' );
*
* var v = isJSON( '{"a":5}' );
* // returns true
*
* v = isJSON( '{a":5}' );
* // returns false
*/

/**
* Test if a value is a regular expression.
*
* @module @stdlib/assert/is-regexp
*
* @example
* var isRegExp = require( '@stdlib/assert/is-regexp' );
*
* var bool = isRegExp( /\.+/ );
* // returns true
*
* bool = isRegExp( {} );
* // returns false
*/

/**
* Test if a value is an array of probabilities that sum to one.
*
* @module @stdlib/assert/is-unity-probability-array
*
* @example
* var isUnityProbabilityArray = require( '@stdlib/assert/is-unity-probability-array' );
*
* var bool = isUnityProbabilityArray( [ 0.25, 0.5, 0.25 ] );
* // returns true
*
* bool = isUnityProbabilityArray( new Uint8Array( [ 0, 1 ] ) );
* // returns true
*
* bool = isUnityProbabilityArray( [ 0.4, 0.4, 0.4 ] );
* // returns false
*
* bool = isUnityProbabilityArray( [ 3.14, 0.0 ] );
* // returns false
*/

/**
* Test if a value is an array of strings.
*
* @module @stdlib/assert/is-string-array
*
* @example
* var isStringArray = require( '@stdlib/assert/is-string-array' );
*
* var bool = isStringArray( [ 'abc', 'def' ] );
* // returns true
*
* bool = isStringArray( [ 'abc', 123 ] );
* // returns false
*
* @example
* var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;
*
* var bool = isStringArray( [ 'abc', 'def' ] );
* // returns true
*
* bool = isStringArray( [ 'abc', new String( 'def' ) ] );
* // returns false
*
* @example
* var isStringArray = require( '@stdlib/assert/is-string-array' ).objects;
*
* var bool = isStringArray( [ new String( 'abc' ), new String( 'def' ) ] );
* // returns true
*
* bool = isStringArray( [ new String( 'abc' ), 'def' ] );
* // returns false
*/

/**
* Tests if a double-precision floating-point numeric value is negative zero.
*
* @param {number} x - value to test
* @returns {boolean} boolean indicating whether the value is negative zero
*
* @example
* var bool = isNegativeZero( -0.0 );
* // returns true
*
* @example
* var bool = isNegativeZero( 0.0 );
* // returns false
*/

/**
* Tests if a value is `null`.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is null
*
* @example
* var bool = isNull( null );
* // returns true
*
* bool = isNull( true );
* // returns false
*/

/**
* Tests if a value is `undefined` or `null`.
*
* ## Notes
*
* -   In older browsers, `undefined` is a global which can be overridden. `void`, however, is an operator which **cannot** be overridden. Consequently, better to use `void` to check for `undefined`. See [Stack Overflow][1].
*
* [1]: http://stackoverflow.com/a/19369078/2225624
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is undefined
*
* @example
* var bool = isUndefinedOrNull( undefined );
* // returns true
*
* bool = isUndefinedOrNull( null );
* // returns true
*
* bool = isUndefinedOrNull( false );
* // returns false
*/

/**
* Tests if a value is `undefined`.
*
* ## Notes
*
* -   In older browsers, `undefined` is a global which can be overridden. `void`, however, is an operator which **cannot** be overridden. Consequently, better to use `void` to check for `undefined`. See [Stack Overflow][1].
*
* [1]: http://stackoverflow.com/a/19369078/2225624
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is undefined
*
* @example
* var bool = isUndefined( undefined );
* // returns true
*
* bool = isUndefined( null );
* // returns false
*/

/**
* Tests if a value is a parseable JSON string.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a parseable JSON string
*
* @example
* var v = isJSON( '{"a":5}' );
* // returns true
*
* @example
* var v = isJSON( '{a":5}' );
* // returns false
*/

/**
* Tests if a value is a regular expression.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a regular expression
*
* @example
* var bool = isRegExp( /\.+/ );
* // returns true
*
* @example
* var bool = isRegExp( {} );
* // returns false
*/

/**
* Tests if a value is an array of probabilities that sum to one.
*
* @param {*} v - value to test
* @returns {boolean} boolean indicating if a value is a probability array
*
* @example
* var bool = isUnityProbabilityArray( [ 0.25, 0.5, 0.25 ] );
* // returns true
*
* @example
* var bool = isUnityProbabilityArray( new Uint8Array( [ 0, 1 ] ) );
* // returns true
*
* @example
* var bool = isUnityProbabilityArray( [ 0.4, 0.4, 0.4 ] );
* // returns false
*
* @example
* var bool = isUnityProbabilityArray( [ 3.14, 0.0 ] );
* // returns false
*/

/**
* Validates function options.
*
* @private
* @param {Object} opts - destination for validated options
* @param {Options} options - function options
* @param {NonNegativeInteger} [options.size] - sample size
* @param {ProbabilityArray} [options.probs] - element probabilities
* @param {boolean} [options.replace] - boolean indicating whether to sample with replacement
* @param {boolean} [options.mutate] - boolean indicating whether to mutate the `pool` when sampling without replacement
* @returns {(null|Error)} null or an error
*
* @example
* var opts = {};
* var options = {
*     'size': 10,
*     'replace': false,
*     'mutate': true,
*     'probs': [ 0.7, 0.3 ]
* };
* var err = validate( opts, options );
* if ( err ) {
*     throw err;
* }
*/

/** @class */

/** @component */

/** @ignore */

/** An ARIA accessible role applied to the Menu component. When set to 'menu', The dropdown */

/** An `href` passed to the Toggle component */

/** An `onClick` handler passed to the Toggle component */

/** Bootstring parameters */

/** Cached calculation results */

/** Define the public API */

/** Detect free variables */

/** Disables both Buttons  */

/** Error messages */

/** Highest positive signed 32-bit float value */

/** Regular expressions */

/** The content of the non-toggle Button.  */

/** Whether to render the dropdown menu in the DOM before the first time it is shown */

/** `inputLength` will hold the number of code points in `input`. */

/***/

/*--------------------------------------------------------------------------*/

/*@__PURE__*/

//

//       A function to add the attribute's value to an attribute

//       A function to read the attribute's value from a DOM node.

//       Called when the view is destroyed or receives a state

//       Called whenever the view's state is updated.

//       The attribute's default value.

//       default:: any

//       destroy:: ?()

//       getFromDOM:: ?(dom.Node) → any

//       object that's used to render the cell's DOM.

//       setDOMAttr:: ?(value: any, attrs: Object)

//       update:: ?(view: EditorView, prevState: EditorState)

//       with different plugins.

//     A CSS class name to add to the cursor element.

//     A group name (something like `"block"`) to add to the table

//     Additional attributes to add to cells. Maps attribute names to

//     Should return an object with the following optional

//     The amount of history events that are collected before the

//     The color of the cursor. Defaults to `black`.

//     The content expression for table cells.

//     The delay between changes after which a new group should be

//     The precise width of the cursor in pixels. Defaults to 1.

//     aren't adjacent, a new group is always started.

//     cellAttributes:: ?Object

//     cellContent:: string

//     class:: ?string

//     color:: ?string

//     depth:: ?number

//     newGroupDelay:: ?number

//     node type.

//     objects with the following properties:

//     oldest events are discarded. Defaults to 100.

//     properties:

//     return::-

//     started. Defaults to 500 (milliseconds). Note that when changes

//     tableGroup:: ?string

//     width:: ?number

//    A valid selection in the document.

//    The initial set of [stored marks](#state.EditorState.storedMarks).

//    The plugins that should be active in this state.

//    The schema to use.

//    The starting document.

//    `$from`, then moves forward as content is placed, and is finally

//    been placed yet.

//    doc:: ?Node

//    is implicit in `$from`, and its open-end value in `frontier`.

//    plugins:: ?[Plugin]

//    reconciled with `$to`.

//    represent the open side of the replacement. It starts at

//    schema:: ?Schema

//    selection:: ?Selection

//    storedMarks:: ?[Mark]

//   (except when it appears in a [node](#model.NodeSpec.parseDOM) or

//   (or deciding not to render) its child nodes.

//   // ...

//   A CSS class name or a space-separated set of class names to be

//   A CSS property name to match. When given, this rule matches

//   A CSS selector describing the kind of DOM elements to match. A

//   A function that will be called to get the text for the current

//   A function to parse text from the clipboard into a document

//   A function used to compute the attributes for the node or mark

//   A set of [document decorations](#view.Decoration) to show in the

//   A set of additional nodes to count as

//   A string of CSS to be _added_ to the node's existing `style` property.

//   Allows a plugin to define a [state field](#state.StateField), an

//   Allows the plugin to append another transaction to be applied

//   Allows you to pass custom rendering and behavior logic for nodes

//   Apply the given transaction to this state field, producing a new

//   Associates DOM parser information with this mark (see the

//   Associates DOM parser information with this node, which can be

//   Attributes for the node or mark created by this rule. When

//   By default, the content is parsed into the schema's default

//   By default, the element will get a class `"ProseMirror"`, and

//   By default, whitespace is collapsed as per HTML's rules. Pass

//   Called for each node around a click, from the inside out. The

//   Called for each node around a double click.

//   Called for each node around a triple click.

//   Called when a DOM

//   Called when something is dropped on the editor. `moved` will be

//   Called when the editor is clicked, after `handleClickOn` handlers

//   Called when the editor is double-clicked, after `handleDoubleClickOn`.

//   Called when the editor is triple-clicked, after `handleTripleClickOn`.

//   Called when the editor receives a `keydown` event.

//   Called when the node view is removed from the editor or the whole

//   Called when the view, after updating its state, tries to scroll

//   Called with a DOM Element for `tag` rules, and with a string (the

//   Can be an object mapping DOM event type names to functions that

//   Can be set to true to indicate that, though this isn't a [leaf

//   Can be used to change the order in which the parse rules in a

//   Can be used to control which DOM events, when they bubble out

//   Can be used to indicate that this node contains code, which

//   Can be used to make this a keyed plugin. You can have only one

//   Can be used to override the behavior of pasting. `slice` is the

//   Can be used to override the content of a matched node. When

//   Can be used to override the way a selection is created when

//   Can be used to override the way the node's selected status (as a

//   Can be used to prevent the editor view from trying to handle some

//   Can be used to transform pasted HTML text, _before_ it is parsed,

//   Can be used to transform pasted content before it is applied to

//   Contrary to the other event handling props, when returning true

//   Control the DOM attributes of the editable element. May be either

//   Controls whether nodes of this type can be selected as a [node

//   Controls whether whitespace should be preserved when parsing the

//   Controls which side of the document position this widget is

//   Convert this field to JSON. Optional, can be left off to disable

//   Defaults to only being exclusive with marks of the same type. You

//   Defines the default way a node of this type should be serialized

//   Defines the default way marks of this type should be serialized

//   Deserialize the JSON representation of this field. Note that the

//   Determines how the left side of the decoration is

//   Determines how the right side of the decoration is mapped.

//   Determines the distance (in pixels) between the cursor and the

//   Determines the extra space (in pixels) that is left above or

//   Determines whether marks of this type can span multiple adjacent

//   Determines whether nodes of this type can be dragged without

//   Determines whether this node is considered an important parent

//   Determines which other marks this mark can coexist with. Should

//   For `tag` rules that produce non-leaf nodes or marks, by default

//   For example `"paragraph/"` means the rule only matches when the

//   For text nodes, the default is to create a text DOM node. Though

//   Handler for `keypress` events.

//   If you supply your own parser, you do not need to also specify

//   Initialize the value of the field. `config` will be the object

//   It will be given a node (possibly of a different type), and an

//   JSON serialization for the field.

//   Likewise, in _inserted_ content the defining parents of the

//   Map a position through this object. When given, `assoc` (should

//   Map a position, and return an object containing additional

//   Map the bookmark through a set of changes.

//   New schema to use.

//   New set of active plugins.

//   Nodes are only matched when the namespace matches or this property

//   ProseMirror does of events fired on the editable DOM element.

//   ProseMirror.

//   Provide the starting content match that content parsed into the

//   Resolve the bookmark to a real selection again. This may need to

//   Return false if the editor should re-read the selection or

//   See

//   Should be set to true for inline nodes. (Implied for text nodes.)

//   Should return a DOM node or an [array

//   Supports the following configuration options:

//   The DOM node that should hold the node's content. Only meaningful

//   The DOM serializer to use when putting content onto the

//   The [parser](#model.DOMParser) to use when reading content from

//   The [parser](#model.DOMParser) to use when reading editor changes

//   The [view props](#view.EditorProps) added by this plugin. Props

//   The `plain` flag will be true when the text is pasted as plain text.

//   The attributes that marks of this type get.

//   The attributes that nodes of this type get.

//   The callback over which to send transactions (state updates)

//   The child node index to start parsing from.

//   The child node index to stop parsing at.

//   The content expression for this node, as described in the [schema

//   The current state of the editor.

//   The default behavior is to split the text into lines, wrap them

//   The default value for this attribute, to use when no explicit

//   The group or space-separated groups to which this mark belongs.

//   The group or space-separated groups to which this node belongs,

//   The mark types that exist in this schema. The order in which they

//   The marks that are allowed inside of this node. May be a

//   The name of the default top-level node for the schema. Defaults

//   The name of the mark type to wrap the matched content in.

//   The name of the node type to create when this rule matches. Only

//   The namespace to match. This should be used with `tag`.

//   The node types in this schema. Maps names to

//   The outer DOM node that represents the document node. When not

//   The precise set of marks to draw around the widget.

//   The schema to use.

//   The set of active plugins.

//   This will be called to handle setting the selection inside the

//   Transform pasted plain text. The `plain` flag will be true when

//   When `marks` is null, `side` also determines the marks that

//   When a mark is [added](#model.Mark.addToSet) to a set, all marks

//   When comparing decorations of this type (in order to decide

//   When defining a `selectNode` method, you should also provide a

//   When enabled (default is false), the sides of nodes of this type

//   When given, restricts this rule to only match when the current

//   When given, the parser will, beside parsing the content,

//   When given, this function will be called for each decoration

//   When given, this will be called when the view is updating itself.

//   When non-null, the target node is wrapped in a DOM element of

//   When present, this will be called before a transaction is

//   When set (defaults to false), selection changes inside the

//   When the plugin needs to interact with the editor view, or

//   When there are multiple widgets at a given position, their

//   When this returns false, the content of the view is not directly

//   When true, finding an element that matches this rule will close

//   When true, ignore content that matches this rule.

//   When true, ignore the node that matches this rule, but do parse

//   Whenever the user directly input text, this handler is called

//   Whether this mark should be active when the cursor is positioned

//   [`DOMParser.fromSchema`](#model.DOMParser^fromSchema) on the

//   [`DOMSerializer.fromSchema`](#model.DOMSerializer^fromSchema)

//   [`DOMSerializer.fromSchema`](#model.DOMSerializer^fromSchema)).

//   [`NodeSpec`](#model.NodeSpec) objects that describe the node type

//   [`TextSelection.between`](#state.TextSelection^between)) if

//   [`clipboardParser`](#view.EditorProps.clipboardParser) on it.

//   [`domParser`](#view.EditorProps.domParser) prop is used.

//   [`editable` prop](#view.EditorProps.editable). Additional classes

//   [`inclusiveStart`](#view.Decoration^inline^spec.inclusiveStart).

//   [`someProp`](#view.EditorView.someProp)) will be used.

//   [`transformPastedText`](#view.EditorProps.transformPastedText).

//   [`updateState`](#view.EditorView.updateState) method with a new

//   [applied](#state.EditorState.apply). The callback will be bound to have

//   [context](#model.ParseRule.context) when parsing, above the

//   [group](#model.NodeSpec.group).

//   [mapped](#transform.Position_Mapping) when content is

//   [mark spec](#model.MarkSpec.parseDOM), in which case the `node`

//   [mutation](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver)

//   [top node type](#model.Schema.topNodeType). You can pass this

//   _added_ to the classes that the node already had.

//   `"property=value"`, in which case the rule only matches if the

//   `"section//"` matches any position inside a section—a double

//   `"selection"` (which doesn't occur for native mutation records).

//   `assoc` points in the direction of the deleted content.

//   `decorations` is an array of node or inline decorations that are

//   `deselectNode` method to remove the effect again.

//   `direct` flag will be true for the inner node.

//   `false`, the rule won't match. When it returns null or undefined,

//   `getAttrs` is provided, it takes precedence.

//   `mark` field in the rules is implied.

//   `preventDefault` yourself (or not, if you want to allow the

//   `side` values determine the order in which they appear. Those

//   `state` argument is again a half-initialized state.

//   `true` to preserve whitespace, but normalize newlines to

//   a CSS selector string that the parser must use to find the actual

//   a selection change, the record will have a `type` property of

//   access the plugin's configuration and state through the key,

//   active around the node. They are automatically drawn in the

//   after the given array of transactions. When another plugin

//   already saw.

//   an object or a function going from an editor state to an object.

//   and marks. Should map node and mark names to constructor

//   and return false to indicate that the match failed.)

//   and reuse DOM nodes. Make sure that any widgets with the same

//   any mark that excludes the new mark but is not, itself, excluded

//   appendTransaction:: ?(transactions: [Transaction], oldState: EditorState, newState: EditorState) → ?Transaction

//   appends a transaction after this was called, it is called again

//   applied by the state, allowing the plugin to cancel it (by

//   apply:: (tr: Transaction, value: T, oldState: EditorState, newState: EditorState) → T

//   are marked as defining.

//   are provided determines the order in which [mark

//   argument `getPos` is a function that can be called to get the

//   array of active decorations (which are automatically drawn, and

//   as the top container.

//   associated with that name. Their order is significant—it

//   associated with. When negative, it is drawn before a cursor

//   at its end (or at its start when that is also the start of the

//   at its position, and content inserted at that position ends

//   atom:: ?bool

//   attributes:: ?union<Object<string>, (EditorState) → ?Object<string>>

//   attrs:: ?Object

//   attrs:: ?Object<AttributeSpec>

//   automatically derive a parser. The `node` field in the rules is

//   backspacing or lifting, won't cross. An example of a node that

//   be -1 or 1, defaults to 1) determines with which side the

//   be a space-separated strings naming other marks or groups of marks.

//   be collapsed, `true` means that whitespace should be preserved

//   before the input is applied. If it returns `true`, the default

//   behavior of actually inserting the text is suppressed.

//   being selected. Defaults to false.

//   below the cursor when it is scrolled into view. Defaults to 5.

//   boolean that indicates whether the mark's content is inline.

//   but newlines normalized to spaces, and `"full"` means that

//   by the new mark, the mark can not be added an the set. You can

//   can set it to an empty string (or any string not containing the

//   causes some commands to behave differently.

//   character, as in `"blockquote/|list_item/"`.

//   class:: ?string

//   clipboard. If not given, the result of

//   clipboardParser:: ?DOMParser

//   clipboardSerializer:: ?DOMSerializer

//   clipboardTextParser:: ?(text: string, $context: ResolvedPos, plain: bool) → Slice

//   clipboardTextSerializer:: ?(Slice) → string

//   closeParent:: ?bool

//   code:: ?bool

//   coexist (as long as they have different attributes).

//   coming after this one.

//   compare the widget DOM node by identity. If you pass a key,

//   complicated filters, use [`getAttrs`](#model.ParseRule.getAttrs)

//   conditions the DOM element or style must match. When it returns

//   config::-

//   constructed state does not yet contain the state from plugins

//   constructing a parser, the order of the rule array is used.

//   content and should be treated as a single unit in the view.

//   content are preserved when possible. Typically,

//   content element, or a function that returns the actual content

//   content inside the matched element. `false` means whitespace may

//   content should be inserted.

//   content:: ?string

//   contentDOM:: ?dom.Node

//   contentElement:: ?union<string, (dom.Node) → dom.Node>

//   context:: ?ResolvedPos

//   context:: ?string

//   context—the parent nodes into which the content is being

//   corresponding [node spec field](#model.NodeSpec.parseDOM)). The

//   corresponds to

//   count as boundaries that regular editing operations, like

//   createSelectionBetween:: ?(view: EditorView, anchor: ResolvedPos, head: ResolvedPos) → ?Selection

//   created by this rule. Can also be used to describe further

//   created.

//   cursor into view, scrolling takes place. Defaults to 0.

//   decorations:: ?(state: EditorState) → ?DecorationSet

//   default behavior).

//   default) nodes get dropped when their entire content is replaced,

//   default:: ?any

//   defining:: ?bool

//   deselectNode:: ?()

//   destroy:: ?()

//   determines which [parse rules](#model.NodeSpec.parseDOM) take

//   different contexts, they can be separated by a pipe (`|`)

//   different keys.

//   differently, this is not supported inside the editor, so you

//   dispatchTransaction:: ?(tr: Transaction)

//   do some error checking and may fall back to a default (usually

//   dom:: ?dom.Node

//   domParser:: ?DOMParser

//   draggable:: ?bool

//   editable.

//   editable:: ?(state: EditorState) → bool

//   editor is destroyed.

//   editor view.

//   editor will use [`textBetween`](#model.Node.textBetween) on the

//   editor's schema.

//   element to the parser.

//   end of the visible viewport at which point, when scrolling the

//   ends up before the widget.

//   excludes:: ?string

//   extra slot in the state object in which it can keep its own data.

//   false otherwise. If the node view has a `contentDOM` property (or

//   field value. Note that the `newState` argument is again a partially

//   filterTransaction:: ?(Transaction, EditorState) → bool

//   findPositions:: ?[{node: dom.Node, offset: number}]

//   for example to clean it up.

//   from such a function, you are responsible for calling

//   from the DOM. Defaults to calling

//   from:: ?number

//   fromJSON:: ?(config: Object, value: *, state: EditorState) → T

//   functions that produce a [`NodeView`](#view.NodeView) object

//   getAttrs:: ?(union<dom.Node, string>) → ?union<Object, false>

//   getContent:: ?(dom.Node, schema: Schema) → Fragment

//   given [top node](#model.ParseOptions.topNode).

//   given node

//   given, the default strategy is used to create a DOM node.

//   group:: ?string

//   guide](/docs/guide/#schema.content_expressions). When not given,

//   handle them. Such functions will be called before any handling

//   handleClick:: ?(view: EditorView, pos: number, event: dom.MouseEvent) → bool

//   handleClickOn:: ?(view: EditorView, pos: number, node: Node, nodePos: number, event: dom.MouseEvent, direct: bool) → bool

//   handleDOMEvents:: ?Object<(view: EditorView, event: dom.Event) → bool>

//   handleDoubleClick:: ?(view: EditorView, pos: number, event: dom.MouseEvent) → bool

//   handleDoubleClickOn:: ?(view: EditorView, pos: number, node: Node, nodePos: number, event: dom.MouseEvent, direct: bool) → bool

//   handleDrop:: ?(view: EditorView, event: dom.Event, slice: Slice, moved: bool) → bool

//   handleKeyDown:: ?(view: EditorView, event: dom.KeyboardEvent) → bool

//   handleKeyPress:: ?(view: EditorView, event: dom.KeyboardEvent) → bool

//   handlePaste:: ?(view: EditorView, event: dom.ClipboardEvent, slice: Slice) → bool

//   handleScrollToSelection:: ?(view: EditorView) → bool

//   handleTextInput:: ?(view: EditorView, from: number, to: number, text: string) → bool

//   handleTripleClick:: ?(view: EditorView, pos: number, event: dom.MouseEvent) → bool

//   handleTripleClickOn:: ?(view: EditorView, pos: number, node: Node, nodePos: number, event: dom.MouseEvent, direct: bool) → bool

//   handlers or the default behavior should be tried.

//   have been called.

//   if the node view also defines a `dom` property and if its node

//   ignore:: ?bool

//   ignoreMutation:: ?(dom.MutationRecord) → bool

//   ignoreSelection:: ?bool

//   ignored.

//   implementing the node's display behavior. For nodes, the third

//   implied (the name of this node will be filled in automatically).

//   in `<p>` tags, and call

//   in the parsed content will not be written to.

//   inclusive:: ?bool

//   inclusiveEnd:: ?bool

//   inclusiveStart:: ?bool

//   indicate that it did not handle the scrolling and further

//   information about the mapping. The result's `deleted` field tells

//   init:: (config: Object, instance: EditorState) → T

//   inline styles that list that property. May also have the form

//   inline:: ?bool

//   inserted directly at that position. By default, the decoration

//   is deleted, the position itself is only considered deleted when

//   is not present, the node view itself is responsible for rendering

//   is null.

//   isolating:: ?bool

//   it is possible to create a serializer where text is rendered

//   it to be in a paragraph that is inside a blockquote, and

//   its content.

//   key are interchangeable—if widgets differ in, for example,

//   key:: ?PluginKey

//   key:: ?string

//   make sure this ends up calling the view's

//   map:: (mapping: Mapping) → SelectionBookmark

//   map:: (pos: number, assoc: ?number) → number

//   mapResult:: (pos: number, assoc: ?number) → MapResult

//   mapping made the bookmark invalid.

//   mark's own name) to allow multiple marks of a given type to

//   mark:: ?string

//   marks in the schema.

//   marks, other nodes default to not allowing marks.

//   marks:: ?[Mark]

//   marks:: ?string

//   marks:: ?union<Object<MarkSpec>, OrderedMap<MarkSpec>>

//   move when a chunk of content is inserted at the mapped position.

//   names or node group names followed by single or double slashes.

//   namespace:: ?string

//   negative, those of the node after when positive.

//   newlines should also be preserved.

//   no `dom` property), updating its child nodes will be handled by

//   node during replace operations (such as paste). Non-defining (the

//   node selection) is displayed.

//   node's current position, which can be useful when creating

//   node. The `anchor` and `head` positions are relative to the start

//   node:: ?string

//   nodeName:: ?string

//   nodeViews:: ?Object<(node: Node, view: EditorView, getPos: () → number, decorations: [Decoration]) → NodeView>

//   node](#model.NodeType.isLeaf), it doesn't have directly editable

//   nodes when serialized to DOM/HTML. Defaults to true.

//   nodes.

//   nodes:: union<Object<NodeSpec>, OrderedMap<NodeSpec>>

//   non-default-paragraph textblock types, and possibly list items,

//   normal way, and you will usually just want to ignore this, but

//   not given, nodes with inline content default to allowing all

//   not have values for plugin fields initialized after this one.

//   of the node. By default, a DOM selection will be created between

//   of this widget, the editor view should ignore.

//   onRemove:: ?(decorationSpec: Object)

//   option to use the type and attributes from a different node

//   optional number zero (“hole”) in it to indicate where the node's

//   options::- The following options are understood:

//   options::- These options are supported:

//   or `mark` property will be derived from its position).

//   or a selection change happens within the view. When the change is

//   or all DOM events that bubble up from the node view. Events for

//   or node. If the child nodes are in a descendent node, this may be

//   override it you can do something else.

//   parent node is a paragraph, `"blockquote/paragraph/"` restricts

//   parent node). Defaults to true.

//   parseDOM:: ?[ParseRule]

//   parsed—matches this expression. Should contain one or more node

//   parsing rules in your schema.

//   passed to [`EditorState.create`](#state.EditorState^create). Note

//   pasted content parsed by the editor, but you can directly access

//   plugin with a given key in a given state, but it is possible to

//   plugins:: ?[Plugin]

//   position is associated, which determines in which direction to

//   precedence by default, and which nodes come first in a given

//   present, instead of parsing the node's child nodes, the result of

//   preserveWhitespace:: ?union<bool, "full">

//   priority:: ?number

//   produced by the view. If you specify this, you probably want to

//   property is only meaningful in a schema—when directly

//   property's value exactly matches the given value. (For more

//   props:: ?EditorProps

//   provided here will be added to the class. For other attributes,

//   provided whenever a node or mark of a type that has them is

//   re-parse the range around the mutation, true if it can safely be

//   re-sync the selection with its selection state.

//   reading a DOM selection between the given anchor and head.

//   record the document positions of the given DOM positions. It

//   replaced range) during the mapping. When content on only one side

//   resolve:: (doc: Node) → Selection

//   returning false).

//   rule should have one of a `node`, `mark`, or `ignore` property

//   rules](#model.MarkSpec.parseDOM) are tried.

//   schema are tried. Those with higher priority come first. Rules

//   schema.

//   schema:: ?Schema

//   schema:: Schema

//   scrollMargin:: ?union<number, {top: number, right: number, bottom: number, left: number}>

//   scrollThreshold:: ?union<number, {top: number, right: number, bottom: number, left: number}>

//   selectNode:: ?()

//   selectable:: ?bool

//   selected range.

//   selection when copying text to the clipboard. By default, the

//   selection](#state.NodeSelection). Defaults to true for non-text

//   set something up in the DOM, use this field. The function

//   setSelection:: ?(anchor: number, head: number, root: dom.Document)

//   sets](#model.Mark.addToSet) are sorted and in which [parse

//   should probably have this enabled is a table cell.

//   should return true if it was able to update to that node, and

//   shouldn't override that in your text node spec.

//   side:: ?number

//   single rule should have _either_ a `tag` or a `style` property.

//   skip:: ?bool

//   slash matches any sequence of ancestor nodes. To allow multiple

//   slice. Called after

//   space-separated string referring to mark names or groups, `"_"`

//   spaces, and `"full"` to preserve whitespace entirely.

//   spanning:: ?bool

//   spec of that decoration.

//   state that has the transaction

//   state:: ?StateField<any>

//   state:: EditorState

//   stopEvent:: ?(event: dom.Event) → bool

//   structure](#model.DOMOutputSpec) that describes one, with an

//   style's value) for `style` rules.

//   style:: ?string

//   tag:: ?string

//   that `instance` is a half-initialized state instance, and will

//   that are functions will be bound to have the plugin instance as

//   that gets dropped as a result of the mapping, passing the

//   that holds the document position. DOM positions that are not

//   that is interpreted as an empty/default set of attributes.

//   that it excludes are removed in the process. If the set contains

//   that key will be compared instead, which can be useful when

//   the DOM positions corresponding to those positions, but if you

//   the behavior of some event handler, they should get

//   the clipboard. When not given, the value of the

//   the content of the DOM element is parsed as content of the mark

//   the current node.

//   the document.

//   the event to get at the raw content.

//   the node does not allow any content.

//   the node view may ignore if it isn't interested in them), and

//   the node view without adding it to the document itself.

//   the same `side` value is unspecified.

//   the selection into view. A handler function may return false to

//   the text is pasted as plain text.

//   the top node.

//   the value provided first (as in

//   the view instance as its `this` binding.

//   the widget is wrapped in—those of the node before when

//   their `this` binding.

//   they can also be used as a way to provide context information to

//   this function is used.

//   this type (and the other attributes are applied to this element).

//   thus be deleted).

//   to DOM/HTML (as used by

//   to DOM/HTML. When the resulting spec contains a hole, that is

//   to `"doc"`.

//   to a string representation for debugging (e.g. in error messages).

//   to explicitly allow all marks, or `""` to disallow marks. When

//   to make it inclusive.

//   to:: ?number

//   toDOM:: ?(mark: Mark, inline: bool) → DOMOutputSpec

//   toDOM:: ?(node: Node) → DOMOutputSpec

//   toDebugString:: ?(node: Node) -> string

//   toJSON:: ?(value: T) → *

//   top node is matched against.

//   topMatch:: ?ContentMatch

//   topNode:: ?Node

//   topNode:: ?string

//   transactions to update it. For marks, the third argument is a

//   transactions, i.e. it won't be passed transactions that it

//   transformPasted:: ?(Slice) → Slice

//   transformPastedHTML:: ?(html: string) → string

//   transformPastedText:: ?(text: string, plain: bool) → string

//   true if this drop moves from the current selection (which should

//   type is not a leaf node type. When this is present, ProseMirror

//   up after the widget. When zero (the default) or positive, the

//   update:: ?(node: Node, decorations: [Decoration]) → bool

//   use the value `"_"` to indicate that the mark excludes all

//   used by [`DOMParser.fromSchema`](#model.DOMParser^fromSchema) to

//   valid for rules with a `tag` property, not for style rules. Each

//   value is provided. Attributes that have no default must be

//   view.

//   view:: ?(EditorView) → Object

//   where the marked content is placed. Otherwise, it is appended to

//   whereas defining nodes persist and wrap the inserted content.

//   whether it needs to be redrawn), ProseMirror will by default

//   which can be referred to in the content expressions for the

//   which this returns true are not handled by the editor.

//   widget are ignored, and don't cause ProseMirror to try and

//   widget is drawn after the cursor and content inserted there

//   will be called when the plugin's state is associated with an

//   will be used.

//   will do so by writing to the objects, adding a `pos` property

//   will have its `contentEditable` attribute determined by the

//   will take care of rendering the node's children into it. When it

//   with lower values appear first. The ordering of widgets with

//   with the new state and new transactions—but only the new

//   without a priority are counted as having priority 50. This

//   without having access to the plugin instance object.

//   won't include the new content, but you can set this to `true`

//   you generate decorations on the fly and don't want to store

//   you whether the position was deleted (completely enclosed in a

//  - `frontier` holds a stack of `{type, match}` objects that

//  - `placed` is a fragment of placed content. Its open-start value

//  - `unplaced` is a slice that represents the content that hasn't

//  0..25 map to ASCII a..z or A..Z

// "<td>..</td>"` the table cells are ignored.

// "Software"), to deal in the Software without restriction, including

// "TS2604: JSX element type 'Component' does not have any construct or call signatures."

// "consumed" by the delegate iterator. If context.method was

// "return" to "throw", let that override the TypeError below.

// "return", allow the original .return call to continue in the

// # heading

// #1011, #1013, #1035).

// #1059) first fires a DOM mutation, before moving the selection to

// #1060

// #820

// #93 Wrap the resize box in span (will not break 100% width/height)

// '\x2D'

// (FIXME it'd be nice if we had a schema-agnostic way to

// (This is a function that allows the custom view to find its

// (Using subclassing for this was intentionally decided against,

// (bidi-aware) start-of-textblock detection if given.

// (direction=-1) cell in a table.

// (e.g. character confirmation may be done with the mouse), and keydown is triggered

// (hidden) cursor is doesn't change the selection, and

// (including decorations that start or end directly at the

// (isCollapsed inappropriately returns true in shadow dom)

// (may be null to just delete). This goes very much against the grain

// (not raw objects).

// (one where the focus is before the anchor), but not all

// (overwritten) the next time the function is called. (Not public.)

// (such as the target of the link). Marks are created through a

// (unescaped) to the output.

// (when it fits directly) and will be null when no such wrapping

// (which can not necessarily be expressed with a text selection, when

// * bullet list

// **Do not** directly mutate the properties of a `Node` object. See

// - Figuring out what part of the document a given DOM position

// - Incremental redrawing when the document changes

// - Wiring in custom implementations of the editing interface for a

// .constructor.prototype properties for functions that return Generator

// .throw, and .return (see defineIteratorMethods).

// .throw, and .return methods.

// 1 / 1.33.

// 1. ordered list

// 16.3+ will not execute our will-update method;

// 26..35 map to ASCII 0..9

// 314px. And it doesn't happen all the time. So just ignore this delta

// : () → ?Node

// : () → ?ParseRule

// : (Decoration, Decoration) → number

// : (EditorState, Node, number, ?Transaction) → ?Transaction

// : (EditorState, bool) → ?{transform: Transform, selection: ?SelectionBookmark, remaining: Branch}

// : (EditorState, number)

// : (EditorView) → union<DecorationSet, DecorationGroup>

// : (EditorView, number, number)

// : (EditorView, number, number) → {left: number, top: number, right: number, bottom: number}

// : (EditorView, string, string, ?bool, ResolvedPos) → ?Slice

// : (Fragment, Fragment) → ?{mark: Mark, type: string}

// : (Fragment, [ViewDesc]) → [ViewDesc]

// : (HistoryState, EditorState, (tr: Transaction), bool)

// : (HistoryState, EditorState, Transaction, Object)

// : (Mark)

// : (Mark, bool, string?) → string

// : (Node) → ?Node

// : (Node) → Fragment

// : (Node, [Decoration], DecorationSet) → bool

// : (Node, [Decoration], DecorationSet, EditorView)

// : (Node, [Decoration], DecorationSet, EditorView) → bool

// : (Node, [Decoration], DecorationSet, EditorView, Fragment, number) → bool

// : (NodeType, ?Object)

// : (NodeType, ?Object) → bool

// : (NodeType, ?Object, ?[Node]) → ?Node

// : (Object) → [[{term: ?any, to: number}]]

// : (ResolvedPos, ResolvedPos) → [number]

// : (Schema) → Object<(mark: Mark) → DOMOutputSpec>

// : (Schema) → Object<(node: Node) → DOMOutputSpec>

// : (Schema) → [ParseRule]

// : (Schema, [Fragment]) → {width: number, height: number, rows: [Fragment]}

// : (Slice) → ?{width: number, height: number, rows: [Fragment]}

// : (Transaction) → EditorState

// : (Transaction) → bool

// : (Transform, ?SelectionBookmark, Object) → Branch

// : (Transform, number)

// : (ViewDesc, DecorationSet, (Decoration, number), (Node, [Decoration], DecorationSet, number))

// : ([DecorationSet]) → union<DecorationSet, DecorationGroup>

// : ([Decoration]) → [Decoration]

// : ([Decoration], Node, number) → DecorationSet

// : ([Decoration], [Decoration]) → bool

// : ([Mark], EditorView)

// : ([[{term: ?any, to: number}]]) → ContentMatch

// : (dom.Element)

// : (dom.Element, ParseRule) → bool

// : (dom.Event) → bool

// : (dom.MutationRecord) → bool

// : (dom.Node)

// : (dom.Node, ?NodeBuilder, ?number, ?number)

// : (dom.Node, [ViewDesc])

// : (dom.Node, number, ?number) → number

// : (number) → ?NodeViewDesc

// : (number) → dom.Node

// : (number) → {node: dom.Node, offset: number}

// : (number, ?number) → MapResult

// : (number, ?number) → number

// : (number, ?number) → {index: number, offset: number}

// : (number, number, ?string, ?string) → string

// : (number, number, dom.Document)

// : (string)

// : (string) → [string]

// : (string) → bool

// : ({sliceDepth: number, frontierDepth: number, parent: ?Node, wrap: ?[NodeType], inject: ?Fragment})

// : ({width: number, height: number, rows: [Fragment]}, number, number) → {width: number, height: number, rows: [Fragment]}

// : ?[MarkType]

// : DOMParser The parser we are using.

// : Object The options passed to this parse.

// : Object<bool> The block-level tags in HTML5

// : Object<bool> The tags that we normally ignore.

// : [Mark] The current set of marks

// :- An abstraction that allows the code dealing with decorations to

// :: ((element: T, index: number) → ?bool, ?number, ?number)

// :: ((element: T, index: number) → U, ?number, ?number) → [U]

// :: ((key: string, value: any))

// :: ((node: Node, offset: number, index: number))

// :: ((node: Node, pos: number, parent: Node) → ?bool)

// :: ((oldStart: number, oldEnd: number, newStart: number, newEnd: number))

// :: ((state: EditorState, ?(tr: Transaction)) → bool, union<(before: Node, after: Node) → bool, [string]>) → (state: EditorState, ?(tr: Transaction)) → bool

// :: ()

// :: () → ?Object

// :: () → Mapping

// :: () → Object

// :: () → Plugin

// :: () → SelectionBookmark

// :: () → Slice

// :: () → StepMap

// :: () → Transaction

// :: () → [Mark]

// :: () → bool

// :: () → string

// :: (...[(EditorState, ?(tr: Transaction), ?EditorView) → bool]) → (EditorState, ?(tr: Transaction), ?EditorView) → bool

// :: (?Fragment) → Node

// :: (?Object) → Mark

// :: (?Object) → Plugin

// :: (?Object, ?union<Fragment, Node, [Node]>, ?[Mark]) → ?Node

// :: (?Object, ?union<Fragment, Node, [Node]>, ?[Mark]) → Node

// :: (?ResolvedPos, ?(Node) → bool) → ?NodeRange

// :: (?[Mark]) → Transaction

// :: (?number) → Node

// :: (?number) → number

// :: (?number, ?number) → Mapping

// :: (?number, ?number) → RopeSequence<T>

// :: (?number, ?number, ?(spec: Object) → bool) → [Decoration]

// :: (?string)

// :: (?union<Fragment, Node, [Node]>) → Fragment

// :: (?union<Mark, [Mark]>) → [Mark]

// :: (?union<Object, OrderedMap>) → OrderedMap

// :: (?union<Object<Plugin>, string, number>) → Object

// :: (?union<[T], RopeSequence<T>>) → RopeSequence<T>

// :: (DirectEditorProps)

// :: (EditorState)

// :: (EditorState) → ?Plugin

// :: (EditorState) → ?any

// :: (EditorState) → any

// :: (EditorState) → number

// :: (EditorState, ?(Transaction)) → bool

// :: (EditorState, ?(tr: Transaction)) → bool

// :: (EditorState, ?(tr: Transaction), ?EditorView) → bool

// :: (EditorState, ?EditorState) → ?Transaction

// :: (EditorState, dispatch: ?(tr: Transaction)) → bool

// :: (Fragment) → ?number

// :: (Fragment) → ?{a: number, b: number}

// :: (Fragment) → Fragment

// :: (Fragment) → bool

// :: (Fragment, ?Object) → dom.DocumentFragment

// :: (Fragment, ?bool) → Slice

// :: (Fragment, ?number, ?number) → ?ContentMatch

// :: (Fragment, bool, ?number) → ?Fragment

// :: (Mapping)

// :: (Mapping, Node, ?Object) → DecorationSet

// :: (Mark) → Transaction

// :: (Mark) → bool

// :: (MarkType) → bool

// :: (MarkType, ?Object) → (state: EditorState, dispatch: ?(tr: Transaction)) → bool

// :: (Node)

// :: (Node) → Selection

// :: (Node) → StepResult

// :: (Node) → TableMap

// :: (Node) → bool

// :: (Node, ?Object) → dom.Node

// :: (Node, ?Object) → string

// :: (Node, ?bool) → Transaction

// :: (Node, Object) → Selection

// :: (Node, [Decoration]) → DecorationSet

// :: (Node, number) → NodeSelection

// :: (Node, number) → bool

// :: (Node, number, ?number) → ?number

// :: (Node, number, ?number) → CellSelection

// :: (Node, number, ?number) → TextSelection

// :: (Node, number, ?number, ?Slice) → ?Step

// :: (Node, number, NodeType) → ?number

// :: (Node, number, Slice) → ?number

// :: (Node, number, number, ?[?{type: NodeType, attrs: ?Object}]) → bool

// :: (Node, number, number, Slice) → StepResult

// :: (Node, string, (number) → string)

// :: (NodeRange) → ?number

// :: (NodeRange, NodeType, ?Object, ?NodeRange) → ?[{type: NodeType, attrs: ?Object}]

// :: (NodeRange, [{type: NodeType, attrs: ?Object}]) → this

// :: (NodeRange, number) → this

// :: (NodeType) → (state: EditorState, dispatch: ?(tr: Transaction)) → bool

// :: (NodeType) → ?ContentMatch

// :: (NodeType) → ?[NodeType]

// :: (NodeType, ?Object) → (state: EditorState, dispatch: ?(tr: Transaction)) → bool

// :: (NodeType, ?Object, ?[Mark]) → bool

// :: (Object) → (view: EditorView, event: dom.Event) → bool

// :: (Object) → EditorState

// :: (Object) → Mark

// :: (Object) → Node

// :: (Object) → Object

// :: (Object) → Plugin

// :: (Object, Object, ?Object<Plugin>) → EditorState

// :: (OrderedMap<NodeSpec>, string, ?string) → OrderedMap<NodeSpec>

// :: (Rect) → [number]

// :: (RegExp, NodeType, ?union<Object, ([string]) → ?Object>) → InputRule

// :: (RegExp, NodeType, ?union<Object, ([string]) → ?Object>, ?([string], Node) → bool) → InputRule

// :: (ResolvedPos) → ?[Mark]

// :: (ResolvedPos) → ResolvedPos

// :: (ResolvedPos) → bool

// :: (ResolvedPos, ?ResolvedPos) → CellSelection

// :: (ResolvedPos, ?number) → Selection

// :: (ResolvedPos, ResolvedPos, ?number) → Selection

// :: (ResolvedPos, number, ?bool) → ?Selection

// :: (Schema) → DOMParser

// :: (Schema) → DOMSerializer

// :: (Schema, ?Object) → Fragment

// :: (Schema, ?Object) → Slice

// :: (Schema, Object) → Mark

// :: (Schema, Object) → Node

// :: (Schema, Object) → Step

// :: (Selection) → Transaction

// :: (Slice) → Transaction

// :: (Slice) → bool

// :: (Step) → StepResult

// :: (StepMap, ?number)

// :: (Transaction)

// :: (Transaction) → EditorState

// :: (Transaction) → Transaction

// :: (Transaction) → {state: EditorState, transactions: [Transaction]}

// :: (Transaction, ?Slice)

// :: (Transaction, Node)

// :: ([Decoration]) → DecorationSet

// :: ([Mark]) → ?Mark

// :: ([Mark]) → Node

// :: ([Mark]) → Transaction

// :: ([Mark]) → [Mark]

// :: ([Mark]) → bool

// :: ([Mark], [Mark]) → bool

// :: ([Node]) → Fragment

// :: (config: {rules: [InputRule]}) → Plugin

// :: (doc: Node) → Step

// :: (dom.Document, DOMOutputSpec) → {dom: dom.Node, contentDOM: ?dom.Node}

// :: (dom.Node, ?ParseOptions) → Node

// :: (dom.Node, ?ParseOptions) → Slice

// :: (dom.Node, number, ?number) → number

// :: (getCellType: ({ row: number, col: number, node: Node}) → NodeType) → (EditorState, dispatch: ?(tr: Transaction)) → bool

// :: (mapping: Mappable) → ?Step

// :: (n: number) → StepMap

// :: (number) → (EditorState, dispatch: ?(tr: Transaction)) → bool

// :: (number) → ?Node

// :: (number) → ?dom.Node

// :: (number) → ?number

// :: (number) → ContentMatch

// :: (number) → Node

// :: (number) → Rect

// :: (number) → ResolvedPos

// :: (number) → T

// :: (number) → Transaction

// :: (number) → number

// :: (number) → {node: ?Node, index: number, offset: number}

// :: (number) → {node: dom.Node, offset: number}

// :: (number) → {type: NodeType, next: ContentMatch}

// :: (number, ?NodeType, ?Object, ?[Mark]) → this

// :: (number, ?number) → Fragment

// :: (number, ?number) → Node

// :: (number, ?number) → Slice

// :: (number, ?number) → number

// :: (number, ?number) → this

// :: (number, ?number, ?Slice) → this

// :: (number, ?number, ?[?{type: NodeType, attrs: ?Object}]) → this

// :: (number, ?number, NodeType, ?Object) → this

// :: (number, Node) → Fragment

// :: (number, NodeType, ?ContentMatch) → this

// :: (number, number) → Rect

// :: (number, number) → this

// :: (number, number) → {left: number, right: number, top: number, bottom: number}

// :: (number, number, (node: Node, pos: number, parent: Node, index: number) → ?bool, ?number)

// :: (number, number, (node: Node, start: number, parent: Node, index: number) → ?bool, ?number)

// :: (number, number, ?Fragment, ?number, ?number) → bool

// :: (number, number, ?string, ?string) → string

// :: (number, number, ?union<Mark, MarkType>) → this

// :: (number, number, DecorationAttrs, ?Object) → Decoration

// :: (number, number, Mark) → this

// :: (number, number, Node) → number

// :: (number, number, Node) → this

// :: (number, number, NodeType, ?[Mark]) → bool

// :: (number, number, Slice) → Node

// :: (number, number, Slice) → this

// :: (number, number, union<Fragment, Node, [Node]>) → this

// :: (number, number, union<Mark, MarkType>) → bool

// :: (number, string, number) → ?number

// :: (number, union<(view: EditorView, getPos: () → number) → dom.Node, dom.Node>, ?Object) → Decoration

// :: (number, union<Fragment, Node, [Node]>) → this

// :: (options: ?Object) → Plugin

// :: (other: Step) → ?Step

// :: (selection: Selection) → ?{pos: number, start: number, node: ProseMirrorNode}

// :: (selection: Selection) → boolean

// :: (step: Step) → this

// :: (string) → ?any

// :: (string) → Node

// :: (string) → OrderedMap

// :: (string) → StepResult

// :: (string) → { leading: ?string, trailing: ?string }

// :: (string, ?(prop: *) → *) → *

// :: (string, ?[Mark]) → Node

// :: (string, ?bool)

// :: (string, ?bool) → string

// :: (string, ?string, Node, ())

// :: (string, ?{ useDeprecatedLogic: bool }) → (EditorState, dispatch: ?(tr: Transaction)) → bool

// :: (string, any) → (EditorState, dispatch: ?(tr: Transaction)) → bool

// :: (string, any) → OrderedMap

// :: (string, any, ?string) → OrderedMap

// :: (string, constructor<Selection>)

// :: (string, constructor<Step>)

// :: (string, from: ?number, to: ?number) → Transaction

// :: (string, number) → string

// :: (string, string, any) → OrderedMap

// :: (union<"up", "down", "left", "right", "forward", "backward">, ?EditorState) → bool

// :: (union<Mark, MarkType>) → Transaction

// :: (union<Object, OrderedMap>) → OrderedMap

// :: (union<[T], RopeSequence<T>>) → RopeSequence<T>

// :: (union<string, MarkType>, ?Object) → Mark

// :: (union<string, NodeType>, ?Object, ?union<Fragment, Node, [Node]>, ?[Mark]) → Node

// :: (union<string, Plugin, PluginKey>) → any

// :: (union<string, Plugin, PluginKey>, any) → Transaction

// :: ({left: number, top: number}) → ?{pos: number, inside: number}

// :: ?Node

// :: ?Node The transformed document.

// :: ?NodeType

// :: ?ResolvedPos

// :: ?[Mark]

// :: ?string Text providing information about a failed step.

// :: ?{slice: Slice, move: bool}

// :: ContentMatch

// :: DecorationSet

// :: DirectEditorProps

// :: EditorProps

// :: EditorState

// :: Fragment

// :: Fragment The slice's content.

// :: InputRule Converts double dashes to an emdash.

// :: InputRule Converts three dots to an ellipsis character.

// :: Mapping

// :: MarkSpec

// :: MarkType

// :: MarkdownParser

// :: MarkdownSerializer

// :: Node

// :: Node The parent node that the range points into.

// :: Node The selected node.

// :: Node The starting document.

// :: NodeSpec

// :: NodeType

// :: Object

// :: Object The mark serializer info.

// :: Object The value of the `tokens` object used to construct

// :: Object<(MarkdownSerializerState, Node)> The node serializer

// :: Object<(node: Node) → DOMOutputSpec>

// :: Object<?(mark: Mark, inline: bool) → DOMOutputSpec>

// :: Object<MarkType>

// :: Object<NodeType>

// :: ResolvedPos

// :: ResolvedPos A position along the end of the content. See

// :: ResolvedPos A resolved position along the start of the

// :: RopeSequence

// :: Schema

// :: SchemaSpec

// :: Selection

// :: Slice

// :: Transaction

// :: [Mark]

// :: [Mark] The empty set of marks.

// :: [Node]

// :: [ParseRule]

// :: [Plugin]

// :: [SelectionRange]

// :: [StepMap]

// :: [Step]

// :: [number] A width * height array with the start position of

// :: bool

// :: bool Tells you whether the position was deleted, that is,

// :: class extends Mappable

// :: class<T> A rope sequence is a persistent sequence data structure

// :: dom.Element

// :: number

// :: number The depth of the node that this range points into.

// :: number The end index of the range in the parent node.

// :: number The mapped version of the position.

// :: number The offset this position has into its parent node.

// :: number The open depth at the end.

// :: number The open depth at the start.

// :: number The position at the end of the range.

// :: number The position at the start of the range.

// :: number The position that was resolved.

// :: number The start index of the range in the parent node.

// :: number The table's height

// :: number The width of the table

// :: string

// :: union<dom.Document, dom.DocumentFragment>

// ::- A DOM parser represents a strategy for parsing DOM content into

// ::- A DOM serializer knows how to convert ProseMirror nodes and

// ::- A [`Selection`](http://prosemirror.net/docs/ref/#state.Selection)

// ::- A collection of [decorations](#view.Decoration), organized in

// ::- A configuration of a Markdown parser. Such a parser uses

// ::- A document schema. Holds [node](#model.NodeType) and [mark

// ::- A fragment represents a node's collection of child nodes.

// ::- A key is used to [tag](#state.PluginSpec.key)

// ::- A mark is a piece of information that can be attached to a node,

// ::- A node selection is a selection that points at a single node.

// ::- A selection type that represents selecting the whole document

// ::- A slice represents a piece cut out of a larger document. It

// ::- A specification for serializing a ProseMirror document as

// ::- A step object represents an atomic change. It generally applies

// ::- A table map describes the structore of a given table. To avoid

// ::- A text selection represents a classical editor selection, with

// ::- Abstraction to build up and track an array of

// ::- Add a mark to all inline content between two positions.

// ::- An editor state transaction, which can be applied to a state to

// ::- An editor view manages the DOM structure that represents an

// ::- An object representing a mapped position with extra

// ::- Decoration objects can be provided to the view through the

// ::- Instances of this class represent a match state of a node

// ::- Like nodes, marks (which are associated with nodes to signify

// ::- Node types are objects allocated once per `Schema` and used to

// ::- Persistent data structure representing an ordered mapping from

// ::- Plugins bundle functionality that can be added to an editor.

// ::- Remove a mark from all inline content between two positions.

// ::- Replace a part of the document with a slice of content, but

// ::- Replace a part of the document with a slice of new content.

// ::- Represents a flat range of content, i.e. one that starts and

// ::- Represents a selected range in a document.

// ::- The result of [applying](#transform.Step.apply) a step. Contains either a

// ::- This class represents a node in the tree that makes up a

// ::- This is an object used to track state and expose

// ::- You can [_resolve_](#model.Node.resolve) a position to get more

// > blockquote

// @@iterator function is called on it. Some browsers' implementations of the

// @ts-ignore

// A .throw or .return when the delegate iterator has no .throw

// A Generator should always return itself as the iterator object when the

// A backdrop key mapping used to make sure we always suppress keys

// A collection of DOM events that occur within the editor, and callback functions

// A command function that redoes the last undone change, if any.

// A command function that undoes the last change, if any.

// A container holding the node's children.

// A custom `update` method gets to decide whether the update goes

// A description of a DOM structure. Can be either a string, which is

// A dummy desc used to tag trailing BR or span nodes created to work

// A fresh object to act as the ID for this upload:

// A lightweight, document-independent representation of a selection.

// A link back to the `Schema` the node type belongs to.

// A list of substrings of CSS properties used to find transition events that

// A map describing the deletions and insertions made by a step, which

// A map from mark names to mark type objects.

// A mapping represents a pipeline of zero or more [step

// A mapping with the maps for each of the steps in this transform.

// A new image is provided, resolve it.

// A parser parsing unextended [CommonMark](http://commonmark.org/),

// A plugin spec may provide a state field (under its

// A ref and forceUpdate for refocus, b/c we only want to trigger when needed

// A resolved position pointing _in front of_ the anchor cell (the one

// A resolved position pointing in front of the head cell (the one

// A serializer for the [basic schema](#schema).

// A set of attributes to add to a decorated node. Most properties

// A set of marks to apply to the next input. Will be null when

// A value that describes how to parse a given DOM node or inline

// A widget desc represents a widget decoration, which is a DOM node

// API

// According to specification a ResizeObserver is deleted by the garbage

// According to the specification following properties are not writable

// Acts like [`splitBlock`](#commands.splitBlock), but without

// Add a DOM node to the content. Text is inserted as text node,

// Add a column at the given position in a table.

// Add a flag to suppress these warnings for this special case.

// Add a key after the given key. If `place` is not found, the new

// Add a mark to the set of stored marks.

// Add a new key to the end of the map.

// Add a new key to the start of the map.

// Add a node at the current position.

// Add a second list item with an empty default start node

// Add a step map to the end of this mapping. If `mirrors` is

// Add a table row after the selection.

// Add a table row before the selection.

// Add all child nodes between `startIndex` and `endIndex` (or the

// Add all the step maps in a given mapping to this one (preserving

// Add listeners if they haven't been added yet.

// Add new frontier nodes for any open nodes at the end.

// Add the given array of decorations to the ones in the set,

// Add the given mark to the inline content between `from` and `to`.

// Add the given text to the document. When escape is not `false`,

// Add the necessary cells, using a heuristic for whether to add the

// Adding or removing a mark

// Adding to a selection that starts in another cell (causing a

// Adding to an existing cell selection

// Adds the given mark to the set of active marks.

// Adds the given text to the current position in the document,

// Adjust decoration positions to changes made by the transaction:

// Adjust the cursor to the dropped position...

// Algorithm for 'placing' the elements of a slice into a gap:

// All elements equally likely...

// All else failed, just try to get a rectangle for the target node

// All nodes marked [selectable](#model.NodeSpec.selectable) can be

// All non-basic code points < n have been handled already. Find the next

// Allowed by RFCs, but cause of XSS attacks.  Always escape these.

// Already observing node.

// An array describes a DOM element. The first value in the array

// An atomic node (e.g. Image) is selected.

// An editable DOM node containing the document. (You probably

// An empty fragment. Intended to be reused whenever a node doesn't

// An event was generated for a text change that didn't change

// An expando property on the DOM node provides a link back to its

// An object describing a schema, as passed to the [`Schema`](#model.Schema)

// An object for storing whatever values modules may want to

// An object mapping attribute names to values. The kind of

// An object mapping the schema's node names to node type objects.

// An optional array of problems (cell overlap or non-rectangular

// And put a sub-ProseMirror into that

// And the alphabetic keys

// And then down into the next node

// And, if no more callbacks then stop observing the node

// Any elements after that (including the 2nd if it's not an attribute

// Append a tooltip to the outer node

// Append the inverse of the given mapping to this one.

// Apply a CSS selector.

// Apply a new step in this transform, saving the result. Throws an

// Apply the given transaction to produce a new state.

// Apply the joining algorithm

// Apply the latest event from one branch to the document and shift the event

// As a workaround, use cWM and cWRP to invoke the new static lifecycle.

// As a workaround, use cWU to invoke the new lifecycle.

// As long as there's unplaced content, try to place some of it.

// Assign the result of the finished delegate to the temporary

// AsyncIterator objects; they just return a Promise for the value of

// At the start of this parent, look at next one

// Attribute descriptors

// AttributeSpec:: interface

// Avoid `split(regex)` for IE8 compatibility. See #17.

// Avoid propagating failures to Promises returned by later

// BR node for some reason doesn't always work (#1073). On Safari,

// Back slashes before the query string get converted to forward slashes

// Back up if the node directly above openStart, or the node above

// Based on the premise that every string can be "surrounded" by empty strings (e.g., "" + "a" + "" + "b" + "" === "ab"):

// Be forgiving, per 25.3.3.3.3 of the spec:

// Because for <= 15.x versions this might be a "prevContext" object.

// Because get-snapshot might return a falsy value.

// Because they would work differently between older and newer (16.3+) versions of React.

// Besides, it's as well not necessary as the <html> itself neither has

// Binding "this" is important for shallow renderer support.

// Bindings should map key names to [command](#commands)-style

// Bitfield to track which aspects of the state were updated by

// Both positions in the same text node -- simply insert text

// Browser (in caretPosition/RangeFromPoint) will agressively

// Build a command that splits a non-empty textblock at the top level

// Build a fragment containing empty versions of the structure

// Build a fragment from an array of nodes. Ensures that adjacent

// Build a serializer using the [`toDOM`](#model.NodeSpec.toDOM)

// Build an input rule for automatically wrapping a textblock when a

// Build an input rule that changes the type of a textblock when the

// Build up a tree that corresponds to a set of decorations. `offset`

// By default, a node is rendered using the `toDOM` method from the

// By default, document nodes are rendered using the result of the

// By default, if there's a node with the same type above the newly

// By this condition we can catch all non-replaced inline, hidden and

// CSP to forbid Function, and you're not willing to fix either of those

// Cache

// Cache the length

// Calculate max size from boundary settings

// Calculate new size

// Call [`Node.replace`](#model.Node.replace) with the given

// Call `f` for every child node, passing the node, its offset

// Call delegate.iterator[context.method](context.arg) and handle the

// Call the given callback for every descendant node. Doesn't

// Call the given callback for every descendant node. The callback

// Call the given function for each element between the given

// Call the given function for each key/value pair in the map, in

// Call this.constructor.gDSFP to support sub-classes.

// Called for leaf DOM nodes that would otherwise be ignored

// Called when the node view is removed from the editor or the whole

// Calls the given function on each of the changed ranges included in

// Can't replace the whole document, so remove 0 if it's present

// Can't update if nextDOM is or contains this.lock, except if

// Case: User is not an owner

// Case: `matching` is set to `dissimilar`

// Change the type, attributes, and/or marks of the node at `pos`.

// Characters that are never ever allowed in a hostname.

// Cheap elimination

// Check if the index is valid

// Check if the string starts with a forward slash...

// Check whether any plugin in the given state has a

// Check whether splitting at the given position is allowed.

// Check whether the cursor is at the end of a cell (so that further

// Check whether the given mark type is allowed in this node.

// Check whether this node and its descendants conform to the

// Check whether this node's markup correspond to the given type,

// Check whether vertical selection motion would involve node

// Checks if current selection is a `CellSelection`.

// Checks whether it would be reasonable to apply a given mark type to

// Chrome Android when after an uneditable node.

// Chrome Android will sometimes, during composition, report the

// Chrome gets confused by <br contenteditable=false>

// Chrome has a rather weird rounding of "client" properties.

// Chrome sometimes starts misreporting the selection, so this

// Chrome will sometimes treat a node selection as a

// Clear all DOM statefulness of the last node selection.

// Client width & height properties can't be

// Clip or extend (repeat) the given set of cells to cover the given

// Close and return the node that is currently on top of the stack.

// Close the block for the given node.

// Close the marks that need to be closed

// Closes the popup.

// Code content is represented as a single token with a `content`

// Collect observers that have active observations.

// Combine a number of command functions into a single function (which

// Command function that removes the selected columns from a table.

// Command to add a column after the column with the selection.

// Command to add a column before the column with the selection.

// Commands for tables:

// Compare the markup (type, attributes, and marks) of this node to

// Compare this fragment to another one.

// Compiles an NFA as produced by `nfa` into a DFA, modeled as a set

// Compressing a branch means rewriting it to push the air (map-only

// Compute a table map.

// Compute the width and height of a set of cells, and make sure each

// Computes the amount of (end) open nodes at the end of the

// Concatenates all the text nodes found in this fragment and its

// Construct a DOM parser using the parsing rules listed in a

// Construct an NFA from an expression as returned by the parser. The

// Continue running updates if changes have been detected as there might

// Continuing an existing cross-cell selection

// Controls whether, when a selection of this type is active in the

// Convenience function for adding list-related node types to a map

// Convert a slice to a JSON-serializable representation.

// Convert the input in UCS-2 to Unicode

// Convert the selection to a JSON representation. When implementing

// Convert this mark to a JSON-serializeable representation.

// Copy chrome, IE, opera backslash-handling behavior.

// Copyright Joyent, Inc. and other Node contributors.

// Could be a NodeSelection or CellSelection.

// Covered by a rowspan cell

// Create ResizeObserverEntry instance for every active observation.

// Create a JSON-serializeable representation of this fragment.

// Create a JSON-serializeable representation of this step. When

// Create a `Node` of this type. The given attributes are

// Create a command function that toggles the given mark with the

// Create a command to lift the list item around the selection up into

// Create a command to sink the list item around the selection down

// Create a composition view for the orphaned nodes

// Create a copy of this node with only the content between the

// Create a copy of this node, with the given set of marks instead

// Create a failed step result.

// Create a fragment from something that can be interpreted as a set

// Create a gap cursor plugin. When enabled, this will capture clicks

// Create a group for the given array of decoration sets, or return

// Create a keymap plugin for the given set of bindings.

// Create a map containing all the keys in this map that don't

// Create a map that moves all positions by offset `n` (which may be

// Create a mapping that maps only through a part of this one.

// Create a mark of this type. `attrs` may be `null` or an object

// Create a mark with the given type and attributes.

// Create a new branch with the given transform added.

// Create a new fragment by appending the given node to this

// Create a new fragment by prepending the given node to this

// Create a new fragment containing the combined content of this

// Create a new fragment in which the node at the given index is

// Create a new map by appending the keys in this map that don't

// Create a new map by prepending the keys in this map that don't

// Create a new map by replacing the value of `key` with a new

// Create a new node with the same markup as this node, containing

// Create a new set that contains the decorations in this set, minus

// Create a new state based on this one, but with an adjusted set of

// Create a new state.

// Create a node in this schema. The `type` may be a string or a

// Create a node selection from non-resolved positions.

// Create a plugin that, when added to a ProseMirror instance,

// Create a properly sorted mark set from null, a single mark, or an

// Create a rope repesenting a sub-sequence of this rope.

// Create a rope representing the given array, or return the rope

// Create a set of decorations, using the structure of the given

// Create a slice from a fragment by taking the maximum possible

// Create a successful step result.

// Create a text node in the schema. Empty text nodes are not

// Create a text selection from non-resolved positions.

// Create a view desc for the top-level document node, to be exported

// Create an input rules plugin. When enabled, it will cause text

// Create an inverted version of this map. The result can be used to

// Create an inverted version of this mapping.

// Create an inverted version of this step. Needs the document as it

// Create and dispatch a cell selection between the given anchor and

// Creates a [plugin](http://prosemirror.net/docs/ref/#state.Plugin)

// Creates a new popup.

// Creates a node decoration. `from` and `to` should point precisely

// Creates a widget decoration, which is a DOM node that's shown in

// Creates an inline decoration, which adds the given attributes to

// Crude approximation of backspace behavior when no command handled it

// Custom probabilities...

// Cut out the part of the document between the given positions, and

// Cut out the sub-fragment between the two given positions.

// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR

// DOM resizing. Until the observe() method is used again.

// DOM, but sometimes—for example when interpreting an event

// DOMOutputSpec:: interface

// DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Shadow_DOM)

// Debounce the scroll handler.

// Decode a generalized variable-length integer into `delta`,

// DecorationAttrs:: interface

// Defaults to false.

// Define Generator.prototype.{next,throw,return} in terms of the

// Define the unified helper method that is used to implement .next,

// Delete all callbacks for the node.

// Delete the content between the given positions.

// Delete the given range, expanding it to cover fully covered

// Delete the selection, if there is one.

// Delete the selection.

// Deletes the table around the selection, if any.

// Deletion

// Deletions on IE11 fire their events in the wrong order, giving

// Deliberately forget the last sent value so that we don't

// Deliver notifications in a separate cycle in order to avoid any

// Depending on the detected platform, this will hold

// Deserialize a JSON representation of a state. `config` should

// Deserialize a fragment from its JSON representation.

// Deserialize a mark from its JSON representation. This method is

// Deserialize a node from its JSON representation.

// Deserialize a node from its JSON representation. This method is

// Deserialize a slice from its JSON representation.

// Deserialize a step from its JSON representation. Will call

// Deserialize the JSON representation of a selection. Must be

// Destroy all remaining children in `this.top`.

// Destroy and remove the children between the given indices in

// Detect whether transition may affect dimensions of an element.

// Determines whether the given [context

// Determines whether the given node may be selected as a node

// DirectEditorProps:: interface extends EditorProps

// Dispatch a transaction. Will call

// Dispatch the exception by looping back around to the

// Do nothing if current environment doesn't have the Element interface.

// Do nothing if element is already being observed.

// Do nothing if element is not being observed.

// Do nothing if observer doesn't have active observations.

// Do nothing if running in a non-browser environment or if listeners

// Don't continue looking further up if the parent node

// Don't do anything if this is the top of the list

// Don't trust event.key in Chrome when there are modifiers until

// Don't use UCS-2

// Done because IE will fire a selectionchange moving the selection

// Drop active composition after 5 seconds of inactivity on Android

// Drop all remaining descs after the current position.

// Drop empty open nodes

// Dummy constructor functions that we use as the .constructor and

// E.g. for an element with content width of 314.2px it sometimes gives

// EXPORTS //

// Edge just doesn't move the cursor forward when you start typing

// Edge sometimes produces wrong names (Issue #3)

// EditorProps:: interface

// EditorView)` arguments, and should return true when they've handled

// Either find an existing desc that exactly matches this node,

// Else, if it continues in the row below, it has to be moved down

// Empty textblock

// Ensure all markup that isn't allowed in the new node type is cleared

// Ensure the current content ends with a newline.

// Error if any of these lifecycles are present,

// Error type raised by [`Node.replace`](#model.Node.replace) when

// Escape the given string so that it can safely appear in Markdown

// Event already had some effect

// Example: `rotate(1.57rad) translateZ(0px)`;

// Exception thrown outside of any try block that could handle

// Experimental kludge to allow opt-in re-parsing of nodes

// Export existing implementation if available.

// Exports

// Expose public methods of ResizeObserver.

// Extract the plugin's state field from an editor state.

// FIXME maybe descend mark views to parse a narrower range?

// FIXME the assumption that this can always return the current

// FIXME this is no longer needed as of prosemirror-view 1.9.0,

// FIXME we'll need some awareness of text direction when scanning for selections

// FUNCTIONS //

// Feature-detects support for .focus({preventScroll: true}), and uses

// Figure out which joinable points exist inside those ranges,

// Fill in the digit keys

// Find a piece of text in an inline fragment, overlapping from-to

// Find a position on the start spine of `this.unplaced` that has

// Find a set of wrapping node types that would allow a node of the

// Find a valid cursor or leaf node selection near the given

// Find a valid cursor or leaf node selection starting at the given

// Find all decorations in this set which touch the given range

// Find an ancestor of the given position that can be joined to the

// Find out whether the selection is at the end of a textblock when

// Find the (direct) child node after the given offset, if any,

// Find the (direct) child node before the given offset, if any,

// Find the DOM node that represents the document node after the

// Find the DOM position that corresponds to the given document

// Find the child nodes that still correspond to a single node,

// Find the cursor or leaf node selection closest to the end of the

// Find the cursor or leaf node selection closest to the start of

// Find the desc for the node after the given pos, if any. (When a

// Find the dimensions of the cell at the given position.

// Find the document position that corresponds to a given DOM

// Find the first position at which this fragment and another

// Find the first position, searching from the end, at which this

// Find the index and inner offset corresponding to a given relative

// Find the left side of the cell at the given position.

// Find the next cell in the given direction, starting from the cell

// Find the node directly after the given position.

// Find the prefix of the mark set that didn't change

// Find the table map for the given table node.

// Find the text in the focused node in the node, stop if it's not

// Finds a position at or around the given position where the given

// Finds the offset of the step map that mirrors the map at the

// Finish the basic string - if it is not empty - with a delimiter

// Firefox returns bad results (the position before the space)

// Firefox sometimes fires spurious events for null/empty styles

// Firefox throws for this call in hard-to-predict circumstances (#994)

// Firefox will raise 'permission denied' errors when accessing

// Firefox will sometimes return offsets into <input> nodes, which

// First, make 100% sure that any "autoEscape" chars get

// Fix #168

// Fix the given table, if necessary. Will append to the transaction

// Focus the editor.

// Followed by a partially overlapping larger span. Split that

// Following conditions are required to handle Internet Explorer which

// Following steps can't be applied to the document's root element as its

// For block nodes, this represents the space taken up by their

// For boundary

// For columns that have defined widths, but whose widths disagree

// For custom components provide additional, non-DOM, props;

// For deprecated behavior pass `useDeprecatedLogic` in options with true.

// For each code that doesn't have a shift-equivalent, copy the base name

// For lockAspectRatio case

// For node types where all attrs have a default value (or which don't

// For parent boundary

// For positions that are have either a different cell or the end

// For target boundary

// For target(html element) boundary

// For text nodes, this contains the node's text content.

// For the native GeneratorFunction constructor, the best we can

// Force the update of observations.

// Furthermore, the keydown event timestamp must be close to the compositionEndedAt timestamp.

// Gather all decorations from the remaining marked children

// Gather the serializers in a schema's mark specs into an object.

// Gather the serializers in a schema's node specs into an object.

// Gecko will do odd things when the selection is directly in front

// GenStateExecuting and loop back for another invocation.

// Generate an integer index on the interval: [0,i]

// Get a [bookmark](#state.SelectionBookmark) for this selection,

// Get a rectangular area of cells from a slice, or null if the outer

// Get all text between positions `from` and `to`. When

// Get cell positions for first row or first column

// Get leading and trailing whitespace from a string. Values of

// Get the _n_​th outgoing edge from this node in the finite

// Get the active plugin with this key, if any, from an editor

// Get the child node at the given index, if it exists.

// Get the child node at the given index. Raise an error when the

// Get the child node at the given index. Raises an error when the

// Get the content match in this node at the given index.

// Get the content of this selection as a slice.

// Get the decorations associated with the current props of a view.

// Get the document root in which the editor exists. This will

// Get the first matching node type at this match position that can

// Get the markdown string for a given opening or closing mark.

// Get the marks after the current position, if any, except those

// Get the marks at this position, factoring in the surrounding

// Get the maxWidth that the image could be resized to.

// Get the node directly after the position, if any. If the position

// Get the node directly before the position, if any. If the

// Get the plugin's state from an editor state.

// Get the position at the given index in the parent node at the

// Get the rectangle spanning the two given cells.

// Get the set of nodes reachable by null edges from `node`. Omit

// Get the step map that represents the changes made by this step,

// Given a pair of viewport coordinates, return the document

// Given a position in the document model, get a bounding box of the

// Given a set of bindings (using the same format as

// Given a set of marks, create a new set which contains this one as

// Given an x,y position on the editor, get the position in the document.

// Given two same-length, non-empty fragments of inline content,

// Goes over the values of a prop, first those provided directly,

// Group transforms that occur in quick succession into one event.

// HACK: Apply position adjustment

// HACK: MouseEvent does not have `which` from flow-bin v0.68.

// HACK: To get `react-draggable` state x and y.

// Handle the basic code points

// Handle the basic code points: let `basic` be the number of input code

// Handle the case where overwriting a selection by typing matches

// Helper class for incrementally updating a tree of mark descs and

// Helper for creating a schema that supports tables.

// Helper for defining the .next, .throw, and .return methods of the

// Helper for iterating through the nodes in a document that changed

// Helper to get the selected rectangle in a table, if any. Adds table

// Hit start of document

// Holds `true` when a

// How a prop is resolved depends on the prop. Handler functions are

// ID to attach to its JSON representation. Use this method to

// IDNA Support: Returns a punycoded representation of "domain".

// IE 8 has a broken Object.defineProperty that only works on DOM objects.

// IE and Edge's clipboard interface is completely broken

// IE11 gives us incorrect next/prev siblings for some

// IE11 has very broken mutation observers, so we also listen to DOMCharacterDataModified

// IE11 sometimes weirdly moves the DOM selection around after

// IE11 will insert a non-breaking space _ahead_ of the space after

// IE11 will sometimes (on backspacing out a single character

// INFO: Apply x and y position adjustments caused by resizing to draggable

// INFO: Make uncontorolled component when resizing to control position by setPostion.

// INFO: To calculate parent width with flex layout

// INFO: To set bounds in `lock aspect ratio with bounds` case. See also that story.

// INFO: Use original width or height if set auto.

// Ideally, the image should not be wider than its containing element.

// If a block node is selected, create an empty paragraph before (if

// If a higher row spans past our clone row, bump the higher row to cover this new row too.

// If a rejected Promise was yielded, throw the rejection back

// If an exception is thrown from innerFn, we leave state ===

// If closing to `$to` succeeded, create a step

// If context.method was "throw" but the delegate handled the

// If dom is outside of this desc's nodeDOM, don't count it.

// If enqueue has been called before, then we want to wait until

// If it's an obj, this is a no-op.

// If maybeInvokeDelegate(context) changed context.method from

// If new component APIs are defined, "unsafe" lifecycles won't be called.

// If no state update ends up happening, reset the selection.

// If nodes within the same range have the same mark, returns the first node.

// If not, try to move the selected block closer to the next one in

// If obj.hasOwnProperty has been overridden, then calling

// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.

// If that fails, either increase the open score of the unplaced

// If the DOM position is in the content, use the child desc after

// If the `after` flag is true of there is no node before, make

// If the cursor is in an empty textblock that can be lifted, lift the

// If the delegate iterator has a return method, give it a

// If the dispatched exception was caught by a catch block,

// If the image is not cropped.

// If the next node is a desc matching this widget, reuse it,

// If the next node is an atom, delete it

// If the node above has no content and the node below is

// If the node before is an atom, delete it

// If the node below has no content and the node above is

// If the node that the selection points into is written to,

// If the parent types match, and the entire node was moved, and

// If the selection falls entirely in a child, give it to that child

// If the selection is empty and at the start of a textblock, try to

// If the selection is empty and the cursor is at the end of a

// If the selection is in a node whose type has a truthy

// If the textblock is all LTR, or the browser doesn't support

// If there is an @ in the hostname, then non-host chars *are* allowed

// If there is no node after this, there's nothing to do

// If there is no node before this, try to lift

// If this cell starts in the row above, simply reduce its rowspan

// If this desc be updated to match the given node decoration,

// If this is non-null, this item is the start of a group, and

// If this is part of a col-spanning cell

// If this item is the inverse of a previous mapping on the stack,

// If this looks like the effect of pressing Enter (or was recorded

// If this position falls inside a col-spanning cell

// If this starts with whitespace, and there is no node before it, or

// If we searched the string to no avail or if the first letter is not `/`, assume that the string is not of the form `/[...]/[guimy]`:

// If we're copying a row with rowspan somewhere, we dont want to copy that cell

// If whitespace has to be expelled from the node, adjust

// If you just need a quick toggle

// If you want the commands defined in this module to apply to your

// Ignore mutations inside nodes that were already noted as inserted

// Ignore on fail

// Ignore the finally entry if control is not jumping to a

// In an empty block. If this is a nested list, the wrapping

// In an empty parent, return the empty array

// In email addresses, only the domain name should be punycoded. Leave

// In firefox, if the cursor is after but outside a marked node,

// In pass 1, if the next node matches, or there is no next

// In some browsers (only in Firefox, actually) CSS width & height

// In some cases with Chrome the selection is empty after calling

// In which Safari (and at some point in the past, Chrome) does really

// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,

// Index into `this.top`'s child array, represents the current

// Indicate success

// Indicate that the editor should scroll the selection into view

// Indicates whether the editor is currently [editable](#view.EditorProps.editable).

// Indicates whether the selection contains any content.

// Initialize progress if not already set:

// Initialize the state

// Inline, not in text node (this is not Bidi-safe)

// Insert `n` at position `i` of the output

// Insert the given content at the given position.

// Insert the given set of cells (as returned by `pastedCells`) into a

// Insert the node as a newly created node desc.

// Inspect all tables in the given state's document and return a

// Invoke a callback for all descendant nodes between the given two

// Invoke a callback for all descendant nodes recursively between

// Issue #867 / #1090 / https://bugs.chromium.org/p/chromium/issues/detail?id=903821

// It only converts parts of the domain name that

// It will pass a snapshot value to did-update though.

// Iterate from the end of the fragment and array of descs to find

// Iterates over parent nodes, returning the closest table node.

// Iterator interface in terms of a single ._invoke method.

// JSON-serialization identifier using

// Join the blocks around the given position. If depth is 2, their

// Join the joinable points

// Join the selected block or, if there is a text selection, the

// Join the selected block, or the closest ancestor of the selection

// Key names may be strings like `"Shift-Ctrl-Enter"`—a key

// Kludge to allow the view to track mappings between different

// Kludge to kill 'control selection' in IE11 when selecting an

// Kludge to prevent issues due to the fact that the whole

// Kludge to work around Webkit not allowing a selection to start/end

// Kludge to work around directly nested list nodes produced by some

// Kludge used to work around a Chrome bug

// Later on, put the first path part into the host field.

// Let the image resize freely.

// Lift the selected block, or the closest ancestor block of the

// Like [`create`](#model.NodeType.create), but check the given content

// Like [`create`](#model.NodeType.create), but see if it is necessary to

// Like nodes, fragments are persistent data structures, and you

// List markers in Mobile Safari will mysteriously disappear

// Look up a handler for the given node. If none are found, return

// Loop over possible expansion levels, starting with the

// MAIN //

// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN

// MODULES /

// MODULES //

// Main

// Main decoding loop: start just after the last delimiter if any basic code

// Main encoding loop:

// Make sure a table has at least the given width and height. Return

// Make sure a textblock looks and behaves correctly in

// Make sure all handlers get registered

// Make sure all nodes above this.open are finished and added to

// Make sure scrollbar width isn't included in the rectangle

// Make sure the current stored marks or, if that is null, the marks

// Make sure the cursor isn't directly after one or more ignored

// Make sure the cursor isn't directly before one or more ignored

// Make sure the given line (left, top) to (left, bottom) doesn't

// Make sure the given line (left, top) to (right, top) doesn't cross

// Make sure the wrapping mark descs match the node's marks.

// Make the head cell the first range, so that it counts as the

// Map a position through this mapping, returning a mapping

// Map a position through this mapping.

// Map the given functions over the elements of the rope, producing

// Map the set of decorations in response to a change in the

// Map this selection through a [mappable](#transform.Mappable) thing. `doc`

// Map this step through a mappable thing, returning either a

// Mappable:: interface

// Mark the children that are directly touched by changes, and

// Mark this node as being the selected node.

// Mark views only support `dom` and `contentDOM`, and don't support

// MarkSpec:: interface

// Markdown/CommonMark text.

// Marks

// Marks applied to its children

// Marks applied to this node itself

// Marks that can't apply here, but will be used in children if possible

// Match a node type, returning a match after that node if

// May have to protect focused DOM from being changed if a composition is active

// Merge the list items into a single big item

// Merge the selected cells into a single cell. Only available when

// Minimum delay before invoking the update of observers.

// Modal is handled separately at `onClick`

// Modifiers can be given in any order. `Shift-` (or `s-`), `Alt-` (or

// Module

// Most transforming methods return the `Transform` object itself, so

// Mounting

// Move content from the unplaced slice at `sliceDepth` to the

// Move dirty info to nearest node view

// Move the selection to the node wrapping the current selection, if

// Move up the DOM as far as possible when in inline context.

// Moving out of the initial cell -- start a new cell selection

// Must read oldChildren because children was tagged with -1

// NFA is represented as an array of states, which are themselves

// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,

// Need to wrap the cursor in mark nodes different from the ones in the DOM context

// Negative numbers represent not expansion over the whole node at

// Nested Marks with same type

// New steps are defined by creating classes that extend `Step`,

// Newer versions of React will ignore that lifecycle if gSBU exists.

// Newer versions of React will ignore these lifecycles if gDSFP exists.

// NodeSpec:: interface

// NodeView:: interface

// Nodes are considered joinable when they are of the same type and

// Nodes are persistent data structures. Instead of changing them, you

// Normalize by dropping open parent nodes

// Not in a cell, let the default behavior happen.

// Not sure about the optimal order of these conditions:

// Note that all referencing and parsing is done with the

// Note that any invalid chars are also handled, but these

// Note that simple async functions are implemented on top of

// Note that unlike typical NFAs, the edge ordering in this one is

// Note that, due to the fact that required nodes can always be

// Note: We intentionally don't use bit shift operators to en- and

// Note: ["return"] must be used for ES3 parsing compatibility.

// Note: we skip the first element, as no further swaps are possible given that all other indices are excluded from swapping...

// Now we have a portion which is definitely the auth.

// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF

// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE

// Object used to store metadata properties for the transaction.

// Object used to track the context of a running parse.

// Objects returned as node views must conform to this interface.

// Older versions will require our polyfilled will-update value.

// On Firefox, using Selection.collapse to put the cursor after a

// On Japanese input method editors (IMEs), the Enter key is used to confirm character

// On Safari, for reasons beyond my understanding, adding an input

// On iOS, if we preventDefault enter key presses, the virtual

// Only checks the top-left point.

// Only do something if both the selection and a focused text node

// Only escape the characters between the `/`:

// Only for Firefox

// Only normalize list elements when lists in the schema can't directly contain themselves

// Only try wrapping nodes (pass 2) after finding a place without

// Open a node of the given type

// Open the marks that need to be opened

// Optimization -- avoid work if it's obvious that it's not needed.

// Optional information to store with the decoration. It

// Or just add it as a new desc.

// Or try updating the next desc to reflect this node.

// Otherwise, if shift is active, also try the binding with the

// Otherwise, use various heuristics, falling back on the bias

// Output any previously expelled trailing whitespace outside the marks

// PROPERTIES //

// Parameterized commands

// Parse a document from the content of a DOM node.

// Parse a string as [CommonMark](http://commonmark.org/) markup,

// ParseOptions:: interface

// ParseRule:: interface

// Parses the content of the given DOM node, like

// Patch up this.children to contain the composition view

// Permission is hereby granted, free of charge, to any person obtaining a

// PluginSpec:: interface

// Pop the latest event off the branch's history and apply it

// Populates the default ARIA attributes here.

// Prefer anchoring to end when Backspace is pressed

// Prefer using a weak map to cache table maps. Fall back on a

// Prepare the state for writing output (closing closed paragraphs,

// Prepare the table to be large enough and not have any cells

// Prepend an array or other rope to this one, returning a new rope.

// Property accessors are not being used as they'd require to define a

// Props are configuration values that can be passed to an editor view

// ProseMirror document. So a document is an instance of `Node`, with

// ProseMirror to miss the change (see #930)

// Pull that off.

// Put the new selection at the position after the inserted

// Put this after the other two cases because it simplifies the booleans

// Queries whether a given mark type is

// Query whether the given position shares the same parent node.

// Query whether the view has focus.

// RFC 2396: characters not allowed for various reasons.

// RFC 3490 separators

// Rather than returning an object with a next method, we keep

// Re-create the same nodes with same attrs, dropping the node content.

// React <= 16.2 does not support getSnapshotBeforeUpdate.

// React <= 16.2 does not support static getDerivedStateFromProps.

// React may warn about cWM/cWRP/cWU methods being deprecated.

// Read a slice of content from the clipboard (or drop data).

// Reassemble:

// Record a transformation in undo history.

// Recovery values encode a range index and an offset. They are

// Rectangle's properties are not writable and non-enumerable.

// Reference: RFC 3986, RFC 1808, RFC 2396

// Regardless of whether this script is executing as a CommonJS module

// Reject immediately following calls.

// Remaining children must be collected and rebuilt into the appropriate structure

// Remove a DOM node and return its next sibling.

// Remove a mark or mark type from the set of stored marks.

// Remove a subtree of the element tree that has been touched

// Remove listeners if controller has no connected observers.

// Remove marks from `hard_break` that are the last node inside

// Remove marks from inline nodes between `from` and `to`. When `mark`

// Remove observer if it's present in registry.

// Remove selected node marking from this node.

// Remove the passed in callback from the callbacks of the observed node

// Remove the placeholder:

// Remove the sample observations:

// Remove the selected rows from a table.

// Remove this mark from the given set, returning a new set. If this

// Remove unknown props, see also https://reactjs.org/warnings/unknown-prop.html

// Removes all marks and nodes from the content of the node at `pos`

// Removes the editor from the DOM and destroys all [node

// Removes the given mark from the set of active marks.

// Removes the marks that are not allowed in this node from the given set.

// Render a block, prefixing each line with `delim`, and the first

// Render a node's content as a list. `delim` should be the extra

// Render an [output spec](#model.DOMOutputSpec) to a DOM node. If

// Render the contents of `parent` as block nodes.

// Render the contents of `parent` as inline content.

// Render the given node as a block.

// Render the node. Special case code marks, since their content

// Repeat the given string `n` times.

// Replace a range of the document with a given slice, using `from`,

// Replace range from-to in an array of view descs with replacement

// Replace the current selection with the given slice.

// Replace the given range with a node, but use `from` and `to` as

// Replace the given range with the given content, which may be a

// Replace the given range, or the selection if no range is given,

// Replace the part of the document between `from` and `to` with the

// Replace the part of the document between the given positions with

// Replace the selection with a placeholder.

// Replace the selection with a placeholder:

// Replace the selection with a slice or, if no slice is given,

// Replace the selection with the given node, appending the changes

// Replace the selection with the given node. When `inheritMarks` is

// ReplaceError:: class extends Error

// Represent delta as a generalized variable-length integer

// Reset the scroll position of the editor's parent nodes to that what

// Resetting context._sent for legacy support of Babel's

// ResizeObserver are tracking the same element and the callback of one

// ResizeObserver instance from receiving notifications of

// Resolve the given position in the document, returning an

// Restore original position

// Restore the previous selection

// Resume execution at the desired location (see delegateYield).

// Retrieve a metadata property for a given name or plugin.

// Retrieve the element at the given position from this rope.

// Retrieve the value stored under `key`, or return undefined when

// Return a JSON-serializeable representation of this node.

// Return a debugging string that describes this fragment.

// Return a horizontal line in block context

// Return a map with the given content. If null, create an empty

// Return a map with the given key removed, if it existed.

// Return a string representation of this node for debugging

// Return a text selection that spans the given positions or, if

// Return an iterator with no values.

// Return the greater of this and the given position.

// Return the local global object if it's not possible extract one from

// Return the position at which the cell at the given row and column

// Return the position of all cells that have the top left corner in

// Return the smaller of this and the given position.

// Returns a command for selecting the next (direction=1) or previous

// Returns a command function that wraps the selection in a list with

// Returns a command that sets the given attribute to the given value,

// Returns a command that tries to set the selected textblocks to the

// Returns a plugin that enables the undo history for an editor. The

// Returns a range based on the place where this position and the

// Returns a rectangular slice of table rows containing the selected

// Returns a resolved position if this is a cursor selection (an

// Returns an array of all depths for which $from - $to spans the

// Returns the smallest column selection that covers the given anchor

// Returns the smallest row selection that covers the given anchor

// Returns the viewport rectangle at a given document position.

// Returns this node's first child, or `null` if there are no

// Returns this node's last child, or `null` if there are no

// Returns true if the given fragment is valid content for this node

// Returns true if this transaction doesn't contain any metadata,

// Reused array to avoid allocating fresh arrays for things that will

// Review our test case against browsers more comprehensively.

// Rowspanning cell that has already been handled

// Run any style parser associated with the node's styles. Either

// Safari ignores clicks on draggable elements

// Safari replaces the list item or table cell with a BR

// Safari's caretRangeFromPoint returns nonsense when on a draggable element

// SafeAnchor handles the disabled case, but we handle it here

// Same for backspace

// Scale image to fit its containing space.

// Scan a sorted array of decorations for partially overlapping spans,

// Scan over the fragment, fitting as many child nodes as

// Scan up from this position

// Scan up the dom finding the first desc that is a descendant of

// Schedule new call to be in invoked when the pending one is resolved.

// SchemaSpec:: interface

// Scroll event does not bubble, so we need to look up all the scrollable

// See https://discuss.prosemirror.net/t/copy-selection-issue-with-the-image-node/1673/2;

// See https://github.com/facebook/regenerator/issues/274 for more details.

// See https://www.stum.de/2016/06/24/handling-ime-events-in-javascript/.

// See if the node before (or its first ancestor) is closed

// See if the transaction adds or removes any placeholders:

// See: https://code.google.com/p/chromium/issues/detail?id=25916

// See: https://github.com/joyent/node/issues/1707

// Select the whole document.

// Selection.extend can be used to create an 'inverted' selection

// Selection.isCollapsed isn't reliable on IE

// Selection.modify (Edge), fall back to a primitive approach

// SelectionBookmark:: interface

// Serialize the content of the given node to

// Serialize the content of this fragment to a DOM fragment. When

// Serialize this node to a DOM node. This can be useful when you

// Serialize this state to JSON. If you want to serialize the state

// Serializer

// Set a flag on the given transaction that will prevent further steps

// Set the current stored marks.

// Set the type of all textblocks (partly) between `from` and `to` to

// Setting context._sent for legacy support of Babel's

// Shift- prefix enabled. See #997

// Shortcut for trivial case

// Simple cases...

// Simple, cheap variant for when there are no local decorations

// Simple, flat case

// Skip ahead if rowspan > 1

// Skip past cells from previous rows (via rowspan)

// So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.

// Some browsers, namely IE and Edge, don't have the SVGGraphicsElement

// Sometimes the cell can be in the same depth.

// Special case for Google doc's image.

// Special case for a simple path URL

// Special cases for handling +-0.0...

// Split a selected cell, whose rowpan or colspan is greater than one,

// Split the content in the given range off from its parent, if there

// Split the node at the given position, and optionally, if `depth` is

// Split the parent block of the selection. If the selection is a text

// Standard className for selected node.

// Start a [transaction](#state.Transaction) from this state.

// Start must be at the end of a block

// StateField:: interface<T>

// Stop listening to mouse motion events.

// Store a metadata property in this transaction, keyed either by

// Store the scroll position of the editor's parent nodes, along with

// Strategy

// Strip off the surrounding list. At the sides where we're not at

// Strip trailing whitespace

// Subscription to the "Transitionend" event is used as a workaround for

// Such objects conform to this interface.

// Superclass for the various kinds of descriptions. Defines their

// Suspiciously specific kludge to work around caret*FromPoint

// Swap elements:

// Sync the DOM if anything changed

// Sync the content of the given DOM node with the nodes associated

// Sync the current stack of mark descs with the given array of

// Syncs `this.children` to match `this.node.content` and the local

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS

// TODO: Support UI for cropping later.

// TODO: implementation (?)

// TYPES //

// Takes a slice parsed with parseSlice, which means there hasn't been

// Tells you whether this node type has any required attributes.

// Test that the style string either precisely matches the prop,

// Test whether a given mark or mark type occurs in this document

// Test whether replacing the range `from` to `to` (by index) with a

// Test whether replacing the range between `from` and `to` (by

// Test whether the blocks before and after a given position can be

// Test whether the given node's content could be appended to this

// Test whether the given set of marks are allowed in this node.

// Test whether the selection is the same as another selection.

// Test whether this mark has the same type and attributes as

// Test whether this mark is in the given set of marks.

// Test whether two nodes represent the same piece of document.

// Test whether two sets of marks are identical.

// Tests whether there is a mark of this type in the given set.

// Tests whether this slice is equal to another slice.

// That means the fitting must be done to the end of the textblock

// The (absolute) position at the end of the node at the given

// The (absolute) position at the start of the node at the given

// The (absolute) position directly after the wrapping node at the

// The (absolute) position directly before the wrapping node at the

// The (forward) step map for this item.

// The ._invoke method unifies the implementations of the .next,

// The [editor view](#view.EditorView) uses a few metadata properties:

// The [props](#view.EditorProps) exported by this plugin.

// The [spec](#model.SchemaSpec) on which the schema is based,

// The `bias` parameter can be used to influence which side of a DOM

// The above copyright notice and this permission notice shall be included

// The amount of keys in this map.

// The amount of redoable events available in a given editor state.

// The amount of undoable events available in a given state.

// The ancestor node at the given level. `p.node(p.depth)` is the

// The attributes associated with this mark.

// The code below helps compile a regular-expression-like language

// The content must have shrunk

// The context.catch method must only be called with a location

// The current document (the result of applying the steps in the

// The current document.

// The delegate iterator is finished, so forget it and continue with

// The depth up to which this position and the given (non-resolved)

// The documents before each of the steps.

// The editor will use this as the node's DOM representation

// The editor will use this as the node's DOM representation.

// The empty rope sequence.

// The empty set of decorations.

// The empty slice.

// The end of this one overlaps with a subsequent span. Split

// The end position in the `maps` array.

// The end position. Will be the same as `from` for [widget

// The extra wrapper is somehow necessary on IE/Edge to prevent the

// The first child of the fragment, or `null` if it is empty.

// The fragments after the join point must match

// The function keys

// The index into the ancestor at the given level. If this points at

// The index pointing after this position into the ancestor at the

// The inverted step

// The last child of the fragment, or `null` if it is empty.

// The lower bound of the range.

// The lower bound of the selection's main range.

// The mark serialization functions.

// The marks (things like whether it is emphasized or part of a

// The name of the mark type.

// The name the node type has in this schema.

// The next textblock must start before end and end near it

// The node is already part of a local view desc, leave it there

// The node serialization functions.

// The node's representation in the editor (empty, for now)

// The number of child nodes in this fragment.

// The number of children that the node has.

// The number of levels the parent node is from the root. If this

// The number of outgoing edges this node has in the finite

// The number zero (pronounced “hole”) is used to indicate the place

// The options passed to the serializer.

// The parent node that the position points into. Note that even if

// The plugin's [spec object](#state.PluginSpec).

// The plugins that are active in this state.

// The props object given directly to the editor view supports two

// The ranges covered by the selection.

// The resolved anchor of the selection (the side that stays in

// The resolved head of the selection (the side that moves when

// The resolved lowerbound of the selection's main range.

// The resolved upper bound of the selection's main range.

// The root entry object (effectively a try statement without a catch

// The root node in which the position was resolved.

// The schema into which the parser parses.

// The schema of the state's document.

// The schema that this mark type instance is part of.

// The selection's anchor, as an unresolved position.

// The selection's head.

// The selection.

// The set of [parse rules](#model.ParseRule) that the parser

// The set of marks allowed in this node. `null` means all marks

// The size of the content represented by this desc.

// The size of the fragment, which is the total of the size of its

// The size of this node, as defined by the integer-based [indexing

// The size this slice would add when inserted into a document.

// The spec on which the type is based.

// The spec provided when creating this decoration. Can be useful

// The spec that this type is based on

// The start position of the decoration.

// The starting match of the node type's content expression.

// The starting position in the `maps` array, used when `map` or

// The step count for which the current selection is valid.

// The step maps in this mapping.

// The steps in this transform.

// The stored marks set by this transaction, if any.

// The timestamp associated with this transaction, in the same

// The transaction's current selection. This defaults to the editor

// The type of node that this is.

// The type of the [default top node](#model.SchemaSpec.topNode)

// The type of this mark.

// The upper bound of the range.

// The upper bound of the selection's main range.

// The value of the state field that tracks undo/redo history for that

// The various event-handling functions may all return `true` to

// The view's current [props](#view.EditorProps).

// The view's current [state](#state.EditorState).

// The wrappers are assumed to be valid in this position, and should

// There are several things that positions can be mapped through.

// There are siblings after the lifted items, which must become

// These are the options recognized by the

// These are used when the footnote is selected

// These is screen coordinate.

// They are part of the [editor state](#state.EditorState) and

// They form a doubly-linked mutable tree, starting at `view.docView`.

// This addresses the problem that Transform.replace expects a

// This bug tends to close the virtual keyboard, so we refocus

// This can be changed by passing an array of types and attributes to

// This can be useful as a base to build a custom serializer from.

// This class tracks the state of the placement progress in the

// This environment has a native %IteratorPrototype%; use it instead

// This field belongs to a plugin mapped to a JSON field, read it from there.

// This file defines a ProseMirror selection subclass that models

// This file defines a number of helpers for wiring up user input to

// This file defines a number of table-related commands.

// This file defines a plugin that handles the drawing of cell

// This file defines helpers for normalizing tables, making sure no

// This file is a fallback for a consumer who is not yet on React 16

// This function abstracts iterating over the nodes and decorations in

// This function creates a set of [node

// This guards against the case where compositionend is triggered without the keyboard

// This intentionally forwards size and variant (if set) to the

// This is a command that will undo an input rule, if applying such a

// This is a huge hack, but appears to be the best we can

// This is a polyfill for %IteratorPrototype% for environments that

// This is at the top of an existing list item

// This is important for "transitions" which never actually start

// This is intended to be able to call things like

// This is the magic part:

// This is the method, for example, to handle paste. The similar

// This is the node that holds the child views. It may be null for

// This is the type passed to the [`Plugin`](#state.Plugin)

// This is to support parse stuff like "  http://foo.com  \n"

// This is very crude, but unfortunately both these browsers _pretend_

// This loop picks a preferred target depth, if one of the covering

// This loop repeatedly gives plugins a chance to respond to

// This method is bound to the view instance, so that it can be

// This method returns true if the keydown event should be ignored.

// This module should not be running in strict mode, so the above

// This piece of state is used to remember when a mouse-drag

// This should be overwrite by subclass.

// This tries to detect Android virtual keyboard

// This works around a Google Docs misbehavior where pasted content will be inexplicably wrapped in `<b>` tags with a font-weight normal.

// Throughout this interface, methods that take an optional `depth`

// To avoid creating an additional object, we just hang the .value

// To be able to deserialize selections from JSON, custom selection

// To be able to serialize steps to JSON, each step needs a string

// Toggles between row/column header and normal cells (Only applies to first row/column).

// Toggles whether the selected column contains header cells.

// Toggles whether the selected row contains header cells.

// Tokenize a style attribute into property/value pairs.

// Touched nodes

// Track which rows we must add cells to, so that we can adjust that

// Tracks whether anything was changed

// Transactions track changes to the document (they are a subclass of

// Trick from jQuery -- some elements must be wrapped in other

// True for node types that allow no content.

// True if this is a block type

// True if this is a textblock type, a block that contains inline

// True if this is an inline type.

// True if this is the text node type.

// True if this node type has inline content.

// True if this selection goes all the way from the left to the

// True if this selection goes all the way from the top to the

// True when the document has been changed (when there are any

// True when this is a block (non-inline node)

// True when this is a leaf node.

// True when this is a text node.

// True when this is a textblock node, a block node with inline

// True when this is an atom, i.e. when it does not have directly

// True when this is an inline node (a text node or a node that can

// True when this match state represents a valid end of the node.

// True when this node allows inline content.

// True when this node is an atom, i.e. when it does not have

// Try falling back to the keyCode when there's a modifier

// Try fast path regexp

// Try the joining algorithm

// Try to apply a step in this transformation, ignoring it if it

// Try to find a handler for the given tag and use that to parse. If

// Try to find a node desc matching the given data. Skip over it and

// Try to find a point where a node of the given type can be inserted

// Try to find a selection inside the given node. `pos` points at the

// Try to find a target depth to which the content in the given range

// Try to find a valid way to wrap the content in the given range in a

// Try to find a way to fit the given node type into the current

// Try to fit each possible depth of the slice into each possible

// Try to insert the given node, adjusting the context when needed.

// Try to match a fragment. Returns the resulting match when

// Try to match the given fragment, and if that fails, see if it can

// Try to merge this step with another one, to be applied directly

// Try to reorder 'mixable' marks, such as em and strong, which

// Try to start a node of the given type, adjusting the context when

// Try to update the next node, if any, to the given data. Checks

// Try/catch helper to minimize deoptimizations. Returns a completion

// URLs are obnoxious.

// USE OR OTHER DEALINGS IN THE SOFTWARE.

// Unmounting.

// Update `this.unplaced`. Drop the entire node from which we

// Update the editor's `state` prop, without touching any of the

// Update the timestamp for the transaction.

// Update the transaction's current selection. Will determine the

// Update the view by updating existing props object with the object

// Update the view's props. Will immediately cause an update to

// Updates the popup.

// Upload was cancelled:

// Use all marks in the main node, except those that have

// Use lowercase letters to refer to letter keys (or uppercase letters

// Use the setState() updater to ensure state isn't stale in certain edge cases.

// Used by hacks like the beforeinput handler to check whether anything happened in the DOM

// Used by the editor's event handler to ignore events that come

// Used for testing.

// Used to [define](#model.NodeSpec.attrs) attributes on nodes or

// Used to check whether a given description corresponds to a

// Used to find a DOM range in a single parent for a given changed

// Used to group adjacent nodes wrapped in similar parents by

// Used to sort decorations so that ones with a low start position

// Used when finding a mark at the top level of a fragment parse.

// Utilities to help with copying and pasting table cells

// Utilities used for copy/paste handling.

// VARIABLES //

// Various helper function for working with tables

// Verbose variant of [`apply`](#state.EditorState.apply) that

// Very specific hack to deal with backspace sometimes failing on

// View descriptions are data structures that describe the DOM that is

// View descs are responsible for setting any selection that falls

// We also can't just check "__reactInternalSnapshot",

// We can say that if CSS dimensions + paddings are equal to the "client"

// We consider the content of each node that is open to the left to be

// We have nothing to observe. Stop observing, which stops the

// We need to de-construct the string...

// We need to handle both cases, but can't just check for the presence of "maybeSnapshot",

// We only ignore it once, as pressing Enter a second time *should* insert a newline.

// We should probably do more with beforeinput events, but support

// We'll increment its span below.

// When `type` isn't given, the existing node type is preserved,

// When a yielded Promise is resolved, its final value becomes

// When editor content is being dragged, this object contains

// When entering a mark, the current top and index are pushed

// When inside a text node, just return the text node's marks

// When parsing in-editor content (in domchange.js), we allow

// When stored marks are added, stop composition, so that they can

// When the callback returns false for a given node, that node's

// When the collab module receives remote changes, the history has

// When the selection is empty and at the end of a textblock, select

// When the selection is empty and at the start of a textblock, select

// When the selection is in a node with a truthy

// When there is a mark of this type in the given set, a new set

// When there's inline content directly after the frontier _and_

// When this position points into a text node, this returns the

// When user click with right button the resize is stuck in resizing mode

// Whether the command for apply specific text style mark is enabled.

// Whether the selection was explicitly updated by this transaction.

// Whether the stored marks were explicitly set for this transaction.

// Whether to render lists in a tight style. This can be overridden

// Whether vertical position motion in a given direction

// Width & height include paddings and borders when the 'border-box' box

// Will be zero for positions that point between nodes.

// With the plugin enabled, these will be created when the user

// Within the body of any async function, `await x` is transformed to

// Without it we would need to implement separate methods for each of

// Work around Chrome issue https://bugs.chromium.org/p/chromium/issues/detail?id=447523

// Work around an issue in Chrome, IE, and Edge where changing

// Work around for an issue where an update arriving right between

// Work around issue in Chrome where backspacing sometimes replaces

// Workaround to get in-selection views selected.

// Wrap a command so that, when it produces a transform that causes

// Wrap subsequent content in a node of the given type.

// Wrap the given [range](#model.NodeRange) in the given set of wrappers.

// Wrap the selection in a node of the given type with the given

// You can add multiple keymap plugins to an editor. The order in

// You can define a custom bookmark type for a custom selection class

// You can set an `"addToHistory"` [metadata

// You can use `Mod-` as a shorthand for `Cmd-` on Mac and `Ctrl-` on

// You can use any node as an editor document

// You should probably put this plugin near the end of your array of

// [CommonMark](http://commonmark.org/).

// [`AllSelection`](#state.AllSelection) if no valid position

// [`EditorState.tr`](#state.EditorState.tr) to create an instance.

// [`KeyEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key).

// [`OrderedMap`](https://github.com/marijnh/orderedmap) instances

// [`ReplaceError`](#model.ReplaceError) is thrown.

// [`Selection.near`](#state.Selection^near) when the document

// [`Step.jsonID`](#transform.Step^jsonID).

// [`Transform`](#transform.Transform)), but also other state changes,

// [`bulletList`](#schema-list.bulletList) as `"bullet_list"`, and

// [`code`](#model.NodeSpec.code) property in its spec, create a

// [`code`](#model.NodeSpec.code) property in its spec, replace the

// [`decorations` prop](#view.EditorProps.decorations). They come in

// [`dispatchTransaction`](#view.DirectEditorProps.dispatchTransaction)

// [`init`](#state.StateField.init) method, passing in the new

// [`joinBackward`](#commands.joinBackward) or other deleting

// [`joinForward`](#commands.joinForward) and similar deleting

// [`keymap`](#keymap.keymap), return a [keydown

// [`liftTarget`](#transform.liftTarget) to compute `target`, to make

// [`listItem`](#schema-list.listItem) as `"list_item"`.

// [`macBaseKeymap`](#commands.macBaseKeymap).

// [`orderedList`](#schema-list.orderedList) as `"ordered_list"`,

// [`parseSlice`](#model.DOMParser.parseSlice) methods.

// [`parse`](#model.DOMParser.parse) and

// [`parse`](#model.DOMParser.parse), and takes the same set of

// [`pcBasekeymap`](#commands.pcBaseKeymap) or

// [`replace`](#transform.Transform.replace) method is a more

// [`serializeFragment`](#model.DOMSerializer.serializeFragment) on

// [`setSelection`](#state.Transaction.setSelection).

// [`state`](#state.PluginSpec.state) property) of this type, which

// [`toDOM`](#model.NodeSpec.toDOM) method of their spec, and managed

// [`undo`](#history.undo) and [`redo`](#history.redo) commands.

// [`updateState`](#view.EditorView.updateState) with the result.

// [composition](https://developer.mozilla.org/en-US/docs/Mozilla/IME_handling_guide)

// [define](#view.EditorProps.nodeViews) a custom node view.

// [defining](#model.NodeSpec.defining).

// [determined](#model.NodeSpec.attrs) by the node type.

// [excluded](#model.MarkSpec.excludes) by this one.

// [exclusive](#model.MarkSpec.excludes) with this mark are present,

// [isolating](#model.NodeSpec.isolating) parent nodes.

// [markdown-it](https://github.com/markdown-it/markdown-it) to

// [object](#model.ResolvedPos) with information about its context.

// [priority](#model.ParseRule.priority).

// [props](#view.DirectEditorProps).

// [registered](#state.Selection^jsonID) your class.

// [step](#transform.Step) that inserts it. Will return null if

// [steps](#transform.Step) representing a document transformation.

// [tag](#model.Node.type) `Node` instances. They contain information

// [tagged](#model.Mark.type) with type objects, which are

// [the guide](/docs/guide/#doc) for more information.

// ` inline code

// `"block"`.

// `"paragraph (ordered_list | bullet_list)*"`. `listGroup` can be

// `Fragment.empty` as content.

// `Meta-`) are recognized. For characters that are created by holding

// `NodeType` instance. Attributes will be extended

// `ProseMirror-gapcursor`. You can either include

// `Schema`, which controls which types exist and which

// ```

// ``` code block

// ```javascript

// `a-`), `Ctrl-` (or `c-` or `Control-`) and `Cmd-` (or `m-` or

// `appendMap`).

// `basicLength` is the number of basic code points.

// `bias` determines whether the method searches forward (default)

// `blockSeparator` is given, it will be inserted whenever a new

// `firstDelim` is a function going from an item index to a

// `getBoundingClientRect` on that DOM node. Do **not** mutate the

// `handleDOMEvents`, where the handler itself is responsible for that.

// `handledCPCount` is the number of code points that have been handled;

// `hasOwn.call(value, "__await")` to determine if the yielded value is

// `historyPreserveItems` property in its spec, in which case we must

// `i` was supposed to wrap around from `out` to `0`,

// `inclusive` set to false and are not present in the other node.

// `index` is the index of the next character to be consumed.

// `itemContent` determines the content expression for the list items.

// `left` and `right` will be the same number, as this returns a

// `mapResult` is called.

// `nodeType` is the type of node to wrap in. If it needs attributes,

// `null`, a `Node`, or an array of nodes.

// `null`. Similarly `marks` may be `null` to default to the empty

// `p.index(0)` is 1 and `p.index(1)` is 2.

// `selectedCell` CSS class.

// `start` and `end` are omitted, all decorations in the set are

// `style/gapcursor.css` from the package's directory or add your own

// `style` attribute, `addElementWithStyles`.

// `table`, `table_row`, and `table_cell` nodes types as used by this

// `this.children`.

// `this.top`.

// `to` point directly before and after the selected node, `anchor`

// `to`, and the slice's [`openStart`](#model.Slice.openStart) property

// `type` property whose value matches the ID under which you

// `wrappingInputRule` function.

// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test

// a DOM selection change and the "selectionchange" event for it

// a ProseMirror document conforming to a given schema. Its behavior

// a `"uiEvent"` property of that may be `"paste"`, `"cut"`, or `"drop"`.

// a different cell above them, add a decoration

// a fallback kludge when not supported.

// a flat array.

// a fragment. Calls `onNode` for each node, with its local and child

// a given node, by looking at the way the mark occurs in the schema.

// a given position is a valid end of the node.

// a hard break, or a text node that ends with whitespace, strip the

// a head (the moving side) and anchor (immobile side), both of which

// a node's spec (typically used when the node is displayed as an

// a position points into a text node, that node is not considered

// a selection starts in such a node and ends in another, in which

// a single set when possible.

// a string or number, in which case it is ignored, to support the

// a wrapping list.

// about the node type, such as its name and what kind of node it

// accidentally pass it on to the delegate.

// action.

// active or the character produced isn't ASCII, and our table

// active plugins. State fields that exist in both sets of plugins

// active.

// actually part of the list item above it.

// add default propTypes for folks that use runtime checks

// add nodes to the start or end of the given fragment to make it

// adding delimiters, and so on), and then optionally add content

// after it

// after it. Returns the merged step when possible, null if the

// after the bite. Otherwise add them at the end).

// afterwards- we wouldn't want to ignore the keydown event in this case.

// against the node type's content restrictions, and throw an error

// aka. 0x7FFFFFFF or 2^31-1

// all previous Promises have been resolved before calling invoke,

// allow deletion at the selected point.

// allowed.

// already have an existing method we want to call, so there's no need

// already have that attribute set to that value.

// also directly pass a DOM node. `getPos` can be used to find the

// also ensures that the minifier will not anonymize the function.

// always called with the plugin instance as their `this` binding.

// amount of characters. For other leaf nodes, it is one. For

// and "client" properties, though that is not always true in Chrome.

// and .done properties off the next function object itself. This

// and are also not enumerable in the native implementation.

// and are at the start or end of a parent node in which the given

// and can thus safely be extended.

// and create a ProseMirror document as prescribed by this parser's

// and don't want to reset the set in the effect

// and drop the descs before it.

// and end token).

// and head cell.

// and if successful, rebuilds the slice so that it fits into that parent.

// and if there was a path

// and is only available when the currently selected cell doesn't

// and optionally a set of attributes that provide further information

// and return it along with its index and offset relative to this

// and some helper methods.

// and split those so that only fully overlapping spans are left (to

// and the new document.

// and the one after it, either by joining them or by moving the other

// and try there, even if the original position wasn't directly at the

// and used by the view class.

// and which can be used to transform between positions in the old

// and whose decorations match the new ones.

// another mark.

// any content-expression checking done on the top nodes, tries to

// any necessary setup in a predictable way. This predictability

// any of the node view methods.

// any rowspan cells by splitting cells that cross it. Return true if

// any text. Mark the dom change to fall back to assuming the

// any type.

// any. (Will not select the document node.)

// anything else is assumed to be absolute.

// anything, or an element merely doesn't have paddings/borders styles.

// appear among text).

// appear in `map` after the keys in `map`.

// appear in `map` before the keys in `map`.

// appear in `map`.

// applicable.

// are allowed.

// are based on the strings that can appear in

// are inside of this node, and the node isn't already part of a

// are kept unchanged. Those that no longer exist are dropped, and

// are the ones that are *expected* to be seen, so we fast-path

// argument that corresponds to a known catch block.

// argument.

// arguments. Create a successful result if it succeeds, and a

// around contentEditable terribleness.

// around those blocks in their shared ancestor is returned. You can

// array of strings was passed, if their node type name is in that

// array.

// arrays of edges, which are `{term, to}` objects. The first state is

// as a non-relevant.

// as being an iOS enter press), just dispatch an Enter key instead.

// as createPortal was introduced in React 16

// as hints, rather than fixed start and end points. This method may

// assignment should always work unless something is misconfigured. Just

// assume that it's an IPv6 address.

// assumed to match.

// async functions in terms of async generators, it is especially

// at `pos`, if any.

// at the old document shape. This is made cheaper by sharing

// at the selection, match the given set of marks. Does nothing if

// at this point, either we have an explicit point where the

// atSign can be anywhere.

// attributes allowed and required are

// attributes they have.

// attributes, and marks.

// attributes.

// attrs in the dom, that won't be picked up. Not entirely sure

// attrs means that if the user somehow manages to change the

// auth portion cannot go past, or the last @ char is the decider.

// automaton that describes the content expression.

// backspacing out the first element in a textblock

// bars are the only difference between rounded dimensions + paddings

// base64 encoded url.

// basic structure and shared methods.

// be able to do that, positions saved in the map are relative to the

// be configured with the [`atom` property](#model.NodeSpec.atom) on

// be displayed.

// be future ones caused by CSS transitions.

// be generated.

// be influenced by the [transaction

// be made to match by inserting nodes in front of it. When

// be replaced by whatever the Enter key handlers do.

// because `rebased` relies on a clean, untouched set of items in

// because each remote change adds one. The `upto` argument is used

// because that's known to be hostless.

// because this should sync the subtree for a whole node at a time.

// before actually updating the DOM, which will cause

// before and after a node in the document. That node, and only that

// before closing marks.

// before the position is returned.

// between non-editable block nodes. We briefly make something

// between rows, fix up the cells whose width doesn't match the

// between the two given positions.

// between them.

// block before (or after if `dir` is positive). Returns the joinable

// block closer to this one in the tree structure. Will use the view

// block node is started. When `leafText` is given, it'll be

// block selections.

// block.

// block. If not, we call `posFromDOM` on the raw node/offset.

// block: 'nearest',

// both side are ‘open’ (cut through).

// bottom of the table.

// bound to keys like backspace, after

// bound to return false, and to make sure that cursor-motion keys

// bound.

// boundaries) and match the given predicate on their spec. When

// boundaries.

// broken by replacing non-ASCII by nothing

// browser)

// browser, the selected range should be visible to the user. Defaults

// browsers support it yet.

// but guard against overflow

// by a DOM change, so that the next update will redraw it.

// by a namespace URL and a space. If the second element is plain

// by checking all node boundaries in their parent nodes.

// call invoke immediately, without waiting on a callback to fire,

// called one at a time, starting with the base props and then

// called when the widget is actually drawn in a view, but you can

// calls them one by one until one returns true).

// can be disambiguated. Try to pick something that's unlikely to

// can be lifted. Will not go across

// can be used to find the correspondence between positions in the

// can cause a spurious DOM selection update, disrupting mouse

// can optionally pass `start` and `end` indices into the

// care to call `preventDefault` on the event, except with

// case it should overwritten)

// case no marks should be preserved).

// case we just use whatever domFromPos produces as a best effort.

// cases want to overflow. A 64-bit float can represent 48-bit

// causes a decoration to show up at the drop position when something

// caveat for [`$from`](#model.NodeRange.$from).

// cell selection to be created).

// cell-based copy/paste, and makes sure tables stay well-formed (each

// cell-selection is happening, so that it can continue even as

// cells at the start or end of the rows (if it looks like a 'bite'

// cells.

// chance to clean up.

// character at that position, relative to the window.

// character in a list item or table cell (#708, #862)

// checked and defaulted (you can pass `null` to use the type's

// child index) with the given replacement fragment (which defaults

// children of the last item

// children that are also instances of `Node`.

// children will not be recursed over. The last parameter can be

// children.

// chop off any delim chars.

// chop off from the tail first.

// clash with classes from other modules.

// classes must register themselves with an ID string, so that they

// client[Width/Height] properties represent viewport area of the window.

// closest ancestor block of the selection that can be joined, with

// code unit is the high surrogate of a surrogate pair

// coherent slice, and will fail to place a set of siblings that don't

// collaboration or history management.)

// collapse, even when it should be valid. This appears to be a bug, but

// collector if the target element is deleted.

// collisions between observers, e.g. when multiple instances of

// column-width dragging plugin, might want to get a turn first to

// come first, and within a set with the same start position, those

// comes *before* the @-sign.

// command handle lifting.

// commands, as a fall-back behavior when the schema doesn't allow

// commands, to provide a fall-back behavior when the schema doesn't

// compare them. This is a persistent data structure—it is not

// compared to the given previous document. Useful for avoiding

// compiled once on the first module load.

// completely covers a parent node, this method may completely replace

// composing:: boolean

// compute and cache per schema. (If you want to store something

// compute the range, not re-resolved positions directly at its

// compute them from the regular expression match.

// computed one.

// config::- Configuration options. Must contain `schema` or `doc` (or both).

// config::- configuration options

// configuration object..

// considered. When `predicate` isn't given, all decorations are

// const table = findTable(selection);

// constructor.

// constructor. It provides a definition for a plugin.

// contain anything (rather than allocating a new empty fragment for

// containing only some of the mark's attributes. The others, if

// content expression.

// content from being mangled when it is put onto the clipboard

// content nodes must be valid children for the node they are placed

// content nodes.

// content of `range`.

// content of the block.

// content that can be moved somewhere on the frontier. Returns two

// content.

// content. If `startOfLine` is true, also escape characters that

// content. May have a `depth` greater than this object's `depth`

// content. The callback is invoked with the node, its

// content. When that ended in an inline node, search backwards,

// contentEditable.

// context. May add intermediate wrappers and/or leave non-solid

// context.dispatchException(context.arg) call above.

// context.method was "next", forget context.arg since it has been

// control over what happens.

// convenience.

// coordinates aren't inside of the editor. When an object is

// coordinates, and its `inside` property holds the position of the

// copied or moved. At any other time, it is null.

// copy of this software and associated documentation files (the

// could be found. When `innerRange` is given, that range's content is

// create an updated state. Use

// create new ones with the content you want. Old ones keep pointing

// create the appropriate tree structure.

// created, this will always succeed if you pass null or

// creating a a schema.

// creating and deserializing such documents.

// creation, but is necessary in the composition hack.

// cross a defining node.

// cross any colspan cells by splitting cells that cross it. Return

// crossing the boundaries of the rectangle that we want to

// current document, and later resolved to a real selection for a

// current iteration.

// currently do: use `Selection.modify` to move the selection by

// cursor, but still report that the node is selected

// cursor-motion keys, the code in the handlers also takes care of

// custom things with the selection. Note that this falls apart when

// declare global: DOMException

// declare global: os, navigator

// declare global: window

// decode these, since those clip to 32 bits, which we might in rare

// decorations, possibly introducing nesting for marks. Then, in a

// decorations. Splits text nodes when there is a decoration starting

// decorations](#view.Decoration^widget).

// default block after the code block, and move the cursor there.

// defaults entirely, if no required attributes exist). `content`

// define these here so at least they only have to be

// defining this for a custom subclass, make sure the result object

// delay rendering the widget by passing a function that will be

// delayed transitions. This way it's possible to capture at least the

// delegate iterator, or by modifying context.method and context.arg,

// delete the selection. Will append to the given transaction.

// deletion at the selected point.

// deletion. Will return `null` if this position is at the end of

// delimiter for the first line of the item.

// depths for any depth that has $from at its start and does not

// depths is not outside of a defining node, and adds negative

// depths, one for the slice and one for the frontier.

// descend into a node when the callback returns `false`.

// describes the state it wants to keep. Functions provided here are

// description.

// descriptions to determine the parse rules that should be used to

// descs matched to the child at that index, or empty.

// descs that don't have children.

// detached elements. Though elements with width & height properties less

// determine whether the first could be created from the second by

// did write to the node.

// directly after `this.$to`, we must generate a `ReplaceAround`

// directly at the start of a textblock and has an uneditable node

// directly editable content.

// directly in the list node (?!) if you delete the last

// directly interact with the UI.

// directly matching ones, in order to avoid overeagerly reusing

// directly passed through to the `InputRule` constructor. You'll

// directly).

// distance between the position and the start of the text node.

// distribute, sublicense, and/or sell copies of the Software, and to permit

// do is to check its .name property.

// do so and return true.

// doc:: Node

// document structure directly, rather than poking around in the

// document).

// document, should be passed so that the serializer can create

// document.

// document. To serialize a whole document, use

// doesn't contain a valid text position.

// doesn't include paddings and borders to computed CSS dimensions.

// doesn't support that mark. This will remove the mark if any marks

// don't natively support it.

// don't support this type of collections.

// drag selection.

// drawn between the document nodes.

// dropping fully covered parent nodes of the replaced region when

// duplicate work on each transaction.

// each inline node between `from` and `to`.

// each leaf node).

// easily passed around.

// editable content. This is usually the same as `isLeaf`, but can

// editable document. Its state and behavior are determined by its

// editable, set the selection, then set it uneditable again.

// editor DOM directly, or add styling this way, since that will be

// editor is destroyed.

// editor state. Assigning a key does mean only one plugin of that

// effective test for hidden elements. E.g. even jQuery's ':visible' filter

// either be valid `DOMOutputSpec` values, or the number zero.

// el has no layout at all, use its children instead.

// element.

// elements for innerHTML to work. I.e. if you do `div.innerHTML =

// elements.

// emitted. The keydown event triggers newline insertion, which we don't want.

// emphasis

// empty if nothing had to be inserted). When `toEnd` is true, only

// empty text selection), and null otherwise.

// ends in the same node.

// enqueue has not been called before, then it is important to

// ensure it's an object, and not a string url.

// ensure that a menu set triggers an update for consumers

// enter key afterwards.

// enter-and-pick-suggestion action. That sometimes (see issue

// entirely by the editor. For some use cases, such as embedded

// entirely inside of them, so that custom implementations can do

// eq:: (Selection) → bool

// equals `from`, and `head` equals `to`..

// error when the step fails.

// escaped, even if encodeURIComponent doesn't think they

// eslint-disable-line no-console

// eslint-disable-line no-unused-vars

// eslint-disable-line no-useless-escape

// eslint-disable-line stdlib/no-builtin-math

// eslint-disable-next-line class-methods-use-this

// eslint-disable-next-line react-hooks/rules-of-hooks

// even href="" will remove it.

// event handler makes an issue where the composition vanishes when

// ex:

// exception, let the outer generator proceed normally. If

// execute code before the first await. Since we implement simple

// executor callback, and why async functions synchronously

// exists.

// explicitly.

// expression match and the node before the wrapped node, and can

// failed one if it throws a `ReplaceError`.

// fails. Returns the step result.

// fall outside of. If so, we take the position before/after that

// false. Otherwise, apply it, use its return value to drive the way

// fields that can't be used in plugins:

// figure out if it's got a host

// filter out columns without cells (where all rows have colspan > 1 in the same column)

// filter out rows without cells (where all columns have rowspan > 1 in the same row)

// final state of an element.

// finally, reconstruct the href based on what has been validated.

// find a cursor (as opposed to a node selection) when pressed. For

// find a parent node in the current context that might fit the nodes,

// find another change.

// find the first instance of any hostEndingChars

// first, if it's not file:, then we MUST have a host,

// fit anywhere in the schema.

// fit the node. If no fitting wrapping can be found, return null.

// fixed-size cache if that's not supported.

// flat cursor-ish rectangle. If the position is between two things

// focused element.

// following conditions:

// following properties:

// footnote is node-selected (and thus DOM-selected) when

// for a while (if only as a no-op)

// for accurate start-of-textblock detection if given.

// for atom nodes selection position after insertion is the previous pos

// for other components

// for recursive calls).

// for selectable node, selection position would be the position of the replaced parent

// for the `" "` name.

// for this schema.

// format a parsed object into a url string

// format as `Date.now()`.

// found.

// fragment and the given fragment differ, or `null` if they are the

// fragment and the other.

// fragment containing those nodes.

// fragment differ, or `null` if they are the same.

// fragment, node, or array of nodes.

// fragment, the fragment itself. For a node or array of nodes, a

// fragment.

// fragment. When 0, the parent is open, but no more. When

// from a position would leave a text block.

// from being appended to an existing history event (so that they

// from certain descs.

// from the outer list item to the parent node of the cursor

// frontier node at `frontierDepth`. Close that frontier node when

// full copy. It is represented as a mostly-balanced tree.

// function.sent implementation.

// functions for this serializer.

// functions, which will be called with `(EditorState, dispatch,

// get a fit that is more in line with WYSIWYG expectations, by

// given `slice`.

// given an invalid replacement.

// given as argument. Equivalent to `view.update(Object.assign({},

// given attributes. Will return `false` when the current selection

// given depth (which defaults to `this.depth`).

// given document again. (This is used mostly by the history to

// given document.

// given level, or the original position when `depth` is `this.depth + 1`.

// given level, or, when `depth` is `this.depth + 1`, the original

// given level.

// given node is allowed at the current cursor position

// given node type with the given attributes.

// given offset, in this mapping (as per the second argument to

// given position diverge around block content. If both point into

// given position. May return `null` when the position doesn't point

// given positions. If `to` is not given, it defaults to the end of

// given string is typed. The `regexp` argument is

// given to assign a group name to the list node types, for example

// given type to appear at this position. The result may be empty

// given, it should be the index of the step map that is the mirror

// given, the key of the binding will be replaced with that key.

// gives wrong results for elements with width & height less than 0.5.

// got a fragment string.

// greater than one, any number of nodes above that. By default, the

// grow the replaced area or close open nodes in the slice in order to

// had a rule with `ignore` set.

// handler](#view.EditorProps.handleKeyDown) that handles them.

// handling mapping positions through a series of steps in which some

// happening, don't update the selection.

// happens amids the pending invocation.

// has a stable shape and so hopefully should be cheap to allocate.

// has focus (which will mess up the editor's selection state).

// has special meaning only at the start of the line.

// hash is always overridden, no matter what.

// have any attributes), build up a single reusable default attribute

// have at least a `schema` field, and should contain array of

// have been (and was previously) designed to take a closure to be

// have been already added.

// have been already removed.

// have no actual children, from caretPositionFromPoint (#953)

// have non-ASCII characters, i.e. it doesn't matter if

// high surrogate, and there is a next character

// hints, rather than precise positions. When from and to are the same

// hooks](#state.PluginSpec.filterTransaction) of

// hostnames are always lower case.

// how the browser resolves relative URLs.

// however, if it ends in anything else non-slashy,

// hrefs like //foo/bar always cut to the protocol.

// http://a@b?@c => user:a host:c path:/?@c

// http://a@b@c/ => user:a@b host:c

// http://accessibility.athena-ict.com/aria/examples/dialog.shtml

// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571/

// https://gist.github.com/jimfb/d99e0678e9da715ccf6454961ef04d1b

// https://github.com/ProseMirror/prosemirror-commands/blob/master/src/commands.js

// https://github.com/ProseMirror/prosemirror-schema-basic/blob/master/src/schema-basic.js

// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume

// https://prosemirror.net/examples/tooltip/

// https://prosemirror.net/examples/upload/

// identifier prefixed with zero or more modifiers. Key identifiers

// identify nodes that serialize as hard breaks)

// if (isCellSelection(selection)) {

// if a Content Security Policy forbids using Function, but in that case

// if a url ENDs in . or .., then it must get a trailing slash.

// if hostname begins with [ and ends with ]

// if it doesn't match.

// if it is file:, then the host is dropped,

// if it's a known url protocol, then changing

// if it's not a basic code point

// if the path is allowed to go above the root, restore leading ..s

// if the relative url is empty, then there's nothing left to do here.

// if the url is a non-slashed url, then relative

// if there is no match.

// if we increase `i` as we go, then subtract off its starting

// if we still have not hit it, then the entire thing is a host.

// if you want shift to be held). You may use `"Space"` as an alias

// if you've stored extra information in that object.

// image of this one.

// immediately overriden by the editor as it redraws the node.

// immediately so there is a chance that we might miss one if change

// implementation details to the user code that they probably will

// implemented for custom classes (as a static class method).

// important to get this right, even though it requires care.

// in IE

// in Markdown may be opened and closed in different order, so

// in all copies or substantial portions of the Software.

// in an empty block or between br nodes.

// in case runtime.js accidentally runs in strict mode, we can escape

// in every case, so we don't have to touch the arguments object. The

// in front of a node or if the node is inside an opaque node view.

// in it, try to use property names unlikely to clash.)

// include scroll bars size which can be removed at this step as scroll

// includes the step type's [JSON id](#transform.Step^jsonID) under

// including an open parent node from the slice that _is_ marked as

// incrementing `n` each time, so we'll fix that now:

// indentation added to all lines except the first in an item,

// independently placeable. I.e. in <p("foo"), p("bar")>, when the

// index is out of range.

// indicate that they handled the given event. The view will then take

// indices and calling `get`, because it doesn't have to descend the

// indices. This tends to be more efficient than looping over the

// information about it. Objects of this class represent such a

// information about the dragged slice and whether it is being

// information that client code or plugins can use to describe what a

// information.

// injected easily by `bin/regenerator --include-runtime script.js`.

// inline: 'nearest',

// inner node that the position falls inside of, or -1 if it is at

// input that matches any of the given rules to trigger the rule's

// insert into. If anything about it changes, recompute the table

// inserted for every non-text leaf node encountered.

// insertions, so if there are added nodes, recompute those

// inside if necessary.

// instances of a state.

// instances whenever needed. The API tries to make this easy.

// instances with the property names they use in the JSON object.

// instantiated once per `Schema`.

// integers precisely.

// interface.

// internal DOM, only inspect it (and even that is usually not

// interpreted as a text node, a DOM node, which is interpreted as

// into a deterministic finite automaton. For a good introduction to

// into a node when the callback returns `false`.

// into a parent of the previous block. Will use the view for accurate

// into an inner list.

// into smaller cells with the cell type (th, td) returned by getType function.

// into smaller cells. Use the first cell type for the new cells.

// into the async generator function so it can be handled there.

// into this parent node, and its index.

// into. If any of this is violated, an error of type

// invisible cursor wrapper, since that would result in those weird

// invocations of the iterator.

// invoked without arguments, but in all the cases we care about we

// is a base offset that should be subtractet from the `from` and `to`

// is a single mark, remove precisely that mark. When it is a mark type,

// is active.

// is also used when comparing decorators for equality.

// is at least one node type that can appear in both nodes (to avoid

// is defined by an array of [rules](#model.ParseRule).

// is dragged over the editor.

// is mostly useful for getting the set of marks to preserve after a

// is sibling content before or after it, and move it up the tree to

// is so spotty that I'm still waiting to see where they are going.

// is why the Promise constructor synchronously invokes its

// isn't a valid place but is at the start or end of a node. Return

// it is difficult to isolate. If this happens fallback to the old path

// it is its parent's first child) or after it.

// it to figure out a position.

// it was before, when storeScrollPos was called.

// it was given, if non-null, or create a new one if necessary.

// it will attach a property `"pointer"` with the value `true` to

// it will be escaped.

// it will return true if moving left from the current cursor

// it's a text node whose content already matches the new text

// it's absolute.

// it's not open, close this frontier node right away.

// it's relative

// it, so set the completion value of the entire function to

// items) out. During collaboration, these naturally accumulate

// iterator prototype chain incorrectly implement this, causing the Generator

// its [content](#model.Node.content).

// its parent node or its parent node isn't a textblock (in which

// itself if a rope was given.

// itself, a `{dom: Node, contentDOM: ?Node}` object, or an array.

// joined.

// just pull out the search.

// key is added to the end.

// keyboard gets confused. So the hack here is to set a flag that

// larger one:

// last and first siblings are also joined, and so on.

// leading and trailing accordingly.

// leading or trailing property of the return object will be undefined

// leading space.

// leaf node

// leaving the cursor in the wrong place. When that happens, we drop

// level.

// like href='?foo'.

// like selection updates and adjustments of the set of [stored

// line in `firstDelim`. `node` should be the node that is closed at

// link) applied to this node.

// links like ../.. should be able

// list item should be split. Otherwise, bail out and let next

// list structure, it should have a shape like `"paragraph block*"` or

// location outside the try/catch block.

// locations where there is no enclosing try statement.

// looking for a place in the doc where the node is allowed

// looking for selection end column (endIndex)

// looking for selection end row (endIndex)

// low surrogate

// lower 16 bits provide the index, the remaining bits the offset.

// make subsequent rendering easier). Will return the input array if

// makes the DOM change code recognize that what just happens should

// map positions in the post-step document to the pre-step document.

// map so that subsequent operations can see the current shape.

// map, table node, and table start offset to the object for

// map. If given an ordered map, return that map itself. If given an

// map:: (doc: Node, mapping: Mappable) → Selection

// mapping, for example, a large number of decorations. The number's

// maps for the remote changes in its array of items.

// maps](#transform.StepMap). It has special provisions for losslessly

// mark is not in the set, the set itself is returned.

// marks of various types to DOM nodes.

// marks' [`inclusive`](#model.MarkSpec.inclusive) property. If the

// marks, reusing existing mark descs when possible.

// marks.

// marks](#state.EditorState.storedMarks) instead of a range of the

// marks](#state.EditorState.storedMarks). In addition, you can store

// matched text is typed into it. You'll usually want to start your

// maxKeys <= 0 means that we should not limit keys count

// may be a `Fragment`, a node, an array of nodes, or

// may influence that state and the view that contains it.

// may not be escaped.

// may return `false` to prevent traversal of a given node's children.

// meant to be awaited.

// menus are display: none when not shown.

// merging completely incompatible nodes).

// metadata properties in a transaction, which are extra pieces of

// method always terminates the yield* loop.

// methods related to markdown serialization. Instances are passed to

// methods, and registering your class with a unique

// might affect dimensions of observed elements.

// minifier not to mangle the names of these two functions.

// mirroring information).

// model is applied (except for IE).

// modified, updates create a new value.

// module. The result can then be added to the set of nodes when

// motion would move out of the cell)

// move cursor to the start of the node

// move those that are after the changes.

// moves when extending the selection).

// moving in a given direction. When, for example, given `"left"`,

// must be able to connect to the surrounding content, and its

// name or by plugin.

// near `pos`, by searching up the node hierarchy when `pos` itself

// near and arrow-key-motion past places that don't have a normally

// necessary).

// necessary.

// need to be.

// need to serialize a part of a document, as opposed to the whole

// needless duplicated nodes.

// negative). This can be useful when applying steps meant for a

// negative, it will search backwards first.

// negative, nothing is open.

// never need.)

// never returning a position at the end of the document

// new document or a failure value.

// newEnd must point directly at or after the end of the block that newStart points into

// no explicit marks have been set.

// no partially overlapping spans are found (the common case).

// no path at all.  easy.

// no query string, but parseQueryString still requested

// no such key exists.

// node after `this.$to`, not `this.$to` itself.

// node after it (if any) are returned.

// node and mark serialization methods (see `toMarkdown`).

// node but the parents look compatible, we've found a

// node doesn't fit, this method may _move_ them out towards a parent

// node if possible. Issue prosemirror/prosemirror#832.

// node of the given type would leave the node's content valid.

// node of the given type. May introduce extra nodes around and inside

// node to see if a range into that parent is acceptable.

// node to use when the position is inside a leaf node.

// node type spec. But client code can use the `nodeViews` spec to

// node with the hole.

// node, will receive the given attributes.

// node-specific editing interfaces, you want more control over

// node.

// node. If that node is empty, this will only return true if there

// nodes of the slice aren't table cells or rows.

// nodes that we're in.

// nodes with only a single null-out-edge, since they may lead to

// nodes, which will confuse the browser's cursor motion logic.

// nodes.

// non-generic

// non-leaf nodes, it is the size of the content plus two (the start

// non-undefined value is found. When `f` returns a truthy value,

// none is found, the element's content nodes are added directly.

// normalize towards nearby inline nodes. Since we are interested in

// normalizeSiblings into the same parent node

// not in the browser, the `document` option, containing a DOM

// now rest is set to the post-host stuff.

// null if no position was found.

// numbers as `this.depth + value`.

// obj.hasOwnProperty(prop) will break.

// object to not be returned from this call. This ensures that doesn't happen.

// object with two separate positions is returned.

// object) are interpreted as children of the DOM elements, and must

// object, and use it for all nodes that don't specify specific

// object, create a map from the object's properties.

// object, it is interpreted as a set of attributes for the element.

// objects. For full spec compliance, you may wish to configure your

// occur in conforming documents, and provides functionality for

// of a list item by also splitting that list item.

// of a non-editable node, so in that case, move it into the next

// of nodes to see if there are block nodes that the coordinates

// of nodes. For `null`, it returns the empty fragment. For a

// of plugins, pass an object mapping property names to use in the

// of state objects (`ContentMatch` instances) with transitions

// of that type exist in the selection, or add it otherwise. If the

// of the node's own marks.

// of the polyfill.

// of the rest of this code, which tends to create nodes with the

// of the table to their right, and either the top of the table or

// of them changes content dimensions of the observed target. Sometimes

// on a node level by specifying a tight attribute on the node.

// one character, and see if that moves the cursor out of the

// only `show` should be changing

// only additional allocation required is the completion record, which

// only occur at the start of a textblock.

// only the slashedProtocols get the //.  Not mailto:, xmpp:, etc.

// only to the document it was created for, since the positions

// onto the other branch.

// onto this.

// open value on both side of the fragment.

// optional starting [content match](#model.ContentMatch) as third

// options. But unlike that method, which produces a whole node,

// options::- An optional set of options.

// or a finally block) gives us a place to store values thrown from

// or backwards (negative number) first. Will fall back to calling

// or ending inside of them. Calls `onWidget` for each widget.

// or has an '=' sign after the prop, followed by the given

// or included in a plugin. This interface lists the supported props.

// or not, return the runtime object so that we can declare the variable

// order to associate old items with rebased steps.

// order.

// other platforms.

// other props.

// otherwise insert the widget as a new view desc.

// otherwise the element after.

// otherwise, the node is passed to `addElement` or, if it has a

// outer generator.

// output spec, it should be the only child element in its parent

// overriding the `apply`, `invert`, `map`, `getMap` and `fromJSON`

// own position)

// paragraph on the left is open, "foo" can be placed (somewhere on

// parameter will interpret undefined as `this.depth` and negative

// parameter, to determine whether to return the position at the

// parent node overrode rendering, there might not be one.)

// parent nodes until a valid replace is found.

// parent-relative position, its parent node, and its child index.

// parse them.

// parsers on.

// parts split off will inherit the node type of the original node.

// pass a different state.

// pass in an optional predicate that will be called with a parent

// pass the transactions the plugin did not see before.

// perform more specific behavior.

// perform the change.

// persons to whom the Software is furnished to do so, subject to the

// place when the selection is modified).

// place where it is inserted.

// place.

// placed it we got to its end, otherwise just drop the placed

// plugin will track undo and redo stacks, which can be used with the

// plugins in a way that makes it possible to find them, given an

// plugins to initialize the state with. `pluginFields` can be used

// plugins) along with the new state.

// plugins, since it handles mouse and arrow key events in tables

// point into textblock nodes. It can be empty (a regular cursor

// point, if any.

// points before the last delimiter, or `0` if there is none, then copy

// points into a text node, only the part of that node after the

// points into a top-level paragraph, 1, and so on.

// points were copied; start at the beginning otherwise.

// position and searching back if `dir` is negative, and forward if

// position in this fragment. The result object will be reused

// position is at the start of a non-empty node, the marks of the

// position is returned.

// position points directly into the root node, it is 0. If it

// position points into a text node, only the part of that node

// position share the same parent nodes.

// position that corresponds to them. May return null if the given

// position where the search starts. When `text` is true, only return

// position would leave that position's parent textblock. Will apply

// position).

// position.

// position. (Whenever possible, it is preferable to inspect the

// position. Note that you should **not** mutate the editor's

// position. Searches forward first by default, but if `bias` is

// positioned wrapper, rather than the root editable node, the

// positions (relative to start of this fragment). Doesn't descend

// positions between block nodes too, we first walk up the hierarchy

// positions in the spans (so that we don't have to allocate new spans

// positive. When `textOnly` is true, only consider cursor

// possible.

// post-step version.

// pre-matches to avoid overwriting nodes that could still be used.

// pre-step version of a document and the same position in the

// preferred one

// preserve a range of the replaced content by moving it into the

// preserve steps exactly as they came in, so that they can be

// primary part of the selection

// primitive tool which will _not_ move the start and end of its given

// private WeakMap storage which may cause memory leaks in browsers that

// probably be computed with [`findWrapping`](#transform.findWrapping).

// probably want the regexp to start with `^`, so that the pattern can

// problems, please detail your unique predicament in a GitHub issue.

// produces a different name from the the keyCode. See #668,

// producing a new set. Needs access to the current document to

// properties are

// properties in a schema's node and mark specs.

// properties of `sel.anchorNode` when it's in a generated CSS

// properties then it's either IE, and thus we don't need to subtract

// property in Markdown-it.

// property, since these are the positions that were used to

// property](#state.Transaction.setMeta) of `false` on a transaction

// protocol, but can be used as an escape hatch if a binding needs to

// protocols that always contain a // bit.

// protocols that can allow "unsafe" and "unwise" chars.

// protocols that never have a hostname.

// provided element.

// provided, that is assumed to hold a previous, known-good state,

// pull out port.

// purposes.

// put cursor inside of the inserted node

// put the host back

// range, and is useful in situations where you need more precise

// range.

// rather broadly, and other plugins, like the gap cursor or the

// readDOMChange.

// rebased on top of the remote changes, and include the position

// rebased.

// recomputing them all the time, they are cached per table node. To

// record like context.tryEntries[i].completion. This interface could

// recursively call mapInner on them and update their positions.

// reduce the distance between that block and the one before it—if

// regeneratorRuntime in the outer scope, which allows this module to be

// regexp with `^` to that it is only matched at the start of a

// register an ID for your step classes. Try to pick something

// remove all marks of that type. When it is null, remove all marks of

// removing or adding a single mark type.

// rendered scroll bars nor it can be clipped.

// replaced by the given node.

// replacement fragment.

// reported position in such situations (#1092).

// reported.

// represented as numbers, because tons of them will be created when

// represents.

// require a separate undo command to undo).

// resetting the set of active marks at the cursor.

// resize handles and a selection that considers the absolutely

// resolution will treat //foo/bar as host=foo,path=bar because that's

// resolved position, providing various pieces of context information,

// result, either by returning a { value, done } result from the

// result.

// result.protocol has already been set by now.

// resulting JSON object to plugin objects. The argument may also be

// return <CustomNodeViewComponent {...this.props} />;

// return a boolean to indicate whether a join should happen.

// return a fragment if the resulting match goes to the end of the

// return an array of marks, or null to indicate some of the styles

// return document.createElement('span');

// return it as a `Slice` object.

// return true when successful.

// returned, its `pos` property is the position nearest to the

// returns the bookmark for that.

// returns the precise transactions that were applied (which might

// right of the table.

// right shape in one go, rather than messing with them after

// root if the editor is inside one.

// row has the same number of cells.

// row has the same width, and cells don't overlap).

// rule was the last thing that the user did.

// rules.

// same as `p.parent`.

// same. Since this position will not be the same in both nodes, an

// schema's [node specs](#model.NodeSpec.parseDOM), reordered by

// schema, and raise error when they do not.

// scheme](/docs/guide/#doc.indexing). For text nodes, this is the

// searching through the plugins (in order of appearance) until one of

// selectable position nearby, and create a gap cursor selection for

// selectable, delete the node above and select the one below.

// selectable, delete the node below and select the one above.

// selection [mapped](#state.Selection.map) through the steps in the

// selection in the wrong place. If it looks like that is

// selection is empty, this applies to the [stored

// selection reported by the Selection object (#710, #973,

// selection that can be lifted, out of its parent node.

// selection that the editor gets when the transaction is applied.

// selection transactions directly caused by mouse or touch input, and

// selection was typed over with an identical value if it can't

// selection with a newline character.

// selection, also delete its content.

// selection.

// selection. On Safari, when Enter is pressed, compositionend and keydown events are

// selection:: Selection

// selections. If so, apply it (if not, the result is left to the

// selections. Will return null when no valid selection position is

// selects across cells, and will be drawn by giving selected cells a

// separate step, syncs the DOM inside `this.contentDOM` to

// set of marks.

// setting context.delegate to null, and returning the ContinueSentinel.

// several variants—see the static members of this class for details.

// shape) for the table, used by the table normalizer.

// shift, the `Shift-` prefix is implied, and should not be added

// should be a string—the name of the DOM element, optionally prefixed

// should be the new document to which we are mapping.

// should not directly interfere with its content.)

// should not mutate them or their content. Rather, you create new

// significant, in that it is used to contruct filler content when

// simply directly correspond to DOM attributes of the same name,

// since it'd require exposing a whole slew of finnicky

// situation where clicking at the point where that

// slice can be inserted. Will look at parent nodes' nearest boundary

// slice, or drop nodes from it, and then try again.

// slice.

// so even if it's empty, it has to be present.

// so that results are always delivered in the correct order. If

// so that the async generator function has the opportunity to do

// something changed.

// sometimes. This works around that.

// span.

// spec::-

// spec::- These options are recognized:

// spec::- These options are supported:

// specifying the nodes for a schema. Adds

// specs](http://prosemirror.net/docs/ref/#model.SchemaSpec.nodes) for

// start of the table, rather than the start of the document.

// start or at the end of this view desc.

// start or end of that node. Returns null when no position was found.

// start-of-operation selection and document, since that's the one

// start/end tokens.

// starts, or would start, if a cell started there.

// state where the thing the user sees differs from the

// state.

// state. Will be stored in the plugin state when the history plugin

// state](#state.StateField) accordingly.

// stay empty anyway.

// step that pulls that content into the node after the frontier.

// steps are inverted versions of earlier steps. (This comes up when

// steps can't be merged.

// steps).

// stored in it will only make sense for that document.

// storedMarks:: ?[Mark]

// stores not only a fragment, but also the depth up to which nodes on

// strict mode using a global Function call. This could conceivably fail

// strikethrough

// string](#ParseRule.context) matches this context.

// strings to values, with some convenient update methods.

// strip [ and ] from the hostname

// strong

// structure between the old and new data as much as possible, which a

// style as a ProseMirror node or mark.

// styles to make it visible.

// sub-class may override this method.

// sub-document to a larger document, or vice-versa.

// subclass should overwrite this.

// subclass that represents a cell selection spanning part of a table.

// successful, return a fragment of inserted nodes (which may be

// successful.

// such a way that the drawing algorithm can efficiently use and

// such as it being emphasized, in code font, or a link. It has a type

// supply a custom node view, which can influence various aspects of

// sure the lift is valid.

// synchronize after every block element.

// table, at the position pointed at by rect.

// take everything except the protocol from relative

// target depth, starting with the preferred depths.

// target—you don't have a choice.)

// text node after a BR node) call the observer callback

// text nodes with the same marks are joined together.

// text selections.

// text:: ?string

// textblock (or doesn't move it at all, when at the start/end of

// textblock, try to reduce or remove the boundary between that block

// textblock. The optional `getAttrs` parameter can be used to compute

// than 0.5 will be discarded as well.

// that are non-inclusive and not present at position `$end`. This

// that aren't directly adjacent, `side` determines which element is

// that can be joined, with the sibling after it.

// that depth, but replacing from $from.before(-D) to $to.pos.

// that does allow the given node to be placed. When the given range

// that doesn't move when extending the selection).

// that don't match the given new parent node type. Accepts an

// that happened, adjust the change to cover the space instead.

// that have a dangerous default effect, even if the commands they are

// that is immediately returned. When `f` isn't provided, it is

// that mark to prevent parser edge cases with new lines just

// that order of the marks for the token matches the order in

// that parent node.

// that separated only by a non-defining textblock node, is defining.

// that supports appending, prepending, and slicing without doing a

// that the DOM represents. If any changes came in in the meantime,

// that they can be chained.

// that they have a clipboard API—all the objects and methods are

// that was active before the first step was applied)

// that's smaller than what was actually overwritten.

// that's unlikely to clash with steps from other modules.

// that, when added to an editor, enables cell-selection, handles

// the .value of the Promise<{value,done}> result for the

// the 3rd node in the 2nd paragraph on the top level, for example,

// the DOM around an active selection puts it into a broken

// the DOM selection, it gives up moving the selection entirely,

// the DOM.

// the `stepType` property.

// the array get to dispatch first).

// the behavior of a node's in-editor representation, and need to

// the cell covering that part of the table in each slot

// the client width of 315px and for the width of 314.7px it may give

// the current state and calling

// the cursor sometimes inexplicable visually lags behind its

// the cursor space when adding a space before another space. When

// the deleted content with a random BR node (issues #799, #831)

// the depth specified by `target`. You'll probably want to use

// the document at the given position. It is recommended that you

// the document structure by lifting it out of its parent or moving it

// the document).

// the end of the block, and `f` is a function that renders the

// the end of the list, the existing list is closed. At sides where

// the entry state and the last node is the success state.

// the final result produced by the iterator.

// the first basic code points to the output.

// the first instance of /, ?, ;, or # ends the host.

// the given content (or empty, if no content is given).

// the given document. Will return an

// the given node type with the given attributes.

// the given rectangle.

// the given slice. The slice must 'fit', meaning its open sides

// the given two positions that are relative to start of this node's

// the given type an attributes. If `dispatch` is null, only return a

// the host field still retains them, though

// the host is the remaining to the left of the first non-host char

// the inserted text won't inherit the marks. So this moves it

// the key. Note that the view argument isn't part of the command

// the left of the input and the end of nodes at the end.

// the left side of the replacement gap) independently from p("bar").

// the local part (i.e. everything up to `@`) intact.

// the method takes exactly one argument, since that happens to be true

// the modification is mapped over those before it is applied, in

// the new node's attributes, and works the same as in the

// the new paragraph from the initial change, and fire a simulated

// the newly created block. And then, because ProseMirror cleans up

// the node after this position the main reference.

// the node before that textblock, if possible. This is intended to be

// the node coming after that textblock, if possible. This is intended

// the node's content is wrapped, and return true.

// the node.

// the ones in the given array.

// the outer generator.

// the parent editor is focused.

// the parent—text nodes are ‘flat’ in this model, and have no content.

// the position under the mouse.

// the proper solution is to fix the accidental strict mode problem. If

// the protocol does weird things

// the same textblock, for example, a range around that textblock

// the schema constraints aren't applied to the start of nodes to

// the selected cells' outline forms a rectangle.

// the selection is modified).

// the set itself is returned. If any marks that are set to be

// the sibling above it.

// the spec has a hole (zero) in it, `contentDOM` will point at the

// the start or end of the selected content, creating a change

// the step was entirely deleted by the mapping.

// the target of a node selection. In such a selection, `from` and

// the tokens to create a ProseMirror document tree.

// the top level, not in any node.

// the top position of an element near the top of the editor, which

// the way the node works.

// the widget and node descs inside of them.

// the wrapper node, if necessary. Returns null if no valid wrapping

// their parents

// them returns true. For some props, the first plugin that yields a

// them.

// them. The cursor is drawn as an element with class

// then it must NOT get a trailing slash.

// then let that catch block handle the exception normally.

// then those from plugins (in order), and calls `f` every time a

// there (may have been modified through other means, in which

// there are for example leaf block nodes at the start or end of the

// there's a block directly before it that can be joined, join them.

// there's a hostname.

// there's no meaningful way to insert the slice here, or inserting it

// there, they just don't work, and they are hard to test.

// these concepts, see https://swtch.com/~rsc/regexp/regexp1.html

// they are marked [non-defining](#model.NodeSpec.defining), or

// they aren't text positions, find a text selection near them.

// they fix https://bugs.chromium.org/p/chromium/issues/detail?id=633838

// they have defaults, will be added.

// they stick out.

// things like emphasis or being part of a link) are

// things simple and return the next function itself.

// this for a custom selection class, make sure to give the object a

// this is already the case.

// this is the end, it is overwritten to its end.

// this map.

// this may result in notifications being blocked for the rest of observers.

// this method just converts the selection to a text selection and

// this one returns a slice that is open at the sides, meaning that

// this one.

// this parser. Can be useful to copy and modify to base other

// this points at the inverse's offset

// this selection is the starting selection for the group (the one

// this transaction.

// this way, you can call url_format() on strings

// those are replaced by this one.

// those cases and it's not possible to perform a precise and performance

// those for other nodes. Returns an array whose positions correspond

// those of another. Returns `true` if both have the same markup.

// those that are new are initialized using their

// though due to backwards-compat we should probably keep it around

// through to the step class' own implementation of this method.

// through. If it does, and there's a `contentDOM` node, our logic

// throw away the existing file, and take the new path instead.

// throw the exception.

// thus doesn't get a reaction from ProseMirror. This

// tightLists:: ?bool

// to `true`.

// to a document transform.

// to be bound to keys like delete, after

// to begin with, then we MUST have a path.

// to clean up potentially wonky urls.

// to crawl up to the hostname, as well.  This is strange.

// to create a new function object. We can even get away with assuming

// to deserialize the state of plugins, by associating plugin

// to ensure that only the items below a given level are compressed,

// to get the position after that node. If not, search forward.

// to invoke when the event fires.

// to its start when removeAllRanges is called and the editor still

// to know about those, so that it can adjust the steps that were

// to make the history handle it well.

// to node positions in the fragment, and whose elements are either

// to prevent it from being rolled back by undo.

// to support http.request

// to the empty fragment) would leave the node's content valid. You

// to the given transaction.

// to the left of the last @ sign, unless some host-ending character

// to the view's current state by default, but it is possible to

// toJSON:: () → Object

// tokenize a file, and then runs the custom rules it is given over

// tools and allowed by browsers to mean that the nested list is

// track and restore old selections.) The default implementation of

// tracks that and forces a selection reset when our update

// transacion represents, so that they can update their [own

// transaction that fixes them, if necessary. If `oldState` was

// transaction, but can be overwritten with

// transactions (which might move its anchor cell) come in.

// transactions as new transactions are added, making sure to only

// transform).

// treat multiple DecorationSet objects as if it were a single object

// treated as the identity function (the prop value is returned

// tree for every element.

// tree shape like this (without back pointers) makes easy.

// trim before proceeding.

// true and the content is inline, it inherits the marks from the

// true if something changed.

// true if something was changed.

// try to replace an empty paragraph

// try to replace selected node

// two joinable nodes to end up next to each other, those are joined.

// two nodes. You can pass a join predicate, which takes a regular

// type can be active in a state.

// type with the given attributes.

// type's [content expression](#model.NodeSpec.content), and can be

// type](#model.MarkType) objects for the nodes and marks that may

// underline

// underlying component, to allow it to render size and style variants.

// uneditable [node view](#view.NodeView)).

// unified ._invoke helper method.

// unless they had them to begin with.

// unmatched surrogate; only append this code unit, in case the next

// unprintable ASCII chars + non-ASCII chars

// unsorted array of marks.

// until users clicks again, dont continue if right click is used.

// update position.

// updates the children.

// us a selection change event before the DOM changes are

// use after the split.

// used as the content to fit into the wrapping, instead of the

// used by NavLink to determine it's role

// used exclusively as they provide rounded values.

// used to find out whether further content matches here, and whether

// used to represent the editor's content. They are used for:

// used to specify a starting position to count from.

// used. When < 0, the element before the position is used,

// user@server is *always* interpreted as a hostname, and url

// uses, in order of precedence.

// using the current marks as styling.

// usually be the top-level `document`, but might be a [shadow

// v0.12 TODO(isaacs): This is not quite how Chrome does things.

// validate a little.

// value at the end to obtain `delta`.

// value gets precedence.

// value to indicate whether this is possible, but don't actually

// value, or adding a binding to the end of the map. If `newKey` is

// value.

// variable specified by delegate.resultName (see delegateYield).

// version of that step with its positions adjusted, or `null` if

// view that's a child of this view

// view.props, props))`.

// views](#view.NodeView).

// was before the step as argument.

// was taken out of the table, add cells at the start of the row

// way `JSON.stringify` calls `toString` methods.

// we don't care about invariant's own frame

// we don't need the default popper style,

// we need this to make sure size of hostname is not

// we replace non-ASCII char with a temporary placeholder

// we test again with ASCII char only

// we've already handled the other stuff above.

// we've indicated that there is a hostname,

// well, in the right position. If this mark is already in the set,

// when asked through getSelection. You'll then get a

// when fixing collisions.

// when given, and otherwise defaults to applying the transaction to

// when querying a position directly after line-broken

// when the `isJoinable` predicate returns true for them or, if an

// when the size of the content above changes.

// when updated to the state produced by this transaction.

// where a node's child nodes should be inserted. If it occurs in an

// whether the step removed its surroundings from the document.

// whether this is a problem

// which gets added to `i`. The overflow checking is easier

// which is a value that can be mapped without having access to a

// which they appear determines their precedence (the ones early in

// which will be set to the property's value. These are exceptions:

// which will be used to avoid re-scanning unchanged parts of the

// whitespace. Detect this situation and and kludge around it

// whole content of the nodes at that depth.

// whole node, if not given). If `sync` is passed, use it to

// widget's current document position.

// widget/mark/node.

// width and height. Will clip rowspan/colspan cells at the edges when

// will be returned. If they point into different blocks, the range

// will be used to make sure the visible viewport remains stable even

// with (a subset of) the same interface.

// with a text node containing the given string.

// with an smaller end position come first.

// with defaults, `content` may be a `Fragment`,

// with the added guarantee that its `nodes` and `marks`

// with the given array of view descs, recursing into mark descs

// without inline HTML, and producing a document in the basic schema.

// without it is returned. Otherwise, the input set is returned.

// without limitation the rights to use, copy, modify, merge, publish,

// without using extend.

// works around that.

// would be a no-op (an empty slice over an empty range).

// would fit here.

// wrapped node, the rule will try to [join](#transform.Transform.join) those

// wrapping failed.

// wrong things when the down arrow is pressed when the cursor is

// you call it with a domain that already is ASCII-only.

// you can either pass them directly, or pass a function that will

// you press enter go away.

// you've misconfigured your bundler to force strict mode and applied a

// }

// ‘Fit’ a slice into a given position in the document, producing a

// ‘[rebasing](/docs/guide/#transform.rebasing)’ steps for

//# sourceMappingURL=index.es.js.map

//let setState trigger the update

//to support http.request

//to support request.http

//urlParse appends trailing / to urls like http://www.example.com
