{"_id":"@atjson/peritext","_rev":"19-81711dc959565df131898b78b6c9db98","name":"@atjson/peritext","dist-tags":{"gdocs-paste-extensions":"0.2.2-gdocs-paste-extensions.11","latest":"0.3.0"},"versions":{"0.2.0":{"name":"@atjson/peritext","version":"0.2.0","license":"Apache-2.0","_id":"@atjson/peritext@0.2.0","maintainers":[{"name":"anurag-cn","email":"anurag_kumar@condenast.com"},{"name":"tce","email":"tim.c.evans@me.com"},{"name":"igostu","email":"indrani_gostu@condenast.com"},{"name":"bbui","email":"bachjbui@gmail.com"},{"name":"gmedina","email":"gus.a.medina@gmail.com"},{"name":"dkorenblyum","email":"dkorenblyum@gmail.com"},{"name":"varun9110","email":"varun.goel.vg@gmail.com"},{"name":"nayeemrehman","email":"neaim_rehman@condenast.com"},{"name":"copilot-robot","email":"copilot@condenast.com"},{"name":"andrealandonio","email":"landonio.andrea@gmail.com"}],"dist":{"shasum":"a939ccacab1139145b2d26b8684fdeee3892f711","tarball":"https://registry.npmjs.org/@atjson/peritext/-/peritext-0.2.0.tgz","fileCount":16,"integrity":"sha512-dq2VNM3hUHQ2lUjs1Fy7teAbLIIGdqhC7l/3vkrMgK8AoByWki5nTAvNqK9B0EF2Rh3g7on7LjOqmE6Q16dKPQ==","signatures":[{"sig":"MEQCIA7KpdoBbIX4A12Ft34APZcD84hLDVe2KwLL17gmdfZ7AiBnBOukLQG5amYS4J9Ap3eRKeHof6FaxA34nej/xuR+zw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":239038},"main":"dist/commonjs/index.js","types":"dist/commonjs/index.d.ts","module":"dist/modules/index.js","gitHead":"f88e3844ef1c6b58d76cae89ef9ebceee290eb77","_npmUser":{"name":"copilot-robot","email":"copilot@condenast.com"},"_npmVersion":"lerna/6.6.2/node@v20.11.1+x64 (linux)","description":"Functions for building and transforming peritext documents","directories":{},"_nodeVersion":"20.11.1","dependencies":{"uuid-random":"^1.3.0","@atjson/util":"0.2.6","@atjson/document":"0.30.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/peritext_0.2.0_1733435105182_0.9807408816134884","host":"s3://npm-registry-packages"}},"0.2.1":{"name":"@atjson/peritext","version":"0.2.1","license":"Apache-2.0","_id":"@atjson/peritext@0.2.1","maintainers":[{"name":"anurag-cn","email":"anurag_kumar@condenast.com"},{"name":"tce","email":"tim.c.evans@me.com"},{"name":"igostu","email":"indrani_gostu@condenast.com"},{"name":"bbui","email":"bachjbui@gmail.com"},{"name":"gmedina","email":"gus.a.medina@gmail.com"},{"name":"dkorenblyum","email":"dkorenblyum@gmail.com"},{"name":"varun9110","email":"varun.goel.vg@gmail.com"},{"name":"nayeemrehman","email":"neaim_rehman@condenast.com"},{"name":"copilot-robot","email":"copilot@condenast.com"},{"name":"andrealandonio","email":"landonio.andrea@gmail.com"}],"dist":{"shasum":"388b09259b763dcb37db203f9db126bca2608b8c","tarball":"https://registry.npmjs.org/@atjson/peritext/-/peritext-0.2.1.tgz","fileCount":16,"integrity":"sha512-mdxf8FDb5sK4hQPhCt/JrVuNgePUxOOKWxgvNl+u3cEdwU9d06+R0eiKjIhYSuxYtjDOWiMlS3j1yHUZuir6LQ==","signatures":[{"sig":"MEYCIQCkainIWVyRef8lZ8nmE/cbZ7nMbqlDl+IHM56oi+NPeQIhAJxXJS2UV/UmvV1SM/7iTfjloV/XbfpuYdWa0/bb/goS","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":248985},"main":"dist/commonjs/index.js","types":"dist/commonjs/index.d.ts","module":"dist/modules/index.js","gitHead":"469aa9b2873dcea46dbf53e50ab58003626f37b3","_npmUser":{"name":"copilot-robot","email":"copilot@condenast.com"},"_npmVersion":"lerna/6.6.2/node@v20.11.1+x64 (linux)","description":"Functions for building and transforming peritext documents","directories":{},"_nodeVersion":"20.11.1","dependencies":{"uuid-random":"^1.3.0","@atjson/util":"0.2.6","@atjson/document":"0.30.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/peritext_0.2.1_1738787439916_0.2193542732726299","host":"s3://npm-registry-packages-npm-production"}},"0.2.2-gdocs-paste-extensions.11":{"name":"@atjson/peritext","version":"0.2.2-gdocs-paste-extensions.11","license":"Apache-2.0","_id":"@atjson/peritext@0.2.2-gdocs-paste-extensions.11","maintainers":[{"name":"anurag-cn","email":"anurag_kumar@condenast.com"},{"name":"tce","email":"tim.c.evans@me.com"},{"name":"igostu","email":"indrani_gostu@condenast.com"},{"name":"bbui","email":"bachjbui@gmail.com"},{"name":"gmedina","email":"gus.a.medina@gmail.com"},{"name":"dkorenblyum","email":"dkorenblyum@gmail.com"},{"name":"varun9110","email":"varun.goel.vg@gmail.com"},{"name":"nayeemrehman","email":"neaim_rehman@condenast.com"},{"name":"copilot-robot","email":"copilot@condenast.com"},{"name":"andrealandonio","email":"landonio.andrea@gmail.com"}],"dist":{"shasum":"1b0ecfc429bc0599f09da6cbf51872e42bfb9152","tarball":"https://registry.npmjs.org/@atjson/peritext/-/peritext-0.2.2-gdocs-paste-extensions.11.tgz","fileCount":16,"integrity":"sha512-06bMAA1Cg8nLQn9XLfVTneZA2YNqsWe3Ei2dUxWk1oiWVyx0+I07jH5a0Fjq3Nn6U77Xu/qIYD35/5FUIcaFRQ==","signatures":[{"sig":"MEYCIQDcTnguOHGlOOXXBPmTaeW0CrhPiHW2/xsi1z5kWVMEzQIhALm8risaIQWdNmx1rnZRnhdTM+a9XvCco/eneOKb/S1q","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":249055},"main":"dist/commonjs/index.js","types":"dist/commonjs/index.d.ts","module":"dist/modules/index.js","gitHead":"450902232dba99ca5a48e85199691b680e7e320d","_npmUser":{"name":"copilot-robot","email":"copilot@condenast.com"},"_npmVersion":"lerna/6.6.2/node@v20.11.1+x64 (linux)","description":"Functions for building and transforming peritext documents","directories":{},"_nodeVersion":"20.11.1","dependencies":{"uuid-random":"^1.3.0","@atjson/util":"0.2.6","@atjson/document":"0.30.4-gdocs-paste-extensions.11+45090223"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/peritext_0.2.2-gdocs-paste-extensions.11_1738864406435_0.49149255322768814","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@atjson/peritext","version":"0.2.2","license":"Apache-2.0","_id":"@atjson/peritext@0.2.2","maintainers":[{"name":"anurag-cn","email":"anurag_kumar@condenast.com"},{"name":"tce","email":"tim.c.evans@me.com"},{"name":"igostu","email":"indrani_gostu@condenast.com"},{"name":"bbui","email":"bachjbui@gmail.com"},{"name":"gmedina","email":"gus.a.medina@gmail.com"},{"name":"dkorenblyum","email":"dkorenblyum@gmail.com"},{"name":"varun9110","email":"varun.goel.vg@gmail.com"},{"name":"nayeemrehman","email":"neaim_rehman@condenast.com"},{"name":"copilot-robot","email":"copilot@condenast.com"},{"name":"andrealandonio","email":"landonio.andrea@gmail.com"}],"dist":{"shasum":"1d69881d7e9e443d74e0f1bad3667f55aee4e0de","tarball":"https://registry.npmjs.org/@atjson/peritext/-/peritext-0.2.2.tgz","fileCount":16,"integrity":"sha512-d0YYHej0DYonRLMl02fKPDAH/9HuM7NLGir49bWKginf0AoqqquHydEtRNiIV3uwEL1jocmJbnPkH35SxSCyQw==","signatures":[{"sig":"MEUCIAtBI98bT99dVvjkYeZEnFMcFsfhrMpB78yZ/9r1LOXTAiEA7mfT1NbECMpVZnyUm5BE0SzUcYqfuZWVgUqURibg1Mc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":249058},"main":"dist/commonjs/index.js","types":"dist/commonjs/index.d.ts","module":"dist/modules/index.js","gitHead":"67447b8a5ad1736a91988a5d3a51cb43b4934288","_npmUser":{"name":"copilot-robot","email":"copilot@condenast.com"},"_npmVersion":"lerna/6.6.2/node@v20.19.1+x64 (linux)","description":"Functions for building and transforming peritext documents","directories":{},"_nodeVersion":"20.19.1","dependencies":{"uuid-random":"^1.3.0","@atjson/util":"0.2.6","@atjson/document":"0.30.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/peritext_0.2.2_1746644012144_0.4084925153945185","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@atjson/peritext","version":"0.2.3","license":"Apache-2.0","_id":"@atjson/peritext@0.2.3","maintainers":[{"name":"anurag-cn","email":"anurag_kumar@condenast.com"},{"name":"tce","email":"tim.c.evans@me.com"},{"name":"igostu","email":"indrani_gostu@condenast.com"},{"name":"bbui","email":"bachjbui@gmail.com"},{"name":"gmedina","email":"gus.a.medina@gmail.com"},{"name":"dkorenblyum","email":"dkorenblyum@gmail.com"},{"name":"varun9110","email":"varun.goel.vg@gmail.com"},{"name":"nayeemrehman","email":"neaim_rehman@condenast.com"},{"name":"copilot-robot","email":"copilot@condenast.com"},{"name":"andrealandonio","email":"landonio.andrea@gmail.com"}],"dist":{"shasum":"64fbec68246dc8e38d1e4834dc774fb957afa72e","tarball":"https://registry.npmjs.org/@atjson/peritext/-/peritext-0.2.3.tgz","fileCount":16,"integrity":"sha512-8h6NyemByAtIpMg4SsGU2PuZoTKXLO4n3Y2SeiuwGw4//HOFrPBbBGJDniJ/MFA7sVbGs5XPZrhTlKbQVuJ7sA==","signatures":[{"sig":"MEUCIQDXvvWuO9ByoA8qBzxviG9YzZFDel03qG2moy5efVCfBgIgZABkLYgYQc7I/5KPXPGkQ1dZRQdyWbv1K2Adha+PnIg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":248912},"main":"dist/commonjs/index.js","types":"dist/commonjs/index.d.ts","module":"dist/modules/index.js","gitHead":"252a1a068b70589b28b174e92bef4550beed9c74","_npmUser":{"name":"copilot-robot","email":"copilot@condenast.com"},"_npmVersion":"lerna/8.2.0/node@v20.19.1+x64 (linux)","description":"Functions for building and transforming peritext documents","directories":{},"_nodeVersion":"20.19.1","dependencies":{"uuid-random":"^1.3.0","@atjson/util":"0.2.6","@atjson/document":"0.30.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/peritext_0.2.3_1749152440375_0.5716715695844263","host":"s3://npm-registry-packages-npm-production"}},"0.2.4":{"name":"@atjson/peritext","version":"0.2.4","license":"Apache-2.0","_id":"@atjson/peritext@0.2.4","maintainers":[{"name":"anurag-cn","email":"anurag_kumar@condenast.com"},{"name":"tce","email":"tim.c.evans@me.com"},{"name":"igostu","email":"indrani_gostu@condenast.com"},{"name":"bbui","email":"bachjbui@gmail.com"},{"name":"gmedina","email":"gus.a.medina@gmail.com"},{"name":"dkorenblyum","email":"dkorenblyum@gmail.com"},{"name":"varun9110","email":"varun.goel.vg@gmail.com"},{"name":"nayeemrehman","email":"neaim_rehman@condenast.com"},{"name":"copilot-robot","email":"copilot@condenast.com"},{"name":"andrealandonio","email":"landonio.andrea@gmail.com"}],"dist":{"shasum":"72b9992060e7bf58995cb940058e6c10fafc4033","tarball":"https://registry.npmjs.org/@atjson/peritext/-/peritext-0.2.4.tgz","fileCount":16,"integrity":"sha512-pOxUbkXyLxmzsJOei3+7g9HQB2FQZe0WMGaNcEQ4aeTQg6+u25OOyhPl/J3H65+jyfJm7Oj7PjNLnrztDlwJGA==","signatures":[{"sig":"MEUCIEV9oxhSDzfr2LjfQa+lXDSeqjFFJ0LASm5Aip7MN1qEAiEAv/2vuc7QWOCvQuEAR5Oh1cgx+vVLXFecrZdgJiofGuU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":328890},"main":"dist/commonjs/index.js","types":"dist/commonjs/index.d.ts","module":"dist/modules/index.js","gitHead":"245457622151d799635186bf57a6baf7ad97259a","_npmUser":{"name":"copilot-robot","email":"copilot@condenast.com"},"_npmVersion":"lerna/8.2.3/node@v20.19.1+x64 (linux)","description":"Functions for building and transforming peritext documents","directories":{},"_nodeVersion":"20.19.1","dependencies":{"uuid-random":"^1.3.0","@atjson/util":"0.2.7","@atjson/document":"0.31.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/peritext_0.2.4_1756312415619_0.037542297670203784","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@atjson/peritext","version":"0.3.0","license":"Apache-2.0","_id":"@atjson/peritext@0.3.0","maintainers":[{"name":"tce","email":"tim.c.evans@me.com"},{"name":"dkorenblyum","email":"dkorenblyum@gmail.com"},{"name":"copilot-robot","email":"copilot@condenast.com"},{"name":"eddleston","email":"paul.eddleston@condenastint.com"}],"homepage":"https://github.com/CondeNast/atjson#readme","bugs":{"url":"https://github.com/CondeNast/atjson/issues"},"dist":{"shasum":"04aa7db9bdc41a397343f8fbb3bfa4d7e2160c2a","tarball":"https://registry.npmjs.org/@atjson/peritext/-/peritext-0.3.0.tgz","fileCount":16,"integrity":"sha512-tcWnmR2nVlkoqltHB5PhKzmVVgrgDjbM/viuPGYOw+h8ppO+jC7KfYShgQxT1NHlbcc0DMGB8qgkmqYqlUADHA==","signatures":[{"sig":"MEUCIEbYYZMe4wme+8Llb2+RgEgr9FAQI/gh0OHeBkSOuov3AiEA+e9TRb9LyeXXQwX+ilYojmTOL/7cSi5qralz/AuGLh0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atjson%2fperitext@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":335822},"main":"dist/commonjs/index.js","types":"dist/commonjs/index.d.ts","module":"dist/modules/index.js","gitHead":"c533aeb1b9c59d0fa03a6c1a3638365ef24e29f0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e2e324a4-b414-467f-9970-9bc56754cefe"}},"repository":{"url":"git+https://github.com/CondeNast/atjson.git","type":"git"},"_npmVersion":"lerna/9.0.7/node@v22.15.0+x64 (linux)","description":"Functions for building and transforming peritext documents","directories":{},"_nodeVersion":"22.15.0","dependencies":{"uuid-random":"^1.3.0","@atjson/util":"0.3.0","@atjson/document":"0.32.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/peritext_0.3.0_1786346795639_0.1554968972449191","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2024-12-05T21:45:05.078Z","modified":"2026-08-10T19:45:09.882Z","0.2.0":"2024-12-05T21:45:05.364Z","0.2.1":"2025-02-05T20:30:40.086Z","0.2.2-gdocs-paste-extensions.11":"2025-02-06T17:53:26.642Z","0.2.2":"2025-05-07T18:53:32.378Z","0.2.3":"2025-06-05T19:40:40.603Z","0.2.4":"2025-08-27T16:33:35.851Z","0.3.0":"2026-08-10T07:26:35.799Z"},"bugs":{"url":"https://github.com/CondeNast/atjson/issues"},"license":"Apache-2.0","homepage":"https://github.com/CondeNast/atjson#readme","repository":{"url":"git+https://github.com/CondeNast/atjson.git","type":"git"},"description":"Functions for building and transforming peritext documents","maintainers":[{"email":"tim.c.evans@me.com","name":"tce"},{"email":"dkorenblyum@gmail.com","name":"dkorenblyum"},{"email":"copilot@condenast.com","name":"copilot-robot"},{"email":"paul.eddleston@condenastint.com","name":"eddleston"},{"email":"nathaniel_laws@condenast.com","name":"natelawscn"}],"readme":"# @atjson/peritext\n\nFunctions for creating and manipulating peritext documents directly. The construction functions `mark`, `block`, and `concat` are useful for creating properly-nested documents of the sort that appear in XML-like structures. Peritext documents can of course in general have structures where marks overlap each other in arbitrary ways, but this library doesn't provide explicit means to do so.\n\nA typical case of creating a document might look like\n\n```typescript\nlet doc = concat(\n  block(Paragraph, { decorations: [\"drop-cap\"] }, \"My introductory paragraph\"),\n  block(HorizontalRule, {}).set(\"selfClosing\", true),\n  block(Paragraph, {}, [\"My\", mark(Italic, {}, \"fancy\"), \"body paragraph\"])\n);\n```\n\n## PeritextBuilderStep\n\nFor convenience, several of the functions in this library (particularly `block`, `mark`, and `slice`) return a `PeritextBuilderStep` instead of just a regular peritext document. A `PeritextBuilderStep` _is_ a peritext document, but when it's created it has an extra value attached to it representing the immediate product of the builder function. This value can be accessed with the `getValue()` method on the `PeritextBuilderStep`:\n\n```typescript\nlet paragraph: PeritextBuilderStep<Block>;\n\nlet doc = block(Div, {}, (paragraph = block(Paragraph, {}, \"Hello!\")));\n\nreturn insertBefore(doc, paragraph.getValue().id, HorizontalRule, {});\n```\n\n## Mutation\n\nAll of the functions that construct and modify documents have the property that they shallowly copy any _peritext documents_ in their arguments, but **directly mutate** any _blocks_ and _marks_ on that document. This potentially-surprising behavior is intentional: this way, one can store the results of intermediate build steps and any such references to marks and blocks in the document will remain accurate after applying further build steps. documents are shallowly-copied in order for the behavior of functions like `concat` (which take multiple document objects and so could only mutate one of them anyway) to be consistent with the behavior of functions like `groupChildren` (which could in principle simply mutate the input document directly)\n","readmeFilename":"README.md"}