@pikacss/core 0.0.22 → 0.0.24

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.cjs CHANGED
@@ -308,25 +308,23 @@ function keyframes() {
308
308
  };
309
309
  engine.keyframes.add(...configList);
310
310
  engine.addPreflight((engine2, isFormatted) => {
311
- const used = /* @__PURE__ */ new Set();
311
+ const maybeUsedName = /* @__PURE__ */ new Set();
312
312
  engine2.store.atomicStyles.forEach(({ content: { property, value } }) => {
313
313
  if (property === "animationName") {
314
- value.forEach((name) => used.add(name));
314
+ value.forEach((name) => maybeUsedName.add(name));
315
315
  return;
316
316
  }
317
317
  if (property === "animation") {
318
318
  value.forEach((value2) => {
319
319
  const animations = value2.split(",").map((v) => v.trim());
320
320
  animations.forEach((animation) => {
321
- const name = animation.split(" ")[0];
322
- if (isNotNullish(name))
323
- used.add(name);
321
+ addToSet(maybeUsedName, ...animation.split(" "));
324
322
  });
325
323
  });
326
324
  }
327
325
  });
328
326
  return renderCSSStyleBlocks(
329
- new Map(Array.from(engine2.keyframes.store.entries()).filter(([name]) => used.has(name)).map(([name, frames]) => [
327
+ new Map(Array.from(engine2.keyframes.store.entries()).filter(([name, { pruneUnused }]) => pruneUnused === false || maybeUsedName.has(name)).map(([name, { frames }]) => [
330
328
  `@keyframes ${name}`,
331
329
  {
332
330
  properties: [],
@@ -735,7 +733,7 @@ function variables() {
735
733
  /* @__PURE__ */ new Map([[
736
734
  ":root",
737
735
  {
738
- properties: Array.from(engine2.variables.store.entries()).filter(([name, { value }]) => used.has(name) && value != null).map(([name, { value }]) => ({ property: name, value }))
736
+ properties: Array.from(engine2.variables.store.entries()).filter(([name, { pruneUnused, value }]) => (pruneUnused === false || used.has(name)) && value != null).map(([name, { value }]) => ({ property: name, value }))
739
737
  }
740
738
  ]]),
741
739
  isFormatted
package/dist/index.mjs CHANGED
@@ -306,25 +306,23 @@ function keyframes() {
306
306
  };
307
307
  engine.keyframes.add(...configList);
308
308
  engine.addPreflight((engine2, isFormatted) => {
309
- const used = /* @__PURE__ */ new Set();
309
+ const maybeUsedName = /* @__PURE__ */ new Set();
310
310
  engine2.store.atomicStyles.forEach(({ content: { property, value } }) => {
311
311
  if (property === "animationName") {
312
- value.forEach((name) => used.add(name));
312
+ value.forEach((name) => maybeUsedName.add(name));
313
313
  return;
314
314
  }
315
315
  if (property === "animation") {
316
316
  value.forEach((value2) => {
317
317
  const animations = value2.split(",").map((v) => v.trim());
318
318
  animations.forEach((animation) => {
319
- const name = animation.split(" ")[0];
320
- if (isNotNullish(name))
321
- used.add(name);
319
+ addToSet(maybeUsedName, ...animation.split(" "));
322
320
  });
323
321
  });
324
322
  }
325
323
  });
326
324
  return renderCSSStyleBlocks(
327
- new Map(Array.from(engine2.keyframes.store.entries()).filter(([name]) => used.has(name)).map(([name, frames]) => [
325
+ new Map(Array.from(engine2.keyframes.store.entries()).filter(([name, { pruneUnused }]) => pruneUnused === false || maybeUsedName.has(name)).map(([name, { frames }]) => [
328
326
  `@keyframes ${name}`,
329
327
  {
330
328
  properties: [],
@@ -733,7 +731,7 @@ function variables() {
733
731
  /* @__PURE__ */ new Map([[
734
732
  ":root",
735
733
  {
736
- properties: Array.from(engine2.variables.store.entries()).filter(([name, { value }]) => used.has(name) && value != null).map(([name, { value }]) => ({ property: name, value }))
734
+ properties: Array.from(engine2.variables.store.entries()).filter(([name, { pruneUnused, value }]) => (pruneUnused === false || used.has(name)) && value != null).map(([name, { value }]) => ({ property: name, value }))
737
735
  }
738
736
  ]]),
739
737
  isFormatted
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.0.22",
7
+ "version": "0.0.24",
8
8
  "author": "DevilTea <ch19980814@gmail.com>",
9
9
  "license": "MIT",
10
10
  "repository": {