@plumeria/core 0.14.10 → 0.15.0
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/index.d.ts +2 -5
- package/dist/index.js +11 -43
- package/dist/index.mjs +13 -20
- package/package.json +2 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { CSSHTML, CSSProperties, CreateKeyframes, CreateStyle, CreateStyleType, CreateTheme, CreateValues,
|
|
2
|
-
import { color, container, media, ps } from "zss-utils";
|
|
1
|
+
import { CSSHTML, CSSProperties, CreateKeyframes, CreateStyle, CreateStyleType, CreateTheme, CreateValues, ReturnType, ReturnVariableType, RxVariableSet } from "zss-engine";
|
|
3
2
|
|
|
4
3
|
declare const rx: (className: string, varSet: RxVariableSet) => {
|
|
5
4
|
className: string;
|
|
@@ -8,8 +7,6 @@ declare const rx: (className: string, varSet: RxVariableSet) => {
|
|
|
8
7
|
};
|
|
9
8
|
};
|
|
10
9
|
|
|
11
|
-
declare const px: <T extends readonly string[]>(...pseudos: T) => Join<T>;
|
|
12
|
-
|
|
13
10
|
declare class StyleSheet {
|
|
14
11
|
private constructor();
|
|
15
12
|
static create<const T extends Record<string, CSSProperties>>(object: CreateStyleType<T>): ReturnType<T>;
|
|
@@ -22,4 +19,4 @@ declare class StyleSheet {
|
|
|
22
19
|
}
|
|
23
20
|
declare const css: typeof StyleSheet;
|
|
24
21
|
|
|
25
|
-
export { CSSHTML, CSSProperties, CreateStyle,
|
|
22
|
+
export { CSSHTML, CSSProperties, CreateStyle, css, rx };
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_css = require('./css.js');
|
|
3
|
-
const zss_utils = require_css.__toESM(require("zss-utils"));
|
|
4
3
|
const zss_engine = require_css.__toESM(require("zss-engine"));
|
|
5
4
|
|
|
6
|
-
const rx = (className, varSet) => ({
|
|
7
|
-
className,
|
|
8
|
-
style: Object.fromEntries(Object.entries(varSet).map(([key, value]) => [key, value]))
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
const px = (...pseudos) => {
|
|
12
|
-
return pseudos.filter(Boolean).join("");
|
|
13
|
-
};
|
|
14
|
-
|
|
15
5
|
const styleAtomMap = new WeakMap();
|
|
16
6
|
function create(object) {
|
|
17
7
|
const result = {};
|
|
@@ -61,7 +51,6 @@ function props(...objects) {
|
|
|
61
51
|
const seenSheets = new Set();
|
|
62
52
|
const allStyleSheets = [];
|
|
63
53
|
const classList = [];
|
|
64
|
-
const injectIfNeeded = zss_engine.isServer ? zss_engine.injectServerCSS : zss_engine.injectClientCSS;
|
|
65
54
|
const chosen = new Map();
|
|
66
55
|
const rightmostKeys = [];
|
|
67
56
|
const orderedKeys = [];
|
|
@@ -107,24 +96,23 @@ function props(...objects) {
|
|
|
107
96
|
uniqueStyleSheets.forEach((sheet) => injectedStyleSheets.add(sheet));
|
|
108
97
|
if (typeof require_css.globalPromise_1 === "undefined") require_css.initPromise_1();
|
|
109
98
|
require_css.resolvePromise_1(uniqueStyleSheets.join(""));
|
|
110
|
-
if (zss_engine.isTestingDevelopment) {
|
|
111
|
-
for (const { hash, sheet } of [...orderedKeys, ...rightmostKeys]) if (uniqueStyleSheets.includes(sheet))
|
|
99
|
+
if (zss_engine.isTestingDevelopment && !zss_engine.isServer) {
|
|
100
|
+
for (const { hash, sheet } of [...orderedKeys, ...rightmostKeys]) if (uniqueStyleSheets.includes(sheet)) (0, zss_engine.injectClientCSS)(hash, sheet);
|
|
112
101
|
}
|
|
113
102
|
return classList.join(" ");
|
|
114
103
|
}
|
|
115
104
|
|
|
116
105
|
function global(object) {
|
|
117
|
-
const base36Hash = (0, zss_engine.genBase36Hash)(object, 1, 8);
|
|
118
106
|
const { styleSheet } = (0, zss_engine.transpile)(object, void 0, "--global");
|
|
119
107
|
if (typeof require_css.globalPromise_2 === "undefined") require_css.initPromise_2();
|
|
120
108
|
require_css.resolvePromise_2(styleSheet);
|
|
121
|
-
if (zss_engine.isTestingDevelopment
|
|
109
|
+
if (zss_engine.isTestingDevelopment && !zss_engine.isServer) (0, zss_engine.injectClientGlobalCSS)(styleSheet);
|
|
122
110
|
}
|
|
123
111
|
|
|
124
112
|
const keyframes = (object) => {
|
|
125
|
-
const
|
|
126
|
-
global({ [`@keyframes ${
|
|
127
|
-
return
|
|
113
|
+
const hash = (0, zss_engine.genBase36Hash)(object, 1, 8);
|
|
114
|
+
global({ [`@keyframes ${hash}`]: object });
|
|
115
|
+
return hash;
|
|
128
116
|
};
|
|
129
117
|
|
|
130
118
|
const defineVars = (object) => {
|
|
@@ -165,6 +153,11 @@ const defineConsts = (constants) => {
|
|
|
165
153
|
return constants;
|
|
166
154
|
};
|
|
167
155
|
|
|
156
|
+
const rx = (className, varSet) => ({
|
|
157
|
+
className,
|
|
158
|
+
style: Object.fromEntries(Object.entries(varSet).map(([key, value]) => [key, value]))
|
|
159
|
+
});
|
|
160
|
+
|
|
168
161
|
var StyleSheet = class {
|
|
169
162
|
constructor() {}
|
|
170
163
|
static create(object) {
|
|
@@ -191,30 +184,5 @@ var StyleSheet = class {
|
|
|
191
184
|
};
|
|
192
185
|
const css = StyleSheet;
|
|
193
186
|
|
|
194
|
-
Object.defineProperty(exports, 'color', {
|
|
195
|
-
enumerable: true,
|
|
196
|
-
get: function () {
|
|
197
|
-
return zss_utils.color;
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
Object.defineProperty(exports, 'container', {
|
|
201
|
-
enumerable: true,
|
|
202
|
-
get: function () {
|
|
203
|
-
return zss_utils.container;
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
187
|
exports.css = css;
|
|
207
|
-
Object.defineProperty(exports, 'media', {
|
|
208
|
-
enumerable: true,
|
|
209
|
-
get: function () {
|
|
210
|
-
return zss_utils.media;
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
Object.defineProperty(exports, 'ps', {
|
|
214
|
-
enumerable: true,
|
|
215
|
-
get: function () {
|
|
216
|
-
return zss_utils.ps;
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
exports.px = px;
|
|
220
188
|
exports.rx = rx;
|
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import { globalPromise_1, globalPromise_2, initPromise_1, initPromise_2, resolvePromise_1, resolvePromise_2 } from "./css.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { camelToKebabCase, genBase36Hash, injectClientCSS, injectClientGlobalCSS, injectServerCSS, isServer, isTestingDevelopment, processAtomicProps, splitAtomicAndNested, transpile } from "zss-engine";
|
|
4
|
-
|
|
5
|
-
const rx = (className, varSet) => ({
|
|
6
|
-
className,
|
|
7
|
-
style: Object.fromEntries(Object.entries(varSet).map(([key, value]) => [key, value]))
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
const px = (...pseudos) => {
|
|
11
|
-
return pseudos.filter(Boolean).join("");
|
|
12
|
-
};
|
|
2
|
+
import { camelToKebabCase, genBase36Hash, injectClientCSS, injectClientGlobalCSS, isServer, isTestingDevelopment, processAtomicProps, splitAtomicAndNested, transpile } from "zss-engine";
|
|
13
3
|
|
|
14
4
|
const styleAtomMap = new WeakMap();
|
|
15
5
|
function create(object) {
|
|
@@ -60,7 +50,6 @@ function props(...objects) {
|
|
|
60
50
|
const seenSheets = new Set();
|
|
61
51
|
const allStyleSheets = [];
|
|
62
52
|
const classList = [];
|
|
63
|
-
const injectIfNeeded = isServer ? injectServerCSS : injectClientCSS;
|
|
64
53
|
const chosen = new Map();
|
|
65
54
|
const rightmostKeys = [];
|
|
66
55
|
const orderedKeys = [];
|
|
@@ -106,24 +95,23 @@ function props(...objects) {
|
|
|
106
95
|
uniqueStyleSheets.forEach((sheet) => injectedStyleSheets.add(sheet));
|
|
107
96
|
if (typeof globalPromise_1 === "undefined") initPromise_1();
|
|
108
97
|
resolvePromise_1(uniqueStyleSheets.join(""));
|
|
109
|
-
if (isTestingDevelopment) {
|
|
110
|
-
for (const { hash, sheet } of [...orderedKeys, ...rightmostKeys]) if (uniqueStyleSheets.includes(sheet))
|
|
98
|
+
if (isTestingDevelopment && !isServer) {
|
|
99
|
+
for (const { hash, sheet } of [...orderedKeys, ...rightmostKeys]) if (uniqueStyleSheets.includes(sheet)) injectClientCSS(hash, sheet);
|
|
111
100
|
}
|
|
112
101
|
return classList.join(" ");
|
|
113
102
|
}
|
|
114
103
|
|
|
115
104
|
function global(object) {
|
|
116
|
-
const base36Hash = genBase36Hash(object, 1, 8);
|
|
117
105
|
const { styleSheet } = transpile(object, void 0, "--global");
|
|
118
106
|
if (typeof globalPromise_2 === "undefined") initPromise_2();
|
|
119
107
|
resolvePromise_2(styleSheet);
|
|
120
|
-
if (isTestingDevelopment
|
|
108
|
+
if (isTestingDevelopment && !isServer) injectClientGlobalCSS(styleSheet);
|
|
121
109
|
}
|
|
122
110
|
|
|
123
111
|
const keyframes = (object) => {
|
|
124
|
-
const
|
|
125
|
-
global({ [`@keyframes ${
|
|
126
|
-
return
|
|
112
|
+
const hash = genBase36Hash(object, 1, 8);
|
|
113
|
+
global({ [`@keyframes ${hash}`]: object });
|
|
114
|
+
return hash;
|
|
127
115
|
};
|
|
128
116
|
|
|
129
117
|
const defineVars = (object) => {
|
|
@@ -164,6 +152,11 @@ const defineConsts = (constants) => {
|
|
|
164
152
|
return constants;
|
|
165
153
|
};
|
|
166
154
|
|
|
155
|
+
const rx = (className, varSet) => ({
|
|
156
|
+
className,
|
|
157
|
+
style: Object.fromEntries(Object.entries(varSet).map(([key, value]) => [key, value]))
|
|
158
|
+
});
|
|
159
|
+
|
|
167
160
|
var StyleSheet = class {
|
|
168
161
|
constructor() {}
|
|
169
162
|
static create(object) {
|
|
@@ -190,4 +183,4 @@ var StyleSheet = class {
|
|
|
190
183
|
};
|
|
191
184
|
const css = StyleSheet;
|
|
192
185
|
|
|
193
|
-
export {
|
|
186
|
+
export { css, rx };
|
package/package.json
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "A library for Scalable and optimized styling",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"css",
|
|
7
|
-
"css-in-js",
|
|
8
|
-
"plumeria",
|
|
9
|
-
"react",
|
|
10
|
-
"next",
|
|
11
|
-
"vite"
|
|
12
|
-
],
|
|
13
5
|
"repository": {
|
|
14
6
|
"type": "git",
|
|
15
7
|
"url": "git+https://github.com/zss-in-js/plumeria.git",
|
|
@@ -39,8 +31,7 @@
|
|
|
39
31
|
"stylesheet.css"
|
|
40
32
|
],
|
|
41
33
|
"dependencies": {
|
|
42
|
-
"zss-engine": "0.2.
|
|
43
|
-
"zss-utils": "0.2.4"
|
|
34
|
+
"zss-engine": "0.2.75"
|
|
44
35
|
},
|
|
45
36
|
"publishConfig": {
|
|
46
37
|
"access": "public"
|