tailwindcss 0.0.0-insiders.d045aaa → 0.0.0-insiders.d06bbb8

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/lib.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { U as UserConfig, P as Plugin } from './types-BTRmm49E.mjs';
1
+ import { U as UserConfig, P as Plugin } from './types-B254mqw1.mjs';
2
2
  import { V as Variant, C as Candidate } from './resolve-config-QUZ9b-Gn.mjs';
3
3
  import './colors.mjs';
4
4
 
@@ -18,8 +18,10 @@ declare class Theme {
18
18
  constructor(values?: Map<string, {
19
19
  value: string;
20
20
  options: ThemeOptions;
21
+ src: Declaration["src"];
21
22
  }>, keyframes?: Set<AtRule>);
22
- add(key: string, value: string, options?: ThemeOptions): void;
23
+ get size(): number;
24
+ add(key: string, value: string, options?: ThemeOptions, src?: Declaration['src']): void;
23
25
  keysInNamespaces(themeKeys: Iterable<ThemeKey>): string[];
24
26
  get(themeKeys: ThemeKey[]): string | null;
25
27
  hasDefault(key: string): boolean;
@@ -27,13 +29,16 @@ declare class Theme {
27
29
  entries(): IterableIterator<[string, {
28
30
  value: string;
29
31
  options: ThemeOptions;
32
+ src: Declaration["src"];
30
33
  }]> | [string, {
31
34
  value: string;
32
35
  options: ThemeOptions;
36
+ src: Declaration["src"];
33
37
  }][];
38
+ prefixKey(key: string): string;
34
39
  clearNamespace(namespace: string, clearOptions: ThemeOptions): void;
35
- markUsedVariable(themeKey: string): void;
36
- resolve(candidateValue: string | null, themeKeys: ThemeKey[]): string | null;
40
+ markUsedVariable(themeKey: string): boolean;
41
+ resolve(candidateValue: string | null, themeKeys: ThemeKey[], options?: ThemeOptions): string | null;
37
42
  resolveValue(candidateValue: string | null, themeKeys: ThemeKey[]): string | null;
38
43
  resolveWith(candidateValue: string, themeKeys: ThemeKey[], nestedKeys?: `--${string}`[]): [string, Record<string, string>] | null;
39
44
  namespace(namespace: string): Map<string | null, string>;
@@ -113,7 +118,10 @@ declare class Variants {
113
118
 
114
119
  declare function compileAstNodes(candidate: Candidate, designSystem: DesignSystem): {
115
120
  node: AstNode;
116
- propertySort: number[];
121
+ propertySort: {
122
+ order: number[];
123
+ count: number;
124
+ };
117
125
  }[];
118
126
 
119
127
  interface ClassMetadata {
@@ -172,55 +180,156 @@ type DesignSystem = {
172
180
  parseCandidate(candidate: string): Readonly<Candidate>[];
173
181
  parseVariant(variant: string): Readonly<Variant> | null;
174
182
  compileAstNodes(candidate: Candidate): ReturnType<typeof compileAstNodes>;
183
+ printCandidate(candidate: Candidate): string;
184
+ printVariant(variant: Variant): string;
175
185
  getVariantOrder(): Map<Variant, number>;
176
- resolveThemeValue(path: string): string | undefined;
186
+ resolveThemeValue(path: string, forceInline?: boolean): string | undefined;
177
187
  trackUsedVariables(raw: string): void;
178
188
  candidatesToCss(classes: string[]): (string | null)[];
179
189
  };
180
190
 
191
+ /**
192
+ * The source code for one or more nodes in the AST
193
+ *
194
+ * This generally corresponds to a stylesheet
195
+ */
196
+ interface Source {
197
+ /**
198
+ * The path to the file that contains the referenced source code
199
+ *
200
+ * If this references the *output* source code, this is `null`.
201
+ */
202
+ file: string | null;
203
+ /**
204
+ * The referenced source code
205
+ */
206
+ code: string;
207
+ }
208
+ /**
209
+ * The file and offsets within it that this node covers
210
+ *
211
+ * This can represent either:
212
+ * - A location in the original CSS which caused this node to be created
213
+ * - A location in the output CSS where this node resides
214
+ */
215
+ type SourceLocation = [source: Source, start: number, end: number];
216
+
181
217
  type StyleRule = {
182
218
  kind: 'rule';
183
219
  selector: string;
184
220
  nodes: AstNode[];
221
+ src?: SourceLocation;
222
+ dst?: SourceLocation;
185
223
  };
186
224
  type AtRule = {
187
225
  kind: 'at-rule';
188
226
  name: string;
189
227
  params: string;
190
228
  nodes: AstNode[];
229
+ src?: SourceLocation;
230
+ dst?: SourceLocation;
191
231
  };
192
232
  type Declaration = {
193
233
  kind: 'declaration';
194
234
  property: string;
195
235
  value: string | undefined;
196
236
  important: boolean;
237
+ src?: SourceLocation;
238
+ dst?: SourceLocation;
197
239
  };
198
240
  type Comment = {
199
241
  kind: 'comment';
200
242
  value: string;
243
+ src?: SourceLocation;
244
+ dst?: SourceLocation;
201
245
  };
202
246
  type Context = {
203
247
  kind: 'context';
204
248
  context: Record<string, string | boolean>;
205
249
  nodes: AstNode[];
250
+ src?: undefined;
251
+ dst?: undefined;
206
252
  };
207
253
  type AtRoot = {
208
254
  kind: 'at-root';
209
255
  nodes: AstNode[];
256
+ src?: undefined;
257
+ dst?: undefined;
210
258
  };
211
259
  type Rule = StyleRule | AtRule;
212
260
  type AstNode = StyleRule | AtRule | Declaration | Comment | Context | AtRoot;
213
261
 
262
+ /**
263
+ * Line offset tables are the key to generating our source maps. They allow us
264
+ * to store indexes with our AST nodes and later convert them into positions as
265
+ * when given the source that the indexes refer to.
266
+ */
267
+ /**
268
+ * A position in source code
269
+ *
270
+ * https://tc39.es/ecma426/#sec-position-record-type
271
+ */
272
+ interface Position {
273
+ /** The line number, one-based */
274
+ line: number;
275
+ /** The column/character number, one-based */
276
+ column: number;
277
+ }
278
+
279
+ interface OriginalPosition extends Position {
280
+ source: DecodedSource;
281
+ }
282
+ /**
283
+ * A "decoded" sourcemap
284
+ *
285
+ * @see https://tc39.es/ecma426/#decoded-source-map-record
286
+ */
287
+ interface DecodedSourceMap {
288
+ file: string | null;
289
+ sources: DecodedSource[];
290
+ mappings: DecodedMapping[];
291
+ }
292
+ /**
293
+ * A "decoded" source
294
+ *
295
+ * @see https://tc39.es/ecma426/#decoded-source-record
296
+ */
297
+ interface DecodedSource {
298
+ url: string | null;
299
+ content: string | null;
300
+ ignore: boolean;
301
+ }
302
+ /**
303
+ * A "decoded" mapping
304
+ *
305
+ * @see https://tc39.es/ecma426/#decoded-mapping-record
306
+ */
307
+ interface DecodedMapping {
308
+ originalPosition: OriginalPosition | null;
309
+ generatedPosition: Position;
310
+ name: string | null;
311
+ }
312
+
214
313
  type Config = UserConfig;
314
+ declare const enum Polyfills {
315
+ None = 0,
316
+ AtProperty = 1,
317
+ ColorMix = 2,
318
+ All = 3
319
+ }
215
320
  type CompileOptions = {
216
321
  base?: string;
322
+ from?: string;
323
+ polyfills?: Polyfills;
217
324
  loadModule?: (id: string, base: string, resourceHint: 'plugin' | 'config') => Promise<{
218
- module: Plugin | Config;
325
+ path: string;
219
326
  base: string;
327
+ module: Plugin | Config;
220
328
  }>;
221
329
  loadStylesheet?: (id: string, base: string) => Promise<{
222
- content: string;
330
+ path: string;
223
331
  base: string;
332
+ content: string;
224
333
  }>;
225
334
  };
226
335
  type Root = null | 'none' | {
@@ -237,24 +346,28 @@ declare const enum Features {
237
346
  Variants = 32
238
347
  }
239
348
  declare function compileAst(input: AstNode[], opts?: CompileOptions): Promise<{
240
- globs: {
349
+ sources: {
241
350
  base: string;
242
351
  pattern: string;
352
+ negated: boolean;
243
353
  }[];
244
354
  root: Root;
245
355
  features: Features;
246
356
  build(candidates: string[]): AstNode[];
247
357
  }>;
358
+
248
359
  declare function compile(css: string, opts?: CompileOptions): Promise<{
249
- globs: {
360
+ sources: {
250
361
  base: string;
251
362
  pattern: string;
363
+ negated: boolean;
252
364
  }[];
253
365
  root: Root;
254
366
  features: Features;
255
367
  build(candidates: string[]): string;
368
+ buildSourceMap(): DecodedSourceMap;
256
369
  }>;
257
370
  declare function __unstable__loadDesignSystem(css: string, opts?: CompileOptions): Promise<DesignSystem>;
258
371
  declare function postcssPluginWarning(): void;
259
372
 
260
- export { type Config, Features, __unstable__loadDesignSystem, compile, compileAst, postcssPluginWarning as default };
373
+ export { type Config, type DecodedSourceMap, Features, Polyfills, __unstable__loadDesignSystem, compile, compileAst, postcssPluginWarning as default };