@textbus/platform-browser 3.1.18 → 3.1.20

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.
@@ -317,49 +317,6 @@ let SelectionBridge = class SelectionBridge {
317
317
  getNextLinePositionByCurrent(position) {
318
318
  return this.getLinePosition(position, true);
319
319
  }
320
- // private getLinePosition(currentPosition: SelectionPosition, toNext: boolean): SelectionPosition | null {
321
- // clearTimeout(this.cacheCaretPositionTimer)
322
- // let p: SelectionPosition | null
323
- // if (this.oldCaretPosition) {
324
- // p = this.caretRangeFromPoint(currentPosition, this.oldCaretPosition.left, toNext)
325
- // } else {
326
- // this.oldCaretPosition = this.getRect(currentPosition)!
327
- // p = this.caretRangeFromPoint(currentPosition, this.oldCaretPosition.left, toNext)
328
- // }
329
- // this.cacheCaretPositionTimer = setTimeout(() => {
330
- // this.oldCaretPosition = null
331
- // }, 3000)
332
- // return p
333
- // }
334
- //
335
- // private caretRangeFromPoint(currentPosition: SelectionPosition, x: number, toNext: boolean): SelectionPosition | null {
336
- // const rect = this.getRect(currentPosition)!
337
- // const fn = document.caretRangeFromPoint || function (x: number, y: number) {
338
- // const range = (document as any).caretPositionFromPoint(x, y)
339
- // return {
340
- // startContainer: range.offsetNode,
341
- // startOffset: range.offset
342
- // }
343
- // }
344
- //
345
- // const current = fn.call(document, rect.left, rect.top)!
346
- //
347
- // let startTop = toNext ? rect.top + rect.height : rect.top
348
- // const step = toNext ? 5 : -5
349
- // while (true) {
350
- // startTop += step
351
- // const newPosition = fn.call(document, x, startTop)
352
- // if (!newPosition) {
353
- // return toNext ?
354
- // this.selection.findLastPosition(this.rootComponentRef.component.slots.last, true) :
355
- // this.selection.findFirstPosition(this.rootComponentRef.component.slots.first, true)
356
- // }
357
- // if (newPosition.startContainer !== current.startContainer || newPosition.startOffset !== current.startOffset) {
358
- // return this.getCorrectedPosition(newPosition.startContainer, newPosition.startOffset, toNext)
359
- // }
360
- // }
361
- // return null
362
- // }
363
320
  getLinePosition(currentPosition, toNext) {
364
321
  clearTimeout(this.cacheCaretPositionTimer);
365
322
  let p;
package/bundles/index.js CHANGED
@@ -319,49 +319,6 @@ exports.SelectionBridge = class SelectionBridge {
319
319
  getNextLinePositionByCurrent(position) {
320
320
  return this.getLinePosition(position, true);
321
321
  }
322
- // private getLinePosition(currentPosition: SelectionPosition, toNext: boolean): SelectionPosition | null {
323
- // clearTimeout(this.cacheCaretPositionTimer)
324
- // let p: SelectionPosition | null
325
- // if (this.oldCaretPosition) {
326
- // p = this.caretRangeFromPoint(currentPosition, this.oldCaretPosition.left, toNext)
327
- // } else {
328
- // this.oldCaretPosition = this.getRect(currentPosition)!
329
- // p = this.caretRangeFromPoint(currentPosition, this.oldCaretPosition.left, toNext)
330
- // }
331
- // this.cacheCaretPositionTimer = setTimeout(() => {
332
- // this.oldCaretPosition = null
333
- // }, 3000)
334
- // return p
335
- // }
336
- //
337
- // private caretRangeFromPoint(currentPosition: SelectionPosition, x: number, toNext: boolean): SelectionPosition | null {
338
- // const rect = this.getRect(currentPosition)!
339
- // const fn = document.caretRangeFromPoint || function (x: number, y: number) {
340
- // const range = (document as any).caretPositionFromPoint(x, y)
341
- // return {
342
- // startContainer: range.offsetNode,
343
- // startOffset: range.offset
344
- // }
345
- // }
346
- //
347
- // const current = fn.call(document, rect.left, rect.top)!
348
- //
349
- // let startTop = toNext ? rect.top + rect.height : rect.top
350
- // const step = toNext ? 5 : -5
351
- // while (true) {
352
- // startTop += step
353
- // const newPosition = fn.call(document, x, startTop)
354
- // if (!newPosition) {
355
- // return toNext ?
356
- // this.selection.findLastPosition(this.rootComponentRef.component.slots.last, true) :
357
- // this.selection.findFirstPosition(this.rootComponentRef.component.slots.first, true)
358
- // }
359
- // if (newPosition.startContainer !== current.startContainer || newPosition.startOffset !== current.startOffset) {
360
- // return this.getCorrectedPosition(newPosition.startContainer, newPosition.startOffset, toNext)
361
- // }
362
- // }
363
- // return null
364
- // }
365
322
  getLinePosition(currentPosition, toNext) {
366
323
  clearTimeout(this.cacheCaretPositionTimer);
367
324
  let p;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/platform-browser",
3
- "version": "3.1.18",
3
+ "version": "3.1.20",
4
4
  "description": "Textbus is a rich text editor and framework that is highly customizable and extensible to achieve rich wysiwyg effects.",
5
5
  "main": "./bundles/index.js",
6
6
  "module": "./bundles/index.esm.js",
@@ -27,7 +27,7 @@
27
27
  "dependencies": {
28
28
  "@tanbo/di": "^1.1.4",
29
29
  "@tanbo/stream": "^1.1.9",
30
- "@textbus/core": "^3.1.18",
30
+ "@textbus/core": "^3.1.20",
31
31
  "reflect-metadata": "^0.1.13"
32
32
  },
33
33
  "devDependencies": {
@@ -48,5 +48,5 @@
48
48
  "bugs": {
49
49
  "url": "https://github.com/textbus/textbus.git/issues"
50
50
  },
51
- "gitHead": "b7f5adca5b1e8268bdcfa9f0358d399c8ebfcd30"
51
+ "gitHead": "c2768c82606cc4bde3cc6588d98b9bf2420c4e5d"
52
52
  }