storybook-addon-pseudo-states 1.15.2--canary.45.e370b20.0 → 1.15.2--canary.45.85eb83a.0

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.
@@ -16,7 +16,7 @@ const warnOnce = message => {
16
16
  console.warn(message);
17
17
  warnings.add(message);
18
18
  };
19
- const isExcludedPseudoElement = pseudoState => _constants.EXCLUDED_PSEUDO_ELEMENTS.some(element => selector.endsWith(`${element}:${pseudoState}`));
19
+ const isExcludedPseudoElement = (selector, pseudoState) => _constants.EXCLUDED_PSEUDO_ELEMENTS.some(element => selector.endsWith(`${element}:${pseudoState}`));
20
20
  const rewriteRule = (cssText, selectorText, shadowRoot) => {
21
21
  return cssText.replace(selectorText, (0, _splitSelectors.splitSelectors)(selectorText).flatMap(selector => {
22
22
  if (selector.includes(".pseudo-")) {
@@ -30,7 +30,7 @@ const rewriteRule = (cssText, selectorText, shadowRoot) => {
30
30
  states.push(state);
31
31
  return "";
32
32
  });
33
- const classSelector = states.reduce((acc, state) => !isExcludedPseudoElement(state) && acc.replace(new RegExp(`(?<!Y):${state}`, "g"), `.pseudo-${state}`), selector);
33
+ const classSelector = states.reduce((acc, state) => !isExcludedPseudoElement(selector, state) && acc.replace(new RegExp(`(?<!Y):${state}`, "g"), `.pseudo-${state}`), selector);
34
34
  if (selector.startsWith(":host(") || selector.startsWith("::slotted(")) {
35
35
  return [selector, classSelector].filter(Boolean);
36
36
  }
@@ -10,7 +10,7 @@ const warnOnce = message => {
10
10
  console.warn(message);
11
11
  warnings.add(message);
12
12
  };
13
- const isExcludedPseudoElement = pseudoState => EXCLUDED_PSEUDO_ELEMENTS.some(element => selector.endsWith(`${element}:${pseudoState}`));
13
+ const isExcludedPseudoElement = (selector, pseudoState) => EXCLUDED_PSEUDO_ELEMENTS.some(element => selector.endsWith(`${element}:${pseudoState}`));
14
14
  const rewriteRule = (cssText, selectorText, shadowRoot) => {
15
15
  return cssText.replace(selectorText, splitSelectors(selectorText).flatMap(selector => {
16
16
  if (selector.includes(".pseudo-")) {
@@ -24,7 +24,7 @@ const rewriteRule = (cssText, selectorText, shadowRoot) => {
24
24
  states.push(state);
25
25
  return "";
26
26
  });
27
- const classSelector = states.reduce((acc, state) => !isExcludedPseudoElement(state) && acc.replace(new RegExp(`(?<!Y):${state}`, "g"), `.pseudo-${state}`), selector);
27
+ const classSelector = states.reduce((acc, state) => !isExcludedPseudoElement(selector, state) && acc.replace(new RegExp(`(?<!Y):${state}`, "g"), `.pseudo-${state}`), selector);
28
28
  if (selector.startsWith(":host(") || selector.startsWith("::slotted(")) {
29
29
  return [selector, classSelector].filter(Boolean);
30
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook-addon-pseudo-states",
3
- "version": "1.15.2--canary.45.e370b20.0",
3
+ "version": "1.15.2--canary.45.85eb83a.0",
4
4
  "description": "CSS pseudo states for Storybook",
5
5
  "keywords": [
6
6
  "storybook-addons",