@urbit-xyz/azimuth-hanzi 0.1.0
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/LICENSE +21 -0
- package/README.md +98 -0
- package/dist/core-325c2f1f.js +989 -0
- package/dist/core-325c2f1f.js.map +1 -0
- package/dist/core-7919ab70.js +2 -0
- package/dist/core-7919ab70.js.map +1 -0
- package/dist/core-b72e8d27.js +1009 -0
- package/dist/core-b72e8d27.js.map +1 -0
- package/dist/core.cjs.development.js +15 -0
- package/dist/core.cjs.development.js.map +1 -0
- package/dist/core.cjs.production.min.js +2 -0
- package/dist/core.cjs.production.min.js.map +1 -0
- package/dist/core.d.ts +22 -0
- package/dist/core.esm.js +3 -0
- package/dist/core.esm.js.map +1 -0
- package/dist/core.js +8 -0
- package/dist/hanzi-sigil.d.ts +24 -0
- package/dist/index.cjs.development.js +126 -0
- package/dist/index.cjs.development.js.map +1 -0
- package/dist/index.cjs.production.min.js +2 -0
- package/dist/index.cjs.production.min.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.esm.js +105 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +8 -0
- package/dist/mapping.d.ts +581 -0
- package/dist/types.d.ts +68 -0
- package/package.json +71 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for generating a Hanzi sigil
|
|
3
|
+
*/
|
|
4
|
+
export type Config = {
|
|
5
|
+
/**
|
|
6
|
+
* The point that the sigil will represent, ie ~sampel-palnet
|
|
7
|
+
*/
|
|
8
|
+
point: string;
|
|
9
|
+
/**
|
|
10
|
+
* The background color of the sigil
|
|
11
|
+
* @default '#000'
|
|
12
|
+
*/
|
|
13
|
+
background?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The foreground color of the characters
|
|
16
|
+
* @default '#FFF'
|
|
17
|
+
*/
|
|
18
|
+
foreground?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The size in pixels to draw the sigil
|
|
21
|
+
* @default 128
|
|
22
|
+
*/
|
|
23
|
+
size?: number;
|
|
24
|
+
/**
|
|
25
|
+
* How much padding around the characters
|
|
26
|
+
* @default 'default'
|
|
27
|
+
*/
|
|
28
|
+
space?: 'none' | 'default' | 'large';
|
|
29
|
+
/**
|
|
30
|
+
* Font weight for the characters
|
|
31
|
+
* @default 400
|
|
32
|
+
*/
|
|
33
|
+
fontWeight?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Custom font family for rendering
|
|
36
|
+
* @default 'Noto Sans SC, Noto Sans TC, sans-serif'
|
|
37
|
+
*/
|
|
38
|
+
fontFamily?: string;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Character entry with metadata
|
|
42
|
+
*/
|
|
43
|
+
export type CharacterEntry = {
|
|
44
|
+
/** The Chinese character */
|
|
45
|
+
character: string;
|
|
46
|
+
/** Pinyin romanization with tone marks */
|
|
47
|
+
pinyin: string;
|
|
48
|
+
/** English meaning/gloss */
|
|
49
|
+
meaning: string;
|
|
50
|
+
/** Semantic category */
|
|
51
|
+
category: string;
|
|
52
|
+
};
|
|
53
|
+
export type PointType = 'galaxy' | 'star' | 'planet' | 'moon';
|
|
54
|
+
/**
|
|
55
|
+
* Result from parsing a point name
|
|
56
|
+
*/
|
|
57
|
+
export type ParsedPoint = {
|
|
58
|
+
/** Original point string */
|
|
59
|
+
point: string;
|
|
60
|
+
/** Array of phonemes */
|
|
61
|
+
phonemes: string[];
|
|
62
|
+
/** Point type based on phoneme count */
|
|
63
|
+
type: PointType;
|
|
64
|
+
/** Mapped Chinese characters */
|
|
65
|
+
characters: string[];
|
|
66
|
+
/** Combined Chinese name */
|
|
67
|
+
hanziName: string;
|
|
68
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@urbit-xyz/azimuth-hanzi",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Chinese character mapping and SVG generation for Urbit Azimuth identities",
|
|
5
|
+
"private": false,
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"module": "./dist/index.esm.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"require": "./dist/index.js",
|
|
13
|
+
"import": "./dist/index.esm.js",
|
|
14
|
+
"types": "./dist/index.d.ts"
|
|
15
|
+
},
|
|
16
|
+
"./core": {
|
|
17
|
+
"require": "./dist/core.js",
|
|
18
|
+
"import": "./dist/core.esm.js",
|
|
19
|
+
"types": "./dist/core.d.ts"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "dts build --entry ./src/index.ts --entry ./src/core.ts",
|
|
27
|
+
"dev": "dts watch",
|
|
28
|
+
"test": "jest",
|
|
29
|
+
"lint": "dts lint",
|
|
30
|
+
"lint:fix": "dts lint src --fix",
|
|
31
|
+
"size": "size-limit",
|
|
32
|
+
"analyze": "size-limit --why",
|
|
33
|
+
"preview": "python3 -m http.server 8080"
|
|
34
|
+
},
|
|
35
|
+
"size-limit": [
|
|
36
|
+
{
|
|
37
|
+
"path": "dist/index.esm.js",
|
|
38
|
+
"limit": "20 KB"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"path": "dist/core.esm.js",
|
|
42
|
+
"limit": "10 KB"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@size-limit/preset-small-lib": "^12.0.0",
|
|
47
|
+
"@tsconfig/recommended": "^1.0.2",
|
|
48
|
+
"@types/jest": "^30.0.0",
|
|
49
|
+
"@types/lodash.memoize": "^4.1.9",
|
|
50
|
+
"dts-cli": "^2.0.0",
|
|
51
|
+
"jest-environment-jsdom": "^30.2.0",
|
|
52
|
+
"size-limit": "^12.0.0",
|
|
53
|
+
"ts-jest": "^29.4.6",
|
|
54
|
+
"typescript": "^5.0.4"
|
|
55
|
+
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"lodash.memoize": "^4.1.2"
|
|
58
|
+
},
|
|
59
|
+
"repository": {
|
|
60
|
+
"type": "git",
|
|
61
|
+
"url": "https://github.com/master-malwyl/azimuth-hanzi"
|
|
62
|
+
},
|
|
63
|
+
"keywords": [
|
|
64
|
+
"urbit",
|
|
65
|
+
"azimuth",
|
|
66
|
+
"chinese",
|
|
67
|
+
"hanzi",
|
|
68
|
+
"sigil",
|
|
69
|
+
"identity"
|
|
70
|
+
]
|
|
71
|
+
}
|