rittenhop-dev/versions/5.94.2/node_modules/yjs/dist/yjs.cjs.map

1 line
546 KiB
Plaintext
Raw Permalink Normal View History

2024-09-23 19:40:12 -04:00
{"version":3,"file":"yjs.cjs","sources":["../src/utils/AbstractConnector.js","../src/utils/DeleteSet.js","../src/utils/Doc.js","../src/utils/UpdateDecoder.js","../src/utils/UpdateEncoder.js","../src/utils/encoding.js","../src/utils/EventHandler.js","../src/utils/ID.js","../src/utils/isParentOf.js","../src/utils/logging.js","../src/utils/PermanentUserData.js","../src/utils/RelativePosition.js","../src/utils/Snapshot.js","../src/utils/StructStore.js","../src/utils/Transaction.js","../src/utils/UndoManager.js","../src/utils/updates.js","../src/utils/YEvent.js","../src/types/AbstractType.js","../src/types/YArray.js","../src/types/YMap.js","../src/types/YText.js","../src/types/YXmlFragment.js","../src/types/YXmlElement.js","../src/types/YXmlEvent.js","../src/types/YXmlHook.js","../src/types/YXmlText.js","../src/structs/AbstractStruct.js","../src/structs/GC.js","../src/structs/ContentBinary.js","../src/structs/ContentDeleted.js","../src/structs/ContentDoc.js","../src/structs/ContentEmbed.js","../src/structs/ContentFormat.js","../src/structs/ContentJSON.js","../src/structs/ContentAny.js","../src/structs/ContentString.js","../src/structs/ContentType.js","../src/structs/Item.js","../src/structs/Skip.js","../src/index.js"],"sourcesContent":["import { ObservableV2 } from 'lib0/observable'\n\nimport {\n Doc // eslint-disable-line\n} from '../internals.js'\n\n/**\n * This is an abstract interface that all Connectors should implement to keep them interchangeable.\n *\n * @note This interface is experimental and it is not advised to actually inherit this class.\n * It just serves as typing information.\n *\n * @extends {ObservableV2<any>}\n */\nexport class AbstractConnector extends ObservableV2 {\n /**\n * @param {Doc} ydoc\n * @param {any} awareness\n */\n constructor (ydoc, awareness) {\n super()\n this.doc = ydoc\n this.awareness = awareness\n }\n}\n","import {\n findIndexSS,\n getState,\n splitItem,\n iterateStructs,\n UpdateEncoderV2,\n DSDecoderV1, DSEncoderV1, DSDecoderV2, DSEncoderV2, Item, GC, StructStore, Transaction, ID // eslint-disable-line\n} from '../internals.js'\n\nimport * as array from 'lib0/array'\nimport * as math from 'lib0/math'\nimport * as map from 'lib0/map'\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\n\nexport class DeleteItem {\n /**\n * @param {number} clock\n * @param {number} len\n */\n constructor (clock, len) {\n /**\n * @type {number}\n */\n this.clock = clock\n /**\n * @type {number}\n */\n this.len = len\n }\n}\n\n/**\n * We no longer maintain a DeleteStore. DeleteSet is a temporary object that is created when needed.\n * - When created in a transaction, it must only be accessed after sorting, and merging\n * - This DeleteSet is send to other clients\n * - We do not create a DeleteSet when we send a sync message. The DeleteSet message is created directly from StructStore\n * - We read a DeleteSet as part of a sync/update message. In this case the DeleteSet is already sorted and merged.\n */\nexport class DeleteSet {\n constructor () {\n /**\n * @type {Map<number,Array<DeleteItem>>}\n */\n this.clients = new Map()\n }\n}\n\n/**\n * Iterate over all structs that the DeleteSet gc's.\n *\n * @param {Transaction} transaction\n * @param {DeleteSet} ds\n * @param {function(GC|Item):void} f\n *\n * @function\n */\nexport const iterateDeletedStructs = (transaction, ds, f) =>\n ds.clients.forEach((deletes, clientid) => {\n const structs = /** @type {Array<GC|Item>} */ (transaction.doc.store.clients.get(clientid))\n for (let i = 0; i < deletes.length; i++) {\n const del = deletes[i]\n iterateStructs(transaction, structs, del.clock, del.len, f)\n }\n })\n\n/**\n * @param {Array<DeleteItem>} dis\n * @param {number} clock\n * @return {number|null}\n *\n * @private\n * @function\n */\nexport const findIndexDS = (dis, clock) => {\n let left = 0\n let right = dis.length - 1\n while (left <= right) {\n const midindex = math.floor((left + right) / 2)\n const mid