{"_id":"@abumalick/arabic-symbols","name":"@abumalick/arabic-symbols","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@abumalick/arabic-symbols","version":"0.1.0","description":"Render Islamic honorific abbreviations as KFGQPC Arabic Symbols glyphs (framework-agnostic + CSS/font).","type":"module","license":"MIT AND LicenseRef-KFGQPC-Fonts","author":{"name":"abumalick"},"keywords":["arabic","islamic","honorific","quran","kfgqpc","salawat"],"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./style.css":"./style.css","./font/*":"./font/*"},"sideEffects":["*.css"],"scripts":{"build":"tsc -p tsconfig.build.json","test":"vitest run","test.watch":"vitest","prepublishOnly":"pnpm build"},"devDependencies":{"typescript":"^5.6.0","vitest":"^2.1.0"},"_id":"@abumalick/arabic-symbols@0.1.0","gitHead":"4965f29e3ae0af0bd437ed6b7397adcc80c78836","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-XC5Eu8qF8cUf/bjdzdUwEhmIp/fu+q/HZoOzImN6sx6+lxhyQ10QVg/SC7qZmQXQfy24iH4kQw1UTQpEIcSqPw==","shasum":"e5f3242b721c006050acb8b7e76d8a5a657e0231","tarball":"https://registry.npmjs.org/@abumalick/arabic-symbols/-/arabic-symbols-0.1.0.tgz","fileCount":17,"unpackedSize":392412,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDqe2twGQE9eAxVJpH+2evLjReAOtfQBSZN9XWcoJVxVQIhAKKjEzsCz051fC33QTnnS1qk+YMV3CwIXu1RdAD3+Bwa"}]},"_npmUser":{"name":"abumalick","email":"abdullah.hilson@gmail.com"},"directories":{},"maintainers":[{"name":"abumalick","email":"abdullah.hilson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/arabic-symbols_0.1.0_1783833196826_0.6229139280360976"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-12T05:13:16.727Z","0.1.0":"2026-07-12T05:13:17.015Z","modified":"2026-07-12T05:13:17.191Z"},"maintainers":[{"name":"abumalick","email":"abdullah.hilson@gmail.com"}],"description":"Render Islamic honorific abbreviations as KFGQPC Arabic Symbols glyphs (framework-agnostic + CSS/font).","keywords":["arabic","islamic","honorific","quran","kfgqpc","salawat"],"author":{"name":"abumalick"},"license":"MIT AND LicenseRef-KFGQPC-Fonts","readme":"# @abumalick/arabic-symbols\n\nRender Islamic honorific abbreviations (عز وجل, ﷺ, رحمه الله, …) as proper\nsingle-glyph honorific symbols, using the **KFGQPC Arabic Symbols 01** font.\n\nFramework-agnostic core (no DOM) + a ready-made HTML helper + the font and CSS.\n\n## Why\n\nContent often writes honorifics as short abbreviations in parentheses — `(زج)`\nfor عز وجل, `(سبح)` for سبحانه وتعالى, and so on. This package turns those tokens\ninto the calligraphic honorific glyph, rendered from the KFGQPC symbols font at\nits native Private-Use-Area codepoints (`U+F062`–`U+F076`). Because the glyphs\nlive in the PUA, a missing font degrades to a harmless placeholder — never a\nwrong letter — and no font modification is required.\n\n## Install\n\n```sh\npnpm add @abumalick/arabic-symbols\n```\n\n## Usage\n\n```ts\nimport { symbolsToHtml, tokenizeSymbols, SYMBOLS } from \"@abumalick/arabic-symbols\";\nimport \"@abumalick/arabic-symbols/style.css\"; // registers @font-face + .arabic-symbol\n\n// HTML string helper (does NOT escape surrounding text — feed it trusted HTML):\nsymbolsToHtml(\"من فضل الله (زج) العظيم\");\n// => 'من فضل الله <span class=\"arabic-symbol\"></span> العظيم'\n\n// Restrict to a specific alias set (alias -> symbol key):\nsymbolsToHtml(\"الله (زج)\", { aliases: { \"زج\": \"azzaWaJalla\" } });\n\n// Aliases can be ANY string (e.g. Latin letters for a French/AZERTY workflow),\n// and the delimiter is configurable per product via `wrap` (default [\"(\", \")\"]):\nsymbolsToHtml(\"Allah [A] great\", {\n  aliases: { A: \"azzaWaJalla\", Z: \"subhanahuWaTaala\" },\n  wrap: [\"[\", \"]\"], // author content as [A], [Z]\n});\n\n// Framework-agnostic tokens (render however you like — Svelte, Vue, RN, …):\ntokenizeSymbols(\"الله (زج)\");\n// => [{ type: \"text\", value: \"الله \" },\n//     { type: \"symbol\", char: \"\", key: \"azzaWaJalla\", phrase: \"عز وجل\", match: \"(زج)\" }]\n```\n\n### API\n\n- `SYMBOLS` — the canonical honorific data (readonly array of `ArabicSymbol`).\n- `symbolChar(key)` — the PUA character for a honorific key (throws if unknown).\n- `symbolByAlias(alias)` — resolve an abbreviation to its `ArabicSymbol`.\n- `tokenizeSymbols(text, opts?)` — segment text into `text`/`symbol` tokens.\n- `replaceSymbols(text, render, opts?)` — replace matched tokens with a custom string.\n- `symbolsToHtml(text, opts?)` — replace matched tokens with\n  `<span class=\"arabic-symbol\">…</span>`.\n\n**Options** (`opts`):\n\n- `aliases` — an `alias -> key` map. When provided, **only** those aliases are\n  matched; otherwise all built-in aliases are used. Aliases can be any string\n  (Arabic tokens like `زج`, or Latin letters like `A` for non-Arabic keyboards).\n- `wrap` — the `[open, close]` delimiter pair around an alias. Defaults to\n  `[\"(\", \")\"]` (matches `(زج)`). Set it per product to change the authoring\n  convention, e.g. `[\"[\", \"]\"]` matches `[A]`. Both delimiters are literal\n  strings (regex-escaped).\n\n### Symbols\n\n| key | codepoint | phrase | default aliases |\n|---|---|---|---|\n| azzaWaJalla | U+F062 | عز وجل | زج, عزوجل |\n| subhanahuWaTaala | U+F063 | سبحانه وتعالى | سبح |\n| jallaJalaluhu | U+F064 | جل جلاله | جج |\n| jallaWaAla | U+F065 | جل وعلا | جع |\n| tabarakaWaTaala | U+F066 | تبارك وتعالى | تب |\n| sallallahuAlayhiWaSallam | U+F067 | صلى الله عليه وسلم | صلعم |\n| radiyallahuAnhu / Anha / Anhum / Anhuma / Anhunna | U+F068–F06C | رضي الله عنه … | رضه, رضها, رضهم, رضهما, رضهن |\n| alayhiSalatuWasSalam | U+F06D | عليه الصلاة والسلام | عصس |\n| alayhiSalam / alayhimSalam / alayhimaSalam | U+F06E, F070, F071 | عليه/عليهم/عليهما السلام | عس, عهم, عهما |\n| rahimahullah / rahimahallah / rahimahumaAllah / rahimahumullah / rahimahunnaAllah | U+F072–F076 | رحمه الله … | رح, رحها, رحهما, رحهم, رحهن |\n\nTo verify the glyph↔phrase readings yourself: `node scripts/glyph-sheet.mjs`\nthen open `scripts/glyphs.html` in a browser.\n\n## License\n\nSPDX: **`MIT AND LicenseRef-KFGQPC-Fonts`**\n\n- Package **code**: MIT — see [`LICENSE`](./LICENSE).\n- Bundled **font** (`font/`): \"KFGQPC Arabic Symbols 01\", property of the King\n  Fahd Glorious Qur'an Printing Complex, redistributed **unmodified** under its\n  own license — see [`LICENSES/LicenseRef-KFGQPC-Fonts.txt`](./LICENSES/LicenseRef-KFGQPC-Fonts.txt),\n  [`font/LICENSE`](./font/LICENSE), and [`NOTICE`](./NOTICE). The KFGQPC terms\n  permit free redistribution as-is but prohibit modifying the font.\n","readmeFilename":"README.md","_rev":"1-32d727734a6c72e204a8cac7268f0d2f"}