@unocss/preset-attributify 0.50.6 → 0.50.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 +6 -6
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +6 -6
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const core = require('@unocss/core');
|
|
6
6
|
|
|
7
7
|
const variantsRE = /^(?!.*\[(?:[^:]+):(?:.+)\]$)((?:.+:)?!?)?(.*)$/;
|
|
8
|
-
|
|
8
|
+
function variantAttributify(options = {}) {
|
|
9
9
|
const prefix = options.prefix ?? "un-";
|
|
10
10
|
const prefixedOnly = options.prefixedOnly ?? false;
|
|
11
11
|
const trueToNonValued = options.trueToNonValued ?? false;
|
|
@@ -40,7 +40,7 @@ const variantAttributify = (options = {}) => {
|
|
|
40
40
|
return `${variants}${name}-${body}`;
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
}
|
|
43
|
+
}
|
|
44
44
|
|
|
45
45
|
const elementRE$1 = /(<\w[\w:\.$-]*\s)((?:'[^>]*?'|"[^>]*?"|`[^>]*?`|\{[^>]*?\}|[^>]*?)*)/g;
|
|
46
46
|
const valuedAttributeRE$1 = /([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:%-]+)(?:=("[^"]*|'[^']*))?/g;
|
|
@@ -132,7 +132,7 @@ const splitterRE = /[\s'"`;]+/g;
|
|
|
132
132
|
const elementRE = /<[^>\s]*\s((?:'.*?'|".*?"|`.*?`|\{.*?\}|[^>]*?)*)/g;
|
|
133
133
|
const valuedAttributeRE = /([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-.~<]+)=?(?:["]([^"]*)["]|[']([^']*)[']|[{]([^}]*)[}])?/gms;
|
|
134
134
|
const defaultIgnoreAttributes = ["placeholder", "fill", "opacity"];
|
|
135
|
-
|
|
135
|
+
function extractorAttributify(options) {
|
|
136
136
|
const ignoreAttributes = options?.ignoreAttributes ?? defaultIgnoreAttributes;
|
|
137
137
|
const nonValuedAttribute = options?.nonValuedAttribute ?? true;
|
|
138
138
|
const trueToNonValued = options?.trueToNonValued ?? false;
|
|
@@ -170,9 +170,9 @@ const extractorAttributify = (options) => {
|
|
|
170
170
|
return new Set(result);
|
|
171
171
|
}
|
|
172
172
|
};
|
|
173
|
-
}
|
|
173
|
+
}
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
function preset(options = {}) {
|
|
176
176
|
options.strict = options.strict ?? false;
|
|
177
177
|
options.prefix = options.prefix ?? "un-";
|
|
178
178
|
options.prefixedOnly = options.prefixedOnly ?? false;
|
|
@@ -198,7 +198,7 @@ const preset = (options = {}) => {
|
|
|
198
198
|
extractors: autocompleteExtractors
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
}
|
|
201
|
+
}
|
|
202
202
|
|
|
203
203
|
exports.autocompleteExtractorAttributify = autocompleteExtractorAttributify;
|
|
204
204
|
exports["default"] = preset;
|
package/dist/index.d.ts
CHANGED
|
@@ -45,10 +45,10 @@ interface AttributifyOptions extends PresetOptions {
|
|
|
45
45
|
declare const autocompleteExtractorAttributify: AutoCompleteExtractor;
|
|
46
46
|
|
|
47
47
|
declare const defaultIgnoreAttributes: string[];
|
|
48
|
-
declare
|
|
48
|
+
declare function extractorAttributify(options?: AttributifyOptions): Extractor;
|
|
49
49
|
|
|
50
50
|
declare const variantsRE: RegExp;
|
|
51
|
-
declare
|
|
51
|
+
declare function variantAttributify(options?: AttributifyOptions): VariantObject;
|
|
52
52
|
|
|
53
53
|
type TwoStringsCompositionPrefix = 'm' | 'p';
|
|
54
54
|
type TwoStringsCompositionSuffix = 'r' | 'b' | 'l' | 't' | 'a';
|
|
@@ -67,6 +67,6 @@ type AttributifyNames<Prefix extends string = ''> = `${Prefix}${BasicAttributes}
|
|
|
67
67
|
interface AttributifyAttributes extends Partial<Record<AttributifyNames, string | boolean>> {
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
declare
|
|
70
|
+
declare function preset(options?: AttributifyOptions): Preset;
|
|
71
71
|
|
|
72
72
|
export { AttributifyAttributes, AttributifyNames, AttributifyOptions, BasicAttributes, PseudoPrefix, SeparateEnabled, SpecialSingleWord, StringNumberComposition, StringNumberCompositionPrefix, TwoStringsComposition, TwoStringsCompositionPrefix, TwoStringsCompositionSuffix, autocompleteExtractorAttributify, preset as default, defaultIgnoreAttributes, extractorAttributify, variantAttributify, variantsRE };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isAttributifySelector, isValidSelector, extractorSplit } from '@unocss/core';
|
|
2
2
|
|
|
3
3
|
const variantsRE = /^(?!.*\[(?:[^:]+):(?:.+)\]$)((?:.+:)?!?)?(.*)$/;
|
|
4
|
-
|
|
4
|
+
function variantAttributify(options = {}) {
|
|
5
5
|
const prefix = options.prefix ?? "un-";
|
|
6
6
|
const prefixedOnly = options.prefixedOnly ?? false;
|
|
7
7
|
const trueToNonValued = options.trueToNonValued ?? false;
|
|
@@ -36,7 +36,7 @@ const variantAttributify = (options = {}) => {
|
|
|
36
36
|
return `${variants}${name}-${body}`;
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
}
|
|
39
|
+
}
|
|
40
40
|
|
|
41
41
|
const elementRE$1 = /(<\w[\w:\.$-]*\s)((?:'[^>]*?'|"[^>]*?"|`[^>]*?`|\{[^>]*?\}|[^>]*?)*)/g;
|
|
42
42
|
const valuedAttributeRE$1 = /([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:%-]+)(?:=("[^"]*|'[^']*))?/g;
|
|
@@ -128,7 +128,7 @@ const splitterRE = /[\s'"`;]+/g;
|
|
|
128
128
|
const elementRE = /<[^>\s]*\s((?:'.*?'|".*?"|`.*?`|\{.*?\}|[^>]*?)*)/g;
|
|
129
129
|
const valuedAttributeRE = /([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-.~<]+)=?(?:["]([^"]*)["]|[']([^']*)[']|[{]([^}]*)[}])?/gms;
|
|
130
130
|
const defaultIgnoreAttributes = ["placeholder", "fill", "opacity"];
|
|
131
|
-
|
|
131
|
+
function extractorAttributify(options) {
|
|
132
132
|
const ignoreAttributes = options?.ignoreAttributes ?? defaultIgnoreAttributes;
|
|
133
133
|
const nonValuedAttribute = options?.nonValuedAttribute ?? true;
|
|
134
134
|
const trueToNonValued = options?.trueToNonValued ?? false;
|
|
@@ -166,9 +166,9 @@ const extractorAttributify = (options) => {
|
|
|
166
166
|
return new Set(result);
|
|
167
167
|
}
|
|
168
168
|
};
|
|
169
|
-
}
|
|
169
|
+
}
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
function preset(options = {}) {
|
|
172
172
|
options.strict = options.strict ?? false;
|
|
173
173
|
options.prefix = options.prefix ?? "un-";
|
|
174
174
|
options.prefixedOnly = options.prefixedOnly ?? false;
|
|
@@ -194,6 +194,6 @@ const preset = (options = {}) => {
|
|
|
194
194
|
extractors: autocompleteExtractors
|
|
195
195
|
}
|
|
196
196
|
};
|
|
197
|
-
}
|
|
197
|
+
}
|
|
198
198
|
|
|
199
199
|
export { autocompleteExtractorAttributify, preset as default, defaultIgnoreAttributes, extractorAttributify, variantAttributify, variantsRE };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-attributify",
|
|
3
|
-
"version": "0.50.
|
|
3
|
+
"version": "0.50.7",
|
|
4
4
|
"description": "Attributify preset for UnoCSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@unocss/core": "0.50.
|
|
36
|
+
"@unocss/core": "0.50.7"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "unbuild",
|