@textbus/platform-browser 4.1.0-alpha.0 → 4.2.0

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.
@@ -14,7 +14,7 @@ export interface RemoteSelectionCursor {
14
14
  * 远程光标绘制范围计算代理类,可用于定制特定场景下的远程选区绘制,如表格有选区,不会遵守常见的文档流形式
15
15
  */
16
16
  export declare abstract class CollaborateSelectionAwarenessDelegate {
17
- abstract getRects(abstractSelection: AbstractSelection, nativeRange: Range): false | Rect[];
17
+ abstract getRects(abstractSelection: AbstractSelection, nativeRange: Range, selectionCursor: UserSelectionCursor): false | Rect[];
18
18
  }
19
19
  /**
20
20
  * 协作用户虚拟光标信息
@@ -23,6 +23,7 @@ export interface UserSelectionCursor {
23
23
  username: string;
24
24
  color: string;
25
25
  selection: SelectionPaths;
26
+ data?: any;
26
27
  }
27
28
  /**
28
29
  * 协作光标绘制类
@@ -1348,7 +1348,12 @@ let MagicInput = class MagicInput extends Input {
1348
1348
  key: key,
1349
1349
  altKey: ev.altKey,
1350
1350
  shiftKey: ev.shiftKey,
1351
- ctrlKey: this.isMac ? ev.metaKey : ev.ctrlKey
1351
+ modKey: this.isMac ? ev.metaKey : ev.ctrlKey,
1352
+ agent: {
1353
+ key: ev.key,
1354
+ code: ev.code,
1355
+ keyCode: ev.keyCode,
1356
+ }
1352
1357
  });
1353
1358
  if (is) {
1354
1359
  this.ignoreComposition = true;
@@ -1614,7 +1619,7 @@ let CollaborateCursor = class CollaborateCursor {
1614
1619
  anchorOffset,
1615
1620
  focusSlot,
1616
1621
  anchorSlot
1617
- }, nativeRange);
1622
+ }, nativeRange, item);
1618
1623
  }
1619
1624
  if (!rects) {
1620
1625
  rects = nativeRange.getClientRects();
@@ -1942,7 +1947,12 @@ let NativeInput = class NativeInput extends Input {
1942
1947
  key: key,
1943
1948
  altKey: ev.altKey,
1944
1949
  shiftKey: ev.shiftKey,
1945
- ctrlKey: this.isMac ? ev.metaKey : ev.ctrlKey
1950
+ modKey: this.isMac ? ev.metaKey : ev.ctrlKey,
1951
+ agent: {
1952
+ key: ev.key,
1953
+ keyCode: ev.keyCode,
1954
+ code: ev.code
1955
+ }
1946
1956
  });
1947
1957
  if (is) {
1948
1958
  this.ignoreComposition = true;
package/bundles/index.js CHANGED
@@ -1350,7 +1350,12 @@ exports.MagicInput = class MagicInput extends Input {
1350
1350
  key: key,
1351
1351
  altKey: ev.altKey,
1352
1352
  shiftKey: ev.shiftKey,
1353
- ctrlKey: this.isMac ? ev.metaKey : ev.ctrlKey
1353
+ modKey: this.isMac ? ev.metaKey : ev.ctrlKey,
1354
+ agent: {
1355
+ key: ev.key,
1356
+ code: ev.code,
1357
+ keyCode: ev.keyCode,
1358
+ }
1354
1359
  });
1355
1360
  if (is) {
1356
1361
  this.ignoreComposition = true;
@@ -1616,7 +1621,7 @@ exports.CollaborateCursor = class CollaborateCursor {
1616
1621
  anchorOffset,
1617
1622
  focusSlot,
1618
1623
  anchorSlot
1619
- }, nativeRange);
1624
+ }, nativeRange, item);
1620
1625
  }
1621
1626
  if (!rects) {
1622
1627
  rects = nativeRange.getClientRects();
@@ -1944,7 +1949,12 @@ exports.NativeInput = class NativeInput extends Input {
1944
1949
  key: key,
1945
1950
  altKey: ev.altKey,
1946
1951
  shiftKey: ev.shiftKey,
1947
- ctrlKey: this.isMac ? ev.metaKey : ev.ctrlKey
1952
+ modKey: this.isMac ? ev.metaKey : ev.ctrlKey,
1953
+ agent: {
1954
+ key: ev.key,
1955
+ keyCode: ev.keyCode,
1956
+ code: ev.code
1957
+ }
1948
1958
  });
1949
1959
  if (is) {
1950
1960
  this.ignoreComposition = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/platform-browser",
3
- "version": "4.1.0-alpha.0",
3
+ "version": "4.2.0",
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",
@@ -26,8 +26,8 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@tanbo/stream": "^1.2.5",
29
- "@textbus/core": "^4.1.0-alpha.0",
30
- "@viewfly/core": "^1.0.4"
29
+ "@textbus/core": "^4.2.0",
30
+ "@viewfly/core": "^1.0.5"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@rollup/plugin-commonjs": "^23.0.2",