{"id":22489307,"url":"https://github.com/atlassian/prosemirror-utils","last_synced_at":"2026-01-14T03:40:15.219Z","repository":{"id":40444104,"uuid":"123996637","full_name":"atlassian/prosemirror-utils","owner":"atlassian","description":"⚒ Utils library for ProseMirror","archived":false,"fork":false,"pushed_at":"2024-05-13T04:00:16.000Z","size":1133,"stargazers_count":517,"open_issues_count":3,"forks_count":60,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-12-30T05:07:37.039Z","etag":null,"topics":["helpers","prosemirror","prosemirror-utils","utils"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atlassian.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-06T00:26:55.000Z","updated_at":"2025-12-08T17:59:19.000Z","dependencies_parsed_at":"2024-05-13T04:49:24.122Z","dependency_job_id":null,"html_url":"https://github.com/atlassian/prosemirror-utils","commit_stats":{"total_commits":183,"total_committers":12,"mean_commits":15.25,"dds":"0.23497267759562845","last_synced_commit":"1b97ff08f1bbaea781f205744588a3dfd228b0d1"},"previous_names":["eshvedai/prosemirror-utils"],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/atlassian/prosemirror-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atlassian%2Fprosemirror-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atlassian%2Fprosemirror-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atlassian%2Fprosemirror-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atlassian%2Fprosemirror-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atlassian","download_url":"https://codeload.github.com/atlassian/prosemirror-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atlassian%2Fprosemirror-utils/sbom","scorecard":{"id":214778,"data":{"date":"2025-08-11","repo":{"name":"github.com/atlassian/prosemirror-utils","commit":"d34dac47b291da9a8a74aeca25ef57b0450fd133"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.1,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":1,"reason":"9 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T01:27:02.699Z","repository_id":40444104,"created_at":"2025-08-17T01:27:02.699Z","updated_at":"2025-08-17T01:27:02.699Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["helpers","prosemirror","prosemirror-utils","utils"],"created_at":"2024-12-06T17:19:36.207Z","updated_at":"2026-01-14T03:40:15.195Z","avatar_url":"https://github.com/atlassian.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Community modules"],"sub_categories":[],"readme":"# Utils library for ProseMirror\n\n[![npm](https://img.shields.io/npm/v/prosemirror-utils.svg?style=flat-square)](https://www.npmjs.com/package/prosemirror-utils)\n[![License](https://img.shields.io/npm/l/prosemirror-utils.svg?style=flat-square)](http://www.apache.org/licenses/LICENSE-2.0)\n[![Github Issues](https://img.shields.io/github/issues/atlassian/prosemirror-utils.svg?style=flat-square)](https://github.com/atlassian/prosemirror-utils/issues)\n[![CircleCI](https://img.shields.io/circleci/project/github/atlassian/prosemirror-utils.svg?style=flat-square)](https://circleci.com/gh/atlassian/prosemirror-utils)\n[![codecov](https://codecov.io/gh/atlassian/prosemirror-utils/branch/master/graph/badge.svg)](https://codecov.io/gh/atlassian/prosemirror-utils)\n[![Downloads](https://img.shields.io/npm/dw/prosemirror-utils.svg?style=flat-square)](https://www.npmjs.com/package/prosemirror-utils)\n[![Code size](https://img.shields.io/github/languages/code-size/atlassian/prosemirror-utils.svg?style=flat-square)](https://www.npmjs.com/package/prosemirror-utils)\n\n\n## How to\n\n### Test\n\n```sh\nnpm run test\n```\n\n### Build\n\n```sh\nnpm run build_all\n```\n\n## Quick Start\n\nInstall `prosemirror-utils` package from npm:\n\n```sh\nnpm install prosemirror-utils\n```\n\n## Public API documentation\n\n### Utils for working with `selection`\n\n * **`findParentNode`**`(predicate: fn(node: ProseMirrorNode) → boolean) → fn(selection: Selection) → ?{pos: number, start: number, depth: number, node: ProseMirrorNode}`\\\n   Iterates over parent nodes, returning the closest node and its start position `predicate` returns truthy for. `start` points to the start position of the node, `pos` points directly before the node.\n\n   ```javascript\n   const predicate = node =\u003e node.type === schema.nodes.blockquote;\n   const parent = findParentNode(predicate)(selection);\n   ```\n\n\n * **`findParentNodeClosestToPos`**`($pos: ResolvedPos, predicate: fn(node: ProseMirrorNode) → boolean) → ?{pos: number, start: number, depth: number, node: ProseMirrorNode}`\\\n   Iterates over parent nodes starting from the given `$pos`, returning the closest node and its start position `predicate` returns truthy for. `start` points to the start position of the node, `pos` points directly before the node.\n\n   ```javascript\n   const predicate = node =\u003e node.type === schema.nodes.blockquote;\n   const parent = findParentNodeClosestToPos(state.doc.resolve(5), predicate);\n   ```\n\n\n * **`findParentDomRef`**`(predicate: fn(node: ProseMirrorNode) → boolean, domAtPos: fn(pos: number) → {node: dom.Node, offset: number}) → fn(selection: Selection) → ?dom.Node`\\\n   Iterates over parent nodes, returning DOM reference of the closest node `predicate` returns truthy for.\n\n   ```javascript\n   const domAtPos = view.domAtPos.bind(view);\n   const predicate = node =\u003e node.type === schema.nodes.table;\n   const parent = findParentDomRef(predicate, domAtPos)(selection); // \u003ctable\u003e\n   ```\n\n\n * **`hasParentNode`**`(predicate: fn(node: ProseMirrorNode) → boolean) → fn(selection: Selection) → boolean`\\\n   Checks if there's a parent node `predicate` returns truthy for.\n\n   ```javascript\n   if (hasParentNode(node =\u003e node.type === schema.nodes.table)(selection)) {\n     // ....\n   }\n   ```\n\n\n * **`findParentNodeOfType`**`(nodeType: NodeType | [NodeType]) → fn(selection: Selection) → ?{pos: number, start: number, depth: number, node: ProseMirrorNode}`\\\n   Iterates over parent nodes, returning closest node of a given `nodeType`. `start` points to the start position of the node, `pos` points directly before the node.\n\n   ```javascript\n   const parent = findParentNodeOfType(schema.nodes.paragraph)(selection);\n   ```\n\n\n * **`findParentNodeOfTypeClosestToPos`**`($pos: ResolvedPos, nodeType: NodeType | [NodeType]) → ?{pos: number, start: number, depth: number, node: ProseMirrorNode}`\\\n   Iterates over parent nodes starting from the given `$pos`, returning closest node of a given `nodeType`. `start` points to the start position of the node, `pos` points directly before the node.\n\n   ```javascript\n   const parent = findParentNodeOfTypeClosestToPos(state.doc.resolve(10), schema.nodes.paragraph);\n   ```\n\n\n * **`hasParentNodeOfType`**`(nodeType: NodeType | [NodeType]) → fn(selection: Selection) → boolean`\\\n   Checks if there's a parent node of a given `nodeType`.\n\n   ```javascript\n   if (hasParentNodeOfType(schema.nodes.table)(selection)) {\n     // ....\n   }\n   ```\n\n\n * **`findParentDomRefOfType`**`(nodeType: NodeType | [NodeType], domAtPos: fn(pos: number) → {node: dom.Node, offset: number}) → fn(selection: Selection) → ?dom.Node`\\\n   Iterates over parent nodes, returning DOM reference of the closest node of a given `nodeType`.\n\n   ```javascript\n   const domAtPos = view.domAtPos.bind(view);\n   const parent = findParentDomRefOfType(schema.nodes.codeBlock, domAtPos)(selection); // \u003cpre\u003e\n   ```\n\n\n * **`findSelectedNodeOfType`**`(nodeType: NodeType | [NodeType]) → fn(selection: Selection) → ?{pos: number, start: number, depth: number, node: ProseMirrorNode}`\\\n   Returns a node of a given `nodeType` if it is selected. `start` points to the start position of the node, `pos` points directly before the node.\n\n   ```javascript\n   const { extension, inlineExtension, bodiedExtension } = schema.nodes;\n   const selectedNode = findSelectedNodeOfType([\n     extension,\n     inlineExtension,\n     bodiedExtension,\n   ])(selection);\n   ```\n\n\n * **`isNodeSelection`**`(selection: Selection) → boolean`\\\n   Checks if current selection is a `NodeSelection`.\n\n   ```javascript\n   if (isNodeSelection(tr.selection)) {\n     // ...\n   }\n   ```\n\n\n * **`findPositionOfNodeBefore`**`(selection: Selection) → ?number`\\\n   Returns position of the previous node.\n\n   ```javascript\n   const pos = findPositionOfNodeBefore(tr.selection);\n   ```\n\n\n * **`findDomRefAtPos`**`(position: number, domAtPos: fn(pos: number) → {node: dom.Node, offset: number}) → dom.Node`\\\n   Returns DOM reference of a node at a given `position`. If the node type is of type `TEXT_NODE` it will return the reference of the parent node.\n\n   ```javascript\n   const domAtPos = view.domAtPos.bind(view);\n   const ref = findDomRefAtPos($from.pos, domAtPos);\n   ```\n\n\n### Utils for working with ProseMirror `node`\n\n * **`flatten`**`(node: ProseMirrorNode, descend: ?boolean = true) → [{node: ProseMirrorNode, pos: number}]`\\\n   Flattens descendants of a given `node`. It doesn't descend into a node when descend argument is `false` (defaults to `true`).\n\n   ```javascript\n   const children = flatten(node);\n   ```\n\n\n * **`findChildren`**`(node: ProseMirrorNode, predicate: fn(node: ProseMirrorNode) → boolean, descend: ?boolean) → [{node: ProseMirrorNode, pos: number}]`\\\n   Iterates over descendants of a given `node`, returning child nodes predicate returns truthy for. It doesn't descend into a node when descend argument is `false` (defaults to `true`).\n\n   ```javascript\n   const textNodes = findChildren(node, child =\u003e child.isText, false);\n   ```\n\n\n * **`findTextNodes`**`(node: ProseMirrorNode, descend: ?boolean) → [{node: ProseMirrorNode, pos: number}]`\\\n   Returns text nodes of a given `node`. It doesn't descend into a node when descend argument is `false` (defaults to `true`).\n\n   ```javascript\n   const textNodes = findTextNodes(node);\n   ```\n\n\n * **`findInlineNodes`**`(node: ProseMirrorNode, descend: ?boolean) → [{node: ProseMirrorNode, pos: number}]`\\\n   Returns inline nodes of a given `node`. It doesn't descend into a node when descend argument is `false` (defaults to `true`).\n\n   ```javascript\n   const inlineNodes = findInlineNodes(node);\n   ```\n\n\n * **`findBlockNodes`**`(node: ProseMirrorNode, descend: ?boolean) → [{node: ProseMirrorNode, pos: number}]`\\\n   Returns block descendants of a given `node`. It doesn't descend into a node when descend argument is `false` (defaults to `true`).\n\n   ```javascript\n   const blockNodes = findBlockNodes(node);\n   ```\n\n\n * **`findChildrenByAttr`**`(node: ProseMirrorNode, predicate: fn(attrs: ?Object) → boolean, descend: ?boolean) → [{node: ProseMirrorNode, pos: number}]`\\\n   Iterates over descendants of a given `node`, returning child nodes predicate returns truthy for. It doesn't descend into a node when descend argument is `false` (defaults to `true`).\n\n   ```javascript\n   const mergedCells = findChildrenByAttr(table, attrs =\u003e attrs.colspan === 2);\n   ```\n\n\n * **`findChildrenByType`**`(node: ProseMirrorNode, nodeType: NodeType, descend: ?boolean) → [{node: ProseMirrorNode, pos: number}]`\\\n   Iterates over descendants of a given `node`, returning child nodes of a given nodeType. It doesn't descend into a node when descend argument is `false` (defaults to `true`).\n\n   ```javascript\n   const cells = findChildrenByType(table, schema.nodes.tableCell);\n   ```\n\n\n * **`findChildrenByMark`**`(node: ProseMirrorNode, markType: markType, descend: ?boolean) → [{node: ProseMirrorNode, pos: number}]`\\\n   Iterates over descendants of a given `node`, returning child nodes that have a mark of a given markType. It doesn't descend into a `node` when descend argument is `false` (defaults to `true`).\n\n   ```javascript\n   const nodes = findChildrenByMark(state.doc, schema.marks.strong);\n   ```\n\n\n * **`contains`**`(node: ProseMirrorNode, nodeType: NodeType) → boolean`\\\n   Returns `true` if a given node contains nodes of a given `nodeType`\n\n   ```javascript\n   if (contains(panel, schema.nodes.listItem)) {\n     // ...\n   }\n   ```\n\n\n### Utils for document transformation\n\n * **`removeParentNodeOfType`**`(nodeType: NodeType | [NodeType]) → fn(tr: Transaction) → Transaction`\\\n   Returns a new transaction that removes a node of a given `nodeType`. It will return an original transaction if parent node hasn't been found.\n\n   ```javascript\n   dispatch(\n     removeParentNodeOfType(schema.nodes.table)(tr)\n   );\n   ```\n\n\n * **`replaceParentNodeOfType`**`(nodeType: NodeType | [NodeType], content: ProseMirrorNode | Fragment) → fn(tr: Transaction) → Transaction`\\\n   Returns a new transaction that replaces parent node of a given `nodeType` with the given `content`. It will return an original transaction if either parent node hasn't been found or replacing is not possible.\n\n   ```javascript\n   const node = schema.nodes.paragraph.createChecked({}, schema.text('new'));\n\n   dispatch(\n    replaceParentNodeOfType(schema.nodes.table, node)(tr)\n   );\n   ```\n\n\n * **`removeSelectedNode`**`(tr: Transaction) → Transaction`\\\n   Returns a new transaction that removes selected node. It will return an original transaction if current selection is not a `NodeSelection`.\n\n   ```javascript\n   dispatch(\n     removeSelectedNode(tr)\n   );\n   ```\n\n\n * **`replaceSelectedNode`**`(content: ProseMirrorNode | ProseMirrorFragment) → fn(tr: Transaction) → Transaction`\\\n   Returns a new transaction that replaces selected node with a given `node`, keeping NodeSelection on the new `node`.\n   It will return the original transaction if either current selection is not a NodeSelection or replacing is not possible.\n\n   ```javascript\n   const node = schema.nodes.paragraph.createChecked({}, schema.text('new'));\n   dispatch(\n     replaceSelectedNode(node)(tr)\n   );\n   ```\n\n\n * **`canInsert`**`($pos: ResolvedPos, content: ProseMirrorNode | Fragment) → boolean`\\\n   Checks if a given `content` can be inserted at the given `$pos`\n\n   ```javascript\n   const { selection: { $from } } = state;\n   const node = state.schema.nodes.atom.createChecked();\n   if (canInsert($from, node)) {\n     // ...\n   }\n   ```\n\n\n * **`safeInsert`**`(content: ProseMirrorNode | Fragment, position: ?number, tryToReplace: ?boolean) → fn(tr: Transaction) → Transaction`\\\n   Returns a new transaction that inserts a given `content` at the current cursor position, or at a given `position`, if it is allowed by schema. If schema restricts such nesting, it will try to find an appropriate place for a given node in the document, looping through parent nodes up until the root document node.\n   If `tryToReplace` is true and current selection is a NodeSelection, it will replace selected node with inserted content if its allowed by schema.\n   If cursor is inside of an empty paragraph, it will try to replace that paragraph with the given content. If insertion is successful and inserted node has content, it will set cursor inside of that content.\n   It will return an original transaction if the place for insertion hasn't been found.\n\n   ```javascript\n   const node = schema.nodes.extension.createChecked({});\n   dispatch(\n     safeInsert(node)(tr)\n   );\n   ```\n\n\n * **`setParentNodeMarkup`**`(nodeType: NodeType | [NodeType], type: ?NodeType | null, attrs: ?Object | null, marks: ?[Mark]) → fn(tr: Transaction) → Transaction`\\\n   Returns a transaction that changes the type, attributes, and/or marks of the parent node of a given `nodeType`.\n\n   ```javascript\n   const node = schema.nodes.extension.createChecked({});\n   dispatch(\n     setParentNodeMarkup(schema.nodes.panel, null, { panelType })(tr);\n   );\n   ```\n\n\n * **`selectParentNodeOfType`**`(nodeType: NodeType | [NodeType]) → fn(tr: Transaction) → Transaction`\\\n   Returns a new transaction that sets a `NodeSelection` on a parent node of a `given nodeType`.\n\n   ```javascript\n   dispatch(\n     selectParentNodeOfType([tableCell, tableHeader])(state.tr)\n   );\n   ```\n\n\n * **`removeNodeBefore`**`(tr: Transaction) → Transaction`\\\n   Returns a new transaction that deletes previous node.\n\n   ```javascript\n   dispatch(\n     removeNodeBefore(state.tr)\n   );\n   ```\n\n\n * **`setTextSelection`**`(position: number, dir: ?number = 1) → fn(tr: Transaction) → Transaction`\\\n   Returns a new transaction that tries to find a valid cursor selection starting at the given `position`\n   and searching back if `dir` is negative, and forward if positive.\n   If a valid cursor position hasn't been found, it will return the original transaction.\n\n   ```javascript\n   dispatch(\n     setTextSelection(5)(tr)\n   );\n   ```\n\n\n## License\n\n- **Apache 2.0** : http://www.apache.org/licenses/LICENSE-2.0\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatlassian%2Fprosemirror-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatlassian%2Fprosemirror-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatlassian%2Fprosemirror-utils/lists"}