weapp-tailwindcss 2.6.0 → 2.6.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 CHANGED
@@ -1,15 +1,17 @@
1
1
  'use strict';
2
2
 
3
- var options = require('./options-487394fa.js');
3
+ var options = require('./options-6a265426.js');
4
4
  require('micromatch');
5
5
  require('@babel/types');
6
6
  require('@babel/generator');
7
7
  require('@babel/parser');
8
8
  require('@babel/traverse');
9
9
  require('./replace.js');
10
- require('./shared-ae7dd073.js');
10
+ require('./dic-05980807.js');
11
+ require('./shared-4eed0e5c.js');
12
+ require('./defaults-0d9846f4.js');
11
13
  require('postcss');
12
- require('./postcss-b53e9504.js');
14
+ require('./postcss-cf8b998a.js');
13
15
  require('postcss-selector-parser');
14
16
  require('@csstools/postcss-is-pseudo-class');
15
17
  require('node:path');
package/dist/cli.mjs CHANGED
@@ -1,13 +1,15 @@
1
- import { g as getOptions, c as createPatch } from './options-f7b71f03.mjs';
1
+ import { g as getOptions, c as createPatch } from './options-800ea85a.mjs';
2
2
  import 'micromatch';
3
3
  import '@babel/types';
4
4
  import '@babel/generator';
5
5
  import '@babel/parser';
6
6
  import '@babel/traverse';
7
7
  import './replace.mjs';
8
- import './shared-7c88fb94.mjs';
8
+ import './dic-3790a3a4.mjs';
9
+ import './shared-686bfc32.mjs';
10
+ import './defaults-c7f00aae.mjs';
9
11
  import 'postcss';
10
- import './postcss-760298ba.mjs';
12
+ import './postcss-53e2ad95.mjs';
11
13
  import 'postcss-selector-parser';
12
14
  import '@csstools/postcss-is-pseudo-class';
13
15
  import 'node:path';
@@ -0,0 +1,139 @@
1
+ 'use strict';
2
+
3
+ var dic = require('./dic-05980807.js');
4
+
5
+ function isRegexp(value) {
6
+ return Object.prototype.toString.call(value) === '[object RegExp]';
7
+ }
8
+ function isMap(value) {
9
+ return Object.prototype.toString.call(value) === '[object Map]';
10
+ }
11
+ const noop = () => { };
12
+ function groupBy(arr, cb) {
13
+ if (!Array.isArray(arr)) {
14
+ throw new TypeError('expected an array for first argument');
15
+ }
16
+ if (typeof cb !== 'function') {
17
+ throw new TypeError('expected a function for second argument');
18
+ }
19
+ const result = {};
20
+ for (const item of arr) {
21
+ const bucketCategory = cb(item);
22
+ const bucket = result[bucketCategory];
23
+ if (Array.isArray(bucket)) {
24
+ result[bucketCategory].push(item);
25
+ }
26
+ else {
27
+ result[bucketCategory] = [item];
28
+ }
29
+ }
30
+ return result;
31
+ }
32
+ function getGroupedEntries(entries, options) {
33
+ const { cssMatcher, htmlMatcher, jsMatcher, wxsMatcher } = options;
34
+ const groupedEntries = groupBy(entries, ([file]) => {
35
+ if (cssMatcher(file)) {
36
+ return 'css';
37
+ }
38
+ else if (htmlMatcher(file)) {
39
+ return 'html';
40
+ }
41
+ else if (jsMatcher(file) || wxsMatcher(file)) {
42
+ return 'js';
43
+ }
44
+ else {
45
+ return 'other';
46
+ }
47
+ });
48
+ return groupedEntries;
49
+ }
50
+
51
+ const defaultOptions = {
52
+ cssMatcher: (file) => /.+\.(?:wx|ac|jx|tt|q|c)ss$/.test(file),
53
+ htmlMatcher: (file) => /.+\.(?:(?:(?:wx|ax|jx|ks|tt|q)ml)|swan)$/.test(file),
54
+ jsMatcher: (file) => {
55
+ if (file.includes('node_modules')) {
56
+ return false;
57
+ }
58
+ return /.+\.[cm]?js?$/.test(file);
59
+ },
60
+ mainCssChunkMatcher: (file, appType) => {
61
+ switch (appType) {
62
+ case 'uni-app': {
63
+ return /^common\/main/.test(file);
64
+ }
65
+ case 'uni-app-vite': {
66
+ return file.startsWith('app') || /^common\/main/.test(file);
67
+ }
68
+ case 'mpx': {
69
+ return file.startsWith('app');
70
+ }
71
+ case 'taro': {
72
+ return file.startsWith('app');
73
+ }
74
+ case 'remax': {
75
+ return file.startsWith('app');
76
+ }
77
+ case 'rax': {
78
+ return file.startsWith('bundle');
79
+ }
80
+ case 'native': {
81
+ return file.startsWith('app');
82
+ }
83
+ case 'kbone': {
84
+ return /^(?:common\/)?miniprogram-app/.test(file);
85
+ }
86
+ default: {
87
+ return true;
88
+ }
89
+ }
90
+ },
91
+ wxsMatcher: (file) => {
92
+ return false;
93
+ },
94
+ cssPreflight: {
95
+ 'box-sizing': 'border-box',
96
+ 'border-width': '0',
97
+ 'border-style': 'solid',
98
+ 'border-color': 'currentColor'
99
+ },
100
+ cssPreflightRange: 'view',
101
+ replaceUniversalSelectorWith: 'view',
102
+ disabled: false,
103
+ customRuleCallback: noop,
104
+ onLoad: noop,
105
+ onStart: noop,
106
+ onEnd: noop,
107
+ onUpdate: noop,
108
+ customAttributes: {},
109
+ customReplaceDictionary: dic.SimpleMappingChars2String,
110
+ supportCustomLengthUnitsPatch: {
111
+ units: ['rpx'],
112
+ dangerousOptions: {
113
+ gteVersion: '3.0.0',
114
+ lengthUnitsFilePath: 'lib/util/dataTypes.js',
115
+ packageName: 'tailwindcss',
116
+ variableName: 'lengthUnits',
117
+ overwrite: true
118
+ }
119
+ },
120
+ appType: undefined,
121
+ arbitraryValues: {
122
+ allowDoubleQuotes: false
123
+ },
124
+ cssChildCombinatorReplaceValue: 'view + view',
125
+ inlineWxs: false,
126
+ injectAdditionalCssVarScope: false,
127
+ jsPreserveClass: (keyword) => {
128
+ if (keyword === '*') {
129
+ return true;
130
+ }
131
+ return false;
132
+ }
133
+ };
134
+
135
+ exports.defaultOptions = defaultOptions;
136
+ exports.getGroupedEntries = getGroupedEntries;
137
+ exports.isMap = isMap;
138
+ exports.isRegexp = isRegexp;
139
+ exports.noop = noop;
@@ -0,0 +1,133 @@
1
+ import { S as SimpleMappingChars2String } from './dic-3790a3a4.mjs';
2
+
3
+ function isRegexp(value) {
4
+ return Object.prototype.toString.call(value) === '[object RegExp]';
5
+ }
6
+ function isMap(value) {
7
+ return Object.prototype.toString.call(value) === '[object Map]';
8
+ }
9
+ const noop = () => { };
10
+ function groupBy(arr, cb) {
11
+ if (!Array.isArray(arr)) {
12
+ throw new TypeError('expected an array for first argument');
13
+ }
14
+ if (typeof cb !== 'function') {
15
+ throw new TypeError('expected a function for second argument');
16
+ }
17
+ const result = {};
18
+ for (const item of arr) {
19
+ const bucketCategory = cb(item);
20
+ const bucket = result[bucketCategory];
21
+ if (Array.isArray(bucket)) {
22
+ result[bucketCategory].push(item);
23
+ }
24
+ else {
25
+ result[bucketCategory] = [item];
26
+ }
27
+ }
28
+ return result;
29
+ }
30
+ function getGroupedEntries(entries, options) {
31
+ const { cssMatcher, htmlMatcher, jsMatcher, wxsMatcher } = options;
32
+ const groupedEntries = groupBy(entries, ([file]) => {
33
+ if (cssMatcher(file)) {
34
+ return 'css';
35
+ }
36
+ else if (htmlMatcher(file)) {
37
+ return 'html';
38
+ }
39
+ else if (jsMatcher(file) || wxsMatcher(file)) {
40
+ return 'js';
41
+ }
42
+ else {
43
+ return 'other';
44
+ }
45
+ });
46
+ return groupedEntries;
47
+ }
48
+
49
+ const defaultOptions = {
50
+ cssMatcher: (file) => /.+\.(?:wx|ac|jx|tt|q|c)ss$/.test(file),
51
+ htmlMatcher: (file) => /.+\.(?:(?:(?:wx|ax|jx|ks|tt|q)ml)|swan)$/.test(file),
52
+ jsMatcher: (file) => {
53
+ if (file.includes('node_modules')) {
54
+ return false;
55
+ }
56
+ return /.+\.[cm]?js?$/.test(file);
57
+ },
58
+ mainCssChunkMatcher: (file, appType) => {
59
+ switch (appType) {
60
+ case 'uni-app': {
61
+ return /^common\/main/.test(file);
62
+ }
63
+ case 'uni-app-vite': {
64
+ return file.startsWith('app') || /^common\/main/.test(file);
65
+ }
66
+ case 'mpx': {
67
+ return file.startsWith('app');
68
+ }
69
+ case 'taro': {
70
+ return file.startsWith('app');
71
+ }
72
+ case 'remax': {
73
+ return file.startsWith('app');
74
+ }
75
+ case 'rax': {
76
+ return file.startsWith('bundle');
77
+ }
78
+ case 'native': {
79
+ return file.startsWith('app');
80
+ }
81
+ case 'kbone': {
82
+ return /^(?:common\/)?miniprogram-app/.test(file);
83
+ }
84
+ default: {
85
+ return true;
86
+ }
87
+ }
88
+ },
89
+ wxsMatcher: (file) => {
90
+ return false;
91
+ },
92
+ cssPreflight: {
93
+ 'box-sizing': 'border-box',
94
+ 'border-width': '0',
95
+ 'border-style': 'solid',
96
+ 'border-color': 'currentColor'
97
+ },
98
+ cssPreflightRange: 'view',
99
+ replaceUniversalSelectorWith: 'view',
100
+ disabled: false,
101
+ customRuleCallback: noop,
102
+ onLoad: noop,
103
+ onStart: noop,
104
+ onEnd: noop,
105
+ onUpdate: noop,
106
+ customAttributes: {},
107
+ customReplaceDictionary: SimpleMappingChars2String,
108
+ supportCustomLengthUnitsPatch: {
109
+ units: ['rpx'],
110
+ dangerousOptions: {
111
+ gteVersion: '3.0.0',
112
+ lengthUnitsFilePath: 'lib/util/dataTypes.js',
113
+ packageName: 'tailwindcss',
114
+ variableName: 'lengthUnits',
115
+ overwrite: true
116
+ }
117
+ },
118
+ appType: undefined,
119
+ arbitraryValues: {
120
+ allowDoubleQuotes: false
121
+ },
122
+ cssChildCombinatorReplaceValue: 'view + view',
123
+ inlineWxs: false,
124
+ injectAdditionalCssVarScope: false,
125
+ jsPreserveClass: (keyword) => {
126
+ if (keyword === '*') {
127
+ return true;
128
+ }
129
+ return false;
130
+ }
131
+ };
132
+
133
+ export { isMap as a, defaultOptions as d, getGroupedEntries as g, isRegexp as i, noop as n };
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var defaults = require('./defaults-0d9846f4.js');
6
+ require('./dic-05980807.js');
7
+
8
+
9
+
10
+ exports.defaultOptions = defaults.defaultOptions;
@@ -0,0 +1,2 @@
1
+ export { d as defaultOptions } from './defaults-c7f00aae.mjs';
2
+ import './dic-3790a3a4.mjs';
@@ -104,66 +104,8 @@ const SimpleMappingChars2String = {
104
104
  };
105
105
  const SimpleMappingChars2StringEntries = Object.entries(SimpleMappingChars2String);
106
106
 
107
- const MAX_ASCII_CHAR_CODE = 127;
108
- function isAsciiNumber(code) {
109
- return code >= 48 && code <= 57;
110
- }
111
- function escape(selectors, options = {
112
- map: SimpleMappingChars2String
113
- }) {
114
- const { map = SimpleMappingChars2String } = options;
115
- const sb = [...selectors];
116
- for (let i = 0; i < sb.length; i++) {
117
- const char = sb[i];
118
- const code = char.codePointAt(0);
119
- const isCodeExisted = code !== undefined;
120
- const hit = map[char];
121
- if (isCodeExisted) {
122
- if (code > MAX_ASCII_CHAR_CODE) {
123
- sb[i] = 'u' + Number(code).toString(16);
124
- }
125
- else if (hit) {
126
- sb[i] = hit;
127
- }
128
- else if (i === 0) {
129
- if (isAsciiNumber(code)) {
130
- sb[i] = '_' + char;
131
- }
132
- else if (char === '-') {
133
- const nextChar = sb[i + 1];
134
- if (nextChar) {
135
- const nextCharCode = nextChar.codePointAt(0);
136
- if (nextCharCode && isAsciiNumber(nextCharCode)) {
137
- sb[i] = '_' + char;
138
- }
139
- }
140
- else if (nextChar === undefined) {
141
- sb[i] = '_' + char;
142
- }
143
- }
144
- }
145
- }
146
- }
147
- const res = sb.join('');
148
- return res;
149
- }
150
-
151
- function internalCssSelectorReplacer(selectors, options = {
152
- escapeMap: SimpleMappingChars2String
153
- }) {
154
- const { mangleContext, escapeMap } = options;
155
- if (mangleContext) {
156
- selectors = mangleContext.cssHandler(selectors);
157
- }
158
- return escape(selectors, {
159
- map: escapeMap
160
- });
161
- }
162
-
163
107
  exports.MappingChars2String = MappingChars2String;
164
108
  exports.MappingChars2StringEntries = MappingChars2StringEntries;
165
109
  exports.SYMBOL_TABLE = SYMBOL_TABLE;
166
110
  exports.SimpleMappingChars2String = SimpleMappingChars2String;
167
111
  exports.SimpleMappingChars2StringEntries = SimpleMappingChars2StringEntries;
168
- exports.escape = escape;
169
- exports.internalCssSelectorReplacer = internalCssSelectorReplacer;
@@ -102,60 +102,4 @@ const SimpleMappingChars2String = {
102
102
  };
103
103
  const SimpleMappingChars2StringEntries = Object.entries(SimpleMappingChars2String);
104
104
 
105
- const MAX_ASCII_CHAR_CODE = 127;
106
- function isAsciiNumber(code) {
107
- return code >= 48 && code <= 57;
108
- }
109
- function escape(selectors, options = {
110
- map: SimpleMappingChars2String
111
- }) {
112
- const { map = SimpleMappingChars2String } = options;
113
- const sb = [...selectors];
114
- for (let i = 0; i < sb.length; i++) {
115
- const char = sb[i];
116
- const code = char.codePointAt(0);
117
- const isCodeExisted = code !== undefined;
118
- const hit = map[char];
119
- if (isCodeExisted) {
120
- if (code > MAX_ASCII_CHAR_CODE) {
121
- sb[i] = 'u' + Number(code).toString(16);
122
- }
123
- else if (hit) {
124
- sb[i] = hit;
125
- }
126
- else if (i === 0) {
127
- if (isAsciiNumber(code)) {
128
- sb[i] = '_' + char;
129
- }
130
- else if (char === '-') {
131
- const nextChar = sb[i + 1];
132
- if (nextChar) {
133
- const nextCharCode = nextChar.codePointAt(0);
134
- if (nextCharCode && isAsciiNumber(nextCharCode)) {
135
- sb[i] = '_' + char;
136
- }
137
- }
138
- else if (nextChar === undefined) {
139
- sb[i] = '_' + char;
140
- }
141
- }
142
- }
143
- }
144
- }
145
- const res = sb.join('');
146
- return res;
147
- }
148
-
149
- function internalCssSelectorReplacer(selectors, options = {
150
- escapeMap: SimpleMappingChars2String
151
- }) {
152
- const { mangleContext, escapeMap } = options;
153
- if (mangleContext) {
154
- selectors = mangleContext.cssHandler(selectors);
155
- }
156
- return escape(selectors, {
157
- map: escapeMap
158
- });
159
- }
160
-
161
- export { MappingChars2String as M, SimpleMappingChars2String as S, SYMBOL_TABLE as a, MappingChars2StringEntries as b, SimpleMappingChars2StringEntries as c, escape as e, internalCssSelectorReplacer as i };
105
+ export { MappingChars2String as M, SimpleMappingChars2String as S, SYMBOL_TABLE as a, MappingChars2StringEntries as b, SimpleMappingChars2StringEntries as c };
package/dist/gulp.js CHANGED
@@ -3,16 +3,18 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var stream = require('node:stream');
6
- var options = require('./options-487394fa.js');
6
+ var options = require('./options-6a265426.js');
7
7
  require('micromatch');
8
8
  require('@babel/types');
9
9
  require('@babel/generator');
10
10
  require('@babel/parser');
11
11
  require('@babel/traverse');
12
12
  require('./replace.js');
13
- require('./shared-ae7dd073.js');
13
+ require('./dic-05980807.js');
14
+ require('./shared-4eed0e5c.js');
15
+ require('./defaults-0d9846f4.js');
14
16
  require('postcss');
15
- require('./postcss-b53e9504.js');
17
+ require('./postcss-cf8b998a.js');
16
18
  require('postcss-selector-parser');
17
19
  require('@csstools/postcss-is-pseudo-class');
18
20
  require('node:path');
package/dist/gulp.mjs CHANGED
@@ -1,14 +1,16 @@
1
1
  import stream from 'node:stream';
2
- import { g as getOptions, a as createTailwindcssPatcher } from './options-f7b71f03.mjs';
2
+ import { g as getOptions, a as createTailwindcssPatcher } from './options-800ea85a.mjs';
3
3
  import 'micromatch';
4
4
  import '@babel/types';
5
5
  import '@babel/generator';
6
6
  import '@babel/parser';
7
7
  import '@babel/traverse';
8
8
  import './replace.mjs';
9
- import './shared-7c88fb94.mjs';
9
+ import './dic-3790a3a4.mjs';
10
+ import './shared-686bfc32.mjs';
11
+ import './defaults-c7f00aae.mjs';
10
12
  import 'postcss';
11
- import './postcss-760298ba.mjs';
13
+ import './postcss-53e2ad95.mjs';
12
14
  import 'postcss-selector-parser';
13
15
  import '@csstools/postcss-is-pseudo-class';
14
16
  import 'node:path';
package/dist/index.js CHANGED
@@ -7,16 +7,18 @@ var vite = require('./vite.js');
7
7
  var gulp = require('./gulp.js');
8
8
  require('node:path');
9
9
  require('node:fs');
10
- require('./options-487394fa.js');
10
+ require('./options-6a265426.js');
11
11
  require('micromatch');
12
12
  require('@babel/types');
13
13
  require('@babel/generator');
14
14
  require('@babel/parser');
15
15
  require('@babel/traverse');
16
16
  require('./replace.js');
17
- require('./shared-ae7dd073.js');
17
+ require('./dic-05980807.js');
18
+ require('./shared-4eed0e5c.js');
19
+ require('./defaults-0d9846f4.js');
18
20
  require('postcss');
19
- require('./postcss-b53e9504.js');
21
+ require('./postcss-cf8b998a.js');
20
22
  require('postcss-selector-parser');
21
23
  require('@csstools/postcss-is-pseudo-class');
22
24
  require('semver');
package/dist/index.mjs CHANGED
@@ -3,16 +3,18 @@ export { UnifiedViteWeappTailwindcssPlugin } from './vite.mjs';
3
3
  export { createPlugins } from './gulp.mjs';
4
4
  import 'node:path';
5
5
  import 'node:fs';
6
- import './options-f7b71f03.mjs';
6
+ import './options-800ea85a.mjs';
7
7
  import 'micromatch';
8
8
  import '@babel/types';
9
9
  import '@babel/generator';
10
10
  import '@babel/parser';
11
11
  import '@babel/traverse';
12
12
  import './replace.mjs';
13
- import './shared-7c88fb94.mjs';
13
+ import './dic-3790a3a4.mjs';
14
+ import './shared-686bfc32.mjs';
15
+ import './defaults-c7f00aae.mjs';
14
16
  import 'postcss';
15
- import './postcss-760298ba.mjs';
17
+ import './postcss-53e2ad95.mjs';
16
18
  import 'postcss-selector-parser';
17
19
  import '@csstools/postcss-is-pseudo-class';
18
20
  import 'semver';