Comparing version 0.0.45 to 0.0.46
import { ReactNode } from 'react'; | ||
import * as yoga_layout from 'yoga-layout'; | ||
declare const code: { | ||
readonly 'ja-JP': RegExp; | ||
readonly 'ko-KR': RegExp; | ||
readonly 'zh-CN': RegExp; | ||
readonly 'zh-TW': RegExp; | ||
readonly 'zh-HK': RegExp; | ||
readonly 'th-TH': RegExp; | ||
readonly 'bn-IN': RegExp; | ||
readonly 'ar-AR': RegExp; | ||
readonly 'ta-IN': RegExp; | ||
readonly 'ml-IN': RegExp; | ||
readonly 'he-IL': RegExp; | ||
readonly 'te-IN': RegExp; | ||
readonly devanagari: RegExp; | ||
readonly kannada: RegExp; | ||
}; | ||
declare type Locale = keyof typeof code; | ||
/** | ||
@@ -15,2 +33,3 @@ * This class handles everything related to fonts. | ||
style?: Style; | ||
lang?: string; | ||
} | ||
@@ -38,2 +57,2 @@ | ||
export { FontOptions as Font, Style as FontStyle, Weight as FontWeight, SatoriOptions, satori as default, init }; | ||
export { FontOptions as Font, Style as FontStyle, Weight as FontWeight, Locale, SatoriOptions, satori as default, init }; |
{ | ||
"name": "satori", | ||
"version": "0.0.45", | ||
"version": "0.0.46", | ||
"description": "Enlightened library to convert HTML and CSS to SVG.", | ||
@@ -71,3 +71,3 @@ "module": "./dist/index.js", | ||
"postcss-value-parser": "^4.2.0", | ||
"yoga-layout-prebuilt": "^1.10.0" | ||
"yoga-wasm-web": "^0.3.0" | ||
}, | ||
@@ -88,7 +88,7 @@ "packageManager": "pnpm@7.11.0", | ||
"dev:test": "NODE_ENV=test vitest --update --outputTruncateLength=9999999", | ||
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --quiet", | ||
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --quiet --cache", | ||
"lint:fix": "pnpm lint --fix", | ||
"prettier-check": "prettier --check .", | ||
"prettier-fix": "prettier --write ." | ||
"prettier-fix": "prettier --write . --cache" | ||
} | ||
} |
@@ -162,3 +162,3 @@ ![Satori](.github/card.png) | ||
<tr><td rowspan="10">Flex</td></tr> | ||
<tr><td rowspan="11">Flex</td></tr> | ||
<tr><td><code>flexDirection</code></td><td><code>column</code>, <code>row</code>, <code>row-reverse</code>, <code>column-reverse</code>, default to <code>row</code></td></tr> | ||
@@ -173,2 +173,3 @@ <tr><td><code>flexWrap</code></td><td><code>wrap</code>, <code>nowrap</code>, <code>wrap-reverse</code>, default to <code>wrap</code></td></tr> | ||
<tr><td><code>justifyContent</code></td><td>Supported</td></tr> | ||
<tr><td><code>gap</code></td><td>Supported</td></tr> | ||
@@ -302,2 +303,16 @@ <tr><td rowspan="5">Font</td></tr> | ||
#### Locales | ||
Satori supports rendering text in different locales. You can specify the supported locales via the `lang` attribute: | ||
```jsx | ||
await satori( | ||
<div lang="ja-JP">骨</div> | ||
) | ||
``` | ||
Same characters can be rendered differently in different locales, you can specify the locale when necessary to force it to render with a specific font and locale. Check out [this example](https://og-playground.vercel.app/?share=nVLdSsMwFH6VcEC86VgdXoyweTMVpyiCA296kzWnbWaalCZ160rfwAcRH8Bn0rcwWVdQEYTdnJzz_ZyEnNNArDkChQkXz5EixNha4rRpfE4IF6aQrKbkOJG4OQ461OfnosTYCq0cF2tZ5apnMxRpZh18EoZHPbgW3Ga_sIJxLlS6Q4sNGbnQU0yKVM0t5sa3R2Wx7KlVZaxI6pl2oPLX_KQTh1-yXEj_6LlnAhLBLXOJYJLMY61MBN_VD2KLlIzGe2jJ4qe01JXiMy116bqsM2Gxc7Stj2edcmIKpohkKp1GsGKD6_sI9hQhn2-vHy_ve-HQK_9ybbPB7O4Q1-LxENfVzX-uydDtgTshAF348RqgDeymB3QchgF04wV66guOyyoFmjBpMADM9Uos6sLvk13vKtfH__FFvkQO1JYVtu0X) to learn more. | ||
Supported locales are exported as the `Locale` enum type. | ||
#### Dynamically Load Emojis and Fonts | ||
@@ -304,0 +319,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
5421153
4261
409
4
+ Addedyoga-wasm-web@^0.3.0
+ Addedyoga-wasm-web@0.3.3(transitive)
- Removedyoga-layout-prebuilt@^1.10.0
- Removed@types/yoga-layout@1.9.2(transitive)
- Removedyoga-layout-prebuilt@1.10.0(transitive)