@plumeria/core 0.7.7 → 0.7.8
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 → cjs/css.js} +12 -12
- package/dist/{index.js → cjs/index.js} +4 -4
- package/dist/{method → cjs/method}/create-build-helper.js +5 -2
- package/dist/{method → cjs/method}/create.js +4 -5
- package/dist/{method → cjs/method}/define-theme-vars.js +2 -2
- package/dist/{method → cjs/method}/global-build-helper.js +6 -3
- package/dist/{method → cjs/method}/global.js +4 -5
- package/dist/{method → cjs/method}/keyframes.js +2 -2
- package/dist/{css.mjs → esm/css.js} +6 -6
- package/dist/esm/index.js +1 -0
- package/dist/{method/create-build-helper.mjs → esm/method/create-build-helper.js} +3 -2
- package/dist/{method/create.mjs → esm/method/create.js} +1 -2
- package/dist/{method/define-theme-vars.mjs → esm/method/define-theme-vars.js} +1 -1
- package/dist/{method/global-build-helper.mjs → esm/method/global-build-helper.js} +4 -3
- package/dist/{method/global.mjs → esm/method/global.js} +1 -2
- package/dist/{method/keyframes.mjs → esm/method/keyframes.js} +1 -1
- package/package.json +22 -15
- package/stylesheet/index.d.ts +2 -0
- package/stylesheet/index.js +1 -0
- package/stylesheet/index.mjs +1 -0
- package/types/css.d.ts +2 -2
- package/types/index.d.ts +1 -1
- package/types/method/create.d.ts +0 -1
- package/types/method/global.d.ts +0 -1
- package/dist/index.mjs +0 -1
- package/dist/styles/global.css +0 -0
- /package/dist/{cx.js → cjs/cx.js} +0 -0
- /package/dist/{rx.js → cjs/rx.js} +0 -0
- /package/dist/{cx.mjs → esm/cx.js} +0 -0
- /package/dist/{rx.mjs → esm/rx.js} +0 -0
- /package/{dist/styles/create.css → stylesheet/core.css} +0 -0
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.rx = exports.cx = exports.css = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
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
8
|
const collection_1 = require("@plumeria/collection");
|
|
9
|
-
const
|
|
10
|
-
Object.defineProperty(exports, "cx", { enumerable: true, get: function () { return
|
|
11
|
-
const
|
|
12
|
-
Object.defineProperty(exports, "rx", { enumerable: true, get: function () { return
|
|
9
|
+
const cx_js_1 = require("./cx.js");
|
|
10
|
+
Object.defineProperty(exports, "cx", { enumerable: true, get: function () { return cx_js_1.cx; } });
|
|
11
|
+
const rx_js_1 = require("./rx.js");
|
|
12
|
+
Object.defineProperty(exports, "rx", { enumerable: true, get: function () { return rx_js_1.rx; } });
|
|
13
13
|
class css {
|
|
14
14
|
static create(object) {
|
|
15
|
-
return (0,
|
|
15
|
+
return (0, create_js_1.create)(object);
|
|
16
16
|
}
|
|
17
17
|
static global(object) {
|
|
18
|
-
return (0,
|
|
18
|
+
return (0, global_js_1.global)(object);
|
|
19
19
|
}
|
|
20
20
|
static defineThemeVars(object) {
|
|
21
|
-
return (0,
|
|
21
|
+
return (0, define_theme_vars_js_1.defineThemeVars)(object);
|
|
22
22
|
}
|
|
23
23
|
static keyframes(object) {
|
|
24
|
-
return (0,
|
|
24
|
+
return (0, keyframes_js_1.keyframes)(object);
|
|
25
25
|
}
|
|
26
26
|
static media = collection_1.media;
|
|
27
27
|
static pseudo = collection_1.pseudo;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.rx = exports.cx = exports.css = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "css", { enumerable: true, get: function () { return
|
|
6
|
-
Object.defineProperty(exports, "cx", { enumerable: true, get: function () { return
|
|
7
|
-
Object.defineProperty(exports, "rx", { enumerable: true, get: function () { return
|
|
4
|
+
var css_js_1 = require("./css.js");
|
|
5
|
+
Object.defineProperty(exports, "css", { enumerable: true, get: function () { return css_js_1.css; } });
|
|
6
|
+
Object.defineProperty(exports, "cx", { enumerable: true, get: function () { return css_js_1.cx; } });
|
|
7
|
+
Object.defineProperty(exports, "rx", { enumerable: true, get: function () { return css_js_1.rx; } });
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.globalPromise = exports.resolvePromise = void 0;
|
|
4
7
|
exports.buildCreate = buildCreate;
|
|
5
8
|
exports.initPromise = initPromise;
|
|
6
9
|
const zss_engine_1 = require("zss-engine");
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
7
11
|
let resolvePromise;
|
|
8
12
|
let globalPromise;
|
|
9
13
|
const sheetQueue = [];
|
|
@@ -17,8 +21,7 @@ function initPromise() {
|
|
|
17
21
|
});
|
|
18
22
|
}
|
|
19
23
|
function processQueue() {
|
|
20
|
-
const
|
|
21
|
-
const filePath = path.join(__dirname, '../styles/create.css');
|
|
24
|
+
const filePath = path_1.default.join(__dirname, '../../../stylesheet/core.css');
|
|
22
25
|
while (sheetQueue.length > 0) {
|
|
23
26
|
const styleSheet = sheetQueue.shift();
|
|
24
27
|
if (!zss_engine_1.isDevelopment && styleSheet)
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.create = create;
|
|
4
|
-
require("../styles/create.css");
|
|
5
4
|
const zss_engine_1 = require("zss-engine");
|
|
6
|
-
const
|
|
5
|
+
const create_build_helper_js_1 = require("./create-build-helper.js");
|
|
7
6
|
function create(object) {
|
|
8
7
|
const base36Hash = (0, zss_engine_1.genBase36Hash)(object, 6);
|
|
9
8
|
const { styleSheet } = (0, zss_engine_1.transpiler)(object, base36Hash);
|
|
10
9
|
const injectCSS = zss_engine_1.isServer ? zss_engine_1.injectServerCSS : zss_engine_1.injectClientCSS;
|
|
11
|
-
if (typeof
|
|
12
|
-
(0,
|
|
13
|
-
(0,
|
|
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);
|
|
14
13
|
Object.keys(object).forEach((key) => {
|
|
15
14
|
Object.defineProperty(object, key, {
|
|
16
15
|
get: () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defineThemeVars = void 0;
|
|
4
|
-
const
|
|
4
|
+
const global_js_1 = require("./global.js");
|
|
5
5
|
const defineThemeVars = (object) => {
|
|
6
6
|
const globalStyles = {};
|
|
7
7
|
const result = {};
|
|
@@ -23,7 +23,7 @@ const defineThemeVars = (object) => {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
(0,
|
|
26
|
+
(0, global_js_1.global)(globalStyles);
|
|
27
27
|
return result;
|
|
28
28
|
};
|
|
29
29
|
exports.defineThemeVars = defineThemeVars;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.globalPromise = exports.resolvePromise = void 0;
|
|
4
7
|
exports.buildGlobal = buildGlobal;
|
|
5
8
|
exports.initPromise = initPromise;
|
|
6
9
|
const zss_engine_1 = require("zss-engine");
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
7
11
|
let resolvePromise;
|
|
8
12
|
let globalPromise;
|
|
9
13
|
const seetQueue = [];
|
|
@@ -16,9 +20,8 @@ function initPromise() {
|
|
|
16
20
|
};
|
|
17
21
|
});
|
|
18
22
|
}
|
|
19
|
-
function processSheets() {
|
|
20
|
-
const
|
|
21
|
-
const filePath = path.join(__dirname, '../styles/global.css');
|
|
23
|
+
async function processSheets() {
|
|
24
|
+
const filePath = path_1.default.join(__dirname, '../../../stylesheet/core.css');
|
|
22
25
|
while (seetQueue.length > 0) {
|
|
23
26
|
const [styleSheet, option] = seetQueue.shift();
|
|
24
27
|
if (!zss_engine_1.isDevelopment && styleSheet)
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.global = global;
|
|
4
|
-
require("../styles/global.css");
|
|
5
4
|
const zss_engine_1 = require("zss-engine");
|
|
6
|
-
const
|
|
5
|
+
const global_build_helper_js_1 = require("./global-build-helper.js");
|
|
7
6
|
function global(object) {
|
|
8
7
|
const base36Hash = (0, zss_engine_1.genBase36Hash)(object, 8);
|
|
9
8
|
const { styleSheet } = (0, zss_engine_1.transpiler)(object, undefined, '--global');
|
|
10
|
-
if (typeof
|
|
11
|
-
(0,
|
|
12
|
-
(0,
|
|
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']);
|
|
13
12
|
if (zss_engine_1.isDevAndTest)
|
|
14
13
|
zss_engine_1.isServer
|
|
15
14
|
? (0, zss_engine_1.injectServerCSS)(base36Hash, styleSheet)
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.keyframes = void 0;
|
|
4
4
|
const zss_engine_1 = require("zss-engine");
|
|
5
|
-
const
|
|
5
|
+
const global_js_1 = require("./global.js");
|
|
6
6
|
const keyframes = (object) => {
|
|
7
7
|
const prefix = (0, zss_engine_1.genBase36Hash)(object, 8);
|
|
8
|
-
(0,
|
|
8
|
+
(0, global_js_1.global)({ [`@keyframes ${prefix}`]: object });
|
|
9
9
|
return prefix;
|
|
10
10
|
};
|
|
11
11
|
exports.keyframes = keyframes;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { create } from './method/create';
|
|
2
|
-
import { global } from './method/global';
|
|
3
|
-
import { defineThemeVars } from './method/define-theme-vars';
|
|
4
|
-
import { keyframes } from './method/keyframes';
|
|
1
|
+
import { create } from './method/create.js';
|
|
2
|
+
import { global } from './method/global.js';
|
|
3
|
+
import { defineThemeVars } from './method/define-theme-vars.js';
|
|
4
|
+
import { keyframes } from './method/keyframes.js';
|
|
5
5
|
import { media, pseudo, colors, container } from '@plumeria/collection';
|
|
6
|
-
import { cx } from './cx';
|
|
7
|
-
import { rx } from './rx';
|
|
6
|
+
import { cx } from './cx.js';
|
|
7
|
+
import { rx } from './rx.js';
|
|
8
8
|
class css {
|
|
9
9
|
static create(object) {
|
|
10
10
|
return create(object);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { css, cx, rx } from './css.js';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { build, isDevelopment } from 'zss-engine';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
const __dirname = import.meta.dirname;
|
|
2
4
|
let resolvePromise;
|
|
3
5
|
let globalPromise;
|
|
4
6
|
const sheetQueue = [];
|
|
@@ -12,8 +14,7 @@ function initPromise() {
|
|
|
12
14
|
});
|
|
13
15
|
}
|
|
14
16
|
function processQueue() {
|
|
15
|
-
const
|
|
16
|
-
const filePath = path.join(__dirname, '../styles/create.css');
|
|
17
|
+
const filePath = path.join(__dirname, '../../../stylesheet/core.css');
|
|
17
18
|
while (sheetQueue.length > 0) {
|
|
18
19
|
const styleSheet = sheetQueue.shift();
|
|
19
20
|
if (!isDevelopment && styleSheet)
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import '../styles/create.css';
|
|
2
1
|
import { isDevAndTest, transpiler, injectServerCSS, genBase36Hash, isServer, injectClientCSS, } from 'zss-engine';
|
|
3
|
-
import { initPromise, globalPromise, resolvePromise, } from './create-build-helper';
|
|
2
|
+
import { initPromise, globalPromise, resolvePromise, } from './create-build-helper.js';
|
|
4
3
|
export function create(object) {
|
|
5
4
|
const base36Hash = genBase36Hash(object, 6);
|
|
6
5
|
const { styleSheet } = transpiler(object, base36Hash);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { build, isDevelopment } from 'zss-engine';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
const __dirname = import.meta.dirname;
|
|
2
4
|
let resolvePromise;
|
|
3
5
|
let globalPromise;
|
|
4
6
|
const seetQueue = [];
|
|
@@ -11,9 +13,8 @@ function initPromise() {
|
|
|
11
13
|
};
|
|
12
14
|
});
|
|
13
15
|
}
|
|
14
|
-
function processSheets() {
|
|
15
|
-
const
|
|
16
|
-
const filePath = path.join(__dirname, '../styles/global.css');
|
|
16
|
+
async function processSheets() {
|
|
17
|
+
const filePath = path.join(__dirname, '../../../stylesheet/core.css');
|
|
17
18
|
while (seetQueue.length > 0) {
|
|
18
19
|
const [styleSheet, option] = seetQueue.shift();
|
|
19
20
|
if (!isDevelopment && styleSheet)
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import '../styles/global.css';
|
|
2
1
|
import { isDevAndTest, isServer, injectServerCSS, injectClientGlobalCSS, transpiler, genBase36Hash, } from 'zss-engine';
|
|
3
|
-
import { resolvePromise, globalPromise, initPromise, } from './global-build-helper';
|
|
2
|
+
import { resolvePromise, globalPromise, initPromise, } from './global-build-helper.js';
|
|
4
3
|
export function global(object) {
|
|
5
4
|
const base36Hash = genBase36Hash(object, 8);
|
|
6
5
|
const { styleSheet } = transpiler(object, undefined, '--global');
|
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/core",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.8",
|
|
4
4
|
"description": "Near Zero-runtime CSS-in-JS for efficient design systems.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
7
|
+
"vite",
|
|
8
|
+
"next",
|
|
7
9
|
"css",
|
|
8
10
|
"css-in-js",
|
|
9
11
|
"plumeria",
|
|
@@ -15,40 +17,45 @@
|
|
|
15
17
|
"sideEffects": false,
|
|
16
18
|
"exports": {
|
|
17
19
|
"./package.json": "./package.json",
|
|
20
|
+
"./stylesheet": {
|
|
21
|
+
"types": "./stylesheet/index.d.ts",
|
|
22
|
+
"import": "./stylesheet/index.mjs",
|
|
23
|
+
"default": "./stylesheet/index.js"
|
|
24
|
+
},
|
|
18
25
|
"./dist/method/create-build-helper": {
|
|
19
26
|
"types": "./types/method/create-build-helper.d.ts",
|
|
20
|
-
"import": "./dist/method/create-build-helper.
|
|
21
|
-
"default": "./dist/method/create-build-helper.js"
|
|
27
|
+
"import": "./dist/esm/method/create-build-helper.js",
|
|
28
|
+
"default": "./dist/cjs/method/create-build-helper.js"
|
|
22
29
|
},
|
|
23
30
|
"./dist/method/global-build-helper": {
|
|
24
31
|
"types": "./types/method/global-build-helper.d.ts",
|
|
25
|
-
"import": "./dist/method/global-build-helper.
|
|
26
|
-
"default": "./dist/method/global-build-helper.js"
|
|
32
|
+
"import": "./dist/esm/method/global-build-helper.js",
|
|
33
|
+
"default": "./dist/cjs//method/global-build-helper.js"
|
|
27
34
|
},
|
|
28
35
|
".": {
|
|
29
36
|
"types": "./types/index.d.ts",
|
|
30
|
-
"import": "./dist/index.
|
|
31
|
-
"default": "./dist/index.js"
|
|
37
|
+
"import": "./dist/esm/index.js",
|
|
38
|
+
"default": "./dist/cjs/index.js"
|
|
32
39
|
}
|
|
33
40
|
},
|
|
34
|
-
"main": "dist/index.js",
|
|
35
|
-
"module": "dist/index.
|
|
41
|
+
"main": "dist/cjs/index.js",
|
|
42
|
+
"module": "dist/esm/index.js",
|
|
36
43
|
"types": "types/index.d.ts",
|
|
37
44
|
"files": [
|
|
38
45
|
"dist/",
|
|
39
|
-
"types/"
|
|
46
|
+
"types/",
|
|
47
|
+
"stylesheet/"
|
|
40
48
|
],
|
|
41
49
|
"dependencies": {
|
|
42
|
-
"zss-engine": "^0.2.
|
|
43
|
-
"@plumeria/collection": "^0.5.
|
|
50
|
+
"zss-engine": "^0.2.23",
|
|
51
|
+
"@plumeria/collection": "^0.5.2"
|
|
44
52
|
},
|
|
45
53
|
"publishConfig": {
|
|
46
54
|
"access": "public"
|
|
47
55
|
},
|
|
48
56
|
"scripts": {
|
|
49
|
-
"build": "rimraf dist types && pnpm esm && pnpm cjs
|
|
50
|
-
"css": "cpy 'src/styles/**' 'dist/styles'",
|
|
57
|
+
"build": "rimraf dist types && pnpm esm && pnpm cjs",
|
|
51
58
|
"cjs": "tsc --project tsconfig.cjs.json",
|
|
52
|
-
"esm": "tsc --project tsconfig.esm.json && node
|
|
59
|
+
"esm": "tsc --project tsconfig.esm.json && node __direname"
|
|
53
60
|
}
|
|
54
61
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('./core.css');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './core.css';
|
package/types/css.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CreateStyle, CustomHTMLType, CustomProperties, KeyframesDefinition, ReturnType, VarsDefinition } from 'zss-engine';
|
|
2
|
-
import { cx } from './cx';
|
|
3
|
-
import { rx } from './rx';
|
|
2
|
+
import { cx } from './cx.js';
|
|
3
|
+
import { rx } from './rx.js';
|
|
4
4
|
declare class css {
|
|
5
5
|
static create<T extends Record<string, CustomProperties>>(object: CreateStyle<T>): ReturnType<T>;
|
|
6
6
|
static global(object: CustomHTMLType): void;
|
package/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { css, cx, rx } from './css';
|
|
1
|
+
export { css, cx, rx } from './css.js';
|
package/types/method/create.d.ts
CHANGED
package/types/method/global.d.ts
CHANGED
package/dist/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { css, cx, rx } from './css';
|
package/dist/styles/global.css
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|