{"_id":"@dojo-ng/rich-text-image","name":"@dojo-ng/rich-text-image","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@dojo-ng/rich-text-image","version":"0.1.0","license":"BSD-3-Clause","description":"Image insert plugin for @dojo-ng/rich-text","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist"},"dependencies":{"@dojo-ng/rich-text":"^0.1.0","@dojo-ng/file-input":"^0.1.0","@dojo-ng/dialog":"^0.1.0","@dojo-ng/text-input":"^0.1.0","@dojo-ng/button":"^0.1.0","@dojo-ng/i18n":"^0.1.0","lexical":"^0.21.0","@lexical/utils":"^0.21.0","lit":"^3.3.0"},"_id":"@dojo-ng/rich-text-image@0.1.0","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-D2yNzDWzoMWkx03xBJ/qFAO8w2KIVDGfxHX0K/Vpj2IT1wvZ1f3leYBCNuSuNFzZ9hDbMXUx8OdxXase/iNUuA==","shasum":"1f6d978123e61711180bc22432eee3d9e33fc330","tarball":"https://registry.npmjs.org/@dojo-ng/rich-text-image/-/rich-text-image-0.1.0.tgz","fileCount":8,"unpackedSize":20199,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCuHu74huuqASbVApDbuD/m9rYSQiBX3mRmu2HFQRhgKwIhAN0jxEjeEPvFPCTSJ7EfQtHw3pjaHXUQfGxrE0FOghQ+"}]},"_npmUser":{"name":"bitranch","email":"bill@bitranch.com"},"directories":{},"maintainers":[{"name":"saysomething","email":"joshs@holmescorp.com"},{"name":"bitranch","email":"bill@bitranch.com"},{"name":"jepe","email":"jeffreyp@holmescorp.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rich-text-image_0.1.0_1788374435953_0.15652336556115154"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-02T18:40:35.709Z","0.1.0":"2026-09-02T18:40:36.101Z","modified":"2026-09-02T18:40:36.507Z"},"maintainers":[{"name":"saysomething","email":"joshs@holmescorp.com"},{"name":"bitranch","email":"bill@bitranch.com"},{"name":"jepe","email":"jeffreyp@holmescorp.com"}],"description":"Image insert plugin for @dojo-ng/rich-text","license":"BSD-3-Clause","readme":"# @dojo-ng/rich-text-image\n\nImage insert plugin for @dojo-ng/rich-text\n\nPart of [Dojo NG](../../README.md), a framework-agnostic web component library. BSD-3-Clause.\n\n> An opt-in plugin for `@dojo-ng/rich-text` (not a custom element). It contributes an `ImageNode` (a decorator node rendering an `<img>`) plus an `INSERT_IMAGE_COMMAND`, and a toolbar button that opens a `dj-dialog` for inserting an image from a file (`dj-file-input`) or a URL — the most recent source wins. Alt text is REQUIRED: the insert button stays disabled until it is non-empty, because the accessible name is mandatory. Exports `imagePlugin`, `createImagePlugin({ upload })`, `ImageNode`, `$createImageNode`, `$isImageNode`, and `INSERT_IMAGE_COMMAND`. Clicking an image selects it (a NodeSelection); Backspace/Delete then removes it (handled by Lexical). Setting `plugins` REPLACES the default set, so spread `...defaultPlugins`. DATA-URL CAVEAT: the default `upload` reads the file to a data URL, which bloats the HTML value — pass your own `upload(file) => Promise<string>` in production to host the file and return a URL. There is no size limit by default; pass `createImagePlugin({ maxSize })` (bytes) to cap the picker's file input. PASTE CAVEAT: the default paste sanitizer drops `<img>` tags, so images enter via the dialog or the `value` property, not paste. DEFERRED: resize/crop, captions, drag/paste insertion, alignment.\n\n## Install\n\n```bash\nnpm install @dojo-ng/rich-text-image\n```\n\n## Usage\n\nCompose the image plugin with the default set. Pass `createImagePlugin({ upload })` to host files instead of embedding data URLs.\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 { createImagePlugin } from \"@dojo-ng/rich-text-image\";\n  const imagePlugin = createImagePlugin({ upload: async (file) => (await myUploader(file)).url });\n  document.getElementById(\"editor\").plugins = [...defaultPlugins, imagePlugin];\n</script>\n```\n","readmeFilename":"README.md","_rev":"1-65b48580756c1dac9a60cb690a956355"}