@weapp-tailwindcss/reset 0.1.5 → 0.1.7
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/index.cjs +3 -6
- package/dist/index.d.cts +64 -0
- package/dist/index.d.ts +0 -4
- package/dist/index.js +2 -4
- package/package.json +9 -4
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
|
|
5
|
+
// \0rolldown/runtime.js
|
|
6
6
|
var __create = Object.create;
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -23,10 +23,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
23
|
value: mod,
|
|
24
24
|
enumerable: true
|
|
25
25
|
}) : target, mod));
|
|
26
|
-
//#endregion
|
|
27
26
|
let tailwindcss_plugin = require("tailwindcss/plugin");
|
|
28
27
|
tailwindcss_plugin = __toESM(tailwindcss_plugin, 1);
|
|
29
|
-
|
|
28
|
+
// src/normalize.ts
|
|
30
29
|
function normalizeResetSelectors(option, defaults) {
|
|
31
30
|
const resolved = option?.selectors?.length ? option.selectors : defaults;
|
|
32
31
|
const normalized = [];
|
|
@@ -89,8 +88,7 @@ function createResetRule(option, defaults) {
|
|
|
89
88
|
pseudo
|
|
90
89
|
};
|
|
91
90
|
}
|
|
92
|
-
|
|
93
|
-
//#region src/index.ts
|
|
91
|
+
// src/index.ts
|
|
94
92
|
const DEFAULT_BUTTON_RESET_SELECTORS = ["button"];
|
|
95
93
|
const DEFAULT_BUTTON_DECLARATIONS = {
|
|
96
94
|
padding: "0",
|
|
@@ -263,6 +261,5 @@ const reset = tailwindcss_plugin.default.withOptions((options) => {
|
|
|
263
261
|
}, () => {
|
|
264
262
|
return {};
|
|
265
263
|
});
|
|
266
|
-
//#endregion
|
|
267
264
|
exports.default = reset;
|
|
268
265
|
exports.reset = reset;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
type ResetPreset = 'minimal' | 'form' | 'content' | 'media' | 'all';
|
|
2
|
+
type BuiltInResetName = 'buttonReset' | 'imageReset' | 'inputReset' | 'textareaReset' | 'listReset' | 'navigatorReset' | 'videoReset';
|
|
3
|
+
interface ResetOptions {
|
|
4
|
+
/**
|
|
5
|
+
* 启用一组内置 reset 预设;默认不传时保持最小行为,仅注入 button/image。
|
|
6
|
+
*/
|
|
7
|
+
preset?: ResetPreset | ResetPreset[];
|
|
8
|
+
/**
|
|
9
|
+
* 控制 `button` reset 的注入与选择器,传入 `false` 可跳过该规则。
|
|
10
|
+
*/
|
|
11
|
+
buttonReset?: false | ResetConfig;
|
|
12
|
+
/**
|
|
13
|
+
* 控制 `image` reset(同时覆盖 `<image>` 与 `<img>`)。
|
|
14
|
+
*/
|
|
15
|
+
imageReset?: false | ResetConfig;
|
|
16
|
+
/**
|
|
17
|
+
* 控制常见输入框 reset(`input`)。
|
|
18
|
+
*/
|
|
19
|
+
inputReset?: false | ResetConfig;
|
|
20
|
+
/**
|
|
21
|
+
* 控制多行输入框 reset(`textarea`)。
|
|
22
|
+
*/
|
|
23
|
+
textareaReset?: false | ResetConfig;
|
|
24
|
+
/**
|
|
25
|
+
* 控制列表 reset(`ul` / `ol`)。
|
|
26
|
+
*/
|
|
27
|
+
listReset?: false | ResetConfig;
|
|
28
|
+
/**
|
|
29
|
+
* 控制链接 reset(`navigator` / `a`)。
|
|
30
|
+
*/
|
|
31
|
+
navigatorReset?: false | ResetConfig;
|
|
32
|
+
/**
|
|
33
|
+
* 控制 `video` reset。
|
|
34
|
+
*/
|
|
35
|
+
videoReset?: false | ResetConfig;
|
|
36
|
+
/**
|
|
37
|
+
* 额外的 reset 规则,可根据业务自定义。
|
|
38
|
+
*/
|
|
39
|
+
extraResets?: ResetConfig[];
|
|
40
|
+
}
|
|
41
|
+
interface ResetConfig {
|
|
42
|
+
selectors?: string[];
|
|
43
|
+
declarations?: Record<string, string | number | false | null | undefined>;
|
|
44
|
+
pseudo?: Record<string, string | number | false | null | undefined>;
|
|
45
|
+
}
|
|
46
|
+
export interface ResetPluginResult {
|
|
47
|
+
handler: (api: {
|
|
48
|
+
addBase: (base: Record<string, Record<string, string>>) => void;
|
|
49
|
+
}) => void;
|
|
50
|
+
config?: Record<string, unknown>;
|
|
51
|
+
}
|
|
52
|
+
interface ResetPlugin {
|
|
53
|
+
(options?: ResetOptions): ResetPluginResult;
|
|
54
|
+
__isOptionsFunction: true;
|
|
55
|
+
}
|
|
56
|
+
interface ResetPlugin {
|
|
57
|
+
(options?: ResetOptions): {
|
|
58
|
+
handler: unknown;
|
|
59
|
+
config?: unknown;
|
|
60
|
+
};
|
|
61
|
+
__isOptionsFunction: true;
|
|
62
|
+
}
|
|
63
|
+
export declare const reset: ResetPlugin;
|
|
64
|
+
export { type BuiltInResetName, type ResetConfig, type ResetOptions, ResetPlugin, type ResetPreset, reset as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/types.d.ts
|
|
2
1
|
type ResetPreset = 'minimal' | 'form' | 'content' | 'media' | 'all';
|
|
3
2
|
type BuiltInResetName = 'buttonReset' | 'imageReset' | 'inputReset' | 'textareaReset' | 'listReset' | 'navigatorReset' | 'videoReset';
|
|
4
3
|
interface ResetOptions {
|
|
@@ -44,8 +43,6 @@ interface ResetConfig {
|
|
|
44
43
|
declarations?: Record<string, string | number | false | null | undefined>;
|
|
45
44
|
pseudo?: Record<string, string | number | false | null | undefined>;
|
|
46
45
|
}
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region src/index.d.ts
|
|
49
46
|
export interface ResetPluginResult {
|
|
50
47
|
handler: (api: {
|
|
51
48
|
addBase: (base: Record<string, Record<string, string>>) => void;
|
|
@@ -64,5 +61,4 @@ interface ResetPlugin {
|
|
|
64
61
|
__isOptionsFunction: true;
|
|
65
62
|
}
|
|
66
63
|
export declare const reset: ResetPlugin;
|
|
67
|
-
//#endregion
|
|
68
64
|
export { type BuiltInResetName, type ResetConfig, type ResetOptions, ResetPlugin, type ResetPreset, reset as default };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import plugin from "tailwindcss/plugin";
|
|
2
|
-
|
|
2
|
+
// src/normalize.ts
|
|
3
3
|
function normalizeResetSelectors(option, defaults) {
|
|
4
4
|
const resolved = option?.selectors?.length ? option.selectors : defaults;
|
|
5
5
|
const normalized = [];
|
|
@@ -62,8 +62,7 @@ function createResetRule(option, defaults) {
|
|
|
62
62
|
pseudo
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
//#region src/index.ts
|
|
65
|
+
// src/index.ts
|
|
67
66
|
const DEFAULT_BUTTON_RESET_SELECTORS = ["button"];
|
|
68
67
|
const DEFAULT_BUTTON_DECLARATIONS = {
|
|
69
68
|
padding: "0",
|
|
@@ -236,5 +235,4 @@ const reset = plugin.withOptions((options) => {
|
|
|
236
235
|
}, () => {
|
|
237
236
|
return {};
|
|
238
237
|
});
|
|
239
|
-
//#endregion
|
|
240
238
|
export { reset as default, reset };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-tailwindcss/reset",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.7",
|
|
5
5
|
"description": "Cross-platform reset styles for weapp-tailwindcss projects. weapp-tailwindcss 项目的跨端 reset 样式资源。",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -26,9 +26,14 @@
|
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"exports": {
|
|
28
28
|
".": {
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
"import": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"default": "./dist/index.js"
|
|
32
|
+
},
|
|
33
|
+
"require": {
|
|
34
|
+
"types": "./dist/index.d.cts",
|
|
35
|
+
"default": "./dist/index.cjs"
|
|
36
|
+
}
|
|
32
37
|
},
|
|
33
38
|
"./*": "./*",
|
|
34
39
|
"./package.json": "./package.json"
|