fix import locations
This commit is contained in:
parent
bbc207aaa6
commit
814af5a3d7
@ -8,7 +8,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "npm run lint",
|
"test": "npm run lint",
|
||||||
"debug": "concurrently 'rollup -wc rollup.test.js' 'cutest-serve y.test.js -o'",
|
"debug": "concurrently 'rollup -wc rollup.test.js' 'cutest-serve y.test.js -o'",
|
||||||
"lint": "standard && documentation lint src/**",
|
"lint": "standard",
|
||||||
"docs": "esdocs",
|
"docs": "esdocs",
|
||||||
"serve-docs": "npm run docs && serve ./docs/",
|
"serve-docs": "npm run docs && serve ./docs/",
|
||||||
"dist": "rollup -c rollup.browser.js; rollup -c rollup.node.js",
|
"dist": "rollup -c rollup.browser.js; rollup -c rollup.node.js",
|
||||||
@ -18,7 +18,8 @@
|
|||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"y.*",
|
"y.*",
|
||||||
"src/*"
|
"src/*",
|
||||||
|
".esdoc.json"
|
||||||
],
|
],
|
||||||
"standard": {
|
"standard": {
|
||||||
"ignore": [
|
"ignore": [
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { deleteItemRange } from '../Struct/Delete.js'
|
import { deleteItemRange } from '../Struct/Delete.js'
|
||||||
import ID from '../Util/ID/ID.js.js'
|
import ID from '../Util/ID/ID.js'
|
||||||
|
|
||||||
export function stringifyDeleteSet (y, decoder, strBuilder) {
|
export function stringifyDeleteSet (y, decoder, strBuilder) {
|
||||||
let dsLength = decoder.readUint32()
|
let dsLength = decoder.readUint32()
|
||||||
|
@ -2,8 +2,8 @@ import BinaryDecoder from '../Util/Binary/Decoder.js'
|
|||||||
import { stringifyStructs } from './integrateRemoteStructs.js'
|
import { stringifyStructs } from './integrateRemoteStructs.js'
|
||||||
import { stringifySyncStep1 } from './syncStep1.js'
|
import { stringifySyncStep1 } from './syncStep1.js'
|
||||||
import { stringifySyncStep2 } from './syncStep2.js'
|
import { stringifySyncStep2 } from './syncStep2.js'
|
||||||
import ID from '../Util/ID/ID.js.js'
|
import ID from '../Util/ID/ID.js'
|
||||||
import RootID from '../Util/ID/RootID.js.js'
|
import RootID from '../Util/ID/RootID.js'
|
||||||
import Y from '../Y.js'
|
import Y from '../Y.js'
|
||||||
|
|
||||||
export function messageToString ([y, buffer]) {
|
export function messageToString ([y, buffer]) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import BinaryEncoder from '../Util/Binary/Encoder.js'
|
import BinaryEncoder from '../Util/Binary/Encoder.js'
|
||||||
import { readStateSet, writeStateSet } from './stateSet.js'
|
import { readStateSet, writeStateSet } from './stateSet.js'
|
||||||
import { writeDeleteSet } from './deleteSet.js'
|
import { writeDeleteSet } from './deleteSet.js'
|
||||||
import ID from '../Util/ID/ID.js.js'
|
import ID from '../Util/ID/ID.js'
|
||||||
import { RootFakeUserID } from '../Util/ID/RootID.js.js'
|
import { RootFakeUserID } from '../Util/ID/RootID.js'
|
||||||
|
|
||||||
export function stringifySyncStep1 (y, decoder, strBuilder) {
|
export function stringifySyncStep1 (y, decoder, strBuilder) {
|
||||||
let auth = decoder.readVarString()
|
let auth = decoder.readVarString()
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import Tree from '../Util/Tree.js'
|
import Tree from '../Util/Tree.js'
|
||||||
import ID from '../Util/ID/ID.js.js'
|
import ID from '../Util/ID/ID.js'
|
||||||
|
|
||||||
class DSNode {
|
class DSNode {
|
||||||
constructor (id, len, gc) {
|
constructor (id, len, gc) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import Tree from '../Util/Tree.js'
|
import Tree from '../Util/Tree.js'
|
||||||
import RootID from '../Util/ID/RootID.js.js'
|
import RootID from '../Util/ID/RootID.js'
|
||||||
import { getStruct } from '../Util/structReferences.js'
|
import { getStruct } from '../Util/structReferences.js'
|
||||||
import { logID } from '../MessageHandler/messageToString.js'
|
import { logID } from '../MessageHandler/messageToString.js'
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import ID from '../Util/ID/ID.js.js'
|
import ID from '../Util/ID/ID.js'
|
||||||
|
|
||||||
export default class StateStore {
|
export default class StateStore {
|
||||||
constructor (y) {
|
constructor (y) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { getReference } from '../Util/structReferences.js'
|
import { getStructReference } from '../Util/structReferences.js'
|
||||||
import ID from '../Util/ID/ID.js.js'
|
import ID from '../Util/ID/ID.js'
|
||||||
import { logID } from '../MessageHandler/messageToString.js'
|
import { logID } from '../MessageHandler/messageToString.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -79,7 +79,7 @@ export default class Delete {
|
|||||||
* @param {BinaryEncoder} encoder The encoder to write data to.
|
* @param {BinaryEncoder} encoder The encoder to write data to.
|
||||||
*/
|
*/
|
||||||
_toBinary (encoder) {
|
_toBinary (encoder) {
|
||||||
encoder.writeUint8(getReference(this.constructor))
|
encoder.writeUint8(getStructReference(this.constructor))
|
||||||
encoder.writeID(this._targetID)
|
encoder.writeID(this._targetID)
|
||||||
encoder.writeVarUint(this._length)
|
encoder.writeVarUint(this._length)
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { getReference } from '../Util/structReferences.js'
|
import { getStructReference } from '../Util/structReferences.js'
|
||||||
import ID from '../Util/ID/ID.js.js'
|
import ID from '../Util/ID/ID.js'
|
||||||
import { RootFakeUserID } from '../Util/ID/RootID.js.js'
|
import { RootFakeUserID } from '../Util/ID/RootID.js'
|
||||||
import Delete from './Delete.js'
|
import Delete from './Delete.js'
|
||||||
import { transactionTypeChanged } from '../Transaction.js'
|
import { transactionTypeChanged } from '../Transaction.js'
|
||||||
|
|
||||||
@ -336,7 +336,7 @@ export default class Item {
|
|||||||
* @param {BinaryEncoder} encoder The encoder to write data to.
|
* @param {BinaryEncoder} encoder The encoder to write data to.
|
||||||
*/
|
*/
|
||||||
_toBinary (encoder) {
|
_toBinary (encoder) {
|
||||||
encoder.writeUint8(getReference(this.constructor))
|
encoder.writeUint8(getStructReference(this.constructor))
|
||||||
let info = 0
|
let info = 0
|
||||||
if (this._origin !== null) {
|
if (this._origin !== null) {
|
||||||
info += 0b1 // origin is defined
|
info += 0b1 // origin is defined
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import Item from './Item.js'
|
import Item from './Item.js'
|
||||||
import EventHandler from '../Util/EventHandler.js'
|
import EventHandler from '../Util/EventHandler.js'
|
||||||
import ID from '../Util/ID/ID.js.js'
|
import ID from '../Util/ID/ID.js'
|
||||||
|
|
||||||
// restructure children as if they were inserted one after another
|
// restructure children as if they were inserted one after another
|
||||||
function integrateChildren (y, start) {
|
function integrateChildren (y, start) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import Type from '../Struct/Type.js'
|
import Type from '../../Struct/Type.js'
|
||||||
import ItemJSON from '../Struct/ItemJSON.js'
|
import ItemJSON from '../../Struct/ItemJSON.js'
|
||||||
import ItemString from '../Struct/ItemString.js'
|
import ItemString from '../../Struct/ItemString.js'
|
||||||
import { logID } from '../MessageHandler/messageToString.js'
|
import { logID } from '../../MessageHandler/messageToString.js'
|
||||||
import YEvent from '../Util/YEvent.js'
|
import YEvent from '../../Util/YEvent.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event that describes the changes on a YArray
|
* Event that describes the changes on a YArray
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import Type from '../Struct/Type.js'
|
import Type from '../../Struct/Type.js'
|
||||||
import Item from '../Struct/Item.js'
|
import Item from '../../Struct/Item.js'
|
||||||
import ItemJSON from '../Struct/ItemJSON.js'
|
import ItemJSON from '../../Struct/ItemJSON.js'
|
||||||
import { logID } from '../MessageHandler/messageToString.js'
|
import { logID } from '../../MessageHandler/messageToString.js'
|
||||||
import YEvent from '../Util/YEvent.js'
|
import YEvent from '../../Util/YEvent.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event that describes the changes on a YMap.
|
* Event that describes the changes on a YMap.
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import ItemString from '../Struct/ItemString.js'
|
import ItemString from '../../Struct/ItemString.js'
|
||||||
import ItemEmbed from '../Struct/ItemEmbed.js'
|
import ItemEmbed from '../../Struct/ItemEmbed.js'
|
||||||
import ItemFormat from '../Struct/ItemFormat.js'
|
import ItemFormat from '../../Struct/ItemFormat.js'
|
||||||
import { logID } from '../MessageHandler/messageToString.js'
|
import { logID } from '../../MessageHandler/messageToString.js'
|
||||||
import { YArrayEvent, default as YArray } from './YArray.js'
|
import { YArrayEvent, default as YArray } from '../YArray/YArray.js'
|
||||||
|
|
||||||
function integrateItem (item, parent, y, left, right) {
|
function integrateItem (item, parent, y, left, right) {
|
||||||
item._origin = left
|
item._origin = left
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { defaultDomFilter } from './utils.js'
|
import { defaultDomFilter } from './utils.js'
|
||||||
|
|
||||||
import YMap from '../YMap.js'
|
import YMap from '../YMap/YMap.js'
|
||||||
import { YXmlFragment } from './YXml.js'
|
import { YXmlFragment } from './YXml.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
import { defaultDomFilter, applyChangesFromDom, reflectChangesOnDom } from './utils.js'
|
import { defaultDomFilter, applyChangesFromDom, reflectChangesOnDom } from './utils.js'
|
||||||
import { beforeTransactionSelectionFixer, afterTransactionSelectionFixer } from './selection.js'
|
import { beforeTransactionSelectionFixer, afterTransactionSelectionFixer } from './selection.js'
|
||||||
|
|
||||||
import YArray from '../YArray.js'
|
import YArray from '../YArray/YArray.js'
|
||||||
import YXmlEvent from './YXmlEvent.js'
|
import YXmlEvent from './YXmlEvent.js'
|
||||||
import { YXmlText, YXmlHook } from './YXml.js'
|
import { YXmlText, YXmlHook } from './YXml.js'
|
||||||
import { logID } from '../../MessageHandler/messageToString.js'
|
import { logID } from '../../MessageHandler/messageToString.js'
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import YMap from '../YMap.js'
|
import YMap from '../YMap/YMap.js'
|
||||||
import { getHook, addHook } from './hooks.js'
|
import { getHook, addHook } from './hooks.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import YText from '../YText.js'
|
import YText from '../YText/YText.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents text in a Dom Element. In the future this type will also handle
|
* Represents text in a Dom Element. In the future this type will also handle
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import ID from '../Util/ID/ID.js.js'
|
import ID from '../ID/ID.js'
|
||||||
import { default as RootID, RootFakeUserID } from '../Util/ID/RootID.js.js'
|
import { default as RootID, RootFakeUserID } from '../ID/RootID.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A BinaryDecoder handles the decoding of an ArrayBuffer.
|
* A BinaryDecoder handles the decoding of an ArrayBuffer.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { RootFakeUserID } from '../Util/ID/RootID.js.js'
|
import { RootFakeUserID } from '../ID/RootID.js'
|
||||||
|
|
||||||
const bits7 = 0b1111111
|
const bits7 = 0b1111111
|
||||||
const bits8 = 0b11111111
|
const bits8 = 0b11111111
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { getReference } from './structReferences.js'
|
import { getStructReference } from '../structReferences.js'
|
||||||
|
|
||||||
export const RootFakeUserID = 0xFFFFFF
|
export const RootFakeUserID = 0xFFFFFF
|
||||||
|
|
||||||
@ -6,7 +6,7 @@ export default class RootID {
|
|||||||
constructor (name, typeConstructor) {
|
constructor (name, typeConstructor) {
|
||||||
this.user = RootFakeUserID
|
this.user = RootFakeUserID
|
||||||
this.name = name
|
this.name = name
|
||||||
this.type = getReference(typeConstructor)
|
this.type = getStructReference(typeConstructor)
|
||||||
}
|
}
|
||||||
equals (id) {
|
equals (id) {
|
||||||
return id !== null && id.user === this.user && id.name === this.name && id.type === this.type
|
return id !== null && id.user === this.user && id.name === this.name && id.type === this.type
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import ID from './ID.js'
|
import ID from './ID/ID.js'
|
||||||
|
|
||||||
class ReverseOperation {
|
class ReverseOperation {
|
||||||
constructor (y, transaction) {
|
constructor (y, transaction) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
import ID from '../Util/ID/ID.js.js'
|
import ID from '../Util/ID/ID.js'
|
||||||
import ItemJSON from '../Struct/ItemJSON.js'
|
import ItemJSON from '../Struct/ItemJSON.js'
|
||||||
import ItemString from '../Struct/ItemString.js'
|
import ItemString from '../Struct/ItemString.js'
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import ID from './ID.js'
|
import ID from './ID/ID.js'
|
||||||
import RootID from './RootID.js'
|
import RootID from './ID/RootID.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A relative position that is based on the Yjs model. In contrast to an
|
* A relative position that is based on the Yjs model. In contrast to an
|
||||||
|
2
src/Y.js
2
src/Y.js
@ -2,7 +2,7 @@ import DeleteStore from './Store/DeleteStore.js'
|
|||||||
import OperationStore from './Store/OperationStore.js'
|
import OperationStore from './Store/OperationStore.js'
|
||||||
import StateStore from './Store/StateStore.js'
|
import StateStore from './Store/StateStore.js'
|
||||||
import { generateUserID } from './Util/generateUserID.js'
|
import { generateUserID } from './Util/generateUserID.js'
|
||||||
import RootID from './Util/ID/RootID.js.js'
|
import RootID from './Util/ID/RootID.js'
|
||||||
import NamedEventHandler from './Util/NamedEventHandler.js'
|
import NamedEventHandler from './Util/NamedEventHandler.js'
|
||||||
import Transaction from './Transaction.js'
|
import Transaction from './Transaction.js'
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import RedBlackTree from '../src/Util/Tree.js'
|
import RedBlackTree from '../src/Util/Tree.js'
|
||||||
import ID from '../src/Util/ID/ID.js.js'
|
import ID from '../src/Util/ID/ID.js'
|
||||||
import Chance from 'chance'
|
import Chance from 'chance'
|
||||||
import { test, proxyConsole } from 'cutest'
|
import { test, proxyConsole } from 'cutest'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user