@plumeria/core 2.2.4 → 2.4.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.js CHANGED
@@ -38,7 +38,7 @@ const createProcessor = () => {
38
38
  const process = async (filePath) => {
39
39
  while (queue.length > 0) {
40
40
  const sheet = queue.shift();
41
- if (!zss_engine.isDevelopment && sheet) (0, zss_engine.build)(sheet, filePath);
41
+ if (!zss_engine.isDevelopment && sheet) await (0, zss_engine.build)(sheet, filePath);
42
42
  }
43
43
  processing = false;
44
44
  };
@@ -46,7 +46,7 @@ const createProcessor = () => {
46
46
  if (!promise) init();
47
47
  if (!processing && queue.length > 0) {
48
48
  processing = true;
49
- process(filePath);
49
+ await process(filePath);
50
50
  }
51
51
  };
52
52
  return {
package/dist/css.mjs CHANGED
@@ -16,7 +16,7 @@ const createProcessor = () => {
16
16
  const process = async (filePath) => {
17
17
  while (queue.length > 0) {
18
18
  const sheet = queue.shift();
19
- if (!isDevelopment && sheet) build(sheet, filePath);
19
+ if (!isDevelopment && sheet) await build(sheet, filePath);
20
20
  }
21
21
  processing = false;
22
22
  };
@@ -24,7 +24,7 @@ const createProcessor = () => {
24
24
  if (!promise) init();
25
25
  if (!processing && queue.length > 0) {
26
26
  processing = true;
27
- process(filePath);
27
+ await process(filePath);
28
28
  }
29
29
  };
30
30
  return {
package/dist/index.js CHANGED
@@ -49,25 +49,33 @@ function create(rule) {
49
49
  if (atRule.startsWith("@media") || atRule.startsWith("@container")) nonFlatQuery[atRule] = nestedObj;
50
50
  else nonFlatBase[atRule] = nestedObj;
51
51
  });
52
- Object.entries(nonFlatBase).forEach(([selector, style]) => {
53
- const nonFlatObj = { [key]: { [selector]: style } };
54
- const nonFlatHash = (0, zss_engine.genBase36Hash)(nonFlatObj, 1, 7);
55
- const { styleSheet } = (0, zss_engine.transpile)(nonFlatObj, nonFlatHash);
52
+ Object.entries(nonFlatBase).forEach(([selector, style], index) => {
53
+ const hashObj = { [key]: {
54
+ [selector]: style,
55
+ index
56
+ } };
57
+ const hash = (0, zss_engine.genBase36Hash)(hashObj, 1, 7);
58
+ const transpileObj = { [key]: { [selector]: style } };
59
+ const { styleSheet } = (0, zss_engine.transpile)(transpileObj, hash);
56
60
  records.push({
57
- key: selector,
58
- hash: nonFlatHash,
61
+ key: selector + index,
62
+ hash,
59
63
  sheet: styleSheet
60
64
  });
61
65
  });
62
66
  Object.entries(nonFlatQuery).forEach(([atRule, nestedStyles]) => {
63
- Object.entries(nestedStyles).forEach(([pseudoSelector, style]) => {
64
- const nonFlatObj = { [key]: { [atRule]: { [pseudoSelector]: style } } };
65
- const nonFlatHash = (0, zss_engine.genBase36Hash)(nonFlatObj, 1, 7);
66
- const { styleSheet } = (0, zss_engine.transpile)(nonFlatObj, nonFlatHash);
67
- const finalSheet = styleSheet.replace(`.${nonFlatHash}`, `.${nonFlatHash}:not(#\\#)`);
67
+ Object.entries(nestedStyles).forEach(([selector, style], index) => {
68
+ const hashObj = { [key]: { [atRule]: {
69
+ [selector]: style,
70
+ index
71
+ } } };
72
+ const hash = (0, zss_engine.genBase36Hash)(hashObj, 1, 7);
73
+ const transpileObj = { [key]: { [atRule]: { [selector]: style } } };
74
+ const { styleSheet } = (0, zss_engine.transpile)(transpileObj, hash);
75
+ const finalSheet = styleSheet.replace(`.${hash}`, `.${hash}:not(#\\#)`);
68
76
  records.push({
69
- key: atRule + pseudoSelector,
70
- hash: nonFlatHash,
77
+ key: atRule + selector + index,
78
+ hash,
71
79
  sheet: finalSheet
72
80
  });
73
81
  });
package/dist/index.mjs CHANGED
@@ -49,25 +49,33 @@ function create(rule) {
49
49
  if (atRule.startsWith("@media") || atRule.startsWith("@container")) nonFlatQuery[atRule] = nestedObj;
50
50
  else nonFlatBase[atRule] = nestedObj;
51
51
  });
52
- Object.entries(nonFlatBase).forEach(([selector, style]) => {
53
- const nonFlatObj = { [key]: { [selector]: style } };
54
- const nonFlatHash = genBase36Hash(nonFlatObj, 1, 7);
55
- const { styleSheet } = transpile(nonFlatObj, nonFlatHash);
52
+ Object.entries(nonFlatBase).forEach(([selector, style], index) => {
53
+ const hashObj = { [key]: {
54
+ [selector]: style,
55
+ index
56
+ } };
57
+ const hash = genBase36Hash(hashObj, 1, 7);
58
+ const transpileObj = { [key]: { [selector]: style } };
59
+ const { styleSheet } = transpile(transpileObj, hash);
56
60
  records.push({
57
- key: selector,
58
- hash: nonFlatHash,
61
+ key: selector + index,
62
+ hash,
59
63
  sheet: styleSheet
60
64
  });
61
65
  });
62
66
  Object.entries(nonFlatQuery).forEach(([atRule, nestedStyles]) => {
63
- Object.entries(nestedStyles).forEach(([pseudoSelector, style]) => {
64
- const nonFlatObj = { [key]: { [atRule]: { [pseudoSelector]: style } } };
65
- const nonFlatHash = genBase36Hash(nonFlatObj, 1, 7);
66
- const { styleSheet } = transpile(nonFlatObj, nonFlatHash);
67
- const finalSheet = styleSheet.replace(`.${nonFlatHash}`, `.${nonFlatHash}:not(#\\#)`);
67
+ Object.entries(nestedStyles).forEach(([selector, style], index) => {
68
+ const hashObj = { [key]: { [atRule]: {
69
+ [selector]: style,
70
+ index
71
+ } } };
72
+ const hash = genBase36Hash(hashObj, 1, 7);
73
+ const transpileObj = { [key]: { [atRule]: { [selector]: style } } };
74
+ const { styleSheet } = transpile(transpileObj, hash);
75
+ const finalSheet = styleSheet.replace(`.${hash}`, `.${hash}:not(#\\#)`);
68
76
  records.push({
69
- key: atRule + pseudoSelector,
70
- hash: nonFlatHash,
77
+ key: atRule + selector + index,
78
+ hash,
71
79
  sheet: finalSheet
72
80
  });
73
81
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/core",
3
- "version": "2.2.4",
3
+ "version": "2.4.0",
4
4
  "description": "An atomic CSS runtime designed to disappear.",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",
@@ -45,7 +45,7 @@
45
45
  "stylesheet.css"
46
46
  ],
47
47
  "dependencies": {
48
- "zss-engine": "2.0.0"
48
+ "zss-engine": "2.1.0"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public",