@livingdocs/editable.js 5.0.1 → 5.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@livingdocs/editable.js",
3
3
  "description": "Friendly contenteditable API",
4
- "version": "5.0.1",
4
+ "version": "5.0.3",
5
5
  "dependencies": {
6
6
  "@babel/runtime": "^7.16.7",
7
7
  "lodash-es": "^4.17.21"
@@ -15,7 +15,7 @@
15
15
  "babel-loader": "^9.0.0",
16
16
  "babel-plugin-add-module-exports": "^1.0.4",
17
17
  "babel-plugin-istanbul": "^6.1.1",
18
- "chai": "^4.3.6",
18
+ "chai": "^5.0.0",
19
19
  "css-loader": "^6.5.1",
20
20
  "eslint": "^8.8.0",
21
21
  "eslint-plugin-react": "^7.28.0",
@@ -80,11 +80,11 @@
80
80
  "isCi": true,
81
81
  "name": "Drone",
82
82
  "service": "drone",
83
- "commit": "a2b34bb63d4d98116766f241ac62ea8d5c6fdfcb",
84
- "build": "1376",
83
+ "commit": "865c11659b5f5cb8e5cddf91a4de566724d291e6",
84
+ "build": "1411",
85
85
  "branch": "master",
86
86
  "isPr": false,
87
87
  "slug": "livingdocsIO/editable.js",
88
- "date": "2023-12-07T13:01:13.070Z"
88
+ "date": "2024-01-18T08:37:14.217Z"
89
89
  }
90
90
  }
package/src/block.js CHANGED
@@ -1,5 +1,5 @@
1
- import config from './config'
2
- import * as content from './content'
1
+ import config from './config.js'
2
+ import * as content from './content.js'
3
3
 
4
4
  let nextBlockId = 1
5
5
  const state = {}
package/src/clipboard.js CHANGED
@@ -1,8 +1,8 @@
1
- import config from './config'
2
- import * as string from './util/string'
3
- import * as nodeType from './node-type'
4
- import * as quotes from './quotes'
5
- import {isPlainTextBlock} from './block'
1
+ import config from './config.js'
2
+ import * as string from './util/string.js'
3
+ import * as nodeType from './node-type.js'
4
+ import * as quotes from './quotes.js'
5
+ import {isPlainTextBlock} from './block.js'
6
6
 
7
7
  let allowedElements, allowedPlainTextElements, requiredAttributes, transformElements, blockLevelElements, replaceQuotes
8
8
  let splitIntoBlocks, blacklistedElements
package/src/content.js CHANGED
@@ -1,9 +1,9 @@
1
- import * as nodeType from './node-type'
2
- import * as rangeSaveRestore from './range-save-restore'
3
- import * as parser from './parser'
4
- import * as string from './util/string'
5
- import {createElement, createRange, getNodes, normalizeBoundaries, splitBoundaries, containsNodeText} from './util/dom'
6
- import config from './config'
1
+ import * as nodeType from './node-type.js'
2
+ import * as rangeSaveRestore from './range-save-restore.js'
3
+ import * as parser from './parser.js'
4
+ import * as string from './util/string.js'
5
+ import {createElement, createRange, getNodes, normalizeBoundaries, splitBoundaries, containsNodeText} from './util/dom.js'
6
+ import config from './config.js'
7
7
 
8
8
  function restoreRange (host, range, func) {
9
9
  range = rangeSaveRestore.save(range)
package/src/core.js CHANGED
@@ -1,17 +1,17 @@
1
- import config from './config'
2
- import error from './util/error'
3
- import * as parser from './parser'
4
- import * as block from './block'
5
- import * as content from './content'
6
- import * as clipboard from './clipboard'
7
- import Dispatcher from './dispatcher'
8
- import Cursor from './cursor'
9
- import highlightSupport from './highlight-support'
10
- import MonitoredHighlighting from './monitored-highlighting'
11
- import createDefaultEvents from './create-default-events'
12
- import {textNodesUnder, getTextNodeAndRelativeOffset} from './util/element'
13
- import {binaryCursorSearch} from './util/binary_search'
14
- import {domArray, createRange, nodeContainsRange} from './util/dom'
1
+ import config from './config.js'
2
+ import error from './util/error.js'
3
+ import * as parser from './parser.js'
4
+ import * as block from './block.js'
5
+ import * as content from './content.js'
6
+ import * as clipboard from './clipboard.js'
7
+ import Dispatcher from './dispatcher.js'
8
+ import Cursor from './cursor.js'
9
+ import highlightSupport from './highlight-support.js'
10
+ import MonitoredHighlighting from './monitored-highlighting.js'
11
+ import createDefaultEvents from './create-default-events.js'
12
+ import {textNodesUnder, getTextNodeAndRelativeOffset} from './util/element.js'
13
+ import {binaryCursorSearch} from './util/binary_search.js'
14
+ import {domArray, createRange, nodeContainsRange} from './util/dom.js'
15
15
 
16
16
  /**
17
17
  * The Core module provides the Editable class that defines the Editable.JS
@@ -1,8 +1,8 @@
1
- import * as parser from './parser'
2
- import * as content from './content'
3
- import log from './util/log'
4
- import * as block from './block'
5
- import * as nodeType from './node-type'
1
+ import * as parser from './parser.js'
2
+ import * as content from './content.js'
3
+ import log from './util/log.js'
4
+ import * as block from './block.js'
5
+ import * as nodeType from './node-type.js'
6
6
 
7
7
  /**
8
8
  * The Behavior module defines the behavior triggered in response to the Editable.JS
@@ -1,4 +1,4 @@
1
- import createDefaultBehavior from './create-default-behavior'
1
+ import createDefaultBehavior from './create-default-behavior.js'
2
2
 
3
3
  export default function createDefaultEvents (editable) {
4
4
  const behavior = createDefaultBehavior(editable)
package/src/cursor.js CHANGED
@@ -1,13 +1,12 @@
1
- import * as viewport from './util/viewport'
2
-
3
- import * as content from './content'
4
- import * as parser from './parser'
5
- import * as string from './util/string'
6
- import {elementNode, documentFragmentNode} from './node-type'
7
- import error from './util/error'
8
- import * as rangeSaveRestore from './range-save-restore'
9
- // import printRange from './util/print_range'
10
- import {closest, getSelection, rangesAreEqual} from './util/dom'
1
+ import * as viewport from './util/viewport.js'
2
+
3
+ import * as content from './content.js'
4
+ import * as parser from './parser.js'
5
+ import * as string from './util/string.js'
6
+ import {elementNode, documentFragmentNode} from './node-type.js'
7
+ import error from './util/error.js'
8
+ import * as rangeSaveRestore from './range-save-restore.js'
9
+ import {closest, getSelection, rangesAreEqual} from './util/dom.js'
11
10
 
12
11
  /**
13
12
  * The Cursor module provides a cross-browser abstraction layer for cursor.
package/src/dispatcher.js CHANGED
@@ -1,11 +1,11 @@
1
- import {selectionchange} from './feature-detection'
2
- import * as clipboard from './clipboard'
3
- import eventable from './eventable'
4
- import SelectionWatcher from './selection-watcher'
5
- import config from './config'
6
- import Keyboard from './keyboard'
7
- import {closest} from './util/dom'
8
- import {replaceLast, endsWithSingleSpace} from './util/string'
1
+ import {selectionchange} from './feature-detection.js'
2
+ import * as clipboard from './clipboard.js'
3
+ import eventable from './eventable.js'
4
+ import SelectionWatcher from './selection-watcher.js'
5
+ import config from './config.js'
6
+ import Keyboard from './keyboard.js'
7
+ import {closest} from './util/dom.js'
8
+ import {replaceLast, endsWithSingleSpace} from './util/string.js'
9
9
 
10
10
  // This will be set to true once we detect the input event is working.
11
11
  // Input event description on MDN:
@@ -1,7 +1,7 @@
1
- import * as content from './content'
2
- import highlightText from './highlight-text'
3
- import {searchText} from './plugins/highlighting/text-search'
4
- import {createElement, createRange, toCharacterRange} from './util/dom'
1
+ import * as content from './content.js'
2
+ import highlightText from './highlight-text.js'
3
+ import {searchText} from './plugins/highlighting/text-search.js'
4
+ import {createElement, createRange, toCharacterRange} from './util/dom.js'
5
5
 
6
6
  const highlightSupport = {
7
7
 
@@ -1,6 +1,6 @@
1
- import NodeIterator from './node-iterator'
2
- import * as nodeType from './node-type'
3
- import {createRange} from './util/dom'
1
+ import NodeIterator from './node-iterator.js'
2
+ import * as nodeType from './node-type.js'
3
+ import {createRange} from './util/dom.js'
4
4
 
5
5
  export default {
6
6
 
package/src/keyboard.js CHANGED
@@ -1,7 +1,7 @@
1
- import {createRange, containsRange} from './util/dom'
2
- import {contenteditableSpanBug} from './feature-detection'
3
- import * as nodeType from './node-type'
4
- import eventable from './eventable'
1
+ import {createRange, containsRange} from './util/dom.js'
2
+ import {contenteditableSpanBug} from './feature-detection.js'
3
+ import * as nodeType from './node-type.js'
4
+ import eventable from './eventable.js'
5
5
 
6
6
  /**
7
7
  * The Keyboard module defines an event API for key events.
@@ -1,13 +1,13 @@
1
1
  import _merge from 'lodash-es/merge'
2
- import * as nodeType from './node-type'
3
- import * as content from './content'
4
- import highlightText from './highlight-text'
5
- import SpellcheckService from './plugins/highlighting/spellcheck-service'
6
- import WhitespaceHighlighting from './plugins/highlighting/whitespace-highlighting'
7
- import {searchAllWords} from './plugins/highlighting/text-search'
8
- import MatchCollection from './plugins/highlighting/match-collection'
9
- import highlightSupport from './highlight-support'
10
- import {domArray, domSelector} from './util/dom'
2
+ import * as nodeType from './node-type.js'
3
+ import * as content from './content.js'
4
+ import highlightText from './highlight-text.js'
5
+ import SpellcheckService from './plugins/highlighting/spellcheck-service.js'
6
+ import WhitespaceHighlighting from './plugins/highlighting/whitespace-highlighting.js'
7
+ import {searchAllWords} from './plugins/highlighting/text-search.js'
8
+ import MatchCollection from './plugins/highlighting/match-collection.js'
9
+ import highlightSupport from './highlight-support.js'
10
+ import {domArray, domSelector} from './util/dom.js'
11
11
 
12
12
  // Spellcheck and Whitespace Highlighting
13
13
  // --------------------------------------
@@ -1,4 +1,4 @@
1
- import {textNode} from './node-type'
1
+ import {textNode} from './node-type.js'
2
2
 
3
3
  // A DOM node iterator.
4
4
  //
package/src/parser.js CHANGED
@@ -1,7 +1,7 @@
1
- import * as string from './util/string'
2
- import * as nodeType from './node-type'
3
- import config from './config'
4
- import {closest} from './util/dom'
1
+ import * as string from './util/string.js'
2
+ import * as nodeType from './node-type.js'
3
+ import config from './config.js'
4
+ import {closest} from './util/dom.js'
5
5
 
6
6
  /**
7
7
  * The parser module provides helper methods to parse html-chunks
@@ -1,4 +1,4 @@
1
- import * as content from '../../content'
1
+ import * as content from '../../content.js'
2
2
 
3
3
  /**
4
4
  * Spellcheck class.
@@ -1,6 +1,6 @@
1
- import Cursor from './cursor'
2
- import Selection from './selection'
3
- import {rangesAreEqual} from './util/dom'
1
+ import Cursor from './cursor.js'
2
+ import Selection from './selection.js'
3
+ import {rangesAreEqual} from './util/dom.js'
4
4
 
5
5
  /** RangeContainer
6
6
  *
@@ -1,6 +1,6 @@
1
- import error from './util/error'
2
- import * as nodeType from './node-type'
3
- import {createRange, normalizeBoundaries} from './util/dom'
1
+ import error from './util/error.js'
2
+ import * as nodeType from './node-type.js'
3
+ import {createRange, normalizeBoundaries} from './util/dom.js'
4
4
 
5
5
  /**
6
6
  * Inspired by the Selection save and restore module for Rangy by Tim Down
@@ -1,8 +1,8 @@
1
- import * as parser from './parser'
2
- import RangeContainer from './range-container'
3
- import Cursor from './cursor'
4
- import Selection from './selection'
5
- import {getSelection} from './util/dom'
1
+ import * as parser from './parser.js'
2
+ import RangeContainer from './range-container.js'
3
+ import Cursor from './cursor.js'
4
+ import Selection from './selection.js'
5
+ import {getSelection} from './util/dom.js'
6
6
 
7
7
  /**
8
8
  * The SelectionWatcher module watches for selection changes inside
package/src/selection.js CHANGED
@@ -1,16 +1,16 @@
1
- import Cursor from './cursor'
2
- import * as content from './content'
3
- import * as parser from './parser'
4
- import * as block from './block'
5
- import config from './config'
6
- import highlightSupport from './highlight-support'
7
- import highlightText from './highlight-text'
1
+ import Cursor from './cursor.js'
2
+ import * as content from './content.js'
3
+ import * as parser from './parser.js'
4
+ import * as block from './block.js'
5
+ import config from './config.js'
6
+ import highlightSupport from './highlight-support.js'
7
+ import highlightText from './highlight-text.js'
8
8
  import {
9
9
  toCharacterRange,
10
10
  rangeToHtml,
11
11
  findStartExcludingWhitespace,
12
12
  findEndExcludingWhitespace
13
- } from './util/dom'
13
+ } from './util/dom.js'
14
14
 
15
15
  /**
16
16
  * The Selection module provides a cross-browser abstraction layer for range
@@ -1,5 +1,5 @@
1
1
  'use strict'
2
- import {getTotalCharCount, textNodesUnder, getTextNodeAndRelativeOffset} from './element'
2
+ import {getTotalCharCount, textNodesUnder, getTextNodeAndRelativeOffset} from './element.js'
3
3
 
4
4
  /**
5
5
  * This is a binary search algorithm implementation aimed at finding
package/src/util/dom.js CHANGED
@@ -1,5 +1,5 @@
1
- import NodeIterator from '../node-iterator'
2
- import {textNode} from '../node-type'
1
+ import NodeIterator from '../node-iterator.js'
2
+ import {textNode} from '../node-type.js'
3
3
 
4
4
  /**
5
5
  * @param {HTMLElement | Array | String} target
@@ -1,5 +1,5 @@
1
1
  'use strict'
2
- import NodeIterator from '../node-iterator'
2
+ import NodeIterator from '../node-iterator.js'
3
3
 
4
4
  export function textNodesUnder (node) {
5
5
  const iterator = new NodeIterator(node, 'getNextTextNode')
package/src/util/error.js CHANGED
@@ -1,4 +1,4 @@
1
- import config from '../config'
1
+ import config from '../config.js'
2
2
 
3
3
  // Allows for safe error logging
4
4
  // Falls back to console.log if console.error is not available
package/src/util/log.js CHANGED
@@ -1,4 +1,4 @@
1
- import config from '../config'
1
+ import config from '../config.js'
2
2
 
3
3
  // Allows for safe console logging
4
4
  // If the last param is the string "trace" console.trace will be called