{"_id":"@dojo-ng/rich-text-slash","_rev":"2-518ae457a2c4ee59ad746785995958c8","name":"@dojo-ng/rich-text-slash","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@dojo-ng/rich-text-slash","version":"0.1.0","license":"BSD-3-Clause","_id":"@dojo-ng/rich-text-slash@0.1.0","maintainers":[{"name":"saysomething","email":"joshs@holmescorp.com"},{"name":"bitranch","email":"bill@bitranch.com"},{"name":"jepe","email":"jeffreyp@holmescorp.com"}],"dist":{"shasum":"c0c2b614aaa11c22c432a2d2cbe20c964c09bbc2","tarball":"https://registry.npmjs.org/@dojo-ng/rich-text-slash/-/rich-text-slash-0.1.0.tgz","fileCount":6,"integrity":"sha512-UXNPMeVf6oF3p1d0hmt+FecfqS844Yix3jeV9LKo310+0LzYzSNmGqlqiCL+0zg9y45wHLlL925ndTmKIsAgXQ==","signatures":[{"sig":"MEUCIDjlHiYMSxDveODj8Rz42cSdEa5lgC4iI4LLu5+9RTpkAiEAi5nxc7e3GxyacJcjGDXhH8QKXHnEKFpHfcCTzNmehfs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8601},"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":"Slash-command menu plugin for @dojo-ng/rich-text","directories":{},"_nodeVersion":"22.23.1","dependencies":{"lit":"^3.3.0","lexical":"^0.21.0","@dojo-ng/rich-text":"^0.1.0","@dojo-ng/rich-text-menu":"^0.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/rich-text-slash_0.1.0_1788374436881_0.6983225468788743","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"_id":"@dojo-ng/rich-text-slash@0.1.1","dist":{"shasum":"a236e1c4a1f8b8e05e575a79c4f104db22d57ddb","tarball":"https://registry.npmjs.org/@dojo-ng/rich-text-slash/-/rich-text-slash-0.1.1.tgz","fileCount":6,"integrity":"sha512-U7QEkRuuUrotn95R18J9uh468uWAr5fReKj/pdYdOGvRBCnXLCPuvac9KvAm0ZA4R8JeEKD/fy5ryPQ9iK6Tnw==","signatures":[{"sig":"MEUCIASkV1gDypqJS4ehtO4IjnQUEqBbzyGcf2rxMf9HUsI/AiEAoyAcAcJ9sO3lliCTQ48V5YSvVbaINBkRKbBkOTxnFMA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC1QJWrFNh1GWbhAKufM/5T4fDKNMhesudMjFtQ49HRhgIgQ59ado/yGAkz5e5d1Z//Je35OU4ShboQ0SaFDW6ZFgo="}],"unpackedSize":8570},"main":"./dist/index.js","name":"@dojo-ng/rich-text-slash","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.1","_npmUser":{"name":"bitranch","email":"bill@bitranch.com"},"_npmVersion":"10.9.8","description":"Slash-command menu 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/rich-text":"^0.1.3","@dojo-ng/rich-text-menu":"^0.1.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rich-text-slash_0.1.1_1791166886327_0.7834298653490808"}}},"time":{"created":"2026-09-02T18:40:36.728Z","modified":"2026-10-05T02:21:26.615Z","0.1.0":"2026-09-02T18:40:37.018Z","0.1.1":"2026-10-05T02:21:26.424Z"},"license":"BSD-3-Clause","description":"Slash-command menu 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-slash\n\nA `/` command menu for `<dj-rich-text>`: type `/` to insert headings, lists, tables, images, and more.\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-slash\n```\n\n## Usage\n\nCompose the slash plugin with the default set and the node-contributing plugins whose commands you want in the menu. Type `/` to open it; `/h` filters to headings.\n\n```html\n<dj-rich-text id=\"editor\" label=\"Article\"></dj-rich-text>\n<script type=\"module\">\n  import \"@dojo-ng/rich-text\";\n  import { defaultPlugins } from \"@dojo-ng/rich-text\";\n  import { headingsPlugin } from \"@dojo-ng/rich-text-headings\";\n  import { listsPlugin } from \"@dojo-ng/rich-text-lists\";\n  import { imagePlugin } from \"@dojo-ng/rich-text-image\";\n  import { slashPlugin } from \"@dojo-ng/rich-text-slash\";\n  document.getElementById(\"editor\").plugins = [...defaultPlugins, headingsPlugin, listsPlugin, imagePlugin, slashPlugin];\n</script>\n```\n\n## Using it\n\n- Typing `/` at the start of a block or after a space opens a menu at the caret. ArrowUp and ArrowDown move the highlight; Enter, Tab, or a click runs the item; Escape closes the menu.\n- Choosing an item removes the `/query` text, then runs the item.\n- A query that matches nothing hides the menu.\n\n## What is in the menu\n\n- The items come from every loaded plugin's `inserts`, plus any `extra` you pass. Headings adds Paragraph, Heading 1 to 3, and Quote; lists adds the three list types; image adds Image; table adds Table.\n- The menu never opens when no plugin adds an item.\n- To add actions from your own plugin, give it an `inserts` array (or a function `(ctx) => items`) of `{ id, label, keywords?, run(ctx) }`.\n\n## Setup\n\n- Exports `slashPlugin`, `createSlashPlugin({ extra? })`, `DEFAULT_SLASH_TRIGGER`, and the `aggregateInserts` and `filterInserts` helpers.\n- Setting `plugins` replaces the default set, so spread `...defaultPlugins` to keep bold, italic, underline, undo, and redo.\n\n## Examples\n\n### Add a custom command\n\nPass `extra` items to `createSlashPlugin`. Each item is `{ id, label, keywords?, run(ctx) }`; `run` is called outside any editor update, so it can dispatch commands or open UI.\n\n```html\n<dj-rich-text id=\"editor\" label=\"Article\"></dj-rich-text>\n<script type=\"module\">\n  import \"@dojo-ng/rich-text\";\n  import { defaultPlugins } from \"@dojo-ng/rich-text\";\n  import { createSlashPlugin } from \"@dojo-ng/rich-text-slash\";\n  const slash = createSlashPlugin({\n    extra: [{ id: \"date\", label: \"Today's date\", keywords: [\"date\", \"now\"], run: (ctx) => ctx.editor.update(() => {}) }],\n  });\n  document.getElementById(\"editor\").plugins = [...defaultPlugins, slash];\n</script>\n```\n","readmeFilename":"README.md"}