Compare commits

...

4 Commits

Author SHA1 Message Date
Kevin Jahns
45df311dd7 13.0.3 2020-02-12 10:38:28 +01:00
Kevin Jahns
62888b4004 bundle yjs as a module to prevent declaration issues from circular dependencies 2020-02-12 10:37:22 +01:00
Kevin Jahns
76c389dba0 13.0.2 2020-02-03 12:23:39 +01:00
Kevin Jahns
78fa98c000 add type definition for YText.length 2020-02-03 12:22:35 +01:00
6 changed files with 36 additions and 16 deletions

20
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "yjs",
"version": "13.0.1",
"version": "13.0.3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -1332,9 +1332,9 @@
"dev": true
},
"isomorphic.js": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/isomorphic.js/-/isomorphic.js-0.1.1.tgz",
"integrity": "sha512-Q85LNm6e50saL4EPWa0mWEYNUuV51n623gzPVNC1QiLGLmjONEtfFT3pa04OoUIYB7rzGJBpzO2iNPhV1Ib4hg=="
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/isomorphic.js/-/isomorphic.js-0.1.3.tgz",
"integrity": "sha512-pabBRLDwYefSsNS+qCazJ97o7P5xDTrNoxSYFTM09JlZTxPrOEPGKekwqUy3/Np4C4PHnVUXHYsZPOix0jELsA=="
},
"js-tokens": {
"version": "4.0.0",
@@ -1439,9 +1439,9 @@
}
},
"lib0": {
"version": "0.2.7",
"resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.7.tgz",
"integrity": "sha512-25ojhgEondpayWt2mgVTKels6R8viO27AetFgvdOk+WWGVah+q2pXouQ6dGj/gtxNwCDD2ih2B0LbDovNEtCrg==",
"version": "0.2.12",
"resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.12.tgz",
"integrity": "sha512-ileLyIMsWqcpyFLP6WMIgD6C7rkwrdYjH6CCFvAnqOhnGcyAl8LmLkiryVNmKW0sLRw/gLcB47LGXJDw0tDlkg==",
"requires": {
"isomorphic.js": "^0.1.1"
}
@@ -2291,9 +2291,9 @@
}
},
"rollup": {
"version": "1.29.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-1.29.1.tgz",
"integrity": "sha512-dGQ+b9d1FOX/gluiggTAVnTvzQZUEkCi/TwZcax7ujugVRHs0nkYJlV9U4hsifGEMojnO+jvEML2CJQ6qXgbHA==",
"version": "1.30.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-1.30.0.tgz",
"integrity": "sha512-ANcmfaSQwpcJtZUTA0ZMNBtFcQ1B4A5FldlNqEK0WdWm9sHSKu93ffa2KV1ux8HA/yKIV/ZARV28m7rNdXJgEw==",
"dev": true,
"requires": {
"@types/estree": "*",

View File

@@ -1,9 +1,9 @@
{
"name": "yjs",
"version": "13.0.1",
"version": "13.0.3",
"description": "Shared Editing Library",
"main": "./dist/yjs.cjs",
"module": "./src/index.js",
"module": "./dist/yjs.mjs",
"types": "./dist/src/index.d.ts",
"sideEffects": false,
"scripts": {
@@ -56,7 +56,7 @@
},
"homepage": "https://yjs.dev",
"dependencies": {
"lib0": "^0.2.7"
"lib0": "^0.2.12"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^11.0.1",
@@ -65,7 +65,7 @@
"http-server": "^0.12.1",
"jsdoc": "^3.6.3",
"markdownlint-cli": "^0.19.0",
"rollup": "^1.29.1",
"rollup": "^1.30.0",
"rollup-cli": "^1.0.9",
"standard": "^14.0.0",
"tui-jsdoc-template": "^1.2.2",

View File

@@ -51,6 +51,21 @@ export default [{
}
},
external: id => /^lib0\//.test(id)
}, {
input: './src/index.js',
output: {
name: 'Y',
file: 'dist/yjs.mjs',
format: 'esm',
sourcemap: true,
paths: path => {
if (/^lib0\//.test(path)) {
return `lib0/dist/${path.slice(5, -3)}.cjs`
}
return path
}
},
external: id => /^lib0\//.test(id)
}, {
input: './tests/index.js',
output: {

View File

@@ -56,5 +56,6 @@ export {
isParentOf,
equalSnapshots,
PermanentUserData, // @TODO experimental
tryGc
tryGc,
transact
} from './internals.js'

View File

@@ -617,6 +617,11 @@ export class YText extends AbstractType {
this._pending = string !== undefined ? [() => this.insert(0, string)] : []
}
/**
* Number of characters of this text type.
*
* @type {number}
*/
get length () {
return this._length
}

View File

@@ -338,7 +338,6 @@ const cleanupTransactions = (transactionCleanups, i) => {
* @param {function(Transaction):void} f
* @param {any} [origin=true]
*
* @private
* @function
*/
export const transact = (doc, f, origin = null, local = true) => {