Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
73e53e3dcc | ||
|
|
222ffea11e |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "yjs",
|
||||
"version": "12.2.0",
|
||||
"version": "12.3.0",
|
||||
"homepage": "y-js.org",
|
||||
"authors": [
|
||||
"Kevin Jahns <kevin.jahns@rwth-aachen.de>"
|
||||
|
||||
24
y.es6
24
y.es6
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* yjs - A framework for real-time p2p shared editing on any data
|
||||
* @version v12.1.7
|
||||
* @version v12.2.1
|
||||
* @link http://y-js.org
|
||||
* @license MIT
|
||||
*/
|
||||
@@ -3459,7 +3459,7 @@ module.exports = function (Y/* :any */) {
|
||||
var ops = []
|
||||
yield* this.os.iterate(this, null, null, function * (op) {
|
||||
if (op.id[0] !== '_') {
|
||||
ops.push(Y.Struct[op.struct].encode(op))
|
||||
ops.push(op)
|
||||
}
|
||||
})
|
||||
return {
|
||||
@@ -3563,6 +3563,20 @@ module.exports = function (Y/* :any */) {
|
||||
module.exports = function (Y /* : any*/) {
|
||||
Y.utils = {}
|
||||
|
||||
Y.utils.bubbleEvent = function (type, event) {
|
||||
type.eventHandler.callEventListeners(event)
|
||||
event.path = []
|
||||
while (type != null && type._deepEventHandler != null) {
|
||||
type._deepEventHandler.callEventListeners(event)
|
||||
if (type._parent != null && type._parentSub != null) {
|
||||
event.path = [type._parentSub].concat(event.path)
|
||||
type = type.os.getType(type._parent)
|
||||
} else {
|
||||
type = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class EventListenerHandler {
|
||||
constructor () {
|
||||
this.eventListeners = []
|
||||
@@ -3587,7 +3601,11 @@ module.exports = function (Y /* : any*/) {
|
||||
callEventListeners (event) {
|
||||
for (var i = 0; i < this.eventListeners.length; i++) {
|
||||
try {
|
||||
this.eventListeners[i](event)
|
||||
var _event = {}
|
||||
for (var name in event) {
|
||||
_event[name] = event[name]
|
||||
}
|
||||
this.eventListeners[i](_event)
|
||||
} catch (e) {
|
||||
console.error('Your observer threw an error. This error was caught so that Yjs still can ensure data consistency! In order to debug this error you have to check "Pause On Caught Exceptions"', e)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user