{"_id":"@dojo-ng/rich-text-criticmarkup","_rev":"4-dd2407ff09bf3cadfbc2d8f34d917a13","name":"@dojo-ng/rich-text-criticmarkup","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@dojo-ng/rich-text-criticmarkup","version":"0.1.0","license":"BSD-3-Clause","_id":"@dojo-ng/rich-text-criticmarkup@0.1.0","maintainers":[{"name":"saysomething","email":"joshs@holmescorp.com"},{"name":"bitranch","email":"bill@bitranch.com"},{"name":"jepe","email":"jeffreyp@holmescorp.com"}],"dist":{"shasum":"a9363da650be0f93592d617f15699697939e978a","tarball":"https://registry.npmjs.org/@dojo-ng/rich-text-criticmarkup/-/rich-text-criticmarkup-0.1.0.tgz","fileCount":23,"integrity":"sha512-xohiZz1LlhRtJPJ6BsdUur4pTO7IGlTVIa59QNSeHQXiLiUDm2v2pQDcMOYKQ4ChyDEaiVwa86WvL2ekjJb+KA==","signatures":[{"sig":"MEUCIGRWDrN/WEbQFe6a1xfwHL32snpPnshA3q+b+lLYbQp1AiEA+t6qgG1NzqJeJtQ+3WPZQGwmY4SuRlbqF5QSRYTaQU4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":135187},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist"},"_npmUser":{"name":"bitranch","email":"bill@bitranch.com"},"_npmVersion":"10.9.8","description":"CriticMarkup tracked-changes plugin for @dojo-ng/rich-text","directories":{},"_nodeVersion":"22.23.1","dependencies":{"lit":"^3.3.0","lexical":"^0.21.0","@dojo-ng/i18n":"^0.1.0","@dojo-ng/popup":"^0.1.0","@lexical/utils":"^0.21.0","@dojo-ng/button":"^0.1.0","@lexical/markdown":"^0.21.0","@dojo-ng/rich-text":"^0.1.0","@dojo-ng/text-area":"^0.1.0","@dojo-ng/popup-confirmation":"^0.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/rich-text-criticmarkup_0.1.0_1789131926266_0.0033328056380994564","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@dojo-ng/rich-text-criticmarkup","version":"0.1.1","license":"BSD-3-Clause","_id":"@dojo-ng/rich-text-criticmarkup@0.1.1","maintainers":[{"name":"saysomething","email":"joshs@holmescorp.com"},{"name":"bitranch","email":"bill@bitranch.com"},{"name":"jepe","email":"jeffreyp@holmescorp.com"}],"dist":{"shasum":"de08a1273f2c124d70bad483d23171f5c4162cc0","tarball":"https://registry.npmjs.org/@dojo-ng/rich-text-criticmarkup/-/rich-text-criticmarkup-0.1.1.tgz","fileCount":23,"integrity":"sha512-WCwzffKs6tqnK3Ja8YDDnAz9FSuoWHvfE5NIJazAktf9luqvSUsObGPTIGvbZB3AQcgnsvL+XX83m+XSK4lt2Q==","signatures":[{"sig":"MEQCICjk+Z4HachepMNYH6wQ/rBWjoIXcLGq057NqsZ4sJ8qAiAfsdLwtcEVymGWyQpR+khi8yJ9PEWQLz5+dx44dVAOzg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDoEYcA844XdbIFJt1dFFar+LcdUgpk8ZUItfUI91+rDwIhAO5u+ztRw09MWsJtsLjdfBAtQ4IlfN6Q9bj5j1ynglr7","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":145060},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist"},"_npmUser":{"name":"bitranch","email":"bill@bitranch.com"},"_npmVersion":"10.9.8","description":"CriticMarkup tracked-changes plugin for @dojo-ng/rich-text","directories":{},"_nodeVersion":"22.23.1","dependencies":{"lit":"^3.3.0","lexical":"^0.21.0","@dojo-ng/i18n":"^0.1.0","@dojo-ng/popup":"^0.1.0","@lexical/utils":"^0.21.0","@dojo-ng/button":"^0.1.0","@lexical/markdown":"^0.21.0","@dojo-ng/rich-text":"^0.1.0","@dojo-ng/text-area":"^0.1.0","@dojo-ng/popup-confirmation":"^0.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/rich-text-criticmarkup_0.1.1_1789563391049_0.9668377960615167","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@dojo-ng/rich-text-criticmarkup","version":"0.1.2","license":"BSD-3-Clause","_id":"@dojo-ng/rich-text-criticmarkup@0.1.2","maintainers":[{"name":"saysomething","email":"joshs@holmescorp.com"},{"name":"bitranch","email":"bill@bitranch.com"},{"name":"jepe","email":"jeffreyp@holmescorp.com"}],"dist":{"shasum":"1b552df1493bea091dab5fc4c971bdb81ad5909e","tarball":"https://registry.npmjs.org/@dojo-ng/rich-text-criticmarkup/-/rich-text-criticmarkup-0.1.2.tgz","fileCount":23,"integrity":"sha512-fdKyyHOjQBMS0MRcPTR7IDUSQJVGLK0P5Du1vIZYgUd5+VXIj5Y/QdKGcVAWoH49B3kr2WJ8b2RAqM+LVgivuw==","signatures":[{"sig":"MEUCIFespAR1KPU0Fopma7qJaPvSFkyGqQ6iHRgacRs06Nl4AiEAvIBjB/q5ghXIkxmKZhUZmpGzLGQ+il706AbusMt0mBM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIBII1TdN7pKc7VVGMwMBVSCmToEVOmLwX36YMKfDvm8DAiBfqNL/W/udYPncrypJKGjj58LnlLQPZGpKrj1bVtjtiA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":168880},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist"},"_npmUser":{"name":"bitranch","email":"bill@bitranch.com"},"_npmVersion":"10.9.8","description":"CriticMarkup tracked-changes plugin for @dojo-ng/rich-text","directories":{},"_nodeVersion":"22.23.1","dependencies":{"lit":"^3.3.0","lexical":"^0.21.0","@dojo-ng/i18n":"^0.1.0","@dojo-ng/popup":"^0.1.0","@lexical/utils":"^0.21.0","@dojo-ng/button":"^0.1.0","@lexical/markdown":"^0.21.0","@dojo-ng/rich-text":"^0.1.2","@dojo-ng/text-area":"^0.1.0","@dojo-ng/popup-confirmation":"^0.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/rich-text-criticmarkup_0.1.2_1790864673757_0.564568966335415","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"_id":"@dojo-ng/rich-text-criticmarkup@0.1.3","dist":{"shasum":"09cb59369705dc87ed16db128f0e131f72a7f647","tarball":"https://registry.npmjs.org/@dojo-ng/rich-text-criticmarkup/-/rich-text-criticmarkup-0.1.3.tgz","fileCount":23,"integrity":"sha512-srV1l+KiEZC3lalRRoBJmGtk1YsbPB8zNkQGOCn8rOk6KiY59Krlh6Dl0sf+SgCezUer20eusODR4RG6Dks87Q==","signatures":[{"sig":"MEUCIQCItgW56bcqK85SgpLNXKzdyxXdLesm1dCp356wZaszCwIgXb1mwsf7BaUGvpYFK4sdGHb3gnw0CVIvAj1PF7gKk7A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGrQ/q4M3wjQhGQh6o57TevlBJ0woOCqXVNzyXkSM/pBAiEAxyElUYO1E3GLkEqdVR/vKd9IGDJq6CszNSWT51JmbR0="}],"unpackedSize":168192},"main":"./dist/index.js","name":"@dojo-ng/rich-text-criticmarkup","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","license":"BSD-3-Clause","scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist"},"version":"0.1.3","_npmUser":{"name":"bitranch","email":"bill@bitranch.com"},"_npmVersion":"10.9.8","description":"CriticMarkup tracked-changes plugin for @dojo-ng/rich-text","directories":{},"maintainers":[{"name":"saysomething","email":"joshs@holmescorp.com"},{"name":"bitranch","email":"bill@bitranch.com"},{"name":"jepe","email":"jeffreyp@holmescorp.com"}],"_nodeVersion":"22.23.1","dependencies":{"lit":"^3.3.0","lexical":"^0.21.0","@dojo-ng/i18n":"^0.1.1","@dojo-ng/popup":"^0.1.1","@lexical/utils":"^0.21.0","@dojo-ng/button":"^0.1.2","@lexical/markdown":"^0.21.0","@dojo-ng/rich-text":"^0.1.3","@dojo-ng/text-area":"^0.1.1","@dojo-ng/popup-confirmation":"^0.1.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rich-text-criticmarkup_0.1.3_1791166863835_0.43210666070737225"}}},"time":{"created":"2026-09-11T13:05:25.906Z","modified":"2026-10-05T02:21:04.116Z","0.1.0":"2026-09-11T13:05:26.409Z","0.1.1":"2026-09-16T12:56:31.161Z","0.1.2":"2026-10-01T14:24:34.083Z","0.1.3":"2026-10-05T02:21:03.930Z"},"license":"BSD-3-Clause","description":"CriticMarkup tracked-changes plugin for @dojo-ng/rich-text","maintainers":[{"name":"saysomething","email":"joshs@holmescorp.com"},{"name":"bitranch","email":"bill@bitranch.com"},{"name":"jepe","email":"jeffreyp@holmescorp.com"}],"readme":"# @dojo-ng/rich-text-criticmarkup\n\nTrack changes for `<dj-rich-text>` in CriticMarkup, a plain-text convention for suggested edits and comments.\n\nPart of [Dojo NG](../../README.md), a framework-agnostic web component library. BSD-3-Clause.\n\n## Install\n\n```bash\nnpm install @dojo-ng/rich-text-criticmarkup\n```\n\n## Usage\n\nCompose the plugin with the default set, starting in suggestion mode: typed/deleted text is wrapped as marks instead of applied directly.\n\n```html\n<dj-rich-text id=\"editor\" label=\"Draft\"></dj-rich-text>\n<script type=\"module\">\n  import \"@dojo-ng/rich-text\";\n  import { defaultPlugins } from \"@dojo-ng/rich-text\";\n  import { createCriticMarkupPlugin } from \"@dojo-ng/rich-text-criticmarkup\";\n  const el = document.getElementById(\"editor\");\n  el.plugins = [...defaultPlugins, createCriticMarkupPlugin({ suggesting: true })];\n  el.value = \"The quick brown fox.\";\n</script>\n```\n\n## The five marks\n\n- `{++inserted++}` and `{--deleted--}`.\n- `{~~old~>new~~}`, a substitution. It is imported as a deletion followed by an insertion, and accepted or declined as that pair, never one half alone.\n- `{>>comment<<}`, on its own or attached right after a highlight.\n- `{==highlighted==}`, a note on the text. It is kept on both accept and decline.\n\n## Suggestion mode\n\n- Turn it on with `setSuggestionMode(editor, true)`, or start with `createCriticMarkupPlugin({ suggesting: true })`. Typed and deleted text then becomes marks instead of changing the text directly.\n- Resolve one mark with `markAtSelection`, `acceptMark`, and `declineMark`, or the whole document with `acceptAllMarks` and `declineAllMarks`.\n- A comment on its own stays either way. A highlight's attached comment goes with the highlight.\n\n## Comments\n\n- `insertComment(editor, text)` adds a comment at a collapsed caret, or highlights a selection and attaches the comment to it. `editComment` changes a comment.\n- `removeComment` removes only the comment and keeps the highlight; `removeHighlight` removes both.\n- A comment cannot contain `<<}` or `{>>`, because either would break the mark the next time the text is read. `isValidCommentText` checks this, and an invalid comment is refused with a message that names the problem.\n\n## Splitting and joining paragraphs\n\n- A paragraph split or join suggested in suggestion mode is stored as a `¶` token inside a one-line mark, not as a real line break, so it survives Markdown import.\n- The `structuralEdits` option (default `\"mark\"`) controls this. `\"annotate\"` makes the edit without tracking it and leaves a comment at the boundary, `\"block\"` refuses the edit, and `\"apply\"` makes it silently.\n- The `¶` token is an extension, not standard CriticMarkup: other tools show it as a literal `¶`. Call `toPortableCriticMarkup(value)` before handing a document to another tool. It splits a multi-paragraph mark into one mark per paragraph, which can leave a blank line behind on decline. Or set `structuralEdits: \"annotate\"` so the token is never written.\n- A `¶` that the author types is written doubled (`¶¶`) so it stays a character.\n\n## Nested marks\n\n- A mark inside another mark is refused as its own node instead of being garbled. It is kept as literal text, and `dj-criticmarkup-refused` fires.\n\n## Formats\n\n- The plugin adds its own `criticmarkup` format (`format=\"criticmarkup\"`), so it works without the Markdown plugin.\n- To read CriticMarkup inside `@dojo-ng/rich-text-markdown`'s format, add `criticMarkupTransformers` to its transformer set.\n\n## Without an editor\n\n- The grammar functions (`parseMarks`, `accept`, `decline`, `acceptAll`, `declineAll`, `stripComments`, and the token functions) are plain string functions with no Lexical import. Use them in a build step, on a server, or in a command-line tool.\n- `fixtures/conformance.json` is included, so a port to another language can run the same test cases.\n\n## Setup\n\n- Setting `plugins` replaces the default set, so spread `...defaultPlugins` to keep bold, italic, underline, undo, and redo.\n\n## Examples\n\n### Resolve CriticMarkup with no editor\n\nThe grammar is a plain string API — parse and resolve marks from a server, a build step, or a CLI, with no Lexical/DOM dependency at all.\n\n```js\nimport { parseMarks, acceptAll, declineAll } from \"@dojo-ng/rich-text-criticmarkup\";\n\nconst draft = \"The {--old--}{++new++} plan is set.\";\nacceptAll(draft);                        // \"The new plan is set.\"\ndeclineAll(draft);                       // \"The old plan is set.\"\nparseMarks(draft).map((m) => m.kind);    // [\"deletion\", \"insertion\"]\n```\n","readmeFilename":"README.md"}