Skip to content

Commit

Permalink
fix(import): Explicitly use file extensions with imports
Browse files Browse the repository at this point in the history
  • Loading branch information
marcbachmann committed Jan 18, 2024
1 parent 3efcef3 commit 865c116
Show file tree
Hide file tree
Showing 48 changed files with 161 additions and 165 deletions.
2 changes: 1 addition & 1 deletion examples/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
4 changes: 2 additions & 2 deletions examples/index.js
Original file line number Diff line number Diff line change
@@ -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})
Expand Down
2 changes: 1 addition & 1 deletion spec/api.spec.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/clipboard.spec.js
Original file line number Diff line number Diff line change
@@ -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 () {

Expand Down
4 changes: 2 additions & 2 deletions spec/config.spec.js
Original file line number Diff line number Diff line change
@@ -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 () {

Expand Down
6 changes: 3 additions & 3 deletions spec/content.spec.js
Original file line number Diff line number Diff line change
@@ -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 () {

Expand Down
6 changes: 3 additions & 3 deletions spec/create-default-events.spec.js
Original file line number Diff line number Diff line change
@@ -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 () {

Expand Down
8 changes: 4 additions & 4 deletions spec/cursor.spec.js
Original file line number Diff line number Diff line change
@@ -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 () {

Expand Down
12 changes: 6 additions & 6 deletions spec/dispatcher.spec.js
Original file line number Diff line number Diff line change
@@ -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 () {
Expand Down
2 changes: 1 addition & 1 deletion spec/eventable.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {expect} from 'chai'
import eventable from '../src/eventable'
import eventable from '../src/eventable.js'

describe('eventable', function () {

Expand Down
8 changes: 4 additions & 4 deletions spec/highlight-support.spec.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions spec/highlight-text.spec.js
Original file line number Diff line number Diff line change
@@ -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 () {

Expand Down
6 changes: 3 additions & 3 deletions spec/keyboard.spec.js
Original file line number Diff line number Diff line change
@@ -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 () {

Expand Down
2 changes: 1 addition & 1 deletion spec/match-collection.spec.js
Original file line number Diff line number Diff line change
@@ -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 () {
Expand Down
4 changes: 2 additions & 2 deletions spec/monitored-highlighting.spec.js
Original file line number Diff line number Diff line change
@@ -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 () {

Expand Down
6 changes: 3 additions & 3 deletions spec/node-iterator.spec.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions spec/parser.spec.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/range-container.spec.js
Original file line number Diff line number Diff line change
@@ -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 () {
Expand Down
4 changes: 2 additions & 2 deletions spec/range-save-restore.spec.js
Original file line number Diff line number Diff line change
@@ -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 () {

Expand Down
10 changes: 5 additions & 5 deletions spec/selection.spec.js
Original file line number Diff line number Diff line change
@@ -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 () {

Expand Down
8 changes: 4 additions & 4 deletions spec/spellcheck.spec.js
Original file line number Diff line number Diff line change
@@ -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 () {

Expand Down
2 changes: 1 addition & 1 deletion spec/string.spec.js
Original file line number Diff line number Diff line change
@@ -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 () {

Expand Down
2 changes: 1 addition & 1 deletion spec/text-search.spec.js
Original file line number Diff line number Diff line change
@@ -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 () {

Expand Down
4 changes: 2 additions & 2 deletions src/block.js
Original file line number Diff line number Diff line change
@@ -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 = {}
Expand Down
10 changes: 5 additions & 5 deletions src/clipboard.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/content.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
28 changes: 14 additions & 14 deletions src/core.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/create-default-behavior.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/create-default-events.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
19 changes: 9 additions & 10 deletions src/cursor.js
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
16 changes: 8 additions & 8 deletions src/dispatcher.js
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
8 changes: 4 additions & 4 deletions src/highlight-support.js
Original file line number Diff line number Diff line change
@@ -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 = {

Expand Down
Loading

0 comments on commit 865c116

Please sign in to comment.