@plumeria/core 0.11.1 → 0.11.3
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/README.md +1 -1
- package/dist/css.js +1 -4
- package/dist/css.mjs +0 -2
- package/dist/index.d.ts +5 -5
- package/dist/index.js +41 -27
- package/dist/index.mjs +41 -27
- package/dist/processors/css.d.ts +1 -2
- package/dist/processors/css.js +0 -1
- package/dist/processors/css.mjs +0 -1
- package/package.json +2 -2
package/README.md
CHANGED
package/dist/css.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -21,10 +21,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
|
23
23
|
|
|
24
|
-
//#endregion
|
|
25
24
|
const zss_engine = __toESM(require("zss-engine"));
|
|
26
25
|
|
|
27
|
-
//#region src/processors/css.ts
|
|
28
26
|
let resolvePromise_1;
|
|
29
27
|
let globalPromise_1;
|
|
30
28
|
const sheetQueue_1 = [];
|
|
@@ -78,7 +76,6 @@ async function buildGlobal(filePath) {
|
|
|
78
76
|
}
|
|
79
77
|
}
|
|
80
78
|
|
|
81
|
-
//#endregion
|
|
82
79
|
Object.defineProperty(exports, '__toESM', {
|
|
83
80
|
enumerable: true,
|
|
84
81
|
get: function () {
|
package/dist/css.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { build, isDevelopment } from "zss-engine";
|
|
2
2
|
|
|
3
|
-
//#region src/processors/css.ts
|
|
4
3
|
let resolvePromise_1;
|
|
5
4
|
let globalPromise_1;
|
|
6
5
|
const sheetQueue_1 = [];
|
|
@@ -54,5 +53,4 @@ async function buildGlobal(filePath) {
|
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
//#endregion
|
|
58
56
|
export { buildCreate, buildGlobal, globalPromise_1, globalPromise_2, initPromise_1, initPromise_2, resolvePromise_1, resolvePromise_2 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { CSSHTML, CSSProperties, CreateKeyframes, CreateStyle, CreateStyleType, CreateTheme, CreateValues, Join, ReturnRx, ReturnType, ReturnVariableType, RxVariableSet } from "zss-engine";
|
|
1
|
+
import { CSSHTML, CSSProperties, CSSProperties as CSSProperties$1, CreateKeyframes, CreateStyle, CreateStyleType, CreateTheme, CreateValues, Join, ReturnRx, ReturnType, ReturnVariableType, RxVariableSet } from "zss-engine";
|
|
2
2
|
import { ps } from "zss-utils";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
declare const rx: (cssProperties: Readonly<CSSProperties>, varSet: RxVariableSet) => {
|
|
4
|
+
declare const px: <T extends readonly string[]>(...pseudos: T) => Join<T>;
|
|
5
|
+
declare const rx: (cssProperties: Readonly<CSSProperties$1>, varSet: RxVariableSet) => {
|
|
6
6
|
className: string;
|
|
7
7
|
style: {
|
|
8
8
|
[k: string]: string;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
declare class css {
|
|
13
13
|
private constructor();
|
|
14
14
|
static create<const T extends Record<string, CSSProperties>>(object: CreateStyleType<T>): ReturnType<T>;
|
|
@@ -194,5 +194,5 @@ declare class css {
|
|
|
194
194
|
yellow: "yellow";
|
|
195
195
|
yellowgreen: "yellowgreen";
|
|
196
196
|
};
|
|
197
|
-
}
|
|
197
|
+
}
|
|
198
198
|
export { CSSHTML, CSSProperties, CreateStyle, css, ps, px, rx };
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,6 @@ const require_css = require('./css.js');
|
|
|
3
3
|
const zss_engine = require_css.__toESM(require("zss-engine"));
|
|
4
4
|
const zss_utils = require_css.__toESM(require("zss-utils"));
|
|
5
5
|
|
|
6
|
-
//#region src/css.ts
|
|
7
6
|
const objectToKeyHashMap = new WeakMap();
|
|
8
7
|
function create(object) {
|
|
9
8
|
const base36Hash = (0, zss_engine.genBase36Hash)(object, 6);
|
|
@@ -22,6 +21,17 @@ function create(object) {
|
|
|
22
21
|
});
|
|
23
22
|
return Object.freeze(object);
|
|
24
23
|
}
|
|
24
|
+
var create_default = create;
|
|
25
|
+
|
|
26
|
+
function global(object) {
|
|
27
|
+
const base36Hash = (0, zss_engine.genBase36Hash)(object, 8);
|
|
28
|
+
const { styleSheet } = (0, zss_engine.transpiler)(object, void 0, "--global");
|
|
29
|
+
if (typeof require_css.globalPromise_2 === "undefined") require_css.initPromise_2();
|
|
30
|
+
require_css.resolvePromise_2(styleSheet);
|
|
31
|
+
if (zss_engine.isTestingDevelopment) zss_engine.isServer ? (0, zss_engine.injectServerCSS)(base36Hash, styleSheet) : (0, zss_engine.injectClientGlobalCSS)(styleSheet);
|
|
32
|
+
}
|
|
33
|
+
var global_default = global;
|
|
34
|
+
|
|
25
35
|
const props = (...objects) => {
|
|
26
36
|
const classNames = objects.filter(Boolean).map((obj) => {
|
|
27
37
|
if (obj && typeof obj === "object") {
|
|
@@ -32,28 +42,23 @@ const props = (...objects) => {
|
|
|
32
42
|
});
|
|
33
43
|
return [...new Set(classNames)].join(" ");
|
|
34
44
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
style: Object.fromEntries(Object.entries(varSet).map(([key, value]) => [key, value]))
|
|
38
|
-
});
|
|
45
|
+
var props_default = props;
|
|
46
|
+
|
|
39
47
|
const px = (...pseudos) => {
|
|
40
48
|
return pseudos.filter(Boolean).join("");
|
|
41
49
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (zss_engine.isTestingDevelopment) zss_engine.isServer ? (0, zss_engine.injectServerCSS)(base36Hash, styleSheet) : (0, zss_engine.injectClientGlobalCSS)(styleSheet);
|
|
48
|
-
}
|
|
50
|
+
const rx = (cssProperties, varSet) => ({
|
|
51
|
+
className: props_default(cssProperties),
|
|
52
|
+
style: Object.fromEntries(Object.entries(varSet).map(([key, value]) => [key, value]))
|
|
53
|
+
});
|
|
54
|
+
|
|
49
55
|
const keyframes = (object) => {
|
|
50
56
|
const prefix = (0, zss_engine.genBase36Hash)(object, 8);
|
|
51
|
-
|
|
57
|
+
global_default({ [`@keyframes ${prefix}`]: object });
|
|
52
58
|
return prefix;
|
|
53
59
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
};
|
|
60
|
+
var keyframes_default = keyframes;
|
|
61
|
+
|
|
57
62
|
const defineVars = (object) => {
|
|
58
63
|
const styles = { ":root": {} };
|
|
59
64
|
const result = {};
|
|
@@ -62,9 +67,11 @@ const defineVars = (object) => {
|
|
|
62
67
|
result[key] = `var(--${kebabKey})`;
|
|
63
68
|
styles[":root"][`--${key}`] = value;
|
|
64
69
|
});
|
|
65
|
-
|
|
70
|
+
global_default(styles);
|
|
66
71
|
return result;
|
|
67
72
|
};
|
|
73
|
+
var vars_default = defineVars;
|
|
74
|
+
|
|
68
75
|
const defineTheme = (object) => {
|
|
69
76
|
const styles = {};
|
|
70
77
|
const result = {};
|
|
@@ -83,31 +90,38 @@ const defineTheme = (object) => {
|
|
|
83
90
|
}
|
|
84
91
|
});
|
|
85
92
|
});
|
|
86
|
-
|
|
93
|
+
global_default(styles);
|
|
87
94
|
return result;
|
|
88
95
|
};
|
|
96
|
+
var theme_default = defineTheme;
|
|
97
|
+
|
|
98
|
+
const defineConsts = (constants) => {
|
|
99
|
+
return constants;
|
|
100
|
+
};
|
|
101
|
+
var consts_default = defineConsts;
|
|
102
|
+
|
|
89
103
|
var css = class {
|
|
90
104
|
constructor() {}
|
|
91
105
|
static create(object) {
|
|
92
|
-
return
|
|
106
|
+
return create_default(object);
|
|
93
107
|
}
|
|
94
108
|
static global(object) {
|
|
95
|
-
return
|
|
109
|
+
return global_default(object);
|
|
96
110
|
}
|
|
97
111
|
static keyframes(object) {
|
|
98
|
-
return
|
|
112
|
+
return keyframes_default(object);
|
|
99
113
|
}
|
|
100
114
|
static defineConsts(object) {
|
|
101
|
-
return
|
|
115
|
+
return consts_default(object);
|
|
102
116
|
}
|
|
103
117
|
static defineVars(object) {
|
|
104
|
-
return
|
|
118
|
+
return vars_default(object);
|
|
105
119
|
}
|
|
106
120
|
static defineTheme(object) {
|
|
107
|
-
return
|
|
121
|
+
return theme_default(object);
|
|
108
122
|
}
|
|
109
123
|
static props(...objects) {
|
|
110
|
-
return
|
|
124
|
+
return props_default(...objects);
|
|
111
125
|
}
|
|
112
126
|
static rx(cssProperties, varSet) {
|
|
113
127
|
return rx(cssProperties, varSet);
|
|
@@ -119,9 +133,9 @@ var css = class {
|
|
|
119
133
|
static container = zss_utils.container;
|
|
120
134
|
static color = zss_utils.color;
|
|
121
135
|
};
|
|
136
|
+
var css_default = css;
|
|
122
137
|
|
|
123
|
-
|
|
124
|
-
exports.css = css;
|
|
138
|
+
exports.css = css_default;
|
|
125
139
|
exports.ps = zss_utils.ps;
|
|
126
140
|
exports.px = px;
|
|
127
141
|
exports.rx = rx;
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,6 @@ import { globalPromise_1, globalPromise_2, initPromise_1, initPromise_2, resolve
|
|
|
2
2
|
import { camelToKebabCase, genBase36Hash, injectClientCSS, injectClientGlobalCSS, injectServerCSS, isServer, isTestingDevelopment, transpiler } from "zss-engine";
|
|
3
3
|
import { color, container, media, ps } from "zss-utils";
|
|
4
4
|
|
|
5
|
-
//#region src/css.ts
|
|
6
5
|
const objectToKeyHashMap = new WeakMap();
|
|
7
6
|
function create(object) {
|
|
8
7
|
const base36Hash = genBase36Hash(object, 6);
|
|
@@ -21,6 +20,17 @@ function create(object) {
|
|
|
21
20
|
});
|
|
22
21
|
return Object.freeze(object);
|
|
23
22
|
}
|
|
23
|
+
var create_default = create;
|
|
24
|
+
|
|
25
|
+
function global(object) {
|
|
26
|
+
const base36Hash = genBase36Hash(object, 8);
|
|
27
|
+
const { styleSheet } = transpiler(object, void 0, "--global");
|
|
28
|
+
if (typeof globalPromise_2 === "undefined") initPromise_2();
|
|
29
|
+
resolvePromise_2(styleSheet);
|
|
30
|
+
if (isTestingDevelopment) isServer ? injectServerCSS(base36Hash, styleSheet) : injectClientGlobalCSS(styleSheet);
|
|
31
|
+
}
|
|
32
|
+
var global_default = global;
|
|
33
|
+
|
|
24
34
|
const props = (...objects) => {
|
|
25
35
|
const classNames = objects.filter(Boolean).map((obj) => {
|
|
26
36
|
if (obj && typeof obj === "object") {
|
|
@@ -31,28 +41,23 @@ const props = (...objects) => {
|
|
|
31
41
|
});
|
|
32
42
|
return [...new Set(classNames)].join(" ");
|
|
33
43
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
style: Object.fromEntries(Object.entries(varSet).map(([key, value]) => [key, value]))
|
|
37
|
-
});
|
|
44
|
+
var props_default = props;
|
|
45
|
+
|
|
38
46
|
const px = (...pseudos) => {
|
|
39
47
|
return pseudos.filter(Boolean).join("");
|
|
40
48
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (isTestingDevelopment) isServer ? injectServerCSS(base36Hash, styleSheet) : injectClientGlobalCSS(styleSheet);
|
|
47
|
-
}
|
|
49
|
+
const rx = (cssProperties, varSet) => ({
|
|
50
|
+
className: props_default(cssProperties),
|
|
51
|
+
style: Object.fromEntries(Object.entries(varSet).map(([key, value]) => [key, value]))
|
|
52
|
+
});
|
|
53
|
+
|
|
48
54
|
const keyframes = (object) => {
|
|
49
55
|
const prefix = genBase36Hash(object, 8);
|
|
50
|
-
|
|
56
|
+
global_default({ [`@keyframes ${prefix}`]: object });
|
|
51
57
|
return prefix;
|
|
52
58
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
};
|
|
59
|
+
var keyframes_default = keyframes;
|
|
60
|
+
|
|
56
61
|
const defineVars = (object) => {
|
|
57
62
|
const styles = { ":root": {} };
|
|
58
63
|
const result = {};
|
|
@@ -61,9 +66,11 @@ const defineVars = (object) => {
|
|
|
61
66
|
result[key] = `var(--${kebabKey})`;
|
|
62
67
|
styles[":root"][`--${key}`] = value;
|
|
63
68
|
});
|
|
64
|
-
|
|
69
|
+
global_default(styles);
|
|
65
70
|
return result;
|
|
66
71
|
};
|
|
72
|
+
var vars_default = defineVars;
|
|
73
|
+
|
|
67
74
|
const defineTheme = (object) => {
|
|
68
75
|
const styles = {};
|
|
69
76
|
const result = {};
|
|
@@ -82,31 +89,38 @@ const defineTheme = (object) => {
|
|
|
82
89
|
}
|
|
83
90
|
});
|
|
84
91
|
});
|
|
85
|
-
|
|
92
|
+
global_default(styles);
|
|
86
93
|
return result;
|
|
87
94
|
};
|
|
95
|
+
var theme_default = defineTheme;
|
|
96
|
+
|
|
97
|
+
const defineConsts = (constants) => {
|
|
98
|
+
return constants;
|
|
99
|
+
};
|
|
100
|
+
var consts_default = defineConsts;
|
|
101
|
+
|
|
88
102
|
var css = class {
|
|
89
103
|
constructor() {}
|
|
90
104
|
static create(object) {
|
|
91
|
-
return
|
|
105
|
+
return create_default(object);
|
|
92
106
|
}
|
|
93
107
|
static global(object) {
|
|
94
|
-
return
|
|
108
|
+
return global_default(object);
|
|
95
109
|
}
|
|
96
110
|
static keyframes(object) {
|
|
97
|
-
return
|
|
111
|
+
return keyframes_default(object);
|
|
98
112
|
}
|
|
99
113
|
static defineConsts(object) {
|
|
100
|
-
return
|
|
114
|
+
return consts_default(object);
|
|
101
115
|
}
|
|
102
116
|
static defineVars(object) {
|
|
103
|
-
return
|
|
117
|
+
return vars_default(object);
|
|
104
118
|
}
|
|
105
119
|
static defineTheme(object) {
|
|
106
|
-
return
|
|
120
|
+
return theme_default(object);
|
|
107
121
|
}
|
|
108
122
|
static props(...objects) {
|
|
109
|
-
return
|
|
123
|
+
return props_default(...objects);
|
|
110
124
|
}
|
|
111
125
|
static rx(cssProperties, varSet) {
|
|
112
126
|
return rx(cssProperties, varSet);
|
|
@@ -118,6 +132,6 @@ var css = class {
|
|
|
118
132
|
static container = container;
|
|
119
133
|
static color = color;
|
|
120
134
|
};
|
|
135
|
+
var css_default = css;
|
|
121
136
|
|
|
122
|
-
|
|
123
|
-
export { css, ps, px, rx };
|
|
137
|
+
export { css_default as css, ps, px, rx };
|
package/dist/processors/css.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
declare let resolvePromise_1: (value: string) => void;
|
|
3
3
|
declare let globalPromise_1: Promise<string>;
|
|
4
4
|
declare function initPromise_1(): void;
|
|
@@ -8,5 +8,4 @@ declare let globalPromise_2: Promise<string>;
|
|
|
8
8
|
declare function initPromise_2(): void;
|
|
9
9
|
declare function buildGlobal(filePath: string): Promise<void>;
|
|
10
10
|
|
|
11
|
-
//#endregion
|
|
12
11
|
export { buildCreate, buildGlobal, globalPromise_1, globalPromise_2, initPromise_1, initPromise_2, resolvePromise_1, resolvePromise_2 };
|
package/dist/processors/css.js
CHANGED
package/dist/processors/css.mjs
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { buildCreate, buildGlobal, globalPromise_1, globalPromise_2, initPromise_1, initPromise_2, resolvePromise_1, resolvePromise_2 } from "../css.mjs";
|
|
2
|
-
|
|
3
2
|
export { buildCreate, buildGlobal, globalPromise_1, globalPromise_2, initPromise_1, initPromise_2, resolvePromise_1, resolvePromise_2 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/core",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"description": "Zero-runtime, expressive CSS-in-JS library for TypeScript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
@@ -46,6 +46,6 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
|
-
"build": "tsdown"
|
|
49
|
+
"build": "tsdown && node strip-comments"
|
|
50
50
|
}
|
|
51
51
|
}
|