@plumeria/core 0.7.20 → 0.8.0-beta.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/cjs/css.js +14 -14
- package/dist/esm/css.js +4 -4
- package/package.json +8 -19
- package/types/css.d.ts +1 -1
- package/LICENSE +0 -21
- package/dist/cjs/method/create-build-helper.js +0 -36
- package/dist/cjs/method/create.js +0 -24
- package/dist/cjs/method/define-theme-vars.js +0 -29
- package/dist/cjs/method/global-build-helper.js +0 -36
- package/dist/cjs/method/global.js +0 -16
- package/dist/cjs/method/keyframes.js +0 -11
- package/dist/esm/method/create-build-helper.js +0 -33
- package/dist/esm/method/create.js +0 -21
- package/dist/esm/method/define-theme-vars.js +0 -25
- package/dist/esm/method/global-build-helper.js +0 -33
- package/dist/esm/method/global.js +0 -13
- package/dist/esm/method/keyframes.js +0 -7
- package/types/method/create-build-helper.d.ts +0 -5
- package/types/method/create.d.ts +0 -2
- package/types/method/define-theme-vars.d.ts +0 -2
- package/types/method/global-build-helper.d.ts +0 -5
- package/types/method/global.d.ts +0 -2
- package/types/method/keyframes.d.ts +0 -2
package/dist/cjs/css.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.rx = exports.cx = exports.css = void 0;
|
|
4
|
-
const create_js_1 = require("./method/create.js");
|
|
5
|
-
const global_js_1 = require("./method/global.js");
|
|
6
|
-
const define_theme_vars_js_1 = require("./method/define-theme-vars.js");
|
|
7
|
-
const keyframes_js_1 = require("./method/keyframes.js");
|
|
8
4
|
const zss_utils_1 = require("zss-utils");
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
const zss_utils_2 = require("zss-utils");
|
|
6
|
+
const zss_utils_3 = require("zss-utils");
|
|
7
|
+
const zss_utils_4 = require("zss-utils");
|
|
8
|
+
const zss_utils_5 = require("zss-utils");
|
|
9
|
+
Object.defineProperty(exports, "cx", { enumerable: true, get: function () { return zss_utils_5.cx; } });
|
|
10
|
+
Object.defineProperty(exports, "rx", { enumerable: true, get: function () { return zss_utils_5.rx; } });
|
|
11
11
|
class css {
|
|
12
12
|
static create(object) {
|
|
13
|
-
return (0,
|
|
13
|
+
return (0, zss_utils_1.create)(object);
|
|
14
14
|
}
|
|
15
15
|
static global = ((called = false) => {
|
|
16
16
|
return (object) => {
|
|
@@ -18,18 +18,18 @@ class css {
|
|
|
18
18
|
throw new Error('css.global() must be one');
|
|
19
19
|
}
|
|
20
20
|
called = true;
|
|
21
|
-
return (0,
|
|
21
|
+
return (0, zss_utils_2.global)(object);
|
|
22
22
|
};
|
|
23
23
|
})();
|
|
24
24
|
static defineThemeVars(object) {
|
|
25
|
-
return (0,
|
|
25
|
+
return (0, zss_utils_3.defineThemeVars)(object);
|
|
26
26
|
}
|
|
27
27
|
static keyframes(object) {
|
|
28
|
-
return (0,
|
|
28
|
+
return (0, zss_utils_4.keyframes)(object);
|
|
29
29
|
}
|
|
30
|
-
static media =
|
|
31
|
-
static pseudo =
|
|
32
|
-
static colors =
|
|
33
|
-
static container =
|
|
30
|
+
static media = zss_utils_5.media;
|
|
31
|
+
static pseudo = zss_utils_5.pseudo;
|
|
32
|
+
static colors = zss_utils_5.colors;
|
|
33
|
+
static container = zss_utils_5.container;
|
|
34
34
|
}
|
|
35
35
|
exports.css = css;
|
package/dist/esm/css.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { create } from '
|
|
2
|
-
import { global } from '
|
|
3
|
-
import { defineThemeVars } from '
|
|
4
|
-
import { keyframes } from '
|
|
1
|
+
import { create } from 'zss-utils';
|
|
2
|
+
import { global } from 'zss-utils';
|
|
3
|
+
import { defineThemeVars } from 'zss-utils';
|
|
4
|
+
import { keyframes } from 'zss-utils';
|
|
5
5
|
import { media, pseudo, colors, container, cx, rx } from 'zss-utils';
|
|
6
6
|
class css {
|
|
7
7
|
static create(object) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0-beta.1",
|
|
4
4
|
"description": "Near Zero-runtime CSS-in-JS for efficient design systems.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
@@ -16,16 +16,6 @@
|
|
|
16
16
|
"exports": {
|
|
17
17
|
"./package.json": "./package.json",
|
|
18
18
|
"./stylesheet": "./stylesheet/core.css",
|
|
19
|
-
"./dist/method/create-build-helper": {
|
|
20
|
-
"types": "./types/method/create-build-helper.d.ts",
|
|
21
|
-
"import": "./dist/esm/method/create-build-helper.js",
|
|
22
|
-
"default": "./dist/cjs/method/create-build-helper.js"
|
|
23
|
-
},
|
|
24
|
-
"./dist/method/global-build-helper": {
|
|
25
|
-
"types": "./types/method/global-build-helper.d.ts",
|
|
26
|
-
"import": "./dist/esm/method/global-build-helper.js",
|
|
27
|
-
"default": "./dist/cjs/method/global-build-helper.js"
|
|
28
|
-
},
|
|
29
19
|
".": {
|
|
30
20
|
"types": "./types/index.d.ts",
|
|
31
21
|
"import": "./dist/esm/index.js",
|
|
@@ -40,19 +30,18 @@
|
|
|
40
30
|
"types/",
|
|
41
31
|
"stylesheet/"
|
|
42
32
|
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "rimraf dist types && pnpm esm && pnpm cjs",
|
|
35
|
+
"cjs": "tsc --project tsconfig.cjs.json",
|
|
36
|
+
"esm": "tsc --project tsconfig.esm.json"
|
|
37
|
+
},
|
|
43
38
|
"dependencies": {
|
|
44
|
-
"zss-utils": "0.0.
|
|
45
|
-
"zss-engine": "0.2.26"
|
|
39
|
+
"zss-utils": "0.0.8"
|
|
46
40
|
},
|
|
47
41
|
"peerDependencies": {
|
|
48
42
|
"@plumeria/compiler": ">=0.7.7"
|
|
49
43
|
},
|
|
50
44
|
"publishConfig": {
|
|
51
45
|
"access": "public"
|
|
52
|
-
},
|
|
53
|
-
"scripts": {
|
|
54
|
-
"build": "rimraf dist types && pnpm esm && pnpm cjs",
|
|
55
|
-
"cjs": "tsc --project tsconfig.cjs.json",
|
|
56
|
-
"esm": "tsc --project tsconfig.esm.json && node __direname"
|
|
57
46
|
}
|
|
58
|
-
}
|
|
47
|
+
}
|
package/types/css.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CreateStyle, CustomHTMLType, CustomProperties, KeyframesDefinition, ReturnType, VarsDefinition } from 'zss-
|
|
1
|
+
import type { CreateStyle, CustomHTMLType, CustomProperties, KeyframesDefinition, ReturnType, VarsDefinition } from 'zss-utils';
|
|
2
2
|
import { cx, rx } from 'zss-utils';
|
|
3
3
|
declare class css {
|
|
4
4
|
static create<T extends Record<string, CustomProperties>>(object: CreateStyle<T>): ReturnType<T>;
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) zss-in-js contributer
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.globalPromise = exports.resolvePromise = void 0;
|
|
4
|
-
exports.buildCreate = buildCreate;
|
|
5
|
-
exports.initPromise = initPromise;
|
|
6
|
-
const zss_engine_1 = require("zss-engine");
|
|
7
|
-
let resolvePromise;
|
|
8
|
-
let globalPromise;
|
|
9
|
-
const sheetQueue = [];
|
|
10
|
-
let isProcessing = false;
|
|
11
|
-
function initPromise() {
|
|
12
|
-
exports.globalPromise = globalPromise = new Promise((resolve) => {
|
|
13
|
-
exports.resolvePromise = resolvePromise = (value) => {
|
|
14
|
-
sheetQueue.push(value);
|
|
15
|
-
resolve(value);
|
|
16
|
-
};
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
async function processQueue() {
|
|
20
|
-
const path = await import('path');
|
|
21
|
-
const filePath = path.join(__dirname, '../../../stylesheet/core.css');
|
|
22
|
-
while (sheetQueue.length > 0) {
|
|
23
|
-
const styleSheet = sheetQueue.shift();
|
|
24
|
-
if (!zss_engine_1.isDevelopment && styleSheet)
|
|
25
|
-
(0, zss_engine_1.build)(styleSheet, filePath);
|
|
26
|
-
}
|
|
27
|
-
isProcessing = false;
|
|
28
|
-
}
|
|
29
|
-
async function buildCreate() {
|
|
30
|
-
if (typeof globalPromise === 'undefined')
|
|
31
|
-
initPromise();
|
|
32
|
-
if (!isProcessing && sheetQueue.length > 0) {
|
|
33
|
-
isProcessing = true;
|
|
34
|
-
processQueue();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.create = create;
|
|
4
|
-
const zss_engine_1 = require("zss-engine");
|
|
5
|
-
const create_build_helper_js_1 = require("./create-build-helper.js");
|
|
6
|
-
function create(object) {
|
|
7
|
-
const base36Hash = (0, zss_engine_1.genBase36Hash)(object, 6);
|
|
8
|
-
const { styleSheet } = (0, zss_engine_1.transpiler)(object, base36Hash);
|
|
9
|
-
const injectCSS = zss_engine_1.isServer ? zss_engine_1.injectServerCSS : zss_engine_1.injectClientCSS;
|
|
10
|
-
if (typeof create_build_helper_js_1.globalPromise === 'undefined')
|
|
11
|
-
(0, create_build_helper_js_1.initPromise)();
|
|
12
|
-
(0, create_build_helper_js_1.resolvePromise)(styleSheet);
|
|
13
|
-
Object.keys(object).forEach((key) => {
|
|
14
|
-
Object.defineProperty(object, key, {
|
|
15
|
-
get: () => {
|
|
16
|
-
const className = key + '_' + base36Hash;
|
|
17
|
-
if (zss_engine_1.isDevAndTest)
|
|
18
|
-
injectCSS(base36Hash, styleSheet);
|
|
19
|
-
return className;
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
return Object.freeze(object);
|
|
24
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defineThemeVars = void 0;
|
|
4
|
-
const global_js_1 = require("./global.js");
|
|
5
|
-
const defineThemeVars = (object) => {
|
|
6
|
-
const globalStyles = {};
|
|
7
|
-
const result = {};
|
|
8
|
-
Object.entries(object).forEach(([key, value]) => {
|
|
9
|
-
result[key] = `var(--${key})`;
|
|
10
|
-
if (typeof value === 'string') {
|
|
11
|
-
(globalStyles[':root'] ||= {})[`--${key}`] = value;
|
|
12
|
-
}
|
|
13
|
-
else if (typeof value === 'object') {
|
|
14
|
-
Object.entries(value).forEach(([subKey, subValue]) => {
|
|
15
|
-
if (subKey.startsWith('@media')) {
|
|
16
|
-
(globalStyles[':root'] ||= {})[subKey] ||= {};
|
|
17
|
-
globalStyles[':root'][subKey][`--${key}`] = subValue;
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
const themeSelector = subKey === 'default' ? ':root' : `:root[data-theme="${subKey}"]`;
|
|
21
|
-
(globalStyles[themeSelector] ||= {})[`--${key}`] = subValue;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
(0, global_js_1.global)(globalStyles);
|
|
27
|
-
return result;
|
|
28
|
-
};
|
|
29
|
-
exports.defineThemeVars = defineThemeVars;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.globalPromise = exports.resolvePromise = void 0;
|
|
4
|
-
exports.buildGlobal = buildGlobal;
|
|
5
|
-
exports.initPromise = initPromise;
|
|
6
|
-
const zss_engine_1 = require("zss-engine");
|
|
7
|
-
let resolvePromise;
|
|
8
|
-
let globalPromise;
|
|
9
|
-
const seetQueue = [];
|
|
10
|
-
let isProcessing = false;
|
|
11
|
-
function initPromise() {
|
|
12
|
-
exports.globalPromise = globalPromise = new Promise((resolve) => {
|
|
13
|
-
exports.resolvePromise = resolvePromise = (value) => {
|
|
14
|
-
seetQueue.push(value);
|
|
15
|
-
resolve(value);
|
|
16
|
-
};
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
async function processSheets() {
|
|
20
|
-
const path = await import('path');
|
|
21
|
-
const filePath = path.join(__dirname, '../../../stylesheet/core.css');
|
|
22
|
-
while (seetQueue.length > 0) {
|
|
23
|
-
const [styleSheet, option] = seetQueue.shift();
|
|
24
|
-
if (!zss_engine_1.isDevelopment && styleSheet)
|
|
25
|
-
(0, zss_engine_1.build)(styleSheet, filePath, option);
|
|
26
|
-
}
|
|
27
|
-
isProcessing = false;
|
|
28
|
-
}
|
|
29
|
-
async function buildGlobal() {
|
|
30
|
-
if (typeof globalPromise === 'undefined')
|
|
31
|
-
initPromise();
|
|
32
|
-
if (!isProcessing && seetQueue.length > 0) {
|
|
33
|
-
isProcessing = true;
|
|
34
|
-
processSheets();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.global = global;
|
|
4
|
-
const zss_engine_1 = require("zss-engine");
|
|
5
|
-
const global_build_helper_js_1 = require("./global-build-helper.js");
|
|
6
|
-
function global(object) {
|
|
7
|
-
const base36Hash = (0, zss_engine_1.genBase36Hash)(object, 8);
|
|
8
|
-
const { styleSheet } = (0, zss_engine_1.transpiler)(object, undefined, '--global');
|
|
9
|
-
if (typeof global_build_helper_js_1.globalPromise === 'undefined')
|
|
10
|
-
(0, global_build_helper_js_1.initPromise)();
|
|
11
|
-
(0, global_build_helper_js_1.resolvePromise)([styleSheet, '--global']);
|
|
12
|
-
if (zss_engine_1.isDevAndTest)
|
|
13
|
-
zss_engine_1.isServer
|
|
14
|
-
? (0, zss_engine_1.injectServerCSS)(base36Hash, styleSheet)
|
|
15
|
-
: (0, zss_engine_1.injectClientGlobalCSS)(styleSheet, 'global');
|
|
16
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.keyframes = void 0;
|
|
4
|
-
const zss_engine_1 = require("zss-engine");
|
|
5
|
-
const global_js_1 = require("./global.js");
|
|
6
|
-
const keyframes = (object) => {
|
|
7
|
-
const prefix = (0, zss_engine_1.genBase36Hash)(object, 8);
|
|
8
|
-
(0, global_js_1.global)({ [`@keyframes ${prefix}`]: object });
|
|
9
|
-
return prefix;
|
|
10
|
-
};
|
|
11
|
-
exports.keyframes = keyframes;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { build, isDevelopment } from 'zss-engine';
|
|
2
|
-
let resolvePromise;
|
|
3
|
-
let globalPromise;
|
|
4
|
-
const sheetQueue = [];
|
|
5
|
-
let isProcessing = false;
|
|
6
|
-
function initPromise() {
|
|
7
|
-
globalPromise = new Promise((resolve) => {
|
|
8
|
-
resolvePromise = (value) => {
|
|
9
|
-
sheetQueue.push(value);
|
|
10
|
-
resolve(value);
|
|
11
|
-
};
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
async function processQueue() {
|
|
15
|
-
const path = await import('path');
|
|
16
|
-
const __dirname = import.meta.dirname;
|
|
17
|
-
const filePath = path.join(__dirname, '../../../stylesheet/core.css');
|
|
18
|
-
while (sheetQueue.length > 0) {
|
|
19
|
-
const styleSheet = sheetQueue.shift();
|
|
20
|
-
if (!isDevelopment && styleSheet)
|
|
21
|
-
build(styleSheet, filePath);
|
|
22
|
-
}
|
|
23
|
-
isProcessing = false;
|
|
24
|
-
}
|
|
25
|
-
export async function buildCreate() {
|
|
26
|
-
if (typeof globalPromise === 'undefined')
|
|
27
|
-
initPromise();
|
|
28
|
-
if (!isProcessing && sheetQueue.length > 0) {
|
|
29
|
-
isProcessing = true;
|
|
30
|
-
processQueue();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
export { resolvePromise, globalPromise, initPromise };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { isDevAndTest, transpiler, injectServerCSS, genBase36Hash, isServer, injectClientCSS, } from 'zss-engine';
|
|
2
|
-
import { initPromise, globalPromise, resolvePromise, } from './create-build-helper.js';
|
|
3
|
-
export function create(object) {
|
|
4
|
-
const base36Hash = genBase36Hash(object, 6);
|
|
5
|
-
const { styleSheet } = transpiler(object, base36Hash);
|
|
6
|
-
const injectCSS = isServer ? injectServerCSS : injectClientCSS;
|
|
7
|
-
if (typeof globalPromise === 'undefined')
|
|
8
|
-
initPromise();
|
|
9
|
-
resolvePromise(styleSheet);
|
|
10
|
-
Object.keys(object).forEach((key) => {
|
|
11
|
-
Object.defineProperty(object, key, {
|
|
12
|
-
get: () => {
|
|
13
|
-
const className = key + '_' + base36Hash;
|
|
14
|
-
if (isDevAndTest)
|
|
15
|
-
injectCSS(base36Hash, styleSheet);
|
|
16
|
-
return className;
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
return Object.freeze(object);
|
|
21
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { global } from './global.js';
|
|
2
|
-
export const defineThemeVars = (object) => {
|
|
3
|
-
const globalStyles = {};
|
|
4
|
-
const result = {};
|
|
5
|
-
Object.entries(object).forEach(([key, value]) => {
|
|
6
|
-
result[key] = `var(--${key})`;
|
|
7
|
-
if (typeof value === 'string') {
|
|
8
|
-
(globalStyles[':root'] ||= {})[`--${key}`] = value;
|
|
9
|
-
}
|
|
10
|
-
else if (typeof value === 'object') {
|
|
11
|
-
Object.entries(value).forEach(([subKey, subValue]) => {
|
|
12
|
-
if (subKey.startsWith('@media')) {
|
|
13
|
-
(globalStyles[':root'] ||= {})[subKey] ||= {};
|
|
14
|
-
globalStyles[':root'][subKey][`--${key}`] = subValue;
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
const themeSelector = subKey === 'default' ? ':root' : `:root[data-theme="${subKey}"]`;
|
|
18
|
-
(globalStyles[themeSelector] ||= {})[`--${key}`] = subValue;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
global(globalStyles);
|
|
24
|
-
return result;
|
|
25
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { build, isDevelopment } from 'zss-engine';
|
|
2
|
-
let resolvePromise;
|
|
3
|
-
let globalPromise;
|
|
4
|
-
const seetQueue = [];
|
|
5
|
-
let isProcessing = false;
|
|
6
|
-
function initPromise() {
|
|
7
|
-
globalPromise = new Promise((resolve) => {
|
|
8
|
-
resolvePromise = (value) => {
|
|
9
|
-
seetQueue.push(value);
|
|
10
|
-
resolve(value);
|
|
11
|
-
};
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
async function processSheets() {
|
|
15
|
-
const path = await import('path');
|
|
16
|
-
const __dirname = import.meta.dirname;
|
|
17
|
-
const filePath = path.join(__dirname, '../../../stylesheet/core.css');
|
|
18
|
-
while (seetQueue.length > 0) {
|
|
19
|
-
const [styleSheet, option] = seetQueue.shift();
|
|
20
|
-
if (!isDevelopment && styleSheet)
|
|
21
|
-
build(styleSheet, filePath, option);
|
|
22
|
-
}
|
|
23
|
-
isProcessing = false;
|
|
24
|
-
}
|
|
25
|
-
export async function buildGlobal() {
|
|
26
|
-
if (typeof globalPromise === 'undefined')
|
|
27
|
-
initPromise();
|
|
28
|
-
if (!isProcessing && seetQueue.length > 0) {
|
|
29
|
-
isProcessing = true;
|
|
30
|
-
processSheets();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
export { resolvePromise, globalPromise, initPromise };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { isDevAndTest, isServer, injectServerCSS, injectClientGlobalCSS, transpiler, genBase36Hash, } from 'zss-engine';
|
|
2
|
-
import { resolvePromise, globalPromise, initPromise, } from './global-build-helper.js';
|
|
3
|
-
export function global(object) {
|
|
4
|
-
const base36Hash = genBase36Hash(object, 8);
|
|
5
|
-
const { styleSheet } = transpiler(object, undefined, '--global');
|
|
6
|
-
if (typeof globalPromise === 'undefined')
|
|
7
|
-
initPromise();
|
|
8
|
-
resolvePromise([styleSheet, '--global']);
|
|
9
|
-
if (isDevAndTest)
|
|
10
|
-
isServer
|
|
11
|
-
? injectServerCSS(base36Hash, styleSheet)
|
|
12
|
-
: injectClientGlobalCSS(styleSheet, 'global');
|
|
13
|
-
}
|
package/types/method/create.d.ts
DELETED
package/types/method/global.d.ts
DELETED