editable.ts 0.0.1
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/LICENSE +21 -0
- package/README.md +571 -0
- package/dist/editable.umd.cjs +2 -0
- package/dist/editable.umd.cjs.map +1 -0
- package/lib/block.d.ts +13 -0
- package/lib/block.d.ts.map +1 -0
- package/lib/block.js +58 -0
- package/lib/block.js.map +1 -0
- package/lib/clipboard.d.ts +22 -0
- package/lib/clipboard.d.ts.map +1 -0
- package/lib/clipboard.js +154 -0
- package/lib/clipboard.js.map +1 -0
- package/lib/config.d.ts +37 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +64 -0
- package/lib/config.js.map +1 -0
- package/lib/content.d.ts +37 -0
- package/lib/content.d.ts.map +1 -0
- package/lib/content.js +526 -0
- package/lib/content.js.map +1 -0
- package/lib/core.d.ts +97 -0
- package/lib/core.d.ts.map +1 -0
- package/lib/core.js +261 -0
- package/lib/core.js.map +1 -0
- package/lib/create-default-behavior.d.ts +31 -0
- package/lib/create-default-behavior.d.ts.map +1 -0
- package/lib/create-default-behavior.js +178 -0
- package/lib/create-default-behavior.js.map +1 -0
- package/lib/create-default-events.d.ts +152 -0
- package/lib/create-default-events.d.ts.map +1 -0
- package/lib/create-default-events.js +183 -0
- package/lib/create-default-events.js.map +1 -0
- package/lib/cursor.d.ts +68 -0
- package/lib/cursor.d.ts.map +1 -0
- package/lib/cursor.js +354 -0
- package/lib/cursor.js.map +1 -0
- package/lib/dispatcher.d.ts +78 -0
- package/lib/dispatcher.d.ts.map +1 -0
- package/lib/dispatcher.js +416 -0
- package/lib/dispatcher.js.map +1 -0
- package/lib/eventable.d.ts +2 -0
- package/lib/eventable.d.ts.map +1 -0
- package/lib/eventable.js +104 -0
- package/lib/eventable.js.map +1 -0
- package/lib/feature-detection.d.ts +12 -0
- package/lib/feature-detection.d.ts.map +1 -0
- package/lib/feature-detection.js +42 -0
- package/lib/feature-detection.js.map +1 -0
- package/lib/highlight-support.d.ts +24 -0
- package/lib/highlight-support.d.ts.map +1 -0
- package/lib/highlight-support.js +172 -0
- package/lib/highlight-support.js.map +1 -0
- package/lib/highlight-text.d.ts +21 -0
- package/lib/highlight-text.d.ts.map +1 -0
- package/lib/highlight-text.js +147 -0
- package/lib/highlight-text.js.map +1 -0
- package/lib/keyboard.d.ts +33 -0
- package/lib/keyboard.d.ts.map +1 -0
- package/lib/keyboard.js +189 -0
- package/lib/keyboard.js.map +1 -0
- package/lib/monitored-highlighting.d.ts +28 -0
- package/lib/monitored-highlighting.d.ts.map +1 -0
- package/lib/monitored-highlighting.js +194 -0
- package/lib/monitored-highlighting.js.map +1 -0
- package/lib/node-iterator.d.ts +16 -0
- package/lib/node-iterator.d.ts.map +1 -0
- package/lib/node-iterator.js +97 -0
- package/lib/node-iterator.js.map +1 -0
- package/lib/node-type.d.ts +13 -0
- package/lib/node-type.d.ts.map +1 -0
- package/lib/node-type.js +15 -0
- package/lib/node-type.js.map +1 -0
- package/lib/parser.d.ts +89 -0
- package/lib/parser.d.ts.map +1 -0
- package/lib/parser.js +251 -0
- package/lib/parser.js.map +1 -0
- package/lib/plugins/highlighting/match-collection.d.ts +7 -0
- package/lib/plugins/highlighting/match-collection.d.ts.map +1 -0
- package/lib/plugins/highlighting/match-collection.js +62 -0
- package/lib/plugins/highlighting/match-collection.js.map +1 -0
- package/lib/plugins/highlighting/spellcheck-service.d.ts +12 -0
- package/lib/plugins/highlighting/spellcheck-service.d.ts.map +1 -0
- package/lib/plugins/highlighting/spellcheck-service.js +24 -0
- package/lib/plugins/highlighting/spellcheck-service.js.map +1 -0
- package/lib/plugins/highlighting/text-search.d.ts +10 -0
- package/lib/plugins/highlighting/text-search.d.ts.map +1 -0
- package/lib/plugins/highlighting/text-search.js +92 -0
- package/lib/plugins/highlighting/text-search.js.map +1 -0
- package/lib/plugins/highlighting/whitespace-highlighting.d.ts +14 -0
- package/lib/plugins/highlighting/whitespace-highlighting.d.ts.map +1 -0
- package/lib/plugins/highlighting/whitespace-highlighting.js +52 -0
- package/lib/plugins/highlighting/whitespace-highlighting.js.map +1 -0
- package/lib/quotes.d.ts +8 -0
- package/lib/quotes.d.ts.map +1 -0
- package/lib/quotes.js +170 -0
- package/lib/quotes.js.map +1 -0
- package/lib/range-container.d.ts +22 -0
- package/lib/range-container.d.ts.map +1 -0
- package/lib/range-container.js +52 -0
- package/lib/range-container.js.map +1 -0
- package/lib/range-save-restore.d.ts +13 -0
- package/lib/range-save-restore.d.ts.map +1 -0
- package/lib/range-save-restore.js +153 -0
- package/lib/range-save-restore.js.map +1 -0
- package/lib/selection-watcher.d.ts +55 -0
- package/lib/selection-watcher.d.ts.map +1 -0
- package/lib/selection-watcher.js +126 -0
- package/lib/selection-watcher.js.map +1 -0
- package/lib/selection.d.ts +74 -0
- package/lib/selection.d.ts.map +1 -0
- package/lib/selection.js +341 -0
- package/lib/selection.js.map +1 -0
- package/lib/smartQuotes.d.ts +16 -0
- package/lib/smartQuotes.d.ts.map +1 -0
- package/lib/smartQuotes.js +92 -0
- package/lib/smartQuotes.js.map +1 -0
- package/lib/util/binary_search.d.ts +23 -0
- package/lib/util/binary_search.d.ts.map +1 -0
- package/lib/util/binary_search.js +137 -0
- package/lib/util/binary_search.js.map +1 -0
- package/lib/util/clone-deep.d.ts +8 -0
- package/lib/util/clone-deep.d.ts.map +1 -0
- package/lib/util/clone-deep.js +10 -0
- package/lib/util/clone-deep.js.map +1 -0
- package/lib/util/dom.d.ts +43 -0
- package/lib/util/dom.d.ts.map +1 -0
- package/lib/util/dom.js +272 -0
- package/lib/util/dom.js.map +1 -0
- package/lib/util/element.d.ts +10 -0
- package/lib/util/element.d.ts.map +1 -0
- package/lib/util/element.js +29 -0
- package/lib/util/element.js.map +1 -0
- package/lib/util/error.d.ts +2 -0
- package/lib/util/error.d.ts.map +1 -0
- package/lib/util/error.js +16 -0
- package/lib/util/error.js.map +1 -0
- package/lib/util/log.d.ts +2 -0
- package/lib/util/log.d.ts.map +1 -0
- package/lib/util/log.js +18 -0
- package/lib/util/log.js.map +1 -0
- package/lib/util/merge.d.ts +6 -0
- package/lib/util/merge.d.ts.map +1 -0
- package/lib/util/merge.js +31 -0
- package/lib/util/merge.js.map +1 -0
- package/lib/util/string.d.ts +25 -0
- package/lib/util/string.d.ts.map +1 -0
- package/lib/util/string.js +68 -0
- package/lib/util/string.js.map +1 -0
- package/lib/util/viewport.d.ts +6 -0
- package/lib/util/viewport.d.ts.map +1 -0
- package/lib/util/viewport.js +8 -0
- package/lib/util/viewport.js.map +1 -0
- package/package.json +86 -0
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
/**
|
|
7
|
+
* The SelectionWatcher module watches for selection changes inside
|
|
8
|
+
* of editable blocks.
|
|
9
|
+
*
|
|
10
|
+
* @module core
|
|
11
|
+
* @submodule selectionWatcher
|
|
12
|
+
*/
|
|
13
|
+
export default class SelectionWatcher {
|
|
14
|
+
constructor(dispatcher, win) {
|
|
15
|
+
this.dispatcher = dispatcher;
|
|
16
|
+
this.win = win || window;
|
|
17
|
+
this.selection = undefined;
|
|
18
|
+
this.currentSelection = undefined;
|
|
19
|
+
this.currentRange = undefined;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Updates the internal selection pointer to the current selection.
|
|
23
|
+
* Returns true if no exception occurred.
|
|
24
|
+
*/
|
|
25
|
+
syncSelection() {
|
|
26
|
+
// Note: the try catch was introduced because of rangy exceptions with nativeSelections
|
|
27
|
+
try {
|
|
28
|
+
this.selection = getSelection(this.win);
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Return a RangeContainer if the current selection is within an editable
|
|
37
|
+
* otherwise return an empty RangeContainer
|
|
38
|
+
*/
|
|
39
|
+
getRangeContainer() {
|
|
40
|
+
const successfulSync = this.syncSelection();
|
|
41
|
+
// rangeCount is 0 or 1 in all browsers except firefox
|
|
42
|
+
// firefox can work with multiple ranges
|
|
43
|
+
// (on a mac hold down the command key to select multiple ranges)
|
|
44
|
+
if (this.selection?.rangeCount && successfulSync) {
|
|
45
|
+
try {
|
|
46
|
+
const range = this.selection.getRangeAt(0);
|
|
47
|
+
// Check if range is still valid (not detached)
|
|
48
|
+
if (range && range.commonAncestorContainer) {
|
|
49
|
+
const hostNode = parser.getHost(range.commonAncestorContainer);
|
|
50
|
+
if (hostNode)
|
|
51
|
+
return new RangeContainer(hostNode, range);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
// Range might be detached, return empty container
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// return an empty range container
|
|
59
|
+
return new RangeContainer();
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Gets a fresh RangeContainer with the current selection or cursor.
|
|
63
|
+
*
|
|
64
|
+
* @return RangeContainer instance
|
|
65
|
+
*/
|
|
66
|
+
getFreshRange() {
|
|
67
|
+
return this.getRangeContainer();
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Gets a fresh RangeContainer with the current selection or cursor.
|
|
71
|
+
*
|
|
72
|
+
* @return Either a Cursor or Selection instance or undefined if
|
|
73
|
+
* there is neither a selection or cursor.
|
|
74
|
+
*/
|
|
75
|
+
getFreshSelection() {
|
|
76
|
+
const rangeContainer = this.getRangeContainer();
|
|
77
|
+
return rangeContainer.isCursor
|
|
78
|
+
? rangeContainer.getCursor()
|
|
79
|
+
: rangeContainer.getSelection();
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get the selection set by the last selectionChanged event.
|
|
83
|
+
* Sometimes the event does not fire fast enough and the selection
|
|
84
|
+
* you get is not the one the user sees.
|
|
85
|
+
* In those cases use #getFreshSelection()
|
|
86
|
+
*
|
|
87
|
+
* @return Either a Cursor or Selection instance or undefined if
|
|
88
|
+
* there is neither a selection or cursor.
|
|
89
|
+
*/
|
|
90
|
+
getSelection() {
|
|
91
|
+
return this.currentSelection;
|
|
92
|
+
}
|
|
93
|
+
forceCursor() {
|
|
94
|
+
const rangeContainer = this.getRangeContainer();
|
|
95
|
+
return rangeContainer.forceCursor();
|
|
96
|
+
}
|
|
97
|
+
selectionChanged() {
|
|
98
|
+
const newRangeContainer = this.getRangeContainer();
|
|
99
|
+
if (newRangeContainer.isDifferentFrom(this.currentRange)) {
|
|
100
|
+
const lastSelection = this.currentSelection;
|
|
101
|
+
this.currentRange = newRangeContainer;
|
|
102
|
+
// empty selection or cursor
|
|
103
|
+
if (lastSelection) {
|
|
104
|
+
if (lastSelection.isCursor && !this.currentRange.isCursor) {
|
|
105
|
+
this.dispatcher.notify('cursor', lastSelection.host);
|
|
106
|
+
}
|
|
107
|
+
else if (lastSelection.isSelection && !this.currentRange.isSelection) {
|
|
108
|
+
this.dispatcher.notify('selection', lastSelection.host);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// set new selection or cursor and fire event
|
|
112
|
+
if (this.currentRange.isCursor && this.currentRange.host && this.currentRange.range) {
|
|
113
|
+
this.currentSelection = new Cursor(this.currentRange.host, this.currentRange.range);
|
|
114
|
+
this.dispatcher.notify('cursor', this.currentSelection.host, this.currentSelection);
|
|
115
|
+
}
|
|
116
|
+
else if (this.currentRange.isSelection && this.currentRange.host && this.currentRange.range) {
|
|
117
|
+
this.currentSelection = new Selection(this.currentRange.host, this.currentRange.range);
|
|
118
|
+
this.dispatcher.notify('selection', this.currentSelection.host, this.currentSelection);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
this.currentSelection = undefined;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=selection-watcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-watcher.js","sourceRoot":"","sources":["../src/selection-watcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,cAAc,MAAM,sBAAsB,CAAA;AACjD,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAA;AAG1C;;;;;;GAMG;AAEH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IAOnC,YAAa,UAAsB,EAAE,GAAY;QAC/C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,MAAM,CAAA;QACxB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAA;QACjC,IAAI,CAAC,YAAY,GAAG,SAAS,CAAA;IAC/B,CAAC;IAED;;;OAGG;IACH,aAAa;QACX,uFAAuF;QACvF,IAAI,CAAC;YACH,IAAI,CAAC,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACzC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,KAAK,CAAA;QACd,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;MAGE;IACF,iBAAiB;QACf,MAAM,cAAc,GAAG,IAAI,CAAC,aAAa,EAAE,CAAA;QAE3C,sDAAsD;QACtD,wCAAwC;QACxC,iEAAiE;QACjE,IAAI,IAAI,CAAC,SAAS,EAAE,UAAU,IAAI,cAAc,EAAE,CAAC;YACjD,IAAI,CAAC;gBACH,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;gBAC1C,+CAA+C;gBAC/C,IAAI,KAAK,IAAI,KAAK,CAAC,uB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Cursor from './cursor.js';
|
|
2
|
+
/**
|
|
3
|
+
* The Selection module provides a cross-browser abstraction layer for range
|
|
4
|
+
* and selection.
|
|
5
|
+
*
|
|
6
|
+
* @module core
|
|
7
|
+
* @submodule selection
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Class that represents a selection and provides functionality to access or
|
|
11
|
+
* modify the selection.
|
|
12
|
+
*
|
|
13
|
+
* @class Selection
|
|
14
|
+
* @constructor
|
|
15
|
+
*/
|
|
16
|
+
export default class Selection extends Cursor {
|
|
17
|
+
constructor(editableHost: HTMLElement, range: Range);
|
|
18
|
+
text(): string;
|
|
19
|
+
html(): string;
|
|
20
|
+
isAllSelected(): boolean;
|
|
21
|
+
getTextRange(): import("./util/dom.js").CharacterRange;
|
|
22
|
+
toString(): string;
|
|
23
|
+
isWrappable(): boolean;
|
|
24
|
+
getRects(): DOMRectList;
|
|
25
|
+
link(href: string, attrs?: Record<string, string | null | undefined>): void;
|
|
26
|
+
trimRange(): void;
|
|
27
|
+
unlink(): void;
|
|
28
|
+
toggleLink(href: string, attrs?: Record<string, string | null | undefined>): void;
|
|
29
|
+
highlightComment({ highlightId, textRange }: {
|
|
30
|
+
highlightId: string;
|
|
31
|
+
textRange: {
|
|
32
|
+
text: string;
|
|
33
|
+
start: number;
|
|
34
|
+
end: number;
|
|
35
|
+
};
|
|
36
|
+
}): void;
|
|
37
|
+
highlight({ highlightId }: {
|
|
38
|
+
highlightId: string;
|
|
39
|
+
}): void;
|
|
40
|
+
toggle(elem: Node): void;
|
|
41
|
+
toggleCustom({ tagName, attributes, trim }: {
|
|
42
|
+
tagName: string;
|
|
43
|
+
attributes: Record<string, any>;
|
|
44
|
+
trim?: boolean;
|
|
45
|
+
}): void;
|
|
46
|
+
makeCustom({ tagName, attributes, trim }: {
|
|
47
|
+
tagName: string;
|
|
48
|
+
attributes: Record<string, any>;
|
|
49
|
+
trim?: boolean;
|
|
50
|
+
}): void;
|
|
51
|
+
makeBold(): void;
|
|
52
|
+
toggleBold(): void;
|
|
53
|
+
giveEmphasis(): void;
|
|
54
|
+
toggleEmphasis(): void;
|
|
55
|
+
makeUnderline(): void;
|
|
56
|
+
toggleUnderline(): void;
|
|
57
|
+
insertCharacter(character: string): Cursor;
|
|
58
|
+
surround(startCharacter: string, endCharacter: string): void;
|
|
59
|
+
removeSurround(startCharacter: string, endCharacter: string): void;
|
|
60
|
+
removeChars(chars?: string[]): void;
|
|
61
|
+
toggleSurround(startCharacter: string, endCharacter: string): void;
|
|
62
|
+
removeFormatting(selector?: string): void;
|
|
63
|
+
deleteExactSurroundingTags(): Selection;
|
|
64
|
+
deleteContainedTags(): Selection;
|
|
65
|
+
deleteContent(): Cursor;
|
|
66
|
+
expandTo(elem: Node): void;
|
|
67
|
+
collapseAtBeginning(elem?: Node): Cursor;
|
|
68
|
+
collapseAtEnd(elem?: Node): Cursor;
|
|
69
|
+
forceWrap(elem: Node): void;
|
|
70
|
+
isExactSelection(elem: Node, onlyVisible?: string | undefined): boolean;
|
|
71
|
+
containsString(str: string): boolean;
|
|
72
|
+
deleteCharacter(character: string): void;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../src/selection.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAchC;;;;;;GAMG;AACH;;;;;;GAMG;AAEH,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,MAAM;gBAC9B,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK;IAOpD,IAAI;IAKJ,IAAI;IAIJ,aAAa;IAYb,YAAY;IAKZ,QAAQ;IAMR,WAAW;IAMX,QAAQ;IAMR,IAAI,CAAE,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAM,GAAG,IAAI;IAkBhF,SA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AE,MAAM,EAAO,GAAG,IAAI;IAQxC,cAAc,CAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI;IAYnE,gBAAgB,CAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI;IAW1C,0BAA0B,IAAK,SAAS;IAcxC,mBAAmB,IAAK,SAAS;IAUjC,aAAa;IAQb,QAAQ,CAAE,IAAI,EAAE,IAAI,GAAG,IAAI;IAQ3B,mBAAmB,CAAE,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM;IASzC,aAAa,CAAE,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM;IASnC,SAAS,CAAE,IAAI,EAAE,IAAI,GAAG,IAAI;IAmB5B,gBAAgB,CAAE,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO;IAQxE,cAAc,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IAMrC,eAAe,CAAE,SAAS,EAAE,MAAM,GAAG,IAAI;CAI1C"}
|
package/lib/selection.js
ADDED
|
@@ -0,0 +1,341 @@
|
|
|
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
|
+
import { toCharacterRange, rangeToHtml, findStartExcludingWhitespace, findEndExcludingWhitespace } from './util/dom.js';
|
|
9
|
+
/**
|
|
10
|
+
* The Selection module provides a cross-browser abstraction layer for range
|
|
11
|
+
* and selection.
|
|
12
|
+
*
|
|
13
|
+
* @module core
|
|
14
|
+
* @submodule selection
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Class that represents a selection and provides functionality to access or
|
|
18
|
+
* modify the selection.
|
|
19
|
+
*
|
|
20
|
+
* @class Selection
|
|
21
|
+
* @constructor
|
|
22
|
+
*/
|
|
23
|
+
export default class Selection extends Cursor {
|
|
24
|
+
constructor(editableHost, range) {
|
|
25
|
+
super(editableHost, range);
|
|
26
|
+
delete this.isCursor;
|
|
27
|
+
this.isSelection = true;
|
|
28
|
+
}
|
|
29
|
+
// Get the text inside the selection.
|
|
30
|
+
text() {
|
|
31
|
+
return this.range.toString();
|
|
32
|
+
}
|
|
33
|
+
// Get the html inside the selection.
|
|
34
|
+
html() {
|
|
35
|
+
return rangeToHtml(this.range);
|
|
36
|
+
}
|
|
37
|
+
isAllSelected() {
|
|
38
|
+
return parser.isBeginningOfHost(this.host, this.range.startContainer, this.range.startOffset) && parser.isTextEndOfHost(this.host, this.range.endContainer, this.range.endOffset);
|
|
39
|
+
}
|
|
40
|
+
getTextRange() {
|
|
41
|
+
return toCharacterRange(this.range, this.host);
|
|
42
|
+
}
|
|
43
|
+
// Return a plain string of the current selection content.
|
|
44
|
+
toString() {
|
|
45
|
+
return this.range.toString();
|
|
46
|
+
}
|
|
47
|
+
// Return true if the selection can be wrapped, i.e. all open nodes
|
|
48
|
+
// are closed within this selection.
|
|
49
|
+
isWrappable() {
|
|
50
|
+
return content.isWrappable(this.range);
|
|
51
|
+
}
|
|
52
|
+
// Get the ClientRects of this selection.
|
|
53
|
+
// Use this if you want more precision than getBoundingClientRect can give.
|
|
54
|
+
getRects() {
|
|
55
|
+
// consider: translate into absolute positions
|
|
56
|
+
// just like Cursor#getCoordinates()
|
|
57
|
+
return this.range.getClientRects();
|
|
58
|
+
}
|
|
59
|
+
link(href, attrs = {}) {
|
|
60
|
+
if (href)
|
|
61
|
+
attrs.href = href;
|
|
62
|
+
const link = this.createElement(config.linkMarkup.name, config.linkMarkup.attribs);
|
|
63
|
+
for (const key in attrs) {
|
|
64
|
+
const value = attrs[key];
|
|
65
|
+
if (value === undefined)
|
|
66
|
+
continue;
|
|
67
|
+
if (value === null) {
|
|
68
|
+
link.removeAttribute(key);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
link.setAttribute(key, value);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (config.linkMarkup.trim)
|
|
75
|
+
this.trimRange();
|
|
76
|
+
this.forceWrap(link);
|
|
77
|
+
}
|
|
78
|
+
// trims whitespaces on the left and right of a selection, i.e. what you want in case of links
|
|
79
|
+
trimRange() {
|
|
80
|
+
const textToTrim = this.range.toString();
|
|
81
|
+
const whitespacesOnTheLeft = textToTrim.search(/\S|$/);
|
|
82
|
+
const lastNonWhitespace = textToTrim.search(/\S[\s]+$/);
|
|
83
|
+
const whitespacesOnTheRight = lastNonWhitespace === -1
|
|
84
|
+
? 0
|
|
85
|
+
: textToTrim.length - (lastNonWhitespace + 1);
|
|
86
|
+
const [startContainer, startOffset] = findStartExcludingWhitespace({
|
|
87
|
+
root: this.range.commonAncestorContainer,
|
|
88
|
+
startContainer: this.range.startContainer,
|
|
89
|
+
startOffset: this.range.startOffset,
|
|
90
|
+
whitespacesOnTheLeft
|
|
91
|
+
});
|
|
92
|
+
this.range.setStart(startContainer, startOffset);
|
|
93
|
+
const [endContainer, endOffset] = findEndExcludingWhitespace({
|
|
94
|
+
root: this.range.commonAncestorContainer,
|
|
95
|
+
endContainer: this.range.endContainer,
|
|
96
|
+
endOffset: this.range.endOffset,
|
|
97
|
+
whitespacesOnTheRight
|
|
98
|
+
});
|
|
99
|
+
this.range.setEnd(endContainer, endOffset);
|
|
100
|
+
}
|
|
101
|
+
unlink() {
|
|
102
|
+
this.removeFormatting(config.linkMarkup.name);
|
|
103
|
+
}
|
|
104
|
+
toggleLink(href, attrs = {}) {
|
|
105
|
+
const links = this.getTagsByName(config.linkMarkup.name);
|
|
106
|
+
if (links.length >= 1) {
|
|
107
|
+
const firstLink = links[0];
|
|
108
|
+
if (this.isExactSelection(firstLink, 'visible')) {
|
|
109
|
+
this.unlink();
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
this.expandTo(firstLink);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
this.link(href, attrs);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
highlightComment({ highlightId, textRange }) {
|
|
120
|
+
highlightSupport.highlightRange(this.host, textRange.text, highlightId, textRange.start, textRange.end, undefined, // dispatcher
|
|
121
|
+
this.win, 'comment');
|
|
122
|
+
}
|
|
123
|
+
// Manually add a highlight
|
|
124
|
+
// Note: the current code does not work with newlines (LP)
|
|
125
|
+
highlight({ highlightId }) {
|
|
126
|
+
const textBefore = this.textBefore();
|
|
127
|
+
const currentTextContent = this.text();
|
|
128
|
+
const marker = '<span class="highlight-comment"></span>';
|
|
129
|
+
const markerNode = highlightSupport.createMarkerNode(marker, 'comment', this.win);
|
|
130
|
+
if (!markerNode)
|
|
131
|
+
return;
|
|
132
|
+
markerNode.setAttribute('data-match', currentTextContent);
|
|
133
|
+
const match = {
|
|
134
|
+
startIndex: textBefore.length,
|
|
135
|
+
endIndex: textBefore.length + currentTextContent.length,
|
|
136
|
+
match: currentTextContent,
|
|
137
|
+
marker: markerNode
|
|
138
|
+
};
|
|
139
|
+
// Note: highlighting won't retain the selection
|
|
140
|
+
highlightText.highlightMatches(this.host, [match]);
|
|
141
|
+
}
|
|
142
|
+
// e.g. toggle('<em>')
|
|
143
|
+
toggle(elem) {
|
|
144
|
+
if (block.isPlainTextBlock(this.host))
|
|
145
|
+
return;
|
|
146
|
+
if (this.range.collapsed)
|
|
147
|
+
return;
|
|
148
|
+
elem = this.adoptElement(elem);
|
|
149
|
+
const newRange = content.toggleTag(this.host, this.range, elem);
|
|
150
|
+
if (newRange) {
|
|
151
|
+
this.range = newRange;
|
|
152
|
+
this.setVisibleSelection();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
toggleCustom({ tagName, attributes, trim = false }) {
|
|
156
|
+
const customElem = this.createElement(tagName, attributes);
|
|
157
|
+
if (trim)
|
|
158
|
+
this.trimRange();
|
|
159
|
+
this.toggle(customElem);
|
|
160
|
+
}
|
|
161
|
+
makeCustom({ tagName, attributes, trim = false }) {
|
|
162
|
+
const customElem = this.createElement(tagName, attributes);
|
|
163
|
+
if (trim)
|
|
164
|
+
this.trimRange();
|
|
165
|
+
this.forceWrap(customElem);
|
|
166
|
+
}
|
|
167
|
+
makeBold() {
|
|
168
|
+
const bold = this.createElement(config.boldMarkup.name, config.boldMarkup.attribs);
|
|
169
|
+
if (config.boldMarkup.trim)
|
|
170
|
+
this.trimRange();
|
|
171
|
+
this.forceWrap(bold);
|
|
172
|
+
}
|
|
173
|
+
toggleBold() {
|
|
174
|
+
const bold = this.createElement(config.boldMarkup.name, config.boldMarkup.attribs);
|
|
175
|
+
if (config.boldMarkup.trim)
|
|
176
|
+
this.trimRange();
|
|
177
|
+
this.toggle(bold);
|
|
178
|
+
}
|
|
179
|
+
giveEmphasis() {
|
|
180
|
+
const em = this.createElement(config.italicMarkup.name, config.italicMarkup.attribs);
|
|
181
|
+
if (config.italicMarkup.trim)
|
|
182
|
+
this.trimRange();
|
|
183
|
+
this.forceWrap(em);
|
|
184
|
+
}
|
|
185
|
+
toggleEmphasis() {
|
|
186
|
+
const em = this.createElement(config.italicMarkup.name, config.italicMarkup.attribs);
|
|
187
|
+
if (config.italicMarkup.trim)
|
|
188
|
+
this.trimRange();
|
|
189
|
+
this.toggle(em);
|
|
190
|
+
}
|
|
191
|
+
makeUnderline() {
|
|
192
|
+
const u = this.createElement(config.underlineMarkup.name, config.underlineMarkup.attribs);
|
|
193
|
+
if (config.underlineMarkup.trim)
|
|
194
|
+
this.trimRange();
|
|
195
|
+
this.forceWrap(u);
|
|
196
|
+
}
|
|
197
|
+
toggleUnderline() {
|
|
198
|
+
const u = this.createElement(config.underlineMarkup.name, config.underlineMarkup.attribs);
|
|
199
|
+
if (config.underlineMarkup.trim)
|
|
200
|
+
this.trimRange();
|
|
201
|
+
this.toggle(u);
|
|
202
|
+
}
|
|
203
|
+
insertCharacter(character) {
|
|
204
|
+
const cursor = this.deleteContent();
|
|
205
|
+
const textNode = cursor.createTextNode(character);
|
|
206
|
+
cursor.insertBefore(textNode);
|
|
207
|
+
cursor.setVisibleSelection();
|
|
208
|
+
return cursor;
|
|
209
|
+
}
|
|
210
|
+
// Surround the selection with characters like quotes.
|
|
211
|
+
//
|
|
212
|
+
// @param {String} E.g. '«'
|
|
213
|
+
// @param {String} E.g. '»'
|
|
214
|
+
surround(startCharacter, endCharacter) {
|
|
215
|
+
this.range = content.surround(this.host, this.range, startCharacter, endCharacter);
|
|
216
|
+
this.setVisibleSelection();
|
|
217
|
+
}
|
|
218
|
+
removeSurround(startCharacter, endCharacter) {
|
|
219
|
+
this.range = content.deleteCharacter(this.host, this.range, startCharacter);
|
|
220
|
+
this.range = content.deleteCharacter(this.host, this.range, endCharacter);
|
|
221
|
+
this.setVisibleSelection();
|
|
222
|
+
}
|
|
223
|
+
removeChars(chars = []) {
|
|
224
|
+
for (let i = 0; i < chars.length; i++) {
|
|
225
|
+
const char = chars[i];
|
|
226
|
+
this.range = content.deleteCharacter(this.host, this.range, char);
|
|
227
|
+
}
|
|
228
|
+
this.setVisibleSelection();
|
|
229
|
+
}
|
|
230
|
+
toggleSurround(startCharacter, endCharacter) {
|
|
231
|
+
if (this.containsString(startCharacter) &&
|
|
232
|
+
this.containsString(endCharacter)) {
|
|
233
|
+
this.removeSurround(startCharacter, endCharacter);
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
this.surround(startCharacter, endCharacter);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
// @param {String} selector. An element selector, e.g. 'a' or 'span.some-class'
|
|
240
|
+
// that represents elements to be removed; if undefined,
|
|
241
|
+
// remove all.
|
|
242
|
+
removeFormatting(selector) {
|
|
243
|
+
const newRange = content.removeFormatting(this.host, this.range, selector || null);
|
|
244
|
+
if (newRange) {
|
|
245
|
+
this.range = newRange;
|
|
246
|
+
this.setVisibleSelection();
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
// Delete the farest ancestor that is an exact selection
|
|
250
|
+
//
|
|
251
|
+
// @return Selection instance
|
|
252
|
+
deleteExactSurroundingTags() {
|
|
253
|
+
const ancestorTags = this.getAncestorTags().reverse();
|
|
254
|
+
for (const ancestorTag of ancestorTags) {
|
|
255
|
+
if (this.isExactSelection(ancestorTag, undefined)) {
|
|
256
|
+
ancestorTag.remove();
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return new Selection(this.host, this.range);
|
|
261
|
+
}
|
|
262
|
+
// Delete all the tags whose text is completely within the current selection.
|
|
263
|
+
//
|
|
264
|
+
// @return Selection instance
|
|
265
|
+
deleteContainedTags() {
|
|
266
|
+
const containedTags = this.getContainedTags();
|
|
267
|
+
containedTags.forEach(containedTag => containedTag.remove());
|
|
268
|
+
return new Selection(this.host, this.range);
|
|
269
|
+
}
|
|
270
|
+
// Delete the contents inside the range and exact surrounding markups.
|
|
271
|
+
// After that the selection will be a cursor.
|
|
272
|
+
//
|
|
273
|
+
// @return Cursor instance
|
|
274
|
+
deleteContent() {
|
|
275
|
+
this.range.deleteContents();
|
|
276
|
+
return new Cursor(this.host, this.range);
|
|
277
|
+
}
|
|
278
|
+
// Expand the current selection.
|
|
279
|
+
//
|
|
280
|
+
// @param {DOM Node}
|
|
281
|
+
expandTo(elem) {
|
|
282
|
+
this.range = content.expandTo(this.host, this.range, elem);
|
|
283
|
+
this.setVisibleSelection();
|
|
284
|
+
}
|
|
285
|
+
// Collapse the selection at the beginning of the selection
|
|
286
|
+
//
|
|
287
|
+
// @return Cursor instance
|
|
288
|
+
collapseAtBeginning(elem) {
|
|
289
|
+
this.range.collapse(true);
|
|
290
|
+
this.setVisibleSelection();
|
|
291
|
+
return new Cursor(this.host, this.range);
|
|
292
|
+
}
|
|
293
|
+
// Collapse the selection at the end of the selection
|
|
294
|
+
//
|
|
295
|
+
// @return Cursor instance
|
|
296
|
+
collapseAtEnd(elem) {
|
|
297
|
+
this.range.collapse(false);
|
|
298
|
+
this.setVisibleSelection();
|
|
299
|
+
return new Cursor(this.host, this.range);
|
|
300
|
+
}
|
|
301
|
+
// Wrap the selection with the specified tag. If any other tag with
|
|
302
|
+
// the same tagName is affecting the selection this tag will be
|
|
303
|
+
// remove first.
|
|
304
|
+
forceWrap(elem) {
|
|
305
|
+
if (block.isPlainTextBlock(this.host))
|
|
306
|
+
return;
|
|
307
|
+
if (this.range.collapsed)
|
|
308
|
+
return;
|
|
309
|
+
elem = this.adoptElement(elem);
|
|
310
|
+
const newRange = content.forceWrap(this.host, this.range, elem);
|
|
311
|
+
if (newRange) {
|
|
312
|
+
this.range = newRange;
|
|
313
|
+
this.setVisibleSelection();
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
// Check if the selection is the same as the elements contents.
|
|
317
|
+
//
|
|
318
|
+
// @method isExactSelection
|
|
319
|
+
// @param {DOM Node}
|
|
320
|
+
// @param {flag: undefined or 'visible'} if 'visible' is passed
|
|
321
|
+
// whitespaces at the beginning or end of the selection will
|
|
322
|
+
// be ignored.
|
|
323
|
+
// @return {Boolean}
|
|
324
|
+
isExactSelection(elem, onlyVisible) {
|
|
325
|
+
return content.isExactSelection(this.range, elem, onlyVisible === 'visible');
|
|
326
|
+
}
|
|
327
|
+
// Check if the selection contains the passed string.
|
|
328
|
+
//
|
|
329
|
+
// @method containsString
|
|
330
|
+
// @return {Boolean}
|
|
331
|
+
containsString(str) {
|
|
332
|
+
return content.containsString(this.range, str);
|
|
333
|
+
}
|
|
334
|
+
// Delete all occurrences of the specified character from the
|
|
335
|
+
// selection.
|
|
336
|
+
deleteCharacter(character) {
|
|
337
|
+
this.range = content.deleteCharacter(this.host, this.range, character);
|
|
338
|
+
this.setVisibleSelection();
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
//# sourceMappingURL=selection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection.js","sourceRoot":"","sources":["../src/selection.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA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EAAE,CAAA;IAC5B,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const shouldApplySmartQuotes: (config: {
|
|
2
|
+
smartQuotes?: boolean;
|
|
3
|
+
quotes?: any;
|
|
4
|
+
singleQuotes?: any;
|
|
5
|
+
}, target: HTMLElement) => boolean;
|
|
6
|
+
export declare const isDoubleQuote: (char: string) => boolean;
|
|
7
|
+
export declare const isSingleQuote: (char: string) => boolean;
|
|
8
|
+
export declare const isApostrophe: (char: string) => boolean;
|
|
9
|
+
export declare const isWhitespace: (char: string) => boolean;
|
|
10
|
+
export declare const isSeparatorOrWhitespace: (char: string) => boolean;
|
|
11
|
+
export declare const replaceQuote: (range: Range, index: number, quoteType: string) => Text | null;
|
|
12
|
+
export declare const applySmartQuotes: (range: Range, config: {
|
|
13
|
+
quotes: string[];
|
|
14
|
+
singleQuotes: string[];
|
|
15
|
+
}, char: string, target: HTMLElement, cursorOffset?: number) => void;
|
|
16
|
+
//# sourceMappingURL=smartQuotes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smartQuotes.d.ts","sourceRoot":"","sources":["../src/smartQuotes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,GAAI,QAAQ;IAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,GAAG,CAAC;IAAC,YAAY,CAAC,EAAE,GAAG,CAAA;CAAC,EAAE,QAAQ,WAAW,KAAG,OAG/H,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,KAAG,OAAgE,CAAA;AAC7G,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,KAAG,OAAgE,CAAA;AAC7G,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG,OAAwC,CAAA;AACpF,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG,OAA4B,CAAA;AACxE,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,KAAG,OAAkC,CAAA;AAOzF,eAAO,MAAM,YAAY,GAAI,OAAO,KAAK,EAAE,OAAO,MAAM,EAAE,WAAW,MAAM,KAAG,IAAI,GAAG,IAcpF,CAAA;AAcD,eAAO,MAAM,gBAAgB,GAAI,OAAO,KAAK,EAAE,QAAQ;IAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAC,EAAE,MAAM,MAAM,EAAE,QAAQ,WAAW,EAAE,eAAe,MAAM,KAAG,IAmD7J,CAAA"}
|