@tokenami/config 0.0.69 → 0.0.70
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 +5 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -17,7 +17,7 @@ var gridValueRegex = /^\d+/;
|
|
|
17
17
|
var GridValue = {
|
|
18
18
|
safeParse: (input) => validate(gridValueRegex, input)
|
|
19
19
|
};
|
|
20
|
-
var tokenPropertyRegex = /(?<!var\()--(?:[^'":{}]+|{
|
|
20
|
+
var tokenPropertyRegex = /(?<!var\()--(?:[^'":{}]+|{[^}]*})+/g;
|
|
21
21
|
var TokenProperty = {
|
|
22
22
|
safeParse: (input) => validate(tokenPropertyRegex, input)
|
|
23
23
|
};
|
|
@@ -119,6 +119,9 @@ function parseProperty(str, options) {
|
|
|
119
119
|
return noColon;
|
|
120
120
|
return noColon.replace(escapeSpecialCharsRegex, (match) => `\\${match}`);
|
|
121
121
|
}
|
|
122
|
+
function stringifyProperty(property) {
|
|
123
|
+
return decodeColon(property).replace(/\\/g, "");
|
|
124
|
+
}
|
|
122
125
|
var encodeColon = (str) => str.replace(/:/g, ";");
|
|
123
126
|
var decodeColon = (str) => str.replace(/;/g, ":");
|
|
124
127
|
|
|
@@ -218,6 +221,7 @@ exports.mapShorthandToLonghands = mapShorthandToLonghands;
|
|
|
218
221
|
exports.parseProperty = parseProperty;
|
|
219
222
|
exports.parsedTokenProperty = parsedTokenProperty;
|
|
220
223
|
exports.parsedVariantProperty = parsedVariantProperty;
|
|
224
|
+
exports.stringifyProperty = stringifyProperty;
|
|
221
225
|
exports.tokenProperty = tokenProperty;
|
|
222
226
|
exports.tokenValue = tokenValue;
|
|
223
227
|
exports.variantProperty = variantProperty;
|
package/dist/index.d.cts
CHANGED
|
@@ -108,7 +108,8 @@ declare function getCSSPropertiesForAlias(alias: string, aliases: Config['aliase
|
|
|
108
108
|
declare function parseProperty<T extends string>(str: T, options?: {
|
|
109
109
|
escapeSpecialChars?: boolean;
|
|
110
110
|
}): T;
|
|
111
|
+
declare function stringifyProperty<T extends string>(property: T): T;
|
|
111
112
|
|
|
112
113
|
declare const mapShorthandToLonghands: Map<"flex" | "grid" | "all" | "border-block-color" | "border-block-style" | "border-block-width" | "border-inline-color" | "border-inline-style" | "border-inline-width" | "border" | "transition" | "font-variant" | "animation" | "background" | "background-position" | "border-block" | "border-block-end" | "border-block-start" | "border-bottom" | "border-color" | "border-image" | "border-inline" | "border-inline-end" | "border-inline-start" | "border-left" | "border-radius" | "border-right" | "border-style" | "border-top" | "border-width" | "column-rule" | "columns" | "contain-intrinsic-size" | "container" | "flex-flow" | "font" | "gap" | "grid-area" | "grid-column" | "grid-row" | "grid-template" | "inset" | "inset-block" | "inset-inline" | "list-style" | "margin" | "margin-block" | "margin-inline" | "mask" | "mask-border" | "offset" | "outline" | "overflow" | "overscroll-behavior" | "padding" | "padding-block" | "padding-inline" | "place-content" | "place-items" | "place-self" | "scroll-margin" | "scroll-margin-block" | "scroll-margin-inline" | "scroll-padding" | "scroll-padding-block" | "scroll-padding-inline" | "scroll-timeline" | "text-decoration" | "text-emphasis", string[]>;
|
|
113
114
|
|
|
114
|
-
export { type Aliases, ArbitraryValue, type CSSProperties, type CSSProperty, type Config, type DeepReadonly, GridProperty, GridValue, type Theme, type ThemeModes, TokenProperty, TokenValue, VariantProperty, arbitraryValue, createConfig, getArbitrarySelector, getCSSPropertiesForAlias, getTokenPropertyName, getTokenPropertyParts, getTokenPropertySplit, getTokenValueParts, gridProperty, mapShorthandToLonghands, parseProperty, parsedTokenProperty, parsedVariantProperty, tokenProperty, tokenValue, variantProperty };
|
|
115
|
+
export { type Aliases, ArbitraryValue, type CSSProperties, type CSSProperty, type Config, type DeepReadonly, GridProperty, GridValue, type Theme, type ThemeModes, TokenProperty, TokenValue, VariantProperty, arbitraryValue, createConfig, getArbitrarySelector, getCSSPropertiesForAlias, getTokenPropertyName, getTokenPropertyParts, getTokenPropertySplit, getTokenValueParts, gridProperty, mapShorthandToLonghands, parseProperty, parsedTokenProperty, parsedVariantProperty, stringifyProperty, tokenProperty, tokenValue, variantProperty };
|
package/dist/index.d.ts
CHANGED
|
@@ -108,7 +108,8 @@ declare function getCSSPropertiesForAlias(alias: string, aliases: Config['aliase
|
|
|
108
108
|
declare function parseProperty<T extends string>(str: T, options?: {
|
|
109
109
|
escapeSpecialChars?: boolean;
|
|
110
110
|
}): T;
|
|
111
|
+
declare function stringifyProperty<T extends string>(property: T): T;
|
|
111
112
|
|
|
112
113
|
declare const mapShorthandToLonghands: Map<"flex" | "grid" | "all" | "border-block-color" | "border-block-style" | "border-block-width" | "border-inline-color" | "border-inline-style" | "border-inline-width" | "border" | "transition" | "font-variant" | "animation" | "background" | "background-position" | "border-block" | "border-block-end" | "border-block-start" | "border-bottom" | "border-color" | "border-image" | "border-inline" | "border-inline-end" | "border-inline-start" | "border-left" | "border-radius" | "border-right" | "border-style" | "border-top" | "border-width" | "column-rule" | "columns" | "contain-intrinsic-size" | "container" | "flex-flow" | "font" | "gap" | "grid-area" | "grid-column" | "grid-row" | "grid-template" | "inset" | "inset-block" | "inset-inline" | "list-style" | "margin" | "margin-block" | "margin-inline" | "mask" | "mask-border" | "offset" | "outline" | "overflow" | "overscroll-behavior" | "padding" | "padding-block" | "padding-inline" | "place-content" | "place-items" | "place-self" | "scroll-margin" | "scroll-margin-block" | "scroll-margin-inline" | "scroll-padding" | "scroll-padding-block" | "scroll-padding-inline" | "scroll-timeline" | "text-decoration" | "text-emphasis", string[]>;
|
|
113
114
|
|
|
114
|
-
export { type Aliases, ArbitraryValue, type CSSProperties, type CSSProperty, type Config, type DeepReadonly, GridProperty, GridValue, type Theme, type ThemeModes, TokenProperty, TokenValue, VariantProperty, arbitraryValue, createConfig, getArbitrarySelector, getCSSPropertiesForAlias, getTokenPropertyName, getTokenPropertyParts, getTokenPropertySplit, getTokenValueParts, gridProperty, mapShorthandToLonghands, parseProperty, parsedTokenProperty, parsedVariantProperty, tokenProperty, tokenValue, variantProperty };
|
|
115
|
+
export { type Aliases, ArbitraryValue, type CSSProperties, type CSSProperty, type Config, type DeepReadonly, GridProperty, GridValue, type Theme, type ThemeModes, TokenProperty, TokenValue, VariantProperty, arbitraryValue, createConfig, getArbitrarySelector, getCSSPropertiesForAlias, getTokenPropertyName, getTokenPropertyParts, getTokenPropertySplit, getTokenValueParts, gridProperty, mapShorthandToLonghands, parseProperty, parsedTokenProperty, parsedVariantProperty, stringifyProperty, tokenProperty, tokenValue, variantProperty };
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var gridValueRegex = /^\d+/;
|
|
|
15
15
|
var GridValue = {
|
|
16
16
|
safeParse: (input) => validate(gridValueRegex, input)
|
|
17
17
|
};
|
|
18
|
-
var tokenPropertyRegex = /(?<!var\()--(?:[^'":{}]+|{
|
|
18
|
+
var tokenPropertyRegex = /(?<!var\()--(?:[^'":{}]+|{[^}]*})+/g;
|
|
19
19
|
var TokenProperty = {
|
|
20
20
|
safeParse: (input) => validate(tokenPropertyRegex, input)
|
|
21
21
|
};
|
|
@@ -117,6 +117,9 @@ function parseProperty(str, options) {
|
|
|
117
117
|
return noColon;
|
|
118
118
|
return noColon.replace(escapeSpecialCharsRegex, (match) => `\\${match}`);
|
|
119
119
|
}
|
|
120
|
+
function stringifyProperty(property) {
|
|
121
|
+
return decodeColon(property).replace(/\\/g, "");
|
|
122
|
+
}
|
|
120
123
|
var encodeColon = (str) => str.replace(/:/g, ";");
|
|
121
124
|
var decodeColon = (str) => str.replace(/;/g, ":");
|
|
122
125
|
|
|
@@ -197,4 +200,4 @@ var replacedAmpersands = shorthandsToLonghands.map(
|
|
|
197
200
|
);
|
|
198
201
|
var mapShorthandToLonghands = new Map(replacedAmpersands);
|
|
199
202
|
|
|
200
|
-
export { ArbitraryValue, GridProperty, GridValue, TokenProperty, TokenValue, VariantProperty, arbitraryValue, createConfig, getArbitrarySelector, getCSSPropertiesForAlias, getTokenPropertyName, getTokenPropertyParts, getTokenPropertySplit, getTokenValueParts, gridProperty, mapShorthandToLonghands, parseProperty, parsedTokenProperty, parsedVariantProperty, tokenProperty, tokenValue, variantProperty };
|
|
203
|
+
export { ArbitraryValue, GridProperty, GridValue, TokenProperty, TokenValue, VariantProperty, arbitraryValue, createConfig, getArbitrarySelector, getCSSPropertiesForAlias, getTokenPropertyName, getTokenPropertyParts, getTokenPropertySplit, getTokenValueParts, gridProperty, mapShorthandToLonghands, parseProperty, parsedTokenProperty, parsedVariantProperty, stringifyProperty, tokenProperty, tokenValue, variantProperty };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenami/config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.70",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"tsup": "^7.0.0",
|
|
39
39
|
"typescript": "^5.1.3"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "e42bbb02d2699ad6625106eea72fa155efebdd73"
|
|
42
42
|
}
|