postcss-focus-within 5.0.0 → 5.0.4

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/CHANGELOG.md ADDED
@@ -0,0 +1,47 @@
1
+ # Changes to PostCSS Focus Within
2
+
3
+ ### 5.0.4 (February 5, 2022)
4
+
5
+ - Improved `es module` and `commonjs` compatibility
6
+
7
+ ### 5.0.3 (January 2, 2022)
8
+
9
+ - Removed Sourcemaps from package tarball.
10
+ - Moved CLI to CLI Package. See [announcement](https://github.com/csstools/postcss-plugins/discussions/121).
11
+
12
+ ### 5.0.2 (December 13, 2021)
13
+
14
+ - Changed: now uses `postcss-selector-parser` for parsing.
15
+ - Updated: documentation
16
+
17
+ ### 5.0.1 (September 22, 2021)
18
+
19
+ - Added missing `dist` to bundle.
20
+ - Added missing `exports` to `package.json`
21
+ - Added missing `types` to `package.json`
22
+ - Added bundling & testing as prepublish step.
23
+
24
+ ### 5.0.0 (September 17, 2021)
25
+
26
+ - Updated: Support for PostCS 8+ (major).
27
+ - Updated: Support for Node 12+ (major).
28
+
29
+ ### 4.0.0 (April 20, 2020)
30
+
31
+ - Fixed: Allow `:focus-within` to appear escaped in a selector
32
+ - Updated: Support for Node 10+
33
+ - Updated: Ownership moved to CSS Tools
34
+
35
+ ### 3.0.0 (September 17, 2018)
36
+
37
+ - Updated: Support for PostCSS v7+
38
+ - Updated: Support for Node v6+
39
+
40
+ ### 2.0.0 (April 7, 2018)
41
+
42
+ - Changed: default functionality to preserve the original rule
43
+ - Added: `preserve` option to preserve the original rule using `:focus-within`
44
+
45
+ ### 1.0.0 (February 17, 2018)
46
+
47
+ - Initial version
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # PostCSS Focus Within [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]
2
2
 
3
3
  [<img alt="npm version" src="https://img.shields.io/npm/v/postcss-focus-within.svg" height="20">][npm-url]
4
- [<img alt="CSS Standard Status" src="https://cssdb.org/badge/focus-within-pseudo-class.svg" height="20">][css-url]
5
- [<img alt="Build Status" src="https://github.com/csstools/postcss-focus-within/workflows/test/badge.svg" height="20">][cli-url]
6
- [<img alt="support chat" src="https://img.shields.io/badge/support-chat-blue.svg" height="20">][git-url]
4
+ [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/focus-within-pseudo-class.svg" height="20">][css-url]
5
+ [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/tree/main/postcss-focus-within/workflows/test/badge.svg" height="20">][cli-url]
6
+ [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
7
7
 
8
8
  [PostCSS Focus Within] lets you use the `:focus-within` pseudo-class in CSS,
9
9
  following the [Selectors Level 4 specification].
@@ -116,14 +116,14 @@ focusWithin({ replaceWith: '.focus-within' });
116
116
  ```
117
117
 
118
118
  [css-url]: https://cssdb.org/#focus-within-pseudo-class
119
- [cli-url]: https://github.com/csstools/postcss-focus-within/actions/workflows/test.yml?query=workflow/test
120
- [git-url]: https://gitter.im/postcss/postcss
119
+ [cli-url]: https://github.com/csstools/postcss-plugins/tree/main/postcss-focus-within/actions/workflows/test.yml?query=workflow/test
120
+ [discord]: https://discord.gg/bUadyRwkJS
121
121
  [npm-url]: https://www.npmjs.com/package/postcss-focus-within
122
122
 
123
123
  [focus-within polyfill]: https://github.com/jsxtools/focus-within
124
124
  [Gulp PostCSS]: https://github.com/postcss/gulp-postcss
125
125
  [Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
126
126
  [PostCSS]: https://github.com/postcss/postcss
127
- [PostCSS Focus Within]: https://github.com/csstools/postcss-focus-within
127
+ [PostCSS Focus Within]: https://github.com/csstools/postcss-plugins/tree/main/postcss-focus-within
128
128
  [PostCSS Loader]: https://github.com/postcss/postcss-loader
129
129
  [Selectors Level 4 specification]: https://www.w3.org/TR/selectors-4/#the-focus-within-pseudo
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=e(require("postcss-selector-parser"));const s=e=>{const s=String(Object(e).replaceWith||"[focus-within]"),r=Boolean(!("preserve"in Object(e))||e.preserve),o=t.default().astSync(s);return{postcssPlugin:"postcss-focus-within",Rule:(e,{result:s})=>{if(!e.selector.includes(":focus-within"))return;let c;try{const s=t.default((e=>{e.walkPseudos((e=>{":focus-within"===e.value&&(e.nodes&&e.nodes.length||e.replaceWith(o.clone({})))}))})).processSync(e.selector);c=String(s)}catch(t){return void e.warn(s,`Failed to parse selector : ${e.selector}`)}if(void 0===c)return;if(c===e.selector)return;const n=e.clone({selector:c});r?e.before(n):e.replaceWith(n)}}};s.postcss=!0,module.exports=s;
@@ -0,0 +1,6 @@
1
+ import type { PluginCreator } from 'postcss';
2
+ declare const creator: PluginCreator<{
3
+ preserve?: boolean;
4
+ replaceWith?: string;
5
+ }>;
6
+ export default creator;
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ import e from"postcss-selector-parser";const s=s=>{const t=String(Object(s).replaceWith||"[focus-within]"),r=Boolean(!("preserve"in Object(s))||s.preserve),o=e().astSync(t);return{postcssPlugin:"postcss-focus-within",Rule:(s,{result:t})=>{if(!s.selector.includes(":focus-within"))return;let c;try{const t=e((e=>{e.walkPseudos((e=>{":focus-within"===e.value&&(e.nodes&&e.nodes.length||e.replaceWith(o.clone({})))}))})).processSync(s.selector);c=String(t)}catch(e){return void s.warn(t,`Failed to parse selector : ${s.selector}`)}if(void 0===c)return;if(c===s.selector)return;const n=s.clone({selector:c});r?s.before(n):s.replaceWith(n)}}};s.postcss=!0;export{s as default};
package/package.json CHANGED
@@ -1,79 +1,48 @@
1
1
  {
2
2
  "name": "postcss-focus-within",
3
- "version": "5.0.0",
3
+ "version": "5.0.4",
4
4
  "description": "Use the :focus-within pseudo-selector in CSS",
5
5
  "author": "Jonathan Neal <jonathantneal@hotmail.com>",
6
6
  "license": "CC0-1.0",
7
- "repository": "csstools/postcss-focus-within",
8
- "homepage": "https://github.com/csstools/postcss-focus-within#readme",
9
- "bugs": "https://github.com/csstools/postcss-focus-within/issues",
10
- "main": "dist/index.cjs.js",
11
- "module": "dist/index.esm.mjs",
7
+ "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-focus-within#readme",
8
+ "bugs": "https://github.com/csstools/postcss-plugins/issues",
9
+ "main": "dist/index.cjs",
10
+ "module": "dist/index.mjs",
11
+ "types": "dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/index.mjs",
15
+ "require": "./dist/index.cjs",
16
+ "default": "./dist/index.mjs"
17
+ }
18
+ },
12
19
  "files": [
20
+ "CHANGELOG.md",
21
+ "LICENSE.md",
22
+ "README.md",
13
23
  "dist"
14
24
  ],
15
25
  "scripts": {
16
- "build": "npx rollup -c .rollup.js",
17
- "build:watch": "npx rollup -c .rollup.js --watch",
18
- "lint": "npx eslint --cache src",
19
- "lint:fix": "npx eslint --cache --fix",
20
- "pretest": "npm install && npm run build",
21
- "test": "npm run lint && npm run tape",
22
- "tape": "npx postcss-tape"
26
+ "build": "rollup -c ../../rollup/default.js",
27
+ "clean": "node -e \"fs.rmSync('./dist', { recursive: true, force: true });\"",
28
+ "lint": "eslint ./src --ext .js --ext .ts --ext .mjs --no-error-on-unmatched-pattern",
29
+ "prepublishOnly": "npm run clean && npm run build && npm run test",
30
+ "stryker": "stryker run --logLevel error",
31
+ "test": "postcss-tape --ci && npm run test:exports",
32
+ "test:exports": "node ./test/_import.mjs && node ./test/_require.cjs"
23
33
  },
24
34
  "engines": {
25
- "node": ">=12"
35
+ "node": "^12 || ^14 || >=16"
26
36
  },
27
- "peerDependencies": {
28
- "postcss": "^8.3"
37
+ "dependencies": {
38
+ "postcss-selector-parser": "^6.0.9"
29
39
  },
30
40
  "devDependencies": {
31
- "@babel/core": "7.15.5",
32
- "@babel/preset-env": "7.15.6",
33
- "eslint": "7.32.0",
34
- "postcss": "8.3.6",
35
- "postcss-tape": "6.0.1",
36
- "pre-commit": "1.2.2",
37
- "rollup": "2.56.3",
38
- "rollup-plugin-babel": "4.4.0"
41
+ "postcss": "^8.3.6",
42
+ "postcss-tape": "^6.0.1"
39
43
  },
40
- "babel": {
41
- "presets": [
42
- [
43
- "@babel/env",
44
- {
45
- "targets": "maintained node versions"
46
- }
47
- ]
48
- ]
49
- },
50
- "eslintConfig": {
51
- "env": {
52
- "es6": true,
53
- "node": true
54
- },
55
- "extends": "eslint:recommended",
56
- "parserOptions": {
57
- "ecmaVersion": 2020,
58
- "sourceType": "module"
59
- }
60
- },
61
- "rollup": {
62
- "input": "src/index.js",
63
- "plugins": [
64
- "rollup-plugin-babel"
65
- ],
66
- "output": [
67
- {
68
- "exports": "default",
69
- "file": "dist/index.cjs.js",
70
- "format": "cjs"
71
- },
72
- {
73
- "file": "dist/index.esm.js",
74
- "format": "esm"
75
- }
76
- ]
44
+ "peerDependencies": {
45
+ "postcss": "^8.4"
77
46
  },
78
47
  "keywords": [
79
48
  "postcss",
@@ -88,5 +57,13 @@
88
57
  "a11y",
89
58
  "descendants",
90
59
  "ancestors"
91
- ]
60
+ ],
61
+ "repository": {
62
+ "type": "git",
63
+ "url": "https://github.com/csstools/postcss-plugins.git",
64
+ "directory": "plugins/postcss-focus-within"
65
+ },
66
+ "volta": {
67
+ "extends": "../../package.json"
68
+ }
92
69
  }