@weapp-tailwindcss/merge 1.0.0-alpha.3 → 1.0.0-alpha.5

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.
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../node_modules/.pnpm/@weapp-core+escape@3.0.2/node_modules/@weapp-core/escape/dist/index.mjs
2
- var MappingChars2String = {
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../node_modules/.pnpm/@weapp-core+escape@4.0.0/node_modules/@weapp-core/escape/dist/index.mjs
2
+ var ComplexMappingChars2String = {
3
3
  "[": "_bl_",
4
4
  "]": "_br_",
5
5
  "(": "_pl_",
@@ -34,14 +34,15 @@ var MappingChars2String = {
34
34
  "$": "_do_"
35
35
  // _: '_u_'
36
36
  };
37
- var MappingChars2StringEntries = Object.entries(MappingChars2String);
38
- var SimpleMappingChars2String = {
37
+ var ComplexMappingChars2StringEntries = Object.entries(ComplexMappingChars2String);
38
+ var MappingChars2String = {
39
39
  "[": "_",
40
40
  "]": "_",
41
- "(": "_",
42
- ")": "_",
43
- "{": "_",
44
- "}": "_",
41
+ // for tailwindcss v4
42
+ "(": "y",
43
+ ")": "y",
44
+ "{": "z",
45
+ "}": "z",
45
46
  "+": "a",
46
47
  ",": "b",
47
48
  ":": "c",
@@ -67,7 +68,7 @@ var SimpleMappingChars2String = {
67
68
  "\\": "w",
68
69
  '"': "x"
69
70
  };
70
- var SimpleMappingChars2StringEntries = Object.entries(SimpleMappingChars2String);
71
+ var MappingChars2StringEntries = Object.entries(MappingChars2String);
71
72
  var MAX_ASCII_CHAR_CODE = 127;
72
73
  function isPlainObject(value) {
73
74
  if (value === null || typeof value !== "object") {
@@ -146,7 +147,7 @@ function escape(selectors, options) {
146
147
  return "";
147
148
  }
148
149
  const { map, ignoreHead } = defu(options, {
149
- map: SimpleMappingChars2String,
150
+ map: MappingChars2String,
150
151
  ignoreHead: false
151
152
  });
152
153
  const sb = [];
@@ -171,10 +172,10 @@ function escape(selectors, options) {
171
172
  return sb.join("");
172
173
  }
173
174
 
174
- // ../weapp-tailwindcss/dist/chunk-U7O2XXYR.mjs
175
+ // ../weapp-tailwindcss/dist/chunk-PCBSAFQF.mjs
175
176
  function replaceWxml(original, options = {
176
177
  keepEOL: false,
177
- escapeMap: SimpleMappingChars2String
178
+ escapeMap: MappingChars2String
178
179
  }) {
179
180
  const { keepEOL, escapeMap, mangleContext, ignoreHead } = options;
180
181
  let res = original;
@@ -1,5 +1,5 @@
1
- // ../../node_modules/.pnpm/@weapp-core+escape@3.0.2/node_modules/@weapp-core/escape/dist/index.mjs
2
- var MappingChars2String = {
1
+ // ../../node_modules/.pnpm/@weapp-core+escape@4.0.0/node_modules/@weapp-core/escape/dist/index.mjs
2
+ var ComplexMappingChars2String = {
3
3
  "[": "_bl_",
4
4
  "]": "_br_",
5
5
  "(": "_pl_",
@@ -34,14 +34,15 @@ var MappingChars2String = {
34
34
  "$": "_do_"
35
35
  // _: '_u_'
36
36
  };
37
- var MappingChars2StringEntries = Object.entries(MappingChars2String);
38
- var SimpleMappingChars2String = {
37
+ var ComplexMappingChars2StringEntries = Object.entries(ComplexMappingChars2String);
38
+ var MappingChars2String = {
39
39
  "[": "_",
40
40
  "]": "_",
41
- "(": "_",
42
- ")": "_",
43
- "{": "_",
44
- "}": "_",
41
+ // for tailwindcss v4
42
+ "(": "y",
43
+ ")": "y",
44
+ "{": "z",
45
+ "}": "z",
45
46
  "+": "a",
46
47
  ",": "b",
47
48
  ":": "c",
@@ -67,7 +68,7 @@ var SimpleMappingChars2String = {
67
68
  "\\": "w",
68
69
  '"': "x"
69
70
  };
70
- var SimpleMappingChars2StringEntries = Object.entries(SimpleMappingChars2String);
71
+ var MappingChars2StringEntries = Object.entries(MappingChars2String);
71
72
  var MAX_ASCII_CHAR_CODE = 127;
72
73
  function isPlainObject(value) {
73
74
  if (value === null || typeof value !== "object") {
@@ -146,7 +147,7 @@ function escape(selectors, options) {
146
147
  return "";
147
148
  }
148
149
  const { map, ignoreHead } = defu(options, {
149
- map: SimpleMappingChars2String,
150
+ map: MappingChars2String,
150
151
  ignoreHead: false
151
152
  });
152
153
  const sb = [];
@@ -171,10 +172,10 @@ function escape(selectors, options) {
171
172
  return sb.join("");
172
173
  }
173
174
 
174
- // ../weapp-tailwindcss/dist/chunk-U7O2XXYR.mjs
175
+ // ../weapp-tailwindcss/dist/chunk-PCBSAFQF.mjs
175
176
  function replaceWxml(original, options = {
176
177
  keepEOL: false,
177
- escapeMap: SimpleMappingChars2String
178
+ escapeMap: MappingChars2String
178
179
  }) {
179
180
  const { keepEOL, escapeMap, mangleContext, ignoreHead } = options;
180
181
  let res = original;
package/dist/cva.cjs CHANGED
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkVR7IWN2Zcjs = require('./chunk-VR7IWN2Z.cjs');
3
+ var _chunkD36KUYOCcjs = require('./chunk-D36KUYOC.cjs');
4
4
 
5
5
  // src/cva.ts
6
6
  var _classvarianceauthority = require('class-variance-authority');
7
7
  function cva(...inputs) {
8
8
  const fn = _classvarianceauthority.cva.call(void 0, ...inputs);
9
9
  return (...props) => {
10
- return _chunkVR7IWN2Zcjs.replaceWxml.call(void 0, fn(...props));
10
+ return _chunkD36KUYOCcjs.replaceWxml.call(void 0, fn(...props));
11
11
  };
12
12
  }
13
13
 
package/dist/cva.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  replaceWxml
3
- } from "./chunk-YR5LCHCZ.js";
3
+ } from "./chunk-YLSVCIIK.js";
4
4
 
5
5
  // src/cva.ts
6
6
  import { cva as _cva } from "class-variance-authority";
package/dist/index.cjs CHANGED
@@ -1,15 +1,42 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkVR7IWN2Zcjs = require('./chunk-VR7IWN2Z.cjs');
4
+ var _chunkD36KUYOCcjs = require('./chunk-D36KUYOC.cjs');
5
5
 
6
6
  // src/index.ts
7
7
  var _clsx = require('clsx');
8
+
9
+
10
+
11
+
12
+
13
+
14
+
8
15
  var _tailwindmerge = require('tailwind-merge');
9
- function cn(...inputs) {
10
- return _chunkVR7IWN2Zcjs.replaceWxml.call(void 0, _tailwindmerge.twMerge.call(void 0, _clsx.clsx.call(void 0, inputs)));
16
+ function twMerge(...inputs) {
17
+ return _chunkD36KUYOCcjs.replaceWxml.call(void 0, _tailwindmerge.twMerge.call(void 0, _clsx.clsx.call(void 0, inputs)));
11
18
  }
19
+ function twJoin(...inputs) {
20
+ return _chunkD36KUYOCcjs.replaceWxml.call(void 0, _tailwindmerge.twJoin.call(void 0, _clsx.clsx.call(void 0, inputs)));
21
+ }
22
+ var extendTailwindMerge = (...args) => {
23
+ const customTwMerge = _tailwindmerge.extendTailwindMerge.call(void 0, ...args);
24
+ return function cn(...inputs) {
25
+ return _chunkD36KUYOCcjs.replaceWxml.call(void 0, customTwMerge(_clsx.clsx.call(void 0, inputs)));
26
+ };
27
+ };
28
+ var createTailwindMerge = (...args) => {
29
+ const customTwMerge = _tailwindmerge.createTailwindMerge.call(void 0, ...args);
30
+ return function cn(...inputs) {
31
+ return _chunkD36KUYOCcjs.replaceWxml.call(void 0, customTwMerge(_clsx.clsx.call(void 0, inputs)));
32
+ };
33
+ };
34
+
35
+
36
+
37
+
38
+
12
39
 
13
40
 
14
41
 
15
- exports.cn = cn; exports.weappTwIgnore = _chunkVR7IWN2Zcjs.weappTwIgnore;
42
+ exports.createTailwindMerge = createTailwindMerge; exports.extendTailwindMerge = extendTailwindMerge; exports.getDefaultConfig = _tailwindmerge.getDefaultConfig; exports.mergeConfigs = _tailwindmerge.mergeConfigs; exports.twJoin = twJoin; exports.twMerge = twMerge; exports.weappTwIgnore = _chunkD36KUYOCcjs.weappTwIgnore;
package/dist/index.d.cts CHANGED
@@ -1,6 +1,12 @@
1
1
  import { ClassValue } from 'clsx';
2
+ export { ClassValue } from 'clsx';
3
+ import { extendTailwindMerge as extendTailwindMerge$1, createTailwindMerge as createTailwindMerge$1 } from 'tailwind-merge';
4
+ export { getDefaultConfig, mergeConfigs } from 'tailwind-merge';
2
5
  export { weappTwIgnore } from 'weapp-tailwindcss/escape';
3
6
 
4
- declare function cn(...inputs: ClassValue[]): string;
7
+ declare function twMerge(...inputs: ClassValue[]): string;
8
+ declare function twJoin(...inputs: ClassValue[]): string;
9
+ declare const extendTailwindMerge: typeof extendTailwindMerge$1;
10
+ declare const createTailwindMerge: typeof createTailwindMerge$1;
5
11
 
6
- export { cn };
12
+ export { createTailwindMerge, extendTailwindMerge, twJoin, twMerge };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,12 @@
1
1
  import { ClassValue } from 'clsx';
2
+ export { ClassValue } from 'clsx';
3
+ import { extendTailwindMerge as extendTailwindMerge$1, createTailwindMerge as createTailwindMerge$1 } from 'tailwind-merge';
4
+ export { getDefaultConfig, mergeConfigs } from 'tailwind-merge';
2
5
  export { weappTwIgnore } from 'weapp-tailwindcss/escape';
3
6
 
4
- declare function cn(...inputs: ClassValue[]): string;
7
+ declare function twMerge(...inputs: ClassValue[]): string;
8
+ declare function twJoin(...inputs: ClassValue[]): string;
9
+ declare const extendTailwindMerge: typeof extendTailwindMerge$1;
10
+ declare const createTailwindMerge: typeof createTailwindMerge$1;
5
11
 
6
- export { cn };
12
+ export { createTailwindMerge, extendTailwindMerge, twJoin, twMerge };
package/dist/index.js CHANGED
@@ -1,15 +1,42 @@
1
1
  import {
2
2
  replaceWxml,
3
3
  weappTwIgnore
4
- } from "./chunk-YR5LCHCZ.js";
4
+ } from "./chunk-YLSVCIIK.js";
5
5
 
6
6
  // src/index.ts
7
7
  import { clsx } from "clsx";
8
- import { twMerge } from "tailwind-merge";
9
- function cn(...inputs) {
10
- return replaceWxml(twMerge(clsx(inputs)));
8
+ import {
9
+ createTailwindMerge as _createTailwindMerge,
10
+ extendTailwindMerge as _extendTailwindMerge,
11
+ twJoin as _twJoin,
12
+ twMerge as _twMerge,
13
+ getDefaultConfig,
14
+ mergeConfigs
15
+ } from "tailwind-merge";
16
+ function twMerge(...inputs) {
17
+ return replaceWxml(_twMerge(clsx(inputs)));
18
+ }
19
+ function twJoin(...inputs) {
20
+ return replaceWxml(_twJoin(clsx(inputs)));
11
21
  }
22
+ var extendTailwindMerge = (...args) => {
23
+ const customTwMerge = _extendTailwindMerge(...args);
24
+ return function cn(...inputs) {
25
+ return replaceWxml(customTwMerge(clsx(inputs)));
26
+ };
27
+ };
28
+ var createTailwindMerge = (...args) => {
29
+ const customTwMerge = _createTailwindMerge(...args);
30
+ return function cn(...inputs) {
31
+ return replaceWxml(customTwMerge(clsx(inputs)));
32
+ };
33
+ };
12
34
  export {
13
- cn,
35
+ createTailwindMerge,
36
+ extendTailwindMerge,
37
+ getDefaultConfig,
38
+ mergeConfigs,
39
+ twJoin,
40
+ twMerge,
14
41
  weappTwIgnore
15
42
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-tailwindcss/merge",
3
3
  "type": "module",
4
- "version": "1.0.0-alpha.3",
4
+ "version": "1.0.0-alpha.5",
5
5
  "description": "weapp-tailwindcss",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -33,10 +33,10 @@
33
33
  "dependencies": {
34
34
  "class-variance-authority": "^0.7.1",
35
35
  "clsx": "^2.1.1",
36
- "tailwind-merge": "^2.6.0"
36
+ "tailwind-merge": "^3.0.1"
37
37
  },
38
38
  "devDependencies": {
39
- "weapp-tailwindcss": "4.0.0-alpha.7"
39
+ "weapp-tailwindcss": "4.0.0-alpha.10"
40
40
  },
41
41
  "scripts": {
42
42
  "dev": "tsup --watch --sourcemap",