Compare commits
8 Commits
v13-doc
...
v13.0.0-57
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3bac7362c2 | ||
|
|
38558a7fad | ||
|
|
bdb3782f8f | ||
|
|
bc32f7348e | ||
|
|
09a94f053e | ||
|
|
0df0079fa3 | ||
|
|
941a22b257 | ||
|
|
4aa41b98a9 |
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "yjs",
|
"name": "yjs",
|
||||||
"version": "13.0.0-54",
|
"version": "13.0.0-57",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "yjs",
|
"name": "yjs",
|
||||||
"version": "13.0.0-54",
|
"version": "13.0.0-57",
|
||||||
"description": "A framework for real-time p2p shared editing on any data",
|
"description": "A framework for real-time p2p shared editing on any data",
|
||||||
"main": "./y.node.js",
|
"main": "./y.node.js",
|
||||||
"browser": "./y.js",
|
"browser": "./y.js",
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ function _integrateRemoteStructHelper (y, struct) {
|
|||||||
if (y.ss.getState(id.user) > id.clock) {
|
if (y.ss.getState(id.user) > id.clock) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (struct.constructor === GC || (struct._parent.constructor !== GC && struct._parent._deleted === false)) {
|
if (!y.gcEnabled || struct.constructor === GC || (struct._parent.constructor !== GC && struct._parent._deleted === false)) {
|
||||||
// Is either a GC or Item with an undeleted parent
|
// Is either a GC or Item with an undeleted parent
|
||||||
// save to integrate
|
// save to integrate
|
||||||
struct._integrate(y)
|
struct._integrate(y)
|
||||||
|
|||||||
@@ -217,8 +217,8 @@ export default class Type extends Item {
|
|||||||
* collect the children of this type.
|
* collect the children of this type.
|
||||||
*/
|
*/
|
||||||
_delete (y, createDelete, gcChildren) {
|
_delete (y, createDelete, gcChildren) {
|
||||||
if (gcChildren === undefined) {
|
if (gcChildren === undefined || !y.gcEnabled) {
|
||||||
gcChildren = y._hasUndoManager === false
|
gcChildren = y._hasUndoManager === false && y.gcEnabled
|
||||||
}
|
}
|
||||||
super._delete(y, createDelete, gcChildren)
|
super._delete(y, createDelete, gcChildren)
|
||||||
y._transaction.changedTypes.delete(this)
|
y._transaction.changedTypes.delete(this)
|
||||||
|
|||||||
3
src/Y.js
3
src/Y.js
@@ -28,8 +28,9 @@ export { default as DomBinding } from './Bindings/DomBinding/DomBinding.js'
|
|||||||
* @param {AbstractPersistence} persistence Persistence adapter instance
|
* @param {AbstractPersistence} persistence Persistence adapter instance
|
||||||
*/
|
*/
|
||||||
export default class Y extends NamedEventHandler {
|
export default class Y extends NamedEventHandler {
|
||||||
constructor (room, opts, persistence) {
|
constructor (room, opts, persistence, conf = {}) {
|
||||||
super()
|
super()
|
||||||
|
this.gcEnabled = conf.gc || false
|
||||||
/**
|
/**
|
||||||
* The room name that this Yjs instance connects to.
|
* The room name that this Yjs instance connects to.
|
||||||
* @type {String}
|
* @type {String}
|
||||||
|
|||||||
1
y.node.js.map
Normal file
1
y.node.js.map
Normal file
File diff suppressed because one or more lines are too long
1
y.test.js.map
Normal file
1
y.test.js.map
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user