{"_id":"@amiriel/core","_rev":"4-b5032cb1ec6b55743180ce2bc9cf4b50","name":"@amiriel/core","dist-tags":{"latest":"0.0.1","beta":"0.0.1-beta.9"},"versions":{"0.0.1-beta.7":{"name":"@amiriel/core","version":"0.0.1-beta.7","keywords":["amiriel","letter-editor","document-model","typescript","framework-agnostic"],"license":"MIT","_id":"@amiriel/core@0.0.1-beta.7","maintainers":[{"name":"dingdangdog","email":"dingdangdogx@outlook.com"}],"homepage":"https://amiriel.com","bugs":{"url":"https://github.com/Amirieljs/Amiriel-Core/issues"},"dist":{"shasum":"704c7919c0d8e320b49842ab6686033487947f53","tarball":"https://registry.npmjs.org/@amiriel/core/-/core-0.0.1-beta.7.tgz","fileCount":23,"integrity":"sha512-Cr3usxPAbqnXWrLs89tWHqB7vE9BHGetkBdOd1s8TPlhIyKKQpWJYSwlEHOGD9hGuK2od3wfcTiwgiAna3i0jA==","signatures":[{"sig":"MEUCIGXmMyElYG537WGG0KJMfuo1gIlDmKKJuwB/MmS20BZ+AiEAsGYWbJLc1TFQa/OvyfqpvXBe6W+nq3YFFAHzY9spuW4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":66880},"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"}},"gitHead":"407229cfff7477b762c7ec35ee6e3b89305751e3","scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"dingdangdog","email":"dingdangdogx@outlook.com"},"repository":{"url":"git+https://github.com/Amirieljs/Amiriel-Core.git","type":"git"},"_npmVersion":"11.12.1","description":"Framework-agnostic TypeScript core for Amiriel letter documents.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@11.7.0","devDependencies":{"typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/core_0.0.1-beta.7_1783046387234_0.20830423825042987","host":"s3://npm-registry-packages-npm-production"}},"0.0.1-beta.8":{"name":"@amiriel/core","version":"0.0.1-beta.8","keywords":["amiriel","letter-editor","document-model","typescript","framework-agnostic"],"license":"MIT","_id":"@amiriel/core@0.0.1-beta.8","maintainers":[{"name":"dingdangdog","email":"dingdangdogx@outlook.com"}],"homepage":"https://amiriel.com","bugs":{"url":"https://github.com/Amirieljs/Amiriel-Core/issues"},"dist":{"shasum":"ff4391a025eeb10ac8a9da4a8f1beb1af9826e5c","tarball":"https://registry.npmjs.org/@amiriel/core/-/core-0.0.1-beta.8.tgz","fileCount":23,"integrity":"sha512-CnmdfQ7hlzo774HNdWuSQ9hr54PysF0x6HNs0LoPW/8PJ70zLM0Kt7PVjoaFp5sGxxppYUol4ExCU9XgGuzNeA==","signatures":[{"sig":"MEYCIQCHegi3EuAdFovTwnFWsVo634fuJZlmF1SisJDl9Mz5MAIhAN6KYFRTNzEBvY204m8rSOSt83io4hKTwdQJzC4mcAxS","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amiriel%2fcore@0.0.1-beta.8","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":66880},"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"}},"gitHead":"56fe0103d53274f305b1ac52575bb5144bdedc1a","scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"dingdangdog","email":"dingdangdogx@outlook.com"},"repository":{"url":"git+https://github.com/Amirieljs/Amiriel-Core.git","type":"git"},"_npmVersion":"10.9.8","description":"Framework-agnostic TypeScript core for Amiriel letter documents.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@11.7.0","readmeFilename":"README.md","devDependencies":{"typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/core_0.0.1-beta.8_1783048235284_0.3107572915541599","host":"s3://npm-registry-packages-npm-production"}},"0.0.1-beta.9":{"name":"@amiriel/core","version":"0.0.1-beta.9","keywords":["amiriel","letter-editor","document-model","typescript","framework-agnostic"],"license":"MIT","_id":"@amiriel/core@0.0.1-beta.9","maintainers":[{"name":"dingdangdog","email":"dingdangdogx@outlook.com"}],"homepage":"https://amiriel.com","bugs":{"url":"https://github.com/Amirieljs/Amiriel-Core/issues"},"dist":{"shasum":"dda0396191e05c5fd587abdc7ff6fee02324c81a","tarball":"https://registry.npmjs.org/@amiriel/core/-/core-0.0.1-beta.9.tgz","fileCount":23,"integrity":"sha512-tfzaNcf0Qbhzv9LEhBZijGYBwi5nvOWXMHSzsRttAzsWk370rpQEheGu8y7tCxl+q+gKIM5NBk7jDOI4KTxtsw==","signatures":[{"sig":"MEUCIQDPRBY5Jd5yA3h4VLfOqT8ZteoRvQmmaGQouiilbQ/AswIgaHSF5UtzDv2dezwy8z5lsZACvuFO9XcnwWjq4zLppwQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amiriel%2fcore@0.0.1-beta.9","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":70639},"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"}},"gitHead":"337b743d88c79d8fa31f03727b9ca649250e401e","scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"dingdangdog","email":"dingdangdogx@outlook.com"},"repository":{"url":"git+https://github.com/Amirieljs/Amiriel-Core.git","type":"git"},"_npmVersion":"10.9.8","description":"Framework-agnostic TypeScript core for Amiriel letter documents.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@11.7.0","readmeFilename":"README.md","devDependencies":{"typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/core_0.0.1-beta.9_1785982086230_0.3040296657690762","host":"s3://npm-registry-packages-npm-production"}},"0.0.1":{"name":"@amiriel/core","version":"0.0.1","description":"Framework-agnostic TypeScript core for Amiriel letter documents.","type":"module","license":"MIT","homepage":"https://amiriel.com","packageManager":"pnpm@11.7.0","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/Amirieljs/Amiriel-Core.git"},"bugs":{"url":"https://github.com/Amirieljs/Amiriel-Core/issues"},"keywords":["amiriel","letter-editor","document-model","typescript","framework-agnostic"],"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"sideEffects":false,"devDependencies":{"typescript":"^5.9.3"},"_id":"@amiriel/core@0.0.1","gitHead":"ca4f927f6b94d941bff37947fb028864de80200f","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-6WkpfALFwsqg7xV6XaqJm8fJQRH5x7I7u2QK91lu2vb1+AMcKT8poW8KDlQUOdz3bmvBOHkBvE6LMICe8xH26w==","shasum":"909ba3adf55a51c48b457f22f091304e6e8871b7","tarball":"https://registry.npmjs.org/@amiriel/core/-/core-0.0.1.tgz","fileCount":23,"unpackedSize":70632,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amiriel%2fcore@0.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCfy4U93nAU32zsCMaqlZHP8gVjYaHdMF2UlMkRYZJILAIhAIxLZUQlgdOJ+2F5XFXzY2VAhOGVImhhQmm/2H5sK7nW"}]},"_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/core_0.0.1_1785988484179_0.5978789011071728"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-03T02:39:47.137Z","modified":"2026-08-06T03:54:44.665Z","0.0.1-beta.7":"2026-07-03T02:39:47.371Z","0.0.1-beta.8":"2026-07-03T03:10:35.434Z","0.0.1-beta.9":"2026-08-06T02:08:06.387Z","0.0.1":"2026-08-06T03:54:44.322Z"},"bugs":{"url":"https://github.com/Amirieljs/Amiriel-Core/issues"},"license":"MIT","homepage":"https://amiriel.com","keywords":["amiriel","letter-editor","document-model","typescript","framework-agnostic"],"repository":{"type":"git","url":"git+https://github.com/Amirieljs/Amiriel-Core.git"},"description":"Framework-agnostic TypeScript core 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/core</h1>\n\n<p align=\"center\">\n  Framework-agnostic TypeScript core for Amiriel letter documents.\n</p>\n\n`@amiriel/core` is the shared model and rules layer used by framework packages such as\n[`@amiriel/vue`](https://github.com/Amirieljs/Amiriel-Vue) for Vue and\n[`@amiriel/react`](https://github.com/Amirieljs/Amiriel-React) for React. It\ncontains no UI framework, DOM, storage, authentication, routing, or database\ncode.\n\n[![npm version (beta)](https://img.shields.io/npm/v/@amiriel/core/beta?style=flat-square)](https://www.npmjs.com/package/@amiriel/core)\n[![license](https://img.shields.io/npm/l/@amiriel/core?style=flat-square)](https://www.npmjs.com/package/@amiriel/core)\n[![TypeScript](https://img.shields.io/badge/typescript-ready-3178C6?style=flat-square&logo=typescript&logoColor=white)]()\n\nPrefer the short package name? Install [`amiriel`](https://www.npmjs.com/package/amiriel) instead — it re-exports everything from this package.\n\n## Features\n\n- Shared Amiriel document types\n- Document normalization helpers\n- Paper size constraints and media placement math\n- Built-in themes and CSS variable generation\n- English and Chinese UI label helpers\n- Font, text color, and video duration utilities\n- Framework-agnostic ESM package with TypeScript declarations\n\n## Install\n\n```bash\nnpm install @amiriel/core@beta\npnpm add @amiriel/core@beta\nyarn add @amiriel/core@beta\nbun add @amiriel/core@beta\n```\n\nOr use the meta package:\n\n```bash\nnpm install amiriel@beta\n```\n\n## Usage\n\n```ts\nimport {\n  normalizeDocument,\n  type AmirielDocument,\n} from \"@amiriel/core\";\n\nconst document: AmirielDocument = normalizeDocument({\n  theme: \"midnight\",\n  media: [],\n  pages: [],\n});\n```\n\n### Custom id generation\n\n`normalizeDocument` may assign page or placement ids when input omits them.\nIn modern Node.js and browsers it uses `crypto.randomUUID()` when available.\nYou can also pass your own id factory:\n\n```ts\nimport { normalizeDocument } from \"@amiriel/core\";\n\nconst document = normalizeDocument(input, {\n  createId: () => `doc-${Date.now()}`,\n});\n```\n\n### Themes\n\nBuilt-in themes: `midnight`, `paper`, `memorial`.\n\n```ts\nimport {\n  amirielThemeCssVars,\n  findAmirielThemeDefinition,\n} from \"@amiriel/core\";\n\nconst theme = findAmirielThemeDefinition(\"paper\");\nconst cssVars = amirielThemeCssVars(theme);\n```\n\n### Labels\n\n```ts\nimport { resolveAmirielLabels } from \"@amiriel/core\";\n\nconst labels = resolveAmirielLabels(\"zh\", {\n  uploadMedia: \"选择照片或视频\",\n});\n```\n\n## Main Exports\n\n| Export | Description |\n| --- | --- |\n| Document types | `AmirielDocument`, `AmirielPage`, `AmirielMedia`, and related shapes |\n| `normalizeDocument` | Normalize document input into the shared Amiriel shape |\n| Theme helpers | Built-in theme definitions, CSS variable generation, and merge utilities |\n| Label helpers | Built-in English and Chinese UI labels with partial overrides |\n| Placement math | Paper sizing, media placement, and text block normalization utilities |\n\n## Package Architecture\n\n| npm package | Repository | Role |\n| --- | --- | --- |\n| `@amiriel/core` | [Amirieljs/Amiriel-Core](https://github.com/Amirieljs/Amiriel-Core) | Framework-agnostic core (this repo) |\n| `amiriel` | [Amirieljs/Amiriel](https://github.com/Amirieljs/Amiriel) | Meta package re-exporting `@amiriel/core` |\n| `@amiriel/vue` | [Amirieljs/Amiriel-Vue](https://github.com/Amirieljs/Amiriel-Vue) | Vue 3 implementation |\n| `@amiriel/react` | [Amirieljs/Amiriel-React](https://github.com/Amirieljs/Amiriel-React) | React implementation |\n| `@amiriel/vanilla` | [Amirieljs/Amiriel-Vanilla](https://github.com/Amirieljs/Amiriel-Vanilla) | Vanilla JS implementation |\n\nFramework packages depend on `@amiriel/core` for document normalization, theme\ndefinitions, labels, and placement math.\n\nThe full hosted product lives at [amiriel.com](https://amiriel.com).\n\n## License\n\nMIT. The core package is open source and can be used commercially. The official\nhosted Amiriel product at [amiriel.com](https://amiriel.com) may still provide\npaid services around storage, accounts, delivery, hosting, collaboration, or\nother product workflows.\n","readmeFilename":"README.md"}