@pikacss/core 0.0.6 → 0.0.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 +8 -12
- package/dist/index.mjs +8 -12
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
const ATOMIC_STYLE_NAME_PLACEHOLDER = "&&";
|
|
4
4
|
const ATOMIC_STYLE_NAME_PLACEHOLDER_RE_GLOBAL = /&&/g;
|
|
5
|
-
const TEMP_ATOMIC_STYLE_NAME_PLACEHOLDER = "@@";
|
|
6
|
-
const TEMP_ATOMIC_STYLE_NAME_PLACEHOLDER_RE_GLOBAL = /@@/g;
|
|
7
5
|
const DEFAULT_SELECTOR_PLACEHOLDER = "&";
|
|
8
6
|
const DEFAULT_SELECTOR_PLACEHOLDER_RE_GLOBAL = /&/g;
|
|
9
7
|
|
|
@@ -66,21 +64,19 @@ function appendAutocompleteCssPropertyValues(config, property, ...values) {
|
|
|
66
64
|
config.autocomplete.cssProperties.set(property, [...current, ...values]);
|
|
67
65
|
}
|
|
68
66
|
|
|
69
|
-
const RE_SPLIT = /\s*,\s
|
|
67
|
+
const RE_SPLIT = /\s*,\s*/g;
|
|
70
68
|
function normalizeSelectors({
|
|
71
69
|
selectors,
|
|
72
70
|
defaultSelector
|
|
73
71
|
}) {
|
|
74
|
-
|
|
72
|
+
if (selectors.length === 0)
|
|
73
|
+
return [defaultSelector];
|
|
74
|
+
const normalized = selectors.map((s) => s.replace(RE_SPLIT, ","));
|
|
75
75
|
const lastSelector = selectors[selectors.length - 1];
|
|
76
|
-
if (
|
|
77
|
-
normalized
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
} else {
|
|
81
|
-
normalized = [...selectors, DEFAULT_SELECTOR_PLACEHOLDER];
|
|
82
|
-
}
|
|
83
|
-
return normalized.map((s) => s.replace(ATOMIC_STYLE_NAME_PLACEHOLDER_RE_GLOBAL, TEMP_ATOMIC_STYLE_NAME_PLACEHOLDER).replace(DEFAULT_SELECTOR_PLACEHOLDER_RE_GLOBAL, defaultSelector).replace(TEMP_ATOMIC_STYLE_NAME_PLACEHOLDER_RE_GLOBAL, ATOMIC_STYLE_NAME_PLACEHOLDER).split(RE_SPLIT).join(","));
|
|
76
|
+
if (lastSelector.includes(ATOMIC_STYLE_NAME_PLACEHOLDER) === false && lastSelector.includes(DEFAULT_SELECTOR_PLACEHOLDER) === false) {
|
|
77
|
+
normalized.push(defaultSelector);
|
|
78
|
+
}
|
|
79
|
+
return normalized.map((s) => s.split(ATOMIC_STYLE_NAME_PLACEHOLDER_RE_GLOBAL).map((_) => _.replace(DEFAULT_SELECTOR_PLACEHOLDER_RE_GLOBAL, defaultSelector)).join(ATOMIC_STYLE_NAME_PLACEHOLDER));
|
|
84
80
|
}
|
|
85
81
|
function normalizeValue(value) {
|
|
86
82
|
if (value == null)
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
const ATOMIC_STYLE_NAME_PLACEHOLDER = "&&";
|
|
2
2
|
const ATOMIC_STYLE_NAME_PLACEHOLDER_RE_GLOBAL = /&&/g;
|
|
3
|
-
const TEMP_ATOMIC_STYLE_NAME_PLACEHOLDER = "@@";
|
|
4
|
-
const TEMP_ATOMIC_STYLE_NAME_PLACEHOLDER_RE_GLOBAL = /@@/g;
|
|
5
3
|
const DEFAULT_SELECTOR_PLACEHOLDER = "&";
|
|
6
4
|
const DEFAULT_SELECTOR_PLACEHOLDER_RE_GLOBAL = /&/g;
|
|
7
5
|
|
|
@@ -64,21 +62,19 @@ function appendAutocompleteCssPropertyValues(config, property, ...values) {
|
|
|
64
62
|
config.autocomplete.cssProperties.set(property, [...current, ...values]);
|
|
65
63
|
}
|
|
66
64
|
|
|
67
|
-
const RE_SPLIT = /\s*,\s
|
|
65
|
+
const RE_SPLIT = /\s*,\s*/g;
|
|
68
66
|
function normalizeSelectors({
|
|
69
67
|
selectors,
|
|
70
68
|
defaultSelector
|
|
71
69
|
}) {
|
|
72
|
-
|
|
70
|
+
if (selectors.length === 0)
|
|
71
|
+
return [defaultSelector];
|
|
72
|
+
const normalized = selectors.map((s) => s.replace(RE_SPLIT, ","));
|
|
73
73
|
const lastSelector = selectors[selectors.length - 1];
|
|
74
|
-
if (
|
|
75
|
-
normalized
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
} else {
|
|
79
|
-
normalized = [...selectors, DEFAULT_SELECTOR_PLACEHOLDER];
|
|
80
|
-
}
|
|
81
|
-
return normalized.map((s) => s.replace(ATOMIC_STYLE_NAME_PLACEHOLDER_RE_GLOBAL, TEMP_ATOMIC_STYLE_NAME_PLACEHOLDER).replace(DEFAULT_SELECTOR_PLACEHOLDER_RE_GLOBAL, defaultSelector).replace(TEMP_ATOMIC_STYLE_NAME_PLACEHOLDER_RE_GLOBAL, ATOMIC_STYLE_NAME_PLACEHOLDER).split(RE_SPLIT).join(","));
|
|
74
|
+
if (lastSelector.includes(ATOMIC_STYLE_NAME_PLACEHOLDER) === false && lastSelector.includes(DEFAULT_SELECTOR_PLACEHOLDER) === false) {
|
|
75
|
+
normalized.push(defaultSelector);
|
|
76
|
+
}
|
|
77
|
+
return normalized.map((s) => s.split(ATOMIC_STYLE_NAME_PLACEHOLDER_RE_GLOBAL).map((_) => _.replace(DEFAULT_SELECTOR_PLACEHOLDER_RE_GLOBAL, defaultSelector)).join(ATOMIC_STYLE_NAME_PLACEHOLDER));
|
|
82
78
|
}
|
|
83
79
|
function normalizeValue(value) {
|
|
84
80
|
if (value == null)
|