{"_id":"@dojo-ng/rich-text","_rev":"3-3412291ceeb8ba020451be17465d85b2","name":"@dojo-ng/rich-text","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@dojo-ng/rich-text","version":"0.1.0","license":"BSD-3-Clause","_id":"@dojo-ng/rich-text@0.1.0","maintainers":[{"name":"saysomething","email":"joshs@holmescorp.com"},{"name":"bitranch","email":"bill@bitranch.com"},{"name":"jepe","email":"jeffreyp@holmescorp.com"}],"dist":{"shasum":"62cfcb89b833e2b4266163e554ef1ebdddff9c86","tarball":"https://registry.npmjs.org/@dojo-ng/rich-text/-/rich-text-0.1.0.tgz","fileCount":14,"integrity":"sha512-WbZC+csaFoZRHPmxOXOaL3SeZfqT9g1T3l4rnyPE8uCdHRLiAHUrBTQ+WaSrGMu+L5okVnClT926ksRweVl6bg==","signatures":[{"sig":"MEUCIHGGIYvkfSt9uFcxEFHZFwectGk6kRFhQWMwMlnwWcTzAiEA67MvENIFjwgSmWrc4J36M/mByHBUbUax3mxXpquUeog=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45587},"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":"Dojo NG rich-text (WYSIWYG) web component on Lexical","directories":{},"_nodeVersion":"22.23.1","dependencies":{"lit":"^3.3.0","lexical":"^0.21.0","@lexical/html":"^0.21.0","@lexical/utils":"^0.21.0","@dojo-ng/button":"^0.1.0","@lexical/history":"^0.21.0","@lexical/clipboard":"^0.21.0","@lexical/rich-text":"^0.21.0","@dojo-ng/dojo-element":"^0.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/rich-text_0.1.0_1788374434922_0.29868728175282455","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@dojo-ng/rich-text","version":"0.1.1","license":"BSD-3-Clause","_id":"@dojo-ng/rich-text@0.1.1","maintainers":[{"name":"saysomething","email":"joshs@holmescorp.com"},{"name":"bitranch","email":"bill@bitranch.com"},{"name":"jepe","email":"jeffreyp@holmescorp.com"}],"dist":{"shasum":"f87a41cfbe98e0ebf4d3d9367f342afe477d5386","tarball":"https://registry.npmjs.org/@dojo-ng/rich-text/-/rich-text-0.1.1.tgz","fileCount":14,"integrity":"sha512-njWUkE61E/bOr2uIhrzKH1k228+0gRK1N+KuJuqNmH0c8fe/nx5yqaTRB8rdpZKEa6KqTtXDTLzIxWPZjKkpEA==","signatures":[{"sig":"MEYCIQC1p490aeAT8BYLo6MaA8vAutdOPu+yDQst1nIjAo/yCwIhAL7PNlZME+FqBTR9r+NcrHgCgROPmt8yrLwGkgz9b/P7","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQDRCcQy2Q3KSJxW6fH+E69B+qQ9BIW4L6XKUqLCtd9t8AIgXocge7j+k/PHV3PKwzble0ZzS/uFPjrDVfRX15xniKw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":48120},"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":"Dojo NG rich-text (WYSIWYG) web component on Lexical","directories":{},"_nodeVersion":"22.23.1","dependencies":{"lit":"^3.3.0","lexical":"^0.21.0","@lexical/html":"^0.21.0","@lexical/utils":"^0.21.0","@dojo-ng/button":"^0.1.1","@lexical/history":"^0.21.0","@lexical/clipboard":"^0.21.0","@lexical/rich-text":"^0.21.0","@dojo-ng/dojo-element":"^0.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/rich-text_0.1.1_1789131980204_0.9188371654530789","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"_id":"@dojo-ng/rich-text@0.1.2","dist":{"shasum":"2731ec49a4cd3d9ec952af2e34445ccf6bb81354","tarball":"https://registry.npmjs.org/@dojo-ng/rich-text/-/rich-text-0.1.2.tgz","fileCount":14,"integrity":"sha512-Z3czvUSNnqcIv8Tg28bJaf3PHN4AkAOTJYJqq2/pVodxKFn42OziIafJTu1g9zWu+uDAa3aR2WowrTb4NimwrQ==","signatures":[{"sig":"MEUCIQCo65QiK1YWpIqWkklCJLsKzj/u3Gx2y2BvaCglC8Ej1wIgP6r0noJx0uaIppILGptEnVA8CUu1rbaEbIIiqHW7K6o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDhhGLzcHdzQ7rJkvua/WLeMlQqVWOeZL2F6r8s//+ETAIhAJKL40/dxt8YixPYuhH6jvgXf+7Oo1L0lIaaNhs6wYRu"}],"unpackedSize":48137},"main":"./dist/index.js","name":"@dojo-ng/rich-text","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.2","_npmUser":{"name":"bitranch","email":"bill@bitranch.com"},"_npmVersion":"10.9.8","description":"Dojo NG rich-text (WYSIWYG) web component on Lexical","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","@lexical/html":"^0.21.0","@lexical/utils":"^0.21.0","@dojo-ng/button":"^0.1.1","@lexical/history":"^0.21.0","@lexical/clipboard":"^0.21.0","@lexical/rich-text":"^0.21.0","@dojo-ng/dojo-element":"^0.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rich-text_0.1.2_1790864600179_0.5342738177059692"}}},"time":{"created":"2026-09-02T18:40:34.422Z","modified":"2026-10-01T14:23:20.592Z","0.1.0":"2026-09-02T18:40:35.074Z","0.1.1":"2026-09-11T13:06:20.296Z","0.1.2":"2026-10-01T14:23:20.264Z"},"license":"BSD-3-Clause","description":"Dojo NG rich-text (WYSIWYG) web component on Lexical","maintainers":[{"name":"saysomething","email":"joshs@holmescorp.com"},{"name":"bitranch","email":"bill@bitranch.com"},{"name":"jepe","email":"jeffreyp@holmescorp.com"}],"readme":"# @dojo-ng/rich-text\n\n`<dj-rich-text>` — A form-associated WYSIWYG editor built on the Lexical core.\n\nPart of [Dojo NG](../../README.md), a framework-agnostic web component library built on Lit. BSD-3-Clause.\n\nA form-associated WYSIWYG editor built on the Lexical core. The editable region renders in LIGHT DOM (Lexical's selection handling is not reliable inside a shadow root yet), so this component overrides `createRenderRoot`; theming still works because `--dj-*` tokens cascade in light DOM. The editor is a PLUGIN HOST: bold/italic/underline and undo/redo ship as the default plugin set (`default-plugins.ts`) and flow through the same {@link RichTextPlugin} API third-party plugins use. Foundational behavior (`registerRichText`, value sync, root-element setup) stays as core. Toolbar controls, node registration, and output formats all come from plugins. Constraint: Lexical needs node classes at creation, so a `plugins` change after creation rebuilds the editor (serialize → recreate → deserialize). Value is HTML by default; the `format` property selects an alternate serializer contributed by a plugin. Event: `dj-change`.\n\n> Pasted HTML is sanitized against an allowlist by default (scripts, styles, event handlers, inline styles, and unsafe `javascript:`/`data:` URLs are stripped; unknown tags are unwrapped, keeping their text) — a security and consistency hook, not a nicety. Set `sanitizePaste = false` in JS to turn it off, or supply your own `pasteSanitizer(html) => html`. Plain-text pastes bypass it. The exported `sanitizeHtml(html)` is the default and can be reused. Formatting, headings/lists/links, and other node types come from plugins; setting `plugins` replaces the default set, so spread `...defaultPlugins` to keep the basics. `value` is readable and writable at any time, not just at construction: assigning it replaces the whole document (discarding the selection and undo history) and emits no `dj-change`, the same as setting a native input's `value`.\n\n## Install\n\n```bash\nnpm install @dojo-ng/rich-text\n```\n\n## Usage\n\nImport the package to register the custom element, then use the tag.\n\nLexical-based; set and read `value` (HTML).\n\n```html\n<dj-rich-text id=\"rt\" label=\"Description\"></dj-rich-text>\n<script type=\"module\">\n  import \"@dojo-ng/rich-text\";\n  document.getElementById(\"rt\").value = \"<p>Hello <strong>world</strong></p>\";\n</script>\n```\n\n## Properties\n\n`↻` marks an attribute reflected to the DOM; a dash means the property is set in JavaScript only.\n\n| Property | Attribute | Type | Default |\n|---|---|---|---|\n| `value` | value | `string` | `\"\"` |\n| `name` | name ↻ | `string` | — |\n| `label` | label | `string` | — |\n| `placeholder` | placeholder | `string` | `\"\"` |\n| `disabled` | disabled ↻ | `boolean` | `false` |\n| `plugins` | — | `RichTextPlugin[]` | `[]` |\n| `format` | format ↻ | `string` | `\"html\"` |\n| `sanitizePaste` | — | `boolean` | `true` |\n| `pasteSanitizer` | — | `(html: string) => string` | — |\n\n**Events:** `dj-change`\n\n**Methods:** `checkValidity(): boolean`, `focus(o: FocusOptions)`, `setHtml(htmlString: string)` (Replace the document with the given HTML (regardless of the active `format`).)\n\n## Theming\n\nStyled with Dojo NG `--dj-*` design tokens and exposes `::part()` hooks for targeted overrides.\n\n## Accessibility and i18n\n\nFollows the project's WCAG 2.2 AA and localization conventions.\n\n## More\n\nLive, interactive examples are at [play.dojo-ng.com](https://play.dojo-ng.com). For the full API reference, theming, accessibility, and localization guides, see the [Dojo NG documentation](../../README.md).\n","readmeFilename":"README.md"}