@textbus/collaborate 2.0.0-beta.9 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,16 +1,10 @@
1
1
  import { SelectionBridge } from '@textbus/browser';
2
- import { Selection, SelectionPaths, Range as TBRange } from '@textbus/core';
2
+ import { Selection, SelectionPaths, AbstractSelection, Scheduler, Rect } from '@textbus/core';
3
3
  export interface RemoteSelection {
4
4
  color: string;
5
5
  username: string;
6
6
  paths: SelectionPaths;
7
7
  }
8
- export interface Rect {
9
- x: number;
10
- y: number;
11
- width: number;
12
- height: number;
13
- }
14
8
  export interface SelectionRect extends Rect {
15
9
  color: string;
16
10
  username: string;
@@ -20,20 +14,26 @@ export interface RemoteSelectionCursor {
20
14
  anchor: HTMLElement;
21
15
  userTip: HTMLElement;
22
16
  }
23
- export declare abstract class CollaborateCursorAwarenessDelegate {
24
- abstract getRects(range: TBRange, nativeRange: Range): false | Rect[];
17
+ export declare abstract class CollaborateSelectionAwarenessDelegate {
18
+ abstract getRects(abstractSelection: AbstractSelection, nativeRange: Range): false | Rect[];
25
19
  }
26
20
  export declare class CollaborateCursor {
27
21
  private container;
28
- private document;
29
22
  private awarenessDelegate;
30
23
  private nativeSelection;
24
+ private scheduler;
31
25
  private selection;
26
+ private host;
27
+ private canvasContainer;
32
28
  private canvas;
33
29
  private context;
34
30
  private tooltips;
35
31
  private onRectsChange;
36
- constructor(container: HTMLElement, document: Document, awarenessDelegate: CollaborateCursorAwarenessDelegate, nativeSelection: SelectionBridge, selection: Selection);
32
+ private subscription;
33
+ private currentSelection;
34
+ constructor(container: HTMLElement, awarenessDelegate: CollaborateSelectionAwarenessDelegate, nativeSelection: SelectionBridge, scheduler: Scheduler, selection: Selection);
35
+ refresh(): void;
36
+ destroy(): void;
37
37
  draw(paths: RemoteSelection[]): void;
38
38
  private drawUserCursor;
39
39
  private getUserCursor;
@@ -11,134 +11,133 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
11
  return function (target, key) { decorator(target, key, paramIndex); }
12
12
  };
13
13
  import { Inject, Injectable, Optional } from '@tanbo/di';
14
- import { createElement, EDITABLE_DOCUMENT, EDITOR_CONTAINER, getLayoutRectByRange, SelectionBridge } from '@textbus/browser';
15
- import { Selection } from '@textbus/core';
16
- import { Subject } from '@tanbo/stream';
17
- export class CollaborateCursorAwarenessDelegate {
14
+ import { createElement, VIEW_CONTAINER, getLayoutRectByRange, SelectionBridge, getBoundingClientRect } from '@textbus/browser';
15
+ import { Selection, Scheduler } from '@textbus/core';
16
+ import { fromEvent, Subject, Subscription } from '@tanbo/stream';
17
+ export class CollaborateSelectionAwarenessDelegate {
18
18
  }
19
19
  let CollaborateCursor = class CollaborateCursor {
20
- constructor(container, document, awarenessDelegate, nativeSelection, selection) {
21
- Object.defineProperty(this, "container", {
22
- enumerable: true,
23
- configurable: true,
24
- writable: true,
25
- value: container
26
- });
27
- Object.defineProperty(this, "document", {
28
- enumerable: true,
29
- configurable: true,
30
- writable: true,
31
- value: document
32
- });
33
- Object.defineProperty(this, "awarenessDelegate", {
34
- enumerable: true,
35
- configurable: true,
36
- writable: true,
37
- value: awarenessDelegate
38
- });
39
- Object.defineProperty(this, "nativeSelection", {
40
- enumerable: true,
41
- configurable: true,
42
- writable: true,
43
- value: nativeSelection
44
- });
45
- Object.defineProperty(this, "selection", {
46
- enumerable: true,
47
- configurable: true,
48
- writable: true,
49
- value: selection
50
- });
51
- Object.defineProperty(this, "canvas", {
52
- enumerable: true,
53
- configurable: true,
54
- writable: true,
55
- value: createElement('canvas', {
56
- styles: {
57
- position: 'absolute',
58
- opacity: 0.5,
59
- left: 0,
60
- top: 0,
61
- width: '100%',
62
- height: '100%',
63
- pointerEvents: 'none'
64
- }
65
- })
20
+ constructor(container, awarenessDelegate, nativeSelection, scheduler, selection) {
21
+ this.container = container;
22
+ this.awarenessDelegate = awarenessDelegate;
23
+ this.nativeSelection = nativeSelection;
24
+ this.scheduler = scheduler;
25
+ this.selection = selection;
26
+ this.host = createElement('div', {
27
+ styles: {
28
+ position: 'absolute',
29
+ left: 0,
30
+ top: 0,
31
+ width: '100%',
32
+ height: '100%',
33
+ pointerEvents: 'none',
34
+ zIndex: 1
35
+ }
66
36
  });
67
- Object.defineProperty(this, "context", {
68
- enumerable: true,
69
- configurable: true,
70
- writable: true,
71
- value: this.canvas.getContext('2d')
37
+ this.canvasContainer = createElement('div', {
38
+ styles: {
39
+ position: 'absolute',
40
+ left: 0,
41
+ top: 0,
42
+ width: '100%',
43
+ height: '100%',
44
+ overflow: 'hidden'
45
+ }
72
46
  });
73
- Object.defineProperty(this, "tooltips", {
74
- enumerable: true,
75
- configurable: true,
76
- writable: true,
77
- value: createElement('div', {
78
- styles: {
79
- position: 'absolute',
80
- left: 0,
81
- top: 0,
82
- width: '100%',
83
- height: '100%',
84
- pointerEvents: 'none',
85
- fontSize: '12px',
86
- zIndex: 10
87
- }
88
- })
47
+ this.canvas = createElement('canvas', {
48
+ styles: {
49
+ position: 'absolute',
50
+ opacity: 0.5,
51
+ left: 0,
52
+ top: 0,
53
+ width: '100%',
54
+ height: document.documentElement.clientHeight + 'px',
55
+ pointerEvents: 'none',
56
+ }
89
57
  });
90
- Object.defineProperty(this, "onRectsChange", {
91
- enumerable: true,
92
- configurable: true,
93
- writable: true,
94
- value: new Subject()
58
+ this.context = this.canvas.getContext('2d');
59
+ this.tooltips = createElement('div', {
60
+ styles: {
61
+ position: 'absolute',
62
+ left: 0,
63
+ top: 0,
64
+ width: '100%',
65
+ height: '100%',
66
+ pointerEvents: 'none',
67
+ fontSize: '12px',
68
+ zIndex: 10
69
+ }
95
70
  });
96
- container.prepend(this.canvas, this.tooltips);
97
- this.onRectsChange.subscribe(rects => {
71
+ this.onRectsChange = new Subject();
72
+ this.subscription = new Subscription();
73
+ this.currentSelection = [];
74
+ this.canvasContainer.append(this.canvas);
75
+ this.host.append(this.canvasContainer, this.tooltips);
76
+ container.prepend(this.host);
77
+ this.subscription.add(this.onRectsChange.subscribe(rects => {
98
78
  for (const rect of rects) {
99
79
  this.context.fillStyle = rect.color;
100
80
  this.context.beginPath();
101
- this.context.rect(rect.x, rect.y, rect.width, rect.height);
81
+ this.context.rect(rect.left, rect.top, rect.width, rect.height);
102
82
  this.context.fill();
103
83
  this.context.closePath();
104
84
  }
105
- });
85
+ }), fromEvent(window, 'resize').subscribe(() => {
86
+ this.canvas.style.height = document.documentElement.clientHeight + 'px';
87
+ this.refresh();
88
+ }), this.scheduler.onDocChanged.subscribe(() => {
89
+ this.refresh();
90
+ }));
91
+ }
92
+ refresh() {
93
+ this.draw(this.currentSelection);
94
+ }
95
+ destroy() {
96
+ this.subscription.unsubscribe();
106
97
  }
107
98
  draw(paths) {
108
- const containerRect = this.container.getBoundingClientRect();
109
- this.canvas.width = containerRect.width;
110
- this.canvas.height = containerRect.height;
99
+ this.currentSelection = paths;
100
+ const containerRect = getBoundingClientRect(this.container);
101
+ this.canvas.style.top = containerRect.top * -1 + 'px';
102
+ this.canvas.width = this.canvas.offsetWidth;
103
+ this.canvas.height = this.canvas.offsetHeight;
111
104
  this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
112
105
  const users = [];
113
106
  paths.filter(i => {
114
- return i.paths.start.length && i.paths.end.length;
107
+ return i.paths.anchor.length && i.paths.focus.length;
115
108
  }).forEach(item => {
116
- const startOffset = item.paths.start.pop();
117
- const startSlot = this.selection.findSlotByPaths(item.paths.start);
118
- const endOffset = item.paths.end.pop();
119
- const endSlot = this.selection.findSlotByPaths(item.paths.end);
120
- if (!startSlot || !endSlot) {
109
+ const anchorPaths = [...item.paths.anchor];
110
+ const focusPaths = [...item.paths.focus];
111
+ const anchorOffset = anchorPaths.pop();
112
+ const anchorSlot = this.selection.findSlotByPaths(anchorPaths);
113
+ const focusOffset = focusPaths.pop();
114
+ const focusSlot = this.selection.findSlotByPaths(focusPaths);
115
+ if (!anchorSlot || !focusSlot) {
121
116
  return;
122
117
  }
123
- const { start, end } = this.nativeSelection.getPositionByRange({
124
- startOffset,
125
- endOffset,
126
- startSlot,
127
- endSlot
118
+ const { focus, anchor } = this.nativeSelection.getPositionByRange({
119
+ focusOffset,
120
+ anchorOffset,
121
+ focusSlot,
122
+ anchorSlot
128
123
  });
129
- if (!start || !end) {
124
+ if (!focus || !anchor) {
130
125
  return;
131
126
  }
132
- const nativeRange = this.document.createRange();
133
- nativeRange.setStart(start.node, start.offset);
134
- nativeRange.setEnd(end.node, end.offset);
127
+ const nativeRange = document.createRange();
128
+ nativeRange.setStart(anchor.node, anchor.offset);
129
+ nativeRange.setEnd(focus.node, focus.offset);
130
+ if ((anchor.node !== focus.node || anchor.offset !== focus.offset) && nativeRange.collapsed) {
131
+ nativeRange.setStart(focus.node, focus.offset);
132
+ nativeRange.setEnd(anchor.node, anchor.offset);
133
+ }
135
134
  let rects = false;
136
135
  if (this.awarenessDelegate) {
137
136
  rects = this.awarenessDelegate.getRects({
138
- startOffset,
139
- endOffset,
140
- startSlot,
141
- endSlot
137
+ focusOffset,
138
+ anchorOffset,
139
+ focusSlot,
140
+ anchorSlot
142
141
  }, nativeRange);
143
142
  }
144
143
  if (!rects) {
@@ -150,24 +149,29 @@ let CollaborateCursor = class CollaborateCursor {
150
149
  selectionRects.push({
151
150
  color: item.color,
152
151
  username: item.username,
153
- x: rect.x - containerRect.x,
154
- y: rect.y - containerRect.y,
152
+ left: rect.left - containerRect.left,
153
+ top: rect.top,
155
154
  width: rect.width,
156
155
  height: rect.height,
157
156
  });
158
157
  }
159
158
  this.onRectsChange.next(selectionRects);
160
159
  const cursorRange = nativeRange.cloneRange();
161
- cursorRange.collapse(!item.paths.focusEnd);
160
+ cursorRange.setStart(focus.node, focus.offset);
161
+ cursorRange.collapse(true);
162
162
  const cursorRect = getLayoutRectByRange(cursorRange);
163
- users.push({
163
+ const rect = {
164
164
  username: item.username,
165
165
  color: item.color,
166
- x: cursorRect.x - containerRect.x,
167
- y: cursorRect.y - containerRect.y,
166
+ left: cursorRect.left - containerRect.left,
167
+ top: cursorRect.top - containerRect.top,
168
168
  width: 2,
169
169
  height: cursorRect.height
170
- });
170
+ };
171
+ if (rect.left < 0 || rect.top < 0 || rect.left > containerRect.width) {
172
+ return;
173
+ }
174
+ users.push(rect);
171
175
  });
172
176
  this.drawUserCursor(users);
173
177
  }
@@ -176,8 +180,8 @@ let CollaborateCursor = class CollaborateCursor {
176
180
  const rect = rects[i];
177
181
  const { cursor, userTip, anchor } = this.getUserCursor(i);
178
182
  Object.assign(cursor.style, {
179
- left: rect.x + 'px',
180
- top: rect.y + 'px',
183
+ left: rect.left + 'px',
184
+ top: rect.top + 'px',
181
185
  width: rect.width + 'px',
182
186
  height: rect.height + 'px',
183
187
  background: rect.color,
@@ -255,14 +259,13 @@ let CollaborateCursor = class CollaborateCursor {
255
259
  };
256
260
  CollaborateCursor = __decorate([
257
261
  Injectable(),
258
- __param(0, Inject(EDITOR_CONTAINER)),
259
- __param(1, Inject(EDITABLE_DOCUMENT)),
260
- __param(2, Optional()),
262
+ __param(0, Inject(VIEW_CONTAINER)),
263
+ __param(1, Optional()),
261
264
  __metadata("design:paramtypes", [HTMLElement,
262
- Document,
263
- CollaborateCursorAwarenessDelegate,
265
+ CollaborateSelectionAwarenessDelegate,
264
266
  SelectionBridge,
267
+ Scheduler,
265
268
  Selection])
266
269
  ], CollaborateCursor);
267
270
  export { CollaborateCursor };
268
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sbGFib3JhdGUtY3Vyc29yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2NvbGxhYm9yYXRlLWN1cnNvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7QUFBQSxPQUFPLEVBQUUsTUFBTSxFQUFFLFVBQVUsRUFBRSxRQUFRLEVBQUUsTUFBTSxXQUFXLENBQUE7QUFDeEQsT0FBTyxFQUNMLGFBQWEsRUFDYixpQkFBaUIsRUFDakIsZ0JBQWdCLEVBQ2hCLG9CQUFvQixFQUNwQixl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zOiB7XG4gICAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgICBkaXNwbGF5OiAnbm9uZScsXG4gICAgICAgIGxlZnQ6ICc1MCUnLFxuICAgICAgICB0cmFuc2Zvcm06ICd0cmFuc2xhdGVYKC01MCUpJyxcbiAgICAgICAgbWFyZ2luQm90dG9tOiAnMnB4JyxcbiAgICAgICAgYm90dG9tOiAnMTAwJScsXG4gICAgICAgIHdoaXRlU3BhY2U6ICdub3dyYXAnLFxuICAgICAgICBjb2xvcjogJyNmZmYnLFxuICAgICAgICBib3hTaGFkb3c6ICcwIDFweCAycHggcmdiYSgwLDAsMCwuMSknLFxuICAgICAgICBib3JkZXJSYWRpdXM6ICczcHgnLFxuICAgICAgICBwYWRkaW5nOiAnM3B4IDVweCcsXG4gICAgICAgIHBvaW50ZXJFdmVudHM6ICdub25lJyxcbiAgICAgIH1cbiAgICB9KVxuXG4gICAgY29uc3QgYW5jaG9yID0gY3JlYXRlRWxlbWVudCgnc3BhbicsIHtcbiAgICAgIHN0eWxlczoge1xuICAgICAgICBwb3NpdGlvbjogJ2Fic29sdXRlJyxcbiAgICAgICAgdG9wOiAnLTJweCcsXG4gICAgICAgIGxlZnQ6ICctMnB4JyxcbiAgICAgICAgd2lkdGg6ICc2cHgnLFxuICAgICAgICBoZWlnaHQ6ICc2cHgnLFxuICAgICAgICBwb2ludGVyRXZlbnRzOiAnYXV0bycsXG4gICAgICAgIHBvaW50ZXI6ICdjdXJzb3InLFxuICAgICAgfSxcbiAgICAgIGNoaWxkcmVuOiBbdXNlclRpcF0sXG4gICAgICBvbjoge1xuICAgICAgICBtb3VzZWVudGVyKCkge1xuICAgICAgICAgIHVzZXJUaXAuc3R5bGUuZGlzcGxheSA9ICdibG9jaydcbiAgICAgICAgfSxcbiAgICAgICAgbW91c2VsZWF2ZSgpIHtcbiAgICAgICAgICB1c2VyVGlwLnN0eWxlLmRpc3BsYXkgPSAnbm9uZSdcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pXG4gICAgY2hpbGQgPSBjcmVhdGVFbGVtZW50KCdzcGFuJywge1xuICAgICAgc3R5bGVzOiB7XG4gICAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgfSxcbiAgICAgIGNoaWxkcmVuOiBbXG4gICAgICAgIGFuY2hvclxuICAgICAgXVxuICAgIH0pXG4gICAgdGhpcy50b29sdGlwcy5hcHBlbmQoY2hpbGQpXG4gICAgcmV0dXJuIHtcbiAgICAgIGN1cnNvcjogY2hpbGQsXG4gICAgICBhbmNob3IsXG4gICAgICB1c2VyVGlwXG4gICAgfVxuICB9XG59XG4iXX0=
@@ -1,20 +1,26 @@
1
1
  import { Observable } from '@tanbo/stream';
2
- import { History, Registry, RootComponentRef, Scheduler, Selection, SelectionPaths, Starter, Translator } from '@textbus/core';
2
+ import { ComponentInitData, ComponentInstance, Controller, History, Registry, RootComponentRef, Scheduler, Selection, SelectionPaths, Starter, Translator } from '@textbus/core';
3
3
  import { Doc as YDoc } from 'yjs';
4
4
  import { CollaborateCursor, RemoteSelection } from './collaborate-cursor';
5
+ export declare abstract class TranslatorFallback {
6
+ abstract createComponentByData(name: string, data: ComponentInitData): ComponentInstance | null;
7
+ }
5
8
  export declare class Collaborate implements History {
9
+ private stackSize;
6
10
  private rootComponentRef;
7
11
  private collaborateCursor;
12
+ private controller;
8
13
  private scheduler;
9
14
  private translator;
10
15
  private registry;
11
16
  private selection;
12
17
  private starter;
18
+ private translatorFallback;
13
19
  onSelectionChange: Observable<SelectionPaths>;
14
20
  yDoc: YDoc;
15
21
  onBack: Observable<void>;
16
22
  onForward: Observable<void>;
17
- onChange: Observable<any>;
23
+ onChange: Observable<void>;
18
24
  onPush: Observable<void>;
19
25
  get canBack(): boolean;
20
26
  get canForward(): boolean;
@@ -30,15 +36,18 @@ export declare class Collaborate implements History {
30
36
  private slotsSyncCaches;
31
37
  private componentStateSyncCaches;
32
38
  private selectionChangeEvent;
39
+ private contentMap;
33
40
  private updateRemoteActions;
34
- constructor(rootComponentRef: RootComponentRef, collaborateCursor: CollaborateCursor, scheduler: Scheduler, translator: Translator, registry: Registry, selection: Selection, starter: Starter);
35
- setup(): void;
36
- updateRemoteSelection(paths: RemoteSelection[]): void;
41
+ constructor(stackSize: number, rootComponentRef: RootComponentRef, collaborateCursor: CollaborateCursor, controller: Controller, scheduler: Scheduler, translator: Translator, registry: Registry, selection: Selection, starter: Starter, translatorFallback: TranslatorFallback);
37
42
  listen(): void;
43
+ updateRemoteSelection(paths: RemoteSelection[]): void;
38
44
  back(): void;
39
45
  forward(): void;
46
+ clear(): void;
40
47
  destroy(): void;
41
- private listen2;
48
+ private syncRootComponent;
49
+ private restoreCursorLocation;
50
+ private getRelativeCursorLocation;
42
51
  private syncContent;
43
52
  private syncSlot;
44
53
  private syncSlots;