@plumeria/core 4.2.1 → 5.0.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/{css.d.ts → css.d.mts} +9 -10
- package/dist/css.mjs +17 -22
- package/package.json +3 -3
- package/dist/css.js +0 -44
|
@@ -61,19 +61,18 @@ type ViewTransition = {
|
|
|
61
61
|
old?: CSSProperties;
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
declare function props(...rules: (false | CSSProperties | null | undefined)[]): string;
|
|
65
|
-
declare const css: {
|
|
66
|
-
new (): {};
|
|
67
|
-
create<const T extends Record<string, CSSProperties>>(_rule: CreateStyleType<T>): ReturnType<T>;
|
|
68
|
-
props: typeof props;
|
|
69
|
-
createTheme<const T extends CreateTheme>(_rule: T): ReturnVariableType<T>;
|
|
70
|
-
createStatic<const T extends CreateStatic>(_rule: T): T;
|
|
71
|
-
keyframes(_rule: Keyframes): string;
|
|
72
|
-
viewTransition(_rule: ViewTransition): string;
|
|
73
|
-
};
|
|
74
64
|
declare const x: (className: string, style: Style) => {
|
|
75
65
|
className: string;
|
|
76
66
|
style: Style;
|
|
77
67
|
};
|
|
68
|
+
declare const css: {
|
|
69
|
+
create: <const T extends Record<string, CSSProperties>>(_rule: CreateStyleType<T>) => ReturnType<T>;
|
|
70
|
+
props: (...rules: (false | CSSProperties | null | undefined)[]) => string;
|
|
71
|
+
createTheme: <const T extends CreateTheme>(_rule: T) => ReturnVariableType<T>;
|
|
72
|
+
createStatic: <const T extends CreateStatic>(_rule: T) => T;
|
|
73
|
+
keyframes: (_rule: Keyframes) => string;
|
|
74
|
+
viewTransition: (_rule: ViewTransition) => string;
|
|
75
|
+
};
|
|
76
|
+
type css = typeof css;
|
|
78
77
|
|
|
79
78
|
export { type CSSProperties, type CreateStyle, css, x };
|
package/dist/css.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
throw new Error(
|
|
3
|
-
}
|
|
1
|
+
const errorFn = () => {
|
|
2
|
+
throw new Error("Runtime execution is not supported");
|
|
3
|
+
};
|
|
4
4
|
const defined = new Set();
|
|
5
|
-
|
|
5
|
+
const props = (...rules) => {
|
|
6
6
|
defined.clear();
|
|
7
7
|
let result = "";
|
|
8
8
|
for (let i = rules.length - 1; i >= 0; i--) {
|
|
@@ -16,28 +16,23 @@ function props(...rules) {
|
|
|
16
16
|
if (chunk) result = result ? chunk + " " + result : chunk;
|
|
17
17
|
}
|
|
18
18
|
return result;
|
|
19
|
-
}
|
|
20
|
-
const css = class _css {
|
|
21
|
-
static create(_rule) {
|
|
22
|
-
throw errorFn("create");
|
|
23
|
-
}
|
|
24
|
-
static props = props;
|
|
25
|
-
static createTheme(_rule) {
|
|
26
|
-
throw errorFn("createTheme");
|
|
27
|
-
}
|
|
28
|
-
static createStatic(_rule) {
|
|
29
|
-
throw errorFn("createStatic");
|
|
30
|
-
}
|
|
31
|
-
static keyframes(_rule) {
|
|
32
|
-
throw errorFn("keyframes");
|
|
33
|
-
}
|
|
34
|
-
static viewTransition(_rule) {
|
|
35
|
-
throw errorFn("viewTransition");
|
|
36
|
-
}
|
|
37
19
|
};
|
|
20
|
+
const create = (_rule) => errorFn();
|
|
21
|
+
const createTheme = (_rule) => errorFn();
|
|
22
|
+
const createStatic = (_rule) => errorFn();
|
|
23
|
+
const keyframes = (_rule) => errorFn();
|
|
24
|
+
const viewTransition = (_rule) => errorFn();
|
|
38
25
|
const x = (className, style) => ({
|
|
39
26
|
className,
|
|
40
27
|
style
|
|
41
28
|
});
|
|
29
|
+
const css = {
|
|
30
|
+
create,
|
|
31
|
+
props,
|
|
32
|
+
createTheme,
|
|
33
|
+
createStatic,
|
|
34
|
+
keyframes,
|
|
35
|
+
viewTransition
|
|
36
|
+
};
|
|
42
37
|
|
|
43
38
|
export { css, x };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "An atomic CSS runtime designed to disappear.",
|
|
5
5
|
"author": "Refirst 11",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"react-native-web"
|
|
25
25
|
],
|
|
26
26
|
"sideEffects": false,
|
|
27
|
-
"main": "dist/css.
|
|
27
|
+
"main": "dist/css.mjs",
|
|
28
28
|
"module": "dist/css.mjs",
|
|
29
|
-
"types": "dist/css.d.
|
|
29
|
+
"types": "dist/css.d.mts",
|
|
30
30
|
"files": [
|
|
31
31
|
"dist/"
|
|
32
32
|
],
|
package/dist/css.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
function errorFn(fn) {
|
|
2
|
-
throw new Error(`css.${fn} requires bundler-plugin setup`);
|
|
3
|
-
}
|
|
4
|
-
const defined = new Set();
|
|
5
|
-
function props(...rules) {
|
|
6
|
-
defined.clear();
|
|
7
|
-
let result = "";
|
|
8
|
-
for (let i = rules.length - 1; i >= 0; i--) {
|
|
9
|
-
const arg = rules[i];
|
|
10
|
-
if (!arg || typeof arg !== "object") continue;
|
|
11
|
-
let chunk = "";
|
|
12
|
-
for (const key in arg) if (arg[key] && !defined.has(key)) {
|
|
13
|
-
defined.add(key);
|
|
14
|
-
chunk += chunk ? " " + arg[key] : arg[key];
|
|
15
|
-
}
|
|
16
|
-
if (chunk) result = result ? chunk + " " + result : chunk;
|
|
17
|
-
}
|
|
18
|
-
return result;
|
|
19
|
-
}
|
|
20
|
-
const css = class _css {
|
|
21
|
-
static create(_rule) {
|
|
22
|
-
throw errorFn("create");
|
|
23
|
-
}
|
|
24
|
-
static props = props;
|
|
25
|
-
static createTheme(_rule) {
|
|
26
|
-
throw errorFn("createTheme");
|
|
27
|
-
}
|
|
28
|
-
static createStatic(_rule) {
|
|
29
|
-
throw errorFn("createStatic");
|
|
30
|
-
}
|
|
31
|
-
static keyframes(_rule) {
|
|
32
|
-
throw errorFn("keyframes");
|
|
33
|
-
}
|
|
34
|
-
static viewTransition(_rule) {
|
|
35
|
-
throw errorFn("viewTransition");
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const x = (className, style) => ({
|
|
39
|
-
className,
|
|
40
|
-
style
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
exports.css = css;
|
|
44
|
-
exports.x = x;
|