Comparing version 13.6.14 to 13.6.15
@@ -71,2 +71,6 @@ export class ArraySearchMarker { | ||
/** | ||
* Makes a copy of this data type that can be included somewhere else. | ||
* | ||
* Note that the content is only readable _after_ it has been included somewhere in the Ydoc. | ||
* | ||
* @return {AbstractType<EventType>} | ||
@@ -73,0 +77,0 @@ */ |
@@ -55,2 +55,6 @@ /** | ||
/** | ||
* Makes a copy of this data type that can be included somewhere else. | ||
* | ||
* Note that the content is only readable _after_ it has been included somewhere in the Ydoc. | ||
* | ||
* @return {YArray<T>} | ||
@@ -136,3 +140,3 @@ */ | ||
/** | ||
* Executes a provided function once on overy element of this YArray. | ||
* Executes a provided function once on every element of this YArray. | ||
* | ||
@@ -139,0 +143,0 @@ * @param {function(T,number,YArray<T>):void} f A function to execute on every element of this YArray. |
@@ -49,2 +49,6 @@ /** | ||
/** | ||
* Makes a copy of this data type that can be included somewhere else. | ||
* | ||
* Note that the content is only readable _after_ it has been included somewhere in the Ydoc. | ||
* | ||
* @return {YMap<MapType>} | ||
@@ -51,0 +55,0 @@ */ |
@@ -121,2 +121,6 @@ export class ItemTextListPosition { | ||
/** | ||
* Makes a copy of this data type that can be included somewhere else. | ||
* | ||
* Note that the content is only readable _after_ it has been included somewhere in the Ydoc. | ||
* | ||
* @return {YText} | ||
@@ -123,0 +127,0 @@ */ |
@@ -43,2 +43,6 @@ /** | ||
/** | ||
* Makes a copy of this data type that can be included somewhere else. | ||
* | ||
* Note that the content is only readable _after_ it has been included somewhere in the Ydoc. | ||
* | ||
* @return {YXmlElement<KV>} | ||
@@ -45,0 +49,0 @@ */ |
@@ -88,2 +88,6 @@ /** | ||
/** | ||
* Makes a copy of this data type that can be included somewhere else. | ||
* | ||
* Note that the content is only readable _after_ it has been included somewhere in the Ydoc. | ||
* | ||
* @return {YXmlFragment} | ||
@@ -224,3 +228,3 @@ */ | ||
/** | ||
* Executes a provided function on once on overy child element. | ||
* Executes a provided function on once on every child element. | ||
* | ||
@@ -227,0 +231,0 @@ * @param {function(YXmlElement|YXmlText,number, typeof self):void} f A function to execute on every element of this YArray. |
@@ -20,2 +20,6 @@ /** | ||
/** | ||
* Makes a copy of this data type that can be included somewhere else. | ||
* | ||
* Note that the content is only readable _after_ it has been included somewhere in the Ydoc. | ||
* | ||
* @return {YXmlHook} | ||
@@ -22,0 +26,0 @@ */ |
@@ -20,2 +20,6 @@ /** | ||
/** | ||
* Makes a copy of this data type that can be included somewhere else. | ||
* | ||
* Note that the content is only readable _after_ it has been included somewhere in the Ydoc. | ||
* | ||
* @return {YXmlText} | ||
@@ -22,0 +26,0 @@ */ |
@@ -113,10 +113,10 @@ export const generateNewClientId: typeof random.uint32; | ||
* | ||
* Multiple calls of `y.get(name, TypeConstructor)` yield the same result | ||
* Multiple calls of `ydoc.get(name, TypeConstructor)` yield the same result | ||
* and do not overwrite each other. I.e. | ||
* `y.define(name, Y.Array) === y.define(name, Y.Array)` | ||
* `ydoc.get(name, Y.Array) === ydoc.get(name, Y.Array)` | ||
* | ||
* After this method is called, the type is also available on `y.share.get(name)`. | ||
* After this method is called, the type is also available on `ydoc.share.get(name)`. | ||
* | ||
* *Best Practices:* | ||
* Define all types right after the Yjs instance is created and store them in a separate object. | ||
* Define all types right after the Y.Doc instance is created and store them in a separate object. | ||
* Also use the typed methods `getText(name)`, `getArray(name)`, .. | ||
@@ -126,6 +126,6 @@ * | ||
* @example | ||
* const y = new Y(..) | ||
* const ydoc = new Y.Doc(..) | ||
* const appState = { | ||
* document: y.getText('document') | ||
* comments: y.getArray('comments') | ||
* document: ydoc.getText('document') | ||
* comments: ydoc.getArray('comments') | ||
* } | ||
@@ -132,0 +132,0 @@ * |
@@ -84,3 +84,3 @@ /** | ||
export function decodeRelativePosition(uint8Array: Uint8Array): RelativePosition; | ||
export function createAbsolutePositionFromRelativePosition(rpos: RelativePosition, doc: Doc): AbsolutePosition | null; | ||
export function createAbsolutePositionFromRelativePosition(rpos: RelativePosition, doc: Doc, followUndoneDeletions?: boolean): AbsolutePosition | null; | ||
export function compareRelativePositions(a: RelativePosition | null, b: RelativePosition | null): boolean; | ||
@@ -87,0 +87,0 @@ import { ID } from "./ID.js"; |
@@ -9,3 +9,4 @@ /** | ||
* @example | ||
* const map = y.define('map', YMap) | ||
* const ydoc = new Y.Doc() | ||
* const map = ydoc.getMap('map') | ||
* // Log content when change is triggered | ||
@@ -19,3 +20,3 @@ * map.observe(() => { | ||
* // When put in a transaction, it will trigger the log after the transaction: | ||
* y.transact(() => { | ||
* ydoc.transact(() => { | ||
* map.set('a', 1) | ||
@@ -22,0 +23,0 @@ * map.set('b', 1) |
{ | ||
"name": "yjs", | ||
"version": "13.6.14", | ||
"version": "13.6.15", | ||
"description": "Shared Editing Library", | ||
@@ -5,0 +5,0 @@ "main": "./dist/yjs.cjs", |
@@ -52,3 +52,5 @@ | ||
* [AFFiNE](https://affine.pro/) A local-first, privacy-first, open source | ||
knowledge base. 🏅 | ||
knowledge base. :star2: | ||
* [Huly](https://huly.io/) - Open Source All-in-One Project Management Platform | ||
:star2: | ||
* [Cargo](https://cargo.site/) Site builder for designers and artists :star2: | ||
@@ -68,2 +70,5 @@ * [Gitbook](https://gitbook.com) Knowledge management for technical teams :star2: | ||
collaboratively organize radio broadcasts. :star: | ||
* [modyfi](https://www.modyfi.com) - Modyfi is the design platform built for | ||
multidisciplinary designers. Design, generate, animate, and more — without | ||
switching between apps. :star: | ||
* [Sana](https://sanalabs.com/) A learning platform with collaborative text | ||
@@ -73,3 +78,4 @@ editing powered by Yjs. | ||
collaborative notes app. | ||
* [PRSM](https://prsm.uk/) Collaborative mind-mapping and system visualisation. *[(source)](https://github.com/micrology/prsm)* | ||
* [PRSM](https://prsm.uk/) Collaborative mind-mapping and system visualisation. | ||
*[(source)](https://github.com/micrology/prsm)* | ||
* [Alldone](https://alldone.app/) A next-gen project management and | ||
@@ -97,2 +103,14 @@ collaboration platform. | ||
* [linear](https://linear.app) Streamline issues, projects, and product roadmaps. | ||
* [btw](https://www.btw.so) - Personal website builder | ||
* [AWS SageMaker](https://aws.amazon.com/sagemaker/) - Machine Learning Service | ||
* [Arkiter](https://www.arkiter.com/) - Live interview software | ||
* [Appflowy](https://www.appflowy.io/) - They use Yrs | ||
* [Multi.app](https://multi.app) - Multiplayer app sharing: Point, draw and edit | ||
in shared apps as if they're on your computer. They are using Yrs. | ||
* [AppMaster](https://appmaster.io) A No-Code platform for creating | ||
production-ready applications with source code generation. | ||
* [Synthesia](https://www.synthesia.io) - Collaborative Video Editor | ||
* [thinkdeli](https://thinkdeli.com) - A fast and simple notes app powered by AI | ||
* [ourboard](https://github.com/raimohanska/ourboard) - A collaborative whiteboard | ||
applicaiton | ||
@@ -152,5 +170,6 @@ ## Table of Contents | ||
A module that contains a simple websocket backend and a websocket client that | ||
connects to that backend. The backend can be extended to persist updates in a | ||
leveldb database. <b>y-sweet</b> and <b>ypy-websocket</b> (see below) are | ||
compatible to the y-wesocket protocol. | ||
connects to that backend. <a href="https://github.com/yjs/y-redis/"><b>y-redis</b></a>, | ||
<b>y-sweet</b>, <b>ypy-websocket</b> and <a href="https://tiptap.dev/docs/hocuspocus/introduction"> | ||
<b>Hocuspocus</b></a> (see below) are alternative | ||
backends to y-websocket. | ||
</dd> | ||
@@ -178,2 +197,6 @@ <dt><a href="https://github.com/yjs/y-webrtc">y-webrtc</a></dt> | ||
</dd> | ||
<dt><a href="https://github.com/ueberdosis/hocuspocus">Hocuspocus</a></dt> | ||
<dd> | ||
A standalone extensible yjs server with sqlite persistence, webhooks, auth and more. | ||
</dd> | ||
<dt><a href="https://docs.partykit.io/reference/y-partykit-api/">PartyKit</a></dt> | ||
@@ -214,2 +237,11 @@ <dd> | ||
</dd> | ||
<dt><a href="https://tinybase.org/">Tinybase</a></dt> | ||
<dd> | ||
The reactive data store for local-first apps. They support multiple CRDTs and | ||
different network technologies. | ||
</dd> | ||
<dt><a href="https://codeberg.org/webxdc/y-webxdc">y-webxdc</a></dt> | ||
<dd> | ||
Provider for sharing data in <a href="https://webxdc.org">webxdc chat apps</a>. | ||
</dd> | ||
</dl> | ||
@@ -216,0 +248,0 @@ |
@@ -319,2 +319,6 @@ import { | ||
/** | ||
* Makes a copy of this data type that can be included somewhere else. | ||
* | ||
* Note that the content is only readable _after_ it has been included somewhere in the Ydoc. | ||
* | ||
* @return {AbstractType<EventType>} | ||
@@ -481,3 +485,3 @@ */ | ||
/** | ||
* Executes a provided function on once on overy element of this YArray. | ||
* Executes a provided function on once on every element of this YArray. | ||
* | ||
@@ -574,3 +578,3 @@ * @param {AbstractType<any>} type | ||
/** | ||
* Executes a provided function on once on overy element of this YArray. | ||
* Executes a provided function on once on every element of this YArray. | ||
* Operates on a snapshotted state of the document. | ||
@@ -577,0 +581,0 @@ * |
@@ -98,2 +98,6 @@ /** | ||
/** | ||
* Makes a copy of this data type that can be included somewhere else. | ||
* | ||
* Note that the content is only readable _after_ it has been included somewhere in the Ydoc. | ||
* | ||
* @return {YArray<T>} | ||
@@ -248,3 +252,3 @@ */ | ||
/** | ||
* Executes a provided function once on overy element of this YArray. | ||
* Executes a provided function once on every element of this YArray. | ||
* | ||
@@ -251,0 +255,0 @@ * @param {function(T,number,YArray<T>):void} f A function to execute on every element of this YArray. |
@@ -91,2 +91,6 @@ /** | ||
/** | ||
* Makes a copy of this data type that can be included somewhere else. | ||
* | ||
* Note that the content is only readable _after_ it has been included somewhere in the Ydoc. | ||
* | ||
* @return {YMap<MapType>} | ||
@@ -93,0 +97,0 @@ */ |
@@ -900,2 +900,6 @@ /** | ||
/** | ||
* Makes a copy of this data type that can be included somewhere else. | ||
* | ||
* Note that the content is only readable _after_ it has been included somewhere in the Ydoc. | ||
* | ||
* @return {YText} | ||
@@ -902,0 +906,0 @@ */ |
@@ -84,2 +84,6 @@ import * as object from 'lib0/object' | ||
/** | ||
* Makes a copy of this data type that can be included somewhere else. | ||
* | ||
* Note that the content is only readable _after_ it has been included somewhere in the Ydoc. | ||
* | ||
* @return {YXmlElement<KV>} | ||
@@ -86,0 +90,0 @@ */ |
@@ -166,2 +166,6 @@ /** | ||
/** | ||
* Makes a copy of this data type that can be included somewhere else. | ||
* | ||
* Note that the content is only readable _after_ it has been included somewhere in the Ydoc. | ||
* | ||
* @return {YXmlFragment} | ||
@@ -410,3 +414,3 @@ */ | ||
/** | ||
* Executes a provided function on once on overy child element. | ||
* Executes a provided function on once on every child element. | ||
* | ||
@@ -413,0 +417,0 @@ * @param {function(YXmlElement|YXmlText,number, typeof self):void} f A function to execute on every element of this YArray. |
@@ -32,2 +32,6 @@ import { | ||
/** | ||
* Makes a copy of this data type that can be included somewhere else. | ||
* | ||
* Note that the content is only readable _after_ it has been included somewhere in the Ydoc. | ||
* | ||
* @return {YXmlHook} | ||
@@ -34,0 +38,0 @@ */ |
@@ -33,2 +33,6 @@ import { | ||
/** | ||
* Makes a copy of this data type that can be included somewhere else. | ||
* | ||
* Note that the content is only readable _after_ it has been included somewhere in the Ydoc. | ||
* | ||
* @return {YXmlText} | ||
@@ -35,0 +39,0 @@ */ |
@@ -190,10 +190,10 @@ /** | ||
* | ||
* Multiple calls of `y.get(name, TypeConstructor)` yield the same result | ||
* Multiple calls of `ydoc.get(name, TypeConstructor)` yield the same result | ||
* and do not overwrite each other. I.e. | ||
* `y.define(name, Y.Array) === y.define(name, Y.Array)` | ||
* `ydoc.get(name, Y.Array) === ydoc.get(name, Y.Array)` | ||
* | ||
* After this method is called, the type is also available on `y.share.get(name)`. | ||
* After this method is called, the type is also available on `ydoc.share.get(name)`. | ||
* | ||
* *Best Practices:* | ||
* Define all types right after the Yjs instance is created and store them in a separate object. | ||
* Define all types right after the Y.Doc instance is created and store them in a separate object. | ||
* Also use the typed methods `getText(name)`, `getArray(name)`, .. | ||
@@ -203,6 +203,6 @@ * | ||
* @example | ||
* const y = new Y(..) | ||
* const ydoc = new Y.Doc(..) | ||
* const appState = { | ||
* document: y.getText('document') | ||
* comments: y.getArray('comments') | ||
* document: ydoc.getText('document') | ||
* comments: ydoc.getArray('comments') | ||
* } | ||
@@ -209,0 +209,0 @@ * |
@@ -11,2 +11,3 @@ import { | ||
followRedone, | ||
getItem, | ||
ID, Doc, AbstractType // eslint-disable-line | ||
@@ -260,4 +261,15 @@ } from '../internals.js' | ||
/** | ||
* Transform a relative position to an absolute position. | ||
* | ||
* If you want to share the relative position with other users, you should set | ||
* `followUndoneDeletions` to false to get consistent results across all clients. | ||
* | ||
* When calculating the absolute position, we try to follow the "undone deletions". This yields | ||
* better results for the user who performed undo. However, only the user who performed the undo | ||
* will get the better results, the other users don't know which operations recreated a deleted | ||
* range of content. There is more information in this ticket: https://github.com/yjs/yjs/issues/638 | ||
* | ||
* @param {RelativePosition} rpos | ||
* @param {Doc} doc | ||
* @param {boolean} followUndoneDeletions - whether to follow undone deletions - see https://github.com/yjs/yjs/issues/638 | ||
* @return {AbsolutePosition|null} | ||
@@ -267,3 +279,3 @@ * | ||
*/ | ||
export const createAbsolutePositionFromRelativePosition = (rpos, doc) => { | ||
export const createAbsolutePositionFromRelativePosition = (rpos, doc, followUndoneDeletions = true) => { | ||
const store = doc.store | ||
@@ -280,3 +292,3 @@ const rightID = rpos.item | ||
} | ||
const res = followRedone(store, rightID) | ||
const res = followUndoneDeletions ? followRedone(store, rightID) : { item: getItem(store, rightID), diff: 0 } | ||
const right = res.item | ||
@@ -305,3 +317,3 @@ if (!(right instanceof Item)) { | ||
} | ||
const { item } = followRedone(store, typeID) | ||
const { item } = followUndoneDeletions ? followRedone(store, typeID) : { item: getItem(store, typeID) } | ||
if (item instanceof Item && item.content instanceof ContentType) { | ||
@@ -308,0 +320,0 @@ type = item.content.type |
@@ -31,3 +31,4 @@ import { | ||
* @example | ||
* const map = y.define('map', YMap) | ||
* const ydoc = new Y.Doc() | ||
* const map = ydoc.getMap('map') | ||
* // Log content when change is triggered | ||
@@ -41,3 +42,3 @@ * map.observe(() => { | ||
* // When put in a transaction, it will trigger the log after the transaction: | ||
* y.transact(() => { | ||
* ydoc.transact(() => { | ||
* map.set('a', 1) | ||
@@ -44,0 +45,0 @@ * map.set('b', 1) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2283144
34222
1283