{"_id":"@anchor-logoot/listdocumentmodel","_rev":"1-2249c22fc326d1fb25a75408ca451e0b","name":"@anchor-logoot/listdocumentmodel","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@anchor-logoot/listdocumentmodel","version":"0.1.0","description":"An ordered list CRDT, duplications allowed.","main":"lib/index.js","types":"lib/index.d.ts","typings":"lib/index.d.ts","author":{"name":"Nathan Pennie","email":"kb1rd@kb1rd.net"},"license":"GPL-3.0-or-later","repository":{"type":"git","url":"git://github.com/anchor-logoot/listdocumentmodel.git"},"scripts":{"check-types":"tsc --noEmit","check-types:watch":"yarn run type-check -- --watch","build":"yarn run lint && yarn run build:types && yarn run build:js","build:types":"tsc --emitDeclarationOnly","build:docs":"typedoc --mode modules --out .jsdoc src/","build:js":"babel src --out-dir lib --extensions \".ts,.tsx\" --source-maps inline","lint":"eslint src/*","test":"yarn run test:unit; yarn run test:practical","test:unit":"mocha --require ./test/babel-register.js --colors ./test/*.spec.ts","test:watch":"mocha --require ./test/babel-register.js --colors -w ./test/*.spec.ts","test:cover":"cross-env NODE_ENV=test nyc mocha --require ./test/babel-register.js --require source-map-support/register --recursive --colors ./test/*.spec.ts","test:perf":"rm -rf .flamegraph; mkdir .flamegraph; for FILE in $(find test/*.perf.js); do 0x -D ./.flamegraph/$FILE -os --title \"$(node $FILE --name)\" $FILE; done","test:practical":"mocha --require ./test/babel-register.js --timeout 20000 --colors ./test/*.practical.ts"},"devDependencies":{"0x":"^4.10.2","@babel/cli":"^7.8.3","@babel/core":"^7.8.3","@babel/plugin-proposal-class-properties":"^7.8.3","@babel/preset-env":"^7.8.3","@babel/preset-typescript":"^7.8.3","@babel/register":"^7.10.5","@istanbuljs/nyc-config-typescript":"^1.0.1","@types/chai":"^4.2.11","@types/mocha":"^8.0.0","@typescript-eslint/eslint-plugin":"^3.7.0","@typescript-eslint/parser":"^3.7.0","babel-eslint":"^10.1.0","babel-plugin-istanbul":"^6.0.0","chai":"^4.2.0","cross-env":"^7.0.2","eslint":"^7.5.0","eslint-config-prettier":"^6.11.0","eslint-loader":"^4.0.2","eslint-plugin-prettier":"^3.1.4","mocha":"^8.0.1","nyc":"^15.1.0","prettier":"^2.0.5","random":"^2.2.0","typedoc":"^0.19.2","typescript":"^3.7.5"},"dependencies":{"@anchor-logoot/dtst-js":"^0.1.1","core-js":"^3.8.2"},"gitHead":"ab9ef35845ac7a0893554b564a326fbdbfa4ddf4","bugs":{"url":"https://github.com/anchor-logoot/listdocumentmodel/issues"},"homepage":"https://github.com/anchor-logoot/listdocumentmodel#readme","_id":"@anchor-logoot/listdocumentmodel@0.1.0","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ar9Pkagww1Ps98FQW/ydjnRIqPiPrMZiV34NK9Wbmgi9P7G81pMpMwi8x2vSOFZsw4lYaaq2m72dUwxrMgj0cA==","shasum":"5f54b3cc3129c91dfeabe6d6373b47eb879e098f","tarball":"https://registry.npmjs.org/@anchor-logoot/listdocumentmodel/-/listdocumentmodel-0.1.0.tgz","fileCount":34,"unpackedSize":499820,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9yQTCRA9TVsSAnZWagAA37cP/iNx0JNxVvl5ZkS/Xd0J\nr5ST4g3a6HDZKvF145WU6A0OqvUosfF+1XYDP6/6cEp1pFIr6mFjkVDtLLBK\neByT/iKyxVJC7Qf+5MAq2hoexGBTiHz8XSzeIABgXhU4ZVT5PRmcy9baCfZ3\n+I3Dd7RUYihCk3g4B1gPuvZexTo8k4HNXzEtS6lmbTMvwlERsH+4d8PSFCnf\nNQRt8RcdiRCEpfwLuqxYQjL7wU8FUsL6taNpQ8HFJIIU2WrIQGk/Ul4EV6Sa\nxDl0JDWyG+zJOsbR5b9stgOg9+2i24H8rSBwNeg1GwlTT+MM4zu0SSXnCeEc\n0Mm9x4BN9I1KNWstmvQkR+GGfQ0anbDgGnLcIc76SmIKvfiuKVDEWTT2+SA2\nqfT0EikjmGMPqsnplMxZ2eCkMlYfUK6so27rZqJXJ3XWNur0l2bdBPbn0TJN\nvlWFHfPkM5MTRh0uQJh2QRlTjVNLQG4D9fbM6AE580n7cbUATldnWddfRxrm\nZOjYIMWffmCub9fdbHZKKXti+eDu5bsK8trkQAAn5Uwfz79xLXgJ66Gx9SUK\nNVYrDCcBUTBq54zFxAoPb8RWfD9xN7fwro0pTpzp9pxSm//WavooMquYlRMk\naVtThD9dD3lOdo7B9ao4R4JhQYAcHcuO2xuwJgM57gsdWzUwi0PlqmACAH+w\niiso\r\n=sPvN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGIMCQGniJqktokRI6IznWfy6CwhstdB6s+XPrOqW6rMAiEAhtKPfDZISqgOo1AxAlcmNedI82vS8lz1m685fo8Mu9Y="}]},"_npmUser":{"name":"kb1rd","email":"kb1rd@kb1rd.net"},"directories":{},"maintainers":[{"name":"kb1rd","email":"kb1rd@kb1rd.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/listdocumentmodel_0.1.0_1610032147020_0.869430297389767"},"_hasShrinkwrap":false}},"time":{"created":"2021-01-07T15:09:06.795Z","0.1.0":"2021-01-07T15:09:07.164Z","modified":"2022-04-04T13:56:53.351Z"},"maintainers":[{"name":"kb1rd","email":"kb1rd@kb1rd.net"}],"description":"An ordered list CRDT, duplications allowed.","homepage":"https://github.com/anchor-logoot/listdocumentmodel#readme","repository":{"type":"git","url":"git://github.com/anchor-logoot/listdocumentmodel.git"},"author":{"name":"Nathan Pennie","email":"kb1rd@kb1rd.net"},"bugs":{"url":"https://github.com/anchor-logoot/listdocumentmodel/issues"},"license":"GPL-3.0-or-later","readme":"# @anchor-logoot/listdocumentmodel\n\nThis is an implementation of the AnchorLogoot algorithm from which the\norganization derives its name. I'm working on some good documentation about the\nactual algorithm itself, but in the mean time, it's undocumented. The actual\ndatatype this represents is an ordered list that allows duplications. To create\na document, simply create an instance of the `ListDocumentModel` class.\n\n## Design Philosophy\nThis algorithm, in contrast to others such as\n[Automerge](https://github.com/automerge/automerge) or\n[Y.js](https://github.com/yjs/yjs) is both data *and* network agnostic. This\nmeans that the `ListDocumentModel` contained here can be used for any ordered\nlist that allows duplication, such as a `string`, array, or a rich text data\ntype. This *does* mean that it's up to you to perform operations on whatever\nyour data model is, but it's quite easy. However, if you want to save the state\n(in IndexedDB or wherever), you will have to implement this yourself. If you\nare interested in using this in your own project, **please submit an issue to\nrequest that I clear up the documentation.** I'm focusing on making the Nodepad\nwork, so docs here are not at the top of my priority list.\n\nThis codebase was forked out of\n[Matrix Notepad](https://matrix-notepad.kb1rd.net) and, shortly thereafter,\nconverted to TypeScript. This is by far the most complex and important part of\nthe Notepad.\n\nThe `ListDocumentModel` contains a mapping of Logootish (custom algorithm)\npositions to text positions in the local document. It is capable of\nbi-directional mappings. The Logoot equivalent of a local insertion is\ndetermined through the `insertLocal` method and the Logoot equivalent of a\nlocal removal is determined through the `removeLocal` function. The local\noperations that must be performed for a given Logoot operation are determined\nby the `insertLogoot` and `removeLogoot` methods, respectively.\n\nConflict resolution is mostly implemented, but there's a few bugs. As soon as\nthose are ironed out, it's ready to go. There will still be performance\nimprovements necessary, though.\n\n## Development\n\n```bash\n\n# Install deps\nyarn\n\n# Check types\nyarn run check-types\n\n# Just lint\nyarn run lint\n\n# Build for production (and lint)\nyarn run build\n\n# Build jsdoc\nyarn run build:docs\n\n# Test\nyarn run test\n\n# Test with auto reloads\nyarn run test:watch\n\n# Get test coverage\nyarn run test:cover\n\n```\n","readmeFilename":"README.md"}