Merge branch 'main' into patch-1
This commit is contained in:
commit
7a4975ee85
19
README.md
19
README.md
@ -60,13 +60,16 @@ on Yjs. [ The french carbon
|
* [Nosgestesclimat](https://nosgestesclimat.fr/groupe) The french carbon
|
||||||
footprint calculator has a group P2P mode based on yjs
|
footprint calculator has a group P2P mode based on yjs
|
||||||
|
* [oorja.io](https://oorja.io) Online meeting spaces extensible with collaborative apps, end-to-end encrypted.
|
||||||
* [LegendKeeper](https://legendkeeper.com) Collaborative campaign planner and worldbuilding app for tabletop RPGs.
|
* [LegendKeeper](https://legendkeeper.com) Collaborative campaign planner and worldbuilding app for tabletop RPGs.
|
||||||
|
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
* [Overview](#Overview)
|
* [Overview](#Overview)
|
||||||
* [Bindings](#Bindings)
|
* [Bindings](#Bindings)
|
||||||
* [Providers](#Providers)
|
* [Providers](#Providers)
|
||||||
|
* [Ports](#Ports)
|
||||||
* [Getting Started](#Getting-Started)
|
* [Getting Started](#Getting-Started)
|
||||||
* [API](#API)
|
* [API](#API)
|
||||||
* [Shared Types](#Shared-Types)
|
* [Shared Types](#Shared-Types)
|
||||||
@ -154,6 +157,22 @@ y-websocket provider.
|
|||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
# Ports
|
||||||
|
|
||||||
|
There are several Yjs-compatible ports to other programming languages.
|
||||||
|
|
||||||
|
* [y-octo](https://github.com/toeverything/y-octo) - Rust implementation by
|
||||||
|
[AFFiNE](https://affine.pro)
|
||||||
|
* [y-crdt](https://github.com/y-crdt/y-crdt) - Rust implementation with multiple
|
||||||
|
language bindings to other languages
|
||||||
|
* [yrs](https://github.com/y-crdt/y-crdt/tree/main/yrs) - Rust interface
|
||||||
|
* [ypy](https://github.com/y-crdt/ypy) - Python binding
|
||||||
|
* [yrb](https://github.com/y-crdt/yrb) - Ruby binding
|
||||||
|
* [yrb](https://github.com/y-crdt/yswift) - Swift binding
|
||||||
|
* [yffi](https://github.com/y-crdt/y-crdt/tree/main/yffi) - C-FFI
|
||||||
|
* [ywasm](https://github.com/y-crdt/y-crdt/tree/main/ywasm) - WASM binding
|
||||||
|
* [ycs](https://github.com/yjs/ycs) - .Net compatible C# implementation.
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
Install Yjs and a provider with your favorite package manager:
|
Install Yjs and a provider with your favorite package manager:
|
||||||
|
@ -15,6 +15,7 @@ import {
|
|||||||
|
|
||||||
import * as time from 'lib0/time'
|
import * as time from 'lib0/time'
|
||||||
import * as array from 'lib0/array'
|
import * as array from 'lib0/array'
|
||||||
|
import * as logging from 'lib0/logging'
|
||||||
import { Observable } from 'lib0/observable'
|
import { Observable } from 'lib0/observable'
|
||||||
|
|
||||||
export class StackItem {
|
export class StackItem {
|
||||||
@ -169,6 +170,7 @@ export class UndoManager extends Observable {
|
|||||||
* @type {Array<AbstractType<any>>}
|
* @type {Array<AbstractType<any>>}
|
||||||
*/
|
*/
|
||||||
this.scope = []
|
this.scope = []
|
||||||
|
this.doc = doc
|
||||||
this.addToScope(typeScope)
|
this.addToScope(typeScope)
|
||||||
this.deleteFilter = deleteFilter
|
this.deleteFilter = deleteFilter
|
||||||
trackedOrigins.add(this)
|
trackedOrigins.add(this)
|
||||||
@ -189,7 +191,6 @@ export class UndoManager extends Observable {
|
|||||||
*/
|
*/
|
||||||
this.undoing = false
|
this.undoing = false
|
||||||
this.redoing = false
|
this.redoing = false
|
||||||
this.doc = doc
|
|
||||||
this.lastChange = 0
|
this.lastChange = 0
|
||||||
this.ignoreRemoteMapChanges = ignoreRemoteMapChanges
|
this.ignoreRemoteMapChanges = ignoreRemoteMapChanges
|
||||||
this.captureTimeout = captureTimeout
|
this.captureTimeout = captureTimeout
|
||||||
@ -263,6 +264,7 @@ export class UndoManager extends Observable {
|
|||||||
ytypes = array.isArray(ytypes) ? ytypes : [ytypes]
|
ytypes = array.isArray(ytypes) ? ytypes : [ytypes]
|
||||||
ytypes.forEach(ytype => {
|
ytypes.forEach(ytype => {
|
||||||
if (this.scope.every(yt => yt !== ytype)) {
|
if (this.scope.every(yt => yt !== ytype)) {
|
||||||
|
if (ytype.doc !== this.doc) logging.warn('[yjs#509] Not same Y.Doc') // use MultiDocUndoManager instead. also see https://github.com/yjs/yjs/issues/509
|
||||||
this.scope.push(ytype)
|
this.scope.push(ytype)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user