diff --git a/.distignore b/.distignore index 1c724b2e..b0fbdc92 100644 --- a/.distignore +++ b/.distignore @@ -9,6 +9,7 @@ bun.lock # Configuration files. .editorconfig .babelrc +.eslintrc.js .gitattributes .gitignore .nvmrc diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..689fa1db --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,30 @@ +/** + * ESLint configuration. + * + * Mirrors the default @wordpress/scripts config and adds the TypeScript import + * resolver, so `import/no-unresolved` understands the `@fp/*` path alias that + * tsconfig.json, webpack.config.js and Jest already map to src/resources/packages. + */ +module.exports = { + root: true, + extends: [ 'plugin:@wordpress/eslint-plugin/recommended' ], + // Vendored third-party builds (qs, Select2 3.5); not ours to lint. + ignorePatterns: [ 'src/resources/js/qs.js', 'src/resources/js/select2.js' ], + settings: { + 'import/resolver': { + typescript: { + project: './tsconfig.json', + }, + node: { + extensions: [ '.js', '.jsx', '.ts', '.tsx' ], + }, + }, + }, + overrides: [ + { + // Unit test files and their helpers only. + files: [ '**/@(test|__tests__)/**/*.js', '**/?(*.)test.js' ], + extends: [ 'plugin:@wordpress/eslint-plugin/test-unit' ], + }, + ], +}; diff --git a/bun.lock b/bun.lock index 3d437a67..870ac77d 100644 --- a/bun.lock +++ b/bun.lock @@ -1,5 +1,6 @@ { "lockfileVersion": 1, + "configVersion": 0, "workspaces": { "": { "name": "fakerpress", @@ -22,9 +23,12 @@ "@testing-library/user-event": "^14.6.1", "@types/react": "^18.3.0", "@types/react-dom": "^18.3.0", + "@wordpress/api-fetch": "^7.57.0", + "@wordpress/i18n": "^6.30.0", "@wordpress/scripts": "^30.16.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", + "eslint-import-resolver-typescript": "^3.10.1", "lucide-react": "^0.576.0", "postcss-import": "^16.1.0", "postcss-mixins": "^11.0.3", @@ -366,6 +370,12 @@ "@dual-bundle/import-meta-resolve": ["@dual-bundle/import-meta-resolve@4.1.0", "", {}, "sha512-+nxncfwHM5SgAtrVzgpzJOI1ol0PkumhVo469KCf9lUi21IGcY90G98VuHm9VRrUypmAzawAHO9bs6hqeADaVg=="], + "@emnapi/core": ["@emnapi/core@1.10.0", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.1", "tslib": "^2.4.0" } }, "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw=="], + + "@emnapi/runtime": ["@emnapi/runtime@1.10.0", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA=="], + + "@emnapi/wasi-threads": ["@emnapi/wasi-threads@1.2.1", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w=="], + "@es-joy/jsdoccomment": ["@es-joy/jsdoccomment@0.41.0", "", { "dependencies": { "comment-parser": "1.4.1", "esquery": "^1.5.0", "jsdoc-type-pratt-parser": "~4.0.0" } }, "sha512-aKUhyn1QI5Ksbqcr3fFJj16p99QdjUxXAEuFst1Z47DRyoiMwivIH9MV/ARcJOCXVjPfjITciej8ZD2O/6qUmw=="], "@eslint-community/eslint-utils": ["@eslint-community/eslint-utils@4.7.0", "", { "dependencies": { "eslint-visitor-keys": "^3.4.3" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw=="], @@ -456,6 +466,8 @@ "@leichtgewicht/ip-codec": ["@leichtgewicht/ip-codec@2.0.5", "", {}, "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw=="], + "@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.2.5", "", { "dependencies": { "@tybys/wasm-util": "^0.10.3" }, "peerDependencies": { "@emnapi/core": "^1.7.1 || ^2.0.0-alpha.4", "@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.4" } }, "sha512-HshSvXzmBxNzqejd3k/KemgQ3hdREUYFRRrgxOZ+gPljDIsO2SDZrVZMd4Z/HsxudQbE62OVyVFE8z9BCurfjA=="], + "@nicolo-ribaudo/eslint-scope-5-internals": ["@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1", "", { "dependencies": { "eslint-scope": "5.1.1" } }, "sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg=="], "@nodelib/fs.scandir": ["@nodelib/fs.scandir@2.1.5", "", { "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g=="], @@ -464,6 +476,8 @@ "@nodelib/fs.walk": ["@nodelib/fs.walk@1.2.8", "", { "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg=="], + "@nolyfill/is-core-module": ["@nolyfill/is-core-module@1.0.39", "", {}, "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA=="], + "@parcel/watcher": ["@parcel/watcher@2.5.1", "", { "dependencies": { "detect-libc": "^1.0.3", "is-glob": "^4.0.3", "micromatch": "^4.0.5", "node-addon-api": "^7.0.0" }, "optionalDependencies": { "@parcel/watcher-android-arm64": "2.5.1", "@parcel/watcher-darwin-arm64": "2.5.1", "@parcel/watcher-darwin-x64": "2.5.1", "@parcel/watcher-freebsd-x64": "2.5.1", "@parcel/watcher-linux-arm-glibc": "2.5.1", "@parcel/watcher-linux-arm-musl": "2.5.1", "@parcel/watcher-linux-arm64-glibc": "2.5.1", "@parcel/watcher-linux-arm64-musl": "2.5.1", "@parcel/watcher-linux-x64-glibc": "2.5.1", "@parcel/watcher-linux-x64-musl": "2.5.1", "@parcel/watcher-win32-arm64": "2.5.1", "@parcel/watcher-win32-ia32": "2.5.1", "@parcel/watcher-win32-x64": "2.5.1" } }, "sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg=="], "@parcel/watcher-android-arm64": ["@parcel/watcher-android-arm64@2.5.1", "", { "os": "android", "cpu": "arm64" }, "sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA=="], @@ -716,6 +730,16 @@ "@tailwindcss/postcss": ["@tailwindcss/postcss@4.2.1", "", { "dependencies": { "@alloc/quick-lru": "^5.2.0", "@tailwindcss/node": "4.2.1", "@tailwindcss/oxide": "4.2.1", "postcss": "^8.5.6", "tailwindcss": "4.2.1" } }, "sha512-OEwGIBnXnj7zJeonOh6ZG9woofIjGrd2BORfvE5p9USYKDCZoQmfqLcfNiRWoJlRWLdNPn2IgVZuWAOM4iTYMw=="], + "@tannin/compile": ["@tannin/compile@1.1.0", "", { "dependencies": { "@tannin/evaluate": "^1.2.0", "@tannin/postfix": "^1.1.0" } }, "sha512-n8m9eNDfoNZoxdvWiTfW/hSPhehzLJ3zW7f8E7oT6mCROoMNWCB4TYtv041+2FMAxweiE0j7i1jubQU4MEC/Gg=="], + + "@tannin/evaluate": ["@tannin/evaluate@1.2.0", "", {}, "sha512-3ioXvNowbO/wSrxsDG5DKIMxC81P0QrQTYai8zFNY+umuoHWRPbQ/TuuDEOju9E+jQDXmj6yI5GyejNuh8I+eg=="], + + "@tannin/plural-forms": ["@tannin/plural-forms@1.1.0", "", { "dependencies": { "@tannin/compile": "^1.1.0" } }, "sha512-xl9R2mDZO/qiHam1AgMnAES6IKIg7OBhcXqy6eDsRCdXuxAFPcjrej9HMjyCLE0DJ/8cHf0i5OQTstuBRhpbHw=="], + + "@tannin/postfix": ["@tannin/postfix@1.1.0", "", {}, "sha512-oocsqY7g0cR+Gur5jRQLSrX2OtpMLMse1I10JQBm8CdGMrDkh1Mg2gjsiquMHRtBs4Qwu5wgEp5GgIYHk4SNPw=="], + + "@tannin/sprintf": ["@tannin/sprintf@1.3.3", "", {}, "sha512-RwARl+hFwhzy0tg9atWcchLFvoQiOh4rrP7uG2N5E4W80BPCUX0ElcUR9St43fxB9EfjsW2df9Qp+UsTbvQDjA=="], + "@testing-library/dom": ["@testing-library/dom@10.4.1", "", { "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", "@types/aria-query": "^5.0.1", "aria-query": "5.3.0", "dom-accessibility-api": "^0.5.9", "lz-string": "^1.5.0", "picocolors": "1.1.1", "pretty-format": "^27.0.2" } }, "sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg=="], "@testing-library/jest-dom": ["@testing-library/jest-dom@6.9.1", "", { "dependencies": { "@adobe/css-tools": "^4.4.0", "aria-query": "^5.0.0", "css.escape": "^1.5.1", "dom-accessibility-api": "^0.6.3", "picocolors": "^1.1.1", "redent": "^3.0.0" } }, "sha512-zIcONa+hVtVSSep9UT3jZ5rizo2BsxgyDYU7WFD5eICBE7no3881HGeb/QkGfsJs6JTkY1aQhT7rIPC7e+0nnA=="], @@ -730,6 +754,8 @@ "@trysound/sax": ["@trysound/sax@0.2.0", "", {}, "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA=="], + "@tybys/wasm-util": ["@tybys/wasm-util@0.10.4", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A=="], + "@types/aria-query": ["@types/aria-query@5.0.4", "", {}, "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw=="], "@types/babel__core": ["@types/babel__core@7.20.5", "", { "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA=="], @@ -854,6 +880,50 @@ "@ungap/structured-clone": ["@ungap/structured-clone@1.3.0", "", {}, "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g=="], + "@unrs/resolver-binding-android-arm-eabi": ["@unrs/resolver-binding-android-arm-eabi@1.12.2", "", { "os": "android", "cpu": "arm" }, "sha512-g5T90pqg1bo/7mytQx6F4iBNC0Wsh9cu+z9veDbFjc7HjpesJFWD7QMS0NGStXM075+7dJPPVvBbpZlnrdpi/w=="], + + "@unrs/resolver-binding-android-arm64": ["@unrs/resolver-binding-android-arm64@1.12.2", "", { "os": "android", "cpu": "arm64" }, "sha512-YGCRZv/9GLhwmz6mYDeTsm/92BAyR28l6c2ReweVW5pWgfsitWLY8upvfRlGdoyD8HjeTHSYJWyZGD4KJA/nFQ=="], + + "@unrs/resolver-binding-darwin-arm64": ["@unrs/resolver-binding-darwin-arm64@1.12.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-u9DiNT1auQMO20A9SyTuG3wUgQWB9Z7KjAg0uFuCDR1FsAY8A0CG2S6JpHS1xwm/w1G08bjXZDcyOCjv1WAm2w=="], + + "@unrs/resolver-binding-darwin-x64": ["@unrs/resolver-binding-darwin-x64@1.12.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-f7rPLi/T1HVKZu/u6t87lroib16n8vrSzcyxI7lg4BGO9UF26KhQL44sd9eOUgrTYhvRXtWOIZT5PejdPyJfUA=="], + + "@unrs/resolver-binding-freebsd-x64": ["@unrs/resolver-binding-freebsd-x64@1.12.2", "", { "os": "freebsd", "cpu": "x64" }, "sha512-BpcOjWCJub6nRZUS2zA20pmLvjtqAtGejETaIyRLiZiQf++cbrjltLA5NN/xaXfqeOBOSlMFbemIl5/S5tljmg=="], + + "@unrs/resolver-binding-linux-arm-gnueabihf": ["@unrs/resolver-binding-linux-arm-gnueabihf@1.12.2", "", { "os": "linux", "cpu": "arm" }, "sha512-vZTDvdSISZjJx66OzJqtsOhzifbqRjbmI1Mnu49fQDwog5GtDI4QidRiEAYbZCRj9C8YZEW+3ZjqsyS9GR4k2A=="], + + "@unrs/resolver-binding-linux-arm-musleabihf": ["@unrs/resolver-binding-linux-arm-musleabihf@1.12.2", "", { "os": "linux", "cpu": "arm" }, "sha512-BiPI+IrIlwcW4nLLMM21+B1dFPzd55yAVgVGrdgDjNef+ch03GdxrcyaIz8X9SsQirh/kCQ7mviyWlMxdh2D7g=="], + + "@unrs/resolver-binding-linux-arm64-gnu": ["@unrs/resolver-binding-linux-arm64-gnu@1.12.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-zJc0H99FEPoFfSrNpa91HYfxzfAJCr502oxNK1cfdC9hlaFI43RT+JFCann9JUgZmLzzntChHyn13Sgn9ljHNg=="], + + "@unrs/resolver-binding-linux-arm64-musl": ["@unrs/resolver-binding-linux-arm64-musl@1.12.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-KQ3Lki6l+Pz1k/eBipN41ES+YUK30beLGb9YqcB1O542cyLCNE6GaxrfcY3T6EezmGGk84wb5XyO9loTM9tkcA=="], + + "@unrs/resolver-binding-linux-loong64-gnu": ["@unrs/resolver-binding-linux-loong64-gnu@1.12.2", "", { "os": "linux", "cpu": "none" }, "sha512-3SJGEh1DborhG6pyxvhPzCT4bbSIVihsvgJc13P1bHG7KLdNDaF9T3gsTwFc7Jw/5Y5/iWOjkEx7Zy0NvCGX3Q=="], + + "@unrs/resolver-binding-linux-loong64-musl": ["@unrs/resolver-binding-linux-loong64-musl@1.12.2", "", { "os": "linux", "cpu": "none" }, "sha512-jiuG/Obbel7uw1PwHNFfrkiKhLAF6mnyZ6aWlOAVN9WqKm8v0OFGnciJIHu8+CMvXLQ8AD51LPzAoUfT21D5Ew=="], + + "@unrs/resolver-binding-linux-ppc64-gnu": ["@unrs/resolver-binding-linux-ppc64-gnu@1.12.2", "", { "os": "linux", "cpu": "ppc64" }, "sha512-q7xRvVpmcfeL+LlZg8Pbbo6QaTZwDU5BaGZbwfhkEsXJn3Was8xYfE0RBH266xZt0rM6B7i8xAYIvjthuUIWHg=="], + + "@unrs/resolver-binding-linux-riscv64-gnu": ["@unrs/resolver-binding-linux-riscv64-gnu@1.12.2", "", { "os": "linux", "cpu": "none" }, "sha512-0CVdx6lcnT3Q9inOH8tsMIOJ6ImndllMjqJHg8RLVdB7Vq4SfkEXl9mCSsVNuNA4MCYycRicCUxPCabVHJRr6A=="], + + "@unrs/resolver-binding-linux-riscv64-musl": ["@unrs/resolver-binding-linux-riscv64-musl@1.12.2", "", { "os": "linux", "cpu": "none" }, "sha512-iOwlRo9vnp6R6ohHQS11n0NnfdXx/omhkocmIfaPRpQhKZ+3BDMkkdRVh53qjkFkpPddf+FETA28NwGN7l5l+w=="], + + "@unrs/resolver-binding-linux-s390x-gnu": ["@unrs/resolver-binding-linux-s390x-gnu@1.12.2", "", { "os": "linux", "cpu": "s390x" }, "sha512-HYJtLfXq94q8iZNFT1lknx258wlkkWhZeUXJRqzKBBUJ00CvZ+N33zgbCqimLjsyw5Va6uUxhVa12mI+kaveEw=="], + + "@unrs/resolver-binding-linux-x64-gnu": ["@unrs/resolver-binding-linux-x64-gnu@1.12.2", "", { "os": "linux", "cpu": "x64" }, "sha512-mPsUhunKKDih5O96Y6enDQyHc1SqBPlY1E/SfMWDM3EdJ95Z9CArPeCVwCCqbP45ljvivdEk8Fxn+SIb1rDAJQ=="], + + "@unrs/resolver-binding-linux-x64-musl": ["@unrs/resolver-binding-linux-x64-musl@1.12.2", "", { "os": "linux", "cpu": "x64" }, "sha512-azrt6+5ydLd8Vt210AAFis/lZevSfPw93EJRIJG+xPu4WCJ8K0kppCTpMyLPcKT7H15M4Jnt2tMp5bOvCkRC6A=="], + + "@unrs/resolver-binding-openharmony-arm64": ["@unrs/resolver-binding-openharmony-arm64@1.12.2", "", { "os": "none", "cpu": "arm64" }, "sha512-YZ9hP4O0X9PQb8eO980qmLNGH4zT3I9+SZTdt0Pr0YyuGQhYKoOZkV02VzrzyOZJ5xIJ3UFIenKkUkGg8GjgWQ=="], + + "@unrs/resolver-binding-wasm32-wasi": ["@unrs/resolver-binding-wasm32-wasi@1.12.2", "", { "dependencies": { "@emnapi/core": "1.10.0", "@emnapi/runtime": "1.10.0", "@napi-rs/wasm-runtime": "^1.1.4" }, "cpu": "none" }, "sha512-tYFDIkMxSflfEc/h92ZWNsZlHSwgimbNHSO3PL2JWQHfCuC2q316jMyYU9TIWZsFK2bQwyK5VAdYgn8ygPj69A=="], + + "@unrs/resolver-binding-win32-arm64-msvc": ["@unrs/resolver-binding-win32-arm64-msvc@1.12.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-qzNyg3xL0VPQmCaUh+N5jSitce6k+uCBfMDesWRnlULOZaqUkaJ0ybdT+UqlAWJoQjuqfIU/0Ptx9bteN4D82g=="], + + "@unrs/resolver-binding-win32-ia32-msvc": ["@unrs/resolver-binding-win32-ia32-msvc@1.12.2", "", { "os": "win32", "cpu": "ia32" }, "sha512-WD9sY00OfpHVGfsnHZoA8jVT+esS/Bg8z8jzxp5BnDCjjwsuKsPQrzswwpFy4J1AUJbXPRfkpcX0mXrzeXW79g=="], + + "@unrs/resolver-binding-win32-x64-msvc": ["@unrs/resolver-binding-win32-x64-msvc@1.12.2", "", { "os": "win32", "cpu": "x64" }, "sha512-nAB74NfSNKknqQ1RrYj6uz8FcXEomu/MATJZxh/x+BArzN2U3JbOYC0APYzUIGhVY3m5hRxA8VPNdPBoG8txlA=="], + "@webassemblyjs/ast": ["@webassemblyjs/ast@1.14.1", "", { "dependencies": { "@webassemblyjs/helper-numbers": "1.13.2", "@webassemblyjs/helper-wasm-bytecode": "1.13.2" } }, "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ=="], "@webassemblyjs/floating-point-hex-parser": ["@webassemblyjs/floating-point-hex-parser@1.13.2", "", {}, "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA=="], @@ -890,6 +960,8 @@ "@webpack-cli/serve": ["@webpack-cli/serve@2.0.5", "", { "peerDependencies": { "webpack": "5.x.x", "webpack-cli": "5.x.x" } }, "sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ=="], + "@wordpress/api-fetch": ["@wordpress/api-fetch@7.57.0", "", { "dependencies": { "@wordpress/i18n": "^6.30.0", "@wordpress/private-apis": "^2.0.0", "@wordpress/url": "^4.57.0" } }, "sha512-NM9whtviaDmHmoJORHCZ1TqDRiC0nPooN/IqGEwfr2nX1X8F6d4hvOceiOZJJDTXQzdJoun5c9oUNQ4IrABQ4w=="], + "@wordpress/babel-preset-default": ["@wordpress/babel-preset-default@8.23.0", "", { "dependencies": { "@babel/core": "7.25.7", "@babel/plugin-transform-react-jsx": "7.25.7", "@babel/plugin-transform-runtime": "7.25.7", "@babel/preset-env": "7.25.7", "@babel/preset-typescript": "7.25.7", "@babel/runtime": "7.25.7", "@wordpress/browserslist-config": "^6.23.0", "@wordpress/warning": "^3.23.0", "browserslist": "^4.21.10", "core-js": "^3.31.0", "react": "^18.3.0" } }, "sha512-dHUQJIXWsgIIhZHXjpHN53S1fzTy4ZJLk0Wpr29hRQYGrWAx9NSMHZRbaF2Qn5Ma5awe9ID5CIzBic4/pGxKqw=="], "@wordpress/base-styles": ["@wordpress/base-styles@5.23.0", "", {}, "sha512-1mtX3jA9el2ZDkAJp7YEN1bX+DzfX0h496uxpRk+evmQJLZxBMPeu5datJFtwkWbVitOsR88WCDvUoNoKJMSuw=="], @@ -902,6 +974,10 @@ "@wordpress/eslint-plugin": ["@wordpress/eslint-plugin@22.9.0", "", { "dependencies": { "@babel/eslint-parser": "7.25.7", "@typescript-eslint/eslint-plugin": "^6.4.1", "@typescript-eslint/parser": "^6.4.1", "@wordpress/babel-preset-default": "^8.23.0", "@wordpress/prettier-config": "^4.23.0", "cosmiconfig": "^7.0.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.25.2", "eslint-plugin-jest": "^27.4.3", "eslint-plugin-jsdoc": "^46.4.6", "eslint-plugin-jsx-a11y": "^6.5.1", "eslint-plugin-playwright": "^0.15.3", "eslint-plugin-prettier": "^5.0.0", "eslint-plugin-react": "^7.27.0", "eslint-plugin-react-hooks": "^4.3.0", "globals": "^13.12.0", "requireindex": "^1.2.0" }, "peerDependencies": { "@babel/core": ">=7", "eslint": ">=8", "prettier": ">=3", "typescript": ">=5" }, "optionalPeers": ["prettier", "typescript"] }, "sha512-reiIp2GpXpxWucTZgrswPVTl1YqoZOSW8DRS4U5tGw6eTNN5YDIcDH+yyje2O2kFNh0otCvF4Y4gzQiYDOulAw=="], + "@wordpress/hooks": ["@wordpress/hooks@4.57.0", "", {}, "sha512-vRJxRhOj+a19RvdW6u0ZBmiQc/t/ueVGsIP3IbS9zuvfLJILtvMSWXU8Fe3m/W+mBK5ZEOfm72LYBhWGPse0DA=="], + + "@wordpress/i18n": ["@wordpress/i18n@6.30.0", "", { "dependencies": { "@tannin/sprintf": "^1.3.2", "@wordpress/hooks": "^4.57.0", "gettext-parser": "^1.3.1", "tannin": "^1.2.0" }, "bin": { "pot-to-php": "tools/pot-to-php.js" } }, "sha512-Q8ivagc2aG+Qe5dTzmiohR+pDo4xDcD746fGI2dq+JIbTibYRnkFoN1VyGFZX/Q+g98I80ZJLJ5Vk3svSXb9ag=="], + "@wordpress/jest-console": ["@wordpress/jest-console@8.23.0", "", { "dependencies": { "@babel/runtime": "7.25.7", "jest-matcher-utils": "^29.6.2" }, "peerDependencies": { "jest": ">=29" } }, "sha512-2uL5VzRf63Uyl6bym7sdYJhke4ziEj8kPlPn3ObCV210140TB17SOxJ8SOE3wxBlEh1VDPSotXto8GW/lu+iBg=="], "@wordpress/jest-preset-default": ["@wordpress/jest-preset-default@12.23.0", "", { "dependencies": { "@wordpress/jest-console": "^8.23.0", "babel-jest": "29.7.0" }, "peerDependencies": { "@babel/core": ">=7", "jest": ">=29" } }, "sha512-vfdTifeiIDi5FlCYlKiKvmY9o1gymXajc8SBAM66y/qDJCbDi/kFsINDM4aejveIIx8qTO7t3lr8hNkOjxsCPw=="], @@ -912,10 +988,14 @@ "@wordpress/prettier-config": ["@wordpress/prettier-config@4.23.0", "", { "peerDependencies": { "prettier": ">=3" } }, "sha512-IxJcV/SxPzT8bRuYbhBZwAa8Q8n16con4uD/8X8OF3/vAP2StX5/kAo3tVvy7e1La7H/1QkmdyayeHkyiwNRsQ=="], + "@wordpress/private-apis": ["@wordpress/private-apis@2.0.0", "", {}, "sha512-VmGwebQZoebF5t1xFMXbj6z/dTtAca4d8YaO3IPN2aP8IT+eOrUBvoAthC5BmLPU4JLN5m3r8vbrid3mcli6vw=="], + "@wordpress/scripts": ["@wordpress/scripts@30.16.0", "", { "dependencies": { "@babel/core": "7.25.7", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11", "@svgr/webpack": "^8.0.1", "@wordpress/babel-preset-default": "^8.23.0", "@wordpress/browserslist-config": "^6.23.0", "@wordpress/dependency-extraction-webpack-plugin": "^6.23.0", "@wordpress/e2e-test-utils-playwright": "^1.23.0", "@wordpress/eslint-plugin": "^22.9.0", "@wordpress/jest-preset-default": "^12.23.0", "@wordpress/npm-package-json-lint-config": "^5.23.0", "@wordpress/postcss-plugins-preset": "^5.23.0", "@wordpress/prettier-config": "^4.23.0", "@wordpress/stylelint-config": "^23.15.0", "adm-zip": "^0.5.9", "babel-jest": "29.7.0", "babel-loader": "9.2.1", "browserslist": "^4.21.10", "chalk": "^4.0.0", "check-node-version": "^4.1.0", "clean-webpack-plugin": "^3.0.0", "copy-webpack-plugin": "^10.2.0", "cross-spawn": "^7.0.6", "css-loader": "^6.2.0", "cssnano": "^6.0.1", "cwd": "^0.10.0", "dir-glob": "^3.0.1", "eslint": "^8.3.0", "expect-puppeteer": "^4.4.0", "fast-glob": "^3.2.7", "filenamify": "^4.2.0", "jest": "^29.6.2", "jest-dev-server": "^10.1.4", "jest-environment-jsdom": "^29.6.2", "jest-environment-node": "^29.6.2", "json2php": "^0.0.9", "markdownlint-cli": "^0.31.1", "merge-deep": "^3.0.3", "mini-css-extract-plugin": "^2.9.2", "minimist": "^1.2.0", "npm-package-json-lint": "^6.4.0", "npm-packlist": "^3.0.0", "postcss": "^8.4.5", "postcss-loader": "^6.2.1", "prettier": "npm:wp-prettier@3.0.3", "puppeteer-core": "^23.10.1", "react-refresh": "^0.14.0", "read-pkg-up": "^7.0.1", "resolve-bin": "^0.4.0", "rtlcss": "^4.3.0", "sass": "^1.54.0", "sass-loader": "^16.0.3", "schema-utils": "^4.2.0", "source-map-loader": "^3.0.0", "stylelint": "^16.8.2", "terser-webpack-plugin": "^5.3.10", "url-loader": "^4.1.1", "webpack": "^5.97.0", "webpack-bundle-analyzer": "^4.9.1", "webpack-cli": "^5.1.4", "webpack-dev-server": "^4.15.1" }, "peerDependencies": { "@playwright/test": "^1.51.1", "react": "^18.0.0", "react-dom": "^18.0.0" }, "bin": { "wp-scripts": "./bin/wp-scripts.js" } }, "sha512-1lOChs1DzI8YYsjZFBNFy0km5o5ts08rIanQQ6k/tdNiVLnb4h5/aUike60Y3phGjV3On7xO/K4ZJ7AyoI0oRA=="], "@wordpress/stylelint-config": ["@wordpress/stylelint-config@23.15.0", "", { "dependencies": { "@stylistic/stylelint-plugin": "^3.0.1", "stylelint-config-recommended": "^14.0.1", "stylelint-config-recommended-scss": "^14.1.0" }, "peerDependencies": { "stylelint": "^16.8.2", "stylelint-scss": "^6.4.0" } }, "sha512-DVxCs7uojx7YJ/jJvN3EZg4wHXgvaMCqiVCtBGOQphgaBetgH5GyEELoDA6MOFd7DCO6edVjx5fhT5dc40zmAQ=="], + "@wordpress/url": ["@wordpress/url@4.57.0", "", { "dependencies": { "remove-accents": "^0.5.0" } }, "sha512-2y8No4z7GNlrNjR7hUTThSG7hVRDAQixwFxPj8JUydjMS9nv02PBgZhy7XakFXVZFw2PsmajTW56+BdQFKp96A=="], + "@wordpress/warning": ["@wordpress/warning@3.23.0", "", {}, "sha512-tPJ8T5BBNRqNTdF8gOy97h+sD+bs0QwoRIzE4y2erQ9E+LqQXIgl8+UhT0F+5q7QcFzd0hGRF8sotzILMjJZHw=="], "@xtuc/ieee754": ["@xtuc/ieee754@1.2.0", "", {}, "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA=="], @@ -1342,6 +1422,8 @@ "encodeurl": ["encodeurl@2.0.0", "", {}, "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg=="], + "encoding": ["encoding@0.1.13", "", { "dependencies": { "iconv-lite": "^0.6.2" } }, "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A=="], + "end-of-stream": ["end-of-stream@1.4.4", "", { "dependencies": { "once": "^1.4.0" } }, "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q=="], "enhanced-resolve": ["enhanced-resolve@5.20.0", "", { "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.3.0" } }, "sha512-/ce7+jQ1PQ6rVXwe+jKEg5hW5ciicHwIQUagZkp6IufBoY3YDgdTTY1azVs0qoRgVmvsNB+rbjLJxDAeHHtwsQ=="], @@ -1390,6 +1472,8 @@ "eslint-import-resolver-node": ["eslint-import-resolver-node@0.3.9", "", { "dependencies": { "debug": "^3.2.7", "is-core-module": "^2.13.0", "resolve": "^1.22.4" } }, "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g=="], + "eslint-import-resolver-typescript": ["eslint-import-resolver-typescript@3.10.1", "", { "dependencies": { "@nolyfill/is-core-module": "1.0.39", "debug": "^4.4.0", "get-tsconfig": "^4.10.0", "is-bun-module": "^2.0.0", "stable-hash": "^0.0.5", "tinyglobby": "^0.2.13", "unrs-resolver": "^1.6.2" }, "peerDependencies": { "eslint": "*", "eslint-plugin-import": "*", "eslint-plugin-import-x": "*" }, "optionalPeers": ["eslint-plugin-import", "eslint-plugin-import-x"] }, "sha512-A1rHYb06zjMGAxdLSkN2fXPBwuSaQ0iO5M/hdyS0Ajj1VBaRp0sPD3dn1FhME3c/JluGFbwSxyCfqdSbtQLAHQ=="], + "eslint-module-utils": ["eslint-module-utils@2.12.0", "", { "dependencies": { "debug": "^3.2.7" } }, "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg=="], "eslint-plugin-import": ["eslint-plugin-import@2.31.0", "", { "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.8", "array.prototype.findlastindex": "^1.2.5", "array.prototype.flat": "^1.3.2", "array.prototype.flatmap": "^1.3.2", "debug": "^3.2.7", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.9", "eslint-module-utils": "^2.12.0", "hasown": "^2.0.2", "is-core-module": "^2.15.1", "is-glob": "^4.0.3", "minimatch": "^3.1.2", "object.fromentries": "^2.0.8", "object.groupby": "^1.0.3", "object.values": "^1.2.0", "semver": "^6.3.1", "string.prototype.trimend": "^1.0.8", "tsconfig-paths": "^3.15.0" }, "peerDependencies": { "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" } }, "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A=="], @@ -1520,7 +1604,7 @@ "fs.realpath": ["fs.realpath@1.0.0", "", {}, "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="], - "fsevents": ["fsevents@2.3.2", "", { "os": "darwin" }, "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA=="], + "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], "function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="], @@ -1548,8 +1632,12 @@ "get-symbol-description": ["get-symbol-description@1.1.0", "", { "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6" } }, "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg=="], + "get-tsconfig": ["get-tsconfig@4.14.3", "", { "dependencies": { "resolve-pkg-maps": "^1.0.0" } }, "sha512-++QEw4DIY7WGoukz+/+A/8dGYPT9l9yIadnmSgZ8Rjr3YVSVDipQSO9CdnJo9ePqFqUUqh+wk9uIaoiAwsiPkA=="], + "get-uri": ["get-uri@6.0.4", "", { "dependencies": { "basic-ftp": "^5.0.2", "data-uri-to-buffer": "^6.0.2", "debug": "^4.3.4" } }, "sha512-E1b1lFFLvLgak2whF2xDBcOy6NLVGZBqqjJjsIhvopKfWWEi64pLVTWWehV8KlLerZkfNTA95sTe2OdJKm1OzQ=="], + "gettext-parser": ["gettext-parser@1.4.0", "", { "dependencies": { "encoding": "^0.1.12", "safe-buffer": "^5.1.1" } }, "sha512-sedZYLHlHeBop/gZ1jdg59hlUEcpcZJofLq2JFwJT1zTqAU3l2wFv6IsuwFHGqbiT9DWzMUW4/em2+hspnmMMA=="], + "glob": ["glob@7.2.3", "", { "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q=="], "glob-parent": ["glob-parent@6.0.2", "", { "dependencies": { "is-glob": "^4.0.3" } }, "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A=="], @@ -1688,6 +1776,8 @@ "is-builtin-module": ["is-builtin-module@3.2.1", "", { "dependencies": { "builtin-modules": "^3.3.0" } }, "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A=="], + "is-bun-module": ["is-bun-module@2.0.0", "", { "dependencies": { "semver": "^7.7.1" } }, "sha512-gNCGbnnnnFAUGKeZ9PdbyeGYJqewpmc2aKHUEMO5nQPWU9lOmv7jcmQIv+qHD8fXW6W7qfuCwX4rY9LNRjXrkQ=="], + "is-callable": ["is-callable@1.2.7", "", {}, "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA=="], "is-core-module": ["is-core-module@2.16.1", "", { "dependencies": { "hasown": "^2.0.2" } }, "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w=="], @@ -2050,6 +2140,8 @@ "nanoid": ["nanoid@3.3.11", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="], + "napi-postinstall": ["napi-postinstall@0.3.4", "", { "bin": { "napi-postinstall": "lib/cli.js" } }, "sha512-PHI5f1O0EP5xJ9gQmFGMS6IZcrVvTjpXjz7Na41gTE7eE2hK11lg04CECCYEEjdc17EV4DO+fkGEtt7TpTaTiQ=="], + "natural-compare": ["natural-compare@1.4.0", "", {}, "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="], "negotiator": ["negotiator@0.6.4", "", {}, "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w=="], @@ -2432,6 +2524,8 @@ "regjsparser": ["regjsparser@0.12.0", "", { "dependencies": { "jsesc": "~3.0.2" }, "bin": { "regjsparser": "bin/parser" } }, "sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ=="], + "remove-accents": ["remove-accents@0.5.0", "", {}, "sha512-8g3/Otx1eJaVD12e31UbJj1YzdtVvzH85HV7t+9MJYk/u3XmkOUJ5Ys9wQrf9PCPK8+xn4ymzqYCiZl6QWKn+A=="], + "require-directory": ["require-directory@2.1.1", "", {}, "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q=="], "require-from-string": ["require-from-string@2.0.2", "", {}, "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="], @@ -2450,6 +2544,8 @@ "resolve-from": ["resolve-from@5.0.0", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="], + "resolve-pkg-maps": ["resolve-pkg-maps@1.0.0", "", {}, "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw=="], + "resolve.exports": ["resolve.exports@2.0.3", "", {}, "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A=="], "retry": ["retry@0.13.1", "", {}, "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg=="], @@ -2574,6 +2670,8 @@ "sprintf-js": ["sprintf-js@1.0.3", "", {}, "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="], + "stable-hash": ["stable-hash@0.0.5", "", {}, "sha512-+L3ccpzibovGXFK+Ap/f8LOS0ahMrHTf3xu7mMLSpEGU0EO9ucaysSylKo9eRDFNhWve/y275iPmIZ4z39a9iA=="], + "stack-utils": ["stack-utils@2.0.6", "", { "dependencies": { "escape-string-regexp": "^2.0.0" } }, "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ=="], "stackframe": ["stackframe@1.3.4", "", {}, "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw=="], @@ -2648,6 +2746,8 @@ "tailwindcss": ["tailwindcss@4.2.1", "", {}, "sha512-/tBrSQ36vCleJkAOsy9kbNTgaxvGbyOamC30PRePTQe/o1MFwEKHQk4Cn7BNGaPtjp+PuUrByJehM1hgxfq4sw=="], + "tannin": ["tannin@1.2.0", "", { "dependencies": { "@tannin/plural-forms": "^1.1.0" } }, "sha512-U7GgX/RcSeUETbV7gYgoz8PD7Ni4y95pgIP/Z6ayI3CfhSujwKEBlGFTCRN+Aqnuyf4AN2yHL+L8x+TCGjb9uA=="], + "tapable": ["tapable@2.2.1", "", {}, "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ=="], "tar-fs": ["tar-fs@3.0.8", "", { "dependencies": { "pump": "^3.0.0", "tar-stream": "^3.1.5" }, "optionalDependencies": { "bare-fs": "^4.0.1", "bare-path": "^3.0.0" } }, "sha512-ZoROL70jptorGAlgAYiLoBLItEKw/fUxg9BSYK/dF/GAGYFJOJJJMvjPAKDJraCXFwadD456FCuvLWgfhMsPwg=="], @@ -2746,6 +2846,8 @@ "unpipe": ["unpipe@1.0.0", "", {}, "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="], + "unrs-resolver": ["unrs-resolver@1.12.2", "", { "dependencies": { "napi-postinstall": "^0.3.4" }, "optionalDependencies": { "@unrs/resolver-binding-android-arm-eabi": "1.12.2", "@unrs/resolver-binding-android-arm64": "1.12.2", "@unrs/resolver-binding-darwin-arm64": "1.12.2", "@unrs/resolver-binding-darwin-x64": "1.12.2", "@unrs/resolver-binding-freebsd-x64": "1.12.2", "@unrs/resolver-binding-linux-arm-gnueabihf": "1.12.2", "@unrs/resolver-binding-linux-arm-musleabihf": "1.12.2", "@unrs/resolver-binding-linux-arm64-gnu": "1.12.2", "@unrs/resolver-binding-linux-arm64-musl": "1.12.2", "@unrs/resolver-binding-linux-loong64-gnu": "1.12.2", "@unrs/resolver-binding-linux-loong64-musl": "1.12.2", "@unrs/resolver-binding-linux-ppc64-gnu": "1.12.2", "@unrs/resolver-binding-linux-riscv64-gnu": "1.12.2", "@unrs/resolver-binding-linux-riscv64-musl": "1.12.2", "@unrs/resolver-binding-linux-s390x-gnu": "1.12.2", "@unrs/resolver-binding-linux-x64-gnu": "1.12.2", "@unrs/resolver-binding-linux-x64-musl": "1.12.2", "@unrs/resolver-binding-openharmony-arm64": "1.12.2", "@unrs/resolver-binding-wasm32-wasi": "1.12.2", "@unrs/resolver-binding-win32-arm64-msvc": "1.12.2", "@unrs/resolver-binding-win32-ia32-msvc": "1.12.2", "@unrs/resolver-binding-win32-x64-msvc": "1.12.2" } }, "sha512-dmlRxBJJayXjqTwC+JtF1HhJmgf3ftQ3YejFcZrf4+KKtJv0qDsK1pjqaaVjG7wJ5NJ6UVP1OqRMQ71Z4C3rxQ=="], + "update-browserslist-db": ["update-browserslist-db@1.1.3", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw=="], "upper-case": ["upper-case@2.0.2", "", { "dependencies": { "tslib": "^2.0.3" } }, "sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg=="], @@ -3124,6 +3226,8 @@ "ip-address/sprintf-js": ["sprintf-js@1.1.3", "", {}, "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA=="], + "is-bun-module/semver": ["semver@7.7.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA=="], + "is-path-in-cwd/is-path-inside": ["is-path-inside@2.1.0", "", { "dependencies": { "path-is-inside": "^1.0.2" } }, "sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg=="], "istanbul-lib-report/make-dir": ["make-dir@4.0.0", "", { "dependencies": { "semver": "^7.5.3" } }, "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw=="], @@ -3138,8 +3242,6 @@ "jest-each/pretty-format": ["pretty-format@29.7.0", "", { "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" } }, "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ=="], - "jest-haste-map/fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], - "jest-haste-map/jest-worker": ["jest-worker@29.7.0", "", { "dependencies": { "@types/node": "*", "jest-util": "^29.7.0", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" } }, "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw=="], "jest-leak-detector/pretty-format": ["pretty-format@29.7.0", "", { "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" } }, "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ=="], @@ -3212,6 +3314,8 @@ "pkg-dir/find-up": ["find-up@6.3.0", "", { "dependencies": { "locate-path": "^7.1.0", "path-exists": "^5.0.0" } }, "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw=="], + "playwright/fsevents": ["fsevents@2.3.2", "", { "os": "darwin" }, "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA=="], + "postcss-calc/postcss-selector-parser": ["postcss-selector-parser@6.1.2", "", { "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" } }, "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg=="], "postcss-loader/semver": ["semver@7.7.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA=="], @@ -3486,8 +3590,6 @@ "url-loader/schema-utils/ajv-keywords": ["ajv-keywords@3.5.2", "", { "peerDependencies": { "ajv": "^6.9.1" } }, "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ=="], - "webpack-dev-server/chokidar/fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], - "webpack-dev-server/chokidar/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], "webpack-dev-server/chokidar/readdirp": ["readdirp@3.6.0", "", { "dependencies": { "picomatch": "^2.2.1" } }, "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA=="], diff --git a/package.json b/package.json index a23c253d..f82570ab 100644 --- a/package.json +++ b/package.json @@ -42,22 +42,25 @@ "main": "Gruntfile.js", "devDependencies": { "@stellarwp/tyson": "^0.0.7", + "@tailwindcss/postcss": "^4.0.0", "@testing-library/jest-dom": "^6.9.1", "@testing-library/react": "^16.3.2", "@testing-library/user-event": "^14.6.1", "@types/react": "^18.3.0", "@types/react-dom": "^18.3.0", + "@wordpress/api-fetch": "^7.57.0", + "@wordpress/i18n": "^6.30.0", "@wordpress/scripts": "^30.16.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", + "eslint-import-resolver-typescript": "^3.10.1", "lucide-react": "^0.576.0", "postcss-import": "^16.1.0", "postcss-mixins": "^11.0.3", "postcss-nested": "^7.0.2", "postcss-preset-env": "^10.1.5", "tailwind-merge": "^3.5.0", - "tailwindcss": "^4.0.0", - "@tailwindcss/postcss": "^4.0.0" + "tailwindcss": "^4.0.0" }, "dependencies": { "@hookform/resolvers": "^5.2.2", diff --git a/readme.txt b/readme.txt index c0277442..7dbf5bf4 100644 --- a/readme.txt +++ b/readme.txt @@ -176,6 +176,7 @@ For help with or questions about FakerPress, visit the [WordPress Plugin Forums] * Fix - The Users generator accepts a boolean `use_html` from the REST API (the `on` value still works). [[#187](https://github.com/bordoni/fakerpress/pull/187)] * Tests - Add Jest coverage for the admin, REST payload tests for every generate endpoint, and build the JS before WPUnit in CI. [[#187](https://github.com/bordoni/fakerpress/pull/187)] * Tweak - Format the JavaScript and TypeScript sources with Prettier; no behaviour change. [[#235](https://github.com/bordoni/fakerpress/pull/235)] +* Tweak - Clear every JavaScript lint and TypeScript error: WordPress package types, the `@fp` import alias in ESLint, the zod v4 meta-rule schema, `…` in translated strings, and `let`/`const` in the legacy jQuery scripts. [[#236](https://github.com/bordoni/fakerpress/pull/236)] = 0.9.2 — 20 of July 2026 = diff --git a/src/resources/js/field.dependency.js b/src/resources/js/field.dependency.js index 5ecbcc02..207a1ab4 100644 --- a/src/resources/js/field.dependency.js +++ b/src/resources/js/field.dependency.js @@ -1,21 +1,14 @@ -( function ( $, _ ) { +( function ( $ ) { 'use strict'; - $.fn.conditional = function ( _opt ) { - var $elements = this, - defaults = { - conditional: function () { - return false; - }, - }, - opt = $.extend( defaults, _opt ); - - $elements.each( function ( index, element ) { - var $element = $( element ), - $condition = $element.data( 'condition' ); + // Stub: conditional field logic was never implemented. It only reads + // each element's `data-condition` and does nothing with it yet. + $.fn.conditional = function () { + this.each( function ( index, element ) { + $( element ).data( 'condition' ); } ); }; $( document ).ready( function () { $( '.fp-conditional' ).conditional(); } ); -} )( window.jQuery, window._ ); +} )( window.jQuery ); diff --git a/src/resources/js/fields.js b/src/resources/js/fields.js index 104b9598..9375d28c 100644 --- a/src/resources/js/fields.js +++ b/src/resources/js/fields.js @@ -1,3 +1,4 @@ +/* global jQuery */ ( function ( $, _ ) { 'use strict'; @@ -25,7 +26,7 @@ }; fp.searchId = function ( e ) { - var id = null; + let id = null; if ( 'undefined' !== typeof e.id ) { id = e.id; @@ -34,13 +35,13 @@ } else if ( 'undefined' !== typeof e.value ) { id = e.value; } - return e == undefined ? null : id; + return e === undefined || e === null ? null : id; }; // Date Fields - fp.fields.dates = function ( $, _ ) { + fp.fields.dates = function () { 'use strict'; - var datepicker_args = { + const datepickerArgs = { after: [ 'attr' ], constrainInput: false, dateFormat: 'yy-mm-dd', @@ -48,20 +49,21 @@ $( '.fp-type-date' ) .not( '.hasDatepicker' ) - .datepicker( datepicker_args ); + .datepicker( datepickerArgs ); $( '.fp-type-interval-wrap' ).each( function () { - var $container = $( this ), - $interval = $container.find( '.fp-type-dropdown' ), - $min = $container.find( '[data-type="min"]' ), - $max = $container.find( '[data-type="max"]' ); + const $container = $( this ); if ( $container.hasClass( fp.ready_class ) ) { return; } $container.addClass( fp.ready_class ); + const $interval = $container.find( '.fp-type-dropdown' ); + const $min = $container.find( '[data-type="min"]' ); + const $max = $container.find( '[data-type="max"]' ); + $min.on( { - change: function ( e ) { + change() { $min.parents( '.fp-field-wrap' ) .find( '[data-type="max"]' ) .datepicker( 'option', 'minDate', $( this ).val() ) @@ -71,7 +73,7 @@ } ); $max.on( { - change: function ( e ) { + change() { $max.parents( '.fp-field-wrap' ) .find( '[data-type="min"]' ) .datepicker( 'option', 'maxDate', $( this ).val() ) @@ -82,10 +84,10 @@ $interval .on( { - change: function ( e ) { - var $selected = $interval.find( ':selected' ), - min = $selected.attr( 'min' ), - max = $selected.attr( 'max' ); + change() { + const $selected = $interval.find( ':selected' ); + const min = $selected.attr( 'min' ); + const max = $selected.attr( 'max' ); $min.datepicker( 'setDate', min ); $max.datepicker( 'setDate', max ); @@ -96,14 +98,14 @@ }; // Select2 Fields - fp.fields.dropdown = function ( $, _ ) { + fp.fields.dropdown = function () { 'use strict'; - var $elements = $( '.fp-type-dropdown' ).not( - '.select2-offscreen, .select2-container' - ), - config = { - wp_query_title: [], - }; + const $elements = $( '.fp-type-dropdown' ).not( + '.select2-offscreen, .select2-container' + ); + const config = { + wp_query_title: [], + }; config.wp_query_title.push( 'ID: "<%= ID %>"' ); config.wp_query_title.push( 'Title: "<%= post_title %>"' ); @@ -114,10 +116,10 @@ $elements .each( function () { - var $select = $( this ), - args = { - width: 420, - }; + const $select = $( this ); + const args = { + width: 420, + }; if ( $select.is( '[multiple]' ) ) { args.multiple = true; @@ -161,17 +163,17 @@ } args.matcher = function ( term, text ) { - var result = - text.toUpperCase().indexOf( term.toUpperCase() ) == 0; + let result = + text.toUpperCase().indexOf( term.toUpperCase() ) === 0; if ( ! result && 'undefined' !== typeof args.tags ) { - var possible = _.where( args.tags, { text: text } ); + const possible = _.where( args.tags, { text } ); if ( args.tags.length > 0 && _.isObject( possible ) ) { - var test_value = fp.searchId( possible[ 0 ] ); + const testValue = fp.searchId( possible[ 0 ] ); result = - test_value + testValue .toUpperCase() - .indexOf( term.toUpperCase() ) == 0; + .indexOf( term.toUpperCase() ) === 0; } } @@ -182,15 +184,15 @@ args.tags = $select.data( 'options' ); args.initSelection = function ( element, callback ) { - var data = []; + const data = []; $( element.val().split( args.regexSplit ) ).each( function () { - var obj = { id: this, text: this }; + let obj = { id: this, text: this }; if ( args.tags.length > 0 && _.isObject( args.tags[ 0 ] ) ) { - var _obj = _.where( args.tags, { + const _obj = _.where( args.tags, { value: this, } ); if ( _obj.length > 0 ) { @@ -208,7 +210,7 @@ callback( data ); }; - args.createSearchChoice = function ( term, data ) { + args.createSearchChoice = function ( term ) { if ( term.match( args.regexToken ) ) { return { id: term, text: term }; } @@ -222,8 +224,8 @@ } if ( $select.is( '[data-source]' ) ) { - var source = $select.data( 'source' ); - var nonce = $select.data( 'nonce' ); + const source = $select.data( 'source' ); + const nonce = $select.data( 'nonce' ); args.data = { results: [] }; args.allowClear = true; @@ -237,7 +239,7 @@ dataType: 'json', type: 'POST', url: window.ajaxurl, - results: function ( data ) { + results( data ) { // parse the results into the format expected by Select2. $.each( data.results, function ( k, result ) { result.id = result.ID; @@ -264,26 +266,26 @@ }; args.ajax.data = function ( search, page ) { - var post_types = []; - var $post_types_field = $( + let postTypes = []; + const $postTypesField = $( '#fakerpress-field-post_types' ); // Check if post_types field exists on the page and has a value if ( - $post_types_field.length > 0 && - $post_types_field.val() + $postTypesField.length > 0 && + $postTypesField.val() ) { // Use the selected post types from the field - var field_value = $post_types_field.val(); - var field_options = - $post_types_field.data( 'options' ); + const fieldValue = $postTypesField.val(); + const fieldOptions = + $postTypesField.data( 'options' ); - if ( field_value && field_options ) { - post_types = _.intersection( - field_value.split( ',' ), + if ( fieldValue && fieldOptions ) { + postTypes = _.intersection( + fieldValue.split( ',' ), _.pluck( - _.where( field_options, { + _.where( fieldOptions, { hierarchical: true, } ), 'id' @@ -293,30 +295,30 @@ } else { // Default to all public post types when field doesn't exist or has no value (e.g., on attachments page) // This will be handled server-side to get all public post types - post_types = []; + postTypes = []; } return { action: 'fakerpress.select2-' + source, - nonce: nonce, + nonce, query: { s: search, posts_per_page: 10, paged: page, - post_type: post_types, + post_type: postTypes, }, }; }; } else { args.ajax.data = function ( search, page ) { - var $container = $select + const $container = $select .parents( '.fp-table-taxonomy' ) .eq( 0 ); return { action: 'fakerpress.select2-' + source, - search: search, - nonce: nonce, - page: page, + search, + nonce, + page, page_limit: 25, taxonomies: $container .find( '.fp-taxonomies' ) @@ -341,8 +343,7 @@ $select.select2( args ); } ) .on( 'change', function ( event ) { - var $select = $( this ), - data = $( this ).data( 'value' ); + const $select = $( this ); if ( ! $select.is( '[multiple]' ) ) { return; @@ -351,18 +352,18 @@ return; } + let data = $select.data( 'value' ); + if ( event.added ) { if ( _.isArray( data ) ) { data.push( event.added ); } else { data = [ event.added ]; } + } else if ( _.isArray( data ) ) { + data = _.without( data, event.removed ); } else { - if ( _.isArray( data ) ) { - data = _.without( data, event.removed ); - } else { - data = []; - } + data = []; } $select .data( 'value', data ) @@ -380,28 +381,29 @@ }; // Quantity Range Fields - fp.fields.range = function ( $, _ ) { + fp.fields.range = function () { 'use strict'; $( '.fp-type-range-wrap' ).each( function () { - var $container = $( this ); - var $minField = $container.find( - '.fp-type-number[data-type="min"]' - ); - var $maxField = $container.find( - '.fp-type-number[data-type="max"]' - ); + const $container = $( this ); if ( $container.hasClass( fp.ready_class ) ) { return; } $container.addClass( fp.ready_class ); + const $minField = $container.find( + '.fp-type-number[data-type="min"]' + ); + const $maxField = $container.find( + '.fp-type-number[data-type="max"]' + ); + $minField .on( { - 'change keyup': function ( e ) { - var minValue = parseInt( $minField.val(), 10 ); - var maxValue = parseInt( $maxField.val(), 10 ); + 'change keyup'() { + const minValue = parseInt( $minField.val(), 10 ); + const maxValue = parseInt( $maxField.val(), 10 ); if ( isNumeric( minValue ) ) { $maxField.prop( 'disabled', false ); @@ -424,9 +426,9 @@ $maxField .on( { - 'change keyup': function ( e ) { - var minValue = parseInt( $minField.val(), 10 ); - var maxValue = parseInt( $maxField.val(), 10 ); + 'change keyup'() { + const minValue = parseInt( $minField.val(), 10 ); + const maxValue = parseInt( $maxField.val(), 10 ); if ( isNumeric( maxValue ) && minValue > maxValue ) { $minField.val( maxValue ); @@ -457,32 +459,24 @@ conf_container: '.fp-meta_conf-container', }, - update: function ( $item ) { + update( $item ) { // Render again the Configuration this.render( $item ); }, - render: function ( $item ) { - var fieldset = this, - $type = $item.find( fieldset.selector.type ), - type = $type.select2( 'val' ), - $name = $item.find( fieldset.selector.name ), - name = $name.val(), - $name_container = $item.find( - fieldset.selector.name_container - ), - $type_container = $item.find( - fieldset.selector.type_container - ), - $conf_container = $item.find( - fieldset.selector.conf_container - ), - $place = $conf_container.find( - fp.fieldset.selector.wrap - ), - config = $conf_container.data( 'config' ), - $template, - template; + render( $item ) { + const fieldset = this; + const $type = $item.find( fieldset.selector.type ); + let type = $type.select2( 'val' ); + const $nameContainer = $item.find( + fieldset.selector.name_container + ); + const $confContainer = $item.find( + fieldset.selector.conf_container + ); + const $place = $confContainer.find( + fp.fieldset.selector.wrap + ); // Before constructing the Type Object check if it's a jQuery element (Select2 bug) if ( type instanceof jQuery ) { @@ -490,72 +484,69 @@ } // Find templates relevant to the current container - $template = $( '.fp-template-' + type ) + const $template = $( '.fp-template-' + type ) .filter( '[data-rel="' + fieldset.$.container.attr( 'id' ) + '"]' ) .filter( '[data-callable]' ); - template = $template.html(); + const template = $template.html(); // Only place if there is a template - if ( template && type !== $conf_container.data( 'type' ) ) { - $conf_container.data( 'type', type ); + if ( template && type !== $confContainer.data( 'type' ) ) { + $confContainer.data( 'type', type ); $place.empty().append( template ); - this.configure( $conf_container ); + this.configure( $confContainer ); } // Make Styles Match the what needs to be done if ( ! type ) { - $name_container.addClass( 'fp-last-child' ); - $conf_container.hide(); + $nameContainer.addClass( 'fp-last-child' ); + $confContainer.hide(); } else { - $name_container.removeClass( 'fp-last-child' ); - $conf_container.show(); + $nameContainer.removeClass( 'fp-last-child' ); + $confContainer.show(); } }, /** - * A way to setup the configuration fields for Meta + * A way to setup the configuration fields for Meta. * - * @param jQuery $conf The configuration Container - * - * @return null + * @param {jQuery} $conf The configuration Container. */ - configure: function ( $conf ) { - var fieldset = this; - var config = $conf.data( 'config' ); - var $fields = $conf.find( fp.fieldset.selector.field ); + configure( $conf ) { + const fieldset = this; + const config = $conf.data( 'config' ); + const $fields = $conf.find( fp.fieldset.selector.field ); // Reset the Configuration, only happens once! // $conf.removeAttr( 'data-config', false ).data( 'config', {} ); // Loop fields $fields.each( function () { - var $field = $( this ); - var $fieldset = $field + const $field = $( this ); + const $fieldset = $field .parents( fieldset.selector.item ) .eq( 0 ); - var $label = $field.next( fp.fieldset.selector.label ); - var $internal_label = $field.next( + let $label = $field.next( fp.fieldset.selector.label ); + const $internalLabel = $field.next( fp.fieldset.selector.internal_label ); - var name = $field.data( 'name' ); - var index = + const __name = $field.data( 'name' ); + const index = parseInt( $fieldset .find( fp.fieldset.selector.order ) .val(), 10 ) - 1; - var key = name[ index ]; - var __name = $field.data( 'name' ); - var __id = $field.data( 'id' ); - var id = []; - var name = []; + const key = __name[ index ]; + const __id = $field.data( 'id' ); + const id = []; + const name = []; // If didn't find a label inside of the parent element if ( 0 === $label.length ) { @@ -565,14 +556,14 @@ .find( fp.fieldset.selector.label ); } - _.each( __id, function ( value, key, list ) { + _.each( __id, function ( value ) { id.push( value ); if ( 'meta' === value || 'taxonomy' === value ) { id.push( index ); } } ); - _.each( __name, function ( value, key, list ) { + _.each( __name, function ( value ) { name.push( value ); if ( 'meta' === value || 'taxonomy' === value ) { name.push( index ); @@ -582,7 +573,7 @@ if ( 0 !== id.length ) { $field.attr( 'id', fp.fieldId( id ) ); $label.attr( 'for', fp.fieldId( id ) ); - $internal_label.attr( 'for', fp.fieldId( id ) ); + $internalLabel.attr( 'for', fp.fieldId( id ) ); } if ( 0 !== name.length ) { @@ -600,9 +591,9 @@ } ); }, - is_removable: function () { + is_removable() { if ( 1 === this.$.items.length ) { - var $item = this.$.items.eq( 0 ); + const $item = this.$.items.eq( 0 ); if ( _.isEmpty( @@ -612,23 +603,22 @@ ) ) { return true; - } else { - return false; } + return false; } return false; }, - setup: function () { - var fieldset = this; + setup() { + const fieldset = this; fieldset.$.container.on( 'change', fieldset.selector.type, [], - function ( event ) { - var $field = $( this ); + function () { + const $field = $( this ); // Render again the Configuration fieldset.render( $field ); @@ -639,7 +629,7 @@ ); }, - reset: function ( $item ) {}, + reset() {}, }, { name: 'taxonomy', @@ -660,11 +650,11 @@ weight: '.fp-weight', }, - update: function ( $item ) {}, + update() {}, - is_removable: function () { + is_removable() { if ( 1 === this.$.items.length ) { - var $item = this.$.items.eq( 0 ); + const $item = this.$.items.eq( 0 ); if ( _.isEmpty( @@ -675,19 +665,16 @@ _.isEmpty( $item.find( this.selector.terms ).val() ) ) { return true; - } else { - return false; } + return false; } return false; }, - setup: function () { - var fieldset = this; - }, + setup() {}, - reset: function ( $item ) {}, + reset() {}, }, ], @@ -703,8 +690,8 @@ field_container: '.fp-field-container', }, - setup: function ( fieldset ) { - var $tbody = $( 'form' ) + setup( fieldset ) { + const $tbody = $( 'form' ) .children( '.form-table' ) .children( 'tbody' ); @@ -726,10 +713,10 @@ 'click', this.selector.duplicate, [], - function ( event ) { - var $button = $( this ), - $item = $button.parents( fieldset.selector.item ), - $clone = $item.clone(); + function () { + const $button = $( this ); + const $item = $button.parents( fieldset.selector.item ); + const $clone = $item.clone(); $clone .find( '.fp-type-date' ) @@ -755,9 +742,9 @@ 'click', this.selector.remove, [], - function ( event ) { - var $button = $( this ), - $item = $button.parents( fieldset.selector.item ); + function () { + const $button = $( this ); + const $item = $button.parents( fieldset.selector.item ); // Prevent remove when there is just one meta if ( 1 === fieldset.$.items.length ) { @@ -778,13 +765,13 @@ this.update( fieldset, false ); }, - reset: function ( fieldset, $item ) { - var $fields = $item + reset( fieldset, $item ) { + const $fields = $item .find( 'tbody' ) .find( fp.fieldset.selector.field ); $fields.each( function () { - var $field = $( this ); + const $field = $( this ); // Reset normal fields $field.val( '' ); @@ -798,7 +785,7 @@ fieldset.reset( $item ); }, - update: function ( fieldset ) { + update( fieldset ) { // Setup a base list of items fieldset.$.items = fieldset.$.wrap.children( fieldset.selector.item @@ -824,23 +811,23 @@ // Regenerate Order Index fieldset.$.items.each( function ( index ) { - var $item = $( this ), - $index = $item.find( fp.fieldset.selector.order ), - $fields = $item.find( fp.fieldset.selector.field ); + const $item = $( this ); + const $index = $item.find( fp.fieldset.selector.order ); + const $fields = $item.find( fp.fieldset.selector.field ); // Change the index first $index.val( index + 1 ); $fields.filter( 'input, textarea, select' ).each( function () { - var $field = $( this ), - $label = $field.next( fp.fieldset.selector.label ), - $internal_label = $field.next( - fp.fieldset.selector.internal_label - ), - __name = $field.data( 'name' ), - __id = $field.data( 'id' ), - id = [], - name = []; + const $field = $( this ); + let $label = $field.next( fp.fieldset.selector.label ); + const $internalLabel = $field.next( + fp.fieldset.selector.internal_label + ); + const __name = $field.data( 'name' ); + const __id = $field.data( 'id' ); + const id = []; + const name = []; // If didn't find a label inside of the parent element if ( 0 === $label.length ) { @@ -850,14 +837,14 @@ .find( fp.fieldset.selector.label ); } - _.each( __id, function ( value, key, list ) { + _.each( __id, function ( value ) { id.push( value ); if ( 'meta' === value || 'taxonomy' === value ) { id.push( index ); } } ); - _.each( __name, function ( value, key, list ) { + _.each( __name, function ( value ) { name.push( value ); if ( 'meta' === value || 'taxonomy' === value ) { name.push( index ); @@ -867,7 +854,7 @@ if ( 0 !== id.length ) { $field.attr( 'id', fp.fieldId( id ) ); $label.attr( 'for', fp.fieldId( id ) ); - $internal_label.attr( 'for', fp.fieldId( id ) ); + $internalLabel.attr( 'for', fp.fieldId( id ) ); } if ( 0 !== name.length ) { @@ -879,7 +866,7 @@ } ); $.each( fp.fields, function ( key, callback ) { - callback( window.jQuery, window._ ); + callback(); } ); }, }; @@ -887,14 +874,14 @@ $( () => { $.each( fp.fieldset.items, function ( index, fieldset ) { fp.fieldset.setup( fieldset ); - fieldset.$.container.each( function ( _index, container ) { + fieldset.$.container.each( function () { // We need this to avoid having a `this` variable been a HTML element fp.fieldset.update( fieldset ); } ); } ); $.each( fp.fields, function ( key, callback ) { - callback( window.jQuery, window._ ); + callback(); } ); } ); } )( window.jQuery, window._ ); diff --git a/src/resources/js/module.js b/src/resources/js/module.js index c2d9612c..6ba6c680 100644 --- a/src/resources/js/module.js +++ b/src/resources/js/module.js @@ -1,3 +1,4 @@ +/* global jQuery, _ */ ( ( $, _ ) => { 'use strict'; @@ -52,9 +53,9 @@ /** * Log a message to the UI with proper styling. * - * @param {jQuery} $element - The element to append the notice to. - * @param {string} html - The HTML template string. - * @param {Object} data - The data to interpolate into the template. + * @param {jQuery} $element - The element to append the notice to. + * @param {string} html - The HTML template string. + * @param {Object} data - The data to interpolate into the template. * @param {string} attrClass - Additional CSS classes for the notice. * @return {jQuery} The element with the appended notice. */ @@ -101,7 +102,7 @@ * Format the success message with links to generated items. * * @param {Object} responseData - The response data from the REST API. - * @param {string} baseMessage - The base success message. + * @param {string} baseMessage - The base success message. * @return {string} The formatted HTML message with links. */ fp.formatSuccessMessage = ( responseData, baseMessage ) => { @@ -123,6 +124,7 @@ if ( responseData.time ) { message += '
' + + /* translators: %s: Generation time in seconds. */ __( 'Generation time: %s seconds', 'fakerpress' ).replace( '%s', responseData.time @@ -136,13 +138,14 @@ /** * Generate fake data using the REST API. * - * @param {jQuery} $form - The form element. + * @param {jQuery} $form - The form element. * @param {Object} requestData - Optional request data override. */ fp.moduleGenerate = ( $form, requestData ) => { // Get the module endpoint from form data attribute const moduleEndpoint = $form.data( 'endpoint' ); if ( ! moduleEndpoint ) { + // eslint-disable-next-line no-console -- Developer-facing error for a form missing data-endpoint; there is no UI to report it in. console.error( 'No endpoint specified in form data-endpoint attribute' ); @@ -156,8 +159,6 @@ const $submitContainer = $form.find( '.fp-submit' ); const $spinner = $submitContainer.find( '.spinner' ); - const $button = $submitContainer.find( '.button-primary' ); - const $response = $submitContainer.find( '.fp-response' ); // Check if this is a batched request (has offset/total parameters) const isBatchedRequest = @@ -170,6 +171,9 @@ return; } + const $button = $submitContainer.find( '.button-primary' ); + const $response = $submitContainer.find( '.fp-response' ); + // Only set spinner and disable button for initial requests if ( ! isBatchedRequest ) { $spinner.addClass( 'is-active' ); @@ -184,7 +188,7 @@ let errorHandled = false; // Prepare the data for the request - let postData = requestData.fakerpress || {}; + const postData = requestData.fakerpress || {}; // Add batching parameters if they exist if ( requestData.offset !== undefined ) { @@ -248,7 +252,7 @@ ); } }, - success: ( data, textStatus, jqXHR ) => { + success: ( data ) => { if ( data === null ) { $spinner.removeClass( 'is-active' ); $button.prop( 'disabled', false ); @@ -269,6 +273,7 @@ const generated = responseData.generated || 0; const baseMessage = data.message || + /* translators: %d: Number of generated items. */ __( 'Generated %d items', 'fakerpress' ).replace( '%d', generated @@ -368,11 +373,13 @@ 'fakerpress' ); } else if ( errorThrown ) { + /* translators: %s: Error message returned by the request. */ errorMessage = __( 'Error: %s', 'fakerpress' ).replace( '%s', errorThrown ); } else { + /* translators: %d: HTTP status code. */ errorMessage = __( 'HTTP Error %d', 'fakerpress' @@ -380,6 +387,7 @@ } } } else if ( errorThrown ) { + /* translators: %s: Error message returned by the request. */ errorMessage = __( 'Error: %s', 'fakerpress' ).replace( '%s', errorThrown @@ -429,16 +437,14 @@ // Convert numeric strings to numbers where appropriate fp.convertNumericValues( formData ); - console.log( 'Form Data', formData ); - return formData; }; /** * Set a nested value in an object using array notation. * - * @param {Object} obj - The target object. - * @param {string} path - The path in array notation (e.g., 'fakerpress[qty][min]'). + * @param {Object} obj - The target object. + * @param {string} path - The path in array notation (e.g., 'fakerpress[qty][min]'). * @param {string} value - The value to set. */ fp.setNestedValue = ( obj, path, value ) => { @@ -557,7 +563,6 @@ $form.on( 'submit', ( event ) => { fp.moduleGenerate( $form ); - console.log( 'Form', $form ); event.preventDefault(); } ); } ); diff --git a/src/resources/packages/admin/components/form/combobox-multi.tsx b/src/resources/packages/admin/components/form/combobox-multi.tsx index 43e77700..d1fd2dff 100644 --- a/src/resources/packages/admin/components/form/combobox-multi.tsx +++ b/src/resources/packages/admin/components/form/combobox-multi.tsx @@ -106,6 +106,13 @@ export function ComboboxMulti( { return val; }; + let emptyMessage = 'No results found.'; + if ( isSearching ) { + emptyMessage = 'Searching...'; + } else if ( allowCreate && inputValue.trim() ) { + emptyMessage = `Press Enter to add "${ inputValue.trim() }"`; + } + return ( @@ -170,13 +177,7 @@ export function ComboboxMulti( { onKeyDown={ handleKeyDown } /> - - { isSearching - ? 'Searching...' - : allowCreate && inputValue.trim() - ? `Press Enter to add "${ inputValue.trim() }"` - : 'No results found.' } - + { emptyMessage } { displayOptions.map( ( option ) => ( p.value === presetValue ); - if ( ! presetConfig ) return null; + if ( ! presetConfig ) { + return null; + } const [ start, end ] = presetConfig.getRange(); return [ format( start, DATE_FORMAT ), format( end, DATE_FORMAT ) ]; } diff --git a/src/resources/packages/admin/components/ui/calendar.tsx b/src/resources/packages/admin/components/ui/calendar.tsx index d241e209..66a6fe7f 100644 --- a/src/resources/packages/admin/components/ui/calendar.tsx +++ b/src/resources/packages/admin/components/ui/calendar.tsx @@ -139,22 +139,33 @@ function Calendar( { ...classNames, } } components={ { - Root: ( { className, rootRef, ...props } ) => { + Root: ( { + className: rootClassName, + rootRef, + ...rootProps + } ) => { return (
); }, - Chevron: ( { className, orientation, ...props } ) => { + Chevron: ( { + className: chevronClassName, + orientation, + ...chevronProps + } ) => { if ( orientation === 'left' ) { return ( ); } @@ -162,23 +173,26 @@ function Calendar( { if ( orientation === 'right' ) { return ( ); } return ( ); }, DayButton: CalendarDayButton, - WeekNumber: ( { children, ...props } ) => { + WeekNumber: ( { children, ...weekNumberProps } ) => { return ( - +
{ children }
@@ -202,7 +216,9 @@ function CalendarDayButton( { const ref = React.useRef< HTMLButtonElement >( null ); React.useEffect( () => { - if ( modifiers.focused ) ref.current?.focus(); + if ( modifiers.focused ) { + ref.current?.focus(); + } }, [ modifiers.focused ] ); return ( diff --git a/src/resources/packages/admin/components/ui/slider.tsx b/src/resources/packages/admin/components/ui/slider.tsx index 957e75f3..c62a68b4 100644 --- a/src/resources/packages/admin/components/ui/slider.tsx +++ b/src/resources/packages/admin/components/ui/slider.tsx @@ -11,15 +11,15 @@ function Slider( { max = 100, ...props }: React.ComponentProps< typeof SliderPrimitive.Root > ) { - const _values = React.useMemo( - () => - Array.isArray( value ) - ? value - : Array.isArray( defaultValue ) - ? defaultValue - : [ min, max ], - [ value, defaultValue, min, max ] - ); + const _values = React.useMemo( () => { + if ( Array.isArray( value ) ) { + return value; + } + if ( Array.isArray( defaultValue ) ) { + return defaultValue; + } + return [ min, max ]; + }, [ value, defaultValue, min, max ] ); return ( @@ -136,7 +136,7 @@ export default function CommentsPage() { onChange={ field.onChange } options={ postTypeOptions } placeholder={ __( - 'Select post types...', + 'Select post types…', 'fakerpress' ) } /> @@ -263,7 +263,7 @@ export default function CommentsPage() { onChange={ field.onChange } options={ htmlTagOptions } placeholder={ __( - 'Select HTML tags...', + 'Select HTML tags…', 'fakerpress' ) } allowCreate diff --git a/src/resources/packages/admin/pages/posts.tsx b/src/resources/packages/admin/pages/posts.tsx index d4faf683..c66bf385 100644 --- a/src/resources/packages/admin/pages/posts.tsx +++ b/src/resources/packages/admin/pages/posts.tsx @@ -47,6 +47,10 @@ interface PostsFormData { * Defaults are added non-destructively: a default whose meta `name` already * exists in `current` is skipped, and existing rules are never removed or * overwritten. Returns the same array reference when nothing is added. + * + * @param current Meta rules currently in the form. + * @param postTypes Selected post types. + * @param byType Default meta rules keyed by post type. */ function mergeDefaultMeta( current: MetaRule[], @@ -309,7 +313,7 @@ export default function PostsPage() { onChange={ field.onChange } options={ postTypeOptions } placeholder={ __( - 'Select post types...', + 'Select post types…', 'fakerpress' ) } /> @@ -334,7 +338,7 @@ export default function PostsPage() { field.onChange( vals.map( Number ) ) } placeholder={ __( - 'Search for posts...', + 'Search for posts…', 'fakerpress' ) } onSearch={ parentSearch.search } @@ -361,7 +365,7 @@ export default function PostsPage() { onChange={ field.onChange } options={ commentStatusOptions } placeholder={ __( - 'Select comment status...', + 'Select comment status…', 'fakerpress' ) } /> @@ -386,7 +390,7 @@ export default function PostsPage() { field.onChange( vals.map( Number ) ) } placeholder={ __( - 'Search for authors...', + 'Search for authors…', 'fakerpress' ) } onSearch={ authorSearch.search } @@ -471,7 +475,7 @@ export default function PostsPage() { onChange={ field.onChange } options={ htmlTagOptions } placeholder={ __( - 'Select HTML tags...', + 'Select HTML tags…', 'fakerpress' ) } allowCreate @@ -498,7 +502,7 @@ export default function PostsPage() { onChange={ field.onChange } options={ imageProviderOptions } placeholder={ __( - 'Select image providers...', + 'Select image providers…', 'fakerpress' ) } /> diff --git a/src/resources/packages/admin/pages/settings.tsx b/src/resources/packages/admin/pages/settings.tsx index 58591733..1df7aae5 100644 --- a/src/resources/packages/admin/pages/settings.tsx +++ b/src/resources/packages/admin/pages/settings.tsx @@ -146,7 +146,7 @@ export default function SettingsPage() { disabled={ isSubmitting } > { isSubmitting - ? __( 'Deleting...', 'fakerpress' ) + ? __( 'Deleting…', 'fakerpress' ) : __( 'Delete All Data', 'fakerpress' ) } diff --git a/src/resources/packages/admin/pages/terms.tsx b/src/resources/packages/admin/pages/terms.tsx index 5b0fa353..3ec606a7 100644 --- a/src/resources/packages/admin/pages/terms.tsx +++ b/src/resources/packages/admin/pages/terms.tsx @@ -149,7 +149,7 @@ export default function TermsPage() { onChange={ field.onChange } options={ taxonomyOptions } placeholder={ __( - 'Select taxonomies...', + 'Select taxonomies…', 'fakerpress' ) } /> diff --git a/src/resources/packages/admin/pages/users.tsx b/src/resources/packages/admin/pages/users.tsx index 9a46e2aa..71760860 100644 --- a/src/resources/packages/admin/pages/users.tsx +++ b/src/resources/packages/admin/pages/users.tsx @@ -125,7 +125,7 @@ export default function UsersPage() { onChange={ field.onChange } options={ roleOptions } placeholder={ __( - 'Select roles...', + 'Select roles…', 'fakerpress' ) } /> @@ -207,7 +207,7 @@ export default function UsersPage() { onChange={ field.onChange } options={ htmlTagOptions } placeholder={ __( - 'Select HTML tags...', + 'Select HTML tags…', 'fakerpress' ) } allowCreate diff --git a/src/resources/packages/admin/schemas/meta-rules.ts b/src/resources/packages/admin/schemas/meta-rules.ts index 8074e1c2..be3a1cad 100644 --- a/src/resources/packages/admin/schemas/meta-rules.ts +++ b/src/resources/packages/admin/schemas/meta-rules.ts @@ -3,7 +3,7 @@ import { z } from 'zod'; export const metaRuleSchema = z.object( { type: z.string().min( 1 ), name: z.string().min( 1 ), - config: z.record( z.unknown() ).default( {} ), + config: z.record( z.string(), z.unknown() ).default( {} ), } ); export type MetaRuleSchema = z.infer< typeof metaRuleSchema >;