diff --git a/examples/events.js b/examples/events.js index caa57ae5..0e3e3a0a 100644 --- a/examples/events.js +++ b/examples/events.js @@ -2,7 +2,7 @@ import React, {Component} from 'react' import {PropTypes} from 'prop-types' import ReactDOM from 'react-dom' import {CSSTransition, TransitionGroup} from 'react-transition-group' -import {closest} from '../src/util/dom' +import {closest} from '../src/util/dom.js' class Events extends Component { render () { diff --git a/examples/index.js b/examples/index.js index 6e984ab2..7bf013f2 100644 --- a/examples/index.js +++ b/examples/index.js @@ -1,8 +1,8 @@ import Prism from 'prismjs' -import {Editable} from '../src/core' +import {Editable} from '../src/core.js' import eventList from './events.js' -import {getSelectionCoordinates} from '../src/util/dom' +import {getSelectionCoordinates} from '../src/util/dom.js' // Paragraph Example const editable = new Editable({browserSpellcheck: false}) diff --git a/spec/api.spec.js b/spec/api.spec.js index c623a869..8d652c8a 100644 --- a/spec/api.spec.js +++ b/spec/api.spec.js @@ -1,5 +1,5 @@ import {expect} from 'chai' -import {Editable} from '../src/core' +import {Editable} from '../src/core.js' describe('Editable', function () { let editable, div diff --git a/spec/clipboard.spec.js b/spec/clipboard.spec.js index 316ba912..aa65b292 100644 --- a/spec/clipboard.spec.js +++ b/spec/clipboard.spec.js @@ -1,7 +1,7 @@ import {expect} from 'chai' -import {parseContent, updateConfig} from '../src/clipboard' +import {parseContent, updateConfig} from '../src/clipboard.js' import cloneDeep from 'lodash-es/cloneDeep' -import config from '../src/config' +import config from '../src/config.js' describe('Clipboard', function () { diff --git a/spec/config.spec.js b/spec/config.spec.js index 274490e3..15d31f46 100644 --- a/spec/config.spec.js +++ b/spec/config.spec.js @@ -1,7 +1,7 @@ import {expect} from 'chai' import cloneDeep from 'lodash-es/cloneDeep' -import config from '../src/config' -import {Editable} from '../src/core' +import config from '../src/config.js' +import {Editable} from '../src/core.js' describe('Editable configuration', function () { diff --git a/spec/content.spec.js b/spec/content.spec.js index 0794e8c7..7965ea1a 100644 --- a/spec/content.spec.js +++ b/spec/content.spec.js @@ -1,8 +1,8 @@ import {expect} from 'chai' -import {createElement, createRange} from '../src/util/dom' +import {createElement, createRange} from '../src/util/dom.js' -import * as content from '../src/content' -import * as rangeSaveRestore from '../src/range-save-restore' +import * as content from '../src/content.js' +import * as rangeSaveRestore from '../src/range-save-restore.js' describe('Content', function () { diff --git a/spec/create-default-events.spec.js b/spec/create-default-events.spec.js index efcedbf3..50ef5065 100644 --- a/spec/create-default-events.spec.js +++ b/spec/create-default-events.spec.js @@ -1,8 +1,8 @@ import {expect} from 'chai' -import {createRange} from '../src/util/dom' +import {createRange} from '../src/util/dom.js' -import Cursor from '../src/cursor' -import {Editable} from '../src/core' +import Cursor from '../src/cursor.js' +import {Editable} from '../src/core.js' describe('Default Events', function () { diff --git a/spec/cursor.spec.js b/spec/cursor.spec.js index 0d85b299..54ecce83 100644 --- a/spec/cursor.spec.js +++ b/spec/cursor.spec.js @@ -1,9 +1,9 @@ import {expect} from 'chai' -import {createRange, createElement} from '../src/util/dom' +import {createRange, createElement} from '../src/util/dom.js' -import * as content from '../src/content' -import Cursor from '../src/cursor' -import config from '../src/config' +import * as content from '../src/content.js' +import Cursor from '../src/cursor.js' +import config from '../src/config.js' describe('Cursor', function () { diff --git a/spec/dispatcher.spec.js b/spec/dispatcher.spec.js index d8bff83f..5e94f59c 100644 --- a/spec/dispatcher.spec.js +++ b/spec/dispatcher.spec.js @@ -1,10 +1,10 @@ import {expect} from 'chai' -import {createRange, rangesAreEqual} from '../src/util/dom' -import * as content from '../src/content' -import Cursor from '../src/cursor' -import Keyboard from '../src/keyboard' -import {Editable} from '../src/core' -import Selection from '../src/selection' +import {createRange, rangesAreEqual} from '../src/util/dom.js' +import * as content from '../src/content.js' +import Cursor from '../src/cursor.js' +import Keyboard from '../src/keyboard.js' +import {Editable} from '../src/core.js' +import Selection from '../src/selection.js' const {key} = Keyboard describe('Dispatcher', function () { diff --git a/spec/eventable.spec.js b/spec/eventable.spec.js index d6818302..8b328df1 100644 --- a/spec/eventable.spec.js +++ b/spec/eventable.spec.js @@ -1,5 +1,5 @@ import {expect} from 'chai' -import eventable from '../src/eventable' +import eventable from '../src/eventable.js' describe('eventable', function () { diff --git a/spec/highlight-support.spec.js b/spec/highlight-support.spec.js index 6b6ed7d8..bcc410e0 100644 --- a/spec/highlight-support.spec.js +++ b/spec/highlight-support.spec.js @@ -1,10 +1,10 @@ import {expect} from 'chai' import sinon from 'sinon' -import {Editable} from '../src/core' -import highlightSupport from '../src/highlight-support' -import {createElement, createRange, toCharacterRange} from '../src/util/dom' -import Selection from '../src/selection' +import {Editable} from '../src/core.js' +import highlightSupport from '../src/highlight-support.js' +import {createElement, createRange, toCharacterRange} from '../src/util/dom.js' +import Selection from '../src/selection.js' function setupHighlightEnv (context, text) { context.text = text diff --git a/spec/highlight-text.spec.js b/spec/highlight-text.spec.js index d80661ef..60ecaec7 100644 --- a/spec/highlight-text.spec.js +++ b/spec/highlight-text.spec.js @@ -1,10 +1,10 @@ import {expect} from 'chai' import sinon from 'sinon' -import Cursor from '../src/cursor' -import highlightText from '../src/highlight-text' -import {searchAllWords} from '../src/plugins/highlighting/text-search' -import {createElement, createRange} from '../src/util/dom' +import Cursor from '../src/cursor.js' +import highlightText from '../src/highlight-text.js' +import {searchAllWords} from '../src/plugins/highlighting/text-search.js' +import {createElement, createRange} from '../src/util/dom.js' describe('highlightText', function () { diff --git a/spec/keyboard.spec.js b/spec/keyboard.spec.js index 18546091..7115c0d8 100644 --- a/spec/keyboard.spec.js +++ b/spec/keyboard.spec.js @@ -1,7 +1,7 @@ import {expect} from 'chai' -import {createElement, createRange} from '../src/util/dom' -import Keyboard from '../src/keyboard' -import * as nodeType from '../src/node-type' +import {createElement, createRange} from '../src/util/dom.js' +import Keyboard from '../src/keyboard.js' +import * as nodeType from '../src/node-type.js' describe('Keyboard', function () { diff --git a/spec/match-collection.spec.js b/spec/match-collection.spec.js index b065d84d..dab39c08 100644 --- a/spec/match-collection.spec.js +++ b/spec/match-collection.spec.js @@ -1,5 +1,5 @@ import {expect} from 'chai' -import MatchCollection from '../src/plugins/highlighting/match-collection' +import MatchCollection from '../src/plugins/highlighting/match-collection.js' describe('MatchCollection', function () { diff --git a/spec/monitored-highlighting.spec.js b/spec/monitored-highlighting.spec.js index 0564fc70..89ebf098 100644 --- a/spec/monitored-highlighting.spec.js +++ b/spec/monitored-highlighting.spec.js @@ -1,7 +1,7 @@ import {expect} from 'chai' -import {Editable} from '../src/core' -import MonitoredHighlighting from '../src/monitored-highlighting' +import {Editable} from '../src/core.js' +import MonitoredHighlighting from '../src/monitored-highlighting.js' describe('MonitoredHighlighting:', function () { diff --git a/spec/node-iterator.spec.js b/spec/node-iterator.spec.js index 62550a4d..fde4de37 100644 --- a/spec/node-iterator.spec.js +++ b/spec/node-iterator.spec.js @@ -1,7 +1,7 @@ import {expect} from 'chai' -import {createElement} from '../src/util/dom' -import NodeIterator from '../src/node-iterator' -import highlightText from '../src/highlight-text' +import {createElement} from '../src/util/dom.js' +import NodeIterator from '../src/node-iterator.js' +import highlightText from '../src/highlight-text.js' describe('NodeIterator', function () { // Helper methods diff --git a/spec/parser.spec.js b/spec/parser.spec.js index 340b3b2a..3369ab7c 100644 --- a/spec/parser.spec.js +++ b/spec/parser.spec.js @@ -1,8 +1,8 @@ import {expect} from 'chai' -import {createRange, createElement} from '../src/util/dom' +import {createRange, createElement} from '../src/util/dom.js' -import * as parser from '../src/parser' -import config from '../src/config' +import * as parser from '../src/parser.js' +import config from '../src/config.js' describe('Parser', function () { // helper methods diff --git a/spec/range-container.spec.js b/spec/range-container.spec.js index d1f8390a..efa957da 100644 --- a/spec/range-container.spec.js +++ b/spec/range-container.spec.js @@ -1,6 +1,6 @@ import {expect} from 'chai' -import {createElement, createRange} from '../src/util/dom' -import RangeContainer from '../src/range-container' +import {createElement, createRange} from '../src/util/dom.js' +import RangeContainer from '../src/range-container.js' describe('RangeContainer', function () { describe('with no params', function () { diff --git a/spec/range-save-restore.spec.js b/spec/range-save-restore.spec.js index b7d51a1c..88011e72 100644 --- a/spec/range-save-restore.spec.js +++ b/spec/range-save-restore.spec.js @@ -1,6 +1,6 @@ import {expect} from 'chai' -import {createElement, createRange, rangeToHtml} from '../src/util/dom' -import * as rangeSaveRestore from '../src/range-save-restore' +import {createElement, createRange, rangeToHtml} from '../src/util/dom.js' +import * as rangeSaveRestore from '../src/range-save-restore.js' describe('RangeSaveRestore', function () { diff --git a/spec/selection.spec.js b/spec/selection.spec.js index 0e9f3f7e..ccdc0fb9 100644 --- a/spec/selection.spec.js +++ b/spec/selection.spec.js @@ -1,10 +1,10 @@ import {expect} from 'chai' -import {Editable} from '../src/core' -import Selection from '../src/selection' -import Cursor from '../src/cursor' -import config from '../src/config' -import {createElement, createRange} from '../src/util/dom' +import {Editable} from '../src/core.js' +import Selection from '../src/selection.js' +import Cursor from '../src/cursor.js' +import config from '../src/config.js' +import {createElement, createRange} from '../src/util/dom.js' describe('Selection', function () { diff --git a/spec/spellcheck.spec.js b/spec/spellcheck.spec.js index b124c8e1..9e71616a 100644 --- a/spec/spellcheck.spec.js +++ b/spec/spellcheck.spec.js @@ -1,9 +1,9 @@ import {expect} from 'chai' import sinon from 'sinon' -import {Editable} from '../src/core' -import MonitoredHighlighting from '../src/monitored-highlighting' -import Cursor from '../src/cursor' -import {createElement, createRange} from '../src/util/dom' +import {Editable} from '../src/core.js' +import MonitoredHighlighting from '../src/monitored-highlighting.js' +import Cursor from '../src/cursor.js' +import {createElement, createRange} from '../src/util/dom.js' describe('Spellcheck:', function () { diff --git a/spec/string.spec.js b/spec/string.spec.js index 0be21aa4..89fdd0ff 100644 --- a/spec/string.spec.js +++ b/spec/string.spec.js @@ -1,5 +1,5 @@ import {expect} from 'chai' -import {escapeHtml} from '../src/util/string' +import {escapeHtml} from '../src/util/string.js' describe('string util', function () { diff --git a/spec/text-search.spec.js b/spec/text-search.spec.js index 659f8785..965abf40 100644 --- a/spec/text-search.spec.js +++ b/spec/text-search.spec.js @@ -1,6 +1,6 @@ import {expect} from 'chai' -import {searchText, searchWord} from '../src/plugins/highlighting/text-search' +import {searchText, searchWord} from '../src/plugins/highlighting/text-search.js' describe('text-search:', function () { diff --git a/src/block.js b/src/block.js index 4e970b12..ec6fb252 100644 --- a/src/block.js +++ b/src/block.js @@ -1,5 +1,5 @@ -import config from './config' -import * as content from './content' +import config from './config.js' +import * as content from './content.js' let nextBlockId = 1 const state = {} diff --git a/src/clipboard.js b/src/clipboard.js index d02d168a..3bb32efe 100644 --- a/src/clipboard.js +++ b/src/clipboard.js @@ -1,8 +1,8 @@ -import config from './config' -import * as string from './util/string' -import * as nodeType from './node-type' -import * as quotes from './quotes' -import {isPlainTextBlock} from './block' +import config from './config.js' +import * as string from './util/string.js' +import * as nodeType from './node-type.js' +import * as quotes from './quotes.js' +import {isPlainTextBlock} from './block.js' let allowedElements, allowedPlainTextElements, requiredAttributes, transformElements, blockLevelElements, replaceQuotes let splitIntoBlocks, blacklistedElements diff --git a/src/content.js b/src/content.js index 0e97dfd3..9c8ed1e8 100644 --- a/src/content.js +++ b/src/content.js @@ -1,9 +1,9 @@ -import * as nodeType from './node-type' -import * as rangeSaveRestore from './range-save-restore' -import * as parser from './parser' -import * as string from './util/string' -import {createElement, createRange, getNodes, normalizeBoundaries, splitBoundaries, containsNodeText} from './util/dom' -import config from './config' +import * as nodeType from './node-type.js' +import * as rangeSaveRestore from './range-save-restore.js' +import * as parser from './parser.js' +import * as string from './util/string.js' +import {createElement, createRange, getNodes, normalizeBoundaries, splitBoundaries, containsNodeText} from './util/dom.js' +import config from './config.js' function restoreRange (host, range, func) { range = rangeSaveRestore.save(range) diff --git a/src/core.js b/src/core.js index 34246de9..d54056c3 100644 --- a/src/core.js +++ b/src/core.js @@ -1,17 +1,17 @@ -import config from './config' -import error from './util/error' -import * as parser from './parser' -import * as block from './block' -import * as content from './content' -import * as clipboard from './clipboard' -import Dispatcher from './dispatcher' -import Cursor from './cursor' -import highlightSupport from './highlight-support' -import MonitoredHighlighting from './monitored-highlighting' -import createDefaultEvents from './create-default-events' -import {textNodesUnder, getTextNodeAndRelativeOffset} from './util/element' -import {binaryCursorSearch} from './util/binary_search' -import {domArray, createRange, nodeContainsRange} from './util/dom' +import config from './config.js' +import error from './util/error.js' +import * as parser from './parser.js' +import * as block from './block.js' +import * as content from './content.js' +import * as clipboard from './clipboard.js' +import Dispatcher from './dispatcher.js' +import Cursor from './cursor.js' +import highlightSupport from './highlight-support.js' +import MonitoredHighlighting from './monitored-highlighting.js' +import createDefaultEvents from './create-default-events.js' +import {textNodesUnder, getTextNodeAndRelativeOffset} from './util/element.js' +import {binaryCursorSearch} from './util/binary_search.js' +import {domArray, createRange, nodeContainsRange} from './util/dom.js' /** * The Core module provides the Editable class that defines the Editable.JS diff --git a/src/create-default-behavior.js b/src/create-default-behavior.js index d7cfac87..592cd350 100644 --- a/src/create-default-behavior.js +++ b/src/create-default-behavior.js @@ -1,8 +1,8 @@ -import * as parser from './parser' -import * as content from './content' -import log from './util/log' -import * as block from './block' -import * as nodeType from './node-type' +import * as parser from './parser.js' +import * as content from './content.js' +import log from './util/log.js' +import * as block from './block.js' +import * as nodeType from './node-type.js' /** * The Behavior module defines the behavior triggered in response to the Editable.JS diff --git a/src/create-default-events.js b/src/create-default-events.js index 1d3ec945..9c9a192b 100644 --- a/src/create-default-events.js +++ b/src/create-default-events.js @@ -1,4 +1,4 @@ -import createDefaultBehavior from './create-default-behavior' +import createDefaultBehavior from './create-default-behavior.js' export default function createDefaultEvents (editable) { const behavior = createDefaultBehavior(editable) diff --git a/src/cursor.js b/src/cursor.js index 6cc4c62d..d99e5dc4 100644 --- a/src/cursor.js +++ b/src/cursor.js @@ -1,13 +1,12 @@ -import * as viewport from './util/viewport' - -import * as content from './content' -import * as parser from './parser' -import * as string from './util/string' -import {elementNode, documentFragmentNode} from './node-type' -import error from './util/error' -import * as rangeSaveRestore from './range-save-restore' -// import printRange from './util/print_range' -import {closest, getSelection, rangesAreEqual} from './util/dom' +import * as viewport from './util/viewport.js' + +import * as content from './content.js' +import * as parser from './parser.js' +import * as string from './util/string.js' +import {elementNode, documentFragmentNode} from './node-type.js' +import error from './util/error.js' +import * as rangeSaveRestore from './range-save-restore.js' +import {closest, getSelection, rangesAreEqual} from './util/dom.js' /** * The Cursor module provides a cross-browser abstraction layer for cursor. diff --git a/src/dispatcher.js b/src/dispatcher.js index 0e06380d..d8dc6912 100644 --- a/src/dispatcher.js +++ b/src/dispatcher.js @@ -1,11 +1,11 @@ -import {selectionchange} from './feature-detection' -import * as clipboard from './clipboard' -import eventable from './eventable' -import SelectionWatcher from './selection-watcher' -import config from './config' -import Keyboard from './keyboard' -import {closest} from './util/dom' -import {replaceLast, endsWithSingleSpace} from './util/string' +import {selectionchange} from './feature-detection.js' +import * as clipboard from './clipboard.js' +import eventable from './eventable.js' +import SelectionWatcher from './selection-watcher.js' +import config from './config.js' +import Keyboard from './keyboard.js' +import {closest} from './util/dom.js' +import {replaceLast, endsWithSingleSpace} from './util/string.js' // This will be set to true once we detect the input event is working. // Input event description on MDN: diff --git a/src/highlight-support.js b/src/highlight-support.js index dece8bc2..0183b148 100644 --- a/src/highlight-support.js +++ b/src/highlight-support.js @@ -1,7 +1,7 @@ -import * as content from './content' -import highlightText from './highlight-text' -import {searchText} from './plugins/highlighting/text-search' -import {createElement, createRange, toCharacterRange} from './util/dom' +import * as content from './content.js' +import highlightText from './highlight-text.js' +import {searchText} from './plugins/highlighting/text-search.js' +import {createElement, createRange, toCharacterRange} from './util/dom.js' const highlightSupport = { diff --git a/src/highlight-text.js b/src/highlight-text.js index b7818dda..4294ec0d 100644 --- a/src/highlight-text.js +++ b/src/highlight-text.js @@ -1,6 +1,6 @@ -import NodeIterator from './node-iterator' -import * as nodeType from './node-type' -import {createRange} from './util/dom' +import NodeIterator from './node-iterator.js' +import * as nodeType from './node-type.js' +import {createRange} from './util/dom.js' export default { diff --git a/src/keyboard.js b/src/keyboard.js index 03804473..296168dd 100644 --- a/src/keyboard.js +++ b/src/keyboard.js @@ -1,7 +1,7 @@ -import {createRange, containsRange} from './util/dom' -import {contenteditableSpanBug} from './feature-detection' -import * as nodeType from './node-type' -import eventable from './eventable' +import {createRange, containsRange} from './util/dom.js' +import {contenteditableSpanBug} from './feature-detection.js' +import * as nodeType from './node-type.js' +import eventable from './eventable.js' /** * The Keyboard module defines an event API for key events. diff --git a/src/monitored-highlighting.js b/src/monitored-highlighting.js index 29a81262..fa5ebdd4 100644 --- a/src/monitored-highlighting.js +++ b/src/monitored-highlighting.js @@ -1,13 +1,13 @@ import _merge from 'lodash-es/merge' -import * as nodeType from './node-type' -import * as content from './content' -import highlightText from './highlight-text' -import SpellcheckService from './plugins/highlighting/spellcheck-service' -import WhitespaceHighlighting from './plugins/highlighting/whitespace-highlighting' -import {searchAllWords} from './plugins/highlighting/text-search' -import MatchCollection from './plugins/highlighting/match-collection' -import highlightSupport from './highlight-support' -import {domArray, domSelector} from './util/dom' +import * as nodeType from './node-type.js' +import * as content from './content.js' +import highlightText from './highlight-text.js' +import SpellcheckService from './plugins/highlighting/spellcheck-service.js' +import WhitespaceHighlighting from './plugins/highlighting/whitespace-highlighting.js' +import {searchAllWords} from './plugins/highlighting/text-search.js' +import MatchCollection from './plugins/highlighting/match-collection.js' +import highlightSupport from './highlight-support.js' +import {domArray, domSelector} from './util/dom.js' // Spellcheck and Whitespace Highlighting // -------------------------------------- diff --git a/src/node-iterator.js b/src/node-iterator.js index 46ccee42..3c0e2e54 100644 --- a/src/node-iterator.js +++ b/src/node-iterator.js @@ -1,4 +1,4 @@ -import {textNode} from './node-type' +import {textNode} from './node-type.js' // A DOM node iterator. // diff --git a/src/parser.js b/src/parser.js index 62539bac..3502fbf1 100644 --- a/src/parser.js +++ b/src/parser.js @@ -1,7 +1,7 @@ -import * as string from './util/string' -import * as nodeType from './node-type' -import config from './config' -import {closest} from './util/dom' +import * as string from './util/string.js' +import * as nodeType from './node-type.js' +import config from './config.js' +import {closest} from './util/dom.js' /** * The parser module provides helper methods to parse html-chunks diff --git a/src/plugins/highlighting/spellcheck-service.js b/src/plugins/highlighting/spellcheck-service.js index 86fca45d..0e009431 100644 --- a/src/plugins/highlighting/spellcheck-service.js +++ b/src/plugins/highlighting/spellcheck-service.js @@ -1,4 +1,4 @@ -import * as content from '../../content' +import * as content from '../../content.js' /** * Spellcheck class. diff --git a/src/range-container.js b/src/range-container.js index 15b63c24..20fdc832 100644 --- a/src/range-container.js +++ b/src/range-container.js @@ -1,6 +1,6 @@ -import Cursor from './cursor' -import Selection from './selection' -import {rangesAreEqual} from './util/dom' +import Cursor from './cursor.js' +import Selection from './selection.js' +import {rangesAreEqual} from './util/dom.js' /** RangeContainer * diff --git a/src/range-save-restore.js b/src/range-save-restore.js index 2b46ffaa..8582ad97 100644 --- a/src/range-save-restore.js +++ b/src/range-save-restore.js @@ -1,6 +1,6 @@ -import error from './util/error' -import * as nodeType from './node-type' -import {createRange, normalizeBoundaries} from './util/dom' +import error from './util/error.js' +import * as nodeType from './node-type.js' +import {createRange, normalizeBoundaries} from './util/dom.js' /** * Inspired by the Selection save and restore module for Rangy by Tim Down diff --git a/src/selection-watcher.js b/src/selection-watcher.js index b7a6ca08..ae145dd7 100644 --- a/src/selection-watcher.js +++ b/src/selection-watcher.js @@ -1,8 +1,8 @@ -import * as parser from './parser' -import RangeContainer from './range-container' -import Cursor from './cursor' -import Selection from './selection' -import {getSelection} from './util/dom' +import * as parser from './parser.js' +import RangeContainer from './range-container.js' +import Cursor from './cursor.js' +import Selection from './selection.js' +import {getSelection} from './util/dom.js' /** * The SelectionWatcher module watches for selection changes inside diff --git a/src/selection.js b/src/selection.js index e9ba7066..75710b43 100644 --- a/src/selection.js +++ b/src/selection.js @@ -1,16 +1,16 @@ -import Cursor from './cursor' -import * as content from './content' -import * as parser from './parser' -import * as block from './block' -import config from './config' -import highlightSupport from './highlight-support' -import highlightText from './highlight-text' +import Cursor from './cursor.js' +import * as content from './content.js' +import * as parser from './parser.js' +import * as block from './block.js' +import config from './config.js' +import highlightSupport from './highlight-support.js' +import highlightText from './highlight-text.js' import { toCharacterRange, rangeToHtml, findStartExcludingWhitespace, findEndExcludingWhitespace -} from './util/dom' +} from './util/dom.js' /** * The Selection module provides a cross-browser abstraction layer for range diff --git a/src/util/binary_search.js b/src/util/binary_search.js index 8d6901c2..c6e5105e 100644 --- a/src/util/binary_search.js +++ b/src/util/binary_search.js @@ -1,5 +1,5 @@ 'use strict' -import {getTotalCharCount, textNodesUnder, getTextNodeAndRelativeOffset} from './element' +import {getTotalCharCount, textNodesUnder, getTextNodeAndRelativeOffset} from './element.js' /** * This is a binary search algorithm implementation aimed at finding diff --git a/src/util/dom.js b/src/util/dom.js index 47e623ce..2dc067ab 100644 --- a/src/util/dom.js +++ b/src/util/dom.js @@ -1,5 +1,5 @@ -import NodeIterator from '../node-iterator' -import {textNode} from '../node-type' +import NodeIterator from '../node-iterator.js' +import {textNode} from '../node-type.js' /** * @param {HTMLElement | Array | String} target diff --git a/src/util/element.js b/src/util/element.js index 4b472544..2ce5726a 100644 --- a/src/util/element.js +++ b/src/util/element.js @@ -1,5 +1,5 @@ 'use strict' -import NodeIterator from '../node-iterator' +import NodeIterator from '../node-iterator.js' export function textNodesUnder (node) { const iterator = new NodeIterator(node, 'getNextTextNode') diff --git a/src/util/error.js b/src/util/error.js index c82e43a1..95c3d5e1 100644 --- a/src/util/error.js +++ b/src/util/error.js @@ -1,4 +1,4 @@ -import config from '../config' +import config from '../config.js' // Allows for safe error logging // Falls back to console.log if console.error is not available diff --git a/src/util/log.js b/src/util/log.js index bedeaed1..6db6d486 100644 --- a/src/util/log.js +++ b/src/util/log.js @@ -1,4 +1,4 @@ -import config from '../config' +import config from '../config.js' // Allows for safe console logging // If the last param is the string "trace" console.trace will be called diff --git a/webpack.config.js b/webpack.config.js index 333811e1..a636f514 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -28,9 +28,6 @@ module.exports = { path: __dirname, filename: '[name].js' }, - externals: dist ? { - jquery: 'jQuery' - } : {}, module: { rules: [ {