@textbus/collaborate 2.5.4 → 2.5.5
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/bundles/collaborate-cursor.d.ts +5 -3
- package/bundles/index.esm.js +11 -12
- package/bundles/index.js +9 -10
- package/package.json +7 -5
@@ -1,3 +1,4 @@
|
|
1
|
+
import { Injector } from '@tanbo/di';
|
1
2
|
import { SelectionBridge } from '@textbus/browser';
|
2
3
|
import { Selection, SelectionPaths, AbstractSelection, Scheduler, Rect } from '@textbus/core';
|
3
4
|
export interface RemoteSelection {
|
@@ -20,11 +21,11 @@ export declare abstract class CollaborateSelectionAwarenessDelegate {
|
|
20
21
|
abstract getRects(abstractSelection: AbstractSelection, nativeRange: Range): false | Rect[];
|
21
22
|
}
|
22
23
|
export declare class CollaborateCursor {
|
23
|
-
private
|
24
|
-
private awarenessDelegate;
|
24
|
+
private injector;
|
25
25
|
private nativeSelection;
|
26
26
|
private scheduler;
|
27
27
|
private selection;
|
28
|
+
private awarenessDelegate;
|
28
29
|
private host;
|
29
30
|
private canvasContainer;
|
30
31
|
private canvas;
|
@@ -33,7 +34,8 @@ export declare class CollaborateCursor {
|
|
33
34
|
private onRectsChange;
|
34
35
|
private subscription;
|
35
36
|
private currentSelection;
|
36
|
-
|
37
|
+
private container;
|
38
|
+
constructor(injector: Injector, nativeSelection: SelectionBridge, scheduler: Scheduler, selection: Selection, awarenessDelegate?: CollaborateSelectionAwarenessDelegate | null);
|
37
39
|
refresh(): void;
|
38
40
|
destroy(): void;
|
39
41
|
draw(paths: RemoteSelection[]): void;
|
package/bundles/index.esm.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
import { Scheduler, Selection, defineComponent, ContentType, VElement, makeError, HISTORY_STACK_SIZE, ChangeOrigin, Slot, FormatType, RootComponentRef, Controller, Translator, Registry, Starter, History } from '@textbus/core';
|
2
|
-
import { Injectable,
|
2
|
+
import { Injectable, Optional, Injector, Inject } from '@tanbo/di';
|
3
3
|
import { Subject, Subscription, fromEvent, delay, map, filter } from '@tanbo/stream';
|
4
4
|
import { Doc, UndoManager, Array, createAbsolutePositionFromRelativePosition, createRelativePositionFromTypeIndex, Map, Text } from 'yjs';
|
5
|
-
import {
|
5
|
+
import { createElement, VIEW_CONTAINER, getLayoutRectByRange, SelectionBridge } from '@textbus/browser';
|
6
6
|
|
7
|
-
|
7
|
+
/******************************************************************************
|
8
8
|
Copyright (c) Microsoft Corporation.
|
9
9
|
|
10
10
|
Permission to use, copy, modify, and/or distribute this software for any
|
@@ -37,12 +37,12 @@ function __metadata(metadataKey, metadataValue) {
|
|
37
37
|
class CollaborateSelectionAwarenessDelegate {
|
38
38
|
}
|
39
39
|
let CollaborateCursor = class CollaborateCursor {
|
40
|
-
constructor(
|
41
|
-
this.
|
42
|
-
this.awarenessDelegate = awarenessDelegate;
|
40
|
+
constructor(injector, nativeSelection, scheduler, selection, awarenessDelegate = null) {
|
41
|
+
this.injector = injector;
|
43
42
|
this.nativeSelection = nativeSelection;
|
44
43
|
this.scheduler = scheduler;
|
45
44
|
this.selection = selection;
|
45
|
+
this.awarenessDelegate = awarenessDelegate;
|
46
46
|
this.host = createElement('div', {
|
47
47
|
styles: {
|
48
48
|
position: 'absolute',
|
@@ -91,9 +91,10 @@ let CollaborateCursor = class CollaborateCursor {
|
|
91
91
|
this.onRectsChange = new Subject();
|
92
92
|
this.subscription = new Subscription();
|
93
93
|
this.currentSelection = [];
|
94
|
+
this.container = injector.get(VIEW_CONTAINER);
|
94
95
|
this.canvasContainer.append(this.canvas);
|
95
96
|
this.host.append(this.canvasContainer, this.tooltips);
|
96
|
-
container.prepend(this.host);
|
97
|
+
this.container.prepend(this.host);
|
97
98
|
this.subscription.add(this.onRectsChange.subscribe(rects => {
|
98
99
|
for (const rect of rects) {
|
99
100
|
this.context.fillStyle = rect.color;
|
@@ -281,13 +282,11 @@ let CollaborateCursor = class CollaborateCursor {
|
|
281
282
|
};
|
282
283
|
CollaborateCursor = __decorate([
|
283
284
|
Injectable(),
|
284
|
-
__param(
|
285
|
-
|
286
|
-
__metadata("design:paramtypes", [HTMLElement,
|
287
|
-
CollaborateSelectionAwarenessDelegate,
|
285
|
+
__param(4, Optional()),
|
286
|
+
__metadata("design:paramtypes", [Injector,
|
288
287
|
SelectionBridge,
|
289
288
|
Scheduler,
|
290
|
-
Selection])
|
289
|
+
Selection, Object])
|
291
290
|
], CollaborateCursor);
|
292
291
|
|
293
292
|
function createUnknownComponent(factoryName, canInsertInlineComponent) {
|
package/bundles/index.js
CHANGED
@@ -6,7 +6,7 @@ var stream = require('@tanbo/stream');
|
|
6
6
|
var yjs = require('yjs');
|
7
7
|
var browser = require('@textbus/browser');
|
8
8
|
|
9
|
-
|
9
|
+
/******************************************************************************
|
10
10
|
Copyright (c) Microsoft Corporation.
|
11
11
|
|
12
12
|
Permission to use, copy, modify, and/or distribute this software for any
|
@@ -39,12 +39,12 @@ function __metadata(metadataKey, metadataValue) {
|
|
39
39
|
class CollaborateSelectionAwarenessDelegate {
|
40
40
|
}
|
41
41
|
exports.CollaborateCursor = class CollaborateCursor {
|
42
|
-
constructor(
|
43
|
-
this.
|
44
|
-
this.awarenessDelegate = awarenessDelegate;
|
42
|
+
constructor(injector, nativeSelection, scheduler, selection, awarenessDelegate = null) {
|
43
|
+
this.injector = injector;
|
45
44
|
this.nativeSelection = nativeSelection;
|
46
45
|
this.scheduler = scheduler;
|
47
46
|
this.selection = selection;
|
47
|
+
this.awarenessDelegate = awarenessDelegate;
|
48
48
|
this.host = browser.createElement('div', {
|
49
49
|
styles: {
|
50
50
|
position: 'absolute',
|
@@ -93,9 +93,10 @@ exports.CollaborateCursor = class CollaborateCursor {
|
|
93
93
|
this.onRectsChange = new stream.Subject();
|
94
94
|
this.subscription = new stream.Subscription();
|
95
95
|
this.currentSelection = [];
|
96
|
+
this.container = injector.get(browser.VIEW_CONTAINER);
|
96
97
|
this.canvasContainer.append(this.canvas);
|
97
98
|
this.host.append(this.canvasContainer, this.tooltips);
|
98
|
-
container.prepend(this.host);
|
99
|
+
this.container.prepend(this.host);
|
99
100
|
this.subscription.add(this.onRectsChange.subscribe(rects => {
|
100
101
|
for (const rect of rects) {
|
101
102
|
this.context.fillStyle = rect.color;
|
@@ -283,13 +284,11 @@ exports.CollaborateCursor = class CollaborateCursor {
|
|
283
284
|
};
|
284
285
|
exports.CollaborateCursor = __decorate([
|
285
286
|
di.Injectable(),
|
286
|
-
__param(
|
287
|
-
|
288
|
-
__metadata("design:paramtypes", [HTMLElement,
|
289
|
-
CollaborateSelectionAwarenessDelegate,
|
287
|
+
__param(4, di.Optional()),
|
288
|
+
__metadata("design:paramtypes", [di.Injector,
|
290
289
|
browser.SelectionBridge,
|
291
290
|
core.Scheduler,
|
292
|
-
core.Selection])
|
291
|
+
core.Selection, Object])
|
293
292
|
], exports.CollaborateCursor);
|
294
293
|
|
295
294
|
function createUnknownComponent(factoryName, canInsertInlineComponent) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@textbus/collaborate",
|
3
|
-
"version": "2.5.
|
3
|
+
"version": "2.5.5",
|
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,8 +27,8 @@
|
|
27
27
|
"dependencies": {
|
28
28
|
"@tanbo/di": "^1.1.3",
|
29
29
|
"@tanbo/stream": "^1.1.8",
|
30
|
-
"@textbus/browser": "^2.5.
|
31
|
-
"@textbus/core": "^2.5.
|
30
|
+
"@textbus/browser": "^2.5.5",
|
31
|
+
"@textbus/core": "^2.5.5",
|
32
32
|
"reflect-metadata": "^0.1.13",
|
33
33
|
"y-protocols": "^1.0.5",
|
34
34
|
"yjs": "^13.5.39"
|
@@ -36,7 +36,9 @@
|
|
36
36
|
"devDependencies": {
|
37
37
|
"@rollup/plugin-commonjs": "^23.0.2",
|
38
38
|
"@rollup/plugin-typescript": "^9.0.2",
|
39
|
-
"
|
39
|
+
"rimraf": "^3.0.2",
|
40
|
+
"rollup": "^3.2.5",
|
41
|
+
"tslib": "^2.4.1"
|
40
42
|
},
|
41
43
|
"author": {
|
42
44
|
"name": "Tanbo",
|
@@ -49,5 +51,5 @@
|
|
49
51
|
"bugs": {
|
50
52
|
"url": "https://github.com/textbus/textbus.git/issues"
|
51
53
|
},
|
52
|
-
"gitHead": "
|
54
|
+
"gitHead": "0c0d274733683f806078cbd25f34288194b4d6ae"
|
53
55
|
}
|