weapp-tailwindcss 5.1.13 → 5.1.15
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/auto-2dg_uhEJ.mjs +13 -0
- package/dist/bundlers/gulp/frameworks/native/index.d.ts +2 -0
- package/dist/bundlers/gulp/index.d.ts +2 -0
- package/dist/bundlers/gulp/shared/create-native-framework-plugins.d.ts +2 -0
- package/dist/bundlers/shared/generated-css-marker.d.ts +2 -2
- package/dist/bundlers/shared/generator-css/local-imports.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/source-resolver/postcss-source.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/types.d.ts +5 -0
- package/dist/bundlers/shared/style-requests.d.ts +1 -0
- package/dist/bundlers/vite/bundle-state.d.ts +1 -0
- package/dist/bundlers/vite/css-finalizer.d.ts +1 -0
- package/dist/bundlers/vite/frameworks/taro/index.d.ts +2 -0
- package/dist/bundlers/vite/frameworks/uni-app/index.d.ts +2 -0
- package/dist/bundlers/vite/frameworks/uni-app-x/index.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/bundle-markup-candidates.d.ts +20 -0
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +4 -0
- package/dist/bundlers/vite/generate-bundle/root-style-output.d.ts +18 -0
- package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/source-candidate-source.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/types.d.ts +7 -0
- package/dist/bundlers/vite/serve-css-generation.d.ts +3 -2
- package/dist/bundlers/vite/serve-root-import-shell.d.ts +8 -0
- package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +1 -0
- package/dist/bundlers/vite/source-candidates.d.ts +3 -0
- package/dist/bundlers/vite/watch-css-post.d.ts +10 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +6 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/css-source-resolvers.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +2 -0
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +1 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-css-generation-loader.d.ts +4 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +3 -0
- package/dist/{context-xSJE588m.mjs → context-BgGWVAmN.mjs} +5 -3
- package/dist/{context-DRRgW7i2.js → context-VeFq_8vW.js} +5 -3
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/{generator-CS10c9g1.js → generator-CEnUsjed.js} +17 -3
- package/dist/{generator-BvPcmqxU.mjs → generator-CEo920So.mjs} +18 -4
- package/dist/generator.js +1 -1
- package/dist/generator.mjs +1 -1
- package/dist/{gulp-DNZZvUMq.js → gulp-3m1dAiig.js} +92 -54
- package/dist/{gulp-BEOzXrbp.mjs → gulp-DP71z1jG.mjs} +92 -54
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-hRhRAjYV.mjs → hmr-timing-1aS6--U7.mjs} +272 -56
- package/dist/{hmr-timing-DW1g3zjl.js → hmr-timing-B8p4f0ca.js} +323 -53
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/rspack.js +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/shared/mpx.d.ts +4 -1
- package/dist/{source-candidate-scan-signature-CMgu5bJk.js → source-candidate-scan-signature-BAahhiwb.js} +20 -139
- package/dist/{source-candidate-scan-signature-t4XKAQ04.mjs → source-candidate-scan-signature-Cf7259PR.mjs} +21 -104
- package/dist/tailwindcss/candidates.d.ts +4 -0
- package/dist/{tailwindcss-z9JMF-qU.js → tailwindcss-KBYPJ2DW.js} +1 -1
- package/dist/{tailwindcss-DZT_pWrd.mjs → tailwindcss-xs704TRw.mjs} +1 -1
- package/dist/{transform-D5JUgMpE.mjs → transform-B_KM9sLX.mjs} +47 -5
- package/dist/{transform-COFRlmDF.js → transform-CcYptivi.js} +47 -5
- package/dist/uni-app-x/component-local-style.d.ts +1 -0
- package/dist/uni-app-x/style-asset/style-value.d.ts +1 -1
- package/dist/{vite-DnkObu2L.js → vite-DUVjMduj.js} +807 -320
- package/dist/{vite-Tpgi77vE.mjs → vite-nXZEiwG0.mjs} +757 -270
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-generation-loader.js +12 -0
- package/dist/weapp-tw-css-import-rewrite-loader-DNk0IxAt.js +10198 -0
- package/dist/weapp-tw-css-import-rewrite-loader.js +6 -8209
- package/dist/{webpack-CTYm19zA.mjs → webpack-C_UUFRgj.mjs} +228 -58
- package/dist/{webpack-CzXjfvYS.js → webpack-nppysF4B.js} +240 -70
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +11 -3
- package/dist/auto-CrJJc5rK.mjs +0 -13
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { hasCssMacroStyleOptions, hasCssMacroTailwindV4CustomVariantConditionalComments, hasCssMacroTailwindV4InternalAtRules, hasCssMacroTailwindV4Source, transformCssMacroCss, transformCssMacroTailwindV4Source, withCssMacroStyleOptions } from "@weapp-tailwindcss/postcss";
|
|
2
|
+
//#region src/css-macro/auto.ts
|
|
3
|
+
const CSS_MACRO_PLUGIN_MARKER = "__weappTailwindcssCssMacro";
|
|
4
|
+
function markCssMacroPlugin(value) {
|
|
5
|
+
Object.defineProperty(value, CSS_MACRO_PLUGIN_MARKER, {
|
|
6
|
+
configurable: false,
|
|
7
|
+
enumerable: false,
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { markCssMacroPlugin as a, withCssMacroStyleOptions as c, hasCssMacroTailwindV4Source as i, hasCssMacroTailwindV4CustomVariantConditionalComments as n, transformCssMacroCss as o, hasCssMacroTailwindV4InternalAtRules as r, transformCssMacroTailwindV4Source as s, hasCssMacroStyleOptions as t };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { UserDefinedOptions } from '../../../../types';
|
|
2
2
|
export declare function createNativeGulpFrameworkPlugins(options?: UserDefinedOptions): {
|
|
3
|
+
adaptWxss: (options?: Partial<import("@weapp-tailwindcss/postcss").IStyleHandlerOptions>) => import("node:stream").Transform;
|
|
4
|
+
generateWxss: (options?: Partial<import("@weapp-tailwindcss/postcss").IStyleHandlerOptions>) => import("node:stream").Transform;
|
|
3
5
|
transformWxss: (options?: Partial<import("@weapp-tailwindcss/postcss").IStyleHandlerOptions>) => import("node:stream").Transform;
|
|
4
6
|
transformWxml: (options?: Partial<import("@/types").ITemplateHandlerOptions>) => import("node:stream").Transform;
|
|
5
7
|
transformJs: (options?: Partial<import("@/types").CreateJsHandlerOptions>) => import("node:stream").Transform;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { UserDefinedOptions } from '../../types';
|
|
2
2
|
export declare function createPlugins(options?: UserDefinedOptions): {
|
|
3
|
+
adaptWxss: (options?: Partial<import("@weapp-tailwindcss/postcss").IStyleHandlerOptions>) => import("node:stream").Transform;
|
|
4
|
+
generateWxss: (options?: Partial<import("@weapp-tailwindcss/postcss").IStyleHandlerOptions>) => import("node:stream").Transform;
|
|
3
5
|
transformWxss: (options?: Partial<import("@weapp-tailwindcss/postcss").IStyleHandlerOptions>) => import("node:stream").Transform;
|
|
4
6
|
transformWxml: (options?: Partial<import("@/types").ITemplateHandlerOptions>) => import("node:stream").Transform;
|
|
5
7
|
transformJs: (options?: Partial<import("@/types").CreateJsHandlerOptions>) => import("node:stream").Transform;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { CreateJsHandlerOptions, IStyleHandlerOptions, ITemplateHandlerOptions, UserDefinedOptions } from '../../../types';
|
|
2
2
|
export declare function createNativeGulpPlugins(options?: UserDefinedOptions): {
|
|
3
|
+
adaptWxss: (options?: Partial<IStyleHandlerOptions>) => import("node:stream").Transform;
|
|
4
|
+
generateWxss: (options?: Partial<IStyleHandlerOptions>) => import("node:stream").Transform;
|
|
3
5
|
transformWxss: (options?: Partial<IStyleHandlerOptions>) => import("node:stream").Transform;
|
|
4
6
|
transformWxml: (options?: Partial<ITemplateHandlerOptions>) => import("node:stream").Transform;
|
|
5
7
|
transformJs: (options?: Partial<CreateJsHandlerOptions>) => import("node:stream").Transform;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export interface BundlerGeneratedCssMarkerBlock {
|
|
2
|
-
bundler: 'vite' | 'webpack';
|
|
2
|
+
bundler: 'gulp' | 'vite' | 'webpack';
|
|
3
3
|
file?: string | undefined;
|
|
4
4
|
css: string;
|
|
5
5
|
}
|
|
6
|
-
export declare function createBundlerGeneratedCssMarker(bundler: 'vite' | 'webpack', file: string): string;
|
|
6
|
+
export declare function createBundlerGeneratedCssMarker(bundler: 'gulp' | 'vite' | 'webpack', file: string): string;
|
|
7
7
|
export declare function hasBundlerGeneratedCssMarker(source: unknown): boolean;
|
|
8
8
|
export declare function stripBundlerGeneratedCssMarkers(source: string): string;
|
|
9
9
|
export declare function parseBundlerGeneratedCssMarkerBlocks(source: string): BundlerGeneratedCssMarkerBlock[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { cleanLocalCssImportWrapperTailwindDirectives, cleanLocalCssImportWrapperTailwindDirectivesRoot, createCssSourceOrderAppend, isLocalCssImportRequest, isPureLocalCssImportWrapper, isPureLocalCssImportWrapperRoot, normalizeOutputImportRequest, restoreLocalCssImports, rewriteLocalCssImportRequestsForOutput, rewriteLocalCssImportRequestsForOutputRoot, splitLocalCssImports, splitLocalCssImportsRoot, } from '@weapp-tailwindcss/postcss';
|
|
1
|
+
export { cleanLocalCssImportWrapperTailwindDirectives, cleanLocalCssImportWrapperTailwindDirectivesRoot, createCssSourceOrderAppend, isLocalCssImportRequest, isPureLocalCssImportWrapper, isPureLocalCssImportWrapperRoot, normalizeOutputImportRequest, removeMatchingLocalCssImports, removeMatchingLocalCssImportsRoot, restoreLocalCssImports, rewriteLocalCssImportRequestsForOutput, rewriteLocalCssImportRequestsForOutputRoot, splitLocalCssImports, splitLocalCssImportsRoot, } from '@weapp-tailwindcss/postcss';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
2
|
import type { TailwindV4CssSource } from './types';
|
|
3
3
|
export declare function resolvePostcssFromOption(cssHandlerOptions: IStyleHandlerOptions): string | undefined;
|
|
4
|
+
export declare function resolvePostcssRequestOption(cssHandlerOptions: IStyleHandlerOptions): string | undefined;
|
|
4
5
|
export declare function resolvePostcssSourceFile(cssHandlerOptions: IStyleHandlerOptions): string | undefined;
|
|
5
6
|
export declare function resolveCssHandlerSourceOptions(cssHandlerOptions: IStyleHandlerOptions): {
|
|
6
7
|
outputRoot?: string | undefined;
|
|
8
|
+
requestFile?: string | undefined;
|
|
7
9
|
sourceFile?: string | undefined;
|
|
8
10
|
sourceCss?: string | undefined;
|
|
9
11
|
cssSources?: TailwindV4CssSource[] | undefined;
|
|
@@ -25,6 +25,7 @@ export interface GenerateCssByGeneratorOptions {
|
|
|
25
25
|
previousCss?: string | undefined;
|
|
26
26
|
previousClassSet?: Set<string> | undefined;
|
|
27
27
|
deferEmptyScopedCssSource?: boolean | undefined;
|
|
28
|
+
deferCssAdaptation?: boolean | undefined;
|
|
28
29
|
disableSourceScan?: boolean | undefined;
|
|
29
30
|
restoreLocalCssImports?: boolean | undefined;
|
|
30
31
|
}
|
|
@@ -39,6 +40,10 @@ export interface GenerateCssByGeneratorResult {
|
|
|
39
40
|
file: string;
|
|
40
41
|
majorVersion?: number | undefined;
|
|
41
42
|
outputFile?: string | undefined;
|
|
43
|
+
preflightMode?: {
|
|
44
|
+
inject: boolean;
|
|
45
|
+
preserve: boolean;
|
|
46
|
+
} | undefined;
|
|
42
47
|
rawCss?: string | undefined;
|
|
43
48
|
} | undefined;
|
|
44
49
|
}
|
|
@@ -32,6 +32,7 @@ export interface BundleBuildState {
|
|
|
32
32
|
runtimeAffectingHashByFile: Map<string, string>;
|
|
33
33
|
linkedByEntry: Map<string, Set<string>>;
|
|
34
34
|
dependentsByLinkedFile: Map<string, Set<string>>;
|
|
35
|
+
bundleMarkupCandidatesByFile: Map<string, Set<string>>;
|
|
35
36
|
generatorCandidateSignature?: string | undefined;
|
|
36
37
|
}
|
|
37
38
|
interface UpdateBundleBuildStateOptions {
|
|
@@ -37,6 +37,7 @@ interface CssFinalizerContext {
|
|
|
37
37
|
rememberMainCssSource?: (file: string, rawSource: string) => void;
|
|
38
38
|
getRememberedMainCssSource?: (file: string) => RememberedMainCssSource | undefined;
|
|
39
39
|
isViteProcessedCssAsset?: (asset: OutputAsset, file?: string) => boolean;
|
|
40
|
+
frameworkRootImportShellTargetByFile?: ReadonlyMap<string, string> | undefined;
|
|
40
41
|
}
|
|
41
42
|
export declare function createViteCssFinalizerOutputPlugin(context: CssFinalizerContext): Plugin;
|
|
42
43
|
export {};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import type { ViteFrameworkCssPipelineStrategy } from '../../shared/framework-strategy';
|
|
1
2
|
import type { InternalUserDefinedOptions, UserDefinedOptions } from '../../../../types';
|
|
3
|
+
export declare const taroCssPipelineStrategy: ViteFrameworkCssPipelineStrategy;
|
|
2
4
|
export declare function createTaroVitePlugins(options?: UserDefinedOptions | InternalUserDefinedOptions): any[];
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import type { ViteFrameworkCssPipelineStrategy } from '../../shared/framework-strategy';
|
|
1
2
|
import type { InternalUserDefinedOptions, UserDefinedOptions } from '../../../../types';
|
|
3
|
+
export declare const uniAppCssPipelineStrategy: ViteFrameworkCssPipelineStrategy;
|
|
2
4
|
export declare function createUniAppVitePlugins(options?: UserDefinedOptions | InternalUserDefinedOptions): import("../..").WeappTailwindcssVitePlugin[] | undefined;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import type { ViteFrameworkCssPipelineStrategy } from '../../shared/framework-strategy';
|
|
1
2
|
import type { InternalUserDefinedOptions, UserDefinedOptions } from '../../../../types';
|
|
3
|
+
export declare const uniAppXCssPipelineStrategy: ViteFrameworkCssPipelineStrategy;
|
|
2
4
|
export declare function createUniAppXVitePlugins(options?: UserDefinedOptions | InternalUserDefinedOptions): import("../..").WeappTailwindcssVitePlugin[] | undefined;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BundleSnapshot } from '../bundle-state';
|
|
2
|
+
import type { SourceCandidateFilterOptions } from '../source-candidates';
|
|
3
|
+
import type { createTransformFilter } from './transform-filter';
|
|
4
|
+
import type { TailwindSourceEntry } from '../../../tailwindcss/source-scan';
|
|
5
|
+
interface CollectBundleMarkupCandidatesOptions {
|
|
6
|
+
extractSourceCandidates?: ((file: string, source: string) => Promise<Set<string>>) | undefined;
|
|
7
|
+
previousCandidatesByFile?: ReadonlyMap<string, Set<string>> | undefined;
|
|
8
|
+
preserveMissingFiles?: boolean | undefined;
|
|
9
|
+
resolveSourceCandidateFile: (file: string) => string | undefined;
|
|
10
|
+
rootDir: string;
|
|
11
|
+
snapshot: BundleSnapshot;
|
|
12
|
+
transformFilter: ReturnType<typeof createTransformFilter>;
|
|
13
|
+
}
|
|
14
|
+
export interface BundleMarkupCandidateCollection {
|
|
15
|
+
candidatesByFile: Map<string, Set<string>>;
|
|
16
|
+
values: Set<string>;
|
|
17
|
+
valuesForEntries: (entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Set<string>;
|
|
18
|
+
}
|
|
19
|
+
export declare function collectBundleMarkupCandidates(options: CollectBundleMarkupCandidatesOptions): Promise<BundleMarkupCandidateCollection>;
|
|
20
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { OutputAsset, OutputChunk } from 'rollup';
|
|
2
|
+
import type { ViteFrameworkCssPipelineContext, ViteFrameworkCssPipelineStrategy } from '../shared/framework-strategy';
|
|
2
3
|
import type { BundleMetrics } from './metrics';
|
|
3
4
|
import type { GenerateBundleContext, RememberedCssSource } from './types';
|
|
4
5
|
interface ProcessRememberedCssReplayOptions {
|
|
@@ -17,6 +18,8 @@ interface ProcessRememberedCssReplayOptions {
|
|
|
17
18
|
isMainChunk?: boolean | undefined;
|
|
18
19
|
}) => GenerateBundleContext['getSourceCandidateSourcesForEntries'];
|
|
19
20
|
cssTaskFactories: Array<() => Promise<void>>;
|
|
21
|
+
cssPipelineContext: ViteFrameworkCssPipelineContext;
|
|
22
|
+
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
20
23
|
debug: GenerateBundleContext['debug'];
|
|
21
24
|
defaultStyleOutputExtension: string;
|
|
22
25
|
emitOrReplayCssAsset: (fileName: string, source: string) => OutputAsset | undefined;
|
|
@@ -52,5 +55,6 @@ interface ProcessRememberedCssReplayOptions {
|
|
|
52
55
|
useIncrementalMode: boolean;
|
|
53
56
|
activeViteCssCacheFiles: Set<string>;
|
|
54
57
|
}
|
|
58
|
+
export declare function shouldSkipRawRememberedCssSource(rawSource: string, sourceFile: string): boolean;
|
|
55
59
|
export declare function processRememberedCssReplay(options: ProcessRememberedCssReplayOptions): Promise<void>;
|
|
56
60
|
export {};
|
|
@@ -1,6 +1,24 @@
|
|
|
1
|
+
import type { OutputBundle } from 'rollup';
|
|
1
2
|
export declare function isRootMiniProgramStyleOutputFile(file: string): boolean;
|
|
2
3
|
export declare function createRelativeCssImportRequest(targetFile: string, importedFile: string): string;
|
|
3
4
|
export declare function createCssImportShell(targetFile: string, importedFile: string): string;
|
|
5
|
+
export declare function resolveSingleCssImportOutputFile(targetFile: string, css: string): string | undefined;
|
|
4
6
|
export declare function createRootMiniProgramOriginStyleOutputFile(file: string): string;
|
|
5
7
|
export declare function shouldKeepRootMiniProgramStyleAsImportShell(enabled: boolean | undefined): enabled is true;
|
|
8
|
+
export declare function shouldPreserveFrameworkRootMiniProgramImportShell(options: {
|
|
9
|
+
css: string;
|
|
10
|
+
file: string;
|
|
11
|
+
isWebGeneratorTarget: boolean;
|
|
12
|
+
matchesCss: boolean;
|
|
13
|
+
shouldKeep: () => boolean | undefined;
|
|
14
|
+
}): boolean;
|
|
15
|
+
export declare function restoreFrameworkRootMiniProgramImportShellAssets(bundle: OutputBundle, options: {
|
|
16
|
+
debug?: ((format: string, ...args: unknown[]) => void) | undefined;
|
|
17
|
+
isWebGeneratorTarget: boolean;
|
|
18
|
+
matchesCss: (file: string) => boolean;
|
|
19
|
+
onUpdate?: ((file: string, oldVal: string, newVal: string) => void) | undefined;
|
|
20
|
+
recordCssAssetResult?: ((file: string, css: string) => void) | undefined;
|
|
21
|
+
shouldKeep: (file: string, css: string) => boolean | undefined;
|
|
22
|
+
targetByFile: ReadonlyMap<string, string>;
|
|
23
|
+
}): number;
|
|
6
24
|
export declare function shouldMoveRootMiniProgramStyleToImportShellOrigin(enabled: boolean | undefined): enabled is true;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { OutputChunk } from 'rollup';
|
|
2
2
|
import type { BundleSnapshot } from '../bundle-state';
|
|
3
3
|
import type { RememberedCssSource } from './types';
|
|
4
|
+
export declare function isSfcStyleSourceFile(file: string): boolean;
|
|
4
5
|
export interface SfcStyleBlock {
|
|
5
6
|
attrs: string;
|
|
6
7
|
index: number;
|
|
@@ -10,7 +11,7 @@ export interface SfcStyleBlock {
|
|
|
10
11
|
export declare function extractSfcStyleBlocks(source: string): SfcStyleBlock[];
|
|
11
12
|
export declare function extractSfcStyleSources(source: string): string[];
|
|
12
13
|
export declare function hasSfcStyleSources(source: string): boolean;
|
|
13
|
-
export declare function resolveSfcStyleRequestFromKnownSource(sourceFile: string, sfcSource: string | undefined, styleSource: string): string;
|
|
14
|
+
export declare function resolveSfcStyleRequestFromKnownSource(sourceFile: string, sfcSource: string | undefined, styleSource: string, currentRequest?: string): string;
|
|
14
15
|
export declare function hasTailwindGenerationSource(source: string, options?: {
|
|
15
16
|
allowRootDirectives?: boolean | undefined;
|
|
16
17
|
}): boolean;
|
|
@@ -6,4 +6,5 @@ export interface ResolveCurrentSourceCandidateSourceOptions {
|
|
|
6
6
|
rootDir: string;
|
|
7
7
|
sourceRoot?: string | undefined;
|
|
8
8
|
}
|
|
9
|
+
export declare function resolveCurrentSourceCandidateFile(options: ResolveCurrentSourceCandidateSourceOptions): string | undefined;
|
|
9
10
|
export declare function resolveCurrentSourceCandidateSource(options: ResolveCurrentSourceCandidateSourceOptions): string | undefined;
|
|
@@ -7,6 +7,10 @@ import type { SourceCandidateFilterOptions } from '../source-candidates';
|
|
|
7
7
|
import type { TailwindSourceEntry } from '../../../tailwindcss/source-scan';
|
|
8
8
|
import type { InternalUserDefinedOptions } from '../../../types';
|
|
9
9
|
export interface GenerateBundleContext {
|
|
10
|
+
processMarkupAndScripts?: boolean | undefined;
|
|
11
|
+
processStyles?: boolean | undefined;
|
|
12
|
+
shouldProcessBundle?: (() => boolean) | undefined;
|
|
13
|
+
shouldProcessStyles?: (() => boolean) | undefined;
|
|
10
14
|
opts: InternalUserDefinedOptions;
|
|
11
15
|
runtimeState: {
|
|
12
16
|
tailwindRuntime: InternalUserDefinedOptions['tailwindRuntime'];
|
|
@@ -42,6 +46,7 @@ export interface GenerateBundleContext {
|
|
|
42
46
|
getSourceCandidates?: () => Set<string>;
|
|
43
47
|
getSourceCandidateSource?: (file: string) => string | undefined;
|
|
44
48
|
getSourceCandidateSources?: () => Iterable<[string, string]>;
|
|
49
|
+
extractSourceCandidates?: (file: string, source: string) => Promise<Set<string>>;
|
|
45
50
|
getSourceCandidatesForEntries?: ((entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Set<string>) | undefined;
|
|
46
51
|
getSourceCandidateSourcesForEntries?: ((entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Map<string, Set<string>>) | undefined;
|
|
47
52
|
waitForSourceCandidateSyncs?: () => Promise<void>;
|
|
@@ -52,6 +57,7 @@ export interface GenerateBundleContext {
|
|
|
52
57
|
setRememberedCssSignature?: (file: string, cssRuntimeSignature: string) => void;
|
|
53
58
|
getKnownCssSource?: (file: string) => string | undefined;
|
|
54
59
|
getKnownSfcSource?: (file: string) => string | undefined;
|
|
60
|
+
getOriginalCssLayerSource?: (file: string) => string | undefined;
|
|
55
61
|
recordGeneratorCandidates?: (candidates: Set<string>) => void;
|
|
56
62
|
pruneViteCssCaches?: (options: {
|
|
57
63
|
activeFiles: Set<string>;
|
|
@@ -60,6 +66,7 @@ export interface GenerateBundleContext {
|
|
|
60
66
|
getViteCssCacheStats?: () => Record<string, unknown>;
|
|
61
67
|
hmrTimingRecorder?: HmrTimingRecorder;
|
|
62
68
|
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
69
|
+
frameworkRootImportShellTargetByFile?: Map<string, string> | undefined;
|
|
63
70
|
}
|
|
64
71
|
export interface RememberedCssSource {
|
|
65
72
|
outputFile: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
|
-
interface
|
|
2
|
+
interface ViteCssGenerationOptions {
|
|
3
3
|
generateCss: (id: string, code: string, hookContext?: {
|
|
4
4
|
addWatchFile?: (id: string) => void;
|
|
5
5
|
emitFile?: (emittedFile: {
|
|
@@ -11,6 +11,7 @@ interface ViteServeCssGenerationOptions {
|
|
|
11
11
|
getCommand: () => string | undefined;
|
|
12
12
|
onTailwindRootCss?: ((id: string, code: string) => Promise<void> | void) | undefined;
|
|
13
13
|
shouldGenerate: () => boolean;
|
|
14
|
+
shouldGenerateBuild?: (() => boolean) | undefined;
|
|
14
15
|
}
|
|
15
|
-
export declare function
|
|
16
|
+
export declare function createViteCssGenerationPlugins(options: ViteCssGenerationOptions): Plugin[];
|
|
16
17
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ViteFrameworkCssPipelineContext, ViteFrameworkCssPipelineStrategy } from './shared/framework-strategy';
|
|
2
|
+
export declare function resolveViteServeRootMiniProgramImportShell(options: {
|
|
3
|
+
css: string;
|
|
4
|
+
cssPipelineContext: ViteFrameworkCssPipelineContext;
|
|
5
|
+
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
6
|
+
isWebGeneratorTarget: boolean;
|
|
7
|
+
outputFile: string;
|
|
8
|
+
}): string | undefined;
|
|
@@ -12,6 +12,7 @@ export interface WeappTailwindcssVitePlugin {
|
|
|
12
12
|
}
|
|
13
13
|
export interface ViteFrameworkBranchContext {
|
|
14
14
|
frameworkName: ViteFrameworkName;
|
|
15
|
+
adaptWatchCssBeforeFrameworkCache?: boolean;
|
|
15
16
|
createExtraPlugins?: (context: ViteFrameworkExtraPluginContext) => Plugin[];
|
|
16
17
|
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
17
18
|
getExtraPluginPlatform?: () => ViteFrameworkExtraPluginPlatform;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TailwindInlineSourceCandidates, TailwindSourceEntry } from '../../tailwindcss/source-scan';
|
|
2
|
+
import type { ICustomAttributesEntities } from '../../types';
|
|
2
3
|
import type { IArbitraryValues } from '../../types/shared';
|
|
3
4
|
export interface SourceCandidateStore {
|
|
4
5
|
syncSource: (id: string, source: string) => Promise<void>;
|
|
@@ -51,6 +52,8 @@ interface ScanSourceCandidateRootOptions {
|
|
|
51
52
|
}
|
|
52
53
|
export interface SourceCandidateCollectorOptions {
|
|
53
54
|
bareArbitraryValues?: IArbitraryValues['bareArbitraryValues'] | undefined;
|
|
55
|
+
customAttributesEntities?: ICustomAttributesEntities | undefined;
|
|
56
|
+
disabledDefaultTemplateHandler?: boolean | undefined;
|
|
54
57
|
extractor?: ((source: string, extension: string) => Promise<Iterable<string>> | Iterable<string>) | undefined;
|
|
55
58
|
}
|
|
56
59
|
export declare function isSourceCandidateRequest(id: string): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ResolvedConfig } from 'vite';
|
|
2
|
+
export interface FrameworkWatchCssAdaptationOptions {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
isWatchBuild: boolean;
|
|
5
|
+
isWebGeneratorBranch: boolean;
|
|
6
|
+
ownsTailwindGeneration: boolean;
|
|
7
|
+
platform?: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare function shouldAdaptFrameworkWatchCssBeforeCache(options: FrameworkWatchCssAdaptationOptions): boolean;
|
|
10
|
+
export declare function wrapViteCssPostTransform(config: ResolvedConfig, transformCss: (css: string, id: string) => Promise<string>): boolean;
|
|
@@ -14,11 +14,13 @@ interface ChunkLike {
|
|
|
14
14
|
interface ModuleLike {
|
|
15
15
|
context?: string;
|
|
16
16
|
dependencies?: Array<unknown> | Iterable<unknown>;
|
|
17
|
+
identifier?: () => string;
|
|
17
18
|
modules?: ModuleLike[] | Iterable<ModuleLike>;
|
|
18
19
|
request?: string;
|
|
19
20
|
resource?: string;
|
|
20
21
|
rootModule?: ModuleLike;
|
|
21
22
|
userRequest?: string;
|
|
23
|
+
type?: string;
|
|
22
24
|
}
|
|
23
25
|
interface ChunkGraphLike {
|
|
24
26
|
getChunkModulesIterable?: (chunk: ChunkLike) => Iterable<ModuleLike> | undefined;
|
|
@@ -42,6 +44,10 @@ export declare function createWebpackCssAssetResourceMap(chunks: Iterable<ChunkL
|
|
|
42
44
|
context?: string;
|
|
43
45
|
resource?: string;
|
|
44
46
|
}) => string | undefined): Map<string, Set<string>>;
|
|
47
|
+
export declare function createWebpackDirectCssAssetResourceMap(chunks: Iterable<ChunkLike>, chunkGraph: ChunkGraphLike | undefined, cssMatcher: (file: string) => boolean, normalizeResource: (resource: string, issuer?: {
|
|
48
|
+
context?: string;
|
|
49
|
+
resource?: string;
|
|
50
|
+
}) => string | undefined): Map<string, Set<string>>;
|
|
45
51
|
export declare function createAssetHashByChunkMap(chunks: Iterable<ChunkLike>): Map<string, string>;
|
|
46
52
|
export declare function createRuntimeAwareCssHash(assetHash: string | undefined, sourceHash: string, runtimeSetHash: string): string;
|
|
47
53
|
export declare function hasWatchChanges(compiler: WebpackWatchChangeLike): boolean;
|
|
@@ -20,6 +20,7 @@ export declare function createWebpackCssSourceResolvers(options: {
|
|
|
20
20
|
};
|
|
21
21
|
cssAssetFiles: Iterable<string>;
|
|
22
22
|
cssAssetResources: ReadonlyMap<string, ReadonlySet<string>>;
|
|
23
|
+
directCssAssetResources: ReadonlyMap<string, ReadonlySet<string>>;
|
|
23
24
|
cssHandlerOptionsCache: Map<string, WebpackCssHandlerOptions>;
|
|
24
25
|
cssSources: Map<string, {
|
|
25
26
|
css: string | undefined;
|
|
@@ -37,12 +37,14 @@ export declare function stripTrailingLineWhitespace(source: string): string;
|
|
|
37
37
|
export declare function pruneWebpackCssHandlerOptionCaches(cssHandlerOptionsCache: Map<string, WebpackCssHandlerOptions>, cssUserHandlerOptionsCache: Map<string, WebpackCssHandlerOptions>, activeCssFiles: Set<string>): void;
|
|
38
38
|
export declare function resolveWebpackGeneratorRawSource(rawSource: string, cssHandlerOptions: WebpackCssHandlerOptions): string;
|
|
39
39
|
export declare function shouldConsumeWebpackLoaderGeneratedCss(options: {
|
|
40
|
+
allowMarkerlessRegistryMatch?: boolean | undefined;
|
|
40
41
|
hasBundlerGeneratedCssMarker: boolean;
|
|
41
42
|
loaderGeneratedClassSet?: Set<string> | undefined;
|
|
42
43
|
sourceCandidates?: Set<string> | undefined;
|
|
43
44
|
shouldRegenerateExplicitTailwindV4CssSource: boolean;
|
|
44
45
|
watchMode?: boolean | undefined;
|
|
45
46
|
}): boolean;
|
|
47
|
+
export declare function hasDeferredWebpackGeneratedCss(source: string, generatedClassSets: Iterable<ReadonlySet<string>>): boolean;
|
|
46
48
|
export interface WebpackGeneratorUserCssSource {
|
|
47
49
|
css: string;
|
|
48
50
|
processed: boolean;
|
|
@@ -33,6 +33,7 @@ export interface WebpackCssImportRewriteRuntimeOptions {
|
|
|
33
33
|
registerCssSourceFile?: (source: WebpackCssSourceRegistration) => void;
|
|
34
34
|
}
|
|
35
35
|
export interface WebpackCssImportRewriteLoaderOptions {
|
|
36
|
+
generateCss?: boolean | undefined;
|
|
36
37
|
tailwindcssImportRewrite?: WebpackCssImportRewriteRuntimeOptions;
|
|
37
38
|
tailwindcssImportRewriteRuntimeKey?: string;
|
|
38
39
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type webpack from 'webpack';
|
|
2
|
+
import type { WebpackCssImportRewriteLoaderOptions } from './runtime-registry';
|
|
3
|
+
declare const WeappTwCssGenerationLoader: webpack.LoaderDefinitionFunction<WebpackCssImportRewriteLoaderOptions>;
|
|
4
|
+
export default WeappTwCssGenerationLoader;
|
|
@@ -3,6 +3,9 @@ import type { WebpackCssImportRewriteLoaderOptions } from './runtime-registry';
|
|
|
3
3
|
import { Buffer } from 'node:buffer';
|
|
4
4
|
interface CssImportRewriteLoaderOptions extends WebpackCssImportRewriteLoaderOptions {
|
|
5
5
|
}
|
|
6
|
+
export declare function resolveWebpackCssPipelineLoaderOptions(options: CssImportRewriteLoaderOptions | undefined): CssImportRewriteLoaderOptions | undefined;
|
|
7
|
+
export declare function generateCssForWebpackPipeline(source: string, loaderContext: webpack.LoaderContext<CssImportRewriteLoaderOptions>, options: CssImportRewriteLoaderOptions | undefined): Promise<string | undefined>;
|
|
8
|
+
export declare function registerWebpackCssGeneratorSource(source: string, resourcePath: string, options: CssImportRewriteLoaderOptions | undefined): void | Promise<void> | undefined;
|
|
6
9
|
export declare function transformCssImportRewriteSource(source: string | Buffer, options: CssImportRewriteLoaderOptions | undefined): string | Buffer<ArrayBufferLike>;
|
|
7
10
|
declare const WeappTwCssImportRewriteLoader: webpack.LoaderDefinitionFunction<CssImportRewriteLoaderOptions>;
|
|
8
11
|
export default WeappTwCssImportRewriteLoader;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveMpxPlatform } from "./framework.mjs";
|
|
2
|
-
import { Ft as resolveValidTailwindV4Candidates$1, Mt as resolveCssMacroTailwindV4Source, O as resolveBooleanObjectOption, Pt as loadTailwindV4DesignSystem, _t as createTailwindV4Engine$1, a as resolveGeneratorRuntimeBranch, d as resolveTailwindV4SourceFromRuntime, i as normalizeWeappTailwindcssGeneratorOptions } from "./generator-
|
|
3
|
-
import { c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssRuntimeFromContext, u as getRuntimeClassSetSignatureWithSources } from "./tailwindcss-
|
|
2
|
+
import { Ft as resolveValidTailwindV4Candidates$1, Mt as resolveCssMacroTailwindV4Source, O as resolveBooleanObjectOption, Pt as loadTailwindV4DesignSystem, _t as createTailwindV4Engine$1, a as resolveGeneratorRuntimeBranch, d as resolveTailwindV4SourceFromRuntime, i as normalizeWeappTailwindcssGeneratorOptions } from "./generator-CEo920So.mjs";
|
|
3
|
+
import { c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssRuntimeFromContext, u as getRuntimeClassSetSignatureWithSources } from "./tailwindcss-xs704TRw.mjs";
|
|
4
4
|
import { i as isMap, n as defuOverrideArray } from "./utils-MVwpU07P.mjs";
|
|
5
5
|
import { b as md5Hash, d as jsStringEscape, h as shouldEnableArbitraryValueFallback, l as getReplacement, m as resolveClassNameTransformWithResult, o as jsHandler, p as decodeUnicode2, t as createTemplateHandler, u as getReplacementCacheStore, y as createDebug } from "./wxml-DdGdeqaH.mjs";
|
|
6
6
|
import { getDefaultOptions, resolveDefaultCssPreflight } from "./defaults.mjs";
|
|
@@ -1200,7 +1200,9 @@ function createInternalCompilerContext(opts) {
|
|
|
1200
1200
|
const cssCalcOptions = applyV4CssCalcDefaults(ctx.cssCalc, tailwindRuntime);
|
|
1201
1201
|
ctx.cssCalc = cssCalcOptions;
|
|
1202
1202
|
syncLegacyFieldsToCssOptions(ctx);
|
|
1203
|
-
const
|
|
1203
|
+
const customAttributesEntities = toCustomAttributesEntities(ctx.customAttributes);
|
|
1204
|
+
ctx.customAttributesEntities = customAttributesEntities;
|
|
1205
|
+
const { styleHandler, jsHandler, templateHandler } = createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions, tailwindRuntime.majorVersion);
|
|
1204
1206
|
ctx.styleHandler = styleHandler;
|
|
1205
1207
|
ctx.jsHandler = jsHandler;
|
|
1206
1208
|
ctx.templateHandler = templateHandler;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
|
|
2
2
|
const require_framework = require("./framework.js");
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
3
|
+
const require_generator = require("./generator-CEnUsjed.js");
|
|
4
|
+
const require_tailwindcss = require("./tailwindcss-KBYPJ2DW.js");
|
|
5
5
|
require("./utils-CuKLf1Zv.js");
|
|
6
6
|
const require_wxml = require("./wxml-Ce10eREX.js");
|
|
7
7
|
const require_defaults = require("./defaults.js");
|
|
@@ -1206,7 +1206,9 @@ function createInternalCompilerContext(opts) {
|
|
|
1206
1206
|
const cssCalcOptions = require_tailwindcss.applyV4CssCalcDefaults(ctx.cssCalc, tailwindRuntime);
|
|
1207
1207
|
ctx.cssCalc = cssCalcOptions;
|
|
1208
1208
|
syncLegacyFieldsToCssOptions(ctx);
|
|
1209
|
-
const
|
|
1209
|
+
const customAttributesEntities = toCustomAttributesEntities(ctx.customAttributes);
|
|
1210
|
+
ctx.customAttributesEntities = customAttributesEntities;
|
|
1211
|
+
const { styleHandler, jsHandler, templateHandler } = createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions, tailwindRuntime.majorVersion);
|
|
1210
1212
|
ctx.styleHandler = styleHandler;
|
|
1211
1213
|
ctx.jsHandler = jsHandler;
|
|
1212
1214
|
ctx.templateHandler = templateHandler;
|
package/dist/core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_context = require("./context-
|
|
2
|
+
const require_context = require("./context-VeFq_8vW.js");
|
|
3
3
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
4
4
|
//#region src/core.ts
|
|
5
5
|
const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
|
package/dist/core.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as createTailwindRuntimeReadyPromise, o as shouldSkipJsTransform, t as getCompilerContext, u as ensureRuntimeClassSet } from "./context-
|
|
1
|
+
import { l as createTailwindRuntimeReadyPromise, o as shouldSkipJsTransform, t as getCompilerContext, u as ensureRuntimeClassSet } from "./context-BgGWVAmN.mjs";
|
|
2
2
|
import { defuOverrideArray } from "@weapp-tailwindcss/shared";
|
|
3
3
|
//#region src/core.ts
|
|
4
4
|
const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
|
package/dist/css-macro.mjs
CHANGED
|
@@ -1348,7 +1348,7 @@ function normalizeConfigDirective(css, config) {
|
|
|
1348
1348
|
//#region src/bundlers/shared/generator-css/markers.ts
|
|
1349
1349
|
const TAILWIND_V4_BANNER_RE = /\/\*!\s*tailwindcss v4\./;
|
|
1350
1350
|
const TAILWIND_ESCAPED_UTILITY_MARKER_RE = /\.[^,{]{0,512}(?:\\:|\\\[|\\#)/;
|
|
1351
|
-
const TAILWIND_ROOT_THEME_MARKER_RE = /(?::host
|
|
1351
|
+
const TAILWIND_ROOT_THEME_MARKER_RE = /(?::root\s*,\s*:host|:host\s*,\s*page\s*,\s*\.tw-root\s*,\s*wx-root-portal-content)[^{]{0,256}\{[^}]{0,4096}(?:--spacing\b|--(?:color|text|font|default|radius)-)/;
|
|
1352
1352
|
const GENERATOR_PLACEHOLDER_MARKER_RE = /\/\*!\s*weapp-tailwindcss generator-placeholder\s*\*\//i;
|
|
1353
1353
|
const GENERATOR_PLACEHOLDER_MARKER_GLOBAL_RE = /\/\*!\s*weapp-tailwindcss generator-placeholder\s*\*\/\s*/gi;
|
|
1354
1354
|
const TAILWIND_BANNER_PREFIX_RE = /^\/\*!\s*tailwindcss v[^*]*\*\/\s*/i;
|
|
@@ -1414,7 +1414,7 @@ function hasTailwindGeneratedCss(rawSource) {
|
|
|
1414
1414
|
}
|
|
1415
1415
|
function hasTailwindGeneratedCssMarkers(rawSource) {
|
|
1416
1416
|
if (rawSource.includes("--tw-") || rawSource.includes("tailwindcss v") || rawSource.includes(":not(#\\#)") || GENERATOR_PLACEHOLDER_MARKER_RE.test(rawSource)) return true;
|
|
1417
|
-
if (!rawSource.includes("\\:") && !rawSource.includes("\\[") && !rawSource.includes("\\#") && !rawSource.includes("--color-") && !rawSource.includes("--spacing
|
|
1417
|
+
if (!rawSource.includes("\\:") && !rawSource.includes("\\[") && !rawSource.includes("\\#") && !rawSource.includes("--color-") && !rawSource.includes("--spacing") && !rawSource.includes("--text-") && !rawSource.includes("--font-") && !rawSource.includes("--font-weight-") && !rawSource.includes("--default-") && !rawSource.includes("--radius-")) return false;
|
|
1418
1418
|
return TAILWIND_ESCAPED_UTILITY_MARKER_RE.test(rawSource) || TAILWIND_ROOT_THEME_MARKER_RE.test(rawSource);
|
|
1419
1419
|
}
|
|
1420
1420
|
//#endregion
|
|
@@ -1839,8 +1839,22 @@ function removeTailwindV4GeneratorAtRulesFallback(source) {
|
|
|
1839
1839
|
function isTailwindGeneratedPreflightComment(text) {
|
|
1840
1840
|
return text.includes("cssremedy") || text.includes("Use the user's configured") || text.includes("tailwindlabs/tailwindcss") || text.includes("Prevent padding and border from affecting element width") || text.includes("Remove default margins and padding") || text.includes("Deprecated") || text.includes("Reset all borders") || text.includes("Add the correct text decoration") || text.includes("Make elements with the HTML hidden attribute stay hidden") || text.includes("Inherit font styles in all browsers") || text.includes("Add the correct height in Firefox") || text.includes("Remove the default font size and weight for headings") || text.includes("Reset links to optimize for opt-in styling") || text.includes("Add the correct font weight in Edge and Safari") || text.includes("Use the user's configured `mono` font-family") || text.includes("Add the correct font size in all browsers") || text.includes("Prevent `sub` and `sup` elements from affecting the line height") || text.includes("Remove text indentation from table contents") || text.includes("Use the modern Firefox focus style") || text.includes("Add the correct vertical alignment") || text.includes("Add the correct display") || text.includes("Make lists unstyled by default") || text.includes("Make replaced elements `display: block` by default") || text.includes("Constrain images and videos to the parent width") || text.includes("Restore default font weight") || text.includes("Restore indentation") || text.includes("Restore space after button") || text.includes("Prevent resizing textareas horizontally") || text.includes("Remove the inner padding in Chrome and Safari") || text.includes("Ensure date/time inputs have the same height") || text.includes("Prevent height from changing on date/time inputs") || text.includes("Remove excess padding from pseudo-elements") || text.includes("Center dropdown marker shown on inputs") || text.includes("Remove the additional `:invalid` styles") || text.includes("Correct the inability to style the border radius") || text.includes("Correct the cursor style of increment and decrement buttons");
|
|
1841
1841
|
}
|
|
1842
|
+
const TAILWIND_GENERATED_THEME_SCOPE_SELECTORS = /* @__PURE__ */ new Set([
|
|
1843
|
+
":host",
|
|
1844
|
+
":root",
|
|
1845
|
+
"page",
|
|
1846
|
+
".tw-root",
|
|
1847
|
+
"wx-root-portal-content"
|
|
1848
|
+
]);
|
|
1849
|
+
function isTailwindGeneratedThemeScopeSelector(selector) {
|
|
1850
|
+
const selectors = selector.split(",").map((item) => item.trim()).filter(Boolean);
|
|
1851
|
+
const selectorSet = new Set(selectors);
|
|
1852
|
+
if (selectorSet.size !== selectors.length) return false;
|
|
1853
|
+
if (!selectors.every((item) => TAILWIND_GENERATED_THEME_SCOPE_SELECTORS.has(item))) return false;
|
|
1854
|
+
return selectorSet.size === 2 && selectorSet.has(":root") && selectorSet.has(":host") || selectorSet.size === 4 && selectorSet.has(":host") && selectorSet.has("page") && selectorSet.has(".tw-root") && selectorSet.has("wx-root-portal-content");
|
|
1855
|
+
}
|
|
1842
1856
|
function isTailwindGeneratedThemeRule(selector, node) {
|
|
1843
|
-
if (
|
|
1857
|
+
if (!isTailwindGeneratedThemeScopeSelector(selector)) return false;
|
|
1844
1858
|
return node.nodes?.some((child) => child.type === "decl" && /^--(?:color|spacing|text|font|default|radius|tw-)/.test(child.prop)) ?? false;
|
|
1845
1859
|
}
|
|
1846
1860
|
function isTailwindGeneratedPreflightRule(selector, node) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveUniUtsPlatform as resolveUniUtsPlatform$1 } from "./framework.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { c as withCssMacroStyleOptions, i as hasCssMacroTailwindV4Source, o as transformCssMacroCss, s as transformCssMacroTailwindV4Source, t as hasCssMacroStyleOptions } from "./auto-2dg_uhEJ.mjs";
|
|
3
3
|
import { t as omitUndefined } from "./object-BJSWl-E5.mjs";
|
|
4
4
|
import "./utils-MVwpU07P.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
@@ -1343,7 +1343,7 @@ function normalizeConfigDirective(css, config) {
|
|
|
1343
1343
|
//#region src/bundlers/shared/generator-css/markers.ts
|
|
1344
1344
|
const TAILWIND_V4_BANNER_RE = /\/\*!\s*tailwindcss v4\./;
|
|
1345
1345
|
const TAILWIND_ESCAPED_UTILITY_MARKER_RE = /\.[^,{]{0,512}(?:\\:|\\\[|\\#)/;
|
|
1346
|
-
const TAILWIND_ROOT_THEME_MARKER_RE = /(?::host
|
|
1346
|
+
const TAILWIND_ROOT_THEME_MARKER_RE = /(?::root\s*,\s*:host|:host\s*,\s*page\s*,\s*\.tw-root\s*,\s*wx-root-portal-content)[^{]{0,256}\{[^}]{0,4096}(?:--spacing\b|--(?:color|text|font|default|radius)-)/;
|
|
1347
1347
|
const GENERATOR_PLACEHOLDER_MARKER_RE = /\/\*!\s*weapp-tailwindcss generator-placeholder\s*\*\//i;
|
|
1348
1348
|
const GENERATOR_PLACEHOLDER_MARKER_GLOBAL_RE = /\/\*!\s*weapp-tailwindcss generator-placeholder\s*\*\/\s*/gi;
|
|
1349
1349
|
const TAILWIND_BANNER_PREFIX_RE = /^\/\*!\s*tailwindcss v[^*]*\*\/\s*/i;
|
|
@@ -1409,7 +1409,7 @@ function hasTailwindGeneratedCss(rawSource) {
|
|
|
1409
1409
|
}
|
|
1410
1410
|
function hasTailwindGeneratedCssMarkers(rawSource) {
|
|
1411
1411
|
if (rawSource.includes("--tw-") || rawSource.includes("tailwindcss v") || rawSource.includes(":not(#\\#)") || GENERATOR_PLACEHOLDER_MARKER_RE.test(rawSource)) return true;
|
|
1412
|
-
if (!rawSource.includes("\\:") && !rawSource.includes("\\[") && !rawSource.includes("\\#") && !rawSource.includes("--color-") && !rawSource.includes("--spacing
|
|
1412
|
+
if (!rawSource.includes("\\:") && !rawSource.includes("\\[") && !rawSource.includes("\\#") && !rawSource.includes("--color-") && !rawSource.includes("--spacing") && !rawSource.includes("--text-") && !rawSource.includes("--font-") && !rawSource.includes("--font-weight-") && !rawSource.includes("--default-") && !rawSource.includes("--radius-")) return false;
|
|
1413
1413
|
return TAILWIND_ESCAPED_UTILITY_MARKER_RE.test(rawSource) || TAILWIND_ROOT_THEME_MARKER_RE.test(rawSource);
|
|
1414
1414
|
}
|
|
1415
1415
|
//#endregion
|
|
@@ -1834,8 +1834,22 @@ function removeTailwindV4GeneratorAtRulesFallback(source) {
|
|
|
1834
1834
|
function isTailwindGeneratedPreflightComment(text) {
|
|
1835
1835
|
return text.includes("cssremedy") || text.includes("Use the user's configured") || text.includes("tailwindlabs/tailwindcss") || text.includes("Prevent padding and border from affecting element width") || text.includes("Remove default margins and padding") || text.includes("Deprecated") || text.includes("Reset all borders") || text.includes("Add the correct text decoration") || text.includes("Make elements with the HTML hidden attribute stay hidden") || text.includes("Inherit font styles in all browsers") || text.includes("Add the correct height in Firefox") || text.includes("Remove the default font size and weight for headings") || text.includes("Reset links to optimize for opt-in styling") || text.includes("Add the correct font weight in Edge and Safari") || text.includes("Use the user's configured `mono` font-family") || text.includes("Add the correct font size in all browsers") || text.includes("Prevent `sub` and `sup` elements from affecting the line height") || text.includes("Remove text indentation from table contents") || text.includes("Use the modern Firefox focus style") || text.includes("Add the correct vertical alignment") || text.includes("Add the correct display") || text.includes("Make lists unstyled by default") || text.includes("Make replaced elements `display: block` by default") || text.includes("Constrain images and videos to the parent width") || text.includes("Restore default font weight") || text.includes("Restore indentation") || text.includes("Restore space after button") || text.includes("Prevent resizing textareas horizontally") || text.includes("Remove the inner padding in Chrome and Safari") || text.includes("Ensure date/time inputs have the same height") || text.includes("Prevent height from changing on date/time inputs") || text.includes("Remove excess padding from pseudo-elements") || text.includes("Center dropdown marker shown on inputs") || text.includes("Remove the additional `:invalid` styles") || text.includes("Correct the inability to style the border radius") || text.includes("Correct the cursor style of increment and decrement buttons");
|
|
1836
1836
|
}
|
|
1837
|
+
const TAILWIND_GENERATED_THEME_SCOPE_SELECTORS = /* @__PURE__ */ new Set([
|
|
1838
|
+
":host",
|
|
1839
|
+
":root",
|
|
1840
|
+
"page",
|
|
1841
|
+
".tw-root",
|
|
1842
|
+
"wx-root-portal-content"
|
|
1843
|
+
]);
|
|
1844
|
+
function isTailwindGeneratedThemeScopeSelector(selector) {
|
|
1845
|
+
const selectors = selector.split(",").map((item) => item.trim()).filter(Boolean);
|
|
1846
|
+
const selectorSet = new Set(selectors);
|
|
1847
|
+
if (selectorSet.size !== selectors.length) return false;
|
|
1848
|
+
if (!selectors.every((item) => TAILWIND_GENERATED_THEME_SCOPE_SELECTORS.has(item))) return false;
|
|
1849
|
+
return selectorSet.size === 2 && selectorSet.has(":root") && selectorSet.has(":host") || selectorSet.size === 4 && selectorSet.has(":host") && selectorSet.has("page") && selectorSet.has(".tw-root") && selectorSet.has("wx-root-portal-content");
|
|
1850
|
+
}
|
|
1837
1851
|
function isTailwindGeneratedThemeRule(selector, node) {
|
|
1838
|
-
if (
|
|
1852
|
+
if (!isTailwindGeneratedThemeScopeSelector(selector)) return false;
|
|
1839
1853
|
return node.nodes?.some((child) => child.type === "decl" && /^--(?:color|spacing|text|font|default|radius|tw-)/.test(child.prop)) ?? false;
|
|
1840
1854
|
}
|
|
1841
1855
|
function isTailwindGeneratedPreflightRule(selector, node) {
|
package/dist/generator.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_generator = require("./generator-CEnUsjed.js");
|
|
3
3
|
exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
|
|
4
4
|
exports.createWeappTailwindcssGeneratorFromRuntime = require_generator.createWeappTailwindcssGeneratorFromRuntime;
|
|
5
5
|
exports.normalizeWeappTailwindcssGeneratorOptions = require_generator.normalizeWeappTailwindcssGeneratorOptions;
|
package/dist/generator.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { bt as transformTailwindV4CssToWeapp, d as resolveTailwindV4SourceFromRuntime, f as resolveTailwindV4SourceFromRuntimeOptions, i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromRuntime, p as resolveTailwindV4SourceOptionsFromRuntime, r as resolveTailwindSourceFromRuntime, t as createWeappTailwindcssGenerator, u as resolveTailwindV4Source, yt as transformTailwindV4CssByTarget } from "./generator-
|
|
1
|
+
import { bt as transformTailwindV4CssToWeapp, d as resolveTailwindV4SourceFromRuntime, f as resolveTailwindV4SourceFromRuntimeOptions, i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromRuntime, p as resolveTailwindV4SourceOptionsFromRuntime, r as resolveTailwindSourceFromRuntime, t as createWeappTailwindcssGenerator, u as resolveTailwindV4Source, yt as transformTailwindV4CssByTarget } from "./generator-CEo920So.mjs";
|
|
2
2
|
export { createWeappTailwindcssGenerator, createWeappTailwindcssGeneratorFromRuntime, normalizeWeappTailwindcssGeneratorOptions, resolveTailwindSourceFromRuntime, resolveTailwindV4Source, resolveTailwindV4SourceFromRuntime, resolveTailwindV4SourceFromRuntimeOptions, resolveTailwindV4SourceOptionsFromRuntime, transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp };
|