@plumeria/core 0.15.4 → 0.15.5

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.js CHANGED
@@ -16,14 +16,12 @@ function create(object) {
16
16
  (0, zss_engine.processAtomicProps)({ [prop]: value }, hashes, sheets);
17
17
  const baseSheets = [];
18
18
  const querySheets = [];
19
- for (const sheet$1 of sheets) if (sheet$1.includes("@media") || sheet$1.includes("@container")) querySheets.push(sheet$1);
20
- else baseSheets.push(sheet$1);
21
- const hash = [...hashes].join(" ");
22
- const sheet = [...baseSheets, ...querySheets].join("");
19
+ for (const sheet of sheets) if (sheet.includes("@media") || sheet.includes("@container")) querySheets.push(sheet);
20
+ else baseSheets.push(sheet);
23
21
  records.push({
24
22
  key: prop,
25
- hash,
26
- sheet
23
+ hash: [...hashes],
24
+ sheet: [...baseSheets, ...querySheets]
27
25
  });
28
26
  });
29
27
  if (Object.keys(nonFlat).length > 0) {
@@ -34,8 +32,8 @@ function create(object) {
34
32
  Object.entries(nestedObj).forEach(([prop]) => {
35
33
  records.push({
36
34
  key: atRule + prop,
37
- hash: nonFlatHash,
38
- sheet: styleSheet
35
+ hash: [nonFlatHash],
36
+ sheet: [styleSheet]
39
37
  });
40
38
  });
41
39
  });
@@ -82,12 +80,22 @@ function props(...objects) {
82
80
  chosen.delete(key);
83
81
  }
84
82
  }
85
- for (const { hash, sheet } of orderedKeys) if (!seenSheets.has(sheet)) {
83
+ const orderedEntries = [];
84
+ const rightmostEntries = [];
85
+ for (const { hash: hashes, sheet: sheets } of orderedKeys) for (let j = 0; j < hashes.length; j++) orderedEntries.push({
86
+ hash: hashes[j],
87
+ sheet: sheets[j]
88
+ });
89
+ for (const { hash: hashes, sheet: sheets } of rightmostKeys) for (let j = 0; j < hashes.length; j++) rightmostEntries.push({
90
+ hash: hashes[j],
91
+ sheet: sheets[j]
92
+ });
93
+ for (const { hash, sheet } of orderedEntries) if (!seenSheets.has(sheet)) {
86
94
  seenSheets.add(sheet);
87
95
  classList.push(hash);
88
96
  allStyleSheets.push(sheet);
89
97
  }
90
- for (const { hash, sheet } of rightmostKeys) if (!seenSheets.has(sheet)) {
98
+ for (const { hash, sheet } of rightmostEntries) if (!seenSheets.has(sheet)) {
91
99
  seenSheets.add(sheet);
92
100
  classList.push(hash);
93
101
  allStyleSheets.push(sheet);
@@ -97,7 +105,8 @@ function props(...objects) {
97
105
  if (typeof require_css.globalPromise_1 === "undefined") require_css.initPromise_1();
98
106
  require_css.resolvePromise_1(uniqueStyleSheets.join(""));
99
107
  if (zss_engine.isTestingDevelopment && !zss_engine.isServer) {
100
- for (const { hash, sheet } of [...orderedKeys, ...rightmostKeys]) if (uniqueStyleSheets.includes(sheet) && !(0, zss_engine.isHashInStyleSheets)(hash)) (0, zss_engine.injectClientCSS)(hash, sheet);
108
+ injectedStyleSheets.clear();
109
+ for (const { hash, sheet } of [...orderedEntries, ...rightmostEntries]) if (uniqueStyleSheets.includes(sheet) && !(0, zss_engine.isHashInStyleSheets)(hash)) (0, zss_engine.injectClientCSS)(hash, sheet);
101
110
  }
102
111
  return classList.join(" ");
103
112
  }
package/dist/index.mjs CHANGED
@@ -15,14 +15,12 @@ function create(object) {
15
15
  processAtomicProps({ [prop]: value }, hashes, sheets);
16
16
  const baseSheets = [];
17
17
  const querySheets = [];
18
- for (const sheet$1 of sheets) if (sheet$1.includes("@media") || sheet$1.includes("@container")) querySheets.push(sheet$1);
19
- else baseSheets.push(sheet$1);
20
- const hash = [...hashes].join(" ");
21
- const sheet = [...baseSheets, ...querySheets].join("");
18
+ for (const sheet of sheets) if (sheet.includes("@media") || sheet.includes("@container")) querySheets.push(sheet);
19
+ else baseSheets.push(sheet);
22
20
  records.push({
23
21
  key: prop,
24
- hash,
25
- sheet
22
+ hash: [...hashes],
23
+ sheet: [...baseSheets, ...querySheets]
26
24
  });
27
25
  });
28
26
  if (Object.keys(nonFlat).length > 0) {
@@ -33,8 +31,8 @@ function create(object) {
33
31
  Object.entries(nestedObj).forEach(([prop]) => {
34
32
  records.push({
35
33
  key: atRule + prop,
36
- hash: nonFlatHash,
37
- sheet: styleSheet
34
+ hash: [nonFlatHash],
35
+ sheet: [styleSheet]
38
36
  });
39
37
  });
40
38
  });
@@ -81,12 +79,22 @@ function props(...objects) {
81
79
  chosen.delete(key);
82
80
  }
83
81
  }
84
- for (const { hash, sheet } of orderedKeys) if (!seenSheets.has(sheet)) {
82
+ const orderedEntries = [];
83
+ const rightmostEntries = [];
84
+ for (const { hash: hashes, sheet: sheets } of orderedKeys) for (let j = 0; j < hashes.length; j++) orderedEntries.push({
85
+ hash: hashes[j],
86
+ sheet: sheets[j]
87
+ });
88
+ for (const { hash: hashes, sheet: sheets } of rightmostKeys) for (let j = 0; j < hashes.length; j++) rightmostEntries.push({
89
+ hash: hashes[j],
90
+ sheet: sheets[j]
91
+ });
92
+ for (const { hash, sheet } of orderedEntries) if (!seenSheets.has(sheet)) {
85
93
  seenSheets.add(sheet);
86
94
  classList.push(hash);
87
95
  allStyleSheets.push(sheet);
88
96
  }
89
- for (const { hash, sheet } of rightmostKeys) if (!seenSheets.has(sheet)) {
97
+ for (const { hash, sheet } of rightmostEntries) if (!seenSheets.has(sheet)) {
90
98
  seenSheets.add(sheet);
91
99
  classList.push(hash);
92
100
  allStyleSheets.push(sheet);
@@ -96,7 +104,8 @@ function props(...objects) {
96
104
  if (typeof globalPromise_1 === "undefined") initPromise_1();
97
105
  resolvePromise_1(uniqueStyleSheets.join(""));
98
106
  if (isTestingDevelopment && !isServer) {
99
- for (const { hash, sheet } of [...orderedKeys, ...rightmostKeys]) if (uniqueStyleSheets.includes(sheet) && !isHashInStyleSheets(hash)) injectClientCSS(hash, sheet);
107
+ injectedStyleSheets.clear();
108
+ for (const { hash, sheet } of [...orderedEntries, ...rightmostEntries]) if (uniqueStyleSheets.includes(sheet) && !isHashInStyleSheets(hash)) injectClientCSS(hash, sheet);
100
109
  }
101
110
  return classList.join(" ");
102
111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/core",
3
- "version": "0.15.4",
3
+ "version": "0.15.5",
4
4
  "description": "A library for scalable and optimized styling",
5
5
  "repository": {
6
6
  "type": "git",