react-native-nano-icons 1.0.1 → 1.1.0-beta.1
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/README.md +137 -21
- package/android/src/main/java/com/nanoicons/NanoIconFonts.kt +15 -0
- package/android/src/main/java/com/nanoicons/NanoIconView.kt +27 -4
- package/android/src/main/java/com/nanoicons/NanoIconViewManager.kt +7 -0
- package/android/src/main/java/com/nanoicons/NanoIconsFontLoaderModule.kt +3 -0
- package/common/cpp/react/renderer/components/RNNanoIconsSpec/NanoIconProps.cpp +6 -1
- package/common/cpp/react/renderer/components/RNNanoIconsSpec/NanoIconProps.h +4 -2
- package/ios/NanoIconView.mm +12 -0
- package/ios/NanoIconsFontLoader.mm +5 -0
- package/lib/commonjs/cli/build.d.ts +26 -0
- package/lib/commonjs/cli/build.js +174 -64
- package/lib/commonjs/cli/buildSymbols.d.ts +17 -0
- package/lib/commonjs/cli/buildSymbols.js +103 -42
- package/lib/commonjs/cli/expoConfig.d.ts +10 -0
- package/lib/commonjs/cli/expoConfig.js +22 -7
- package/lib/commonjs/cli/fingerprint.d.ts +15 -0
- package/lib/commonjs/cli/fingerprint.js +36 -0
- package/lib/commonjs/cli/index.d.ts +2 -2
- package/lib/commonjs/cli/index.js +3 -1
- package/lib/commonjs/cli/link.d.ts +4 -0
- package/lib/commonjs/cli/link.js +25 -0
- package/lib/commonjs/cli/sameOutputs.d.ts +5 -0
- package/lib/commonjs/cli/sameOutputs.js +45 -0
- package/lib/commonjs/index.node.js +1 -1
- package/lib/commonjs/plugin/src/buildFonts.d.ts +3 -2
- package/lib/commonjs/plugin/src/buildFonts.js +11 -3
- package/lib/commonjs/plugin/src/buildSymbols.d.ts +2 -2
- package/lib/commonjs/plugin/src/buildSymbols.js +10 -3
- package/lib/commonjs/plugin/src/frozen.d.ts +3 -0
- package/lib/commonjs/plugin/src/frozen.js +18 -0
- package/lib/commonjs/plugin/src/index.js +3 -3
- package/lib/commonjs/plugin/src/types.d.ts +10 -0
- package/lib/commonjs/plugin/src/withNanoIconsDrawableLinking.d.ts +1 -1
- package/lib/commonjs/plugin/src/withNanoIconsDrawableLinking.js +2 -2
- package/lib/commonjs/plugin/src/withNanoIconsFontLinking.d.ts +3 -3
- package/lib/commonjs/plugin/src/withNanoIconsFontLinking.js +8 -8
- package/lib/commonjs/plugin/src/withNanoIconsSymbolLinking.d.ts +1 -1
- package/lib/commonjs/plugin/src/withNanoIconsSymbolLinking.js +2 -2
- package/lib/commonjs/scripts/cli.js +31 -2
- package/lib/commonjs/src/core/flatten/dom.js +40 -5
- package/lib/commonjs/src/core/flatten/element.js +2 -1
- package/lib/commonjs/src/core/flatten/stages/collapse.js +12 -0
- package/lib/commonjs/src/core/font/compile.d.ts +0 -1
- package/lib/commonjs/src/core/font/compile.js +2 -8
- package/lib/commonjs/src/core/glyph/merge.d.ts +2 -1
- package/lib/commonjs/src/core/glyph/merge.js +27 -36
- package/lib/commonjs/src/core/glyph/parse.d.ts +1 -2
- package/lib/commonjs/src/core/glyph/parse.js +31 -18
- package/lib/commonjs/src/core/pathkit/winding.d.ts +7 -1
- package/lib/commonjs/src/core/pathkit/winding.js +172 -0
- package/lib/commonjs/src/core/pipeline/config.d.ts +1 -0
- package/lib/commonjs/src/core/pipeline/prepare.d.ts +1 -1
- package/lib/commonjs/src/core/pipeline/prepare.js +3 -16
- package/lib/commonjs/src/core/pipeline/prepareIcon.d.ts +1 -0
- package/lib/commonjs/src/core/pipeline/prepareIcon.js +1 -1
- package/lib/commonjs/src/core/pipeline/preparedSvgCache.js +1 -1
- package/lib/commonjs/src/core/pipeline/runFontPipeline.js +20 -12
- package/lib/commonjs/src/core/symbols/knockout.js +4 -3
- package/lib/commonjs/src/utils/fingerPrint.d.ts +1 -0
- package/lib/commonjs/src/utils/fingerPrint.js +3 -1
- package/lib/commonjs/src/utils/fontIdentity.d.ts +1 -1
- package/lib/commonjs/src/utils/fontIdentity.js +2 -2
- package/lib/module/createNanoIconsSet.js +0 -1
- package/lib/module/createNanoIconsSet.native.js +22 -18
- package/lib/module/createNanoIconsSet.shared.js +32 -18
- package/lib/module/createNanoIconsSet.web.js +103 -61
- package/lib/module/devServerFont.js +1 -1
- package/lib/module/devServerFont.web.js +3 -5
- package/lib/module/fontIntegrity.js +20 -38
- package/lib/module/fontIntegrity.web.js +48 -0
- package/lib/module/fontIntegrityStore.js +65 -0
- package/lib/module/index.js +1 -1
- package/lib/module/index.node.js +1 -1
- package/lib/module/index.web.js +4 -0
- package/lib/module/loadDynamicFont.js +3 -15
- package/lib/module/specs/NanoIconViewNativeComponent.ts +2 -1
- package/lib/module/utils/fingerPrint.js +3 -2
- package/lib/module/utils/fontIdentity.js +2 -2
- package/lib/module/utils/fontScale.js +10 -2
- package/lib/module/utils/glyphRuntime.js +13 -0
- package/lib/module/utils/iconAccessibility.js +26 -0
- package/lib/module/utils/iconPropsEqual.js +27 -0
- package/lib/module/utils/webCss.js +26 -0
- package/lib/module/utils/webStyle.js +86 -0
- package/lib/module/webFont.js +33 -0
- package/lib/typescript/src/const/codegenPrimitives.d.ts +1 -0
- package/lib/typescript/src/core/glyph/merge.d.ts +2 -1
- package/lib/typescript/src/core/glyph/parse.d.ts +1 -2
- package/lib/typescript/src/core/pathkit/winding.d.ts +7 -1
- package/lib/typescript/src/createNanoIconsSet.d.ts +0 -1
- package/lib/typescript/src/createNanoIconsSet.native.d.ts +0 -2
- package/lib/typescript/src/createNanoIconsSet.shared.d.ts +1 -3
- package/lib/typescript/src/createNanoIconsSet.web.d.ts +1 -2
- package/lib/typescript/src/fontIntegrity.d.ts +2 -14
- package/lib/typescript/src/fontIntegrity.web.d.ts +7 -0
- package/lib/typescript/src/fontIntegrityStore.d.ts +19 -0
- package/lib/typescript/src/index.d.ts +2 -1
- package/lib/typescript/src/index.web.d.ts +5 -0
- package/lib/typescript/src/loadDynamicFont.d.ts +0 -1
- package/lib/typescript/src/specs/NanoIconViewNativeComponent.d.ts +2 -1
- package/lib/typescript/src/specs/NativeNanoIconsFontLoader.d.ts +1 -0
- package/lib/typescript/src/types.d.ts +37 -9
- package/lib/typescript/src/utils/fingerPrint.d.ts +1 -0
- package/lib/typescript/src/utils/fontIdentity.d.ts +1 -1
- package/lib/typescript/src/utils/glyphRuntime.d.ts +8 -0
- package/lib/typescript/src/utils/iconAccessibility.d.ts +4 -0
- package/lib/typescript/src/utils/iconPropsEqual.d.ts +4 -0
- package/lib/typescript/src/utils/webCss.d.ts +9 -0
- package/lib/typescript/src/utils/webStyle.d.ts +3 -0
- package/lib/typescript/src/webFont.d.ts +6 -0
- package/package.json +19 -3
- package/src/const/codegenPrimitives.ts +3 -3
- package/src/specs/NanoIconViewNativeComponent.ts +2 -1
- package/src/specs/NativeNanoIconsFontLoader.ts +1 -0
- package/lib/commonjs/src/core/pathkit/evenodd.d.ts +0 -12
- package/lib/commonjs/src/core/pathkit/evenodd.js +0 -37
- package/lib/typescript/src/core/pathkit/evenodd.d.ts +0 -13
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { useSyncExternalStore } from 'react';
|
|
4
|
-
import { Image
|
|
5
|
-
import { FONT_SOURCE_CODE, resolveFontIssue } from
|
|
4
|
+
import { Image } from 'react-native';
|
|
5
|
+
import { FONT_SOURCE_CODE, resolveFontIssue } from './fontIntegrity';
|
|
6
6
|
import NanoIconsFontLoader from './nativeFontLoader';
|
|
7
7
|
import { runtimeError } from "./utils/runtimeLog.js";
|
|
8
8
|
|
|
@@ -46,18 +46,6 @@ export function resolveFontUri(font) {
|
|
|
46
46
|
throw fontSourceError('Unsupported font source. Pass require("Foo.ttf"), { uri }, or a path string.');
|
|
47
47
|
}
|
|
48
48
|
async function register(family, uri) {
|
|
49
|
-
if (Platform.OS === 'web') {
|
|
50
|
-
// Browser FontFace API. Typed loosely so this compiles under both the RN-only
|
|
51
|
-
// lib config and a DOM-aware app config without depending on the DOM lib.
|
|
52
|
-
const g = globalThis;
|
|
53
|
-
if (!g.FontFace || !g.document?.fonts) {
|
|
54
|
-
throw runtimeError('FontFace API unavailable; cannot load dynamic font on this platform.');
|
|
55
|
-
}
|
|
56
|
-
const face = new g.FontFace(family, `url(${uri})`);
|
|
57
|
-
await face.load();
|
|
58
|
-
g.document.fonts.add(face);
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
49
|
if (!NanoIconsFontLoader) {
|
|
62
50
|
throw runtimeError('Native font loader is unavailable (Expo Go or module not built). ' + 'Load the font yourself, or use a development/production build.');
|
|
63
51
|
}
|
|
@@ -113,7 +101,7 @@ export function useDynamicFontPending(managed, family) {
|
|
|
113
101
|
const status = useDynamicFontStatus(family);
|
|
114
102
|
return managed && status === 'loading';
|
|
115
103
|
}
|
|
116
|
-
|
|
104
|
+
function useDynamicFontStatus(family) {
|
|
117
105
|
return useSyncExternalStore(cb => {
|
|
118
106
|
listeners.add(cb);
|
|
119
107
|
return () => listeners.delete(cb);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { codegenNativeComponent } from 'react-native';
|
|
2
2
|
import type { ColorValue, ViewProps } from 'react-native';
|
|
3
|
-
import type { Float, Int32 } from '../const/codegenPrimitives';
|
|
3
|
+
import type { Float, Int32, WithDefault } from '../const/codegenPrimitives';
|
|
4
4
|
|
|
5
5
|
export interface NativeProps extends ViewProps {
|
|
6
6
|
fontFamily: string;
|
|
@@ -12,6 +12,7 @@ export interface NativeProps extends ViewProps {
|
|
|
12
12
|
fontScale: Float;
|
|
13
13
|
advanceWidth: Int32;
|
|
14
14
|
unitsPerEm: Int32;
|
|
15
|
+
squareGlyphScale?: WithDefault<Float, 0>;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export default codegenNativeComponent<NativeProps>('NanoIconView', {
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
const crypto = require('crypto');
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
const path = require('path');
|
|
6
|
+
const CRLF = /\r\n/g;
|
|
6
7
|
export function getFingerprintSync(dir, inputs) {
|
|
7
8
|
return fingerprintSvgDirSync(dir, inputs).hash;
|
|
8
9
|
}
|
|
9
10
|
export function fingerprintSvgDirSync(dir, inputs) {
|
|
10
|
-
return hashSvgDir(dir, [inputs.upm, inputs.safeZone, inputs.startUnicode, inputs.version, inputs.toolchain]);
|
|
11
|
+
return hashSvgDir(dir, [inputs.upm, inputs.safeZone, inputs.curveTolerance, inputs.startUnicode, inputs.version, inputs.toolchain]);
|
|
11
12
|
}
|
|
12
13
|
export function fingerprintSymbolDirSync(dir, inputs) {
|
|
13
14
|
return hashSvgDir(dir, ['symbol', inputs.prefix, inputs.version, inputs.toolchain]);
|
|
@@ -18,7 +19,7 @@ function hashSvgDir(dir, settings) {
|
|
|
18
19
|
const svgHashByFile = new Map();
|
|
19
20
|
for (const file of files) {
|
|
20
21
|
const filePath = path.join(dir, file);
|
|
21
|
-
const content = fs.readFileSync(filePath);
|
|
22
|
+
const content = fs.readFileSync(filePath, 'utf8').replace(CRLF, '\n');
|
|
22
23
|
// Hash both path and content
|
|
23
24
|
hash.update(file);
|
|
24
25
|
hash.update(content);
|
|
@@ -5,8 +5,8 @@ const BUILD_HASH = `[0-9a-f]{${BUILD_HASH_LENGTH}}`;
|
|
|
5
5
|
const BUILD_SUFFIX = new RegExp(`-${BUILD_HASH}$`);
|
|
6
6
|
const BUILD_FONT_FILE = new RegExp(`-${BUILD_HASH}\\.ttf$`);
|
|
7
7
|
const REGEX_SPECIALS = /[.*+?^${}()|[\]\\]/g;
|
|
8
|
-
export function buildFontFamily(fontFamily,
|
|
9
|
-
return `${fontFamily}-${
|
|
8
|
+
export function buildFontFamily(fontFamily, contentHash) {
|
|
9
|
+
return `${fontFamily}-${contentHash.slice(0, BUILD_HASH_LENGTH)}`;
|
|
10
10
|
}
|
|
11
11
|
export function configuredFontFamily(family) {
|
|
12
12
|
return family.replace(BUILD_SUFFIX, '');
|
|
@@ -9,7 +9,15 @@ function subscribe(onChange) {
|
|
|
9
9
|
function getFontScale() {
|
|
10
10
|
return PixelRatio.getFontScale();
|
|
11
11
|
}
|
|
12
|
+
function subscribeNever() {
|
|
13
|
+
return () => {};
|
|
14
|
+
}
|
|
15
|
+
function noScale() {
|
|
16
|
+
return 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Icons with font scaling disabled don't subscribe, so they don't add a
|
|
20
|
+
// Dimensions listener or re-render on window changes.
|
|
12
21
|
export function useFontScale(enabled) {
|
|
13
|
-
|
|
14
|
-
return enabled ? fontScale : 1;
|
|
22
|
+
return useSyncExternalStore(enabled ? subscribe : subscribeNever, enabled ? getFontScale : noScale);
|
|
15
23
|
}
|
|
@@ -11,6 +11,19 @@ export function resolveGlyphEntry(glyphMap, name) {
|
|
|
11
11
|
return glyphMap.i[name] ?? [glyphMap.m.u, [[63, 'black']]];
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Size of a glyph in a square box, as fractions of the box side: the glyph's
|
|
16
|
+
* longer side fits the safe zone.
|
|
17
|
+
*/
|
|
18
|
+
export function squareGlyphBox(advanceWidth, unitsPerEm, safeZone) {
|
|
19
|
+
const contentWidth = advanceWidth - (unitsPerEm - safeZone);
|
|
20
|
+
const scale = contentWidth > safeZone ? safeZone / contentWidth : 1;
|
|
21
|
+
return {
|
|
22
|
+
scale,
|
|
23
|
+
width: advanceWidth / unitsPerEm * scale
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
14
27
|
/** A memoized codepoint -> string converter, scoped per icon set. */
|
|
15
28
|
export function createCharCache() {
|
|
16
29
|
const cache = new Map();
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function iconAccessibilityProps({
|
|
4
|
+
accessible,
|
|
5
|
+
accessibilityLabel,
|
|
6
|
+
accessibilityRole,
|
|
7
|
+
accessibilityElementsHidden,
|
|
8
|
+
importantForAccessibility
|
|
9
|
+
}) {
|
|
10
|
+
if (accessibilityLabel || accessible === true || accessibilityElementsHidden === false || importantForAccessibility === 'yes' || accessibilityRole !== undefined && accessibilityRole !== 'none') {
|
|
11
|
+
return {
|
|
12
|
+
accessible,
|
|
13
|
+
accessibilityLabel,
|
|
14
|
+
accessibilityRole: accessibilityRole ?? 'image',
|
|
15
|
+
accessibilityElementsHidden,
|
|
16
|
+
importantForAccessibility
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
accessible: accessible ?? false,
|
|
21
|
+
accessibilityLabel,
|
|
22
|
+
accessibilityRole,
|
|
23
|
+
accessibilityElementsHidden: accessibilityElementsHidden ?? true,
|
|
24
|
+
importantForAccessibility: importantForAccessibility ?? 'no-hide-descendants'
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { shallowEqualColor } from "./shallowEqualColor.js";
|
|
4
|
+
const hasOwn = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
5
|
+
export function shallowEqualStyle(a, b) {
|
|
6
|
+
if (a === b) return true;
|
|
7
|
+
if (Array.isArray(a) || Array.isArray(b)) {
|
|
8
|
+
return Array.isArray(a) && Array.isArray(b) && a.length === b.length && a.every((item, i) => shallowEqualStyle(item, b[i]));
|
|
9
|
+
}
|
|
10
|
+
if (a === null || b === null || typeof a !== 'object' || typeof b !== 'object') {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
const aStyle = a;
|
|
14
|
+
const bStyle = b;
|
|
15
|
+
const keys = Object.keys(aStyle);
|
|
16
|
+
return keys.length === Object.keys(bStyle).length && keys.every(key => hasOwn(bStyle, key) && Object.is(aStyle[key], bStyle[key]));
|
|
17
|
+
}
|
|
18
|
+
export function areIconPropsEqual(prev, next) {
|
|
19
|
+
const keys = Object.keys(prev);
|
|
20
|
+
if (keys.length !== Object.keys(next).length) return false;
|
|
21
|
+
return keys.every(key => {
|
|
22
|
+
if (!hasOwn(next, key)) return false;
|
|
23
|
+
if (key === 'style') return shallowEqualStyle(prev.style, next.style);
|
|
24
|
+
if (key === 'color') return shallowEqualColor(prev.color, next.color);
|
|
25
|
+
return Object.is(prev[key], next[key]);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export const ICON_CLASS = 'nano-icon';
|
|
4
|
+
export const STYLE_HREF = 'react-native-nano-icons';
|
|
5
|
+
export const STYLE_PRECEDENCE = 'react-native-nano-icons';
|
|
6
|
+
export const BASE_CSS = `:where(.${ICON_CLASS}){display:inline-block;position:relative;` + 'width:calc(var(--nano-icon-ratio,1)*1em);height:1em;line-height:0;vertical-align:middle}' + `.${ICON_CLASS}>span{position:absolute;left:0;bottom:0;color:inherit;` + 'font-family:inherit;font-size:inherit;font-weight:normal;font-style:normal;' + 'line-height:1;white-space:pre}';
|
|
7
|
+
export const BASE_HREF = `${STYLE_HREF}:${shortHash(BASE_CSS)}`;
|
|
8
|
+
const TEXT_COLORS = new Set(['black', '#000', '#000f', '#000000', '#000000ff', 'rgb(0,0,0)', 'rgba(0,0,0,1)', 'currentcolor']);
|
|
9
|
+
const followsTextColorByLayers = new WeakMap();
|
|
10
|
+
export function followsTextColor(layers) {
|
|
11
|
+
let follows = followsTextColorByLayers.get(layers);
|
|
12
|
+
if (follows === undefined) {
|
|
13
|
+
follows = layers.every(([, srcColor]) => TEXT_COLORS.has(srcColor.replace(/\s+/g, '').toLowerCase()));
|
|
14
|
+
followsTextColorByLayers.set(layers, follows);
|
|
15
|
+
}
|
|
16
|
+
return follows;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// @keep: 32-bit FNV-1a hash in base 36, a short and stable id for the hoisted <style> href.
|
|
20
|
+
export function shortHash(value) {
|
|
21
|
+
let hash = 0x811c9dc5;
|
|
22
|
+
for (let i = 0; i < value.length; i++) {
|
|
23
|
+
hash = Math.imul(hash ^ value.charCodeAt(i), 0x01000193);
|
|
24
|
+
}
|
|
25
|
+
return (hash >>> 0).toString(36);
|
|
26
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const SIDE_AXIS = {
|
|
4
|
+
Top: 'Vertical',
|
|
5
|
+
Bottom: 'Vertical',
|
|
6
|
+
Left: 'Horizontal',
|
|
7
|
+
Right: 'Horizontal'
|
|
8
|
+
};
|
|
9
|
+
const SIDES = Object.keys(SIDE_AXIS);
|
|
10
|
+
const LOGICAL_RENAMES = {
|
|
11
|
+
marginStart: 'marginInlineStart',
|
|
12
|
+
marginEnd: 'marginInlineEnd',
|
|
13
|
+
paddingStart: 'paddingInlineStart',
|
|
14
|
+
paddingEnd: 'paddingInlineEnd',
|
|
15
|
+
start: 'insetInlineStart',
|
|
16
|
+
end: 'insetInlineEnd'
|
|
17
|
+
};
|
|
18
|
+
function flattenInto(style, out) {
|
|
19
|
+
if (Array.isArray(style)) {
|
|
20
|
+
for (const entry of style) flattenInto(entry, out);
|
|
21
|
+
} else if (style != null && typeof style === 'object') {
|
|
22
|
+
Object.assign(out, style);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function expandBox(style, prop) {
|
|
26
|
+
const horizontal = `${prop}Horizontal`;
|
|
27
|
+
const vertical = `${prop}Vertical`;
|
|
28
|
+
const hasAxis = style[horizontal] !== undefined || style[vertical] !== undefined;
|
|
29
|
+
const hasSide = SIDES.some(side => style[`${prop}${side}`] !== undefined);
|
|
30
|
+
if (!hasAxis && !(hasSide && style[prop] !== undefined)) return;
|
|
31
|
+
for (const side of SIDES) {
|
|
32
|
+
const value = style[`${prop}${side}`] ?? style[`${prop}${SIDE_AXIS[side]}`] ?? style[prop];
|
|
33
|
+
if (value !== undefined) style[`${prop}${side}`] = value;
|
|
34
|
+
}
|
|
35
|
+
delete style[prop];
|
|
36
|
+
delete style[horizontal];
|
|
37
|
+
delete style[vertical];
|
|
38
|
+
}
|
|
39
|
+
function transformFunction(entry) {
|
|
40
|
+
const [type, value] = Object.entries(entry)[0] ?? [];
|
|
41
|
+
if (type === undefined) return '';
|
|
42
|
+
if (Array.isArray(value)) {
|
|
43
|
+
const name = type === 'matrix' && value.length === 16 ? 'matrix3d' : type;
|
|
44
|
+
return `${name}(${value.join(',')})`;
|
|
45
|
+
}
|
|
46
|
+
if (typeof value === 'number' && !type.startsWith('scale')) {
|
|
47
|
+
return `${type}(${value}px)`;
|
|
48
|
+
}
|
|
49
|
+
return `${type}(${String(value)})`;
|
|
50
|
+
}
|
|
51
|
+
function lengthList(value) {
|
|
52
|
+
return value.map(v => typeof v === 'number' ? `${v}px` : String(v)).join(' ');
|
|
53
|
+
}
|
|
54
|
+
export function resolveWebStyle(style) {
|
|
55
|
+
if (style == null || style === false) return undefined;
|
|
56
|
+
const flat = {};
|
|
57
|
+
flattenInto(style, flat);
|
|
58
|
+
expandBox(flat, 'margin');
|
|
59
|
+
expandBox(flat, 'padding');
|
|
60
|
+
for (const [from, to] of Object.entries(LOGICAL_RENAMES)) {
|
|
61
|
+
if (flat[from] === undefined) continue;
|
|
62
|
+
flat[to] ??= flat[from];
|
|
63
|
+
delete flat[from];
|
|
64
|
+
}
|
|
65
|
+
if (Array.isArray(flat.transform)) {
|
|
66
|
+
flat.transform = flat.transform.map(transformFunction).join(' ');
|
|
67
|
+
}
|
|
68
|
+
if (Array.isArray(flat.transformOrigin)) {
|
|
69
|
+
flat.transformOrigin = lengthList(flat.transformOrigin);
|
|
70
|
+
}
|
|
71
|
+
if (typeof flat.lineHeight === 'number') {
|
|
72
|
+
flat.lineHeight = `${flat.lineHeight}px`;
|
|
73
|
+
}
|
|
74
|
+
if (flat.borderStyle === undefined) {
|
|
75
|
+
if (flat.borderWidth != null) {
|
|
76
|
+
flat.borderStyle = 'solid';
|
|
77
|
+
} else {
|
|
78
|
+
for (const side of SIDES) {
|
|
79
|
+
if (flat[`border${side}Width`] != null) {
|
|
80
|
+
flat[`border${side}Style`] = 'solid';
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return flat;
|
|
86
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { runtimeError, warnRuntime } from "./utils/runtimeLog.js";
|
|
4
|
+
const registered = new Map();
|
|
5
|
+
export function webFontUrl(font) {
|
|
6
|
+
if (typeof font === 'string') return font;
|
|
7
|
+
if (font != null && typeof font === 'object' && typeof font.uri === 'string') {
|
|
8
|
+
return font.uri;
|
|
9
|
+
}
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
export function isWebFontRegistered(family) {
|
|
13
|
+
return registered.has(family);
|
|
14
|
+
}
|
|
15
|
+
export async function registerWebFont(family, url) {
|
|
16
|
+
if (registered.get(family) === url) return;
|
|
17
|
+
const g = globalThis;
|
|
18
|
+
if (!g.FontFace || !g.document?.fonts) {
|
|
19
|
+
throw runtimeError('FontFace API unavailable; cannot load the icon font.');
|
|
20
|
+
}
|
|
21
|
+
const face = new g.FontFace(family, `url(${JSON.stringify(url)})`, {
|
|
22
|
+
display: 'block'
|
|
23
|
+
});
|
|
24
|
+
await face.load();
|
|
25
|
+
g.document.fonts.add(face);
|
|
26
|
+
registered.set(family, url);
|
|
27
|
+
}
|
|
28
|
+
export function __resetWebFontsForTests() {
|
|
29
|
+
registered.clear();
|
|
30
|
+
}
|
|
31
|
+
export function warnFontNotLoaded(fontBasename) {
|
|
32
|
+
warnRuntime(`Icon font "${fontBasename}" is not loaded on web: pass its url, e.g. require("${fontBasename}.woff2") or { uri }.`);
|
|
33
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { PathKitModule } from '../pathkit/types';
|
|
1
2
|
import type { NanoLogger } from '../types';
|
|
2
3
|
import type { ParsedPath } from './parse';
|
|
3
4
|
/**
|
|
4
5
|
* Merge consecutive same-color paths into single compound paths.
|
|
5
6
|
* Preserves z-order: only merges runs of adjacent paths with identical fill color.
|
|
6
7
|
*/
|
|
7
|
-
export declare function mergeSameColorPaths(paths: ParsedPath[], logger?: NanoLogger): ParsedPath[];
|
|
8
|
+
export declare function mergeSameColorPaths(paths: ParsedPath[], pathkit: PathKitModule, logger?: NanoLogger): ParsedPath[];
|
|
8
9
|
//# sourceMappingURL=merge.d.ts.map
|
|
@@ -2,14 +2,13 @@ import { type Element } from '@xmldom/xmldom';
|
|
|
2
2
|
export type ParsedPath = {
|
|
3
3
|
d: string;
|
|
4
4
|
fill: string | null;
|
|
5
|
-
fillRule?: 'evenodd';
|
|
6
|
-
noMerge?: boolean;
|
|
7
5
|
knockout?: boolean;
|
|
8
6
|
};
|
|
9
7
|
export type ParsedFlatSvg = {
|
|
10
8
|
viewBox: [number, number, number, number];
|
|
11
9
|
paths: ParsedPath[];
|
|
12
10
|
};
|
|
11
|
+
export declare function attribute(el: Element, name: string): string | null;
|
|
13
12
|
export declare function calculateOpColor(fill: string | null, opacity: number, el: Element): `rgba(${number},${number},${number},${number})`;
|
|
14
13
|
/**
|
|
15
14
|
* If a flattened path lost its initial moveto (e.g. an empty `Mx y z`
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import type { PathKitModule, PathKitPath } from './types';
|
|
1
|
+
import type { Cmd, PathKitModule, PathKitPath } from './types';
|
|
2
2
|
export declare function orientedPathData(PathKit: PathKitModule, path: PathKitPath): string;
|
|
3
3
|
export declare function canonicalWinding(PathKit: PathKitModule, d: string): string;
|
|
4
4
|
export declare function reversedWinding(PathKit: PathKitModule, d: string): string;
|
|
5
|
+
export type WindingAnalysis = {
|
|
6
|
+
contours: Cmd[][];
|
|
7
|
+
outerSigns: (-1 | 0 | 1)[];
|
|
8
|
+
};
|
|
9
|
+
export declare function analyzeWinding(PathKit: PathKitModule, d: string): WindingAnalysis | null;
|
|
10
|
+
export declare function pathDataWithWinding(PathKit: PathKitModule, d: string, analysis: WindingAnalysis, sign: -1 | 1): string;
|
|
5
11
|
//# sourceMappingURL=winding.d.ts.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { NanoGlyphMapInput } from './core/types';
|
|
2
2
|
import type { IconComponent } from './types';
|
|
3
3
|
export type { IconComponent, IconProps } from './types';
|
|
4
|
-
export { shallowEqualColor } from './utils/shallowEqualColor';
|
|
5
4
|
export declare function createIconSet<GM extends NanoGlyphMapInput>(glyphMap: GM): IconComponent<GM>;
|
|
6
5
|
export declare function createIconSet<GM extends NanoGlyphMapInput>(glyphMap: GM, font: unknown): IconComponent<GM>;
|
|
7
6
|
//# sourceMappingURL=createNanoIconsSet.d.ts.map
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { NanoGlyphMapInput } from './core/types';
|
|
2
2
|
import type { IconComponent, IconProps } from './types';
|
|
3
|
-
import { shallowEqualColor } from './utils/shallowEqualColor';
|
|
4
3
|
export type { IconComponent, IconProps };
|
|
5
|
-
export { shallowEqualColor };
|
|
6
4
|
export declare function createIconSet<GM extends NanoGlyphMapInput>(glyphMap: GM): IconComponent<GM>;
|
|
7
5
|
export declare function createIconSet<GM extends NanoGlyphMapInput>(glyphMap: GM, font: unknown): IconComponent<GM>;
|
|
8
6
|
//# sourceMappingURL=createNanoIconsSet.native.d.ts.map
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { NanoGlyphMapInput } from './core/types';
|
|
2
2
|
import type { IconComponent, IconProps } from './types';
|
|
3
|
-
import { shallowEqualColor } from './utils/shallowEqualColor';
|
|
4
3
|
export type { IconComponent, IconProps };
|
|
5
|
-
export { shallowEqualColor };
|
|
6
4
|
/**
|
|
7
5
|
* Warn when the `font` argument and the glyphmap's linking mode are inconsistent.
|
|
8
6
|
*
|
|
@@ -15,7 +13,7 @@ export { shallowEqualColor };
|
|
|
15
13
|
export declare function warnIfLinkingMismatch(fontFamily: string, linking: string | undefined, font: unknown): void;
|
|
16
14
|
/**
|
|
17
15
|
* JS implementation using <View> + <Text> layers.
|
|
18
|
-
* Used
|
|
16
|
+
* Used as a fallback when native component is unavailable (e.g. Expo Go).
|
|
19
17
|
*/
|
|
20
18
|
export declare function createJSIconSet<GM extends NanoGlyphMapInput>(glyphMap: GM): IconComponent<GM>;
|
|
21
19
|
export declare function createJSIconSet<GM extends NanoGlyphMapInput>(glyphMap: GM, font: unknown): IconComponent<GM>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { NanoGlyphMapInput } from './core/types';
|
|
2
2
|
import type { IconComponent, IconProps } from './types';
|
|
3
|
-
import { shallowEqualColor } from './utils/shallowEqualColor';
|
|
4
3
|
export type { IconComponent, IconProps };
|
|
5
|
-
export { shallowEqualColor };
|
|
6
4
|
export declare function createIconSet<GM extends NanoGlyphMapInput>(glyphMap: GM): IconComponent<GM>;
|
|
5
|
+
export declare function createIconSet<GM extends NanoGlyphMapInput>(glyphMap: GM, font: unknown): IconComponent<GM>;
|
|
7
6
|
//# sourceMappingURL=createNanoIconsSet.web.d.ts.map
|
|
@@ -1,24 +1,12 @@
|
|
|
1
|
-
export type FontIntegrityIssue
|
|
2
|
-
fontFamily: string;
|
|
3
|
-
family: string;
|
|
4
|
-
linking: 'static' | 'dynamic';
|
|
5
|
-
message: string;
|
|
6
|
-
/** The error behind a dynamic font failure, when there is one. */
|
|
7
|
-
cause?: unknown;
|
|
8
|
-
};
|
|
9
|
-
export type FontIntegrityStatus = 'found' | 'resolved';
|
|
10
|
-
type Listener = (issue: FontIntegrityIssue, status: FontIntegrityStatus) => void;
|
|
1
|
+
export { addFontIntegrityListener, getFontIntegrityIssues, resolveFontIssue, useFontIntegrityIssue, type FontIntegrityIssue, type FontIntegrityStatus, } from './fontIntegrityStore';
|
|
11
2
|
export declare function isFontRegistered(family: string): Promise<boolean>;
|
|
12
3
|
export declare function checkFontIntegrity(family: string, linking: 'static' | 'dynamic'): Promise<void>;
|
|
4
|
+
export declare function checkStaticFontNow(family: string): boolean;
|
|
13
5
|
export declare const FONT_MISMATCH_CODE = "E_NANOICONS_FONT_MISMATCH";
|
|
14
6
|
export declare function isFontMismatch(err: unknown): boolean;
|
|
15
7
|
export declare const FONT_SOURCE_CODE = "E_NANOICONS_FONT_SOURCE";
|
|
16
8
|
export declare function reportFontMismatch(family: string, linking: 'static' | 'dynamic'): void;
|
|
17
9
|
export declare function reportMissingDynamicFont(family: string): Promise<void>;
|
|
18
10
|
export declare function reportDynamicFontLoadFailure(family: string, cause: unknown): Promise<void>;
|
|
19
|
-
export declare function resolveFontIssue(family: string): void;
|
|
20
|
-
export declare function addFontIntegrityListener(listener: Listener): () => void;
|
|
21
|
-
export declare function getFontIntegrityIssues(): FontIntegrityIssue[];
|
|
22
11
|
export declare function __resetFontIntegrityForTests(): void;
|
|
23
|
-
export {};
|
|
24
12
|
//# sourceMappingURL=fontIntegrity.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type FontIntegrityIssue } from './fontIntegrityStore';
|
|
2
|
+
export { addFontIntegrityListener, getFontIntegrityIssues, resolveFontIssue, useFontIntegrityIssue, type FontIntegrityIssue, type FontIntegrityStatus, } from './fontIntegrityStore';
|
|
3
|
+
type Linking = FontIntegrityIssue['linking'];
|
|
4
|
+
export declare function reportFontLoadFailure(family: string, linking: Linking, cause: unknown): void;
|
|
5
|
+
export declare function watchFontLoadFailures(family: string, linking: Linking): void;
|
|
6
|
+
export declare function __resetFontIntegrityForTests(): void;
|
|
7
|
+
//# sourceMappingURL=fontIntegrity.web.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type FontIntegrityIssue = {
|
|
2
|
+
fontFamily: string;
|
|
3
|
+
family: string;
|
|
4
|
+
linking: 'static' | 'dynamic';
|
|
5
|
+
message: string;
|
|
6
|
+
/** The error behind a dynamic font failure or a web font load failure, when there is one. */
|
|
7
|
+
cause?: unknown;
|
|
8
|
+
};
|
|
9
|
+
export type FontIntegrityStatus = 'found' | 'resolved';
|
|
10
|
+
type Listener = (issue: FontIntegrityIssue, status: FontIntegrityStatus) => void;
|
|
11
|
+
export declare function causeDetail(cause: unknown): unknown[];
|
|
12
|
+
export declare function recordIssue(family: string, linking: 'static' | 'dynamic', message: string, cause?: unknown, notifyLater?: boolean): void;
|
|
13
|
+
export declare function resolveFontIssue(family: string): void;
|
|
14
|
+
export declare function addFontIntegrityListener(listener: Listener): () => void;
|
|
15
|
+
export declare function getFontIntegrityIssues(): FontIntegrityIssue[];
|
|
16
|
+
export declare function useFontIntegrityIssue(family: string): FontIntegrityIssue | undefined;
|
|
17
|
+
export declare function __resetFontIssuesForTests(): void;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=fontIntegrityStore.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { createIconSet as createNanoIconSet, type IconComponent, type IconProps, } from './createNanoIconsSet';
|
|
2
|
-
export { addFontIntegrityListener, getFontIntegrityIssues, type FontIntegrityIssue, type FontIntegrityStatus, } from './fontIntegrity';
|
|
2
|
+
export { addFontIntegrityListener, getFontIntegrityIssues, useFontIntegrityIssue, type FontIntegrityIssue, type FontIntegrityStatus, } from './fontIntegrity';
|
|
3
|
+
export type { GlyphEntry, GlyphLayer, NanoGlyphMap, NanoGlyphMapInput, } from './core/types';
|
|
3
4
|
export type { ColorValue } from 'react-native';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { createIconSet as createNanoIconSet, type IconComponent, type IconProps, } from './createNanoIconsSet.web';
|
|
2
|
+
export { addFontIntegrityListener, getFontIntegrityIssues, useFontIntegrityIssue, type FontIntegrityIssue, type FontIntegrityStatus, } from './fontIntegrity.web';
|
|
3
|
+
export type { GlyphEntry, GlyphLayer, NanoGlyphMap, NanoGlyphMapInput, } from './core/types';
|
|
4
|
+
export type { ColorValue } from 'react-native';
|
|
5
|
+
//# sourceMappingURL=index.web.d.ts.map
|
|
@@ -22,7 +22,6 @@ export declare function loadDynamicFont(family: string, font: unknown, opts?: {
|
|
|
22
22
|
* errored, or not managed by us).
|
|
23
23
|
*/
|
|
24
24
|
export declare function useDynamicFontPending(managed: boolean, family: string): boolean;
|
|
25
|
-
export declare function useDynamicFontStatus(family: string): FontStatus | undefined;
|
|
26
25
|
/** Test-only: reset module state between tests. */
|
|
27
26
|
export declare function __resetDynamicFontsForTests(): void;
|
|
28
27
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ColorValue, ViewProps } from 'react-native';
|
|
2
|
-
import type { Float, Int32 } from '../const/codegenPrimitives';
|
|
2
|
+
import type { Float, Int32, WithDefault } from '../const/codegenPrimitives';
|
|
3
3
|
export interface NativeProps extends ViewProps {
|
|
4
4
|
fontFamily: string;
|
|
5
5
|
codepoints: ReadonlyArray<Int32>;
|
|
@@ -10,6 +10,7 @@ export interface NativeProps extends ViewProps {
|
|
|
10
10
|
fontScale: Float;
|
|
11
11
|
advanceWidth: Int32;
|
|
12
12
|
unitsPerEm: Int32;
|
|
13
|
+
squareGlyphScale?: WithDefault<Float, 0>;
|
|
13
14
|
}
|
|
14
15
|
declare const _default: import("react-native/types_generated/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
|
|
15
16
|
export default _default;
|
|
@@ -3,6 +3,7 @@ export interface Spec extends TurboModule {
|
|
|
3
3
|
/** Pass glyphMap.m.f as `family`. On iOS it must also match the TTF's embedded PostScript/full name. */
|
|
4
4
|
registerFont(family: string, uri: string): Promise<boolean>;
|
|
5
5
|
isFontRegistered(family: string): Promise<boolean>;
|
|
6
|
+
isFontAvailable(family: string): boolean;
|
|
6
7
|
}
|
|
7
8
|
declare const _default: Spec | null | undefined;
|
|
8
9
|
export default _default;
|
|
@@ -1,28 +1,56 @@
|
|
|
1
1
|
import type { ComponentRef, Ref } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ColorValue, TextProps, View, ViewProps } from 'react-native';
|
|
3
3
|
import type { NanoGlyphMapInput } from './core/types';
|
|
4
4
|
import type { TintMode } from './utils/glyphRuntime';
|
|
5
5
|
type ViewRef = ComponentRef<typeof View>;
|
|
6
6
|
export type IconProps<Name> = {
|
|
7
|
+
/** Icon name: the SVG file name without `.svg`. */
|
|
7
8
|
name: Name;
|
|
9
|
+
/**
|
|
10
|
+
* Icon height in points. Defaults to `12`, and on web to `1em`, so the icon
|
|
11
|
+
* follows the CSS `font-size`.
|
|
12
|
+
*/
|
|
8
13
|
size?: number;
|
|
14
|
+
/**
|
|
15
|
+
* One color, or one per layer. A shorter array repeats its last color.
|
|
16
|
+
* Defaults to the original SVG's colors. On web, `currentColor` layers and icons
|
|
17
|
+
* drawn only in black follow the CSS `color`.
|
|
18
|
+
*/
|
|
9
19
|
color?: ColorValue | ColorValue[];
|
|
20
|
+
/**
|
|
21
|
+
* Which layers `color` applies to: every layer, or only those drawn with
|
|
22
|
+
* `currentColor`.
|
|
23
|
+
* @default 'all'
|
|
24
|
+
*/
|
|
10
25
|
tintMode?: TintMode;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
26
|
+
/**
|
|
27
|
+
* The box the icon is drawn in.
|
|
28
|
+
* - `'fit-glyph'`: `size` high and as wide as the glyph (default font
|
|
29
|
+
* behavior).
|
|
30
|
+
* - `'square'`: `size` high and wide, with the glyph fitted and centered,
|
|
31
|
+
* like `resizeMode="contain"`.
|
|
32
|
+
* @default 'fit-glyph'
|
|
33
|
+
*/
|
|
34
|
+
frame?: 'fit-glyph' | 'square';
|
|
35
|
+
/**
|
|
36
|
+
* Label announced by screen readers. Without it, the icon is decorative and
|
|
37
|
+
* hidden from screen readers, unless `accessible`, `accessibilityRole`,
|
|
38
|
+
* `importantForAccessibility="yes"` or `accessibilityElementsHidden={false}`
|
|
39
|
+
* exposes it. On web, an exposed icon without a label is named after `name`.
|
|
40
|
+
*/
|
|
14
41
|
accessibilityLabel?: string;
|
|
15
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Hides the icon from screen readers.
|
|
44
|
+
* @platform `iOS` and `Web` only - no-op on Android.
|
|
45
|
+
*/
|
|
16
46
|
accessibilityElementsHidden?: boolean;
|
|
17
|
-
importantForAccessibility?: 'auto' | 'yes' | 'no' | 'no-hide-descendants';
|
|
18
47
|
ref?: Ref<ViewRef>;
|
|
19
|
-
testID?: string;
|
|
20
48
|
/**
|
|
21
49
|
* Forwarded to the container element on web.
|
|
22
|
-
* @platform Web only - no-op on native.
|
|
50
|
+
* @platform `Web` only - no-op on native.
|
|
23
51
|
*/
|
|
24
52
|
className?: string;
|
|
25
|
-
}
|
|
53
|
+
} & Partial<Pick<TextProps, 'allowFontScaling'> & Pick<ViewProps, 'style' | 'testID' | 'accessible' | 'accessibilityRole' | 'importantForAccessibility'>>;
|
|
26
54
|
export type IconComponent<GM extends NanoGlyphMapInput> = React.FC<IconProps<keyof GM['i']>> & {
|
|
27
55
|
loadFont: (font?: number | string | {
|
|
28
56
|
uri: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function buildFontFamily(fontFamily: string,
|
|
1
|
+
export declare function buildFontFamily(fontFamily: string, contentHash: string): string;
|
|
2
2
|
export declare function configuredFontFamily(family: string): string;
|
|
3
3
|
export declare function isFontFileOf(fontFamily: string, fileName: string): boolean;
|
|
4
4
|
export declare function isBuildFontFile(fileName: string): boolean;
|
|
@@ -7,6 +7,14 @@ export declare const DEFAULT_ICON_SIZE = 12;
|
|
|
7
7
|
* (codepoint 63) sized to the font's em when the name is unknown.
|
|
8
8
|
*/
|
|
9
9
|
export declare function resolveGlyphEntry<GM extends NanoGlyphMapInput>(glyphMap: GM, name: keyof GM['i']): GlyphEntry;
|
|
10
|
+
/**
|
|
11
|
+
* Size of a glyph in a square box, as fractions of the box side: the glyph's
|
|
12
|
+
* longer side fits the safe zone.
|
|
13
|
+
*/
|
|
14
|
+
export declare function squareGlyphBox(advanceWidth: number, unitsPerEm: number, safeZone: number): {
|
|
15
|
+
scale: number;
|
|
16
|
+
width: number;
|
|
17
|
+
};
|
|
10
18
|
/** A memoized codepoint -> string converter, scoped per icon set. */
|
|
11
19
|
export declare function createCharCache(): (codepoint: number) => string;
|
|
12
20
|
/**
|