@unocss/preset-wind4 66.6.2 → 66.6.4-beta.1

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.
@@ -1,4 +1,4 @@
1
- import { w as resolveBreakpoints } from "./utils-C1uvQCt6.mjs";
1
+ import { w as resolveBreakpoints } from "./utils-B_qFX7UQ.mjs";
2
2
  import { isString } from "@unocss/core";
3
3
 
4
4
  //#region src/rules/container.ts
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import { postprocessors } from "./postprocess.mjs";
2
- import { H as PRESET_NAME, I as globalKeywords, a as themeTracking, f as compressCSS, h as getThemeByKey, n as detectThemeValue, o as trackedProperties, s as trackedTheme } from "./utils-C1uvQCt6.mjs";
2
+ import { H as PRESET_NAME, I as globalKeywords, a as themeTracking, f as compressCSS, h as getThemeByKey, n as detectThemeValue, o as trackedProperties, s as trackedTheme } from "./utils-B_qFX7UQ.mjs";
3
3
  import { rules } from "./rules.mjs";
4
4
  import { shortcuts } from "./shortcuts.mjs";
5
5
  import { theme } from "./theme.mjs";
6
- import { t as variants } from "./variants-BqQ8LqhD.mjs";
6
+ import { t as variants } from "./variants-Dae_1bdw.mjs";
7
7
  import { definePreset, escapeSelector, toArray, uniq } from "@unocss/core";
8
8
  import { extractorArbitraryVariants } from "@unocss/extractor-arbitrary-variants";
9
9
  import { alphaPlaceholdersRE } from "@unocss/rule-utils";
package/dist/rules.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { A as bracketTypeRe, B as xyzMap, D as h, F as directionMap, I as globalKeywords, L as insetMap, M as cornerMap, R as positionMap, S as parseColor, U as SpecialColorKey, V as CONTROL_NO_NEGATIVE, _ as hyphenate, a as themeTracking, b as makeGlobalStaticRules, d as colorableShadows, g as hasParseableColor, j as splitComma, l as colorCSSGenerator, m as directionSize, n as detectThemeValue, p as defineProperty, r as generateThemeVariable, u as colorResolver, v as isCSSMathFn, w as resolveBreakpoints, x as numberResolver, y as isSize, z as xyzArray } from "./utils-C1uvQCt6.mjs";
2
- import { n as containerParent, r as containerShortcuts, t as container } from "./container-DKNdsyjo.mjs";
1
+ import { A as bracketTypeRe, B as xyzMap, D as h, F as directionMap, I as globalKeywords, L as insetMap, M as cornerMap, R as positionMap, S as parseColor, U as SpecialColorKey, V as CONTROL_NO_NEGATIVE, _ as hyphenate, a as themeTracking, b as makeGlobalStaticRules, d as colorableShadows, g as hasParseableColor, j as splitComma, l as colorCSSGenerator, m as directionSize, n as detectThemeValue, p as defineProperty, r as generateThemeVariable, u as colorResolver, v as isCSSMathFn, w as resolveBreakpoints, x as numberResolver, y as isSize, z as xyzArray } from "./utils-B_qFX7UQ.mjs";
2
+ import { n as containerParent, r as containerShortcuts, t as container } from "./container-BsDB8iH5.mjs";
3
3
  import { notNull, symbols } from "@unocss/core";
4
4
  import { getStringComponent, getStringComponents } from "@unocss/rule-utils";
5
5
 
@@ -841,7 +841,7 @@ function* handlerSpace([m, d, s], { theme, symbols: symbols$1 }) {
841
841
  } else v = theme.spacing?.[s] ?? h.bracket.cssvar.auto.fraction.rem(s || "1");
842
842
  if (v != null) {
843
843
  const results = directionMap[d === "x" ? "inline" : "block"].map((item, index) => {
844
- return [`margin${item}`, ` calc(${v} * ${index === 0 ? `var(--un-space-${d}-reverse)` : `calc(1 - var(--un-space-${d}-reverse))`})`];
844
+ return [`margin${item}`, `calc(${v} * ${index === 0 ? `var(--un-space-${d}-reverse)` : `calc(1 - var(--un-space-${d}-reverse))`})`];
845
845
  });
846
846
  if (results) {
847
847
  yield {
@@ -1,4 +1,4 @@
1
- import { r as containerShortcuts } from "./container-DKNdsyjo.mjs";
1
+ import { r as containerShortcuts } from "./container-BsDB8iH5.mjs";
2
2
 
3
3
  //#region src/shortcuts/index.ts
4
4
  const shortcuts = [...containerShortcuts];
@@ -663,6 +663,7 @@ function defineProperty(property, options = {}) {
663
663
  const value = {
664
664
  [symbols.shortcutsNoMerge]: true,
665
665
  [symbols.noMerge]: true,
666
+ [symbols.noScope]: true,
666
667
  [symbols.variants]: () => [{
667
668
  parent: "",
668
669
  layer: "properties",
package/dist/utils.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { B as xyzMap, C as parseThemeColor, D as h, E as splitShorthand, F as directionMap, H as PRESET_NAME, I as globalKeywords, L as insetMap, M as cornerMap, N as cssMathFnRE, O as handler, P as cssVarFnRE, R as positionMap, S as parseColor, T as resolveVerticalBreakpoints, U as SpecialColorKey, V as CONTROL_NO_NEGATIVE, _ as hyphenate, a as themeTracking, b as makeGlobalStaticRules, c as camelize, d as colorableShadows, f as compressCSS, g as hasParseableColor, h as getThemeByKey, i as propertyTracking, k as handlers_exports, l as colorCSSGenerator, m as directionSize, n as detectThemeValue, o as trackedProperties, p as defineProperty, r as generateThemeVariable, s as trackedTheme, t as createRemToPxProcessor, u as colorResolver, v as isCSSMathFn, w as resolveBreakpoints, x as numberResolver, y as isSize, z as xyzArray } from "./utils-C1uvQCt6.mjs";
1
+ import { B as xyzMap, C as parseThemeColor, D as h, E as splitShorthand, F as directionMap, H as PRESET_NAME, I as globalKeywords, L as insetMap, M as cornerMap, N as cssMathFnRE, O as handler, P as cssVarFnRE, R as positionMap, S as parseColor, T as resolveVerticalBreakpoints, U as SpecialColorKey, V as CONTROL_NO_NEGATIVE, _ as hyphenate, a as themeTracking, b as makeGlobalStaticRules, c as camelize, d as colorableShadows, f as compressCSS, g as hasParseableColor, h as getThemeByKey, i as propertyTracking, k as handlers_exports, l as colorCSSGenerator, m as directionSize, n as detectThemeValue, o as trackedProperties, p as defineProperty, r as generateThemeVariable, s as trackedTheme, t as createRemToPxProcessor, u as colorResolver, v as isCSSMathFn, w as resolveBreakpoints, x as numberResolver, y as isSize, z as xyzArray } from "./utils-B_qFX7UQ.mjs";
2
2
 
3
3
  export * from "@unocss/rule-utils"
4
4
 
@@ -1,4 +1,4 @@
1
- import { D as h, N as cssMathFnRE, P as cssVarFnRE, V as CONTROL_NO_NEGATIVE, g as hasParseableColor, w as resolveBreakpoints } from "./utils-C1uvQCt6.mjs";
1
+ import { D as h, N as cssMathFnRE, P as cssVarFnRE, V as CONTROL_NO_NEGATIVE, g as hasParseableColor, w as resolveBreakpoints } from "./utils-B_qFX7UQ.mjs";
2
2
  import { toArray } from "@unocss/core";
3
3
  import { calcMaxWidthBySize, createPartClasses, createPseudoClassFunctions, createPseudoClassesAndElements, createTaggedPseudoClasses, getBracket, getStringComponent, hasThemeFn, transformThemeFn, variantGetBracket, variantGetParameter, variantMatcher, variantParentMatcher } from "@unocss/rule-utils";
4
4
 
@@ -488,12 +488,24 @@ const variantImplicitGroup = {
488
488
  //#region src/variants/negative.ts
489
489
  const anchoredNumberRE = /^-?[0-9.]+(?:[a-z]+|%)?$/;
490
490
  const numberRE = /-?[0-9.]+(?:[a-z]+|%)?/;
491
+ const spacingMultiplyRE = /var\(--spacing(?:-[\w-]+)?\)\s*\*\s*(-?[0-9.]+(?:[a-z]+|%)?)/;
491
492
  const ignoreProps = [/\b(opacity|color|flex|backdrop-filter|^filter|^scale|transform|mask-image)\b/];
492
493
  function negateMathFunction(value) {
493
494
  const match = value.match(cssMathFnRE) || value.match(cssVarFnRE);
494
495
  if (match) {
495
496
  const [fnBody, rest] = getStringComponent(`(${match[2]})${match[3]}`, "(", ")", " ") ?? [];
496
- if (fnBody) return `calc(${match[1]}${fnBody} * -1)${rest ? ` ${rest}` : ""}`;
497
+ if (fnBody) {
498
+ const spacingMultiplyMatch = fnBody.match(spacingMultiplyRE);
499
+ if (spacingMultiplyMatch) {
500
+ const num = spacingMultiplyMatch[1];
501
+ const nextNum = num.startsWith("-") ? num.slice(1) : `-${num}`;
502
+ const nextFnBody = fnBody.replace(spacingMultiplyRE, (segment) => {
503
+ return segment.replace(num, nextNum);
504
+ });
505
+ return `${match[1]}${nextFnBody}${rest ? ` ${rest}` : ""}`;
506
+ }
507
+ return `calc(${match[1]}${fnBody} * -1)${rest ? ` ${rest}` : ""}`;
508
+ }
497
509
  }
498
510
  }
499
511
  const negateFunctionBodyRE = /\b(hue-rotate)\s*(\(.*)/;
@@ -516,28 +528,17 @@ const variantNegative = {
516
528
  body: (body) => {
517
529
  if (body.find((v) => v[0] === CONTROL_NO_NEGATIVE)) return;
518
530
  let changed = false;
519
- body.forEach((v) => {
520
- if (toArray(v[2]).includes(CONTROL_NO_NEGATIVE)) return;
521
- const value = v[1]?.toString();
522
- if (!value || value === "0") return;
523
- if (ignoreProps.some((i) => i.test(v[0]))) return;
524
- const negatedFn = negateMathFunction(value);
525
- if (negatedFn) {
526
- v[1] = negatedFn;
527
- changed = true;
528
- return;
529
- }
530
- const negatedBody = negateFunctionBody(value);
531
- if (negatedBody) {
532
- v[1] = negatedBody;
533
- changed = true;
534
- return;
535
- }
536
- if (anchoredNumberRE.test(value)) {
537
- v[1] = value.replace(numberRE, (i) => i.startsWith("-") ? i.slice(1) : `-${i}`);
538
- changed = true;
539
- }
540
- });
531
+ for (const v of body) {
532
+ const [prop, rawValue, meta] = v;
533
+ if (typeof rawValue === "object") continue;
534
+ if (meta && toArray(meta).includes(CONTROL_NO_NEGATIVE)) continue;
535
+ const value = rawValue?.toString();
536
+ if (!value || value === "0" || ignoreProps.some((i) => i.test(prop))) continue;
537
+ const nextValue = negateMathFunction(value) ?? negateFunctionBody(value) ?? (anchoredNumberRE.test(value) ? value.replace(numberRE, (i) => i.startsWith("-") ? i.slice(1) : `-${i}`) : void 0);
538
+ if (!nextValue || nextValue === value) continue;
539
+ v[1] = nextValue;
540
+ changed = true;
541
+ }
541
542
  if (changed) return body;
542
543
  return [];
543
544
  }
package/dist/variants.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { A as variantColorsMediaOrClass, C as variantOrientations, D as variantLanguageDirections, E as variantImportant, F as variantChildren, I as variantBreakpoints, L as variantAria, M as variantContainerQuery, N as variantCombinators, O as variantDataAttribute, P as variantSvgCombinators, R as variantTaggedAriaAttributes, S as variantNoscript, T as variantScripting, _ as variantVariables, a as variantPseudoClassFunctions, b as variantForcedColors, c as placeholderModifier, d as variantImplicitGroup, f as variantInternalLayer, g as variantTheme, h as variantStickyHover, i as variantPartClasses, j as variantColorsScheme, k as variantTaggedDataAttributes, l as variantNegative, m as variantSelector, n as variantSupports, o as variantPseudoClassesAndElements, p as variantScope, r as variantStartingStyle, s as variantTaggedPseudoClasses, t as variants, u as variantCssLayer, v as variantContrasts, w as variantPrint, x as variantMotions, y as variantCustomMedia } from "./variants-BqQ8LqhD.mjs";
1
+ import { A as variantColorsMediaOrClass, C as variantOrientations, D as variantLanguageDirections, E as variantImportant, F as variantChildren, I as variantBreakpoints, L as variantAria, M as variantContainerQuery, N as variantCombinators, O as variantDataAttribute, P as variantSvgCombinators, R as variantTaggedAriaAttributes, S as variantNoscript, T as variantScripting, _ as variantVariables, a as variantPseudoClassFunctions, b as variantForcedColors, c as placeholderModifier, d as variantImplicitGroup, f as variantInternalLayer, g as variantTheme, h as variantStickyHover, i as variantPartClasses, j as variantColorsScheme, k as variantTaggedDataAttributes, l as variantNegative, m as variantSelector, n as variantSupports, o as variantPseudoClassesAndElements, p as variantScope, r as variantStartingStyle, s as variantTaggedPseudoClasses, t as variants, u as variantCssLayer, v as variantContrasts, w as variantPrint, x as variantMotions, y as variantCustomMedia } from "./variants-Dae_1bdw.mjs";
2
2
 
3
3
  export { placeholderModifier, variantAria, variantBreakpoints, variantChildren, variantColorsMediaOrClass, variantColorsScheme, variantCombinators, variantContainerQuery, variantContrasts, variantCssLayer, variantCustomMedia, variantDataAttribute, variantForcedColors, variantImplicitGroup, variantImportant, variantInternalLayer, variantLanguageDirections, variantMotions, variantNegative, variantNoscript, variantOrientations, variantPartClasses, variantPrint, variantPseudoClassFunctions, variantPseudoClassesAndElements, variantScope, variantScripting, variantSelector, variantStartingStyle, variantStickyHover, variantSupports, variantSvgCombinators, variantTaggedAriaAttributes, variantTaggedDataAttributes, variantTaggedPseudoClasses, variantTheme, variantVariables, variants };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unocss/preset-wind4",
3
3
  "type": "module",
4
- "version": "66.6.2",
4
+ "version": "66.6.4-beta.1",
5
5
  "description": "Tailwind 4 compact preset for UnoCSS",
6
6
  "authors": [
7
7
  {
@@ -54,9 +54,9 @@
54
54
  "dist"
55
55
  ],
56
56
  "dependencies": {
57
- "@unocss/core": "66.6.2",
58
- "@unocss/extractor-arbitrary-variants": "66.6.2",
59
- "@unocss/rule-utils": "66.6.2"
57
+ "@unocss/core": "66.6.4-beta.1",
58
+ "@unocss/extractor-arbitrary-variants": "66.6.4-beta.1",
59
+ "@unocss/rule-utils": "66.6.4-beta.1"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "tsdown --config-loader unrun",