pictoguys 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 +397 -0
- package/dist/character-DAS3IMm1.d.cts +141 -0
- package/dist/character-DAS3IMm1.d.ts +141 -0
- package/dist/chunk-2W2JD54I.js +21 -0
- package/dist/chunk-74VFD4AY.js +109 -0
- package/dist/chunk-MHPZBNYL.js +359 -0
- package/dist/chunk-RSKU5HRZ.js +18 -0
- package/dist/core.cjs +409 -0
- package/dist/core.d.cts +36 -0
- package/dist/core.d.ts +36 -0
- package/dist/core.js +3 -0
- package/dist/index.cjs +536 -0
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -0
- package/dist/react.cjs +504 -0
- package/dist/react.d.cts +20 -0
- package/dist/react.d.ts +20 -0
- package/dist/react.js +3 -0
- package/dist/rng.cjs +24 -0
- package/dist/rng.d.cts +4 -0
- package/dist/rng.d.ts +4 -0
- package/dist/rng.js +1 -0
- package/package.json +76 -0
package/dist/react.d.cts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { d as Character, b as CharConfig, a as AnimName } from './character-DAS3IMm1.cjs';
|
|
3
|
+
|
|
4
|
+
interface PictoProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
5
|
+
/** An existing character (e.g. from picto.character). Wins over seed/config. */
|
|
6
|
+
char?: Character;
|
|
7
|
+
/** Seed for a fresh character. */
|
|
8
|
+
seed?: number | string;
|
|
9
|
+
/** Explicit config for a fresh character. */
|
|
10
|
+
config?: CharConfig;
|
|
11
|
+
/** Rendered size in px (width = height). Default 120. */
|
|
12
|
+
size?: number;
|
|
13
|
+
/** Add a background tile behind the picto. Default false (transparent). */
|
|
14
|
+
background?: boolean;
|
|
15
|
+
/** Play an animation declaratively. */
|
|
16
|
+
animate?: AnimName;
|
|
17
|
+
}
|
|
18
|
+
declare const Picto: React.ForwardRefExoticComponent<PictoProps & React.RefAttributes<HTMLSpanElement>>;
|
|
19
|
+
|
|
20
|
+
export { Picto, type PictoProps };
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { d as Character, b as CharConfig, a as AnimName } from './character-DAS3IMm1.js';
|
|
3
|
+
|
|
4
|
+
interface PictoProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
5
|
+
/** An existing character (e.g. from picto.character). Wins over seed/config. */
|
|
6
|
+
char?: Character;
|
|
7
|
+
/** Seed for a fresh character. */
|
|
8
|
+
seed?: number | string;
|
|
9
|
+
/** Explicit config for a fresh character. */
|
|
10
|
+
config?: CharConfig;
|
|
11
|
+
/** Rendered size in px (width = height). Default 120. */
|
|
12
|
+
size?: number;
|
|
13
|
+
/** Add a background tile behind the picto. Default false (transparent). */
|
|
14
|
+
background?: boolean;
|
|
15
|
+
/** Play an animation declaratively. */
|
|
16
|
+
animate?: AnimName;
|
|
17
|
+
}
|
|
18
|
+
declare const Picto: React.ForwardRefExoticComponent<PictoProps & React.RefAttributes<HTMLSpanElement>>;
|
|
19
|
+
|
|
20
|
+
export { Picto, type PictoProps };
|
package/dist/react.js
ADDED
package/dist/rng.cjs
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/rng.ts
|
|
4
|
+
function mulberry32(a) {
|
|
5
|
+
return function() {
|
|
6
|
+
a |= 0;
|
|
7
|
+
a = a + 1831565813 | 0;
|
|
8
|
+
let t = Math.imul(a ^ a >>> 15, 1 | a);
|
|
9
|
+
t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t;
|
|
10
|
+
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function hashSeed(s) {
|
|
14
|
+
if (typeof s === "number") return s >>> 0;
|
|
15
|
+
let h = 2166136261 >>> 0;
|
|
16
|
+
for (let i = 0; i < s.length; i++) {
|
|
17
|
+
h ^= s.charCodeAt(i);
|
|
18
|
+
h = Math.imul(h, 16777619);
|
|
19
|
+
}
|
|
20
|
+
return h >>> 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
exports.hashSeed = hashSeed;
|
|
24
|
+
exports.mulberry32 = mulberry32;
|
package/dist/rng.d.cts
ADDED
package/dist/rng.d.ts
ADDED
package/dist/rng.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { hashSeed, mulberry32 } from './chunk-2W2JD54I.js';
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pictoguys",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Tiny React library for procedural SVG characters. Seed in, character out.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./core": {
|
|
16
|
+
"types": "./dist/core.d.ts",
|
|
17
|
+
"import": "./dist/core.js",
|
|
18
|
+
"require": "./dist/core.cjs"
|
|
19
|
+
},
|
|
20
|
+
"./react": {
|
|
21
|
+
"types": "./dist/react.d.ts",
|
|
22
|
+
"import": "./dist/react.js",
|
|
23
|
+
"require": "./dist/react.cjs"
|
|
24
|
+
},
|
|
25
|
+
"./rng": {
|
|
26
|
+
"types": "./dist/rng.d.ts",
|
|
27
|
+
"import": "./dist/rng.js",
|
|
28
|
+
"require": "./dist/rng.cjs"
|
|
29
|
+
},
|
|
30
|
+
"./package.json": "./package.json"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist"
|
|
34
|
+
],
|
|
35
|
+
"sideEffects": false,
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsup",
|
|
38
|
+
"dev": "tsup --watch",
|
|
39
|
+
"typecheck": "tsc --noEmit",
|
|
40
|
+
"prepublishOnly": "npm run typecheck && npm run build",
|
|
41
|
+
"release:check": "npm run typecheck && npm run build && npm pack --dry-run"
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"react",
|
|
45
|
+
"svg",
|
|
46
|
+
"avatar",
|
|
47
|
+
"procedural",
|
|
48
|
+
"generative",
|
|
49
|
+
"character",
|
|
50
|
+
"picto"
|
|
51
|
+
],
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "git+https://github.com/ctresb/picto.git"
|
|
56
|
+
},
|
|
57
|
+
"bugs": {
|
|
58
|
+
"url": "https://github.com/ctresb/picto/issues"
|
|
59
|
+
},
|
|
60
|
+
"homepage": "https://github.com/ctresb/picto#readme",
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"react": ">=17"
|
|
63
|
+
},
|
|
64
|
+
"peerDependenciesMeta": {
|
|
65
|
+
"react": {
|
|
66
|
+
"optional": true
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@resvg/resvg-js": "^2.6.2",
|
|
71
|
+
"@types/react": "^19.0.0",
|
|
72
|
+
"react": "^19.0.0",
|
|
73
|
+
"tsup": "^8.3.5",
|
|
74
|
+
"typescript": "^5.7.2"
|
|
75
|
+
}
|
|
76
|
+
}
|