@plumeria/core 0.11.2 → 0.11.4
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 +1 -4
- package/dist/css.mjs +0 -2
- package/dist/index.d.ts +1 -4
- package/dist/index.js +12 -38
- package/dist/index.mjs +12 -38
- 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/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,7 +1,6 @@
|
|
|
1
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
|
-
//#region src/main/utilities.d.ts
|
|
5
4
|
declare const px: <T extends readonly string[]>(...pseudos: T) => Join<T>;
|
|
6
5
|
declare const rx: (cssProperties: Readonly<CSSProperties$1>, varSet: RxVariableSet) => {
|
|
7
6
|
className: string;
|
|
@@ -10,8 +9,6 @@ declare const rx: (cssProperties: Readonly<CSSProperties$1>, varSet: RxVariableS
|
|
|
10
9
|
};
|
|
11
10
|
};
|
|
12
11
|
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/css.d.ts
|
|
15
12
|
declare class css {
|
|
16
13
|
private constructor();
|
|
17
14
|
static create<const T extends Record<string, CSSProperties>>(object: CreateStyleType<T>): ReturnType<T>;
|
|
@@ -197,5 +194,5 @@ declare class css {
|
|
|
197
194
|
yellow: "yellow";
|
|
198
195
|
yellowgreen: "yellowgreen";
|
|
199
196
|
};
|
|
200
|
-
}
|
|
197
|
+
}
|
|
201
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/main/create.ts
|
|
7
6
|
const objectToKeyHashMap = new WeakMap();
|
|
8
7
|
function create(object) {
|
|
9
8
|
const base36Hash = (0, zss_engine.genBase36Hash)(object, 6);
|
|
@@ -22,10 +21,7 @@ function create(object) {
|
|
|
22
21
|
});
|
|
23
22
|
return Object.freeze(object);
|
|
24
23
|
}
|
|
25
|
-
var create_default = create;
|
|
26
24
|
|
|
27
|
-
//#endregion
|
|
28
|
-
//#region src/main/global.ts
|
|
29
25
|
function global(object) {
|
|
30
26
|
const base36Hash = (0, zss_engine.genBase36Hash)(object, 8);
|
|
31
27
|
const { styleSheet } = (0, zss_engine.transpiler)(object, void 0, "--global");
|
|
@@ -33,10 +29,7 @@ function global(object) {
|
|
|
33
29
|
require_css.resolvePromise_2(styleSheet);
|
|
34
30
|
if (zss_engine.isTestingDevelopment) zss_engine.isServer ? (0, zss_engine.injectServerCSS)(base36Hash, styleSheet) : (0, zss_engine.injectClientGlobalCSS)(styleSheet);
|
|
35
31
|
}
|
|
36
|
-
var global_default = global;
|
|
37
32
|
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/main/props.ts
|
|
40
33
|
const props = (...objects) => {
|
|
41
34
|
const classNames = objects.filter(Boolean).map((obj) => {
|
|
42
35
|
if (obj && typeof obj === "object") {
|
|
@@ -47,29 +40,21 @@ const props = (...objects) => {
|
|
|
47
40
|
});
|
|
48
41
|
return [...new Set(classNames)].join(" ");
|
|
49
42
|
};
|
|
50
|
-
var props_default = props;
|
|
51
43
|
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region src/main/utilities.ts
|
|
54
44
|
const px = (...pseudos) => {
|
|
55
45
|
return pseudos.filter(Boolean).join("");
|
|
56
46
|
};
|
|
57
47
|
const rx = (cssProperties, varSet) => ({
|
|
58
|
-
className:
|
|
48
|
+
className: props(cssProperties),
|
|
59
49
|
style: Object.fromEntries(Object.entries(varSet).map(([key, value]) => [key, value]))
|
|
60
50
|
});
|
|
61
51
|
|
|
62
|
-
//#endregion
|
|
63
|
-
//#region src/define/keyframes.ts
|
|
64
52
|
const keyframes = (object) => {
|
|
65
53
|
const prefix = (0, zss_engine.genBase36Hash)(object, 8);
|
|
66
|
-
|
|
54
|
+
global({ [`@keyframes ${prefix}`]: object });
|
|
67
55
|
return prefix;
|
|
68
56
|
};
|
|
69
|
-
var keyframes_default = keyframes;
|
|
70
57
|
|
|
71
|
-
//#endregion
|
|
72
|
-
//#region src/define/vars.ts
|
|
73
58
|
const defineVars = (object) => {
|
|
74
59
|
const styles = { ":root": {} };
|
|
75
60
|
const result = {};
|
|
@@ -78,13 +63,10 @@ const defineVars = (object) => {
|
|
|
78
63
|
result[key] = `var(--${kebabKey})`;
|
|
79
64
|
styles[":root"][`--${key}`] = value;
|
|
80
65
|
});
|
|
81
|
-
|
|
66
|
+
global(styles);
|
|
82
67
|
return result;
|
|
83
68
|
};
|
|
84
|
-
var vars_default = defineVars;
|
|
85
69
|
|
|
86
|
-
//#endregion
|
|
87
|
-
//#region src/define/theme.ts
|
|
88
70
|
const defineTheme = (object) => {
|
|
89
71
|
const styles = {};
|
|
90
72
|
const result = {};
|
|
@@ -103,42 +85,36 @@ const defineTheme = (object) => {
|
|
|
103
85
|
}
|
|
104
86
|
});
|
|
105
87
|
});
|
|
106
|
-
|
|
88
|
+
global(styles);
|
|
107
89
|
return result;
|
|
108
90
|
};
|
|
109
|
-
var theme_default = defineTheme;
|
|
110
91
|
|
|
111
|
-
//#endregion
|
|
112
|
-
//#region src/define/consts.ts
|
|
113
92
|
const defineConsts = (constants) => {
|
|
114
93
|
return constants;
|
|
115
94
|
};
|
|
116
|
-
var consts_default = defineConsts;
|
|
117
95
|
|
|
118
|
-
//#endregion
|
|
119
|
-
//#region src/css.ts
|
|
120
96
|
var css = class {
|
|
121
97
|
constructor() {}
|
|
122
98
|
static create(object) {
|
|
123
|
-
return
|
|
99
|
+
return create(object);
|
|
124
100
|
}
|
|
125
101
|
static global(object) {
|
|
126
|
-
return
|
|
102
|
+
return global(object);
|
|
127
103
|
}
|
|
128
104
|
static keyframes(object) {
|
|
129
|
-
return
|
|
105
|
+
return keyframes(object);
|
|
130
106
|
}
|
|
131
107
|
static defineConsts(object) {
|
|
132
|
-
return
|
|
108
|
+
return defineConsts(object);
|
|
133
109
|
}
|
|
134
110
|
static defineVars(object) {
|
|
135
|
-
return
|
|
111
|
+
return defineVars(object);
|
|
136
112
|
}
|
|
137
113
|
static defineTheme(object) {
|
|
138
|
-
return
|
|
114
|
+
return defineTheme(object);
|
|
139
115
|
}
|
|
140
116
|
static props(...objects) {
|
|
141
|
-
return
|
|
117
|
+
return props(...objects);
|
|
142
118
|
}
|
|
143
119
|
static rx(cssProperties, varSet) {
|
|
144
120
|
return rx(cssProperties, varSet);
|
|
@@ -150,10 +126,8 @@ var css = class {
|
|
|
150
126
|
static container = zss_utils.container;
|
|
151
127
|
static color = zss_utils.color;
|
|
152
128
|
};
|
|
153
|
-
var css_default = css;
|
|
154
129
|
|
|
155
|
-
|
|
156
|
-
exports.css = css_default;
|
|
130
|
+
exports.css = css;
|
|
157
131
|
exports.ps = zss_utils.ps;
|
|
158
132
|
exports.px = px;
|
|
159
133
|
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/main/create.ts
|
|
6
5
|
const objectToKeyHashMap = new WeakMap();
|
|
7
6
|
function create(object) {
|
|
8
7
|
const base36Hash = genBase36Hash(object, 6);
|
|
@@ -21,10 +20,7 @@ function create(object) {
|
|
|
21
20
|
});
|
|
22
21
|
return Object.freeze(object);
|
|
23
22
|
}
|
|
24
|
-
var create_default = create;
|
|
25
23
|
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region src/main/global.ts
|
|
28
24
|
function global(object) {
|
|
29
25
|
const base36Hash = genBase36Hash(object, 8);
|
|
30
26
|
const { styleSheet } = transpiler(object, void 0, "--global");
|
|
@@ -32,10 +28,7 @@ function global(object) {
|
|
|
32
28
|
resolvePromise_2(styleSheet);
|
|
33
29
|
if (isTestingDevelopment) isServer ? injectServerCSS(base36Hash, styleSheet) : injectClientGlobalCSS(styleSheet);
|
|
34
30
|
}
|
|
35
|
-
var global_default = global;
|
|
36
31
|
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region src/main/props.ts
|
|
39
32
|
const props = (...objects) => {
|
|
40
33
|
const classNames = objects.filter(Boolean).map((obj) => {
|
|
41
34
|
if (obj && typeof obj === "object") {
|
|
@@ -46,29 +39,21 @@ const props = (...objects) => {
|
|
|
46
39
|
});
|
|
47
40
|
return [...new Set(classNames)].join(" ");
|
|
48
41
|
};
|
|
49
|
-
var props_default = props;
|
|
50
42
|
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region src/main/utilities.ts
|
|
53
43
|
const px = (...pseudos) => {
|
|
54
44
|
return pseudos.filter(Boolean).join("");
|
|
55
45
|
};
|
|
56
46
|
const rx = (cssProperties, varSet) => ({
|
|
57
|
-
className:
|
|
47
|
+
className: props(cssProperties),
|
|
58
48
|
style: Object.fromEntries(Object.entries(varSet).map(([key, value]) => [key, value]))
|
|
59
49
|
});
|
|
60
50
|
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region src/define/keyframes.ts
|
|
63
51
|
const keyframes = (object) => {
|
|
64
52
|
const prefix = genBase36Hash(object, 8);
|
|
65
|
-
|
|
53
|
+
global({ [`@keyframes ${prefix}`]: object });
|
|
66
54
|
return prefix;
|
|
67
55
|
};
|
|
68
|
-
var keyframes_default = keyframes;
|
|
69
56
|
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region src/define/vars.ts
|
|
72
57
|
const defineVars = (object) => {
|
|
73
58
|
const styles = { ":root": {} };
|
|
74
59
|
const result = {};
|
|
@@ -77,13 +62,10 @@ const defineVars = (object) => {
|
|
|
77
62
|
result[key] = `var(--${kebabKey})`;
|
|
78
63
|
styles[":root"][`--${key}`] = value;
|
|
79
64
|
});
|
|
80
|
-
|
|
65
|
+
global(styles);
|
|
81
66
|
return result;
|
|
82
67
|
};
|
|
83
|
-
var vars_default = defineVars;
|
|
84
68
|
|
|
85
|
-
//#endregion
|
|
86
|
-
//#region src/define/theme.ts
|
|
87
69
|
const defineTheme = (object) => {
|
|
88
70
|
const styles = {};
|
|
89
71
|
const result = {};
|
|
@@ -102,42 +84,36 @@ const defineTheme = (object) => {
|
|
|
102
84
|
}
|
|
103
85
|
});
|
|
104
86
|
});
|
|
105
|
-
|
|
87
|
+
global(styles);
|
|
106
88
|
return result;
|
|
107
89
|
};
|
|
108
|
-
var theme_default = defineTheme;
|
|
109
90
|
|
|
110
|
-
//#endregion
|
|
111
|
-
//#region src/define/consts.ts
|
|
112
91
|
const defineConsts = (constants) => {
|
|
113
92
|
return constants;
|
|
114
93
|
};
|
|
115
|
-
var consts_default = defineConsts;
|
|
116
94
|
|
|
117
|
-
//#endregion
|
|
118
|
-
//#region src/css.ts
|
|
119
95
|
var css = class {
|
|
120
96
|
constructor() {}
|
|
121
97
|
static create(object) {
|
|
122
|
-
return
|
|
98
|
+
return create(object);
|
|
123
99
|
}
|
|
124
100
|
static global(object) {
|
|
125
|
-
return
|
|
101
|
+
return global(object);
|
|
126
102
|
}
|
|
127
103
|
static keyframes(object) {
|
|
128
|
-
return
|
|
104
|
+
return keyframes(object);
|
|
129
105
|
}
|
|
130
106
|
static defineConsts(object) {
|
|
131
|
-
return
|
|
107
|
+
return defineConsts(object);
|
|
132
108
|
}
|
|
133
109
|
static defineVars(object) {
|
|
134
|
-
return
|
|
110
|
+
return defineVars(object);
|
|
135
111
|
}
|
|
136
112
|
static defineTheme(object) {
|
|
137
|
-
return
|
|
113
|
+
return defineTheme(object);
|
|
138
114
|
}
|
|
139
115
|
static props(...objects) {
|
|
140
|
-
return
|
|
116
|
+
return props(...objects);
|
|
141
117
|
}
|
|
142
118
|
static rx(cssProperties, varSet) {
|
|
143
119
|
return rx(cssProperties, varSet);
|
|
@@ -149,7 +125,5 @@ var css = class {
|
|
|
149
125
|
static container = container;
|
|
150
126
|
static color = color;
|
|
151
127
|
};
|
|
152
|
-
var css_default = css;
|
|
153
128
|
|
|
154
|
-
|
|
155
|
-
export { css_default as css, ps, px, rx };
|
|
129
|
+
export { 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.4",
|
|
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
|
}
|