{"_id":"@amiriel/vanilla","_rev":"3-dcc45efaa9af62ed7f393913b44e1ab3","name":"@amiriel/vanilla","dist-tags":{"latest":"0.0.1","beta":"0.0.1-beta.8"},"versions":{"0.0.1-beta.1":{"name":"@amiriel/vanilla","version":"0.0.1-beta.1","keywords":["amiriel","vanilla","web-components","editor","letter-editor","typescript"],"license":"MIT","_id":"@amiriel/vanilla@0.0.1-beta.1","maintainers":[{"name":"dingdangdog","email":"dingdangdogx@outlook.com"}],"homepage":"https://amiriel.com","bugs":{"url":"https://github.com/Amirieljs/Amiriel-Vanilla/issues"},"dist":{"shasum":"4df8d4e371ab029a8b49a80b42cdd4c6a6ac8f3a","tarball":"https://registry.npmjs.org/@amiriel/vanilla/-/vanilla-0.0.1-beta.1.tgz","fileCount":32,"integrity":"sha512-gXUyytFsZV/1MMGm4OjGSx/Dcvs/qhK2r6Rzq8SWV6QMNp7g4qwCvPzVf4ci3a/HahZeFF5bXPrsZXfpEatQqw==","signatures":[{"sig":"MEUCIDTfSPDn+P8zE+PkSb6XBBs5UYl/ztx/yrjcycsoX5F+AiEA7n348deMZXsJI5er8wN+Kr4wWooUXmlu1i4EXKLL1/A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":125699},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./style.css":"./dist/style.css"},"gitHead":"7a6237ab99353ae28967c89ab4d020bb2e3f0e58","scripts":{"build":"tsc -p tsconfig.json && node scripts/copy-style.mjs","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"dingdangdog","email":"dingdangdogx@outlook.com"},"repository":{"url":"git+https://github.com/Amirieljs/Amiriel-Vanilla.git","type":"git"},"_npmVersion":"11.12.1","description":"Vanilla JavaScript editor and renderer for Amiriel letter documents.","directories":{},"sideEffects":["./dist/style.css","./src/style.css"],"_nodeVersion":"22.22.0","dependencies":{"@amiriel/core":"^0.0.1-beta.7"},"_hasShrinkwrap":false,"packageManager":"pnpm@11.7.0","devDependencies":{"typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/vanilla_0.0.1-beta.1_1783047234555_0.8155935709848603","host":"s3://npm-registry-packages-npm-production"}},"0.0.1-beta.8":{"name":"@amiriel/vanilla","version":"0.0.1-beta.8","keywords":["amiriel","vanilla","web-components","editor","letter-editor","typescript"],"license":"MIT","_id":"@amiriel/vanilla@0.0.1-beta.8","maintainers":[{"name":"dingdangdog","email":"dingdangdogx@outlook.com"}],"homepage":"https://amiriel.com","bugs":{"url":"https://github.com/Amirieljs/Amiriel-Vanilla/issues"},"dist":{"shasum":"45b808aa0a8f3934ec2e6ef31418c4c1ff58aec2","tarball":"https://registry.npmjs.org/@amiriel/vanilla/-/vanilla-0.0.1-beta.8.tgz","fileCount":32,"integrity":"sha512-GFcp8MPM2+xu5sVUjTfNVY47+yQ6sDeup9caXF3FVNSmWRyMR4yrLk8RRTCP0Lc1Di9zj4Jz17F0km7Mj31FQQ==","signatures":[{"sig":"MEYCIQCjyX7+LIW0m6vm+eLF1udTic6iopTLbwOtA51joQzF2AIhALFtWh1pT1m0wTch4zxBLJciYG+mFHSlBP0QsKXmFQ0P","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amiriel%2fvanilla@0.0.1-beta.8","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":125096},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./style.css":"./dist/style.css"},"gitHead":"378632c128f39ef96a27367cd2591b0204e53a27","scripts":{"build":"tsc -p tsconfig.json && node scripts/copy-style.mjs","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"dingdangdog","email":"dingdangdogx@outlook.com"},"repository":{"url":"git+https://github.com/Amirieljs/Amiriel-Vanilla.git","type":"git"},"_npmVersion":"10.9.8","description":"Vanilla JavaScript editor and renderer for Amiriel letter documents.","directories":{},"sideEffects":["./dist/style.css","./src/style.css"],"_nodeVersion":"22.23.1","dependencies":{"@amiriel/core":"^0.0.1-beta.7"},"_hasShrinkwrap":false,"packageManager":"pnpm@11.7.0","readmeFilename":"README.md","devDependencies":{"typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/vanilla_0.0.1-beta.8_1783048996249_0.05551224277686817","host":"s3://npm-registry-packages-npm-production"}},"0.0.1":{"name":"@amiriel/vanilla","version":"0.0.1","description":"Vanilla JavaScript editor and renderer for Amiriel letter documents.","type":"module","license":"MIT","homepage":"https://amiriel.com","packageManager":"pnpm@11.7.0","repository":{"type":"git","url":"git+https://github.com/Amirieljs/Amiriel-Vanilla.git"},"bugs":{"url":"https://github.com/Amirieljs/Amiriel-Vanilla/issues"},"keywords":["amiriel","vanilla","web-components","editor","letter-editor","typescript"],"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./style.css":"./dist/style.css"},"scripts":{"build":"tsc -p tsconfig.json && node scripts/copy-style.mjs","typecheck":"tsc -p tsconfig.json --noEmit"},"sideEffects":["./dist/style.css","./src/style.css"],"dependencies":{"@amiriel/core":"^0.0.1"},"devDependencies":{"typescript":"^5.9.3"},"_id":"@amiriel/vanilla@0.0.1","gitHead":"5fc94a708581c7a6df4b0fc3d24d81542069d7b3","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-0Xi3NNrJC4JQfm/KE1rVjiy6ewSieIqQy+bu+FLAiS5PIzUYA564HEHMjtNafo7S0m09ANfSclWrV+zg+2OUaQ==","shasum":"e75b4380bd27027f4b40a390c8cd7897ba963eec","tarball":"https://registry.npmjs.org/@amiriel/vanilla/-/vanilla-0.0.1.tgz","fileCount":32,"unpackedSize":125082,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amiriel%2fvanilla@0.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCY3nvGqIUaeeRXOXW0ut3ER6GfRmNYHBcXyJ957jy3wQIhAKqMEczGFmJN1YUtZjJGkuujz/S6IvsPdehHQ9XG61hz"}]},"_npmUser":{"name":"dingdangdog","email":"dingdangdogx@outlook.com"},"directories":{},"maintainers":[{"name":"dingdangdog","email":"dingdangdogx@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vanilla_0.0.1_1785989497446_0.5692379875142988"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-03T02:53:54.375Z","modified":"2026-08-06T04:11:38.025Z","0.0.1-beta.1":"2026-07-03T02:53:54.687Z","0.0.1-beta.8":"2026-07-03T03:23:16.405Z","0.0.1":"2026-08-06T04:11:37.615Z"},"bugs":{"url":"https://github.com/Amirieljs/Amiriel-Vanilla/issues"},"license":"MIT","homepage":"https://amiriel.com","keywords":["amiriel","vanilla","web-components","editor","letter-editor","typescript"],"repository":{"type":"git","url":"git+https://github.com/Amirieljs/Amiriel-Vanilla.git"},"description":"Vanilla JavaScript editor and renderer for Amiriel letter documents.","maintainers":[{"name":"dingdangdog","email":"dingdangdogx@outlook.com"}],"readme":"<p align=\"center\">\n  <img src=\"https://amiriel.com/logo/amiriel_256x256.webp\" alt=\"Amiriel logo\" width=\"96\" height=\"96\" />\n</p>\n\n<h1 align=\"center\">Amiriel Vanilla</h1>\n\n<p align=\"center\">\n  Vanilla JavaScript editor and renderer for Amiriel letter documents.\n</p>\n\n`@amiriel/vanilla` provides a framework-free implementation of the Amiriel document\nrenderer and editor shell. It is built on `@amiriel/core`, so the document model, themes,\nlabels, and normalization rules stay aligned with the Vue and React packages.\n\n[![npm version (beta)](https://img.shields.io/npm/v/@amiriel/vanilla/beta?style=flat-square)](https://www.npmjs.com/package/@amiriel/vanilla)\n[![license](https://img.shields.io/npm/l/@amiriel/vanilla?style=flat-square)](https://www.npmjs.com/package/@amiriel/vanilla)\n[![TypeScript](https://img.shields.io/badge/typescript-ready-3178C6?style=flat-square&logo=typescript&logoColor=white)]()\n\nThe full hosted product lives at [amiriel.com](https://amiriel.com).\n\n## Features\n\n- Vanilla JS read-only renderer for Amiriel documents\n- Imperative editor API for pages, themes, text blocks, paper size, and media list\n- Optional `<amiriel-body-editor>` custom element\n- Image/video media lightbox\n- Shared document model from `@amiriel/core`\n- TypeScript declarations\n\nThe current Vanilla editor matches the React shell feature set. Advanced parity with\nthe Vue editor, such as drag-and-drop placement and resize handles, should be added\nincrementally.\n\n## Install\n\n```bash\nnpm install @amiriel/vanilla@beta\npnpm add @amiriel/vanilla@beta\nyarn add @amiriel/vanilla@beta\nbun add @amiriel/vanilla@beta\n```\n\nImport the stylesheet once:\n\n```html\n<link rel=\"stylesheet\" href=\"/node_modules/@amiriel/vanilla/dist/style.css\" />\n```\n\n```js\nimport \"@amiriel/vanilla/style.css\";\n```\n\n## Usage\n\n### Imperative API\n\n```html\n<div id=\"editor\"></div>\n<script type=\"module\">\n  import { createAmirielEditor } from \"@amiriel/vanilla\";\n  import \"@amiriel/vanilla/style.css\";\n\n  const editor = createAmirielEditor(document.getElementById(\"editor\"), {\n    locale: \"zh\",\n    showGithubLink: true,\n    onChange(document) {\n      console.log(document);\n    },\n    async onMediaRequest(request) {\n      request.handled = true;\n      try {\n        const media = await uploadMediaSomewhere(request.file);\n        request.resolve(media);\n      } catch (error) {\n        request.reject(error instanceof Error ? error.message : \"Upload failed\");\n      }\n    },\n  });\n\n  editor.setDocument({\n    theme: \"midnight\",\n    media: [],\n    pages: [],\n  });\n</script>\n```\n\n### Custom element\n\n```html\n<link rel=\"stylesheet\" href=\"/node_modules/@amiriel/vanilla/dist/style.css\" />\n<amiriel-body-editor locale=\"en\"></amiriel-body-editor>\n<script type=\"module\">\n  import { defineAmirielElements } from \"@amiriel/vanilla\";\n  defineAmirielElements();\n</script>\n```\n\n### Read-only renderer\n\n```js\nimport { createAmirielBodyRenderer } from \"@amiriel/vanilla\";\nimport \"@amiriel/vanilla/style.css\";\n\nconst renderer = createAmirielBodyRenderer(document.getElementById(\"preview\"), {\n  document: myDocument,\n  locale: \"en\",\n});\n\nrenderer.update({ pageIndex: 1 });\n```\n\nHost applications own media upload and pass the resulting media object back\nthrough `request.resolve(media)`.\n\n## Main Exports\n\n| Export | Description |\n| --- | --- |\n| `createAmirielEditor` | Mount a Vanilla editor into a host element |\n| `createAmirielBodyRenderer` | Mount a read-only renderer |\n| `defineAmirielElements` | Register `<amiriel-body-editor>` |\n| `AmirielBodyEditorElement` | Custom element class |\n| Core types and helpers | Re-exported from `@amiriel/core` |\n\n## Editor Options\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `value` | empty document | Initial document value |\n| `onChange` | none | Called when the document changes |\n| `readOnly` | `false` | Render the editor shell without editing controls |\n| `locale` | `\"en\"` | Built-in label locale: `en` or `zh` |\n| `labels` | none | Partial override for UI labels |\n| `themes` | none | Override built-in themes or register custom paper themes |\n| `showGithubLink` | `true` | Show GitHub link on the text-block toolbar |\n| `githubUrl` | `https://github.com/Amirieljs/Amiriel-Vanilla` | Target URL for the GitHub button |\n| `defaultPaperSize` | `{ width: 720, height: 520 }` | Fallback paper size |\n| `paperSizeLimits` | core defaults | Paper resizing bounds |\n| `paperResizable` | `true` | Allow users to edit paper width and height |\n| `onMediaRequest` | none | Host-controlled upload hook for new media files |\n| `onMediaRemoved` | none | Called when the user removes media from the document |\n\n## Package Architecture\n\nThis repository is the Vanilla JavaScript implementation. The shared framework-agnostic\ncore lives in [`@amiriel/core`](https://github.com/Amirieljs/Amiriel-Core), the meta package\n[`amiriel`](https://github.com/Amirieljs/Amiriel) re-exports it, the Vue\nimplementation lives in [`@amiriel/vue`](https://github.com/Amirieljs/Amiriel-Vue),\nand the React implementation lives in\n[`@amiriel/react`](https://github.com/Amirieljs/Amiriel-React).\n\n## License\n\nMIT. The Vanilla editor package is open source and can be used commercially. The\nofficial hosted Amiriel product at [amiriel.com](https://amiriel.com) may still\nprovide paid services around storage, accounts, delivery, hosting, collaboration,\nor other product workflows.\n","readmeFilename":"README.md"}