@ogxjs/core 0.1.2 → 0.2.0-alpha.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/dist/cache/hash.d.ts +66 -0
- package/dist/cache/hash.d.ts.map +1 -0
- package/dist/cache/hash.js +161 -0
- package/dist/cache/index.d.ts +10 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +12 -0
- package/dist/cache/lru.d.ts +122 -0
- package/dist/cache/lru.d.ts.map +1 -0
- package/dist/cache/lru.js +269 -0
- package/dist/cache/snapshot.d.ts +116 -0
- package/dist/cache/snapshot.d.ts.map +1 -0
- package/dist/cache/snapshot.js +204 -0
- package/dist/cache.d.ts +2 -2
- package/dist/cache.js +2 -2
- package/dist/css.d.ts +19 -6
- package/dist/css.d.ts.map +1 -1
- package/dist/index.d.ts +17 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -9
- package/dist/ogx.js +2 -2
- package/dist/perf/index.d.ts +8 -0
- package/dist/perf/index.d.ts.map +1 -0
- package/dist/perf/index.js +7 -0
- package/dist/perf/timing.d.ts +160 -0
- package/dist/perf/timing.d.ts.map +1 -0
- package/dist/perf/timing.js +305 -0
- package/dist/presets/blog.js +1 -1
- package/dist/presets/docs.d.ts +2 -0
- package/dist/presets/docs.d.ts.map +1 -1
- package/dist/presets/docs.js +26 -23
- package/dist/presets/minimal.d.ts +2 -0
- package/dist/presets/minimal.d.ts.map +1 -1
- package/dist/presets/minimal.js +8 -16
- package/dist/presets/social.d.ts +2 -0
- package/dist/presets/social.d.ts.map +1 -1
- package/dist/presets/social.js +28 -18
- package/dist/render-png.d.ts.map +1 -1
- package/dist/render-png.js +9 -1
- package/dist/render-svg.d.ts.map +1 -1
- package/dist/render-svg.js +11 -1
- package/dist/tailwind/class-cache.d.ts +141 -0
- package/dist/tailwind/class-cache.d.ts.map +1 -0
- package/dist/tailwind/class-cache.js +212 -0
- package/dist/tailwind/index.d.ts +14 -1
- package/dist/tailwind/index.d.ts.map +1 -1
- package/dist/tailwind/index.js +15 -1
- package/dist/tailwind/lookup-tables.d.ts +30 -0
- package/dist/tailwind/lookup-tables.d.ts.map +1 -0
- package/dist/tailwind/lookup-tables.js +427 -0
- package/dist/tailwind/parser-v2.d.ts +54 -0
- package/dist/tailwind/parser-v2.d.ts.map +1 -0
- package/dist/tailwind/parser-v2.js +250 -0
- package/dist/tailwind/parser.d.ts +1 -0
- package/dist/tailwind/parser.d.ts.map +1 -1
- package/dist/tailwind/parser.js +1 -0
- package/dist/tailwind/prefix-handlers.d.ts +68 -0
- package/dist/tailwind/prefix-handlers.d.ts.map +1 -0
- package/dist/tailwind/prefix-handlers.js +931 -0
- package/package.json +17 -2
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ogxjs/core - Snapshot Cache v2
|
|
3
|
+
* High-performance image cache with LRU eviction
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* Refactored cache system for v0.2.0 "Turbo":
|
|
7
|
+
* - Uses fast sync hash (FNV-1a/xxHash) instead of SHA-256
|
|
8
|
+
* - LRU eviction instead of simple Map
|
|
9
|
+
* - Optional TTL support
|
|
10
|
+
* - Memory bounded
|
|
11
|
+
*
|
|
12
|
+
* @version 0.2.0 "Turbo"
|
|
13
|
+
*/
|
|
14
|
+
import { type LRUCacheStats } from "./lru";
|
|
15
|
+
export interface SnapshotCacheOptions {
|
|
16
|
+
/** Maximum number of cached images (default: 500) */
|
|
17
|
+
maxSize?: number;
|
|
18
|
+
/** Time-to-live in milliseconds (default: 0 = no expiration) */
|
|
19
|
+
ttl?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface SnapshotCacheStats extends LRUCacheStats {
|
|
22
|
+
/** Memory estimate in bytes */
|
|
23
|
+
memoryEstimate: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Cache for generated OG images
|
|
27
|
+
*
|
|
28
|
+
* Uses LRU eviction to bound memory usage.
|
|
29
|
+
* Keys are generated from config objects using fast hash.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const cache = new SnapshotCacheV2({ maxSize: 100, ttl: 60000 });
|
|
34
|
+
*
|
|
35
|
+
* const hash = cache.getHash(config);
|
|
36
|
+
* if (!cache.has(hash)) {
|
|
37
|
+
* const image = await render(element);
|
|
38
|
+
* cache.set(hash, image);
|
|
39
|
+
* }
|
|
40
|
+
* return cache.get(hash);
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare class SnapshotCacheV2 {
|
|
44
|
+
private cache;
|
|
45
|
+
private memoryEstimate;
|
|
46
|
+
constructor(options?: SnapshotCacheOptions);
|
|
47
|
+
/**
|
|
48
|
+
* Generate a hash key for a configuration object
|
|
49
|
+
* Uses fast sync hash (no await needed)
|
|
50
|
+
*/
|
|
51
|
+
getHash(config: unknown): string;
|
|
52
|
+
/**
|
|
53
|
+
* Get a cached image by hash
|
|
54
|
+
*/
|
|
55
|
+
get(hash: string): Uint8Array | string | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Check if a hash exists in cache
|
|
58
|
+
*/
|
|
59
|
+
has(hash: string): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Store an image in cache
|
|
62
|
+
*/
|
|
63
|
+
set(hash: string, data: Uint8Array | string): void;
|
|
64
|
+
/**
|
|
65
|
+
* Delete a cached image
|
|
66
|
+
*/
|
|
67
|
+
delete(hash: string): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Clear the entire cache
|
|
70
|
+
*/
|
|
71
|
+
clear(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Get cache size
|
|
74
|
+
*/
|
|
75
|
+
get size(): number;
|
|
76
|
+
/**
|
|
77
|
+
* Get cache statistics
|
|
78
|
+
*/
|
|
79
|
+
get stats(): SnapshotCacheStats;
|
|
80
|
+
/**
|
|
81
|
+
* Prune expired entries
|
|
82
|
+
*/
|
|
83
|
+
prune(): number;
|
|
84
|
+
/**
|
|
85
|
+
* @deprecated Use getHash() instead (sync, no await needed)
|
|
86
|
+
*/
|
|
87
|
+
getHashAsync(config: unknown): Promise<string>;
|
|
88
|
+
/**
|
|
89
|
+
* Set cache TTL
|
|
90
|
+
* Note: Only affects new entries, not existing ones
|
|
91
|
+
*/
|
|
92
|
+
setTTL(_milliseconds: number): void;
|
|
93
|
+
}
|
|
94
|
+
export declare function getSnapshotCache(): SnapshotCacheV2;
|
|
95
|
+
/**
|
|
96
|
+
* Configure the global cache instance
|
|
97
|
+
* Must be called before any cache operations
|
|
98
|
+
*/
|
|
99
|
+
export declare function configureSnapshotCache(options: SnapshotCacheOptions): void;
|
|
100
|
+
/**
|
|
101
|
+
* Legacy export for backward compatibility
|
|
102
|
+
*/
|
|
103
|
+
export declare const snapshotCache: {
|
|
104
|
+
readonly instance: SnapshotCacheV2;
|
|
105
|
+
getHash(config: unknown): string;
|
|
106
|
+
getHashAsync(config: unknown): Promise<string>;
|
|
107
|
+
get(hash: string): Uint8Array | string | undefined;
|
|
108
|
+
has(hash: string): boolean;
|
|
109
|
+
set(hash: string, data: Uint8Array | string): void;
|
|
110
|
+
delete(hash: string): boolean;
|
|
111
|
+
clear(): void;
|
|
112
|
+
readonly size: number;
|
|
113
|
+
readonly stats: SnapshotCacheStats;
|
|
114
|
+
setTTL(ms: number): void;
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../src/cache/snapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAIrD,MAAM,WAAW,oBAAoB;IACpC,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,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AG,MAAM,GAAG,IAAI;iBAIrC,MAAM,GAAG,OAAO;aAIpB,IAAI;mBAID,MAAM;oBAIL,kBAAkB;eAIpB,MAAM,GAAG,IAAI;CAGxB,CAAC"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ogxjs/core - Snapshot Cache v2
|
|
3
|
+
* High-performance image cache with LRU eviction
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* Refactored cache system for v0.2.0 "Turbo":
|
|
7
|
+
* - Uses fast sync hash (FNV-1a/xxHash) instead of SHA-256
|
|
8
|
+
* - LRU eviction instead of simple Map
|
|
9
|
+
* - Optional TTL support
|
|
10
|
+
* - Memory bounded
|
|
11
|
+
*
|
|
12
|
+
* @version 0.2.0 "Turbo"
|
|
13
|
+
*/
|
|
14
|
+
import { hashObject } from "./hash";
|
|
15
|
+
import { LRUCache } from "./lru";
|
|
16
|
+
// SNAPSHOT CACHE CLASS
|
|
17
|
+
/**
|
|
18
|
+
* Cache for generated OG images
|
|
19
|
+
*
|
|
20
|
+
* Uses LRU eviction to bound memory usage.
|
|
21
|
+
* Keys are generated from config objects using fast hash.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const cache = new SnapshotCacheV2({ maxSize: 100, ttl: 60000 });
|
|
26
|
+
*
|
|
27
|
+
* const hash = cache.getHash(config);
|
|
28
|
+
* if (!cache.has(hash)) {
|
|
29
|
+
* const image = await render(element);
|
|
30
|
+
* cache.set(hash, image);
|
|
31
|
+
* }
|
|
32
|
+
* return cache.get(hash);
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export class SnapshotCacheV2 {
|
|
36
|
+
cache;
|
|
37
|
+
memoryEstimate = 0;
|
|
38
|
+
constructor(options = {}) {
|
|
39
|
+
this.cache = new LRUCache({
|
|
40
|
+
maxSize: options.maxSize ?? 500,
|
|
41
|
+
ttl: options.ttl ?? 0,
|
|
42
|
+
onEvict: (_key, value) => {
|
|
43
|
+
// Update memory estimate on eviction
|
|
44
|
+
if (value instanceof Uint8Array) {
|
|
45
|
+
this.memoryEstimate -= value.byteLength;
|
|
46
|
+
}
|
|
47
|
+
else if (typeof value === "string") {
|
|
48
|
+
this.memoryEstimate -= value.length * 2; // UTF-16
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Generate a hash key for a configuration object
|
|
55
|
+
* Uses fast sync hash (no await needed)
|
|
56
|
+
*/
|
|
57
|
+
getHash(config) {
|
|
58
|
+
return hashObject(config);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Get a cached image by hash
|
|
62
|
+
*/
|
|
63
|
+
get(hash) {
|
|
64
|
+
return this.cache.get(hash);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Check if a hash exists in cache
|
|
68
|
+
*/
|
|
69
|
+
has(hash) {
|
|
70
|
+
return this.cache.has(hash);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Store an image in cache
|
|
74
|
+
*/
|
|
75
|
+
set(hash, data) {
|
|
76
|
+
// Update memory estimate
|
|
77
|
+
if (data instanceof Uint8Array) {
|
|
78
|
+
this.memoryEstimate += data.byteLength;
|
|
79
|
+
}
|
|
80
|
+
else if (typeof data === "string") {
|
|
81
|
+
this.memoryEstimate += data.length * 2;
|
|
82
|
+
}
|
|
83
|
+
this.cache.set(hash, data);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Delete a cached image
|
|
87
|
+
*/
|
|
88
|
+
delete(hash) {
|
|
89
|
+
const existing = this.cache.get(hash);
|
|
90
|
+
if (existing) {
|
|
91
|
+
if (existing instanceof Uint8Array) {
|
|
92
|
+
this.memoryEstimate -= existing.byteLength;
|
|
93
|
+
}
|
|
94
|
+
else if (typeof existing === "string") {
|
|
95
|
+
this.memoryEstimate -= existing.length * 2;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return this.cache.delete(hash);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Clear the entire cache
|
|
102
|
+
*/
|
|
103
|
+
clear() {
|
|
104
|
+
this.cache.clear();
|
|
105
|
+
this.memoryEstimate = 0;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Get cache size
|
|
109
|
+
*/
|
|
110
|
+
get size() {
|
|
111
|
+
return this.cache.size;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Get cache statistics
|
|
115
|
+
*/
|
|
116
|
+
get stats() {
|
|
117
|
+
return {
|
|
118
|
+
...this.cache.stats,
|
|
119
|
+
memoryEstimate: this.memoryEstimate,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Prune expired entries
|
|
124
|
+
*/
|
|
125
|
+
prune() {
|
|
126
|
+
return this.cache.prune();
|
|
127
|
+
}
|
|
128
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
129
|
+
// LEGACY COMPATIBILITY
|
|
130
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
131
|
+
/**
|
|
132
|
+
* @deprecated Use getHash() instead (sync, no await needed)
|
|
133
|
+
*/
|
|
134
|
+
async getHashAsync(config) {
|
|
135
|
+
return this.getHash(config);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Set cache TTL
|
|
139
|
+
* Note: Only affects new entries, not existing ones
|
|
140
|
+
*/
|
|
141
|
+
setTTL(_milliseconds) {
|
|
142
|
+
console.warn("SnapshotCacheV2.setTTL() is deprecated. Pass ttl in constructor options.");
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// SINGLETON INSTANCE
|
|
146
|
+
/**
|
|
147
|
+
* Global singleton cache instance
|
|
148
|
+
* Configured with sensible defaults
|
|
149
|
+
*/
|
|
150
|
+
let _instance = null;
|
|
151
|
+
export function getSnapshotCache() {
|
|
152
|
+
if (!_instance) {
|
|
153
|
+
_instance = new SnapshotCacheV2({
|
|
154
|
+
maxSize: 500,
|
|
155
|
+
ttl: 0, // No expiration by default
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
return _instance;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Configure the global cache instance
|
|
162
|
+
* Must be called before any cache operations
|
|
163
|
+
*/
|
|
164
|
+
export function configureSnapshotCache(options) {
|
|
165
|
+
_instance = new SnapshotCacheV2(options);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Legacy export for backward compatibility
|
|
169
|
+
*/
|
|
170
|
+
export const snapshotCache = {
|
|
171
|
+
get instance() {
|
|
172
|
+
return getSnapshotCache();
|
|
173
|
+
},
|
|
174
|
+
getHash(config) {
|
|
175
|
+
return getSnapshotCache().getHash(config);
|
|
176
|
+
},
|
|
177
|
+
async getHashAsync(config) {
|
|
178
|
+
return getSnapshotCache().getHash(config);
|
|
179
|
+
},
|
|
180
|
+
get(hash) {
|
|
181
|
+
return getSnapshotCache().get(hash);
|
|
182
|
+
},
|
|
183
|
+
has(hash) {
|
|
184
|
+
return getSnapshotCache().has(hash);
|
|
185
|
+
},
|
|
186
|
+
set(hash, data) {
|
|
187
|
+
getSnapshotCache().set(hash, data);
|
|
188
|
+
},
|
|
189
|
+
delete(hash) {
|
|
190
|
+
return getSnapshotCache().delete(hash);
|
|
191
|
+
},
|
|
192
|
+
clear() {
|
|
193
|
+
getSnapshotCache().clear();
|
|
194
|
+
},
|
|
195
|
+
get size() {
|
|
196
|
+
return getSnapshotCache().size;
|
|
197
|
+
},
|
|
198
|
+
get stats() {
|
|
199
|
+
return getSnapshotCache().stats;
|
|
200
|
+
},
|
|
201
|
+
setTTL(ms) {
|
|
202
|
+
getSnapshotCache().setTTL(ms);
|
|
203
|
+
},
|
|
204
|
+
};
|
package/dist/cache.d.ts
CHANGED
|
@@ -21,9 +21,9 @@ export declare class SnapshotCache {
|
|
|
21
21
|
*/
|
|
22
22
|
getHashAsync(config: any): Promise<string>;
|
|
23
23
|
/**
|
|
24
|
-
* Calculate a hash for a configuration object (sync
|
|
24
|
+
* Calculate a hash for a configuration object (sync)
|
|
25
25
|
* Uses djb2 algorithm - fast but has higher collision probability
|
|
26
|
-
*
|
|
26
|
+
* Note: Cache v2 uses FNV-1a (fnv1a/fastHash) for better performance
|
|
27
27
|
*/
|
|
28
28
|
getHash(config: any): string;
|
|
29
29
|
/**
|
package/dist/cache.js
CHANGED
|
@@ -50,9 +50,9 @@ export class SnapshotCache {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* Calculate a hash for a configuration object (sync
|
|
53
|
+
* Calculate a hash for a configuration object (sync)
|
|
54
54
|
* Uses djb2 algorithm - fast but has higher collision probability
|
|
55
|
-
*
|
|
55
|
+
* Note: Cache v2 uses FNV-1a (fnv1a/fastHash) for better performance
|
|
56
56
|
*/
|
|
57
57
|
getHash(config) {
|
|
58
58
|
const str = this.serializeConfig(config);
|
package/dist/css.d.ts
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* This is a subset of React.CSSProperties optimized for OG image generation
|
|
4
4
|
*/
|
|
5
5
|
export interface CSSProperties {
|
|
6
|
-
display?: "flex" | "none";
|
|
7
|
-
position?: "relative" | "absolute";
|
|
6
|
+
display?: "flex" | "none" | "block" | "inline" | "inline-flex" | "inline-block";
|
|
7
|
+
position?: "relative" | "absolute" | "fixed" | "static" | "sticky";
|
|
8
8
|
flexDirection?: "row" | "row-reverse" | "column" | "column-reverse";
|
|
9
9
|
flexWrap?: "nowrap" | "wrap" | "wrap-reverse";
|
|
10
10
|
flexGrow?: number;
|
|
11
11
|
flexShrink?: number;
|
|
12
12
|
flexBasis?: number | string;
|
|
13
13
|
alignItems?: "flex-start" | "flex-end" | "center" | "baseline" | "stretch";
|
|
14
|
-
alignContent?: "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "stretch";
|
|
14
|
+
alignContent?: "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch";
|
|
15
15
|
alignSelf?: "auto" | "flex-start" | "flex-end" | "center" | "baseline" | "stretch";
|
|
16
16
|
justifyContent?: "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "space-evenly";
|
|
17
17
|
gap?: number | string;
|
|
@@ -39,7 +39,7 @@ export interface CSSProperties {
|
|
|
39
39
|
left?: number | string;
|
|
40
40
|
border?: string;
|
|
41
41
|
borderWidth?: number | string;
|
|
42
|
-
borderStyle?: "solid" | "dashed";
|
|
42
|
+
borderStyle?: "solid" | "dashed" | "dotted" | "double" | "none";
|
|
43
43
|
borderColor?: string;
|
|
44
44
|
borderTop?: string;
|
|
45
45
|
borderRight?: string;
|
|
@@ -71,13 +71,26 @@ export interface CSSProperties {
|
|
|
71
71
|
whiteSpace?: "normal" | "pre" | "pre-wrap" | "pre-line" | "nowrap";
|
|
72
72
|
wordBreak?: "normal" | "break-all" | "break-word" | "keep-all";
|
|
73
73
|
opacity?: number;
|
|
74
|
-
overflow?: "visible" | "hidden";
|
|
74
|
+
overflow?: "visible" | "hidden" | "auto" | "scroll";
|
|
75
|
+
overflowX?: "visible" | "hidden" | "auto" | "scroll";
|
|
76
|
+
overflowY?: "visible" | "hidden" | "auto" | "scroll";
|
|
75
77
|
boxShadow?: string;
|
|
76
78
|
transform?: string;
|
|
77
79
|
transformOrigin?: string;
|
|
78
|
-
objectFit?: "contain" | "cover" | "none";
|
|
80
|
+
objectFit?: "contain" | "cover" | "none" | "fill" | "scale-down";
|
|
79
81
|
objectPosition?: string;
|
|
80
82
|
filter?: string;
|
|
81
83
|
clipPath?: string;
|
|
84
|
+
zIndex?: number | string;
|
|
85
|
+
aspectRatio?: string;
|
|
86
|
+
justifyItems?: "start" | "end" | "center" | "stretch";
|
|
87
|
+
justifySelf?: "auto" | "start" | "end" | "center" | "stretch";
|
|
88
|
+
pointerEvents?: "none" | "auto";
|
|
89
|
+
userSelect?: "none" | "text" | "all" | "auto";
|
|
90
|
+
borderTopWidth?: number | string;
|
|
91
|
+
borderRightWidth?: number | string;
|
|
92
|
+
borderBottomWidth?: number | string;
|
|
93
|
+
borderLeftWidth?: number | string;
|
|
94
|
+
overflowWrap?: "normal" | "break-word";
|
|
82
95
|
}
|
|
83
96
|
//# sourceMappingURL=css.d.ts.map
|
package/dist/css.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../src/css.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAE7B,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../src/css.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAE7B,OAAO,CAAC,EACL,MAAM,GACN,MAAM,GACN,OAAO,GACP,QAAQ,GACR,aAAa,GACb,cAAc,CAAC;IAClB,QAAQ,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACnE,aAAa,CAAC,EAAE,KAAK,GAAG,aAAa,GAAG,QAAQ,GAAG,gBAAgB,CAAC;IACpE,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,cAAc,CAAC;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;IAC3E,YAAY,CAAC,EACV,YAAY,GACZ,UAAU,GACV,QAAQ,GACR,eAAe,GACf,cAAc,GACd,cAAc,GACd,SAAS,CAAC;IACb,SAAS,CAAC,EACP,MAAM,GACN,YAAY,GACZ,UAAU,GACV,QAAQ,GACR,UAAU,GACV,SAAS,CAAC;IACb,cAAc,CAAC,EACZ,YAAY,GACZ,UA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GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;IAG9C,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,iBAAiB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAGlC,YAAY,CAAC,EAAE,QAAQ,GAAG,YAAY,CAAC;CACvC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ogxjs/core - High-performance OG Image Generator
|
|
3
|
+
*
|
|
4
|
+
* @description
|
|
5
|
+
* Generate beautiful Open Graph images using Tailwind CSS classes.
|
|
6
|
+
* Built for Node.js, Bun, and Deno.
|
|
7
|
+
*
|
|
8
|
+
* @version 0.2.0 "Turbo"
|
|
9
|
+
* @see https://ogx-three.vercel.app
|
|
10
|
+
*/
|
|
1
11
|
export { absolute, badge, card, div, fluent, footer, grid, h, h1, h2, header, img, imgFromUrl, main, p, row, spacer, span, stack, svgFromContent, unsafe_img, validateImageUrl, } from "./builder";
|
|
2
|
-
export {
|
|
12
|
+
export type { LRUCacheOptions, LRUCacheStats, SnapshotCacheOptions, SnapshotCacheStats, } from "./cache/index";
|
|
13
|
+
export { configureSnapshotCache, fastHash, fnv1a, getSnapshotCache, hashObject, LRUCache, snapshotCache, } from "./cache/index";
|
|
3
14
|
export type { CSSProperties } from "./css";
|
|
4
15
|
export { fontRegistry } from "./font-registry";
|
|
5
16
|
export { createFont, loadFont, loadFontFromUrl, loadInterFont, loadInterFromUrl, } from "./fonts";
|
|
6
17
|
export { ogx, ogxToSVG } from "./ogx";
|
|
18
|
+
export type { TimingAggregate, TimingEntry, TimingReport } from "./perf";
|
|
19
|
+
export { benchmark, benchmarkSync, quickTime, quickTimeSync, Timer, timing, } from "./perf";
|
|
7
20
|
export type { BlogPresetProps, DocsPresetProps, MinimalPresetProps, SocialPresetProps, } from "./presets";
|
|
8
21
|
export { blogPreset, docsPreset, minimalPreset, presets, socialPreset, } from "./presets";
|
|
9
22
|
export { render } from "./render-png";
|
|
10
23
|
export { renderToSVG } from "./render-svg";
|
|
11
|
-
export {
|
|
24
|
+
export type { CacheStats, GradientState, ParseContext } from "./tailwind";
|
|
25
|
+
export { clearAllCaches, getCacheStats, isStaticClass, parseTailwind, parseTailwindBatch, STATIC_CLASSES, } from "./tailwind";
|
|
12
26
|
export type { Platform } from "./targets";
|
|
13
27
|
export { getPlatformDimensions } from "./targets";
|
|
14
|
-
export type { FontConfig, OGXBaseConfig, OGXChildren, OGXConfig, OGXElement, OGXElementProps, Preset, PresetName, PresetProps, RenderOptions, } from "./types";
|
|
28
|
+
export type { FontConfig, OGXBaseConfig, OGXChildren, OGXConfig, OGXElement, OGXElementProps, Preset, PresetName, PresetProps, RenderOptions, ThemeConfig, } from "./types";
|
|
15
29
|
export { loadAsset, toDataUri } from "./utils/assets";
|
|
16
30
|
export type { FitTextOptions } from "./utils/text";
|
|
17
31
|
export { calculateFittingFontSize } from "./utils/text";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EACN,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,GAAG,EACH,MAAM,EACN,MAAM,EACN,IAAI,EACJ,CAAC,EACD,EAAE,EACF,EAAE,EACF,MAAM,EACN,GAAG,EACH,UAAU,EACV,IAAI,EACJ,CAAC,EACD,GAAG,EACH,MAAM,EACN,IAAI,EACJ,KAAK,EACL,cAAc,EACd,UAAU,EACV,gBAAgB,GAChB,MAAM,WAAW,CAAC;AACnB,YAAY,EACX,eAAe,EACf,aAAa,EACb,oBAAoB,E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EACN,UAAU,EACV,WAAW,EACX,aAAa,EACb,WAAW,GACX,MAAM,SAAS,CAAC;AAKjB,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @ogxjs/core - High-performance OG Image Generator
|
|
3
|
+
*
|
|
4
|
+
* @description
|
|
5
|
+
* Generate beautiful Open Graph images using Tailwind CSS classes.
|
|
6
|
+
* Built for Node.js, Bun, and Deno.
|
|
7
|
+
*
|
|
8
|
+
* @version 0.2.0 "Turbo"
|
|
9
|
+
* @see https://ogx-three.vercel.app
|
|
10
|
+
*/
|
|
11
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
12
|
+
// BUILDER - Element construction
|
|
13
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
3
14
|
export { absolute, badge, card, div, fluent, footer, grid, h, h1, h2, header, img, imgFromUrl, main, p, row, spacer, span, stack, svgFromContent, unsafe_img, validateImageUrl, } from "./builder";
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
//
|
|
15
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
16
|
+
// CACHE - v2 with LRU + Fast Hash
|
|
17
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
18
|
+
export { configureSnapshotCache, fastHash, fnv1a, getSnapshotCache, hashObject, LRUCache, snapshotCache, } from "./cache/index";
|
|
19
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
20
|
+
// FONTS - Loading and registration
|
|
21
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
7
22
|
export { fontRegistry } from "./font-registry";
|
|
8
23
|
export { createFont, loadFont, loadFontFromUrl, loadInterFont, loadInterFromUrl, } from "./fonts";
|
|
9
|
-
//
|
|
24
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
25
|
+
// RENDERING - SVG and PNG generation
|
|
26
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
10
27
|
export { ogx, ogxToSVG } from "./ogx";
|
|
11
|
-
//
|
|
28
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
29
|
+
// PERFORMANCE - Timing API
|
|
30
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
31
|
+
export { benchmark, benchmarkSync, quickTime, quickTimeSync, Timer, timing, } from "./perf";
|
|
32
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
33
|
+
// PRESETS - Ready-to-use templates
|
|
34
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
12
35
|
export { blogPreset, docsPreset, minimalPreset, presets, socialPreset, } from "./presets";
|
|
13
36
|
export { render } from "./render-png";
|
|
14
37
|
export { renderToSVG } from "./render-svg";
|
|
15
|
-
|
|
16
|
-
//
|
|
38
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
39
|
+
// TAILWIND - Parser v2 with O(1) lookups
|
|
40
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
41
|
+
export { clearAllCaches, getCacheStats, isStaticClass, parseTailwind, parseTailwindBatch, STATIC_CLASSES, } from "./tailwind";
|
|
42
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
43
|
+
// PLATFORM - Target dimensions
|
|
44
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
17
45
|
export { getPlatformDimensions } from "./targets";
|
|
46
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
47
|
+
// UTILITIES
|
|
48
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
18
49
|
export { loadAsset, toDataUri } from "./utils/assets";
|
|
19
50
|
export { calculateFittingFontSize } from "./utils/text";
|
package/dist/ogx.js
CHANGED
|
@@ -25,7 +25,7 @@ export async function ogx(config) {
|
|
|
25
25
|
if (!presetFn) {
|
|
26
26
|
throw new Error(`Unknown preset: ${preset}`);
|
|
27
27
|
}
|
|
28
|
-
const element = presetFn({ ...props, slots });
|
|
28
|
+
const element = presetFn({ ...props, slots, colorScheme });
|
|
29
29
|
// Resolve fonts (Registry > Explicit > Default Inter)
|
|
30
30
|
let resolvedFonts = fonts ?? [];
|
|
31
31
|
if (resolvedFonts.length === 0) {
|
|
@@ -74,7 +74,7 @@ export async function ogxToSVG(config) {
|
|
|
74
74
|
if (!presetFn) {
|
|
75
75
|
throw new Error(`Unknown preset: ${preset}`);
|
|
76
76
|
}
|
|
77
|
-
const element = presetFn({ ...props, slots });
|
|
77
|
+
const element = presetFn({ ...props, slots, colorScheme });
|
|
78
78
|
// Resolve fonts
|
|
79
79
|
let resolvedFonts = fonts ?? [];
|
|
80
80
|
if (resolvedFonts.length === 0) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ogxjs/core - Performance Module
|
|
3
|
+
* Timing and profiling utilities
|
|
4
|
+
*
|
|
5
|
+
* @version 0.2.0 "Turbo"
|
|
6
|
+
*/
|
|
7
|
+
export { benchmark, benchmarkSync, quickTime, quickTimeSync, Timer, type TimingAggregate, type TimingEntry, type TimingReport, timing, } from "./timing";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/perf/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACN,SAAS,EACT,aAAa,EACb,SAAS,EACT,aAAa,EACb,KAAK,EACL,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,MAAM,GACN,MAAM,UAAU,CAAC"}
|