@teacss/classes 0.10.8 → 0.10.9
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/package.json +1 -1
- package/dist/attributes.d.ts +0 -13
- package/dist/attributes.js +0 -20
- package/dist/cache.d.ts +0 -25
- package/dist/cache.js +0 -101
- package/dist/generated/merge-policy.d.ts +0 -5
- package/dist/generated/merge-policy.js +0 -37
- package/dist/index.d.ts +0 -6
- package/dist/index.js +0 -3
- package/dist/input.d.ts +0 -15
- package/dist/input.js +0 -116
- package/dist/merge.d.ts +0 -58
- package/dist/merge.js +0 -475
- package/dist/recipe.d.ts +0 -193
- package/dist/recipe.js +0 -594
- package/dist/syntax/group.d.ts +0 -35
- package/dist/syntax/group.js +0 -306
- package/dist/syntax/literal.d.ts +0 -17
- package/dist/syntax/literal.js +0 -152
- package/dist/syntax/token.d.ts +0 -51
- package/dist/syntax/token.js +0 -132
package/package.json
CHANGED
package/dist/attributes.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Attribute helpers for component authors composing recipes with arbitrary
|
|
3
|
-
* pass-through DOM attributes.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Return a shallow copy of `attributes` without the entries whose names appear
|
|
7
|
-
* in `ownedNames`, compared case-insensitively — HTML attribute names are
|
|
8
|
-
* case-insensitive, so `onClick` and `onclick` collide on the same attribute.
|
|
9
|
-
* Use it to strip component-owned attributes before spreading the rest onto an
|
|
10
|
-
* element. The input object is not mutated; symbol-keyed entries are preserved.
|
|
11
|
-
*/
|
|
12
|
-
export declare function omitAttributes<T extends object>(attributes: T, ownedNames: readonly string[]): Partial<T>;
|
|
13
|
-
//# sourceMappingURL=attributes.d.ts.map
|
package/dist/attributes.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Attribute helpers for component authors composing recipes with arbitrary
|
|
3
|
-
* pass-through DOM attributes.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Return a shallow copy of `attributes` without the entries whose names appear
|
|
7
|
-
* in `ownedNames`, compared case-insensitively — HTML attribute names are
|
|
8
|
-
* case-insensitive, so `onClick` and `onclick` collide on the same attribute.
|
|
9
|
-
* Use it to strip component-owned attributes before spreading the rest onto an
|
|
10
|
-
* element. The input object is not mutated; symbol-keyed entries are preserved.
|
|
11
|
-
*/
|
|
12
|
-
export function omitAttributes(attributes, ownedNames) {
|
|
13
|
-
const safeAttributes = { ...attributes };
|
|
14
|
-
const owned = new Set(ownedNames.map((name) => name.toLowerCase()));
|
|
15
|
-
for (const name of Object.keys(safeAttributes)) {
|
|
16
|
-
if (owned.has(name.toLowerCase()))
|
|
17
|
-
delete safeAttributes[name];
|
|
18
|
-
}
|
|
19
|
-
return safeAttributes;
|
|
20
|
-
}
|
package/dist/cache.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare class StringCache<Value> {
|
|
2
|
-
readonly max: number;
|
|
3
|
-
readonly budget: number;
|
|
4
|
-
readonly weight: (key: string, value: Value) => number;
|
|
5
|
-
readonly values: Map<string, Value>;
|
|
6
|
-
private readonly queue;
|
|
7
|
-
private head;
|
|
8
|
-
private tail;
|
|
9
|
-
bytes: number;
|
|
10
|
-
constructor(max: number, budget: number, weight: (key: string, value: Value) => number);
|
|
11
|
-
get(key: string): Value | undefined;
|
|
12
|
-
set(key: string, value: Value): void;
|
|
13
|
-
}
|
|
14
|
-
/** The FIFO Map is also the queue, so evictions cannot leave an unbounded tail. */
|
|
15
|
-
export declare class TupleCache {
|
|
16
|
-
private readonly root;
|
|
17
|
-
private readonly entries;
|
|
18
|
-
bytes: number;
|
|
19
|
-
nodes: number;
|
|
20
|
-
get size(): number;
|
|
21
|
-
get(args: readonly string[]): string | undefined;
|
|
22
|
-
set(args: readonly string[], result: string): void;
|
|
23
|
-
private prune;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=cache.d.ts.map
|
package/dist/cache.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/** Private FIFO caches: hits do not rewrite insertion order. */
|
|
2
|
-
import { setOwnArrayIndex } from "./input.js";
|
|
3
|
-
export class StringCache {
|
|
4
|
-
max;
|
|
5
|
-
budget;
|
|
6
|
-
weight;
|
|
7
|
-
values = new Map();
|
|
8
|
-
queue = [];
|
|
9
|
-
head = 0;
|
|
10
|
-
tail = 0;
|
|
11
|
-
bytes = 0;
|
|
12
|
-
constructor(max, budget, weight) {
|
|
13
|
-
this.max = max;
|
|
14
|
-
this.budget = budget;
|
|
15
|
-
this.weight = weight;
|
|
16
|
-
}
|
|
17
|
-
get(key) {
|
|
18
|
-
return this.values.get(key);
|
|
19
|
-
}
|
|
20
|
-
set(key, value) {
|
|
21
|
-
const bytes = this.weight(key, value);
|
|
22
|
-
if (bytes > this.budget || this.max === 0 || this.values.has(key))
|
|
23
|
-
return;
|
|
24
|
-
while (this.values.size >= this.max || this.bytes + bytes > this.budget) {
|
|
25
|
-
const first = this.queue[this.head];
|
|
26
|
-
this.bytes -= this.weight(first, this.values.get(first));
|
|
27
|
-
this.values.delete(first);
|
|
28
|
-
this.queue[this.head] = "";
|
|
29
|
-
this.head = (this.head + 1) % this.max;
|
|
30
|
-
}
|
|
31
|
-
this.values.set(key, value);
|
|
32
|
-
if (this.tail < this.queue.length)
|
|
33
|
-
this.queue[this.tail] = key;
|
|
34
|
-
else
|
|
35
|
-
setOwnArrayIndex(this.queue, this.tail, key);
|
|
36
|
-
this.tail = (this.tail + 1) % this.max;
|
|
37
|
-
this.bytes += bytes;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
/** The FIFO Map is also the queue, so evictions cannot leave an unbounded tail. */
|
|
41
|
-
export class TupleCache {
|
|
42
|
-
root = { children: new Map(), result: undefined };
|
|
43
|
-
entries = new Map();
|
|
44
|
-
bytes = 0;
|
|
45
|
-
nodes = 1;
|
|
46
|
-
get size() {
|
|
47
|
-
return this.entries.size;
|
|
48
|
-
}
|
|
49
|
-
get(args) {
|
|
50
|
-
let node = this.root;
|
|
51
|
-
for (let index = 0; index < args.length; index++) {
|
|
52
|
-
const child = node.children.get(args[index]);
|
|
53
|
-
if (!child)
|
|
54
|
-
return;
|
|
55
|
-
node = child;
|
|
56
|
-
}
|
|
57
|
-
return node.result;
|
|
58
|
-
}
|
|
59
|
-
set(args, result) {
|
|
60
|
-
let bytes = result.length * 2;
|
|
61
|
-
for (let index = 0; index < args.length; index++)
|
|
62
|
-
bytes += args[index].length * 2;
|
|
63
|
-
if (bytes > 65536)
|
|
64
|
-
return;
|
|
65
|
-
// Only successful misses enter here; an existing arity terminal is not rewritten.
|
|
66
|
-
if (this.get(args) !== undefined)
|
|
67
|
-
return;
|
|
68
|
-
while (this.entries.size >= 64 || this.bytes + bytes > 65536) {
|
|
69
|
-
const first = this.entries.keys().next().value;
|
|
70
|
-
const entry = this.entries.get(first);
|
|
71
|
-
first.result = undefined;
|
|
72
|
-
this.prune(this.root, entry.args, 0);
|
|
73
|
-
this.entries.delete(first);
|
|
74
|
-
this.bytes -= entry.bytes;
|
|
75
|
-
}
|
|
76
|
-
let node = this.root;
|
|
77
|
-
for (let index = 0; index < args.length; index++) {
|
|
78
|
-
let child = node.children.get(args[index]);
|
|
79
|
-
if (!child) {
|
|
80
|
-
child = { children: new Map(), result: undefined };
|
|
81
|
-
node.children.set(args[index], child);
|
|
82
|
-
this.nodes++;
|
|
83
|
-
}
|
|
84
|
-
node = child;
|
|
85
|
-
}
|
|
86
|
-
node.result = result;
|
|
87
|
-
this.entries.set(node, { args, bytes });
|
|
88
|
-
this.bytes += bytes;
|
|
89
|
-
}
|
|
90
|
-
prune(node, args, index) {
|
|
91
|
-
if (index === args.length)
|
|
92
|
-
return;
|
|
93
|
-
const key = args[index];
|
|
94
|
-
const child = node.children.get(key);
|
|
95
|
-
this.prune(child, args, index + 1);
|
|
96
|
-
if (child.children.size === 0 && child.result === undefined) {
|
|
97
|
-
node.children.delete(key);
|
|
98
|
-
this.nodes--;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const prefixes: string[];
|
|
2
|
-
export declare const rows: number[][], equalRows: number[], importantRows: number[];
|
|
3
|
-
export declare const finalizerFlags: Uint8Array<ArrayBuffer>;
|
|
4
|
-
export declare const typographyNames: ReadonlySet<string>;
|
|
5
|
-
//# sourceMappingURL=merge-policy.d.ts.map
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// Generated by packages/classes/scripts/gen-merge-policy.mjs from crates/teacss-engine/tests/snapshots/merge_policy__policy.snap. Do not edit.
|
|
2
|
-
// E: same importance, later deletes earlier. I: important deletes ordinary.
|
|
3
|
-
// Every descriptor's self edge is implicit. Row zero is empty.
|
|
4
|
-
function numbers(value) {
|
|
5
|
-
return value ? value.split(",").map((item) => Number.parseInt(item, 36)) : [];
|
|
6
|
-
}
|
|
7
|
-
function decodePrefixes(value) {
|
|
8
|
-
let previous = "";
|
|
9
|
-
return value.split(" ").map((item) => (previous = previous.slice(0, Number.parseInt(item[0], 36)) + item.slice(1)));
|
|
10
|
-
}
|
|
11
|
-
export const prefixes = decodePrefixes("0alc 2i 2s 1nimation 9-delay birection buration afill aiteration aname aplay arange-end gstart atimeline ding 0backdrop-blur arightness 9contrast 9filter 9grayscale 9hue-rotate 9invert 9opacity 9saturate aepia 1g-g 4-1 6-angle 7color 7position 52 6-angle 7color 7position 53 6-angle 7color 7position 54 6-angle 7color 7position 55 6-angle 7color 7position 56 6-angle 7color 7position 57 6-angle 7color 7position 58 6-angle 7color 7position 59 6-angle 7color 7position 5angle 5to 3image 1lock-size 7tep a-align binsert bround bsize 2ur 1order 6-b 8-color 9style 9width 8lock c-color dstyle dwidth 7color 7e 8-color 9style 9width 7g 8-1 a-angle bcolor bposition 92 a-angle bcolor bposition 93 a-angle bcolor bposition 94 a-angle bcolor bposition 95 a-angle bcolor bposition 96 a-angle bcolor bposition 97 a-angle bcolor bposition 98 a-angle bcolor bposition 99 a-angle bcolor bposition 9angle 9to 7image c-outset drepeat dslice eource dwidth 8nline d-color estyle ewidth 7l 8-color 9style 9width 7n 8-color 9style 9width 7r 8-color 9style 9width 7s 8-color 9style 9width 8pacing e-x fy 8tyle 7t 8-color 9style 9width 7u 8-color 9style 9width 7width 7x 8-color 9style 9width 7y 8-color 9style 9width 2x-shadow 1rightness 0column-count 7height 7width 8rap 6s 2ntrast 2rner 6-b 8-shape 8l 9-shape 8r 9-shape 7e 8-shape 8e 9-shape 8s 9-shape 7l 8-shape 7n 8-shape 7r 8-shape 7s 8-shape 8e 9-shape 8hape 8s 9-shape 7t 8-shape 8l 9-shape 8r 9-shape 7u 8-shape 0d 1imensions 1rop-shadow 0filter 6-opacity 1lex 4-basis 5grow 5shrink 0g-1 3-angle 4color 4position 22 3-angle 4color 4position 23 3-angle 4color 4position 24 3-angle 4color 4position 25 3-angle 4color 4position 26 3-angle 4color 4position 27 3-angle 4color 4position 28 3-angle 4color 4position 29 3-angle 4color 4position 2angle 2to 1ap 3-column 4row 1rayscale 2id-area 5column b-end cspan dtart 5row 8-end 9span atart 0h 1ue-rotate 0i 1-b 3lock 2e 2inline 2l 2n 2r 2s 2t 2u 2x 2y 1nline-size 2set-shadow c-outline-width 2vert 0juc 2i 2s 0line-clamp 0m 1-b 3lock 2e 2inline 2l 2n 2r 2s 2t 2u 2x 2y 1ask-b-1-color 9position 79-color 9position 5composite 5g 6-1 8-angle 9color 9position 72 8-angle 9color 9position 73 8-angle 9color 9position 74 8-angle 9color 9position 75 8-angle 9color 9position 76 8-angle 9color 9position 77 8-angle 9color 9position 78 8-angle 9color 9position 79 8-angle 9color 9position 7angle 7conic c-1 e-angle fcolor d2 e-angle fcolor d3 e-angle fcolor d4 e-angle fcolor d5 e-angle fcolor d6 e-angle fcolor d7 e-angle fcolor d8 e-angle fcolor d9 e-angle fcolor 7linear d-1 f-color gposition e2 f-color gposition e3 f-color gposition e4 f-color gposition e5 f-color gposition e6 f-color gposition e7 f-color gposition e8 f-color gposition e9 f-color gposition eangle eto 7radial d-1 f-color gposition e2 f-color gposition e3 f-color gposition e4 f-color gposition e5 f-color gposition e6 f-color gposition e7 f-color gposition e8 f-color gposition e9 f-color gposition 7to 5image 5l-1-color 9position 79-color 9position 5r-1-color 9position 79-color 9position 5t-1-color 9position 79-color 9position 5x-1-color 9position 79-color 9position 5y-1-color 9position 79-color 9position 2x-block-size 4dimensions 4h 4inline-size 4size 4w 1in-block-size 4dimensions 4h 4inline-size 4size 4w 0outline 7-color 8style 8width 1verflow 8-block 9clip-m f-b hlock ge ginline gl gn gr gs gt gu gx gy 9inline 9x 9y 4scroll-behavior j-block kinline kx ky 0p 1-b 3lock 2e 2inline 2l 2n 2r 2s 2t 2u 2x 2y 1lc 2i 2s 0rd 2-b 4l 4r 3e 4e 4s 3l 3n 3r 3s 4e 4s 3t 4l 4r 3u 1otate-x 7y 7z 1ule 4-break 5color 8umn b-break ccolor cinset h-cap iend ijunction istart cstyle cvis cwidth 5inset a-cap bend bjunction bstart 5row 8-break 9color 9inset e-cap fend fjunction fstart 9style 9vis 9width 5style 5vis 5width 0saturate 1cale 5-x 6y 6z 2roll-m 8-b alock 9e 9inline 9l 9n 9r 9s 9t 9u 9x 9y 7p 8-b alock 9e 9inline 9l 9n 9r 9s 9t 9u 9x 9y 6bar-color athumb brack 1epia 1hadow 6-outline-width 1ize 1kew 4-x 5y 0text-align a-all 6utospace 5emphasis d-color estyle 5spacing c-trim 6troke b-color cwidth 5wrap 9-mode astyle 1ransform 5ition a-behavior bdelay curation bproperty btiming 5late 9-x ay az 0w 1hite-space b-collapse ctrim");
|
|
12
|
-
function decodeRows(patternData, equalData, importantData) {
|
|
13
|
-
const patterns = patternData.split("|").map((data) => {
|
|
14
|
-
let previous = 0;
|
|
15
|
-
return numbers(data).map((gap) => (previous += gap));
|
|
16
|
-
});
|
|
17
|
-
const rows = [[]];
|
|
18
|
-
const seen = new Map([["", 0]]);
|
|
19
|
-
const decode = (data) => numbers(data).map((pattern, source) => {
|
|
20
|
-
const row = patterns[pattern].map((offset) => source + offset);
|
|
21
|
-
const key = row.join(",");
|
|
22
|
-
let id = seen.get(key);
|
|
23
|
-
if (id === undefined) {
|
|
24
|
-
id = rows.length;
|
|
25
|
-
Object.defineProperty(rows, id, { value: row, configurable: true, enumerable: true, writable: true });
|
|
26
|
-
seen.set(key, id);
|
|
27
|
-
}
|
|
28
|
-
return id;
|
|
29
|
-
});
|
|
30
|
-
return { rows, equalRows: decode(equalData), importantRows: decode(importantData) };
|
|
31
|
-
}
|
|
32
|
-
export const { rows, equalRows, importantRows } = decodeRows("|1,1,1,1,1,1,1,1,1,1,1|3|2|1|-3,1,1,2,1,1,1,1,1|-1|-2|-3|-4|-5|-6|13|1,1,1|-13|1,1,1,1|42|1,1,1,1,1,1,1,1,1,1,1,1,1,14,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1|1,1,1,1n,1,1,1,h,1,1,1|1q,k|-7,4,5,1d,4,4,4,4,8,4,5,4|17|-13,14,1,1,1,1|-1d,1,1,1,1b,1,1,d,1,1,1|-1d,1t|1,1|-27,4,5,1d,4,4,4,4,8,4,5,4|-2f,4,5,1d,4,4,4,4,8,4,5,4|-t,1,1,1,5,1,1,1,j,1,1|-t,8|-2n,1,1,1,27,1,1,1,b,1,1|-2n,2a|3a,1,8p,1|18|-4,1,1,1|12|1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,8f,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1|1,1,1,1,1,97,1,1|2,2|1,9a|1,99|1,1,1,b,1,8u,1,6|2,c|1,97|1,96|-a,1,a,e,1,8l,5,7|-a,p|-6,1,1,1,4,91,1,2|-6,2|-c,1,c,c,1,8k,6,6|-c,p|-8,1,8,4,1,8t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int8Array(prefixes.length);
|
|
34
|
-
const flags = numbers("f,4,g,4,h,4,i,5,j,4,k,4,l,4,m,4,n,4,o,4,1z,2,4s,9,4t,2,4z,2,60,2,61,3,62,2,7c,2,7n,2,82,8,83,8,84,2,ft,2,go,7,gp,6,gq,6,gr,2,gs,8,gt,8");
|
|
35
|
-
for (let index = 0; index < flags.length; index += 2)
|
|
36
|
-
finalizerFlags[flags[index]] = flags[index + 1];
|
|
37
|
-
export const typographyNames = new Set(["heading-1x", "heading-1x-mono", "heading-2x", "heading-2x-mono", "heading-3x", "heading-3x-mono", "heading-4x", "heading-4x-mono", "heading-5x", "heading-5x-mono", "heading-6x", "heading-6x-mono", "heading-7x", "heading-7x-mono", "heading-8x", "heading-8x-mono", "heading-9x", "heading-9x-mono", "label-1x", "label-1x-mono", "label-2x", "label-2x-mono", "label-3x", "label-3x-mono", "label-4x", "label-4x-mono", "label-5x", "label-5x-mono", "label-6x", "label-6x-mono", "label-7x", "label-7x-mono", "label-8x", "label-8x-mono", "label-9x", "label-9x-mono", "prose-1x", "prose-1x-mono", "prose-2x", "prose-2x-mono", "prose-3x", "prose-3x-mono", "prose-4x", "prose-4x-mono", "prose-5x", "prose-5x-mono", "prose-6x", "prose-6x-mono", "prose-7x", "prose-7x-mono", "prose-8x", "prose-8x-mono", "prose-9x", "prose-9x-mono"]);
|
package/dist/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { omitAttributes } from "./attributes.js";
|
|
2
|
-
export type { ClassDict, ClassValue, Merger } from "./input.js";
|
|
3
|
-
export { cn } from "./merge.js";
|
|
4
|
-
export type { ClassProp, RecipeIntrospection, Reciper, VariantProps } from "./recipe.js";
|
|
5
|
-
export { recipe } from "./recipe.js";
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
DELETED
package/dist/input.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type ClassDict = Record<string, any>;
|
|
2
|
-
export type ClassValue = string | number | bigint | null | undefined | boolean | readonly ClassValue[] | ClassDict;
|
|
3
|
-
export interface Merger {
|
|
4
|
-
(strings: TemplateStringsArray, ...expressions: ClassValue[]): string;
|
|
5
|
-
(...inputs: ClassValue[]): string;
|
|
6
|
-
}
|
|
7
|
-
/** Internal (also used by recipe.ts): define an own data element even when the index is prototype-shadowed. */
|
|
8
|
-
export declare function setOwnArrayIndex<Value>(target: Value[], index: number, value: Value): void;
|
|
9
|
-
/** Internal (also used by recipe.ts): append as an own element, resisting Array.prototype pollution. */
|
|
10
|
-
export declare function appendOwnArrayValue<Value>(target: Value[], value: Value): void;
|
|
11
|
-
/** Normalize nested class values without applying semantic conflict resolution. */
|
|
12
|
-
export declare function toClassString(inputs: readonly ClassValue[]): string;
|
|
13
|
-
/** Dispatch templates before ordinary ClassValue normalization; read raw exactly once. */
|
|
14
|
-
export declare function normalizeInput(args: readonly ClassValue[]): string;
|
|
15
|
-
//# sourceMappingURL=input.d.ts.map
|
package/dist/input.js
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
const ARRAY_LENGTH_LIMIT = 0xffffffff;
|
|
2
|
-
const ARRAY_LENGTH_EXPECTATION = "must have an integer length from 0 through 4294967294";
|
|
3
|
-
const MISSING_OWN_VALUE = Symbol("missing-own-value");
|
|
4
|
-
function valueFromDescriptor(receiver, descriptor) {
|
|
5
|
-
if ("value" in descriptor)
|
|
6
|
-
return descriptor.value;
|
|
7
|
-
return descriptor.get === undefined ? undefined : Reflect.apply(descriptor.get, receiver, []);
|
|
8
|
-
}
|
|
9
|
-
function snapshotOwnValue(receiver, property) {
|
|
10
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(receiver, property);
|
|
11
|
-
return descriptor === undefined ? MISSING_OWN_VALUE : valueFromDescriptor(receiver, descriptor);
|
|
12
|
-
}
|
|
13
|
-
/** Internal (also used by recipe.ts): define an own data element even when the index is prototype-shadowed. */
|
|
14
|
-
export function setOwnArrayIndex(target, index, value) {
|
|
15
|
-
Object.defineProperty(target, index, {
|
|
16
|
-
configurable: true,
|
|
17
|
-
enumerable: true,
|
|
18
|
-
value,
|
|
19
|
-
writable: true,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
/** Internal (also used by recipe.ts): append as an own element, resisting Array.prototype pollution. */
|
|
23
|
-
export function appendOwnArrayValue(target, value) {
|
|
24
|
-
const index = target.length;
|
|
25
|
-
if (index in target) {
|
|
26
|
-
setOwnArrayIndex(target, index, value);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
target[index] = value;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
function snapshotArrayLength(value) {
|
|
33
|
-
const length = snapshotOwnValue(value, "length");
|
|
34
|
-
return typeof length === "number" && Number.isInteger(length) && length >= 0 && length < ARRAY_LENGTH_LIMIT ? length : null;
|
|
35
|
-
}
|
|
36
|
-
/** Normalize nested class values without applying semantic conflict resolution. */
|
|
37
|
-
export function toClassString(inputs) {
|
|
38
|
-
let value = "";
|
|
39
|
-
const length = snapshotArrayLength(inputs);
|
|
40
|
-
if (length === null) {
|
|
41
|
-
throw new TypeError(`[TeaCSS classes] class-value array ${ARRAY_LENGTH_EXPECTATION}`);
|
|
42
|
-
}
|
|
43
|
-
for (let index = 0; index < length; index++) {
|
|
44
|
-
const input = snapshotOwnValue(inputs, index);
|
|
45
|
-
if (input === MISSING_OWN_VALUE)
|
|
46
|
-
continue;
|
|
47
|
-
const part = resolveValue(input);
|
|
48
|
-
if (part)
|
|
49
|
-
value += (value && " ") + part;
|
|
50
|
-
}
|
|
51
|
-
return value;
|
|
52
|
-
}
|
|
53
|
-
function resolveValue(input) {
|
|
54
|
-
if (!input)
|
|
55
|
-
return "";
|
|
56
|
-
if (typeof input === "string")
|
|
57
|
-
return input;
|
|
58
|
-
if (typeof input === "number" || typeof input === "bigint")
|
|
59
|
-
return String(input);
|
|
60
|
-
if (Array.isArray(input))
|
|
61
|
-
return toClassString(input);
|
|
62
|
-
if (typeof input === "object") {
|
|
63
|
-
const dictionary = input;
|
|
64
|
-
let value = "";
|
|
65
|
-
for (const key of Reflect.ownKeys(dictionary)) {
|
|
66
|
-
if (typeof key !== "string")
|
|
67
|
-
continue;
|
|
68
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(dictionary, key);
|
|
69
|
-
if (descriptor === undefined || !descriptor.enumerable)
|
|
70
|
-
continue;
|
|
71
|
-
if (valueFromDescriptor(dictionary, descriptor))
|
|
72
|
-
value += (value && " ") + key;
|
|
73
|
-
}
|
|
74
|
-
return value;
|
|
75
|
-
}
|
|
76
|
-
return "";
|
|
77
|
-
}
|
|
78
|
-
function templateLiteralAt(strings, rawStrings, index) {
|
|
79
|
-
const cooked = snapshotOwnValue(strings, index);
|
|
80
|
-
if (cooked === MISSING_OWN_VALUE)
|
|
81
|
-
return "";
|
|
82
|
-
if (typeof cooked === "string")
|
|
83
|
-
return cooked;
|
|
84
|
-
if (Array.isArray(rawStrings)) {
|
|
85
|
-
const raw = snapshotOwnValue(rawStrings, index);
|
|
86
|
-
if (typeof raw === "string")
|
|
87
|
-
return raw;
|
|
88
|
-
}
|
|
89
|
-
return "";
|
|
90
|
-
}
|
|
91
|
-
function resolveTemplateExpression(input) {
|
|
92
|
-
if (typeof input === "number" || typeof input === "bigint")
|
|
93
|
-
return String(input);
|
|
94
|
-
return resolveValue(input);
|
|
95
|
-
}
|
|
96
|
-
function buildTemplateInput(strings, rawStrings, args) {
|
|
97
|
-
let input = "";
|
|
98
|
-
const length = snapshotArrayLength(strings);
|
|
99
|
-
if (length === null) {
|
|
100
|
-
throw new TypeError(`[TeaCSS classes] tagged-template strings ${ARRAY_LENGTH_EXPECTATION}`);
|
|
101
|
-
}
|
|
102
|
-
for (let index = 0; index < length; index++) {
|
|
103
|
-
input += templateLiteralAt(strings, rawStrings, index);
|
|
104
|
-
if (index + 1 < length && index + 1 < args.length) {
|
|
105
|
-
const expression = resolveTemplateExpression(args[index + 1]);
|
|
106
|
-
input += expression;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
return input;
|
|
110
|
-
}
|
|
111
|
-
/** Dispatch templates before ordinary ClassValue normalization; read raw exactly once. */
|
|
112
|
-
export function normalizeInput(args) {
|
|
113
|
-
const first = args[0];
|
|
114
|
-
const raw = Array.isArray(first) ? snapshotOwnValue(first, "raw") : MISSING_OWN_VALUE;
|
|
115
|
-
return Array.isArray(raw) ? buildTemplateInput(first, raw, args) : toClassString(args);
|
|
116
|
-
}
|
package/dist/merge.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/** Fixed declaration policy and Official numbered typography grouping. */
|
|
2
|
-
import { type ClassValue, type Merger } from "./input.js";
|
|
3
|
-
export type { ClassDict, ClassValue, Merger } from "./input.js";
|
|
4
|
-
interface Token {
|
|
5
|
-
readonly raw: string;
|
|
6
|
-
readonly id: number;
|
|
7
|
-
readonly important: number;
|
|
8
|
-
readonly condition: string;
|
|
9
|
-
readonly identity: string;
|
|
10
|
-
readonly family: number;
|
|
11
|
-
}
|
|
12
|
-
export interface PreparedFragment {
|
|
13
|
-
readonly raw: string;
|
|
14
|
-
readonly tokens?: readonly Token[];
|
|
15
|
-
}
|
|
16
|
-
/** Source-only controls for equivalence tests and performance ablation. */
|
|
17
|
-
export interface RuntimeOptions {
|
|
18
|
-
readonly tupleCache?: boolean;
|
|
19
|
-
readonly resultCache?: boolean;
|
|
20
|
-
readonly descriptorCache?: boolean;
|
|
21
|
-
readonly epochLimit?: number;
|
|
22
|
-
}
|
|
23
|
-
/** Selector roles in the engine's assembly order: `<prefix><subject><suffix><combinator><pseudo-element>`, then parent at-rules. */
|
|
24
|
-
export declare const PREFIX = 1;
|
|
25
|
-
export declare const SUFFIX = 2;
|
|
26
|
-
export declare const COMBINATOR = 4;
|
|
27
|
-
export declare const PSEUDO_ELEMENT = 8;
|
|
28
|
-
export declare const PARENT = 16;
|
|
29
|
-
/**
|
|
30
|
-
* The roles a condition's CSS occupies, mirroring the Standard resolvers. A role
|
|
31
|
-
* the condition may not use is harmless: it only keeps more condition keys apart.
|
|
32
|
-
*/
|
|
33
|
-
export declare function conditionRoles(condition: string): number;
|
|
34
|
-
export declare function createRuntime(options?: RuntimeOptions): {
|
|
35
|
-
cn: Merger;
|
|
36
|
-
prepareFragment: (raw: string) => PreparedFragment;
|
|
37
|
-
mergePrepared: (fragments: readonly PreparedFragment[], caller: ClassValue) => string;
|
|
38
|
-
inspect: () => {
|
|
39
|
-
tuples: {
|
|
40
|
-
size: number;
|
|
41
|
-
bytes: number;
|
|
42
|
-
nodes: number;
|
|
43
|
-
};
|
|
44
|
-
results: {
|
|
45
|
-
size: number;
|
|
46
|
-
bytes: number;
|
|
47
|
-
};
|
|
48
|
-
descriptors: {
|
|
49
|
-
size: number;
|
|
50
|
-
bytes: number;
|
|
51
|
-
};
|
|
52
|
-
scratch: {
|
|
53
|
-
bytes: number;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
export declare const cn: Merger, prepareFragment: (raw: string) => PreparedFragment, mergePrepared: (fragments: readonly PreparedFragment[], caller: ClassValue) => string;
|
|
58
|
-
//# sourceMappingURL=merge.d.ts.map
|