@vercel/og 0.8.0 → 0.8.2

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.
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Modified version of https://unpkg.com/twemoji@13.1.0/dist/twemoji.esm.js.
3
+ */
4
+ /*! Copyright Twitter Inc. and other contributors. Licensed under MIT */
5
+ const U200D = String.fromCharCode(8205);
6
+ const UFE0Fg = /\uFE0F/g;
7
+ export function getIconCode(char) {
8
+ return toCodePoint(char.indexOf(U200D) < 0 ? char.replace(UFE0Fg, '') : char);
9
+ }
10
+ function toCodePoint(unicodeSurrogates) {
11
+ var r = [], c = 0, p = 0, i = 0;
12
+ while (i < unicodeSurrogates.length) {
13
+ c = unicodeSurrogates.charCodeAt(i++);
14
+ if (p) {
15
+ r.push((65536 + ((p - 55296) << 10) + (c - 56320)).toString(16));
16
+ p = 0;
17
+ }
18
+ else if (55296 <= c && c <= 56319) {
19
+ p = c;
20
+ }
21
+ else {
22
+ r.push(c.toString(16));
23
+ }
24
+ }
25
+ return r.join('-');
26
+ }
27
+ const apis = {
28
+ twemoji: (code) => 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg/' + code.toLowerCase() + '.svg',
29
+ openmoji: 'https://cdn.jsdelivr.net/npm/@svgmoji/openmoji@2.0.0/svg/',
30
+ blobmoji: 'https://cdn.jsdelivr.net/npm/@svgmoji/blob@2.0.0/svg/',
31
+ noto: 'https://cdn.jsdelivr.net/gh/svgmoji/svgmoji/packages/svgmoji__noto/svg/',
32
+ fluent: (code) => 'https://cdn.jsdelivr.net/gh/shuding/fluentui-emoji-unicode/assets/' +
33
+ code.toLowerCase() +
34
+ '_color.svg',
35
+ fluentFlat: (code) => 'https://cdn.jsdelivr.net/gh/shuding/fluentui-emoji-unicode/assets/' +
36
+ code.toLowerCase() +
37
+ '_flat.svg',
38
+ };
39
+ export function loadEmoji(code, type) {
40
+ // https://github.com/svgmoji/svgmoji
41
+ if (!type || !apis[type]) {
42
+ type = 'twemoji';
43
+ }
44
+ const api = apis[type];
45
+ if (typeof api === 'function') {
46
+ return fetch(api(code));
47
+ }
48
+ return fetch(`${api}${code.toUpperCase()}.svg`);
49
+ }
@@ -1,7 +1,6 @@
1
1
  import type { ReactElement } from 'react';
2
- import type { ImageResponseOptions, FigmaImageResponseProps } from './types';
2
+ import type { ImageResponseOptions } from './types';
3
3
  export declare class ImageResponse extends Response {
4
4
  constructor(element: ReactElement, options?: ImageResponseOptions);
5
5
  }
6
- export declare const experimental_FigmaImageResponse: (props: FigmaImageResponseProps) => Promise<ImageResponse>;
7
6
  export type EdgeImageResponse = typeof ImageResponse;