@plumeria/core 2.2.0 → 2.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/css.js +44 -92
- package/dist/css.mjs +41 -53
- package/dist/index.js +25 -25
- package/dist/index.mjs +26 -26
- package/dist/processors/css.d.ts +13 -9
- package/dist/processors/css.js +2 -28
- package/dist/processors/css.mjs +2 -2
- package/package.json +2 -2
package/dist/css.js
CHANGED
|
@@ -22,58 +22,46 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
|
|
23
23
|
const zss_engine = __toESM(require("zss-engine"));
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const styleSheet = sheetQueue_2.shift();
|
|
66
|
-
if (!zss_engine.isDevelopment && styleSheet) (0, zss_engine.build)(styleSheet, filePath, "--global");
|
|
67
|
-
}
|
|
68
|
-
isProcessing_2 = false;
|
|
69
|
-
}
|
|
70
|
-
async function buildGlobal(filePath) {
|
|
71
|
-
if (typeof globalPromise_2 === "undefined") initPromise_2();
|
|
72
|
-
if (!isProcessing_2 && sheetQueue_2.length > 0) {
|
|
73
|
-
isProcessing_2 = true;
|
|
74
|
-
processQueue_2(filePath);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
25
|
+
const createProcessor = () => {
|
|
26
|
+
let resolve;
|
|
27
|
+
let promise;
|
|
28
|
+
const queue = [];
|
|
29
|
+
let processing = false;
|
|
30
|
+
const init = () => {
|
|
31
|
+
promise = new Promise((r) => {
|
|
32
|
+
resolve = (value) => {
|
|
33
|
+
queue.push(value);
|
|
34
|
+
r(value);
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
const process = async (filePath) => {
|
|
39
|
+
while (queue.length > 0) {
|
|
40
|
+
const sheet = queue.shift();
|
|
41
|
+
if (!zss_engine.isDevelopment && sheet) (0, zss_engine.build)(sheet, filePath);
|
|
42
|
+
}
|
|
43
|
+
processing = false;
|
|
44
|
+
};
|
|
45
|
+
const buildFiles = async (filePath) => {
|
|
46
|
+
if (!promise) init();
|
|
47
|
+
if (!processing && queue.length > 0) {
|
|
48
|
+
processing = true;
|
|
49
|
+
process(filePath);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
get resolve() {
|
|
54
|
+
return resolve;
|
|
55
|
+
},
|
|
56
|
+
get promise() {
|
|
57
|
+
return promise;
|
|
58
|
+
},
|
|
59
|
+
init,
|
|
60
|
+
build: buildFiles
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
const gQueue = createProcessor();
|
|
64
|
+
const pQueue = createProcessor();
|
|
77
65
|
|
|
78
66
|
Object.defineProperty(exports, '__toESM', {
|
|
79
67
|
enumerable: true,
|
|
@@ -81,51 +69,15 @@ Object.defineProperty(exports, '__toESM', {
|
|
|
81
69
|
return __toESM;
|
|
82
70
|
}
|
|
83
71
|
});
|
|
84
|
-
Object.defineProperty(exports, '
|
|
85
|
-
enumerable: true,
|
|
86
|
-
get: function () {
|
|
87
|
-
return buildGlobal;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
Object.defineProperty(exports, 'buildProps', {
|
|
91
|
-
enumerable: true,
|
|
92
|
-
get: function () {
|
|
93
|
-
return buildProps;
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
Object.defineProperty(exports, 'globalPromise_1', {
|
|
97
|
-
enumerable: true,
|
|
98
|
-
get: function () {
|
|
99
|
-
return globalPromise_1;
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
Object.defineProperty(exports, 'globalPromise_2', {
|
|
103
|
-
enumerable: true,
|
|
104
|
-
get: function () {
|
|
105
|
-
return globalPromise_2;
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
Object.defineProperty(exports, 'initPromise_1', {
|
|
109
|
-
enumerable: true,
|
|
110
|
-
get: function () {
|
|
111
|
-
return initPromise_1;
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
Object.defineProperty(exports, 'initPromise_2', {
|
|
115
|
-
enumerable: true,
|
|
116
|
-
get: function () {
|
|
117
|
-
return initPromise_2;
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
Object.defineProperty(exports, 'resolvePromise_1', {
|
|
72
|
+
Object.defineProperty(exports, 'gQueue', {
|
|
121
73
|
enumerable: true,
|
|
122
74
|
get: function () {
|
|
123
|
-
return
|
|
75
|
+
return gQueue;
|
|
124
76
|
}
|
|
125
77
|
});
|
|
126
|
-
Object.defineProperty(exports, '
|
|
78
|
+
Object.defineProperty(exports, 'pQueue', {
|
|
127
79
|
enumerable: true,
|
|
128
80
|
get: function () {
|
|
129
|
-
return
|
|
81
|
+
return pQueue;
|
|
130
82
|
}
|
|
131
83
|
});
|
package/dist/css.mjs
CHANGED
|
@@ -1,56 +1,44 @@
|
|
|
1
1
|
import { build, isDevelopment } from "zss-engine";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
let
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const styleSheet = sheetQueue_2.shift();
|
|
44
|
-
if (!isDevelopment && styleSheet) build(styleSheet, filePath, "--global");
|
|
45
|
-
}
|
|
46
|
-
isProcessing_2 = false;
|
|
47
|
-
}
|
|
48
|
-
async function buildGlobal(filePath) {
|
|
49
|
-
if (typeof globalPromise_2 === "undefined") initPromise_2();
|
|
50
|
-
if (!isProcessing_2 && sheetQueue_2.length > 0) {
|
|
51
|
-
isProcessing_2 = true;
|
|
52
|
-
processQueue_2(filePath);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
3
|
+
const createProcessor = () => {
|
|
4
|
+
let resolve;
|
|
5
|
+
let promise;
|
|
6
|
+
const queue = [];
|
|
7
|
+
let processing = false;
|
|
8
|
+
const init = () => {
|
|
9
|
+
promise = new Promise((r) => {
|
|
10
|
+
resolve = (value) => {
|
|
11
|
+
queue.push(value);
|
|
12
|
+
r(value);
|
|
13
|
+
};
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
const process = async (filePath) => {
|
|
17
|
+
while (queue.length > 0) {
|
|
18
|
+
const sheet = queue.shift();
|
|
19
|
+
if (!isDevelopment && sheet) build(sheet, filePath);
|
|
20
|
+
}
|
|
21
|
+
processing = false;
|
|
22
|
+
};
|
|
23
|
+
const buildFiles = async (filePath) => {
|
|
24
|
+
if (!promise) init();
|
|
25
|
+
if (!processing && queue.length > 0) {
|
|
26
|
+
processing = true;
|
|
27
|
+
process(filePath);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
return {
|
|
31
|
+
get resolve() {
|
|
32
|
+
return resolve;
|
|
33
|
+
},
|
|
34
|
+
get promise() {
|
|
35
|
+
return promise;
|
|
36
|
+
},
|
|
37
|
+
init,
|
|
38
|
+
build: buildFiles
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
const gQueue = createProcessor();
|
|
42
|
+
const pQueue = createProcessor();
|
|
55
43
|
|
|
56
|
-
export {
|
|
44
|
+
export { gQueue, pQueue };
|
package/dist/index.js
CHANGED
|
@@ -11,34 +11,34 @@ function create(object) {
|
|
|
11
11
|
const finalFlat = (0, zss_engine.overrideLonghand)(flat);
|
|
12
12
|
const records = [];
|
|
13
13
|
Object.entries(finalFlat).forEach(([prop, value]) => {
|
|
14
|
-
if (
|
|
14
|
+
if (prop.startsWith("@media") || prop.startsWith("@container")) Object.entries(value).forEach(([innerProp, innerValue]) => {
|
|
15
15
|
const atomicMap = new Map();
|
|
16
16
|
(0, zss_engine.processAtomicProps)({ [innerProp]: innerValue }, atomicMap, prop);
|
|
17
|
-
const
|
|
18
|
-
const
|
|
17
|
+
const querySheets = [];
|
|
18
|
+
const queryHashes = [];
|
|
19
19
|
for (const [hash, sheet] of atomicMap) {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
querySheets.push(sheet.replace(`.${hash}`, `.${hash}:not(#\\#)`));
|
|
21
|
+
queryHashes.push(hash);
|
|
22
22
|
}
|
|
23
|
-
if (
|
|
23
|
+
if (querySheets.length > 0) records.push({
|
|
24
24
|
key: prop + innerProp,
|
|
25
|
-
hash:
|
|
26
|
-
sheet:
|
|
25
|
+
hash: queryHashes.join(" "),
|
|
26
|
+
sheet: querySheets.join("")
|
|
27
27
|
});
|
|
28
28
|
});
|
|
29
29
|
else {
|
|
30
30
|
const atomicMap = new Map();
|
|
31
31
|
(0, zss_engine.processAtomicProps)({ [prop]: value }, atomicMap);
|
|
32
|
-
const
|
|
33
|
-
const
|
|
32
|
+
const sheets = [];
|
|
33
|
+
const hashes = [];
|
|
34
34
|
for (const [hash, sheet] of atomicMap) {
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
sheets.push(sheet);
|
|
36
|
+
hashes.push(hash);
|
|
37
37
|
}
|
|
38
|
-
if (
|
|
38
|
+
if (sheets.length > 0) records.push({
|
|
39
39
|
key: prop,
|
|
40
|
-
hash:
|
|
41
|
-
sheet:
|
|
40
|
+
hash: hashes.join(" "),
|
|
41
|
+
sheet: sheets.join("")
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
});
|
|
@@ -73,10 +73,10 @@ function create(object) {
|
|
|
73
73
|
return Object.freeze(result);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
const
|
|
76
|
+
const setSheets = new Set();
|
|
77
77
|
function props(...objects) {
|
|
78
78
|
const seenSheets = new Set();
|
|
79
|
-
const
|
|
79
|
+
const baseSheets = [];
|
|
80
80
|
const classList = [];
|
|
81
81
|
const chosen = new Map();
|
|
82
82
|
const rightmostKeys = [];
|
|
@@ -112,24 +112,24 @@ function props(...objects) {
|
|
|
112
112
|
for (const { hash, sheet } of orderedKeys) if (!seenSheets.has(sheet)) {
|
|
113
113
|
seenSheets.add(sheet);
|
|
114
114
|
classList.push(hash);
|
|
115
|
-
|
|
115
|
+
baseSheets.push(sheet);
|
|
116
116
|
}
|
|
117
117
|
for (const { hash, sheet } of rightmostKeys) if (!seenSheets.has(sheet)) {
|
|
118
118
|
seenSheets.add(sheet);
|
|
119
119
|
classList.push(hash);
|
|
120
|
-
|
|
120
|
+
baseSheets.push(sheet);
|
|
121
121
|
}
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
if (typeof require_css.
|
|
125
|
-
require_css.
|
|
122
|
+
const uniqueSheets = [...baseSheets].filter((sheet) => !setSheets.has(sheet));
|
|
123
|
+
uniqueSheets.forEach((sheet) => setSheets.add(sheet));
|
|
124
|
+
if (typeof require_css.pQueue.promise === "undefined") require_css.pQueue.init();
|
|
125
|
+
require_css.pQueue.resolve(uniqueSheets.join(""));
|
|
126
126
|
return classList.join(" ");
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
function global(object) {
|
|
130
130
|
const { styleSheet } = (0, zss_engine.transpile)(object, void 0, "--global");
|
|
131
|
-
if (typeof require_css.
|
|
132
|
-
require_css.
|
|
131
|
+
if (typeof require_css.gQueue.promise === "undefined") require_css.gQueue.init();
|
|
132
|
+
require_css.gQueue.resolve(styleSheet);
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
const keyframes = (object) => {
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { gQueue, pQueue } from "./css.mjs";
|
|
2
2
|
import { camelToKebabCase, genBase36Hash, overrideLonghand, processAtomicProps, splitAtomicAndNested, transpile } from "zss-engine";
|
|
3
3
|
|
|
4
4
|
const styleAtomMap = new WeakMap();
|
|
@@ -11,34 +11,34 @@ function create(object) {
|
|
|
11
11
|
const finalFlat = overrideLonghand(flat);
|
|
12
12
|
const records = [];
|
|
13
13
|
Object.entries(finalFlat).forEach(([prop, value]) => {
|
|
14
|
-
if (
|
|
14
|
+
if (prop.startsWith("@media") || prop.startsWith("@container")) Object.entries(value).forEach(([innerProp, innerValue]) => {
|
|
15
15
|
const atomicMap = new Map();
|
|
16
16
|
processAtomicProps({ [innerProp]: innerValue }, atomicMap, prop);
|
|
17
|
-
const
|
|
18
|
-
const
|
|
17
|
+
const querySheets = [];
|
|
18
|
+
const queryHashes = [];
|
|
19
19
|
for (const [hash, sheet] of atomicMap) {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
querySheets.push(sheet.replace(`.${hash}`, `.${hash}:not(#\\#)`));
|
|
21
|
+
queryHashes.push(hash);
|
|
22
22
|
}
|
|
23
|
-
if (
|
|
23
|
+
if (querySheets.length > 0) records.push({
|
|
24
24
|
key: prop + innerProp,
|
|
25
|
-
hash:
|
|
26
|
-
sheet:
|
|
25
|
+
hash: queryHashes.join(" "),
|
|
26
|
+
sheet: querySheets.join("")
|
|
27
27
|
});
|
|
28
28
|
});
|
|
29
29
|
else {
|
|
30
30
|
const atomicMap = new Map();
|
|
31
31
|
processAtomicProps({ [prop]: value }, atomicMap);
|
|
32
|
-
const
|
|
33
|
-
const
|
|
32
|
+
const sheets = [];
|
|
33
|
+
const hashes = [];
|
|
34
34
|
for (const [hash, sheet] of atomicMap) {
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
sheets.push(sheet);
|
|
36
|
+
hashes.push(hash);
|
|
37
37
|
}
|
|
38
|
-
if (
|
|
38
|
+
if (sheets.length > 0) records.push({
|
|
39
39
|
key: prop,
|
|
40
|
-
hash:
|
|
41
|
-
sheet:
|
|
40
|
+
hash: hashes.join(" "),
|
|
41
|
+
sheet: sheets.join("")
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
});
|
|
@@ -73,10 +73,10 @@ function create(object) {
|
|
|
73
73
|
return Object.freeze(result);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
const
|
|
76
|
+
const setSheets = new Set();
|
|
77
77
|
function props(...objects) {
|
|
78
78
|
const seenSheets = new Set();
|
|
79
|
-
const
|
|
79
|
+
const baseSheets = [];
|
|
80
80
|
const classList = [];
|
|
81
81
|
const chosen = new Map();
|
|
82
82
|
const rightmostKeys = [];
|
|
@@ -112,24 +112,24 @@ function props(...objects) {
|
|
|
112
112
|
for (const { hash, sheet } of orderedKeys) if (!seenSheets.has(sheet)) {
|
|
113
113
|
seenSheets.add(sheet);
|
|
114
114
|
classList.push(hash);
|
|
115
|
-
|
|
115
|
+
baseSheets.push(sheet);
|
|
116
116
|
}
|
|
117
117
|
for (const { hash, sheet } of rightmostKeys) if (!seenSheets.has(sheet)) {
|
|
118
118
|
seenSheets.add(sheet);
|
|
119
119
|
classList.push(hash);
|
|
120
|
-
|
|
120
|
+
baseSheets.push(sheet);
|
|
121
121
|
}
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
if (typeof
|
|
125
|
-
|
|
122
|
+
const uniqueSheets = [...baseSheets].filter((sheet) => !setSheets.has(sheet));
|
|
123
|
+
uniqueSheets.forEach((sheet) => setSheets.add(sheet));
|
|
124
|
+
if (typeof pQueue.promise === "undefined") pQueue.init();
|
|
125
|
+
pQueue.resolve(uniqueSheets.join(""));
|
|
126
126
|
return classList.join(" ");
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
function global(object) {
|
|
130
130
|
const { styleSheet } = transpile(object, void 0, "--global");
|
|
131
|
-
if (typeof
|
|
132
|
-
|
|
131
|
+
if (typeof gQueue.promise === "undefined") gQueue.init();
|
|
132
|
+
gQueue.resolve(styleSheet);
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
const keyframes = (object) => {
|
package/dist/processors/css.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
declare
|
|
9
|
-
|
|
2
|
+
declare const gQueue: {
|
|
3
|
+
readonly resolve: (value: string) => void;
|
|
4
|
+
readonly promise: Promise<string>;
|
|
5
|
+
init: () => void;
|
|
6
|
+
build: (filePath: string) => Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
declare const pQueue: {
|
|
9
|
+
readonly resolve: (value: string) => void;
|
|
10
|
+
readonly promise: Promise<string>;
|
|
11
|
+
init: () => void;
|
|
12
|
+
build: (filePath: string) => Promise<void>;
|
|
13
|
+
};
|
|
10
14
|
|
|
11
|
-
export {
|
|
15
|
+
export { gQueue, pQueue };
|
package/dist/processors/css.js
CHANGED
|
@@ -1,29 +1,3 @@
|
|
|
1
1
|
const require_css = require('../css.js');
|
|
2
|
-
exports.
|
|
3
|
-
exports.
|
|
4
|
-
Object.defineProperty(exports, 'globalPromise_1', {
|
|
5
|
-
enumerable: true,
|
|
6
|
-
get: function () {
|
|
7
|
-
return require_css.globalPromise_1;
|
|
8
|
-
}
|
|
9
|
-
});
|
|
10
|
-
Object.defineProperty(exports, 'globalPromise_2', {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return require_css.globalPromise_2;
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
exports.initPromise_1 = require_css.initPromise_1;
|
|
17
|
-
exports.initPromise_2 = require_css.initPromise_2;
|
|
18
|
-
Object.defineProperty(exports, 'resolvePromise_1', {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return require_css.resolvePromise_1;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, 'resolvePromise_2', {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return require_css.resolvePromise_2;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
2
|
+
exports.gQueue = require_css.gQueue;
|
|
3
|
+
exports.pQueue = require_css.pQueue;
|
package/dist/processors/css.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { gQueue, pQueue } from "../css.mjs";
|
|
2
|
+
export { gQueue, pQueue };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/core",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "An atomic CSS runtime designed to disappear.",
|
|
5
5
|
"author": "Refirst 11",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"stylesheet.css"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"zss-engine": "1.2.
|
|
48
|
+
"zss-engine": "1.2.2"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public",
|