tailwindcss-patch 9.4.3 → 9.5.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.
Files changed (36) hide show
  1. package/dist/{cli-BztQHMRp.js → cli-CGyUnvFc.js} +3 -2
  2. package/dist/{cli-D0jXMGXf.mjs → cli-DRfALTSo.mjs} +1 -1
  3. package/dist/cli.js +2 -2
  4. package/dist/cli.mjs +2 -2
  5. package/dist/commands/cli-runtime.d.mts +1 -1
  6. package/dist/commands/cli-runtime.d.ts +1 -1
  7. package/dist/commands/cli-runtime.js +2 -2
  8. package/dist/commands/cli-runtime.mjs +2 -2
  9. package/dist/{dist-DDcbvOwe.js → dist-DlC5vuI2.js} +1 -1
  10. package/dist/index.d.mts +7 -149
  11. package/dist/index.d.ts +8 -150
  12. package/dist/index.js +294 -521
  13. package/dist/index.mjs +6 -471
  14. package/dist/{validate-BuqRodYI.d.ts → validate-B5-08lrU.d.ts} +7 -251
  15. package/dist/{validate-oAkURzUC.d.mts → validate-CgrG4aAY.d.mts} +7 -251
  16. package/dist/{validate-Bug_WYcU.mjs → validate-Q00Ccqht.mjs} +8 -1405
  17. package/dist/{validate-DbuKewV-.js → validate-XiYmTZcd.js} +82 -1708
  18. package/package.json +8 -10
  19. package/src/api/tailwindcss-patcher.ts +8 -5
  20. package/src/extraction/candidate-extractor.ts +17 -701
  21. package/src/extraction/split-candidate-tokens.ts +5 -101
  22. package/src/options/types.ts +1 -2
  23. package/src/style-candidates.ts +5 -35
  24. package/src/style-generator.ts +11 -80
  25. package/src/types.ts +21 -95
  26. package/src/v3/index.ts +2 -2
  27. package/src/v4/index.ts +104 -28
  28. package/src/v3/style-generator.ts +0 -384
  29. package/src/v4/bare-arbitrary-values.ts +0 -545
  30. package/src/v4/candidates.ts +0 -316
  31. package/src/v4/engine.ts +0 -112
  32. package/src/v4/node-adapter.ts +0 -207
  33. package/src/v4/source-scan.ts +0 -432
  34. package/src/v4/source.ts +0 -235
  35. package/src/v4/style-generator.ts +0 -44
  36. package/src/v4/types.ts +0 -103
package/src/v4/types.ts DELETED
@@ -1,103 +0,0 @@
1
- import type { TailwindStyleSource } from '../style-candidates'
2
-
3
- export interface TailwindV4SourceOptions {
4
- projectRoot?: string
5
- cwd?: string
6
- base?: string
7
- baseFallbacks?: string[]
8
- css?: string
9
- cssSources?: TailwindV4CssSource[]
10
- cssEntries?: string[]
11
- packageName?: string
12
- }
13
-
14
- export interface TailwindV4CssSource {
15
- css: string
16
- base?: string
17
- file?: string
18
- dependencies?: string[]
19
- }
20
-
21
- export interface TailwindV4ResolvedSource {
22
- projectRoot: string
23
- base: string
24
- baseFallbacks: string[]
25
- css: string
26
- dependencies: string[]
27
- }
28
-
29
- export interface TailwindV4CandidateSource {
30
- content: string
31
- extension?: string
32
- }
33
-
34
- export interface TailwindV4StyleSource extends TailwindStyleSource {}
35
-
36
- export interface TailwindV4GenerateOptions {
37
- candidates?: Iterable<string>
38
- sources?: TailwindV4CandidateSource[]
39
- /**
40
- * Enables UnoCSS-style bare arbitrary values such as `p-10%` and `p-2.5px`.
41
- */
42
- bareArbitraryValues?: boolean | {
43
- units?: string[]
44
- }
45
- /**
46
- * 扫描文件系统 source entries 中的候选类名。
47
- *
48
- * - `true`:使用 Tailwind v4 编译入口解析出的 `@source` 列表。
49
- * - `TailwindV4SourcePattern[]`:使用调用方显式传入的 source 列表。
50
- */
51
- scanSources?: boolean | TailwindV4SourcePattern[]
52
- }
53
-
54
- export type TailwindV4CompiledSourceRoot = null | 'none' | {
55
- base: string
56
- pattern: string
57
- }
58
-
59
- export interface TailwindV4SourcePattern {
60
- base: string
61
- pattern: string
62
- negated: boolean
63
- }
64
-
65
- export interface TailwindV4GenerateResult {
66
- css: string
67
- classSet: Set<string>
68
- rawCandidates: Set<string>
69
- dependencies: string[]
70
- sources: TailwindV4SourcePattern[]
71
- root: TailwindV4CompiledSourceRoot
72
- }
73
-
74
- export interface TailwindV4StyleGenerateOptions extends TailwindV4SourceOptions {
75
- source?: TailwindV4ResolvedSource
76
- candidates?: Iterable<string>
77
- sources?: TailwindV4StyleSource[]
78
- /**
79
- * Enables UnoCSS-style bare arbitrary values such as `p-10%` and `p-2.5px`.
80
- */
81
- bareArbitraryValues?: TailwindV4GenerateOptions['bareArbitraryValues']
82
- /**
83
- * Scans the compiled Tailwind CSS v4 source entries in addition to in-memory sources.
84
- */
85
- scanSources?: TailwindV4GenerateOptions['scanSources']
86
- }
87
-
88
- export interface TailwindV4StyleGenerateResult extends TailwindV4GenerateResult {
89
- tokens: Set<string>
90
- source: TailwindV4ResolvedSource
91
- }
92
-
93
- export interface TailwindV4DesignSystem {
94
- parseCandidate: (candidate: string) => unknown[]
95
- candidatesToCss: (candidates: string[]) => Array<string | null | undefined>
96
- }
97
-
98
- export interface TailwindV4Engine {
99
- source: TailwindV4ResolvedSource
100
- loadDesignSystem: () => Promise<TailwindV4DesignSystem>
101
- validateCandidates: (candidates: Iterable<string>) => Promise<Set<string>>
102
- generate: (options?: TailwindV4GenerateOptions) => Promise<TailwindV4GenerateResult>
103
- }