css-in-js-engine-pb 0.2.0 → 0.2.2
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/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/insertWithBucket.d.ts.map +1 -1
- package/dist/insertWithBucket.js +24 -27
- package/dist/shorthands/borderColor.d.ts +2 -0
- package/dist/shorthands/borderColor.d.ts.map +1 -1
- package/dist/shorthands/borderColor.js +8 -1
- package/dist/shorthands/index.d.ts +1 -0
- package/dist/shorthands/index.d.ts.map +1 -1
- package/dist/shorthands/index.js +1 -1
- package/package.json +1 -1
- package/dist/shorthands/borderBottom.d.ts +0 -1
- package/dist/shorthands/borderBottom.d.ts.map +0 -1
- package/dist/shorthands/borderBottom.js +0 -1
- package/dist/shorthands/borderLeft.d.ts +0 -1
- package/dist/shorthands/borderLeft.d.ts.map +0 -1
- package/dist/shorthands/borderLeft.js +0 -1
- package/dist/shorthands/borderRadius.d.ts +0 -1
- package/dist/shorthands/borderRadius.d.ts.map +0 -1
- package/dist/shorthands/borderRadius.js +0 -1
- package/dist/shorthands/borderRight.d.ts +0 -1
- package/dist/shorthands/borderRight.d.ts.map +0 -1
- package/dist/shorthands/borderRight.js +0 -1
- package/dist/shorthands/borderStyle.d.ts +0 -1
- package/dist/shorthands/borderStyle.d.ts.map +0 -1
- package/dist/shorthands/borderStyle.js +0 -1
- package/dist/shorthands/borderTop.d.ts +0 -1
- package/dist/shorthands/borderTop.d.ts.map +0 -1
- package/dist/shorthands/borderTop.js +0 -1
- package/dist/shorthands/borderWidth.d.ts +0 -1
- package/dist/shorthands/borderWidth.d.ts.map +0 -1
- package/dist/shorthands/borderWidth.js +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ export { mergeClasses } from './mergeClasses';
|
|
|
2
2
|
export { makeStyles } from './makeStyles';
|
|
3
3
|
export { makeStaticStyles } from './makeStaticStyles';
|
|
4
4
|
export { makeResetStyles } from './makeResetStyles';
|
|
5
|
-
|
|
5
|
+
import { borderColor } from './shorthands';
|
|
6
|
+
export declare const shorthands: {
|
|
7
|
+
borderColor: typeof borderColor;
|
|
8
|
+
};
|
|
6
9
|
export type { StyleRule, CSSValue, StylesBySlots, ClassNamesBySlot, } from './types';
|
|
7
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EACH,WAAW,EACd,MAAM,cAAc,CAAC;AAEtB,eAAO,MAAM,UAAU;;CAEtB,CAAC;AAEF,YAAY,EACR,SAAS,EACT,QAAQ,EACR,aAAa,EACb,gBAAgB,GACnB,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,4 +2,7 @@ export { mergeClasses } from './mergeClasses';
|
|
|
2
2
|
export { makeStyles } from './makeStyles';
|
|
3
3
|
export { makeStaticStyles } from './makeStaticStyles';
|
|
4
4
|
export { makeResetStyles } from './makeResetStyles';
|
|
5
|
-
|
|
5
|
+
import { borderColor } from './shorthands';
|
|
6
|
+
export const shorthands = {
|
|
7
|
+
borderColor
|
|
8
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertWithBucket.d.ts","sourceRoot":"","sources":["../src/insertWithBucket.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"insertWithBucket.d.ts","sourceRoot":"","sources":["../src/insertWithBucket.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAmC5C,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,WAAW,QAqDzE"}
|
package/dist/insertWithBucket.js
CHANGED
|
@@ -2,7 +2,6 @@ import { insertRulesOnce } from './insertOnce';
|
|
|
2
2
|
import { StyleBucket } from './StyleBucket';
|
|
3
3
|
const bucketRules = new Map();
|
|
4
4
|
const seenBuckets = new Set();
|
|
5
|
-
const flushedBuckets = new Set();
|
|
6
5
|
const ORDER = [
|
|
7
6
|
StyleBucket.Reset,
|
|
8
7
|
StyleBucket.Base,
|
|
@@ -13,7 +12,6 @@ const ORDER = [
|
|
|
13
12
|
StyleBucket.Focus,
|
|
14
13
|
StyleBucket.User,
|
|
15
14
|
];
|
|
16
|
-
// Buckets that should NOT block ordering if unused
|
|
17
15
|
const OPTIONAL_BUCKETS = [
|
|
18
16
|
StyleBucket.Base,
|
|
19
17
|
StyleBucket.Size,
|
|
@@ -22,10 +20,10 @@ const OPTIONAL_BUCKETS = [
|
|
|
22
20
|
StyleBucket.Focus,
|
|
23
21
|
StyleBucket.User,
|
|
24
22
|
];
|
|
25
|
-
// Mark optional buckets as seen by default
|
|
26
23
|
for (const b of OPTIONAL_BUCKETS) {
|
|
27
24
|
seenBuckets.add(b);
|
|
28
25
|
}
|
|
26
|
+
let highestInsertedBucketIndex = -1;
|
|
29
27
|
function bucketName(bucket) {
|
|
30
28
|
var _a;
|
|
31
29
|
return (_a = StyleBucket[bucket]) !== null && _a !== void 0 ? _a : `UNKNOWN(${bucket})`;
|
|
@@ -33,45 +31,44 @@ function bucketName(bucket) {
|
|
|
33
31
|
export function insertRulesWithBucket(rules, bucket) {
|
|
34
32
|
console.groupCollapsed(`[STYLE] insertRulesWithBucket → ${bucketName(bucket)}`);
|
|
35
33
|
console.log('incoming rules.length:', rules.length);
|
|
36
|
-
// mark bucket as seen
|
|
37
34
|
seenBuckets.add(bucket);
|
|
38
|
-
// collect rules
|
|
39
35
|
if (rules.length) {
|
|
40
36
|
const existing = bucketRules.get(bucket);
|
|
41
|
-
if (existing)
|
|
37
|
+
if (existing)
|
|
42
38
|
existing.push(...rules);
|
|
43
|
-
|
|
44
|
-
else {
|
|
39
|
+
else
|
|
45
40
|
bucketRules.set(bucket, [...rules]);
|
|
46
|
-
}
|
|
47
41
|
}
|
|
48
42
|
console.log('bucketRules:', Array.from(bucketRules.entries()).map(([b, r]) => `${bucketName(b)}=${r.length}`));
|
|
49
43
|
console.log('seenBuckets:', Array.from(seenBuckets).map(bucketName));
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
.
|
|
61
|
-
.
|
|
62
|
-
|
|
63
|
-
console.log(`⛔ ${bucketName(b)} blocked (earlier bucket not seen yet)`);
|
|
64
|
-
break; // cannot flush further
|
|
44
|
+
const targetIndex = ORDER.indexOf(bucket);
|
|
45
|
+
if (targetIndex === -1) {
|
|
46
|
+
console.warn('⛔ bucket not in ORDER:', bucket);
|
|
47
|
+
console.groupEnd();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
// Don’t insert beyond unseen required buckets
|
|
51
|
+
// (Reset + Appearance are required; Base/Size/Shape/State/Focus/User are optional via pre-seed)
|
|
52
|
+
for (let i = 0; i <= targetIndex; i++) {
|
|
53
|
+
if (!seenBuckets.has(ORDER[i])) {
|
|
54
|
+
console.log(`⛔ blocked at ${bucketName(ORDER[i])} (not seen yet)`);
|
|
55
|
+
console.groupEnd();
|
|
56
|
+
return;
|
|
65
57
|
}
|
|
58
|
+
}
|
|
59
|
+
// Insert buckets in order up to targetIndex.
|
|
60
|
+
// IMPORTANT: we do NOT “flush forever”. We may insert more later.
|
|
61
|
+
for (let i = 0; i <= targetIndex; i++) {
|
|
62
|
+
const b = ORDER[i];
|
|
66
63
|
const r = bucketRules.get(b);
|
|
67
64
|
if (!r || r.length === 0) {
|
|
68
|
-
console.log(`⏳ ${bucketName(b)} has no rules
|
|
65
|
+
console.log(`⏳ ${bucketName(b)} has no queued rules`);
|
|
69
66
|
continue;
|
|
70
67
|
}
|
|
71
|
-
console.log(`➡
|
|
68
|
+
console.log(`➡ INSERTING ${r.length} queued rules from ${bucketName(b)}`);
|
|
72
69
|
insertRulesOnce(r);
|
|
73
|
-
flushedBuckets.add(b);
|
|
74
70
|
bucketRules.set(b, []);
|
|
71
|
+
highestInsertedBucketIndex = Math.max(highestInsertedBucketIndex, i);
|
|
75
72
|
}
|
|
76
73
|
console.groupEnd();
|
|
77
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"borderColor.d.ts","sourceRoot":"","sources":["../../src/shorthands/borderColor.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"borderColor.d.ts","sourceRoot":"","sources":["../../src/shorthands/borderColor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAOpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shorthands/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shorthands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/shorthands/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { borderColor } from './borderColor';
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=borderBottom.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"borderBottom.d.ts","sourceRoot":"","sources":["../../src/shorthands/borderBottom.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=borderLeft.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"borderLeft.d.ts","sourceRoot":"","sources":["../../src/shorthands/borderLeft.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=borderRadius.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"borderRadius.d.ts","sourceRoot":"","sources":["../../src/shorthands/borderRadius.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=borderRight.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"borderRight.d.ts","sourceRoot":"","sources":["../../src/shorthands/borderRight.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=borderStyle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"borderStyle.d.ts","sourceRoot":"","sources":["../../src/shorthands/borderStyle.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=borderTop.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"borderTop.d.ts","sourceRoot":"","sources":["../../src/shorthands/borderTop.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=borderWidth.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"borderWidth.d.ts","sourceRoot":"","sources":["../../src/shorthands/borderWidth.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|