@textbus/platform-browser 3.1.5 → 3.1.7

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.
@@ -8,12 +8,7 @@ declare class NativeCaret implements Caret {
8
8
  onPositionChange: Observable<CaretPosition | null>;
9
9
  set nativeRange(range: Range | null);
10
10
  get nativeRange(): Range | null;
11
- get rect(): DOMRect | {
12
- left: number;
13
- top: number;
14
- width: number;
15
- height: number;
16
- };
11
+ get rect(): import("../_utils/uikit").Rect;
17
12
  private oldPosition;
18
13
  private _nativeRange;
19
14
  private subs;
@@ -1348,24 +1348,24 @@ Parser = Parser_1 = __decorate([
1348
1348
  __metadata("design:paramtypes", [Object, Injector])
1349
1349
  ], Parser);
1350
1350
 
1351
- const iframeHTML = `
1352
- <!DOCTYPE html>
1353
- <html>
1354
- <head>
1355
- <meta charset="UTF-8">
1356
- <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
1357
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
1358
- <title>Textbus</title>
1359
- <style>
1360
- html {position: fixed; left:0; overflow: hidden}
1361
- html, body{height: 100%;width:100%}
1362
- body{margin:0; overflow: hidden}
1363
- textarea{width: 2000px;height: 100%;opacity: 0; padding: 0; outline: none; border: none; position: absolute; left:0; top:0;}
1364
- </style>
1365
- </head>
1366
- <body>
1367
- </body>
1368
- </html>
1351
+ const iframeHTML = `
1352
+ <!DOCTYPE html>
1353
+ <html>
1354
+ <head>
1355
+ <meta charset="UTF-8">
1356
+ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
1357
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
1358
+ <title>Textbus</title>
1359
+ <style>
1360
+ html {position: fixed; left:0; overflow: hidden}
1361
+ html, body{height: 100%;width:100%}
1362
+ body{margin:0; overflow: hidden}
1363
+ textarea{width: 2000px;height: 100%;opacity: 0; padding: 0; outline: none; border: none; position: absolute; left:0; top:0;}
1364
+ </style>
1365
+ </head>
1366
+ <body>
1367
+ </body>
1368
+ </html>
1369
1369
  `;
1370
1370
  class ExperimentalCaret {
1371
1371
  get rect() {
@@ -1897,7 +1897,7 @@ class NativeCaret {
1897
1897
  if (range) {
1898
1898
  const r = range.cloneRange();
1899
1899
  r.collapse(true);
1900
- const rect = r.getBoundingClientRect();
1900
+ const rect = getLayoutRectByRange(r);
1901
1901
  this.positionChangeEvent.next({
1902
1902
  left: rect.left,
1903
1903
  top: rect.top,
@@ -1915,7 +1915,7 @@ class NativeCaret {
1915
1915
  if (this.nativeRange) {
1916
1916
  const range = this.nativeRange.cloneRange();
1917
1917
  range.collapse(true);
1918
- return range.getBoundingClientRect();
1918
+ return getLayoutRectByRange(range);
1919
1919
  }
1920
1920
  return {
1921
1921
  left: 0,
@@ -2762,7 +2762,7 @@ class Viewer extends Starter {
2762
2762
  });
2763
2763
  const styleEl = document.createElement('style');
2764
2764
  docStyles.push(...(options.styleSheets || []));
2765
- editModeStyles.push(`#${this.id} *::selection{background-color: rgba(18, 150, 219, .4); color:inherit}`, ...(options.editingStyleSheets || []));
2765
+ editModeStyles.push(`#${this.id} *::selection{background-color: rgba(18, 150, 219, .2); color:inherit}`, ...(options.editingStyleSheets || []));
2766
2766
  this.styleSheet = Viewer.cssMin(docStyles.join(''));
2767
2767
  styleEl.innerHTML = this.styleSheet + Viewer.cssMin(editModeStyles.join(''));
2768
2768
  this.resourceNodes.push(styleEl);
package/bundles/index.js CHANGED
@@ -1350,24 +1350,24 @@ exports.Parser = Parser_1 = __decorate([
1350
1350
  __metadata("design:paramtypes", [Object, di.Injector])
1351
1351
  ], exports.Parser);
1352
1352
 
1353
- const iframeHTML = `
1354
- <!DOCTYPE html>
1355
- <html>
1356
- <head>
1357
- <meta charset="UTF-8">
1358
- <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
1359
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
1360
- <title>Textbus</title>
1361
- <style>
1362
- html {position: fixed; left:0; overflow: hidden}
1363
- html, body{height: 100%;width:100%}
1364
- body{margin:0; overflow: hidden}
1365
- textarea{width: 2000px;height: 100%;opacity: 0; padding: 0; outline: none; border: none; position: absolute; left:0; top:0;}
1366
- </style>
1367
- </head>
1368
- <body>
1369
- </body>
1370
- </html>
1353
+ const iframeHTML = `
1354
+ <!DOCTYPE html>
1355
+ <html>
1356
+ <head>
1357
+ <meta charset="UTF-8">
1358
+ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
1359
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
1360
+ <title>Textbus</title>
1361
+ <style>
1362
+ html {position: fixed; left:0; overflow: hidden}
1363
+ html, body{height: 100%;width:100%}
1364
+ body{margin:0; overflow: hidden}
1365
+ textarea{width: 2000px;height: 100%;opacity: 0; padding: 0; outline: none; border: none; position: absolute; left:0; top:0;}
1366
+ </style>
1367
+ </head>
1368
+ <body>
1369
+ </body>
1370
+ </html>
1371
1371
  `;
1372
1372
  class ExperimentalCaret {
1373
1373
  get rect() {
@@ -1899,7 +1899,7 @@ class NativeCaret {
1899
1899
  if (range) {
1900
1900
  const r = range.cloneRange();
1901
1901
  r.collapse(true);
1902
- const rect = r.getBoundingClientRect();
1902
+ const rect = getLayoutRectByRange(r);
1903
1903
  this.positionChangeEvent.next({
1904
1904
  left: rect.left,
1905
1905
  top: rect.top,
@@ -1917,7 +1917,7 @@ class NativeCaret {
1917
1917
  if (this.nativeRange) {
1918
1918
  const range = this.nativeRange.cloneRange();
1919
1919
  range.collapse(true);
1920
- return range.getBoundingClientRect();
1920
+ return getLayoutRectByRange(range);
1921
1921
  }
1922
1922
  return {
1923
1923
  left: 0,
@@ -2764,7 +2764,7 @@ class Viewer extends core.Starter {
2764
2764
  });
2765
2765
  const styleEl = document.createElement('style');
2766
2766
  docStyles.push(...(options.styleSheets || []));
2767
- editModeStyles.push(`#${this.id} *::selection{background-color: rgba(18, 150, 219, .4); color:inherit}`, ...(options.editingStyleSheets || []));
2767
+ editModeStyles.push(`#${this.id} *::selection{background-color: rgba(18, 150, 219, .2); color:inherit}`, ...(options.editingStyleSheets || []));
2768
2768
  this.styleSheet = Viewer.cssMin(docStyles.join(''));
2769
2769
  styleEl.innerHTML = this.styleSheet + Viewer.cssMin(editModeStyles.join(''));
2770
2770
  this.resourceNodes.push(styleEl);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/platform-browser",
3
- "version": "3.1.5",
3
+ "version": "3.1.7",
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.5",
30
+ "@textbus/core": "^3.1.7",
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": "7707dcf0125dde78800b15b4e769090bccaa7b2c"
51
+ "gitHead": "d42df7247f069565b920b0dc3d48de68dfea39e0"
52
52
  }