@plumeria/core 4.0.1 → 4.0.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 CHANGED
@@ -46,7 +46,7 @@ Read the [documentation](https://plumeria.dev/) for more details.
46
46
  - [Next](https://plumeria.dev/docs/integration/next)
47
47
  - [Turbopack](https://plumeria.dev/docs/integration/turbopack)
48
48
  - [Webpack](https://plumeria.dev/docs/integration/webpack)
49
- - [CLI](https://plumeria.dev/docs/integration/cli)
49
+ - [PostCSS](https://plumeria.dev/docs/integration/postcss)
50
50
  - [ESLint](https://plumeria.dev/docs/integration/eslint)
51
51
 
52
52
  ## Acknowledgement
package/dist/css.js CHANGED
@@ -4,35 +4,25 @@ function errorFn(fn) {
4
4
  }
5
5
  function props(...rules) {
6
6
  const chosen = new Map();
7
- const classList = [];
8
- const orderedKeys = [];
9
- const rightmostKeys = [];
10
- for (let i = rules.length - 1; i >= 0; i--) {
7
+ const lastIdx = rules.length - 1;
8
+ for (let i = lastIdx; i >= 0; i--) {
11
9
  const arg = rules[i];
12
10
  if (!arg || typeof arg === "string") continue;
13
- for (const [key, hash] of Object.entries(arg)) if (!chosen.has(key)) chosen.set(key, {
14
- hash,
15
- propsIdx: i
16
- });
11
+ for (const key in arg) if (!chosen.has(key)) chosen.set(key, i);
17
12
  }
18
- for (let i = 0; i < rules.length; i++) {
13
+ const classList = [];
14
+ const rightmostList = [];
15
+ for (let i = 0; i <= lastIdx; i++) {
19
16
  const arg = rules[i];
20
17
  if (!arg) continue;
21
18
  if (typeof arg === "string") {
22
19
  classList.push(arg);
23
20
  continue;
24
21
  }
25
- for (const [key] of Object.entries(arg)) {
26
- const info = chosen.get(key);
27
- if (info && info.propsIdx === i) {
28
- if (i === rules.length - 1) rightmostKeys.push(info);
29
- else orderedKeys.push(info);
30
- chosen.delete(key);
31
- }
32
- }
22
+ for (const key in arg) if (chosen.get(key) === i && arg[key]) if (i === lastIdx) rightmostList.push(arg[key]);
23
+ else classList.push(arg[key]);
33
24
  }
34
- for (const { hash } of orderedKeys) classList.push(hash);
35
- for (const { hash } of rightmostKeys) classList.push(hash);
25
+ for (const hash of rightmostList) classList.push(hash);
36
26
  return classList.join(" ");
37
27
  }
38
28
  const css = class _css {
package/dist/css.mjs CHANGED
@@ -4,35 +4,25 @@ function errorFn(fn) {
4
4
  }
5
5
  function props(...rules) {
6
6
  const chosen = new Map();
7
- const classList = [];
8
- const orderedKeys = [];
9
- const rightmostKeys = [];
10
- for (let i = rules.length - 1; i >= 0; i--) {
7
+ const lastIdx = rules.length - 1;
8
+ for (let i = lastIdx; i >= 0; i--) {
11
9
  const arg = rules[i];
12
10
  if (!arg || typeof arg === "string") continue;
13
- for (const [key, hash] of Object.entries(arg)) if (!chosen.has(key)) chosen.set(key, {
14
- hash,
15
- propsIdx: i
16
- });
11
+ for (const key in arg) if (!chosen.has(key)) chosen.set(key, i);
17
12
  }
18
- for (let i = 0; i < rules.length; i++) {
13
+ const classList = [];
14
+ const rightmostList = [];
15
+ for (let i = 0; i <= lastIdx; i++) {
19
16
  const arg = rules[i];
20
17
  if (!arg) continue;
21
18
  if (typeof arg === "string") {
22
19
  classList.push(arg);
23
20
  continue;
24
21
  }
25
- for (const [key] of Object.entries(arg)) {
26
- const info = chosen.get(key);
27
- if (info && info.propsIdx === i) {
28
- if (i === rules.length - 1) rightmostKeys.push(info);
29
- else orderedKeys.push(info);
30
- chosen.delete(key);
31
- }
32
- }
22
+ for (const key in arg) if (chosen.get(key) === i && arg[key]) if (i === lastIdx) rightmostList.push(arg[key]);
23
+ else classList.push(arg[key]);
33
24
  }
34
- for (const { hash } of orderedKeys) classList.push(hash);
35
- for (const { hash } of rightmostKeys) classList.push(hash);
25
+ for (const hash of rightmostList) classList.push(hash);
36
26
  return classList.join(" ");
37
27
  }
38
28
  const css = class _css {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/core",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "description": "An atomic CSS runtime designed to disappear.",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",
@@ -19,6 +19,7 @@
19
19
  "atomic-css",
20
20
  "css-in-js",
21
21
  "css",
22
+ "linaria",
22
23
  "stylex",
23
24
  "react-native-web"
24
25
  ],
@@ -27,8 +28,7 @@
27
28
  "module": "dist/css.mjs",
28
29
  "types": "dist/css.d.ts",
29
30
  "files": [
30
- "dist/",
31
- "stylesheet.css"
31
+ "dist/"
32
32
  ],
33
33
  "dependencies": {
34
34
  "csstype": "^3.2.3"