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