storybook-addon-pseudo-states 1.15.2--canary.45.e370b20.0 → 1.15.2--canary.45.9045854.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.9045854.0",
4
4
  "description": "CSS pseudo states for Storybook",
5
5
  "keywords": [
6
6
  "storybook-addons",
package/CHANGELOG.md DELETED
@@ -1,93 +0,0 @@
1
- # v1.15.1 (Wed Jun 22 2022)
2
-
3
- #### 🐛 Bug Fix
4
-
5
- - Update react and react-dom peer dependencies level [#35](https://github.com/chromaui/storybook-addon-pseudo-states/pull/35) ([@dsueltenfuss](https://github.com/dsueltenfuss))
6
-
7
- #### Authors: 1
8
-
9
- - Dave Sueltenfuss ([@dsueltenfuss](https://github.com/dsueltenfuss))
10
-
11
- ---
12
-
13
- # v1.15.0 (Thu Jun 16 2022)
14
-
15
- #### 🚀 Enhancement
16
-
17
- - Add support for targeting specific elements [#25](https://github.com/chromaui/storybook-addon-pseudo-states/pull/25) (sagiv.bengiat@appsflyer.com [@ghengeveld](https://github.com/ghengeveld) [@sag1v](https://github.com/sag1v))
18
-
19
- #### Authors: 3
20
-
21
- - Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))
22
- - Sagiv ben giat ([@sag1v](https://github.com/sag1v))
23
- - sagiv.bengiat (sagiv.bengiat@appsflyer.com)
24
-
25
- ---
26
-
27
- # v1.14.1 (Wed Jun 15 2022)
28
-
29
- #### ⚠️ Pushed to `main`
30
-
31
- - Fix toolbar toggles ([@ghengeveld](https://github.com/ghengeveld))
32
- - Upgrade Storybook ([@ghengeveld](https://github.com/ghengeveld))
33
-
34
- #### Authors: 1
35
-
36
- - Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))
37
-
38
- ---
39
-
40
- # v1.0.0 (Tue May 24 2022)
41
-
42
- #### 🚀 Enhancement
43
-
44
- - Merge branch 'main' into feature/docs-support [#20](https://github.com/chromaui/storybook-addon-pseudo-states/pull/20) ([@ghengeveld](https://github.com/ghengeveld))
45
- - Add support for custom elements using `:host(:hover)` like styling. [#17](https://github.com/chromaui/storybook-addon-pseudo-states/pull/17) (jeroen.zwartepoorte@iddinkgroup.com [@ghengeveld](https://github.com/ghengeveld))
46
-
47
- #### 🐛 Bug Fix
48
-
49
- - fix: only generate pseudo selector when the selector has a match [#30](https://github.com/chromaui/storybook-addon-pseudo-states/pull/30) ([@tobi-or-not-tobi](https://github.com/tobi-or-not-tobi) [@ghengeveld](https://github.com/ghengeveld))
50
- - Use personal access token to be able to push to main ([@ghengeveld](https://github.com/ghengeveld))
51
- - fix: Resolve crash for stories that use internal State [#28](https://github.com/chromaui/storybook-addon-pseudo-states/pull/28) (david.maulick@coinbase.com)
52
- - Fix CSS selector splitting [#24](https://github.com/chromaui/storybook-addon-pseudo-states/pull/24) ([@ilanus](https://github.com/ilanus) [@ghengeveld](https://github.com/ghengeveld))
53
- - Add support for slotted lit elements [#23](https://github.com/chromaui/storybook-addon-pseudo-states/pull/23) ([@ilanus](https://github.com/ilanus))
54
- - Setup auto [#7](https://github.com/chromaui/storybook-addon-pseudo-states/pull/7) ([@ghengeveld](https://github.com/ghengeveld))
55
-
56
- #### ⚠️ Pushed to `main`
57
-
58
- - Update config to checkout repo using personal access token ([@ghengeveld](https://github.com/ghengeveld))
59
- - Use chromatic@next ([@ghengeveld](https://github.com/ghengeveld))
60
- - [skip release] Revert back to disabling CustomElement stories ([@ghengeveld](https://github.com/ghengeveld))
61
- - Another attempt at dealing with IE ([@ghengeveld](https://github.com/ghengeveld))
62
- - Don't disable stories, just ignore IE ([@ghengeveld](https://github.com/ghengeveld))
63
- - Fix missing parameter ([@ghengeveld](https://github.com/ghengeveld))
64
- - Disable snapshotting for CustomElements stories ([@ghengeveld](https://github.com/ghengeveld))
65
- - 1.1.0 ([@ghengeveld](https://github.com/ghengeveld))
66
- - Simplify ([@ghengeveld](https://github.com/ghengeveld))
67
- - Small tweak ([@ghengeveld](https://github.com/ghengeveld))
68
- - Upgrade Storybook ([@ghengeveld](https://github.com/ghengeveld))
69
- - Ignore .env file ([@ghengeveld](https://github.com/ghengeveld))
70
-
71
- #### Authors: 5
72
-
73
- - David Maulick ([@dmaulick](https://github.com/dmaulick))
74
- - Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))
75
- - Ilan ([@ilanus](https://github.com/ilanus))
76
- - Jeroen Zwartepoorte ([@jpzwarte](https://github.com/jpzwarte))
77
- - tobi-or-not-tobi ([@tobi-or-not-tobi](https://github.com/tobi-or-not-tobi))
78
-
79
- ---
80
-
81
- # v1.0.0 (Sat Feb 27 2021)
82
-
83
- #### 🐛 Bug Fix
84
-
85
- - Setup auto [#7](https://github.com/chromaui/storybook-addon-pseudo-states/pull/7) ([@ghengeveld](https://github.com/ghengeveld))
86
-
87
- #### ⚠️ Pushed to `main`
88
-
89
- - Ignore .env file ([@ghengeveld](https://github.com/ghengeveld))
90
-
91
- #### Authors: 1
92
-
93
- - Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))