storybook-addon-pseudo-states 10.2.0-alpha.15 → 10.2.0-alpha.16

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.
@@ -73,10 +73,13 @@ var pseudoStates = Object.values(PSEUDO_STATES), pseudoStatesPattern = `${EXCLUD
73
73
  states: Array.from(states),
74
74
  withoutPseudoStates
75
75
  };
76
- }, rewriteNotSelectors = (selector, forShadowDOM) => [...selector.matchAll(/:not\(([^)]+)\)/g)].reduce((acc, match) => {
77
- let originalNot = match[0], selectorList = match[1], rewrittenNot = rewriteNotSelector(selectorList, forShadowDOM);
78
- return acc.replace(originalNot, rewrittenNot);
79
- }, selector), rewriteNotSelector = (negatedSelectorList, forShadowDOM) => {
76
+ }, rewriteNotSelectors = (selector, forShadowDOM) => [...selector.matchAll(/:not\((?:[^()]|\([^()]+\)|\((?:[^()]|\([^()]+\))+\))+\)/g)].reduce(
77
+ (acc, [originalNot]) => {
78
+ let selectorList = originalNot.match(/^:not\((.+)\)$/)?.[1] ?? "", rewrittenNot = rewriteNotSelector(selectorList, forShadowDOM);
79
+ return acc.replace(originalNot, rewrittenNot);
80
+ },
81
+ selector
82
+ ), rewriteNotSelector = (negatedSelectorList, forShadowDOM) => {
80
83
  let rewrittenSelectors = [];
81
84
  for (let negatedSelector of negatedSelectorList.split(/,\s*/))
82
85
  rewrittenSelectors.push(replacePseudoStatesWithAncestorSelector(negatedSelector, forShadowDOM));
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  preview_exports
3
- } from "./_browser-chunks/chunk-7YGVKEB6.js";
3
+ } from "./_browser-chunks/chunk-NXWUPAMR.js";
4
4
  import {
5
5
  PARAM_KEY
6
6
  } from "./_browser-chunks/chunk-FLRMKMJW.js";
package/dist/preview.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  decorators,
3
3
  initialGlobals
4
- } from "./_browser-chunks/chunk-7YGVKEB6.js";
4
+ } from "./_browser-chunks/chunk-NXWUPAMR.js";
5
5
  import "./_browser-chunks/chunk-FLRMKMJW.js";
6
6
  export {
7
7
  decorators,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook-addon-pseudo-states",
3
- "version": "10.2.0-alpha.15",
3
+ "version": "10.2.0-alpha.16",
4
4
  "description": "Storybook Pseudo-states addon: Manipulate CSS pseudo states",
5
5
  "keywords": [
6
6
  "storybook",
@@ -57,7 +57,7 @@
57
57
  "typescript": "^5.9.3"
58
58
  },
59
59
  "peerDependencies": {
60
- "storybook": "^10.2.0-alpha.15"
60
+ "storybook": "^10.2.0-alpha.16"
61
61
  },
62
62
  "publishConfig": {
63
63
  "access": "public"