tailwindcss-patch 9.2.1 → 9.3.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.
- package/dist/cli.js +2 -2
- package/dist/cli.mjs +2 -2
- package/dist/commands/cli-runtime.d.mts +1 -1
- package/dist/commands/cli-runtime.d.ts +1 -1
- package/dist/commands/cli-runtime.js +1 -1
- package/dist/commands/cli-runtime.mjs +1 -1
- package/dist/{index.bundle-Dnh0a6WS.mjs → index.bundle-BKRsKEHP.mjs} +4 -3
- package/dist/{index.bundle-BkqJb7rw.js → index.bundle-Y1jzXpYx.js} +4 -3
- package/dist/index.d.mts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{validate-Bo-Ua7Kg.js → validate-Bd1fbQsd.js} +271 -10
- package/dist/{validate-Bu_rkfQF.d.ts → validate-Bqych-z9.d.ts} +17 -1
- package/dist/{validate-CIMnzW8O.d.mts → validate-C8-qsOWo.d.mts} +17 -1
- package/dist/{validate-CceFRP7h.mjs → validate-CVInpab6.mjs} +261 -12
- package/package.json +8 -8
- package/src/extraction/candidate-extractor.ts +30 -4
- package/src/options/normalize.ts +5 -0
- package/src/options/types.ts +8 -0
- package/src/runtime/class-collector.ts +2 -0
- package/src/v4/bare-arbitrary-values.ts +326 -0
- package/src/v4/candidates.ts +68 -4
- package/src/v4/engine.ts +15 -3
- package/src/v4/types.ts +6 -0
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
2
|
-
const require_validate = require("./validate-
|
|
3
|
-
const require_index_bundle = require("./index.bundle-
|
|
2
|
+
const require_validate = require("./validate-Bd1fbQsd.js");
|
|
3
|
+
const require_index_bundle = require("./index.bundle-Y1jzXpYx.js");
|
|
4
4
|
let node_process = require("node:process");
|
|
5
5
|
node_process = require_chunk.__toESM(node_process);
|
|
6
6
|
//#region src/cli.bundle.ts
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as createTailwindcssPatchCli } from "./index.bundle-
|
|
1
|
+
import { j as logger, r as ValidateCommandError } from "./validate-CVInpab6.mjs";
|
|
2
|
+
import { t as createTailwindcssPatchCli } from "./index.bundle-BKRsKEHP.mjs";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
//#region src/cli.bundle.ts
|
|
5
5
|
async function main() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ValidateFailureSummary, c as TailwindcssPatchCliMountOptions, d as TailwindcssPatchCommandContext, f as TailwindcssPatchCommandHandler, g as tailwindcssPatchCommands, h as TailwindcssPatchCommandOptions, i as ValidateFailureReason, l as TailwindcssPatchCliOptions, m as TailwindcssPatchCommandOptionDefinition, n as VALIDATE_FAILURE_REASONS, o as ValidateJsonFailurePayload, p as TailwindcssPatchCommandHandlerMap, r as ValidateCommandError, s as ValidateJsonSuccessPayload, t as VALIDATE_EXIT_CODES, u as TailwindcssPatchCommand } from "../validate-
|
|
1
|
+
import { a as ValidateFailureSummary, c as TailwindcssPatchCliMountOptions, d as TailwindcssPatchCommandContext, f as TailwindcssPatchCommandHandler, g as tailwindcssPatchCommands, h as TailwindcssPatchCommandOptions, i as ValidateFailureReason, l as TailwindcssPatchCliOptions, m as TailwindcssPatchCommandOptionDefinition, n as VALIDATE_FAILURE_REASONS, o as ValidateJsonFailurePayload, p as TailwindcssPatchCommandHandlerMap, r as ValidateCommandError, s as ValidateJsonSuccessPayload, t as VALIDATE_EXIT_CODES, u as TailwindcssPatchCommand } from "../validate-C8-qsOWo.mjs";
|
|
2
2
|
import { CAC } from "cac";
|
|
3
3
|
|
|
4
4
|
//#region src/commands/cli.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ValidateFailureSummary, c as TailwindcssPatchCliMountOptions, d as TailwindcssPatchCommandContext, f as TailwindcssPatchCommandHandler, g as tailwindcssPatchCommands, h as TailwindcssPatchCommandOptions, i as ValidateFailureReason, l as TailwindcssPatchCliOptions, m as TailwindcssPatchCommandOptionDefinition, n as VALIDATE_FAILURE_REASONS, o as ValidateJsonFailurePayload, p as TailwindcssPatchCommandHandlerMap, r as ValidateCommandError, s as ValidateJsonSuccessPayload, t as VALIDATE_EXIT_CODES, u as TailwindcssPatchCommand } from "../validate-
|
|
1
|
+
import { a as ValidateFailureSummary, c as TailwindcssPatchCliMountOptions, d as TailwindcssPatchCommandContext, f as TailwindcssPatchCommandHandler, g as tailwindcssPatchCommands, h as TailwindcssPatchCommandOptions, i as ValidateFailureReason, l as TailwindcssPatchCliOptions, m as TailwindcssPatchCommandOptionDefinition, n as VALIDATE_FAILURE_REASONS, o as ValidateJsonFailurePayload, p as TailwindcssPatchCommandHandlerMap, r as ValidateCommandError, s as ValidateJsonSuccessPayload, t as VALIDATE_EXIT_CODES, u as TailwindcssPatchCommand } from "../validate-Bqych-z9.js";
|
|
2
2
|
import { CAC } from "cac";
|
|
3
3
|
|
|
4
4
|
//#region src/commands/cli.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("../chunk-8l464Juk.js");
|
|
3
|
-
const require_validate = require("../validate-
|
|
3
|
+
const require_validate = require("../validate-Bd1fbQsd.js");
|
|
4
4
|
let node_process = require("node:process");
|
|
5
5
|
node_process = require_chunk.__toESM(node_process);
|
|
6
6
|
let fs_extra = require("fs-extra");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as loadPatchOptionsForWorkspace, O as loadWorkspaceConfigModule, a as tailwindcssPatchCommands, b as groupTokensByFile, i as classifyValidateError, j as logger, n as VALIDATE_FAILURE_REASONS, o as migrateConfigFiles, r as ValidateCommandError, s as restoreConfigFiles, t as VALIDATE_EXIT_CODES, u as TailwindcssPatcher } from "../validate-CVInpab6.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import fs from "fs-extra";
|
|
4
4
|
import path from "pathe";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as canonicalizeBareArbitraryValueCandidates, E as resolveValidTailwindV4Candidates, S as loadTailwindV4DesignSystem, T as replaceBareArbitraryValueSelectors, _ as extractRawCandidates, k as normalizeOptions, v as extractRawCandidatesWithPositions, w as extractTailwindV4InlineSourceCandidates, x as compileTailwindV4Source } from "./validate-CVInpab6.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import path from "pathe";
|
|
@@ -35,11 +35,12 @@ function createTailwindV4Engine(source) {
|
|
|
35
35
|
async generate(options) {
|
|
36
36
|
const { compiled, dependencies } = await compileTailwindV4Source(source);
|
|
37
37
|
const rawCandidates = await collectRawCandidates(source, options, compiled.sources);
|
|
38
|
-
const classSet = resolveValidTailwindV4Candidates(await loadTailwindV4DesignSystem(source), rawCandidates);
|
|
38
|
+
const classSet = resolveValidTailwindV4Candidates(await loadTailwindV4DesignSystem(source), rawCandidates, { ...options?.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: options.bareArbitraryValues } });
|
|
39
39
|
const inlineSources = extractTailwindV4InlineSourceCandidates(source.css);
|
|
40
40
|
for (const candidate of inlineSources.excluded) classSet.delete(candidate);
|
|
41
|
+
const buildCandidates = canonicalizeBareArbitraryValueCandidates(classSet, options?.bareArbitraryValues);
|
|
41
42
|
return {
|
|
42
|
-
css: compiled.build(
|
|
43
|
+
css: replaceBareArbitraryValueSelectors(compiled.build(buildCandidates), classSet, options?.bareArbitraryValues),
|
|
43
44
|
classSet,
|
|
44
45
|
rawCandidates,
|
|
45
46
|
dependencies: Array.from(dependencies),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
2
|
-
const require_validate = require("./validate-
|
|
2
|
+
const require_validate = require("./validate-Bd1fbQsd.js");
|
|
3
3
|
let node_module = require("node:module");
|
|
4
4
|
let node_process = require("node:process");
|
|
5
5
|
node_process = require_chunk.__toESM(node_process);
|
|
@@ -38,11 +38,12 @@ function createTailwindV4Engine(source) {
|
|
|
38
38
|
async generate(options) {
|
|
39
39
|
const { compiled, dependencies } = await require_validate.compileTailwindV4Source(source);
|
|
40
40
|
const rawCandidates = await collectRawCandidates(source, options, compiled.sources);
|
|
41
|
-
const classSet = require_validate.resolveValidTailwindV4Candidates(await require_validate.loadTailwindV4DesignSystem(source), rawCandidates);
|
|
41
|
+
const classSet = require_validate.resolveValidTailwindV4Candidates(await require_validate.loadTailwindV4DesignSystem(source), rawCandidates, { ...options?.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: options.bareArbitraryValues } });
|
|
42
42
|
const inlineSources = require_validate.extractTailwindV4InlineSourceCandidates(source.css);
|
|
43
43
|
for (const candidate of inlineSources.excluded) classSet.delete(candidate);
|
|
44
|
+
const buildCandidates = require_validate.canonicalizeBareArbitraryValueCandidates(classSet, options?.bareArbitraryValues);
|
|
44
45
|
return {
|
|
45
|
-
css: compiled.build(
|
|
46
|
+
css: require_validate.replaceBareArbitraryValueSelectors(compiled.build(buildCandidates), classSet, options?.bareArbitraryValues),
|
|
46
47
|
classSet,
|
|
47
48
|
rawCandidates,
|
|
48
49
|
dependencies: Array.from(dependencies),
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as TailwindTokenByFileMap, A as groupTokensByFile, B as NormalizedTailwindCssPatchOptions, C as MIGRATION_REPORT_SCHEMA_VERSION, D as extractRawCandidates, E as extractProjectCandidatesWithPositions, F as CacheStrategy, G as TailwindV4Options, H as TailwindCssPatchOptions, I as ExposeContextOptions, J as PatchCheckStatus, K as ExtractResult, L as ExtendLengthUnitsOptions, M as normalizeOptions, N as ApplyOptions, O as extractRawCandidatesWithPositions, P as CacheOptions, Q as TailwindPatchRuntime, R as ExtractOptions, S as MIGRATION_REPORT_KIND, T as TailwindcssPatcher, U as TailwindV2Options, V as TailwindCssOptions, W as TailwindV3Options, X as PatchStatusEntry, Y as PatchName, Z as PatchStatusReport, _ as ConfigFileMigrationEntry, a as ValidateFailureSummary, at as CacheClearOptions, b as RestoreConfigFilesOptions, c as TailwindcssPatchCliMountOptions, ct as CacheContextDescriptor, d as TailwindcssPatchCommandContext, dt as CacheReadMeta, et as TailwindTokenFileKey, f as TailwindcssPatchCommandHandler, ft as CacheReadResult, g as tailwindcssPatchCommands, h as TailwindcssPatchCommandOptions, i as ValidateFailureReason, it as TailwindcssRuntimeContext, j as BareArbitraryValueOptions, k as extractValidCandidates, l as TailwindcssPatchCliOptions, lt as CacheContextMetadata, m as TailwindcssPatchCommandOptionDefinition, n as VALIDATE_FAILURE_REASONS, nt as TailwindTokenReport, o as ValidateJsonFailurePayload, ot as CacheClearResult, p as TailwindcssPatchCommandHandlerMap, q as ILengthUnitsPatchOptions, r as ValidateCommandError, rt as TailwindcssClassCache, s as ValidateJsonSuccessPayload, st as CacheClearScope, t as VALIDATE_EXIT_CODES, tt as TailwindTokenLocation, u as TailwindcssPatchCommand, ut as CacheIndexFileV2, v as ConfigFileMigrationReport, w as logger, x as RestoreConfigFilesResult, y as MigrateConfigFilesOptions, z as NormalizedCacheOptions } from "./validate-C8-qsOWo.mjs";
|
|
2
2
|
import { PackageInfo } from "local-pkg";
|
|
3
3
|
import postcss from "postcss";
|
|
4
4
|
import { CAC } from "cac";
|
|
@@ -101,6 +101,12 @@ interface TailwindV4CandidateSource {
|
|
|
101
101
|
interface TailwindV4GenerateOptions {
|
|
102
102
|
candidates?: Iterable<string>;
|
|
103
103
|
sources?: TailwindV4CandidateSource[];
|
|
104
|
+
/**
|
|
105
|
+
* Enables UnoCSS-style bare arbitrary values such as `p-10%` and `p-2.5px`.
|
|
106
|
+
*/
|
|
107
|
+
bareArbitraryValues?: boolean | {
|
|
108
|
+
units?: string[];
|
|
109
|
+
};
|
|
104
110
|
/**
|
|
105
111
|
* 扫描文件系统 source entries 中的候选类名。
|
|
106
112
|
*
|
|
@@ -137,7 +143,9 @@ interface TailwindV4Engine {
|
|
|
137
143
|
}
|
|
138
144
|
//#endregion
|
|
139
145
|
//#region src/v4/candidates.d.ts
|
|
140
|
-
declare function resolveValidTailwindV4Candidates(designSystem: TailwindV4DesignSystem, candidates: Iterable<string
|
|
146
|
+
declare function resolveValidTailwindV4Candidates(designSystem: TailwindV4DesignSystem, candidates: Iterable<string>, options?: {
|
|
147
|
+
bareArbitraryValues?: boolean | BareArbitraryValueOptions;
|
|
148
|
+
}): Set<string>;
|
|
141
149
|
//#endregion
|
|
142
150
|
//#region src/v4/engine.d.ts
|
|
143
151
|
declare function createTailwindV4Engine(source: TailwindV4ResolvedSource): TailwindV4Engine;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as TailwindTokenByFileMap, A as groupTokensByFile, B as NormalizedTailwindCssPatchOptions, C as MIGRATION_REPORT_SCHEMA_VERSION, D as extractRawCandidates, E as extractProjectCandidatesWithPositions, F as CacheStrategy, G as TailwindV4Options, H as TailwindCssPatchOptions, I as ExposeContextOptions, J as PatchCheckStatus, K as ExtractResult, L as ExtendLengthUnitsOptions, M as normalizeOptions, N as ApplyOptions, O as extractRawCandidatesWithPositions, P as CacheOptions, Q as TailwindPatchRuntime, R as ExtractOptions, S as MIGRATION_REPORT_KIND, T as TailwindcssPatcher, U as TailwindV2Options, V as TailwindCssOptions, W as TailwindV3Options, X as PatchStatusEntry, Y as PatchName, Z as PatchStatusReport, _ as ConfigFileMigrationEntry, a as ValidateFailureSummary, at as CacheClearOptions, b as RestoreConfigFilesOptions, c as TailwindcssPatchCliMountOptions, ct as CacheContextDescriptor, d as TailwindcssPatchCommandContext, dt as CacheReadMeta, et as TailwindTokenFileKey, f as TailwindcssPatchCommandHandler, ft as CacheReadResult, g as tailwindcssPatchCommands, h as TailwindcssPatchCommandOptions, i as ValidateFailureReason, it as TailwindcssRuntimeContext, j as BareArbitraryValueOptions, k as extractValidCandidates, l as TailwindcssPatchCliOptions, lt as CacheContextMetadata, m as TailwindcssPatchCommandOptionDefinition, n as VALIDATE_FAILURE_REASONS, nt as TailwindTokenReport, o as ValidateJsonFailurePayload, ot as CacheClearResult, p as TailwindcssPatchCommandHandlerMap, q as ILengthUnitsPatchOptions, r as ValidateCommandError, rt as TailwindcssClassCache, s as ValidateJsonSuccessPayload, st as CacheClearScope, t as VALIDATE_EXIT_CODES, tt as TailwindTokenLocation, u as TailwindcssPatchCommand, ut as CacheIndexFileV2, v as ConfigFileMigrationReport, w as logger, x as RestoreConfigFilesResult, y as MigrateConfigFilesOptions, z as NormalizedCacheOptions } from "./validate-Bqych-z9.js";
|
|
2
2
|
import { CAC } from "cac";
|
|
3
3
|
import { PackageInfo } from "local-pkg";
|
|
4
4
|
import postcss from "postcss";
|
|
@@ -101,6 +101,12 @@ interface TailwindV4CandidateSource {
|
|
|
101
101
|
interface TailwindV4GenerateOptions {
|
|
102
102
|
candidates?: Iterable<string>;
|
|
103
103
|
sources?: TailwindV4CandidateSource[];
|
|
104
|
+
/**
|
|
105
|
+
* Enables UnoCSS-style bare arbitrary values such as `p-10%` and `p-2.5px`.
|
|
106
|
+
*/
|
|
107
|
+
bareArbitraryValues?: boolean | {
|
|
108
|
+
units?: string[];
|
|
109
|
+
};
|
|
104
110
|
/**
|
|
105
111
|
* 扫描文件系统 source entries 中的候选类名。
|
|
106
112
|
*
|
|
@@ -137,7 +143,9 @@ interface TailwindV4Engine {
|
|
|
137
143
|
}
|
|
138
144
|
//#endregion
|
|
139
145
|
//#region src/v4/candidates.d.ts
|
|
140
|
-
declare function resolveValidTailwindV4Candidates(designSystem: TailwindV4DesignSystem, candidates: Iterable<string
|
|
146
|
+
declare function resolveValidTailwindV4Candidates(designSystem: TailwindV4DesignSystem, candidates: Iterable<string>, options?: {
|
|
147
|
+
bareArbitraryValues?: boolean | BareArbitraryValueOptions;
|
|
148
|
+
}): Set<string>;
|
|
141
149
|
//#endregion
|
|
142
150
|
//#region src/v4/engine.d.ts
|
|
143
151
|
declare function createTailwindV4Engine(source: TailwindV4ResolvedSource): TailwindV4Engine;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_validate = require("./validate-
|
|
3
|
-
const require_index_bundle = require("./index.bundle-
|
|
2
|
+
const require_validate = require("./validate-Bd1fbQsd.js");
|
|
3
|
+
const require_index_bundle = require("./index.bundle-Y1jzXpYx.js");
|
|
4
4
|
exports.CacheStore = require_validate.CacheStore;
|
|
5
5
|
exports.MIGRATION_REPORT_KIND = require_validate.MIGRATION_REPORT_KIND;
|
|
6
6
|
exports.MIGRATION_REPORT_SCHEMA_VERSION = require_validate.MIGRATION_REPORT_SCHEMA_VERSION;
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as resolveTailwindV4SourceFromPatchOptions, i as resolveTailwindV4Source, n as defineConfig, o as createTailwindV4Engine, r as mountTailwindcssPatchCommands, t as createTailwindcssPatchCli } from "./index.bundle-
|
|
1
|
+
import { A as CacheStore, E as resolveValidTailwindV4Candidates, S as loadTailwindV4DesignSystem, _ as extractRawCandidates, a as tailwindcssPatchCommands, b as groupTokensByFile, c as MIGRATION_REPORT_KIND, d as getPatchStatusReport, f as runTailwindBuild, g as extractProjectCandidatesWithPositions, h as collectClassesFromTailwindV4, j as logger, k as normalizeOptions, l as MIGRATION_REPORT_SCHEMA_VERSION, m as collectClassesFromContexts, n as VALIDATE_FAILURE_REASONS, o as migrateConfigFiles, p as loadRuntimeContexts, r as ValidateCommandError, s as restoreConfigFiles, t as VALIDATE_EXIT_CODES, u as TailwindcssPatcher, v as extractRawCandidatesWithPositions, y as extractValidCandidates } from "./validate-CVInpab6.mjs";
|
|
2
|
+
import { a as resolveTailwindV4SourceFromPatchOptions, i as resolveTailwindV4Source, n as defineConfig, o as createTailwindV4Engine, r as mountTailwindcssPatchCommands, t as createTailwindcssPatchCli } from "./index.bundle-BKRsKEHP.mjs";
|
|
3
3
|
export { CacheStore, MIGRATION_REPORT_KIND, MIGRATION_REPORT_SCHEMA_VERSION, TailwindcssPatcher, VALIDATE_EXIT_CODES, VALIDATE_FAILURE_REASONS, ValidateCommandError, collectClassesFromContexts, collectClassesFromTailwindV4, createTailwindV4Engine, createTailwindcssPatchCli, defineConfig, extractProjectCandidatesWithPositions, extractRawCandidates, extractRawCandidatesWithPositions, extractValidCandidates, getPatchStatusReport, groupTokensByFile, loadRuntimeContexts, loadTailwindV4DesignSystem, logger, migrateConfigFiles, mountTailwindcssPatchCommands, normalizeOptions, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions, resolveValidTailwindV4Candidates, restoreConfigFiles, runTailwindBuild, tailwindcssPatchCommands };
|
|
@@ -23,7 +23,7 @@ _babel_traverse = require_chunk.__toESM(_babel_traverse);
|
|
|
23
23
|
let _babel_parser = require("@babel/parser");
|
|
24
24
|
let tailwindcss_config = require("tailwindcss-config");
|
|
25
25
|
//#region package.json
|
|
26
|
-
var version = "9.
|
|
26
|
+
var version = "9.3.1";
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region src/constants.ts
|
|
29
29
|
const pkgName = "tailwindcss-patch";
|
|
@@ -184,6 +184,8 @@ function cloneEntry(entry) {
|
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
186
|
var CacheStore = class {
|
|
187
|
+
options;
|
|
188
|
+
context;
|
|
187
189
|
driver;
|
|
188
190
|
lockPath;
|
|
189
191
|
memoryCache = null;
|
|
@@ -1342,7 +1344,8 @@ function normalizeTailwindV4Options(v4, fallbackBase) {
|
|
|
1342
1344
|
...v4?.css === void 0 ? {} : { css: v4.css },
|
|
1343
1345
|
cssEntries,
|
|
1344
1346
|
sources,
|
|
1345
|
-
hasUserDefinedSources
|
|
1347
|
+
hasUserDefinedSources,
|
|
1348
|
+
bareArbitraryValues: v4?.bareArbitraryValues === true ? {} : typeof v4?.bareArbitraryValues === "object" && v4.bareArbitraryValues !== null ? { ...v4.bareArbitraryValues } : false
|
|
1346
1349
|
};
|
|
1347
1350
|
}
|
|
1348
1351
|
function normalizeTailwindOptions(tailwind, projectRoot, shouldDefaultResolveFromCwd) {
|
|
@@ -1447,23 +1450,257 @@ async function loadPatchOptionsForWorkspace(cwd, overrides) {
|
|
|
1447
1450
|
return merge(overrides ?? {}, base, { projectRoot: cwd });
|
|
1448
1451
|
}
|
|
1449
1452
|
//#endregion
|
|
1453
|
+
//#region src/v4/bare-arbitrary-values.ts
|
|
1454
|
+
const DEFAULT_BARE_ARBITRARY_VALUE_UNITS = [
|
|
1455
|
+
"%",
|
|
1456
|
+
"px",
|
|
1457
|
+
"rpx",
|
|
1458
|
+
"rem",
|
|
1459
|
+
"em",
|
|
1460
|
+
"vw",
|
|
1461
|
+
"vh",
|
|
1462
|
+
"vmin",
|
|
1463
|
+
"vmax",
|
|
1464
|
+
"dvw",
|
|
1465
|
+
"dvh",
|
|
1466
|
+
"svw",
|
|
1467
|
+
"svh",
|
|
1468
|
+
"lvw",
|
|
1469
|
+
"lvh",
|
|
1470
|
+
"ch",
|
|
1471
|
+
"ex",
|
|
1472
|
+
"lh",
|
|
1473
|
+
"rlh",
|
|
1474
|
+
"fr",
|
|
1475
|
+
"deg",
|
|
1476
|
+
"rad",
|
|
1477
|
+
"turn",
|
|
1478
|
+
"s",
|
|
1479
|
+
"ms"
|
|
1480
|
+
];
|
|
1481
|
+
const NUMBER_RE = /^-?(?:\d+|\d*\.\d+)$/;
|
|
1482
|
+
const FUNCTION_VALUE_RE = /^[a-zA-Z_-][a-zA-Z0-9_-]*\(/;
|
|
1483
|
+
function splitVariantPrefix(candidate) {
|
|
1484
|
+
let depth = 0;
|
|
1485
|
+
let quote;
|
|
1486
|
+
let lastSeparator = -1;
|
|
1487
|
+
for (let index = 0; index < candidate.length; index++) {
|
|
1488
|
+
const character = candidate[index];
|
|
1489
|
+
if (character === "\\") {
|
|
1490
|
+
index++;
|
|
1491
|
+
continue;
|
|
1492
|
+
}
|
|
1493
|
+
if (quote) {
|
|
1494
|
+
if (character === quote) quote = void 0;
|
|
1495
|
+
continue;
|
|
1496
|
+
}
|
|
1497
|
+
if (character === "\"" || character === "'") {
|
|
1498
|
+
quote = character;
|
|
1499
|
+
continue;
|
|
1500
|
+
}
|
|
1501
|
+
if (character === "[" || character === "(" || character === "{") {
|
|
1502
|
+
depth++;
|
|
1503
|
+
continue;
|
|
1504
|
+
}
|
|
1505
|
+
if (character === "]" || character === ")" || character === "}") {
|
|
1506
|
+
depth = Math.max(0, depth - 1);
|
|
1507
|
+
continue;
|
|
1508
|
+
}
|
|
1509
|
+
if (depth === 0 && character === ":") lastSeparator = index;
|
|
1510
|
+
}
|
|
1511
|
+
if (lastSeparator === -1) return {
|
|
1512
|
+
prefix: "",
|
|
1513
|
+
body: candidate
|
|
1514
|
+
};
|
|
1515
|
+
return {
|
|
1516
|
+
prefix: candidate.slice(0, lastSeparator + 1),
|
|
1517
|
+
body: candidate.slice(lastSeparator + 1)
|
|
1518
|
+
};
|
|
1519
|
+
}
|
|
1520
|
+
function isBalancedFunctionValue(value) {
|
|
1521
|
+
let depth = 0;
|
|
1522
|
+
let quote;
|
|
1523
|
+
for (let index = 0; index < value.length; index++) {
|
|
1524
|
+
const character = value[index];
|
|
1525
|
+
if (character === "\\") {
|
|
1526
|
+
index++;
|
|
1527
|
+
continue;
|
|
1528
|
+
}
|
|
1529
|
+
if (quote) {
|
|
1530
|
+
if (character === quote) quote = void 0;
|
|
1531
|
+
continue;
|
|
1532
|
+
}
|
|
1533
|
+
if (character === "\"" || character === "'") {
|
|
1534
|
+
quote = character;
|
|
1535
|
+
continue;
|
|
1536
|
+
}
|
|
1537
|
+
if (character === "(") {
|
|
1538
|
+
depth++;
|
|
1539
|
+
continue;
|
|
1540
|
+
}
|
|
1541
|
+
if (character === ")") {
|
|
1542
|
+
depth--;
|
|
1543
|
+
if (depth < 0) return false;
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
return depth === 0 && quote === void 0;
|
|
1547
|
+
}
|
|
1548
|
+
function isHexColorValue(value) {
|
|
1549
|
+
return /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6,8})$/.test(value);
|
|
1550
|
+
}
|
|
1551
|
+
function isQuotedValue(value) {
|
|
1552
|
+
const quote = value[0];
|
|
1553
|
+
if (quote !== "\"" && quote !== "'" || value[value.length - 1] !== quote) return false;
|
|
1554
|
+
let escaped = false;
|
|
1555
|
+
for (let index = 1; index < value.length - 1; index++) {
|
|
1556
|
+
const character = value[index];
|
|
1557
|
+
if (escaped) {
|
|
1558
|
+
escaped = false;
|
|
1559
|
+
continue;
|
|
1560
|
+
}
|
|
1561
|
+
if (character === "\\") escaped = true;
|
|
1562
|
+
}
|
|
1563
|
+
return !escaped;
|
|
1564
|
+
}
|
|
1565
|
+
function normalizeBareArbitraryValueOptions(options) {
|
|
1566
|
+
if (options === false || options === void 0 || options === null) return;
|
|
1567
|
+
const units = options === true ? DEFAULT_BARE_ARBITRARY_VALUE_UNITS : options.units ?? DEFAULT_BARE_ARBITRARY_VALUE_UNITS;
|
|
1568
|
+
const normalizedUnits = [...new Set(units.filter((unit) => typeof unit === "string" && unit.length > 0))];
|
|
1569
|
+
if (normalizedUnits.length === 0) return;
|
|
1570
|
+
return { units: normalizedUnits.sort((a, b) => b.length - a.length) };
|
|
1571
|
+
}
|
|
1572
|
+
function resolveValueWithUnit(body, units) {
|
|
1573
|
+
for (const unit of units) {
|
|
1574
|
+
if (!body.endsWith(unit)) continue;
|
|
1575
|
+
const numberPart = body.slice(0, -unit.length);
|
|
1576
|
+
if (NUMBER_RE.test(numberPart)) return `${numberPart}${unit}`;
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
function resolveArbitraryValue(body, units) {
|
|
1580
|
+
const withUnit = resolveValueWithUnit(body, units);
|
|
1581
|
+
if (withUnit) return withUnit;
|
|
1582
|
+
if (isHexColorValue(body)) return body;
|
|
1583
|
+
if (isQuotedValue(body)) return body;
|
|
1584
|
+
if (FUNCTION_VALUE_RE.test(body) && body.endsWith(")") && isBalancedFunctionValue(body)) return body;
|
|
1585
|
+
}
|
|
1586
|
+
function resolveUtilityAndValue(body, units) {
|
|
1587
|
+
let depth = 0;
|
|
1588
|
+
let quote;
|
|
1589
|
+
for (let index = 1; index < body.length; index++) {
|
|
1590
|
+
const character = body[index];
|
|
1591
|
+
if (character === "\\") {
|
|
1592
|
+
index++;
|
|
1593
|
+
continue;
|
|
1594
|
+
}
|
|
1595
|
+
if (quote) {
|
|
1596
|
+
if (character === quote) quote = void 0;
|
|
1597
|
+
continue;
|
|
1598
|
+
}
|
|
1599
|
+
if (character === "\"" || character === "'") {
|
|
1600
|
+
quote = character;
|
|
1601
|
+
continue;
|
|
1602
|
+
}
|
|
1603
|
+
if (character === "(" || character === "{") {
|
|
1604
|
+
depth++;
|
|
1605
|
+
continue;
|
|
1606
|
+
}
|
|
1607
|
+
if (character === ")" || character === "}") {
|
|
1608
|
+
depth = Math.max(0, depth - 1);
|
|
1609
|
+
continue;
|
|
1610
|
+
}
|
|
1611
|
+
if (depth > 0 || character !== "-") continue;
|
|
1612
|
+
const utility = body.slice(0, index);
|
|
1613
|
+
const rawValue = body.slice(index + 1);
|
|
1614
|
+
if (!utility || !rawValue) continue;
|
|
1615
|
+
const value = resolveArbitraryValue(rawValue, units);
|
|
1616
|
+
if (value) return {
|
|
1617
|
+
utility,
|
|
1618
|
+
value
|
|
1619
|
+
};
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
function resolveBareArbitraryValueCandidate(candidate, options) {
|
|
1623
|
+
const normalizedOptions = normalizeBareArbitraryValueOptions(options);
|
|
1624
|
+
if (!normalizedOptions || !candidate || candidate.includes("[") || candidate.includes("]")) return;
|
|
1625
|
+
const { prefix, body } = splitVariantPrefix(candidate);
|
|
1626
|
+
const important = body.startsWith("!") ? "!" : "";
|
|
1627
|
+
let normalizedBody = important ? body.slice(1) : body;
|
|
1628
|
+
const negative = normalizedBody.startsWith("-") ? "-" : "";
|
|
1629
|
+
if (negative) normalizedBody = normalizedBody.slice(1);
|
|
1630
|
+
const resolved = resolveUtilityAndValue(normalizedBody, normalizedOptions.units);
|
|
1631
|
+
if (!resolved) return;
|
|
1632
|
+
return {
|
|
1633
|
+
candidate,
|
|
1634
|
+
canonicalCandidate: `${prefix}${important}${negative}${resolved.utility}-[${resolved.value}]`
|
|
1635
|
+
};
|
|
1636
|
+
}
|
|
1637
|
+
function escapeCssClassName(value) {
|
|
1638
|
+
let result = "";
|
|
1639
|
+
for (let index = 0; index < value.length; index++) {
|
|
1640
|
+
const codeUnit = value.charCodeAt(index);
|
|
1641
|
+
const character = value.charAt(index);
|
|
1642
|
+
if (codeUnit === 0) {
|
|
1643
|
+
result += "�";
|
|
1644
|
+
continue;
|
|
1645
|
+
}
|
|
1646
|
+
if (codeUnit >= 1 && codeUnit <= 31 || codeUnit === 127 || index === 0 && codeUnit >= 48 && codeUnit <= 57 || index === 1 && codeUnit >= 48 && codeUnit <= 57 && value.charCodeAt(0) === 45) {
|
|
1647
|
+
result += `\\${codeUnit.toString(16)} `;
|
|
1648
|
+
continue;
|
|
1649
|
+
}
|
|
1650
|
+
if (codeUnit >= 128 || codeUnit === 45 || codeUnit === 95 || codeUnit >= 48 && codeUnit <= 57 || codeUnit >= 65 && codeUnit <= 90 || codeUnit >= 97 && codeUnit <= 122) {
|
|
1651
|
+
result += character;
|
|
1652
|
+
continue;
|
|
1653
|
+
}
|
|
1654
|
+
result += `\\${character}`;
|
|
1655
|
+
}
|
|
1656
|
+
return result;
|
|
1657
|
+
}
|
|
1658
|
+
//#endregion
|
|
1450
1659
|
//#region src/v4/candidates.ts
|
|
1451
|
-
function resolveValidTailwindV4Candidates(designSystem, candidates) {
|
|
1660
|
+
function resolveValidTailwindV4Candidates(designSystem, candidates, options) {
|
|
1452
1661
|
const validCandidates = /* @__PURE__ */ new Set();
|
|
1453
1662
|
const parsedCandidates = [];
|
|
1663
|
+
const originalCandidateByCanonical = /* @__PURE__ */ new Map();
|
|
1454
1664
|
for (const candidate of candidates) {
|
|
1455
|
-
if (!candidate
|
|
1456
|
-
|
|
1665
|
+
if (!candidate) continue;
|
|
1666
|
+
const bareArbitrary = resolveBareArbitraryValueCandidate(candidate, options?.bareArbitraryValues);
|
|
1667
|
+
const candidateToCheck = bareArbitrary?.canonicalCandidate ?? candidate;
|
|
1668
|
+
if (parsedCandidates.includes(candidateToCheck)) continue;
|
|
1669
|
+
if (designSystem.parseCandidate(candidateToCheck).length > 0) {
|
|
1670
|
+
parsedCandidates.push(candidateToCheck);
|
|
1671
|
+
if (bareArbitrary) originalCandidateByCanonical.set(candidateToCheck, candidate);
|
|
1672
|
+
}
|
|
1457
1673
|
}
|
|
1458
1674
|
if (parsedCandidates.length === 0) return validCandidates;
|
|
1459
1675
|
const cssByCandidate = designSystem.candidatesToCss(parsedCandidates);
|
|
1460
1676
|
for (let index = 0; index < parsedCandidates.length; index++) {
|
|
1461
1677
|
const candidate = parsedCandidates[index];
|
|
1462
1678
|
const candidateCss = cssByCandidate[index];
|
|
1463
|
-
if (candidate && typeof candidateCss === "string" && candidateCss.trim().length > 0) validCandidates.add(candidate);
|
|
1679
|
+
if (candidate && typeof candidateCss === "string" && candidateCss.trim().length > 0) validCandidates.add(originalCandidateByCanonical.get(candidate) ?? candidate);
|
|
1464
1680
|
}
|
|
1465
1681
|
return validCandidates;
|
|
1466
1682
|
}
|
|
1683
|
+
function createSelectorAliasMap(candidates, options) {
|
|
1684
|
+
const aliases = /* @__PURE__ */ new Map();
|
|
1685
|
+
for (const candidate of candidates) {
|
|
1686
|
+
const bareArbitrary = resolveBareArbitraryValueCandidate(candidate, options);
|
|
1687
|
+
if (!bareArbitrary) continue;
|
|
1688
|
+
aliases.set(escapeCssClassName(bareArbitrary.canonicalCandidate), escapeCssClassName(bareArbitrary.candidate));
|
|
1689
|
+
}
|
|
1690
|
+
return aliases;
|
|
1691
|
+
}
|
|
1692
|
+
function replaceBareArbitraryValueSelectors(css, candidates, options) {
|
|
1693
|
+
const aliases = createSelectorAliasMap(candidates, options);
|
|
1694
|
+
if (aliases.size === 0) return css;
|
|
1695
|
+
let result = css;
|
|
1696
|
+
for (const [canonicalSelector, bareSelector] of aliases) result = result.replaceAll(canonicalSelector, bareSelector);
|
|
1697
|
+
return result;
|
|
1698
|
+
}
|
|
1699
|
+
function canonicalizeBareArbitraryValueCandidates(candidates, options) {
|
|
1700
|
+
return Array.from(candidates, (candidate) => {
|
|
1701
|
+
return resolveBareArbitraryValueCandidate(candidate, options)?.canonicalCandidate ?? candidate;
|
|
1702
|
+
});
|
|
1703
|
+
}
|
|
1467
1704
|
function splitTopLevel(value, separator) {
|
|
1468
1705
|
const result = [];
|
|
1469
1706
|
let start = 0;
|
|
@@ -1730,6 +1967,10 @@ function getOxideModule() {
|
|
|
1730
1967
|
});
|
|
1731
1968
|
return oxideImportPromise;
|
|
1732
1969
|
}
|
|
1970
|
+
function createCandidateCacheKey(designSystemKey, options) {
|
|
1971
|
+
if (options.bareArbitraryValues == null || options.bareArbitraryValues === false) return designSystemKey;
|
|
1972
|
+
return `${designSystemKey}:bare-arbitrary:${JSON.stringify(options.bareArbitraryValues)}`;
|
|
1973
|
+
}
|
|
1733
1974
|
async function extractRawCandidatesWithPositions(content, extension = "html") {
|
|
1734
1975
|
const { Scanner } = await getOxideModule();
|
|
1735
1976
|
return new Scanner({}).getCandidatesWithPositions({
|
|
@@ -1769,8 +2010,9 @@ async function extractValidCandidates(options) {
|
|
|
1769
2010
|
};
|
|
1770
2011
|
const designSystemKey = getTailwindV4DesignSystemCacheKey(source);
|
|
1771
2012
|
const designSystem = await loadTailwindV4DesignSystem(source);
|
|
1772
|
-
const
|
|
1773
|
-
designSystemCandidateCache.
|
|
2013
|
+
const candidateCacheKey = createCandidateCacheKey(designSystemKey, providedOptions);
|
|
2014
|
+
const candidateCache = designSystemCandidateCache.get(candidateCacheKey) ?? /* @__PURE__ */ new Map();
|
|
2015
|
+
designSystemCandidateCache.set(candidateCacheKey, candidateCache);
|
|
1774
2016
|
const candidates = await extractRawCandidates(sources);
|
|
1775
2017
|
const validCandidates = [];
|
|
1776
2018
|
const uncachedCandidates = [];
|
|
@@ -1781,14 +2023,15 @@ async function extractValidCandidates(options) {
|
|
|
1781
2023
|
continue;
|
|
1782
2024
|
}
|
|
1783
2025
|
if (cached === false) continue;
|
|
1784
|
-
|
|
2026
|
+
const bareArbitrary = resolveBareArbitraryValueCandidate(rawCandidate, providedOptions.bareArbitraryValues);
|
|
2027
|
+
if (designSystem.parseCandidate(rawCandidate).length > 0 || bareArbitrary && designSystem.parseCandidate(bareArbitrary.canonicalCandidate).length > 0) {
|
|
1785
2028
|
uncachedCandidates.push(rawCandidate);
|
|
1786
2029
|
continue;
|
|
1787
2030
|
}
|
|
1788
2031
|
candidateCache.set(rawCandidate, false);
|
|
1789
2032
|
}
|
|
1790
2033
|
if (uncachedCandidates.length === 0) return validCandidates;
|
|
1791
|
-
const validUncachedCandidates = resolveValidTailwindV4Candidates(designSystem, uncachedCandidates);
|
|
2034
|
+
const validUncachedCandidates = resolveValidTailwindV4Candidates(designSystem, uncachedCandidates, providedOptions.bareArbitraryValues === void 0 ? void 0 : { bareArbitraryValues: providedOptions.bareArbitraryValues });
|
|
1792
2035
|
for (const candidate of uncachedCandidates) {
|
|
1793
2036
|
const isValid = validUncachedCandidates.has(candidate);
|
|
1794
2037
|
candidateCache.set(candidate, isValid);
|
|
@@ -1996,6 +2239,7 @@ async function collectClassesFromTailwindV4(options) {
|
|
|
1996
2239
|
base: firstBase,
|
|
1997
2240
|
baseFallbacks: designSystemBases.slice(1),
|
|
1998
2241
|
css,
|
|
2242
|
+
...v4Options.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: v4Options.bareArbitraryValues },
|
|
1999
2243
|
...sources === void 0 ? {} : { sources }
|
|
2000
2244
|
});
|
|
2001
2245
|
for (const candidate of candidates) if (options.filter(candidate)) set.add(candidate);
|
|
@@ -2006,6 +2250,7 @@ async function collectClassesFromTailwindV4(options) {
|
|
|
2006
2250
|
const candidates = await extractValidCandidates({
|
|
2007
2251
|
cwd: options.projectRoot,
|
|
2008
2252
|
base: baseForCss,
|
|
2253
|
+
...v4Options.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: v4Options.bareArbitraryValues },
|
|
2009
2254
|
...v4Options.css === void 0 ? {} : { css: v4Options.css },
|
|
2010
2255
|
...sources === void 0 ? {} : { sources }
|
|
2011
2256
|
});
|
|
@@ -2670,6 +2915,9 @@ function resolveTailwindExecutionOptions(normalized, majorVersion) {
|
|
|
2670
2915
|
};
|
|
2671
2916
|
}
|
|
2672
2917
|
var BaseCollector = class {
|
|
2918
|
+
packageInfo;
|
|
2919
|
+
options;
|
|
2920
|
+
majorVersion;
|
|
2673
2921
|
constructor(packageInfo, options, majorVersion) {
|
|
2674
2922
|
this.packageInfo = packageInfo;
|
|
2675
2923
|
this.options = options;
|
|
@@ -2694,6 +2942,7 @@ var BaseCollector = class {
|
|
|
2694
2942
|
}
|
|
2695
2943
|
};
|
|
2696
2944
|
var RuntimeCollector = class extends BaseCollector {
|
|
2945
|
+
snapshotFactory;
|
|
2697
2946
|
inFlightBuild;
|
|
2698
2947
|
constructor(packageInfo, options, majorVersion, snapshotFactory) {
|
|
2699
2948
|
super(packageInfo, options, majorVersion);
|
|
@@ -3613,6 +3862,12 @@ Object.defineProperty(exports, "ValidateCommandError", {
|
|
|
3613
3862
|
return ValidateCommandError;
|
|
3614
3863
|
}
|
|
3615
3864
|
});
|
|
3865
|
+
Object.defineProperty(exports, "canonicalizeBareArbitraryValueCandidates", {
|
|
3866
|
+
enumerable: true,
|
|
3867
|
+
get: function() {
|
|
3868
|
+
return canonicalizeBareArbitraryValueCandidates;
|
|
3869
|
+
}
|
|
3870
|
+
});
|
|
3616
3871
|
Object.defineProperty(exports, "classifyValidateError", {
|
|
3617
3872
|
enumerable: true,
|
|
3618
3873
|
get: function() {
|
|
@@ -3721,6 +3976,12 @@ Object.defineProperty(exports, "normalizeOptions", {
|
|
|
3721
3976
|
return normalizeOptions;
|
|
3722
3977
|
}
|
|
3723
3978
|
});
|
|
3979
|
+
Object.defineProperty(exports, "replaceBareArbitraryValueSelectors", {
|
|
3980
|
+
enumerable: true,
|
|
3981
|
+
get: function() {
|
|
3982
|
+
return replaceBareArbitraryValueSelectors;
|
|
3983
|
+
}
|
|
3984
|
+
});
|
|
3724
3985
|
Object.defineProperty(exports, "resolveValidTailwindV4Candidates", {
|
|
3725
3986
|
enumerable: true,
|
|
3726
3987
|
get: function() {
|
|
@@ -250,6 +250,10 @@ interface TailwindV4Options {
|
|
|
250
250
|
cssEntries?: string[];
|
|
251
251
|
/** Overrides the content sources scanned by the oxide scanner. */
|
|
252
252
|
sources?: SourceEntry[];
|
|
253
|
+
/** Enables UnoCSS-style bare arbitrary values such as `p-10%` and `p-2.5px`. */
|
|
254
|
+
bareArbitraryValues?: boolean | {
|
|
255
|
+
/** Unit allow-list used when detecting bare arbitrary values. */units?: string[];
|
|
256
|
+
} | undefined;
|
|
253
257
|
}
|
|
254
258
|
/**
|
|
255
259
|
* High-level Tailwind patch configuration shared across versions.
|
|
@@ -327,6 +331,9 @@ interface NormalizedTailwindV4Options {
|
|
|
327
331
|
cssEntries: string[];
|
|
328
332
|
sources: SourceEntry[];
|
|
329
333
|
hasUserDefinedSources: boolean;
|
|
334
|
+
bareArbitraryValues: false | {
|
|
335
|
+
units?: string[];
|
|
336
|
+
} | undefined;
|
|
330
337
|
}
|
|
331
338
|
/**
|
|
332
339
|
* Tailwind configuration ready for consumption by the runtime after normalization.
|
|
@@ -414,6 +421,14 @@ type TailwindcssConfigResult = Awaited<ReturnType<TailwindcssConfigModule['getCo
|
|
|
414
421
|
//#region src/runtime/collector.d.ts
|
|
415
422
|
type TailwindMajorVersion = 2 | 3 | 4;
|
|
416
423
|
//#endregion
|
|
424
|
+
//#region src/v4/bare-arbitrary-values.d.ts
|
|
425
|
+
interface BareArbitraryValueOptions {
|
|
426
|
+
/**
|
|
427
|
+
* 允许作为无方括号任意值的单位列表。
|
|
428
|
+
*/
|
|
429
|
+
units?: string[];
|
|
430
|
+
}
|
|
431
|
+
//#endregion
|
|
417
432
|
//#region src/extraction/candidate-extractor.d.ts
|
|
418
433
|
interface ExtractValidCandidatesOption {
|
|
419
434
|
sources?: SourceEntry[];
|
|
@@ -421,6 +436,7 @@ interface ExtractValidCandidatesOption {
|
|
|
421
436
|
baseFallbacks?: string[];
|
|
422
437
|
css?: string;
|
|
423
438
|
cwd?: string;
|
|
439
|
+
bareArbitraryValues?: boolean | BareArbitraryValueOptions;
|
|
424
440
|
}
|
|
425
441
|
declare function extractRawCandidatesWithPositions(content: string, extension?: string): Promise<{
|
|
426
442
|
rawCandidate: string;
|
|
@@ -683,4 +699,4 @@ declare class ValidateCommandError extends Error {
|
|
|
683
699
|
constructor(summary: ValidateFailureSummary, options?: ErrorOptions);
|
|
684
700
|
}
|
|
685
701
|
//#endregion
|
|
686
|
-
export {
|
|
702
|
+
export { TailwindTokenByFileMap as $, groupTokensByFile as A, NormalizedTailwindCssPatchOptions as B, MIGRATION_REPORT_SCHEMA_VERSION as C, extractRawCandidates as D, extractProjectCandidatesWithPositions as E, CacheStrategy as F, TailwindV4Options as G, TailwindCssPatchOptions as H, ExposeContextOptions as I, PatchCheckStatus as J, ExtractResult as K, ExtendLengthUnitsOptions as L, normalizeOptions as M, ApplyOptions as N, extractRawCandidatesWithPositions as O, CacheOptions as P, TailwindPatchRuntime as Q, ExtractOptions as R, MIGRATION_REPORT_KIND as S, TailwindcssPatcher as T, TailwindV2Options as U, TailwindCssOptions as V, TailwindV3Options as W, PatchStatusEntry as X, PatchName as Y, PatchStatusReport as Z, ConfigFileMigrationEntry as _, ValidateFailureSummary as a, CacheClearOptions as at, RestoreConfigFilesOptions as b, TailwindcssPatchCliMountOptions as c, CacheContextDescriptor as ct, TailwindcssPatchCommandContext as d, CacheReadMeta as dt, TailwindTokenFileKey as et, TailwindcssPatchCommandHandler as f, CacheReadResult as ft, tailwindcssPatchCommands as g, TailwindcssPatchCommandOptions as h, ValidateFailureReason as i, TailwindcssRuntimeContext as it, BareArbitraryValueOptions as j, extractValidCandidates as k, TailwindcssPatchCliOptions as l, CacheContextMetadata as lt, TailwindcssPatchCommandOptionDefinition as m, VALIDATE_FAILURE_REASONS as n, TailwindTokenReport as nt, ValidateJsonFailurePayload as o, CacheClearResult as ot, TailwindcssPatchCommandHandlerMap as p, ILengthUnitsPatchOptions as q, ValidateCommandError as r, TailwindcssClassCache as rt, ValidateJsonSuccessPayload as s, CacheClearScope as st, VALIDATE_EXIT_CODES as t, TailwindTokenLocation as tt, TailwindcssPatchCommand as u, CacheIndexFileV2 as ut, ConfigFileMigrationReport as v, logger as w, RestoreConfigFilesResult as x, MigrateConfigFilesOptions as y, NormalizedCacheOptions as z };
|