@sanity/document-internationalization 1.0.2 β†’ 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/document-internationalization",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Provides document level translations for Sanity Studio",
5
5
  "keywords": [
6
6
  "sanity",
@@ -16,10 +16,16 @@ const EmojiBox = styled(Box)`
16
16
  transform: translateY(1px);
17
17
  `
18
18
 
19
+ function flagIcon(flagEmoji: string | undefined) {
20
+ const flagHtml = twemoji.parse(flagEmoji ?? `πŸ‡ΊπŸ‡³`, {folder: 'svg', ext: '.svg'})
21
+ // temporary fix because maxcdn has stopped supporting twemoji
22
+ // https://github.com/twitter/twemoji/issues/580#issuecomment-1377111079
23
+ return parse(flagHtml.replace('twemoji.maxcdn.com/v', 'cdnjs.cloudflare.com/ajax/libs/twemoji'))
24
+ }
25
+
19
26
  export const SingleFlag: React.FunctionComponent<Props> = ({code, langCulture}) => {
20
27
  const flagEmoji = useMemo(() => code && getFlag(code), [code])
21
- const flagHtml = twemoji.parse(flagEmoji ?? `πŸ‡ΊπŸ‡³`, {folder: 'svg', ext: '.svg'})
22
- const flagReact = parse(flagHtml)
28
+ const flagReact = flagIcon(flagEmoji)
23
29
 
24
30
  const {customFlagComponents} = useContext(LanguageConfigContext)
25
31
  const CustomFlagComponent = useMemo(() => {