From d97ca64d5f31020acb9c3cffdbf009a3972c052c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Feb 2024 01:08:49 +0000 Subject: [PATCH 001/110] build(deps-dev): bump @typescript-eslint/eslint-plugin Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.19.0 to 6.20.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.20.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 238 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 120 insertions(+), 120 deletions(-) diff --git a/package-lock.json b/package-lock.json index 067ce4c29..126cb8826 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "@types/wordpress__editor": "^13.6.7", "@types/wordpress__plugins": "^3.0.3", "@types/wordpress__wordcount": "^2.4.5", - "@typescript-eslint/eslint-plugin": "^6.19.0", + "@typescript-eslint/eslint-plugin": "^6.20.0", "@wordpress/api-fetch": "^6.38.0", "@wordpress/babel-preset-default": "^7.32.0", "@wordpress/block-editor": "^12.17.0", @@ -6285,16 +6285,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.19.0.tgz", - "integrity": "sha512-DUCUkQNklCQYnrBSSikjVChdc84/vMPDQSgJTHBZ64G9bA9w0Crc0rd2diujKbTdp6w2J47qkeHQLoi0rpLCdg==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.20.0.tgz", + "integrity": "sha512-fTwGQUnjhoYHeSF6m5pWNkzmDDdsKELYrOBxhjMrofPqCkoC2k3B2wvGHFxa1CTIqkEn88nlW1HVMztjo2K8Hg==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.19.0", - "@typescript-eslint/type-utils": "6.19.0", - "@typescript-eslint/utils": "6.19.0", - "@typescript-eslint/visitor-keys": "6.19.0", + "@typescript-eslint/scope-manager": "6.20.0", + "@typescript-eslint/type-utils": "6.20.0", + "@typescript-eslint/utils": "6.20.0", + "@typescript-eslint/visitor-keys": "6.20.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -6320,13 +6320,13 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.19.0.tgz", - "integrity": "sha512-dO1XMhV2ehBI6QN8Ufi7I10wmUovmLU0Oru3n5LVlM2JuzB4M+dVphCPLkVpKvGij2j/pHBWuJ9piuXx+BhzxQ==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.20.0.tgz", + "integrity": "sha512-p4rvHQRDTI1tGGMDFQm+GtxP1ZHyAh64WANVoyEcNMpaTFn3ox/3CcgtIlELnRfKzSs/DwYlDccJEtr3O6qBvA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.19.0", - "@typescript-eslint/visitor-keys": "6.19.0" + "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/visitor-keys": "6.20.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -6337,9 +6337,9 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.19.0.tgz", - "integrity": "sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.20.0.tgz", + "integrity": "sha512-MM9mfZMAhiN4cOEcUOEx+0HmuaW3WBfukBZPCfwSqFnQy0grXYtngKCqpQN339X3RrwtzspWJrpbrupKYUSBXQ==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -6350,12 +6350,12 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.0.tgz", - "integrity": "sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.20.0.tgz", + "integrity": "sha512-E8Cp98kRe4gKHjJD4NExXKz/zOJ1A2hhZc+IMVD6i7w4yjIvh6VyuRI0gRtxAsXtoC35uGMaQ9rjI2zJaXDEAw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.19.0", + "@typescript-eslint/types": "6.20.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -6445,13 +6445,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.19.0.tgz", - "integrity": "sha512-mcvS6WSWbjiSxKCwBcXtOM5pRkPQ6kcDds/juxcy/727IQr3xMEcwr/YLHW2A2+Fp5ql6khjbKBzOyjuPqGi/w==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.20.0.tgz", + "integrity": "sha512-qnSobiJQb1F5JjN0YDRPHruQTrX7ICsmltXhkV536mp4idGAYrIyr47zF/JmkJtEcAVnIz4gUYJ7gOZa6SmN4g==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.19.0", - "@typescript-eslint/utils": "6.19.0", + "@typescript-eslint/typescript-estree": "6.20.0", + "@typescript-eslint/utils": "6.20.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -6472,9 +6472,9 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.19.0.tgz", - "integrity": "sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.20.0.tgz", + "integrity": "sha512-MM9mfZMAhiN4cOEcUOEx+0HmuaW3WBfukBZPCfwSqFnQy0grXYtngKCqpQN339X3RrwtzspWJrpbrupKYUSBXQ==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -6485,13 +6485,13 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.19.0.tgz", - "integrity": "sha512-o/zefXIbbLBZ8YJ51NlkSAt2BamrK6XOmuxSR3hynMIzzyMY33KuJ9vuMdFSXW+H0tVvdF9qBPTHA91HDb4BIQ==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.20.0.tgz", + "integrity": "sha512-RnRya9q5m6YYSpBN7IzKu9FmLcYtErkDkc8/dKv81I9QiLLtVBHrjz+Ev/crAqgMNW2FCsoZF4g2QUylMnJz+g==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.19.0", - "@typescript-eslint/visitor-keys": "6.19.0", + "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/visitor-keys": "6.20.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -6513,12 +6513,12 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.0.tgz", - "integrity": "sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.20.0.tgz", + "integrity": "sha512-E8Cp98kRe4gKHjJD4NExXKz/zOJ1A2hhZc+IMVD6i7w4yjIvh6VyuRI0gRtxAsXtoC35uGMaQ9rjI2zJaXDEAw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.19.0", + "@typescript-eslint/types": "6.20.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -6660,17 +6660,17 @@ "dev": true }, "node_modules/@typescript-eslint/utils": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.19.0.tgz", - "integrity": "sha512-QR41YXySiuN++/dC9UArYOg4X86OAYP83OWTewpVx5ct1IZhjjgTLocj7QNxGhWoTqknsgpl7L+hGygCO+sdYw==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.20.0.tgz", + "integrity": "sha512-/EKuw+kRu2vAqCoDwDCBtDRU6CTKbUmwwI7SH7AashZ+W+7o8eiyy6V2cdOqN49KsTcASWsC5QeghYuRDTyOOg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.19.0", - "@typescript-eslint/types": "6.19.0", - "@typescript-eslint/typescript-estree": "6.19.0", + "@typescript-eslint/scope-manager": "6.20.0", + "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/typescript-estree": "6.20.0", "semver": "^7.5.4" }, "engines": { @@ -6685,13 +6685,13 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/scope-manager": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.19.0.tgz", - "integrity": "sha512-dO1XMhV2ehBI6QN8Ufi7I10wmUovmLU0Oru3n5LVlM2JuzB4M+dVphCPLkVpKvGij2j/pHBWuJ9piuXx+BhzxQ==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.20.0.tgz", + "integrity": "sha512-p4rvHQRDTI1tGGMDFQm+GtxP1ZHyAh64WANVoyEcNMpaTFn3ox/3CcgtIlELnRfKzSs/DwYlDccJEtr3O6qBvA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.19.0", - "@typescript-eslint/visitor-keys": "6.19.0" + "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/visitor-keys": "6.20.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -6702,9 +6702,9 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.19.0.tgz", - "integrity": "sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.20.0.tgz", + "integrity": "sha512-MM9mfZMAhiN4cOEcUOEx+0HmuaW3WBfukBZPCfwSqFnQy0grXYtngKCqpQN339X3RrwtzspWJrpbrupKYUSBXQ==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -6715,13 +6715,13 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.19.0.tgz", - "integrity": "sha512-o/zefXIbbLBZ8YJ51NlkSAt2BamrK6XOmuxSR3hynMIzzyMY33KuJ9vuMdFSXW+H0tVvdF9qBPTHA91HDb4BIQ==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.20.0.tgz", + "integrity": "sha512-RnRya9q5m6YYSpBN7IzKu9FmLcYtErkDkc8/dKv81I9QiLLtVBHrjz+Ev/crAqgMNW2FCsoZF4g2QUylMnJz+g==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.19.0", - "@typescript-eslint/visitor-keys": "6.19.0", + "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/visitor-keys": "6.20.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -6743,12 +6743,12 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.0.tgz", - "integrity": "sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.20.0.tgz", + "integrity": "sha512-E8Cp98kRe4gKHjJD4NExXKz/zOJ1A2hhZc+IMVD6i7w4yjIvh6VyuRI0gRtxAsXtoC35uGMaQ9rjI2zJaXDEAw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.19.0", + "@typescript-eslint/types": "6.20.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -32616,16 +32616,16 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.19.0.tgz", - "integrity": "sha512-DUCUkQNklCQYnrBSSikjVChdc84/vMPDQSgJTHBZ64G9bA9w0Crc0rd2diujKbTdp6w2J47qkeHQLoi0rpLCdg==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.20.0.tgz", + "integrity": "sha512-fTwGQUnjhoYHeSF6m5pWNkzmDDdsKELYrOBxhjMrofPqCkoC2k3B2wvGHFxa1CTIqkEn88nlW1HVMztjo2K8Hg==", "dev": true, "requires": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.19.0", - "@typescript-eslint/type-utils": "6.19.0", - "@typescript-eslint/utils": "6.19.0", - "@typescript-eslint/visitor-keys": "6.19.0", + "@typescript-eslint/scope-manager": "6.20.0", + "@typescript-eslint/type-utils": "6.20.0", + "@typescript-eslint/utils": "6.20.0", + "@typescript-eslint/visitor-keys": "6.20.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -32635,28 +32635,28 @@ }, "dependencies": { "@typescript-eslint/scope-manager": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.19.0.tgz", - "integrity": "sha512-dO1XMhV2ehBI6QN8Ufi7I10wmUovmLU0Oru3n5LVlM2JuzB4M+dVphCPLkVpKvGij2j/pHBWuJ9piuXx+BhzxQ==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.20.0.tgz", + "integrity": "sha512-p4rvHQRDTI1tGGMDFQm+GtxP1ZHyAh64WANVoyEcNMpaTFn3ox/3CcgtIlELnRfKzSs/DwYlDccJEtr3O6qBvA==", "dev": true, "requires": { - "@typescript-eslint/types": "6.19.0", - "@typescript-eslint/visitor-keys": "6.19.0" + "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/visitor-keys": "6.20.0" } }, "@typescript-eslint/types": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.19.0.tgz", - "integrity": "sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.20.0.tgz", + "integrity": "sha512-MM9mfZMAhiN4cOEcUOEx+0HmuaW3WBfukBZPCfwSqFnQy0grXYtngKCqpQN339X3RrwtzspWJrpbrupKYUSBXQ==", "dev": true }, "@typescript-eslint/visitor-keys": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.0.tgz", - "integrity": "sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.20.0.tgz", + "integrity": "sha512-E8Cp98kRe4gKHjJD4NExXKz/zOJ1A2hhZc+IMVD6i7w4yjIvh6VyuRI0gRtxAsXtoC35uGMaQ9rjI2zJaXDEAw==", "dev": true, "requires": { - "@typescript-eslint/types": "6.19.0", + "@typescript-eslint/types": "6.20.0", "eslint-visitor-keys": "^3.4.1" } }, @@ -32710,31 +32710,31 @@ } }, "@typescript-eslint/type-utils": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.19.0.tgz", - "integrity": "sha512-mcvS6WSWbjiSxKCwBcXtOM5pRkPQ6kcDds/juxcy/727IQr3xMEcwr/YLHW2A2+Fp5ql6khjbKBzOyjuPqGi/w==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.20.0.tgz", + "integrity": "sha512-qnSobiJQb1F5JjN0YDRPHruQTrX7ICsmltXhkV536mp4idGAYrIyr47zF/JmkJtEcAVnIz4gUYJ7gOZa6SmN4g==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "6.19.0", - "@typescript-eslint/utils": "6.19.0", + "@typescript-eslint/typescript-estree": "6.20.0", + "@typescript-eslint/utils": "6.20.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, "dependencies": { "@typescript-eslint/types": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.19.0.tgz", - "integrity": "sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.20.0.tgz", + "integrity": "sha512-MM9mfZMAhiN4cOEcUOEx+0HmuaW3WBfukBZPCfwSqFnQy0grXYtngKCqpQN339X3RrwtzspWJrpbrupKYUSBXQ==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.19.0.tgz", - "integrity": "sha512-o/zefXIbbLBZ8YJ51NlkSAt2BamrK6XOmuxSR3hynMIzzyMY33KuJ9vuMdFSXW+H0tVvdF9qBPTHA91HDb4BIQ==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.20.0.tgz", + "integrity": "sha512-RnRya9q5m6YYSpBN7IzKu9FmLcYtErkDkc8/dKv81I9QiLLtVBHrjz+Ev/crAqgMNW2FCsoZF4g2QUylMnJz+g==", "dev": true, "requires": { - "@typescript-eslint/types": "6.19.0", - "@typescript-eslint/visitor-keys": "6.19.0", + "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/visitor-keys": "6.20.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -32744,12 +32744,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.0.tgz", - "integrity": "sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.20.0.tgz", + "integrity": "sha512-E8Cp98kRe4gKHjJD4NExXKz/zOJ1A2hhZc+IMVD6i7w4yjIvh6VyuRI0gRtxAsXtoC35uGMaQ9rjI2zJaXDEAw==", "dev": true, "requires": { - "@typescript-eslint/types": "6.19.0", + "@typescript-eslint/types": "6.20.0", "eslint-visitor-keys": "^3.4.1" } }, @@ -32845,44 +32845,44 @@ } }, "@typescript-eslint/utils": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.19.0.tgz", - "integrity": "sha512-QR41YXySiuN++/dC9UArYOg4X86OAYP83OWTewpVx5ct1IZhjjgTLocj7QNxGhWoTqknsgpl7L+hGygCO+sdYw==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.20.0.tgz", + "integrity": "sha512-/EKuw+kRu2vAqCoDwDCBtDRU6CTKbUmwwI7SH7AashZ+W+7o8eiyy6V2cdOqN49KsTcASWsC5QeghYuRDTyOOg==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.19.0", - "@typescript-eslint/types": "6.19.0", - "@typescript-eslint/typescript-estree": "6.19.0", + "@typescript-eslint/scope-manager": "6.20.0", + "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/typescript-estree": "6.20.0", "semver": "^7.5.4" }, "dependencies": { "@typescript-eslint/scope-manager": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.19.0.tgz", - "integrity": "sha512-dO1XMhV2ehBI6QN8Ufi7I10wmUovmLU0Oru3n5LVlM2JuzB4M+dVphCPLkVpKvGij2j/pHBWuJ9piuXx+BhzxQ==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.20.0.tgz", + "integrity": "sha512-p4rvHQRDTI1tGGMDFQm+GtxP1ZHyAh64WANVoyEcNMpaTFn3ox/3CcgtIlELnRfKzSs/DwYlDccJEtr3O6qBvA==", "dev": true, "requires": { - "@typescript-eslint/types": "6.19.0", - "@typescript-eslint/visitor-keys": "6.19.0" + "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/visitor-keys": "6.20.0" } }, "@typescript-eslint/types": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.19.0.tgz", - "integrity": "sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.20.0.tgz", + "integrity": "sha512-MM9mfZMAhiN4cOEcUOEx+0HmuaW3WBfukBZPCfwSqFnQy0grXYtngKCqpQN339X3RrwtzspWJrpbrupKYUSBXQ==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.19.0.tgz", - "integrity": "sha512-o/zefXIbbLBZ8YJ51NlkSAt2BamrK6XOmuxSR3hynMIzzyMY33KuJ9vuMdFSXW+H0tVvdF9qBPTHA91HDb4BIQ==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.20.0.tgz", + "integrity": "sha512-RnRya9q5m6YYSpBN7IzKu9FmLcYtErkDkc8/dKv81I9QiLLtVBHrjz+Ev/crAqgMNW2FCsoZF4g2QUylMnJz+g==", "dev": true, "requires": { - "@typescript-eslint/types": "6.19.0", - "@typescript-eslint/visitor-keys": "6.19.0", + "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/visitor-keys": "6.20.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -32892,12 +32892,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.0.tgz", - "integrity": "sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.20.0.tgz", + "integrity": "sha512-E8Cp98kRe4gKHjJD4NExXKz/zOJ1A2hhZc+IMVD6i7w4yjIvh6VyuRI0gRtxAsXtoC35uGMaQ9rjI2zJaXDEAw==", "dev": true, "requires": { - "@typescript-eslint/types": "6.19.0", + "@typescript-eslint/types": "6.20.0", "eslint-visitor-keys": "^3.4.1" } }, diff --git a/package.json b/package.json index 6b5b660a6..10266d78a 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@types/wordpress__editor": "^13.6.7", "@types/wordpress__plugins": "^3.0.3", "@types/wordpress__wordcount": "^2.4.5", - "@typescript-eslint/eslint-plugin": "^6.19.0", + "@typescript-eslint/eslint-plugin": "^6.20.0", "@wordpress/api-fetch": "^6.38.0", "@wordpress/babel-preset-default": "^7.32.0", "@wordpress/block-editor": "^12.17.0", From 575efcdc394d5b6c047659bce7c1aada43378e25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 10:05:55 +0000 Subject: [PATCH 002/110] build(deps-dev): bump @wordpress/editor from 13.25.0 to 13.27.2 Bumps [@wordpress/editor](https://github.com/WordPress/gutenberg/tree/HEAD/packages/editor) from 13.25.0 to 13.27.2. - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/editor/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/editor@13.27.2/packages/editor) --- updated-dependencies: - dependency-name: "@wordpress/editor" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 996 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 501 insertions(+), 497 deletions(-) diff --git a/package-lock.json b/package-lock.json index 126cb8826..2be0012ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,7 @@ "@wordpress/data": "^9.19.0", "@wordpress/e2e-test-utils": "^10.21.0", "@wordpress/edit-post": "^7.24.0", - "@wordpress/editor": "^13.25.0", + "@wordpress/editor": "^13.27.2", "@wordpress/element": "^5.25.0", "@wordpress/env": "^9.2.0", "@wordpress/eslint-plugin": "^17.7.0", @@ -7070,9 +7070,9 @@ } }, "node_modules/@wordpress/autop": { - "version": "3.49.0", - "resolved": "https://registry.npmjs.org/@wordpress/autop/-/autop-3.49.0.tgz", - "integrity": "sha512-bc0jUu8yOCioNFFgrO++XhdGU6QpL9HF9LeWxzayqp5Br4z9z7Zslp+KH1Gy6H2RNowEr8Fq4hZ7JwQ009EDmw==", + "version": "3.50.0", + "resolved": "https://registry.npmjs.org/@wordpress/autop/-/autop-3.50.0.tgz", + "integrity": "sha512-4E0vq2MvSOVDKXs4OulIbTdKU6S5O9QjT4qc63rAd0uiKGBYV12ViPzmwbJ6k38zOO0PKdcwlVCj55Gq4aoPDw==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -7123,9 +7123,9 @@ "dev": true }, "node_modules/@wordpress/blob": { - "version": "3.49.0", - "resolved": "https://registry.npmjs.org/@wordpress/blob/-/blob-3.49.0.tgz", - "integrity": "sha512-HYPMuXJx35uYlQC6JF9XXvPsOht2X8qJfXzGtxWb51OIC6DSRqh3f6s12fgPaNh9uElcSjQ4+Su286upu7S4vw==", + "version": "3.50.0", + "resolved": "https://registry.npmjs.org/@wordpress/blob/-/blob-3.50.0.tgz", + "integrity": "sha512-QvBhsW9WPdsOJhJ0BxzZ83i+cH/gAdjJ1iHY4Rkb02qbZEz4jhdvucGQf2oVnWwvAsFiFPKWk7CwAM5XjoahCA==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -7135,44 +7135,44 @@ } }, "node_modules/@wordpress/block-editor": { - "version": "12.17.0", - "resolved": "https://registry.npmjs.org/@wordpress/block-editor/-/block-editor-12.17.0.tgz", - "integrity": "sha512-np1ICMmScrSuDOQRYQqlDY35kOoQEHuckSCjJPQpjprutXaqG+Jk+RAeeHVgQ8Ze5B+QgkFLjNvYwRh11kYdqg==", + "version": "12.18.2", + "resolved": "https://registry.npmjs.org/@wordpress/block-editor/-/block-editor-12.18.2.tgz", + "integrity": "sha512-LDZIcp5Bl2FCyfkf07XgfM0kzY+AYhyTS4kt2U4GRSeUey79AM+GIYXb8TM2Y68B09HP/rpntBW4e/cBqjHfjw==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@react-spring/web": "^9.4.5", - "@wordpress/a11y": "^3.49.0", - "@wordpress/api-fetch": "^6.46.0", - "@wordpress/blob": "^3.49.0", - "@wordpress/blocks": "^12.26.0", - "@wordpress/commands": "^0.20.0", - "@wordpress/components": "^25.15.0", - "@wordpress/compose": "^6.26.0", - "@wordpress/data": "^9.19.0", - "@wordpress/date": "^4.49.0", - "@wordpress/deprecated": "^3.49.0", - "@wordpress/dom": "^3.49.0", - "@wordpress/element": "^5.26.0", - "@wordpress/escape-html": "^2.49.0", - "@wordpress/hooks": "^3.49.0", - "@wordpress/html-entities": "^3.49.0", - "@wordpress/i18n": "^4.49.0", - "@wordpress/icons": "^9.40.0", - "@wordpress/is-shallow-equal": "^4.49.0", - "@wordpress/keyboard-shortcuts": "^4.26.0", - "@wordpress/keycodes": "^3.49.0", - "@wordpress/notices": "^4.17.0", - "@wordpress/preferences": "^3.26.0", - "@wordpress/private-apis": "^0.31.0", - "@wordpress/rich-text": "^6.26.0", - "@wordpress/style-engine": "^1.32.0", - "@wordpress/token-list": "^2.49.0", - "@wordpress/url": "^3.50.0", - "@wordpress/warning": "^2.49.0", - "@wordpress/wordcount": "^3.49.0", + "@wordpress/a11y": "^3.50.0", + "@wordpress/api-fetch": "^6.47.0", + "@wordpress/blob": "^3.50.0", + "@wordpress/blocks": "^12.27.1", + "@wordpress/commands": "^0.21.0", + "@wordpress/components": "^25.16.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/data": "^9.20.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keyboard-shortcuts": "^4.27.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/notices": "^4.18.0", + "@wordpress/preferences": "^3.27.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/style-engine": "^1.33.1", + "@wordpress/token-list": "^2.50.0", + "@wordpress/url": "^3.51.0", + "@wordpress/warning": "^2.50.0", + "@wordpress/wordcount": "^3.50.0", "change-case": "^4.1.2", "classnames": "^2.3.1", "colord": "^2.7.0", @@ -7198,19 +7198,19 @@ } }, "node_modules/@wordpress/block-editor/node_modules/@wordpress/commands": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.20.0.tgz", - "integrity": "sha512-aQQCr3ViLwPEo/SEeW7FowA4zCfvypkO7eqTuTlcd+1E3ndRzlWA91rneo+l9GBUQ/elZzhc5Z0i2cMxHTMDRQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.21.0.tgz", + "integrity": "sha512-MzMUGCT9cQXto1jrA5lHAtnieTyAhcuNIxfyxlcE+316KNQfbyD8bc7KOzSV2sxXD/rfHuCxvHjfomFyyP+4kA==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/components": "^25.15.0", - "@wordpress/data": "^9.19.0", - "@wordpress/element": "^5.26.0", - "@wordpress/i18n": "^4.49.0", - "@wordpress/icons": "^9.40.0", - "@wordpress/keyboard-shortcuts": "^4.26.0", - "@wordpress/private-apis": "^0.31.0", + "@wordpress/components": "^25.16.0", + "@wordpress/data": "^9.20.0", + "@wordpress/element": "^5.27.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/keyboard-shortcuts": "^4.27.0", + "@wordpress/private-apis": "^0.32.0", "classnames": "^2.3.1", "cmdk": "^0.2.0", "rememo": "^4.0.2" @@ -7224,9 +7224,9 @@ } }, "node_modules/@wordpress/block-editor/node_modules/@wordpress/private-apis": { - "version": "0.31.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.31.0.tgz", - "integrity": "sha512-Hx2LJfkgbeAixXHDvi/rBly4+mShhrJfYXwyh6uTLnXkjp6OcPuBbCXhIfARw45lNdiqWdHoqXcAl1RTBFFd4g==", + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -7304,9 +7304,9 @@ } }, "node_modules/@wordpress/block-serialization-default-parser": { - "version": "4.49.0", - "resolved": "https://registry.npmjs.org/@wordpress/block-serialization-default-parser/-/block-serialization-default-parser-4.49.0.tgz", - "integrity": "sha512-9pQ6yxOhiFv+47iZWF3Te6N+PK+IFlEWgG3IpSIj3mWV6OI7FoM/+C2ePeR06OxE2cQHRkL9pAsECtK9eDJmCQ==", + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@wordpress/block-serialization-default-parser/-/block-serialization-default-parser-4.50.0.tgz", + "integrity": "sha512-ihf2vr+w2zHBOvYTPQZXDiR2IMvso8yJJtzKIHA2ZEgVQ+VVLb4X86n34hfWXtPA3i2KDW+t1WCtq56aNq3Zag==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -7316,27 +7316,27 @@ } }, "node_modules/@wordpress/blocks": { - "version": "12.26.0", - "resolved": "https://registry.npmjs.org/@wordpress/blocks/-/blocks-12.26.0.tgz", - "integrity": "sha512-iIWUJmxGPXymf+X1rlHT0QxHV8+NzLfe96S3oKpX2UyFc/5H+eYWwyhA7u2S3kam/ss1DwAwdS7rRIMUHPU5PQ==", + "version": "12.27.1", + "resolved": "https://registry.npmjs.org/@wordpress/blocks/-/blocks-12.27.1.tgz", + "integrity": "sha512-9uZtuTG6+fiFV2bLn8b1gzv4BgMpBu4SDQGnvzc5f9U5GL5oYns3PP8vXDOwM2cK1DEmqPsohQWhRnz8QYZDtw==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/autop": "^3.49.0", - "@wordpress/blob": "^3.49.0", - "@wordpress/block-serialization-default-parser": "^4.49.0", - "@wordpress/compose": "^6.26.0", - "@wordpress/data": "^9.19.0", - "@wordpress/deprecated": "^3.49.0", - "@wordpress/dom": "^3.49.0", - "@wordpress/element": "^5.26.0", - "@wordpress/hooks": "^3.49.0", - "@wordpress/html-entities": "^3.49.0", - "@wordpress/i18n": "^4.49.0", - "@wordpress/is-shallow-equal": "^4.49.0", - "@wordpress/private-apis": "^0.31.0", - "@wordpress/rich-text": "^6.26.0", - "@wordpress/shortcode": "^3.49.0", + "@wordpress/autop": "^3.50.0", + "@wordpress/blob": "^3.50.0", + "@wordpress/block-serialization-default-parser": "^4.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/data": "^9.20.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/shortcode": "^3.50.0", "change-case": "^4.1.2", "colord": "^2.7.0", "fast-deep-equal": "^3.1.3", @@ -7358,9 +7358,9 @@ } }, "node_modules/@wordpress/blocks/node_modules/@wordpress/private-apis": { - "version": "0.31.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.31.0.tgz", - "integrity": "sha512-Hx2LJfkgbeAixXHDvi/rBly4+mShhrJfYXwyh6uTLnXkjp6OcPuBbCXhIfARw45lNdiqWdHoqXcAl1RTBFFd4g==", + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -7540,19 +7540,6 @@ "react": "^18.0.0" } }, - "node_modules/@wordpress/compose/node_modules/@wordpress/undo-manager": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-0.10.0.tgz", - "integrity": "sha512-ODDqAL6BSvD+J7FV+sQTAaVHiPChh/4KBnKg8pb2ogg+Weq6VynthxDxGpQnN8FcMKB9ZoyS3SNIl8pVXLKIwA==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.16.0", - "@wordpress/is-shallow-equal": "^4.50.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/@wordpress/core-commands": { "version": "0.16.0", "resolved": "https://registry.npmjs.org/@wordpress/core-commands/-/core-commands-0.16.0.tgz", @@ -7580,27 +7567,27 @@ } }, "node_modules/@wordpress/core-data": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/@wordpress/core-data/-/core-data-6.26.0.tgz", - "integrity": "sha512-RI3uf3gHnjNyHgMm72IQlk0k83FJAYmLOGUJM01NuMvsVIxDxp03rfvy3lCfNy1+BknknOYFhUaX88NKrizgNA==", + "version": "6.27.2", + "resolved": "https://registry.npmjs.org/@wordpress/core-data/-/core-data-6.27.2.tgz", + "integrity": "sha512-Jsy+vW/izrd/T36D/4b266ScobCezNYX2Me/clCmHGB4eRW3drXZPbMnWZLNEDagYr87sQcM1Namasb69dnDhA==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/api-fetch": "^6.46.0", - "@wordpress/block-editor": "^12.17.0", - "@wordpress/blocks": "^12.26.0", - "@wordpress/compose": "^6.26.0", - "@wordpress/data": "^9.19.0", - "@wordpress/deprecated": "^3.49.0", - "@wordpress/element": "^5.26.0", - "@wordpress/html-entities": "^3.49.0", - "@wordpress/i18n": "^4.49.0", - "@wordpress/is-shallow-equal": "^4.49.0", - "@wordpress/private-apis": "^0.31.0", - "@wordpress/rich-text": "^6.26.0", - "@wordpress/sync": "^0.11.0", - "@wordpress/undo-manager": "^0.9.0", - "@wordpress/url": "^3.50.0", + "@wordpress/api-fetch": "^6.47.0", + "@wordpress/block-editor": "^12.18.2", + "@wordpress/blocks": "^12.27.1", + "@wordpress/compose": "^6.27.0", + "@wordpress/data": "^9.20.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/sync": "^0.12.0", + "@wordpress/undo-manager": "^0.10.0", + "@wordpress/url": "^3.51.0", "change-case": "^4.1.2", "equivalent-key-map": "^0.2.2", "fast-deep-equal": "^3.1.3", @@ -7617,9 +7604,9 @@ } }, "node_modules/@wordpress/core-data/node_modules/@wordpress/private-apis": { - "version": "0.31.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.31.0.tgz", - "integrity": "sha512-Hx2LJfkgbeAixXHDvi/rBly4+mShhrJfYXwyh6uTLnXkjp6OcPuBbCXhIfARw45lNdiqWdHoqXcAl1RTBFFd4g==", + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -7857,42 +7844,42 @@ } }, "node_modules/@wordpress/editor": { - "version": "13.25.0", - "resolved": "https://registry.npmjs.org/@wordpress/editor/-/editor-13.25.0.tgz", - "integrity": "sha512-1waT0ZG6ii98eOuqbOJMEE9vHp1Y8BGlnb37rwiFn61yeUnWuvH2qcHyPiRh4tUDYp3rHACa+P0joN4L32MeHA==", + "version": "13.27.2", + "resolved": "https://registry.npmjs.org/@wordpress/editor/-/editor-13.27.2.tgz", + "integrity": "sha512-Wk1dwG5bkmDD74zip36yC1NO3EleXe/t35Z9GHfLaiZkUYlhZV2gv66QrrGN7Y59Zl68j+b4lRGLkUxEMWkleA==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.48.0", - "@wordpress/api-fetch": "^6.45.0", - "@wordpress/blob": "^3.48.0", - "@wordpress/block-editor": "^12.16.0", - "@wordpress/blocks": "^12.25.0", - "@wordpress/commands": "^0.19.0", - "@wordpress/components": "^25.14.0", - "@wordpress/compose": "^6.25.0", - "@wordpress/core-data": "^6.25.0", - "@wordpress/data": "^9.18.0", - "@wordpress/date": "^4.48.0", - "@wordpress/deprecated": "^3.48.0", - "@wordpress/dom": "^3.48.0", - "@wordpress/element": "^5.25.0", - "@wordpress/hooks": "^3.48.0", - "@wordpress/html-entities": "^3.48.0", - "@wordpress/i18n": "^4.48.0", - "@wordpress/icons": "^9.39.0", - "@wordpress/keyboard-shortcuts": "^4.25.0", - "@wordpress/keycodes": "^3.48.0", - "@wordpress/media-utils": "^4.39.0", - "@wordpress/notices": "^4.16.0", - "@wordpress/patterns": "^1.9.0", - "@wordpress/preferences": "^3.25.0", - "@wordpress/private-apis": "^0.30.0", - "@wordpress/reusable-blocks": "^4.25.0", - "@wordpress/rich-text": "^6.25.0", - "@wordpress/server-side-render": "^4.25.0", - "@wordpress/url": "^3.49.0", - "@wordpress/wordcount": "^3.48.0", + "@wordpress/a11y": "^3.50.0", + "@wordpress/api-fetch": "^6.47.0", + "@wordpress/blob": "^3.50.0", + "@wordpress/block-editor": "^12.18.2", + "@wordpress/blocks": "^12.27.1", + "@wordpress/commands": "^0.21.0", + "@wordpress/components": "^25.16.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/core-data": "^6.27.2", + "@wordpress/data": "^9.20.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/keyboard-shortcuts": "^4.27.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/media-utils": "^4.41.0", + "@wordpress/notices": "^4.18.0", + "@wordpress/patterns": "^1.11.2", + "@wordpress/preferences": "^3.27.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/reusable-blocks": "^4.27.2", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/server-side-render": "^4.27.1", + "@wordpress/url": "^3.51.0", + "@wordpress/wordcount": "^3.50.0", "classnames": "^2.3.1", "date-fns": "^2.28.0", "memize": "^2.1.0", @@ -7909,19 +7896,19 @@ } }, "node_modules/@wordpress/editor/node_modules/@wordpress/commands": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.19.0.tgz", - "integrity": "sha512-HGI59spV/efsbBaZ1/MkFFIjCSiQRd3u+oEAyRY8KWhxZBkEbJPnxBVb1I+LZ4GkhMNwRLAeo2VrI1HoYbs6eQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.21.0.tgz", + "integrity": "sha512-MzMUGCT9cQXto1jrA5lHAtnieTyAhcuNIxfyxlcE+316KNQfbyD8bc7KOzSV2sxXD/rfHuCxvHjfomFyyP+4kA==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/components": "^25.14.0", - "@wordpress/data": "^9.18.0", - "@wordpress/element": "^5.25.0", - "@wordpress/i18n": "^4.48.0", - "@wordpress/icons": "^9.39.0", - "@wordpress/keyboard-shortcuts": "^4.25.0", - "@wordpress/private-apis": "^0.30.0", + "@wordpress/components": "^25.16.0", + "@wordpress/data": "^9.20.0", + "@wordpress/element": "^5.27.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/keyboard-shortcuts": "^4.27.0", + "@wordpress/private-apis": "^0.32.0", "classnames": "^2.3.1", "cmdk": "^0.2.0", "rememo": "^4.0.2" @@ -7935,9 +7922,9 @@ } }, "node_modules/@wordpress/editor/node_modules/@wordpress/private-apis": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.30.0.tgz", - "integrity": "sha512-mkz2QtbSVNAsFNXBni5XMLV1KYhQAx1vyC5KcEyeQADiRkRUW6XJ+u53WwQfpdjvsEQhkyGpK13Rl7gt3KOpeQ==", + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -8286,15 +8273,15 @@ } }, "node_modules/@wordpress/keyboard-shortcuts": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/@wordpress/keyboard-shortcuts/-/keyboard-shortcuts-4.26.0.tgz", - "integrity": "sha512-ijCDTSKmWUP4sanucgrOqhSaxqBE1nbR2FzBEITSSfh2x1i0IK5rzF5BL3waV4mWKuSe0UmpPz5vnqKvijc+Ug==", + "version": "4.27.0", + "resolved": "https://registry.npmjs.org/@wordpress/keyboard-shortcuts/-/keyboard-shortcuts-4.27.0.tgz", + "integrity": "sha512-mpYhaSAMHXbRMp9hP08LejX/u1nLQaZONhwGSytqIhN1DQwpBbNbmV8ZNm1dnevUsYqEfPVVov6HFyPxYQ6m4w==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/data": "^9.19.0", - "@wordpress/element": "^5.26.0", - "@wordpress/keycodes": "^3.49.0", + "@wordpress/data": "^9.20.0", + "@wordpress/element": "^5.27.0", + "@wordpress/keycodes": "^3.50.0", "rememo": "^4.0.2" }, "engines": { @@ -8318,30 +8305,30 @@ } }, "node_modules/@wordpress/media-utils": { - "version": "4.39.0", - "resolved": "https://registry.npmjs.org/@wordpress/media-utils/-/media-utils-4.39.0.tgz", - "integrity": "sha512-vJRqqnEIsAvgy82daf+qE87ncB4o8x2Y/1NbvqUJUvU/B+xDxRxZeOYdwcYIhb7VNFkWo+DMxtIuhiNX67XiTQ==", + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/@wordpress/media-utils/-/media-utils-4.41.0.tgz", + "integrity": "sha512-wCxk8DAhmZ/3/a+oPRrieGurMOKDrYoDnnA0jhTm2D45kvn9y+NfnNBvLo2q1Is1ZiVTtNq54IRUXcdOjZgR9A==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/api-fetch": "^6.45.0", - "@wordpress/blob": "^3.48.0", - "@wordpress/element": "^5.25.0", - "@wordpress/i18n": "^4.48.0" + "@wordpress/api-fetch": "^6.47.0", + "@wordpress/blob": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/i18n": "^4.50.0" }, "engines": { "node": ">=12" } }, "node_modules/@wordpress/notices": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@wordpress/notices/-/notices-4.17.0.tgz", - "integrity": "sha512-EH7f4YDQUtuY+UlS8OIv0bjXXK+SGMGPQNlecSKFoP3QBoXZy5zhVDAfr4vewPE19t3gWaf22zPtF0NTl06a2g==", + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@wordpress/notices/-/notices-4.18.0.tgz", + "integrity": "sha512-Y2XpY6niJ7NuqPBtGYvDYSPCfw/y4yxv60ahu1kYd8r5BamKSchTYwKSnV0yrx/IUfNO04VAsNq9NCUQG12pRA==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.49.0", - "@wordpress/data": "^9.19.0" + "@wordpress/a11y": "^3.50.0", + "@wordpress/data": "^9.20.0" }, "engines": { "node": ">=12" @@ -8363,26 +8350,26 @@ } }, "node_modules/@wordpress/patterns": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@wordpress/patterns/-/patterns-1.9.0.tgz", - "integrity": "sha512-acuP9k41lGQD/jMcAbiChx5XRP5HUfyre1hJeL+eqAC/SYF/BnDKrhxugoXnOIpJDxrlOZ968csZukbj088QnQ==", + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/@wordpress/patterns/-/patterns-1.11.2.tgz", + "integrity": "sha512-cN7xjw5pfKq73mVF0q0ebZh4DmAab5SlQ9CvM7PtB03JOl3GMwVIDV5Tnbbhfi1KIsFwep2/CGft3xwuJlS3FQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.48.0", - "@wordpress/block-editor": "^12.16.0", - "@wordpress/blocks": "^12.25.0", - "@wordpress/components": "^25.14.0", - "@wordpress/compose": "^6.25.0", - "@wordpress/core-data": "^6.25.0", - "@wordpress/data": "^9.18.0", - "@wordpress/element": "^5.25.0", - "@wordpress/html-entities": "^3.48.0", - "@wordpress/i18n": "^4.48.0", - "@wordpress/icons": "^9.39.0", - "@wordpress/notices": "^4.16.0", - "@wordpress/private-apis": "^0.30.0", - "@wordpress/url": "^3.49.0", + "@wordpress/a11y": "^3.50.0", + "@wordpress/block-editor": "^12.18.2", + "@wordpress/blocks": "^12.27.1", + "@wordpress/components": "^25.16.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/core-data": "^6.27.2", + "@wordpress/data": "^9.20.0", + "@wordpress/element": "^5.27.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/notices": "^4.18.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/url": "^3.51.0", "nanoid": "^3.3.4" }, "engines": { @@ -8394,9 +8381,9 @@ } }, "node_modules/@wordpress/patterns/node_modules/@wordpress/private-apis": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.30.0.tgz", - "integrity": "sha512-mkz2QtbSVNAsFNXBni5XMLV1KYhQAx1vyC5KcEyeQADiRkRUW6XJ+u53WwQfpdjvsEQhkyGpK13Rl7gt3KOpeQ==", + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -8445,18 +8432,21 @@ } }, "node_modules/@wordpress/preferences": { - "version": "3.26.0", - "resolved": "https://registry.npmjs.org/@wordpress/preferences/-/preferences-3.26.0.tgz", - "integrity": "sha512-8fXN9T1sh9g6kl3ta0BWlZKeqlvMGj2VhNd564zZdfOsEojW1Fhq2RoLahcp2BnMmSojdgPCSQQ8O2IdirwDyA==", + "version": "3.27.0", + "resolved": "https://registry.npmjs.org/@wordpress/preferences/-/preferences-3.27.0.tgz", + "integrity": "sha512-LMhOHX5FI4CJHv2YhtpiEtHfLqL/pjKAMja/v7skkHPlrh64Sgzi/gep016/My5SjcR64JUD1Na2U2j/BnrBNQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.49.0", - "@wordpress/components": "^25.15.0", - "@wordpress/data": "^9.19.0", - "@wordpress/element": "^5.26.0", - "@wordpress/i18n": "^4.49.0", - "@wordpress/icons": "^9.40.0", + "@wordpress/a11y": "^3.50.0", + "@wordpress/components": "^25.16.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/data": "^9.20.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/private-apis": "^0.32.0", "classnames": "^2.3.1" }, "engines": { @@ -8467,6 +8457,18 @@ "react-dom": "^18.0.0" } }, + "node_modules/@wordpress/preferences/node_modules/@wordpress/private-apis": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.16.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@wordpress/prettier-config": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-3.7.0.tgz", @@ -8537,23 +8539,23 @@ } }, "node_modules/@wordpress/reusable-blocks": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@wordpress/reusable-blocks/-/reusable-blocks-4.25.0.tgz", - "integrity": "sha512-R7ysUJMRcxfGeF0Ly7/5QK7L32aHsGHXamSQY5h+aBhdNhKRtElWZKvzaKiw7AmKUqWpCQtpa8elFm2Iim//vw==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@wordpress/reusable-blocks/-/reusable-blocks-4.27.2.tgz", + "integrity": "sha512-kkhZyYFj4rbf7lPOqDMfaNO3fqLEyHYKjWITWzRMUPtLeIHin/DHepVz6Z6NERANHpbP0mD4BDoBEGYJ9/brbA==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/block-editor": "^12.16.0", - "@wordpress/blocks": "^12.25.0", - "@wordpress/components": "^25.14.0", - "@wordpress/core-data": "^6.25.0", - "@wordpress/data": "^9.18.0", - "@wordpress/element": "^5.25.0", - "@wordpress/i18n": "^4.48.0", - "@wordpress/icons": "^9.39.0", - "@wordpress/notices": "^4.16.0", - "@wordpress/private-apis": "^0.30.0", - "@wordpress/url": "^3.49.0" + "@wordpress/block-editor": "^12.18.2", + "@wordpress/blocks": "^12.27.1", + "@wordpress/components": "^25.16.0", + "@wordpress/core-data": "^6.27.2", + "@wordpress/data": "^9.20.0", + "@wordpress/element": "^5.27.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/notices": "^4.18.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/url": "^3.51.0" }, "engines": { "node": ">=12" @@ -8564,9 +8566,9 @@ } }, "node_modules/@wordpress/reusable-blocks/node_modules/@wordpress/private-apis": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.30.0.tgz", - "integrity": "sha512-mkz2QtbSVNAsFNXBni5XMLV1KYhQAx1vyC5KcEyeQADiRkRUW6XJ+u53WwQfpdjvsEQhkyGpK13Rl7gt3KOpeQ==", + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -8990,21 +8992,21 @@ } }, "node_modules/@wordpress/server-side-render": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@wordpress/server-side-render/-/server-side-render-4.25.0.tgz", - "integrity": "sha512-ScR5axX8TI6B0YDyZoZJReKSF0muxkx93Qb0buPBv9UxZ/Yv+U3GtNOFZvDZcn6hmHB99qkhuCS0UEVg56isqQ==", + "version": "4.27.1", + "resolved": "https://registry.npmjs.org/@wordpress/server-side-render/-/server-side-render-4.27.1.tgz", + "integrity": "sha512-hovofyT0z75NSK/CSkkSbbTdkq9Afc1MKbEVGXTGpqq5sKOa7IAcxWjzmh8byTgT8x7GEaAyHZUr31p4l0CGnQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/api-fetch": "^6.45.0", - "@wordpress/blocks": "^12.25.0", - "@wordpress/components": "^25.14.0", - "@wordpress/compose": "^6.25.0", - "@wordpress/data": "^9.18.0", - "@wordpress/deprecated": "^3.48.0", - "@wordpress/element": "^5.25.0", - "@wordpress/i18n": "^4.48.0", - "@wordpress/url": "^3.49.0", + "@wordpress/api-fetch": "^6.47.0", + "@wordpress/blocks": "^12.27.1", + "@wordpress/components": "^25.16.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/data": "^9.20.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/url": "^3.51.0", "fast-deep-equal": "^3.1.3" }, "engines": { @@ -9016,9 +9018,9 @@ } }, "node_modules/@wordpress/shortcode": { - "version": "3.49.0", - "resolved": "https://registry.npmjs.org/@wordpress/shortcode/-/shortcode-3.49.0.tgz", - "integrity": "sha512-4E+CQTj+MWqmYGqyPGUddKX2JgNpMIA6MrTZOQ4MEJp3VIxkLubzIwORfDZ6rlXD8PJ3kvMMivzB1MZ2svnX3Q==", + "version": "3.50.0", + "resolved": "https://registry.npmjs.org/@wordpress/shortcode/-/shortcode-3.50.0.tgz", + "integrity": "sha512-RnlqS2OsNUaI6VOLwyUiaL3trAJcWjtoiW21BjIXODbTkEreRJgBJnch7wdFpGimJmKIWBwRD8jQ4hdTND8xVw==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", @@ -9029,9 +9031,9 @@ } }, "node_modules/@wordpress/style-engine": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/style-engine/-/style-engine-1.32.0.tgz", - "integrity": "sha512-0Z3DjiUuwxH9t4P085EFXo+fCT+znOYNwEf59bn6e8jRxlQx7t88ecH8hlzQNswpYj0pKBzXQCUsJsxglZYv3g==", + "version": "1.33.1", + "resolved": "https://registry.npmjs.org/@wordpress/style-engine/-/style-engine-1.33.1.tgz", + "integrity": "sha512-mkur1jw3Trz76iwxU6DalTFsJyF5P/NTdU9xniMT8bo1H9HspgKrzqXAaxkTL9F9BXkyiYs+ctVekJYRUKlgcw==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", @@ -9058,14 +9060,14 @@ } }, "node_modules/@wordpress/sync": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@wordpress/sync/-/sync-0.11.0.tgz", - "integrity": "sha512-690oDaDUYWX3sBeHsOlXyreRFgFzVrb+GO6Vo74lUbx0zdI0sNJeX7blBSn3QvZcysN0cAvCRO1sciJinD4e5A==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@wordpress/sync/-/sync-0.12.0.tgz", + "integrity": "sha512-45gU1Gu/ys3zqYO4dDQf6eG5gGgJK9nXa62IUtUWFXIH4FN29XlvGppMVK/zzhJwejF/XnDuT7mQuVEFCZGswA==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", "@types/simple-peer": "^9.11.5", - "@wordpress/url": "^3.50.0", + "@wordpress/url": "^3.51.0", "import-locals": "^2.0.0", "lib0": "^0.2.42", "simple-peer": "^9.11.0", @@ -9079,9 +9081,9 @@ } }, "node_modules/@wordpress/token-list": { - "version": "2.49.0", - "resolved": "https://registry.npmjs.org/@wordpress/token-list/-/token-list-2.49.0.tgz", - "integrity": "sha512-TwLvEfkGqztps2xl+J57BYeJzG0lCLV418fem2VXdl2E2BCwt+d/kDggBPb4KmSdRvSO05QukZsRzPsfFRUbug==", + "version": "2.50.0", + "resolved": "https://registry.npmjs.org/@wordpress/token-list/-/token-list-2.50.0.tgz", + "integrity": "sha512-LTjXkoljQpJIHqs0isTUzIc1fMu68y0N9HcDIdsCMGkmKptWUCETtb+DItnraxDDLuyWNuTYf840S83a3XAVRA==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -9091,13 +9093,13 @@ } }, "node_modules/@wordpress/undo-manager": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-0.9.0.tgz", - "integrity": "sha512-ZD6fVOdDhH8NvV/2fqjkI6W3kURzU7grWMBSZLtnSmSSPdT//1VSIxe0gcbmRvVPWLdj+TXbHifIswcJK0bHhQ==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-0.10.0.tgz", + "integrity": "sha512-ODDqAL6BSvD+J7FV+sQTAaVHiPChh/4KBnKg8pb2ogg+Weq6VynthxDxGpQnN8FcMKB9ZoyS3SNIl8pVXLKIwA==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/is-shallow-equal": "^4.49.0" + "@wordpress/is-shallow-equal": "^4.50.0" }, "engines": { "node": ">=12" @@ -33160,9 +33162,9 @@ } }, "@wordpress/autop": { - "version": "3.49.0", - "resolved": "https://registry.npmjs.org/@wordpress/autop/-/autop-3.49.0.tgz", - "integrity": "sha512-bc0jUu8yOCioNFFgrO++XhdGU6QpL9HF9LeWxzayqp5Br4z9z7Zslp+KH1Gy6H2RNowEr8Fq4hZ7JwQ009EDmw==", + "version": "3.50.0", + "resolved": "https://registry.npmjs.org/@wordpress/autop/-/autop-3.50.0.tgz", + "integrity": "sha512-4E0vq2MvSOVDKXs4OulIbTdKU6S5O9QjT4qc63rAd0uiKGBYV12ViPzmwbJ6k38zOO0PKdcwlVCj55Gq4aoPDw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" @@ -33202,53 +33204,53 @@ "dev": true }, "@wordpress/blob": { - "version": "3.49.0", - "resolved": "https://registry.npmjs.org/@wordpress/blob/-/blob-3.49.0.tgz", - "integrity": "sha512-HYPMuXJx35uYlQC6JF9XXvPsOht2X8qJfXzGtxWb51OIC6DSRqh3f6s12fgPaNh9uElcSjQ4+Su286upu7S4vw==", + "version": "3.50.0", + "resolved": "https://registry.npmjs.org/@wordpress/blob/-/blob-3.50.0.tgz", + "integrity": "sha512-QvBhsW9WPdsOJhJ0BxzZ83i+cH/gAdjJ1iHY4Rkb02qbZEz4jhdvucGQf2oVnWwvAsFiFPKWk7CwAM5XjoahCA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" } }, "@wordpress/block-editor": { - "version": "12.17.0", - "resolved": "https://registry.npmjs.org/@wordpress/block-editor/-/block-editor-12.17.0.tgz", - "integrity": "sha512-np1ICMmScrSuDOQRYQqlDY35kOoQEHuckSCjJPQpjprutXaqG+Jk+RAeeHVgQ8Ze5B+QgkFLjNvYwRh11kYdqg==", + "version": "12.18.2", + "resolved": "https://registry.npmjs.org/@wordpress/block-editor/-/block-editor-12.18.2.tgz", + "integrity": "sha512-LDZIcp5Bl2FCyfkf07XgfM0kzY+AYhyTS4kt2U4GRSeUey79AM+GIYXb8TM2Y68B09HP/rpntBW4e/cBqjHfjw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@react-spring/web": "^9.4.5", - "@wordpress/a11y": "^3.49.0", - "@wordpress/api-fetch": "^6.46.0", - "@wordpress/blob": "^3.49.0", - "@wordpress/blocks": "^12.26.0", - "@wordpress/commands": "^0.20.0", - "@wordpress/components": "^25.15.0", - "@wordpress/compose": "^6.26.0", - "@wordpress/data": "^9.19.0", - "@wordpress/date": "^4.49.0", - "@wordpress/deprecated": "^3.49.0", - "@wordpress/dom": "^3.49.0", - "@wordpress/element": "^5.26.0", - "@wordpress/escape-html": "^2.49.0", - "@wordpress/hooks": "^3.49.0", - "@wordpress/html-entities": "^3.49.0", - "@wordpress/i18n": "^4.49.0", - "@wordpress/icons": "^9.40.0", - "@wordpress/is-shallow-equal": "^4.49.0", - "@wordpress/keyboard-shortcuts": "^4.26.0", - "@wordpress/keycodes": "^3.49.0", - "@wordpress/notices": "^4.17.0", - "@wordpress/preferences": "^3.26.0", - "@wordpress/private-apis": "^0.31.0", - "@wordpress/rich-text": "^6.26.0", - "@wordpress/style-engine": "^1.32.0", - "@wordpress/token-list": "^2.49.0", - "@wordpress/url": "^3.50.0", - "@wordpress/warning": "^2.49.0", - "@wordpress/wordcount": "^3.49.0", + "@wordpress/a11y": "^3.50.0", + "@wordpress/api-fetch": "^6.47.0", + "@wordpress/blob": "^3.50.0", + "@wordpress/blocks": "^12.27.1", + "@wordpress/commands": "^0.21.0", + "@wordpress/components": "^25.16.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/data": "^9.20.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keyboard-shortcuts": "^4.27.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/notices": "^4.18.0", + "@wordpress/preferences": "^3.27.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/style-engine": "^1.33.1", + "@wordpress/token-list": "^2.50.0", + "@wordpress/url": "^3.51.0", + "@wordpress/warning": "^2.50.0", + "@wordpress/wordcount": "^3.50.0", "change-case": "^4.1.2", "classnames": "^2.3.1", "colord": "^2.7.0", @@ -33267,28 +33269,28 @@ }, "dependencies": { "@wordpress/commands": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.20.0.tgz", - "integrity": "sha512-aQQCr3ViLwPEo/SEeW7FowA4zCfvypkO7eqTuTlcd+1E3ndRzlWA91rneo+l9GBUQ/elZzhc5Z0i2cMxHTMDRQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.21.0.tgz", + "integrity": "sha512-MzMUGCT9cQXto1jrA5lHAtnieTyAhcuNIxfyxlcE+316KNQfbyD8bc7KOzSV2sxXD/rfHuCxvHjfomFyyP+4kA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/components": "^25.15.0", - "@wordpress/data": "^9.19.0", - "@wordpress/element": "^5.26.0", - "@wordpress/i18n": "^4.49.0", - "@wordpress/icons": "^9.40.0", - "@wordpress/keyboard-shortcuts": "^4.26.0", - "@wordpress/private-apis": "^0.31.0", + "@wordpress/components": "^25.16.0", + "@wordpress/data": "^9.20.0", + "@wordpress/element": "^5.27.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/keyboard-shortcuts": "^4.27.0", + "@wordpress/private-apis": "^0.32.0", "classnames": "^2.3.1", "cmdk": "^0.2.0", "rememo": "^4.0.2" } }, "@wordpress/private-apis": { - "version": "0.31.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.31.0.tgz", - "integrity": "sha512-Hx2LJfkgbeAixXHDvi/rBly4+mShhrJfYXwyh6uTLnXkjp6OcPuBbCXhIfARw45lNdiqWdHoqXcAl1RTBFFd4g==", + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" @@ -33353,36 +33355,36 @@ } }, "@wordpress/block-serialization-default-parser": { - "version": "4.49.0", - "resolved": "https://registry.npmjs.org/@wordpress/block-serialization-default-parser/-/block-serialization-default-parser-4.49.0.tgz", - "integrity": "sha512-9pQ6yxOhiFv+47iZWF3Te6N+PK+IFlEWgG3IpSIj3mWV6OI7FoM/+C2ePeR06OxE2cQHRkL9pAsECtK9eDJmCQ==", + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@wordpress/block-serialization-default-parser/-/block-serialization-default-parser-4.50.0.tgz", + "integrity": "sha512-ihf2vr+w2zHBOvYTPQZXDiR2IMvso8yJJtzKIHA2ZEgVQ+VVLb4X86n34hfWXtPA3i2KDW+t1WCtq56aNq3Zag==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" } }, "@wordpress/blocks": { - "version": "12.26.0", - "resolved": "https://registry.npmjs.org/@wordpress/blocks/-/blocks-12.26.0.tgz", - "integrity": "sha512-iIWUJmxGPXymf+X1rlHT0QxHV8+NzLfe96S3oKpX2UyFc/5H+eYWwyhA7u2S3kam/ss1DwAwdS7rRIMUHPU5PQ==", + "version": "12.27.1", + "resolved": "https://registry.npmjs.org/@wordpress/blocks/-/blocks-12.27.1.tgz", + "integrity": "sha512-9uZtuTG6+fiFV2bLn8b1gzv4BgMpBu4SDQGnvzc5f9U5GL5oYns3PP8vXDOwM2cK1DEmqPsohQWhRnz8QYZDtw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/autop": "^3.49.0", - "@wordpress/blob": "^3.49.0", - "@wordpress/block-serialization-default-parser": "^4.49.0", - "@wordpress/compose": "^6.26.0", - "@wordpress/data": "^9.19.0", - "@wordpress/deprecated": "^3.49.0", - "@wordpress/dom": "^3.49.0", - "@wordpress/element": "^5.26.0", - "@wordpress/hooks": "^3.49.0", - "@wordpress/html-entities": "^3.49.0", - "@wordpress/i18n": "^4.49.0", - "@wordpress/is-shallow-equal": "^4.49.0", - "@wordpress/private-apis": "^0.31.0", - "@wordpress/rich-text": "^6.26.0", - "@wordpress/shortcode": "^3.49.0", + "@wordpress/autop": "^3.50.0", + "@wordpress/blob": "^3.50.0", + "@wordpress/block-serialization-default-parser": "^4.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/data": "^9.20.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/shortcode": "^3.50.0", "change-case": "^4.1.2", "colord": "^2.7.0", "fast-deep-equal": "^3.1.3", @@ -33398,9 +33400,9 @@ }, "dependencies": { "@wordpress/private-apis": { - "version": "0.31.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.31.0.tgz", - "integrity": "sha512-Hx2LJfkgbeAixXHDvi/rBly4+mShhrJfYXwyh6uTLnXkjp6OcPuBbCXhIfARw45lNdiqWdHoqXcAl1RTBFFd4g==", + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" @@ -33539,18 +33541,6 @@ "clipboard": "^2.0.11", "mousetrap": "^1.6.5", "use-memo-one": "^1.1.1" - }, - "dependencies": { - "@wordpress/undo-manager": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-0.10.0.tgz", - "integrity": "sha512-ODDqAL6BSvD+J7FV+sQTAaVHiPChh/4KBnKg8pb2ogg+Weq6VynthxDxGpQnN8FcMKB9ZoyS3SNIl8pVXLKIwA==", - "dev": true, - "requires": { - "@babel/runtime": "^7.16.0", - "@wordpress/is-shallow-equal": "^4.50.0" - } - } } }, "@wordpress/core-commands": { @@ -33573,27 +33563,27 @@ } }, "@wordpress/core-data": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/@wordpress/core-data/-/core-data-6.26.0.tgz", - "integrity": "sha512-RI3uf3gHnjNyHgMm72IQlk0k83FJAYmLOGUJM01NuMvsVIxDxp03rfvy3lCfNy1+BknknOYFhUaX88NKrizgNA==", + "version": "6.27.2", + "resolved": "https://registry.npmjs.org/@wordpress/core-data/-/core-data-6.27.2.tgz", + "integrity": "sha512-Jsy+vW/izrd/T36D/4b266ScobCezNYX2Me/clCmHGB4eRW3drXZPbMnWZLNEDagYr87sQcM1Namasb69dnDhA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/api-fetch": "^6.46.0", - "@wordpress/block-editor": "^12.17.0", - "@wordpress/blocks": "^12.26.0", - "@wordpress/compose": "^6.26.0", - "@wordpress/data": "^9.19.0", - "@wordpress/deprecated": "^3.49.0", - "@wordpress/element": "^5.26.0", - "@wordpress/html-entities": "^3.49.0", - "@wordpress/i18n": "^4.49.0", - "@wordpress/is-shallow-equal": "^4.49.0", - "@wordpress/private-apis": "^0.31.0", - "@wordpress/rich-text": "^6.26.0", - "@wordpress/sync": "^0.11.0", - "@wordpress/undo-manager": "^0.9.0", - "@wordpress/url": "^3.50.0", + "@wordpress/api-fetch": "^6.47.0", + "@wordpress/block-editor": "^12.18.2", + "@wordpress/blocks": "^12.27.1", + "@wordpress/compose": "^6.27.0", + "@wordpress/data": "^9.20.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/sync": "^0.12.0", + "@wordpress/undo-manager": "^0.10.0", + "@wordpress/url": "^3.51.0", "change-case": "^4.1.2", "equivalent-key-map": "^0.2.2", "fast-deep-equal": "^3.1.3", @@ -33603,9 +33593,9 @@ }, "dependencies": { "@wordpress/private-apis": { - "version": "0.31.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.31.0.tgz", - "integrity": "sha512-Hx2LJfkgbeAixXHDvi/rBly4+mShhrJfYXwyh6uTLnXkjp6OcPuBbCXhIfARw45lNdiqWdHoqXcAl1RTBFFd4g==", + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" @@ -33786,42 +33776,42 @@ } }, "@wordpress/editor": { - "version": "13.25.0", - "resolved": "https://registry.npmjs.org/@wordpress/editor/-/editor-13.25.0.tgz", - "integrity": "sha512-1waT0ZG6ii98eOuqbOJMEE9vHp1Y8BGlnb37rwiFn61yeUnWuvH2qcHyPiRh4tUDYp3rHACa+P0joN4L32MeHA==", + "version": "13.27.2", + "resolved": "https://registry.npmjs.org/@wordpress/editor/-/editor-13.27.2.tgz", + "integrity": "sha512-Wk1dwG5bkmDD74zip36yC1NO3EleXe/t35Z9GHfLaiZkUYlhZV2gv66QrrGN7Y59Zl68j+b4lRGLkUxEMWkleA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.48.0", - "@wordpress/api-fetch": "^6.45.0", - "@wordpress/blob": "^3.48.0", - "@wordpress/block-editor": "^12.16.0", - "@wordpress/blocks": "^12.25.0", - "@wordpress/commands": "^0.19.0", - "@wordpress/components": "^25.14.0", - "@wordpress/compose": "^6.25.0", - "@wordpress/core-data": "^6.25.0", - "@wordpress/data": "^9.18.0", - "@wordpress/date": "^4.48.0", - "@wordpress/deprecated": "^3.48.0", - "@wordpress/dom": "^3.48.0", - "@wordpress/element": "^5.25.0", - "@wordpress/hooks": "^3.48.0", - "@wordpress/html-entities": "^3.48.0", - "@wordpress/i18n": "^4.48.0", - "@wordpress/icons": "^9.39.0", - "@wordpress/keyboard-shortcuts": "^4.25.0", - "@wordpress/keycodes": "^3.48.0", - "@wordpress/media-utils": "^4.39.0", - "@wordpress/notices": "^4.16.0", - "@wordpress/patterns": "^1.9.0", - "@wordpress/preferences": "^3.25.0", - "@wordpress/private-apis": "^0.30.0", - "@wordpress/reusable-blocks": "^4.25.0", - "@wordpress/rich-text": "^6.25.0", - "@wordpress/server-side-render": "^4.25.0", - "@wordpress/url": "^3.49.0", - "@wordpress/wordcount": "^3.48.0", + "@wordpress/a11y": "^3.50.0", + "@wordpress/api-fetch": "^6.47.0", + "@wordpress/blob": "^3.50.0", + "@wordpress/block-editor": "^12.18.2", + "@wordpress/blocks": "^12.27.1", + "@wordpress/commands": "^0.21.0", + "@wordpress/components": "^25.16.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/core-data": "^6.27.2", + "@wordpress/data": "^9.20.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/keyboard-shortcuts": "^4.27.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/media-utils": "^4.41.0", + "@wordpress/notices": "^4.18.0", + "@wordpress/patterns": "^1.11.2", + "@wordpress/preferences": "^3.27.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/reusable-blocks": "^4.27.2", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/server-side-render": "^4.27.1", + "@wordpress/url": "^3.51.0", + "@wordpress/wordcount": "^3.50.0", "classnames": "^2.3.1", "date-fns": "^2.28.0", "memize": "^2.1.0", @@ -33831,28 +33821,28 @@ }, "dependencies": { "@wordpress/commands": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.19.0.tgz", - "integrity": "sha512-HGI59spV/efsbBaZ1/MkFFIjCSiQRd3u+oEAyRY8KWhxZBkEbJPnxBVb1I+LZ4GkhMNwRLAeo2VrI1HoYbs6eQ==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.21.0.tgz", + "integrity": "sha512-MzMUGCT9cQXto1jrA5lHAtnieTyAhcuNIxfyxlcE+316KNQfbyD8bc7KOzSV2sxXD/rfHuCxvHjfomFyyP+4kA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/components": "^25.14.0", - "@wordpress/data": "^9.18.0", - "@wordpress/element": "^5.25.0", - "@wordpress/i18n": "^4.48.0", - "@wordpress/icons": "^9.39.0", - "@wordpress/keyboard-shortcuts": "^4.25.0", - "@wordpress/private-apis": "^0.30.0", + "@wordpress/components": "^25.16.0", + "@wordpress/data": "^9.20.0", + "@wordpress/element": "^5.27.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/keyboard-shortcuts": "^4.27.0", + "@wordpress/private-apis": "^0.32.0", "classnames": "^2.3.1", "cmdk": "^0.2.0", "rememo": "^4.0.2" } }, "@wordpress/private-apis": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.30.0.tgz", - "integrity": "sha512-mkz2QtbSVNAsFNXBni5XMLV1KYhQAx1vyC5KcEyeQADiRkRUW6XJ+u53WwQfpdjvsEQhkyGpK13Rl7gt3KOpeQ==", + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" @@ -34103,15 +34093,15 @@ } }, "@wordpress/keyboard-shortcuts": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/@wordpress/keyboard-shortcuts/-/keyboard-shortcuts-4.26.0.tgz", - "integrity": "sha512-ijCDTSKmWUP4sanucgrOqhSaxqBE1nbR2FzBEITSSfh2x1i0IK5rzF5BL3waV4mWKuSe0UmpPz5vnqKvijc+Ug==", + "version": "4.27.0", + "resolved": "https://registry.npmjs.org/@wordpress/keyboard-shortcuts/-/keyboard-shortcuts-4.27.0.tgz", + "integrity": "sha512-mpYhaSAMHXbRMp9hP08LejX/u1nLQaZONhwGSytqIhN1DQwpBbNbmV8ZNm1dnevUsYqEfPVVov6HFyPxYQ6m4w==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/data": "^9.19.0", - "@wordpress/element": "^5.26.0", - "@wordpress/keycodes": "^3.49.0", + "@wordpress/data": "^9.20.0", + "@wordpress/element": "^5.27.0", + "@wordpress/keycodes": "^3.50.0", "rememo": "^4.0.2" } }, @@ -34126,27 +34116,27 @@ } }, "@wordpress/media-utils": { - "version": "4.39.0", - "resolved": "https://registry.npmjs.org/@wordpress/media-utils/-/media-utils-4.39.0.tgz", - "integrity": "sha512-vJRqqnEIsAvgy82daf+qE87ncB4o8x2Y/1NbvqUJUvU/B+xDxRxZeOYdwcYIhb7VNFkWo+DMxtIuhiNX67XiTQ==", + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/@wordpress/media-utils/-/media-utils-4.41.0.tgz", + "integrity": "sha512-wCxk8DAhmZ/3/a+oPRrieGurMOKDrYoDnnA0jhTm2D45kvn9y+NfnNBvLo2q1Is1ZiVTtNq54IRUXcdOjZgR9A==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/api-fetch": "^6.45.0", - "@wordpress/blob": "^3.48.0", - "@wordpress/element": "^5.25.0", - "@wordpress/i18n": "^4.48.0" + "@wordpress/api-fetch": "^6.47.0", + "@wordpress/blob": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/i18n": "^4.50.0" } }, "@wordpress/notices": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@wordpress/notices/-/notices-4.17.0.tgz", - "integrity": "sha512-EH7f4YDQUtuY+UlS8OIv0bjXXK+SGMGPQNlecSKFoP3QBoXZy5zhVDAfr4vewPE19t3gWaf22zPtF0NTl06a2g==", + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@wordpress/notices/-/notices-4.18.0.tgz", + "integrity": "sha512-Y2XpY6niJ7NuqPBtGYvDYSPCfw/y4yxv60ahu1kYd8r5BamKSchTYwKSnV0yrx/IUfNO04VAsNq9NCUQG12pRA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.49.0", - "@wordpress/data": "^9.19.0" + "@wordpress/a11y": "^3.50.0", + "@wordpress/data": "^9.20.0" } }, "@wordpress/npm-package-json-lint-config": { @@ -34157,33 +34147,33 @@ "requires": {} }, "@wordpress/patterns": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@wordpress/patterns/-/patterns-1.9.0.tgz", - "integrity": "sha512-acuP9k41lGQD/jMcAbiChx5XRP5HUfyre1hJeL+eqAC/SYF/BnDKrhxugoXnOIpJDxrlOZ968csZukbj088QnQ==", + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/@wordpress/patterns/-/patterns-1.11.2.tgz", + "integrity": "sha512-cN7xjw5pfKq73mVF0q0ebZh4DmAab5SlQ9CvM7PtB03JOl3GMwVIDV5Tnbbhfi1KIsFwep2/CGft3xwuJlS3FQ==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.48.0", - "@wordpress/block-editor": "^12.16.0", - "@wordpress/blocks": "^12.25.0", - "@wordpress/components": "^25.14.0", - "@wordpress/compose": "^6.25.0", - "@wordpress/core-data": "^6.25.0", - "@wordpress/data": "^9.18.0", - "@wordpress/element": "^5.25.0", - "@wordpress/html-entities": "^3.48.0", - "@wordpress/i18n": "^4.48.0", - "@wordpress/icons": "^9.39.0", - "@wordpress/notices": "^4.16.0", - "@wordpress/private-apis": "^0.30.0", - "@wordpress/url": "^3.49.0", + "@wordpress/a11y": "^3.50.0", + "@wordpress/block-editor": "^12.18.2", + "@wordpress/blocks": "^12.27.1", + "@wordpress/components": "^25.16.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/core-data": "^6.27.2", + "@wordpress/data": "^9.20.0", + "@wordpress/element": "^5.27.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/notices": "^4.18.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/url": "^3.51.0", "nanoid": "^3.3.4" }, "dependencies": { "@wordpress/private-apis": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.30.0.tgz", - "integrity": "sha512-mkz2QtbSVNAsFNXBni5XMLV1KYhQAx1vyC5KcEyeQADiRkRUW6XJ+u53WwQfpdjvsEQhkyGpK13Rl7gt3KOpeQ==", + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" @@ -34218,19 +34208,33 @@ } }, "@wordpress/preferences": { - "version": "3.26.0", - "resolved": "https://registry.npmjs.org/@wordpress/preferences/-/preferences-3.26.0.tgz", - "integrity": "sha512-8fXN9T1sh9g6kl3ta0BWlZKeqlvMGj2VhNd564zZdfOsEojW1Fhq2RoLahcp2BnMmSojdgPCSQQ8O2IdirwDyA==", + "version": "3.27.0", + "resolved": "https://registry.npmjs.org/@wordpress/preferences/-/preferences-3.27.0.tgz", + "integrity": "sha512-LMhOHX5FI4CJHv2YhtpiEtHfLqL/pjKAMja/v7skkHPlrh64Sgzi/gep016/My5SjcR64JUD1Na2U2j/BnrBNQ==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.49.0", - "@wordpress/components": "^25.15.0", - "@wordpress/data": "^9.19.0", - "@wordpress/element": "^5.26.0", - "@wordpress/i18n": "^4.49.0", - "@wordpress/icons": "^9.40.0", + "@wordpress/a11y": "^3.50.0", + "@wordpress/components": "^25.16.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/data": "^9.20.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/private-apis": "^0.32.0", "classnames": "^2.3.1" + }, + "dependencies": { + "@wordpress/private-apis": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.0" + } + } } }, "@wordpress/prettier-config": { @@ -34283,29 +34287,29 @@ } }, "@wordpress/reusable-blocks": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@wordpress/reusable-blocks/-/reusable-blocks-4.25.0.tgz", - "integrity": "sha512-R7ysUJMRcxfGeF0Ly7/5QK7L32aHsGHXamSQY5h+aBhdNhKRtElWZKvzaKiw7AmKUqWpCQtpa8elFm2Iim//vw==", + "version": "4.27.2", + "resolved": "https://registry.npmjs.org/@wordpress/reusable-blocks/-/reusable-blocks-4.27.2.tgz", + "integrity": "sha512-kkhZyYFj4rbf7lPOqDMfaNO3fqLEyHYKjWITWzRMUPtLeIHin/DHepVz6Z6NERANHpbP0mD4BDoBEGYJ9/brbA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/block-editor": "^12.16.0", - "@wordpress/blocks": "^12.25.0", - "@wordpress/components": "^25.14.0", - "@wordpress/core-data": "^6.25.0", - "@wordpress/data": "^9.18.0", - "@wordpress/element": "^5.25.0", - "@wordpress/i18n": "^4.48.0", - "@wordpress/icons": "^9.39.0", - "@wordpress/notices": "^4.16.0", - "@wordpress/private-apis": "^0.30.0", - "@wordpress/url": "^3.49.0" + "@wordpress/block-editor": "^12.18.2", + "@wordpress/blocks": "^12.27.1", + "@wordpress/components": "^25.16.0", + "@wordpress/core-data": "^6.27.2", + "@wordpress/data": "^9.20.0", + "@wordpress/element": "^5.27.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/notices": "^4.18.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/url": "^3.51.0" }, "dependencies": { "@wordpress/private-apis": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.30.0.tgz", - "integrity": "sha512-mkz2QtbSVNAsFNXBni5XMLV1KYhQAx1vyC5KcEyeQADiRkRUW6XJ+u53WwQfpdjvsEQhkyGpK13Rl7gt3KOpeQ==", + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" @@ -34627,28 +34631,28 @@ } }, "@wordpress/server-side-render": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/@wordpress/server-side-render/-/server-side-render-4.25.0.tgz", - "integrity": "sha512-ScR5axX8TI6B0YDyZoZJReKSF0muxkx93Qb0buPBv9UxZ/Yv+U3GtNOFZvDZcn6hmHB99qkhuCS0UEVg56isqQ==", + "version": "4.27.1", + "resolved": "https://registry.npmjs.org/@wordpress/server-side-render/-/server-side-render-4.27.1.tgz", + "integrity": "sha512-hovofyT0z75NSK/CSkkSbbTdkq9Afc1MKbEVGXTGpqq5sKOa7IAcxWjzmh8byTgT8x7GEaAyHZUr31p4l0CGnQ==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/api-fetch": "^6.45.0", - "@wordpress/blocks": "^12.25.0", - "@wordpress/components": "^25.14.0", - "@wordpress/compose": "^6.25.0", - "@wordpress/data": "^9.18.0", - "@wordpress/deprecated": "^3.48.0", - "@wordpress/element": "^5.25.0", - "@wordpress/i18n": "^4.48.0", - "@wordpress/url": "^3.49.0", + "@wordpress/api-fetch": "^6.47.0", + "@wordpress/blocks": "^12.27.1", + "@wordpress/components": "^25.16.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/data": "^9.20.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/url": "^3.51.0", "fast-deep-equal": "^3.1.3" } }, "@wordpress/shortcode": { - "version": "3.49.0", - "resolved": "https://registry.npmjs.org/@wordpress/shortcode/-/shortcode-3.49.0.tgz", - "integrity": "sha512-4E+CQTj+MWqmYGqyPGUddKX2JgNpMIA6MrTZOQ4MEJp3VIxkLubzIwORfDZ6rlXD8PJ3kvMMivzB1MZ2svnX3Q==", + "version": "3.50.0", + "resolved": "https://registry.npmjs.org/@wordpress/shortcode/-/shortcode-3.50.0.tgz", + "integrity": "sha512-RnlqS2OsNUaI6VOLwyUiaL3trAJcWjtoiW21BjIXODbTkEreRJgBJnch7wdFpGimJmKIWBwRD8jQ4hdTND8xVw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", @@ -34656,9 +34660,9 @@ } }, "@wordpress/style-engine": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/style-engine/-/style-engine-1.32.0.tgz", - "integrity": "sha512-0Z3DjiUuwxH9t4P085EFXo+fCT+znOYNwEf59bn6e8jRxlQx7t88ecH8hlzQNswpYj0pKBzXQCUsJsxglZYv3g==", + "version": "1.33.1", + "resolved": "https://registry.npmjs.org/@wordpress/style-engine/-/style-engine-1.33.1.tgz", + "integrity": "sha512-mkur1jw3Trz76iwxU6DalTFsJyF5P/NTdU9xniMT8bo1H9HspgKrzqXAaxkTL9F9BXkyiYs+ctVekJYRUKlgcw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", @@ -34676,14 +34680,14 @@ } }, "@wordpress/sync": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@wordpress/sync/-/sync-0.11.0.tgz", - "integrity": "sha512-690oDaDUYWX3sBeHsOlXyreRFgFzVrb+GO6Vo74lUbx0zdI0sNJeX7blBSn3QvZcysN0cAvCRO1sciJinD4e5A==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@wordpress/sync/-/sync-0.12.0.tgz", + "integrity": "sha512-45gU1Gu/ys3zqYO4dDQf6eG5gGgJK9nXa62IUtUWFXIH4FN29XlvGppMVK/zzhJwejF/XnDuT7mQuVEFCZGswA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", "@types/simple-peer": "^9.11.5", - "@wordpress/url": "^3.50.0", + "@wordpress/url": "^3.51.0", "import-locals": "^2.0.0", "lib0": "^0.2.42", "simple-peer": "^9.11.0", @@ -34694,22 +34698,22 @@ } }, "@wordpress/token-list": { - "version": "2.49.0", - "resolved": "https://registry.npmjs.org/@wordpress/token-list/-/token-list-2.49.0.tgz", - "integrity": "sha512-TwLvEfkGqztps2xl+J57BYeJzG0lCLV418fem2VXdl2E2BCwt+d/kDggBPb4KmSdRvSO05QukZsRzPsfFRUbug==", + "version": "2.50.0", + "resolved": "https://registry.npmjs.org/@wordpress/token-list/-/token-list-2.50.0.tgz", + "integrity": "sha512-LTjXkoljQpJIHqs0isTUzIc1fMu68y0N9HcDIdsCMGkmKptWUCETtb+DItnraxDDLuyWNuTYf840S83a3XAVRA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" } }, "@wordpress/undo-manager": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-0.9.0.tgz", - "integrity": "sha512-ZD6fVOdDhH8NvV/2fqjkI6W3kURzU7grWMBSZLtnSmSSPdT//1VSIxe0gcbmRvVPWLdj+TXbHifIswcJK0bHhQ==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-0.10.0.tgz", + "integrity": "sha512-ODDqAL6BSvD+J7FV+sQTAaVHiPChh/4KBnKg8pb2ogg+Weq6VynthxDxGpQnN8FcMKB9ZoyS3SNIl8pVXLKIwA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/is-shallow-equal": "^4.49.0" + "@wordpress/is-shallow-equal": "^4.50.0" } }, "@wordpress/url": { diff --git a/package.json b/package.json index 10266d78a..db1da5181 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "@wordpress/data": "^9.19.0", "@wordpress/e2e-test-utils": "^10.21.0", "@wordpress/edit-post": "^7.24.0", - "@wordpress/editor": "^13.25.0", + "@wordpress/editor": "^13.27.2", "@wordpress/element": "^5.25.0", "@wordpress/env": "^9.2.0", "@wordpress/eslint-plugin": "^17.7.0", From cfb9bc9ced0875f594158c0e5ef07ab360a06c24 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 10:17:29 +0000 Subject: [PATCH 003/110] build(deps-dev): bump @wordpress/scripts from 26.19.0 to 27.1.0 (#2162) --- package-lock.json | 350 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 175 insertions(+), 177 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2be0012ef..6239cbffe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "@wordpress/i18n": "^4.41.0", "@wordpress/icons": "^9.38.0", "@wordpress/plugins": "^6.18.0", - "@wordpress/scripts": "^26.19.0", + "@wordpress/scripts": "^27.1.0", "@wordpress/url": "^3.51.0", "@wordpress/wordcount": "^3.50.0", "concurrently": "^8.2.2", @@ -3891,13 +3891,13 @@ } }, "node_modules/@playwright/test": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.40.1.tgz", - "integrity": "sha512-EaaawMTOeEItCRvfmkI9v6rBkF1svM8wjl/YPRrg2N2Wmp+4qJYkWtJsbew1szfKKDm6fPLy4YAanBhIlf9dWw==", + "version": "1.41.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.41.2.tgz", + "integrity": "sha512-qQB9h7KbibJzrDpkXkYvsmiDJK14FULCCZgEcoe2AvFAS64oCirWTwzTlAYEbKaRxWs5TFesE1Na6izMv3HfGg==", "dev": true, "peer": true, "dependencies": { - "playwright": "1.40.1" + "playwright": "1.41.2" }, "bin": { "playwright": "cli.js" @@ -7117,9 +7117,9 @@ } }, "node_modules/@wordpress/base-styles": { - "version": "4.39.0", - "resolved": "https://registry.npmjs.org/@wordpress/base-styles/-/base-styles-4.39.0.tgz", - "integrity": "sha512-Obc6fKAnqzuWQSLgoce2yxhwMLd0nu4j7k3pVkBSzuitPw1LokmzHcHWPpgpMGR1T8CzKuj0Wsybcr2n3Xtyug==", + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/@wordpress/base-styles/-/base-styles-4.41.0.tgz", + "integrity": "sha512-MjPAZeAqvyskDXDp2wGZ0DjtYOQLOydI1WqVIZS4wnIdhsQWQD//VMeXgLrcmCzNyQg+iKTx3o+BzmXVTOD0+w==", "dev": true }, "node_modules/@wordpress/blob": { @@ -7685,19 +7685,18 @@ } }, "node_modules/@wordpress/dependency-extraction-webpack-plugin": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@wordpress/dependency-extraction-webpack-plugin/-/dependency-extraction-webpack-plugin-4.31.0.tgz", - "integrity": "sha512-Xpm8EEhi6e8GL1juYh/70AFbcE/ZVXJ3p47KMkkEsn5t+hG9QHjKe2lTj98v2r3rB+ampoK+whdV1w6gItXYpw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/dependency-extraction-webpack-plugin/-/dependency-extraction-webpack-plugin-5.1.0.tgz", + "integrity": "sha512-W2W+9JNAaGirAtGDSf83pjEKb63DLhgpJGgvMOpEPoRPtucgO6CCm3uMoNkJTpKoxJQ2tSZEymAhF/YdLm+ScQ==", "dev": true, "dependencies": { - "json2php": "^0.0.7", - "webpack-sources": "^3.2.2" + "json2php": "^0.0.7" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { - "webpack": "^4.8.3 || ^5.0.0" + "webpack": "^5.0.0" } }, "node_modules/@wordpress/deprecated": { @@ -7760,14 +7759,14 @@ } }, "node_modules/@wordpress/e2e-test-utils-playwright": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils-playwright/-/e2e-test-utils-playwright-0.16.0.tgz", - "integrity": "sha512-CktRj5/Cc/pAvTHXIAPIMrmmnb0VjtXbTGSjYG6pW/JI2YAmpwY2yBA+DlHJjqOIpcjDDj+sSsJomRSxT2chwQ==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils-playwright/-/e2e-test-utils-playwright-0.18.0.tgz", + "integrity": "sha512-Z8uH1dUzy/STQjOU6eb9nquVK4RC1rUx0gXY/GN1IVNDJvGN/yJxT/gNKmfiL7KpmHvNp2Q5M4bnUT9uiNcM+Q==", "dev": true, "dependencies": { - "@wordpress/api-fetch": "^6.45.0", - "@wordpress/keycodes": "^3.48.0", - "@wordpress/url": "^3.49.0", + "@wordpress/api-fetch": "^6.47.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/url": "^3.51.0", "change-case": "^4.1.2", "form-data": "^4.0.0", "get-port": "^5.1.1", @@ -8240,9 +8239,9 @@ } }, "node_modules/@wordpress/jest-console": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@wordpress/jest-console/-/jest-console-7.19.0.tgz", - "integrity": "sha512-x35izGNCLo7xoK770I7O/+m6sE/a9lmo6QqyDoR1AZaUwk0PAY35EGrbbi3FfXeReTXBRNJ1MpnQyvskg8o/Gw==", + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@wordpress/jest-console/-/jest-console-7.21.0.tgz", + "integrity": "sha512-o2vZRlwwJ6WoxRwnFFT5iZzfdc2d9MZvrtwB093RWPNcyK5qVtApji4VN/ieHijB4bjEHGalm0UKfKpt0EDlUQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", @@ -8256,12 +8255,12 @@ } }, "node_modules/@wordpress/jest-preset-default": { - "version": "11.19.0", - "resolved": "https://registry.npmjs.org/@wordpress/jest-preset-default/-/jest-preset-default-11.19.0.tgz", - "integrity": "sha512-9BbUDZaa6Cg9dz+JyfOe30C8JJrhCkyaFqCqSNJEcyB4KK83qp2QRkblVXABmHarw4oPfg+OJLLALIAA045a0w==", + "version": "11.21.0", + "resolved": "https://registry.npmjs.org/@wordpress/jest-preset-default/-/jest-preset-default-11.21.0.tgz", + "integrity": "sha512-XAztKOROu02iBsz+Qosv/RYuPWB1XwwlU+FiA5Y68tRztrqFy4b/il+DFg4Jue/zXF7UECWUvosd5ow/GmKa6Q==", "dev": true, "dependencies": { - "@wordpress/jest-console": "^7.19.0", + "@wordpress/jest-console": "^7.21.0", "babel-jest": "^29.6.2" }, "engines": { @@ -8338,9 +8337,9 @@ } }, "node_modules/@wordpress/npm-package-json-lint-config": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/npm-package-json-lint-config/-/npm-package-json-lint-config-4.33.0.tgz", - "integrity": "sha512-GBVGcn6xAqrWQueSlMVMHoebGsHvildWwcJ/lIpxh7i7V/VBoc9Z8rdUEKAip6lTjZx+mCmzXQH4hU3QdNA/RA==", + "version": "4.35.0", + "resolved": "https://registry.npmjs.org/@wordpress/npm-package-json-lint-config/-/npm-package-json-lint-config-4.35.0.tgz", + "integrity": "sha512-QmkhYM4/s+2r3RuolVRRmoUa5o3lFgcHA6I3A9akaSVGZr//4p2p+iXOGmNub9njgGlj7j8SAPN8GUsCO/VqZQ==", "dev": true, "engines": { "node": ">=14" @@ -8416,12 +8415,12 @@ } }, "node_modules/@wordpress/postcss-plugins-preset": { - "version": "4.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/postcss-plugins-preset/-/postcss-plugins-preset-4.32.0.tgz", - "integrity": "sha512-+4+chYW8pRd7Irzm8lXom5Axs765q4me1mT+FBskfotUroAvoJtmfAybmyhIvTirTwLaN7ugOYiSBjAD6M7+rg==", + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@wordpress/postcss-plugins-preset/-/postcss-plugins-preset-4.34.0.tgz", + "integrity": "sha512-OLQBSLE2q11Ik+WdcO2QfGr/O4X/zJYOGXNsychx/EaMamLzJInFcRL6kGbPX41zPINhadq5x2vFIZI2EC+Uyg==", "dev": true, "dependencies": { - "@wordpress/base-styles": "^4.39.0", + "@wordpress/base-styles": "^4.41.0", "autoprefixer": "^10.2.5" }, "engines": { @@ -8622,24 +8621,24 @@ } }, "node_modules/@wordpress/scripts": { - "version": "26.19.0", - "resolved": "https://registry.npmjs.org/@wordpress/scripts/-/scripts-26.19.0.tgz", - "integrity": "sha512-m3QYlgpWRfIqCfU4jWKwGeA12Qkt6d9CMewEIxIBGVlEGd/sL5rU1fM7LKNBEbSPQpaOTWJApNGWPcW75Fwp+w==", + "version": "27.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/scripts/-/scripts-27.1.0.tgz", + "integrity": "sha512-jewyOxqaNrsct5R1NXv2lT8CA70vzrvpdZHYERCcH9LzKuvrcc32Telm9Jqso6ay1ZgHeIbjHSCd2+r2sBG7hw==", "dev": true, "dependencies": { "@babel/core": "^7.16.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11", "@svgr/webpack": "^8.0.1", - "@wordpress/babel-preset-default": "^7.32.0", - "@wordpress/browserslist-config": "^5.31.0", - "@wordpress/dependency-extraction-webpack-plugin": "^4.31.0", - "@wordpress/e2e-test-utils-playwright": "^0.16.0", - "@wordpress/eslint-plugin": "^17.5.0", - "@wordpress/jest-preset-default": "^11.19.0", - "@wordpress/npm-package-json-lint-config": "^4.33.0", - "@wordpress/postcss-plugins-preset": "^4.32.0", - "@wordpress/prettier-config": "^3.5.0", - "@wordpress/stylelint-config": "^21.31.0", + "@wordpress/babel-preset-default": "^7.34.0", + "@wordpress/browserslist-config": "^5.33.0", + "@wordpress/dependency-extraction-webpack-plugin": "^5.1.0", + "@wordpress/e2e-test-utils-playwright": "^0.18.0", + "@wordpress/eslint-plugin": "^17.7.0", + "@wordpress/jest-preset-default": "^11.21.0", + "@wordpress/npm-package-json-lint-config": "^4.35.0", + "@wordpress/postcss-plugins-preset": "^4.34.0", + "@wordpress/prettier-config": "^3.7.0", + "@wordpress/stylelint-config": "^21.33.0", "adm-zip": "^0.5.9", "babel-jest": "^29.6.2", "babel-loader": "^8.2.3", @@ -8690,7 +8689,7 @@ "wp-scripts": "bin/wp-scripts.js" }, "engines": { - "node": ">=14", + "node": ">=18", "npm": ">=6.14.4" }, "peerDependencies": { @@ -9044,9 +9043,9 @@ } }, "node_modules/@wordpress/stylelint-config": { - "version": "21.31.0", - "resolved": "https://registry.npmjs.org/@wordpress/stylelint-config/-/stylelint-config-21.31.0.tgz", - "integrity": "sha512-rorpVMYfFaNWYzg4psfUMpWLkxhD3uwWip6mf96mo/i8De4wxAz6DwKlCPIa4j74SLTiIMrdwXb2qJFNQcjQng==", + "version": "21.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/stylelint-config/-/stylelint-config-21.33.0.tgz", + "integrity": "sha512-DwjXrjRBva0tkYILvDV7rjl3VaKXxvchlxnFfFs6l2DWL/Qo31CJ+f2rVw4XSWuuWxY1EsyIn9tOBS9URloWTQ==", "dev": true, "dependencies": { "stylelint-config-recommended": "^6.0.0", @@ -9677,9 +9676,9 @@ "dev": true }, "node_modules/autoprefixer": { - "version": "10.4.16", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.16.tgz", - "integrity": "sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==", + "version": "10.4.17", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.17.tgz", + "integrity": "sha512-/cpVNRLSfhOtcGflT13P2794gVSgmPgTR+erw5ifnMLZb0UnSlkK4tquLmkd3BhA+nLo5tX8Cu0upUsGKvKbmg==", "dev": true, "funding": [ { @@ -9696,9 +9695,9 @@ } ], "dependencies": { - "browserslist": "^4.21.10", - "caniuse-lite": "^1.0.30001538", - "fraction.js": "^4.3.6", + "browserslist": "^4.22.2", + "caniuse-lite": "^1.0.30001578", + "fraction.js": "^4.3.7", "normalize-range": "^0.1.2", "picocolors": "^1.0.0", "postcss-value-parser": "^4.2.0" @@ -10230,9 +10229,9 @@ } }, "node_modules/browserslist": { - "version": "4.21.10", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz", - "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==", + "version": "4.22.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.3.tgz", + "integrity": "sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A==", "dev": true, "funding": [ { @@ -10249,10 +10248,10 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001517", - "electron-to-chromium": "^1.4.477", - "node-releases": "^2.0.13", - "update-browserslist-db": "^1.0.11" + "caniuse-lite": "^1.0.30001580", + "electron-to-chromium": "^1.4.648", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.13" }, "bin": { "browserslist": "cli.js" @@ -10506,9 +10505,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001538", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001538.tgz", - "integrity": "sha512-HWJnhnID+0YMtGlzcp3T9drmBJUVDchPJ08tpUGFLs9CYlwWPH2uLgpHn8fND5pCgXVtnGS3H4QR9XLMHVNkHw==", + "version": "1.0.30001584", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001584.tgz", + "integrity": "sha512-LOz7CCQ9M1G7OjJOF9/mzmqmj3jE/7VOmrfw6Mgs0E8cjOsbRXQJHsPBfmBOXDskXKrHLyyW3n7kpDW/4BsfpQ==", "dev": true, "funding": [ { @@ -12688,9 +12687,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.508", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.508.tgz", - "integrity": "sha512-FFa8QKjQK/A5QuFr2167myhMesGrhlOBD+3cYNxO9/S4XzHEXesyTD/1/xF644gC8buFPz3ca6G1LOQD0tZrrg==", + "version": "1.4.656", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.656.tgz", + "integrity": "sha512-9AQB5eFTHyR3Gvt2t/NwR0le2jBSUNwCnMbUCejFWHD+so4tH40/dRLgoE+jxlPeWS43XJewyvCv+I8LPMl49Q==", "dev": true }, "node_modules/emittery": { @@ -21011,9 +21010,9 @@ "dev": true }, "node_modules/node-releases": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", - "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", "dev": true }, "node_modules/normalize-package-data": { @@ -21250,9 +21249,9 @@ } }, "node_modules/npm-package-json-lint/node_modules/jsonc-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", - "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", "dev": true }, "node_modules/npm-package-json-lint/node_modules/lru-cache": { @@ -22203,13 +22202,13 @@ } }, "node_modules/playwright": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.40.1.tgz", - "integrity": "sha512-2eHI7IioIpQ0bS1Ovg/HszsN/XKNwEG1kbzSDDmADpclKc7CyqkHw7Mg2JCz/bbCxg25QUPcjksoMW7JcIFQmw==", + "version": "1.41.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.41.2.tgz", + "integrity": "sha512-v0bOa6H2GJChDL8pAeLa/LZC4feoAMbSQm1/jF/ySsWWoaNItvrMP7GEkvEEFyCTUYKMxjQKaTSg5up7nR6/8A==", "dev": true, "peer": true, "dependencies": { - "playwright-core": "1.40.1" + "playwright-core": "1.41.2" }, "bin": { "playwright": "cli.js" @@ -22249,9 +22248,9 @@ } }, "node_modules/playwright/node_modules/playwright-core": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.40.1.tgz", - "integrity": "sha512-+hkOycxPiV534c4HhpfX6yrlawqVUzITRKwHAmYfmsVreltEl6fAZJ3DPfLMOODw0H3s1Itd6MDCWmP1fl/QvQ==", + "version": "1.41.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.41.2.tgz", + "integrity": "sha512-VaTvwCA4Y8kxEe+kfm2+uUUw5Lubf38RxF7FpBxLPmGe5sdNkSg5e3ChEigaGrX7qdqT3pt2m/98LiyvU2x6CA==", "dev": true, "peer": true, "bin": { @@ -26569,9 +26568,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", - "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", "dev": true, "funding": [ { @@ -26924,9 +26923,9 @@ } }, "node_modules/web-vitals": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-3.5.0.tgz", - "integrity": "sha512-f5YnCHVG9Y6uLCePD4tY8bO/Ge15NPEQWtvm3tPzDKygloiqtb4SVqRHBcrIAqo2ztqX5XueqDn97zHF0LdT6w==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-3.5.2.tgz", + "integrity": "sha512-c0rhqNcHXRkY/ogGDJQxZ9Im9D19hDihbzSQJrsioex+KnFgmMzBiy57Z1EjkhX/+OjyBpclDCzz2ITtjokFmg==", "dev": true }, "node_modules/webidl-conversions": { @@ -30670,13 +30669,13 @@ } }, "@playwright/test": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.40.1.tgz", - "integrity": "sha512-EaaawMTOeEItCRvfmkI9v6rBkF1svM8wjl/YPRrg2N2Wmp+4qJYkWtJsbew1szfKKDm6fPLy4YAanBhIlf9dWw==", + "version": "1.41.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.41.2.tgz", + "integrity": "sha512-qQB9h7KbibJzrDpkXkYvsmiDJK14FULCCZgEcoe2AvFAS64oCirWTwzTlAYEbKaRxWs5TFesE1Na6izMv3HfGg==", "dev": true, "peer": true, "requires": { - "playwright": "1.40.1" + "playwright": "1.41.2" } }, "@pmmmwh/react-refresh-webpack-plugin": { @@ -33198,9 +33197,9 @@ } }, "@wordpress/base-styles": { - "version": "4.39.0", - "resolved": "https://registry.npmjs.org/@wordpress/base-styles/-/base-styles-4.39.0.tgz", - "integrity": "sha512-Obc6fKAnqzuWQSLgoce2yxhwMLd0nu4j7k3pVkBSzuitPw1LokmzHcHWPpgpMGR1T8CzKuj0Wsybcr2n3Xtyug==", + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/@wordpress/base-styles/-/base-styles-4.41.0.tgz", + "integrity": "sha512-MjPAZeAqvyskDXDp2wGZ0DjtYOQLOydI1WqVIZS4wnIdhsQWQD//VMeXgLrcmCzNyQg+iKTx3o+BzmXVTOD0+w==", "dev": true }, "@wordpress/blob": { @@ -33656,13 +33655,12 @@ } }, "@wordpress/dependency-extraction-webpack-plugin": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@wordpress/dependency-extraction-webpack-plugin/-/dependency-extraction-webpack-plugin-4.31.0.tgz", - "integrity": "sha512-Xpm8EEhi6e8GL1juYh/70AFbcE/ZVXJ3p47KMkkEsn5t+hG9QHjKe2lTj98v2r3rB+ampoK+whdV1w6gItXYpw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/dependency-extraction-webpack-plugin/-/dependency-extraction-webpack-plugin-5.1.0.tgz", + "integrity": "sha512-W2W+9JNAaGirAtGDSf83pjEKb63DLhgpJGgvMOpEPoRPtucgO6CCm3uMoNkJTpKoxJQ2tSZEymAhF/YdLm+ScQ==", "dev": true, "requires": { - "json2php": "^0.0.7", - "webpack-sources": "^3.2.2" + "json2php": "^0.0.7" } }, "@wordpress/deprecated": { @@ -33709,14 +33707,14 @@ } }, "@wordpress/e2e-test-utils-playwright": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils-playwright/-/e2e-test-utils-playwright-0.16.0.tgz", - "integrity": "sha512-CktRj5/Cc/pAvTHXIAPIMrmmnb0VjtXbTGSjYG6pW/JI2YAmpwY2yBA+DlHJjqOIpcjDDj+sSsJomRSxT2chwQ==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils-playwright/-/e2e-test-utils-playwright-0.18.0.tgz", + "integrity": "sha512-Z8uH1dUzy/STQjOU6eb9nquVK4RC1rUx0gXY/GN1IVNDJvGN/yJxT/gNKmfiL7KpmHvNp2Q5M4bnUT9uiNcM+Q==", "dev": true, "requires": { - "@wordpress/api-fetch": "^6.45.0", - "@wordpress/keycodes": "^3.48.0", - "@wordpress/url": "^3.49.0", + "@wordpress/api-fetch": "^6.47.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/url": "^3.51.0", "change-case": "^4.1.2", "form-data": "^4.0.0", "get-port": "^5.1.1", @@ -34073,9 +34071,9 @@ } }, "@wordpress/jest-console": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@wordpress/jest-console/-/jest-console-7.19.0.tgz", - "integrity": "sha512-x35izGNCLo7xoK770I7O/+m6sE/a9lmo6QqyDoR1AZaUwk0PAY35EGrbbi3FfXeReTXBRNJ1MpnQyvskg8o/Gw==", + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@wordpress/jest-console/-/jest-console-7.21.0.tgz", + "integrity": "sha512-o2vZRlwwJ6WoxRwnFFT5iZzfdc2d9MZvrtwB093RWPNcyK5qVtApji4VN/ieHijB4bjEHGalm0UKfKpt0EDlUQ==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", @@ -34083,12 +34081,12 @@ } }, "@wordpress/jest-preset-default": { - "version": "11.19.0", - "resolved": "https://registry.npmjs.org/@wordpress/jest-preset-default/-/jest-preset-default-11.19.0.tgz", - "integrity": "sha512-9BbUDZaa6Cg9dz+JyfOe30C8JJrhCkyaFqCqSNJEcyB4KK83qp2QRkblVXABmHarw4oPfg+OJLLALIAA045a0w==", + "version": "11.21.0", + "resolved": "https://registry.npmjs.org/@wordpress/jest-preset-default/-/jest-preset-default-11.21.0.tgz", + "integrity": "sha512-XAztKOROu02iBsz+Qosv/RYuPWB1XwwlU+FiA5Y68tRztrqFy4b/il+DFg4Jue/zXF7UECWUvosd5ow/GmKa6Q==", "dev": true, "requires": { - "@wordpress/jest-console": "^7.19.0", + "@wordpress/jest-console": "^7.21.0", "babel-jest": "^29.6.2" } }, @@ -34140,9 +34138,9 @@ } }, "@wordpress/npm-package-json-lint-config": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/npm-package-json-lint-config/-/npm-package-json-lint-config-4.33.0.tgz", - "integrity": "sha512-GBVGcn6xAqrWQueSlMVMHoebGsHvildWwcJ/lIpxh7i7V/VBoc9Z8rdUEKAip6lTjZx+mCmzXQH4hU3QdNA/RA==", + "version": "4.35.0", + "resolved": "https://registry.npmjs.org/@wordpress/npm-package-json-lint-config/-/npm-package-json-lint-config-4.35.0.tgz", + "integrity": "sha512-QmkhYM4/s+2r3RuolVRRmoUa5o3lFgcHA6I3A9akaSVGZr//4p2p+iXOGmNub9njgGlj7j8SAPN8GUsCO/VqZQ==", "dev": true, "requires": {} }, @@ -34198,12 +34196,12 @@ } }, "@wordpress/postcss-plugins-preset": { - "version": "4.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/postcss-plugins-preset/-/postcss-plugins-preset-4.32.0.tgz", - "integrity": "sha512-+4+chYW8pRd7Irzm8lXom5Axs765q4me1mT+FBskfotUroAvoJtmfAybmyhIvTirTwLaN7ugOYiSBjAD6M7+rg==", + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@wordpress/postcss-plugins-preset/-/postcss-plugins-preset-4.34.0.tgz", + "integrity": "sha512-OLQBSLE2q11Ik+WdcO2QfGr/O4X/zJYOGXNsychx/EaMamLzJInFcRL6kGbPX41zPINhadq5x2vFIZI2EC+Uyg==", "dev": true, "requires": { - "@wordpress/base-styles": "^4.39.0", + "@wordpress/base-styles": "^4.41.0", "autoprefixer": "^10.2.5" } }, @@ -34350,24 +34348,24 @@ } }, "@wordpress/scripts": { - "version": "26.19.0", - "resolved": "https://registry.npmjs.org/@wordpress/scripts/-/scripts-26.19.0.tgz", - "integrity": "sha512-m3QYlgpWRfIqCfU4jWKwGeA12Qkt6d9CMewEIxIBGVlEGd/sL5rU1fM7LKNBEbSPQpaOTWJApNGWPcW75Fwp+w==", + "version": "27.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/scripts/-/scripts-27.1.0.tgz", + "integrity": "sha512-jewyOxqaNrsct5R1NXv2lT8CA70vzrvpdZHYERCcH9LzKuvrcc32Telm9Jqso6ay1ZgHeIbjHSCd2+r2sBG7hw==", "dev": true, "requires": { "@babel/core": "^7.16.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11", "@svgr/webpack": "^8.0.1", - "@wordpress/babel-preset-default": "^7.32.0", - "@wordpress/browserslist-config": "^5.31.0", - "@wordpress/dependency-extraction-webpack-plugin": "^4.31.0", - "@wordpress/e2e-test-utils-playwright": "^0.16.0", - "@wordpress/eslint-plugin": "^17.5.0", - "@wordpress/jest-preset-default": "^11.19.0", - "@wordpress/npm-package-json-lint-config": "^4.33.0", - "@wordpress/postcss-plugins-preset": "^4.32.0", - "@wordpress/prettier-config": "^3.5.0", - "@wordpress/stylelint-config": "^21.31.0", + "@wordpress/babel-preset-default": "^7.34.0", + "@wordpress/browserslist-config": "^5.33.0", + "@wordpress/dependency-extraction-webpack-plugin": "^5.1.0", + "@wordpress/e2e-test-utils-playwright": "^0.18.0", + "@wordpress/eslint-plugin": "^17.7.0", + "@wordpress/jest-preset-default": "^11.21.0", + "@wordpress/npm-package-json-lint-config": "^4.35.0", + "@wordpress/postcss-plugins-preset": "^4.34.0", + "@wordpress/prettier-config": "^3.7.0", + "@wordpress/stylelint-config": "^21.33.0", "adm-zip": "^0.5.9", "babel-jest": "^29.6.2", "babel-loader": "^8.2.3", @@ -34670,9 +34668,9 @@ } }, "@wordpress/stylelint-config": { - "version": "21.31.0", - "resolved": "https://registry.npmjs.org/@wordpress/stylelint-config/-/stylelint-config-21.31.0.tgz", - "integrity": "sha512-rorpVMYfFaNWYzg4psfUMpWLkxhD3uwWip6mf96mo/i8De4wxAz6DwKlCPIa4j74SLTiIMrdwXb2qJFNQcjQng==", + "version": "21.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/stylelint-config/-/stylelint-config-21.33.0.tgz", + "integrity": "sha512-DwjXrjRBva0tkYILvDV7rjl3VaKXxvchlxnFfFs6l2DWL/Qo31CJ+f2rVw4XSWuuWxY1EsyIn9tOBS9URloWTQ==", "dev": true, "requires": { "stylelint-config-recommended": "^6.0.0", @@ -35150,14 +35148,14 @@ "dev": true }, "autoprefixer": { - "version": "10.4.16", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.16.tgz", - "integrity": "sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==", + "version": "10.4.17", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.17.tgz", + "integrity": "sha512-/cpVNRLSfhOtcGflT13P2794gVSgmPgTR+erw5ifnMLZb0UnSlkK4tquLmkd3BhA+nLo5tX8Cu0upUsGKvKbmg==", "dev": true, "requires": { - "browserslist": "^4.21.10", - "caniuse-lite": "^1.0.30001538", - "fraction.js": "^4.3.6", + "browserslist": "^4.22.2", + "caniuse-lite": "^1.0.30001578", + "fraction.js": "^4.3.7", "normalize-range": "^0.1.2", "picocolors": "^1.0.0", "postcss-value-parser": "^4.2.0" @@ -35565,15 +35563,15 @@ } }, "browserslist": { - "version": "4.21.10", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz", - "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==", + "version": "4.22.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.3.tgz", + "integrity": "sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001517", - "electron-to-chromium": "^1.4.477", - "node-releases": "^2.0.13", - "update-browserslist-db": "^1.0.11" + "caniuse-lite": "^1.0.30001580", + "electron-to-chromium": "^1.4.648", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.13" } }, "bser": { @@ -35754,9 +35752,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001538", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001538.tgz", - "integrity": "sha512-HWJnhnID+0YMtGlzcp3T9drmBJUVDchPJ08tpUGFLs9CYlwWPH2uLgpHn8fND5pCgXVtnGS3H4QR9XLMHVNkHw==", + "version": "1.0.30001584", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001584.tgz", + "integrity": "sha512-LOz7CCQ9M1G7OjJOF9/mzmqmj3jE/7VOmrfw6Mgs0E8cjOsbRXQJHsPBfmBOXDskXKrHLyyW3n7kpDW/4BsfpQ==", "dev": true }, "capital-case": { @@ -37385,9 +37383,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.4.508", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.508.tgz", - "integrity": "sha512-FFa8QKjQK/A5QuFr2167myhMesGrhlOBD+3cYNxO9/S4XzHEXesyTD/1/xF644gC8buFPz3ca6G1LOQD0tZrrg==", + "version": "1.4.656", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.656.tgz", + "integrity": "sha512-9AQB5eFTHyR3Gvt2t/NwR0le2jBSUNwCnMbUCejFWHD+so4tH40/dRLgoE+jxlPeWS43XJewyvCv+I8LPMl49Q==", "dev": true }, "emittery": { @@ -43662,9 +43660,9 @@ "dev": true }, "node-releases": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", - "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", "dev": true }, "normalize-package-data": { @@ -43837,9 +43835,9 @@ } }, "jsonc-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", - "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", "dev": true }, "lru-cache": { @@ -44554,14 +44552,14 @@ } }, "playwright": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.40.1.tgz", - "integrity": "sha512-2eHI7IioIpQ0bS1Ovg/HszsN/XKNwEG1kbzSDDmADpclKc7CyqkHw7Mg2JCz/bbCxg25QUPcjksoMW7JcIFQmw==", + "version": "1.41.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.41.2.tgz", + "integrity": "sha512-v0bOa6H2GJChDL8pAeLa/LZC4feoAMbSQm1/jF/ySsWWoaNItvrMP7GEkvEEFyCTUYKMxjQKaTSg5up7nR6/8A==", "dev": true, "peer": true, "requires": { "fsevents": "2.3.2", - "playwright-core": "1.40.1" + "playwright-core": "1.41.2" }, "dependencies": { "fsevents": { @@ -44573,9 +44571,9 @@ "peer": true }, "playwright-core": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.40.1.tgz", - "integrity": "sha512-+hkOycxPiV534c4HhpfX6yrlawqVUzITRKwHAmYfmsVreltEl6fAZJ3DPfLMOODw0H3s1Itd6MDCWmP1fl/QvQ==", + "version": "1.41.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.41.2.tgz", + "integrity": "sha512-VaTvwCA4Y8kxEe+kfm2+uUUw5Lubf38RxF7FpBxLPmGe5sdNkSg5e3ChEigaGrX7qdqT3pt2m/98LiyvU2x6CA==", "dev": true, "peer": true } @@ -47782,9 +47780,9 @@ "dev": true }, "update-browserslist-db": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", - "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", "dev": true, "requires": { "escalade": "^3.1.1", @@ -48011,9 +48009,9 @@ } }, "web-vitals": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-3.5.0.tgz", - "integrity": "sha512-f5YnCHVG9Y6uLCePD4tY8bO/Ge15NPEQWtvm3tPzDKygloiqtb4SVqRHBcrIAqo2ztqX5XueqDn97zHF0LdT6w==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-3.5.2.tgz", + "integrity": "sha512-c0rhqNcHXRkY/ogGDJQxZ9Im9D19hDihbzSQJrsioex+KnFgmMzBiy57Z1EjkhX/+OjyBpclDCzz2ITtjokFmg==", "dev": true }, "webidl-conversions": { diff --git a/package.json b/package.json index db1da5181..33609cc20 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "@wordpress/i18n": "^4.41.0", "@wordpress/icons": "^9.38.0", "@wordpress/plugins": "^6.18.0", - "@wordpress/scripts": "^26.19.0", + "@wordpress/scripts": "^27.1.0", "@wordpress/url": "^3.51.0", "@wordpress/wordcount": "^3.50.0", "concurrently": "^8.2.2", From 431e0284c310a410291e13f402a8b997b090cf00 Mon Sep 17 00:00:00 2001 From: Alex Cicovic <23142906+acicovic@users.noreply.github.com> Date: Tue, 16 Jan 2024 11:21:08 +0200 Subject: [PATCH 004/110] Harden User Meta endpoints --- src/Endpoints/class-base-endpoint.php | 13 +++++- .../class-base-endpoint-user-meta.php | 41 ++++++++++++++----- 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/src/Endpoints/class-base-endpoint.php b/src/Endpoints/class-base-endpoint.php index 56cee5495..9eebe8bfc 100644 --- a/src/Endpoints/class-base-endpoint.php +++ b/src/Endpoints/class-base-endpoint.php @@ -11,7 +11,6 @@ namespace Parsely\Endpoints; use Parsely\Parsely; -use WP_REST_Server; use function Parsely\Utils\convert_endpoint_to_filter_key; @@ -70,17 +69,27 @@ abstract class Base_Endpoint { * Constructor. * * @param Parsely $parsely Parsely instance. + * @param bool $enable_capability_filters Whether to allow capability + * filters usage for the endpoint. * * @since 3.2.0 * @since 3.7.0 Added user capability checks based on `is_public_endpoint` attribute. * @since 3.11.0 Moved from Base_Endpoint_Remote into Base_Endpoint. */ - public function __construct( Parsely $parsely ) { + public function __construct( + Parsely $parsely, + bool $enable_capability_filters = true + ) { $this->parsely = $parsely; if ( $this->is_public_endpoint ) { $this->user_capability = null; } else { + if ( false === $enable_capability_filters ) { + // The endpoint doesn't allow capability filters usage. + return; + } + /** * Filter to change the default user capability for all private endpoints. * diff --git a/src/Endpoints/user-meta/class-base-endpoint-user-meta.php b/src/Endpoints/user-meta/class-base-endpoint-user-meta.php index ebea99691..7874a6cc8 100644 --- a/src/Endpoints/user-meta/class-base-endpoint-user-meta.php +++ b/src/Endpoints/user-meta/class-base-endpoint-user-meta.php @@ -43,6 +43,15 @@ abstract class Base_Endpoint_User_Meta extends Base_Endpoint { */ protected $valid_subvalues = array(); + /** + * The current user's ID. + * + * @since 3.14.0 + * + * @var int + */ + protected $current_user_id = 0; + /** * Returns the meta entry's key. * @@ -69,7 +78,7 @@ abstract protected function get_subvalues_specs(): array; * @param Parsely $parsely Parsely instance. */ public function __construct( Parsely $parsely ) { - parent::__construct( $parsely ); + parent::__construct( $parsely, false ); $subvalues_specs = $this->get_subvalues_specs(); @@ -85,6 +94,10 @@ public function __construct( Parsely $parsely ) { * @since 3.13.0 */ public function run(): void { + // Initialize the current user ID here, as doing it in the constructor + // is too early. + $this->current_user_id = get_current_user_id(); + $this->register_endpoint( static::get_route(), 'process_request', @@ -113,15 +126,25 @@ public static function get_route(): string { */ public function process_request( WP_REST_Request $request ): string { $request_method = $request->get_method(); - $user_id = get_current_user_id(); // Update the meta entry's value if the request method is PUT. if ( 'PUT' === $request_method ) { $meta_value = $request->get_json_params(); - $this->set_value( $user_id, $meta_value ); + $this->set_value( $meta_value ); } - return $this->get_value( $user_id ); + return $this->get_value(); + } + + /** + * Checks if the current user is allowed to make the API call. + * + * @since 3.14.0 + * + * @return bool + */ + public function is_user_allowed_to_make_api_call(): bool { + return current_user_can( 'edit_user', $this->current_user_id ); } /** @@ -129,12 +152,11 @@ public function process_request( WP_REST_Request $request ): string { * * @since 3.13.0 * - * @param int $user_id The user ID to which the meta entry is assigned. * @return string The meta entry's value as JSON. */ - protected function get_value( int $user_id ): string { + protected function get_value(): string { $meta_key = $this->get_meta_key(); - $meta_value = get_user_meta( $user_id, $meta_key, true ); + $meta_value = get_user_meta( $this->current_user_id, $meta_key, true ); if ( ! is_array( $meta_value ) || 0 === count( $meta_value ) ) { $meta_value = $this->default_value; @@ -150,15 +172,14 @@ protected function get_value( int $user_id ): string { * * @since 3.13.0 * - * @param int $user_id The user ID to which the meta entry is assigned. * @param array $meta_value The value to set the meta entry to. * @return bool Whether updating the meta entry's value was successful. */ - protected function set_value( int $user_id, array $meta_value ): bool { + protected function set_value( array $meta_value ): bool { $sanitized_value = $this->sanitize_value( $meta_value ); $update_meta = update_user_meta( - $user_id, + $this->current_user_id, $this->get_meta_key(), $sanitized_value ); From c0763648abc678650a101637a4fcea7f0468a77b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 01:48:42 +0000 Subject: [PATCH 005/110] build(deps-dev): bump @types/jest from 29.5.11 to 29.5.12 Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.5.11 to 29.5.12. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6239cbffe..80b5bc61e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "devDependencies": { "@testing-library/jest-dom": "^6.2.0", "@testing-library/react": "^14.1.2", - "@types/jest": "^29.5.11", + "@types/jest": "^29.5.12", "@types/jest-environment-puppeteer": "^5.0.6", "@types/wordpress__block-editor": "^11.5.9", "@types/wordpress__blocks": "^12.5.13", @@ -5431,9 +5431,9 @@ } }, "node_modules/@types/jest": { - "version": "29.5.11", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.11.tgz", - "integrity": "sha512-S2mHmYIVe13vrm6q4kN6fLYYAka15ALQki/vgDC3mIukEOx8WJlv0kQPM+d4w8Gp6u0uSdKND04IlTXBv0rwnQ==", + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", "dev": true, "dependencies": { "expect": "^29.0.0", @@ -31812,9 +31812,9 @@ } }, "@types/jest": { - "version": "29.5.11", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.11.tgz", - "integrity": "sha512-S2mHmYIVe13vrm6q4kN6fLYYAka15ALQki/vgDC3mIukEOx8WJlv0kQPM+d4w8Gp6u0uSdKND04IlTXBv0rwnQ==", + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", "dev": true, "requires": { "expect": "^29.0.0", diff --git a/package.json b/package.json index 33609cc20..cf3e271e3 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "devDependencies": { "@testing-library/jest-dom": "^6.2.0", "@testing-library/react": "^14.1.2", - "@types/jest": "^29.5.11", + "@types/jest": "^29.5.12", "@types/jest-environment-puppeteer": "^5.0.6", "@types/wordpress__block-editor": "^11.5.9", "@types/wordpress__blocks": "^12.5.13", From d5283b8c9e3f75459e8ca40fa582f45cc982d973 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 07:55:01 +0000 Subject: [PATCH 006/110] build(deps-dev): bump @testing-library/react from 14.1.2 to 14.2.1 Bumps [@testing-library/react](https://github.com/testing-library/react-testing-library) from 14.1.2 to 14.2.1. - [Release notes](https://github.com/testing-library/react-testing-library/releases) - [Changelog](https://github.com/testing-library/react-testing-library/blob/main/CHANGELOG.md) - [Commits](https://github.com/testing-library/react-testing-library/compare/v14.1.2...v14.2.1) --- updated-dependencies: - dependency-name: "@testing-library/react" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 80b5bc61e..da7b6b1be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ }, "devDependencies": { "@testing-library/jest-dom": "^6.2.0", - "@testing-library/react": "^14.1.2", + "@testing-library/react": "^14.2.1", "@types/jest": "^29.5.12", "@types/jest-environment-puppeteer": "^5.0.6", "@types/wordpress__block-editor": "^11.5.9", @@ -5166,9 +5166,9 @@ } }, "node_modules/@testing-library/react": { - "version": "14.1.2", - "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.1.2.tgz", - "integrity": "sha512-z4p7DVBTPjKM5qDZ0t5ZjzkpSNb+fZy1u6bzO7kk8oeGagpPCAtgh4cx1syrfp7a+QWkM021jGqjJaxJJnXAZg==", + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.2.1.tgz", + "integrity": "sha512-sGdjws32ai5TLerhvzThYFbpnF9XtL65Cjf+gB0Dhr29BGqK+mAeN7SURSdu+eqgET4ANcWoC7FQpkaiGvBr+A==", "dev": true, "dependencies": { "@babel/runtime": "^7.12.5", @@ -31560,9 +31560,9 @@ } }, "@testing-library/react": { - "version": "14.1.2", - "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.1.2.tgz", - "integrity": "sha512-z4p7DVBTPjKM5qDZ0t5ZjzkpSNb+fZy1u6bzO7kk8oeGagpPCAtgh4cx1syrfp7a+QWkM021jGqjJaxJJnXAZg==", + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.2.1.tgz", + "integrity": "sha512-sGdjws32ai5TLerhvzThYFbpnF9XtL65Cjf+gB0Dhr29BGqK+mAeN7SURSdu+eqgET4ANcWoC7FQpkaiGvBr+A==", "dev": true, "requires": { "@babel/runtime": "^7.12.5", diff --git a/package.json b/package.json index cf3e271e3..9e7fb0bdb 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ }, "devDependencies": { "@testing-library/jest-dom": "^6.2.0", - "@testing-library/react": "^14.1.2", + "@testing-library/react": "^14.2.1", "@types/jest": "^29.5.12", "@types/jest-environment-puppeteer": "^5.0.6", "@types/wordpress__block-editor": "^11.5.9", From 324ab3a7ca3fdfcde6cbd2060893107835fbbe98 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 08:01:59 +0000 Subject: [PATCH 007/110] build(deps-dev): bump @testing-library/jest-dom from 6.2.0 to 6.4.2 Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 6.2.0 to 6.4.2. - [Release notes](https://github.com/testing-library/jest-dom/releases) - [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md) - [Commits](https://github.com/testing-library/jest-dom/compare/v6.2.0...v6.4.2) --- updated-dependencies: - dependency-name: "@testing-library/jest-dom" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 18 +++++++++++------- package.json | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index da7b6b1be..2a39d4aea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "js-cookie": "^3.0.5" }, "devDependencies": { - "@testing-library/jest-dom": "^6.2.0", + "@testing-library/jest-dom": "^6.4.2", "@testing-library/react": "^14.2.1", "@types/jest": "^29.5.12", "@types/jest-environment-puppeteer": "^5.0.6", @@ -5052,9 +5052,9 @@ } }, "node_modules/@testing-library/jest-dom": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.2.0.tgz", - "integrity": "sha512-+BVQlJ9cmEn5RDMUS8c2+TU6giLvzaHZ8sU/x0Jj7fk+6/46wPdwlgOPcpxS17CjcanBi/3VmGMqVr2rmbUmNw==", + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.4.2.tgz", + "integrity": "sha512-CzqH0AFymEMG48CpzXFriYYkOjk6ZGPCLMhW9e9jg3KMCn5OfJecF8GtGW7yGfR/IgCe3SX8BSwjdzI6BBbZLw==", "dev": true, "dependencies": { "@adobe/css-tools": "^4.3.2", @@ -5073,6 +5073,7 @@ }, "peerDependencies": { "@jest/globals": ">= 28", + "@types/bun": "latest", "@types/jest": ">= 28", "jest": ">= 28", "vitest": ">= 0.32" @@ -5081,6 +5082,9 @@ "@jest/globals": { "optional": true }, + "@types/bun": { + "optional": true + }, "@types/jest": { "optional": true }, @@ -31487,9 +31491,9 @@ } }, "@testing-library/jest-dom": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.2.0.tgz", - "integrity": "sha512-+BVQlJ9cmEn5RDMUS8c2+TU6giLvzaHZ8sU/x0Jj7fk+6/46wPdwlgOPcpxS17CjcanBi/3VmGMqVr2rmbUmNw==", + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.4.2.tgz", + "integrity": "sha512-CzqH0AFymEMG48CpzXFriYYkOjk6ZGPCLMhW9e9jg3KMCn5OfJecF8GtGW7yGfR/IgCe3SX8BSwjdzI6BBbZLw==", "dev": true, "requires": { "@adobe/css-tools": "^4.3.2", diff --git a/package.json b/package.json index 9e7fb0bdb..070322957 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "js-cookie": "^3.0.5" }, "devDependencies": { - "@testing-library/jest-dom": "^6.2.0", + "@testing-library/jest-dom": "^6.4.2", "@testing-library/react": "^14.2.1", "@types/jest": "^29.5.12", "@types/jest-environment-puppeteer": "^5.0.6", From 5f87c21785b3866bc90b2afd26de59e250dd249c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 08:11:50 +0000 Subject: [PATCH 008/110] build(deps-dev): bump @typescript-eslint/eslint-plugin (#2188) --- package-lock.json | 262 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 132 insertions(+), 132 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2a39d4aea..3156638d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "@types/wordpress__editor": "^13.6.7", "@types/wordpress__plugins": "^3.0.3", "@types/wordpress__wordcount": "^2.4.5", - "@typescript-eslint/eslint-plugin": "^6.20.0", + "@typescript-eslint/eslint-plugin": "^6.21.0", "@wordpress/api-fetch": "^6.38.0", "@wordpress/babel-preset-default": "^7.32.0", "@wordpress/block-editor": "^12.17.0", @@ -6289,16 +6289,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.20.0.tgz", - "integrity": "sha512-fTwGQUnjhoYHeSF6m5pWNkzmDDdsKELYrOBxhjMrofPqCkoC2k3B2wvGHFxa1CTIqkEn88nlW1HVMztjo2K8Hg==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", + "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.20.0", - "@typescript-eslint/type-utils": "6.20.0", - "@typescript-eslint/utils": "6.20.0", - "@typescript-eslint/visitor-keys": "6.20.0", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/type-utils": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -6324,13 +6324,13 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.20.0.tgz", - "integrity": "sha512-p4rvHQRDTI1tGGMDFQm+GtxP1ZHyAh64WANVoyEcNMpaTFn3ox/3CcgtIlELnRfKzSs/DwYlDccJEtr3O6qBvA==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", + "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.20.0", - "@typescript-eslint/visitor-keys": "6.20.0" + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -6341,9 +6341,9 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.20.0.tgz", - "integrity": "sha512-MM9mfZMAhiN4cOEcUOEx+0HmuaW3WBfukBZPCfwSqFnQy0grXYtngKCqpQN339X3RrwtzspWJrpbrupKYUSBXQ==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -6354,12 +6354,12 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.20.0.tgz", - "integrity": "sha512-E8Cp98kRe4gKHjJD4NExXKz/zOJ1A2hhZc+IMVD6i7w4yjIvh6VyuRI0gRtxAsXtoC35uGMaQ9rjI2zJaXDEAw==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/types": "6.21.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -6449,13 +6449,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.20.0.tgz", - "integrity": "sha512-qnSobiJQb1F5JjN0YDRPHruQTrX7ICsmltXhkV536mp4idGAYrIyr47zF/JmkJtEcAVnIz4gUYJ7gOZa6SmN4g==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", + "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.20.0", - "@typescript-eslint/utils": "6.20.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/utils": "6.21.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -6476,9 +6476,9 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.20.0.tgz", - "integrity": "sha512-MM9mfZMAhiN4cOEcUOEx+0HmuaW3WBfukBZPCfwSqFnQy0grXYtngKCqpQN339X3RrwtzspWJrpbrupKYUSBXQ==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -6489,13 +6489,13 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.20.0.tgz", - "integrity": "sha512-RnRya9q5m6YYSpBN7IzKu9FmLcYtErkDkc8/dKv81I9QiLLtVBHrjz+Ev/crAqgMNW2FCsoZF4g2QUylMnJz+g==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", + "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.20.0", - "@typescript-eslint/visitor-keys": "6.20.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -6517,12 +6517,12 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.20.0.tgz", - "integrity": "sha512-E8Cp98kRe4gKHjJD4NExXKz/zOJ1A2hhZc+IMVD6i7w4yjIvh6VyuRI0gRtxAsXtoC35uGMaQ9rjI2zJaXDEAw==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/types": "6.21.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -6570,9 +6570,9 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -6664,17 +6664,17 @@ "dev": true }, "node_modules/@typescript-eslint/utils": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.20.0.tgz", - "integrity": "sha512-/EKuw+kRu2vAqCoDwDCBtDRU6CTKbUmwwI7SH7AashZ+W+7o8eiyy6V2cdOqN49KsTcASWsC5QeghYuRDTyOOg==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", + "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.20.0", - "@typescript-eslint/types": "6.20.0", - "@typescript-eslint/typescript-estree": "6.20.0", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", "semver": "^7.5.4" }, "engines": { @@ -6689,13 +6689,13 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/scope-manager": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.20.0.tgz", - "integrity": "sha512-p4rvHQRDTI1tGGMDFQm+GtxP1ZHyAh64WANVoyEcNMpaTFn3ox/3CcgtIlELnRfKzSs/DwYlDccJEtr3O6qBvA==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", + "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.20.0", - "@typescript-eslint/visitor-keys": "6.20.0" + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -6706,9 +6706,9 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.20.0.tgz", - "integrity": "sha512-MM9mfZMAhiN4cOEcUOEx+0HmuaW3WBfukBZPCfwSqFnQy0grXYtngKCqpQN339X3RrwtzspWJrpbrupKYUSBXQ==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -6719,13 +6719,13 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.20.0.tgz", - "integrity": "sha512-RnRya9q5m6YYSpBN7IzKu9FmLcYtErkDkc8/dKv81I9QiLLtVBHrjz+Ev/crAqgMNW2FCsoZF4g2QUylMnJz+g==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", + "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.20.0", - "@typescript-eslint/visitor-keys": "6.20.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -6747,12 +6747,12 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.20.0.tgz", - "integrity": "sha512-E8Cp98kRe4gKHjJD4NExXKz/zOJ1A2hhZc+IMVD6i7w4yjIvh6VyuRI0gRtxAsXtoC35uGMaQ9rjI2zJaXDEAw==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/types": "6.21.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -6800,9 +6800,9 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -32621,16 +32621,16 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.20.0.tgz", - "integrity": "sha512-fTwGQUnjhoYHeSF6m5pWNkzmDDdsKELYrOBxhjMrofPqCkoC2k3B2wvGHFxa1CTIqkEn88nlW1HVMztjo2K8Hg==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", + "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", "dev": true, "requires": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.20.0", - "@typescript-eslint/type-utils": "6.20.0", - "@typescript-eslint/utils": "6.20.0", - "@typescript-eslint/visitor-keys": "6.20.0", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/type-utils": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -32640,28 +32640,28 @@ }, "dependencies": { "@typescript-eslint/scope-manager": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.20.0.tgz", - "integrity": "sha512-p4rvHQRDTI1tGGMDFQm+GtxP1ZHyAh64WANVoyEcNMpaTFn3ox/3CcgtIlELnRfKzSs/DwYlDccJEtr3O6qBvA==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", + "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", "dev": true, "requires": { - "@typescript-eslint/types": "6.20.0", - "@typescript-eslint/visitor-keys": "6.20.0" + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" } }, "@typescript-eslint/types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.20.0.tgz", - "integrity": "sha512-MM9mfZMAhiN4cOEcUOEx+0HmuaW3WBfukBZPCfwSqFnQy0grXYtngKCqpQN339X3RrwtzspWJrpbrupKYUSBXQ==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", "dev": true }, "@typescript-eslint/visitor-keys": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.20.0.tgz", - "integrity": "sha512-E8Cp98kRe4gKHjJD4NExXKz/zOJ1A2hhZc+IMVD6i7w4yjIvh6VyuRI0gRtxAsXtoC35uGMaQ9rjI2zJaXDEAw==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", "dev": true, "requires": { - "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/types": "6.21.0", "eslint-visitor-keys": "^3.4.1" } }, @@ -32715,31 +32715,31 @@ } }, "@typescript-eslint/type-utils": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.20.0.tgz", - "integrity": "sha512-qnSobiJQb1F5JjN0YDRPHruQTrX7ICsmltXhkV536mp4idGAYrIyr47zF/JmkJtEcAVnIz4gUYJ7gOZa6SmN4g==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", + "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "6.20.0", - "@typescript-eslint/utils": "6.20.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/utils": "6.21.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, "dependencies": { "@typescript-eslint/types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.20.0.tgz", - "integrity": "sha512-MM9mfZMAhiN4cOEcUOEx+0HmuaW3WBfukBZPCfwSqFnQy0grXYtngKCqpQN339X3RrwtzspWJrpbrupKYUSBXQ==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.20.0.tgz", - "integrity": "sha512-RnRya9q5m6YYSpBN7IzKu9FmLcYtErkDkc8/dKv81I9QiLLtVBHrjz+Ev/crAqgMNW2FCsoZF4g2QUylMnJz+g==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", + "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", "dev": true, "requires": { - "@typescript-eslint/types": "6.20.0", - "@typescript-eslint/visitor-keys": "6.20.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -32749,12 +32749,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.20.0.tgz", - "integrity": "sha512-E8Cp98kRe4gKHjJD4NExXKz/zOJ1A2hhZc+IMVD6i7w4yjIvh6VyuRI0gRtxAsXtoC35uGMaQ9rjI2zJaXDEAw==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", "dev": true, "requires": { - "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/types": "6.21.0", "eslint-visitor-keys": "^3.4.1" } }, @@ -32786,9 +32786,9 @@ } }, "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -32850,44 +32850,44 @@ } }, "@typescript-eslint/utils": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.20.0.tgz", - "integrity": "sha512-/EKuw+kRu2vAqCoDwDCBtDRU6CTKbUmwwI7SH7AashZ+W+7o8eiyy6V2cdOqN49KsTcASWsC5QeghYuRDTyOOg==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", + "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.20.0", - "@typescript-eslint/types": "6.20.0", - "@typescript-eslint/typescript-estree": "6.20.0", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", "semver": "^7.5.4" }, "dependencies": { "@typescript-eslint/scope-manager": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.20.0.tgz", - "integrity": "sha512-p4rvHQRDTI1tGGMDFQm+GtxP1ZHyAh64WANVoyEcNMpaTFn3ox/3CcgtIlELnRfKzSs/DwYlDccJEtr3O6qBvA==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", + "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", "dev": true, "requires": { - "@typescript-eslint/types": "6.20.0", - "@typescript-eslint/visitor-keys": "6.20.0" + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" } }, "@typescript-eslint/types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.20.0.tgz", - "integrity": "sha512-MM9mfZMAhiN4cOEcUOEx+0HmuaW3WBfukBZPCfwSqFnQy0grXYtngKCqpQN339X3RrwtzspWJrpbrupKYUSBXQ==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.20.0.tgz", - "integrity": "sha512-RnRya9q5m6YYSpBN7IzKu9FmLcYtErkDkc8/dKv81I9QiLLtVBHrjz+Ev/crAqgMNW2FCsoZF4g2QUylMnJz+g==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", + "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", "dev": true, "requires": { - "@typescript-eslint/types": "6.20.0", - "@typescript-eslint/visitor-keys": "6.20.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -32897,12 +32897,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.20.0.tgz", - "integrity": "sha512-E8Cp98kRe4gKHjJD4NExXKz/zOJ1A2hhZc+IMVD6i7w4yjIvh6VyuRI0gRtxAsXtoC35uGMaQ9rjI2zJaXDEAw==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", "dev": true, "requires": { - "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/types": "6.21.0", "eslint-visitor-keys": "^3.4.1" } }, @@ -32934,9 +32934,9 @@ } }, "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "requires": { "lru-cache": "^6.0.0" diff --git a/package.json b/package.json index 070322957..46d086bf7 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@types/wordpress__editor": "^13.6.7", "@types/wordpress__plugins": "^3.0.3", "@types/wordpress__wordcount": "^2.4.5", - "@typescript-eslint/eslint-plugin": "^6.20.0", + "@typescript-eslint/eslint-plugin": "^6.21.0", "@wordpress/api-fetch": "^6.38.0", "@wordpress/babel-preset-default": "^7.32.0", "@wordpress/block-editor": "^12.17.0", From 8141965d41eb1ba7c71b85c34bc8416e2a0d9ee6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Feb 2024 01:16:51 +0000 Subject: [PATCH 009/110] build(deps-dev): bump prettier from 3.2.4 to 3.2.5 Bumps [prettier](https://github.com/prettier/prettier) from 3.2.4 to 3.2.5. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.2.4...3.2.5) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3156638d3..d3832568b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ "concurrently": "^8.2.2", "eslint-plugin-jest": "^27.6.3", "husky": "^8.0.3", - "prettier": "^3.2.4", + "prettier": "^3.2.5", "ts-loader": "^9.5.1", "typescript": "^5.3.3" }, @@ -22942,9 +22942,9 @@ } }, "node_modules/prettier": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.4.tgz", - "integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -45003,9 +45003,9 @@ "dev": true }, "prettier": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.4.tgz", - "integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "dev": true }, "prettier-linter-helpers": { diff --git a/package.json b/package.json index 46d086bf7..523cd658a 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "concurrently": "^8.2.2", "eslint-plugin-jest": "^27.6.3", "husky": "^8.0.3", - "prettier": "^3.2.4", + "prettier": "^3.2.5", "ts-loader": "^9.5.1", "typescript": "^5.3.3" }, From 511be1c7e3e4c682fec7e6546db83607d9a26950 Mon Sep 17 00:00:00 2001 From: Alex Cicovic <23142906+acicovic@users.noreply.github.com> Date: Wed, 7 Feb 2024 08:12:28 +0200 Subject: [PATCH 010/110] Base Endpoint class: Refactor access capability code --- src/Endpoints/class-base-api-proxy.php | 13 ++- src/Endpoints/class-base-endpoint.php | 96 ++++++------------- .../class-base-endpoint-user-meta.php | 7 +- .../class-analytics-post-detail-api.php | 18 +++- src/RemoteAPI/class-analytics-posts-api.php | 18 +++- .../class-referrers-post-detail-api.php | 18 +++- src/RemoteAPI/class-related-api.php | 12 ++- src/RemoteAPI/class-remote-api-cache.php | 8 +- src/RemoteAPI/class-validate-api.php | 17 +++- .../class-content-suggestions-base-api.php | 20 +++- .../class-suggest-meta-description-api.php | 9 +- .../class-write-title-api.php | 9 +- src/RemoteAPI/interface-remote-api.php | 7 +- .../class-dashboard-widget.php | 2 +- .../post-list-stats/class-post-list-stats.php | 2 +- 15 files changed, 138 insertions(+), 118 deletions(-) diff --git a/src/Endpoints/class-base-api-proxy.php b/src/Endpoints/class-base-api-proxy.php index 4e8656973..e09bdafa2 100644 --- a/src/Endpoints/class-base-api-proxy.php +++ b/src/Endpoints/class-base-api-proxy.php @@ -68,12 +68,15 @@ abstract protected function generate_data( $response ): array; abstract public function get_items( WP_REST_Request $request ); /** - * Determines if there are enough permissions to call the endpoint. + * Returns whether the endpoint is available for access by the current + * user. + * + * @since 3.14.0 Renamed from `permission_callback()`. * * @return bool */ - public function permission_callback(): bool { - return $this->api->is_user_allowed_to_make_api_call(); + public function is_available_to_current_user(): bool { + return $this->api->is_available_to_current_user(); } /** @@ -115,9 +118,9 @@ protected function register_endpoint( string $endpoint ): void { array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), - 'permission_callback' => array( $this, 'permission_callback' ), + 'permission_callback' => array( $this, 'is_available_to_current_user' ), 'args' => $get_items_args, - 'show_in_index' => $this->permission_callback(), + 'show_in_index' => $this->is_available_to_current_user(), ), ); diff --git a/src/Endpoints/class-base-endpoint.php b/src/Endpoints/class-base-endpoint.php index 9eebe8bfc..9fd161686 100644 --- a/src/Endpoints/class-base-endpoint.php +++ b/src/Endpoints/class-base-endpoint.php @@ -35,14 +35,13 @@ abstract class Base_Endpoint { protected const ENDPOINT = ''; /** - * Indicates whether the endpoint is public or protected behind permissions. + * The default user capability needed to access endpoints. * - * @since 3.7.0 - * @since 3.11.0 Moved from Base_Endpoint_Remote into Base_Endpoint. + * @since 3.14.0 * - * @var bool + * @var string */ - protected $is_public_endpoint = false; + protected const DEFAULT_ACCESS_CAPABILITY = 'publish_posts'; /** * Parsely Instance. @@ -54,42 +53,42 @@ abstract class Base_Endpoint { protected $parsely; /** - * User capability based on which we should allow access to the endpoint. - * - * `null` should be used for all public endpoints. + * Returns whether the endpoint is available for access by the current + * user. * - * @since 3.7.0 - * @since 3.11.0 Moved from Base_Endpoint_Remote into Base_Endpoint. + * @since 3.14.0 Replaced `is_public_endpoint`, `user_capability` and `permission_callback()`. * - * @var string|null + * @return bool */ - protected $user_capability; + abstract public function is_available_to_current_user(): bool; /** * Constructor. * * @param Parsely $parsely Parsely instance. - * @param bool $enable_capability_filters Whether to allow capability - * filters usage for the endpoint. * * @since 3.2.0 * @since 3.7.0 Added user capability checks based on `is_public_endpoint` attribute. * @since 3.11.0 Moved from Base_Endpoint_Remote into Base_Endpoint. + * @since 3.14.0 Moved capability filters functionality outside of the constructor. */ - public function __construct( - Parsely $parsely, - bool $enable_capability_filters = true - ) { + public function __construct( Parsely $parsely ) { $this->parsely = $parsely; + } - if ( $this->is_public_endpoint ) { - $this->user_capability = null; - } else { - if ( false === $enable_capability_filters ) { - // The endpoint doesn't allow capability filters usage. - return; - } - + /** + * Returns the user capability allowing access to the endpoint, after having + * applied capability filters. + * + * `DEFAULT_ACCESS_CAPABILITY` is not passed here by default, to allow for + * a more explicit declaration in child classes. + * + * @since 3.14.0 + * + * @param string $capability The original capability allowing access. + * @return string The capability allowing access after applying the filters. + */ + protected function apply_capability_filters( string $capability ): string { /** * Filter to change the default user capability for all private endpoints. * @@ -97,11 +96,11 @@ public function __construct( */ $default_user_capability = apply_filters( 'wp_parsely_user_capability_for_all_private_apis', - 'publish_posts' + $capability ); /** - * Filter to change the user capability for the specific API endpoint. + * Filter to change the user capability for the specific endpoint. * * @var string */ @@ -110,31 +109,7 @@ public function __construct( $default_user_capability ); - $this->user_capability = $endpoint_specific_user_capability; - } - } - - /** - * Checks if the current user is allowed to make the API call. - * - * @since 3.7.0 - * @since 3.11.0 Moved from Base_Endpoint_Remote into Base_Endpoint. - * - * @return bool - */ - public function is_user_allowed_to_make_api_call(): bool { - // This endpoint does not require any capability checks. - if ( is_null( $this->user_capability ) ) { - return true; - } - - // The user has the required capability to access this endpoint. - // phpcs:ignore WordPress.WP.Capabilities.Undetermined - if ( current_user_can( $this->user_capability ) ) { - return true; - } - - return false; + return $endpoint_specific_user_capability; } /** @@ -173,23 +148,12 @@ public function register_endpoint( array( 'methods' => $methods, 'callback' => array( $this, $callback ), - 'permission_callback' => array( $this, 'permission_callback' ), + 'permission_callback' => array( $this, 'is_available_to_current_user' ), 'args' => $get_items_args, - 'show_in_index' => static::permission_callback(), + 'show_in_index' => static::is_available_to_current_user(), ), ); register_rest_route( 'wp-parsely/v1', $endpoint, $rest_route_args ); } - - /** - * Determines if there are enough permissions to call the endpoint. - * - * @since 3.11.0 Moved from Base_Endpoint_Remote into Base_Endpoint. - * - * @return bool - */ - public function permission_callback(): bool { - return $this->is_user_allowed_to_make_api_call(); - } } diff --git a/src/Endpoints/user-meta/class-base-endpoint-user-meta.php b/src/Endpoints/user-meta/class-base-endpoint-user-meta.php index 7874a6cc8..9cc00a5d1 100644 --- a/src/Endpoints/user-meta/class-base-endpoint-user-meta.php +++ b/src/Endpoints/user-meta/class-base-endpoint-user-meta.php @@ -78,7 +78,7 @@ abstract protected function get_subvalues_specs(): array; * @param Parsely $parsely Parsely instance. */ public function __construct( Parsely $parsely ) { - parent::__construct( $parsely, false ); + parent::__construct( $parsely ); $subvalues_specs = $this->get_subvalues_specs(); @@ -137,13 +137,14 @@ public function process_request( WP_REST_Request $request ): string { } /** - * Checks if the current user is allowed to make the API call. + * Returns whether the endpoint is available for access by the current + * user. * * @since 3.14.0 * * @return bool */ - public function is_user_allowed_to_make_api_call(): bool { + public function is_available_to_current_user(): bool { return current_user_can( 'edit_user', $this->current_user_id ); } diff --git a/src/RemoteAPI/class-analytics-post-detail-api.php b/src/RemoteAPI/class-analytics-post-detail-api.php index 444e7b9b9..a61049920 100644 --- a/src/RemoteAPI/class-analytics-post-detail-api.php +++ b/src/RemoteAPI/class-analytics-post-detail-api.php @@ -10,6 +10,7 @@ namespace Parsely\RemoteAPI; +use Parsely\Endpoints\Base_Endpoint; use Parsely\Parsely; /** @@ -23,10 +24,19 @@ class Analytics_Post_Detail_API extends Base_Endpoint_Remote { protected const QUERY_FILTER = 'wp_parsely_analytics_post_detail_endpoint_args'; /** - * Indicates whether the endpoint is public or protected behind permissions. + * Returns whether the endpoint is available for access by the current + * user. * - * @since 3.7.0 - * @var bool + * @since 3.14.0 + * + * @return bool */ - protected $is_public_endpoint = false; + public function is_available_to_current_user(): bool { + return current_user_can( + // phpcs:ignore WordPress.WP.Capabilities.Undetermined + $this->apply_capability_filters( + Base_Endpoint::DEFAULT_ACCESS_CAPABILITY + ) + ); + } } diff --git a/src/RemoteAPI/class-analytics-posts-api.php b/src/RemoteAPI/class-analytics-posts-api.php index a9e67af74..b1e725e64 100644 --- a/src/RemoteAPI/class-analytics-posts-api.php +++ b/src/RemoteAPI/class-analytics-posts-api.php @@ -10,6 +10,7 @@ namespace Parsely\RemoteAPI; +use Parsely\Endpoints\Base_Endpoint; use Parsely\Parsely; use WP_Error; @@ -60,12 +61,21 @@ class Analytics_Posts_API extends Base_Endpoint_Remote { protected const QUERY_FILTER = 'wp_parsely_analytics_posts_endpoint_args'; /** - * Indicates whether the endpoint is public or protected behind permissions. + * Returns whether the endpoint is available for access by the current + * user. * - * @since 3.7.0 - * @var bool + * @since 3.14.0 + * + * @return bool */ - protected $is_public_endpoint = false; + public function is_available_to_current_user(): bool { + return current_user_can( + // phpcs:ignore WordPress.WP.Capabilities.Undetermined + $this->apply_capability_filters( + Base_Endpoint::DEFAULT_ACCESS_CAPABILITY + ) + ); + } /** * Calls Parse.ly Analytics API to get posts info. diff --git a/src/RemoteAPI/class-referrers-post-detail-api.php b/src/RemoteAPI/class-referrers-post-detail-api.php index bf9c3f2f9..51e91c9ec 100644 --- a/src/RemoteAPI/class-referrers-post-detail-api.php +++ b/src/RemoteAPI/class-referrers-post-detail-api.php @@ -10,6 +10,7 @@ namespace Parsely\RemoteAPI; +use Parsely\Endpoints\Base_Endpoint; use Parsely\Parsely; /** @@ -23,10 +24,19 @@ class Referrers_Post_Detail_API extends Base_Endpoint_Remote { protected const QUERY_FILTER = 'wp_parsely_referrers_post_detail_endpoint_args'; /** - * Indicates whether the endpoint is public or protected behind permissions. + * Returns whether the endpoint is available for access by the current + * user. * - * @since 3.7.0 - * @var bool + * @since 3.14.0 + * + * @return bool */ - protected $is_public_endpoint = false; + public function is_available_to_current_user(): bool { + return current_user_can( + // phpcs:ignore WordPress.WP.Capabilities.Undetermined + $this->apply_capability_filters( + Base_Endpoint::DEFAULT_ACCESS_CAPABILITY + ) + ); + } } diff --git a/src/RemoteAPI/class-related-api.php b/src/RemoteAPI/class-related-api.php index 096e0c4e3..93b47bba2 100644 --- a/src/RemoteAPI/class-related-api.php +++ b/src/RemoteAPI/class-related-api.php @@ -23,10 +23,14 @@ class Related_API extends Base_Endpoint_Remote { protected const QUERY_FILTER = 'wp_parsely_related_endpoint_args'; /** - * Indicates whether the endpoint is public or protected behind permissions. + * Returns whether the endpoint is available for access by the current + * user. * - * @since 3.7.0 - * @var bool + * @since 3.14.0 + * + * @return bool */ - protected $is_public_endpoint = true; + public function is_available_to_current_user(): bool { + return true; + } } diff --git a/src/RemoteAPI/class-remote-api-cache.php b/src/RemoteAPI/class-remote-api-cache.php index 072219bd7..a37e67006 100644 --- a/src/RemoteAPI/class-remote-api-cache.php +++ b/src/RemoteAPI/class-remote-api-cache.php @@ -74,13 +74,15 @@ public function get_items( array $query, bool $associative = false ) { } /** - * Checks if the current user is allowed to make the API call. + * Returns whether the endpoint is available for access by the current + * user. * * @since 3.7.0 + * @since 3.14.0 Renamed from `is_user_allowed_to_make_api_call()`. * * @return bool */ - public function is_user_allowed_to_make_api_call(): bool { - return $this->remote_api->is_user_allowed_to_make_api_call(); + public function is_available_to_current_user(): bool { + return $this->remote_api->is_available_to_current_user(); } } diff --git a/src/RemoteAPI/class-validate-api.php b/src/RemoteAPI/class-validate-api.php index d880ca96c..e7941cff3 100644 --- a/src/RemoteAPI/class-validate-api.php +++ b/src/RemoteAPI/class-validate-api.php @@ -10,6 +10,7 @@ namespace Parsely\RemoteAPI; +use Parsely\Endpoints\Base_Endpoint; use Parsely\Parsely; use WP_Error; @@ -28,13 +29,21 @@ class Validate_API extends Base_Endpoint_Remote { protected const QUERY_FILTER = 'wp_parsely_validate_secret_endpoint_args'; /** - * Indicates whether the endpoint is public or protected behind permissions. + * Returns whether the endpoint is available for access by the current + * user. * - * @since 3.11.0 + * @since 3.14.0 * - * @var bool + * @return bool */ - protected $is_public_endpoint = false; + public function is_available_to_current_user(): bool { + return current_user_can( + // phpcs:ignore WordPress.WP.Capabilities.Undetermined + $this->apply_capability_filters( + Base_Endpoint::DEFAULT_ACCESS_CAPABILITY + ) + ); + } /** * Gets the URL for the Parse.ly API credentials validation endpoint. diff --git a/src/RemoteAPI/content-suggestions/class-content-suggestions-base-api.php b/src/RemoteAPI/content-suggestions/class-content-suggestions-base-api.php index 5bb5cc1ea..e9727437a 100644 --- a/src/RemoteAPI/content-suggestions/class-content-suggestions-base-api.php +++ b/src/RemoteAPI/content-suggestions/class-content-suggestions-base-api.php @@ -10,6 +10,7 @@ namespace Parsely\RemoteAPI\ContentSuggestions; +use Parsely\Endpoints\Base_Endpoint; use Parsely\Parsely; use Parsely\RemoteAPI\Base_Endpoint_Remote; use WP_Error; @@ -21,9 +22,26 @@ * * @phpstan-import-type WP_HTTP_Request_Args from Parsely */ -class Content_Suggestions_Base_API extends Base_Endpoint_Remote { +abstract class Content_Suggestions_Base_API extends Base_Endpoint_Remote { protected const API_BASE_URL = Parsely::PUBLIC_SUGGESTIONS_API_BASE_URL; + /** + * Returns whether the endpoint is available for access by the current + * user. + * + * @since 3.14.0 + * + * @return bool + */ + public function is_available_to_current_user(): bool { + return current_user_can( + // phpcs:ignore WordPress.WP.Capabilities.Undetermined + $this->apply_capability_filters( + Base_Endpoint::DEFAULT_ACCESS_CAPABILITY + ) + ); + } + /** * Returns the request's options for the remote API call. * diff --git a/src/RemoteAPI/content-suggestions/class-suggest-meta-description-api.php b/src/RemoteAPI/content-suggestions/class-suggest-meta-description-api.php index a411c06ea..48191e066 100644 --- a/src/RemoteAPI/content-suggestions/class-suggest-meta-description-api.php +++ b/src/RemoteAPI/content-suggestions/class-suggest-meta-description-api.php @@ -10,6 +10,7 @@ namespace Parsely\RemoteAPI\ContentSuggestions; +use Parsely\Endpoints\Base_Endpoint; use Parsely\Parsely; use WP_Error; @@ -24,14 +25,6 @@ class Suggest_Meta_Description_API extends Content_Suggestions_Base_API { protected const ENDPOINT = '/suggest-meta-description'; protected const QUERY_FILTER = 'wp_parsely_suggest_meta_description_endpoint_args'; - /** - * Indicates whether the endpoint is public or protected behind permissions. - * - * @since 3.13.0 - * @var bool - */ - protected $is_public_endpoint = false; - /** * Gets the meta description for a given content using the Parse.ly * Content Suggestion API. diff --git a/src/RemoteAPI/content-suggestions/class-write-title-api.php b/src/RemoteAPI/content-suggestions/class-write-title-api.php index 2b088a719..5ba66fa34 100644 --- a/src/RemoteAPI/content-suggestions/class-write-title-api.php +++ b/src/RemoteAPI/content-suggestions/class-write-title-api.php @@ -8,6 +8,7 @@ namespace Parsely\RemoteAPI\ContentSuggestions; +use Parsely\Endpoints\Base_Endpoint; use Parsely\Parsely; use WP_Error; @@ -22,14 +23,6 @@ class Write_Title_API extends Content_Suggestions_Base_API { protected const ENDPOINT = '/write-title'; protected const QUERY_FILTER = 'wp_parsely_write_title_endpoint_args'; - /** - * Indicates whether the endpoint is public or protected behind permissions. - * - * @since 3.12.0 - * @var bool - */ - protected $is_public_endpoint = true; - /** * Generates titles for a given content using the Parse.ly * Content Suggestion API. diff --git a/src/RemoteAPI/interface-remote-api.php b/src/RemoteAPI/interface-remote-api.php index 3496390e1..45d42c4e6 100644 --- a/src/RemoteAPI/interface-remote-api.php +++ b/src/RemoteAPI/interface-remote-api.php @@ -27,9 +27,12 @@ interface Remote_API_Interface { public function get_items( array $query, bool $associative = false ); /** - * Checks if the current user is allowed to make the API call. + * Returns whether the endpoint is available for access by the current + * user. + * + * @since 3.14.0 Renamed from `is_user_allowed_to_make_api_call()`. * * @return bool */ - public function is_user_allowed_to_make_api_call(): bool; + public function is_available_to_current_user(): bool; } diff --git a/src/content-helper/dashboard-widget/class-dashboard-widget.php b/src/content-helper/dashboard-widget/class-dashboard-widget.php index e9e39c248..0e4b042a3 100644 --- a/src/content-helper/dashboard-widget/class-dashboard-widget.php +++ b/src/content-helper/dashboard-widget/class-dashboard-widget.php @@ -94,7 +94,7 @@ public function can_enable_widget(): bool { return $this->can_enable_feature( null !== $screen && 'dashboard' === $screen->id, - $posts_api->is_user_allowed_to_make_api_call() + $posts_api->is_available_to_current_user() ); } diff --git a/src/content-helper/post-list-stats/class-post-list-stats.php b/src/content-helper/post-list-stats/class-post-list-stats.php index 401e31d49..76e8c3c86 100644 --- a/src/content-helper/post-list-stats/class-post-list-stats.php +++ b/src/content-helper/post-list-stats/class-post-list-stats.php @@ -123,7 +123,7 @@ public function run(): void { if ( ! $this->can_enable_feature( $this->parsely->site_id_is_set(), $this->parsely->api_secret_is_set(), - $this->analytics_api->is_user_allowed_to_make_api_call() + $this->analytics_api->is_available_to_current_user() ) ) { return; } From 2298ad122f1d6ea34dbbfdffd732bda95dfccd66 Mon Sep 17 00:00:00 2001 From: Alex Cicovic <23142906+acicovic@users.noreply.github.com> Date: Wed, 7 Feb 2024 08:53:01 +0200 Subject: [PATCH 011/110] Update integration tests --- .../Integration/ContentHelperFeatureTest.php | 14 ----- .../AnalyticsPostsProxyEndpointTest.php | 16 +++--- .../DashboardWidgetSettingsEndpointTest.php | 53 ++----------------- .../EditorSidebarSettingsEndpointTest.php | 53 ++----------------- .../ReferrersPostDetailProxyEndpointTest.php | 14 ++--- .../Endpoints/RelatedProxyEndpointTest.php | 4 +- .../StatsPostDetailProxyEndpointTest.php | 12 ++--- tests/Integration/ProxyEndpointTest.php | 4 +- .../RemoteAPI/AnalyticsPostsRemoteAPITest.php | 33 ++++++++---- .../RemoteAPI/RelatedRemoteAPITest.php | 10 ++-- tests/Integration/RemoteAPITest.php | 9 ++-- .../ContentHelperDashboardWidgetTest.php | 4 +- .../ContentHelperPostListStatsTest.php | 4 +- 13 files changed, 73 insertions(+), 157 deletions(-) diff --git a/tests/Integration/ContentHelperFeatureTest.php b/tests/Integration/ContentHelperFeatureTest.php index 520add702..b250e2f86 100644 --- a/tests/Integration/ContentHelperFeatureTest.php +++ b/tests/Integration/ContentHelperFeatureTest.php @@ -105,7 +105,6 @@ function () use ( $feature_filter_value ) { * @covers \Parsely\Content_Helper\Post_List_Stats::is_tracked_as_post_type * @covers \Parsely\Content_Helper\Post_List_Stats::run * @covers \Parsely\Content_Helper\Post_List_Stats::set_current_screen - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call * @uses \Parsely\Parsely::__construct * @uses \Parsely\Parsely::api_secret_is_set * @uses \Parsely\Parsely::get_options @@ -149,7 +148,6 @@ public function test_assets_get_enqueued_by_default(): void { * @covers \Parsely\Content_Helper\Post_List_Stats::is_tracked_as_post_type * @covers \Parsely\Content_Helper\Post_List_Stats::run * @covers \Parsely\Content_Helper\Post_List_Stats::set_current_screen - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call * @uses \Parsely\Parsely::__construct * @uses \Parsely\Parsely::api_secret_is_set * @uses \Parsely\Parsely::get_options @@ -186,7 +184,6 @@ public function test_assets_get_enqueued_when_global_filter_is_true(): void { * @covers \Parsely\Content_Helper\Post_List_Stats::__construct * @covers \Parsely\Content_Helper\Post_List_Stats::get_feature_filter_name * @covers \Parsely\Content_Helper\Post_List_Stats::run - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call * @uses \Parsely\Parsely::__construct * @uses \Parsely\Parsely::api_secret_is_set * @uses \Parsely\Parsely::get_options @@ -223,7 +220,6 @@ public function test_assets_do_not_get_enqueued_when_global_filter_is_false(): v * @covers \Parsely\Content_Helper\Post_List_Stats::__construct * @covers \Parsely\Content_Helper\Post_List_Stats::get_feature_filter_name * @covers \Parsely\Content_Helper\Post_List_Stats::run - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call * @uses \Parsely\Parsely::__construct * @uses \Parsely\Parsely::api_secret_is_set * @uses \Parsely\Parsely::get_options @@ -268,7 +264,6 @@ public function test_assets_do_not_get_enqueued_when_global_filter_is_invalid(): * @covers \Parsely\Content_Helper\Post_List_Stats::is_tracked_as_post_type * @covers \Parsely\Content_Helper\Post_List_Stats::run * @covers \Parsely\Content_Helper\Post_List_Stats::set_current_screen - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call * @uses \Parsely\Parsely::__construct * @uses \Parsely\Parsely::api_secret_is_set * @uses \Parsely\Parsely::get_options @@ -305,7 +300,6 @@ public function test_assets_get_enqueued_when_feature_filter_is_true(): void { * @covers \Parsely\Content_Helper\Post_List_Stats::__construct * @covers \Parsely\Content_Helper\Post_List_Stats::get_feature_filter_name * @covers \Parsely\Content_Helper\Post_List_Stats::run - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call * @uses \Parsely\Parsely::__construct * @uses \Parsely\Parsely::api_secret_is_set * @uses \Parsely\Parsely::get_options @@ -342,7 +336,6 @@ public function test_assets_do_not_get_enqueued_when_feature_filter_is_false(): * @covers \Parsely\Content_Helper\Post_List_Stats::__construct * @covers \Parsely\Content_Helper\Post_List_Stats::get_feature_filter_name * @covers \Parsely\Content_Helper\Post_List_Stats::run - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call * @uses \Parsely\Parsely::__construct * @uses \Parsely\Parsely::api_secret_is_set * @uses \Parsely\Parsely::get_options @@ -386,7 +379,6 @@ public function test_assets_do_not_get_enqueued_when_feature_filter_is_invalid() * @covers \Parsely\Content_Helper\Post_List_Stats::is_tracked_as_post_type * @covers \Parsely\Content_Helper\Post_List_Stats::run * @covers \Parsely\Content_Helper\Post_List_Stats::set_current_screen - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call * @uses \Parsely\Parsely::__construct * @uses \Parsely\Parsely::api_secret_is_set * @uses \Parsely\Parsely::get_options @@ -430,7 +422,6 @@ public function test_assets_get_enqueued_when_both_filters_are_true(): void { * @covers \Parsely\Content_Helper\Post_List_Stats::is_tracked_as_post_type * @covers \Parsely\Content_Helper\Post_List_Stats::run * @covers \Parsely\Content_Helper\Post_List_Stats::set_current_screen - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call * @uses \Parsely\Parsely::__construct * @uses \Parsely\Parsely::api_secret_is_set * @uses \Parsely\Parsely::get_options @@ -467,7 +458,6 @@ public function test_assets_do_not_get_enqueued_when_both_filters_are_false(): v * @covers \Parsely\Content_Helper\Post_List_Stats::__construct * @covers \Parsely\Content_Helper\Post_List_Stats::get_feature_filter_name * @covers \Parsely\Content_Helper\Post_List_Stats::run - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call * @uses \Parsely\Parsely::__construct * @uses \Parsely\Parsely::api_secret_is_set * @uses \Parsely\Parsely::get_options @@ -504,7 +494,6 @@ public function test_assets_do_not_get_enqueued_when_both_filters_are_invalid(): * @covers \Parsely\Content_Helper\Post_List_Stats::__construct * @covers \Parsely\Content_Helper\Post_List_Stats::get_feature_filter_name * @covers \Parsely\Content_Helper\Post_List_Stats::run - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call * @uses \Parsely\Parsely::__construct * @uses \Parsely\Parsely::api_secret_is_set * @uses \Parsely\Parsely::get_options @@ -548,7 +537,6 @@ public function test_assets_do_not_get_enqueued_when_global_filter_is_true_and_f * @covers \Parsely\Content_Helper\Post_List_Stats::is_tracked_as_post_type * @covers \Parsely\Content_Helper\Post_List_Stats::run * @covers \Parsely\Content_Helper\Post_List_Stats::set_current_screen - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call * @uses \Parsely\Parsely::__construct * @uses \Parsely\Parsely::api_secret_is_set * @uses \Parsely\Parsely::get_options @@ -586,7 +574,6 @@ public function test_assets_get_enqueued_when_global_filter_is_false_and_feature * @covers \Parsely\Content_Helper\Post_List_Stats::__construct * @covers \Parsely\Content_Helper\Post_List_Stats::get_feature_filter_name * @covers \Parsely\Content_Helper\Post_List_Stats::run - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call * @uses \Parsely\Parsely::__construct * @uses \Parsely\Parsely::api_secret_is_set * @uses \Parsely\Parsely::get_options @@ -630,7 +617,6 @@ public function test_assets_do_not_get_enqueued_when_global_filter_is_true_and_f * @covers \Parsely\Content_Helper\Post_List_Stats::is_tracked_as_post_type * @covers \Parsely\Content_Helper\Post_List_Stats::run * @covers \Parsely\Content_Helper\Post_List_Stats::set_current_screen - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call * @uses \Parsely\Parsely::__construct * @uses \Parsely\Parsely::api_secret_is_set * @uses \Parsely\Parsely::get_options diff --git a/tests/Integration/Endpoints/AnalyticsPostsProxyEndpointTest.php b/tests/Integration/Endpoints/AnalyticsPostsProxyEndpointTest.php index 5ca71074d..bcd57e272 100644 --- a/tests/Integration/Endpoints/AnalyticsPostsProxyEndpointTest.php +++ b/tests/Integration/Endpoints/AnalyticsPostsProxyEndpointTest.php @@ -73,7 +73,7 @@ public function test_verify_that_route_is_not_registered_when_proxy_is_disabled( * Verifies forbidden error when current user doesn't have proper * capabilities. * - * @covers \Parsely\Endpoints\Base_API_Proxy::permission_callback + * @covers \Parsely\RemoteAPI\Analytics_Posts_API::is_available_to_current_user * @uses \Parsely\Endpoints\Base_API_Proxy::register_endpoint * @uses \Parsely\Endpoints\Analytics_Posts_API_Proxy::register_endpoint */ @@ -103,7 +103,7 @@ public function test_access_of_analytics_posts_endpoint_is_forbidden(): void { * * @covers \Parsely\Endpoints\Analytics_Posts_API_Proxy::get_items * @uses \Parsely\Endpoints\Analytics_Posts_API_Proxy::__construct - * @uses \Parsely\Endpoints\Analytics_Posts_API_Proxy::permission_callback + * @uses \Parsely\Endpoints\Analytics_Posts_API_Proxy::is_available_to_current_user * @uses \Parsely\Endpoints\Analytics_Posts_API_Proxy::run * @uses \Parsely\Parsely::site_id_is_missing * @uses \Parsely\Parsely::site_id_is_set @@ -124,7 +124,7 @@ public function test_get_items_fails_when_site_id_is_not_set(): void { * * @covers \Parsely\Endpoints\Analytics_Posts_API_Proxy::get_items * @uses \Parsely\Endpoints\Analytics_Posts_API_Proxy::__construct - * @uses \Parsely\Endpoints\Analytics_Posts_API_Proxy::permission_callback + * @uses \Parsely\Endpoints\Analytics_Posts_API_Proxy::is_available_to_current_user * @uses \Parsely\Endpoints\Analytics_Posts_API_Proxy::run * @uses \Parsely\Parsely::site_id_is_missing * @uses \Parsely\Parsely::site_id_is_set @@ -142,9 +142,9 @@ public function test_get_items_fails_when_api_secret_is_not_set(): void { /** * Verifies default user capability filter. * - * @covers \Parsely\Endpoints\Analytics_Posts_API_Proxy::permission_callback + * @covers \Parsely\Endpoints\Analytics_Posts_API_Proxy::is_available_to_current_user * @uses \Parsely\Endpoints\Base_Endpoint::__construct - * @uses \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call + * @uses \Parsely\RemoteAPI\Analytics_Posts_API::is_available_to_current_user */ public function test_user_is_allowed_to_make_proxy_api_call_if_default_user_capability_is_changed(): void { parent::run_test_user_is_allowed_to_make_proxy_api_call_if_default_user_capability_is_changed(); @@ -153,9 +153,9 @@ public function test_user_is_allowed_to_make_proxy_api_call_if_default_user_capa /** * Verifies endpoint specific user capability filter. * - * @covers \Parsely\Endpoints\Analytics_Posts_API_Proxy::permission_callback + * @covers \Parsely\Endpoints\Analytics_Posts_API_Proxy::is_available_to_current_user * @uses \Parsely\Endpoints\Base_Endpoint::__construct - * @uses \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call + * @uses \Parsely\RemoteAPI\Analytics_Posts_API::is_available_to_current_user */ public function test_user_is_allowed_to_make_proxy_api_call_if_endpoint_specific_user_capability_is_changed(): void { parent::run_test_user_is_allowed_to_make_proxy_api_call_if_endpoint_specific_user_capability_is_changed( 'analytics_posts' ); @@ -168,7 +168,7 @@ public function test_user_is_allowed_to_make_proxy_api_call_if_endpoint_specific * @covers \Parsely\Endpoints\Analytics_Posts_API_Proxy::get_items * @uses \Parsely\Endpoints\Analytics_Posts_API_Proxy::__construct * @uses \Parsely\Endpoints\Analytics_Posts_API_Proxy::generate_data - * @uses \Parsely\Endpoints\Analytics_Posts_API_Proxy::permission_callback + * @uses \Parsely\Endpoints\Analytics_Posts_API_Proxy::is_available_to_current_user * @uses \Parsely\Endpoints\Analytics_Posts_API_Proxy::run * @uses \Parsely\Endpoints\Base_API_Proxy::get_data * @uses \Parsely\Endpoints\Base_API_Proxy::register_endpoint diff --git a/tests/Integration/Endpoints/DashboardWidgetSettingsEndpointTest.php b/tests/Integration/Endpoints/DashboardWidgetSettingsEndpointTest.php index 390dee873..401781bf1 100644 --- a/tests/Integration/Endpoints/DashboardWidgetSettingsEndpointTest.php +++ b/tests/Integration/Endpoints/DashboardWidgetSettingsEndpointTest.php @@ -66,11 +66,10 @@ public function get_endpoint(): Base_Endpoint_User_Meta { * @covers \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::get_route * @covers \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::run * @uses \Parsely\Endpoints\Base_Endpoint::__construct - * @uses \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call - * @uses \Parsely\Endpoints\Base_Endpoint::permission_callback * @uses \Parsely\Endpoints\Base_Endpoint::register_endpoint * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::__construct * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::get_subvalues_specs + * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::is_available_to_current_user * @uses \Parsely\Endpoints\User_Meta\Dashboard_Widget_Settings_Endpoint::get_subvalues_specs * @uses \Parsely\Parsely::__construct * @uses \Parsely\Parsely::allow_parsely_remote_requests @@ -106,52 +105,10 @@ public function test_register_routes_by_default(): void { * @uses \Parsely\Parsely::set_managed_options * @uses \Parsely\Utils\convert_endpoint_to_filter_key */ - public function test_verify_that_route_is_not_registered_when_proxy_is_disabled(): void { + public function test_verify_that_route_is_not_registered_when_endpoint_is_disabled(): void { parent::run_test_do_not_register_route_when_proxy_is_disabled(); } - /** - * Verifies default user capability filter. - * - * @since 3.13.0 - * - * @covers \Parsely\Endpoints\Base_Endpoint::permission_callback - * @uses \Parsely\Endpoints\Base_Endpoint::__construct - * @uses \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call - * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::__construct - * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::get_subvalues_specs - * @uses \Parsely\Endpoints\User_Meta\Dashboard_Widget_Settings_Endpoint::get_subvalues_specs - * @uses \Parsely\Parsely::__construct - * @uses \Parsely\Parsely::allow_parsely_remote_requests - * @uses \Parsely\Parsely::are_credentials_managed - * @uses \Parsely\Parsely::set_managed_options - * @uses \Parsely\Utils\convert_endpoint_to_filter_key - */ - public function test_user_is_allowed_to_make_proxy_api_call_if_default_user_capability_is_changed(): void { - parent::run_test_user_is_allowed_to_make_proxy_api_call_if_default_user_capability_is_changed(); - } - - /** - * Verifies endpoint specific user capability filter. - * - * @since 3.13.0 - * - * @covers \Parsely\Endpoints\Base_Endpoint::permission_callback - * @uses \Parsely\Endpoints\Base_Endpoint::__construct - * @uses \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call - * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::__construct - * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::get_subvalues_specs - * @uses \Parsely\Endpoints\User_Meta\Dashboard_Widget_Settings_Endpoint::get_subvalues_specs - * @uses \Parsely\Parsely::__construct - * @uses \Parsely\Parsely::allow_parsely_remote_requests - * @uses \Parsely\Parsely::are_credentials_managed - * @uses \Parsely\Parsely::set_managed_options - * @uses \Parsely\Utils\convert_endpoint_to_filter_key - */ - public function test_user_is_allowed_to_make_proxy_api_call_if_endpoint_specific_user_capability_is_changed(): void { - parent::run_test_user_is_allowed_to_make_proxy_api_call_if_endpoint_specific_user_capability_is_changed(); - } - /** * Verifies that the endpoint returns the correct default settings. * @@ -163,9 +120,8 @@ public function test_user_is_allowed_to_make_proxy_api_call_if_endpoint_specific * @covers \Parsely\Endpoints\User_Meta\Dashboard_Widget_Settings_Endpoint::get_subvalues_specs * @covers \Parsely\Endpoints\User_Meta\Dashboard_Widget_Settings_Endpoint::process_request * @uses \Parsely\Endpoints\Base_Endpoint::__construct - * @uses \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call - * @uses \Parsely\Endpoints\Base_Endpoint::permission_callback * @uses \Parsely\Endpoints\Base_Endpoint::register_endpoint + * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::is_available_to_current_user * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::run * @uses \Parsely\Endpoints\User_Meta\Dashboard_Widget_Settings_Endpoint::get_meta_key * @uses \Parsely\Endpoints\User_Meta\Dashboard_Widget_Settings_Endpoint::get_route @@ -195,10 +151,9 @@ public function test_endpoint_returns_value_on_get_request(): void { * @covers \Parsely\Endpoints\User_Meta\Dashboard_Widget_Settings_Endpoint::get_subvalues_specs * @covers \Parsely\Endpoints\User_Meta\Dashboard_Widget_Settings_Endpoint::process_request * @uses \Parsely\Endpoints\Base_Endpoint::__construct - * @uses \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call - * @uses \Parsely\Endpoints\Base_Endpoint::permission_callback * @uses \Parsely\Endpoints\Base_Endpoint::register_endpoint * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::__construct + * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::is_available_to_current_user * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::run * @uses \Parsely\Endpoints\User_Meta\Dashboard_Widget_Settings_Endpoint::get_meta_key * @uses \Parsely\Endpoints\User_Meta\Dashboard_Widget_Settings_Endpoint::get_route diff --git a/tests/Integration/Endpoints/EditorSidebarSettingsEndpointTest.php b/tests/Integration/Endpoints/EditorSidebarSettingsEndpointTest.php index b06fed665..3fdf3d683 100644 --- a/tests/Integration/Endpoints/EditorSidebarSettingsEndpointTest.php +++ b/tests/Integration/Endpoints/EditorSidebarSettingsEndpointTest.php @@ -75,11 +75,10 @@ public function get_endpoint(): Base_Endpoint_User_Meta { * @covers \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::get_route * @covers \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::run * @uses \Parsely\Endpoints\Base_Endpoint::__construct - * @uses \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call - * @uses \Parsely\Endpoints\Base_Endpoint::permission_callback * @uses \Parsely\Endpoints\Base_Endpoint::register_endpoint * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::__construct * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::get_subvalues_specs + * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::is_available_to_current_user * @uses \Parsely\Endpoints\User_Meta\Editor_Sidebar_Settings_Endpoint::get_subvalues_specs * @uses \Parsely\Parsely::__construct * @uses \Parsely\Parsely::allow_parsely_remote_requests @@ -115,52 +114,10 @@ public function test_register_routes_by_default(): void { * @uses \Parsely\Parsely::set_managed_options * @uses \Parsely\Utils\convert_endpoint_to_filter_key */ - public function test_verify_that_route_is_not_registered_when_proxy_is_disabled(): void { + public function test_verify_that_route_is_not_registered_when_endpoint_is_disabled(): void { parent::run_test_do_not_register_route_when_proxy_is_disabled(); } - /** - * Verifies default user capability filter. - * - * @since 3.13.0 - * - * @covers \Parsely\Endpoints\Base_Endpoint::permission_callback - * @uses \Parsely\Endpoints\Base_Endpoint::__construct - * @uses \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call - * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::__construct - * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::get_subvalues_specs - * @uses \Parsely\Endpoints\User_Meta\Editor_Sidebar_Settings_Endpoint::get_subvalues_specs - * @uses \Parsely\Parsely::__construct - * @uses \Parsely\Parsely::allow_parsely_remote_requests - * @uses \Parsely\Parsely::are_credentials_managed - * @uses \Parsely\Parsely::set_managed_options - * @uses \Parsely\Utils\convert_endpoint_to_filter_key - */ - public function test_user_is_allowed_to_make_proxy_api_call_if_default_user_capability_is_changed(): void { - parent::run_test_user_is_allowed_to_make_proxy_api_call_if_default_user_capability_is_changed(); - } - - /** - * Verifies endpoint specific user capability filter. - * - * @since 3.13.0 - * - * @covers \Parsely\Endpoints\Base_Endpoint::permission_callback - * @uses \Parsely\Endpoints\Base_Endpoint::__construct - * @uses \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call - * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::__construct - * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::get_subvalues_specs - * @uses \Parsely\Endpoints\User_Meta\Editor_Sidebar_Settings_Endpoint::get_subvalues_specs - * @uses \Parsely\Parsely::__construct - * @uses \Parsely\Parsely::allow_parsely_remote_requests - * @uses \Parsely\Parsely::are_credentials_managed - * @uses \Parsely\Parsely::set_managed_options - * @uses \Parsely\Utils\convert_endpoint_to_filter_key - */ - public function test_user_is_allowed_to_make_proxy_api_call_if_endpoint_specific_user_capability_is_changed(): void { - parent::run_test_user_is_allowed_to_make_proxy_api_call_if_endpoint_specific_user_capability_is_changed(); - } - /** * Verifies that the endpoint returns the correct default settings. * @@ -172,9 +129,8 @@ public function test_user_is_allowed_to_make_proxy_api_call_if_endpoint_specific * @covers \Parsely\Endpoints\User_Meta\Editor_Sidebar_Settings_Endpoint::get_subvalues_specs * @covers \Parsely\Endpoints\User_Meta\Editor_Sidebar_Settings_Endpoint::process_request * @uses \Parsely\Endpoints\Base_Endpoint::__construct - * @uses \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call - * @uses \Parsely\Endpoints\Base_Endpoint::permission_callback * @uses \Parsely\Endpoints\Base_Endpoint::register_endpoint + * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::is_available_to_current_user * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::run * @uses \Parsely\Endpoints\User_Meta\Editor_Sidebar_Settings_Endpoint::get_meta_key * @uses \Parsely\Endpoints\User_Meta\Editor_Sidebar_Settings_Endpoint::get_route @@ -204,10 +160,9 @@ public function test_endpoint_returns_value_on_get_request(): void { * @covers \Parsely\Endpoints\User_Meta\Editor_Sidebar_Settings_Endpoint::get_subvalues_specs * @covers \Parsely\Endpoints\User_Meta\Editor_Sidebar_Settings_Endpoint::process_request * @uses \Parsely\Endpoints\Base_Endpoint::__construct - * @uses \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call - * @uses \Parsely\Endpoints\Base_Endpoint::permission_callback * @uses \Parsely\Endpoints\Base_Endpoint::register_endpoint * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::__construct + * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::is_available_to_current_user * @uses \Parsely\Endpoints\User_Meta\Base_Endpoint_User_Meta::run * @uses \Parsely\Endpoints\User_Meta\Editor_Sidebar_Settings_Endpoint::get_meta_key * @uses \Parsely\Endpoints\User_Meta\Editor_Sidebar_Settings_Endpoint::get_route diff --git a/tests/Integration/Endpoints/ReferrersPostDetailProxyEndpointTest.php b/tests/Integration/Endpoints/ReferrersPostDetailProxyEndpointTest.php index 03fd94c80..eac7f0429 100644 --- a/tests/Integration/Endpoints/ReferrersPostDetailProxyEndpointTest.php +++ b/tests/Integration/Endpoints/ReferrersPostDetailProxyEndpointTest.php @@ -75,7 +75,7 @@ public function test_verify_that_route_is_not_registered_when_proxy_is_disabled( * @uses \Parsely\Endpoints\Base_API_Proxy::get_data * @uses \Parsely\Endpoints\Base_API_Proxy::register_endpoint * @uses \Parsely\Endpoints\Referrers_Post_Detail_API_Proxy::__construct - * @uses \Parsely\Endpoints\Referrers_Post_Detail_API_Proxy::permission_callback + * @uses \Parsely\Endpoints\Referrers_Post_Detail_API_Proxy::is_available_to_current_user * @uses \Parsely\Endpoints\Referrers_Post_Detail_API_Proxy::run * @uses \Parsely\Parsely::site_id_is_missing * @uses \Parsely\Parsely::site_id_is_set @@ -96,7 +96,7 @@ public function test_get_items_fails_when_site_id_is_not_set(): void { * @uses \Parsely\Endpoints\Base_API_Proxy::get_data * @uses \Parsely\Endpoints\Base_API_Proxy::register_endpoint * @uses \Parsely\Endpoints\Referrers_Post_Detail_API_Proxy::__construct - * @uses \Parsely\Endpoints\Referrers_Post_Detail_API_Proxy::permission_callback + * @uses \Parsely\Endpoints\Referrers_Post_Detail_API_Proxy::is_available_to_current_user * @uses \Parsely\Endpoints\Referrers_Post_Detail_API_Proxy::run * @uses \Parsely\Parsely::site_id_is_missing * @uses \Parsely\Parsely::site_id_is_set @@ -112,9 +112,9 @@ public function test_get_items_fails_when_api_secret_is_not_set(): void { /** * Verifies default user capability filter. * - * @covers \Parsely\Endpoints\Referrers_Post_Detail_API_Proxy::permission_callback + * @covers \Parsely\Endpoints\Referrers_Post_Detail_API_Proxy::is_available_to_current_user * @uses \Parsely\Endpoints\Base_Endpoint::__construct - * @uses \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call + * @uses \Parsely\RemoteAPI\Referrers_Post_Detail_API::is_available_to_current_user */ public function test_user_is_allowed_to_make_proxy_api_call_if_default_user_capability_is_changed(): void { parent::run_test_user_is_allowed_to_make_proxy_api_call_if_default_user_capability_is_changed(); @@ -123,9 +123,9 @@ public function test_user_is_allowed_to_make_proxy_api_call_if_default_user_capa /** * Verifies endpoint specific user capability filter. * - * @covers \Parsely\Endpoints\Referrers_Post_Detail_API_Proxy::permission_callback + * @covers \Parsely\Endpoints\Referrers_Post_Detail_API_Proxy::is_available_to_current_user * @uses \Parsely\Endpoints\Base_Endpoint::__construct - * @uses \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call + * @uses \Parsely\RemoteAPI\Referrers_Post_Detail_API::is_available_to_current_user */ public function test_user_is_allowed_to_make_proxy_api_call_if_endpoint_specific_user_capability_is_changed(): void { parent::run_test_user_is_allowed_to_make_proxy_api_call_if_endpoint_specific_user_capability_is_changed(); @@ -140,7 +140,7 @@ public function test_user_is_allowed_to_make_proxy_api_call_if_endpoint_specific * @uses \Parsely\Endpoints\Base_API_Proxy::register_endpoint * @uses \Parsely\Endpoints\Referrers_Post_Detail_API_Proxy::__construct * @uses \Parsely\Endpoints\Referrers_Post_Detail_API_Proxy::generate_data - * @uses \Parsely\Endpoints\Referrers_Post_Detail_API_Proxy::permission_callback + * @uses \Parsely\Endpoints\Referrers_Post_Detail_API_Proxy::is_available_to_current_user * @uses \Parsely\Endpoints\Referrers_Post_Detail_API_Proxy::run * @uses \Parsely\Parsely::site_id_is_missing * @uses \Parsely\Parsely::site_id_is_set diff --git a/tests/Integration/Endpoints/RelatedProxyEndpointTest.php b/tests/Integration/Endpoints/RelatedProxyEndpointTest.php index e12f954f0..d576f3bc7 100644 --- a/tests/Integration/Endpoints/RelatedProxyEndpointTest.php +++ b/tests/Integration/Endpoints/RelatedProxyEndpointTest.php @@ -74,7 +74,7 @@ public function test_verify_that_route_is_not_registered_when_proxy_is_disabled( * @uses \Parsely\Endpoints\Base_API_Proxy::get_data * @uses \Parsely\Endpoints\Base_API_Proxy::register_endpoint * @uses \Parsely\Endpoints\Related_API_Proxy::__construct - * @uses \Parsely\Endpoints\Related_API_Proxy::permission_callback + * @uses \Parsely\Endpoints\Related_API_Proxy::is_available_to_current_user * @uses \Parsely\Endpoints\Related_API_Proxy::run * @uses \Parsely\Parsely::site_id_is_missing * @uses \Parsely\Parsely::site_id_is_set @@ -94,7 +94,7 @@ public function test_get_items_fails_when_site_id_is_not_set(): void { * @uses \Parsely\Endpoints\Base_API_Proxy::register_endpoint * @uses \Parsely\Endpoints\Related_API_Proxy::__construct * @uses \Parsely\Endpoints\Related_API_Proxy::generate_data - * @uses \Parsely\Endpoints\Related_API_Proxy::permission_callback + * @uses \Parsely\Endpoints\Related_API_Proxy::is_available_to_current_user * @uses \Parsely\Endpoints\Related_API_Proxy::run * @uses \Parsely\Parsely::site_id_is_missing * @uses \Parsely\Parsely::site_id_is_set diff --git a/tests/Integration/Endpoints/StatsPostDetailProxyEndpointTest.php b/tests/Integration/Endpoints/StatsPostDetailProxyEndpointTest.php index dd074eb47..ffcf8c37f 100644 --- a/tests/Integration/Endpoints/StatsPostDetailProxyEndpointTest.php +++ b/tests/Integration/Endpoints/StatsPostDetailProxyEndpointTest.php @@ -75,7 +75,7 @@ public function test_verify_that_route_is_not_registered_when_proxy_is_disabled( * @uses \Parsely\Endpoints\Base_API_Proxy::get_data * @uses \Parsely\Endpoints\Base_API_Proxy::register_endpoint * @uses \Parsely\Endpoints\Analytics_Post_Detail_API_Proxy::__construct - * @uses \Parsely\Endpoints\Analytics_Post_Detail_API_Proxy::permission_callback + * @uses \Parsely\Endpoints\Analytics_Post_Detail_API_Proxy::is_available_to_current_user * @uses \Parsely\Endpoints\Analytics_Post_Detail_API_Proxy::run * @uses \Parsely\Parsely::site_id_is_missing * @uses \Parsely\Parsely::site_id_is_set @@ -96,7 +96,7 @@ public function test_get_items_fails_when_site_id_is_not_set(): void { * @uses \Parsely\Endpoints\Base_API_Proxy::get_data * @uses \Parsely\Endpoints\Base_API_Proxy::register_endpoint * @uses \Parsely\Endpoints\Analytics_Post_Detail_API_Proxy::__construct - * @uses \Parsely\Endpoints\Analytics_Post_Detail_API_Proxy::permission_callback + * @uses \Parsely\Endpoints\Analytics_Post_Detail_API_Proxy::is_available_to_current_user * @uses \Parsely\Endpoints\Analytics_Post_Detail_API_Proxy::run * @uses \Parsely\Parsely::site_id_is_missing * @uses \Parsely\Parsely::site_id_is_set @@ -112,9 +112,8 @@ public function test_get_items_fails_when_api_secret_is_not_set(): void { /** * Verifies default user capability filter. * - * @covers \Parsely\Endpoints\Analytics_Post_Detail_API_Proxy::permission_callback + * @covers \Parsely\Endpoints\Analytics_Post_Detail_API_Proxy::is_available_to_current_user * @uses \Parsely\Endpoints\Base_Endpoint::__construct - * @uses \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call */ public function test_user_is_allowed_to_make_proxy_api_call_if_default_user_capability_is_changed(): void { parent::run_test_user_is_allowed_to_make_proxy_api_call_if_default_user_capability_is_changed(); @@ -123,9 +122,8 @@ public function test_user_is_allowed_to_make_proxy_api_call_if_default_user_capa /** * Verifies endpoint specific user capability filter. * - * @covers \Parsely\Endpoints\Analytics_Post_Detail_API_Proxy::permission_callback + * @covers \Parsely\Endpoints\Analytics_Post_Detail_API_Proxy::is_available_to_current_user * @uses \Parsely\Endpoints\Base_Endpoint::__construct - * @uses \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call */ public function test_user_is_allowed_to_make_proxy_api_call_if_endpoint_specific_user_capability_is_changed(): void { parent::run_test_user_is_allowed_to_make_proxy_api_call_if_endpoint_specific_user_capability_is_changed( 'analytics_post_detail' ); @@ -140,7 +138,7 @@ public function test_user_is_allowed_to_make_proxy_api_call_if_endpoint_specific * @uses \Parsely\Endpoints\Base_API_Proxy::register_endpoint * @uses \Parsely\Endpoints\Analytics_Post_Detail_API_Proxy::__construct * @uses \Parsely\Endpoints\Analytics_Post_Detail_API_Proxy::generate_data - * @uses \Parsely\Endpoints\Analytics_Post_Detail_API_Proxy::permission_callback + * @uses \Parsely\Endpoints\Analytics_Post_Detail_API_Proxy::is_available_to_current_user * @uses \Parsely\Endpoints\Analytics_Post_Detail_API_Proxy::run * @uses \Parsely\Parsely::site_id_is_missing * @uses \Parsely\Parsely::site_id_is_set diff --git a/tests/Integration/ProxyEndpointTest.php b/tests/Integration/ProxyEndpointTest.php index 6d9ccd91c..81a923b67 100644 --- a/tests/Integration/ProxyEndpointTest.php +++ b/tests/Integration/ProxyEndpointTest.php @@ -218,7 +218,7 @@ function () { } ); - self::assertTrue( static::get_endpoint()->permission_callback() ); + self::assertTrue( static::get_endpoint()->is_available_to_current_user() ); } /** @@ -239,6 +239,6 @@ function () { } ); - self::assertTrue( static::get_endpoint()->permission_callback() ); + self::assertTrue( static::get_endpoint()->is_available_to_current_user() ); } } diff --git a/tests/Integration/RemoteAPI/AnalyticsPostsRemoteAPITest.php b/tests/Integration/RemoteAPI/AnalyticsPostsRemoteAPITest.php index e2bd9d989..c3f75b3e3 100644 --- a/tests/Integration/RemoteAPI/AnalyticsPostsRemoteAPITest.php +++ b/tests/Integration/RemoteAPI/AnalyticsPostsRemoteAPITest.php @@ -43,9 +43,14 @@ public function data_api_url(): iterable { /** * Verifies default user capability filter. * - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call - * + * @covers \Parsely\RemoteAPI\Analytics_Posts_API::is_available_to_current_user * @uses \Parsely\Endpoints\Base_Endpoint::__construct + * @uses \Parsely\Endpoints\Base_Endpoint::apply_capability_filters + * @uses \Parsely\Parsely::__construct + * @uses \Parsely\Parsely::allow_parsely_remote_requests + * @uses \Parsely\Parsely::are_credentials_managed + * @uses \Parsely\Parsely::set_managed_options + * @uses \Parsely\Utils\convert_endpoint_to_filter_key */ public function test_user_is_allowed_to_make_api_call_if_default_user_capability_is_changed(): void { $this->login_as_contributor(); @@ -58,15 +63,20 @@ function () { $api = new Analytics_Posts_API( new Parsely() ); - self::assertTrue( $api->is_user_allowed_to_make_api_call() ); + self::assertTrue( $api->is_available_to_current_user() ); } /** * Verifies endpoint specific user capability filter. * - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call - * + * @covers \Parsely\RemoteAPI\Analytics_Posts_API::is_available_to_current_user * @uses \Parsely\Endpoints\Base_Endpoint::__construct + * @uses \Parsely\Endpoints\Base_Endpoint::apply_capability_filters + * @uses \Parsely\Parsely::__construct + * @uses \Parsely\Parsely::allow_parsely_remote_requests + * @uses \Parsely\Parsely::are_credentials_managed + * @uses \Parsely\Parsely::set_managed_options + * @uses \Parsely\Utils\convert_endpoint_to_filter_key */ public function test_user_is_allowed_to_make_api_call_if_endpoint_specific_user_capability_is_changed(): void { $this->login_as_contributor(); @@ -79,15 +89,20 @@ function () { $api = new Analytics_Posts_API( new Parsely() ); - self::assertTrue( $api->is_user_allowed_to_make_api_call() ); + self::assertTrue( $api->is_available_to_current_user() ); } /** * Verifies that the endpoint specific user capability filter has more priority than the default capability filter. * - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call - * + * @covers \Parsely\RemoteAPI\Analytics_Posts_API::is_available_to_current_user * @uses \Parsely\Endpoints\Base_Endpoint::__construct + * @uses \Parsely\Endpoints\Base_Endpoint::apply_capability_filters + * @uses \Parsely\Parsely::__construct + * @uses \Parsely\Parsely::allow_parsely_remote_requests + * @uses \Parsely\Parsely::are_credentials_managed + * @uses \Parsely\Parsely::set_managed_options + * @uses \Parsely\Utils\convert_endpoint_to_filter_key */ public function test_endpoint_specific_user_capability_filter_have_more_priority_than_default(): void { $this->login_as_contributor(); @@ -108,6 +123,6 @@ function () { $api = new Analytics_Posts_API( new Parsely() ); - self::assertTrue( $api->is_user_allowed_to_make_api_call() ); + self::assertTrue( $api->is_available_to_current_user() ); } } diff --git a/tests/Integration/RemoteAPI/RelatedRemoteAPITest.php b/tests/Integration/RemoteAPI/RelatedRemoteAPITest.php index 00382e39a..885e71f0f 100644 --- a/tests/Integration/RemoteAPI/RelatedRemoteAPITest.php +++ b/tests/Integration/RemoteAPI/RelatedRemoteAPITest.php @@ -71,14 +71,18 @@ public function data_api_url(): iterable { /** * Verifies that the endpoint does not have filters that check user capability. * - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call - * + * @covers \Parsely\RemoteAPI\Related_API::is_available_to_current_user * @uses \Parsely\Endpoints\Base_Endpoint::__construct + * @uses \Parsely\Parsely::get_managed_credentials + * @uses \Parsely\Parsely::__construct + * @uses \Parsely\Parsely::allow_parsely_remote_requests + * @uses \Parsely\Parsely::are_credentials_managed + * @uses \Parsely\Parsely::set_managed_options */ public function test_related_endpoint_does_not_have_user_capability_filters(): void { $api = new Related_API( new Parsely() ); - self::assertTrue( $api->is_user_allowed_to_make_api_call() ); + self::assertTrue( $api->is_available_to_current_user() ); $this->assert_wp_hooks_availability( array( 'wp_parsely_user_capability_for_all_private_apis', diff --git a/tests/Integration/RemoteAPITest.php b/tests/Integration/RemoteAPITest.php index 45010be05..086bdd707 100644 --- a/tests/Integration/RemoteAPITest.php +++ b/tests/Integration/RemoteAPITest.php @@ -50,11 +50,12 @@ public static function set_up_before_class(): void { * @dataProvider data_api_url * @covers \Parsely\RemoteAPI\Related_API::get_api_url * @covers \Parsely\RemoteAPI\Analytics_Posts_API::get_api_url - * @uses \Parsely\Parsely::site_id_is_set + * @uses \Parsely\Endpoints\Base_Endpoint::__construct * @uses \Parsely\Parsely::api_secret_is_set - * @uses \Parsely\Parsely::get_site_id + * @uses \Parsely\Parsely::get_managed_credentials * @uses \Parsely\Parsely::get_options - * @uses \Parsely\Endpoints\Base_Endpoint::__construct + * @uses \Parsely\Parsely::get_site_id + * @uses \Parsely\Parsely::site_id_is_set * * @param array $query Test query arguments. * @param string $url Expected generated URL. @@ -70,6 +71,7 @@ public function test_api_url( array $query, string $url ): void { * * @covers \Parsely\RemoteAPI\Remote_API_Cache::get_items * @covers \Parsely\RemoteAPI\Remote_API_Cache::__construct + * @uses \Parsely\RemoteAPI\Base_Endpoint_Remote::get_endpoint */ public function test_remote_api_cache_returns_cached_value(): void { $api_mock = $this->getMockBuilder( get_class( self::$remote_api ) ) @@ -114,6 +116,7 @@ public function test_remote_api_cache_returns_cached_value(): void { * * @covers \Parsely\RemoteAPI\Remote_API_Cache::get_items * @covers \Parsely\RemoteAPI\Remote_API_Cache::__construct + * @uses \Parsely\RemoteAPI\Base_Endpoint_Remote::get_endpoint */ public function test_caching_decorator_returns_uncached_value(): void { $api_mock = $this->getMockBuilder( get_class( self::$remote_api ) ) diff --git a/tests/Integration/content-helper/ContentHelperDashboardWidgetTest.php b/tests/Integration/content-helper/ContentHelperDashboardWidgetTest.php index 393b55f43..13032d131 100644 --- a/tests/Integration/content-helper/ContentHelperDashboardWidgetTest.php +++ b/tests/Integration/content-helper/ContentHelperDashboardWidgetTest.php @@ -87,7 +87,7 @@ protected function assert_enqueued_status( * @covers \Parsely\Content_Helper\Dashboard_Widget::get_script_id * @covers \Parsely\Content_Helper\Dashboard_Widget::get_style_id * @covers \Parsely\Content_Helper\Dashboard_Widget::run - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call + * @covers \Parsely\RemoteAPI\Analytics_Posts_API::is_available_to_current_user * @uses \Parsely\Parsely::__construct * @uses \Parsely\Endpoints\Base_Endpoint::__construct * @uses \Parsely\Utils\convert_endpoint_to_filter_key @@ -115,7 +115,7 @@ public function test_assets_do_not_get_enqueued_when_user_has_not_enough_capabil * @covers \Parsely\Content_Helper\Dashboard_Widget::get_script_id * @covers \Parsely\Content_Helper\Dashboard_Widget::get_style_id * @covers \Parsely\Content_Helper\Dashboard_Widget::run - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call + * @covers \Parsely\RemoteAPI\Analytics_Posts_API::is_available_to_current_user * @uses \Parsely\Parsely::__construct * @uses \Parsely\Endpoints\Base_Endpoint::__construct * @uses \Parsely\Utils\convert_endpoint_to_filter_key diff --git a/tests/Integration/content-helper/ContentHelperPostListStatsTest.php b/tests/Integration/content-helper/ContentHelperPostListStatsTest.php index 7674ed1fd..7070e67eb 100644 --- a/tests/Integration/content-helper/ContentHelperPostListStatsTest.php +++ b/tests/Integration/content-helper/ContentHelperPostListStatsTest.php @@ -113,7 +113,7 @@ protected function assert_enqueued_status( * @covers \Parsely\Content_Helper\Post_List_Stats::__construct * @covers \Parsely\Content_Helper\Post_List_Stats::get_feature_filter_name * @covers \Parsely\Content_Helper\Post_List_Stats::run - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call + * @covers \Parsely\RemoteAPI\Analytics_Posts_API::is_available_to_current_user * @covers \Parsely\Utils\convert_endpoint_to_filter_key * @uses \Parsely\Parsely::__construct * @uses \Parsely\Parsely::api_secret_is_set @@ -143,7 +143,7 @@ public function test_assets_do_not_get_enqueued_when_user_has_not_enough_capabil * @covers \Parsely\Content_Helper\Post_List_Stats::is_tracked_as_post_type * @covers \Parsely\Content_Helper\Post_List_Stats::run * @covers \Parsely\Content_Helper\Post_List_Stats::set_current_screen - * @covers \Parsely\Endpoints\Base_Endpoint::is_user_allowed_to_make_api_call + * @covers \Parsely\RemoteAPI\Analytics_Posts_API::is_available_to_current_user * @covers \Parsely\Utils\convert_endpoint_to_filter_key * @uses \Parsely\Parsely::__construct * @uses \Parsely\Parsely::api_secret_is_set From 8424eed00a1057e023875b7e8c0124b76906af93 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Feb 2024 09:02:22 +0000 Subject: [PATCH 012/110] build(deps-dev): bump @types/wordpress__block-editor (#2195) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index d3832568b..9802a89a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@testing-library/react": "^14.2.1", "@types/jest": "^29.5.12", "@types/jest-environment-puppeteer": "^5.0.6", - "@types/wordpress__block-editor": "^11.5.9", + "@types/wordpress__block-editor": "^11.5.10", "@types/wordpress__blocks": "^12.5.13", "@types/wordpress__components": "^23.0.11", "@types/wordpress__edit-post": "^7.5.5", @@ -5780,9 +5780,9 @@ } }, "node_modules/@types/wordpress__block-editor": { - "version": "11.5.9", - "resolved": "https://registry.npmjs.org/@types/wordpress__block-editor/-/wordpress__block-editor-11.5.9.tgz", - "integrity": "sha512-yIFKaL40j/dDIDOH5hlvlTwwuTqb1SDgVYZQ8v498fAq+tYRQKZCJICpAunSmlMQpxHX1qs1+ZqmljyWvU1p4w==", + "version": "11.5.10", + "resolved": "https://registry.npmjs.org/@types/wordpress__block-editor/-/wordpress__block-editor-11.5.10.tgz", + "integrity": "sha512-+cv7XP9ht3QZJFb59Os9cLlq6TNHTLugeaf+bR3mPGnzlCRXbyHN81TxfSXjhpB6Y8oKFcDUpVlrVRmoJ9QJGQ==", "dev": true, "dependencies": { "@types/react": "*", @@ -32151,9 +32151,9 @@ } }, "@types/wordpress__block-editor": { - "version": "11.5.9", - "resolved": "https://registry.npmjs.org/@types/wordpress__block-editor/-/wordpress__block-editor-11.5.9.tgz", - "integrity": "sha512-yIFKaL40j/dDIDOH5hlvlTwwuTqb1SDgVYZQ8v498fAq+tYRQKZCJICpAunSmlMQpxHX1qs1+ZqmljyWvU1p4w==", + "version": "11.5.10", + "resolved": "https://registry.npmjs.org/@types/wordpress__block-editor/-/wordpress__block-editor-11.5.10.tgz", + "integrity": "sha512-+cv7XP9ht3QZJFb59Os9cLlq6TNHTLugeaf+bR3mPGnzlCRXbyHN81TxfSXjhpB6Y8oKFcDUpVlrVRmoJ9QJGQ==", "dev": true, "requires": { "@types/react": "*", diff --git a/package.json b/package.json index 523cd658a..4938d9bf2 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "@testing-library/react": "^14.2.1", "@types/jest": "^29.5.12", "@types/jest-environment-puppeteer": "^5.0.6", - "@types/wordpress__block-editor": "^11.5.9", + "@types/wordpress__block-editor": "^11.5.10", "@types/wordpress__blocks": "^12.5.13", "@types/wordpress__components": "^23.0.11", "@types/wordpress__edit-post": "^7.5.5", From 13b7af48400951bf103a8e3f00c7e885779ab1c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Feb 2024 16:48:27 +0000 Subject: [PATCH 013/110] build(deps): bump actions/setup-node from 4.0.1 to 4.0.2 (#2199) --- .github/workflows/e2e-tests.yml | 2 +- .github/workflows/node.js.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index b9e3d1755..1202e6e67 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v4 - name: Use desired version of NodeJS - uses: actions/setup-node@v4.0.1 + uses: actions/setup-node@v4.0.2 with: node-version: 16 cache: npm diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 0b7631e8e..8b0bfe79b 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -29,7 +29,7 @@ jobs: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4.0.1 + uses: actions/setup-node@v4.0.2 with: node-version: ${{ matrix.node-version }} cache: npm From c4f2a6f022010697cd65fe4f3a45b32829383c5e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Feb 2024 17:31:24 +0000 Subject: [PATCH 014/110] build(deps-dev): bump husky from 8.0.3 to 9.0.10 (#2190) --- .husky/pre-commit | 3 --- package-lock.json | 18 +++++++++--------- package.json | 4 ++-- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 52a445c12..728606848 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,6 +1,3 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - npm run lint composer cs vendor/bin/phpstan analyse --memory-limit=1G diff --git a/package-lock.json b/package-lock.json index 9802a89a4..dea0fad50 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,7 +49,7 @@ "@wordpress/wordcount": "^3.50.0", "concurrently": "^8.2.2", "eslint-plugin-jest": "^27.6.3", - "husky": "^8.0.3", + "husky": "^9.0.10", "prettier": "^3.2.5", "ts-loader": "^9.5.1", "typescript": "^5.3.3" @@ -15450,15 +15450,15 @@ } }, "node_modules/husky": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", - "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", + "version": "9.0.10", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.10.tgz", + "integrity": "sha512-TQGNknoiy6bURzIO77pPRu+XHi6zI7T93rX+QnJsoYFf3xdjKOur+IlfqzJGMHIK/wXrLg+GsvMs8Op7vI2jVA==", "dev": true, "bin": { - "husky": "lib/bin.js" + "husky": "bin.mjs" }, "engines": { - "node": ">=14" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/typicode" @@ -39462,9 +39462,9 @@ "dev": true }, "husky": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", - "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", + "version": "9.0.10", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.10.tgz", + "integrity": "sha512-TQGNknoiy6bURzIO77pPRu+XHi6zI7T93rX+QnJsoYFf3xdjKOur+IlfqzJGMHIK/wXrLg+GsvMs8Op7vI2jVA==", "dev": true }, "iconv-lite": { diff --git a/package.json b/package.json index 4938d9bf2..7bfa3d2ed 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "@wordpress/wordcount": "^3.50.0", "concurrently": "^8.2.2", "eslint-plugin-jest": "^27.6.3", - "husky": "^8.0.3", + "husky": "^9.0.10", "prettier": "^3.2.5", "ts-loader": "^9.5.1", "typescript": "^5.3.3" @@ -93,7 +93,7 @@ "lint:js": "wp-scripts lint-js", "lint:pkg-json": "wp-scripts lint-pkg-json", "plugin-zip": "wp-scripts plugin-zip", - "prepare": "husky install", + "prepare": "husky", "start": "wp-scripts start", "test": "npm run test:unit", "test:e2e": "wp-scripts test-e2e", From fd32f2e897c2352ee6145721b5d8c953df219d7d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Feb 2024 18:54:04 +0000 Subject: [PATCH 015/110] build(deps-dev): update rector/rector requirement from ^0.19.0 to ^1.0.0 (#2197) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 65d10ae59..765168afa 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "phpstan/phpstan-mockery": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", "phpstan/phpstan": "^1.4", - "rector/rector": "^0.19.0", + "rector/rector": "^1.0.0", "szepeviktor/phpstan-wordpress": "^1.0", "tomasvotruba/type-coverage": "^0.2.0", "yoast/wp-test-utils": "^1" From 4bf9ce729c51455d0f7567044b61ee443da1e4e7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 01:44:00 +0000 Subject: [PATCH 016/110] build(deps-dev): bump @wordpress/url from 3.51.0 to 3.52.0 Bumps [@wordpress/url](https://github.com/WordPress/gutenberg/tree/HEAD/packages/url) from 3.51.0 to 3.52.0. - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/url/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/url@3.52.0/packages/url) --- updated-dependencies: - dependency-name: "@wordpress/url" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index dea0fad50..73b67e247 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ "@wordpress/icons": "^9.38.0", "@wordpress/plugins": "^6.18.0", "@wordpress/scripts": "^27.1.0", - "@wordpress/url": "^3.51.0", + "@wordpress/url": "^3.52.0", "@wordpress/wordcount": "^3.50.0", "concurrently": "^8.2.2", "eslint-plugin-jest": "^27.6.3", @@ -9109,9 +9109,9 @@ } }, "node_modules/@wordpress/url": { - "version": "3.51.0", - "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-3.51.0.tgz", - "integrity": "sha512-OjucjlP1763gfKbe8lv/k3RCisyX8AfNBrhASk7JqxAj6rFhb1ZZO7YmAgB2m+WoGB5v7fkOli0FZyDqISdYyg==", + "version": "3.52.0", + "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-3.52.0.tgz", + "integrity": "sha512-LkKQT7Hv+7ekCQ8fjDg2CK2FUtQhnzI/1PSCcmuL9guxsrQBKoiQFoGvsTUfXC4TtlkyV/gI/iB0zfoyq5t1Gg==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", @@ -34719,9 +34719,9 @@ } }, "@wordpress/url": { - "version": "3.51.0", - "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-3.51.0.tgz", - "integrity": "sha512-OjucjlP1763gfKbe8lv/k3RCisyX8AfNBrhASk7JqxAj6rFhb1ZZO7YmAgB2m+WoGB5v7fkOli0FZyDqISdYyg==", + "version": "3.52.0", + "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-3.52.0.tgz", + "integrity": "sha512-LkKQT7Hv+7ekCQ8fjDg2CK2FUtQhnzI/1PSCcmuL9guxsrQBKoiQFoGvsTUfXC4TtlkyV/gI/iB0zfoyq5t1Gg==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", diff --git a/package.json b/package.json index 7bfa3d2ed..d30cfe158 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "@wordpress/icons": "^9.38.0", "@wordpress/plugins": "^6.18.0", "@wordpress/scripts": "^27.1.0", - "@wordpress/url": "^3.51.0", + "@wordpress/url": "^3.52.0", "@wordpress/wordcount": "^3.50.0", "concurrently": "^8.2.2", "eslint-plugin-jest": "^27.6.3", From da463aad1316c445f8bf4dc3cea06c3c03585bc1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 08:27:48 +0000 Subject: [PATCH 017/110] build(deps-dev): bump @wordpress/e2e-test-utils from 10.21.0 to 10.22.0 (#2205) --- package-lock.json | 90 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/package-lock.json b/package-lock.json index 73b67e247..f4fe0c193 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "@wordpress/compose": "^6.18.0", "@wordpress/core-data": "^6.26.0", "@wordpress/data": "^9.19.0", - "@wordpress/e2e-test-utils": "^10.21.0", + "@wordpress/e2e-test-utils": "^10.22.0", "@wordpress/edit-post": "^7.24.0", "@wordpress/editor": "^13.27.2", "@wordpress/element": "^5.25.0", @@ -7060,14 +7060,14 @@ } }, "node_modules/@wordpress/api-fetch": { - "version": "6.47.0", - "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-6.47.0.tgz", - "integrity": "sha512-NA/jWDXoVtJmiVBYhlxts2UrgKJpJM+zTGzLCfRQCZUzpJYm3LonB8x+uCQ78nEyxCY397Esod3jnbquYjOr0Q==", + "version": "6.48.0", + "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-6.48.0.tgz", + "integrity": "sha512-Yo9kpwf07OXt/xV82EfYlnR4Dl6T/VnhKbo0wtmOO7fLxhfOrF0rFgJM4X78WEWBYcjnGwQD5c5ufad7X5XK1A==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/url": "^3.51.0" + "@wordpress/i18n": "^4.51.0", + "@wordpress/url": "^3.52.0" }, "engines": { "node": ">=12" @@ -7741,15 +7741,15 @@ } }, "node_modules/@wordpress/e2e-test-utils": { - "version": "10.21.0", - "resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils/-/e2e-test-utils-10.21.0.tgz", - "integrity": "sha512-Oh62GkqAKBIyD0IO3/Oa0l42yL/jbpTRDyh8H+t6gZbHWYTDvEGEr/LOqI9bk5Lwk7Jt5jpN6136FDwyMzHSXw==", + "version": "10.22.0", + "resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils/-/e2e-test-utils-10.22.0.tgz", + "integrity": "sha512-y+JWxgHuTgRwomApfbgHyDj//iYFuerL7BwoxYAfA/dk59C10H3nfqRPxtrca1vh1249e5w76xOM+Y353BleJg==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/api-fetch": "^6.47.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/url": "^3.51.0", + "@wordpress/api-fetch": "^6.48.0", + "@wordpress/keycodes": "^3.51.0", + "@wordpress/url": "^3.52.0", "change-case": "^4.1.2", "form-data": "^4.0.0", "node-fetch": "^2.6.0" @@ -8131,9 +8131,9 @@ } }, "node_modules/@wordpress/hooks": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.50.0.tgz", - "integrity": "sha512-YIhwT1y0ss7Byfz46NBx08EUmXzWMu+g5DCY7FMuDNhwxSEoZMB8edKMiwNmFk4mFKBCnXM1d5FeONUPIUkJwg==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.51.0.tgz", + "integrity": "sha512-u//qLJCfgmGBLEdAtZx5C1KzmhcCYDIk46feYGBR9DHB1/fqdvMpxc20un62i8QgYvJyF7GChmerkPbssa6a8w==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -8155,13 +8155,13 @@ } }, "node_modules/@wordpress/i18n": { - "version": "4.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-4.50.0.tgz", - "integrity": "sha512-FkA2se6HMQm4eFC+/kTWvWQqs51VxpZuvY2MlWUp/L1r1d/dMBHXu049x86+/+6yk3ZNqiK5h6j6Z76dvPHZ4w==", + "version": "4.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-4.51.0.tgz", + "integrity": "sha512-JiMEstT98R1e4bgI8DA+XVCXUSis/6eZ7+RF5nHuDiseIyQ68B2D2FzYoEFaw/zaVebvtWA0lZ8HbHihgsSVPQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/hooks": "^3.50.0", + "@wordpress/hooks": "^3.51.0", "gettext-parser": "^1.3.1", "memize": "^2.1.0", "sprintf-js": "^1.1.1", @@ -8295,13 +8295,13 @@ } }, "node_modules/@wordpress/keycodes": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-3.50.0.tgz", - "integrity": "sha512-ykWpyCbgwcaT8i5kSfotYtd2oOHyMDpWEYR73InYrzEhl7pnS3wD7hi/KfeKLvMfYhbysUXlCVr6q/oH+qK/DQ==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-3.51.0.tgz", + "integrity": "sha512-wudlftpjZ/2tZ2gKY7w2m7BG4LBhmEvDn2K48IbTcMtEyFJidIB0IFpT+skR1aFhIekGDZ7W8UXPQVbjwbWhwA==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/i18n": "^4.50.0" + "@wordpress/i18n": "^4.51.0" }, "engines": { "node": ">=12" @@ -33154,14 +33154,14 @@ } }, "@wordpress/api-fetch": { - "version": "6.47.0", - "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-6.47.0.tgz", - "integrity": "sha512-NA/jWDXoVtJmiVBYhlxts2UrgKJpJM+zTGzLCfRQCZUzpJYm3LonB8x+uCQ78nEyxCY397Esod3jnbquYjOr0Q==", + "version": "6.48.0", + "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-6.48.0.tgz", + "integrity": "sha512-Yo9kpwf07OXt/xV82EfYlnR4Dl6T/VnhKbo0wtmOO7fLxhfOrF0rFgJM4X78WEWBYcjnGwQD5c5ufad7X5XK1A==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/url": "^3.51.0" + "@wordpress/i18n": "^4.51.0", + "@wordpress/url": "^3.52.0" } }, "@wordpress/autop": { @@ -33696,15 +33696,15 @@ } }, "@wordpress/e2e-test-utils": { - "version": "10.21.0", - "resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils/-/e2e-test-utils-10.21.0.tgz", - "integrity": "sha512-Oh62GkqAKBIyD0IO3/Oa0l42yL/jbpTRDyh8H+t6gZbHWYTDvEGEr/LOqI9bk5Lwk7Jt5jpN6136FDwyMzHSXw==", + "version": "10.22.0", + "resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils/-/e2e-test-utils-10.22.0.tgz", + "integrity": "sha512-y+JWxgHuTgRwomApfbgHyDj//iYFuerL7BwoxYAfA/dk59C10H3nfqRPxtrca1vh1249e5w76xOM+Y353BleJg==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/api-fetch": "^6.47.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/url": "^3.51.0", + "@wordpress/api-fetch": "^6.48.0", + "@wordpress/keycodes": "^3.51.0", + "@wordpress/url": "^3.52.0", "change-case": "^4.1.2", "form-data": "^4.0.0", "node-fetch": "^2.6.0" @@ -33991,9 +33991,9 @@ } }, "@wordpress/hooks": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.50.0.tgz", - "integrity": "sha512-YIhwT1y0ss7Byfz46NBx08EUmXzWMu+g5DCY7FMuDNhwxSEoZMB8edKMiwNmFk4mFKBCnXM1d5FeONUPIUkJwg==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.51.0.tgz", + "integrity": "sha512-u//qLJCfgmGBLEdAtZx5C1KzmhcCYDIk46feYGBR9DHB1/fqdvMpxc20un62i8QgYvJyF7GChmerkPbssa6a8w==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" @@ -34009,13 +34009,13 @@ } }, "@wordpress/i18n": { - "version": "4.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-4.50.0.tgz", - "integrity": "sha512-FkA2se6HMQm4eFC+/kTWvWQqs51VxpZuvY2MlWUp/L1r1d/dMBHXu049x86+/+6yk3ZNqiK5h6j6Z76dvPHZ4w==", + "version": "4.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-4.51.0.tgz", + "integrity": "sha512-JiMEstT98R1e4bgI8DA+XVCXUSis/6eZ7+RF5nHuDiseIyQ68B2D2FzYoEFaw/zaVebvtWA0lZ8HbHihgsSVPQ==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/hooks": "^3.50.0", + "@wordpress/hooks": "^3.51.0", "gettext-parser": "^1.3.1", "memize": "^2.1.0", "sprintf-js": "^1.1.1", @@ -34108,13 +34108,13 @@ } }, "@wordpress/keycodes": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-3.50.0.tgz", - "integrity": "sha512-ykWpyCbgwcaT8i5kSfotYtd2oOHyMDpWEYR73InYrzEhl7pnS3wD7hi/KfeKLvMfYhbysUXlCVr6q/oH+qK/DQ==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-3.51.0.tgz", + "integrity": "sha512-wudlftpjZ/2tZ2gKY7w2m7BG4LBhmEvDn2K48IbTcMtEyFJidIB0IFpT+skR1aFhIekGDZ7W8UXPQVbjwbWhwA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/i18n": "^4.50.0" + "@wordpress/i18n": "^4.51.0" } }, "@wordpress/media-utils": { diff --git a/package.json b/package.json index d30cfe158..59a4db849 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "@wordpress/compose": "^6.18.0", "@wordpress/core-data": "^6.26.0", "@wordpress/data": "^9.19.0", - "@wordpress/e2e-test-utils": "^10.21.0", + "@wordpress/e2e-test-utils": "^10.22.0", "@wordpress/edit-post": "^7.24.0", "@wordpress/editor": "^13.27.2", "@wordpress/element": "^5.25.0", From 5ca49f1ada2a261634f9f395217025a99e3e5cf6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 08:39:50 +0000 Subject: [PATCH 018/110] build(deps-dev): bump @wordpress/icons from 9.41.0 to 9.42.0 (#2203) --- package-lock.json | 66 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/package-lock.json b/package-lock.json index f4fe0c193..2c3317cd4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,7 @@ "@wordpress/eslint-plugin": "^17.7.0", "@wordpress/hooks": "^3.41.0", "@wordpress/i18n": "^4.41.0", - "@wordpress/icons": "^9.38.0", + "@wordpress/icons": "^9.42.0", "@wordpress/plugins": "^6.18.0", "@wordpress/scripts": "^27.1.0", "@wordpress/url": "^3.52.0", @@ -7937,15 +7937,15 @@ } }, "node_modules/@wordpress/element": { - "version": "5.27.0", - "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-5.27.0.tgz", - "integrity": "sha512-IA5LTAfx5bDNXULPmctcNb/04i4JcnIReG0RAuPgrZ8lbMZWUxGFymh10PEQjs7ZJ++qGsI6E+6JISpjkRaDQQ==", + "version": "5.28.0", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-5.28.0.tgz", + "integrity": "sha512-NEoT3mgF+pJvnhnaTQeLuhSgC6ThfooMfl7OoEyIthRZpUtgKFakmMUU2T6ODzP2+k2DV/jNCfoBZ/Haekmwew==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", "@types/react": "^18.0.21", "@types/react-dom": "^18.0.6", - "@wordpress/escape-html": "^2.50.0", + "@wordpress/escape-html": "^2.51.0", "change-case": "^4.1.2", "is-plain-object": "^5.0.0", "react": "^18.2.0", @@ -8049,9 +8049,9 @@ } }, "node_modules/@wordpress/escape-html": { - "version": "2.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/escape-html/-/escape-html-2.50.0.tgz", - "integrity": "sha512-hBvoMCEZocziZDGCmBanSO+uupnd054mxd7FQ6toQ4UnsZ4JwXSmEC72W2Ed+cRGB1DeJDD0dY9iC0b4xkumsQ==", + "version": "2.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/escape-html/-/escape-html-2.51.0.tgz", + "integrity": "sha512-sDDSyctW5yON2IaEkaMGIfk2LiQ3Jpz8xAnElKjKpnFhbHQBIG2B2NS2UQ5DzsPGZrfCPHt13E20fGwWj+lthw==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -8175,14 +8175,14 @@ } }, "node_modules/@wordpress/icons": { - "version": "9.41.0", - "resolved": "https://registry.npmjs.org/@wordpress/icons/-/icons-9.41.0.tgz", - "integrity": "sha512-L4fp9ZdxGBpMk3o2YqABgiPHNoHyu9Enid7JNkCdWP8iUgk7dEiDvo/XoiWPTAeNbF6W8Nqu54635mq01es0NQ==", + "version": "9.42.0", + "resolved": "https://registry.npmjs.org/@wordpress/icons/-/icons-9.42.0.tgz", + "integrity": "sha512-hOLLSsjWFjqV/drgKY2r5wica9dzaqmFcwfB3V/QQAEKrFR3CG2atskDWBRqFfHQIH8nNxSceoGl8PJjiEvi/g==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/element": "^5.27.0", - "@wordpress/primitives": "^3.48.0" + "@wordpress/element": "^5.28.0", + "@wordpress/primitives": "^3.49.0" }, "engines": { "node": ">=12" @@ -8485,13 +8485,13 @@ } }, "node_modules/@wordpress/primitives": { - "version": "3.48.0", - "resolved": "https://registry.npmjs.org/@wordpress/primitives/-/primitives-3.48.0.tgz", - "integrity": "sha512-uBoMxpl+FiZF6aRXH/+Hwol4EAL6QqlNSaGF1IzEwklFzdRF1m5wTM4vh21w8Bq7lgxiuAqyueY7X5u32v+zPw==", + "version": "3.49.0", + "resolved": "https://registry.npmjs.org/@wordpress/primitives/-/primitives-3.49.0.tgz", + "integrity": "sha512-ekcL5fcrEiKOT8pTdi74k+zm7dRBpGW7bPw5bmI8jeJiDNR8HxCLpJQn2O3kI0QK5MenelNJS0j74QKO5noLxw==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/element": "^5.27.0", + "@wordpress/element": "^5.28.0", "classnames": "^2.3.1" }, "engines": { @@ -33853,15 +33853,15 @@ } }, "@wordpress/element": { - "version": "5.27.0", - "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-5.27.0.tgz", - "integrity": "sha512-IA5LTAfx5bDNXULPmctcNb/04i4JcnIReG0RAuPgrZ8lbMZWUxGFymh10PEQjs7ZJ++qGsI6E+6JISpjkRaDQQ==", + "version": "5.28.0", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-5.28.0.tgz", + "integrity": "sha512-NEoT3mgF+pJvnhnaTQeLuhSgC6ThfooMfl7OoEyIthRZpUtgKFakmMUU2T6ODzP2+k2DV/jNCfoBZ/Haekmwew==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", "@types/react": "^18.0.21", "@types/react-dom": "^18.0.6", - "@wordpress/escape-html": "^2.50.0", + "@wordpress/escape-html": "^2.51.0", "change-case": "^4.1.2", "is-plain-object": "^5.0.0", "react": "^18.2.0", @@ -33940,9 +33940,9 @@ } }, "@wordpress/escape-html": { - "version": "2.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/escape-html/-/escape-html-2.50.0.tgz", - "integrity": "sha512-hBvoMCEZocziZDGCmBanSO+uupnd054mxd7FQ6toQ4UnsZ4JwXSmEC72W2Ed+cRGB1DeJDD0dY9iC0b4xkumsQ==", + "version": "2.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/escape-html/-/escape-html-2.51.0.tgz", + "integrity": "sha512-sDDSyctW5yON2IaEkaMGIfk2LiQ3Jpz8xAnElKjKpnFhbHQBIG2B2NS2UQ5DzsPGZrfCPHt13E20fGwWj+lthw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" @@ -34023,14 +34023,14 @@ } }, "@wordpress/icons": { - "version": "9.41.0", - "resolved": "https://registry.npmjs.org/@wordpress/icons/-/icons-9.41.0.tgz", - "integrity": "sha512-L4fp9ZdxGBpMk3o2YqABgiPHNoHyu9Enid7JNkCdWP8iUgk7dEiDvo/XoiWPTAeNbF6W8Nqu54635mq01es0NQ==", + "version": "9.42.0", + "resolved": "https://registry.npmjs.org/@wordpress/icons/-/icons-9.42.0.tgz", + "integrity": "sha512-hOLLSsjWFjqV/drgKY2r5wica9dzaqmFcwfB3V/QQAEKrFR3CG2atskDWBRqFfHQIH8nNxSceoGl8PJjiEvi/g==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/element": "^5.27.0", - "@wordpress/primitives": "^3.48.0" + "@wordpress/element": "^5.28.0", + "@wordpress/primitives": "^3.49.0" } }, "@wordpress/interactivity": { @@ -34247,13 +34247,13 @@ "requires": {} }, "@wordpress/primitives": { - "version": "3.48.0", - "resolved": "https://registry.npmjs.org/@wordpress/primitives/-/primitives-3.48.0.tgz", - "integrity": "sha512-uBoMxpl+FiZF6aRXH/+Hwol4EAL6QqlNSaGF1IzEwklFzdRF1m5wTM4vh21w8Bq7lgxiuAqyueY7X5u32v+zPw==", + "version": "3.49.0", + "resolved": "https://registry.npmjs.org/@wordpress/primitives/-/primitives-3.49.0.tgz", + "integrity": "sha512-ekcL5fcrEiKOT8pTdi74k+zm7dRBpGW7bPw5bmI8jeJiDNR8HxCLpJQn2O3kI0QK5MenelNJS0j74QKO5noLxw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/element": "^5.27.0", + "@wordpress/element": "^5.28.0", "classnames": "^2.3.1" } }, diff --git a/package.json b/package.json index 59a4db849..9f327d786 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "@wordpress/eslint-plugin": "^17.7.0", "@wordpress/hooks": "^3.41.0", "@wordpress/i18n": "^4.41.0", - "@wordpress/icons": "^9.38.0", + "@wordpress/icons": "^9.42.0", "@wordpress/plugins": "^6.18.0", "@wordpress/scripts": "^27.1.0", "@wordpress/url": "^3.52.0", From 5c5f84effdb906ab915145ec7ad67d7d07dd87d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 08:41:50 +0000 Subject: [PATCH 019/110] build(deps-dev): bump @wordpress/components from 25.16.0 to 26.0.0 Bumps [@wordpress/components](https://github.com/WordPress/gutenberg/tree/HEAD/packages/components) from 25.16.0 to 26.0.0. - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/components/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/components@26.0.0/packages/components) --- updated-dependencies: - dependency-name: "@wordpress/components" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 2203 +++++++++++++++++++++++++++++++++++++++++---- package.json | 2 +- 2 files changed, 2039 insertions(+), 166 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2c3317cd4..1692b944e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,7 +30,7 @@ "@wordpress/babel-preset-default": "^7.32.0", "@wordpress/block-editor": "^12.17.0", "@wordpress/blocks": "^12.26.0", - "@wordpress/components": "^25.7.0", + "@wordpress/components": "^26.0.0", "@wordpress/compose": "^6.18.0", "@wordpress/core-data": "^6.26.0", "@wordpress/data": "^9.19.0", @@ -7046,14 +7046,14 @@ } }, "node_modules/@wordpress/a11y": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/a11y/-/a11y-3.50.0.tgz", - "integrity": "sha512-eQiPGnxqiL1LgnHztFG0RGSFZ5phwR8B8Fr4lbJsFalsc9R/tOcjewvf2KN0yi2UlRA5ssAeiTP+tYmeAqtOHQ==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/a11y/-/a11y-3.51.0.tgz", + "integrity": "sha512-sq7dflOxrSAvtEb7Ae1VmLyEYESlRlrwCBrWeAyYwekQ08Da1ph7EyvYMM1Yoq7xCbnLpPvAt/oGO05Mhkv2dg==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/dom-ready": "^3.50.0", - "@wordpress/i18n": "^4.50.0" + "@wordpress/dom-ready": "^3.51.0", + "@wordpress/i18n": "^4.51.0" }, "engines": { "node": ">=12" @@ -7227,6 +7227,71 @@ "react-dom": "^18.0.0" } }, + "node_modules/@wordpress/block-editor/node_modules/@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "dependencies": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, "node_modules/@wordpress/block-editor/node_modules/@wordpress/private-apis": { "version": "0.32.0", "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", @@ -7239,6 +7304,19 @@ "node": ">=12" } }, + "node_modules/@wordpress/block-editor/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@wordpress/block-library": { "version": "8.24.0", "resolved": "https://registry.npmjs.org/@wordpress/block-library/-/block-library-8.24.0.tgz", @@ -7294,6 +7372,83 @@ "react-dom": "^18.0.0" } }, + "node_modules/@wordpress/block-library/node_modules/@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "dependencies": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, + "node_modules/@wordpress/block-library/node_modules/@wordpress/components/node_modules/@wordpress/private-apis": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.16.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@wordpress/block-library/node_modules/uuid": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", @@ -7427,7 +7582,7 @@ "react-dom": "^18.0.0" } }, - "node_modules/@wordpress/components": { + "node_modules/@wordpress/commands/node_modules/@wordpress/components": { "version": "25.16.0", "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", @@ -7492,7 +7647,7 @@ "react-dom": "^18.0.0" } }, - "node_modules/@wordpress/components/node_modules/@wordpress/private-apis": { + "node_modules/@wordpress/commands/node_modules/@wordpress/components/node_modules/@wordpress/private-apis": { "version": "0.32.0", "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", @@ -7504,6 +7659,95 @@ "node": ">=12" } }, + "node_modules/@wordpress/commands/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@wordpress/components": { + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-26.0.0.tgz", + "integrity": "sha512-23poBjhN4Lgqw3mYQwrHSiF0qrfDVlwr8voqLampeNXFHgJfST13aOCeD3y9ZpML2urOKt5Mi//+Lype9p29FA==", + "dev": true, + "dependencies": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.51.0", + "@wordpress/compose": "^6.28.0", + "@wordpress/date": "^4.51.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/dom": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/escape-html": "^2.51.0", + "@wordpress/hooks": "^3.51.0", + "@wordpress/html-entities": "^3.51.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/icons": "^9.42.0", + "@wordpress/is-shallow-equal": "^4.51.0", + "@wordpress/keycodes": "^3.51.0", + "@wordpress/primitives": "^3.49.0", + "@wordpress/private-apis": "^0.33.0", + "@wordpress/rich-text": "^6.28.0", + "@wordpress/warning": "^2.51.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, + "node_modules/@wordpress/components/node_modules/@wordpress/private-apis": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.33.0.tgz", + "integrity": "sha512-Dc8y7m17gAKnDVFOPDqPcb2jo9cDhDNikLdepTkRXLywYUPT2PFH4GrXsVK87BLc+nCIqgs3DFU/AJx1db4y/w==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.16.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@wordpress/components/node_modules/uuid": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", @@ -7518,20 +7762,20 @@ } }, "node_modules/@wordpress/compose": { - "version": "6.27.0", - "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-6.27.0.tgz", - "integrity": "sha512-jbEQQ2znRyJTwUNR4m5BKaDyIsuK9TMZx0SKqP+FTfGqT3y7scOnQrHpK0kZdPji++/1cBbn3gSPBLCEmtmHRw==", + "version": "6.28.0", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-6.28.0.tgz", + "integrity": "sha512-Vx1SDgG3wIaiB/sUZcYB6csG0s5H3Lv5p9oKy8NDkA9dVfHoUz/XLwdx/yzsB3mqvDcZqReEQeoYHP7F4HeWqA==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", "@types/mousetrap": "^1.6.8", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/priority-queue": "^2.50.0", - "@wordpress/undo-manager": "^0.10.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/dom": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/is-shallow-equal": "^4.51.0", + "@wordpress/keycodes": "^3.51.0", + "@wordpress/priority-queue": "^2.51.0", + "@wordpress/undo-manager": "^0.11.0", "change-case": "^4.1.2", "clipboard": "^2.0.11", "mousetrap": "^1.6.5", @@ -7544,6 +7788,19 @@ "react": "^18.0.0" } }, + "node_modules/@wordpress/compose/node_modules/@wordpress/undo-manager": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-0.11.0.tgz", + "integrity": "sha512-f9izRRzLlZRBXhve1OU9sBGWRvfGU94nhENN7gtf7l31q3xdsnrGf5NE/R1yhwCAHifUFF1dVcIGC1cfT2jQIg==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.16.0", + "@wordpress/is-shallow-equal": "^4.51.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@wordpress/core-commands": { "version": "0.16.0", "resolved": "https://registry.npmjs.org/@wordpress/core-commands/-/core-commands-0.16.0.tgz", @@ -7633,19 +7890,19 @@ } }, "node_modules/@wordpress/data": { - "version": "9.20.0", - "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-9.20.0.tgz", - "integrity": "sha512-3cm2te6NUj/X1zzmRO+WhueCanjocniX6sJFVzkg5mGXme6wFI8iSOnGPKlMkGcZGd0fVei1ydBKaIUMjrPBTQ==", + "version": "9.21.0", + "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-9.21.0.tgz", + "integrity": "sha512-jEAWHcR+xlnI+V0l5N2WLZrZ7THZ+wQjIs5gDHg1wcRLWo7oxe8JHPQ4sIf0zqNaCwj3/svXFvg7pkaJqkDHAw==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/priority-queue": "^2.50.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/redux-routine": "^4.50.0", + "@wordpress/compose": "^6.28.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/is-shallow-equal": "^4.51.0", + "@wordpress/priority-queue": "^2.51.0", + "@wordpress/private-apis": "^0.33.0", + "@wordpress/redux-routine": "^4.51.0", "deepmerge": "^4.3.0", "equivalent-key-map": "^0.2.2", "is-plain-object": "^5.0.0", @@ -7662,9 +7919,9 @@ } }, "node_modules/@wordpress/data/node_modules/@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.33.0.tgz", + "integrity": "sha512-Dc8y7m17gAKnDVFOPDqPcb2jo9cDhDNikLdepTkRXLywYUPT2PFH4GrXsVK87BLc+nCIqgs3DFU/AJx1db4y/w==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -7674,13 +7931,13 @@ } }, "node_modules/@wordpress/date": { - "version": "4.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/date/-/date-4.50.0.tgz", - "integrity": "sha512-FhfaG6YRXWmni66RjwhCB7rQNlLJ05+qTa/jXrj2UNWDNv/sfZ6Ky+b/rKrrUnLaIs9pGiW1195cSxsAS4EY3w==", + "version": "4.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/date/-/date-4.51.0.tgz", + "integrity": "sha512-RqnaIJa8gJ2F8Hj2SLbjk7V4dSRObxIhud+/xneSi4PoPi0pYL3sIGoppXXpyZINhCfMiVZ2JIc8Ryt0zgYxAw==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/deprecated": "^3.50.0", + "@wordpress/deprecated": "^3.51.0", "moment": "^2.29.4", "moment-timezone": "^0.5.40" }, @@ -7704,35 +7961,35 @@ } }, "node_modules/@wordpress/deprecated": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/deprecated/-/deprecated-3.50.0.tgz", - "integrity": "sha512-DL01l0Wlo3df9OcSGHP11Ot/nq0HytbdmD+iPkiCCRI6Xctepbs/DzRR2CO3qLrJkWn6RReFwZWZZjzI7lZUqg==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/deprecated/-/deprecated-3.51.0.tgz", + "integrity": "sha512-jbhK5/zhn2D6xW0WqEFitxowgrlIL03CdG0gMQ9JJNlewvI2qg+4fj9k/ORQh8l5UpBUfkwUHVMaGQswtUUaeQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/hooks": "^3.50.0" + "@wordpress/hooks": "^3.51.0" }, "engines": { "node": ">=12" } }, "node_modules/@wordpress/dom": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-3.50.0.tgz", - "integrity": "sha512-rMnV1ysGOHbKnmjLQYwGkT1co1iEkC3YsKrEObP8mklw1R7rbCy7fc2brIz7kqcHU1DRyg/+7wOCMkg8a/EV/Q==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-3.51.0.tgz", + "integrity": "sha512-5L8iQCq2t+4qHpo4MBZqMg5MqmVZI/U/BaF50yhtTZQSGyhR2SzlixnL8udwatm8KQFteWj8Zwmmu+3GXRTB2Q==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/deprecated": "^3.50.0" + "@wordpress/deprecated": "^3.51.0" }, "engines": { "node": ">=12" } }, "node_modules/@wordpress/dom-ready": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/dom-ready/-/dom-ready-3.50.0.tgz", - "integrity": "sha512-97tJpat1emXnwfGlJMiG6p37CpHJXDLmM/SIbsGJ0Oj8P4/TXbTuE9DNT1H8B1wKe5zD7kICjp48y91ugmgSrQ==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/dom-ready/-/dom-ready-3.51.0.tgz", + "integrity": "sha512-k8+UhRu7moBPWUa1EAfqF+r5VT8EnBGr4zxV+jJJZZg0tTN61RD/mJ0kSzu/0PVQQsAiDgAhxWrfVy2FwFdpCw==", "dependencies": { "@babel/runtime": "^7.16.0" }, @@ -7846,6 +8103,96 @@ "react-dom": "^18.0.0" } }, + "node_modules/@wordpress/edit-post/node_modules/@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "dependencies": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, + "node_modules/@wordpress/edit-post/node_modules/@wordpress/components/node_modules/@wordpress/private-apis": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.16.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@wordpress/edit-post/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@wordpress/editor": { "version": "13.27.2", "resolved": "https://registry.npmjs.org/@wordpress/editor/-/editor-13.27.2.tgz", @@ -7924,6 +8271,71 @@ "react-dom": "^18.0.0" } }, + "node_modules/@wordpress/editor/node_modules/@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "dependencies": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, "node_modules/@wordpress/editor/node_modules/@wordpress/private-apis": { "version": "0.32.0", "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", @@ -7936,6 +8348,19 @@ "node": ">=12" } }, + "node_modules/@wordpress/editor/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@wordpress/element": { "version": "5.28.0", "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-5.28.0.tgz", @@ -8143,9 +8568,9 @@ } }, "node_modules/@wordpress/html-entities": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/html-entities/-/html-entities-3.50.0.tgz", - "integrity": "sha512-DBRgShv6FLtDpapoTgmEx//6uHeq+mk5zKhAWAAqu6+/6LqOm/TCoUTxb0E2xtHh4oRBgU5nYC92pObRaczFdQ==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/html-entities/-/html-entities-3.51.0.tgz", + "integrity": "sha512-3LBqSN5d0aTa0MKgen60RfuwZZnANrUw3tQ3pI4H+hXWSazSi1joyxBPmM1fxNuEO7QMnq1I3pU6ywF9Ok6OOw==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -8230,10 +8655,100 @@ "react-dom": "^18.0.0" } }, + "node_modules/@wordpress/interface/node_modules/@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "dependencies": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, + "node_modules/@wordpress/interface/node_modules/@wordpress/private-apis": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.16.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@wordpress/interface/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@wordpress/is-shallow-equal": { - "version": "4.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-4.50.0.tgz", - "integrity": "sha512-lX0fMa1f/TwWYYF+Oj0MG2Eze4Bb+vsnhXX6X1l+Ri3PG34wWGonjq729qHbJRDwm8o1y9GeswCgESIpuAm9wg==", + "version": "4.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-4.51.0.tgz", + "integrity": "sha512-/Rik1HF5XoLEuodtwvSMFsAMsLC40aRnFei+vzEsaSjcS4/z2kmzgGcIpc8Ca3HEJgtdx6MuziODG1hU9bKRtg==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -8383,6 +8898,71 @@ "react-dom": "^18.0.0" } }, + "node_modules/@wordpress/patterns/node_modules/@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "dependencies": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, "node_modules/@wordpress/patterns/node_modules/@wordpress/private-apis": { "version": "0.32.0", "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", @@ -8395,6 +8975,19 @@ "node": ">=12" } }, + "node_modules/@wordpress/patterns/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@wordpress/plugins": { "version": "6.18.0", "resolved": "https://registry.npmjs.org/@wordpress/plugins/-/plugins-6.18.0.tgz", @@ -8418,6 +9011,96 @@ "react-dom": "^18.0.0" } }, + "node_modules/@wordpress/plugins/node_modules/@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "dependencies": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, + "node_modules/@wordpress/plugins/node_modules/@wordpress/private-apis": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.16.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@wordpress/plugins/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@wordpress/postcss-plugins-preset": { "version": "4.34.0", "resolved": "https://registry.npmjs.org/@wordpress/postcss-plugins-preset/-/postcss-plugins-preset-4.34.0.tgz", @@ -8460,6 +9143,71 @@ "react-dom": "^18.0.0" } }, + "node_modules/@wordpress/preferences/node_modules/@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "dependencies": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, "node_modules/@wordpress/preferences/node_modules/@wordpress/private-apis": { "version": "0.32.0", "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", @@ -8472,6 +9220,19 @@ "node": ">=12" } }, + "node_modules/@wordpress/preferences/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@wordpress/prettier-config": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-3.7.0.tgz", @@ -8499,9 +9260,9 @@ } }, "node_modules/@wordpress/priority-queue": { - "version": "2.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/priority-queue/-/priority-queue-2.50.0.tgz", - "integrity": "sha512-21E842EVFYUd1ZrNTLAW57IyloDCUZr6h1Te6BgqKoeKOEteoTQwA9BemMzZJUiThUSZymW94ot0Omb+C8VX2g==", + "version": "2.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/priority-queue/-/priority-queue-2.51.0.tgz", + "integrity": "sha512-eu5kFXJT1GfZU+g/7VeLi1p0dMt4SAj5qnHxnA1OWdsRd8CSx0ne7VdZxZroeGif1/x/IliBtdb28A8WEZM59A==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", @@ -8524,9 +9285,9 @@ } }, "node_modules/@wordpress/redux-routine": { - "version": "4.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/redux-routine/-/redux-routine-4.50.0.tgz", - "integrity": "sha512-giHjQYhmFDCpeNEnsZKP0JNPBnpuQwsoxLmHAUUSNFWAmd4rtnNnG6M8HuqOLmgYTvEa8Hlx3Bl+reTGvrtI2g==", + "version": "4.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/redux-routine/-/redux-routine-4.51.0.tgz", + "integrity": "sha512-lMEkB4yg0H/P0kvmgWrPcD55ib9lPUROABdgy569ERtIq6F3Ig7Q2SJoGM91VgIVBDb4ZFvJ9Wa/+a2HIHJMuQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", @@ -8568,6 +9329,71 @@ "react-dom": "^18.0.0" } }, + "node_modules/@wordpress/reusable-blocks/node_modules/@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "dependencies": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, "node_modules/@wordpress/reusable-blocks/node_modules/@wordpress/private-apis": { "version": "0.32.0", "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", @@ -8580,21 +9406,34 @@ "node": ">=12" } }, + "node_modules/@wordpress/reusable-blocks/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@wordpress/rich-text": { - "version": "6.27.0", - "resolved": "https://registry.npmjs.org/@wordpress/rich-text/-/rich-text-6.27.0.tgz", - "integrity": "sha512-B7t++SldcI4nb+lO2m9oEdyD8y2FbH5DKY5F2G3xpcEnw4EKSt4SsTzeclMQ/2zzlEHPRKU/IR29SeOIJ1H8JQ==", + "version": "6.28.0", + "resolved": "https://registry.npmjs.org/@wordpress/rich-text/-/rich-text-6.28.0.tgz", + "integrity": "sha512-Fl0TQOELar08jtRWus2qRz1mqvwMWsgxrZTInbWTEnRdxC/s8MuSEPuHLLJSO1dNnOqmaVIvui5285iuZM5slg==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.50.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/data": "^9.20.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/escape-html": "^2.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/keycodes": "^3.50.0", + "@wordpress/a11y": "^3.51.0", + "@wordpress/compose": "^6.28.0", + "@wordpress/data": "^9.21.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/escape-html": "^2.51.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/keycodes": "^3.51.0", "memize": "^2.1.0", "rememo": "^4.0.2" }, @@ -9020,6 +9859,96 @@ "react-dom": "^18.0.0" } }, + "node_modules/@wordpress/server-side-render/node_modules/@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "dependencies": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, + "node_modules/@wordpress/server-side-render/node_modules/@wordpress/private-apis": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.16.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@wordpress/server-side-render/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@wordpress/shortcode": { "version": "3.50.0", "resolved": "https://registry.npmjs.org/@wordpress/shortcode/-/shortcode-3.50.0.tgz", @@ -9140,9 +10069,9 @@ } }, "node_modules/@wordpress/warning": { - "version": "2.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/warning/-/warning-2.50.0.tgz", - "integrity": "sha512-y7Zf48roDfiPgbRAWGXDwN3C8sfbEdneGq+HvXCW6rIeGYnDLdEkpX9i7RfultkFFPVeSP3FpMKVMkto2nbqzA==", + "version": "2.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/warning/-/warning-2.51.0.tgz", + "integrity": "sha512-e+YbsQY4o/nTY0gT5Rr5766wU2xzwL5m/8S1HET9wBaeCRoZR/0IKyTOvPfihW13uT6FayBne3rqwT/h6F8w6Q==", "dev": true, "engines": { "node": ">=12" @@ -9173,6 +10102,96 @@ "react-dom": "^18.0.0" } }, + "node_modules/@wordpress/widgets/node_modules/@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "dependencies": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, + "node_modules/@wordpress/widgets/node_modules/@wordpress/private-apis": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.16.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@wordpress/widgets/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@wordpress/wordcount": { "version": "3.50.0", "resolved": "https://registry.npmjs.org/@wordpress/wordcount/-/wordcount-3.50.0.tgz", @@ -33143,14 +34162,14 @@ "requires": {} }, "@wordpress/a11y": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/a11y/-/a11y-3.50.0.tgz", - "integrity": "sha512-eQiPGnxqiL1LgnHztFG0RGSFZ5phwR8B8Fr4lbJsFalsc9R/tOcjewvf2KN0yi2UlRA5ssAeiTP+tYmeAqtOHQ==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/a11y/-/a11y-3.51.0.tgz", + "integrity": "sha512-sq7dflOxrSAvtEb7Ae1VmLyEYESlRlrwCBrWeAyYwekQ08Da1ph7EyvYMM1Yoq7xCbnLpPvAt/oGO05Mhkv2dg==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/dom-ready": "^3.50.0", - "@wordpress/i18n": "^4.50.0" + "@wordpress/dom-ready": "^3.51.0", + "@wordpress/i18n": "^4.51.0" } }, "@wordpress/api-fetch": { @@ -33290,6 +34309,64 @@ "rememo": "^4.0.2" } }, + "@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "requires": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + } + }, "@wordpress/private-apis": { "version": "0.32.0", "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", @@ -33298,6 +34375,12 @@ "requires": { "@babel/runtime": "^7.16.0" } + }, + "uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true } } }, @@ -33349,6 +34432,75 @@ "uuid": "^9.0.1" }, "dependencies": { + "@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "requires": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + }, + "dependencies": { + "@wordpress/private-apis": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.0" + } + } + } + }, "uuid": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", @@ -33448,12 +34600,89 @@ "classnames": "^2.3.1", "cmdk": "^0.2.0", "rememo": "^4.0.2" + }, + "dependencies": { + "@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "requires": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + }, + "dependencies": { + "@wordpress/private-apis": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.0" + } + } + } + }, + "uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true + } } }, "@wordpress/components": { - "version": "25.16.0", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", - "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-26.0.0.tgz", + "integrity": "sha512-23poBjhN4Lgqw3mYQwrHSiF0qrfDVlwr8voqLampeNXFHgJfST13aOCeD3y9ZpML2urOKt5Mi//+Lype9p29FA==", "dev": true, "requires": { "@ariakit/react": "^0.3.12", @@ -33468,23 +34697,23 @@ "@types/gradient-parser": "0.1.3", "@types/highlight-words-core": "1.2.1", "@use-gesture/react": "^10.2.24", - "@wordpress/a11y": "^3.50.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/date": "^4.50.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/escape-html": "^2.50.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/primitives": "^3.48.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/warning": "^2.50.0", + "@wordpress/a11y": "^3.51.0", + "@wordpress/compose": "^6.28.0", + "@wordpress/date": "^4.51.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/dom": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/escape-html": "^2.51.0", + "@wordpress/hooks": "^3.51.0", + "@wordpress/html-entities": "^3.51.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/icons": "^9.42.0", + "@wordpress/is-shallow-equal": "^4.51.0", + "@wordpress/keycodes": "^3.51.0", + "@wordpress/primitives": "^3.49.0", + "@wordpress/private-apis": "^0.33.0", + "@wordpress/rich-text": "^6.28.0", + "@wordpress/warning": "^2.51.0", "change-case": "^4.1.2", "classnames": "^2.3.1", "colord": "^2.7.0", @@ -33501,7 +34730,6 @@ "path-to-regexp": "^6.2.1", "re-resizable": "^6.4.0", "react-colorful": "^5.3.1", - "reakit": "^1.3.11", "remove-accents": "^0.5.0", "use-lilius": "^2.0.1", "uuid": "^9.0.1", @@ -33509,9 +34737,9 @@ }, "dependencies": { "@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.33.0.tgz", + "integrity": "sha512-Dc8y7m17gAKnDVFOPDqPcb2jo9cDhDNikLdepTkRXLywYUPT2PFH4GrXsVK87BLc+nCIqgs3DFU/AJx1db4y/w==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" @@ -33526,24 +34754,36 @@ } }, "@wordpress/compose": { - "version": "6.27.0", - "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-6.27.0.tgz", - "integrity": "sha512-jbEQQ2znRyJTwUNR4m5BKaDyIsuK9TMZx0SKqP+FTfGqT3y7scOnQrHpK0kZdPji++/1cBbn3gSPBLCEmtmHRw==", + "version": "6.28.0", + "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-6.28.0.tgz", + "integrity": "sha512-Vx1SDgG3wIaiB/sUZcYB6csG0s5H3Lv5p9oKy8NDkA9dVfHoUz/XLwdx/yzsB3mqvDcZqReEQeoYHP7F4HeWqA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", "@types/mousetrap": "^1.6.8", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/priority-queue": "^2.50.0", - "@wordpress/undo-manager": "^0.10.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/dom": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/is-shallow-equal": "^4.51.0", + "@wordpress/keycodes": "^3.51.0", + "@wordpress/priority-queue": "^2.51.0", + "@wordpress/undo-manager": "^0.11.0", "change-case": "^4.1.2", "clipboard": "^2.0.11", "mousetrap": "^1.6.5", "use-memo-one": "^1.1.1" + }, + "dependencies": { + "@wordpress/undo-manager": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-0.11.0.tgz", + "integrity": "sha512-f9izRRzLlZRBXhve1OU9sBGWRvfGU94nhENN7gtf7l31q3xdsnrGf5NE/R1yhwCAHifUFF1dVcIGC1cfT2jQIg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.0", + "@wordpress/is-shallow-equal": "^4.51.0" + } + } } }, "@wordpress/core-commands": { @@ -33613,19 +34853,19 @@ } }, "@wordpress/data": { - "version": "9.20.0", - "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-9.20.0.tgz", - "integrity": "sha512-3cm2te6NUj/X1zzmRO+WhueCanjocniX6sJFVzkg5mGXme6wFI8iSOnGPKlMkGcZGd0fVei1ydBKaIUMjrPBTQ==", + "version": "9.21.0", + "resolved": "https://registry.npmjs.org/@wordpress/data/-/data-9.21.0.tgz", + "integrity": "sha512-jEAWHcR+xlnI+V0l5N2WLZrZ7THZ+wQjIs5gDHg1wcRLWo7oxe8JHPQ4sIf0zqNaCwj3/svXFvg7pkaJqkDHAw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/priority-queue": "^2.50.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/redux-routine": "^4.50.0", + "@wordpress/compose": "^6.28.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/is-shallow-equal": "^4.51.0", + "@wordpress/priority-queue": "^2.51.0", + "@wordpress/private-apis": "^0.33.0", + "@wordpress/redux-routine": "^4.51.0", "deepmerge": "^4.3.0", "equivalent-key-map": "^0.2.2", "is-plain-object": "^5.0.0", @@ -33636,9 +34876,9 @@ }, "dependencies": { "@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.33.0.tgz", + "integrity": "sha512-Dc8y7m17gAKnDVFOPDqPcb2jo9cDhDNikLdepTkRXLywYUPT2PFH4GrXsVK87BLc+nCIqgs3DFU/AJx1db4y/w==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" @@ -33647,13 +34887,13 @@ } }, "@wordpress/date": { - "version": "4.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/date/-/date-4.50.0.tgz", - "integrity": "sha512-FhfaG6YRXWmni66RjwhCB7rQNlLJ05+qTa/jXrj2UNWDNv/sfZ6Ky+b/rKrrUnLaIs9pGiW1195cSxsAS4EY3w==", + "version": "4.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/date/-/date-4.51.0.tgz", + "integrity": "sha512-RqnaIJa8gJ2F8Hj2SLbjk7V4dSRObxIhud+/xneSi4PoPi0pYL3sIGoppXXpyZINhCfMiVZ2JIc8Ryt0zgYxAw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/deprecated": "^3.50.0", + "@wordpress/deprecated": "^3.51.0", "moment": "^2.29.4", "moment-timezone": "^0.5.40" } @@ -33668,29 +34908,29 @@ } }, "@wordpress/deprecated": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/deprecated/-/deprecated-3.50.0.tgz", - "integrity": "sha512-DL01l0Wlo3df9OcSGHP11Ot/nq0HytbdmD+iPkiCCRI6Xctepbs/DzRR2CO3qLrJkWn6RReFwZWZZjzI7lZUqg==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/deprecated/-/deprecated-3.51.0.tgz", + "integrity": "sha512-jbhK5/zhn2D6xW0WqEFitxowgrlIL03CdG0gMQ9JJNlewvI2qg+4fj9k/ORQh8l5UpBUfkwUHVMaGQswtUUaeQ==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/hooks": "^3.50.0" + "@wordpress/hooks": "^3.51.0" } }, "@wordpress/dom": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-3.50.0.tgz", - "integrity": "sha512-rMnV1ysGOHbKnmjLQYwGkT1co1iEkC3YsKrEObP8mklw1R7rbCy7fc2brIz7kqcHU1DRyg/+7wOCMkg8a/EV/Q==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/dom/-/dom-3.51.0.tgz", + "integrity": "sha512-5L8iQCq2t+4qHpo4MBZqMg5MqmVZI/U/BaF50yhtTZQSGyhR2SzlixnL8udwatm8KQFteWj8Zwmmu+3GXRTB2Q==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/deprecated": "^3.50.0" + "@wordpress/deprecated": "^3.51.0" } }, "@wordpress/dom-ready": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/dom-ready/-/dom-ready-3.50.0.tgz", - "integrity": "sha512-97tJpat1emXnwfGlJMiG6p37CpHJXDLmM/SIbsGJ0Oj8P4/TXbTuE9DNT1H8B1wKe5zD7kICjp48y91ugmgSrQ==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/dom-ready/-/dom-ready-3.51.0.tgz", + "integrity": "sha512-k8+UhRu7moBPWUa1EAfqF+r5VT8EnBGr4zxV+jJJZZg0tTN61RD/mJ0kSzu/0PVQQsAiDgAhxWrfVy2FwFdpCw==", "requires": { "@babel/runtime": "^7.16.0" } @@ -33775,6 +35015,83 @@ "classnames": "^2.3.1", "memize": "^2.1.0", "rememo": "^4.0.2" + }, + "dependencies": { + "@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "requires": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + }, + "dependencies": { + "@wordpress/private-apis": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.0" + } + } + } + }, + "uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true + } } }, "@wordpress/editor": { @@ -33841,6 +35158,64 @@ "rememo": "^4.0.2" } }, + "@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "requires": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + } + }, "@wordpress/private-apis": { "version": "0.32.0", "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", @@ -33849,6 +35224,12 @@ "requires": { "@babel/runtime": "^7.16.0" } + }, + "uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true } } }, @@ -34000,9 +35381,9 @@ } }, "@wordpress/html-entities": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/html-entities/-/html-entities-3.50.0.tgz", - "integrity": "sha512-DBRgShv6FLtDpapoTgmEx//6uHeq+mk5zKhAWAAqu6+/6LqOm/TCoUTxb0E2xtHh4oRBgU5nYC92pObRaczFdQ==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/html-entities/-/html-entities-3.51.0.tgz", + "integrity": "sha512-3LBqSN5d0aTa0MKgen60RfuwZZnANrUw3tQ3pI4H+hXWSazSi1joyxBPmM1fxNuEO7QMnq1I3pU6ywF9Ok6OOw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" @@ -34063,12 +35444,87 @@ "@wordpress/preferences": "^3.24.0", "@wordpress/viewport": "^5.24.0", "classnames": "^2.3.1" + }, + "dependencies": { + "@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "requires": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + } + }, + "@wordpress/private-apis": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.0" + } + }, + "uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true + } } }, "@wordpress/is-shallow-equal": { - "version": "4.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-4.50.0.tgz", - "integrity": "sha512-lX0fMa1f/TwWYYF+Oj0MG2Eze4Bb+vsnhXX6X1l+Ri3PG34wWGonjq729qHbJRDwm8o1y9GeswCgESIpuAm9wg==", + "version": "4.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/is-shallow-equal/-/is-shallow-equal-4.51.0.tgz", + "integrity": "sha512-/Rik1HF5XoLEuodtwvSMFsAMsLC40aRnFei+vzEsaSjcS4/z2kmzgGcIpc8Ca3HEJgtdx6MuziODG1hU9bKRtg==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" @@ -34172,6 +35628,64 @@ "nanoid": "^3.3.4" }, "dependencies": { + "@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "requires": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + } + }, "@wordpress/private-apis": { "version": "0.32.0", "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", @@ -34180,6 +35694,12 @@ "requires": { "@babel/runtime": "^7.16.0" } + }, + "uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true } } }, @@ -34197,6 +35717,81 @@ "@wordpress/icons": "^9.41.0", "@wordpress/is-shallow-equal": "^4.50.0", "memize": "^2.0.1" + }, + "dependencies": { + "@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "requires": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + } + }, + "@wordpress/private-apis": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.0" + } + }, + "uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true + } } }, "@wordpress/postcss-plugins-preset": { @@ -34228,6 +35823,64 @@ "classnames": "^2.3.1" }, "dependencies": { + "@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "requires": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + } + }, "@wordpress/private-apis": { "version": "0.32.0", "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", @@ -34236,6 +35889,12 @@ "requires": { "@babel/runtime": "^7.16.0" } + }, + "uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true } } }, @@ -34258,9 +35917,9 @@ } }, "@wordpress/priority-queue": { - "version": "2.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/priority-queue/-/priority-queue-2.50.0.tgz", - "integrity": "sha512-21E842EVFYUd1ZrNTLAW57IyloDCUZr6h1Te6BgqKoeKOEteoTQwA9BemMzZJUiThUSZymW94ot0Omb+C8VX2g==", + "version": "2.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/priority-queue/-/priority-queue-2.51.0.tgz", + "integrity": "sha512-eu5kFXJT1GfZU+g/7VeLi1p0dMt4SAj5qnHxnA1OWdsRd8CSx0ne7VdZxZroeGif1/x/IliBtdb28A8WEZM59A==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", @@ -34277,9 +35936,9 @@ } }, "@wordpress/redux-routine": { - "version": "4.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/redux-routine/-/redux-routine-4.50.0.tgz", - "integrity": "sha512-giHjQYhmFDCpeNEnsZKP0JNPBnpuQwsoxLmHAUUSNFWAmd4rtnNnG6M8HuqOLmgYTvEa8Hlx3Bl+reTGvrtI2g==", + "version": "4.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/redux-routine/-/redux-routine-4.51.0.tgz", + "integrity": "sha512-lMEkB4yg0H/P0kvmgWrPcD55ib9lPUROABdgy569ERtIq6F3Ig7Q2SJoGM91VgIVBDb4ZFvJ9Wa/+a2HIHJMuQ==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", @@ -34308,6 +35967,64 @@ "@wordpress/url": "^3.51.0" }, "dependencies": { + "@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "requires": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + } + }, "@wordpress/private-apis": { "version": "0.32.0", "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", @@ -34316,24 +36033,30 @@ "requires": { "@babel/runtime": "^7.16.0" } + }, + "uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true } } }, "@wordpress/rich-text": { - "version": "6.27.0", - "resolved": "https://registry.npmjs.org/@wordpress/rich-text/-/rich-text-6.27.0.tgz", - "integrity": "sha512-B7t++SldcI4nb+lO2m9oEdyD8y2FbH5DKY5F2G3xpcEnw4EKSt4SsTzeclMQ/2zzlEHPRKU/IR29SeOIJ1H8JQ==", + "version": "6.28.0", + "resolved": "https://registry.npmjs.org/@wordpress/rich-text/-/rich-text-6.28.0.tgz", + "integrity": "sha512-Fl0TQOELar08jtRWus2qRz1mqvwMWsgxrZTInbWTEnRdxC/s8MuSEPuHLLJSO1dNnOqmaVIvui5285iuZM5slg==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.50.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/data": "^9.20.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/escape-html": "^2.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/keycodes": "^3.50.0", + "@wordpress/a11y": "^3.51.0", + "@wordpress/compose": "^6.28.0", + "@wordpress/data": "^9.21.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/escape-html": "^2.51.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/keycodes": "^3.51.0", "memize": "^2.1.0", "rememo": "^4.0.2" } @@ -34649,6 +36372,81 @@ "@wordpress/i18n": "^4.50.0", "@wordpress/url": "^3.51.0", "fast-deep-equal": "^3.1.3" + }, + "dependencies": { + "@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "requires": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + } + }, + "@wordpress/private-apis": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.0" + } + }, + "uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true + } } }, "@wordpress/shortcode": { @@ -34741,9 +36539,9 @@ } }, "@wordpress/warning": { - "version": "2.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/warning/-/warning-2.50.0.tgz", - "integrity": "sha512-y7Zf48roDfiPgbRAWGXDwN3C8sfbEdneGq+HvXCW6rIeGYnDLdEkpX9i7RfultkFFPVeSP3FpMKVMkto2nbqzA==", + "version": "2.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/warning/-/warning-2.51.0.tgz", + "integrity": "sha512-e+YbsQY4o/nTY0gT5Rr5766wU2xzwL5m/8S1HET9wBaeCRoZR/0IKyTOvPfihW13uT6FayBne3rqwT/h6F8w6Q==", "dev": true }, "@wordpress/widgets": { @@ -34765,6 +36563,81 @@ "@wordpress/icons": "^9.38.0", "@wordpress/notices": "^4.15.0", "classnames": "^2.3.1" + }, + "dependencies": { + "@wordpress/components": { + "version": "25.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", + "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "dev": true, + "requires": { + "@ariakit/react": "^0.3.12", + "@babel/runtime": "^7.16.0", + "@emotion/cache": "^11.7.1", + "@emotion/css": "^11.7.1", + "@emotion/react": "^11.7.1", + "@emotion/serialize": "^1.0.2", + "@emotion/styled": "^11.6.0", + "@emotion/utils": "^1.0.0", + "@floating-ui/react-dom": "^2.0.1", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", + "@use-gesture/react": "^10.2.24", + "@wordpress/a11y": "^3.50.0", + "@wordpress/compose": "^6.27.0", + "@wordpress/date": "^4.50.0", + "@wordpress/deprecated": "^3.50.0", + "@wordpress/dom": "^3.50.0", + "@wordpress/element": "^5.27.0", + "@wordpress/escape-html": "^2.50.0", + "@wordpress/hooks": "^3.50.0", + "@wordpress/html-entities": "^3.50.0", + "@wordpress/i18n": "^4.50.0", + "@wordpress/icons": "^9.41.0", + "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/keycodes": "^3.50.0", + "@wordpress/primitives": "^3.48.0", + "@wordpress/private-apis": "^0.32.0", + "@wordpress/rich-text": "^6.27.0", + "@wordpress/warning": "^2.50.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "date-fns": "^2.28.0", + "deepmerge": "^4.3.0", + "dom-scroll-into-view": "^1.2.1", + "downshift": "^6.0.15", + "fast-deep-equal": "^3.1.3", + "framer-motion": "^10.13.0", + "gradient-parser": "^0.1.5", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "path-to-regexp": "^6.2.1", + "re-resizable": "^6.4.0", + "react-colorful": "^5.3.1", + "reakit": "^1.3.11", + "remove-accents": "^0.5.0", + "use-lilius": "^2.0.1", + "uuid": "^9.0.1", + "valtio": "1.7.0" + } + }, + "@wordpress/private-apis": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", + "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.0" + } + }, + "uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true + } } }, "@wordpress/wordcount": { diff --git a/package.json b/package.json index 9f327d786..26b857bdb 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "@wordpress/babel-preset-default": "^7.32.0", "@wordpress/block-editor": "^12.17.0", "@wordpress/blocks": "^12.26.0", - "@wordpress/components": "^25.7.0", + "@wordpress/components": "^26.0.0", "@wordpress/compose": "^6.18.0", "@wordpress/core-data": "^6.26.0", "@wordpress/data": "^9.19.0", From 890bb70d5a1d31d2a3e58660bcef49bb3caa354d Mon Sep 17 00:00:00 2001 From: Henrique Mouta Date: Mon, 12 Feb 2024 12:03:50 +0000 Subject: [PATCH 020/110] Telemetry: Fix bad reporting when adding or removing Parse.ly blocks (#2200) * Refactor the block change monitor logic to improve telemetry when adding or removing blocks * Subscribe specifically to the `core/block-editor` store. * Address code review feedback * Wait until the editor is ready, instead of relying on a fixed timeout. --------- Co-authored-by: Alex Cicovic <23142906+acicovic@users.noreply.github.com> --- build/telemetry.asset.php | 2 +- build/telemetry.js | 2 +- package-lock.json | 40 +++++++-- package.json | 4 +- src/js/telemetry/block-change.tsx | 133 +++++++++++++++++++----------- 5 files changed, 125 insertions(+), 56 deletions(-) diff --git a/build/telemetry.asset.php b/build/telemetry.asset.php index 1079ba810..f472f6ad2 100644 --- a/build/telemetry.asset.php +++ b/build/telemetry.asset.php @@ -1 +1 @@ - array('wp-data', 'wp-element', 'wp-plugins'), 'version' => '277684fa760337ecf379'); + array('wp-data', 'wp-element', 'wp-plugins'), 'version' => '77eca9d53acf3533f9f9'); diff --git a/build/telemetry.js b/build/telemetry.js index 43aafb13c..e7c8af604 100644 --- a/build/telemetry.js +++ b/build/telemetry.js @@ -1 +1 @@ -!function(){"use strict";var e=window.wp.element,t=window.wp.plugins,r=function(){function e(){this._tkq=[],this.isLoaded=!1,this.isEnabled=!1,"undefined"!=typeof wpParselyTracksTelemetry&&(this.isEnabled=!0,this.loadTrackingLibrary())}return e.getInstance=function(){return window.wpParselyTelemetryInstance||Object.defineProperty(window,"wpParselyTelemetryInstance",{value:new e,writable:!1,configurable:!1,enumerable:!1}),window.wpParselyTelemetryInstance},e.prototype.loadTrackingLibrary=function(){var e=this,t=document.createElement("script");t.async=!0,t.src="//stats.wp.com/w.js",t.onload=function(){e.isLoaded=!0,e._tkq=window._tkq||[]},document.head.appendChild(t)},e.trackEvent=function(t,r){return void 0===r&&(r={}),n=this,i=void 0,o=function(){var n;return function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=1e4&&(clearInterval(a),r("Telemetry library not loaded"))}),100);else r("Telemetry not enabled")}))},e.prototype.trackEvent=function(t,r){var n;this.isLoaded?(0!==t.indexOf(e.TRACKS_PREFIX)&&(t=e.TRACKS_PREFIX+t),this.isEventNameValid(t)?(r=this.prepareProperties(r),null===(n=this._tkq)||void 0===n||n.push(["recordEvent",t,r])):console.error("Error tracking event: Invalid event name")):console.error("Error tracking event: Telemetry not loaded")},e.prototype.isTelemetryEnabled=function(){return this.isEnabled},e.prototype.isProprietyValid=function(t){return e.PROPERTY_REGEX.test(t)},e.prototype.isEventNameValid=function(t){return e.EVENT_NAME_REGEX.test(t)},e.prototype.prepareProperties=function(e){return(e=this.sanitizeProperties(e)).parsely_version=wpParselyTracksTelemetry.version,wpParselyTracksTelemetry.user&&(e._ut=wpParselyTracksTelemetry.user.type,e._ui=wpParselyTracksTelemetry.user.id),wpParselyTracksTelemetry.vipgo_env&&(e.vipgo_env=wpParselyTracksTelemetry.vipgo_env),this.sanitizeProperties(e)},e.prototype.sanitizeProperties=function(e){var t=this,r={};return Object.keys(e).forEach((function(n){t.isProprietyValid(n)&&(r[n]=e[n])})),r},e.TRACKS_PREFIX="wpparsely_",e.EVENT_NAME_REGEX=/^(([a-z0-9]+)_){2}([a-z0-9_]+)$/,e.PROPERTY_REGEX=/^[a-z_][a-z0-9_]*$/,e}(),n=(r.trackEvent,window.wp.data);if(r.getInstance().isTelemetryEnabled()){var i=[function(){return(0,e.useEffect)((function(){var e=function(){return(0,n.select)("core/block-editor").getBlocks()},t=new Set(e().map((function(e){return e.clientId}))),r=(0,n.subscribe)((function(){var r=e(),n=new Set(r.map((function(e){return e.clientId})));if(n.size!==t.size)for(var i=n.size>t.size,a=0,o=i?r:Array.from(t);a=t||n<0||b&&e-v>=s}function E(){var e=o();if(m(e))return g(e);p=setTimeout(E,function(e){var n=t-(e-d);return b?c(n,s-(e-v)):n}(e))}function g(e){return p=void 0,h&&u?w(e):(u=l=void 0,f)}function T(){var e=o(),n=m(e);if(u=arguments,l=this,d=e,n){if(void 0===p)return function(e){return v=e,p=setTimeout(E,t),y?w(e):f}(d);if(b)return clearTimeout(p),p=setTimeout(E,t),w(d)}return void 0===p&&(p=setTimeout(E,t)),f}return t=i(t)||0,r(n)&&(y=!!n.leading,s=(b="maxWait"in n)?a(i(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h),T.cancel=function(){void 0!==p&&clearTimeout(p),v=0,u=d=l=p=void 0},T.flush=function(){return void 0===p?f:g(o())},T}},218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},448:function(e,t,n){var r=n(239),o=n(5);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},771:function(e,t,n){var r=n(639);e.exports=function(){return r.Date.now()}},841:function(e,t,n){var r=n(561),o=n(218),i=n(448),a=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=c.test(e);return n||u.test(e)?l(e.slice(2),n?2:8):a.test(e)?NaN:+e}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=window.wp.element,t=window.wp.plugins,r=function(){function e(){this._tkq=[],this.isLoaded=!1,this.isEnabled=!1,"undefined"!=typeof wpParselyTracksTelemetry&&(this.isEnabled=!0,this.loadTrackingLibrary())}return e.getInstance=function(){return window.wpParselyTelemetryInstance||Object.defineProperty(window,"wpParselyTelemetryInstance",{value:new e,writable:!1,configurable:!1,enumerable:!1}),window.wpParselyTelemetryInstance},e.prototype.loadTrackingLibrary=function(){var e=this,t=document.createElement("script");t.async=!0,t.src="//stats.wp.com/w.js",t.onload=function(){e.isLoaded=!0,e._tkq=window._tkq||[]},document.head.appendChild(t)},e.trackEvent=function(t,n){return void 0===n&&(n={}),r=this,o=void 0,a=function(){var r;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]=1e4&&(clearInterval(i),n("Telemetry library not loaded"))}),100);else n("Telemetry not enabled")}))},e.prototype.trackEvent=function(t,n){var r;this.isLoaded?(0!==t.indexOf(e.TRACKS_PREFIX)&&(t=e.TRACKS_PREFIX+t),this.isEventNameValid(t)?(n=this.prepareProperties(n),null===(r=this._tkq)||void 0===r||r.push(["recordEvent",t,n])):console.error("Error tracking event: Invalid event name")):console.error("Error tracking event: Telemetry not loaded")},e.prototype.isTelemetryEnabled=function(){return this.isEnabled},e.prototype.isProprietyValid=function(t){return e.PROPERTY_REGEX.test(t)},e.prototype.isEventNameValid=function(t){return e.EVENT_NAME_REGEX.test(t)},e.prototype.prepareProperties=function(e){return(e=this.sanitizeProperties(e)).parsely_version=wpParselyTracksTelemetry.version,wpParselyTracksTelemetry.user&&(e._ut=wpParselyTracksTelemetry.user.type,e._ui=wpParselyTracksTelemetry.user.id),wpParselyTracksTelemetry.vipgo_env&&(e.vipgo_env=wpParselyTracksTelemetry.vipgo_env),this.sanitizeProperties(e)},e.prototype.sanitizeProperties=function(e){var t=this,n={};return Object.keys(e).forEach((function(r){t.isProprietyValid(r)&&(n[r]=e[r])})),n},e.TRACKS_PREFIX="wpparsely_",e.EVENT_NAME_REGEX=/^(([a-z0-9]+)_){2}([a-z0-9_]+)$/,e.PROPERTY_REGEX=/^[a-z_][a-z0-9_]*$/,e}(),o=(r.trackEvent,window.wp.data),i=n(279),a=n.n(i);if(r.getInstance().isTelemetryEnabled()){var c=[function(){var t="wp-parsely/";return(0,e.useEffect)((function(){var e,n,i,c,u;return(n=void 0,i=void 0,c=void 0,u=function(){return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]0)&&(t(),e())}))}))]}))},new(c||(c=Promise))((function(e,t){function r(e){try{a(u.next(e))}catch(e){t(e)}}function o(e){try{a(u.throw(e))}catch(e){t(e)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof c?n:new c((function(e){e(n)}))).then(r,o)}a((u=u.apply(n,i||[])).next())}))).then((function(){var n=(0,o.select)("core/block-editor").getBlocks(),i=a()((function(){var e=(0,o.select)("core/block-editor").getBlocks(),i=e.map((function(e){return e.clientId})),a=n.map((function(e){return e.clientId}));e.filter((function(e){return!a.includes(e.clientId)})).forEach((function(e){e.name.startsWith(t)&&r.trackEvent("block_added",{block:e.name})})),a.filter((function(e){return!i.includes(e)})).forEach((function(e){var o=n.find((function(t){return t.clientId===e}));o&&o.name.startsWith(t)&&r.trackEvent("block_removed",{block:o.name})})),n=e}),1e3);return e=(0,o.subscribe)(i,"core/block-editor")})),function(){e&&e()}}),[]),null}],u=e.createElement.apply(void 0,function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o { +export const BlockChangeMonitor = (): null => { /** - * The prefix of the block's name. + * The prefix of the blocks to monitor. * * @since 3.12.0 */ const parselyBlockPrefix: string = 'wp-parsely/'; /** - * The useEffect hook is used to subscribe to changes in the block editor when the component is mounted. - * It first gets the current list of blocks and creates a Set of the block IDs. - * Then, it subscribes to changes in the block editor. - * When the block editor changes, it gets the new list of blocks and creates a new Set of the block IDs. - * It checks if the size of the new block IDs Set is different from the last one, indicating that a block - * has been added or removed. + * This useEffect hook is used to monitor changes in the WordPress block editor. + * It delays the initialization to avoid reacting to the initial block load. + * It subscribes to changes in the block editor when the component is mounted. + * When the block editor changes, it checks if blocks have been added or removed by comparing the current + * list of blocks with the previous one. * If a block has been added or removed, it sends a telemetry event to the server. - * Finally, it updates the last block IDs with the new block IDs for the next comparison. - * When the component is unmounted, it unsubscribes from the block editor changes. + * When the component is unmounted, it clears the initialization timeout. * * @since 3.12.0 + * @since 3.14.0 Improved detection by comparing current and previous block states directly. */ useEffect( () => { - const getBlockList = () => select( 'core/block-editor' ).getBlocks() as BlockInstance[]; - let lastBlockIds = new Set( getBlockList().map( ( block ) => block.clientId ) ); + // Debounce interval to save CPU cycles with the frequent editor updates. + const debounceInterval = 1000; // In milliseconds. - const unsubscribe = subscribe( () => { - const newBlockList = getBlockList(); - const newBlockIds = new Set( newBlockList.map( ( block ) => block.clientId ) ); + let unsubscribe: () => void; + const initialize = () => { + let previousBlocks = select( 'core/block-editor' ).getBlocks(); - if ( newBlockIds.size !== lastBlockIds.size ) { - const blocksAdded = newBlockIds.size > lastBlockIds.size; - const changedBlockList = blocksAdded ? newBlockList : Array.from( lastBlockIds ); + /** + * Checks if blocks have been added or removed and sends telemetry events accordingly. + * + * @since 3.14.0 + */ + const checkBlocks = () => { + const currentBlocks = select( 'core/block-editor' ).getBlocks(); + const currentBlockIds = currentBlocks.map( ( block ) => block.clientId ); + const previousBlockIds = previousBlocks.map( ( block ) => block.clientId ); - for ( const block of changedBlockList ) { - if ( blocksAdded ) { - // block is a BlockInstance when blocks are added. - const blockInstance = block as BlockInstance; - if ( blockInstance.name.startsWith( parselyBlockPrefix ) && ! lastBlockIds.has( blockInstance.clientId ) ) { - // Telemetry.trackEvent( 'block_added', { block: blockInstance.name } ); - } - } else { - // block is a string (client ID) when blocks are removed. - const clientId = block as string; - if ( ! newBlockIds.has( clientId ) ) { - // Telemetry.trackEvent( 'block_removed', { block: clientId } ); - } + // Find added blocks. + const addedBlocks = currentBlocks.filter( + ( block ) => ! previousBlockIds.includes( block.clientId ), + ); + addedBlocks.forEach( ( block ) => { + if ( block.name.startsWith( parselyBlockPrefix ) ) { + Telemetry.trackEvent( 'block_added', { block: block.name } ); } - } - } + } ); - lastBlockIds = newBlockIds; - } ); + // Find removed blocks. + const removedBlockIds = previousBlockIds.filter( ( id ) => ! currentBlockIds.includes( id ) ); + removedBlockIds.forEach( ( id ) => { + const removedBlock = previousBlocks.find( ( block ) => block.clientId === id ); + if ( removedBlock && removedBlock.name.startsWith( parselyBlockPrefix ) ) { + Telemetry.trackEvent( 'block_removed', { block: removedBlock.name } ); + } + } ); + + // Update the previousBlocks for the next check. + previousBlocks = currentBlocks; + }; + + // Debounce the checkBlocks function to save CPU cycles with the frequent editor updates. + const debouncedCheckBlocks = debounce( checkBlocks, debounceInterval ); + unsubscribe = subscribe( debouncedCheckBlocks, 'core/block-editor' ); + return unsubscribe; + }; + + /** + * Checks if the editor is ready to be monitored. + * It waits for the editor to be clean or to have at least one block, and it resolves when it's ready. + * + * @since 3.14.0 + */ + const isEditorReady = async (): Promise => { + return new Promise( ( resolve ) => { + const unsubscribeEditorReady = subscribe( () => { + if ( select( 'core/editor' ).isCleanNewPost() || select( 'core/block-editor' ).getBlockCount() > 0 ) { + unsubscribeEditorReady(); + resolve(); + } + } ); + } ); + }; + + // Initialize the block change monitor when the editor is ready. + isEditorReady().then( initialize ); return () => { - unsubscribe(); + if ( unsubscribe ) { + unsubscribe(); + } }; }, [] ); From a296e3e54f6634bc6dc218512f06479cc6a64ea6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 01:45:15 +0000 Subject: [PATCH 021/110] build(deps-dev): bump @wordpress/plugins from 6.18.0 to 6.19.0 Bumps [@wordpress/plugins](https://github.com/WordPress/gutenberg/tree/HEAD/packages/plugins) from 6.18.0 to 6.19.0. - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/plugins/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/plugins@6.19.0/packages/plugins) --- updated-dependencies: - dependency-name: "@wordpress/plugins" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 203 +++++----------------------------------------- package.json | 2 +- 2 files changed, 20 insertions(+), 185 deletions(-) diff --git a/package-lock.json b/package-lock.json index 644c7c237..105278e75 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ "@wordpress/hooks": "^3.41.0", "@wordpress/i18n": "^4.41.0", "@wordpress/icons": "^9.42.0", - "@wordpress/plugins": "^6.18.0", + "@wordpress/plugins": "^6.19.0", "@wordpress/scripts": "^27.1.0", "@wordpress/url": "^3.52.0", "@wordpress/wordcount": "^3.50.0", @@ -9006,18 +9006,18 @@ } }, "node_modules/@wordpress/plugins": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/@wordpress/plugins/-/plugins-6.18.0.tgz", - "integrity": "sha512-m2BRJ5BApIMwT2Ck5E5yD8pS3RiIoOvWhzsYWrRqRfwjRhc6K46BreCbkiHgduBaFgzDIWpujlUHkYtdl27RoQ==", + "version": "6.19.0", + "resolved": "https://registry.npmjs.org/@wordpress/plugins/-/plugins-6.19.0.tgz", + "integrity": "sha512-yJ7WinsxebDyKJKHfn1cLVl6Sv6WbREBGJ4L+jzlPM7JRjcAfazpcdzpoa4Y6+31B8dKVZxSVZXurqYIj4U0MQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/components": "^25.16.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/element": "^5.27.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/components": "^26.0.0", + "@wordpress/compose": "^6.28.0", + "@wordpress/element": "^5.28.0", + "@wordpress/hooks": "^3.51.0", + "@wordpress/icons": "^9.42.0", + "@wordpress/is-shallow-equal": "^4.51.0", "memize": "^2.0.1" }, "engines": { @@ -9028,96 +9028,6 @@ "react-dom": "^18.0.0" } }, - "node_modules/@wordpress/plugins/node_modules/@wordpress/components": { - "version": "25.16.0", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", - "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", - "dev": true, - "dependencies": { - "@ariakit/react": "^0.3.12", - "@babel/runtime": "^7.16.0", - "@emotion/cache": "^11.7.1", - "@emotion/css": "^11.7.1", - "@emotion/react": "^11.7.1", - "@emotion/serialize": "^1.0.2", - "@emotion/styled": "^11.6.0", - "@emotion/utils": "^1.0.0", - "@floating-ui/react-dom": "^2.0.1", - "@types/gradient-parser": "0.1.3", - "@types/highlight-words-core": "1.2.1", - "@use-gesture/react": "^10.2.24", - "@wordpress/a11y": "^3.50.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/date": "^4.50.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/escape-html": "^2.50.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/primitives": "^3.48.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/warning": "^2.50.0", - "change-case": "^4.1.2", - "classnames": "^2.3.1", - "colord": "^2.7.0", - "date-fns": "^2.28.0", - "deepmerge": "^4.3.0", - "dom-scroll-into-view": "^1.2.1", - "downshift": "^6.0.15", - "fast-deep-equal": "^3.1.3", - "framer-motion": "^10.13.0", - "gradient-parser": "^0.1.5", - "highlight-words-core": "^1.2.2", - "is-plain-object": "^5.0.0", - "memize": "^2.1.0", - "path-to-regexp": "^6.2.1", - "re-resizable": "^6.4.0", - "react-colorful": "^5.3.1", - "reakit": "^1.3.11", - "remove-accents": "^0.5.0", - "use-lilius": "^2.0.1", - "uuid": "^9.0.1", - "valtio": "1.7.0" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" - } - }, - "node_modules/@wordpress/plugins/node_modules/@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.16.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@wordpress/plugins/node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true, - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/@wordpress/postcss-plugins-preset": { "version": "4.34.0", "resolved": "https://registry.npmjs.org/@wordpress/postcss-plugins-preset/-/postcss-plugins-preset-4.34.0.tgz", @@ -35735,94 +35645,19 @@ } }, "@wordpress/plugins": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/@wordpress/plugins/-/plugins-6.18.0.tgz", - "integrity": "sha512-m2BRJ5BApIMwT2Ck5E5yD8pS3RiIoOvWhzsYWrRqRfwjRhc6K46BreCbkiHgduBaFgzDIWpujlUHkYtdl27RoQ==", + "version": "6.19.0", + "resolved": "https://registry.npmjs.org/@wordpress/plugins/-/plugins-6.19.0.tgz", + "integrity": "sha512-yJ7WinsxebDyKJKHfn1cLVl6Sv6WbREBGJ4L+jzlPM7JRjcAfazpcdzpoa4Y6+31B8dKVZxSVZXurqYIj4U0MQ==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/components": "^25.16.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/element": "^5.27.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/is-shallow-equal": "^4.50.0", + "@wordpress/components": "^26.0.0", + "@wordpress/compose": "^6.28.0", + "@wordpress/element": "^5.28.0", + "@wordpress/hooks": "^3.51.0", + "@wordpress/icons": "^9.42.0", + "@wordpress/is-shallow-equal": "^4.51.0", "memize": "^2.0.1" - }, - "dependencies": { - "@wordpress/components": { - "version": "25.16.0", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", - "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", - "dev": true, - "requires": { - "@ariakit/react": "^0.3.12", - "@babel/runtime": "^7.16.0", - "@emotion/cache": "^11.7.1", - "@emotion/css": "^11.7.1", - "@emotion/react": "^11.7.1", - "@emotion/serialize": "^1.0.2", - "@emotion/styled": "^11.6.0", - "@emotion/utils": "^1.0.0", - "@floating-ui/react-dom": "^2.0.1", - "@types/gradient-parser": "0.1.3", - "@types/highlight-words-core": "1.2.1", - "@use-gesture/react": "^10.2.24", - "@wordpress/a11y": "^3.50.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/date": "^4.50.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/escape-html": "^2.50.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/primitives": "^3.48.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/warning": "^2.50.0", - "change-case": "^4.1.2", - "classnames": "^2.3.1", - "colord": "^2.7.0", - "date-fns": "^2.28.0", - "deepmerge": "^4.3.0", - "dom-scroll-into-view": "^1.2.1", - "downshift": "^6.0.15", - "fast-deep-equal": "^3.1.3", - "framer-motion": "^10.13.0", - "gradient-parser": "^0.1.5", - "highlight-words-core": "^1.2.2", - "is-plain-object": "^5.0.0", - "memize": "^2.1.0", - "path-to-regexp": "^6.2.1", - "re-resizable": "^6.4.0", - "react-colorful": "^5.3.1", - "reakit": "^1.3.11", - "remove-accents": "^0.5.0", - "use-lilius": "^2.0.1", - "uuid": "^9.0.1", - "valtio": "1.7.0" - } - }, - "@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", - "dev": true, - "requires": { - "@babel/runtime": "^7.16.0" - } - }, - "uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true - } } }, "@wordpress/postcss-plugins-preset": { diff --git a/package.json b/package.json index ad816b3b0..4775132aa 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "@wordpress/hooks": "^3.41.0", "@wordpress/i18n": "^4.41.0", "@wordpress/icons": "^9.42.0", - "@wordpress/plugins": "^6.18.0", + "@wordpress/plugins": "^6.19.0", "@wordpress/scripts": "^27.1.0", "@wordpress/url": "^3.52.0", "@wordpress/wordcount": "^3.50.0", From eb56e8aeaea851476ac16b50ebb12f2c641cf563 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 07:25:53 +0000 Subject: [PATCH 022/110] build(deps-dev): bump @wordpress/scripts from 27.1.0 to 27.2.0 (#2211) --- package-lock.json | 286 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 144 insertions(+), 144 deletions(-) diff --git a/package-lock.json b/package-lock.json index 105278e75..bf2b2be85 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,7 +46,7 @@ "@wordpress/i18n": "^4.41.0", "@wordpress/icons": "^9.42.0", "@wordpress/plugins": "^6.19.0", - "@wordpress/scripts": "^27.1.0", + "@wordpress/scripts": "^27.2.0", "@wordpress/url": "^3.52.0", "@wordpress/wordcount": "^3.50.0", "concurrently": "^8.2.2", @@ -7103,9 +7103,9 @@ } }, "node_modules/@wordpress/babel-plugin-import-jsx-pragma": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/babel-plugin-import-jsx-pragma/-/babel-plugin-import-jsx-pragma-4.33.0.tgz", - "integrity": "sha512-CjzruFKWgzU/mO/nnQJ2l9UlzZQpqS60UC6l2vNdJ9oD2nKHR5Oou6kNic3QhWDVJrBf2JUiJJ0TC280bykXmA==", + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@wordpress/babel-plugin-import-jsx-pragma/-/babel-plugin-import-jsx-pragma-4.34.0.tgz", + "integrity": "sha512-DOoUJKvfUc8rdiGqcZND5lauoY4B5+cCuuHLh9AztE1t2DlQJBy6DtP6t1bUZb7BYUWOoWgRflMLtOK3ZTf0cg==", "dev": true, "engines": { "node": ">=14" @@ -7115,9 +7115,9 @@ } }, "node_modules/@wordpress/babel-preset-default": { - "version": "7.34.0", - "resolved": "https://registry.npmjs.org/@wordpress/babel-preset-default/-/babel-preset-default-7.34.0.tgz", - "integrity": "sha512-yjFOllyTktFHtcIEgU3ghXBn8lItzr5mPLf0xdSpe0cHceFYL1hT1oprhgRL+olZweaO96Yfm0qUCCKQfJBWsA==", + "version": "7.35.0", + "resolved": "https://registry.npmjs.org/@wordpress/babel-preset-default/-/babel-preset-default-7.35.0.tgz", + "integrity": "sha512-wgZOezNvzbrJTHn0Cyt8+Si7sb5aJJ+akHOrEgvUUv576LfgWUKHPRz8Ecu1fFlupEp35r1uoQ5J+UviLWrvEg==", "dev": true, "dependencies": { "@babel/core": "^7.16.0", @@ -7126,9 +7126,9 @@ "@babel/preset-env": "^7.16.0", "@babel/preset-typescript": "^7.16.0", "@babel/runtime": "^7.16.0", - "@wordpress/babel-plugin-import-jsx-pragma": "^4.33.0", - "@wordpress/browserslist-config": "^5.33.0", - "@wordpress/warning": "^2.50.0", + "@wordpress/babel-plugin-import-jsx-pragma": "^4.34.0", + "@wordpress/browserslist-config": "^5.34.0", + "@wordpress/warning": "^2.51.0", "browserslist": "^4.21.10", "core-js": "^3.31.0", "react": "^18.2.0" @@ -7138,9 +7138,9 @@ } }, "node_modules/@wordpress/base-styles": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@wordpress/base-styles/-/base-styles-4.41.0.tgz", - "integrity": "sha512-MjPAZeAqvyskDXDp2wGZ0DjtYOQLOydI1WqVIZS4wnIdhsQWQD//VMeXgLrcmCzNyQg+iKTx3o+BzmXVTOD0+w==", + "version": "4.42.0", + "resolved": "https://registry.npmjs.org/@wordpress/base-styles/-/base-styles-4.42.0.tgz", + "integrity": "sha512-CD8nFUg45v70BTsKuS9f/sJsdF8xOkJb2oXd0HikWtuJJ24YQB8bzkeIg+TvD5LnK4pwZeDskODo4QFBsoCwIw==", "dev": true }, "node_modules/@wordpress/blob": { @@ -7565,9 +7565,9 @@ } }, "node_modules/@wordpress/browserslist-config": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/browserslist-config/-/browserslist-config-5.33.0.tgz", - "integrity": "sha512-dv1ZlpqGk8gaSBJPP/Z/1uOuxjtP0EBsHVKInLRu6FWLTJkK8rnCeC3xJT3/2TtJ0rasLC79RoytfhXTOODVwg==", + "version": "5.34.0", + "resolved": "https://registry.npmjs.org/@wordpress/browserslist-config/-/browserslist-config-5.34.0.tgz", + "integrity": "sha512-LafF3XoetOAN99bktOzc9hSOv7cPoQEe0/KPgiw24t77xvRqLuWww+zYbiHAHYSzdBGngrlNwRLgloSifnp+hg==", "dev": true, "engines": { "node": ">=14" @@ -7963,9 +7963,9 @@ } }, "node_modules/@wordpress/dependency-extraction-webpack-plugin": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@wordpress/dependency-extraction-webpack-plugin/-/dependency-extraction-webpack-plugin-5.1.0.tgz", - "integrity": "sha512-W2W+9JNAaGirAtGDSf83pjEKb63DLhgpJGgvMOpEPoRPtucgO6CCm3uMoNkJTpKoxJQ2tSZEymAhF/YdLm+ScQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@wordpress/dependency-extraction-webpack-plugin/-/dependency-extraction-webpack-plugin-5.2.0.tgz", + "integrity": "sha512-BOwGopKL5MocUnmrum9tS+HttzFaY3z5CE6sE2DsoM9BWo6OomM6XC5iNGjbv7KDTmxdxjKr0Yzr6YUeSbNrRA==", "dev": true, "dependencies": { "json2php": "^0.0.7" @@ -8037,14 +8037,14 @@ } }, "node_modules/@wordpress/e2e-test-utils-playwright": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils-playwright/-/e2e-test-utils-playwright-0.18.0.tgz", - "integrity": "sha512-Z8uH1dUzy/STQjOU6eb9nquVK4RC1rUx0gXY/GN1IVNDJvGN/yJxT/gNKmfiL7KpmHvNp2Q5M4bnUT9uiNcM+Q==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils-playwright/-/e2e-test-utils-playwright-0.19.0.tgz", + "integrity": "sha512-iNg5t+fqNZwzBULhe9kMGd36nVlX/WmNeB75wDUKX37fms2ZhiMppj7lt5VGQ82nWDvM+Fq/h89wfioeJKiHhA==", "dev": true, "dependencies": { - "@wordpress/api-fetch": "^6.47.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/url": "^3.51.0", + "@wordpress/api-fetch": "^6.48.0", + "@wordpress/keycodes": "^3.51.0", + "@wordpress/url": "^3.52.0", "change-case": "^4.1.2", "form-data": "^4.0.0", "get-port": "^5.1.1", @@ -8503,16 +8503,16 @@ } }, "node_modules/@wordpress/eslint-plugin": { - "version": "17.7.0", - "resolved": "https://registry.npmjs.org/@wordpress/eslint-plugin/-/eslint-plugin-17.7.0.tgz", - "integrity": "sha512-JSFaCogE0WlZpl0SV4q8DK8G6jwDjEzXRzOsgesWilea4OuVp1KxCamkddTorRNM3QAbjrGuPJ4NYaGrNG9QsA==", + "version": "17.8.0", + "resolved": "https://registry.npmjs.org/@wordpress/eslint-plugin/-/eslint-plugin-17.8.0.tgz", + "integrity": "sha512-Ob0WR21Y9AcX7AFKhj0RtJ1l5odp9+Uq0W5tOMVY0jZBAW0oVF6YeZMbc0zbynPss5PnWljtk0YX3CJCae2p3Q==", "dev": true, "dependencies": { "@babel/eslint-parser": "^7.16.0", "@typescript-eslint/eslint-plugin": "^6.4.1", "@typescript-eslint/parser": "^6.4.1", - "@wordpress/babel-preset-default": "^7.34.0", - "@wordpress/prettier-config": "^3.7.0", + "@wordpress/babel-preset-default": "^7.35.0", + "@wordpress/prettier-config": "^3.8.0", "cosmiconfig": "^7.0.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.25.2", @@ -8775,9 +8775,9 @@ } }, "node_modules/@wordpress/jest-console": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@wordpress/jest-console/-/jest-console-7.21.0.tgz", - "integrity": "sha512-o2vZRlwwJ6WoxRwnFFT5iZzfdc2d9MZvrtwB093RWPNcyK5qVtApji4VN/ieHijB4bjEHGalm0UKfKpt0EDlUQ==", + "version": "7.22.0", + "resolved": "https://registry.npmjs.org/@wordpress/jest-console/-/jest-console-7.22.0.tgz", + "integrity": "sha512-vuTq/VwmXXTDlZzHiFlYQDCAq8xTg/99pHBiKcJwKe13LZgxEwbUtjKp18JzbXb5qS9KPW/EynTiYxpTLn1o7w==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", @@ -8791,12 +8791,12 @@ } }, "node_modules/@wordpress/jest-preset-default": { - "version": "11.21.0", - "resolved": "https://registry.npmjs.org/@wordpress/jest-preset-default/-/jest-preset-default-11.21.0.tgz", - "integrity": "sha512-XAztKOROu02iBsz+Qosv/RYuPWB1XwwlU+FiA5Y68tRztrqFy4b/il+DFg4Jue/zXF7UECWUvosd5ow/GmKa6Q==", + "version": "11.22.0", + "resolved": "https://registry.npmjs.org/@wordpress/jest-preset-default/-/jest-preset-default-11.22.0.tgz", + "integrity": "sha512-OSKGvYOQDWynaA78AUzwMpj8kkUrBSJF/Z8InH84RHV1w30DUMQ0b7pSJzOiPPo72uXDcTiit4hYHvSK20BqbA==", "dev": true, "dependencies": { - "@wordpress/jest-console": "^7.21.0", + "@wordpress/jest-console": "^7.22.0", "babel-jest": "^29.6.2" }, "engines": { @@ -8873,9 +8873,9 @@ } }, "node_modules/@wordpress/npm-package-json-lint-config": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@wordpress/npm-package-json-lint-config/-/npm-package-json-lint-config-4.35.0.tgz", - "integrity": "sha512-QmkhYM4/s+2r3RuolVRRmoUa5o3lFgcHA6I3A9akaSVGZr//4p2p+iXOGmNub9njgGlj7j8SAPN8GUsCO/VqZQ==", + "version": "4.36.0", + "resolved": "https://registry.npmjs.org/@wordpress/npm-package-json-lint-config/-/npm-package-json-lint-config-4.36.0.tgz", + "integrity": "sha512-//BDDFVMHxtXC3JC+76DR8ZbJPI3ltzJ3XLbcn8myG9rlQegbSSqmltVcYoR3CGKFI+IbxY1P8CuzJGRN5EIRA==", "dev": true, "engines": { "node": ">=14" @@ -9029,12 +9029,12 @@ } }, "node_modules/@wordpress/postcss-plugins-preset": { - "version": "4.34.0", - "resolved": "https://registry.npmjs.org/@wordpress/postcss-plugins-preset/-/postcss-plugins-preset-4.34.0.tgz", - "integrity": "sha512-OLQBSLE2q11Ik+WdcO2QfGr/O4X/zJYOGXNsychx/EaMamLzJInFcRL6kGbPX41zPINhadq5x2vFIZI2EC+Uyg==", + "version": "4.35.0", + "resolved": "https://registry.npmjs.org/@wordpress/postcss-plugins-preset/-/postcss-plugins-preset-4.35.0.tgz", + "integrity": "sha512-+DiPMZMZXN/U/7mCY/oYEnttjCx2A+m7WOk3hWZt4JP0zDud10iHGMt+VzYPcQBQqABhK9CfPFWhz0WXinJQCw==", "dev": true, "dependencies": { - "@wordpress/base-styles": "^4.41.0", + "@wordpress/base-styles": "^4.42.0", "autoprefixer": "^10.2.5" }, "engines": { @@ -9161,9 +9161,9 @@ } }, "node_modules/@wordpress/prettier-config": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-3.7.0.tgz", - "integrity": "sha512-JRTc5p7UxtcPkqdSDXSFJoJnVuS510uiRVz8anXEl5nuOx5p+SJAzi9QPrxTgOE8bN3wRABH4eIhfOcta4CFdg==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-3.8.0.tgz", + "integrity": "sha512-xKhhI73uTM3UeK7MYjCeyqGgyZvXic4t0rXKiERN6j4aBH7TdAflKli1zj9Xiy0AxFwLJcy0SZqxqLcw0JHSzA==", "dev": true, "engines": { "node": ">=14" @@ -9391,24 +9391,24 @@ } }, "node_modules/@wordpress/scripts": { - "version": "27.1.0", - "resolved": "https://registry.npmjs.org/@wordpress/scripts/-/scripts-27.1.0.tgz", - "integrity": "sha512-jewyOxqaNrsct5R1NXv2lT8CA70vzrvpdZHYERCcH9LzKuvrcc32Telm9Jqso6ay1ZgHeIbjHSCd2+r2sBG7hw==", + "version": "27.2.0", + "resolved": "https://registry.npmjs.org/@wordpress/scripts/-/scripts-27.2.0.tgz", + "integrity": "sha512-xkrNYRuXxtkCkxtBWq7H46cgvbBHzfy8VdELqXn5XwK8S+ytDVOe3YUXqhisn9VdPurrjgfgAa/qNMA3xPr90Q==", "dev": true, "dependencies": { "@babel/core": "^7.16.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11", "@svgr/webpack": "^8.0.1", - "@wordpress/babel-preset-default": "^7.34.0", - "@wordpress/browserslist-config": "^5.33.0", - "@wordpress/dependency-extraction-webpack-plugin": "^5.1.0", - "@wordpress/e2e-test-utils-playwright": "^0.18.0", - "@wordpress/eslint-plugin": "^17.7.0", - "@wordpress/jest-preset-default": "^11.21.0", - "@wordpress/npm-package-json-lint-config": "^4.35.0", - "@wordpress/postcss-plugins-preset": "^4.34.0", - "@wordpress/prettier-config": "^3.7.0", - "@wordpress/stylelint-config": "^21.33.0", + "@wordpress/babel-preset-default": "^7.35.0", + "@wordpress/browserslist-config": "^5.34.0", + "@wordpress/dependency-extraction-webpack-plugin": "^5.2.0", + "@wordpress/e2e-test-utils-playwright": "^0.19.0", + "@wordpress/eslint-plugin": "^17.8.0", + "@wordpress/jest-preset-default": "^11.22.0", + "@wordpress/npm-package-json-lint-config": "^4.36.0", + "@wordpress/postcss-plugins-preset": "^4.35.0", + "@wordpress/prettier-config": "^3.8.0", + "@wordpress/stylelint-config": "^21.34.0", "adm-zip": "^0.5.9", "babel-jest": "^29.6.2", "babel-loader": "^8.2.3", @@ -9903,9 +9903,9 @@ } }, "node_modules/@wordpress/stylelint-config": { - "version": "21.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/stylelint-config/-/stylelint-config-21.33.0.tgz", - "integrity": "sha512-DwjXrjRBva0tkYILvDV7rjl3VaKXxvchlxnFfFs6l2DWL/Qo31CJ+f2rVw4XSWuuWxY1EsyIn9tOBS9URloWTQ==", + "version": "21.34.0", + "resolved": "https://registry.npmjs.org/@wordpress/stylelint-config/-/stylelint-config-21.34.0.tgz", + "integrity": "sha512-Zou/Y6vdMWnAMzcPNH4yZoKkd8h22DyYO4jyC58ChPEF3O7csvmjpbnDloAr5/MOgCz91hnSkZmiKG0zp8VE6w==", "dev": true, "dependencies": { "stylelint-config-recommended": "^6.0.0", @@ -11292,9 +11292,9 @@ } }, "node_modules/builtins/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -21992,9 +21992,9 @@ } }, "node_modules/normalize-package-data/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -22216,9 +22216,9 @@ } }, "node_modules/npm-package-json-lint/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -34134,16 +34134,16 @@ } }, "@wordpress/babel-plugin-import-jsx-pragma": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/babel-plugin-import-jsx-pragma/-/babel-plugin-import-jsx-pragma-4.33.0.tgz", - "integrity": "sha512-CjzruFKWgzU/mO/nnQJ2l9UlzZQpqS60UC6l2vNdJ9oD2nKHR5Oou6kNic3QhWDVJrBf2JUiJJ0TC280bykXmA==", + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@wordpress/babel-plugin-import-jsx-pragma/-/babel-plugin-import-jsx-pragma-4.34.0.tgz", + "integrity": "sha512-DOoUJKvfUc8rdiGqcZND5lauoY4B5+cCuuHLh9AztE1t2DlQJBy6DtP6t1bUZb7BYUWOoWgRflMLtOK3ZTf0cg==", "dev": true, "requires": {} }, "@wordpress/babel-preset-default": { - "version": "7.34.0", - "resolved": "https://registry.npmjs.org/@wordpress/babel-preset-default/-/babel-preset-default-7.34.0.tgz", - "integrity": "sha512-yjFOllyTktFHtcIEgU3ghXBn8lItzr5mPLf0xdSpe0cHceFYL1hT1oprhgRL+olZweaO96Yfm0qUCCKQfJBWsA==", + "version": "7.35.0", + "resolved": "https://registry.npmjs.org/@wordpress/babel-preset-default/-/babel-preset-default-7.35.0.tgz", + "integrity": "sha512-wgZOezNvzbrJTHn0Cyt8+Si7sb5aJJ+akHOrEgvUUv576LfgWUKHPRz8Ecu1fFlupEp35r1uoQ5J+UviLWrvEg==", "dev": true, "requires": { "@babel/core": "^7.16.0", @@ -34152,18 +34152,18 @@ "@babel/preset-env": "^7.16.0", "@babel/preset-typescript": "^7.16.0", "@babel/runtime": "^7.16.0", - "@wordpress/babel-plugin-import-jsx-pragma": "^4.33.0", - "@wordpress/browserslist-config": "^5.33.0", - "@wordpress/warning": "^2.50.0", + "@wordpress/babel-plugin-import-jsx-pragma": "^4.34.0", + "@wordpress/browserslist-config": "^5.34.0", + "@wordpress/warning": "^2.51.0", "browserslist": "^4.21.10", "core-js": "^3.31.0", "react": "^18.2.0" } }, "@wordpress/base-styles": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@wordpress/base-styles/-/base-styles-4.41.0.tgz", - "integrity": "sha512-MjPAZeAqvyskDXDp2wGZ0DjtYOQLOydI1WqVIZS4wnIdhsQWQD//VMeXgLrcmCzNyQg+iKTx3o+BzmXVTOD0+w==", + "version": "4.42.0", + "resolved": "https://registry.npmjs.org/@wordpress/base-styles/-/base-styles-4.42.0.tgz", + "integrity": "sha512-CD8nFUg45v70BTsKuS9f/sJsdF8xOkJb2oXd0HikWtuJJ24YQB8bzkeIg+TvD5LnK4pwZeDskODo4QFBsoCwIw==", "dev": true }, "@wordpress/blob": { @@ -34519,9 +34519,9 @@ } }, "@wordpress/browserslist-config": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/browserslist-config/-/browserslist-config-5.33.0.tgz", - "integrity": "sha512-dv1ZlpqGk8gaSBJPP/Z/1uOuxjtP0EBsHVKInLRu6FWLTJkK8rnCeC3xJT3/2TtJ0rasLC79RoytfhXTOODVwg==", + "version": "5.34.0", + "resolved": "https://registry.npmjs.org/@wordpress/browserslist-config/-/browserslist-config-5.34.0.tgz", + "integrity": "sha512-LafF3XoetOAN99bktOzc9hSOv7cPoQEe0/KPgiw24t77xvRqLuWww+zYbiHAHYSzdBGngrlNwRLgloSifnp+hg==", "dev": true }, "@wordpress/commands": { @@ -34840,9 +34840,9 @@ } }, "@wordpress/dependency-extraction-webpack-plugin": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@wordpress/dependency-extraction-webpack-plugin/-/dependency-extraction-webpack-plugin-5.1.0.tgz", - "integrity": "sha512-W2W+9JNAaGirAtGDSf83pjEKb63DLhgpJGgvMOpEPoRPtucgO6CCm3uMoNkJTpKoxJQ2tSZEymAhF/YdLm+ScQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@wordpress/dependency-extraction-webpack-plugin/-/dependency-extraction-webpack-plugin-5.2.0.tgz", + "integrity": "sha512-BOwGopKL5MocUnmrum9tS+HttzFaY3z5CE6sE2DsoM9BWo6OomM6XC5iNGjbv7KDTmxdxjKr0Yzr6YUeSbNrRA==", "dev": true, "requires": { "json2php": "^0.0.7" @@ -34892,14 +34892,14 @@ } }, "@wordpress/e2e-test-utils-playwright": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils-playwright/-/e2e-test-utils-playwright-0.18.0.tgz", - "integrity": "sha512-Z8uH1dUzy/STQjOU6eb9nquVK4RC1rUx0gXY/GN1IVNDJvGN/yJxT/gNKmfiL7KpmHvNp2Q5M4bnUT9uiNcM+Q==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils-playwright/-/e2e-test-utils-playwright-0.19.0.tgz", + "integrity": "sha512-iNg5t+fqNZwzBULhe9kMGd36nVlX/WmNeB75wDUKX37fms2ZhiMppj7lt5VGQ82nWDvM+Fq/h89wfioeJKiHhA==", "dev": true, "requires": { - "@wordpress/api-fetch": "^6.47.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/url": "^3.51.0", + "@wordpress/api-fetch": "^6.48.0", + "@wordpress/keycodes": "^3.51.0", + "@wordpress/url": "^3.52.0", "change-case": "^4.1.2", "form-data": "^4.0.0", "get-port": "^5.1.1", @@ -35271,16 +35271,16 @@ } }, "@wordpress/eslint-plugin": { - "version": "17.7.0", - "resolved": "https://registry.npmjs.org/@wordpress/eslint-plugin/-/eslint-plugin-17.7.0.tgz", - "integrity": "sha512-JSFaCogE0WlZpl0SV4q8DK8G6jwDjEzXRzOsgesWilea4OuVp1KxCamkddTorRNM3QAbjrGuPJ4NYaGrNG9QsA==", + "version": "17.8.0", + "resolved": "https://registry.npmjs.org/@wordpress/eslint-plugin/-/eslint-plugin-17.8.0.tgz", + "integrity": "sha512-Ob0WR21Y9AcX7AFKhj0RtJ1l5odp9+Uq0W5tOMVY0jZBAW0oVF6YeZMbc0zbynPss5PnWljtk0YX3CJCae2p3Q==", "dev": true, "requires": { "@babel/eslint-parser": "^7.16.0", "@typescript-eslint/eslint-plugin": "^6.4.1", "@typescript-eslint/parser": "^6.4.1", - "@wordpress/babel-preset-default": "^7.34.0", - "@wordpress/prettier-config": "^3.7.0", + "@wordpress/babel-preset-default": "^7.35.0", + "@wordpress/prettier-config": "^3.8.0", "cosmiconfig": "^7.0.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.25.2", @@ -35472,9 +35472,9 @@ } }, "@wordpress/jest-console": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@wordpress/jest-console/-/jest-console-7.21.0.tgz", - "integrity": "sha512-o2vZRlwwJ6WoxRwnFFT5iZzfdc2d9MZvrtwB093RWPNcyK5qVtApji4VN/ieHijB4bjEHGalm0UKfKpt0EDlUQ==", + "version": "7.22.0", + "resolved": "https://registry.npmjs.org/@wordpress/jest-console/-/jest-console-7.22.0.tgz", + "integrity": "sha512-vuTq/VwmXXTDlZzHiFlYQDCAq8xTg/99pHBiKcJwKe13LZgxEwbUtjKp18JzbXb5qS9KPW/EynTiYxpTLn1o7w==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", @@ -35482,12 +35482,12 @@ } }, "@wordpress/jest-preset-default": { - "version": "11.21.0", - "resolved": "https://registry.npmjs.org/@wordpress/jest-preset-default/-/jest-preset-default-11.21.0.tgz", - "integrity": "sha512-XAztKOROu02iBsz+Qosv/RYuPWB1XwwlU+FiA5Y68tRztrqFy4b/il+DFg4Jue/zXF7UECWUvosd5ow/GmKa6Q==", + "version": "11.22.0", + "resolved": "https://registry.npmjs.org/@wordpress/jest-preset-default/-/jest-preset-default-11.22.0.tgz", + "integrity": "sha512-OSKGvYOQDWynaA78AUzwMpj8kkUrBSJF/Z8InH84RHV1w30DUMQ0b7pSJzOiPPo72uXDcTiit4hYHvSK20BqbA==", "dev": true, "requires": { - "@wordpress/jest-console": "^7.21.0", + "@wordpress/jest-console": "^7.22.0", "babel-jest": "^29.6.2" } }, @@ -35539,9 +35539,9 @@ } }, "@wordpress/npm-package-json-lint-config": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@wordpress/npm-package-json-lint-config/-/npm-package-json-lint-config-4.35.0.tgz", - "integrity": "sha512-QmkhYM4/s+2r3RuolVRRmoUa5o3lFgcHA6I3A9akaSVGZr//4p2p+iXOGmNub9njgGlj7j8SAPN8GUsCO/VqZQ==", + "version": "4.36.0", + "resolved": "https://registry.npmjs.org/@wordpress/npm-package-json-lint-config/-/npm-package-json-lint-config-4.36.0.tgz", + "integrity": "sha512-//BDDFVMHxtXC3JC+76DR8ZbJPI3ltzJ3XLbcn8myG9rlQegbSSqmltVcYoR3CGKFI+IbxY1P8CuzJGRN5EIRA==", "dev": true, "requires": {} }, @@ -35661,12 +35661,12 @@ } }, "@wordpress/postcss-plugins-preset": { - "version": "4.34.0", - "resolved": "https://registry.npmjs.org/@wordpress/postcss-plugins-preset/-/postcss-plugins-preset-4.34.0.tgz", - "integrity": "sha512-OLQBSLE2q11Ik+WdcO2QfGr/O4X/zJYOGXNsychx/EaMamLzJInFcRL6kGbPX41zPINhadq5x2vFIZI2EC+Uyg==", + "version": "4.35.0", + "resolved": "https://registry.npmjs.org/@wordpress/postcss-plugins-preset/-/postcss-plugins-preset-4.35.0.tgz", + "integrity": "sha512-+DiPMZMZXN/U/7mCY/oYEnttjCx2A+m7WOk3hWZt4JP0zDud10iHGMt+VzYPcQBQqABhK9CfPFWhz0WXinJQCw==", "dev": true, "requires": { - "@wordpress/base-styles": "^4.41.0", + "@wordpress/base-styles": "^4.42.0", "autoprefixer": "^10.2.5" } }, @@ -35765,9 +35765,9 @@ } }, "@wordpress/prettier-config": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-3.7.0.tgz", - "integrity": "sha512-JRTc5p7UxtcPkqdSDXSFJoJnVuS510uiRVz8anXEl5nuOx5p+SJAzi9QPrxTgOE8bN3wRABH4eIhfOcta4CFdg==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-3.8.0.tgz", + "integrity": "sha512-xKhhI73uTM3UeK7MYjCeyqGgyZvXic4t0rXKiERN6j4aBH7TdAflKli1zj9Xiy0AxFwLJcy0SZqxqLcw0JHSzA==", "dev": true, "requires": {} }, @@ -35941,24 +35941,24 @@ } }, "@wordpress/scripts": { - "version": "27.1.0", - "resolved": "https://registry.npmjs.org/@wordpress/scripts/-/scripts-27.1.0.tgz", - "integrity": "sha512-jewyOxqaNrsct5R1NXv2lT8CA70vzrvpdZHYERCcH9LzKuvrcc32Telm9Jqso6ay1ZgHeIbjHSCd2+r2sBG7hw==", + "version": "27.2.0", + "resolved": "https://registry.npmjs.org/@wordpress/scripts/-/scripts-27.2.0.tgz", + "integrity": "sha512-xkrNYRuXxtkCkxtBWq7H46cgvbBHzfy8VdELqXn5XwK8S+ytDVOe3YUXqhisn9VdPurrjgfgAa/qNMA3xPr90Q==", "dev": true, "requires": { "@babel/core": "^7.16.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11", "@svgr/webpack": "^8.0.1", - "@wordpress/babel-preset-default": "^7.34.0", - "@wordpress/browserslist-config": "^5.33.0", - "@wordpress/dependency-extraction-webpack-plugin": "^5.1.0", - "@wordpress/e2e-test-utils-playwright": "^0.18.0", - "@wordpress/eslint-plugin": "^17.7.0", - "@wordpress/jest-preset-default": "^11.21.0", - "@wordpress/npm-package-json-lint-config": "^4.35.0", - "@wordpress/postcss-plugins-preset": "^4.34.0", - "@wordpress/prettier-config": "^3.7.0", - "@wordpress/stylelint-config": "^21.33.0", + "@wordpress/babel-preset-default": "^7.35.0", + "@wordpress/browserslist-config": "^5.34.0", + "@wordpress/dependency-extraction-webpack-plugin": "^5.2.0", + "@wordpress/e2e-test-utils-playwright": "^0.19.0", + "@wordpress/eslint-plugin": "^17.8.0", + "@wordpress/jest-preset-default": "^11.22.0", + "@wordpress/npm-package-json-lint-config": "^4.36.0", + "@wordpress/postcss-plugins-preset": "^4.35.0", + "@wordpress/prettier-config": "^3.8.0", + "@wordpress/stylelint-config": "^21.34.0", "adm-zip": "^0.5.9", "babel-jest": "^29.6.2", "babel-loader": "^8.2.3", @@ -36336,9 +36336,9 @@ } }, "@wordpress/stylelint-config": { - "version": "21.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/stylelint-config/-/stylelint-config-21.33.0.tgz", - "integrity": "sha512-DwjXrjRBva0tkYILvDV7rjl3VaKXxvchlxnFfFs6l2DWL/Qo31CJ+f2rVw4XSWuuWxY1EsyIn9tOBS9URloWTQ==", + "version": "21.34.0", + "resolved": "https://registry.npmjs.org/@wordpress/stylelint-config/-/stylelint-config-21.34.0.tgz", + "integrity": "sha512-Zou/Y6vdMWnAMzcPNH4yZoKkd8h22DyYO4jyC58ChPEF3O7csvmjpbnDloAr5/MOgCz91hnSkZmiKG0zp8VE6w==", "dev": true, "requires": { "stylelint-config-recommended": "^6.0.0", @@ -37373,9 +37373,9 @@ } }, "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -45429,9 +45429,9 @@ } }, "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -45592,9 +45592,9 @@ } }, "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "requires": { "lru-cache": "^6.0.0" diff --git a/package.json b/package.json index 4775132aa..5ca25067d 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "@wordpress/i18n": "^4.41.0", "@wordpress/icons": "^9.42.0", "@wordpress/plugins": "^6.19.0", - "@wordpress/scripts": "^27.1.0", + "@wordpress/scripts": "^27.2.0", "@wordpress/url": "^3.52.0", "@wordpress/wordcount": "^3.50.0", "concurrently": "^8.2.2", From 6e08650ebf23cdb6e929fcb284c95eac194400f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 07:32:04 +0000 Subject: [PATCH 023/110] build(deps-dev): bump @wordpress/wordcount from 3.50.0 to 3.51.0 (#2209) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index bf2b2be85..a3d7d4869 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,7 +48,7 @@ "@wordpress/plugins": "^6.19.0", "@wordpress/scripts": "^27.2.0", "@wordpress/url": "^3.52.0", - "@wordpress/wordcount": "^3.50.0", + "@wordpress/wordcount": "^3.51.0", "concurrently": "^8.2.2", "eslint-plugin-jest": "^27.6.3", "husky": "^9.0.10", @@ -10120,9 +10120,9 @@ } }, "node_modules/@wordpress/wordcount": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/wordcount/-/wordcount-3.50.0.tgz", - "integrity": "sha512-lRfIX3B9ha//bqsUihym2BnOiAsdDQr22vdy0wZIpm5G2tFvTddCKHy0YClf52IJK0z61WqbNuF9hrvzWWxL+g==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/wordcount/-/wordcount-3.51.0.tgz", + "integrity": "sha512-H5pkrHjR2iJN5jZZQpPvC7VDb4t4EnYBBPjOVy29GUbX6ndbz0O9GcW2GKScW7napBNG0KjAS+YoJzceIr4c/Q==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -36507,9 +36507,9 @@ } }, "@wordpress/wordcount": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/wordcount/-/wordcount-3.50.0.tgz", - "integrity": "sha512-lRfIX3B9ha//bqsUihym2BnOiAsdDQr22vdy0wZIpm5G2tFvTddCKHy0YClf52IJK0z61WqbNuF9hrvzWWxL+g==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/wordcount/-/wordcount-3.51.0.tgz", + "integrity": "sha512-H5pkrHjR2iJN5jZZQpPvC7VDb4t4EnYBBPjOVy29GUbX6ndbz0O9GcW2GKScW7napBNG0KjAS+YoJzceIr4c/Q==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" diff --git a/package.json b/package.json index 5ca25067d..7479d4a02 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "@wordpress/plugins": "^6.19.0", "@wordpress/scripts": "^27.2.0", "@wordpress/url": "^3.52.0", - "@wordpress/wordcount": "^3.50.0", + "@wordpress/wordcount": "^3.51.0", "concurrently": "^8.2.2", "eslint-plugin-jest": "^27.6.3", "husky": "^9.0.10", From 86ae963af4f78c3b118876b558880e1a195cad45 Mon Sep 17 00:00:00 2001 From: Henrique Mouta Date: Tue, 13 Feb 2024 11:43:15 +0000 Subject: [PATCH 024/110] PCH Settings: Refactor to the client-side Settings API (#2193) * Refactor client-side Settings API to use a context provider and a store instead. * Add missing build files. * Move settings handling from outside the PCH Editor sidebar component to the individual components * Fix Title Suggestion using wrong setting for isOpen in the Settings component * Address SonarCloud complains * Address issue with settings override when updating with different contexts. * Update some DocBlocks * Fix issue with duplicated HTTP requests to save the settings * Rename store to have a hyphen --------- Co-authored-by: Alex Cicovic <23142906+acicovic@users.noreply.github.com> --- .../content-helper/dashboard-widget.asset.php | 2 +- build/content-helper/dashboard-widget.js | 2 +- build/content-helper/editor-sidebar.asset.php | 2 +- build/content-helper/editor-sidebar.js | 22 +- .../common/hooks/useSaveSettings.ts | 49 ---- src/content-helper/common/settings/index.ts | 35 +++ .../common/settings/provider.tsx | 183 ++++++++++++++ src/content-helper/common/settings/store.ts | 83 +++++++ .../common/settings/types/index.ts | 17 ++ .../settings/types/sidebar-settings.d.ts | 21 ++ .../settings/types/top-posts-settings.d.ts | 12 + .../dashboard-widget/components/top-posts.tsx | 62 +---- .../dashboard-widget/dashboard-widget.tsx | 49 +++- .../dashboard-widget/provider.ts | 2 +- .../editor-sidebar/editor-sidebar.tsx | 232 +++++++----------- .../related-top-posts/component-list.tsx | 31 ++- .../title-suggestions/component-settings.tsx | 2 +- .../title-suggestions/component.tsx | 36 +-- tests/js/content-helper/structure.test.tsx | 3 - 19 files changed, 542 insertions(+), 303 deletions(-) delete mode 100644 src/content-helper/common/hooks/useSaveSettings.ts create mode 100644 src/content-helper/common/settings/index.ts create mode 100644 src/content-helper/common/settings/provider.tsx create mode 100644 src/content-helper/common/settings/store.ts create mode 100644 src/content-helper/common/settings/types/index.ts create mode 100644 src/content-helper/common/settings/types/sidebar-settings.d.ts create mode 100644 src/content-helper/common/settings/types/top-posts-settings.d.ts diff --git a/build/content-helper/dashboard-widget.asset.php b/build/content-helper/dashboard-widget.asset.php index 0ca283f0b..4a607a954 100644 --- a/build/content-helper/dashboard-widget.asset.php +++ b/build/content-helper/dashboard-widget.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '4a49c9901d461440c000'); + array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '89c5f808aac7a7a8501f'); diff --git a/build/content-helper/dashboard-widget.js b/build/content-helper/dashboard-widget.js index 3aac52622..d008f6add 100644 --- a/build/content-helper/dashboard-widget.js +++ b/build/content-helper/dashboard-widget.js @@ -1 +1 @@ -!function(){"use strict";var e={251:function(e,t,r){var n=r(196),a=Symbol.for("react.element"),s=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,s={},c=null,u=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,n)&&!l.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===s[n]&&(s[n]=t[n]);return{$$typeof:a,type:e,key:c,ref:u,props:s,_owner:o.current}}t.Fragment=s,t.jsx=c,t.jsxs=c},893:function(e,t,r){e.exports=r(251)},196:function(e){e.exports=window.React}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e,t,n,a=r(893),s=window.wp.element,i=function(e){void 0===e&&(e=null);var t="";(null==e?void 0:e.children)&&(t=e.children);var r="content-helper-error-message";return(null==e?void 0:e.className)&&(r+=" "+e.className),(0,a.jsx)("div",{className:r,"data-testid":null==e?void 0:e.testId,dangerouslySetInnerHTML:{__html:t}})},o=function(e){return void 0===e&&(e=null),(0,a.jsx)(i,{className:null==e?void 0:e.className,testId:"empty-credentials-message",children:window.wpParselyEmptyCredentialsMessage})},l=function(){return l=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]=1e4&&(clearInterval(s),r("Telemetry library not loaded"))}),100);else r("Telemetry not enabled")}))},e.prototype.trackEvent=function(t,r){var n;this.isLoaded?(0!==t.indexOf(e.TRACKS_PREFIX)&&(t=e.TRACKS_PREFIX+t),this.isEventNameValid(t)?(r=this.prepareProperties(r),null===(n=this._tkq)||void 0===n||n.push(["recordEvent",t,r])):console.error("Error tracking event: Invalid event name")):console.error("Error tracking event: Telemetry not loaded")},e.prototype.isTelemetryEnabled=function(){return this.isEnabled},e.prototype.isProprietyValid=function(t){return e.PROPERTY_REGEX.test(t)},e.prototype.isEventNameValid=function(t){return e.EVENT_NAME_REGEX.test(t)},e.prototype.prepareProperties=function(e){return(e=this.sanitizeProperties(e)).parsely_version=wpParselyTracksTelemetry.version,wpParselyTracksTelemetry.user&&(e._ut=wpParselyTracksTelemetry.user.type,e._ui=wpParselyTracksTelemetry.user.id),wpParselyTracksTelemetry.vipgo_env&&(e.vipgo_env=wpParselyTracksTelemetry.vipgo_env),this.sanitizeProperties(e)},e.prototype.sanitizeProperties=function(e){var t=this,r={};return Object.keys(e).forEach((function(n){t.isProprietyValid(n)&&(r[n]=e[n])})),r},e.TRACKS_PREFIX="wpparsely_",e.EVENT_NAME_REGEX=/^(([a-z0-9]+)_){2}([a-z0-9_]+)$/,e.PROPERTY_REGEX=/^[a-z_][a-z0-9_]*$/,e}(),h=(d.trackEvent,window.wp.apiFetch),f=r.n(h),y=function(e){var t=e.defaultValue,r=e.items,n=e.onChange;return(0,a.jsx)("select",{onChange:n,value:t,children:r.map((function(e){return(0,a.jsx)("option",{value:e[0],children:e[1]},e[0])}))})};!function(e){e.Minutes10="10m",e.Hour="1h",e.Hours2="2h",e.Hours4="4h",e.Hours24="24h",e.Days7="7d",e.Days30="30d"}(e||(e={})),function(e){e.Views="views",e.AvgEngaged="avg_engaged"}(t||(t={})),function(e){e.Author="author",e.Section="section",e.Tag="tag",e.Unavailable="unavailable"}(n||(n={}));var v=function(e,t){return Object.values(t).includes(e)};function w(e,t){void 0===t&&(t=!1);var r=parseInt(e,10),n=e.charAt(e.length-1),a=(0,p.__)("Unknown Period","wp-parsely");switch(n){case"m":if(1===r){a=(0,p.__)("Last Minute","wp-parsely");break}a=(0,p.sprintf)(/* translators: 1: Number of minutes */(0,p._n)("Last %1$d Minute","Last %1$d Minutes",r,"wp-parsely"),r);break;case"h":if(1===r){a=(0,p.__)("Last Hour","wp-parsely");break}a=(0,p.sprintf)(/* translators: 1: Number of hours */(0,p._n)("Last %1$d Hour","Last %1$d Hours",r,"wp-parsely"),r);break;case"d":if(1===r){a=(0,p.__)("Last Day","wp-parsely");break}a=(0,p.sprintf)(/* translators: 1: Number of days */(0,p._n)("Last %1$d Day","Last %1$d Days",r,"wp-parsely"),r)}return t?a.toLocaleLowerCase():a}function _(e){switch(e){case t.Views:return(0,p.__)("Page Views","wp-parsely");case t.AvgEngaged:return(0,p.__)("Avg. Time","wp-parsely");default:return(0,p.__)("Unknown Metric","wp-parsely")}}var m,g,b=window.wp.url,P=(m=function(e,t){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},m(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});!function(e){e.CannotFormulateApiQuery="ch_cannot_formulate_api_query",e.FetchError="fetch_error",e.HttpRequestFailed="http_request_failed",e[e.ParselyApiForbidden=403]="ParselyApiForbidden",e.ParselyApiResponseContainsError="ch_response_contains_error",e.ParselyApiReturnedNoData="ch_parsely_api_returned_no_data",e.ParselyApiReturnedTooManyResults="ch_parsely_api_returned_too_many_results",e[e.ParselyApiUnauthorized=401]="ParselyApiUnauthorized",e.PluginCredentialsNotSetMessageDetected="parsely_credentials_not_set_message_detected",e.PluginSettingsApiSecretNotSet="parsely_api_secret_not_set",e.PluginSettingsSiteIdNotSet="parsely_site_id_not_set",e.PostIsNotPublished="ch_post_not_published"}(g||(g={}));var x=function(e){function t(r,n,a){void 0===a&&(a=(0,p.__)("Error: ","wp-parsely"));var s=e.call(this,a+r)||this;s.hint=null,s.name=s.constructor.name,s.code=n;var i=[g.ParselyApiForbidden,g.ParselyApiResponseContainsError,g.ParselyApiReturnedNoData,g.ParselyApiReturnedTooManyResults,g.ParselyApiUnauthorized,g.PluginCredentialsNotSetMessageDetected,g.PluginSettingsApiSecretNotSet,g.PluginSettingsSiteIdNotSet,g.PostIsNotPublished];return s.retryFetch=!i.includes(s.code),Object.setPrototypeOf(s,t.prototype),s}return P(t,e),t.prototype.Message=function(e){return void 0===e&&(e=null),[g.PluginCredentialsNotSetMessageDetected,g.PluginSettingsSiteIdNotSet,g.PluginSettingsApiSecretNotSet].includes(this.code)?o(e):(this.code===g.FetchError&&(this.hint=this.Hint((0,p.__)("This error can sometimes be caused by ad-blockers or browser tracking protections. Please add this site to any applicable allow lists and try again.","wp-parsely"))),this.code===g.ParselyApiForbidden&&(this.hint=this.Hint((0,p.__)("Please ensure that the Site ID and API Secret given in the plugin's settings are correct.","wp-parsely"))),this.code===g.HttpRequestFailed&&(this.hint=this.Hint((0,p.__)("The Parse.ly API cannot be reached. Please verify that you are online.","wp-parsely"))),this.code===g.ParselyApiUnauthorized&&(this.message=(0,p.__)("This feature is accessible to select customers participating in its beta testing.","wp-parsely")),(0,a.jsx)(i,{className:null==e?void 0:e.className,testId:"error",children:"

".concat(this.message,"

").concat(this.hint?this.hint:"")}))},t.prototype.Hint=function(e){return'

'.concat((0,p.__)("Hint:","wp-parsely")," ").concat(e,"

")},t}(Error),j={month:"short",day:"numeric",year:"numeric"},E={month:"short",day:"numeric"},N=(0,p.__)("Date N/A","wp-parsely");function T(e){if(!1===function(e){return!isNaN(+e)&&0!==e.getTime()}(e))return N;var t=j;return e.getUTCFullYear()===(new Date).getUTCFullYear()&&(t=E),Intl.DateTimeFormat(document.documentElement.lang||"en",t).format(e)}var k=function(){return k=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]=c){var u=t;(a=n/c)%1>1/o&&(u=a>10?1:2),u=parseFloat(a.toFixed(2))===parseFloat(a.toFixed(0))?0:u,s=a.toFixed(u),i=l}o=c})),s+r+i}function L(e){var t=e.metric,r=e.post,n=e.avgEngagedIcon,s=e.viewsIcon;return"views"===t?(0,a.jsxs)("span",{className:"parsely-top-post-metric-data",children:[(0,a.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Number of Views","wp-parsely")}),s,R(r.views.toString())]}):"avg_engaged"===t?(0,a.jsxs)("span",{className:"parsely-top-post-metric-data",children:[(0,a.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Average Time","wp-parsely")}),n,r.avgEngaged]}):(0,a.jsx)("span",{className:"parsely-top-post-metric-data",children:"-"})}function M(e){var t,r=e.metric,n=e.post;return(0,a.jsx)("li",{className:"parsely-top-post",children:(0,a.jsxs)("div",{className:"parsely-top-post-content",children:[(0,a.jsx)(F,{post:n}),(0,a.jsxs)("div",{className:"parsely-top-post-data",children:[(0,a.jsx)(L,{metric:r,post:n}),(0,a.jsx)(V,{post:n}),(0,a.jsxs)("a",{className:"parsely-top-post-icon-link",href:n.url,target:"_blank",rel:"noreferrer",children:[(0,a.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("View Post (opens in new tab)","wp-parsely")}),(0,a.jsx)(I,{})]}),0!==n.postId&&(0,a.jsxs)("a",{className:"parsely-top-post-icon-link",href:(t=n.postId,"/wp-admin/post.php?post=".concat(t,"&action=edit")),target:"_blank",rel:"noreferrer",children:[(0,a.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Edit Post (opens in new tab)","wp-parsely")}),(0,a.jsx)(O,{})]}),(0,a.jsxs)("div",{className:"parsely-top-post-metadata",children:[(0,a.jsxs)("span",{className:"parsely-top-post-date",children:[(0,a.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Date","wp-parsely")}),T(new Date(n.date))]}),(0,a.jsxs)("span",{className:"parsely-top-post-author",children:[(0,a.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Author","wp-parsely")}),n.author]})]})]})]})},n.id)}function F(e){var t=e.post;return t.thumbnailUrl?(0,a.jsxs)("div",{className:"parsely-top-post-thumbnail",children:[(0,a.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Thumbnail","wp-parsely")}),(0,a.jsx)("img",{src:t.thumbnailUrl,alt:(0,p.__)("Post thumbnail","wp-parsely")})]}):(0,a.jsx)("div",{className:"parsely-top-post-thumbnail",children:(0,a.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Post thumbnail not available","wp-parsely")})})}function V(e){var t=e.post;return(0,a.jsxs)("a",{className:"parsely-top-post-title",href:t.dashUrl,target:"_blank",rel:"noreferrer",children:[(0,a.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("View in Parse.ly (opens in new tab)","wp-parsely")}),t.title]})}var D=function(){return D=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]0&&e.retryFetch?[4,new Promise((function(e){return setTimeout(e,500)}))]:[3,3];case 1:return r.sent(),[4,t(n-1)];case 2:return r.sent(),[3,4];case 3:h(!1),b(e),r.label=4;case 4:return[2]}}))}))})),[2]}))}))};return h(!0),t(1),function(){h(!1),j([]),b(void 0)}}),[i,N]);var k=function(e,t){d.trackEvent("dash_widget_filter_changed",D({filter:e},t))},S=(0,a.jsxs)("div",{className:"parsely-top-posts-filters",children:[(0,a.jsx)(y,{defaultValue:i.Period,items:Object.values(e).map((function(e){return[e,w(e)]})),onChange:function(t){v(t.target.value,e)&&(o(D(D({},i),{Period:t.target.value})),k("period",{period:t.target.value}),T(1))}}),(0,a.jsx)(y,{defaultValue:i.Metric,items:Object.values(t).map((function(e){return[e,_(e)]})),onChange:function(e){v(e.target.value,t)&&(o(D(D({},i),{Metric:e.target.value})),k("metric",{metric:e.target.value}),T(1))}})]}),C=(0,a.jsxs)("div",{className:"parsely-top-posts-navigation",children:[(0,a.jsx)("button",{className:"parsely-top-posts-navigation-prev",disabled:N<=1,"aria-label":(0,p.__)("Previous page","wp-parsely"),onClick:function(){T(N-1),d.trackEvent("dash_widget_navigation",{navigation:"previous",to_page:N-1})},children:(0,p.__)("<< Previous","wp-parsely")}),(0,p.sprintf)(/* translators: 1: Current page */(0,p.__)("Page %1$d","wp-parsely"),N),(0,a.jsx)("button",{className:"parsely-top-posts-navigation-next",disabled:!c&&x.length<5,"aria-label":(0,p.__)("Next page","wp-parsely"),onClick:function(){T(N+1),d.trackEvent("dash_widget_navigation",{navigation:"next",to_page:N+1})},children:(0,p.__)("Next >>","wp-parsely")})]});if(g)return(0,a.jsxs)(a.Fragment,{children:[S,g.Message(),N>1&&C]});var O=(0,a.jsx)("div",{className:"parsely-spinner-wrapper",children:(0,a.jsx)(u.Spinner,{})});return(0,a.jsxs)(a.Fragment,{children:[S,c?O:(0,a.jsx)("ol",{className:"parsely-top-posts",style:{counterReset:"item "+5*(N-1)},children:x.map((function(e){return(0,a.jsx)(M,{metric:i.Metric,post:e},e.id)}))}),(x.length>=5||N>1)&&C]})}window.addEventListener("load",(function(){var e=document.querySelector("#wp-parsely-dashboard-widget > .inside");if(null!==e){var t=(0,a.jsx)(c,{children:(0,a.jsx)(z,{})});s.createRoot?(0,s.createRoot)(e).render(t):(0,s.render)(t,e)}}),!1)}()}(); \ No newline at end of file +!function(){"use strict";var e={251:function(e,t,r){var n=r(196),a=Symbol.for("react.element"),s=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,s={},c=null,u=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,n)&&!l.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===s[n]&&(s[n]=t[n]);return{$$typeof:a,type:e,key:c,ref:u,props:s,_owner:o.current}}t.Fragment=s,t.jsx=c,t.jsxs=c},893:function(e,t,r){e.exports=r(251)},196:function(e){e.exports=window.React}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e=r(893),t=window.wp.element,n=window.wp.data,a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]=1e4&&(clearInterval(s),r("Telemetry library not loaded"))}),100);else r("Telemetry not enabled")}))},e.prototype.trackEvent=function(t,r){var n;this.isLoaded?(0!==t.indexOf(e.TRACKS_PREFIX)&&(t=e.TRACKS_PREFIX+t),this.isEventNameValid(t)?(r=this.prepareProperties(r),null===(n=this._tkq)||void 0===n||n.push(["recordEvent",t,r])):console.error("Error tracking event: Invalid event name")):console.error("Error tracking event: Telemetry not loaded")},e.prototype.isTelemetryEnabled=function(){return this.isEnabled},e.prototype.isProprietyValid=function(t){return e.PROPERTY_REGEX.test(t)},e.prototype.isEventNameValid=function(t){return e.EVENT_NAME_REGEX.test(t)},e.prototype.prepareProperties=function(e){return(e=this.sanitizeProperties(e)).parsely_version=wpParselyTracksTelemetry.version,wpParselyTracksTelemetry.user&&(e._ut=wpParselyTracksTelemetry.user.type,e._ui=wpParselyTracksTelemetry.user.id),wpParselyTracksTelemetry.vipgo_env&&(e.vipgo_env=wpParselyTracksTelemetry.vipgo_env),this.sanitizeProperties(e)},e.prototype.sanitizeProperties=function(e){var t=this,r={};return Object.keys(e).forEach((function(n){t.isProprietyValid(n)&&(r[n]=e[n])})),r},e.TRACKS_PREFIX="wpparsely_",e.EVENT_NAME_REGEX=/^(([a-z0-9]+)_){2}([a-z0-9_]+)$/,e.PROPERTY_REGEX=/^[a-z_][a-z0-9_]*$/,e}(),N=(T.trackEvent,function(t){var r=t.defaultValue,n=t.items,a=t.onChange;return(0,e.jsx)("select",{onChange:a,value:r,children:n.map((function(t){return(0,e.jsx)("option",{value:t[0],children:t[1]},t[0])}))})}),k=window.wp.url,C=(m=function(e,t){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},m(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});!function(e){e.CannotFormulateApiQuery="ch_cannot_formulate_api_query",e.FetchError="fetch_error",e.HttpRequestFailed="http_request_failed",e[e.ParselyApiForbidden=403]="ParselyApiForbidden",e.ParselyApiResponseContainsError="ch_response_contains_error",e.ParselyApiReturnedNoData="ch_parsely_api_returned_no_data",e.ParselyApiReturnedTooManyResults="ch_parsely_api_returned_too_many_results",e[e.ParselyApiUnauthorized=401]="ParselyApiUnauthorized",e.PluginCredentialsNotSetMessageDetected="parsely_credentials_not_set_message_detected",e.PluginSettingsApiSecretNotSet="parsely_api_secret_not_set",e.PluginSettingsSiteIdNotSet="parsely_site_id_not_set",e.PostIsNotPublished="ch_post_not_published"}(b||(b={}));var O=function(t){function r(e,n,a){void 0===a&&(a=(0,v.__)("Error: ","wp-parsely"));var s=t.call(this,a+e)||this;s.hint=null,s.name=s.constructor.name,s.code=n;var i=[b.ParselyApiForbidden,b.ParselyApiResponseContainsError,b.ParselyApiReturnedNoData,b.ParselyApiReturnedTooManyResults,b.ParselyApiUnauthorized,b.PluginCredentialsNotSetMessageDetected,b.PluginSettingsApiSecretNotSet,b.PluginSettingsSiteIdNotSet,b.PostIsNotPublished];return s.retryFetch=!i.includes(s.code),Object.setPrototypeOf(s,r.prototype),s}return C(r,t),r.prototype.Message=function(t){return void 0===t&&(t=null),[b.PluginCredentialsNotSetMessageDetected,b.PluginSettingsSiteIdNotSet,b.PluginSettingsApiSecretNotSet].includes(this.code)?x(t):(this.code===b.FetchError&&(this.hint=this.Hint((0,v.__)("This error can sometimes be caused by ad-blockers or browser tracking protections. Please add this site to any applicable allow lists and try again.","wp-parsely"))),this.code===b.ParselyApiForbidden&&(this.hint=this.Hint((0,v.__)("Please ensure that the Site ID and API Secret given in the plugin's settings are correct.","wp-parsely"))),this.code===b.HttpRequestFailed&&(this.hint=this.Hint((0,v.__)("The Parse.ly API cannot be reached. Please verify that you are online.","wp-parsely"))),this.code===b.ParselyApiUnauthorized&&(this.message=(0,v.__)("This feature is accessible to select customers participating in its beta testing.","wp-parsely")),(0,e.jsx)(P,{className:null==t?void 0:t.className,testId:"error",children:"

".concat(this.message,"

").concat(this.hint?this.hint:"")}))},r.prototype.Hint=function(e){return'

'.concat((0,v.__)("Hint:","wp-parsely")," ").concat(e,"

")},r}(Error),A={month:"short",day:"numeric",year:"numeric"},I={month:"short",day:"numeric"},R=(0,v.__)("Date N/A","wp-parsely");function L(e){if(!1===function(e){return!isNaN(+e)&&0!==e.getTime()}(e))return R;var t=A;return e.getUTCFullYear()===(new Date).getUTCFullYear()&&(t=I),Intl.DateTimeFormat(document.documentElement.lang||"en",t).format(e)}var M=function(){return M=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]=c){var u=t;(a=n/c)%1>1/o&&(u=a>10?1:2),u=parseFloat(a.toFixed(2))===parseFloat(a.toFixed(0))?0:u,s=a.toFixed(u),i=l}o=c})),s+r+i}function z(t){var r=t.metric,n=t.post,a=t.avgEngagedIcon,s=t.viewsIcon;return"views"===r?(0,e.jsxs)("span",{className:"parsely-top-post-metric-data",children:[(0,e.jsx)("span",{className:"screen-reader-text",children:(0,v.__)("Number of Views","wp-parsely")}),s,G(n.views.toString())]}):"avg_engaged"===r?(0,e.jsxs)("span",{className:"parsely-top-post-metric-data",children:[(0,e.jsx)("span",{className:"screen-reader-text",children:(0,v.__)("Average Time","wp-parsely")}),a,n.avgEngaged]}):(0,e.jsx)("span",{className:"parsely-top-post-metric-data",children:"-"})}function $(t){var r,n=t.metric,a=t.post;return(0,e.jsx)("li",{className:"parsely-top-post",children:(0,e.jsxs)("div",{className:"parsely-top-post-content",children:[(0,e.jsx)(q,{post:a}),(0,e.jsxs)("div",{className:"parsely-top-post-data",children:[(0,e.jsx)(z,{metric:n,post:a}),(0,e.jsx)(X,{post:a}),(0,e.jsxs)("a",{className:"parsely-top-post-icon-link",href:a.url,target:"_blank",rel:"noreferrer",children:[(0,e.jsx)("span",{className:"screen-reader-text",children:(0,v.__)("View Post (opens in new tab)","wp-parsely")}),(0,e.jsx)(U,{})]}),0!==a.postId&&(0,e.jsxs)("a",{className:"parsely-top-post-icon-link",href:(r=a.postId,"/wp-admin/post.php?post=".concat(r,"&action=edit")),target:"_blank",rel:"noreferrer",children:[(0,e.jsx)("span",{className:"screen-reader-text",children:(0,v.__)("Edit Post (opens in new tab)","wp-parsely")}),(0,e.jsx)(H,{})]}),(0,e.jsxs)("div",{className:"parsely-top-post-metadata",children:[(0,e.jsxs)("span",{className:"parsely-top-post-date",children:[(0,e.jsx)("span",{className:"screen-reader-text",children:(0,v.__)("Date","wp-parsely")}),L(new Date(a.date))]}),(0,e.jsxs)("span",{className:"parsely-top-post-author",children:[(0,e.jsx)("span",{className:"screen-reader-text",children:(0,v.__)("Author","wp-parsely")}),a.author]})]})]})]})},a.id)}function q(t){var r=t.post;return r.thumbnailUrl?(0,e.jsxs)("div",{className:"parsely-top-post-thumbnail",children:[(0,e.jsx)("span",{className:"screen-reader-text",children:(0,v.__)("Thumbnail","wp-parsely")}),(0,e.jsx)("img",{src:r.thumbnailUrl,alt:(0,v.__)("Post thumbnail","wp-parsely")})]}):(0,e.jsx)("div",{className:"parsely-top-post-thumbnail",children:(0,e.jsx)("span",{className:"screen-reader-text",children:(0,v.__)("Post thumbnail not available","wp-parsely")})})}function X(t){var r=t.post;return(0,e.jsxs)("a",{className:"parsely-top-post-title",href:r.dashUrl,target:"_blank",rel:"noreferrer",children:[(0,e.jsx)("span",{className:"screen-reader-text",children:(0,v.__)("View in Parse.ly (opens in new tab)","wp-parsely")}),r.title]})}var Y=function(){return Y=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]0&&e.retryFetch?[4,new Promise((function(e){return setTimeout(e,500)}))]:[3,3];case 1:return r.sent(),[4,t(n-1)];case 2:return r.sent(),[3,4];case 3:l(!1),d(e),r.label=4;case 4:return[2]}}))}))})),[2]}))}))};return l(!0),t(1),function(){l(!1),b([]),d(void 0)}}),[a,x]);var S=function(e,t){T.trackEvent("dash_widget_filter_changed",Y({filter:e},t))},k=(0,e.jsxs)("div",{className:"parsely-top-posts-filters",children:[(0,e.jsx)(N,{defaultValue:a.Period,items:Object.values(f).map((function(e){return[e,g(e)]})),onChange:function(e){w(e.target.value,f)&&(s({Period:e.target.value}),S("period",{period:e.target.value}),j(1))}}),(0,e.jsx)(N,{defaultValue:a.Metric,items:Object.values(h).map((function(e){return[e,_(e)]})),onChange:function(e){w(e.target.value,h)&&(s({Metric:e.target.value}),S("metric",{metric:e.target.value}),j(1))}})]}),C=(0,e.jsxs)("div",{className:"parsely-top-posts-navigation",children:[(0,e.jsx)("button",{className:"parsely-top-posts-navigation-prev",disabled:x<=1,"aria-label":(0,v.__)("Previous page","wp-parsely"),onClick:function(){j(x-1),T.trackEvent("dash_widget_navigation",{navigation:"previous",to_page:x-1})},children:(0,v.__)("<< Previous","wp-parsely")}),(0,v.sprintf)(/* translators: 1: Current page */(0,v.__)("Page %1$d","wp-parsely"),x),(0,e.jsx)("button",{className:"parsely-top-posts-navigation-next",disabled:!o&&m.length<5,"aria-label":(0,v.__)("Next page","wp-parsely"),onClick:function(){j(x+1),T.trackEvent("dash_widget_navigation",{navigation:"next",to_page:x+1})},children:(0,v.__)("Next >>","wp-parsely")})]});if(u)return(0,e.jsxs)(e.Fragment,{children:[k,u.Message(),x>1&&C]});var O=(0,e.jsx)("div",{className:"parsely-spinner-wrapper",children:(0,e.jsx)(E.Spinner,{})});return(0,e.jsxs)(e.Fragment,{children:[k,o?O:(0,e.jsx)("ol",{className:"parsely-top-posts",style:{counterReset:"item "+5*(x-1)},children:m.map((function(t){return(0,e.jsx)($,{metric:a.Metric,post:t},t.id)}))}),(m.length>=5||x>1)&&C]})}var K=function(e){var t;try{t=JSON.parse(e)}catch(e){return{Metric:h.Views,Period:f.Days7}}return w(null==t?void 0:t.Metric,h)||(t.Metric=h.Views),w(null==t?void 0:t.Period,f)||(t.Period=f.Days7),t};window.addEventListener("load",(function(){var r=document.querySelector("#wp-parsely-dashboard-widget > .inside");if(null!==r){var n=(0,e.jsx)(d,{endpoint:"dashboard-widget-settings",defaultSettings:K(window.wpParselyContentHelperSettings),children:(0,e.jsx)(S,{children:(0,e.jsx)(W,{})})});t.createRoot?(0,t.createRoot)(r).render(n):(0,t.render)(n,r)}}),!1)}()}(); \ No newline at end of file diff --git a/build/content-helper/editor-sidebar.asset.php b/build/content-helper/editor-sidebar.asset.php index 0a98b64b5..099eedea1 100644 --- a/build/content-helper/editor-sidebar.asset.php +++ b/build/content-helper/editor-sidebar.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => 'c5cfd2f2ca1a40f7169c'); + array('react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => '009b7ca6bf45fe81240a'); diff --git a/build/content-helper/editor-sidebar.js b/build/content-helper/editor-sidebar.js index e294dcfde..f4ca0f1eb 100644 --- a/build/content-helper/editor-sidebar.js +++ b/build/content-helper/editor-sidebar.js @@ -1,16 +1,16 @@ -!function(){"use strict";var e={251:function(e,t,n){var r=n(196),i=Symbol.for("react.element"),s=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,s={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===s[r]&&(s[r]=t[r]);return{$$typeof:i,type:e,key:c,ref:u,props:s,_owner:o.current}}t.Fragment=s,t.jsx=c,t.jsxs=c},893:function(e,t,n){e.exports=n(251)},196:function(e){e.exports=window.React}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e,t,r,i=n(893),s=window.wp.components,a=window.wp.coreData,o=window.wp.data,l=window.wp.editPost,c=window.wp.editor,u=window.wp.element,p=window.wp.i18n,d=window.wp.plugins,h=function(){function e(){this._tkq=[],this.isLoaded=!1,this.isEnabled=!1,"undefined"!=typeof wpParselyTracksTelemetry&&(this.isEnabled=!0,this.loadTrackingLibrary())}return e.getInstance=function(){return window.wpParselyTelemetryInstance||Object.defineProperty(window,"wpParselyTelemetryInstance",{value:new e,writable:!1,configurable:!1,enumerable:!1}),window.wpParselyTelemetryInstance},e.prototype.loadTrackingLibrary=function(){var e=this,t=document.createElement("script");t.async=!0,t.src="//stats.wp.com/w.js",t.onload=function(){e.isLoaded=!0,e._tkq=window._tkq||[]},document.head.appendChild(t)},e.trackEvent=function(t,n){return void 0===n&&(n={}),r=this,i=void 0,a=function(){var r;return function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(l){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=1e4&&(clearInterval(s),n("Telemetry library not loaded"))}),100);else n("Telemetry not enabled")}))},e.prototype.trackEvent=function(t,n){var r;this.isLoaded?(0!==t.indexOf(e.TRACKS_PREFIX)&&(t=e.TRACKS_PREFIX+t),this.isEventNameValid(t)?(n=this.prepareProperties(n),null===(r=this._tkq)||void 0===r||r.push(["recordEvent",t,n])):console.error("Error tracking event: Invalid event name")):console.error("Error tracking event: Telemetry not loaded")},e.prototype.isTelemetryEnabled=function(){return this.isEnabled},e.prototype.isProprietyValid=function(t){return e.PROPERTY_REGEX.test(t)},e.prototype.isEventNameValid=function(t){return e.EVENT_NAME_REGEX.test(t)},e.prototype.prepareProperties=function(e){return(e=this.sanitizeProperties(e)).parsely_version=wpParselyTracksTelemetry.version,wpParselyTracksTelemetry.user&&(e._ut=wpParselyTracksTelemetry.user.type,e._ui=wpParselyTracksTelemetry.user.id),wpParselyTracksTelemetry.vipgo_env&&(e.vipgo_env=wpParselyTracksTelemetry.vipgo_env),this.sanitizeProperties(e)},e.prototype.sanitizeProperties=function(e){var t=this,n={};return Object.keys(e).forEach((function(r){t.isProprietyValid(r)&&(n[r]=e[r])})),n},e.TRACKS_PREFIX="wpparsely_",e.EVENT_NAME_REGEX=/^(([a-z0-9]+)_){2}([a-z0-9_]+)$/,e.PROPERTY_REGEX=/^[a-z_][a-z0-9_]*$/,e}(),f=(h.trackEvent,function(e){var t=e.text,n=void 0===t?(0,p.__)("Beta","wp-parsely"):t,r=e.color,s=void 0===r?"var(--parsely-green)":r,a=e.fontSize,o={backgroundColor:s,fontSize:void 0===a?"0.75rem":a};return(0,i.jsx)("div",{className:"wp-parsely-beta-badge",style:o,children:n})}),y=(0,u.forwardRef)((function({icon:e,size:t=24,...n},r){return(0,u.cloneElement)(e,{width:t,height:t,...n,ref:r})})),g=n(196),v=window.wp.primitives,w=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),m=function(){return(0,i.jsxs)(s.SVG,{"aria-hidden":"true",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[(0,i.jsx)(s.G,{transform:"matrix(1, 0, 0, 1, 1.7763568394002505e-15, 0)"}),(0,i.jsx)(s.Path,{d:"M 16.693 6.167 A 4.541 4.541 0 0 1 12.152 10.708 A 4.541 4.541 0 0 1 7.611 6.167 A 4.541 4.541 0 0 1 12.152 1.626 A 4.541 4.541 0 0 1 16.693 6.167 Z",style:{fill:"rgba(216, 216, 216, 0)",fillOpacity:0,strokeWidth:"2.5px",stroke:"rgb(0, 0, 0)"}}),(0,i.jsx)(s.Path,{d:"M 3.016 23.76 L 3.0135 22.4385 C 3.0109999999999997 21.117 3.0060000000000002 18.474 3.3204999999999996 16.911 C 3.635 15.347999999999999 4.268999999999999 14.865 7.068666666666666 14.6235 C 9.868333333333332 14.382 14.833666666666666 14.382 17.585833333333333 14.658 C 20.337999999999997 14.934 20.877 15.485999999999999 21.1465 17.0435 C 21.416 18.601 21.416 21.164 21.416 22.4455 L 21.416 23.727",style:{fillOpacity:0,fill:"rgb(255, 255, 255)",strokeWidth:"2.5px",stroke:"rgb(0, 0, 0)"}})]})},_={journalist:{label:(0,p.__)("Journalist","wp-parsely"),emoji:"📰"},editorialWriter:{label:(0,p.__)("Editorial Writer","wp-parsely"),emoji:"✍️"},investigativeReporter:{label:(0,p.__)("Investigative Reporter","wp-parsely"),emoji:"🕵️"},techAnalyst:{label:(0,p.__)("Tech Analyst","wp-parsely"),emoji:"💻"},businessAnalyst:{label:(0,p.__)("Business Analyst","wp-parsely"),emoji:"📈"},culturalCommentator:{label:(0,p.__)("Cultural Commentator","wp-parsely"),emoji:"🌍"},scienceCorrespondent:{label:(0,p.__)("Science Correspondent","wp-parsely"),emoji:"🔬"},politicalAnalyst:{label:(0,p.__)("Political Analyst","wp-parsely"),emoji:"🏛️"},healthWellnessAdvocate:{label:(0,p.__)("Health and Wellness Advocate","wp-parsely"),emoji:"🍏"},environmentalJournalist:{label:(0,p.__)("Environmental Journalist","wp-parsely"),emoji:"🌳"},custom:{label:(0,p.__)("Use a custom persona","wp-parsely"),emoji:"🔧"}},b=Object.keys(_),x=function(e){return"custom"===e||""===e?_.custom.label:j(e)?e:_[e].label},j=function(e){return!b.includes(e)||"custom"===e},P=function(e){var t=e.value,n=e.onChange,r=(0,u.useState)(""),a=r[0],o=r[1];return(0,i.jsx)("div",{className:"parsely-persona-selector-custom",children:(0,i.jsx)(s.TextControl,{value:a||t,onChange:function(e){n(e),o(e)},help:(0,p.__)("Enter a custom persona","wp-parsely")})})},T=function(e){var t=e.persona,n=e.label,r=void 0===n?(0,p.__)("Select a persona","wp-parsely"):n,a=e.onChange,o=e.onDropdownChange,l=e.disabled,c=void 0!==l&&l,u=e.allowCustom,d=void 0!==u&&u;return(0,i.jsxs)(s.Disabled,{isDisabled:c,children:[(0,i.jsx)(s.DropdownMenu,{label:(0,p.__)("Persona","wp-parsely"),icon:m,className:"parsely-persona-selector-dropdown"+(c?" is-disabled":""),popoverProps:{className:"wp-parsely-popover"},toggleProps:{children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"parsely-persona-selector-label",children:r}),(0,i.jsx)(y,{icon:w})]})},children:function(e){var n=e.onClose;return(0,i.jsx)(s.MenuGroup,{label:(0,p.__)("Select a persona","wp-parsely"),children:(0,i.jsx)(i.Fragment,{children:b.map((function(e){if(!d&&"custom"===e)return null;var r=_[e];return(0,i.jsxs)(s.MenuItem,{isSelected:e===t,className:e===t?"is-selected":"",role:"menuitemradio",onClick:function(){null==o||o(e),a(e),n()},children:[r.emoji," ",r.label]},e)}))})})}}),d&&j(t)&&(0,i.jsx)(P,{onChange:function(e){a(""!==e?e:"custom")},value:"custom"===t?"":t})]})},S=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{fillRule:"evenodd",d:"M6.863 13.644L5 13.25h-.5a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5H5L18 6.5h2V16h-2l-3.854-.815.026.008a3.75 3.75 0 01-7.31-1.549zm1.477.313a2.251 2.251 0 004.356.921l-4.356-.921zm-2.84-3.28L18.157 8h.343v6.5h-.343L5.5 11.823v-1.146z",clipRule:"evenodd"})),E={neutral:{label:(0,p.__)("Neutral","wp-parsely"),emoji:"😐"},formal:{label:(0,p.__)("Formal","wp-parsely"),emoji:"🎩"},humorous:{label:(0,p.__)("Humorous","wp-parsely"),emoji:"😂"},confident:{label:(0,p.__)("Confident","wp-parsely"),emoji:"😎"},provocative:{label:(0,p.__)("Provocative","wp-parsely"),emoji:"😈"},serious:{label:(0,p.__)("Serious","wp-parsely"),emoji:"🧐"},inspirational:{label:(0,p.__)("Inspirational","wp-parsely"),emoji:"✨"},skeptical:{label:(0,p.__)("Skeptical","wp-parsely"),emoji:"🤨"},conversational:{label:(0,p.__)("Conversational","wp-parsely"),emoji:"💬"},analytical:{label:(0,p.__)("Analytical","wp-parsely"),emoji:"🤓"},custom:{label:(0,p.__)("Use a custom tone","wp-parsely"),emoji:"🔧"}},C=Object.keys(E),N=function(e){return"custom"===e||""===e?E.custom.label:k(e)?e:E[e].label},k=function(e){return!C.includes(e)||"custom"===e},O=function(e){var t=e.value,n=e.onChange,r=(0,u.useState)(""),a=r[0],o=r[1];return(0,i.jsx)("div",{className:"parsely-tone-selector-custom",children:(0,i.jsx)(s.TextControl,{value:a||t,onChange:function(e){n(e),o(e)},help:(0,p.__)("Enter a custom tone","wp-parsely")})})},A=function(e){var t=e.tone,n=e.label,r=void 0===n?(0,p.__)("Select a tone","wp-parsely"):n,a=e.onChange,o=e.onDropdownChange,l=e.disabled,c=void 0!==l&&l,u=e.allowCustom,d=void 0!==u&&u;return(0,i.jsxs)(s.Disabled,{isDisabled:c,children:[(0,i.jsx)(s.DropdownMenu,{label:(0,p.__)("Tone","wp-parsely"),icon:S,className:"parsely-tone-selector-dropdown"+(c?" is-disabled":""),popoverProps:{className:"wp-parsely-popover"},toggleProps:{children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"parsely-tone-selector-label",children:r}),(0,i.jsx)(y,{icon:w})]})},children:function(e){var n=e.onClose;return(0,i.jsx)(s.MenuGroup,{label:(0,p.__)("Select a tone","wp-parsely"),children:(0,i.jsx)(i.Fragment,{children:C.map((function(e){if(!d&&"custom"===e)return null;var r=E[e];return(0,i.jsxs)(s.MenuItem,{isSelected:e===t,className:e===t?"is-selected":"",role:"menuitemradio",onClick:function(){null==o||o(e),a(e),n()},children:[r.emoji," ",r.label]},e)}))})})}}),d&&k(t)&&(0,i.jsx)(O,{onChange:function(e){a(""!==e?e:"custom")},value:"custom"===t?"":t})]})},R=window.wp.apiFetch,L=n.n(R),I=function(e){var t=e.size,n=void 0===t?24:t;return(0,i.jsxs)(s.SVG,{height:n,viewBox:"0 0 60 65",width:n,xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M23.72,51.53c0-.18,0-.34-.06-.52a13.11,13.11,0,0,0-2.1-5.53A14.74,14.74,0,0,0,19.12,43c-.27-.21-.5-.11-.51.22l-.24,3.42c0,.33-.38.35-.49,0l-1.5-4.8a1.4,1.4,0,0,0-.77-.78,23.91,23.91,0,0,0-3.1-.84c-1.38-.24-3.39-.39-3.39-.39-.34,0-.45.21-.25.49l2.06,3.76c.2.27,0,.54-.29.33l-4.51-3.6a3.68,3.68,0,0,0-2.86-.48c-1,.16-2.44.46-2.44.46a.68.68,0,0,0-.39.25.73.73,0,0,0-.14.45S.41,43,.54,44a3.63,3.63,0,0,0,1.25,2.62L6.48,50c.28.2.09.49-.23.37l-4.18-.94c-.32-.12-.5,0-.4.37,0,0,.69,1.89,1.31,3.16a24,24,0,0,0,1.66,2.74,1.34,1.34,0,0,0,1,.52l5,.13c.33,0,.41.38.1.48L7.51,58c-.31.1-.34.35-.07.55a14.29,14.29,0,0,0,3.05,1.66,13.09,13.09,0,0,0,5.9.5,25.13,25.13,0,0,0,4.34-1,9.55,9.55,0,0,1-.08-1.2,9.32,9.32,0,0,1,3.07-6.91"}),(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M59.7,41.53a.73.73,0,0,0-.14-.45.68.68,0,0,0-.39-.25s-1.43-.3-2.44-.46a3.64,3.64,0,0,0-2.86.48l-4.51,3.6c-.26.21-.49-.06-.29-.33l2.06-3.76c.2-.28.09-.49-.25-.49,0,0-2,.15-3.39.39a23.91,23.91,0,0,0-3.1.84,1.4,1.4,0,0,0-.77.78l-1.5,4.8c-.11.32-.48.3-.49,0l-.24-3.42c0-.33-.24-.43-.51-.22a14.74,14.74,0,0,0-2.44,2.47A13.11,13.11,0,0,0,36.34,51c0,.18,0,.34-.06.52a9.26,9.26,0,0,1,3,8.1,24.1,24.1,0,0,0,4.34,1,13.09,13.09,0,0,0,5.9-.5,14.29,14.29,0,0,0,3.05-1.66c.27-.2.24-.45-.07-.55l-3.22-1.17c-.31-.1-.23-.47.1-.48l5-.13a1.38,1.38,0,0,0,1-.52A24.6,24.6,0,0,0,57,52.92c.61-1.27,1.31-3.16,1.31-3.16.1-.33-.08-.49-.4-.37l-4.18.94c-.32.12-.51-.17-.23-.37l4.69-3.34A3.63,3.63,0,0,0,59.46,44c.13-1,.24-2.47.24-2.47"}),(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M46.5,25.61c0-.53-.35-.72-.8-.43l-4.86,2.66c-.45.28-.56-.27-.23-.69l4.66-6.23a2,2,0,0,0,.28-1.68,36.51,36.51,0,0,0-2.19-4.89,34,34,0,0,0-2.81-3.94c-.33-.41-.74-.35-.91.16l-2.28,5.68c-.16.5-.6.48-.59-.05l.28-8.93a2.54,2.54,0,0,0-.66-1.64S35,4.27,33.88,3.27,30.78.69,30.78.69a1.29,1.29,0,0,0-1.54,0s-1.88,1.49-3.12,2.59-2.48,2.35-2.48,2.35A2.5,2.5,0,0,0,23,7.27l.27,8.93c0,.53-.41.55-.58.05l-2.29-5.69c-.17-.5-.57-.56-.91-.14a35.77,35.77,0,0,0-3,4.2,35.55,35.55,0,0,0-2,4.62,2,2,0,0,0,.27,1.67l4.67,6.24c.33.42.23,1-.22.69l-4.87-2.66c-.45-.29-.82-.1-.82.43a18.6,18.6,0,0,0,.83,5.07,20.16,20.16,0,0,0,5.37,7.77c3.19,3,5.93,7.8,7.45,11.08A9.6,9.6,0,0,1,30,49.09a9.31,9.31,0,0,1,2.86.45c1.52-3.28,4.26-8.11,7.44-11.09a20.46,20.46,0,0,0,5.09-7,19,19,0,0,0,1.11-5.82"}),(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M36.12,58.44A6.12,6.12,0,1,1,30,52.32a6.11,6.11,0,0,1,6.12,6.12"})]})};!function(e){e.Minutes10="10m",e.Hour="1h",e.Hours2="2h",e.Hours4="4h",e.Hours24="24h",e.Days7="7d",e.Days30="30d"}(e||(e={})),function(e){e.Views="views",e.AvgEngaged="avg_engaged"}(t||(t={})),function(e){e.Author="author",e.Section="section",e.Tag="tag",e.Unavailable="unavailable"}(r||(r={}));var F=function(e,t){return Object.values(t).includes(e)};function D(e,t){void 0===t&&(t=!1);var n=parseInt(e,10),r=e.charAt(e.length-1),i=(0,p.__)("Unknown Period","wp-parsely");switch(r){case"m":if(1===n){i=(0,p.__)("Last Minute","wp-parsely");break}i=(0,p.sprintf)(/* translators: 1: Number of minutes */(0,p._n)("Last %1$d Minute","Last %1$d Minutes",n,"wp-parsely"),n);break;case"h":if(1===n){i=(0,p.__)("Last Hour","wp-parsely");break}i=(0,p.sprintf)(/* translators: 1: Number of hours */(0,p._n)("Last %1$d Hour","Last %1$d Hours",n,"wp-parsely"),n);break;case"d":if(1===n){i=(0,p.__)("Last Day","wp-parsely");break}i=(0,p.sprintf)(/* translators: 1: Number of days */(0,p._n)("Last %1$d Day","Last %1$d Days",n,"wp-parsely"),n)}return t?i.toLocaleLowerCase():i}function M(e){switch(e){case t.Views:return(0,p.__)("Page Views","wp-parsely");case t.AvgEngaged:return(0,p.__)("Avg. Time","wp-parsely");default:return(0,p.__)("Unknown Metric","wp-parsely")}}var V=function(e){void 0===e&&(e=null);var t="";(null==e?void 0:e.children)&&(t=e.children);var n="content-helper-error-message";return(null==e?void 0:e.className)&&(n+=" "+e.className),(0,i.jsx)("div",{className:n,"data-testid":null==e?void 0:e.testId,dangerouslySetInnerHTML:{__html:t}})},z=function(e){return void 0===e&&(e=null),(0,i.jsx)(V,{className:null==e?void 0:e.className,testId:"empty-credentials-message",children:window.wpParselyEmptyCredentialsMessage})},B=function(){return B=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=c){var u=t;(i=r/c)%1>1/o&&(u=i>10?1:2),u=parseFloat(i.toFixed(2))===parseFloat(i.toFixed(0))?0:u,s=i.toFixed(u),a=l}o=c})),s+n+a}var U,$,W=window.wp.url,q=(U=function(e,t){return U=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},U(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}U(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});!function(e){e.CannotFormulateApiQuery="ch_cannot_formulate_api_query",e.FetchError="fetch_error",e.HttpRequestFailed="http_request_failed",e[e.ParselyApiForbidden=403]="ParselyApiForbidden",e.ParselyApiResponseContainsError="ch_response_contains_error",e.ParselyApiReturnedNoData="ch_parsely_api_returned_no_data",e.ParselyApiReturnedTooManyResults="ch_parsely_api_returned_too_many_results",e[e.ParselyApiUnauthorized=401]="ParselyApiUnauthorized",e.PluginCredentialsNotSetMessageDetected="parsely_credentials_not_set_message_detected",e.PluginSettingsApiSecretNotSet="parsely_api_secret_not_set",e.PluginSettingsSiteIdNotSet="parsely_site_id_not_set",e.PostIsNotPublished="ch_post_not_published"}($||($={}));var Q=function(e){function t(n,r,i){void 0===i&&(i=(0,p.__)("Error: ","wp-parsely"));var s=e.call(this,i+n)||this;s.hint=null,s.name=s.constructor.name,s.code=r;var a=[$.ParselyApiForbidden,$.ParselyApiResponseContainsError,$.ParselyApiReturnedNoData,$.ParselyApiReturnedTooManyResults,$.ParselyApiUnauthorized,$.PluginCredentialsNotSetMessageDetected,$.PluginSettingsApiSecretNotSet,$.PluginSettingsSiteIdNotSet,$.PostIsNotPublished];return s.retryFetch=!a.includes(s.code),Object.setPrototypeOf(s,t.prototype),s}return q(t,e),t.prototype.Message=function(e){return void 0===e&&(e=null),[$.PluginCredentialsNotSetMessageDetected,$.PluginSettingsSiteIdNotSet,$.PluginSettingsApiSecretNotSet].includes(this.code)?z(e):(this.code===$.FetchError&&(this.hint=this.Hint((0,p.__)("This error can sometimes be caused by ad-blockers or browser tracking protections. Please add this site to any applicable allow lists and try again.","wp-parsely"))),this.code===$.ParselyApiForbidden&&(this.hint=this.Hint((0,p.__)("Please ensure that the Site ID and API Secret given in the plugin's settings are correct.","wp-parsely"))),this.code===$.HttpRequestFailed&&(this.hint=this.Hint((0,p.__)("The Parse.ly API cannot be reached. Please verify that you are online.","wp-parsely"))),this.code===$.ParselyApiUnauthorized&&(this.message=(0,p.__)("This feature is accessible to select customers participating in its beta testing.","wp-parsely")),(0,i.jsx)(V,{className:null==e?void 0:e.className,testId:"error",children:"

".concat(this.message,"

").concat(this.hint?this.hint:"")}))},t.prototype.Hint=function(e){return'

'.concat((0,p.__)("Hint:","wp-parsely")," ").concat(e,"

")},t}(Error),X={month:"short",day:"numeric",year:"numeric"},Z={month:"short",day:"numeric"},Y=(0,p.__)("Date N/A","wp-parsely");function J(e){if(!1===function(e){return!isNaN(+e)&&0!==e.getTime()}(e))return Y;var t=X;return e.getUTCFullYear()===(new Date).getUTCFullYear()&&(t=Z),Intl.DateTimeFormat(document.documentElement.lang||"en",t).format(e)}function K(e){return{period_start:e,period_end:""}}var ee=function(){return ee=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1?[2,Promise.reject(new Q((0,p.sprintf)(/* translators: URL of the published post */ -(0,p.__)("Multiple results were returned for the post %s by the Parse.ly API.","wp-parsely"),t),$.ParselyApiReturnedTooManyResults))]:[2,n.data[0]]}}))}))},e.prototype.fetchReferrerDataFromWpEndpoint=function(e,t,n){return te(this,void 0,void 0,(function(){var r,i;return ne(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,L()({path:(0,W.addQueryArgs)("/wp-parsely/v1/referrers/post/detail",ee(ee({},K(e)),{itm_source:this.itmSource,total_views:n,url:t}))})];case 1:return r=s.sent(),[3,3];case 2:return i=s.sent(),[2,Promise.reject(new Q(i.message,i.code))];case 3:return(null==r?void 0:r.error)?[2,Promise.reject(new Q(r.error.message,$.ParselyApiResponseContainsError))]:[2,r.data]}}))}))},e}(),ie=function(){return ie=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&e.retryFetch?[4,new Promise((function(e){return setTimeout(e,500)}))]:[3,3];case 1:return t.sent(),[4,r(i-1)];case 2:return t.sent(),[3,4];case 3:p(e),o(!1),t.label=4;case 4:return[2]}}))}))})),[2]}))}))};return o(!0),r(1),function(){p(void 0)}}),[n]),c?c.Message():a?(0,i.jsx)("div",{className:"parsely-spinner-wrapper","data-testid":"parsely-spinner-wrapper",children:(0,i.jsx)(s.Spinner,{})}):(0,i.jsx)(le,{data:h,period:n})}function le(e){return(0,i.jsxs)("div",{className:"performance-details-panel",children:[(0,i.jsx)("div",{className:"section period",children:D(e.period)}),(0,i.jsx)(ce,ie({},e)),(0,i.jsx)(ue,ie({},e)),(0,i.jsx)(pe,ie({},e)),(0,i.jsx)(de,ie({},e))]})}function ce(e){var t=e.data;return(0,i.jsx)("div",{className:"section general-performance",children:(0,i.jsxs)("table",{children:[(0,i.jsx)("tbody",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:H(t.views)}),(0,i.jsx)("td",{children:H(t.visitors)}),(0,i.jsx)("td",{children:t.avgEngaged})]})}),(0,i.jsx)("tfoot",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:(0,p.__)("Page Views","wp-parsely")}),(0,i.jsx)("th",{children:(0,p.__)("Visitors","wp-parsely")}),(0,i.jsx)("th",{children:(0,p.__)("Avg. Time","wp-parsely")})]})})]})})}function ue(e){var t=e.data;delete t.referrers.types.totals;var n=function(e){switch(e){case"social":return(0,p.__)("Social","wp-parsely");case"search":return(0,p.__)("Search","wp-parsely");case"other":return(0,p.__)("Other","wp-parsely");case"internal":return(0,p.__)("Internal","wp-parsely");case"direct":return(0,p.__)("Direct","wp-parsely")}return e};return(0,i.jsxs)("div",{className:"section referrer-types",children:[(0,i.jsx)("div",{className:"section-title",children:(0,p.__)("Referrers (Page Views)","wp-parsely")}),(0,i.jsx)("div",{className:"multi-percentage-bar",children:Object.entries(t.referrers.types).map((function(e){var t=e[0],r=e[1],s=(0,p.sprintf)(/* translators: 1: Referrer type, 2: Percentage value, %%: Escaped percent sign */ -(0,p.__)("%1$s: %2$s%%","wp-parsely"),n(t),r.viewsPercentage);return(0,i.jsx)("div",{"aria-label":s,className:"bar-fill "+t,style:{width:r.viewsPercentage+"%"}},t)}))}),(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:Object.keys(t.referrers.types).map((function(e){return(0,i.jsx)("th",{children:n(e)},e)}))})}),(0,i.jsx)("tbody",{children:(0,i.jsx)("tr",{children:Object.entries(t.referrers.types).map((function(e){var t=e[0],n=e[1];return(0,i.jsx)("td",{children:H(n.views)},t)}))})})]})]})}function pe(e){var t=e.data,n=0;return(0,i.jsxs)("div",{className:"section top-referrers",children:[(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{scope:"col",children:(0,p.__)("Top Referrers","wp-parsely")}),(0,i.jsx)("th",{colSpan:2,scope:"colgroup",children:(0,p.__)("Page Views","wp-parsely")})]})}),(0,i.jsx)("tbody",{children:Object.entries(t.referrers.top).map((function(e){var t=e[0],r=e[1];if("totals"===t)return n=Number(r.viewsPercentage),null;var s=t;"direct"===t&&(s=(0,p.__)("Direct","wp-parsely")) -/* translators: %s: Percentage value, %%: Escaped percent sign */;var a=(0,p.sprintf)((0,p.__)("%s%%","wp-parsely"),r.viewsPercentage);return(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{scope:"row",children:s}),(0,i.jsx)("td",{children:(0,i.jsx)("div",{"aria-label":a,className:"percentage-bar",style:{"--bar-fill":r.viewsPercentage+"%"}})}),(0,i.jsx)("td",{children:H(r.views)})]},t)}))})]}),(0,i.jsxs)("div",{children:[" ",/* translators: %s: Percentage value, %%: Escaped percent sign */ -(0,p.sprintf)((0,p._n)("%s%% of views came from top referrers.","%s%% of views came from top referrers.",n,"wp-parsely"),n)]})]})}function de(e){var t=e.data,n=(0,i.jsxs)("span",{className:"screen-reader-text",children:[" ",(0,p.__)("(opens in new tab)","wp-parsely")]});return(0,i.jsxs)("div",{className:"section actions",children:[(0,i.jsxs)(s.Button,{href:t.url,rel:"noopener",target:"_blank",variant:"secondary",children:[(0,p.__)("Visit Post","wp-parsely"),n]}),(0,i.jsxs)(s.Button,{href:t.dashUrl,rel:"noopener",target:"_blank",variant:"primary",children:[(0,p.__)("View in Parse.ly","wp-parsely"),n]})]})}var he=function(e){var t=e.filter,n=e.label,s=e.onFilterTypeChange,a=e.onFilterValueChange,o=e.postData,l=function(){return o.tags.length>=1&&o.categories.length>=1||o.tags.length>=1&&o.authors.length>=1||o.categories.length>=1&&o.authors.length>=1},c=function(){return r.Tag===t.type&&o.tags.length>1||r.Section===t.type&&o.categories.length>1||r.Author===t.type&&o.authors.length>1},u=c()&&!l();return(0,i.jsxs)(i.Fragment,{children:[l()&&(0,i.jsx)(fe,{filter:t,label:u?void 0:n,onFilterTypeChange:s,postData:o}),c()&&(0,i.jsx)(ye,{filter:t,label:u?n:void 0,onFilterValueChange:a,postData:o})]})},fe=function(e){var t=e.filter,n=e.label,a=e.onFilterTypeChange,o=e.postData;return(0,i.jsxs)(s.SelectControl,{label:n,onChange:function(e){return a(e)},value:t.type,children:[o.tags.length>=1&&(0,i.jsx)("option",{value:r.Tag,children:(0,p.__)("Tag","wp-parsely")}),o.categories.length>=1&&(0,i.jsx)("option",{value:r.Section,children:(0,p.__)("Section","wp-parsely")}),o.authors.length>=1&&(0,i.jsx)("option",{value:r.Author,children:(0,p.__)("Author","wp-parsely")})]})},ye=function(e){var t=e.filter,n=e.label,a=e.onFilterValueChange,o=e.postData;return(0,i.jsx)(s.ComboboxControl,{label:n,onChange:function(e){return a(e)},options:r.Tag===t.type?o.tags.map((function(e){return{value:e,label:e}})):r.Section===t.type?o.categories.map((function(e){return{value:e,label:e}})):r.Author===t.type?o.authors.map((function(e){return{value:e,label:e}})):[],value:t.value})},ge=function(){return(0,i.jsx)(s.SVG,{"aria-hidden":"true",version:"1.1",viewBox:"0 0 15 15",width:"15",height:"15",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(s.Path,{d:"M0 14.0025V11.0025L7.5 3.5025L10.5 6.5025L3 14.0025H0ZM12 5.0025L13.56 3.4425C14.15 2.8525 14.15 1.9025 13.56 1.3225L12.68 0.4425C12.09 -0.1475 11.14 -0.1475 10.56 0.4425L9 2.0025L12 5.0025Z"})})},ve=function(){return(0,i.jsxs)(s.SVG,{"aria-hidden":"true",version:"1.1",viewBox:"0 0 16 16",width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(s.Path,{d:"M0 3.29592C0 2.73237 0.456853 2.27551 1.02041 2.27551H4.08165C4.50432 2.27551 4.84696 2.61815 4.84696 3.04082C4.84696 3.46349 4.50432 3.80613 4.08165 3.80613H1.53062V11.9694H9.69391V9.6735C9.69391 9.25083 10.0366 8.90819 10.4592 8.90819C10.8819 8.90819 11.2245 9.25083 11.2245 9.6735V12.4796C11.2245 13.0432 10.7677 13.5 10.2041 13.5H1.02041C0.456854 13.5 0 13.0432 0 12.4796V3.29592Z"}),(0,i.jsx)(s.Path,{d:"M12.531 1.22415C12.8299 1.52303 12.8299 2.00759 12.531 2.30646L6.15342 8.68404C5.85455 8.98291 5.36998 8.98291 5.07111 8.68404C4.77224 8.38517 4.77224 7.9006 5.07111 7.60173L11.4487 1.22415C11.7476 0.925282 12.2321 0.925282 12.531 1.22415Z"}),(0,i.jsx)(s.Path,{d:"M6.63268 1.51012C6.63268 1.08745 6.97532 0.744812 7.39799 0.744812H12.2449C12.6676 0.744812 13.0103 1.08745 13.0103 1.51012V6.35708C13.0103 6.77975 12.6676 7.12239 12.2449 7.12239C11.8223 7.12239 11.4796 6.77975 11.4796 6.35708V2.27543H7.39799C6.97532 2.27543 6.63268 1.93279 6.63268 1.51012Z"})]})},we=function(){return(0,i.jsx)(s.SVG,{"aria-hidden":"true",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 42 42",children:(0,i.jsx)(s.Path,{d:"M15.3,20.1c0,3.1,2.6,5.7,5.7,5.7s5.7-2.6,5.7-5.7s-2.6-5.7-5.7-5.7S15.3,17,15.3,20.1z M23.4,32.4\n\t\t\tC30.1,30.9,40.5,22,40.5,22s-7.7-12-18-13.3c-0.6-0.1-2.6-0.1-3-0.1c-10,1-18,13.7-18,13.7s8.7,8.6,17,9.9\n\t\t\tC19.4,32.6,22.4,32.6,23.4,32.4z M11.1,20.7c0-5.2,4.4-9.4,9.9-9.4s9.9,4.2,9.9,9.4S26.5,30,21,30S11.1,25.8,11.1,20.7z"})})};function me(e){var t=e.metric,n=e.post,r=e.avgEngagedIcon,s=e.viewsIcon;return"views"===t?(0,i.jsxs)("span",{className:"parsely-top-post-metric-data",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Number of Views","wp-parsely")}),s,H(n.views.toString())]}):"avg_engaged"===t?(0,i.jsxs)("span",{className:"parsely-top-post-metric-data",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Average Time","wp-parsely")}),r,n.avgEngaged]}):(0,i.jsx)("span",{className:"parsely-top-post-metric-data",children:"-"})}function _e(e){var t,n=e.metric,r=e.post;return(0,i.jsxs)("li",{className:"parsely-top-post","data-testid":"parsely-top-post",children:[(0,i.jsxs)("div",{className:"parsely-top-post-title",children:[(0,i.jsxs)("a",{className:"parsely-top-post-stats-link",href:r.dashUrl,target:"_blank",rel:"noreferrer",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("View in Parse.ly (opens new tab)","wp-parsely")}),r.title]}),(0,i.jsxs)("a",{className:"parsely-top-post-view-link",href:r.url,target:"_blank",rel:"noreferrer",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("View Post (opens new tab)","wp-parsely")}),(0,i.jsx)(ve,{})]}),0!==r.postId&&(0,i.jsxs)("a",{className:"parsely-top-post-edit-link",href:(t=r.postId,"/wp-admin/post.php?post=".concat(t,"&action=edit")),target:"_blank",rel:"noreferrer",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Edit Post (opens new tab)","wp-parsely")}),(0,i.jsx)(ge,{})]})]}),(0,i.jsxs)("p",{className:"parsely-top-post-info",children:[(0,i.jsxs)("span",{className:"parsely-top-post-date",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Date","wp-parsely")}),J(new Date(r.date))]}),(0,i.jsxs)("span",{className:"parsely-top-post-author",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Author","wp-parsely")}),r.author]}),(0,i.jsx)(me,{metric:n,post:r,viewsIcon:(0,i.jsx)(we,{}),avgEngagedIcon:(0,i.jsx)(s.Dashicon,{icon:"clock"})})]})]})}var be=function(){return be=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=1e4&&(clearInterval(s),n("Telemetry library not loaded"))}),100);else n("Telemetry not enabled")}))},e.prototype.trackEvent=function(t,n){var r;this.isLoaded?(0!==t.indexOf(e.TRACKS_PREFIX)&&(t=e.TRACKS_PREFIX+t),this.isEventNameValid(t)?(n=this.prepareProperties(n),null===(r=this._tkq)||void 0===r||r.push(["recordEvent",t,n])):console.error("Error tracking event: Invalid event name")):console.error("Error tracking event: Telemetry not loaded")},e.prototype.isTelemetryEnabled=function(){return this.isEnabled},e.prototype.isProprietyValid=function(t){return e.PROPERTY_REGEX.test(t)},e.prototype.isEventNameValid=function(t){return e.EVENT_NAME_REGEX.test(t)},e.prototype.prepareProperties=function(e){return(e=this.sanitizeProperties(e)).parsely_version=wpParselyTracksTelemetry.version,wpParselyTracksTelemetry.user&&(e._ut=wpParselyTracksTelemetry.user.type,e._ui=wpParselyTracksTelemetry.user.id),wpParselyTracksTelemetry.vipgo_env&&(e.vipgo_env=wpParselyTracksTelemetry.vipgo_env),this.sanitizeProperties(e)},e.prototype.sanitizeProperties=function(e){var t=this,n={};return Object.keys(e).forEach((function(r){t.isProprietyValid(r)&&(n[r]=e[r])})),n},e.TRACKS_PREFIX="wpparsely_",e.EVENT_NAME_REGEX=/^(([a-z0-9]+)_){2}([a-z0-9_]+)$/,e.PROPERTY_REGEX=/^[a-z_][a-z0-9_]*$/,e}(),f=(h.trackEvent,function(e){var t=e.text,n=void 0===t?(0,p.__)("Beta","wp-parsely"):t,r=e.color,s=void 0===r?"var(--parsely-green)":r,a=e.fontSize,o={backgroundColor:s,fontSize:void 0===a?"0.75rem":a};return(0,i.jsx)("div",{className:"wp-parsely-beta-badge",style:o,children:n})}),y=(0,u.forwardRef)((function({icon:e,size:t=24,...n},r){return(0,u.cloneElement)(e,{width:t,height:t,...n,ref:r})})),g=n(196),v=window.wp.primitives,w=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),m=function(){return(0,i.jsxs)(s.SVG,{"aria-hidden":"true",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[(0,i.jsx)(s.G,{transform:"matrix(1, 0, 0, 1, 1.7763568394002505e-15, 0)"}),(0,i.jsx)(s.Path,{d:"M 16.693 6.167 A 4.541 4.541 0 0 1 12.152 10.708 A 4.541 4.541 0 0 1 7.611 6.167 A 4.541 4.541 0 0 1 12.152 1.626 A 4.541 4.541 0 0 1 16.693 6.167 Z",style:{fill:"rgba(216, 216, 216, 0)",fillOpacity:0,strokeWidth:"2.5px",stroke:"rgb(0, 0, 0)"}}),(0,i.jsx)(s.Path,{d:"M 3.016 23.76 L 3.0135 22.4385 C 3.0109999999999997 21.117 3.0060000000000002 18.474 3.3204999999999996 16.911 C 3.635 15.347999999999999 4.268999999999999 14.865 7.068666666666666 14.6235 C 9.868333333333332 14.382 14.833666666666666 14.382 17.585833333333333 14.658 C 20.337999999999997 14.934 20.877 15.485999999999999 21.1465 17.0435 C 21.416 18.601 21.416 21.164 21.416 22.4455 L 21.416 23.727",style:{fillOpacity:0,fill:"rgb(255, 255, 255)",strokeWidth:"2.5px",stroke:"rgb(0, 0, 0)"}})]})},_={journalist:{label:(0,p.__)("Journalist","wp-parsely"),emoji:"📰"},editorialWriter:{label:(0,p.__)("Editorial Writer","wp-parsely"),emoji:"✍️"},investigativeReporter:{label:(0,p.__)("Investigative Reporter","wp-parsely"),emoji:"🕵️"},techAnalyst:{label:(0,p.__)("Tech Analyst","wp-parsely"),emoji:"💻"},businessAnalyst:{label:(0,p.__)("Business Analyst","wp-parsely"),emoji:"📈"},culturalCommentator:{label:(0,p.__)("Cultural Commentator","wp-parsely"),emoji:"🌍"},scienceCorrespondent:{label:(0,p.__)("Science Correspondent","wp-parsely"),emoji:"🔬"},politicalAnalyst:{label:(0,p.__)("Political Analyst","wp-parsely"),emoji:"🏛️"},healthWellnessAdvocate:{label:(0,p.__)("Health and Wellness Advocate","wp-parsely"),emoji:"🍏"},environmentalJournalist:{label:(0,p.__)("Environmental Journalist","wp-parsely"),emoji:"🌳"},custom:{label:(0,p.__)("Use a custom persona","wp-parsely"),emoji:"🔧"}},b=Object.keys(_),x=function(e){return"custom"===e||""===e?_.custom.label:j(e)?e:_[e].label},j=function(e){return!b.includes(e)||"custom"===e},P=function(e){var t=e.value,n=e.onChange,r=(0,u.useState)(""),a=r[0],o=r[1];return(0,i.jsx)("div",{className:"parsely-persona-selector-custom",children:(0,i.jsx)(s.TextControl,{value:a||t,onChange:function(e){n(e),o(e)},help:(0,p.__)("Enter a custom persona","wp-parsely")})})},T=function(e){var t=e.persona,n=e.label,r=void 0===n?(0,p.__)("Select a persona","wp-parsely"):n,a=e.onChange,o=e.onDropdownChange,l=e.disabled,c=void 0!==l&&l,u=e.allowCustom,d=void 0!==u&&u;return(0,i.jsxs)(s.Disabled,{isDisabled:c,children:[(0,i.jsx)(s.DropdownMenu,{label:(0,p.__)("Persona","wp-parsely"),icon:m,className:"parsely-persona-selector-dropdown"+(c?" is-disabled":""),popoverProps:{className:"wp-parsely-popover"},toggleProps:{children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"parsely-persona-selector-label",children:r}),(0,i.jsx)(y,{icon:w})]})},children:function(e){var n=e.onClose;return(0,i.jsx)(s.MenuGroup,{label:(0,p.__)("Select a persona","wp-parsely"),children:(0,i.jsx)(i.Fragment,{children:b.map((function(e){if(!d&&"custom"===e)return null;var r=_[e];return(0,i.jsxs)(s.MenuItem,{isSelected:e===t,className:e===t?"is-selected":"",role:"menuitemradio",onClick:function(){null==o||o(e),a(e),n()},children:[r.emoji," ",r.label]},e)}))})})}}),d&&j(t)&&(0,i.jsx)(P,{onChange:function(e){a(""!==e?e:"custom")},value:"custom"===t?"":t})]})},S=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{fillRule:"evenodd",d:"M6.863 13.644L5 13.25h-.5a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5H5L18 6.5h2V16h-2l-3.854-.815.026.008a3.75 3.75 0 01-7.31-1.549zm1.477.313a2.251 2.251 0 004.356.921l-4.356-.921zm-2.84-3.28L18.157 8h.343v6.5h-.343L5.5 11.823v-1.146z",clipRule:"evenodd"})),E={neutral:{label:(0,p.__)("Neutral","wp-parsely"),emoji:"😐"},formal:{label:(0,p.__)("Formal","wp-parsely"),emoji:"🎩"},humorous:{label:(0,p.__)("Humorous","wp-parsely"),emoji:"😂"},confident:{label:(0,p.__)("Confident","wp-parsely"),emoji:"😎"},provocative:{label:(0,p.__)("Provocative","wp-parsely"),emoji:"😈"},serious:{label:(0,p.__)("Serious","wp-parsely"),emoji:"🧐"},inspirational:{label:(0,p.__)("Inspirational","wp-parsely"),emoji:"✨"},skeptical:{label:(0,p.__)("Skeptical","wp-parsely"),emoji:"🤨"},conversational:{label:(0,p.__)("Conversational","wp-parsely"),emoji:"💬"},analytical:{label:(0,p.__)("Analytical","wp-parsely"),emoji:"🤓"},custom:{label:(0,p.__)("Use a custom tone","wp-parsely"),emoji:"🔧"}},C=Object.keys(E),N=function(e){return"custom"===e||""===e?E.custom.label:k(e)?e:E[e].label},k=function(e){return!C.includes(e)||"custom"===e},O=function(e){var t=e.value,n=e.onChange,r=(0,u.useState)(""),a=r[0],o=r[1];return(0,i.jsx)("div",{className:"parsely-tone-selector-custom",children:(0,i.jsx)(s.TextControl,{value:a||t,onChange:function(e){n(e),o(e)},help:(0,p.__)("Enter a custom tone","wp-parsely")})})},A=function(e){var t=e.tone,n=e.label,r=void 0===n?(0,p.__)("Select a tone","wp-parsely"):n,a=e.onChange,o=e.onDropdownChange,l=e.disabled,c=void 0!==l&&l,u=e.allowCustom,d=void 0!==u&&u;return(0,i.jsxs)(s.Disabled,{isDisabled:c,children:[(0,i.jsx)(s.DropdownMenu,{label:(0,p.__)("Tone","wp-parsely"),icon:S,className:"parsely-tone-selector-dropdown"+(c?" is-disabled":""),popoverProps:{className:"wp-parsely-popover"},toggleProps:{children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"parsely-tone-selector-label",children:r}),(0,i.jsx)(y,{icon:w})]})},children:function(e){var n=e.onClose;return(0,i.jsx)(s.MenuGroup,{label:(0,p.__)("Select a tone","wp-parsely"),children:(0,i.jsx)(i.Fragment,{children:C.map((function(e){if(!d&&"custom"===e)return null;var r=E[e];return(0,i.jsxs)(s.MenuItem,{isSelected:e===t,className:e===t?"is-selected":"",role:"menuitemradio",onClick:function(){null==o||o(e),a(e),n()},children:[r.emoji," ",r.label]},e)}))})})}}),d&&k(t)&&(0,i.jsx)(O,{onChange:function(e){a(""!==e?e:"custom")},value:"custom"===t?"":t})]})},R=function(e){var t=e.size,n=void 0===t?24:t;return(0,i.jsxs)(s.SVG,{height:n,viewBox:"0 0 60 65",width:n,xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M23.72,51.53c0-.18,0-.34-.06-.52a13.11,13.11,0,0,0-2.1-5.53A14.74,14.74,0,0,0,19.12,43c-.27-.21-.5-.11-.51.22l-.24,3.42c0,.33-.38.35-.49,0l-1.5-4.8a1.4,1.4,0,0,0-.77-.78,23.91,23.91,0,0,0-3.1-.84c-1.38-.24-3.39-.39-3.39-.39-.34,0-.45.21-.25.49l2.06,3.76c.2.27,0,.54-.29.33l-4.51-3.6a3.68,3.68,0,0,0-2.86-.48c-1,.16-2.44.46-2.44.46a.68.68,0,0,0-.39.25.73.73,0,0,0-.14.45S.41,43,.54,44a3.63,3.63,0,0,0,1.25,2.62L6.48,50c.28.2.09.49-.23.37l-4.18-.94c-.32-.12-.5,0-.4.37,0,0,.69,1.89,1.31,3.16a24,24,0,0,0,1.66,2.74,1.34,1.34,0,0,0,1,.52l5,.13c.33,0,.41.38.1.48L7.51,58c-.31.1-.34.35-.07.55a14.29,14.29,0,0,0,3.05,1.66,13.09,13.09,0,0,0,5.9.5,25.13,25.13,0,0,0,4.34-1,9.55,9.55,0,0,1-.08-1.2,9.32,9.32,0,0,1,3.07-6.91"}),(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M59.7,41.53a.73.73,0,0,0-.14-.45.68.68,0,0,0-.39-.25s-1.43-.3-2.44-.46a3.64,3.64,0,0,0-2.86.48l-4.51,3.6c-.26.21-.49-.06-.29-.33l2.06-3.76c.2-.28.09-.49-.25-.49,0,0-2,.15-3.39.39a23.91,23.91,0,0,0-3.1.84,1.4,1.4,0,0,0-.77.78l-1.5,4.8c-.11.32-.48.3-.49,0l-.24-3.42c0-.33-.24-.43-.51-.22a14.74,14.74,0,0,0-2.44,2.47A13.11,13.11,0,0,0,36.34,51c0,.18,0,.34-.06.52a9.26,9.26,0,0,1,3,8.1,24.1,24.1,0,0,0,4.34,1,13.09,13.09,0,0,0,5.9-.5,14.29,14.29,0,0,0,3.05-1.66c.27-.2.24-.45-.07-.55l-3.22-1.17c-.31-.1-.23-.47.1-.48l5-.13a1.38,1.38,0,0,0,1-.52A24.6,24.6,0,0,0,57,52.92c.61-1.27,1.31-3.16,1.31-3.16.1-.33-.08-.49-.4-.37l-4.18.94c-.32.12-.51-.17-.23-.37l4.69-3.34A3.63,3.63,0,0,0,59.46,44c.13-1,.24-2.47.24-2.47"}),(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M46.5,25.61c0-.53-.35-.72-.8-.43l-4.86,2.66c-.45.28-.56-.27-.23-.69l4.66-6.23a2,2,0,0,0,.28-1.68,36.51,36.51,0,0,0-2.19-4.89,34,34,0,0,0-2.81-3.94c-.33-.41-.74-.35-.91.16l-2.28,5.68c-.16.5-.6.48-.59-.05l.28-8.93a2.54,2.54,0,0,0-.66-1.64S35,4.27,33.88,3.27,30.78.69,30.78.69a1.29,1.29,0,0,0-1.54,0s-1.88,1.49-3.12,2.59-2.48,2.35-2.48,2.35A2.5,2.5,0,0,0,23,7.27l.27,8.93c0,.53-.41.55-.58.05l-2.29-5.69c-.17-.5-.57-.56-.91-.14a35.77,35.77,0,0,0-3,4.2,35.55,35.55,0,0,0-2,4.62,2,2,0,0,0,.27,1.67l4.67,6.24c.33.42.23,1-.22.69l-4.87-2.66c-.45-.29-.82-.1-.82.43a18.6,18.6,0,0,0,.83,5.07,20.16,20.16,0,0,0,5.37,7.77c3.19,3,5.93,7.8,7.45,11.08A9.6,9.6,0,0,1,30,49.09a9.31,9.31,0,0,1,2.86.45c1.52-3.28,4.26-8.11,7.44-11.09a20.46,20.46,0,0,0,5.09-7,19,19,0,0,0,1.11-5.82"}),(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M36.12,58.44A6.12,6.12,0,1,1,30,52.32a6.11,6.11,0,0,1,6.12,6.12"})]})},L=function(){return L=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=c){var u=t;(i=r/c)%1>1/o&&(u=i>10?1:2),u=parseFloat(i.toFixed(2))===parseFloat(i.toFixed(0))?0:u,s=i.toFixed(u),a=l}o=c})),s+n+a}var J,K,ee=window.wp.url,te=(J=function(e,t){return J=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},J(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}J(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});!function(e){e.CannotFormulateApiQuery="ch_cannot_formulate_api_query",e.FetchError="fetch_error",e.HttpRequestFailed="http_request_failed",e[e.ParselyApiForbidden=403]="ParselyApiForbidden",e.ParselyApiResponseContainsError="ch_response_contains_error",e.ParselyApiReturnedNoData="ch_parsely_api_returned_no_data",e.ParselyApiReturnedTooManyResults="ch_parsely_api_returned_too_many_results",e[e.ParselyApiUnauthorized=401]="ParselyApiUnauthorized",e.PluginCredentialsNotSetMessageDetected="parsely_credentials_not_set_message_detected",e.PluginSettingsApiSecretNotSet="parsely_api_secret_not_set",e.PluginSettingsSiteIdNotSet="parsely_site_id_not_set",e.PostIsNotPublished="ch_post_not_published"}(K||(K={}));var ne=function(e){function t(n,r,i){void 0===i&&(i=(0,p.__)("Error: ","wp-parsely"));var s=e.call(this,i+n)||this;s.hint=null,s.name=s.constructor.name,s.code=r;var a=[K.ParselyApiForbidden,K.ParselyApiResponseContainsError,K.ParselyApiReturnedNoData,K.ParselyApiReturnedTooManyResults,K.ParselyApiUnauthorized,K.PluginCredentialsNotSetMessageDetected,K.PluginSettingsApiSecretNotSet,K.PluginSettingsSiteIdNotSet,K.PostIsNotPublished];return s.retryFetch=!a.includes(s.code),Object.setPrototypeOf(s,t.prototype),s}return te(t,e),t.prototype.Message=function(e){return void 0===e&&(e=null),[K.PluginCredentialsNotSetMessageDetected,K.PluginSettingsSiteIdNotSet,K.PluginSettingsApiSecretNotSet].includes(this.code)?Q(e):(this.code===K.FetchError&&(this.hint=this.Hint((0,p.__)("This error can sometimes be caused by ad-blockers or browser tracking protections. Please add this site to any applicable allow lists and try again.","wp-parsely"))),this.code===K.ParselyApiForbidden&&(this.hint=this.Hint((0,p.__)("Please ensure that the Site ID and API Secret given in the plugin's settings are correct.","wp-parsely"))),this.code===K.HttpRequestFailed&&(this.hint=this.Hint((0,p.__)("The Parse.ly API cannot be reached. Please verify that you are online.","wp-parsely"))),this.code===K.ParselyApiUnauthorized&&(this.message=(0,p.__)("This feature is accessible to select customers participating in its beta testing.","wp-parsely")),(0,i.jsx)(q,{className:null==e?void 0:e.className,testId:"error",children:"

".concat(this.message,"

").concat(this.hint?this.hint:"")}))},t.prototype.Hint=function(e){return'

'.concat((0,p.__)("Hint:","wp-parsely")," ").concat(e,"

")},t}(Error),re={month:"short",day:"numeric",year:"numeric"},ie={month:"short",day:"numeric"},se=(0,p.__)("Date N/A","wp-parsely");function ae(e){if(!1===function(e){return!isNaN(+e)&&0!==e.getTime()}(e))return se;var t=re;return e.getUTCFullYear()===(new Date).getUTCFullYear()&&(t=ie),Intl.DateTimeFormat(document.documentElement.lang||"en",t).format(e)}function oe(e){return{period_start:e,period_end:""}}var le=function(){return le=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1?[2,Promise.reject(new ne((0,p.sprintf)(/* translators: URL of the published post */ +(0,p.__)("Multiple results were returned for the post %s by the Parse.ly API.","wp-parsely"),t),K.ParselyApiReturnedTooManyResults))]:[2,n.data[0]]}}))}))},e.prototype.fetchReferrerDataFromWpEndpoint=function(e,t,n){return ce(this,void 0,void 0,(function(){var r,i;return ue(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,V()({path:(0,ee.addQueryArgs)("/wp-parsely/v1/referrers/post/detail",le(le({},oe(e)),{itm_source:this.itmSource,total_views:n,url:t}))})];case 1:return r=s.sent(),[3,3];case 2:return i=s.sent(),[2,Promise.reject(new ne(i.message,i.code))];case 3:return(null==r?void 0:r.error)?[2,Promise.reject(new ne(r.error.message,K.ParselyApiResponseContainsError))]:[2,r.data]}}))}))},e}(),de=function(){return de=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&e.retryFetch?[4,new Promise((function(e){return setTimeout(e,500)}))]:[3,3];case 1:return t.sent(),[4,r(i-1)];case 2:return t.sent(),[3,4];case 3:p(e),o(!1),t.label=4;case 4:return[2]}}))}))})),[2]}))}))};return o(!0),r(1),function(){p(void 0)}}),[n]),c?c.Message():a?(0,i.jsx)("div",{className:"parsely-spinner-wrapper","data-testid":"parsely-spinner-wrapper",children:(0,i.jsx)(s.Spinner,{})}):(0,i.jsx)(ge,{data:h,period:n})}function ge(e){return(0,i.jsxs)("div",{className:"performance-details-panel",children:[(0,i.jsx)("div",{className:"section period",children:$(e.period)}),(0,i.jsx)(ve,de({},e)),(0,i.jsx)(we,de({},e)),(0,i.jsx)(me,de({},e)),(0,i.jsx)(_e,de({},e))]})}function ve(e){var t=e.data;return(0,i.jsx)("div",{className:"section general-performance",children:(0,i.jsxs)("table",{children:[(0,i.jsx)("tbody",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:Y(t.views)}),(0,i.jsx)("td",{children:Y(t.visitors)}),(0,i.jsx)("td",{children:t.avgEngaged})]})}),(0,i.jsx)("tfoot",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:(0,p.__)("Page Views","wp-parsely")}),(0,i.jsx)("th",{children:(0,p.__)("Visitors","wp-parsely")}),(0,i.jsx)("th",{children:(0,p.__)("Avg. Time","wp-parsely")})]})})]})})}function we(e){var t=e.data;delete t.referrers.types.totals;var n=function(e){switch(e){case"social":return(0,p.__)("Social","wp-parsely");case"search":return(0,p.__)("Search","wp-parsely");case"other":return(0,p.__)("Other","wp-parsely");case"internal":return(0,p.__)("Internal","wp-parsely");case"direct":return(0,p.__)("Direct","wp-parsely")}return e};return(0,i.jsxs)("div",{className:"section referrer-types",children:[(0,i.jsx)("div",{className:"section-title",children:(0,p.__)("Referrers (Page Views)","wp-parsely")}),(0,i.jsx)("div",{className:"multi-percentage-bar",children:Object.entries(t.referrers.types).map((function(e){var t=e[0],r=e[1],s=(0,p.sprintf)(/* translators: 1: Referrer type, 2: Percentage value, %%: Escaped percent sign */ +(0,p.__)("%1$s: %2$s%%","wp-parsely"),n(t),r.viewsPercentage);return(0,i.jsx)("div",{"aria-label":s,className:"bar-fill "+t,style:{width:r.viewsPercentage+"%"}},t)}))}),(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:Object.keys(t.referrers.types).map((function(e){return(0,i.jsx)("th",{children:n(e)},e)}))})}),(0,i.jsx)("tbody",{children:(0,i.jsx)("tr",{children:Object.entries(t.referrers.types).map((function(e){var t=e[0],n=e[1];return(0,i.jsx)("td",{children:Y(n.views)},t)}))})})]})]})}function me(e){var t=e.data,n=0;return(0,i.jsxs)("div",{className:"section top-referrers",children:[(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{scope:"col",children:(0,p.__)("Top Referrers","wp-parsely")}),(0,i.jsx)("th",{colSpan:2,scope:"colgroup",children:(0,p.__)("Page Views","wp-parsely")})]})}),(0,i.jsx)("tbody",{children:Object.entries(t.referrers.top).map((function(e){var t=e[0],r=e[1];if("totals"===t)return n=Number(r.viewsPercentage),null;var s=t;"direct"===t&&(s=(0,p.__)("Direct","wp-parsely")) +/* translators: %s: Percentage value, %%: Escaped percent sign */;var a=(0,p.sprintf)((0,p.__)("%s%%","wp-parsely"),r.viewsPercentage);return(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{scope:"row",children:s}),(0,i.jsx)("td",{children:(0,i.jsx)("div",{"aria-label":a,className:"percentage-bar",style:{"--bar-fill":r.viewsPercentage+"%"}})}),(0,i.jsx)("td",{children:Y(r.views)})]},t)}))})]}),(0,i.jsxs)("div",{children:[" ",/* translators: %s: Percentage value, %%: Escaped percent sign */ +(0,p.sprintf)((0,p._n)("%s%% of views came from top referrers.","%s%% of views came from top referrers.",n,"wp-parsely"),n)]})]})}function _e(e){var t=e.data,n=(0,i.jsxs)("span",{className:"screen-reader-text",children:[" ",(0,p.__)("(opens in new tab)","wp-parsely")]});return(0,i.jsxs)("div",{className:"section actions",children:[(0,i.jsxs)(s.Button,{href:t.url,rel:"noopener",target:"_blank",variant:"secondary",children:[(0,p.__)("Visit Post","wp-parsely"),n]}),(0,i.jsxs)(s.Button,{href:t.dashUrl,rel:"noopener",target:"_blank",variant:"primary",children:[(0,p.__)("View in Parse.ly","wp-parsely"),n]})]})}var be=function(e){var t=e.filter,n=e.label,s=e.onFilterTypeChange,a=e.onFilterValueChange,o=e.postData,l=function(){return o.tags.length>=1&&o.categories.length>=1||o.tags.length>=1&&o.authors.length>=1||o.categories.length>=1&&o.authors.length>=1},c=function(){return r.Tag===t.type&&o.tags.length>1||r.Section===t.type&&o.categories.length>1||r.Author===t.type&&o.authors.length>1},u=c()&&!l();return(0,i.jsxs)(i.Fragment,{children:[l()&&(0,i.jsx)(xe,{filter:t,label:u?void 0:n,onFilterTypeChange:s,postData:o}),c()&&(0,i.jsx)(je,{filter:t,label:u?n:void 0,onFilterValueChange:a,postData:o})]})},xe=function(e){var t=e.filter,n=e.label,a=e.onFilterTypeChange,o=e.postData;return(0,i.jsxs)(s.SelectControl,{label:n,onChange:function(e){return a(e)},value:t.type,children:[o.tags.length>=1&&(0,i.jsx)("option",{value:r.Tag,children:(0,p.__)("Tag","wp-parsely")}),o.categories.length>=1&&(0,i.jsx)("option",{value:r.Section,children:(0,p.__)("Section","wp-parsely")}),o.authors.length>=1&&(0,i.jsx)("option",{value:r.Author,children:(0,p.__)("Author","wp-parsely")})]})},je=function(e){var t=e.filter,n=e.label,a=e.onFilterValueChange,o=e.postData;return(0,i.jsx)(s.ComboboxControl,{label:n,onChange:function(e){return a(e)},options:r.Tag===t.type?o.tags.map((function(e){return{value:e,label:e}})):r.Section===t.type?o.categories.map((function(e){return{value:e,label:e}})):r.Author===t.type?o.authors.map((function(e){return{value:e,label:e}})):[],value:t.value})},Pe=function(){return(0,i.jsx)(s.SVG,{"aria-hidden":"true",version:"1.1",viewBox:"0 0 15 15",width:"15",height:"15",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(s.Path,{d:"M0 14.0025V11.0025L7.5 3.5025L10.5 6.5025L3 14.0025H0ZM12 5.0025L13.56 3.4425C14.15 2.8525 14.15 1.9025 13.56 1.3225L12.68 0.4425C12.09 -0.1475 11.14 -0.1475 10.56 0.4425L9 2.0025L12 5.0025Z"})})},Te=function(){return(0,i.jsxs)(s.SVG,{"aria-hidden":"true",version:"1.1",viewBox:"0 0 16 16",width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(s.Path,{d:"M0 3.29592C0 2.73237 0.456853 2.27551 1.02041 2.27551H4.08165C4.50432 2.27551 4.84696 2.61815 4.84696 3.04082C4.84696 3.46349 4.50432 3.80613 4.08165 3.80613H1.53062V11.9694H9.69391V9.6735C9.69391 9.25083 10.0366 8.90819 10.4592 8.90819C10.8819 8.90819 11.2245 9.25083 11.2245 9.6735V12.4796C11.2245 13.0432 10.7677 13.5 10.2041 13.5H1.02041C0.456854 13.5 0 13.0432 0 12.4796V3.29592Z"}),(0,i.jsx)(s.Path,{d:"M12.531 1.22415C12.8299 1.52303 12.8299 2.00759 12.531 2.30646L6.15342 8.68404C5.85455 8.98291 5.36998 8.98291 5.07111 8.68404C4.77224 8.38517 4.77224 7.9006 5.07111 7.60173L11.4487 1.22415C11.7476 0.925282 12.2321 0.925282 12.531 1.22415Z"}),(0,i.jsx)(s.Path,{d:"M6.63268 1.51012C6.63268 1.08745 6.97532 0.744812 7.39799 0.744812H12.2449C12.6676 0.744812 13.0103 1.08745 13.0103 1.51012V6.35708C13.0103 6.77975 12.6676 7.12239 12.2449 7.12239C11.8223 7.12239 11.4796 6.77975 11.4796 6.35708V2.27543H7.39799C6.97532 2.27543 6.63268 1.93279 6.63268 1.51012Z"})]})},Se=function(){return(0,i.jsx)(s.SVG,{"aria-hidden":"true",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 42 42",children:(0,i.jsx)(s.Path,{d:"M15.3,20.1c0,3.1,2.6,5.7,5.7,5.7s5.7-2.6,5.7-5.7s-2.6-5.7-5.7-5.7S15.3,17,15.3,20.1z M23.4,32.4\n\t\t\tC30.1,30.9,40.5,22,40.5,22s-7.7-12-18-13.3c-0.6-0.1-2.6-0.1-3-0.1c-10,1-18,13.7-18,13.7s8.7,8.6,17,9.9\n\t\t\tC19.4,32.6,22.4,32.6,23.4,32.4z M11.1,20.7c0-5.2,4.4-9.4,9.9-9.4s9.9,4.2,9.9,9.4S26.5,30,21,30S11.1,25.8,11.1,20.7z"})})};function Ee(e){var t=e.metric,n=e.post,r=e.avgEngagedIcon,s=e.viewsIcon;return"views"===t?(0,i.jsxs)("span",{className:"parsely-top-post-metric-data",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Number of Views","wp-parsely")}),s,Y(n.views.toString())]}):"avg_engaged"===t?(0,i.jsxs)("span",{className:"parsely-top-post-metric-data",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Average Time","wp-parsely")}),r,n.avgEngaged]}):(0,i.jsx)("span",{className:"parsely-top-post-metric-data",children:"-"})}function Ce(e){var t,n=e.metric,r=e.post;return(0,i.jsxs)("li",{className:"parsely-top-post","data-testid":"parsely-top-post",children:[(0,i.jsxs)("div",{className:"parsely-top-post-title",children:[(0,i.jsxs)("a",{className:"parsely-top-post-stats-link",href:r.dashUrl,target:"_blank",rel:"noreferrer",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("View in Parse.ly (opens new tab)","wp-parsely")}),r.title]}),(0,i.jsxs)("a",{className:"parsely-top-post-view-link",href:r.url,target:"_blank",rel:"noreferrer",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("View Post (opens new tab)","wp-parsely")}),(0,i.jsx)(Te,{})]}),0!==r.postId&&(0,i.jsxs)("a",{className:"parsely-top-post-edit-link",href:(t=r.postId,"/wp-admin/post.php?post=".concat(t,"&action=edit")),target:"_blank",rel:"noreferrer",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Edit Post (opens new tab)","wp-parsely")}),(0,i.jsx)(Pe,{})]})]}),(0,i.jsxs)("p",{className:"parsely-top-post-info",children:[(0,i.jsxs)("span",{className:"parsely-top-post-date",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Date","wp-parsely")}),ae(new Date(r.date))]}),(0,i.jsxs)("span",{className:"parsely-top-post-author",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Author","wp-parsely")}),r.author]}),(0,i.jsx)(Ee,{metric:n,post:r,viewsIcon:(0,i.jsx)(Se,{}),avgEngagedIcon:(0,i.jsx)(s.Dashicon,{icon:"clock"})})]})]})}var Ne=function(){return Ne=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&n.retryFetch?[4,new Promise((function(e){return setTimeout(e,500)}))]:[3,3];case 1:return t.sent(),[4,i(e-1)];case 2:return t.sent(),[3,4];case 3:y(!1),w(n),t.label=4;case 4:return[2]}}))}))})),[2]}))}))},s=r.Tag===S.type,o=r.Unavailable===S.type,u=0===c.tags.length,p=s&&!c.tags.includes(S.value);return y(!0),o||s&&u?E((e="",n=r.Unavailable,c.tags.length>=1?(n=r.Tag,e=c.tags[0]):c.categories.length>=1?(n=r.Section,e=c.categories[0]):(n=r.Author,e=c.authors[0]),{type:n,value:e})):p?E({type:r.Tag,value:c.tags[0]}):i(1),function(){y(!1),P([]),b(""),w(void 0)}}),[l,a,S,c]);var C=(0,i.jsx)("div",{className:"parsely-spinner-wrapper","data-testid":"parsely-spinner-wrapper",children:(0,i.jsx)(s.Spinner,{})}),N=(0,i.jsx)(he,{filter:S,label:(0,p.__)("Filter by","wp-parsely"),onFilterTypeChange:function(e){if(F(e,r)){var t="",n=e;r.Tag===n&&(t=c.tags[0]),r.Section===n&&(t=c.categories[0]),r.Author===n&&(t=c.authors[0]),""!==t&&(o(n,t),E({type:n,value:t}),h.trackEvent("related_top_posts_filter_type_changed",{filter_type:n}))}},onFilterValueChange:function(e){"string"==typeof e&&(o(S.type,e),E(Te(Te({},S),{value:e})))},postData:c});return v?(0,i.jsxs)(i.Fragment,{children:[N,v.Message({className:"parsely-top-posts-descr"})]}):(0,i.jsxs)(i.Fragment,{children:[N,f?C:(0,i.jsxs)("div",{className:"parsely-top-posts-wrapper",children:[(0,i.jsx)("p",{className:"parsely-top-posts-descr","data-testid":"parsely-top-posts-descr",children:_}),(0,i.jsx)("ol",{className:"parsely-top-posts",children:j.map((function(e){return(0,i.jsx)(_e,{metric:a,post:e},e.id)}))})]})]})}var Ne,ke=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,g.createElement)(v.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})),Oe=function(e){var t=e.isLoading,n=e.isOpen,r=e.onPersonaChange,a=e.onSettingChange,o=e.onToneChange,l=e.persona,c=e.tone,d=(0,u.useState)(n),f=d[0],y=d[1];return(0,i.jsxs)("div",{className:"parsely-write-titles-settings",children:[(0,i.jsxs)("div",{className:"parsely-write-titles-settings-header",children:[(0,i.jsx)(I,{size:20}),(0,i.jsx)(s.BaseControl,{id:"parsely-write-titles-settings",className:"parsely-write-titles-settings-header-label",label:(0,p.__)("Parse.ly AI Settings","wp-parsely"),children:(0,i.jsx)(s.Button,{label:(0,p.__)("Change Tone & Persona","wp-parsely"),icon:ke,onClick:function(){a("TitleSuggestionsSettingsOpen",!f),y(!f),h.trackEvent("title_suggestions_ai_settings_toggled",{is_active:!f})},isPressed:f,size:"small"})})]}),f&&(0,i.jsxs)("div",{className:"parsely-write-titles-settings-body",children:[(0,i.jsx)(A,{tone:c,label:N(c),onChange:function(e){o(e)},onDropdownChange:function(e){h.trackEvent("title_suggestions_ai_tone_changed",{tone:e})},disabled:t,allowCustom:!0}),(0,i.jsx)(T,{persona:l,label:x(l),onChange:function(e){r(e)},onDropdownChange:function(e){h.trackEvent("title_suggestions_ai_persona_changed",{persona:e})},disabled:t,allowCustom:!0})]})]})},Ae=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),Re=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{d:"m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z"})),Le=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})),Ie=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})),Fe=function(){return Fe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?"secondary":"primary",isBusy:b,onClick:function(){return $e(void 0,void 0,void 0,(function(){return We(this,(function(e){switch(e.label){case 0:return!1!==b?[3,2]:(h.trackEvent("title_suggestions_generate_pressed",{request_more:j.length>0,total_titles:j.length,total_pinned:j.filter((function(e){return e.isPinned})).length,tone:y,persona:w}),[4,(t=Ne.PostTitle,n=A,r=y,i=w,$e(void 0,void 0,void 0,(function(){var e,s,a;return We(this,(function(o){switch(o.label){case 0:return[4,C(!0)];case 1:o.sent(),e=new Ue,o.label=2;case 2:return o.trys.push([2,5,,6]),[4,e.generateTitles(n,3,r,i)];case 3:return s=o.sent(),[4,E(t,s)];case 4:return o.sent(),[3,6];case 5:return a=o.sent(),d(a),[3,6];case 6:return[4,C(!1)];case 7:return o.sent(),[2]}}))})))]);case 1:e.sent(),e.label=2;case 2:return[2]}var t,n,r,i}))}))},children:[b&&(0,p.__)("Generating Titles…","wp-parsely"),!b&&j.length>0&&(0,p.__)("Generate More","wp-parsely"),!b&&0===j.length&&(0,p.__)("Generate Titles","wp-parsely")]})}),F=(0,i.jsxs)("div",{className:"parsely-write-titles-title-suggestions-container",children:[void 0!==T&&(0,i.jsx)(He,{title:T,type:Ne.PostTitle,isOriginal:!0}),j.map((function(e){return(0,i.jsx)(He,{title:e,type:Ne.PostTitle},e.id)}))]}),D=(0,i.jsxs)("div",{className:"parsely-write-titles-accepted-title-container",children:[(0,i.jsx)("div",{className:"parsely-write-titles-text",children:(0,p.__)("Replace the current post title with the following?","wp-parsely")}),(0,i.jsx)("div",{className:"parsely-write-titles-accepted-title",children:null==P?void 0:P.title}),(0,i.jsxs)("div",{className:"parsely-write-titles-accepted-title-actions",children:[(0,i.jsx)(s.Button,{variant:"secondary",onClick:function(){var e;k(Ne.PostTitle,void 0),h.trackEvent("title_suggestions_cancel_pressed",{original_title:R,canceled_title:null!==(e=null==P?void 0:P.title)&&void 0!==e?e:""})},children:(0,p.__)("Cancel","wp-parsely")}),(0,i.jsx)(s.Button,{variant:"primary",onClick:function(){return $e(void 0,void 0,void 0,(function(){return We(this,(function(e){switch(e.label){case 0:return[4,O(Ne.PostTitle,R)];case 1:return e.sent(),(0,o.dispatch)("core/editor").editPost({title:null==P?void 0:P.title}),P?[4,(0,o.dispatch)(ze).pinTitle(Ne.PostTitle,P)]:[3,3];case 2:e.sent(),h.trackEvent("title_suggestions_accept_pressed",{old_title:R,new_title:P.title}),e.label=3;case 3:return[4,k(Ne.PostTitle,void 0)];case 4:return e.sent(),[2]}}))}))},children:(0,p.__)("Replace","wp-parsely")})]})]});return c?c.Message():(0,i.jsx)(s.PanelRow,{children:(0,i.jsxs)("div",{className:"parsely-write-titles-wrapper",children:[0===j.length&&void 0===P&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"parsely-write-titles-text",children:(0,p.__)("Use Parse.ly AI to generate a title for your post.","wp-parsely")}),L,I]}),00&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&n.retryFetch?[4,new Promise((function(e){return setTimeout(e,500)}))]:[3,3];case 1:return t.sent(),[4,s(e-1)];case 2:return t.sent(),[3,4];case 3:g(!1),m(n),t.label=4;case 4:return[2]}}))}))})),[2]}))}))},l=r.Tag===E.type,c=r.Unavailable===E.type,u=0===o.tags.length,p=l&&!o.tags.includes(E.value);return g(!0),c||l&&u?C((e="",i=r.Unavailable,o.tags.length>=1?(i=r.Tag,e=o.tags[0]):o.categories.length>=1?(i=r.Section,e=o.categories[0]):(i=r.Author,e=o.authors[0]),{type:i,value:e})):p?C({type:r.Tag,value:o.tags[0]}):s(1),function(){g(!1),T([]),x(""),m(void 0)}}),[a,n,E,o]);var k=(0,i.jsx)("div",{className:"parsely-spinner-wrapper","data-testid":"parsely-spinner-wrapper",children:(0,i.jsx)(s.Spinner,{})}),O=(0,i.jsx)(be,{filter:E,label:(0,p.__)("Filter by","wp-parsely"),onFilterTypeChange:function(e){if(U(e,r)){var t="",n=e;r.Tag===n&&(t=o.tags[0]),r.Section===n&&(t=o.categories[0]),r.Author===n&&(t=o.authors[0]),""!==t&&(N(n,t),C({type:n,value:t}),h.trackEvent("related_top_posts_filter_type_changed",{filter_type:n}))}},onFilterValueChange:function(e){"string"==typeof e&&(N(E.type,e),C(Re(Re({},E),{value:e})))},postData:o});return w?(0,i.jsxs)(i.Fragment,{children:[O,w.Message({className:"parsely-top-posts-descr"})]}):(0,i.jsxs)(i.Fragment,{children:[O,y?k:(0,i.jsxs)("div",{className:"parsely-top-posts-wrapper",children:[(0,i.jsx)("p",{className:"parsely-top-posts-descr","data-testid":"parsely-top-posts-descr",children:b}),(0,i.jsx)("ol",{className:"parsely-top-posts",children:P.map((function(e){return(0,i.jsx)(Ce,{metric:n,post:e},e.id)}))})]})]})}var Me,De=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,g.createElement)(v.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})),Ve=function(e){var t=e.isLoading,n=e.isOpen,r=e.onPersonaChange,a=e.onSettingChange,o=e.onToneChange,l=e.persona,c=e.tone,d=(0,u.useState)(n),f=d[0],y=d[1];return(0,i.jsxs)("div",{className:"parsely-write-titles-settings",children:[(0,i.jsxs)("div",{className:"parsely-write-titles-settings-header",children:[(0,i.jsx)(R,{size:20}),(0,i.jsx)(s.BaseControl,{id:"parsely-write-titles-settings",className:"parsely-write-titles-settings-header-label",label:(0,p.__)("Parse.ly AI Settings","wp-parsely"),children:(0,i.jsx)(s.Button,{label:(0,p.__)("Change Tone & Persona","wp-parsely"),icon:De,onClick:function(){a("TitleSuggestionsSettingsOpen",!f),y(!f),h.trackEvent("title_suggestions_ai_settings_toggled",{is_active:!f})},isPressed:f,size:"small"})})]}),f&&(0,i.jsxs)("div",{className:"parsely-write-titles-settings-body",children:[(0,i.jsx)(A,{tone:c,label:N(c),onChange:function(e){o(e)},onDropdownChange:function(e){h.trackEvent("title_suggestions_ai_tone_changed",{tone:e})},disabled:t,allowCustom:!0}),(0,i.jsx)(T,{persona:l,label:x(l),onChange:function(e){r(e)},onDropdownChange:function(e){h.trackEvent("title_suggestions_ai_persona_changed",{persona:e})},disabled:t,allowCustom:!0})]})]})},Ge=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),ze=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{d:"m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z"})),Be=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})),He=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})),Ue=function(){return Ue=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?"secondary":"primary",isBusy:m,onClick:function(){return Ke(void 0,void 0,void 0,(function(){return et(this,(function(e){switch(e.label){case 0:return!1!==m?[3,2]:(h.trackEvent("title_suggestions_generate_pressed",{request_more:_.length>0,total_titles:_.length,total_pinned:_.filter((function(e){return e.isPinned})).length,tone:d,persona:g}),[4,(t=Me.PostTitle,n=O,r=d,i=g,Ke(void 0,void 0,void 0,(function(){var e,s,a;return et(this,(function(o){switch(o.label){case 0:return[4,S(!0)];case 1:o.sent(),e=new Je,o.label=2;case 2:return o.trys.push([2,5,,6]),[4,e.generateTitles(n,3,r,i)];case 3:return s=o.sent(),[4,T(t,s)];case 4:return o.sent(),[3,6];case 5:return a=o.sent(),l(a),[3,6];case 6:return[4,S(!1)];case 7:return o.sent(),[2]}}))})))]);case 1:e.sent(),e.label=2;case 2:return[2]}var t,n,r,i}))}))},children:[m&&(0,p.__)("Generating Titles…","wp-parsely"),!m&&_.length>0&&(0,p.__)("Generate More","wp-parsely"),!m&&0===_.length&&(0,p.__)("Generate Titles","wp-parsely")]})}),I=(0,i.jsxs)("div",{className:"parsely-write-titles-title-suggestions-container",children:[void 0!==j&&(0,i.jsx)(Ye,{title:j,type:Me.PostTitle,isOriginal:!0}),_.map((function(e){return(0,i.jsx)(Ye,{title:e,type:Me.PostTitle},e.id)}))]}),F=(0,i.jsxs)("div",{className:"parsely-write-titles-accepted-title-container",children:[(0,i.jsx)("div",{className:"parsely-write-titles-text",children:(0,p.__)("Replace the current post title with the following?","wp-parsely")}),(0,i.jsx)("div",{className:"parsely-write-titles-accepted-title",children:null==b?void 0:b.title}),(0,i.jsxs)("div",{className:"parsely-write-titles-accepted-title-actions",children:[(0,i.jsx)(s.Button,{variant:"secondary",onClick:function(){var e;E(Me.PostTitle,void 0),h.trackEvent("title_suggestions_cancel_pressed",{original_title:A,canceled_title:null!==(e=null==b?void 0:b.title)&&void 0!==e?e:""})},children:(0,p.__)("Cancel","wp-parsely")}),(0,i.jsx)(s.Button,{variant:"primary",onClick:function(){return Ke(void 0,void 0,void 0,(function(){return et(this,(function(e){switch(e.label){case 0:return[4,C(Me.PostTitle,A)];case 1:return e.sent(),(0,o.dispatch)("core/editor").editPost({title:null==b?void 0:b.title}),b?[4,(0,o.dispatch)(Qe).pinTitle(Me.PostTitle,b)]:[3,3];case 2:e.sent(),h.trackEvent("title_suggestions_accept_pressed",{old_title:A,new_title:b.title}),e.label=3;case 3:return[4,E(Me.PostTitle,void 0)];case 4:return e.sent(),[2]}}))}))},children:(0,p.__)("Replace","wp-parsely")})]})]});return a?a.Message():(0,i.jsx)(s.PanelRow,{children:(0,i.jsxs)("div",{className:"parsely-write-titles-wrapper",children:[0===_.length&&void 0===b&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"parsely-write-titles-text",children:(0,p.__)("Use Parse.ly AI to generate a title for your post.","wp-parsely")}),R,L]}),0<_.length&&void 0===b&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"parsely-write-titles-text",children:(0,u.createInterpolateElement)( // translators: %1$s is the tone, %2$s is the persona. -(0,p.__)("We've generated a few titles based on the content of your post, written as a .","wp-parsely"),{tone:(0,i.jsx)("strong",{children:N(y)}),persona:(0,i.jsx)("strong",{children:x(w)})})}),F,L,I]}),void 0!==P&&D]})})},Qe=function(){return Qe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n titles based on the content of your post, written as a .","wp-parsely"),{tone:(0,i.jsx)("strong",{children:N(d)}),persona:(0,i.jsx)("strong",{children:x(g)})})}),I,R,L]}),void 0!==b&&F]})})},nt=function(){return nt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n { - const isFirstRender = useRef( true ); - - useEffect( () => { - // Don't save settings on the first render. - if ( isFirstRender.current ) { - isFirstRender.current = false; - return; - } - - apiFetch( { - path: '/wp-parsely/v1/user-meta/content-helper/' + endpoint, - method: 'PUT', - data, - } ); - }, deps ?? Object.values( data ) ); // eslint-disable-line react-hooks/exhaustive-deps -}; diff --git a/src/content-helper/common/settings/index.ts b/src/content-helper/common/settings/index.ts new file mode 100644 index 000000000..51cca9764 --- /dev/null +++ b/src/content-helper/common/settings/index.ts @@ -0,0 +1,35 @@ +/** + * WordPress dependencies + */ +import { register, select } from '@wordpress/data'; + +/** + * Internal dependencies + */ +import { SettingsStore, STORE_NAME } from './store'; + +/** + * Exports + */ +export { SettingsProvider, useSettings } from './provider'; +// Export all the settings types. +export * from './types'; + +/** + * Initializes the settings store. + * + * @since 3.14.0 + */ +function initSettings() { + // Check if the store is already registered. + const isStoreRegistered = select( STORE_NAME ) !== undefined; + + // Register the store if it's not already registered. + if ( ! isStoreRegistered ) { + register( SettingsStore ); + } +} + +// Initialize the settings store. +initSettings(); + diff --git a/src/content-helper/common/settings/provider.tsx b/src/content-helper/common/settings/provider.tsx new file mode 100644 index 000000000..b4d0b5e96 --- /dev/null +++ b/src/content-helper/common/settings/provider.tsx @@ -0,0 +1,183 @@ +/** + * WordPress dependencies + */ +import apiFetch from '@wordpress/api-fetch'; +import { dispatch, useSelect } from '@wordpress/data'; +import { + createContext, + useCallback, + useContext, + useEffect, + useMemo, + useRef, + useState, +} from '@wordpress/element'; +import type { ReactNode } from 'react'; + +/** + * Internal dependencies + */ +import { SettingsStore } from './store'; +import { Settings } from './types'; + +/** + * The context type for the settings context. + * + * @since 3.14.0 + */ +interface SettingsContextType { + settings: T; + setSettings: ( settings: Partial ) => void; +} + +/** + * The Settings context. + * + * @since 3.14.0 + */ +const SettingsContext = createContext>( { + settings: {} as Settings, + setSettings: () => { + // eslint-disable-next-line no-console + console.error( 'WP Parse.ly: setSettings not implemented' ); + }, +} ); + +/** + * Hook to get the settings from the context. + * Should only be used within a SettingsProvider. + * + * @since 3.14.0 + * + * @template T - The type of settings to retrieve, defaults to Settings. + * + * @return {SettingsContextType} The settings context. + * + * @throws {Error} Throws an error if used outside of a SettingsProvider. + * + * @example + * // Using the useSettings hook with a specific type + * const { settings, setSettings } = useSettings(); + */ +export const useSettings = (): SettingsContextType => { + const context = useContext( SettingsContext ); + if ( context === undefined ) { + throw new Error( 'useSettings must be used within a SettingsProvider' ); + } + return context as unknown as SettingsContextType; +}; + +/** + * Custom types for brevity and for avoiding a "type React is undefined" error. + */ +type ReactDeps = React.DependencyList | undefined; + +/** + * Saves the settings into the WordPress database whenever a dependency update + * occurs. + * + * @since 3.13.0 + * @since 3.14.0 Moved from `content-helper/common/hooks/useSaveSettings.ts`. + * + * @param {string} endpoint The settings endpoint to send the data to. + * @param {Settings} data The data to send. + * @param {ReactDeps} deps The deps array that triggers saving. + */ +const useSaveSettings = ( + endpoint: string, + data: Settings, + deps: ReactDeps +) => { + const isFirstRender = useRef( true ); + + useEffect( () => { + // Don't save settings on the first render. + if ( isFirstRender.current ) { + isFirstRender.current = false; + return; + } + + apiFetch( { + path: '/wp-parsely/v1/user-meta/content-helper/' + endpoint, + method: 'PUT', + data, + } ); + }, deps ); // eslint-disable-line react-hooks/exhaustive-deps +}; + +/** + * The SettingsProvider component properties. + * + * @since 3.14.0 + */ +interface SettingsProviderProps { + children: ReactNode; + endpoint: string; + defaultSettings: Settings; +} + +/** + * The SettingsProvider component. + * + * Provides the settings context to its children. + * It also saves the settings to the WordPress database whenever a setting change occurs. + * The settings are saved to the WordPress database using the useSaveSettings hook. + * + * @since 3.14.0 + * + * @param {SettingsProviderProps} props The component's props. + */ +export const SettingsProvider = ( { children, endpoint, defaultSettings }: SettingsProviderProps ) => { + // Get the current settings from the store. + const { storedSettings } = useSelect( ( select ) => { + let settings = select( SettingsStore ).getSettings( endpoint ); + + // Set the default settings if empty. + if ( ! settings ) { + settings = defaultSettings; + dispatch( SettingsStore ).setSettings( endpoint, defaultSettings ).then( () => {} ); + } + + return { + storedSettings: settings, + }; + }, [ defaultSettings, endpoint ] ); + + // Internal state for storing the settings. + const [ internalSettings, setInternalSettings ] = useState( storedSettings ); + const { setPartialSettings } = dispatch( SettingsStore ); + + /** + * Updates the settings in the internal state and in the store. + * + * @since 3.14.0 + * + * @param {Partial} updatedSettings The updated settings. + */ + const updateSettings = useCallback( ( updatedSettings: Partial ) => { + setInternalSettings( ( currentSettings ) => ( { ...currentSettings, ...updatedSettings } ) ); + setPartialSettings( endpoint, updatedSettings ); + }, [ endpoint, setPartialSettings ] ); + + /** + * Saves the settings into the WordPress database whenever a setting change + * occurs. + * + * internalSettings is the dependency, because we only want to save the settings + * when they change, and save it with the value in the store (storedSettings). + * + * @since 3.14.0 + */ + useSaveSettings( endpoint, storedSettings, [ internalSettings ] ); + + // Memoize the provider value to avoid unnecessary re-renders. + const providerValue = useMemo( () => ( + { settings: storedSettings, setSettings: updateSettings } + ), [ storedSettings, updateSettings ] ); + + return ( + + { children } + + ); +}; diff --git a/src/content-helper/common/settings/store.ts b/src/content-helper/common/settings/store.ts new file mode 100644 index 000000000..8d134a678 --- /dev/null +++ b/src/content-helper/common/settings/store.ts @@ -0,0 +1,83 @@ +/** + * WordPress dependencies + */ +import { createReduxStore } from '@wordpress/data'; + +/** + * Internal dependencies + */ +import type { Settings } from './types'; + +// Define state type. +interface SettingsState { + [endpoint: string]: Settings; +} + +// Define action types. +interface SetSettingsAction { + type: 'SET_SETTINGS'; + endpoint: string; + settings: Settings; +} + +interface SetPartialSettingsAction { + type: 'SET_PARTIAL_SETTINGS'; + endpoint: string; + partialSettings: Partial; +} + +// Union of all action types. +type ActionTypes = SetSettingsAction | SetPartialSettingsAction; + +// Default state. +const DEFAULT_STATE: SettingsState = {}; + +// Store name. +export const STORE_NAME = 'wp-parsely/settings'; + +// Reducer. +const reducer = ( state: SettingsState = DEFAULT_STATE, action: ActionTypes ): SettingsState => { + switch ( action.type ) { + case 'SET_SETTINGS': { + return { + ...state, + [ action.endpoint ]: action.settings, + }; + } + case 'SET_PARTIAL_SETTINGS': { + const currentSettings = state[ action.endpoint ] || {}; + const updatedSettings = { ...currentSettings, ...action.partialSettings } as Settings; + return { + ...state, + [ action.endpoint ]: updatedSettings, + }; + } + default: + return state; + } +}; + +// Actions. +const actions = { + setSettings( endpoint: string, settings: Settings ): SetSettingsAction { + return { type: 'SET_SETTINGS', endpoint, settings }; + }, + setPartialSettings( endpoint: string, partialSettings: Partial ): SetPartialSettingsAction { + return { type: 'SET_PARTIAL_SETTINGS', endpoint, partialSettings }; + }, +}; + +// Selectors. +const selectors = { + getSettings( state: SettingsState, endpoint: string ): Settings { + return state[ endpoint ]; + }, +}; + +// Create and register the store. +export const SettingsStore = createReduxStore( STORE_NAME, { + initialState: DEFAULT_STATE, + reducer, + actions, + selectors, +} ); diff --git a/src/content-helper/common/settings/types/index.ts b/src/content-helper/common/settings/types/index.ts new file mode 100644 index 000000000..a65440b62 --- /dev/null +++ b/src/content-helper/common/settings/types/index.ts @@ -0,0 +1,17 @@ +/** + * Import the settings types. + */ +import type { SidebarSettings } from './sidebar-settings'; +import type { TopPostsSettings } from './top-posts-settings'; + +/** + * Export the settings types. + */ +export type { + SidebarSettings, + TopPostsSettings, +}; + +// Generic type for settings. +export type Settings = SidebarSettings | TopPostsSettings; + diff --git a/src/content-helper/common/settings/types/sidebar-settings.d.ts b/src/content-helper/common/settings/types/sidebar-settings.d.ts new file mode 100644 index 000000000..1b6a773d2 --- /dev/null +++ b/src/content-helper/common/settings/types/sidebar-settings.d.ts @@ -0,0 +1,21 @@ +import { Metric, Period } from '../../utils/constants'; + +/** + * Defines the settings structure for the ContentHelperEditorSidebar component. + * + * @since 3.13.0 + * @since 3.14.0 Moved from `content-helper/editor-sidebar/editor-sidebar.tsx`. + */ +export interface SidebarSettings { + PerformanceDetailsOpen: boolean; + RelatedTopPostsFilterBy: string; + RelatedTopPostsFilterValue: string; + RelatedTopPostsOpen: boolean; + SettingsMetric: Metric; + SettingsOpen: boolean; + SettingsPeriod: Period; + TitleSuggestionsOpen: boolean; + TitleSuggestionsPersona: string; + TitleSuggestionsSettingsOpen: boolean; + TitleSuggestionsTone: string; +} diff --git a/src/content-helper/common/settings/types/top-posts-settings.d.ts b/src/content-helper/common/settings/types/top-posts-settings.d.ts new file mode 100644 index 000000000..49b5abb3a --- /dev/null +++ b/src/content-helper/common/settings/types/top-posts-settings.d.ts @@ -0,0 +1,12 @@ +import { Metric, Period } from '../../utils/constants'; + +/** + * Defines the settings structure for the TopPosts component. + * + * @since 3.13.0 + * @since 3.14.0 Moved from `content-helper/dashboard-widget/components/top-posts.tsx`. + */ +export interface TopPostsSettings { + Metric: Metric; + Period: Period; +} diff --git a/src/content-helper/dashboard-widget/components/top-posts.tsx b/src/content-helper/dashboard-widget/components/top-posts.tsx index 104d8bcc1..9f0b7d17a 100644 --- a/src/content-helper/dashboard-widget/components/top-posts.tsx +++ b/src/content-helper/dashboard-widget/components/top-posts.tsx @@ -10,8 +10,8 @@ import { __, sprintf } from '@wordpress/i18n'; */ import { Telemetry } from '../../../js/telemetry/telemetry'; import { ContentHelperError } from '../../common/content-helper-error'; -import { useSaveSettings } from '../../common/hooks/useSaveSettings'; import { Select } from '../../common/select'; +import { TopPostsSettings, useSettings } from '../../common/settings'; import { Metric, Period, @@ -25,74 +25,18 @@ import { TopPostListItem } from './top-posts-list-item'; const FETCH_RETRIES = 1; -/** - * Defines the settings structure for the TopPosts component. - * - * @since 3.13.0 - */ -export interface TopPostsSettings { - Metric: Metric; - Period: Period; -} - -/** - * Gets the settings from the passed JSON. - * - * If missing settings or invalid values are detected, they get set to their - * defaults. - * - * @since 3.13.0 - * - * @param {string} settingsJson The JSON containing the settings. - * - * @return {TopPostsSettings} The resulting settings object. - */ -const getSettingsFromJson = ( settingsJson: string ): TopPostsSettings => { - let parsedSettings: TopPostsSettings; - - try { - parsedSettings = JSON.parse( settingsJson ); - } catch ( e ) { - // Return defaults when parsing failed or the string is empty. - return { - Metric: Metric.Views, - Period: Period.Days7, - }; - } - - // Fix invalid values if any are found. - if ( ! isInEnum( parsedSettings?.Metric, Metric ) ) { - parsedSettings.Metric = Metric.Views; - } - if ( ! isInEnum( parsedSettings?.Period, Period ) ) { - parsedSettings.Period = Period.Days7; - } - - return parsedSettings; -}; - /** * List of the top posts. * * @since 3.7.0 */ export function TopPosts(): JSX.Element { - const [ settings, setSettings ] = useState( - getSettingsFromJson( window.wpParselyContentHelperSettings ) - ); + const { settings, setSettings } = useSettings(); const [ loading, setLoading ] = useState( true ); const [ error, setError ] = useState(); const [ posts, setPosts ] = useState( [] ); const [ page, setPage ] = useState( 1 ); - /** - * Saves the settings into the WordPress database whenever a setting change - * occurs. - * - * @since 3.13.0 - */ - useSaveSettings( 'dashboard-widget-settings', settings ); - /** * Fetches the top posts. * @@ -152,7 +96,6 @@ export function TopPosts(): JSX.Element { onChange={ ( event ) => { if ( isInEnum( event.target.value, Period ) ) { setSettings( { - ...settings, Period: event.target.value as Period, } ); trackFilterChanges( 'period', { period: event.target.value } ); @@ -170,7 +113,6 @@ export function TopPosts(): JSX.Element { onChange={ ( event ) => { if ( isInEnum( event.target.value, Metric ) ) { setSettings( { - ...settings, Metric: event.target.value as Metric, } ); trackFilterChanges( 'metric', { metric: event.target.value } ); diff --git a/src/content-helper/dashboard-widget/dashboard-widget.tsx b/src/content-helper/dashboard-widget/dashboard-widget.tsx index c294411f9..fff8cfd0e 100644 --- a/src/content-helper/dashboard-widget/dashboard-widget.tsx +++ b/src/content-helper/dashboard-widget/dashboard-widget.tsx @@ -6,16 +6,63 @@ import { createRoot, render } from '@wordpress/element'; /** * Internal dependencies */ +import { SettingsProvider, TopPostsSettings } from '../common/settings'; +import { Metric, Period, isInEnum } from '../common/utils/constants'; import { VerifyCredentials } from '../common/verify-credentials'; import { TopPosts } from './components/top-posts'; +/** + * Gets the settings from the passed JSON. + * + * If missing settings or invalid values are detected, they get set to their + * defaults. + * + * @since 3.13.0 + * @since 3.14.0 Moved from `content-helper/dashboard-widget/dashboard-widget.tsx`. + * + * @param {string} settingsJson The JSON containing the settings. + * + * @return {TopPostsSettings} The resulting settings object. + */ +const getSettingsFromJson = ( settingsJson: string ): TopPostsSettings => { + let parsedSettings: TopPostsSettings; + + try { + parsedSettings = JSON.parse( settingsJson ); + } catch ( e ) { + // Return defaults when parsing failed or the string is empty. + return { + Metric: Metric.Views, + Period: Period.Days7, + }; + } + + // Fix invalid values if any are found. + if ( ! isInEnum( parsedSettings?.Metric, Metric ) ) { + parsedSettings.Metric = Metric.Views; + } + if ( ! isInEnum( parsedSettings?.Period, Period ) ) { + parsedSettings.Period = Period.Days7; + } + + return parsedSettings; +}; + window.addEventListener( 'load', function() { const container = document.querySelector( '#wp-parsely-dashboard-widget > .inside' ); if ( null !== container ) { - const component = ; + const component = + + + + + ; if ( createRoot ) { createRoot( container ).render( component ); diff --git a/src/content-helper/dashboard-widget/provider.ts b/src/content-helper/dashboard-widget/provider.ts index 25ebdb94b..534452dea 100644 --- a/src/content-helper/dashboard-widget/provider.ts +++ b/src/content-helper/dashboard-widget/provider.ts @@ -14,7 +14,7 @@ import { } from '../common/content-helper-error'; import { getApiPeriodParams } from '../common/utils/api'; import { PostData } from '../common/utils/post'; -import { TopPostsSettings } from './components/top-posts'; +import { TopPostsSettings } from '../common/settings'; /** * The form of the response returned by the /stats/posts WordPress REST API diff --git a/src/content-helper/editor-sidebar/editor-sidebar.tsx b/src/content-helper/editor-sidebar/editor-sidebar.tsx index 34091e5e1..7b380ecab 100644 --- a/src/content-helper/editor-sidebar/editor-sidebar.tsx +++ b/src/content-helper/editor-sidebar/editor-sidebar.tsx @@ -18,8 +18,8 @@ import { Telemetry } from '../../js/telemetry/telemetry'; import { BetaBadge } from '../common/components/beta-badge'; import { PARSELY_PERSONAS } from '../common/components/persona-selector'; import { PARSELY_TONES } from '../common/components/tone-selector'; -import { useSaveSettings } from '../common/hooks/useSaveSettings'; import { LeafIcon } from '../common/icons/leaf-icon'; +import { SettingsProvider, SidebarSettings, useSettings } from '../common/settings'; import { Metric, Period, @@ -35,25 +35,6 @@ import { TitleSuggestionsPanel } from './title-suggestions/component'; const BLOCK_PLUGIN_ID = 'wp-parsely-block-editor-sidebar'; -/** - * Defines the settings structure for the ContentHelperEditorSidebar component. - * - * @since 3.13.0 - */ -export interface SidebarSettings { - PerformanceDetailsOpen: boolean; - RelatedTopPostsFilterBy: string; - RelatedTopPostsFilterValue: string; - RelatedTopPostsOpen: boolean; - SettingsMetric: Metric; - SettingsOpen: boolean; - SettingsPeriod: Period; - TitleSuggestionsOpen: boolean; - TitleSuggestionsPersona: string; - TitleSuggestionsSettingsOpen: boolean; - TitleSuggestionsTone: string; -} - /** * Defines the data structure exposed by the Sidebar about the currently opened * Post. @@ -91,7 +72,7 @@ interface GutenbergFunction { * * @return {SidebarSettings} The resulting settings object. */ -const getSettingsFromJson = ( settingsJson: string ): SidebarSettings => { +export const getSettingsFromJson = ( settingsJson: string ): SidebarSettings => { let parsedSettings: SidebarSettings; try { @@ -159,44 +140,11 @@ const getSettingsFromJson = ( settingsJson: string ): SidebarSettings => { * @return {JSX.Element} The Content Helper Editor Sidebar. */ const ContentHelperEditorSidebar = (): JSX.Element => { - const [ settings, setSettings ] = useState( - getSettingsFromJson( window.wpParselyContentHelperSettings ) - ); const [ postData, setPostData ] = useState( { authors: [], categories: [], tags: [], } ); - /** - * Updates all filter settings. - * - * @since 3.13.0 - * - * @param {PostFilterType} filter The new filter type. - * @param {string} value The new filter value. - */ - const handleRelatedTopPostsFilterChange = ( - filter: PostFilterType, value: string - ): void => { - setSettings( { - ...settings, - RelatedTopPostsFilterBy: filter, - RelatedTopPostsFilterValue: value, - } ); - }; - - /** - * Updates the passed setting. - * - * @since 3.13.0 - * - * @param {keyof SidebarSettings} setting The setting to be updated. - * @param {string|boolean} value The new settings value. - */ - const handleSettingChange = ( - setting: keyof SidebarSettings, value: string|boolean - ): void => { - setSettings( { ...settings, [ setting ]: value } ); - }; + const { settings, setSettings } = useSettings(); /** * Returns the current Post's ID, tags and categories. @@ -253,14 +201,6 @@ const ContentHelperEditorSidebar = (): JSX.Element => { return authors ? authors.map( ( a ) => a.name ) : []; }, [ authors ] ); - /** - * Saves the settings into the WordPress database whenever a setting change - * occurs. - * - * @since 3.13.0 - */ - useSaveSettings( 'editor-sidebar-settings', settings ); - useEffect( () => { setPostData( { authors: authorNames, @@ -328,7 +268,6 @@ const ContentHelperEditorSidebar = (): JSX.Element => { onChange={ ( selection ) => { if ( isInEnum( selection, Period ) ) { setSettings( { - ...settings, SettingsPeriod: selection as Period, } ); trackSettingsChange( 'period', { period: selection } ); @@ -349,7 +288,6 @@ const ContentHelperEditorSidebar = (): JSX.Element => { onChange={ ( selection ) => { if ( isInEnum( selection, Metric ) ) { setSettings( { - ...settings, SettingsMetric: selection as Metric, } ); trackSettingsChange( 'metric', { metric: selection } ); @@ -375,89 +313,82 @@ const ContentHelperEditorSidebar = (): JSX.Element => { className="wp-parsely-content-helper" title={ __( 'Parse.ly Editor Sidebar', 'wp-parsely' ) } > - - { - setSettings( { ...settings, SettingsOpen: next } ); - trackToggle( 'settings', next ); - } } - > - - - - - { - setSettings( { - ...settings, PerformanceDetailsOpen: next, - } ); - trackToggle( 'performance_details', next ); - } } - > - { - - - - } - - - - { - setSettings( { - ...settings, RelatedTopPostsOpen: next, - } ); - trackToggle( 'related_top_posts', next ); - } } - > - { - - - - } - - - - } - title={ __( 'Title Suggestions', 'wp-parsely' ) } - initialOpen={ settings.TitleSuggestionsOpen } - onToggle={ ( next ) => { - setSettings( { - ...settings, TitleSuggestionsOpen: next, - } ); - trackToggle( 'title_suggestions', next ); - } } - > - { + + + { + setSettings( { SettingsOpen: next } ); + trackToggle( 'settings', next ); + } } + > + + + + + { + setSettings( { + PerformanceDetailsOpen: next, + } ); + trackToggle( 'performance_details', next ); + } } + > + { + + + + } + + + + { + setSettings( { + RelatedTopPostsOpen: next, + } ); + trackToggle( 'related_top_posts', next ); + } } + > + { + + + + } + + + + } + title={ __( 'Title Suggestions', 'wp-parsely' ) } + initialOpen={ settings.TitleSuggestionsOpen } + onToggle={ ( next ) => { + setSettings( { + TitleSuggestionsOpen: next, + } ); + trackToggle( 'title_suggestions', next ); + } } + > - + - } - - + + + ); }; @@ -465,5 +396,12 @@ const ContentHelperEditorSidebar = (): JSX.Element => { // Registering Plugin to WordPress Block Editor. registerPlugin( BLOCK_PLUGIN_ID, { icon: LeafIcon, - render: ContentHelperEditorSidebar, + render: () => ( + + + + ), } ); diff --git a/src/content-helper/editor-sidebar/related-top-posts/component-list.tsx b/src/content-helper/editor-sidebar/related-top-posts/component-list.tsx index 78cb320e9..e114210f2 100644 --- a/src/content-helper/editor-sidebar/related-top-posts/component-list.tsx +++ b/src/content-helper/editor-sidebar/related-top-posts/component-list.tsx @@ -10,6 +10,7 @@ import { __ } from '@wordpress/i18n'; */ import { Telemetry } from '../../../js/telemetry/telemetry'; import { ContentHelperError } from '../../common/content-helper-error'; +import { SidebarSettings, useSettings } from '../../common/settings'; import { Metric, Period, @@ -33,9 +34,7 @@ const FETCH_RETRIES = 1; * @since 3.11.0 */ interface RelatedTopPostListProps { - initialFilter: PostFilter; metric: Metric; - onFilterChange: ( type: PostFilterType, value: string ) => void; period: Period; postData: SidebarPostData; } @@ -46,13 +45,37 @@ interface RelatedTopPostListProps { * @param {RelatedTopPostListProps} props The component's props. */ export function RelatedTopPostList( { - initialFilter, metric, onFilterChange, period, postData, + metric, period, postData, } : Readonly ): JSX.Element { + const { settings, setSettings } = useSettings(); + const [ loading, setLoading ] = useState( true ); const [ error, setError ] = useState(); const [ message, setMessage ] = useState(); const [ posts, setPosts ] = useState( [] ); - const [ filter, setFilter ] = useState( initialFilter ); + const [ filter, setFilter ] = useState( + { + type: settings.RelatedTopPostsFilterBy as PostFilterType, + value: settings.RelatedTopPostsFilterValue, + } + ); + + /** + * Updates all filter settings. + * + * @since 3.13.0 + * @since 3.14.0 Renamed from `handleRelatedTopPostsFilterChange` and + * moved from the editor sidebar to the related top posts component. + * + * @param {PostFilterType} filterBy The new filter type. + * @param {string} value The new filter value. + */ + const onFilterChange = ( filterBy: PostFilterType, value: string ): void => { + setSettings( { + RelatedTopPostsFilterBy: filterBy, + RelatedTopPostsFilterValue: value, + } ); + }; /** * Updates the filter type and sets its default value. diff --git a/src/content-helper/editor-sidebar/title-suggestions/component-settings.tsx b/src/content-helper/editor-sidebar/title-suggestions/component-settings.tsx index 7698edc1c..7ea2da6bb 100644 --- a/src/content-helper/editor-sidebar/title-suggestions/component-settings.tsx +++ b/src/content-helper/editor-sidebar/title-suggestions/component-settings.tsx @@ -13,7 +13,7 @@ import { Telemetry } from '../../../js/telemetry/telemetry'; import { PersonaProp, PersonaSelector, getPersonaLabel } from '../../common/components/persona-selector'; import { ToneProp, ToneSelector, getToneLabel } from '../../common/components/tone-selector'; import { LeafIcon } from '../../common/icons/leaf-icon'; -import { SidebarSettings } from '../editor-sidebar'; +import { SidebarSettings } from '../../common/settings'; /** * Props for the Title Suggestions Settings component. diff --git a/src/content-helper/editor-sidebar/title-suggestions/component.tsx b/src/content-helper/editor-sidebar/title-suggestions/component.tsx index f6e9fcd9e..17bf9fc0e 100644 --- a/src/content-helper/editor-sidebar/title-suggestions/component.tsx +++ b/src/content-helper/editor-sidebar/title-suggestions/component.tsx @@ -14,39 +14,25 @@ import { Telemetry } from '../../../js/telemetry/telemetry'; import { PersonaProp, getPersonaLabel } from '../../common/components/persona-selector'; import { ToneProp, getToneLabel } from '../../common/components/tone-selector'; import { ContentHelperError } from '../../common/content-helper-error'; -import { SidebarSettings } from '../editor-sidebar'; +import { SidebarSettings, useSettings } from '../../common/settings'; import { TitleSuggestionsSettings } from './component-settings'; import { TitleSuggestion } from './component-title-suggestion'; import { WriteTitleProvider } from './provider'; import { TitleStore, TitleType } from './store'; -/** - * Defines the props structure for TitleSuggestionsPanel. - * - * @since 3.13.0 - */ -interface TitleSuggestionsPanelProps { - initialPersona: PersonaProp; - initialSettingsOpen: boolean; - initialTone: ToneProp; - onSettingChange: ( key: keyof SidebarSettings, value: string | boolean ) => void; -} - /** * Title Suggestions Panel. * * @since 3.12.0 * - * @param {TitleSuggestionsPanelProps} props The component's props. - * * @return {JSX.Element} The Title Suggestions Panel. */ -export const TitleSuggestionsPanel = ( { - initialPersona, initialSettingsOpen, initialTone, onSettingChange, -}: TitleSuggestionsPanelProps ): JSX.Element => { +export const TitleSuggestionsPanel = (): JSX.Element => { + const { settings, setSettings } = useSettings(); + const [ error, setError ] = useState(); - const [ tone, setTone ] = useState( initialTone ); - const [ persona, setPersona ] = useState( initialPersona ); + const [ tone, setTone ] = useState( settings.TitleSuggestionsTone ); + const [ persona, setPersona ] = useState( settings.TitleSuggestionsPersona ); const { loading, @@ -75,6 +61,10 @@ export const TitleSuggestionsPanel = ( { setOriginalTitle, } = useDispatch( TitleStore ); + const onSettingChange = ( key: keyof SidebarSettings, value: string | boolean ) => { + setSettings( { [ key ]: value } ); + }; + const currentPostContent = useSelect( ( select ) => { const { getEditedPostContent } = select( 'core/editor' ) as GutenbergFunction; return getEditedPostContent(); @@ -147,7 +137,7 @@ export const TitleSuggestionsPanel = ( { const parselyAISettings = { onSettingChange( 'TitleSuggestionsPersona', selectedPersona ); setPersona( selectedPersona ); @@ -157,8 +147,8 @@ export const TitleSuggestionsPanel = ( { onSettingChange( 'TitleSuggestionsTone', selectedTone ); setTone( selectedTone ); } } - persona={ initialPersona } - tone={ initialTone } + persona={ settings.TitleSuggestionsPersona } + tone={ settings.TitleSuggestionsTone } />; const generateTitleButton: JSX.Element = ( diff --git a/tests/js/content-helper/structure.test.tsx b/tests/js/content-helper/structure.test.tsx index d9695bc52..74f8c2847 100644 --- a/tests/js/content-helper/structure.test.tsx +++ b/tests/js/content-helper/structure.test.tsx @@ -19,7 +19,6 @@ import { DASHBOARD_BASE_URL, Metric, Period, - PostFilter, } from '../../../src/content-helper/common/utils/constants'; import { SidebarPostData, @@ -41,9 +40,7 @@ const postData: SidebarPostData = { const relatedTopPostList = {} } period={ Period.Days7 } postData={ postData } /> From c165a85025cccf9bc8cdf19b2bc9135b8afcc4ea Mon Sep 17 00:00:00 2001 From: Henrique Mouta Date: Tue, 13 Feb 2024 14:41:43 +0000 Subject: [PATCH 025/110] PCH: Add Smart Linking feature (#2116) * Add UI elements for cross linker functionality * Move cross linker to the editor-sidebar directory * Implement the functionality of the cross linker * Add missing file * Revert debugging change * Improvements when applying suggested links * Update build files * Add integration test for the `suggest-links` API endpoint * Apply SonarCloud suggested fixes * Add Tracks telemetry * Updating @since to 3.14.0 * Implement the new settings saving to the Cross Linker * Update copy to "Smart Links" * Update build files * Improve comments, return types and whitespace * Perform minor code adjustments * Add build files * Address code review feedback * `useSaveSettings`: Only save the settings if there are changes to the settings object. * Add correct coverage annotations to test * Refactor client-side Settings API to use a context provider and a store instead. * Add missing build files. * Apply code review suggestions * Implement the new settings API * Move settings handling from outside the PCH Editor sidebar component to the individual components * Merge branch 'update/settings-refactor' into 'add/cross-linker' * Fix Title Suggestion using wrong setting for isOpen in the Settings component * Address SonarCloud complains * Add built files * Address issue with settings override when updating with different contexts. * Add built files * Change Cross Linker to Smart Linking * Add hint notice when trying to uncheck the entire post without a block selected. * Fix wrong order in the settings array * Update package.json * Add build files and fix small conflict * Fix typo * Remove duplicate test annotation * Sort Content Helper settings * Fix failing integration tests --------- Co-authored-by: Alex Cicovic <23142906+acicovic@users.noreply.github.com> --- build/admin-settings.asset.php | 2 +- build/admin-settings.css | 2 +- build/blocks/recommendations/edit.asset.php | 2 +- build/blocks/recommendations/edit.js | 2 +- .../content-helper/dashboard-widget.asset.php | 2 +- build/content-helper/dashboard-widget.css | 2 +- build/content-helper/dashboard-widget.js | 2 +- build/content-helper/editor-sidebar.asset.php | 2 +- build/content-helper/editor-sidebar.css | 5 +- build/content-helper/editor-sidebar.js | 23 +- .../excerpt-generator.asset.php | 2 +- build/content-helper/excerpt-generator.css | 4 +- build/content-helper/excerpt-generator.js | 4 +- src/@types/gutenberg/types.ts | 7 + src/Endpoints/class-base-api-proxy.php | 7 +- .../class-suggest-links-api-proxy.php | 138 ++++++ ...class-editor-sidebar-settings-endpoint.php | 16 + .../class-link-suggestion.php | 48 ++ .../class-suggest-links-api.php | 86 ++++ .../common/content-helper-error.tsx | 30 +- src/content-helper/common/css/common.scss | 42 ++ src/content-helper/common/css/variables.scss | 1 + src/content-helper/common/icons/leaf-icon.tsx | 3 +- .../settings/types/sidebar-settings.d.ts | 4 + .../dashboard-widget/dashboard-widget.tsx | 4 +- .../editor-sidebar/editor-sidebar.scss | 29 +- .../editor-sidebar/editor-sidebar.tsx | 53 ++- .../smart-linking/component-block-overlay.tsx | 146 ++++++ .../smart-linking/component-settings.tsx | 129 ++++++ .../smart-linking/component.tsx | 437 ++++++++++++++++++ .../editor-sidebar/smart-linking/provider.ts | 86 ++++ .../smart-linking/smart-linking.scss | 99 ++++ .../smart-linking/smart-linking.tsx | 124 +++++ .../editor-sidebar/smart-linking/store.ts | 253 ++++++++++ .../editor-sidebar/smart-linking/utils.ts | 51 ++ .../title-suggestions/component-settings.tsx | 8 +- .../excerpt-generator/excerpt-generator.scss | 8 - .../EditorSidebarSettingsEndpointTest.php | 6 +- .../SuggestLinksAPITest.php | 162 +++++++ wp-parsely.php | 10 + 40 files changed, 1960 insertions(+), 81 deletions(-) create mode 100644 src/Endpoints/content-suggestions/class-suggest-links-api-proxy.php create mode 100644 src/RemoteAPI/content-suggestions/class-link-suggestion.php create mode 100644 src/RemoteAPI/content-suggestions/class-suggest-links-api.php create mode 100644 src/content-helper/editor-sidebar/smart-linking/component-block-overlay.tsx create mode 100644 src/content-helper/editor-sidebar/smart-linking/component-settings.tsx create mode 100644 src/content-helper/editor-sidebar/smart-linking/component.tsx create mode 100644 src/content-helper/editor-sidebar/smart-linking/provider.ts create mode 100644 src/content-helper/editor-sidebar/smart-linking/smart-linking.scss create mode 100644 src/content-helper/editor-sidebar/smart-linking/smart-linking.tsx create mode 100644 src/content-helper/editor-sidebar/smart-linking/store.ts create mode 100644 src/content-helper/editor-sidebar/smart-linking/utils.ts create mode 100644 tests/Integration/RemoteAPI/content-suggestions/SuggestLinksAPITest.php diff --git a/build/admin-settings.asset.php b/build/admin-settings.asset.php index b5514bb69..c258d3f4c 100644 --- a/build/admin-settings.asset.php +++ b/build/admin-settings.asset.php @@ -1 +1 @@ - array(), 'version' => '769e007a999eeb6e2141'); + array(), 'version' => 'a8745041e2f834ac025c'); diff --git a/build/admin-settings.css b/build/admin-settings.css index 881bfa9db..97699b964 100644 --- a/build/admin-settings.css +++ b/build/admin-settings.css @@ -1 +1 @@ -#wp-parsely-dashboard-widget,.settings_page_parsely,.wp-parsely-content-helper,.wp-parsely-excerpt-generator,.wp-parsely-popover{--base-font:"source-sans-pro",arial,sans-serif;--numeric-font:"ff-din-round-web",sans-serif;--parsely-green:#59a744;--gray-200:#f7f8f9;--gray-300:#edeeef;--gray-400:#d7dbdf;--gray-500:#959da5;--gray-600:#586069;--gray-700:#444d56;--gray-900:#24292e;--blue-500:#44a8e5;--blue-550:#2596db;--green-500:#7bc01b;--green-900:#3d6307;--ref-direct:205,13%,52%;--ref-internal:161,91%,41%;--ref-social:210,72%,41%;--ref-search:42,100%,50%;--ref-other:3,76%,58%;--base-text:var(--gray-900);--base-text-2:var(--gray-600);--base-3:var(--gray-400);--border:var(--gray-400);--data:var(--green-500);--control:var(--blue-500);--font-size--large:1rem;--font-size--extra-large:1.2rem;--black:#000;--sidebar-black:#1e1e1e}.settings_page_parsely{--padding-default:15px}.settings_page_parsely #track-post-types{max-width:550px;width:100%}.settings_page_parsely #track-post-types td,.settings_page_parsely #track-post-types th{display:table-cell;padding:var(--padding-default);text-align:center;vertical-align:middle}.settings_page_parsely #track-post-types td{padding:0}.settings_page_parsely #track-post-types td label{display:inline-block;margin:0!important;padding-bottom:var(--padding-default);padding-top:var(--padding-default);width:100%}.settings_page_parsely #track-post-types thead th:nth-child(3){word-break:break-word}.settings_page_parsely fieldset:disabled *,.settings_page_parsely tr:has(fieldset:disabled) *{color:var(--gray-500);cursor:default}.settings_page_parsely .managed-option-badge{border:.0625rem solid var(--green-500);border-radius:.25rem;color:var(--green-500)!important;display:inline-block;font-size:.625rem;padding:.125rem .25rem;text-decoration:none}.settings_page_parsely a.managed-option-badge{cursor:pointer!important}.settings_page_parsely a.managed-option-badge:hover{background-color:var(--green-500);color:#fff!important}@media only screen and (max-width:380px){.settings_page_parsely #track-post-types td,.settings_page_parsely #track-post-types th{padding-left:10px;padding-right:10px}.settings_page_parsely #track-post-types th:first-child{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}} +#wp-parsely-dashboard-widget,.settings_page_parsely,.wp-parsely-content-helper,.wp-parsely-excerpt-generator,.wp-parsely-panel,.wp-parsely-popover{--base-font:"source-sans-pro",arial,sans-serif;--numeric-font:"ff-din-round-web",sans-serif;--parsely-green:#59a744;--gray-200:#f7f8f9;--gray-300:#edeeef;--gray-400:#d7dbdf;--gray-500:#959da5;--gray-600:#586069;--gray-700:#444d56;--gray-900:#24292e;--blue-500:#44a8e5;--blue-550:#2596db;--green-500:#7bc01b;--green-900:#3d6307;--ref-direct:205,13%,52%;--ref-internal:161,91%,41%;--ref-social:210,72%,41%;--ref-search:42,100%,50%;--ref-other:3,76%,58%;--base-text:var(--gray-900);--base-text-2:var(--gray-600);--base-3:var(--gray-400);--border:var(--gray-400);--data:var(--green-500);--control:var(--blue-500);--font-size--large:1rem;--font-size--extra-large:1.2rem;--black:#000;--sidebar-black:#1e1e1e}.settings_page_parsely{--padding-default:15px}.settings_page_parsely #track-post-types{max-width:550px;width:100%}.settings_page_parsely #track-post-types td,.settings_page_parsely #track-post-types th{display:table-cell;padding:var(--padding-default);text-align:center;vertical-align:middle}.settings_page_parsely #track-post-types td{padding:0}.settings_page_parsely #track-post-types td label{display:inline-block;margin:0!important;padding-bottom:var(--padding-default);padding-top:var(--padding-default);width:100%}.settings_page_parsely #track-post-types thead th:nth-child(3){word-break:break-word}.settings_page_parsely fieldset:disabled *,.settings_page_parsely tr:has(fieldset:disabled) *{color:var(--gray-500);cursor:default}.settings_page_parsely .managed-option-badge{border:.0625rem solid var(--green-500);border-radius:.25rem;color:var(--green-500)!important;display:inline-block;font-size:.625rem;padding:.125rem .25rem;text-decoration:none}.settings_page_parsely a.managed-option-badge{cursor:pointer!important}.settings_page_parsely a.managed-option-badge:hover{background-color:var(--green-500);color:#fff!important}@media only screen and (max-width:380px){.settings_page_parsely #track-post-types td,.settings_page_parsely #track-post-types th{padding-left:10px;padding-right:10px}.settings_page_parsely #track-post-types th:first-child{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}} diff --git a/build/blocks/recommendations/edit.asset.php b/build/blocks/recommendations/edit.asset.php index 11b5a05bb..d07e3e227 100644 --- a/build/blocks/recommendations/edit.asset.php +++ b/build/blocks/recommendations/edit.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '44ef23fe00e4fd1314e1'); + array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => 'ada8db34ea07d80ab473'); diff --git a/build/blocks/recommendations/edit.js b/build/blocks/recommendations/edit.js index 9480dc879..ac88aae08 100644 --- a/build/blocks/recommendations/edit.js +++ b/build/blocks/recommendations/edit.js @@ -1 +1 @@ -!function(){"use strict";var e,n={204:function(e,n,r){var t,o,a=r(893),i=window.wp.blockEditor,l=window.wp.blocks,s=window.wp.i18n,c=window.wp.components,u=JSON.parse('{"u2":"wp-parsely/recommendations","Y4":{"imagestyle":{"type":"string","default":"original"},"limit":{"type":"number","default":3},"openlinksinnewtab":{"type":"boolean","default":false},"showimages":{"type":"boolean","default":true},"sort":{"type":"string","default":"score"},"title":{"type":"string","default":"Related Content"}}}'),d=window.wp.element;(o=t||(t={}))[o.Error=0]="Error",o[o.Loaded=1]="Loaded",o[o.Recommendations=2]="Recommendations";var p=function(){return p=Object.assign||function(e){for(var n,r=1,t=arguments.length;r0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]=a)&&Object.keys(t.O).every((function(e){return t.O[e](r[s])}))?r.splice(s--,1):(l=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[r,o,a]},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,{a:n}),n},t.d=function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},function(){var e={878:0,570:0};t.O.j=function(n){return 0===e[n]};var n=function(n,r){var o,a,i=r[0],l=r[1],s=r[2],c=0;if(i.some((function(n){return 0!==e[n]}))){for(o in l)t.o(l,o)&&(t.m[o]=l[o]);if(s)var u=s(t)}for(n&&n(r);c0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]=a)&&Object.keys(t.O).every((function(e){return t.O[e](r[s])}))?r.splice(s--,1):(l=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[r,o,a]},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,{a:n}),n},t.d=function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},function(){var e={878:0,570:0};t.O.j=function(n){return 0===e[n]};var n=function(n,r){var o,a,i=r[0],l=r[1],s=r[2],c=0;if(i.some((function(n){return 0!==e[n]}))){for(o in l)t.o(l,o)&&(t.m[o]=l[o]);if(s)var u=s(t)}for(n&&n(r);c array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '89c5f808aac7a7a8501f'); + array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '129dbcef4fff1d8e5eb3'); diff --git a/build/content-helper/dashboard-widget.css b/build/content-helper/dashboard-widget.css index f58d9b642..5abad82da 100644 --- a/build/content-helper/dashboard-widget.css +++ b/build/content-helper/dashboard-widget.css @@ -1 +1 @@ -#wp-parsely-dashboard-widget,.settings_page_parsely,.wp-parsely-content-helper,.wp-parsely-excerpt-generator,.wp-parsely-popover{--base-font:"source-sans-pro",arial,sans-serif;--numeric-font:"ff-din-round-web",sans-serif;--parsely-green:#59a744;--gray-200:#f7f8f9;--gray-300:#edeeef;--gray-400:#d7dbdf;--gray-500:#959da5;--gray-600:#586069;--gray-700:#444d56;--gray-900:#24292e;--blue-500:#44a8e5;--blue-550:#2596db;--green-500:#7bc01b;--green-900:#3d6307;--ref-direct:205,13%,52%;--ref-internal:161,91%,41%;--ref-social:210,72%,41%;--ref-search:42,100%,50%;--ref-other:3,76%,58%;--base-text:var(--gray-900);--base-text-2:var(--gray-600);--base-3:var(--gray-400);--border:var(--gray-400);--data:var(--green-500);--control:var(--blue-500);--font-size--large:1rem;--font-size--extra-large:1.2rem;--black:#000;--sidebar-black:#1e1e1e}#wp-parsely-dashboard-widget{color:var(--base-text);font-family:var(--base-font)}#wp-parsely-dashboard-widget .parsely-spinner-wrapper{display:flex;justify-content:center;margin:11.875rem 0}#wp-parsely-dashboard-widget .parsely-spinner-wrapper svg{height:22px;width:22px}#wp-parsely-dashboard-widget .content-helper-error-message{margin-top:1.125rem}#wp-parsely-dashboard-widget p.content-helper-error-message-hint{color:var(--gray-700)}#wp-parsely-dashboard-widget .parsely-top-posts-filters{display:flex;justify-content:space-between;margin-bottom:.625rem}#wp-parsely-dashboard-widget .parsely-top-posts-navigation{display:flex;justify-content:space-between;margin-top:.625rem}#wp-parsely-dashboard-widget .parsely-top-posts-navigation button{background:none;border:none;color:var(--blue-550);font-size:.75rem;font-weight:600;text-decoration:none}#wp-parsely-dashboard-widget .parsely-top-posts-navigation button:disabled{visibility:hidden}#wp-parsely-dashboard-widget .parsely-top-posts-navigation button:not([disabled]):hover{cursor:pointer}#wp-parsely-dashboard-widget .parsely-top-post-content{display:flex}#wp-parsely-dashboard-widget .parsely-top-post-content:before{content:counter(item) "";counter-increment:item;padding-right:.5rem}@media only screen and (max-width:380px){#wp-parsely-dashboard-widget .parsely-top-post-content:before{content:"";padding-right:0}}#wp-parsely-dashboard-widget .parsely-top-posts{list-style:none;margin:1rem 0 0}#wp-parsely-dashboard-widget .parsely-top-post{margin-bottom:1rem}#wp-parsely-dashboard-widget .parsely-top-post-thumbnail{height:46px;min-width:46px}#wp-parsely-dashboard-widget .parsely-top-post-thumbnail img{height:100%;width:100%}#wp-parsely-dashboard-widget .parsely-top-post-data{border-top:1px solid var(--gray-300);flex-grow:1;margin-left:.5rem;padding-top:.25rem}#wp-parsely-dashboard-widget .parsely-top-post-title{color:var(--base-text);font-size:.875rem;margin-right:.4375rem}#wp-parsely-dashboard-widget a.parsely-top-post-title:hover{color:var(--blue-550)}#wp-parsely-dashboard-widget .parsely-top-post-icon-link{position:relative;top:.25rem}#wp-parsely-dashboard-widget .parsely-top-post-icon-link svg{fill:#8d98a1;margin-right:.1875rem}#wp-parsely-dashboard-widget .parsely-top-post-icon-link svg:hover{fill:var(--blue-550)}#wp-parsely-dashboard-widget .parsely-top-post-metadata{margin:.25rem 0 0}#wp-parsely-dashboard-widget .parsely-top-post-metadata>span{color:var(--gray-500)}#wp-parsely-dashboard-widget .parsely-top-post-metadata>span:not(:first-child){margin-left:.75rem}#wp-parsely-dashboard-widget .parsely-top-post-metric-data{float:right;font-family:var(--numeric-font);font-size:1.125rem;padding-left:.625rem} +#wp-parsely-dashboard-widget,.settings_page_parsely,.wp-parsely-content-helper,.wp-parsely-excerpt-generator,.wp-parsely-panel,.wp-parsely-popover{--base-font:"source-sans-pro",arial,sans-serif;--numeric-font:"ff-din-round-web",sans-serif;--parsely-green:#59a744;--gray-200:#f7f8f9;--gray-300:#edeeef;--gray-400:#d7dbdf;--gray-500:#959da5;--gray-600:#586069;--gray-700:#444d56;--gray-900:#24292e;--blue-500:#44a8e5;--blue-550:#2596db;--green-500:#7bc01b;--green-900:#3d6307;--ref-direct:205,13%,52%;--ref-internal:161,91%,41%;--ref-social:210,72%,41%;--ref-search:42,100%,50%;--ref-other:3,76%,58%;--base-text:var(--gray-900);--base-text-2:var(--gray-600);--base-3:var(--gray-400);--border:var(--gray-400);--data:var(--green-500);--control:var(--blue-500);--font-size--large:1rem;--font-size--extra-large:1.2rem;--black:#000;--sidebar-black:#1e1e1e}#wp-parsely-dashboard-widget{color:var(--base-text);font-family:var(--base-font)}#wp-parsely-dashboard-widget .parsely-spinner-wrapper{display:flex;justify-content:center;margin:11.875rem 0}#wp-parsely-dashboard-widget .parsely-spinner-wrapper svg{height:22px;width:22px}#wp-parsely-dashboard-widget .content-helper-error-message{margin-top:1.125rem}#wp-parsely-dashboard-widget p.content-helper-error-message-hint{color:var(--gray-700)}#wp-parsely-dashboard-widget .parsely-top-posts-filters{display:flex;justify-content:space-between;margin-bottom:.625rem}#wp-parsely-dashboard-widget .parsely-top-posts-navigation{display:flex;justify-content:space-between;margin-top:.625rem}#wp-parsely-dashboard-widget .parsely-top-posts-navigation button{background:none;border:none;color:var(--blue-550);font-size:.75rem;font-weight:600;text-decoration:none}#wp-parsely-dashboard-widget .parsely-top-posts-navigation button:disabled{visibility:hidden}#wp-parsely-dashboard-widget .parsely-top-posts-navigation button:not([disabled]):hover{cursor:pointer}#wp-parsely-dashboard-widget .parsely-top-post-content{display:flex}#wp-parsely-dashboard-widget .parsely-top-post-content:before{content:counter(item) "";counter-increment:item;padding-right:.5rem}@media only screen and (max-width:380px){#wp-parsely-dashboard-widget .parsely-top-post-content:before{content:"";padding-right:0}}#wp-parsely-dashboard-widget .parsely-top-posts{list-style:none;margin:1rem 0 0}#wp-parsely-dashboard-widget .parsely-top-post{margin-bottom:1rem}#wp-parsely-dashboard-widget .parsely-top-post-thumbnail{height:46px;min-width:46px}#wp-parsely-dashboard-widget .parsely-top-post-thumbnail img{height:100%;width:100%}#wp-parsely-dashboard-widget .parsely-top-post-data{border-top:1px solid var(--gray-300);flex-grow:1;margin-left:.5rem;padding-top:.25rem}#wp-parsely-dashboard-widget .parsely-top-post-title{color:var(--base-text);font-size:.875rem;margin-right:.4375rem}#wp-parsely-dashboard-widget a.parsely-top-post-title:hover{color:var(--blue-550)}#wp-parsely-dashboard-widget .parsely-top-post-icon-link{position:relative;top:.25rem}#wp-parsely-dashboard-widget .parsely-top-post-icon-link svg{fill:#8d98a1;margin-right:.1875rem}#wp-parsely-dashboard-widget .parsely-top-post-icon-link svg:hover{fill:var(--blue-550)}#wp-parsely-dashboard-widget .parsely-top-post-metadata{margin:.25rem 0 0}#wp-parsely-dashboard-widget .parsely-top-post-metadata>span{color:var(--gray-500)}#wp-parsely-dashboard-widget .parsely-top-post-metadata>span:not(:first-child){margin-left:.75rem}#wp-parsely-dashboard-widget .parsely-top-post-metric-data{float:right;font-family:var(--numeric-font);font-size:1.125rem;padding-left:.625rem} diff --git a/build/content-helper/dashboard-widget.js b/build/content-helper/dashboard-widget.js index d008f6add..e4257dae9 100644 --- a/build/content-helper/dashboard-widget.js +++ b/build/content-helper/dashboard-widget.js @@ -1 +1 @@ -!function(){"use strict";var e={251:function(e,t,r){var n=r(196),a=Symbol.for("react.element"),s=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,s={},c=null,u=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,n)&&!l.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===s[n]&&(s[n]=t[n]);return{$$typeof:a,type:e,key:c,ref:u,props:s,_owner:o.current}}t.Fragment=s,t.jsx=c,t.jsxs=c},893:function(e,t,r){e.exports=r(251)},196:function(e){e.exports=window.React}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e=r(893),t=window.wp.element,n=window.wp.data,a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]=1e4&&(clearInterval(s),r("Telemetry library not loaded"))}),100);else r("Telemetry not enabled")}))},e.prototype.trackEvent=function(t,r){var n;this.isLoaded?(0!==t.indexOf(e.TRACKS_PREFIX)&&(t=e.TRACKS_PREFIX+t),this.isEventNameValid(t)?(r=this.prepareProperties(r),null===(n=this._tkq)||void 0===n||n.push(["recordEvent",t,r])):console.error("Error tracking event: Invalid event name")):console.error("Error tracking event: Telemetry not loaded")},e.prototype.isTelemetryEnabled=function(){return this.isEnabled},e.prototype.isProprietyValid=function(t){return e.PROPERTY_REGEX.test(t)},e.prototype.isEventNameValid=function(t){return e.EVENT_NAME_REGEX.test(t)},e.prototype.prepareProperties=function(e){return(e=this.sanitizeProperties(e)).parsely_version=wpParselyTracksTelemetry.version,wpParselyTracksTelemetry.user&&(e._ut=wpParselyTracksTelemetry.user.type,e._ui=wpParselyTracksTelemetry.user.id),wpParselyTracksTelemetry.vipgo_env&&(e.vipgo_env=wpParselyTracksTelemetry.vipgo_env),this.sanitizeProperties(e)},e.prototype.sanitizeProperties=function(e){var t=this,r={};return Object.keys(e).forEach((function(n){t.isProprietyValid(n)&&(r[n]=e[n])})),r},e.TRACKS_PREFIX="wpparsely_",e.EVENT_NAME_REGEX=/^(([a-z0-9]+)_){2}([a-z0-9_]+)$/,e.PROPERTY_REGEX=/^[a-z_][a-z0-9_]*$/,e}(),N=(T.trackEvent,function(t){var r=t.defaultValue,n=t.items,a=t.onChange;return(0,e.jsx)("select",{onChange:a,value:r,children:n.map((function(t){return(0,e.jsx)("option",{value:t[0],children:t[1]},t[0])}))})}),k=window.wp.url,C=(m=function(e,t){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},m(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});!function(e){e.CannotFormulateApiQuery="ch_cannot_formulate_api_query",e.FetchError="fetch_error",e.HttpRequestFailed="http_request_failed",e[e.ParselyApiForbidden=403]="ParselyApiForbidden",e.ParselyApiResponseContainsError="ch_response_contains_error",e.ParselyApiReturnedNoData="ch_parsely_api_returned_no_data",e.ParselyApiReturnedTooManyResults="ch_parsely_api_returned_too_many_results",e[e.ParselyApiUnauthorized=401]="ParselyApiUnauthorized",e.PluginCredentialsNotSetMessageDetected="parsely_credentials_not_set_message_detected",e.PluginSettingsApiSecretNotSet="parsely_api_secret_not_set",e.PluginSettingsSiteIdNotSet="parsely_site_id_not_set",e.PostIsNotPublished="ch_post_not_published"}(b||(b={}));var O=function(t){function r(e,n,a){void 0===a&&(a=(0,v.__)("Error: ","wp-parsely"));var s=t.call(this,a+e)||this;s.hint=null,s.name=s.constructor.name,s.code=n;var i=[b.ParselyApiForbidden,b.ParselyApiResponseContainsError,b.ParselyApiReturnedNoData,b.ParselyApiReturnedTooManyResults,b.ParselyApiUnauthorized,b.PluginCredentialsNotSetMessageDetected,b.PluginSettingsApiSecretNotSet,b.PluginSettingsSiteIdNotSet,b.PostIsNotPublished];return s.retryFetch=!i.includes(s.code),Object.setPrototypeOf(s,r.prototype),s}return C(r,t),r.prototype.Message=function(t){return void 0===t&&(t=null),[b.PluginCredentialsNotSetMessageDetected,b.PluginSettingsSiteIdNotSet,b.PluginSettingsApiSecretNotSet].includes(this.code)?x(t):(this.code===b.FetchError&&(this.hint=this.Hint((0,v.__)("This error can sometimes be caused by ad-blockers or browser tracking protections. Please add this site to any applicable allow lists and try again.","wp-parsely"))),this.code===b.ParselyApiForbidden&&(this.hint=this.Hint((0,v.__)("Please ensure that the Site ID and API Secret given in the plugin's settings are correct.","wp-parsely"))),this.code===b.HttpRequestFailed&&(this.hint=this.Hint((0,v.__)("The Parse.ly API cannot be reached. Please verify that you are online.","wp-parsely"))),this.code===b.ParselyApiUnauthorized&&(this.message=(0,v.__)("This feature is accessible to select customers participating in its beta testing.","wp-parsely")),(0,e.jsx)(P,{className:null==t?void 0:t.className,testId:"error",children:"

".concat(this.message,"

").concat(this.hint?this.hint:"")}))},r.prototype.Hint=function(e){return'

'.concat((0,v.__)("Hint:","wp-parsely")," ").concat(e,"

")},r}(Error),A={month:"short",day:"numeric",year:"numeric"},I={month:"short",day:"numeric"},R=(0,v.__)("Date N/A","wp-parsely");function L(e){if(!1===function(e){return!isNaN(+e)&&0!==e.getTime()}(e))return R;var t=A;return e.getUTCFullYear()===(new Date).getUTCFullYear()&&(t=I),Intl.DateTimeFormat(document.documentElement.lang||"en",t).format(e)}var M=function(){return M=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]=c){var u=t;(a=n/c)%1>1/o&&(u=a>10?1:2),u=parseFloat(a.toFixed(2))===parseFloat(a.toFixed(0))?0:u,s=a.toFixed(u),i=l}o=c})),s+r+i}function z(t){var r=t.metric,n=t.post,a=t.avgEngagedIcon,s=t.viewsIcon;return"views"===r?(0,e.jsxs)("span",{className:"parsely-top-post-metric-data",children:[(0,e.jsx)("span",{className:"screen-reader-text",children:(0,v.__)("Number of Views","wp-parsely")}),s,G(n.views.toString())]}):"avg_engaged"===r?(0,e.jsxs)("span",{className:"parsely-top-post-metric-data",children:[(0,e.jsx)("span",{className:"screen-reader-text",children:(0,v.__)("Average Time","wp-parsely")}),a,n.avgEngaged]}):(0,e.jsx)("span",{className:"parsely-top-post-metric-data",children:"-"})}function $(t){var r,n=t.metric,a=t.post;return(0,e.jsx)("li",{className:"parsely-top-post",children:(0,e.jsxs)("div",{className:"parsely-top-post-content",children:[(0,e.jsx)(q,{post:a}),(0,e.jsxs)("div",{className:"parsely-top-post-data",children:[(0,e.jsx)(z,{metric:n,post:a}),(0,e.jsx)(X,{post:a}),(0,e.jsxs)("a",{className:"parsely-top-post-icon-link",href:a.url,target:"_blank",rel:"noreferrer",children:[(0,e.jsx)("span",{className:"screen-reader-text",children:(0,v.__)("View Post (opens in new tab)","wp-parsely")}),(0,e.jsx)(U,{})]}),0!==a.postId&&(0,e.jsxs)("a",{className:"parsely-top-post-icon-link",href:(r=a.postId,"/wp-admin/post.php?post=".concat(r,"&action=edit")),target:"_blank",rel:"noreferrer",children:[(0,e.jsx)("span",{className:"screen-reader-text",children:(0,v.__)("Edit Post (opens in new tab)","wp-parsely")}),(0,e.jsx)(H,{})]}),(0,e.jsxs)("div",{className:"parsely-top-post-metadata",children:[(0,e.jsxs)("span",{className:"parsely-top-post-date",children:[(0,e.jsx)("span",{className:"screen-reader-text",children:(0,v.__)("Date","wp-parsely")}),L(new Date(a.date))]}),(0,e.jsxs)("span",{className:"parsely-top-post-author",children:[(0,e.jsx)("span",{className:"screen-reader-text",children:(0,v.__)("Author","wp-parsely")}),a.author]})]})]})]})},a.id)}function q(t){var r=t.post;return r.thumbnailUrl?(0,e.jsxs)("div",{className:"parsely-top-post-thumbnail",children:[(0,e.jsx)("span",{className:"screen-reader-text",children:(0,v.__)("Thumbnail","wp-parsely")}),(0,e.jsx)("img",{src:r.thumbnailUrl,alt:(0,v.__)("Post thumbnail","wp-parsely")})]}):(0,e.jsx)("div",{className:"parsely-top-post-thumbnail",children:(0,e.jsx)("span",{className:"screen-reader-text",children:(0,v.__)("Post thumbnail not available","wp-parsely")})})}function X(t){var r=t.post;return(0,e.jsxs)("a",{className:"parsely-top-post-title",href:r.dashUrl,target:"_blank",rel:"noreferrer",children:[(0,e.jsx)("span",{className:"screen-reader-text",children:(0,v.__)("View in Parse.ly (opens in new tab)","wp-parsely")}),r.title]})}var Y=function(){return Y=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]0&&e.retryFetch?[4,new Promise((function(e){return setTimeout(e,500)}))]:[3,3];case 1:return r.sent(),[4,t(n-1)];case 2:return r.sent(),[3,4];case 3:l(!1),d(e),r.label=4;case 4:return[2]}}))}))})),[2]}))}))};return l(!0),t(1),function(){l(!1),b([]),d(void 0)}}),[a,x]);var S=function(e,t){T.trackEvent("dash_widget_filter_changed",Y({filter:e},t))},k=(0,e.jsxs)("div",{className:"parsely-top-posts-filters",children:[(0,e.jsx)(N,{defaultValue:a.Period,items:Object.values(f).map((function(e){return[e,g(e)]})),onChange:function(e){w(e.target.value,f)&&(s({Period:e.target.value}),S("period",{period:e.target.value}),j(1))}}),(0,e.jsx)(N,{defaultValue:a.Metric,items:Object.values(h).map((function(e){return[e,_(e)]})),onChange:function(e){w(e.target.value,h)&&(s({Metric:e.target.value}),S("metric",{metric:e.target.value}),j(1))}})]}),C=(0,e.jsxs)("div",{className:"parsely-top-posts-navigation",children:[(0,e.jsx)("button",{className:"parsely-top-posts-navigation-prev",disabled:x<=1,"aria-label":(0,v.__)("Previous page","wp-parsely"),onClick:function(){j(x-1),T.trackEvent("dash_widget_navigation",{navigation:"previous",to_page:x-1})},children:(0,v.__)("<< Previous","wp-parsely")}),(0,v.sprintf)(/* translators: 1: Current page */(0,v.__)("Page %1$d","wp-parsely"),x),(0,e.jsx)("button",{className:"parsely-top-posts-navigation-next",disabled:!o&&m.length<5,"aria-label":(0,v.__)("Next page","wp-parsely"),onClick:function(){j(x+1),T.trackEvent("dash_widget_navigation",{navigation:"next",to_page:x+1})},children:(0,v.__)("Next >>","wp-parsely")})]});if(u)return(0,e.jsxs)(e.Fragment,{children:[k,u.Message(),x>1&&C]});var O=(0,e.jsx)("div",{className:"parsely-spinner-wrapper",children:(0,e.jsx)(E.Spinner,{})});return(0,e.jsxs)(e.Fragment,{children:[k,o?O:(0,e.jsx)("ol",{className:"parsely-top-posts",style:{counterReset:"item "+5*(x-1)},children:m.map((function(t){return(0,e.jsx)($,{metric:a.Metric,post:t},t.id)}))}),(m.length>=5||x>1)&&C]})}var K=function(e){var t;try{t=JSON.parse(e)}catch(e){return{Metric:h.Views,Period:f.Days7}}return w(null==t?void 0:t.Metric,h)||(t.Metric=h.Views),w(null==t?void 0:t.Period,f)||(t.Period=f.Days7),t};window.addEventListener("load",(function(){var r=document.querySelector("#wp-parsely-dashboard-widget > .inside");if(null!==r){var n=(0,e.jsx)(d,{endpoint:"dashboard-widget-settings",defaultSettings:K(window.wpParselyContentHelperSettings),children:(0,e.jsx)(S,{children:(0,e.jsx)(W,{})})});t.createRoot?(0,t.createRoot)(r).render(n):(0,t.render)(n,r)}}),!1)}()}(); \ No newline at end of file +!function(){"use strict";var e={251:function(e,t,r){var n=r(196),a=Symbol.for("react.element"),s=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,s={},c=null,u=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,n)&&!l.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===s[n]&&(s[n]=t[n]);return{$$typeof:a,type:e,key:c,ref:u,props:s,_owner:o.current}}t.Fragment=s,t.jsx=c,t.jsxs=c},893:function(e,t,r){e.exports=r(251)},196:function(e){e.exports=window.React}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e,t,n,a=r(893),s=window.wp.element,i=function(e){void 0===e&&(e=null);var t="";(null==e?void 0:e.children)&&(t=e.children);var r="content-helper-error-message";return(null==e?void 0:e.className)&&(r+=" "+e.className),(0,a.jsx)("div",{className:r,"data-testid":null==e?void 0:e.testId,dangerouslySetInnerHTML:{__html:t}})},o=function(e){return void 0===e&&(e=null),(0,a.jsx)(i,{className:null==e?void 0:e.className,testId:"empty-credentials-message",children:window.wpParselyEmptyCredentialsMessage})},l=function(){return l=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]=1e4&&(clearInterval(s),r("Telemetry library not loaded"))}),100);else r("Telemetry not enabled")}))},e.prototype.trackEvent=function(t,r){var n;this.isLoaded?(0!==t.indexOf(e.TRACKS_PREFIX)&&(t=e.TRACKS_PREFIX+t),this.isEventNameValid(t)?(r=this.prepareProperties(r),null===(n=this._tkq)||void 0===n||n.push(["recordEvent",t,r])):console.error("Error tracking event: Invalid event name")):console.error("Error tracking event: Telemetry not loaded")},e.prototype.isTelemetryEnabled=function(){return this.isEnabled},e.prototype.isProprietyValid=function(t){return e.PROPERTY_REGEX.test(t)},e.prototype.isEventNameValid=function(t){return e.EVENT_NAME_REGEX.test(t)},e.prototype.prepareProperties=function(e){return(e=this.sanitizeProperties(e)).parsely_version=wpParselyTracksTelemetry.version,wpParselyTracksTelemetry.user&&(e._ut=wpParselyTracksTelemetry.user.type,e._ui=wpParselyTracksTelemetry.user.id),wpParselyTracksTelemetry.vipgo_env&&(e.vipgo_env=wpParselyTracksTelemetry.vipgo_env),this.sanitizeProperties(e)},e.prototype.sanitizeProperties=function(e){var t=this,r={};return Object.keys(e).forEach((function(n){t.isProprietyValid(n)&&(r[n]=e[n])})),r},e.TRACKS_PREFIX="wpparsely_",e.EVENT_NAME_REGEX=/^(([a-z0-9]+)_){2}([a-z0-9_]+)$/,e.PROPERTY_REGEX=/^[a-z_][a-z0-9_]*$/,e}(),f=(d.trackEvent,function(e){var t=e.defaultValue,r=e.items,n=e.onChange;return(0,a.jsx)("select",{onChange:n,value:t,children:r.map((function(e){return(0,a.jsx)("option",{value:e[0],children:e[1]},e[0])}))})}),h=window.wp.data,y=function(){return y=Object.assign||function(e){for(var t,r=1,n=arguments.length;r".concat(this.message,"

").concat(this.hint?this.hint:"")}))},t.prototype.Hint=function(e){return'

'.concat((0,p.__)("Hint:","wp-parsely")," ").concat(e,"

")},t}(Error),A={month:"short",day:"numeric",year:"numeric"},O={month:"short",day:"numeric"},R=(0,p.__)("Date N/A","wp-parsely");function L(e){if(!1===function(e){return!isNaN(+e)&&0!==e.getTime()}(e))return R;var t=A;return e.getUTCFullYear()===(new Date).getUTCFullYear()&&(t=O),Intl.DateTimeFormat(document.documentElement.lang||"en",t).format(e)}var M=function(){return M=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]=c){var u=t;(a=n/c)%1>1/o&&(u=a>10?1:2),u=parseFloat(a.toFixed(2))===parseFloat(a.toFixed(0))?0:u,s=a.toFixed(u),i=l}o=c})),s+r+i}function z(e){var t=e.metric,r=e.post,n=e.avgEngagedIcon,s=e.viewsIcon;return"views"===t?(0,a.jsxs)("span",{className:"parsely-top-post-metric-data",children:[(0,a.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Number of Views","wp-parsely")}),s,G(r.views.toString())]}):"avg_engaged"===t?(0,a.jsxs)("span",{className:"parsely-top-post-metric-data",children:[(0,a.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Average Time","wp-parsely")}),n,r.avgEngaged]}):(0,a.jsx)("span",{className:"parsely-top-post-metric-data",children:"-"})}function $(e){var t,r=e.metric,n=e.post;return(0,a.jsx)("li",{className:"parsely-top-post",children:(0,a.jsxs)("div",{className:"parsely-top-post-content",children:[(0,a.jsx)(q,{post:n}),(0,a.jsxs)("div",{className:"parsely-top-post-data",children:[(0,a.jsx)(z,{metric:r,post:n}),(0,a.jsx)(X,{post:n}),(0,a.jsxs)("a",{className:"parsely-top-post-icon-link",href:n.url,target:"_blank",rel:"noreferrer",children:[(0,a.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("View Post (opens in new tab)","wp-parsely")}),(0,a.jsx)(U,{})]}),0!==n.postId&&(0,a.jsxs)("a",{className:"parsely-top-post-icon-link",href:(t=n.postId,"/wp-admin/post.php?post=".concat(t,"&action=edit")),target:"_blank",rel:"noreferrer",children:[(0,a.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Edit Post (opens in new tab)","wp-parsely")}),(0,a.jsx)(D,{})]}),(0,a.jsxs)("div",{className:"parsely-top-post-metadata",children:[(0,a.jsxs)("span",{className:"parsely-top-post-date",children:[(0,a.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Date","wp-parsely")}),L(new Date(n.date))]}),(0,a.jsxs)("span",{className:"parsely-top-post-author",children:[(0,a.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Author","wp-parsely")}),n.author]})]})]})]})},n.id)}function q(e){var t=e.post;return t.thumbnailUrl?(0,a.jsxs)("div",{className:"parsely-top-post-thumbnail",children:[(0,a.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Thumbnail","wp-parsely")}),(0,a.jsx)("img",{src:t.thumbnailUrl,alt:(0,p.__)("Post thumbnail","wp-parsely")})]}):(0,a.jsx)("div",{className:"parsely-top-post-thumbnail",children:(0,a.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Post thumbnail not available","wp-parsely")})})}function X(e){var t=e.post;return(0,a.jsxs)("a",{className:"parsely-top-post-title",href:t.dashUrl,target:"_blank",rel:"noreferrer",children:[(0,a.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("View in Parse.ly (opens in new tab)","wp-parsely")}),t.title]})}var Y=function(){return Y=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]0&&e.retryFetch?[4,new Promise((function(e){return setTimeout(e,500)}))]:[3,3];case 1:return r.sent(),[4,t(n-1)];case 2:return r.sent(),[3,4];case 3:h(!1),w(e),r.label=4;case 4:return[2]}}))}))})),[2]}))}))};return h(!0),t(1),function(){h(!1),m([]),w(void 0)}}),[i,x]);var N=function(e,t){d.trackEvent("dash_widget_filter_changed",Y({filter:e},t))},k=(0,a.jsxs)("div",{className:"parsely-top-posts-filters",children:[(0,a.jsx)(f,{defaultValue:i.Period,items:Object.values(e).map((function(e){return[e,j(e)]})),onChange:function(t){S(t.target.value,e)&&(o({Period:t.target.value}),N("period",{period:t.target.value}),T(1))}}),(0,a.jsx)(f,{defaultValue:i.Metric,items:Object.values(t).map((function(e){return[e,E(e)]})),onChange:function(e){S(e.target.value,t)&&(o({Metric:e.target.value}),N("metric",{metric:e.target.value}),T(1))}})]}),C=(0,a.jsxs)("div",{className:"parsely-top-posts-navigation",children:[(0,a.jsx)("button",{className:"parsely-top-posts-navigation-prev",disabled:x<=1,"aria-label":(0,p.__)("Previous page","wp-parsely"),onClick:function(){T(x-1),d.trackEvent("dash_widget_navigation",{navigation:"previous",to_page:x-1})},children:(0,p.__)("<< Previous","wp-parsely")}),(0,p.sprintf)(/* translators: 1: Current page */(0,p.__)("Page %1$d","wp-parsely"),x),(0,a.jsx)("button",{className:"parsely-top-posts-navigation-next",disabled:!c&&_.length<5,"aria-label":(0,p.__)("Next page","wp-parsely"),onClick:function(){T(x+1),d.trackEvent("dash_widget_navigation",{navigation:"next",to_page:x+1})},children:(0,p.__)("Next >>","wp-parsely")})]});if(v)return(0,a.jsxs)(a.Fragment,{children:[k,v.Message(),x>1&&C]});var I=(0,a.jsx)("div",{className:"parsely-spinner-wrapper",children:(0,a.jsx)(u.Spinner,{})});return(0,a.jsxs)(a.Fragment,{children:[k,c?I:(0,a.jsx)("ol",{className:"parsely-top-posts",style:{counterReset:"item "+5*(x-1)},children:_.map((function(e){return(0,a.jsx)($,{metric:i.Metric,post:e},e.id)}))}),(_.length>=5||x>1)&&C]})}var K=function(r){var n;try{n=JSON.parse(r)}catch(r){return{Metric:t.Views,Period:e.Days7}}return S(null==n?void 0:n.Metric,t)||(n.Metric=t.Views),S(null==n?void 0:n.Period,e)||(n.Period=e.Days7),n};window.addEventListener("load",(function(){var e=document.querySelector("#wp-parsely-dashboard-widget > .inside");if(null!==e){var t=(0,a.jsx)(x,{endpoint:"dashboard-widget-settings",defaultSettings:K(window.wpParselyContentHelperSettings),children:(0,a.jsx)(c,{children:(0,a.jsx)(W,{})})});s.createRoot?(0,s.createRoot)(e).render(t):(0,s.render)(t,e)}}),!1)}()}(); \ No newline at end of file diff --git a/build/content-helper/editor-sidebar.asset.php b/build/content-helper/editor-sidebar.asset.php index 099eedea1..00d33cc01 100644 --- a/build/content-helper/editor-sidebar.asset.php +++ b/build/content-helper/editor-sidebar.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => '009b7ca6bf45fe81240a'); + array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => '3f353fcbfaf6f76d8ea2'); diff --git a/build/content-helper/editor-sidebar.css b/build/content-helper/editor-sidebar.css index dd1083259..4a5c889a2 100644 --- a/build/content-helper/editor-sidebar.css +++ b/build/content-helper/editor-sidebar.css @@ -1,2 +1,3 @@ -.wp-parsely-beta-badge{align-self:end;background-color:var(--parsely-green);border-radius:.34em;box-shadow:0 .0625rem .1875rem rgba(0,0,0,.2);color:#fff;display:inline-block;font-size:.75rem;font-weight:700;margin:.125em .125em .125em auto;opacity:.8;padding:.15em .65em;text-transform:uppercase;-webkit-user-select:none;-moz-user-select:none;user-select:none}.parsely-tone-selector-dropdown{margin-bottom:.625rem;width:100%}.parsely-tone-selector-dropdown.is-disabled{opacity:.5;pointer-events:none}.parsely-tone-selector-dropdown .components-dropdown-menu__toggle{display:flex;gap:.625rem;width:100%}.parsely-tone-selector-dropdown .components-dropdown-menu__toggle svg:first-of-type path{transform:scale(1.4);transform-origin:center}.parsely-tone-selector-dropdown .parsely-tone-selector-label{flex-grow:2;text-align:left}.parsely-tone-selector-dropdown .parsely-tone-selector-label:first-letter{text-transform:uppercase}#wp-parsely-dashboard-widget,.settings_page_parsely,.wp-parsely-content-helper,.wp-parsely-excerpt-generator,.wp-parsely-popover{--base-font:"source-sans-pro",arial,sans-serif;--numeric-font:"ff-din-round-web",sans-serif;--parsely-green:#59a744;--gray-200:#f7f8f9;--gray-300:#edeeef;--gray-400:#d7dbdf;--gray-500:#959da5;--gray-600:#586069;--gray-700:#444d56;--gray-900:#24292e;--blue-500:#44a8e5;--blue-550:#2596db;--green-500:#7bc01b;--green-900:#3d6307;--ref-direct:205,13%,52%;--ref-internal:161,91%,41%;--ref-social:210,72%,41%;--ref-search:42,100%,50%;--ref-other:3,76%,58%;--base-text:var(--gray-900);--base-text-2:var(--gray-600);--base-3:var(--gray-400);--border:var(--gray-400);--data:var(--green-500);--control:var(--blue-500);--font-size--large:1rem;--font-size--extra-large:1.2rem;--black:#000;--sidebar-black:#1e1e1e}.parsely-persona-selector-dropdown{margin-bottom:.625rem;width:100%}.parsely-persona-selector-dropdown.is-disabled{opacity:.5;pointer-events:none}.parsely-persona-selector-dropdown .components-dropdown-menu__toggle{display:flex;gap:.625rem;width:100%}.parsely-persona-selector-dropdown .parsely-persona-selector-label{flex-grow:2;text-align:left}.parsely-persona-selector-dropdown .parsely-persona-selector-label:first-letter{text-transform:uppercase}.wp-parsely-popover button.components-button.components-menu-item__button.is-selected,.wp-parsely-popover button.components-button.components-menu-item__button.is-selected:focus{box-shadow:0 0 0 2px var(--parsely-green);outline:3px solid transparent} -#wp-parsely-dashboard-widget,.settings_page_parsely,.wp-parsely-content-helper,.wp-parsely-excerpt-generator,.wp-parsely-popover{--base-font:"source-sans-pro",arial,sans-serif;--numeric-font:"ff-din-round-web",sans-serif;--parsely-green:#59a744;--gray-200:#f7f8f9;--gray-300:#edeeef;--gray-400:#d7dbdf;--gray-500:#959da5;--gray-600:#586069;--gray-700:#444d56;--gray-900:#24292e;--blue-500:#44a8e5;--blue-550:#2596db;--green-500:#7bc01b;--green-900:#3d6307;--ref-direct:205,13%,52%;--ref-internal:161,91%,41%;--ref-social:210,72%,41%;--ref-search:42,100%,50%;--ref-other:3,76%,58%;--base-text:var(--gray-900);--base-text-2:var(--gray-600);--base-3:var(--gray-400);--border:var(--gray-400);--data:var(--green-500);--control:var(--blue-500);--font-size--large:1rem;--font-size--extra-large:1.2rem;--black:#000;--sidebar-black:#1e1e1e}.wp-parsely-content-helper .parsely-spinner-wrapper{display:flex;justify-content:center;margin:2.5rem 0}.wp-parsely-content-helper .parsely-spinner-wrapper svg{height:22px;width:22px}.wp-parsely-content-helper .content-helper-error-message{margin-top:.9375rem!important}.wp-parsely-content-helper p.content-helper-error-message-hint{color:var(--gray-700)}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-posts{list-style-type:none;margin:1.375rem 0 0}.wp-parsely-content-helper .parsely-top-posts-wrapper p.parsely-top-posts-descr{color:var(--gray-700);margin-top:.9375rem}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post{border-top:1px solid var(--gray-300);margin-bottom:.3125rem;padding:.625rem 0}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-title a{line-height:16px;text-decoration:none}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-stats-link{color:var(--black);font-size:.875rem;margin-right:.4375rem}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-stats-link:hover{color:var(--blue-550)}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-metric-data span.dashicon,.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-metric-data svg{fill:var(--gray-600);margin-right:.1875rem;position:relative;top:2px}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-metric-data span.dashicon{color:var(--gray-600);font-size:16px;height:16px;width:16px}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-edit-link,.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-view-link{display:inline-block;height:16px;margin-right:.1875rem;position:relative;width:16px}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-edit-link svg,.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-view-link svg{fill:#8d98a1;position:absolute;top:2px}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-edit-link:hover svg,.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-view-link:hover svg{fill:var(--blue-550)}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-info{align-items:center;display:flex;justify-content:space-between;margin:.3125rem 0 0}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-info>span{color:var(--gray-600);display:flex;margin-bottom:0}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-info>span:not(:first-child){margin-left:.3125rem}.wp-parsely-content-helper .performance-details-panel div.section{font-family:var(--base-font);margin-top:1.8rem}.wp-parsely-content-helper .performance-details-panel div.section table{border-collapse:collapse;width:100%}.wp-parsely-content-helper .performance-details-panel div.section table th{font-weight:400;text-align:left}.wp-parsely-content-helper .performance-details-panel div.section div.section-title{color:var(--base-text-2);margin-bottom:.5rem}.wp-parsely-content-helper .performance-details-panel div.section.period{color:var(--base-text-2);margin-top:.8rem}.wp-parsely-content-helper .performance-details-panel div.section.general-performance table tbody tr{font-family:var(--numeric-font);font-size:var(--font-size--extra-large);font-weight:500}.wp-parsely-content-helper .performance-details-panel div.section.general-performance table tfoot tr{color:var(--gray-700);height:1.4rem;vertical-align:bottom}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types div.multi-percentage-bar{--radius:2px;display:flex;height:.5rem}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types div.multi-percentage-bar .bar-fill:first-child{border-radius:var(--radius) 0 0 var(--radius)}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types div.multi-percentage-bar .bar-fill:last-child{border-radius:0 var(--radius) var(--radius) 0}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types div.multi-percentage-bar .bar-fill.direct{background-color:hsl(var(--ref-direct))}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types div.multi-percentage-bar .bar-fill.internal{background-color:hsl(var(--ref-internal))}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types div.multi-percentage-bar .bar-fill.search{background-color:hsl(var(--ref-search))}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types div.multi-percentage-bar .bar-fill.social{background-color:hsl(var(--ref-social))}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types div.multi-percentage-bar .bar-fill.other{background-color:hsl(var(--ref-other))}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types table{margin-top:.5rem}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types table tbody tr{font-family:var(--numeric-font);font-size:var(--font-size--large);height:1.4rem;vertical-align:bottom}.wp-parsely-content-helper .performance-details-panel div.section.top-referrers table thead tr{color:var(--base-text-2);height:1.6rem;vertical-align:top}.wp-parsely-content-helper .performance-details-panel div.section.top-referrers table thead tr th:last-child{text-align:right}.wp-parsely-content-helper .performance-details-panel div.section.top-referrers table tbody tr{border:1px solid var(--border);border-left:0;border-right:0;height:2rem}.wp-parsely-content-helper .performance-details-panel div.section.top-referrers table tbody tr th:first-child{--width:8rem;max-width:var(--width);min-width:var(--width);overflow:hidden;padding-right:1rem;text-overflow:ellipsis;white-space:nowrap}.wp-parsely-content-helper .performance-details-panel div.section.top-referrers table tbody tr td:nth-child(2){width:100%}.wp-parsely-content-helper .performance-details-panel div.section.top-referrers table tbody tr td:last-child{padding-left:1rem;text-align:right}.wp-parsely-content-helper .performance-details-panel div.section.top-referrers table tbody div.percentage-bar{--radius:4px;background-color:var(--base-3);border-radius:var(--radius);display:flex;height:.4rem;margin:0;overflow:hidden}.wp-parsely-content-helper .performance-details-panel div.section.top-referrers table tbody div.percentage-bar:after{background-color:var(--data);border-radius:var(--radius);content:"";height:100%;width:var(--bar-fill)}.wp-parsely-content-helper .performance-details-panel div.section.top-referrers div:last-child{color:var(--base-text-2);margin-top:.6rem}.wp-parsely-content-helper .performance-details-panel div.section.actions{display:inline-flex;justify-content:space-between;width:100%}.wp-parsely-content-helper .performance-details-panel div.section.actions a.components-button{border-radius:4px;text-transform:uppercase}.wp-parsely-content-helper .performance-details-panel div.section.actions a.components-button.is-secondary{box-shadow:inset 0 0 0 1px var(--border);color:var(--sidebar-black)}.wp-parsely-content-helper .performance-details-panel div.section.actions a.components-button.is-primary{background-color:var(--control)}.wp-parsely-content-helper .parsely-write-titles-wrapper{display:flex;flex-direction:column}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-text{margin-bottom:.625rem}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-text strong{text-transform:lowercase}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-generate-button{display:flex;justify-content:center;margin:.625rem 0}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-settings .parsely-write-titles-settings-header{display:flex;margin:.625rem 0;width:100%}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-settings .parsely-write-titles-settings-header .parsely-write-titles-settings-header-label{flex-grow:2;margin-left:.3125rem;text-align:left}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-settings .parsely-write-titles-settings-header .parsely-write-titles-settings-header-label .components-base-control__field{align-items:center;display:flex;justify-content:space-between}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-settings .parsely-write-titles-settings-header .parsely-write-titles-settings-header-label .components-base-control__field .components-base-control__label{margin-bottom:0}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-accepted-title-container .parsely-write-titles-accepted-title{font-size:1rem;font-weight:600;line-height:1.25rem;margin:0 0 .9375rem;text-align:center}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-accepted-title-container .parsely-write-titles-accepted-title-actions{display:flex;gap:.625rem;justify-content:center;margin:.625rem 0}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container{margin:.625rem 0 0}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container .parsely-write-titles-title-suggestion{border-top:1px solid var(--gray-300);display:flex;padding:1rem 0}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container .parsely-write-titles-title-suggestion .parsely-write-titles-suggested-title{flex:1;font-size:.875rem;font-weight:600;padding:0 .5rem 0 .3125rem}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container .parsely-write-titles-title-suggestion .parsely-write-titles-suggested-title-actions{display:flex;flex-direction:column;width:1.5625rem}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container .parsely-write-titles-title-suggestion .parsely-write-titles-suggested-title-actions .components-button-group .components-button{margin-left:0}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container .parsely-write-titles-title-suggestion .parsely-write-titles-suggested-title-actions .is-pinned{background-color:var(--gray-500);box-shadow:inset 0 0 0 1px var(--sidebar-black);color:#fff}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container .parsely-write-titles-title-suggestion.original-title{background-color:var(--gray-200);border:0;color:var(--gray-600);margin-bottom:.9375rem;padding:.3125rem}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container .parsely-write-titles-title-suggestion.original-title .parsely-write-titles-suggested-title{padding-bottom:.3125rem;padding-top:.3125rem}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container .parsely-write-titles-title-suggestion.original-title button{margin-top:.125rem}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container .title-in-use{color:var(--green-900)} +.wp-parsely-beta-badge{align-self:end;background-color:var(--parsely-green);border-radius:.34em;box-shadow:0 .0625rem .1875rem rgba(0,0,0,.2);color:#fff;display:inline-block;font-size:.75rem;font-weight:700;margin:.125em .125em .125em auto;opacity:.8;padding:.15em .65em;text-transform:uppercase;-webkit-user-select:none;-moz-user-select:none;user-select:none}.parsely-tone-selector-dropdown{margin-bottom:.625rem;width:100%}.parsely-tone-selector-dropdown.is-disabled{opacity:.5;pointer-events:none}.parsely-tone-selector-dropdown .components-dropdown-menu__toggle{display:flex;gap:.625rem;width:100%}.parsely-tone-selector-dropdown .components-dropdown-menu__toggle svg:first-of-type path{transform:scale(1.4);transform-origin:center}.parsely-tone-selector-dropdown .parsely-tone-selector-label{flex-grow:2;text-align:left}.parsely-tone-selector-dropdown .parsely-tone-selector-label:first-letter{text-transform:uppercase}#wp-parsely-dashboard-widget,.settings_page_parsely,.wp-parsely-content-helper,.wp-parsely-excerpt-generator,.wp-parsely-panel,.wp-parsely-popover{--base-font:"source-sans-pro",arial,sans-serif;--numeric-font:"ff-din-round-web",sans-serif;--parsely-green:#59a744;--gray-200:#f7f8f9;--gray-300:#edeeef;--gray-400:#d7dbdf;--gray-500:#959da5;--gray-600:#586069;--gray-700:#444d56;--gray-900:#24292e;--blue-500:#44a8e5;--blue-550:#2596db;--green-500:#7bc01b;--green-900:#3d6307;--ref-direct:205,13%,52%;--ref-internal:161,91%,41%;--ref-social:210,72%,41%;--ref-search:42,100%,50%;--ref-other:3,76%,58%;--base-text:var(--gray-900);--base-text-2:var(--gray-600);--base-3:var(--gray-400);--border:var(--gray-400);--data:var(--green-500);--control:var(--blue-500);--font-size--large:1rem;--font-size--extra-large:1.2rem;--black:#000;--sidebar-black:#1e1e1e}.parsely-persona-selector-dropdown{margin-bottom:.625rem;width:100%}.parsely-persona-selector-dropdown.is-disabled{opacity:.5;pointer-events:none}.parsely-persona-selector-dropdown .components-dropdown-menu__toggle{display:flex;gap:.625rem;width:100%}.parsely-persona-selector-dropdown .parsely-persona-selector-label{flex-grow:2;text-align:left}.parsely-persona-selector-dropdown .parsely-persona-selector-label:first-letter{text-transform:uppercase}.wp-parsely-popover button.components-button.components-menu-item__button.is-selected,.wp-parsely-popover button.components-button.components-menu-item__button.is-selected:focus{box-shadow:0 0 0 2px var(--parsely-green);outline:3px solid transparent}.parsely-panel-settings{width:100%}.parsely-panel-settings .parsely-panel-settings-header{display:flex;margin:.625rem 0;width:100%}.parsely-panel-settings .parsely-panel-settings-header .parsely-panel-settings-header-label{flex-grow:2;margin:0 0 0 .3125rem;text-align:left}.parsely-panel-settings .parsely-panel-settings-header .parsely-panel-settings-header-label .components-base-control__field{align-items:center;display:flex;justify-content:space-between}.parsely-panel-settings .parsely-panel-settings-header .parsely-panel-settings-header-label .components-base-control__field .components-base-control__label{margin-bottom:0}.wp-parsely-content-helper-error{align-self:flex-start;margin:0}.wp-parsely-content-helper-error p{margin:0}.wp-parsely-content-helper-error .content-helper-error-message{margin:0!important} +#wp-parsely-dashboard-widget,.settings_page_parsely,.wp-parsely-content-helper,.wp-parsely-excerpt-generator,.wp-parsely-panel,.wp-parsely-popover{--base-font:"source-sans-pro",arial,sans-serif;--numeric-font:"ff-din-round-web",sans-serif;--parsely-green:#59a744;--gray-200:#f7f8f9;--gray-300:#edeeef;--gray-400:#d7dbdf;--gray-500:#959da5;--gray-600:#586069;--gray-700:#444d56;--gray-900:#24292e;--blue-500:#44a8e5;--blue-550:#2596db;--green-500:#7bc01b;--green-900:#3d6307;--ref-direct:205,13%,52%;--ref-internal:161,91%,41%;--ref-social:210,72%,41%;--ref-search:42,100%,50%;--ref-other:3,76%,58%;--base-text:var(--gray-900);--base-text-2:var(--gray-600);--base-3:var(--gray-400);--border:var(--gray-400);--data:var(--green-500);--control:var(--blue-500);--font-size--large:1rem;--font-size--extra-large:1.2rem;--black:#000;--sidebar-black:#1e1e1e}.wp-parsely-block-overlay{align-items:center;background-color:hsla(0,0%,100%,.85);box-sizing:border-box;display:flex;height:100%;justify-content:center;left:0;position:absolute;top:0;width:100%}.wp-parsely-block-overlay .wp-parsely-block-overlay-label{align-items:center;display:flex;flex-direction:column;flex-grow:1;justify-content:center;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.wp-parsely-block-overlay svg{height:1.5625rem;width:1.5625rem}.wp-parsely-block-overlay.full-content-overlay{font-size:1.25rem;z-index:999}.wp-parsely-block-overlay.full-content-overlay span{margin-top:.9375rem}.wp-parsely-block-overlay.full-content-overlay svg{height:3.125rem;width:3.125rem}.wp-parsely-panel .wp-parsely-icon{margin-right:.3125rem;order:-1}.wp-parsely-smart-linking .components-panel__row{flex-direction:column}.wp-parsely-smart-linking .wp-parsely-smart-linking-text{margin-bottom:.625rem}.wp-parsely-smart-linking .wp-parsely-smart-linking-generate{align-items:center;display:flex;flex-direction:column}.wp-parsely-smart-linking .wp-parsely-smart-linking-generate button{margin:.625rem 0}.wp-parsely-smart-linking .wp-parsely-smart-linking-generate .components-disabled .components-checkbox-control__label{color:var(--gray-500)}.wp-parsely-smart-linking .wp-parsely-smart-linking-generate .components-button{margin-bottom:.625rem;width:-moz-fit-content;width:fit-content}.wp-parsely-smart-linking .wp-parsely-smart-linking-generate .components-base-control{margin-bottom:0!important;margin-top:.625rem}.wp-parsely-smart-linking .wp-parsely-smart-linking-generate .components-base-control .components-base-control__field{display:flex}.wp-parsely-smart-linking .wp-parsely-smart-linking-hint,.wp-parsely-smart-linking .wp-parsely-smart-linking-suggested-links{margin:0} +#wp-parsely-dashboard-widget,.settings_page_parsely,.wp-parsely-content-helper,.wp-parsely-excerpt-generator,.wp-parsely-panel,.wp-parsely-popover{--base-font:"source-sans-pro",arial,sans-serif;--numeric-font:"ff-din-round-web",sans-serif;--parsely-green:#59a744;--gray-200:#f7f8f9;--gray-300:#edeeef;--gray-400:#d7dbdf;--gray-500:#959da5;--gray-600:#586069;--gray-700:#444d56;--gray-900:#24292e;--blue-500:#44a8e5;--blue-550:#2596db;--green-500:#7bc01b;--green-900:#3d6307;--ref-direct:205,13%,52%;--ref-internal:161,91%,41%;--ref-social:210,72%,41%;--ref-search:42,100%,50%;--ref-other:3,76%,58%;--base-text:var(--gray-900);--base-text-2:var(--gray-600);--base-3:var(--gray-400);--border:var(--gray-400);--data:var(--green-500);--control:var(--blue-500);--font-size--large:1rem;--font-size--extra-large:1.2rem;--black:#000;--sidebar-black:#1e1e1e}.wp-parsely-content-helper .parsely-spinner-wrapper{display:flex;justify-content:center;margin:2.5rem 0}.wp-parsely-content-helper .parsely-spinner-wrapper svg{height:22px;width:22px}.wp-parsely-content-helper .content-helper-error-message,.wp-parsely-content-helper .wp-parsely-content-helper-error .content-helper-error-message{margin-top:.9375rem!important}.wp-parsely-content-helper p.content-helper-error-message-hint{color:var(--gray-700)}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-posts{list-style-type:none;margin:1.375rem 0 0}.wp-parsely-content-helper .parsely-top-posts-wrapper p.parsely-top-posts-descr{color:var(--gray-700);margin-top:.9375rem}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post{border-top:1px solid var(--gray-300);margin-bottom:.3125rem;padding:.625rem 0}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-title a{line-height:16px;text-decoration:none}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-stats-link{color:var(--black);font-size:.875rem;margin-right:.4375rem}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-stats-link:hover{color:var(--blue-550)}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-metric-data span.dashicon,.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-metric-data svg{fill:var(--gray-600);margin-right:.1875rem;position:relative;top:2px}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-metric-data span.dashicon{color:var(--gray-600);font-size:16px;height:16px;width:16px}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-edit-link,.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-view-link{display:inline-block;height:16px;margin-right:.1875rem;position:relative;width:16px}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-edit-link svg,.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-view-link svg{fill:#8d98a1;position:absolute;top:2px}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-edit-link:hover svg,.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-view-link:hover svg{fill:var(--blue-550)}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-info{align-items:center;display:flex;justify-content:space-between;margin:.3125rem 0 0}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-info>span{color:var(--gray-600);display:flex;margin-bottom:0}.wp-parsely-content-helper .parsely-top-posts-wrapper .parsely-top-post-info>span:not(:first-child){margin-left:.3125rem}.wp-parsely-content-helper .performance-details-panel div.section{font-family:var(--base-font);margin-top:1.8rem}.wp-parsely-content-helper .performance-details-panel div.section table{border-collapse:collapse;width:100%}.wp-parsely-content-helper .performance-details-panel div.section table th{font-weight:400;text-align:left}.wp-parsely-content-helper .performance-details-panel div.section div.section-title{color:var(--base-text-2);margin-bottom:.5rem}.wp-parsely-content-helper .performance-details-panel div.section.period{color:var(--base-text-2);margin-top:.8rem}.wp-parsely-content-helper .performance-details-panel div.section.general-performance table tbody tr{font-family:var(--numeric-font);font-size:var(--font-size--extra-large);font-weight:500}.wp-parsely-content-helper .performance-details-panel div.section.general-performance table tfoot tr{color:var(--gray-700);height:1.4rem;vertical-align:bottom}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types div.multi-percentage-bar{--radius:2px;display:flex;height:.5rem}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types div.multi-percentage-bar .bar-fill:first-child{border-radius:var(--radius) 0 0 var(--radius)}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types div.multi-percentage-bar .bar-fill:last-child{border-radius:0 var(--radius) var(--radius) 0}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types div.multi-percentage-bar .bar-fill.direct{background-color:hsl(var(--ref-direct))}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types div.multi-percentage-bar .bar-fill.internal{background-color:hsl(var(--ref-internal))}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types div.multi-percentage-bar .bar-fill.search{background-color:hsl(var(--ref-search))}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types div.multi-percentage-bar .bar-fill.social{background-color:hsl(var(--ref-social))}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types div.multi-percentage-bar .bar-fill.other{background-color:hsl(var(--ref-other))}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types table{margin-top:.5rem}.wp-parsely-content-helper .performance-details-panel div.section.referrer-types table tbody tr{font-family:var(--numeric-font);font-size:var(--font-size--large);height:1.4rem;vertical-align:bottom}.wp-parsely-content-helper .performance-details-panel div.section.top-referrers table thead tr{color:var(--base-text-2);height:1.6rem;vertical-align:top}.wp-parsely-content-helper .performance-details-panel div.section.top-referrers table thead tr th:last-child{text-align:right}.wp-parsely-content-helper .performance-details-panel div.section.top-referrers table tbody tr{border:1px solid var(--border);border-left:0;border-right:0;height:2rem}.wp-parsely-content-helper .performance-details-panel div.section.top-referrers table tbody tr th:first-child{--width:8rem;max-width:var(--width);min-width:var(--width);overflow:hidden;padding-right:1rem;text-overflow:ellipsis;white-space:nowrap}.wp-parsely-content-helper .performance-details-panel div.section.top-referrers table tbody tr td:nth-child(2){width:100%}.wp-parsely-content-helper .performance-details-panel div.section.top-referrers table tbody tr td:last-child{padding-left:1rem;text-align:right}.wp-parsely-content-helper .performance-details-panel div.section.top-referrers table tbody div.percentage-bar{--radius:4px;background-color:var(--base-3);border-radius:var(--radius);display:flex;height:.4rem;margin:0;overflow:hidden}.wp-parsely-content-helper .performance-details-panel div.section.top-referrers table tbody div.percentage-bar:after{background-color:var(--data);border-radius:var(--radius);content:"";height:100%;width:var(--bar-fill)}.wp-parsely-content-helper .performance-details-panel div.section.top-referrers div:last-child{color:var(--base-text-2);margin-top:.6rem}.wp-parsely-content-helper .performance-details-panel div.section.actions{display:inline-flex;justify-content:space-between;width:100%}.wp-parsely-content-helper .performance-details-panel div.section.actions a.components-button{border-radius:4px;text-transform:uppercase}.wp-parsely-content-helper .performance-details-panel div.section.actions a.components-button.is-secondary{box-shadow:inset 0 0 0 1px var(--border);color:var(--sidebar-black)}.wp-parsely-content-helper .performance-details-panel div.section.actions a.components-button.is-primary{background-color:var(--control)}.wp-parsely-content-helper .parsely-write-titles-wrapper{display:flex;flex-direction:column}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-text{margin-bottom:.625rem}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-text strong{text-transform:lowercase}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-generate-button{display:flex;justify-content:center;margin:.625rem 0}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-accepted-title-container .parsely-write-titles-accepted-title{font-size:1rem;font-weight:600;line-height:1.25rem;margin:0 0 .9375rem;text-align:center}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-accepted-title-container .parsely-write-titles-accepted-title-actions{display:flex;gap:.625rem;justify-content:center;margin:.625rem 0}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container{margin:.625rem 0 0}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container .parsely-write-titles-title-suggestion{border-top:1px solid var(--gray-300);display:flex;padding:1rem 0}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container .parsely-write-titles-title-suggestion .parsely-write-titles-suggested-title{flex:1;font-size:.875rem;font-weight:600;padding:0 .5rem 0 .3125rem}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container .parsely-write-titles-title-suggestion .parsely-write-titles-suggested-title-actions{display:flex;flex-direction:column;width:1.5625rem}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container .parsely-write-titles-title-suggestion .parsely-write-titles-suggested-title-actions .components-button-group .components-button{margin-left:0}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container .parsely-write-titles-title-suggestion .parsely-write-titles-suggested-title-actions .is-pinned{background-color:var(--gray-500);box-shadow:inset 0 0 0 1px var(--sidebar-black);color:#fff}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container .parsely-write-titles-title-suggestion.original-title{background-color:var(--gray-200);border:0;color:var(--gray-600);margin-bottom:.9375rem;padding:.3125rem}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container .parsely-write-titles-title-suggestion.original-title .parsely-write-titles-suggested-title{padding-bottom:.3125rem;padding-top:.3125rem}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container .parsely-write-titles-title-suggestion.original-title button{margin-top:.125rem}.wp-parsely-content-helper .parsely-write-titles-wrapper .parsely-write-titles-title-suggestions-container .title-in-use{color:var(--green-900)} diff --git a/build/content-helper/editor-sidebar.js b/build/content-helper/editor-sidebar.js index f4ca0f1eb..629235ebb 100644 --- a/build/content-helper/editor-sidebar.js +++ b/build/content-helper/editor-sidebar.js @@ -1,16 +1,17 @@ -!function(){"use strict";var e={251:function(e,t,n){var r=n(196),i=Symbol.for("react.element"),s=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,s={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===s[r]&&(s[r]=t[r]);return{$$typeof:i,type:e,key:c,ref:u,props:s,_owner:o.current}}t.Fragment=s,t.jsx=c,t.jsxs=c},893:function(e,t,n){e.exports=n(251)},196:function(e){e.exports=window.React}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e,t,r,i=n(893),s=window.wp.components,a=window.wp.coreData,o=window.wp.data,l=window.wp.editPost,c=window.wp.editor,u=window.wp.element,p=window.wp.i18n,d=window.wp.plugins,h=function(){function e(){this._tkq=[],this.isLoaded=!1,this.isEnabled=!1,"undefined"!=typeof wpParselyTracksTelemetry&&(this.isEnabled=!0,this.loadTrackingLibrary())}return e.getInstance=function(){return window.wpParselyTelemetryInstance||Object.defineProperty(window,"wpParselyTelemetryInstance",{value:new e,writable:!1,configurable:!1,enumerable:!1}),window.wpParselyTelemetryInstance},e.prototype.loadTrackingLibrary=function(){var e=this,t=document.createElement("script");t.async=!0,t.src="//stats.wp.com/w.js",t.onload=function(){e.isLoaded=!0,e._tkq=window._tkq||[]},document.head.appendChild(t)},e.trackEvent=function(t,n){return void 0===n&&(n={}),r=this,i=void 0,a=function(){var r;return function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(l){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=1e4&&(clearInterval(s),n("Telemetry library not loaded"))}),100);else n("Telemetry not enabled")}))},e.prototype.trackEvent=function(t,n){var r;this.isLoaded?(0!==t.indexOf(e.TRACKS_PREFIX)&&(t=e.TRACKS_PREFIX+t),this.isEventNameValid(t)?(n=this.prepareProperties(n),null===(r=this._tkq)||void 0===r||r.push(["recordEvent",t,n])):console.error("Error tracking event: Invalid event name")):console.error("Error tracking event: Telemetry not loaded")},e.prototype.isTelemetryEnabled=function(){return this.isEnabled},e.prototype.isProprietyValid=function(t){return e.PROPERTY_REGEX.test(t)},e.prototype.isEventNameValid=function(t){return e.EVENT_NAME_REGEX.test(t)},e.prototype.prepareProperties=function(e){return(e=this.sanitizeProperties(e)).parsely_version=wpParselyTracksTelemetry.version,wpParselyTracksTelemetry.user&&(e._ut=wpParselyTracksTelemetry.user.type,e._ui=wpParselyTracksTelemetry.user.id),wpParselyTracksTelemetry.vipgo_env&&(e.vipgo_env=wpParselyTracksTelemetry.vipgo_env),this.sanitizeProperties(e)},e.prototype.sanitizeProperties=function(e){var t=this,n={};return Object.keys(e).forEach((function(r){t.isProprietyValid(r)&&(n[r]=e[r])})),n},e.TRACKS_PREFIX="wpparsely_",e.EVENT_NAME_REGEX=/^(([a-z0-9]+)_){2}([a-z0-9_]+)$/,e.PROPERTY_REGEX=/^[a-z_][a-z0-9_]*$/,e}(),f=(h.trackEvent,function(e){var t=e.text,n=void 0===t?(0,p.__)("Beta","wp-parsely"):t,r=e.color,s=void 0===r?"var(--parsely-green)":r,a=e.fontSize,o={backgroundColor:s,fontSize:void 0===a?"0.75rem":a};return(0,i.jsx)("div",{className:"wp-parsely-beta-badge",style:o,children:n})}),y=(0,u.forwardRef)((function({icon:e,size:t=24,...n},r){return(0,u.cloneElement)(e,{width:t,height:t,...n,ref:r})})),g=n(196),v=window.wp.primitives,w=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),m=function(){return(0,i.jsxs)(s.SVG,{"aria-hidden":"true",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[(0,i.jsx)(s.G,{transform:"matrix(1, 0, 0, 1, 1.7763568394002505e-15, 0)"}),(0,i.jsx)(s.Path,{d:"M 16.693 6.167 A 4.541 4.541 0 0 1 12.152 10.708 A 4.541 4.541 0 0 1 7.611 6.167 A 4.541 4.541 0 0 1 12.152 1.626 A 4.541 4.541 0 0 1 16.693 6.167 Z",style:{fill:"rgba(216, 216, 216, 0)",fillOpacity:0,strokeWidth:"2.5px",stroke:"rgb(0, 0, 0)"}}),(0,i.jsx)(s.Path,{d:"M 3.016 23.76 L 3.0135 22.4385 C 3.0109999999999997 21.117 3.0060000000000002 18.474 3.3204999999999996 16.911 C 3.635 15.347999999999999 4.268999999999999 14.865 7.068666666666666 14.6235 C 9.868333333333332 14.382 14.833666666666666 14.382 17.585833333333333 14.658 C 20.337999999999997 14.934 20.877 15.485999999999999 21.1465 17.0435 C 21.416 18.601 21.416 21.164 21.416 22.4455 L 21.416 23.727",style:{fillOpacity:0,fill:"rgb(255, 255, 255)",strokeWidth:"2.5px",stroke:"rgb(0, 0, 0)"}})]})},_={journalist:{label:(0,p.__)("Journalist","wp-parsely"),emoji:"📰"},editorialWriter:{label:(0,p.__)("Editorial Writer","wp-parsely"),emoji:"✍️"},investigativeReporter:{label:(0,p.__)("Investigative Reporter","wp-parsely"),emoji:"🕵️"},techAnalyst:{label:(0,p.__)("Tech Analyst","wp-parsely"),emoji:"💻"},businessAnalyst:{label:(0,p.__)("Business Analyst","wp-parsely"),emoji:"📈"},culturalCommentator:{label:(0,p.__)("Cultural Commentator","wp-parsely"),emoji:"🌍"},scienceCorrespondent:{label:(0,p.__)("Science Correspondent","wp-parsely"),emoji:"🔬"},politicalAnalyst:{label:(0,p.__)("Political Analyst","wp-parsely"),emoji:"🏛️"},healthWellnessAdvocate:{label:(0,p.__)("Health and Wellness Advocate","wp-parsely"),emoji:"🍏"},environmentalJournalist:{label:(0,p.__)("Environmental Journalist","wp-parsely"),emoji:"🌳"},custom:{label:(0,p.__)("Use a custom persona","wp-parsely"),emoji:"🔧"}},b=Object.keys(_),x=function(e){return"custom"===e||""===e?_.custom.label:j(e)?e:_[e].label},j=function(e){return!b.includes(e)||"custom"===e},P=function(e){var t=e.value,n=e.onChange,r=(0,u.useState)(""),a=r[0],o=r[1];return(0,i.jsx)("div",{className:"parsely-persona-selector-custom",children:(0,i.jsx)(s.TextControl,{value:a||t,onChange:function(e){n(e),o(e)},help:(0,p.__)("Enter a custom persona","wp-parsely")})})},T=function(e){var t=e.persona,n=e.label,r=void 0===n?(0,p.__)("Select a persona","wp-parsely"):n,a=e.onChange,o=e.onDropdownChange,l=e.disabled,c=void 0!==l&&l,u=e.allowCustom,d=void 0!==u&&u;return(0,i.jsxs)(s.Disabled,{isDisabled:c,children:[(0,i.jsx)(s.DropdownMenu,{label:(0,p.__)("Persona","wp-parsely"),icon:m,className:"parsely-persona-selector-dropdown"+(c?" is-disabled":""),popoverProps:{className:"wp-parsely-popover"},toggleProps:{children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"parsely-persona-selector-label",children:r}),(0,i.jsx)(y,{icon:w})]})},children:function(e){var n=e.onClose;return(0,i.jsx)(s.MenuGroup,{label:(0,p.__)("Select a persona","wp-parsely"),children:(0,i.jsx)(i.Fragment,{children:b.map((function(e){if(!d&&"custom"===e)return null;var r=_[e];return(0,i.jsxs)(s.MenuItem,{isSelected:e===t,className:e===t?"is-selected":"",role:"menuitemradio",onClick:function(){null==o||o(e),a(e),n()},children:[r.emoji," ",r.label]},e)}))})})}}),d&&j(t)&&(0,i.jsx)(P,{onChange:function(e){a(""!==e?e:"custom")},value:"custom"===t?"":t})]})},S=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{fillRule:"evenodd",d:"M6.863 13.644L5 13.25h-.5a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5H5L18 6.5h2V16h-2l-3.854-.815.026.008a3.75 3.75 0 01-7.31-1.549zm1.477.313a2.251 2.251 0 004.356.921l-4.356-.921zm-2.84-3.28L18.157 8h.343v6.5h-.343L5.5 11.823v-1.146z",clipRule:"evenodd"})),E={neutral:{label:(0,p.__)("Neutral","wp-parsely"),emoji:"😐"},formal:{label:(0,p.__)("Formal","wp-parsely"),emoji:"🎩"},humorous:{label:(0,p.__)("Humorous","wp-parsely"),emoji:"😂"},confident:{label:(0,p.__)("Confident","wp-parsely"),emoji:"😎"},provocative:{label:(0,p.__)("Provocative","wp-parsely"),emoji:"😈"},serious:{label:(0,p.__)("Serious","wp-parsely"),emoji:"🧐"},inspirational:{label:(0,p.__)("Inspirational","wp-parsely"),emoji:"✨"},skeptical:{label:(0,p.__)("Skeptical","wp-parsely"),emoji:"🤨"},conversational:{label:(0,p.__)("Conversational","wp-parsely"),emoji:"💬"},analytical:{label:(0,p.__)("Analytical","wp-parsely"),emoji:"🤓"},custom:{label:(0,p.__)("Use a custom tone","wp-parsely"),emoji:"🔧"}},C=Object.keys(E),N=function(e){return"custom"===e||""===e?E.custom.label:k(e)?e:E[e].label},k=function(e){return!C.includes(e)||"custom"===e},O=function(e){var t=e.value,n=e.onChange,r=(0,u.useState)(""),a=r[0],o=r[1];return(0,i.jsx)("div",{className:"parsely-tone-selector-custom",children:(0,i.jsx)(s.TextControl,{value:a||t,onChange:function(e){n(e),o(e)},help:(0,p.__)("Enter a custom tone","wp-parsely")})})},A=function(e){var t=e.tone,n=e.label,r=void 0===n?(0,p.__)("Select a tone","wp-parsely"):n,a=e.onChange,o=e.onDropdownChange,l=e.disabled,c=void 0!==l&&l,u=e.allowCustom,d=void 0!==u&&u;return(0,i.jsxs)(s.Disabled,{isDisabled:c,children:[(0,i.jsx)(s.DropdownMenu,{label:(0,p.__)("Tone","wp-parsely"),icon:S,className:"parsely-tone-selector-dropdown"+(c?" is-disabled":""),popoverProps:{className:"wp-parsely-popover"},toggleProps:{children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"parsely-tone-selector-label",children:r}),(0,i.jsx)(y,{icon:w})]})},children:function(e){var n=e.onClose;return(0,i.jsx)(s.MenuGroup,{label:(0,p.__)("Select a tone","wp-parsely"),children:(0,i.jsx)(i.Fragment,{children:C.map((function(e){if(!d&&"custom"===e)return null;var r=E[e];return(0,i.jsxs)(s.MenuItem,{isSelected:e===t,className:e===t?"is-selected":"",role:"menuitemradio",onClick:function(){null==o||o(e),a(e),n()},children:[r.emoji," ",r.label]},e)}))})})}}),d&&k(t)&&(0,i.jsx)(O,{onChange:function(e){a(""!==e?e:"custom")},value:"custom"===t?"":t})]})},R=function(e){var t=e.size,n=void 0===t?24:t;return(0,i.jsxs)(s.SVG,{height:n,viewBox:"0 0 60 65",width:n,xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M23.72,51.53c0-.18,0-.34-.06-.52a13.11,13.11,0,0,0-2.1-5.53A14.74,14.74,0,0,0,19.12,43c-.27-.21-.5-.11-.51.22l-.24,3.42c0,.33-.38.35-.49,0l-1.5-4.8a1.4,1.4,0,0,0-.77-.78,23.91,23.91,0,0,0-3.1-.84c-1.38-.24-3.39-.39-3.39-.39-.34,0-.45.21-.25.49l2.06,3.76c.2.27,0,.54-.29.33l-4.51-3.6a3.68,3.68,0,0,0-2.86-.48c-1,.16-2.44.46-2.44.46a.68.68,0,0,0-.39.25.73.73,0,0,0-.14.45S.41,43,.54,44a3.63,3.63,0,0,0,1.25,2.62L6.48,50c.28.2.09.49-.23.37l-4.18-.94c-.32-.12-.5,0-.4.37,0,0,.69,1.89,1.31,3.16a24,24,0,0,0,1.66,2.74,1.34,1.34,0,0,0,1,.52l5,.13c.33,0,.41.38.1.48L7.51,58c-.31.1-.34.35-.07.55a14.29,14.29,0,0,0,3.05,1.66,13.09,13.09,0,0,0,5.9.5,25.13,25.13,0,0,0,4.34-1,9.55,9.55,0,0,1-.08-1.2,9.32,9.32,0,0,1,3.07-6.91"}),(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M59.7,41.53a.73.73,0,0,0-.14-.45.68.68,0,0,0-.39-.25s-1.43-.3-2.44-.46a3.64,3.64,0,0,0-2.86.48l-4.51,3.6c-.26.21-.49-.06-.29-.33l2.06-3.76c.2-.28.09-.49-.25-.49,0,0-2,.15-3.39.39a23.91,23.91,0,0,0-3.1.84,1.4,1.4,0,0,0-.77.78l-1.5,4.8c-.11.32-.48.3-.49,0l-.24-3.42c0-.33-.24-.43-.51-.22a14.74,14.74,0,0,0-2.44,2.47A13.11,13.11,0,0,0,36.34,51c0,.18,0,.34-.06.52a9.26,9.26,0,0,1,3,8.1,24.1,24.1,0,0,0,4.34,1,13.09,13.09,0,0,0,5.9-.5,14.29,14.29,0,0,0,3.05-1.66c.27-.2.24-.45-.07-.55l-3.22-1.17c-.31-.1-.23-.47.1-.48l5-.13a1.38,1.38,0,0,0,1-.52A24.6,24.6,0,0,0,57,52.92c.61-1.27,1.31-3.16,1.31-3.16.1-.33-.08-.49-.4-.37l-4.18.94c-.32.12-.51-.17-.23-.37l4.69-3.34A3.63,3.63,0,0,0,59.46,44c.13-1,.24-2.47.24-2.47"}),(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M46.5,25.61c0-.53-.35-.72-.8-.43l-4.86,2.66c-.45.28-.56-.27-.23-.69l4.66-6.23a2,2,0,0,0,.28-1.68,36.51,36.51,0,0,0-2.19-4.89,34,34,0,0,0-2.81-3.94c-.33-.41-.74-.35-.91.16l-2.28,5.68c-.16.5-.6.48-.59-.05l.28-8.93a2.54,2.54,0,0,0-.66-1.64S35,4.27,33.88,3.27,30.78.69,30.78.69a1.29,1.29,0,0,0-1.54,0s-1.88,1.49-3.12,2.59-2.48,2.35-2.48,2.35A2.5,2.5,0,0,0,23,7.27l.27,8.93c0,.53-.41.55-.58.05l-2.29-5.69c-.17-.5-.57-.56-.91-.14a35.77,35.77,0,0,0-3,4.2,35.55,35.55,0,0,0-2,4.62,2,2,0,0,0,.27,1.67l4.67,6.24c.33.42.23,1-.22.69l-4.87-2.66c-.45-.29-.82-.1-.82.43a18.6,18.6,0,0,0,.83,5.07,20.16,20.16,0,0,0,5.37,7.77c3.19,3,5.93,7.8,7.45,11.08A9.6,9.6,0,0,1,30,49.09a9.31,9.31,0,0,1,2.86.45c1.52-3.28,4.26-8.11,7.44-11.09a20.46,20.46,0,0,0,5.09-7,19,19,0,0,0,1.11-5.82"}),(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M36.12,58.44A6.12,6.12,0,1,1,30,52.32a6.11,6.11,0,0,1,6.12,6.12"})]})},L=function(){return L=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=c){var u=t;(i=r/c)%1>1/o&&(u=i>10?1:2),u=parseFloat(i.toFixed(2))===parseFloat(i.toFixed(0))?0:u,s=i.toFixed(u),a=l}o=c})),s+n+a}var J,K,ee=window.wp.url,te=(J=function(e,t){return J=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},J(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}J(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});!function(e){e.CannotFormulateApiQuery="ch_cannot_formulate_api_query",e.FetchError="fetch_error",e.HttpRequestFailed="http_request_failed",e[e.ParselyApiForbidden=403]="ParselyApiForbidden",e.ParselyApiResponseContainsError="ch_response_contains_error",e.ParselyApiReturnedNoData="ch_parsely_api_returned_no_data",e.ParselyApiReturnedTooManyResults="ch_parsely_api_returned_too_many_results",e[e.ParselyApiUnauthorized=401]="ParselyApiUnauthorized",e.PluginCredentialsNotSetMessageDetected="parsely_credentials_not_set_message_detected",e.PluginSettingsApiSecretNotSet="parsely_api_secret_not_set",e.PluginSettingsSiteIdNotSet="parsely_site_id_not_set",e.PostIsNotPublished="ch_post_not_published"}(K||(K={}));var ne=function(e){function t(n,r,i){void 0===i&&(i=(0,p.__)("Error: ","wp-parsely"));var s=e.call(this,i+n)||this;s.hint=null,s.name=s.constructor.name,s.code=r;var a=[K.ParselyApiForbidden,K.ParselyApiResponseContainsError,K.ParselyApiReturnedNoData,K.ParselyApiReturnedTooManyResults,K.ParselyApiUnauthorized,K.PluginCredentialsNotSetMessageDetected,K.PluginSettingsApiSecretNotSet,K.PluginSettingsSiteIdNotSet,K.PostIsNotPublished];return s.retryFetch=!a.includes(s.code),Object.setPrototypeOf(s,t.prototype),s}return te(t,e),t.prototype.Message=function(e){return void 0===e&&(e=null),[K.PluginCredentialsNotSetMessageDetected,K.PluginSettingsSiteIdNotSet,K.PluginSettingsApiSecretNotSet].includes(this.code)?Q(e):(this.code===K.FetchError&&(this.hint=this.Hint((0,p.__)("This error can sometimes be caused by ad-blockers or browser tracking protections. Please add this site to any applicable allow lists and try again.","wp-parsely"))),this.code===K.ParselyApiForbidden&&(this.hint=this.Hint((0,p.__)("Please ensure that the Site ID and API Secret given in the plugin's settings are correct.","wp-parsely"))),this.code===K.HttpRequestFailed&&(this.hint=this.Hint((0,p.__)("The Parse.ly API cannot be reached. Please verify that you are online.","wp-parsely"))),this.code===K.ParselyApiUnauthorized&&(this.message=(0,p.__)("This feature is accessible to select customers participating in its beta testing.","wp-parsely")),(0,i.jsx)(q,{className:null==e?void 0:e.className,testId:"error",children:"

".concat(this.message,"

").concat(this.hint?this.hint:"")}))},t.prototype.Hint=function(e){return'

'.concat((0,p.__)("Hint:","wp-parsely")," ").concat(e,"

")},t}(Error),re={month:"short",day:"numeric",year:"numeric"},ie={month:"short",day:"numeric"},se=(0,p.__)("Date N/A","wp-parsely");function ae(e){if(!1===function(e){return!isNaN(+e)&&0!==e.getTime()}(e))return se;var t=re;return e.getUTCFullYear()===(new Date).getUTCFullYear()&&(t=ie),Intl.DateTimeFormat(document.documentElement.lang||"en",t).format(e)}function oe(e){return{period_start:e,period_end:""}}var le=function(){return le=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1?[2,Promise.reject(new ne((0,p.sprintf)(/* translators: URL of the published post */ -(0,p.__)("Multiple results were returned for the post %s by the Parse.ly API.","wp-parsely"),t),K.ParselyApiReturnedTooManyResults))]:[2,n.data[0]]}}))}))},e.prototype.fetchReferrerDataFromWpEndpoint=function(e,t,n){return ce(this,void 0,void 0,(function(){var r,i;return ue(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,V()({path:(0,ee.addQueryArgs)("/wp-parsely/v1/referrers/post/detail",le(le({},oe(e)),{itm_source:this.itmSource,total_views:n,url:t}))})];case 1:return r=s.sent(),[3,3];case 2:return i=s.sent(),[2,Promise.reject(new ne(i.message,i.code))];case 3:return(null==r?void 0:r.error)?[2,Promise.reject(new ne(r.error.message,K.ParselyApiResponseContainsError))]:[2,r.data]}}))}))},e}(),de=function(){return de=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&e.retryFetch?[4,new Promise((function(e){return setTimeout(e,500)}))]:[3,3];case 1:return t.sent(),[4,r(i-1)];case 2:return t.sent(),[3,4];case 3:p(e),o(!1),t.label=4;case 4:return[2]}}))}))})),[2]}))}))};return o(!0),r(1),function(){p(void 0)}}),[n]),c?c.Message():a?(0,i.jsx)("div",{className:"parsely-spinner-wrapper","data-testid":"parsely-spinner-wrapper",children:(0,i.jsx)(s.Spinner,{})}):(0,i.jsx)(ge,{data:h,period:n})}function ge(e){return(0,i.jsxs)("div",{className:"performance-details-panel",children:[(0,i.jsx)("div",{className:"section period",children:$(e.period)}),(0,i.jsx)(ve,de({},e)),(0,i.jsx)(we,de({},e)),(0,i.jsx)(me,de({},e)),(0,i.jsx)(_e,de({},e))]})}function ve(e){var t=e.data;return(0,i.jsx)("div",{className:"section general-performance",children:(0,i.jsxs)("table",{children:[(0,i.jsx)("tbody",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:Y(t.views)}),(0,i.jsx)("td",{children:Y(t.visitors)}),(0,i.jsx)("td",{children:t.avgEngaged})]})}),(0,i.jsx)("tfoot",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:(0,p.__)("Page Views","wp-parsely")}),(0,i.jsx)("th",{children:(0,p.__)("Visitors","wp-parsely")}),(0,i.jsx)("th",{children:(0,p.__)("Avg. Time","wp-parsely")})]})})]})})}function we(e){var t=e.data;delete t.referrers.types.totals;var n=function(e){switch(e){case"social":return(0,p.__)("Social","wp-parsely");case"search":return(0,p.__)("Search","wp-parsely");case"other":return(0,p.__)("Other","wp-parsely");case"internal":return(0,p.__)("Internal","wp-parsely");case"direct":return(0,p.__)("Direct","wp-parsely")}return e};return(0,i.jsxs)("div",{className:"section referrer-types",children:[(0,i.jsx)("div",{className:"section-title",children:(0,p.__)("Referrers (Page Views)","wp-parsely")}),(0,i.jsx)("div",{className:"multi-percentage-bar",children:Object.entries(t.referrers.types).map((function(e){var t=e[0],r=e[1],s=(0,p.sprintf)(/* translators: 1: Referrer type, 2: Percentage value, %%: Escaped percent sign */ -(0,p.__)("%1$s: %2$s%%","wp-parsely"),n(t),r.viewsPercentage);return(0,i.jsx)("div",{"aria-label":s,className:"bar-fill "+t,style:{width:r.viewsPercentage+"%"}},t)}))}),(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:Object.keys(t.referrers.types).map((function(e){return(0,i.jsx)("th",{children:n(e)},e)}))})}),(0,i.jsx)("tbody",{children:(0,i.jsx)("tr",{children:Object.entries(t.referrers.types).map((function(e){var t=e[0],n=e[1];return(0,i.jsx)("td",{children:Y(n.views)},t)}))})})]})]})}function me(e){var t=e.data,n=0;return(0,i.jsxs)("div",{className:"section top-referrers",children:[(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{scope:"col",children:(0,p.__)("Top Referrers","wp-parsely")}),(0,i.jsx)("th",{colSpan:2,scope:"colgroup",children:(0,p.__)("Page Views","wp-parsely")})]})}),(0,i.jsx)("tbody",{children:Object.entries(t.referrers.top).map((function(e){var t=e[0],r=e[1];if("totals"===t)return n=Number(r.viewsPercentage),null;var s=t;"direct"===t&&(s=(0,p.__)("Direct","wp-parsely")) -/* translators: %s: Percentage value, %%: Escaped percent sign */;var a=(0,p.sprintf)((0,p.__)("%s%%","wp-parsely"),r.viewsPercentage);return(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{scope:"row",children:s}),(0,i.jsx)("td",{children:(0,i.jsx)("div",{"aria-label":a,className:"percentage-bar",style:{"--bar-fill":r.viewsPercentage+"%"}})}),(0,i.jsx)("td",{children:Y(r.views)})]},t)}))})]}),(0,i.jsxs)("div",{children:[" ",/* translators: %s: Percentage value, %%: Escaped percent sign */ -(0,p.sprintf)((0,p._n)("%s%% of views came from top referrers.","%s%% of views came from top referrers.",n,"wp-parsely"),n)]})]})}function _e(e){var t=e.data,n=(0,i.jsxs)("span",{className:"screen-reader-text",children:[" ",(0,p.__)("(opens in new tab)","wp-parsely")]});return(0,i.jsxs)("div",{className:"section actions",children:[(0,i.jsxs)(s.Button,{href:t.url,rel:"noopener",target:"_blank",variant:"secondary",children:[(0,p.__)("Visit Post","wp-parsely"),n]}),(0,i.jsxs)(s.Button,{href:t.dashUrl,rel:"noopener",target:"_blank",variant:"primary",children:[(0,p.__)("View in Parse.ly","wp-parsely"),n]})]})}var be=function(e){var t=e.filter,n=e.label,s=e.onFilterTypeChange,a=e.onFilterValueChange,o=e.postData,l=function(){return o.tags.length>=1&&o.categories.length>=1||o.tags.length>=1&&o.authors.length>=1||o.categories.length>=1&&o.authors.length>=1},c=function(){return r.Tag===t.type&&o.tags.length>1||r.Section===t.type&&o.categories.length>1||r.Author===t.type&&o.authors.length>1},u=c()&&!l();return(0,i.jsxs)(i.Fragment,{children:[l()&&(0,i.jsx)(xe,{filter:t,label:u?void 0:n,onFilterTypeChange:s,postData:o}),c()&&(0,i.jsx)(je,{filter:t,label:u?n:void 0,onFilterValueChange:a,postData:o})]})},xe=function(e){var t=e.filter,n=e.label,a=e.onFilterTypeChange,o=e.postData;return(0,i.jsxs)(s.SelectControl,{label:n,onChange:function(e){return a(e)},value:t.type,children:[o.tags.length>=1&&(0,i.jsx)("option",{value:r.Tag,children:(0,p.__)("Tag","wp-parsely")}),o.categories.length>=1&&(0,i.jsx)("option",{value:r.Section,children:(0,p.__)("Section","wp-parsely")}),o.authors.length>=1&&(0,i.jsx)("option",{value:r.Author,children:(0,p.__)("Author","wp-parsely")})]})},je=function(e){var t=e.filter,n=e.label,a=e.onFilterValueChange,o=e.postData;return(0,i.jsx)(s.ComboboxControl,{label:n,onChange:function(e){return a(e)},options:r.Tag===t.type?o.tags.map((function(e){return{value:e,label:e}})):r.Section===t.type?o.categories.map((function(e){return{value:e,label:e}})):r.Author===t.type?o.authors.map((function(e){return{value:e,label:e}})):[],value:t.value})},Pe=function(){return(0,i.jsx)(s.SVG,{"aria-hidden":"true",version:"1.1",viewBox:"0 0 15 15",width:"15",height:"15",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(s.Path,{d:"M0 14.0025V11.0025L7.5 3.5025L10.5 6.5025L3 14.0025H0ZM12 5.0025L13.56 3.4425C14.15 2.8525 14.15 1.9025 13.56 1.3225L12.68 0.4425C12.09 -0.1475 11.14 -0.1475 10.56 0.4425L9 2.0025L12 5.0025Z"})})},Te=function(){return(0,i.jsxs)(s.SVG,{"aria-hidden":"true",version:"1.1",viewBox:"0 0 16 16",width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(s.Path,{d:"M0 3.29592C0 2.73237 0.456853 2.27551 1.02041 2.27551H4.08165C4.50432 2.27551 4.84696 2.61815 4.84696 3.04082C4.84696 3.46349 4.50432 3.80613 4.08165 3.80613H1.53062V11.9694H9.69391V9.6735C9.69391 9.25083 10.0366 8.90819 10.4592 8.90819C10.8819 8.90819 11.2245 9.25083 11.2245 9.6735V12.4796C11.2245 13.0432 10.7677 13.5 10.2041 13.5H1.02041C0.456854 13.5 0 13.0432 0 12.4796V3.29592Z"}),(0,i.jsx)(s.Path,{d:"M12.531 1.22415C12.8299 1.52303 12.8299 2.00759 12.531 2.30646L6.15342 8.68404C5.85455 8.98291 5.36998 8.98291 5.07111 8.68404C4.77224 8.38517 4.77224 7.9006 5.07111 7.60173L11.4487 1.22415C11.7476 0.925282 12.2321 0.925282 12.531 1.22415Z"}),(0,i.jsx)(s.Path,{d:"M6.63268 1.51012C6.63268 1.08745 6.97532 0.744812 7.39799 0.744812H12.2449C12.6676 0.744812 13.0103 1.08745 13.0103 1.51012V6.35708C13.0103 6.77975 12.6676 7.12239 12.2449 7.12239C11.8223 7.12239 11.4796 6.77975 11.4796 6.35708V2.27543H7.39799C6.97532 2.27543 6.63268 1.93279 6.63268 1.51012Z"})]})},Se=function(){return(0,i.jsx)(s.SVG,{"aria-hidden":"true",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 42 42",children:(0,i.jsx)(s.Path,{d:"M15.3,20.1c0,3.1,2.6,5.7,5.7,5.7s5.7-2.6,5.7-5.7s-2.6-5.7-5.7-5.7S15.3,17,15.3,20.1z M23.4,32.4\n\t\t\tC30.1,30.9,40.5,22,40.5,22s-7.7-12-18-13.3c-0.6-0.1-2.6-0.1-3-0.1c-10,1-18,13.7-18,13.7s8.7,8.6,17,9.9\n\t\t\tC19.4,32.6,22.4,32.6,23.4,32.4z M11.1,20.7c0-5.2,4.4-9.4,9.9-9.4s9.9,4.2,9.9,9.4S26.5,30,21,30S11.1,25.8,11.1,20.7z"})})};function Ee(e){var t=e.metric,n=e.post,r=e.avgEngagedIcon,s=e.viewsIcon;return"views"===t?(0,i.jsxs)("span",{className:"parsely-top-post-metric-data",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Number of Views","wp-parsely")}),s,Y(n.views.toString())]}):"avg_engaged"===t?(0,i.jsxs)("span",{className:"parsely-top-post-metric-data",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Average Time","wp-parsely")}),r,n.avgEngaged]}):(0,i.jsx)("span",{className:"parsely-top-post-metric-data",children:"-"})}function Ce(e){var t,n=e.metric,r=e.post;return(0,i.jsxs)("li",{className:"parsely-top-post","data-testid":"parsely-top-post",children:[(0,i.jsxs)("div",{className:"parsely-top-post-title",children:[(0,i.jsxs)("a",{className:"parsely-top-post-stats-link",href:r.dashUrl,target:"_blank",rel:"noreferrer",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("View in Parse.ly (opens new tab)","wp-parsely")}),r.title]}),(0,i.jsxs)("a",{className:"parsely-top-post-view-link",href:r.url,target:"_blank",rel:"noreferrer",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("View Post (opens new tab)","wp-parsely")}),(0,i.jsx)(Te,{})]}),0!==r.postId&&(0,i.jsxs)("a",{className:"parsely-top-post-edit-link",href:(t=r.postId,"/wp-admin/post.php?post=".concat(t,"&action=edit")),target:"_blank",rel:"noreferrer",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Edit Post (opens new tab)","wp-parsely")}),(0,i.jsx)(Pe,{})]})]}),(0,i.jsxs)("p",{className:"parsely-top-post-info",children:[(0,i.jsxs)("span",{className:"parsely-top-post-date",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Date","wp-parsely")}),ae(new Date(r.date))]}),(0,i.jsxs)("span",{className:"parsely-top-post-author",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Author","wp-parsely")}),r.author]}),(0,i.jsx)(Ee,{metric:n,post:r,viewsIcon:(0,i.jsx)(Se,{}),avgEngagedIcon:(0,i.jsx)(s.Dashicon,{icon:"clock"})})]})]})}var Ne=function(){return Ne=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=1e4&&(clearInterval(s),n("Telemetry library not loaded"))}),100);else n("Telemetry not enabled")}))},e.prototype.trackEvent=function(t,n){var r;this.isLoaded?(0!==t.indexOf(e.TRACKS_PREFIX)&&(t=e.TRACKS_PREFIX+t),this.isEventNameValid(t)?(n=this.prepareProperties(n),null===(r=this._tkq)||void 0===r||r.push(["recordEvent",t,n])):console.error("Error tracking event: Invalid event name")):console.error("Error tracking event: Telemetry not loaded")},e.prototype.isTelemetryEnabled=function(){return this.isEnabled},e.prototype.isProprietyValid=function(t){return e.PROPERTY_REGEX.test(t)},e.prototype.isEventNameValid=function(t){return e.EVENT_NAME_REGEX.test(t)},e.prototype.prepareProperties=function(e){return(e=this.sanitizeProperties(e)).parsely_version=wpParselyTracksTelemetry.version,wpParselyTracksTelemetry.user&&(e._ut=wpParselyTracksTelemetry.user.type,e._ui=wpParselyTracksTelemetry.user.id),wpParselyTracksTelemetry.vipgo_env&&(e.vipgo_env=wpParselyTracksTelemetry.vipgo_env),this.sanitizeProperties(e)},e.prototype.sanitizeProperties=function(e){var t=this,n={};return Object.keys(e).forEach((function(r){t.isProprietyValid(r)&&(n[r]=e[r])})),n},e.TRACKS_PREFIX="wpparsely_",e.EVENT_NAME_REGEX=/^(([a-z0-9]+)_){2}([a-z0-9_]+)$/,e.PROPERTY_REGEX=/^[a-z_][a-z0-9_]*$/,e}(),h=(f.trackEvent,function(e){var t=e.text,n=void 0===t?(0,p.__)("Beta","wp-parsely"):t,r=e.color,s=void 0===r?"var(--parsely-green)":r,a=e.fontSize,o={backgroundColor:s,fontSize:void 0===a?"0.75rem":a};return(0,i.jsx)("div",{className:"wp-parsely-beta-badge",style:o,children:n})}),g=(0,u.forwardRef)((function({icon:e,size:t=24,...n},r){return(0,u.cloneElement)(e,{width:t,height:t,...n,ref:r})})),y=n(196),v=window.wp.primitives,m=(0,y.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,y.createElement)(v.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),w=function(){return(0,i.jsxs)(s.SVG,{"aria-hidden":"true",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[(0,i.jsx)(s.G,{transform:"matrix(1, 0, 0, 1, 1.7763568394002505e-15, 0)"}),(0,i.jsx)(s.Path,{d:"M 16.693 6.167 A 4.541 4.541 0 0 1 12.152 10.708 A 4.541 4.541 0 0 1 7.611 6.167 A 4.541 4.541 0 0 1 12.152 1.626 A 4.541 4.541 0 0 1 16.693 6.167 Z",style:{fill:"rgba(216, 216, 216, 0)",fillOpacity:0,strokeWidth:"2.5px",stroke:"rgb(0, 0, 0)"}}),(0,i.jsx)(s.Path,{d:"M 3.016 23.76 L 3.0135 22.4385 C 3.0109999999999997 21.117 3.0060000000000002 18.474 3.3204999999999996 16.911 C 3.635 15.347999999999999 4.268999999999999 14.865 7.068666666666666 14.6235 C 9.868333333333332 14.382 14.833666666666666 14.382 17.585833333333333 14.658 C 20.337999999999997 14.934 20.877 15.485999999999999 21.1465 17.0435 C 21.416 18.601 21.416 21.164 21.416 22.4455 L 21.416 23.727",style:{fillOpacity:0,fill:"rgb(255, 255, 255)",strokeWidth:"2.5px",stroke:"rgb(0, 0, 0)"}})]})},_={journalist:{label:(0,p.__)("Journalist","wp-parsely"),emoji:"📰"},editorialWriter:{label:(0,p.__)("Editorial Writer","wp-parsely"),emoji:"✍️"},investigativeReporter:{label:(0,p.__)("Investigative Reporter","wp-parsely"),emoji:"🕵️"},techAnalyst:{label:(0,p.__)("Tech Analyst","wp-parsely"),emoji:"💻"},businessAnalyst:{label:(0,p.__)("Business Analyst","wp-parsely"),emoji:"📈"},culturalCommentator:{label:(0,p.__)("Cultural Commentator","wp-parsely"),emoji:"🌍"},scienceCorrespondent:{label:(0,p.__)("Science Correspondent","wp-parsely"),emoji:"🔬"},politicalAnalyst:{label:(0,p.__)("Political Analyst","wp-parsely"),emoji:"🏛️"},healthWellnessAdvocate:{label:(0,p.__)("Health and Wellness Advocate","wp-parsely"),emoji:"🍏"},environmentalJournalist:{label:(0,p.__)("Environmental Journalist","wp-parsely"),emoji:"🌳"},custom:{label:(0,p.__)("Use a custom persona","wp-parsely"),emoji:"🔧"}},b=Object.keys(_),x=function(e){return"custom"===e||""===e?_.custom.label:S(e)?e:_[e].label},S=function(e){return!b.includes(e)||"custom"===e},j=function(e){var t=e.value,n=e.onChange,r=(0,u.useState)(""),a=r[0],o=r[1];return(0,i.jsx)("div",{className:"parsely-persona-selector-custom",children:(0,i.jsx)(s.TextControl,{value:a||t,onChange:function(e){n(e),o(e)},help:(0,p.__)("Enter a custom persona","wp-parsely")})})},k=function(e){var t=e.persona,n=e.label,r=void 0===n?(0,p.__)("Select a persona","wp-parsely"):n,a=e.onChange,o=e.onDropdownChange,l=e.disabled,c=void 0!==l&&l,u=e.allowCustom,d=void 0!==u&&u;return(0,i.jsxs)(s.Disabled,{isDisabled:c,children:[(0,i.jsx)(s.DropdownMenu,{label:(0,p.__)("Persona","wp-parsely"),icon:w,className:"parsely-persona-selector-dropdown"+(c?" is-disabled":""),popoverProps:{className:"wp-parsely-popover"},toggleProps:{children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"parsely-persona-selector-label",children:r}),(0,i.jsx)(g,{icon:m})]})},children:function(e){var n=e.onClose;return(0,i.jsx)(s.MenuGroup,{label:(0,p.__)("Select a persona","wp-parsely"),children:(0,i.jsx)(i.Fragment,{children:b.map((function(e){if(!d&&"custom"===e)return null;var r=_[e];return(0,i.jsxs)(s.MenuItem,{isSelected:e===t,className:e===t?"is-selected":"",role:"menuitemradio",onClick:function(){null==o||o(e),a(e),n()},children:[r.emoji," ",r.label]},e)}))})})}}),d&&S(t)&&(0,i.jsx)(j,{onChange:function(e){a(""!==e?e:"custom")},value:"custom"===t?"":t})]})},P=(0,y.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,y.createElement)(v.Path,{fillRule:"evenodd",d:"M6.863 13.644L5 13.25h-.5a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5H5L18 6.5h2V16h-2l-3.854-.815.026.008a3.75 3.75 0 01-7.31-1.549zm1.477.313a2.251 2.251 0 004.356.921l-4.356-.921zm-2.84-3.28L18.157 8h.343v6.5h-.343L5.5 11.823v-1.146z",clipRule:"evenodd"})),T={neutral:{label:(0,p.__)("Neutral","wp-parsely"),emoji:"😐"},formal:{label:(0,p.__)("Formal","wp-parsely"),emoji:"🎩"},humorous:{label:(0,p.__)("Humorous","wp-parsely"),emoji:"😂"},confident:{label:(0,p.__)("Confident","wp-parsely"),emoji:"😎"},provocative:{label:(0,p.__)("Provocative","wp-parsely"),emoji:"😈"},serious:{label:(0,p.__)("Serious","wp-parsely"),emoji:"🧐"},inspirational:{label:(0,p.__)("Inspirational","wp-parsely"),emoji:"✨"},skeptical:{label:(0,p.__)("Skeptical","wp-parsely"),emoji:"🤨"},conversational:{label:(0,p.__)("Conversational","wp-parsely"),emoji:"💬"},analytical:{label:(0,p.__)("Analytical","wp-parsely"),emoji:"🤓"},custom:{label:(0,p.__)("Use a custom tone","wp-parsely"),emoji:"🔧"}},E=Object.keys(T),L=function(e){return"custom"===e||""===e?T.custom.label:C(e)?e:T[e].label},C=function(e){return!E.includes(e)||"custom"===e},O=function(e){var t=e.value,n=e.onChange,r=(0,u.useState)(""),a=r[0],o=r[1];return(0,i.jsx)("div",{className:"parsely-tone-selector-custom",children:(0,i.jsx)(s.TextControl,{value:a||t,onChange:function(e){n(e),o(e)},help:(0,p.__)("Enter a custom tone","wp-parsely")})})},N=function(e){var t=e.tone,n=e.label,r=void 0===n?(0,p.__)("Select a tone","wp-parsely"):n,a=e.onChange,o=e.onDropdownChange,l=e.disabled,c=void 0!==l&&l,u=e.allowCustom,d=void 0!==u&&u;return(0,i.jsxs)(s.Disabled,{isDisabled:c,children:[(0,i.jsx)(s.DropdownMenu,{label:(0,p.__)("Tone","wp-parsely"),icon:P,className:"parsely-tone-selector-dropdown"+(c?" is-disabled":""),popoverProps:{className:"wp-parsely-popover"},toggleProps:{children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"parsely-tone-selector-label",children:r}),(0,i.jsx)(g,{icon:m})]})},children:function(e){var n=e.onClose;return(0,i.jsx)(s.MenuGroup,{label:(0,p.__)("Select a tone","wp-parsely"),children:(0,i.jsx)(i.Fragment,{children:E.map((function(e){if(!d&&"custom"===e)return null;var r=T[e];return(0,i.jsxs)(s.MenuItem,{isSelected:e===t,className:e===t?"is-selected":"",role:"menuitemradio",onClick:function(){null==o||o(e),a(e),n()},children:[r.emoji," ",r.label]},e)}))})})}}),d&&C(t)&&(0,i.jsx)(O,{onChange:function(e){a(""!==e?e:"custom")},value:"custom"===t?"":t})]})},A=function(e){var t=e.size,n=void 0===t?24:t,r=e.className,a=void 0===r?"wp-parsely-icon":r;return(0,i.jsxs)(s.SVG,{className:a,height:n,viewBox:"0 0 60 65",width:n,xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M23.72,51.53c0-.18,0-.34-.06-.52a13.11,13.11,0,0,0-2.1-5.53A14.74,14.74,0,0,0,19.12,43c-.27-.21-.5-.11-.51.22l-.24,3.42c0,.33-.38.35-.49,0l-1.5-4.8a1.4,1.4,0,0,0-.77-.78,23.91,23.91,0,0,0-3.1-.84c-1.38-.24-3.39-.39-3.39-.39-.34,0-.45.21-.25.49l2.06,3.76c.2.27,0,.54-.29.33l-4.51-3.6a3.68,3.68,0,0,0-2.86-.48c-1,.16-2.44.46-2.44.46a.68.68,0,0,0-.39.25.73.73,0,0,0-.14.45S.41,43,.54,44a3.63,3.63,0,0,0,1.25,2.62L6.48,50c.28.2.09.49-.23.37l-4.18-.94c-.32-.12-.5,0-.4.37,0,0,.69,1.89,1.31,3.16a24,24,0,0,0,1.66,2.74,1.34,1.34,0,0,0,1,.52l5,.13c.33,0,.41.38.1.48L7.51,58c-.31.1-.34.35-.07.55a14.29,14.29,0,0,0,3.05,1.66,13.09,13.09,0,0,0,5.9.5,25.13,25.13,0,0,0,4.34-1,9.55,9.55,0,0,1-.08-1.2,9.32,9.32,0,0,1,3.07-6.91"}),(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M59.7,41.53a.73.73,0,0,0-.14-.45.68.68,0,0,0-.39-.25s-1.43-.3-2.44-.46a3.64,3.64,0,0,0-2.86.48l-4.51,3.6c-.26.21-.49-.06-.29-.33l2.06-3.76c.2-.28.09-.49-.25-.49,0,0-2,.15-3.39.39a23.91,23.91,0,0,0-3.1.84,1.4,1.4,0,0,0-.77.78l-1.5,4.8c-.11.32-.48.3-.49,0l-.24-3.42c0-.33-.24-.43-.51-.22a14.74,14.74,0,0,0-2.44,2.47A13.11,13.11,0,0,0,36.34,51c0,.18,0,.34-.06.52a9.26,9.26,0,0,1,3,8.1,24.1,24.1,0,0,0,4.34,1,13.09,13.09,0,0,0,5.9-.5,14.29,14.29,0,0,0,3.05-1.66c.27-.2.24-.45-.07-.55l-3.22-1.17c-.31-.1-.23-.47.1-.48l5-.13a1.38,1.38,0,0,0,1-.52A24.6,24.6,0,0,0,57,52.92c.61-1.27,1.31-3.16,1.31-3.16.1-.33-.08-.49-.4-.37l-4.18.94c-.32.12-.51-.17-.23-.37l4.69-3.34A3.63,3.63,0,0,0,59.46,44c.13-1,.24-2.47.24-2.47"}),(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M46.5,25.61c0-.53-.35-.72-.8-.43l-4.86,2.66c-.45.28-.56-.27-.23-.69l4.66-6.23a2,2,0,0,0,.28-1.68,36.51,36.51,0,0,0-2.19-4.89,34,34,0,0,0-2.81-3.94c-.33-.41-.74-.35-.91.16l-2.28,5.68c-.16.5-.6.48-.59-.05l.28-8.93a2.54,2.54,0,0,0-.66-1.64S35,4.27,33.88,3.27,30.78.69,30.78.69a1.29,1.29,0,0,0-1.54,0s-1.88,1.49-3.12,2.59-2.48,2.35-2.48,2.35A2.5,2.5,0,0,0,23,7.27l.27,8.93c0,.53-.41.55-.58.05l-2.29-5.69c-.17-.5-.57-.56-.91-.14a35.77,35.77,0,0,0-3,4.2,35.55,35.55,0,0,0-2,4.62,2,2,0,0,0,.27,1.67l4.67,6.24c.33.42.23,1-.22.69l-4.87-2.66c-.45-.29-.82-.1-.82.43a18.6,18.6,0,0,0,.83,5.07,20.16,20.16,0,0,0,5.37,7.77c3.19,3,5.93,7.8,7.45,11.08A9.6,9.6,0,0,1,30,49.09a9.31,9.31,0,0,1,2.86.45c1.52-3.28,4.26-8.11,7.44-11.09a20.46,20.46,0,0,0,5.09-7,19,19,0,0,0,1.11-5.82"}),(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M36.12,58.44A6.12,6.12,0,1,1,30,52.32a6.11,6.11,0,0,1,6.12,6.12"})]})},R=function(){return R=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=c){var u=t;(i=r/c)%1>1/o&&(u=i>10?1:2),u=parseFloat(i.toFixed(2))===parseFloat(i.toFixed(0))?0:u,s=i.toFixed(u),a=l}o=c})),s+n+a}var Z,J,ee=window.wp.url,te=(Z=function(e,t){return Z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Z(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}Z(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});!function(e){e.CannotFormulateApiQuery="ch_cannot_formulate_api_query",e.FetchError="fetch_error",e.HttpRequestFailed="http_request_failed",e[e.ParselyApiForbidden=403]="ParselyApiForbidden",e.ParselyApiResponseContainsError="ch_response_contains_error",e.ParselyApiReturnedNoData="ch_parsely_api_returned_no_data",e.ParselyApiReturnedTooManyResults="ch_parsely_api_returned_too_many_results",e[e.ParselyApiUnauthorized=401]="ParselyApiUnauthorized",e[e.ParselyInternalServerError=500]="ParselyInternalServerError",e.PluginCredentialsNotSetMessageDetected="parsely_credentials_not_set_message_detected",e.PluginSettingsApiSecretNotSet="parsely_api_secret_not_set",e.PluginSettingsSiteIdNotSet="parsely_site_id_not_set",e.PostIsNotPublished="ch_post_not_published"}(J||(J={}));var ne=function(e){function t(n,r,i){void 0===i&&(i=(0,p.__)("Error: ","wp-parsely"));var s=e.call(this,i+n)||this;s.hint=null,s.name=s.constructor.name,s.code=r;var a=[J.ParselyApiForbidden,J.ParselyApiResponseContainsError,J.ParselyApiReturnedNoData,J.ParselyApiReturnedTooManyResults,J.ParselyApiUnauthorized,J.PluginCredentialsNotSetMessageDetected,J.PluginSettingsApiSecretNotSet,J.PluginSettingsSiteIdNotSet,J.PostIsNotPublished];return s.retryFetch=!a.includes(s.code),Object.setPrototypeOf(s,t.prototype),s.code===J.ParselyApiUnauthorized&&(s.message=(0,p.__)("This feature is accessible to select customers participating in its beta testing.","wp-parsely")),s.code===J.ParselyInternalServerError&&(s.message=(0,p.__)("The Parse.ly API returned an internal server error. Please try again later.","wp-parsely")),s.code===J.HttpRequestFailed&&s.message.includes("cURL error 28")&&(s.message=(0,p.__)("The Parse.ly API did not respond in a timely manner. Please try again later.","wp-parsely")),s}return te(t,e),t.prototype.Message=function(e){return void 0===e&&(e=null),[J.PluginCredentialsNotSetMessageDetected,J.PluginSettingsSiteIdNotSet,J.PluginSettingsApiSecretNotSet].includes(this.code)?K(e):(this.code===J.FetchError&&(this.hint=this.Hint((0,p.__)("This error can sometimes be caused by ad-blockers or browser tracking protections. Please add this site to any applicable allow lists and try again.","wp-parsely"))),this.code===J.ParselyApiForbidden&&(this.hint=this.Hint((0,p.__)("Please ensure that the Site ID and API Secret given in the plugin's settings are correct.","wp-parsely"))),this.code===J.HttpRequestFailed&&(this.hint=this.Hint((0,p.__)("The Parse.ly API cannot be reached. Please verify that you are online.","wp-parsely"))),(0,i.jsx)(q,{className:null==e?void 0:e.className,testId:"error",children:"

".concat(this.message,"

").concat(this.hint?this.hint:"")}))},t.prototype.Hint=function(e){return'

'.concat((0,p.__)("Hint:","wp-parsely")," ").concat(e,"

")},t}(Error),re={month:"short",day:"numeric",year:"numeric"},ie={month:"short",day:"numeric"},se=(0,p.__)("Date N/A","wp-parsely");function ae(e){if(!1===function(e){return!isNaN(+e)&&0!==e.getTime()}(e))return se;var t=re;return e.getUTCFullYear()===(new Date).getUTCFullYear()&&(t=ie),Intl.DateTimeFormat(document.documentElement.lang||"en",t).format(e)}function oe(e){return{period_start:e,period_end:""}}var le=function(){return le=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1?[2,Promise.reject(new ne((0,p.sprintf)(/* translators: URL of the published post */ +(0,p.__)("Multiple results were returned for the post %s by the Parse.ly API.","wp-parsely"),t),J.ParselyApiReturnedTooManyResults))]:[2,n.data[0]]}}))}))},e.prototype.fetchReferrerDataFromWpEndpoint=function(e,t,n){return ce(this,void 0,void 0,(function(){var r,i;return ue(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,F()({path:(0,ee.addQueryArgs)("/wp-parsely/v1/referrers/post/detail",le(le({},oe(e)),{itm_source:this.itmSource,total_views:n,url:t}))})];case 1:return r=s.sent(),[3,3];case 2:return i=s.sent(),[2,Promise.reject(new ne(i.message,i.code))];case 3:return(null==r?void 0:r.error)?[2,Promise.reject(new ne(r.error.message,J.ParselyApiResponseContainsError))]:[2,r.data]}}))}))},e}(),de=function(){return de=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&e.retryFetch?[4,new Promise((function(e){return setTimeout(e,500)}))]:[3,3];case 1:return t.sent(),[4,r(i-1)];case 2:return t.sent(),[3,4];case 3:p(e),o(!1),t.label=4;case 4:return[2]}}))}))})),[2]}))}))};return o(!0),r(1),function(){p(void 0)}}),[n]),c?c.Message():a?(0,i.jsx)("div",{className:"parsely-spinner-wrapper","data-testid":"parsely-spinner-wrapper",children:(0,i.jsx)(s.Spinner,{})}):(0,i.jsx)(ye,{data:f,period:n})}function ye(e){return(0,i.jsxs)("div",{className:"performance-details-panel",children:[(0,i.jsx)("div",{className:"section period",children:W(e.period)}),(0,i.jsx)(ve,de({},e)),(0,i.jsx)(me,de({},e)),(0,i.jsx)(we,de({},e)),(0,i.jsx)(_e,de({},e))]})}function ve(e){var t=e.data;return(0,i.jsx)("div",{className:"section general-performance",children:(0,i.jsxs)("table",{children:[(0,i.jsx)("tbody",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:X(t.views)}),(0,i.jsx)("td",{children:X(t.visitors)}),(0,i.jsx)("td",{children:t.avgEngaged})]})}),(0,i.jsx)("tfoot",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:(0,p.__)("Page Views","wp-parsely")}),(0,i.jsx)("th",{children:(0,p.__)("Visitors","wp-parsely")}),(0,i.jsx)("th",{children:(0,p.__)("Avg. Time","wp-parsely")})]})})]})})}function me(e){var t=e.data;delete t.referrers.types.totals;var n=function(e){switch(e){case"social":return(0,p.__)("Social","wp-parsely");case"search":return(0,p.__)("Search","wp-parsely");case"other":return(0,p.__)("Other","wp-parsely");case"internal":return(0,p.__)("Internal","wp-parsely");case"direct":return(0,p.__)("Direct","wp-parsely")}return e};return(0,i.jsxs)("div",{className:"section referrer-types",children:[(0,i.jsx)("div",{className:"section-title",children:(0,p.__)("Referrers (Page Views)","wp-parsely")}),(0,i.jsx)("div",{className:"multi-percentage-bar",children:Object.entries(t.referrers.types).map((function(e){var t=e[0],r=e[1],s=(0,p.sprintf)(/* translators: 1: Referrer type, 2: Percentage value, %%: Escaped percent sign */ +(0,p.__)("%1$s: %2$s%%","wp-parsely"),n(t),r.viewsPercentage);return(0,i.jsx)("div",{"aria-label":s,className:"bar-fill "+t,style:{width:r.viewsPercentage+"%"}},t)}))}),(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:Object.keys(t.referrers.types).map((function(e){return(0,i.jsx)("th",{children:n(e)},e)}))})}),(0,i.jsx)("tbody",{children:(0,i.jsx)("tr",{children:Object.entries(t.referrers.types).map((function(e){var t=e[0],n=e[1];return(0,i.jsx)("td",{children:X(n.views)},t)}))})})]})]})}function we(e){var t=e.data,n=0;return(0,i.jsxs)("div",{className:"section top-referrers",children:[(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{scope:"col",children:(0,p.__)("Top Referrers","wp-parsely")}),(0,i.jsx)("th",{colSpan:2,scope:"colgroup",children:(0,p.__)("Page Views","wp-parsely")})]})}),(0,i.jsx)("tbody",{children:Object.entries(t.referrers.top).map((function(e){var t=e[0],r=e[1];if("totals"===t)return n=Number(r.viewsPercentage),null;var s=t;"direct"===t&&(s=(0,p.__)("Direct","wp-parsely")) +/* translators: %s: Percentage value, %%: Escaped percent sign */;var a=(0,p.sprintf)((0,p.__)("%s%%","wp-parsely"),r.viewsPercentage);return(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{scope:"row",children:s}),(0,i.jsx)("td",{children:(0,i.jsx)("div",{"aria-label":a,className:"percentage-bar",style:{"--bar-fill":r.viewsPercentage+"%"}})}),(0,i.jsx)("td",{children:X(r.views)})]},t)}))})]}),(0,i.jsxs)("div",{children:[" ",/* translators: %s: Percentage value, %%: Escaped percent sign */ +(0,p.sprintf)((0,p._n)("%s%% of views came from top referrers.","%s%% of views came from top referrers.",n,"wp-parsely"),n)]})]})}function _e(e){var t=e.data,n=(0,i.jsxs)("span",{className:"screen-reader-text",children:[" ",(0,p.__)("(opens in new tab)","wp-parsely")]});return(0,i.jsxs)("div",{className:"section actions",children:[(0,i.jsxs)(s.Button,{href:t.url,rel:"noopener",target:"_blank",variant:"secondary",children:[(0,p.__)("Visit Post","wp-parsely"),n]}),(0,i.jsxs)(s.Button,{href:t.dashUrl,rel:"noopener",target:"_blank",variant:"primary",children:[(0,p.__)("View in Parse.ly","wp-parsely"),n]})]})}var be=function(e){var t=e.filter,n=e.label,s=e.onFilterTypeChange,a=e.onFilterValueChange,o=e.postData,l=function(){return o.tags.length>=1&&o.categories.length>=1||o.tags.length>=1&&o.authors.length>=1||o.categories.length>=1&&o.authors.length>=1},c=function(){return r.Tag===t.type&&o.tags.length>1||r.Section===t.type&&o.categories.length>1||r.Author===t.type&&o.authors.length>1},u=c()&&!l();return(0,i.jsxs)(i.Fragment,{children:[l()&&(0,i.jsx)(xe,{filter:t,label:u?void 0:n,onFilterTypeChange:s,postData:o}),c()&&(0,i.jsx)(Se,{filter:t,label:u?n:void 0,onFilterValueChange:a,postData:o})]})},xe=function(e){var t=e.filter,n=e.label,a=e.onFilterTypeChange,o=e.postData;return(0,i.jsxs)(s.SelectControl,{label:n,onChange:function(e){return a(e)},value:t.type,children:[o.tags.length>=1&&(0,i.jsx)("option",{value:r.Tag,children:(0,p.__)("Tag","wp-parsely")}),o.categories.length>=1&&(0,i.jsx)("option",{value:r.Section,children:(0,p.__)("Section","wp-parsely")}),o.authors.length>=1&&(0,i.jsx)("option",{value:r.Author,children:(0,p.__)("Author","wp-parsely")})]})},Se=function(e){var t=e.filter,n=e.label,a=e.onFilterValueChange,o=e.postData;return(0,i.jsx)(s.ComboboxControl,{label:n,onChange:function(e){return a(e)},options:r.Tag===t.type?o.tags.map((function(e){return{value:e,label:e}})):r.Section===t.type?o.categories.map((function(e){return{value:e,label:e}})):r.Author===t.type?o.authors.map((function(e){return{value:e,label:e}})):[],value:t.value})},je=function(){return(0,i.jsx)(s.SVG,{"aria-hidden":"true",version:"1.1",viewBox:"0 0 15 15",width:"15",height:"15",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(s.Path,{d:"M0 14.0025V11.0025L7.5 3.5025L10.5 6.5025L3 14.0025H0ZM12 5.0025L13.56 3.4425C14.15 2.8525 14.15 1.9025 13.56 1.3225L12.68 0.4425C12.09 -0.1475 11.14 -0.1475 10.56 0.4425L9 2.0025L12 5.0025Z"})})},ke=function(){return(0,i.jsxs)(s.SVG,{"aria-hidden":"true",version:"1.1",viewBox:"0 0 16 16",width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(s.Path,{d:"M0 3.29592C0 2.73237 0.456853 2.27551 1.02041 2.27551H4.08165C4.50432 2.27551 4.84696 2.61815 4.84696 3.04082C4.84696 3.46349 4.50432 3.80613 4.08165 3.80613H1.53062V11.9694H9.69391V9.6735C9.69391 9.25083 10.0366 8.90819 10.4592 8.90819C10.8819 8.90819 11.2245 9.25083 11.2245 9.6735V12.4796C11.2245 13.0432 10.7677 13.5 10.2041 13.5H1.02041C0.456854 13.5 0 13.0432 0 12.4796V3.29592Z"}),(0,i.jsx)(s.Path,{d:"M12.531 1.22415C12.8299 1.52303 12.8299 2.00759 12.531 2.30646L6.15342 8.68404C5.85455 8.98291 5.36998 8.98291 5.07111 8.68404C4.77224 8.38517 4.77224 7.9006 5.07111 7.60173L11.4487 1.22415C11.7476 0.925282 12.2321 0.925282 12.531 1.22415Z"}),(0,i.jsx)(s.Path,{d:"M6.63268 1.51012C6.63268 1.08745 6.97532 0.744812 7.39799 0.744812H12.2449C12.6676 0.744812 13.0103 1.08745 13.0103 1.51012V6.35708C13.0103 6.77975 12.6676 7.12239 12.2449 7.12239C11.8223 7.12239 11.4796 6.77975 11.4796 6.35708V2.27543H7.39799C6.97532 2.27543 6.63268 1.93279 6.63268 1.51012Z"})]})},Pe=function(){return(0,i.jsx)(s.SVG,{"aria-hidden":"true",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 42 42",children:(0,i.jsx)(s.Path,{d:"M15.3,20.1c0,3.1,2.6,5.7,5.7,5.7s5.7-2.6,5.7-5.7s-2.6-5.7-5.7-5.7S15.3,17,15.3,20.1z M23.4,32.4\n\t\t\tC30.1,30.9,40.5,22,40.5,22s-7.7-12-18-13.3c-0.6-0.1-2.6-0.1-3-0.1c-10,1-18,13.7-18,13.7s8.7,8.6,17,9.9\n\t\t\tC19.4,32.6,22.4,32.6,23.4,32.4z M11.1,20.7c0-5.2,4.4-9.4,9.9-9.4s9.9,4.2,9.9,9.4S26.5,30,21,30S11.1,25.8,11.1,20.7z"})})};function Te(e){var t=e.metric,n=e.post,r=e.avgEngagedIcon,s=e.viewsIcon;return"views"===t?(0,i.jsxs)("span",{className:"parsely-top-post-metric-data",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Number of Views","wp-parsely")}),s,X(n.views.toString())]}):"avg_engaged"===t?(0,i.jsxs)("span",{className:"parsely-top-post-metric-data",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Average Time","wp-parsely")}),r,n.avgEngaged]}):(0,i.jsx)("span",{className:"parsely-top-post-metric-data",children:"-"})}function Ee(e){var t,n=e.metric,r=e.post;return(0,i.jsxs)("li",{className:"parsely-top-post","data-testid":"parsely-top-post",children:[(0,i.jsxs)("div",{className:"parsely-top-post-title",children:[(0,i.jsxs)("a",{className:"parsely-top-post-stats-link",href:r.dashUrl,target:"_blank",rel:"noreferrer",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("View in Parse.ly (opens new tab)","wp-parsely")}),r.title]}),(0,i.jsxs)("a",{className:"parsely-top-post-view-link",href:r.url,target:"_blank",rel:"noreferrer",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("View Post (opens new tab)","wp-parsely")}),(0,i.jsx)(ke,{})]}),0!==r.postId&&(0,i.jsxs)("a",{className:"parsely-top-post-edit-link",href:(t=r.postId,"/wp-admin/post.php?post=".concat(t,"&action=edit")),target:"_blank",rel:"noreferrer",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Edit Post (opens new tab)","wp-parsely")}),(0,i.jsx)(je,{})]})]}),(0,i.jsxs)("p",{className:"parsely-top-post-info",children:[(0,i.jsxs)("span",{className:"parsely-top-post-date",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Date","wp-parsely")}),ae(new Date(r.date))]}),(0,i.jsxs)("span",{className:"parsely-top-post-author",children:[(0,i.jsx)("span",{className:"screen-reader-text",children:(0,p.__)("Author","wp-parsely")}),r.author]}),(0,i.jsx)(Te,{metric:n,post:r,viewsIcon:(0,i.jsx)(Pe,{}),avgEngagedIcon:(0,i.jsx)(s.Dashicon,{icon:"clock"})})]})]})}var Le=function(){return Le=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&n.retryFetch?[4,new Promise((function(e){return setTimeout(e,500)}))]:[3,3];case 1:return t.sent(),[4,s(e-1)];case 2:return t.sent(),[3,4];case 3:g(!1),m(n),t.label=4;case 4:return[2]}}))}))})),[2]}))}))},l=r.Tag===E.type,c=r.Unavailable===E.type,u=0===o.tags.length,p=l&&!o.tags.includes(E.value);return g(!0),c||l&&u?C((e="",i=r.Unavailable,o.tags.length>=1?(i=r.Tag,e=o.tags[0]):o.categories.length>=1?(i=r.Section,e=o.categories[0]):(i=r.Author,e=o.authors[0]),{type:i,value:e})):p?C({type:r.Tag,value:o.tags[0]}):s(1),function(){g(!1),T([]),x(""),m(void 0)}}),[a,n,E,o]);var k=(0,i.jsx)("div",{className:"parsely-spinner-wrapper","data-testid":"parsely-spinner-wrapper",children:(0,i.jsx)(s.Spinner,{})}),O=(0,i.jsx)(be,{filter:E,label:(0,p.__)("Filter by","wp-parsely"),onFilterTypeChange:function(e){if(U(e,r)){var t="",n=e;r.Tag===n&&(t=o.tags[0]),r.Section===n&&(t=o.categories[0]),r.Author===n&&(t=o.authors[0]),""!==t&&(N(n,t),C({type:n,value:t}),h.trackEvent("related_top_posts_filter_type_changed",{filter_type:n}))}},onFilterValueChange:function(e){"string"==typeof e&&(N(E.type,e),C(Re(Re({},E),{value:e})))},postData:o});return w?(0,i.jsxs)(i.Fragment,{children:[O,w.Message({className:"parsely-top-posts-descr"})]}):(0,i.jsxs)(i.Fragment,{children:[O,y?k:(0,i.jsxs)("div",{className:"parsely-top-posts-wrapper",children:[(0,i.jsx)("p",{className:"parsely-top-posts-descr","data-testid":"parsely-top-posts-descr",children:b}),(0,i.jsx)("ol",{className:"parsely-top-posts",children:P.map((function(e){return(0,i.jsx)(Ce,{metric:n,post:e},e.id)}))})]})]})}var Me,De=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,g.createElement)(v.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})),Ve=function(e){var t=e.isLoading,n=e.isOpen,r=e.onPersonaChange,a=e.onSettingChange,o=e.onToneChange,l=e.persona,c=e.tone,d=(0,u.useState)(n),f=d[0],y=d[1];return(0,i.jsxs)("div",{className:"parsely-write-titles-settings",children:[(0,i.jsxs)("div",{className:"parsely-write-titles-settings-header",children:[(0,i.jsx)(R,{size:20}),(0,i.jsx)(s.BaseControl,{id:"parsely-write-titles-settings",className:"parsely-write-titles-settings-header-label",label:(0,p.__)("Parse.ly AI Settings","wp-parsely"),children:(0,i.jsx)(s.Button,{label:(0,p.__)("Change Tone & Persona","wp-parsely"),icon:De,onClick:function(){a("TitleSuggestionsSettingsOpen",!f),y(!f),h.trackEvent("title_suggestions_ai_settings_toggled",{is_active:!f})},isPressed:f,size:"small"})})]}),f&&(0,i.jsxs)("div",{className:"parsely-write-titles-settings-body",children:[(0,i.jsx)(A,{tone:c,label:N(c),onChange:function(e){o(e)},onDropdownChange:function(e){h.trackEvent("title_suggestions_ai_tone_changed",{tone:e})},disabled:t,allowCustom:!0}),(0,i.jsx)(T,{persona:l,label:x(l),onChange:function(e){r(e)},onDropdownChange:function(e){h.trackEvent("title_suggestions_ai_persona_changed",{persona:e})},disabled:t,allowCustom:!0})]})]})},Ge=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),ze=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{d:"m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z"})),Be=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})),He=(0,g.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,g.createElement)(v.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})),Ue=function(){return Ue=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?"secondary":"primary",isBusy:m,onClick:function(){return Ke(void 0,void 0,void 0,(function(){return et(this,(function(e){switch(e.label){case 0:return!1!==m?[3,2]:(h.trackEvent("title_suggestions_generate_pressed",{request_more:_.length>0,total_titles:_.length,total_pinned:_.filter((function(e){return e.isPinned})).length,tone:d,persona:g}),[4,(t=Me.PostTitle,n=O,r=d,i=g,Ke(void 0,void 0,void 0,(function(){var e,s,a;return et(this,(function(o){switch(o.label){case 0:return[4,S(!0)];case 1:o.sent(),e=new Je,o.label=2;case 2:return o.trys.push([2,5,,6]),[4,e.generateTitles(n,3,r,i)];case 3:return s=o.sent(),[4,T(t,s)];case 4:return o.sent(),[3,6];case 5:return a=o.sent(),l(a),[3,6];case 6:return[4,S(!1)];case 7:return o.sent(),[2]}}))})))]);case 1:e.sent(),e.label=2;case 2:return[2]}var t,n,r,i}))}))},children:[m&&(0,p.__)("Generating Titles…","wp-parsely"),!m&&_.length>0&&(0,p.__)("Generate More","wp-parsely"),!m&&0===_.length&&(0,p.__)("Generate Titles","wp-parsely")]})}),I=(0,i.jsxs)("div",{className:"parsely-write-titles-title-suggestions-container",children:[void 0!==j&&(0,i.jsx)(Ye,{title:j,type:Me.PostTitle,isOriginal:!0}),_.map((function(e){return(0,i.jsx)(Ye,{title:e,type:Me.PostTitle},e.id)}))]}),F=(0,i.jsxs)("div",{className:"parsely-write-titles-accepted-title-container",children:[(0,i.jsx)("div",{className:"parsely-write-titles-text",children:(0,p.__)("Replace the current post title with the following?","wp-parsely")}),(0,i.jsx)("div",{className:"parsely-write-titles-accepted-title",children:null==b?void 0:b.title}),(0,i.jsxs)("div",{className:"parsely-write-titles-accepted-title-actions",children:[(0,i.jsx)(s.Button,{variant:"secondary",onClick:function(){var e;E(Me.PostTitle,void 0),h.trackEvent("title_suggestions_cancel_pressed",{original_title:A,canceled_title:null!==(e=null==b?void 0:b.title)&&void 0!==e?e:""})},children:(0,p.__)("Cancel","wp-parsely")}),(0,i.jsx)(s.Button,{variant:"primary",onClick:function(){return Ke(void 0,void 0,void 0,(function(){return et(this,(function(e){switch(e.label){case 0:return[4,C(Me.PostTitle,A)];case 1:return e.sent(),(0,o.dispatch)("core/editor").editPost({title:null==b?void 0:b.title}),b?[4,(0,o.dispatch)(Qe).pinTitle(Me.PostTitle,b)]:[3,3];case 2:e.sent(),h.trackEvent("title_suggestions_accept_pressed",{old_title:A,new_title:b.title}),e.label=3;case 3:return[4,E(Me.PostTitle,void 0)];case 4:return e.sent(),[2]}}))}))},children:(0,p.__)("Replace","wp-parsely")})]})]});return a?a.Message():(0,i.jsx)(s.PanelRow,{children:(0,i.jsxs)("div",{className:"parsely-write-titles-wrapper",children:[0===_.length&&void 0===b&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"parsely-write-titles-text",children:(0,p.__)("Use Parse.ly AI to generate a title for your post.","wp-parsely")}),R,L]}),0<_.length&&void 0===b&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"parsely-write-titles-text",children:(0,u.createInterpolateElement)( +message:(0,p.sprintf)((0,p.__)('by author "%1$s"',"wp-parsely"),n.value)};throw new ne((0,p.__)("No valid filter type has been specified.","wp-parsely"),J.CannotFormulateApiQuery)},e}(),Ae=function(){return Ae=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&n.retryFetch?[4,new Promise((function(e){return setTimeout(e,500)}))]:[3,3];case 1:return t.sent(),[4,s(e-1)];case 2:return t.sent(),[3,4];case 3:y(!1),w(n),t.label=4;case 4:return[2]}}))}))})),[2]}))}))},l=r.Tag===T.type,c=r.Unavailable===T.type,u=0===o.tags.length,p=l&&!o.tags.includes(T.value);return y(!0),c||l&&u?E((e="",i=r.Unavailable,o.tags.length>=1?(i=r.Tag,e=o.tags[0]):o.categories.length>=1?(i=r.Section,e=o.categories[0]):(i=r.Author,e=o.authors[0]),{type:i,value:e})):p?E({type:r.Tag,value:o.tags[0]}):s(1),function(){y(!1),k([]),x(""),w(void 0)}}),[a,n,T,o]);var C=(0,i.jsx)("div",{className:"parsely-spinner-wrapper","data-testid":"parsely-spinner-wrapper",children:(0,i.jsx)(s.Spinner,{})}),O=(0,i.jsx)(be,{filter:T,label:(0,p.__)("Filter by","wp-parsely"),onFilterTypeChange:function(e){if(U(e,r)){var t="",n=e;r.Tag===n&&(t=o.tags[0]),r.Section===n&&(t=o.categories[0]),r.Author===n&&(t=o.authors[0]),""!==t&&(L(n,t),E({type:n,value:t}),f.trackEvent("related_top_posts_filter_type_changed",{filter_type:n}))}},onFilterValueChange:function(e){"string"==typeof e&&(L(T.type,e),E(Ae(Ae({},T),{value:e})))},postData:o});return m?(0,i.jsxs)(i.Fragment,{children:[O,m.Message({className:"parsely-top-posts-descr"})]}):(0,i.jsxs)(i.Fragment,{children:[O,g?C:(0,i.jsxs)("div",{className:"parsely-top-posts-wrapper",children:[(0,i.jsx)("p",{className:"parsely-top-posts-descr","data-testid":"parsely-top-posts-descr",children:b}),(0,i.jsx)("ol",{className:"parsely-top-posts",children:j.map((function(e){return(0,i.jsx)(Ee,{metric:n,post:e},e.id)}))})]})]})}var Me=(0,y.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,y.createElement)(v.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,y.createElement)(v.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})),De=window.wp.blockEditor,Fe=window.wp.compose,Ve=window.wp.hooks,Ge=function(){return Ge=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)){var e={maxLinksPerPost:c.SmartLinkingMaxLinks,maxLinkWords:c.SmartLinkingMaxLinkWords,settingsOpen:c.SmartLinkingSettingsOpen};A(e)}}),[A,c]);var R=(0,o.useSelect)((function(e){var t=e("core/block-editor"),r=t.getSelectedBlock,i=t.getBlock,s=e("core/editor").getEditedPostContent;return{selectedBlock:n?i(n):r(),postContent:s()}}),[n]),I=R.selectedBlock,B=R.postContent;(0,u.useEffect)((function(){y(null)}),[I]);var M=function(e){return void 0===e&&(e="all"),nt(void 0,void 0,void 0,(function(){var t;return rt(this,(function(n){switch(n.label){case 0:return[4,N(e)];case 1:return n.sent(),a===tt.BlockInspector&&("all"===e||w?(t=(0,o.select)("core/block-editor").getBlockOrder()[0],(0,o.dispatch)("core/block-editor").selectBlock(t)):(0,o.dispatch)("core/block-editor").selectBlock(e)),0===_.length&&F(),[2]}}))}))},D=function(){(0,o.dispatch)("core/editor").lockPostSaving("wp-parsely-block-overlay"),document.querySelectorAll('.edit-post-header__settings>[type="button"]').forEach((function(e){e.setAttribute("disabled","disabled")}))},F=function(){document.querySelectorAll('.edit-post-header__settings>[type="button"]').forEach((function(e){e.removeAttribute("disabled")})),(0,o.dispatch)("core/editor").unlockPostSaving("wp-parsely-block-overlay")};return(0,i.jsx)("div",{className:"wp-parsely-smart-linking",children:(0,i.jsxs)(s.PanelRow,{className:t,children:[(0,i.jsxs)("div",{className:"wp-parsely-smart-linking-text",children:[(0,p.__)("Automatically insert links to your most relevant, top performing content.","wp-parsely")," ",(0,i.jsx)("a",{href:"https://docs.parse.ly/plugin-content-helper/#h-smart-linking-beta",children:(0,p.__)("Learn how Smart Linking works.","wp-parsely")})]}),b&&(0,i.jsx)(s.Notice,{status:"info",isDismissible:!1,className:"wp-parsely-content-helper-error",children:b.message}),null!==x&&(0,i.jsx)(s.Notice,{status:"success",isDismissible:!1,className:"wp-parsely-smart-linking-suggested-links",children:/* translators: 1 - number of smart links generated */ +(0,p.sprintf)((0,p.__)("Successfully added %s smart links.","wp-parsely"),x.length)}),(0,i.jsx)(Ze,{disabled:m,onSettingChange:function(e,t){var n,r;d(((n={})[e]=t,n)),A(((r={})[e]=t,r))}}),(0,i.jsxs)("div",{className:"wp-parsely-smart-linking-generate",children:[(0,i.jsx)(s.Button,{onClick:function(){return nt(void 0,void 0,void 0,(function(){var e,t,n,r,i;return rt(this,(function(s){switch(s.label){case 0:return[4,T(!0)];case 1:return s.sent(),[4,C(null)];case 2:return s.sent(),[4,L(null)];case 3:return s.sent(),f.trackEvent("smart_linking_generate_pressed",{is_full_content:w,selected_block:null!==(i=null==I?void 0:I.name)&&void 0!==i?i:"none",context:a}),[4,(l=w?"all":null==I?void 0:I.clientId,void 0===l&&(l="all"),nt(void 0,void 0,void 0,(function(){return rt(this,(function(e){switch(e.label){case 0:return[4,O(l)];case 1:return e.sent(),D(),[2]}}))})))];case 4:s.sent(),e=setTimeout((function(){var e;T(!1),f.trackEvent("smart_linking_generate_timeout",{is_full_content:w,selected_block:null!==(e=null==I?void 0:I.name)&&void 0!==e?e:"none",context:a}),M(w?"all":null==I?void 0:I.clientId)}),6e4),s.label=5;case 5:return s.trys.push([5,11,12,15]),t=w||!I,n=[],!(null==I?void 0:I.originalContent)||t?[3,7]:[4,Je.generateSmartLinks(null==I?void 0:I.originalContent,j,S)];case 6:return n=s.sent(),[3,9];case 7:return[4,Je.generateSmartLinks(B,j,S)];case 8:n=s.sent(),s.label=9;case 9:return[4,C(n)];case 10:return s.sent(),function(e){var t;f.trackEvent("smart_linking_applied",{is_full_content:w,selected_block:null!==(t=null==I?void 0:I.name)&&void 0!==t?t:"none",links_count:e.length,context:a});for(var n="",r=n=I&&!w?I.attributes.content:B,i=0,s=e;i(null==p?void 0:p.length)&&l.offset++;var d='').concat(l.text,"");r=et(r,new RegExp("(".concat(l.text,"|]*>").concat(l.text,")")),d,l.offset)}}I&&!w?(0,o.dispatch)("core/block-editor").updateBlockAttributes(I.clientId,{content:r}):(0,o.dispatch)("core/editor").editPost({content:r})}(n),[3,15];case 11:return r=s.sent(),L(r),[3,15];case 12:return[4,T(!1)];case 13:return s.sent(),[4,M(w?"all":null==I?void 0:I.clientId)];case 14:return s.sent(),clearTimeout(e),[7];case 15:return[2]}var l}))}))},variant:"primary",isBusy:m,disabled:m,children:m?(0,p.__)("Generating…","wp-parsely"):(0,p.__)("Add Smart Links","wp-parsely")}),g&&(0,i.jsxs)(s.Notice,{status:"warning",isDismissible:!0,onRemove:function(){return y(null)},className:"wp-parsely-smart-linking-hint",children:[(0,i.jsx)("strong",{children:(0,p.__)("Hint:","wp-parsely")})," ",g]}),(0,i.jsx)(s.Disabled,{isDisabled:m,children:(0,i.jsx)(s.CheckboxControl,{checked:!I||w,disabled:m,onClick:function(){I||y((0,p.__)("If you want to target a specific block, you should select it on the block editor.","wp-parsely"))},onChange:I?E:function(){},label:(0,p.__)("Add smart links for the entire post","wp-parsely")})})]})]})})},at=function(e){var t=e.isLoading,n=e.isOpen,r=e.onPersonaChange,a=e.onSettingChange,o=e.onToneChange,l=e.persona,c=e.tone,d=(0,u.useState)(n),h=d[0],g=d[1];return(0,i.jsxs)("div",{className:"parsely-panel-settings",children:[(0,i.jsxs)("div",{className:"parsely-panel-settings-header",children:[(0,i.jsx)(A,{size:20}),(0,i.jsx)(s.BaseControl,{id:"parsely-write-titles-settings",className:"parsely-panel-settings-header-label",label:(0,p.__)("Parse.ly AI Settings","wp-parsely"),children:(0,i.jsx)(s.Button,{label:(0,p.__)("Change Tone & Persona","wp-parsely"),icon:Me,onClick:function(){a("TitleSuggestionsSettingsOpen",!h),g(!h),f.trackEvent("title_suggestions_ai_settings_toggled",{is_active:!h})},isPressed:h,size:"small"})})]}),h&&(0,i.jsxs)("div",{className:"parsely-panel-settings-body",children:[(0,i.jsx)(N,{tone:c,label:L(c),onChange:function(e){o(e)},onDropdownChange:function(e){f.trackEvent("title_suggestions_ai_tone_changed",{tone:e})},disabled:t,allowCustom:!0}),(0,i.jsx)(k,{persona:l,label:x(l),onChange:function(e){r(e)},onDropdownChange:function(e){f.trackEvent("title_suggestions_ai_persona_changed",{persona:e})},disabled:t,allowCustom:!0})]})]})},ot=(0,y.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,y.createElement)(v.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),lt=(0,y.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,y.createElement)(v.Path,{d:"m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z"})),ct=(0,y.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,y.createElement)(v.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})),ut=(0,y.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,y.createElement)(v.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})),pt=function(){return pt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?"secondary":"primary",isBusy:w,onClick:function(){return _t(void 0,void 0,void 0,(function(){return bt(this,(function(e){switch(e.label){case 0:return!1!==w?[3,2]:(f.trackEvent("title_suggestions_generate_pressed",{request_more:_.length>0,total_titles:_.length,total_pinned:_.filter((function(e){return e.isPinned})).length,tone:d,persona:y}),[4,(t=it.PostTitle,n=O,r=d,i=y,_t(void 0,void 0,void 0,(function(){var e,s,a;return bt(this,(function(o){switch(o.label){case 0:return[4,P(!0)];case 1:o.sent(),e=new wt,o.label=2;case 2:return o.trys.push([2,5,,6]),[4,e.generateTitles(n,3,r,i)];case 3:return s=o.sent(),[4,k(t,s)];case 4:return o.sent(),[3,6];case 5:return a=o.sent(),l(a),[3,6];case 6:return[4,P(!1)];case 7:return o.sent(),[2]}}))})))]);case 1:e.sent(),e.label=2;case 2:return[2]}var t,n,r,i}))}))},children:[w&&(0,p.__)("Generating Titles…","wp-parsely"),!w&&_.length>0&&(0,p.__)("Generate More","wp-parsely"),!w&&0===_.length&&(0,p.__)("Generate Titles","wp-parsely")]})}),I=(0,i.jsxs)("div",{className:"parsely-write-titles-title-suggestions-container",children:[void 0!==S&&(0,i.jsx)(mt,{title:S,type:it.PostTitle,isOriginal:!0}),_.map((function(e){return(0,i.jsx)(mt,{title:e,type:it.PostTitle},e.id)}))]}),B=(0,i.jsxs)("div",{className:"parsely-write-titles-accepted-title-container",children:[(0,i.jsx)("div",{className:"parsely-write-titles-text",children:(0,p.__)("Replace the current post title with the following?","wp-parsely")}),(0,i.jsx)("div",{className:"parsely-write-titles-accepted-title",children:null==b?void 0:b.title}),(0,i.jsxs)("div",{className:"parsely-write-titles-accepted-title-actions",children:[(0,i.jsx)(s.Button,{variant:"secondary",onClick:function(){var e;T(it.PostTitle,void 0),f.trackEvent("title_suggestions_cancel_pressed",{original_title:N,canceled_title:null!==(e=null==b?void 0:b.title)&&void 0!==e?e:""})},children:(0,p.__)("Cancel","wp-parsely")}),(0,i.jsx)(s.Button,{variant:"primary",onClick:function(){return _t(void 0,void 0,void 0,(function(){return bt(this,(function(e){switch(e.label){case 0:return[4,E(it.PostTitle,N)];case 1:return e.sent(),(0,o.dispatch)("core/editor").editPost({title:null==b?void 0:b.title}),b?[4,(0,o.dispatch)(gt).pinTitle(it.PostTitle,b)]:[3,3];case 2:e.sent(),f.trackEvent("title_suggestions_accept_pressed",{old_title:N,new_title:b.title}),e.label=3;case 3:return[4,T(it.PostTitle,void 0)];case 4:return e.sent(),[2]}}))}))},children:(0,p.__)("Replace","wp-parsely")})]})]});return a?a.Message():(0,i.jsx)(s.PanelRow,{children:(0,i.jsxs)("div",{className:"parsely-write-titles-wrapper",children:[0===_.length&&void 0===b&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"parsely-write-titles-text",children:(0,p.__)("Use Parse.ly AI to generate a title for your post.","wp-parsely")}),A,R]}),0<_.length&&void 0===b&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"parsely-write-titles-text",children:(0,u.createInterpolateElement)( // translators: %1$s is the tone, %2$s is the persona. -(0,p.__)("We've generated a few titles based on the content of your post, written as a .","wp-parsely"),{tone:(0,i.jsx)("strong",{children:N(d)}),persona:(0,i.jsx)("strong",{children:x(g)})})}),I,R,L]}),void 0!==b&&F]})})},nt=function(){return nt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n titles based on the content of your post, written as a .","wp-parsely"),{tone:(0,i.jsx)("strong",{children:L(d)}),persona:(0,i.jsx)("strong",{children:x(y)})})}),I,A,R]}),void 0!==b&&B]})})},St=function(){return St=Object.assign||function(e){for(var t,n=1,r=arguments.length;n array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-url', 'wp-wordcount'), 'version' => 'ec0f278129ee227f1c61'); + array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-url', 'wp-wordcount'), 'version' => 'c9937d8820fad7f4e480'); diff --git a/build/content-helper/excerpt-generator.css b/build/content-helper/excerpt-generator.css index 9d05adffb..8cf3b48a7 100644 --- a/build/content-helper/excerpt-generator.css +++ b/build/content-helper/excerpt-generator.css @@ -1,2 +1,2 @@ -.wp-parsely-beta-badge{align-self:end;background-color:var(--parsely-green);border-radius:.34em;box-shadow:0 .0625rem .1875rem rgba(0,0,0,.2);color:#fff;display:inline-block;font-size:.75rem;font-weight:700;margin:.125em .125em .125em auto;opacity:.8;padding:.15em .65em;text-transform:uppercase;-webkit-user-select:none;-moz-user-select:none;user-select:none}.parsely-tone-selector-dropdown{margin-bottom:.625rem;width:100%}.parsely-tone-selector-dropdown.is-disabled{opacity:.5;pointer-events:none}.parsely-tone-selector-dropdown .components-dropdown-menu__toggle{display:flex;gap:.625rem;width:100%}.parsely-tone-selector-dropdown .components-dropdown-menu__toggle svg:first-of-type path{transform:scale(1.4);transform-origin:center}.parsely-tone-selector-dropdown .parsely-tone-selector-label{flex-grow:2;text-align:left}.parsely-tone-selector-dropdown .parsely-tone-selector-label:first-letter{text-transform:uppercase}#wp-parsely-dashboard-widget,.settings_page_parsely,.wp-parsely-content-helper,.wp-parsely-excerpt-generator,.wp-parsely-popover{--base-font:"source-sans-pro",arial,sans-serif;--numeric-font:"ff-din-round-web",sans-serif;--parsely-green:#59a744;--gray-200:#f7f8f9;--gray-300:#edeeef;--gray-400:#d7dbdf;--gray-500:#959da5;--gray-600:#586069;--gray-700:#444d56;--gray-900:#24292e;--blue-500:#44a8e5;--blue-550:#2596db;--green-500:#7bc01b;--green-900:#3d6307;--ref-direct:205,13%,52%;--ref-internal:161,91%,41%;--ref-social:210,72%,41%;--ref-search:42,100%,50%;--ref-other:3,76%,58%;--base-text:var(--gray-900);--base-text-2:var(--gray-600);--base-3:var(--gray-400);--border:var(--gray-400);--data:var(--green-500);--control:var(--blue-500);--font-size--large:1rem;--font-size--extra-large:1.2rem;--black:#000;--sidebar-black:#1e1e1e}.parsely-persona-selector-dropdown{margin-bottom:.625rem;width:100%}.parsely-persona-selector-dropdown.is-disabled{opacity:.5;pointer-events:none}.parsely-persona-selector-dropdown .components-dropdown-menu__toggle{display:flex;gap:.625rem;width:100%}.parsely-persona-selector-dropdown .parsely-persona-selector-label{flex-grow:2;text-align:left}.parsely-persona-selector-dropdown .parsely-persona-selector-label:first-letter{text-transform:uppercase}.wp-parsely-popover button.components-button.components-menu-item__button.is-selected,.wp-parsely-popover button.components-button.components-menu-item__button.is-selected:focus{box-shadow:0 0 0 2px var(--parsely-green);outline:3px solid transparent} -#wp-parsely-dashboard-widget,.settings_page_parsely,.wp-parsely-content-helper,.wp-parsely-excerpt-generator,.wp-parsely-popover{--base-font:"source-sans-pro",arial,sans-serif;--numeric-font:"ff-din-round-web",sans-serif;--parsely-green:#59a744;--gray-200:#f7f8f9;--gray-300:#edeeef;--gray-400:#d7dbdf;--gray-500:#959da5;--gray-600:#586069;--gray-700:#444d56;--gray-900:#24292e;--blue-500:#44a8e5;--blue-550:#2596db;--green-500:#7bc01b;--green-900:#3d6307;--ref-direct:205,13%,52%;--ref-internal:161,91%,41%;--ref-social:210,72%,41%;--ref-search:42,100%,50%;--ref-other:3,76%,58%;--base-text:var(--gray-900);--base-text-2:var(--gray-600);--base-3:var(--gray-400);--border:var(--gray-400);--data:var(--green-500);--control:var(--blue-500);--font-size--large:1rem;--font-size--extra-large:1.2rem;--black:#000;--sidebar-black:#1e1e1e}.editor-post-excerpt__spinner{align-items:center;background:hsla(0,0%,100%,.7);bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:1.25rem;z-index:10}.editor-post-excerpt__spinner.has-word-count{bottom:1.25rem}.wp-parsely-excerpt-generator{margin-top:.9375rem}.wp-parsely-excerpt-generator .wp-parsely-excerpt-generator-header{align-items:center;display:flex;justify-content:flex-start;margin-bottom:.625rem}.wp-parsely-excerpt-generator .wp-parsely-excerpt-generator-header .wp-parsely-excerpt-generator-header-label{display:inline-block;font-size:.6875rem;font-weight:500;line-height:1.4;margin-left:.3125rem;padding:0;text-transform:uppercase}.wp-parsely-excerpt-generator .wp-parsely-excerpt-generator-controls{align-items:center;display:flex;gap:.9375rem;justify-content:center}.wp-parsely-excerpt-generator .wp-parsely-excerpt-generator-error,.wp-parsely-excerpt-generator .wp-parsely-excerpt-generator-error p{margin:0} +.wp-parsely-beta-badge{align-self:end;background-color:var(--parsely-green);border-radius:.34em;box-shadow:0 .0625rem .1875rem rgba(0,0,0,.2);color:#fff;display:inline-block;font-size:.75rem;font-weight:700;margin:.125em .125em .125em auto;opacity:.8;padding:.15em .65em;text-transform:uppercase;-webkit-user-select:none;-moz-user-select:none;user-select:none}.parsely-tone-selector-dropdown{margin-bottom:.625rem;width:100%}.parsely-tone-selector-dropdown.is-disabled{opacity:.5;pointer-events:none}.parsely-tone-selector-dropdown .components-dropdown-menu__toggle{display:flex;gap:.625rem;width:100%}.parsely-tone-selector-dropdown .components-dropdown-menu__toggle svg:first-of-type path{transform:scale(1.4);transform-origin:center}.parsely-tone-selector-dropdown .parsely-tone-selector-label{flex-grow:2;text-align:left}.parsely-tone-selector-dropdown .parsely-tone-selector-label:first-letter{text-transform:uppercase}#wp-parsely-dashboard-widget,.settings_page_parsely,.wp-parsely-content-helper,.wp-parsely-excerpt-generator,.wp-parsely-panel,.wp-parsely-popover{--base-font:"source-sans-pro",arial,sans-serif;--numeric-font:"ff-din-round-web",sans-serif;--parsely-green:#59a744;--gray-200:#f7f8f9;--gray-300:#edeeef;--gray-400:#d7dbdf;--gray-500:#959da5;--gray-600:#586069;--gray-700:#444d56;--gray-900:#24292e;--blue-500:#44a8e5;--blue-550:#2596db;--green-500:#7bc01b;--green-900:#3d6307;--ref-direct:205,13%,52%;--ref-internal:161,91%,41%;--ref-social:210,72%,41%;--ref-search:42,100%,50%;--ref-other:3,76%,58%;--base-text:var(--gray-900);--base-text-2:var(--gray-600);--base-3:var(--gray-400);--border:var(--gray-400);--data:var(--green-500);--control:var(--blue-500);--font-size--large:1rem;--font-size--extra-large:1.2rem;--black:#000;--sidebar-black:#1e1e1e}.parsely-persona-selector-dropdown{margin-bottom:.625rem;width:100%}.parsely-persona-selector-dropdown.is-disabled{opacity:.5;pointer-events:none}.parsely-persona-selector-dropdown .components-dropdown-menu__toggle{display:flex;gap:.625rem;width:100%}.parsely-persona-selector-dropdown .parsely-persona-selector-label{flex-grow:2;text-align:left}.parsely-persona-selector-dropdown .parsely-persona-selector-label:first-letter{text-transform:uppercase}.wp-parsely-popover button.components-button.components-menu-item__button.is-selected,.wp-parsely-popover button.components-button.components-menu-item__button.is-selected:focus{box-shadow:0 0 0 2px var(--parsely-green);outline:3px solid transparent}.parsely-panel-settings{width:100%}.parsely-panel-settings .parsely-panel-settings-header{display:flex;margin:.625rem 0;width:100%}.parsely-panel-settings .parsely-panel-settings-header .parsely-panel-settings-header-label{flex-grow:2;margin:0 0 0 .3125rem;text-align:left}.parsely-panel-settings .parsely-panel-settings-header .parsely-panel-settings-header-label .components-base-control__field{align-items:center;display:flex;justify-content:space-between}.parsely-panel-settings .parsely-panel-settings-header .parsely-panel-settings-header-label .components-base-control__field .components-base-control__label{margin-bottom:0}.wp-parsely-content-helper-error{align-self:flex-start;margin:0}.wp-parsely-content-helper-error p{margin:0}.wp-parsely-content-helper-error .content-helper-error-message{margin:0!important} +#wp-parsely-dashboard-widget,.settings_page_parsely,.wp-parsely-content-helper,.wp-parsely-excerpt-generator,.wp-parsely-panel,.wp-parsely-popover{--base-font:"source-sans-pro",arial,sans-serif;--numeric-font:"ff-din-round-web",sans-serif;--parsely-green:#59a744;--gray-200:#f7f8f9;--gray-300:#edeeef;--gray-400:#d7dbdf;--gray-500:#959da5;--gray-600:#586069;--gray-700:#444d56;--gray-900:#24292e;--blue-500:#44a8e5;--blue-550:#2596db;--green-500:#7bc01b;--green-900:#3d6307;--ref-direct:205,13%,52%;--ref-internal:161,91%,41%;--ref-social:210,72%,41%;--ref-search:42,100%,50%;--ref-other:3,76%,58%;--base-text:var(--gray-900);--base-text-2:var(--gray-600);--base-3:var(--gray-400);--border:var(--gray-400);--data:var(--green-500);--control:var(--blue-500);--font-size--large:1rem;--font-size--extra-large:1.2rem;--black:#000;--sidebar-black:#1e1e1e}.editor-post-excerpt__spinner{align-items:center;background:hsla(0,0%,100%,.7);bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:1.25rem;z-index:10}.editor-post-excerpt__spinner.has-word-count{bottom:1.25rem}.wp-parsely-excerpt-generator{margin-top:.9375rem}.wp-parsely-excerpt-generator .wp-parsely-excerpt-generator-header{align-items:center;display:flex;justify-content:flex-start;margin-bottom:.625rem}.wp-parsely-excerpt-generator .wp-parsely-excerpt-generator-header .wp-parsely-excerpt-generator-header-label{display:inline-block;font-size:.6875rem;font-weight:500;line-height:1.4;margin-left:.3125rem;padding:0;text-transform:uppercase}.wp-parsely-excerpt-generator .wp-parsely-excerpt-generator-controls{align-items:center;display:flex;gap:.9375rem;justify-content:center} diff --git a/build/content-helper/excerpt-generator.js b/build/content-helper/excerpt-generator.js index ae784b2bd..e7aaf8799 100644 --- a/build/content-helper/excerpt-generator.js +++ b/build/content-helper/excerpt-generator.js @@ -1,3 +1,3 @@ -!function(){"use strict";var e={251:function(e,t,r){var n=r(196),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,i={},c=null,u=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,n)&&!l.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===i[n]&&(i[n]=t[n]);return{$$typeof:o,type:e,key:c,ref:u,props:i,_owner:s.current}}t.Fragment=i,t.jsx=c,t.jsxs=c},893:function(e,t,r){e.exports=r(251)},196:function(e){e.exports=window.React}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e,t,n=window.wp.hooks,o=window.wp.data,i=window.wp.plugins,a=r(893),s=window.wp.components,l=window.wp.editPost,c=window.wp.editor,u=window.wp.element,p=window.wp.i18n,d=window.wp.wordcount,y=function(){function e(){this._tkq=[],this.isLoaded=!1,this.isEnabled=!1,"undefined"!=typeof wpParselyTracksTelemetry&&(this.isEnabled=!0,this.loadTrackingLibrary())}return e.getInstance=function(){return window.wpParselyTelemetryInstance||Object.defineProperty(window,"wpParselyTelemetryInstance",{value:new e,writable:!1,configurable:!1,enumerable:!1}),window.wpParselyTelemetryInstance},e.prototype.loadTrackingLibrary=function(){var e=this,t=document.createElement("script");t.async=!0,t.src="//stats.wp.com/w.js",t.onload=function(){e.isLoaded=!0,e._tkq=window._tkq||[]},document.head.appendChild(t)},e.trackEvent=function(t,r){return void 0===r&&(r={}),n=this,o=void 0,a=function(){var n;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=1e4&&(clearInterval(i),r("Telemetry library not loaded"))}),100);else r("Telemetry not enabled")}))},e.prototype.trackEvent=function(t,r){var n;this.isLoaded?(0!==t.indexOf(e.TRACKS_PREFIX)&&(t=e.TRACKS_PREFIX+t),this.isEventNameValid(t)?(r=this.prepareProperties(r),null===(n=this._tkq)||void 0===n||n.push(["recordEvent",t,r])):console.error("Error tracking event: Invalid event name")):console.error("Error tracking event: Telemetry not loaded")},e.prototype.isTelemetryEnabled=function(){return this.isEnabled},e.prototype.isProprietyValid=function(t){return e.PROPERTY_REGEX.test(t)},e.prototype.isEventNameValid=function(t){return e.EVENT_NAME_REGEX.test(t)},e.prototype.prepareProperties=function(e){return(e=this.sanitizeProperties(e)).parsely_version=wpParselyTracksTelemetry.version,wpParselyTracksTelemetry.user&&(e._ut=wpParselyTracksTelemetry.user.type,e._ui=wpParselyTracksTelemetry.user.id),wpParselyTracksTelemetry.vipgo_env&&(e.vipgo_env=wpParselyTracksTelemetry.vipgo_env),this.sanitizeProperties(e)},e.prototype.sanitizeProperties=function(e){var t=this,r={};return Object.keys(e).forEach((function(n){t.isProprietyValid(n)&&(r[n]=e[n])})),r},e.TRACKS_PREFIX="wpparsely_",e.EVENT_NAME_REGEX=/^(([a-z0-9]+)_){2}([a-z0-9_]+)$/,e.PROPERTY_REGEX=/^[a-z_][a-z0-9_]*$/,e}(),f=(y.trackEvent,function(e){var t=e.text,r=void 0===t?(0,p.__)("Beta","wp-parsely"):t,n=e.color,o=void 0===n?"var(--parsely-green)":n,i=e.fontSize,s={backgroundColor:o,fontSize:void 0===i?"0.75rem":i};return(0,a.jsx)("div",{className:"wp-parsely-beta-badge",style:s,children:r})}),h=function(e){var t=e.size,r=void 0===t?24:t;return(0,a.jsxs)(s.SVG,{height:r,viewBox:"0 0 60 65",width:r,xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)(s.Path,{fill:"#5ba745",d:"M23.72,51.53c0-.18,0-.34-.06-.52a13.11,13.11,0,0,0-2.1-5.53A14.74,14.74,0,0,0,19.12,43c-.27-.21-.5-.11-.51.22l-.24,3.42c0,.33-.38.35-.49,0l-1.5-4.8a1.4,1.4,0,0,0-.77-.78,23.91,23.91,0,0,0-3.1-.84c-1.38-.24-3.39-.39-3.39-.39-.34,0-.45.21-.25.49l2.06,3.76c.2.27,0,.54-.29.33l-4.51-3.6a3.68,3.68,0,0,0-2.86-.48c-1,.16-2.44.46-2.44.46a.68.68,0,0,0-.39.25.73.73,0,0,0-.14.45S.41,43,.54,44a3.63,3.63,0,0,0,1.25,2.62L6.48,50c.28.2.09.49-.23.37l-4.18-.94c-.32-.12-.5,0-.4.37,0,0,.69,1.89,1.31,3.16a24,24,0,0,0,1.66,2.74,1.34,1.34,0,0,0,1,.52l5,.13c.33,0,.41.38.1.48L7.51,58c-.31.1-.34.35-.07.55a14.29,14.29,0,0,0,3.05,1.66,13.09,13.09,0,0,0,5.9.5,25.13,25.13,0,0,0,4.34-1,9.55,9.55,0,0,1-.08-1.2,9.32,9.32,0,0,1,3.07-6.91"}),(0,a.jsx)(s.Path,{fill:"#5ba745",d:"M59.7,41.53a.73.73,0,0,0-.14-.45.68.68,0,0,0-.39-.25s-1.43-.3-2.44-.46a3.64,3.64,0,0,0-2.86.48l-4.51,3.6c-.26.21-.49-.06-.29-.33l2.06-3.76c.2-.28.09-.49-.25-.49,0,0-2,.15-3.39.39a23.91,23.91,0,0,0-3.1.84,1.4,1.4,0,0,0-.77.78l-1.5,4.8c-.11.32-.48.3-.49,0l-.24-3.42c0-.33-.24-.43-.51-.22a14.74,14.74,0,0,0-2.44,2.47A13.11,13.11,0,0,0,36.34,51c0,.18,0,.34-.06.52a9.26,9.26,0,0,1,3,8.1,24.1,24.1,0,0,0,4.34,1,13.09,13.09,0,0,0,5.9-.5,14.29,14.29,0,0,0,3.05-1.66c.27-.2.24-.45-.07-.55l-3.22-1.17c-.31-.1-.23-.47.1-.48l5-.13a1.38,1.38,0,0,0,1-.52A24.6,24.6,0,0,0,57,52.92c.61-1.27,1.31-3.16,1.31-3.16.1-.33-.08-.49-.4-.37l-4.18.94c-.32.12-.51-.17-.23-.37l4.69-3.34A3.63,3.63,0,0,0,59.46,44c.13-1,.24-2.47.24-2.47"}),(0,a.jsx)(s.Path,{fill:"#5ba745",d:"M46.5,25.61c0-.53-.35-.72-.8-.43l-4.86,2.66c-.45.28-.56-.27-.23-.69l4.66-6.23a2,2,0,0,0,.28-1.68,36.51,36.51,0,0,0-2.19-4.89,34,34,0,0,0-2.81-3.94c-.33-.41-.74-.35-.91.16l-2.28,5.68c-.16.5-.6.48-.59-.05l.28-8.93a2.54,2.54,0,0,0-.66-1.64S35,4.27,33.88,3.27,30.78.69,30.78.69a1.29,1.29,0,0,0-1.54,0s-1.88,1.49-3.12,2.59-2.48,2.35-2.48,2.35A2.5,2.5,0,0,0,23,7.27l.27,8.93c0,.53-.41.55-.58.05l-2.29-5.69c-.17-.5-.57-.56-.91-.14a35.77,35.77,0,0,0-3,4.2,35.55,35.55,0,0,0-2,4.62,2,2,0,0,0,.27,1.67l4.67,6.24c.33.42.23,1-.22.69l-4.87-2.66c-.45-.29-.82-.1-.82.43a18.6,18.6,0,0,0,.83,5.07,20.16,20.16,0,0,0,5.37,7.77c3.19,3,5.93,7.8,7.45,11.08A9.6,9.6,0,0,1,30,49.09a9.31,9.31,0,0,1,2.86.45c1.52-3.28,4.26-8.11,7.44-11.09a20.46,20.46,0,0,0,5.09-7,19,19,0,0,0,1.11-5.82"}),(0,a.jsx)(s.Path,{fill:"#5ba745",d:"M36.12,58.44A6.12,6.12,0,1,1,30,52.32a6.11,6.11,0,0,1,6.12,6.12"})]})},w=window.wp.apiFetch,v=r.n(w),_=window.wp.url,b=function(e){void 0===e&&(e=null);var t="";(null==e?void 0:e.children)&&(t=e.children);var r="content-helper-error-message";return(null==e?void 0:e.className)&&(r+=" "+e.className),(0,a.jsx)("div",{className:r,"data-testid":null==e?void 0:e.testId,dangerouslySetInnerHTML:{__html:t}})},g=(e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)});!function(e){e.CannotFormulateApiQuery="ch_cannot_formulate_api_query",e.FetchError="fetch_error",e.HttpRequestFailed="http_request_failed",e[e.ParselyApiForbidden=403]="ParselyApiForbidden",e.ParselyApiResponseContainsError="ch_response_contains_error",e.ParselyApiReturnedNoData="ch_parsely_api_returned_no_data",e.ParselyApiReturnedTooManyResults="ch_parsely_api_returned_too_many_results",e[e.ParselyApiUnauthorized=401]="ParselyApiUnauthorized",e.PluginCredentialsNotSetMessageDetected="parsely_credentials_not_set_message_detected",e.PluginSettingsApiSecretNotSet="parsely_api_secret_not_set",e.PluginSettingsSiteIdNotSet="parsely_site_id_not_set",e.PostIsNotPublished="ch_post_not_published"}(t||(t={}));var m=function(e){function r(n,o,i){void 0===i&&(i=(0,p.__)("Error: ","wp-parsely"));var a=e.call(this,i+n)||this;a.hint=null,a.name=a.constructor.name,a.code=o;var s=[t.ParselyApiForbidden,t.ParselyApiResponseContainsError,t.ParselyApiReturnedNoData,t.ParselyApiReturnedTooManyResults,t.ParselyApiUnauthorized,t.PluginCredentialsNotSetMessageDetected,t.PluginSettingsApiSecretNotSet,t.PluginSettingsSiteIdNotSet,t.PostIsNotPublished];return a.retryFetch=!s.includes(a.code),Object.setPrototypeOf(a,r.prototype),a}return g(r,e),r.prototype.Message=function(e){return void 0===e&&(e=null),[t.PluginCredentialsNotSetMessageDetected,t.PluginSettingsSiteIdNotSet,t.PluginSettingsApiSecretNotSet].includes(this.code)?function(e){return void 0===e&&(e=null),(0,a.jsx)(b,{className:null==e?void 0:e.className,testId:"empty-credentials-message",children:window.wpParselyEmptyCredentialsMessage})}(e):(this.code===t.FetchError&&(this.hint=this.Hint((0,p.__)("This error can sometimes be caused by ad-blockers or browser tracking protections. Please add this site to any applicable allow lists and try again.","wp-parsely"))),this.code===t.ParselyApiForbidden&&(this.hint=this.Hint((0,p.__)("Please ensure that the Site ID and API Secret given in the plugin's settings are correct.","wp-parsely"))),this.code===t.HttpRequestFailed&&(this.hint=this.Hint((0,p.__)("The Parse.ly API cannot be reached. Please verify that you are online.","wp-parsely"))),this.code===t.ParselyApiUnauthorized&&(this.message=(0,p.__)("This feature is accessible to select customers participating in its beta testing.","wp-parsely")),(0,a.jsx)(b,{className:null==e?void 0:e.className,testId:"error",children:"

".concat(this.message,"

").concat(this.hint?this.hint:"")}))},r.prototype.Hint=function(e){return'

'.concat((0,p.__)("Hint:","wp-parsely")," ").concat(e,"

")},r}(Error),x=function(){function e(){}return e.prototype.generateExcerpt=function(e,r){var n,o,i,a,s;return o=this,i=void 0,s=function(){var o,i;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0,N=(0,d.count)(i||k,"words",{}),A=(0,p.sprintf)( +!function(){"use strict";var e={251:function(e,t,r){var n=r(196),o=Symbol.for("react.element"),a=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,a={},c=null,u=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,n)&&!l.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===a[n]&&(a[n]=t[n]);return{$$typeof:o,type:e,key:c,ref:u,props:a,_owner:s.current}}t.Fragment=a,t.jsx=c,t.jsxs=c},893:function(e,t,r){e.exports=r(251)},196:function(e){e.exports=window.React}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e,t,n=window.wp.hooks,o=window.wp.data,a=window.wp.plugins,i=r(893),s=window.wp.components,l=window.wp.editPost,c=window.wp.editor,u=window.wp.element,p=window.wp.i18n,d=window.wp.wordcount,y=function(){function e(){this._tkq=[],this.isLoaded=!1,this.isEnabled=!1,"undefined"!=typeof wpParselyTracksTelemetry&&(this.isEnabled=!0,this.loadTrackingLibrary())}return e.getInstance=function(){return window.wpParselyTelemetryInstance||Object.defineProperty(window,"wpParselyTelemetryInstance",{value:new e,writable:!1,configurable:!1,enumerable:!1}),window.wpParselyTelemetryInstance},e.prototype.loadTrackingLibrary=function(){var e=this,t=document.createElement("script");t.async=!0,t.src="//stats.wp.com/w.js",t.onload=function(){e.isLoaded=!0,e._tkq=window._tkq||[]},document.head.appendChild(t)},e.trackEvent=function(t,r){return void 0===r&&(r={}),n=this,o=void 0,i=function(){var n;return function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=1e4&&(clearInterval(a),r("Telemetry library not loaded"))}),100);else r("Telemetry not enabled")}))},e.prototype.trackEvent=function(t,r){var n;this.isLoaded?(0!==t.indexOf(e.TRACKS_PREFIX)&&(t=e.TRACKS_PREFIX+t),this.isEventNameValid(t)?(r=this.prepareProperties(r),null===(n=this._tkq)||void 0===n||n.push(["recordEvent",t,r])):console.error("Error tracking event: Invalid event name")):console.error("Error tracking event: Telemetry not loaded")},e.prototype.isTelemetryEnabled=function(){return this.isEnabled},e.prototype.isProprietyValid=function(t){return e.PROPERTY_REGEX.test(t)},e.prototype.isEventNameValid=function(t){return e.EVENT_NAME_REGEX.test(t)},e.prototype.prepareProperties=function(e){return(e=this.sanitizeProperties(e)).parsely_version=wpParselyTracksTelemetry.version,wpParselyTracksTelemetry.user&&(e._ut=wpParselyTracksTelemetry.user.type,e._ui=wpParselyTracksTelemetry.user.id),wpParselyTracksTelemetry.vipgo_env&&(e.vipgo_env=wpParselyTracksTelemetry.vipgo_env),this.sanitizeProperties(e)},e.prototype.sanitizeProperties=function(e){var t=this,r={};return Object.keys(e).forEach((function(n){t.isProprietyValid(n)&&(r[n]=e[n])})),r},e.TRACKS_PREFIX="wpparsely_",e.EVENT_NAME_REGEX=/^(([a-z0-9]+)_){2}([a-z0-9_]+)$/,e.PROPERTY_REGEX=/^[a-z_][a-z0-9_]*$/,e}(),f=(y.trackEvent,function(e){var t=e.text,r=void 0===t?(0,p.__)("Beta","wp-parsely"):t,n=e.color,o=void 0===n?"var(--parsely-green)":n,a=e.fontSize,s={backgroundColor:o,fontSize:void 0===a?"0.75rem":a};return(0,i.jsx)("div",{className:"wp-parsely-beta-badge",style:s,children:r})}),h=function(e){var t=e.size,r=void 0===t?24:t,n=e.className,o=void 0===n?"wp-parsely-icon":n;return(0,i.jsxs)(s.SVG,{className:o,height:r,viewBox:"0 0 60 65",width:r,xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M23.72,51.53c0-.18,0-.34-.06-.52a13.11,13.11,0,0,0-2.1-5.53A14.74,14.74,0,0,0,19.12,43c-.27-.21-.5-.11-.51.22l-.24,3.42c0,.33-.38.35-.49,0l-1.5-4.8a1.4,1.4,0,0,0-.77-.78,23.91,23.91,0,0,0-3.1-.84c-1.38-.24-3.39-.39-3.39-.39-.34,0-.45.21-.25.49l2.06,3.76c.2.27,0,.54-.29.33l-4.51-3.6a3.68,3.68,0,0,0-2.86-.48c-1,.16-2.44.46-2.44.46a.68.68,0,0,0-.39.25.73.73,0,0,0-.14.45S.41,43,.54,44a3.63,3.63,0,0,0,1.25,2.62L6.48,50c.28.2.09.49-.23.37l-4.18-.94c-.32-.12-.5,0-.4.37,0,0,.69,1.89,1.31,3.16a24,24,0,0,0,1.66,2.74,1.34,1.34,0,0,0,1,.52l5,.13c.33,0,.41.38.1.48L7.51,58c-.31.1-.34.35-.07.55a14.29,14.29,0,0,0,3.05,1.66,13.09,13.09,0,0,0,5.9.5,25.13,25.13,0,0,0,4.34-1,9.55,9.55,0,0,1-.08-1.2,9.32,9.32,0,0,1,3.07-6.91"}),(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M59.7,41.53a.73.73,0,0,0-.14-.45.68.68,0,0,0-.39-.25s-1.43-.3-2.44-.46a3.64,3.64,0,0,0-2.86.48l-4.51,3.6c-.26.21-.49-.06-.29-.33l2.06-3.76c.2-.28.09-.49-.25-.49,0,0-2,.15-3.39.39a23.91,23.91,0,0,0-3.1.84,1.4,1.4,0,0,0-.77.78l-1.5,4.8c-.11.32-.48.3-.49,0l-.24-3.42c0-.33-.24-.43-.51-.22a14.74,14.74,0,0,0-2.44,2.47A13.11,13.11,0,0,0,36.34,51c0,.18,0,.34-.06.52a9.26,9.26,0,0,1,3,8.1,24.1,24.1,0,0,0,4.34,1,13.09,13.09,0,0,0,5.9-.5,14.29,14.29,0,0,0,3.05-1.66c.27-.2.24-.45-.07-.55l-3.22-1.17c-.31-.1-.23-.47.1-.48l5-.13a1.38,1.38,0,0,0,1-.52A24.6,24.6,0,0,0,57,52.92c.61-1.27,1.31-3.16,1.31-3.16.1-.33-.08-.49-.4-.37l-4.18.94c-.32.12-.51-.17-.23-.37l4.69-3.34A3.63,3.63,0,0,0,59.46,44c.13-1,.24-2.47.24-2.47"}),(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M46.5,25.61c0-.53-.35-.72-.8-.43l-4.86,2.66c-.45.28-.56-.27-.23-.69l4.66-6.23a2,2,0,0,0,.28-1.68,36.51,36.51,0,0,0-2.19-4.89,34,34,0,0,0-2.81-3.94c-.33-.41-.74-.35-.91.16l-2.28,5.68c-.16.5-.6.48-.59-.05l.28-8.93a2.54,2.54,0,0,0-.66-1.64S35,4.27,33.88,3.27,30.78.69,30.78.69a1.29,1.29,0,0,0-1.54,0s-1.88,1.49-3.12,2.59-2.48,2.35-2.48,2.35A2.5,2.5,0,0,0,23,7.27l.27,8.93c0,.53-.41.55-.58.05l-2.29-5.69c-.17-.5-.57-.56-.91-.14a35.77,35.77,0,0,0-3,4.2,35.55,35.55,0,0,0-2,4.62,2,2,0,0,0,.27,1.67l4.67,6.24c.33.42.23,1-.22.69l-4.87-2.66c-.45-.29-.82-.1-.82.43a18.6,18.6,0,0,0,.83,5.07,20.16,20.16,0,0,0,5.37,7.77c3.19,3,5.93,7.8,7.45,11.08A9.6,9.6,0,0,1,30,49.09a9.31,9.31,0,0,1,2.86.45c1.52-3.28,4.26-8.11,7.44-11.09a20.46,20.46,0,0,0,5.09-7,19,19,0,0,0,1.11-5.82"}),(0,i.jsx)(s.Path,{fill:"#5ba745",d:"M36.12,58.44A6.12,6.12,0,1,1,30,52.32a6.11,6.11,0,0,1,6.12,6.12"})]})},w=window.wp.apiFetch,v=r.n(w),_=window.wp.url,g=function(e){void 0===e&&(e=null);var t="";(null==e?void 0:e.children)&&(t=e.children);var r="content-helper-error-message";return(null==e?void 0:e.className)&&(r+=" "+e.className),(0,i.jsx)("div",{className:r,"data-testid":null==e?void 0:e.testId,dangerouslySetInnerHTML:{__html:t}})},b=(e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)});!function(e){e.CannotFormulateApiQuery="ch_cannot_formulate_api_query",e.FetchError="fetch_error",e.HttpRequestFailed="http_request_failed",e[e.ParselyApiForbidden=403]="ParselyApiForbidden",e.ParselyApiResponseContainsError="ch_response_contains_error",e.ParselyApiReturnedNoData="ch_parsely_api_returned_no_data",e.ParselyApiReturnedTooManyResults="ch_parsely_api_returned_too_many_results",e[e.ParselyApiUnauthorized=401]="ParselyApiUnauthorized",e[e.ParselyInternalServerError=500]="ParselyInternalServerError",e.PluginCredentialsNotSetMessageDetected="parsely_credentials_not_set_message_detected",e.PluginSettingsApiSecretNotSet="parsely_api_secret_not_set",e.PluginSettingsSiteIdNotSet="parsely_site_id_not_set",e.PostIsNotPublished="ch_post_not_published"}(t||(t={}));var m=function(e){function r(n,o,a){void 0===a&&(a=(0,p.__)("Error: ","wp-parsely"));var i=e.call(this,a+n)||this;i.hint=null,i.name=i.constructor.name,i.code=o;var s=[t.ParselyApiForbidden,t.ParselyApiResponseContainsError,t.ParselyApiReturnedNoData,t.ParselyApiReturnedTooManyResults,t.ParselyApiUnauthorized,t.PluginCredentialsNotSetMessageDetected,t.PluginSettingsApiSecretNotSet,t.PluginSettingsSiteIdNotSet,t.PostIsNotPublished];return i.retryFetch=!s.includes(i.code),Object.setPrototypeOf(i,r.prototype),i.code===t.ParselyApiUnauthorized&&(i.message=(0,p.__)("This feature is accessible to select customers participating in its beta testing.","wp-parsely")),i.code===t.ParselyInternalServerError&&(i.message=(0,p.__)("The Parse.ly API returned an internal server error. Please try again later.","wp-parsely")),i.code===t.HttpRequestFailed&&i.message.includes("cURL error 28")&&(i.message=(0,p.__)("The Parse.ly API did not respond in a timely manner. Please try again later.","wp-parsely")),i}return b(r,e),r.prototype.Message=function(e){return void 0===e&&(e=null),[t.PluginCredentialsNotSetMessageDetected,t.PluginSettingsSiteIdNotSet,t.PluginSettingsApiSecretNotSet].includes(this.code)?function(e){return void 0===e&&(e=null),(0,i.jsx)(g,{className:null==e?void 0:e.className,testId:"empty-credentials-message",children:window.wpParselyEmptyCredentialsMessage})}(e):(this.code===t.FetchError&&(this.hint=this.Hint((0,p.__)("This error can sometimes be caused by ad-blockers or browser tracking protections. Please add this site to any applicable allow lists and try again.","wp-parsely"))),this.code===t.ParselyApiForbidden&&(this.hint=this.Hint((0,p.__)("Please ensure that the Site ID and API Secret given in the plugin's settings are correct.","wp-parsely"))),this.code===t.HttpRequestFailed&&(this.hint=this.Hint((0,p.__)("The Parse.ly API cannot be reached. Please verify that you are online.","wp-parsely"))),(0,i.jsx)(g,{className:null==e?void 0:e.className,testId:"error",children:"

".concat(this.message,"

").concat(this.hint?this.hint:"")}))},r.prototype.Hint=function(e){return'

'.concat((0,p.__)("Hint:","wp-parsely")," ").concat(e,"

")},r}(Error),P=function(){function e(){}return e.prototype.generateExcerpt=function(e,r){var n,o,a,i,s;return o=this,a=void 0,s=function(){var o,a;return function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0,N=(0,d.count)(a||S,"words",{}),A=(0,p.sprintf)( // Translators: %1$s the number of words in the excerpt. -(0,p._n)("%1$s word","%1$s words",N,"wp-parsely"),N);return(0,u.useEffect)((function(){var e=document.querySelector(".editor-post-excerpt textarea");e&&(e.scrollTop=0)}),[i]),(0,a.jsxs)("div",{className:"editor-post-excerpt",children:[(0,a.jsxs)("div",{style:{position:"relative"},children:[t&&(0,a.jsx)("div",{className:"editor-post-excerpt__spinner"+(N>0?" has-word-count":""),children:(0,a.jsx)(s.Spinner,{})}),(0,a.jsx)(s.TextareaControl,{__nextHasNoMarginBottom:!0,label:(0,p.__)("Write an excerpt (optional)","wp-parsely"),className:"editor-post-excerpt__textarea",onChange:function(e){return b({excerpt:e})},disabled:t||j,value:j?i:k,help:N?A:null})]}),(0,a.jsx)(s.ExternalLink,{href:(0,p.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt","wp-parsely"),children:(0,p.__)("Learn more about manual excerpts","wp-parsely")}),(0,a.jsxs)("div",{className:"wp-parsely-excerpt-generator",children:[(0,a.jsxs)("div",{className:"wp-parsely-excerpt-generator-header",children:[(0,a.jsx)(h,{size:20}),(0,a.jsx)("div",{className:"wp-parsely-excerpt-generator-header-label",children:(0,p.__)("Parse.ly AI","wp-parsely")}),(0,a.jsx)(f,{})]}),v&&(0,a.jsx)(s.Notice,{status:"info",isDismissible:!1,className:"wp-parsely-excerpt-generator-error",children:v.Message()}),(0,a.jsx)("div",{className:"wp-parsely-excerpt-generator-controls",children:j?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.Button,{variant:"secondary",onClick:function(){return P(void 0,void 0,void 0,(function(){return E(this,(function(e){switch(e.label){case 0:return[4,b({excerpt:i})];case 1:return e.sent(),l(""),y.trackEvent("excerpt_generator_accepted"),[2]}}))}))},children:(0,p.__)("Accept","wp-parsely")}),(0,a.jsx)(s.Button,{isDestructive:!0,variant:"secondary",onClick:function(){return P(void 0,void 0,void 0,(function(){return E(this,(function(e){return l(""),y.trackEvent("excerpt_generator_discarded"),[2]}))}))},children:(0,p.__)("Discard","wp-parsely")})]}):(0,a.jsx)(s.Button,{onClick:function(){return P(void 0,void 0,void 0,(function(){var e,t;return E(this,(function(n){switch(n.label){case 0:r(!0),_(void 0),n.label=1;case 1:return n.trys.push([1,3,4,5]),y.trackEvent("excerpt_generator_pressed"),[4,g.generateExcerpt(T,S)];case 2:return e=n.sent(),l(e),[3,5];case 3:return t=n.sent(),_(t),[3,5];case 4:return r(!1),[7];case 5:return[2]}}))}))},variant:"primary",isBusy:t,disabled:t,children:t?(0,p.__)("Generating…","wp-parsely"):(0,p.__)("Generate Excerpt","wp-parsely")})})]})]})},S=function(){return(0,a.jsx)(c.PostTypeSupportCheck,{supportKeys:"excerpt",children:(0,a.jsx)(l.PluginDocumentSettingPanel,{name:"parsely-post-excerpt",title:"Excerpt",children:(0,a.jsx)(k,{})})})};(0,n.addFilter)("plugins.registerPlugin","wp-parsely-excerpt-generator",(function(e,t){var r,a;return"wp-parsely-block-editor-sidebar"!==t||((null===(r=null===window||void 0===window?void 0:window.Jetpack_Editor_Initial_State)||void 0===r?void 0:r.available_blocks["ai-content-lens"])&&(console.log("Parse.ly: Jetpack AI is enabled and will be disabled."),(0,n.removeFilter)("blocks.registerBlockType","jetpack/ai-content-lens-features")),(0,i.registerPlugin)("wp-parsely-excerpt-generator",{render:S}),null===(a=(0,o.dispatch)("core/edit-post"))||void 0===a||a.removeEditorPanel("post-excerpt")),e}),1e3)}()}(); \ No newline at end of file +(0,p._n)("%1$s word","%1$s words",N,"wp-parsely"),N);return(0,u.useEffect)((function(){var e=document.querySelector(".editor-post-excerpt textarea");e&&(e.scrollTop=0)}),[a]),(0,i.jsxs)("div",{className:"editor-post-excerpt",children:[(0,i.jsxs)("div",{style:{position:"relative"},children:[t&&(0,i.jsx)("div",{className:"editor-post-excerpt__spinner"+(N>0?" has-word-count":""),children:(0,i.jsx)(s.Spinner,{})}),(0,i.jsx)(s.TextareaControl,{__nextHasNoMarginBottom:!0,label:(0,p.__)("Write an excerpt (optional)","wp-parsely"),className:"editor-post-excerpt__textarea",onChange:function(e){return g({excerpt:e})},disabled:t||j,value:j?a:S,help:N?A:null})]}),(0,i.jsx)(s.ExternalLink,{href:(0,p.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt","wp-parsely"),children:(0,p.__)("Learn more about manual excerpts","wp-parsely")}),(0,i.jsxs)("div",{className:"wp-parsely-excerpt-generator",children:[(0,i.jsxs)("div",{className:"wp-parsely-excerpt-generator-header",children:[(0,i.jsx)(h,{size:20}),(0,i.jsx)("div",{className:"wp-parsely-excerpt-generator-header-label",children:(0,p.__)("Parse.ly AI","wp-parsely")}),(0,i.jsx)(f,{})]}),v&&(0,i.jsx)(s.Notice,{status:"info",isDismissible:!1,className:"wp-parsely-excerpt-generator-error",children:v.Message()}),(0,i.jsx)("div",{className:"wp-parsely-excerpt-generator-controls",children:j?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.Button,{variant:"secondary",onClick:function(){return x(void 0,void 0,void 0,(function(){return E(this,(function(e){switch(e.label){case 0:return[4,g({excerpt:a})];case 1:return e.sent(),l(""),y.trackEvent("excerpt_generator_accepted"),[2]}}))}))},children:(0,p.__)("Accept","wp-parsely")}),(0,i.jsx)(s.Button,{isDestructive:!0,variant:"secondary",onClick:function(){return x(void 0,void 0,void 0,(function(){return E(this,(function(e){return l(""),y.trackEvent("excerpt_generator_discarded"),[2]}))}))},children:(0,p.__)("Discard","wp-parsely")})]}):(0,i.jsx)(s.Button,{onClick:function(){return x(void 0,void 0,void 0,(function(){var e,t;return E(this,(function(n){switch(n.label){case 0:r(!0),_(void 0),n.label=1;case 1:return n.trys.push([1,3,4,5]),y.trackEvent("excerpt_generator_pressed"),[4,b.generateExcerpt(T,k)];case 2:return e=n.sent(),l(e),[3,5];case 3:return t=n.sent(),_(t),[3,5];case 4:return r(!1),[7];case 5:return[2]}}))}))},variant:"primary",isBusy:t,disabled:t,children:t?(0,p.__)("Generating…","wp-parsely"):(0,p.__)("Generate Excerpt","wp-parsely")})})]})]})},k=function(){return(0,i.jsx)(c.PostTypeSupportCheck,{supportKeys:"excerpt",children:(0,i.jsx)(l.PluginDocumentSettingPanel,{name:"parsely-post-excerpt",title:"Excerpt",children:(0,i.jsx)(S,{})})})};(0,n.addFilter)("plugins.registerPlugin","wp-parsely-excerpt-generator",(function(e,t){var r,i;return"wp-parsely-block-editor-sidebar"!==t||((null===(r=null===window||void 0===window?void 0:window.Jetpack_Editor_Initial_State)||void 0===r?void 0:r.available_blocks["ai-content-lens"])&&(console.log("Parse.ly: Jetpack AI is enabled and will be disabled."),(0,n.removeFilter)("blocks.registerBlockType","jetpack/ai-content-lens-features")),(0,a.registerPlugin)("wp-parsely-excerpt-generator",{render:k}),null===(i=(0,o.dispatch)("core/edit-post"))||void 0===i||i.removeEditorPanel("post-excerpt")),e}),1e3)}()}(); \ No newline at end of file diff --git a/src/@types/gutenberg/types.ts b/src/@types/gutenberg/types.ts index 3cc1b76d7..e2bff35cf 100644 --- a/src/@types/gutenberg/types.ts +++ b/src/@types/gutenberg/types.ts @@ -1,3 +1,6 @@ +// eslint-disable-next-line import/named +import { BlockInstance } from '@wordpress/blocks'; + /** * Defines typings for some non-exported Gutenberg functions to avoid * intellisense errors in function calls. @@ -9,4 +12,8 @@ export interface GutenbergFunction { getEditedPostAttribute( attribute: string ): string; getEditedPostContent(): string; + getSelectedBlock(): BlockInstance | null; + getBlock( clientId: string ): BlockInstance | null; + getBlocks(): BlockInstance[]; } + diff --git a/src/Endpoints/class-base-api-proxy.php b/src/Endpoints/class-base-api-proxy.php index e09bdafa2..39ed2413f 100644 --- a/src/Endpoints/class-base-api-proxy.php +++ b/src/Endpoints/class-base-api-proxy.php @@ -93,9 +93,10 @@ public function __construct( Parsely $parsely, Remote_API_Interface $api ) { /** * Registers the endpoint's WP REST route. * - * @param string $endpoint The endpoint's route (e.g. /stats/posts). + * @param string $endpoint The endpoint's route (e.g. /stats/posts). + * @param array $methods The HTTP methods to use for the endpoint. */ - protected function register_endpoint( string $endpoint ): void { + protected function register_endpoint( string $endpoint, array $methods = array( WP_REST_Server::READABLE ) ): void { if ( ! apply_filters( 'wp_parsely_enable_' . convert_endpoint_to_filter_key( $endpoint ) . '_api_proxy', true ) ) { return; } @@ -116,7 +117,7 @@ protected function register_endpoint( string $endpoint ): void { $rest_route_args = array( array( - 'methods' => WP_REST_Server::READABLE, + 'methods' => $methods, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'is_available_to_current_user' ), 'args' => $get_items_args, diff --git a/src/Endpoints/content-suggestions/class-suggest-links-api-proxy.php b/src/Endpoints/content-suggestions/class-suggest-links-api-proxy.php new file mode 100644 index 000000000..a6c3a8f41 --- /dev/null +++ b/src/Endpoints/content-suggestions/class-suggest-links-api-proxy.php @@ -0,0 +1,138 @@ +suggest_links_api = new Suggest_Links_API( $parsely ); + parent::__construct( $parsely, $this->suggest_links_api ); + } + + /** + * Registers the endpoint's WP REST route. + * + * @since 3.14.0 + */ + public function run(): void { + $this->register_endpoint( '/content-suggestions/suggest-links', array( 'POST' ) ); + } + + /** + * Generates the final data from the passed response. + * + * @since 3.14.0 + * + * @param array $response The response received by the proxy. + * @return array The generated data. + */ + protected function generate_data( $response ): array { + // Unused function. + return $response; + } + + /** + * Cached "proxy" to the Parse.ly API endpoint. + * + * @since 3.14.0 + * + * @param WP_REST_Request $request The request object. + * @return stdClass|WP_Error stdClass containing the data or a WP_Error + * object on failure. + */ + public function get_items( WP_REST_Request $request ) { + $validation = $this->validate_apikey_and_secret(); + if ( is_wp_error( $validation ) ) { + return $validation; + } + + /** + * The post content to be sent to the API. + * + * @var string|null $post_content + */ + $post_content = $request->get_param( 'content' ); + + /** + * The maximum amount of words of the link text. + * + * @var string|null $max_link_words + */ + $max_link_words = $request->get_param( 'max_link_words' ); + + /** + * The maximum number of links to return. + * + * @var string|null $max_links + */ + $max_links = $request->get_param( 'max_links' ); + + if ( null === $post_content ) { + return new WP_Error( + 'parsely_content_not_set', + __( 'A post content must be set to use this endpoint', 'wp-parsely' ), + array( 'status' => 403 ) + ); + } + + if ( is_numeric( $max_link_words ) ) { + $max_link_words = (int) $max_link_words; + } else { + $max_link_words = 4; + } + + if ( is_numeric( $max_links ) ) { + $max_links = (int) $max_links; + } else { + $max_links = 10; + } + + $response = $this->suggest_links_api->get_links( + $post_content, + $max_link_words, + $max_links + ); + + if ( is_wp_error( $response ) ) { + return $response; + } + + return (object) array( + 'data' => $response, + ); + } +} diff --git a/src/Endpoints/user-meta/class-editor-sidebar-settings-endpoint.php b/src/Endpoints/user-meta/class-editor-sidebar-settings-endpoint.php index db85feb67..aeab38e5d 100644 --- a/src/Endpoints/user-meta/class-editor-sidebar-settings-endpoint.php +++ b/src/Endpoints/user-meta/class-editor-sidebar-settings-endpoint.php @@ -69,6 +69,22 @@ protected function get_subvalues_specs(): array { 'values' => array( '10m', '1h', '2h', '4h', '24h', '7d', '30d' ), 'default' => '7d', ), + 'SmartLinkingMaxLinks' => array( + 'values' => array(), + 'default' => 10, + ), + 'SmartLinkingMaxLinkWords' => array( + 'values' => array(), + 'default' => 4, + ), + 'SmartLinkingOpen' => array( + 'values' => array( true, false ), + 'default' => false, + ), + 'SmartLinkingSettingsOpen' => array( + 'values' => array( true, false ), + 'default' => false, + ), 'TitleSuggestionsOpen' => array( 'values' => array( true, false ), 'default' => false, diff --git a/src/RemoteAPI/content-suggestions/class-link-suggestion.php b/src/RemoteAPI/content-suggestions/class-link-suggestion.php new file mode 100644 index 000000000..1caa97d5a --- /dev/null +++ b/src/RemoteAPI/content-suggestions/class-link-suggestion.php @@ -0,0 +1,48 @@ + $max_link_words, + 'max_links' => $max_links, + ); + + $decoded = $this->post_request( $query, array( 'text' => $content ) ); + + if ( is_wp_error( $decoded ) ) { + return $decoded; + } + + if ( ! property_exists( $decoded, 'links' ) || + ! is_array( $decoded->links ) ) { + return new WP_Error( + 400, + __( 'Unable to parse meta description from upstream API', 'wp-parsely' ) + ); + } + + // Convert the links to Link_Suggestion objects. + $links = array(); + foreach ( $decoded->links as $link ) { + $link_obj = new Link_Suggestion(); + $link_obj->href = $link->href; + $link_obj->title = $link->title; + $link_obj->text = $link->text; + $link_obj->offset = $link->offset; + $links[] = $link_obj; + } + + return $links; + } +} diff --git a/src/content-helper/common/content-helper-error.tsx b/src/content-helper/common/content-helper-error.tsx index 4321ac36f..48f4f8359 100644 --- a/src/content-helper/common/content-helper-error.tsx +++ b/src/content-helper/common/content-helper-error.tsx @@ -26,6 +26,7 @@ export enum ContentHelperErrorCode { ParselyApiReturnedNoData = 'ch_parsely_api_returned_no_data', ParselyApiReturnedTooManyResults = 'ch_parsely_api_returned_too_many_results', ParselyApiUnauthorized = 401, // Intentionally without quotes. + ParselyInternalServerError = 500, // Intentionally without quotes. PluginCredentialsNotSetMessageDetected = 'parsely_credentials_not_set_message_detected', PluginSettingsApiSecretNotSet = 'parsely_api_secret_not_set', PluginSettingsSiteIdNotSet = 'parsely_site_id_not_set', @@ -64,6 +65,27 @@ export class ContentHelperError extends Error { // Set the prototype explicitly. Object.setPrototypeOf( this, ContentHelperError.prototype ); + + // Errors that need rephrasing. + if ( this.code === ContentHelperErrorCode.ParselyApiUnauthorized ) { + this.message = __( + 'This feature is accessible to select customers participating in its beta testing.', + 'wp-parsely' + ); + } + if ( this.code === ContentHelperErrorCode.ParselyInternalServerError ) { + this.message = __( + 'The Parse.ly API returned an internal server error. Please try again later.', + 'wp-parsely' + ); + } + if ( this.code === ContentHelperErrorCode.HttpRequestFailed && + this.message.includes( 'cURL error 28' ) ) { + this.message = __( + 'The Parse.ly API did not respond in a timely manner. Please try again later.', + 'wp-parsely' + ); + } } /** @@ -104,14 +126,6 @@ export class ContentHelperError extends Error { ) ); } - // Errors that need rephrasing. - if ( this.code === ContentHelperErrorCode.ParselyApiUnauthorized ) { - this.message = __( - 'This feature is accessible to select customers participating in its beta testing.', - 'wp-parsely' - ); - } - return ( ( +export const LeafIcon = ( { size = 24, className = 'wp-parsely-icon' } ) => ( void; + /** * Defines the data structure exposed by the Sidebar about the currently opened * Post. @@ -72,9 +76,14 @@ interface GutenbergFunction { * * @return {SidebarSettings} The resulting settings object. */ -export const getSettingsFromJson = ( settingsJson: string ): SidebarSettings => { +export const getSettingsFromJson = ( settingsJson: string = '' ): SidebarSettings => { let parsedSettings: SidebarSettings; + // If the settings are empty, try to get them from the global variable. + if ( '' === settingsJson ) { + settingsJson = window.wpParselyContentHelperSettings; + } + try { parsedSettings = JSON.parse( settingsJson ); } catch ( e ) { @@ -87,6 +96,10 @@ export const getSettingsFromJson = ( settingsJson: string ): SidebarSettings => SettingsMetric: Metric.Views, SettingsOpen: true, SettingsPeriod: Period.Days7, + SmartLinkingMaxLinks: DEFAULT_MAX_LINKS, + SmartLinkingMaxLinkWords: DEFAULT_MAX_LINK_WORDS, + SmartLinkingOpen: false, + SmartLinkingSettingsOpen: false, TitleSuggestionsOpen: false, TitleSuggestionsPersona: PARSELY_PERSONAS.journalist.label, TitleSuggestionsSettingsOpen: false, @@ -116,6 +129,18 @@ export const getSettingsFromJson = ( settingsJson: string ): SidebarSettings => if ( ! isInEnum( parsedSettings?.SettingsPeriod, Period ) ) { parsedSettings.SettingsPeriod = Period.Days7; } + if ( typeof parsedSettings?.SmartLinkingMaxLinks !== 'number' ) { + parsedSettings.SmartLinkingMaxLinks = DEFAULT_MAX_LINKS; + } + if ( typeof parsedSettings?.SmartLinkingMaxLinkWords !== 'number' ) { + parsedSettings.SmartLinkingMaxLinkWords = DEFAULT_MAX_LINK_WORDS; + } + if ( typeof parsedSettings?.SmartLinkingOpen !== 'boolean' ) { + parsedSettings.SmartLinkingOpen = false; + } + if ( typeof parsedSettings?.SmartLinkingSettingsOpen !== 'boolean' ) { + parsedSettings.SmartLinkingSettingsOpen = false; + } if ( typeof parsedSettings?.TitleSuggestionsOpen !== 'boolean' ) { parsedSettings.TitleSuggestionsOpen = false; } @@ -315,7 +340,7 @@ const ContentHelperEditorSidebar = (): JSX.Element => { > { + + } + title={ __( 'Smart Linking', 'wp-parsely' ) } + initialOpen={ settings.SmartLinkingOpen } + onToggle={ ( next ) => { + setSettings( { + SmartLinkingOpen: next, + } ); + trackToggle( 'smart_linking', next ); + } } + > + + + + + ); @@ -399,9 +443,12 @@ registerPlugin( BLOCK_PLUGIN_ID, { render: () => ( ), } ); + +// Initialize Smart Linking. +initSmartLinking(); diff --git a/src/content-helper/editor-sidebar/smart-linking/component-block-overlay.tsx b/src/content-helper/editor-sidebar/smart-linking/component-block-overlay.tsx new file mode 100644 index 000000000..f2cf9335d --- /dev/null +++ b/src/content-helper/editor-sidebar/smart-linking/component-block-overlay.tsx @@ -0,0 +1,146 @@ +/** + * WordPress dependencies + */ +import { Spinner } from '@wordpress/components'; +import { dispatch, useSelect } from '@wordpress/data'; +import { createPortal, useEffect, useState } from '@wordpress/element'; +import { __ } from '@wordpress/i18n'; + +/** + * Internal dependencies + */ +import { SmartLinkingStore } from './store'; + +/** + * Defines the props structure for BlockOverlay. + * + * @since 3.14.0 + */ +type BlockOverlayProps = { + selectedBlockClientId: string; + label: string; +}; + +/** + * Draws an overlay over the selected block. + * + * @since 3.14.0 + * + * @param {BlockOverlayProps} props The component's props. + * + * @return {JSX.Element} The JSX Element. + */ +export const BlockOverlay = ( { + selectedBlockClientId, + label, +}: Readonly ): JSX.Element => { + // Create a container element for the overlay. + const [ container ] = useState( document.createElement( 'div' ) ); + container.className = 'wp-parsely-block-overlay'; + if ( selectedBlockClientId === 'all' ) { + container.className += ' full-content-overlay'; + } + + // When clicking the overlay, we want the underlying block to be selected. + container.onclick = ( e ) => { + e.stopPropagation(); + e.stopImmediatePropagation(); + + if ( selectedBlockClientId === 'all' ) { + return; + } + + dispatch( 'core/block-editor' ).selectBlock( selectedBlockClientId, -1 ); + + // When nested blocks are selected, the block editor will focus the outermost block. + // We need to blur the focused element to avoid this. + const activeElement = container.ownerDocument.activeElement; + ( activeElement as HTMLElement ).blur(); + }; + + useEffect( () => { + if ( ! selectedBlockClientId ) { + return; + } + + /** + * If the selected block is the "All content" block, we need to append the overlay + * to the editor element instead of the block element. + */ + if ( selectedBlockClientId === 'all' ) { + const editorElement = document.querySelector( '.interface-navigable-region.interface-interface-skeleton__content' ); + editorElement?.appendChild( container ); + + // Set overflow to hidden. + editorElement?.setAttribute( 'style', 'overflow: hidden' ); + container.style.top = editorElement?.scrollTop + 'px'; + + return () => { + if ( editorElement?.contains( container ) ) { + editorElement.removeChild( container ); + } + // Restore overflow. + editorElement?.setAttribute( 'style', '' ); + container.style.top = ''; + }; + } + + const blockElement = document.querySelector( `[data-block="${ selectedBlockClientId }"]` ); + + // Disable changes on the block element. + blockElement?.setAttribute( 'contenteditable', 'false' ); + blockElement?.setAttribute( 'aria-disabled', 'true' ); + + // Insert the container in the block element. + blockElement?.appendChild( container ); + + // Remove the container on component unload. + return () => { + // Enable changes on the block element. + blockElement?.setAttribute( 'contenteditable', 'true' ); + blockElement?.removeAttribute( 'aria-disabled' ); + + if ( blockElement?.contains( container ) ) { + blockElement.removeChild( container ); + } + }; + } ); + + return createPortal( +
+ + { label } +
, + container + ); +}; + +/** + * Draws the multiple block overlays that are currently stored in the Smart Linking store. + * + * @since 3.14.0 + * + * @return {JSX.Element} The JSX Element. + */ +export const BlockOverlayContainer = ( ): JSX.Element => { + const { overlayBlocks } = useSelect( ( select ) => { + const { getOverlayBlocks } = select( SmartLinkingStore ); + + return { + overlayBlocks: getOverlayBlocks(), + }; + }, [] ); + + return ( + <> + { overlayBlocks.map( ( blockId ) => ( + + ) ) } + + ); +}; + diff --git a/src/content-helper/editor-sidebar/smart-linking/component-settings.tsx b/src/content-helper/editor-sidebar/smart-linking/component-settings.tsx new file mode 100644 index 000000000..d8192d32f --- /dev/null +++ b/src/content-helper/editor-sidebar/smart-linking/component-settings.tsx @@ -0,0 +1,129 @@ +/** + * WordPress dependencies + */ +import { BaseControl, Button, RangeControl } from '@wordpress/components'; +import { useDispatch, useSelect } from '@wordpress/data'; +import { __ } from '@wordpress/i18n'; +import { settings } from '@wordpress/icons'; + +/** + * Internal dependencies + */ +import { Telemetry } from '../../../js/telemetry/telemetry'; +import { LeafIcon } from '../../common/icons/leaf-icon'; +import { OnSettingChangeFunction } from '../editor-sidebar'; +import { DEFAULT_MAX_LINK_WORDS, DEFAULT_MAX_LINKS } from './smart-linking'; +import { SmartLinkingStore } from './store'; + +/** + * Defines the props structure for SmartLinkingSettings. + * + * @since 3.14.0 + */ +type SmartLinkingSettingsProps = { + disabled?: boolean; + onSettingChange: OnSettingChangeFunction +}; + +/** + * Settings for the Smart Linking. + * + * @since 3.14.0 + * + * @param {SmartLinkingSettingsProps} props The component's props. + * + * @return {JSX.Element} The JSX Element. + */ +export const SmartLinkingSettings = ( { + disabled = false, + onSettingChange, +}: Readonly ): JSX.Element => { + /** + * Gets the settings from the Smart Linking store. + * + * @since 3.14.0 + */ + const { + maxLinks, + maxLinkWords, + settingsOpen, + } = useSelect( ( select ) => { + const { getMaxLinkWords, getMaxLinks, areSettingsOpen } = select( SmartLinkingStore ); + + return { + maxLinks: getMaxLinks(), + maxLinkWords: getMaxLinkWords(), + settingsOpen: areSettingsOpen(), + }; + }, [] ); + + const { + setMaxLinks, + setMaxLinkWords, + setSettingsOpen, + } = useDispatch( SmartLinkingStore ); + + /** + * Toggles the settings panel. + * + * @since 3.14.0 + */ + const toggleSetting = (): void => { + onSettingChange( 'SmartLinkingSettingsOpen', ! settingsOpen ); + setSettingsOpen( ! settingsOpen ); + + Telemetry.trackEvent( 'smart_linking_ai_settings_toggled', { + is_active: ! settingsOpen, + } ); + }; + + return ( +
+
+ + +
+ { settingsOpen && ( +
+ { + setMaxLinks( value ?? 1 ); + onSettingChange( 'SmartLinkingMaxLinks', value ?? DEFAULT_MAX_LINKS ); + } } + label={ __( 'Links limit', 'wp-parsely' ) } + help={ __( 'The maximum number of smart links to add in the content.', 'wp-parsely' ) } + min={ 1 } + max={ 20 } + /> + { + setMaxLinkWords( value ?? 1 ); + onSettingChange( 'SmartLinkingMaxLinkWords', value ?? DEFAULT_MAX_LINK_WORDS ); + } } + label={ __( 'Link length', 'wp-parsely' ) } + help={ __( 'The maximum length (in words) for the smart link.', 'wp-parsely' ) } + min={ 1 } + max={ 8 } + /> +
+ ) } +
+ ); +}; diff --git a/src/content-helper/editor-sidebar/smart-linking/component.tsx b/src/content-helper/editor-sidebar/smart-linking/component.tsx new file mode 100644 index 000000000..e5dd67fce --- /dev/null +++ b/src/content-helper/editor-sidebar/smart-linking/component.tsx @@ -0,0 +1,437 @@ +/** + * WordPress dependencies + */ +import { Button, CheckboxControl, Disabled, Notice, PanelRow } from '@wordpress/components'; +import { dispatch, select, useDispatch, useSelect } from '@wordpress/data'; +import { useEffect, useState } from '@wordpress/element'; +import { __, sprintf } from '@wordpress/i18n'; + +/** + * Internal dependencies + */ +import { GutenbergFunction } from '../../../@types/gutenberg/types'; +import { Telemetry } from '../../../js/telemetry/telemetry'; +import { SidebarSettings, useSettings } from '../../common/settings'; +import { SmartLinkingSettings } from './component-settings'; +import { SmartLinkingProvider, LinkSuggestion } from './provider'; +import { SmartLinkingSettingsProps, SmartLinkingStore } from './store'; +import { escapeRegExp, replaceNthOccurrence } from './utils'; + +/** + * Defines the props structure for SmartLinkingPanel. + * + * @since 3.14.0 + */ +type SmartLinkingPanelProps = { + className?: string; + selectedBlockClientId?: string; + context?: SmartLinkingPanelContext; +} + +/** + * Defines the possible contexts in which the Smart Linking panel can be used. + * + * @since 3.14.0 + */ +export enum SmartLinkingPanelContext { + Unknown = 'unknown', + ContentHelperSidebar = 'content_helper_sidebar', + BlockInspector = 'block_inspector', +} + +/** + * Smart Linking Panel. + * + * @since 3.14.0 + * + * @param { Readonly } props The component's props. + * + * @return { JSX.Element } The JSX Element. + */ +export const SmartLinkingPanel = ( { + className, + selectedBlockClientId, + context = SmartLinkingPanelContext.Unknown, +}: Readonly ): JSX.Element => { + const { settings, setSettings } = useSettings(); + const [ hint, setHint ] = useState( null ); + + /** + * Loads the Smart Linking store. + * + * @since 3.14.0 + */ + const { + loading, + fullContent, + overlayBlocks, + error, + suggestedLinks, + maxLinks, + maxLinkWords, + smartLinkingSettings, + } = useSelect( ( selectFn ) => { + const { + isLoading, + getOverlayBlocks, + getSuggestedLinks, + getError, + isFullContent, + getMaxLinks, + getMaxLinkWords, + getSmartLinkingSettings, + } = selectFn( SmartLinkingStore ); + return { + loading: isLoading(), + error: getError(), + maxLinks: getMaxLinks(), + maxLinkWords: getMaxLinkWords(), + fullContent: isFullContent(), + overlayBlocks: getOverlayBlocks(), + suggestedLinks: getSuggestedLinks(), + smartLinkingSettings: getSmartLinkingSettings(), + }; + }, [] ); + + /** + * Loads the Smart Linking store actions. + * + * @since 3.14.0 + */ + const { + setLoading, + setFullContent, + setError, + setSuggestedLinks, + addOverlayBlock, + removeOverlayBlock, + setSmartLinkingSettings, + } = useDispatch( SmartLinkingStore ); + + /** + * Handles the change of a setting. + * + * Updates the settings in the Smart Linking store and the Settings Context. + * + * @since 3.14.0 + * + * @param { keyof SidebarSettings } setting The setting to change. + * @param { string | boolean | number } value The new value of the setting. + */ + const onSettingChange = ( setting: keyof SidebarSettings, value: string|boolean|number ): void => { + setSettings( { [ setting ]: value } ); + setSmartLinkingSettings( { [ setting ]: value } ); + }; + + /** + * Loads and prepares the Smart Linking settings from the Settings Context, + * if they are not already loaded. + * + * @since 3.14.0 + */ + useEffect( () => { + // If the smartLinkingSettings are not empty object, return early. + if ( Object.keys( smartLinkingSettings ).length > 0 ) { + return; + } + + // Load the settings from the WordPress database and store them in the Smart Linking store. + const newSmartLinkingSettings: SmartLinkingSettingsProps = { + maxLinksPerPost: settings.SmartLinkingMaxLinks, + maxLinkWords: settings.SmartLinkingMaxLinkWords, + settingsOpen: settings.SmartLinkingSettingsOpen, + }; + setSmartLinkingSettings( newSmartLinkingSettings ); + }, [ setSmartLinkingSettings, settings ] ); // eslint-disable-line react-hooks/exhaustive-deps + + /** + * Loads the selected block and post content. + * + * @since 3.14.0 + */ + const { + selectedBlock, + postContent, + } = useSelect( ( selectFn ) => { + const { getSelectedBlock, getBlock } = selectFn( 'core/block-editor' ) as GutenbergFunction; + const { getEditedPostContent } = selectFn( 'core/editor' ) as GutenbergFunction; + + return { + selectedBlock: selectedBlockClientId ? getBlock( selectedBlockClientId ) : getSelectedBlock(), + postContent: getEditedPostContent(), + }; + }, [ selectedBlockClientId ] ); + + /** + * Resets the hint when the selected block changes. + */ + useEffect( () => { + setHint( null ); + }, [ selectedBlock ] ); + + /** + * Generates smart links for the selected block or the entire post content. + * + * @since 3.14.0 + */ + const generateSmartLinks = () => async (): Promise => { + await setLoading( true ); + await setSuggestedLinks( null ); + await setError( null ); + + Telemetry.trackEvent( 'smart_linking_generate_pressed', { + is_full_content: fullContent, + selected_block: selectedBlock?.name ?? 'none', + context, + } ); + + // If selected block is not set, the overlay will be applied to the entire content. + await applyOverlay( fullContent ? 'all' : selectedBlock?.clientId ); + + // After 60 seconds without a response, timeout and remove any overlay. + const timeout = setTimeout( () => { + setLoading( false ); + Telemetry.trackEvent( 'smart_linking_generate_timeout', { + is_full_content: fullContent, + selected_block: selectedBlock?.name ?? 'none', + context, + } ); + + // If selected block is not set, the overlay will be removed from the entire content. + removeOverlay( fullContent ? 'all' : selectedBlock?.clientId ); + }, 60000 ); + + try { + const generatingFullContent = fullContent || ! selectedBlock; + let generatedLinks = []; + if ( selectedBlock?.originalContent && ! generatingFullContent ) { + generatedLinks = await SmartLinkingProvider.generateSmartLinks( + selectedBlock?.originalContent, + maxLinkWords, + maxLinks + ); + } else { + generatedLinks = await SmartLinkingProvider.generateSmartLinks( + postContent, + maxLinkWords, + maxLinks + ); + } + await setSuggestedLinks( generatedLinks ); + applySmartLinks( generatedLinks ); + } catch ( e: any ) { // eslint-disable-line @typescript-eslint/no-explicit-any + setError( e ); + } finally { + await setLoading( false ); + await removeOverlay( fullContent ? 'all' : selectedBlock?.clientId ); + clearTimeout( timeout ); + } + }; + + /** + * Applies the smart links to the selected block or the entire post content. + * + * @since 3.14.0 + * + * @param {LinkSuggestion[]} links The smart links to apply. + */ + const applySmartLinks = ( links: LinkSuggestion[] ): void => { + Telemetry.trackEvent( 'smart_linking_applied', { + is_full_content: fullContent, + selected_block: selectedBlock?.name ?? 'none', + links_count: links.length, + context, + } ); + + // Get the original content of the selected block or the entire post content. + let originalContent = ''; + if ( selectedBlock && ! fullContent ) { + originalContent = selectedBlock.attributes.content; + } else { + originalContent = postContent; + } + + let newContent = originalContent; // Fallback to original content if no links are found. + for ( const link of links ) { + // Check if the content already contains the link, skip if so. + if ( originalContent.includes( link.title ) && originalContent.includes( link.href ) ) { + continue; + } + + // Escape the link text to convert regex special characters to literal characters. + link.text = escapeRegExp( link.text ); + + // Check if the amount of link.text occurrences in the newContent is bigger than the amount of + // link.text occurrences in the originalContent, if so, it means that we've introduced another + // occurrence of the link.text in the newContent, so we need to increase the offset. + const linkTextRegex = new RegExp( link.text, 'g' ); + const newContentMatches = newContent.match( linkTextRegex ); + const originalContentMatches = originalContent.match( linkTextRegex ); + if ( ( newContentMatches && originalContentMatches ) && + newContentMatches?.length > originalContentMatches?.length ) { + link.offset++; + } + + const anchor = `${ link.text }`; + + // Regex that searches for the link.text, but if the text is inside an HTML anchor, + // the anchor itself is also selected and replaced with the new anchor. + const searchRegex = new RegExp( `(${ link.text }|]*>${ link.text })` ); + newContent = replaceNthOccurrence( newContent, searchRegex, anchor, link.offset ); + } + + // Either update the selected block or the entire post content. + if ( selectedBlock && ! fullContent ) { + dispatch( 'core/block-editor' ).updateBlockAttributes( selectedBlock.clientId, { content: newContent } ); + } else { + dispatch( 'core/editor' ).editPost( { content: newContent } ); + } + }; + + /** + * Applies the overlay to the selected block or the entire post content. + * + * @since 3.14.0 + * + * @param {string} clientId The client ID of the block to apply the overlay to.\ + * If set to 'all', the overlay will be applied to the entire post content. + */ + const applyOverlay = async ( clientId: string = 'all' ): Promise => { + await addOverlayBlock( clientId ); + disableSave(); + }; + + /** + * Removes the overlay from the selected block or the entire post content. + * + * @since 3.14.0 + * + * @param {string} clientId The client ID of the block to remove the overlay from. + * If set to 'all', the overlay will be removed from the entire post content. + */ + const removeOverlay = async ( clientId: string = 'all' ): Promise => { + await removeOverlayBlock( clientId ); + + // Select a block after removing the overlay, only if we're using the block inspector. + if ( context === SmartLinkingPanelContext.BlockInspector ) { + if ( 'all' !== clientId && ! fullContent ) { + dispatch( 'core/block-editor' ).selectBlock( clientId ); + } else { + const firstBlock = select( 'core/block-editor' ).getBlockOrder()[ 0 ]; + // Select the first block in the post. + dispatch( 'core/block-editor' ).selectBlock( firstBlock ); + } + } + + // If there are no more overlay blocks, enable save. + if ( overlayBlocks.length === 0 ) { + enableSave(); + } + }; + + /** + * Disables the save button and locks post auto-saving. + * + * @since 3.14.0 + */ + const disableSave = (): void => { + // Lock post saving. + dispatch( 'core/editor' ).lockPostSaving( 'wp-parsely-block-overlay' ); + + // Disable save buttons. + const saveButtons = document.querySelectorAll( '.edit-post-header__settings>[type="button"]' ); + saveButtons.forEach( ( button ) => { + button.setAttribute( 'disabled', 'disabled' ); + } ); + }; + + /** + * Enables the save button and unlocks post auto-saving. + * + * @since 3.14.0 + */ + const enableSave = (): void => { + // Enable save buttons. + const saveButtons = document.querySelectorAll( '.edit-post-header__settings>[type="button"]' ); + saveButtons.forEach( ( button ) => { + button.removeAttribute( 'disabled' ); + } ); + + // Unlock post saving. + dispatch( 'core/editor' ).unlockPostSaving( 'wp-parsely-block-overlay' ); + }; + + return ( +
+ +
+ { __( + 'Automatically insert links to your most relevant, top performing content.', + 'wp-parsely' + ) } +   + + { __( 'Learn how Smart Linking works.', 'wp-parsely' ) } + +
+ { error && ( + + { error.message } + + ) } + { suggestedLinks !== null && ( + + { + /* translators: 1 - number of smart links generated */ + sprintf( __( 'Successfully added %s smart links.', 'wp-parsely' ), suggestedLinks.length ) + } + + ) } + +
+ + { hint && + setHint( null ) } + className="wp-parsely-smart-linking-hint" + > + { __( 'Hint:', 'wp-parsely' ) } { hint } + } + + { + if ( ! selectedBlock ) { + setHint( __( 'If you want to target a specific block, you should select it on the block editor.', + 'wp-parsely' ) ); + } + } } + onChange={ + selectedBlock + ? setFullContent + : () => { + /* empty */ + } + } + label={ __( 'Add smart links for the entire post', 'wp-parsely' ) } + /> + +
+
+
+ ); +}; diff --git a/src/content-helper/editor-sidebar/smart-linking/provider.ts b/src/content-helper/editor-sidebar/smart-linking/provider.ts new file mode 100644 index 000000000..ee7a617d7 --- /dev/null +++ b/src/content-helper/editor-sidebar/smart-linking/provider.ts @@ -0,0 +1,86 @@ +/** + * WordPress dependencies + */ +import apiFetch from '@wordpress/api-fetch'; +import { addQueryArgs } from '@wordpress/url'; + +/** + * Internal dependencies + */ +import { ContentHelperError, ContentHelperErrorCode } from '../../common/content-helper-error'; +import { DEFAULT_MAX_LINK_WORDS, DEFAULT_MAX_LINKS } from './smart-linking'; + +/** + * Structure of a link suggestion returned by the + * `content-suggestions/suggest-links` endpoint. + * + * @since 3.14.0 + */ +export type LinkSuggestion = { + href: string; + text: string; + title: string; + offset: number; +}; + +/** + * Specifies the form of the response returned by the + * `content-suggestions/suggest-links` WordPress REST API endpoint. + * + * @since 3.14.0 + */ +interface SmartLinkingApiResponse { + error?: Error; + data: LinkSuggestion[]; +} + +/** + * Returns data from the `content-suggestions/suggest-links` WordPress REST API + * endpoint. + * + * @since 3.14.0 + */ +export class SmartLinkingProvider { + /** + * Returns a list of suggested links for the given content. + * + * @param {string} content The content to generate links for. + * @param {number} maxLinkWords The maximum number of words in links. + * @param {number} maxLinksPerPost The maximum number of links to return. + * + * @return {Promise} The resulting list of links. + */ + static async generateSmartLinks( + content: string, + maxLinkWords: number = DEFAULT_MAX_LINK_WORDS, + maxLinksPerPost: number = DEFAULT_MAX_LINKS, + ): Promise { + let response; + + try { + response = await apiFetch( { + method: 'POST', + path: addQueryArgs( '/wp-parsely/v1/content-suggestions/suggest-links', { + max_link_words: maxLinkWords, + max_links: maxLinksPerPost, + } ), + data: { + content, + }, + } ); + } catch ( wpError: any ) { // eslint-disable-line @typescript-eslint/no-explicit-any + return Promise.reject( new ContentHelperError( wpError.message, wpError.code ) ); + } + + if ( response?.error ) { + return Promise.reject( + new ContentHelperError( + response.error.message, + ContentHelperErrorCode.ParselyApiResponseContainsError, + ), + ); + } + + return response.data ?? []; + } +} diff --git a/src/content-helper/editor-sidebar/smart-linking/smart-linking.scss b/src/content-helper/editor-sidebar/smart-linking/smart-linking.scss new file mode 100644 index 000000000..f6cd26ff8 --- /dev/null +++ b/src/content-helper/editor-sidebar/smart-linking/smart-linking.scss @@ -0,0 +1,99 @@ +@import "../../common/css/variables"; +@import "../../common/css/functions"; + +.wp-parsely-block-overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(255, 255, 255, 0.85); + display: flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + + .wp-parsely-block-overlay-label { + flex-grow: 1; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + pointer-events: none; + user-select: none; + } + + svg { + width: to_rem(25px); + height: to_rem(25px); + } + + &.full-content-overlay { + z-index: 999; + font-size: to_rem(20px); + + span { + margin-top: to_rem(15px); + } + + svg { + width: to_rem(50px); + height: to_rem(50px); + } + } +} + +.wp-parsely-panel { + + .wp-parsely-icon { + order: -1; + margin-right: to_rem(5px); + } +} + +.wp-parsely-smart-linking { + + .components-panel__row { + flex-direction: column; + } + + .wp-parsely-smart-linking-text { + margin-bottom: to_rem(10px); + } + + .wp-parsely-smart-linking-generate { + display: flex; + flex-direction: column; + align-items: center; + + button { + margin: to_rem(10px) 0; + } + + .components-disabled .components-checkbox-control__label { + color: var(--gray-500); + } + + .components-button { + width: fit-content; + margin-bottom: to_rem(10px); + } + + .components-base-control { + margin-bottom: 0 !important; + margin-top: to_rem(10px); + + .components-base-control__field { + display: flex; + } + } + } + + .wp-parsely-smart-linking-suggested-links { + margin: 0; + } + + .wp-parsely-smart-linking-hint { + margin: 0; + } +} diff --git a/src/content-helper/editor-sidebar/smart-linking/smart-linking.tsx b/src/content-helper/editor-sidebar/smart-linking/smart-linking.tsx new file mode 100644 index 000000000..196bbf18b --- /dev/null +++ b/src/content-helper/editor-sidebar/smart-linking/smart-linking.tsx @@ -0,0 +1,124 @@ +/** + * WordPress dependencies + */ +import { InspectorControls } from '@wordpress/block-editor'; +import { PanelBody } from '@wordpress/components'; +import { compose, createHigherOrderComponent } from '@wordpress/compose'; +import { addFilter } from '@wordpress/hooks'; +import { registerPlugin } from '@wordpress/plugins'; + +/** + * Internal dependencies + */ +import { Telemetry } from '../../../js/telemetry/telemetry'; +import { BetaBadge } from '../../common/components/beta-badge'; +import { LeafIcon } from '../../common/icons/leaf-icon'; +import { SettingsProvider, SidebarSettings, useSettings } from '../../common/settings'; +import { VerifyCredentials } from '../../common/verify-credentials'; +import { getSettingsFromJson } from '../editor-sidebar'; +import { SmartLinkingPanel, SmartLinkingPanelContext } from './component'; +import { BlockOverlayContainer } from './component-block-overlay'; +import './smart-linking.scss'; + +export const DEFAULT_MAX_LINKS = 10; + +export const DEFAULT_MAX_LINK_WORDS = 4; + +/** + * Higher order component to add the settings provider to the block edit component. + * This is required to provide the settings to the smart linking panel. + * + * @since 3.14.0 + */ +const withSettingsProvider = createHigherOrderComponent( ( BlockEdit ) => { + return ( props ) => { + if ( ! props.isSelected || props.name !== 'core/paragraph' ) { + return ; + } + + return ( + + + + ); + }; +}, 'withSettingsProvider' ); + +/** + * Smart linking inspector control panel component. + * + * @since 3.14.0 + */ +const SmartLinkingInspectorControlPanel = createHigherOrderComponent( ( BlockEdit ) => { + return ( props ) => { + if ( ! props.isSelected || props.name !== 'core/paragraph' ) { + return ; + } + + const { settings, setSettings } = useSettings(); + return ( + <> + + { /* @ts-ignore */ } + + } + onToggle={ ( next ) => { + setSettings( { SmartLinkingOpen: next } ); + Telemetry.trackEvent( 'smart_linking_block_inspector_panel_toggled', { open: next } ); + } } + > + + + + + + + ); + }; +}, 'withSmartLinkingPanel' ); + +/** + * The smart linking panel with settings provider. + * This is the final component that is added to the block inspector. + * + * @since 3.14.0 + */ +const SmartLinkingPanelWithSettingsProvider = compose( + withSettingsProvider, + SmartLinkingInspectorControlPanel +); + +/** + * Initializes the smart linking, by adding the smart linking panel to the paragraph block. + * Also registers the block overlay container. + * + * @since 3.14.0 + */ +export const initSmartLinking = (): void => { + /** + * Add smart linking inspector control panel to paragraph block. + */ + addFilter( + 'editor.BlockEdit', + 'wpparsely/smart-linking-inspector-control-panel', + SmartLinkingPanelWithSettingsProvider + ); + + /** + * Register the block overlay container to allow drawing the overlay over the blocks + * that are being processed. + */ + registerPlugin( 'wp-parsely-block-overlay', { + render: BlockOverlayContainer, + } ); +}; diff --git a/src/content-helper/editor-sidebar/smart-linking/store.ts b/src/content-helper/editor-sidebar/smart-linking/store.ts new file mode 100644 index 000000000..69f261c49 --- /dev/null +++ b/src/content-helper/editor-sidebar/smart-linking/store.ts @@ -0,0 +1,253 @@ +/** + * WordPress dependencies + */ +import { createReduxStore, register } from '@wordpress/data'; +import { ContentHelperError } from '../../common/content-helper-error'; +import { DEFAULT_MAX_LINK_WORDS, DEFAULT_MAX_LINKS } from './smart-linking'; + +/** + * Internal dependencies + */ +import { LinkSuggestion } from './provider'; + +export type SmartLinkingSettingsProps = { + settingsOpen?: boolean; + maxLinkWords?: number; + maxLinksPerPost?: number; +}; + +/** + * The shape of the SmartLinking store state. + */ +type SmartLinkingState = { + isLoading: boolean; + fullContent: boolean; + error: ContentHelperError | null; + settings: SmartLinkingSettingsProps; + suggestedLinks: LinkSuggestion[] | null; + overlayBlocks: string[]; +}; + +/** Actions */ +interface SetLoadingAction { + type: 'SET_LOADING'; + isLoading: boolean; +} + +interface SetErrorAction { + type: 'SET_ERROR'; + error: ContentHelperError | null; +} + +interface SetOverlayBlocksAction { + type: 'SET_OVERLAY_BLOCKS'; + overlayBlocks: string[]; +} + +interface AddOverlayBlockAction { + type: 'ADD_OVERLAY_BLOCK'; + block: string; +} + +interface RemoveOverlayBlockAction { + type: 'REMOVE_OVERLAY_BLOCK'; + block: string; +} + +interface SetFullContentAction { + type: 'SET_FULL_CONTENT'; + fullContent: boolean; +} + +interface SetSettingsAction { + type: 'SET_SETTINGS'; + settings: SmartLinkingSettingsProps; +} + +interface SetSuggestedLinksAction { + type: 'SET_SUGGESTED_LINKS'; + suggestedLinks: LinkSuggestion[] | null; +} + +type ActionTypes = SetLoadingAction | SetOverlayBlocksAction | SetSettingsAction | + AddOverlayBlockAction | RemoveOverlayBlockAction |SetFullContentAction | + SetSuggestedLinksAction | SetErrorAction; + +const defaultState: SmartLinkingState = { + isLoading: false, + fullContent: false, + suggestedLinks: null, + error: null, + settings: { }, + overlayBlocks: [], +}; + +/** + * The SmartLinking store. + * + * @since 3.14.0 + */ +export const SmartLinkingStore = createReduxStore( 'wp-parsely/smart-linking', { + initialState: defaultState, + reducer( state: SmartLinkingState = defaultState, action: ActionTypes ): SmartLinkingState { + switch ( action.type ) { + case 'SET_LOADING': + return { + ...state, + isLoading: action.isLoading, + }; + case 'SET_OVERLAY_BLOCKS': + return { + ...state, + overlayBlocks: action.overlayBlocks, + }; + case 'SET_ERROR': + return { + ...state, + error: action.error, + }; + case 'ADD_OVERLAY_BLOCK': + return { + ...state, + overlayBlocks: [ ...state.overlayBlocks, action.block ], + }; + case 'REMOVE_OVERLAY_BLOCK': + // If the action is 'all', remove all overlay blocks. + if ( action.block === 'all' ) { + return { + ...state, + overlayBlocks: [], + }; + } + return { + ...state, + overlayBlocks: state.overlayBlocks.filter( ( block ) => block !== action.block ), + }; + case 'SET_FULL_CONTENT': + return { + ...state, + fullContent: action.fullContent, + }; + case 'SET_SETTINGS': + return { + ...state, + settings: { + ...state.settings, + ...action.settings, + }, + }; + case 'SET_SUGGESTED_LINKS': + return { + ...state, + suggestedLinks: action.suggestedLinks, + }; + default: + return state; + } + }, + actions: { + setLoading( isLoading: boolean ): SetLoadingAction { + return { + type: 'SET_LOADING', + isLoading, + }; + }, + setOverlayBlocks( overlayBlocks: string[] ): SetOverlayBlocksAction { + return { + type: 'SET_OVERLAY_BLOCKS', + overlayBlocks, + }; + }, + setError( error: ContentHelperError | null ): SetErrorAction { + return { + type: 'SET_ERROR', + error, + }; + }, + addOverlayBlock( block: string ): AddOverlayBlockAction { + return { + type: 'ADD_OVERLAY_BLOCK', + block, + }; + }, + removeOverlayBlock( block: string ): RemoveOverlayBlockAction { + return { + type: 'REMOVE_OVERLAY_BLOCK', + block, + }; + }, + setFullContent( fullContent: boolean ): SetFullContentAction { + return { + type: 'SET_FULL_CONTENT', + fullContent, + }; + }, + setSmartLinkingSettings( settings: SmartLinkingSettingsProps ): SetSettingsAction { + return { + type: 'SET_SETTINGS', + settings, + }; + }, + setMaxLinkWords( maxLinkWords: number ): SetSettingsAction { + return { + type: 'SET_SETTINGS', + settings: { + maxLinkWords, + }, + }; + }, + setMaxLinks( maxLinksPerPost: number ): SetSettingsAction { + return { + type: 'SET_SETTINGS', + settings: { + maxLinksPerPost, + }, + }; + }, + setSettingsOpen( settingsOpen: boolean ): SetSettingsAction { + return { + type: 'SET_SETTINGS', + settings: { + settingsOpen, + }, + }; + }, + setSuggestedLinks( suggestedLinks: LinkSuggestion[] | null ): SetSuggestedLinksAction { + return { + type: 'SET_SUGGESTED_LINKS', + suggestedLinks, + }; + }, + }, + selectors: { + isLoading( state: SmartLinkingState ): boolean { + return state.isLoading; + }, + isFullContent( state: SmartLinkingState ): boolean { + return state.fullContent; + }, + getError( state: SmartLinkingState ): ContentHelperError | null { + return state.error; + }, + getSmartLinkingSettings( state: SmartLinkingState ): SmartLinkingSettingsProps { + return state.settings; + }, + getOverlayBlocks( state: SmartLinkingState ): string[] { + return state.overlayBlocks; + }, + areSettingsOpen( state: SmartLinkingState ): boolean { + return state.settings.settingsOpen ?? false; + }, + getMaxLinkWords( state: SmartLinkingState ): number { + return state.settings.maxLinkWords ?? DEFAULT_MAX_LINK_WORDS; + }, + getMaxLinks( state: SmartLinkingState ): number { + return state.settings.maxLinksPerPost ?? DEFAULT_MAX_LINKS; + }, + getSuggestedLinks( state: SmartLinkingState ): LinkSuggestion[] | null { + return state.suggestedLinks; + }, + }, +} ); + +register( SmartLinkingStore ); diff --git a/src/content-helper/editor-sidebar/smart-linking/utils.ts b/src/content-helper/editor-sidebar/smart-linking/utils.ts new file mode 100644 index 000000000..681098612 --- /dev/null +++ b/src/content-helper/editor-sidebar/smart-linking/utils.ts @@ -0,0 +1,51 @@ +/** + * Replaces the nth occurrence of a substring within a string. + * + * If the search string does not occur n times, the original string is returned. + * + * @since 3.14.0 + * + * @param {string} inputString The original string. + * @param {string} search The substring to search for. + * @param {string} replacement The replacement string. + * @param {number} n The 0-based index of the occurrence to replace. + * + * @return {string} The string containing the replacement, or the original string. + */ +export function replaceNthOccurrence( + inputString: string, search: RegExp, replacement: string, n: number +): string { + let match; + let i = 0; + + // Ensure the global flag is set to find all occurrences. + const globalSearch = new RegExp( + search.source, 'g' + ( search.ignoreCase ? 'i' : '' ) + ( search.multiline ? 'm' : '' ) + ); + + while ( ( match = globalSearch.exec( inputString ) ) !== null ) { + if ( i === n ) { + // Replace the nth occurrence + const contentBefore = inputString.substring( 0, match.index ); + const contentAfter = inputString.substring( globalSearch.lastIndex ); + return contentBefore + replacement + contentAfter; + } + i++; + } + + // Return the original string if the nth occurrence is not found. + return inputString; +} + +/** + * Escapes special characters in a string for use in a regular expression. + * + * @since 3.14.0 + * + * @param {string} string - The string to be escaped. + * + * @return {string} The escaped string. + */ +export function escapeRegExp( string: string ): string { + return string.replace( /[.*+?^${}()|[\]\\]/g, '\\$&' ); // $& means the whole matched string. +} diff --git a/src/content-helper/editor-sidebar/title-suggestions/component-settings.tsx b/src/content-helper/editor-sidebar/title-suggestions/component-settings.tsx index 7ea2da6bb..c320fea71 100644 --- a/src/content-helper/editor-sidebar/title-suggestions/component-settings.tsx +++ b/src/content-helper/editor-sidebar/title-suggestions/component-settings.tsx @@ -57,12 +57,12 @@ export const TitleSuggestionsSettings = ( { }; return ( -
-
+
+
{ isSettingActive && ( -
+
'views', 'SettingsOpen' => true, 'SettingsPeriod' => '7d', + 'SmartLinkingMaxLinks' => 10, + 'SmartLinkingMaxLinkWords' => 4, + 'SmartLinkingOpen' => false, + 'SmartLinkingSettingsOpen' => false, 'TitleSuggestionsOpen' => false, 'TitleSuggestionsPersona' => 'journalist', 'TitleSuggestionsSettingsOpen' => false, @@ -208,7 +212,7 @@ protected function generate_json( $array['SettingsPeriod'] = $settings_period; } - ksort( $array ); + ksort( $array, SORT_NATURAL | SORT_FLAG_CASE ); return $this->wp_json_encode( array_merge( $array, $extra_data ) ); } diff --git a/tests/Integration/RemoteAPI/content-suggestions/SuggestLinksAPITest.php b/tests/Integration/RemoteAPI/content-suggestions/SuggestLinksAPITest.php new file mode 100644 index 000000000..e7bfe28f7 --- /dev/null +++ b/tests/Integration/RemoteAPI/content-suggestions/SuggestLinksAPITest.php @@ -0,0 +1,162 @@ + + */ + public function data_api_url(): iterable { + yield 'Basic (Expected data)' => array( + array( + 'apikey' => 'my-key', + 'secret' => 'my-secret', + 'max_link_words' => '4', + 'max_links' => '10', + ), + Parsely::PUBLIC_SUGGESTIONS_API_BASE_URL . + '/suggest-links?apikey=my-key&max_link_words=4&max_links=10&secret=my-secret', + ); + } + + /** + * Mocks a successful HTTP response to the Content Suggestion suggest-links + * API endpoint. + * + * @since 3.14.0 + * + * @param string $response The response to mock. + * @param array $args The arguments passed to the HTTP request. + * @param string $url The URL of the HTTP request. + * @return array|false The mocked response. + * + * @phpstan-ignore-next-line + */ + public function mock_successful_suggest_links_response( + string $response, + array $args, + string $url + ) { + if ( ! str_contains( $url, 'suggest-links' ) ) { + return false; + } + + $response = array( + 'links' => array( + array( + 'href' => 'http://example.com/article-1', + 'title' => 'Cool article 1', + 'text' => 'Lorem ipsum', + 'offset' => 0, + ), + array( + 'href' => 'http://example.com/article-2', + 'title' => 'A great article 2', + 'text' => 'maximus', + 'offset' => 0, + ), + array( + 'href' => 'http://example.com/article-3', + 'title' => 'Yet another great article 3', + 'text' => 'maximus', + 'offset' => 1, + ), + ), + ); + + return array( + 'headers' => array(), + 'cookies' => array(), + 'filename' => null, + 'response' => array( + 'code' => 200, + 'message' => 'OK', + ), + 'status_code' => 200, + 'success' => true, + 'body' => $this->wp_json_encode( $response ), + ); + } + + /** + * Tests getting smart links suggestions from the API. + * + * @since 3.14.0 + * + * @covers \Parsely\RemoteAPI\ContentSuggestions\Suggest_Links_API::get_links + * @uses \Parsely\Parsely::api_secret_is_set + * @uses \Parsely\Parsely::get_managed_credentials + * @uses \Parsely\Parsely::get_options + * @uses \Parsely\Parsely::get_site_id + * @uses \Parsely\Parsely::set_default_track_as_values + * @uses \Parsely\Parsely::site_id_is_set + * @uses \Parsely\RemoteAPI\Base_Endpoint_Remote::get_api_url + * @uses \Parsely\RemoteAPI\ContentSuggestions\Content_Suggestions_Base_API::get_request_options + * @uses \Parsely\RemoteAPI\ContentSuggestions\Content_Suggestions_Base_API::post_request + */ + public function test_get_links(): void { + $content = '

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec maximus metus sed urna maximus, + et malesuada dui placerat. Donec risus dui, dictum nec interdum eu, malesuada non diam. Curabitur + in erat eu nisi scelerisque tristique eu nec tortor. Nam fermentum rutrum mi id scelerisque. +

'; + + // Mock API result. + add_filter( 'pre_http_request', array( $this, 'mock_successful_suggest_links_response' ), 10, 3 ); + + // Test getting three titles. + $suggested_links = self::$suggest_links_api->get_links( $content ); + + self::assertIsArray( $suggested_links ); + self::assertEquals( 3, count( $suggested_links ) ); + + // Assert the structure the suggested links, and if the object is a Link_Suggestion + // instance. + foreach ( $suggested_links as $suggested_link ) { + self::assertIsObject( $suggested_link ); + self::assertInstanceOf( 'Parsely\RemoteAPI\ContentSuggestions\Link_Suggestion', $suggested_link ); + } + + // Remove mock. + remove_filter( 'pre_http_request', array( $this, 'mock_successful_write_titles_response' ) ); + } +} diff --git a/wp-parsely.php b/wp-parsely.php index b8c1308f9..51693e3f1 100644 --- a/wp-parsely.php +++ b/wp-parsely.php @@ -32,6 +32,7 @@ use Parsely\Content_Helper\Post_List_Stats; use Parsely\Endpoints\Analytics_Post_Detail_API_Proxy; use Parsely\Endpoints\Analytics_Posts_API_Proxy; +use Parsely\Endpoints\ContentSuggestions\Suggest_Links_API_Proxy; use Parsely\Endpoints\ContentSuggestions\Suggest_Meta_Description_API_Proxy; use Parsely\Endpoints\ContentSuggestions\Write_Title_API_Proxy; use Parsely\Endpoints\GraphQL_Metadata; @@ -45,6 +46,7 @@ use Parsely\Integrations\Integrations; use Parsely\RemoteAPI\Analytics_Post_Detail_API; use Parsely\RemoteAPI\Analytics_Posts_API; +use Parsely\RemoteAPI\ContentSuggestions\Suggest_Links_API; use Parsely\RemoteAPI\ContentSuggestions\Suggest_Meta_Description_API; use Parsely\RemoteAPI\ContentSuggestions\Write_Title_API; use Parsely\RemoteAPI\Referrers_Post_Detail_API; @@ -165,6 +167,7 @@ function parsely_wp_admin_early_register(): void { require_once __DIR__ . '/src/Endpoints/class-referrers-post-detail-api-proxy.php'; require_once __DIR__ . '/src/Endpoints/class-related-api-proxy.php'; require_once __DIR__ . '/src/Endpoints/class-rest-metadata.php'; +require_once __DIR__ . '/src/Endpoints/content-suggestions/class-suggest-links-api-proxy.php'; require_once __DIR__ . '/src/Endpoints/content-suggestions/class-suggest-meta-description-api-proxy.php'; require_once __DIR__ . '/src/Endpoints/content-suggestions/class-write-title-api-proxy.php'; require_once __DIR__ . '/src/Endpoints/user-meta/class-dashboard-widget-settings-endpoint.php'; @@ -184,6 +187,7 @@ function parsely_wp_admin_early_register(): void { require_once __DIR__ . '/src/RemoteAPI/class-referrers-post-detail-api.php'; require_once __DIR__ . '/src/RemoteAPI/class-related-api.php'; require_once __DIR__ . '/src/RemoteAPI/class-validate-api.php'; +require_once __DIR__ . '/src/RemoteAPI/content-suggestions/class-suggest-links-api.php'; require_once __DIR__ . '/src/RemoteAPI/content-suggestions/class-suggest-meta-description-api.php'; require_once __DIR__ . '/src/RemoteAPI/content-suggestions/class-write-title-api.php'; @@ -238,6 +242,12 @@ function parsely_rest_api_init(): void { Suggest_Meta_Description_API_Proxy::class, $wp_cache ); + + parsely_run_rest_api_endpoint( + Suggest_Links_API::class, + Suggest_Links_API_Proxy::class, + $wp_cache + ); } require_once __DIR__ . '/src/blocks/recommendations/class-recommendations-block.php'; From 95edd579a897b4e8d59e317e310f0ce0ac9db2ae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 01:36:05 +0000 Subject: [PATCH 026/110] build(deps-dev): bump @wordpress/core-data from 6.27.2 to 6.28.1 Bumps [@wordpress/core-data](https://github.com/WordPress/gutenberg/tree/HEAD/packages/core-data) from 6.27.2 to 6.28.1. - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/core-data/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/core-data@6.28.1/packages/core-data) --- updated-dependencies: - dependency-name: "@wordpress/core-data" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 1251 +++++++++++++++++---------------------------- package.json | 2 +- 2 files changed, 479 insertions(+), 774 deletions(-) diff --git a/package-lock.json b/package-lock.json index a3d7d4869..6701315a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "@wordpress/blocks": "^12.26.0", "@wordpress/components": "^26.0.0", "@wordpress/compose": "^6.18.0", - "@wordpress/core-data": "^6.26.0", + "@wordpress/core-data": "^6.28.1", "@wordpress/data": "^9.19.0", "@wordpress/e2e-test-utils": "^10.22.0", "@wordpress/edit-post": "^7.24.0", @@ -2305,22 +2305,28 @@ } }, "node_modules/@floating-ui/dom": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.5.1.tgz", - "integrity": "sha512-KwvVcPSXg6mQygvA1TjbN/gh///36kKtllIF8SUm0qpFj8+rvYrpvlYdL1JoA71SHpDqgSSdGOSoQ0Mp3uY5aw==", + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.3.tgz", + "integrity": "sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw==", "dev": true, "dependencies": { - "@floating-ui/core": "^1.4.1", - "@floating-ui/utils": "^0.1.1" + "@floating-ui/core": "^1.0.0", + "@floating-ui/utils": "^0.2.0" } }, + "node_modules/@floating-ui/dom/node_modules/@floating-ui/utils": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.1.tgz", + "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==", + "dev": true + }, "node_modules/@floating-ui/react-dom": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.2.tgz", - "integrity": "sha512-5qhlDvjaLmAst/rKb3VdlCinwTF4EYMiVxuuc/HVUjs46W0zgtbMmAZ1UTsDrRTxRmUEzl92mOtWbeeXL26lSQ==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.8.tgz", + "integrity": "sha512-HOdqOt3R3OGeTKidaLvJKcgg75S6tibQ3Tif4eyd91QnIJWr0NLvoXFpJA/j8HqkFSL68GDca9AuyWEHlhyClw==", "dev": true, "dependencies": { - "@floating-ui/dom": "^1.5.1" + "@floating-ui/dom": "^1.6.1" }, "peerDependencies": { "react": ">=16.8.0", @@ -7091,9 +7097,9 @@ } }, "node_modules/@wordpress/autop": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/autop/-/autop-3.50.0.tgz", - "integrity": "sha512-4E0vq2MvSOVDKXs4OulIbTdKU6S5O9QjT4qc63rAd0uiKGBYV12ViPzmwbJ6k38zOO0PKdcwlVCj55Gq4aoPDw==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/autop/-/autop-3.51.0.tgz", + "integrity": "sha512-n33dunOrA3lLNXlHHVzU0f5Sns67XvxHTYd86cdBLZFLDeScfCnFzJ4+5K4l+1ayuNK511Njf+76Z0vYKrGc9w==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -7144,9 +7150,9 @@ "dev": true }, "node_modules/@wordpress/blob": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/blob/-/blob-3.50.0.tgz", - "integrity": "sha512-QvBhsW9WPdsOJhJ0BxzZ83i+cH/gAdjJ1iHY4Rkb02qbZEz4jhdvucGQf2oVnWwvAsFiFPKWk7CwAM5XjoahCA==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/blob/-/blob-3.51.0.tgz", + "integrity": "sha512-DICMSq7Y6gI6Lz+euG1v1xsIExIFrQ8bcINmnUmwcujgHckm0BaJwAKXXO4CHQVwNLWbHZiu5ySuzorw5rhG8w==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -7156,44 +7162,44 @@ } }, "node_modules/@wordpress/block-editor": { - "version": "12.18.2", - "resolved": "https://registry.npmjs.org/@wordpress/block-editor/-/block-editor-12.18.2.tgz", - "integrity": "sha512-LDZIcp5Bl2FCyfkf07XgfM0kzY+AYhyTS4kt2U4GRSeUey79AM+GIYXb8TM2Y68B09HP/rpntBW4e/cBqjHfjw==", + "version": "12.19.1", + "resolved": "https://registry.npmjs.org/@wordpress/block-editor/-/block-editor-12.19.1.tgz", + "integrity": "sha512-ZzG0XiakM5GHVvpJw0MTEYmX0WPJJwGegMTbhkSCrMnsAY0uRpYjrZwbSbPoweFdBpkIWdKs7W9BGIQ69WVcsA==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@react-spring/web": "^9.4.5", - "@wordpress/a11y": "^3.50.0", - "@wordpress/api-fetch": "^6.47.0", - "@wordpress/blob": "^3.50.0", - "@wordpress/blocks": "^12.27.1", - "@wordpress/commands": "^0.21.0", - "@wordpress/components": "^25.16.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/data": "^9.20.0", - "@wordpress/date": "^4.50.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/escape-html": "^2.50.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/keyboard-shortcuts": "^4.27.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/notices": "^4.18.0", - "@wordpress/preferences": "^3.27.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/style-engine": "^1.33.1", - "@wordpress/token-list": "^2.50.0", - "@wordpress/url": "^3.51.0", - "@wordpress/warning": "^2.50.0", - "@wordpress/wordcount": "^3.50.0", + "@wordpress/a11y": "^3.51.0", + "@wordpress/api-fetch": "^6.48.0", + "@wordpress/blob": "^3.51.0", + "@wordpress/blocks": "^12.28.1", + "@wordpress/commands": "^0.22.1", + "@wordpress/components": "^26.0.1", + "@wordpress/compose": "^6.28.0", + "@wordpress/data": "^9.21.0", + "@wordpress/date": "^4.51.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/dom": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/escape-html": "^2.51.0", + "@wordpress/hooks": "^3.51.0", + "@wordpress/html-entities": "^3.51.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/icons": "^9.42.0", + "@wordpress/is-shallow-equal": "^4.51.0", + "@wordpress/keyboard-shortcuts": "^4.28.0", + "@wordpress/keycodes": "^3.51.0", + "@wordpress/notices": "^4.19.0", + "@wordpress/preferences": "^3.28.1", + "@wordpress/private-apis": "^0.33.0", + "@wordpress/rich-text": "^6.28.1", + "@wordpress/style-engine": "^1.34.0", + "@wordpress/token-list": "^2.51.0", + "@wordpress/url": "^3.52.0", + "@wordpress/warning": "^2.51.0", + "@wordpress/wordcount": "^3.51.0", "change-case": "^4.1.2", "classnames": "^2.3.1", "colord": "^2.7.0", @@ -7219,19 +7225,19 @@ } }, "node_modules/@wordpress/block-editor/node_modules/@wordpress/commands": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.21.0.tgz", - "integrity": "sha512-MzMUGCT9cQXto1jrA5lHAtnieTyAhcuNIxfyxlcE+316KNQfbyD8bc7KOzSV2sxXD/rfHuCxvHjfomFyyP+4kA==", + "version": "0.22.1", + "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.22.1.tgz", + "integrity": "sha512-lA5LH7fyV0ov8QgZ1cetstTH9pQL+3b0RAYoR/MJJLOzlEdg7NXbb2vIKTYZ13oF1Oo4oIdrG+JDUeL94wVVvQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/components": "^25.16.0", - "@wordpress/data": "^9.20.0", - "@wordpress/element": "^5.27.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/keyboard-shortcuts": "^4.27.0", - "@wordpress/private-apis": "^0.32.0", + "@wordpress/components": "^26.0.1", + "@wordpress/data": "^9.21.0", + "@wordpress/element": "^5.28.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/icons": "^9.42.0", + "@wordpress/keyboard-shortcuts": "^4.28.0", + "@wordpress/private-apis": "^0.33.0", "classnames": "^2.3.1", "cmdk": "^0.2.0", "rememo": "^4.0.2" @@ -7244,7 +7250,74 @@ "react-dom": "^18.0.0" } }, - "node_modules/@wordpress/block-editor/node_modules/@wordpress/components": { + "node_modules/@wordpress/block-editor/node_modules/@wordpress/private-apis": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.33.0.tgz", + "integrity": "sha512-Dc8y7m17gAKnDVFOPDqPcb2jo9cDhDNikLdepTkRXLywYUPT2PFH4GrXsVK87BLc+nCIqgs3DFU/AJx1db4y/w==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.16.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@wordpress/block-library": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@wordpress/block-library/-/block-library-8.24.0.tgz", + "integrity": "sha512-dztSfFa6S6QjlwS477HhPtjLHUc9UpC/qr2UFRvLA7euYdiEEIlYIHH/JlD9VHXJfQb5eA9lr9f3jMulU3PeSw==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.16.0", + "@wordpress/a11y": "^3.47.0", + "@wordpress/api-fetch": "^6.44.0", + "@wordpress/autop": "^3.47.0", + "@wordpress/blob": "^3.47.0", + "@wordpress/block-editor": "^12.15.0", + "@wordpress/blocks": "^12.24.0", + "@wordpress/components": "^25.13.0", + "@wordpress/compose": "^6.24.0", + "@wordpress/core-data": "^6.24.0", + "@wordpress/data": "^9.17.0", + "@wordpress/date": "^4.47.0", + "@wordpress/deprecated": "^3.47.0", + "@wordpress/dom": "^3.47.0", + "@wordpress/element": "^5.24.0", + "@wordpress/escape-html": "^2.47.0", + "@wordpress/hooks": "^3.47.0", + "@wordpress/html-entities": "^3.47.0", + "@wordpress/i18n": "^4.47.0", + "@wordpress/icons": "^9.38.0", + "@wordpress/interactivity": "^3.0.0", + "@wordpress/keycodes": "^3.47.0", + "@wordpress/notices": "^4.15.0", + "@wordpress/primitives": "^3.45.0", + "@wordpress/private-apis": "^0.29.0", + "@wordpress/reusable-blocks": "^4.24.0", + "@wordpress/rich-text": "^6.24.0", + "@wordpress/server-side-render": "^4.24.0", + "@wordpress/url": "^3.48.0", + "@wordpress/viewport": "^5.24.0", + "@wordpress/wordcount": "^3.47.0", + "change-case": "^4.1.2", + "classnames": "^2.3.1", + "colord": "^2.7.0", + "escape-html": "^1.0.3", + "fast-average-color": "^9.1.1", + "fast-deep-equal": "^3.1.3", + "memize": "^2.1.0", + "remove-accents": "^0.5.0", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, + "node_modules/@wordpress/block-library/node_modules/@wordpress/components": { "version": "25.16.0", "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", @@ -7309,7 +7382,7 @@ "react-dom": "^18.0.0" } }, - "node_modules/@wordpress/block-editor/node_modules/@wordpress/private-apis": { + "node_modules/@wordpress/block-library/node_modules/@wordpress/components/node_modules/@wordpress/private-apis": { "version": "0.32.0", "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", @@ -7321,7 +7394,7 @@ "node": ">=12" } }, - "node_modules/@wordpress/block-editor/node_modules/uuid": { + "node_modules/@wordpress/block-library/node_modules/uuid": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", @@ -7334,52 +7407,117 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/@wordpress/block-library": { - "version": "8.24.0", - "resolved": "https://registry.npmjs.org/@wordpress/block-library/-/block-library-8.24.0.tgz", - "integrity": "sha512-dztSfFa6S6QjlwS477HhPtjLHUc9UpC/qr2UFRvLA7euYdiEEIlYIHH/JlD9VHXJfQb5eA9lr9f3jMulU3PeSw==", + "node_modules/@wordpress/block-serialization-default-parser": { + "version": "4.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/block-serialization-default-parser/-/block-serialization-default-parser-4.51.0.tgz", + "integrity": "sha512-GQQ6hu7exCmk8KN7wW2Mvmo1CZjBC8sVZZ87lwciKYs963AKrFSySS6JIvI1fxJagHVAddP1MbW5xLYrFt+ISg==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.16.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@wordpress/blocks": { + "version": "12.28.1", + "resolved": "https://registry.npmjs.org/@wordpress/blocks/-/blocks-12.28.1.tgz", + "integrity": "sha512-eOmNQQyaXiYQLyW5U+pTkX/+2nFcRc+hGJKQhCbPzotWlFeOexTu1J7X9drfN7ikfFSYxtG2EGWMgHcY2PtU5A==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.16.0", + "@wordpress/autop": "^3.51.0", + "@wordpress/blob": "^3.51.0", + "@wordpress/block-serialization-default-parser": "^4.51.0", + "@wordpress/compose": "^6.28.0", + "@wordpress/data": "^9.21.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/dom": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/hooks": "^3.51.0", + "@wordpress/html-entities": "^3.51.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/is-shallow-equal": "^4.51.0", + "@wordpress/private-apis": "^0.33.0", + "@wordpress/rich-text": "^6.28.1", + "@wordpress/shortcode": "^3.51.0", + "change-case": "^4.1.2", + "colord": "^2.7.0", + "fast-deep-equal": "^3.1.3", + "hpq": "^1.3.0", + "is-plain-object": "^5.0.0", + "memize": "^2.1.0", + "react-is": "^18.2.0", + "rememo": "^4.0.2", + "remove-accents": "^0.5.0", + "showdown": "^1.9.1", + "simple-html-tokenizer": "^0.5.7", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "react": "^18.0.0" + } + }, + "node_modules/@wordpress/blocks/node_modules/@wordpress/private-apis": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.33.0.tgz", + "integrity": "sha512-Dc8y7m17gAKnDVFOPDqPcb2jo9cDhDNikLdepTkRXLywYUPT2PFH4GrXsVK87BLc+nCIqgs3DFU/AJx1db4y/w==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.16.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@wordpress/blocks/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "node_modules/@wordpress/blocks/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@wordpress/browserslist-config": { + "version": "5.34.0", + "resolved": "https://registry.npmjs.org/@wordpress/browserslist-config/-/browserslist-config-5.34.0.tgz", + "integrity": "sha512-LafF3XoetOAN99bktOzc9hSOv7cPoQEe0/KPgiw24t77xvRqLuWww+zYbiHAHYSzdBGngrlNwRLgloSifnp+hg==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@wordpress/commands": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.18.0.tgz", + "integrity": "sha512-qJyAz2WtpRcJIKWtdkI5wWAnjx5aU9NdsZNW59xf9k9Uh3N1+1dvfFl3FJpR3pGCJv3dmuyFaWXJNYXqswXj/w==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.47.0", - "@wordpress/api-fetch": "^6.44.0", - "@wordpress/autop": "^3.47.0", - "@wordpress/blob": "^3.47.0", - "@wordpress/block-editor": "^12.15.0", - "@wordpress/blocks": "^12.24.0", "@wordpress/components": "^25.13.0", - "@wordpress/compose": "^6.24.0", - "@wordpress/core-data": "^6.24.0", "@wordpress/data": "^9.17.0", - "@wordpress/date": "^4.47.0", - "@wordpress/deprecated": "^3.47.0", - "@wordpress/dom": "^3.47.0", "@wordpress/element": "^5.24.0", - "@wordpress/escape-html": "^2.47.0", - "@wordpress/hooks": "^3.47.0", - "@wordpress/html-entities": "^3.47.0", "@wordpress/i18n": "^4.47.0", "@wordpress/icons": "^9.38.0", - "@wordpress/interactivity": "^3.0.0", - "@wordpress/keycodes": "^3.47.0", - "@wordpress/notices": "^4.15.0", - "@wordpress/primitives": "^3.45.0", + "@wordpress/keyboard-shortcuts": "^4.24.0", "@wordpress/private-apis": "^0.29.0", - "@wordpress/reusable-blocks": "^4.24.0", - "@wordpress/rich-text": "^6.24.0", - "@wordpress/server-side-render": "^4.24.0", - "@wordpress/url": "^3.48.0", - "@wordpress/viewport": "^5.24.0", - "@wordpress/wordcount": "^3.47.0", - "change-case": "^4.1.2", "classnames": "^2.3.1", - "colord": "^2.7.0", - "escape-html": "^1.0.3", - "fast-average-color": "^9.1.1", - "fast-deep-equal": "^3.1.3", - "memize": "^2.1.0", - "remove-accents": "^0.5.0", - "uuid": "^9.0.1" + "cmdk": "^0.2.0", + "rememo": "^4.0.2" }, "engines": { "node": ">=12" @@ -7389,217 +7527,7 @@ "react-dom": "^18.0.0" } }, - "node_modules/@wordpress/block-library/node_modules/@wordpress/components": { - "version": "25.16.0", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", - "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", - "dev": true, - "dependencies": { - "@ariakit/react": "^0.3.12", - "@babel/runtime": "^7.16.0", - "@emotion/cache": "^11.7.1", - "@emotion/css": "^11.7.1", - "@emotion/react": "^11.7.1", - "@emotion/serialize": "^1.0.2", - "@emotion/styled": "^11.6.0", - "@emotion/utils": "^1.0.0", - "@floating-ui/react-dom": "^2.0.1", - "@types/gradient-parser": "0.1.3", - "@types/highlight-words-core": "1.2.1", - "@use-gesture/react": "^10.2.24", - "@wordpress/a11y": "^3.50.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/date": "^4.50.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/escape-html": "^2.50.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/primitives": "^3.48.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/warning": "^2.50.0", - "change-case": "^4.1.2", - "classnames": "^2.3.1", - "colord": "^2.7.0", - "date-fns": "^2.28.0", - "deepmerge": "^4.3.0", - "dom-scroll-into-view": "^1.2.1", - "downshift": "^6.0.15", - "fast-deep-equal": "^3.1.3", - "framer-motion": "^10.13.0", - "gradient-parser": "^0.1.5", - "highlight-words-core": "^1.2.2", - "is-plain-object": "^5.0.0", - "memize": "^2.1.0", - "path-to-regexp": "^6.2.1", - "re-resizable": "^6.4.0", - "react-colorful": "^5.3.1", - "reakit": "^1.3.11", - "remove-accents": "^0.5.0", - "use-lilius": "^2.0.1", - "uuid": "^9.0.1", - "valtio": "1.7.0" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" - } - }, - "node_modules/@wordpress/block-library/node_modules/@wordpress/components/node_modules/@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.16.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@wordpress/block-library/node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true, - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/@wordpress/block-serialization-default-parser": { - "version": "4.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/block-serialization-default-parser/-/block-serialization-default-parser-4.50.0.tgz", - "integrity": "sha512-ihf2vr+w2zHBOvYTPQZXDiR2IMvso8yJJtzKIHA2ZEgVQ+VVLb4X86n34hfWXtPA3i2KDW+t1WCtq56aNq3Zag==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.16.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@wordpress/blocks": { - "version": "12.27.1", - "resolved": "https://registry.npmjs.org/@wordpress/blocks/-/blocks-12.27.1.tgz", - "integrity": "sha512-9uZtuTG6+fiFV2bLn8b1gzv4BgMpBu4SDQGnvzc5f9U5GL5oYns3PP8vXDOwM2cK1DEmqPsohQWhRnz8QYZDtw==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.16.0", - "@wordpress/autop": "^3.50.0", - "@wordpress/blob": "^3.50.0", - "@wordpress/block-serialization-default-parser": "^4.50.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/data": "^9.20.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/shortcode": "^3.50.0", - "change-case": "^4.1.2", - "colord": "^2.7.0", - "fast-deep-equal": "^3.1.3", - "hpq": "^1.3.0", - "is-plain-object": "^5.0.0", - "memize": "^2.1.0", - "react-is": "^18.2.0", - "rememo": "^4.0.2", - "remove-accents": "^0.5.0", - "showdown": "^1.9.1", - "simple-html-tokenizer": "^0.5.7", - "uuid": "^9.0.1" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "react": "^18.0.0" - } - }, - "node_modules/@wordpress/blocks/node_modules/@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.16.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@wordpress/blocks/node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", - "dev": true - }, - "node_modules/@wordpress/blocks/node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true, - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/@wordpress/browserslist-config": { - "version": "5.34.0", - "resolved": "https://registry.npmjs.org/@wordpress/browserslist-config/-/browserslist-config-5.34.0.tgz", - "integrity": "sha512-LafF3XoetOAN99bktOzc9hSOv7cPoQEe0/KPgiw24t77xvRqLuWww+zYbiHAHYSzdBGngrlNwRLgloSifnp+hg==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/@wordpress/commands": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.18.0.tgz", - "integrity": "sha512-qJyAz2WtpRcJIKWtdkI5wWAnjx5aU9NdsZNW59xf9k9Uh3N1+1dvfFl3FJpR3pGCJv3dmuyFaWXJNYXqswXj/w==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.16.0", - "@wordpress/components": "^25.13.0", - "@wordpress/data": "^9.17.0", - "@wordpress/element": "^5.24.0", - "@wordpress/i18n": "^4.47.0", - "@wordpress/icons": "^9.38.0", - "@wordpress/keyboard-shortcuts": "^4.24.0", - "@wordpress/private-apis": "^0.29.0", - "classnames": "^2.3.1", - "cmdk": "^0.2.0", - "rememo": "^4.0.2" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" - } - }, - "node_modules/@wordpress/commands/node_modules/@wordpress/components": { + "node_modules/@wordpress/commands/node_modules/@wordpress/components": { "version": "25.16.0", "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", @@ -7690,9 +7618,9 @@ } }, "node_modules/@wordpress/components": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-26.0.0.tgz", - "integrity": "sha512-23poBjhN4Lgqw3mYQwrHSiF0qrfDVlwr8voqLampeNXFHgJfST13aOCeD3y9ZpML2urOKt5Mi//+Lype9p29FA==", + "version": "26.0.1", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-26.0.1.tgz", + "integrity": "sha512-kHrQVm109nXYHfoea0KlIKa8RIIMrx/vgnUb0mKKA4BGhg/kGaNW+vYnWVE5W/kGEDk+7Y8fiDnwicc5AisuBg==", "dev": true, "dependencies": { "@ariakit/react": "^0.3.12", @@ -7703,7 +7631,7 @@ "@emotion/serialize": "^1.0.2", "@emotion/styled": "^11.6.0", "@emotion/utils": "^1.0.0", - "@floating-ui/react-dom": "^2.0.1", + "@floating-ui/react-dom": "^2.0.8", "@types/gradient-parser": "0.1.3", "@types/highlight-words-core": "1.2.1", "@use-gesture/react": "^10.2.24", @@ -7722,7 +7650,7 @@ "@wordpress/keycodes": "^3.51.0", "@wordpress/primitives": "^3.49.0", "@wordpress/private-apis": "^0.33.0", - "@wordpress/rich-text": "^6.28.0", + "@wordpress/rich-text": "^6.28.1", "@wordpress/warning": "^2.51.0", "change-case": "^4.1.2", "classnames": "^2.3.1", @@ -7805,19 +7733,6 @@ "react": "^18.0.0" } }, - "node_modules/@wordpress/compose/node_modules/@wordpress/undo-manager": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-0.11.0.tgz", - "integrity": "sha512-f9izRRzLlZRBXhve1OU9sBGWRvfGU94nhENN7gtf7l31q3xdsnrGf5NE/R1yhwCAHifUFF1dVcIGC1cfT2jQIg==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.16.0", - "@wordpress/is-shallow-equal": "^4.51.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/@wordpress/core-commands": { "version": "0.16.0", "resolved": "https://registry.npmjs.org/@wordpress/core-commands/-/core-commands-0.16.0.tgz", @@ -7845,27 +7760,27 @@ } }, "node_modules/@wordpress/core-data": { - "version": "6.27.2", - "resolved": "https://registry.npmjs.org/@wordpress/core-data/-/core-data-6.27.2.tgz", - "integrity": "sha512-Jsy+vW/izrd/T36D/4b266ScobCezNYX2Me/clCmHGB4eRW3drXZPbMnWZLNEDagYr87sQcM1Namasb69dnDhA==", + "version": "6.28.1", + "resolved": "https://registry.npmjs.org/@wordpress/core-data/-/core-data-6.28.1.tgz", + "integrity": "sha512-nsWF83Ssf7QH+jPSkxv5w1PYTC7yZ281kcQBJHWcb27NWsJu0iJ6qPO/h94PItU8yOdeWQ7e6zOJ2gWSvZVtHg==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/api-fetch": "^6.47.0", - "@wordpress/block-editor": "^12.18.2", - "@wordpress/blocks": "^12.27.1", - "@wordpress/compose": "^6.27.0", - "@wordpress/data": "^9.20.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/sync": "^0.12.0", - "@wordpress/undo-manager": "^0.10.0", - "@wordpress/url": "^3.51.0", + "@wordpress/api-fetch": "^6.48.0", + "@wordpress/block-editor": "^12.19.1", + "@wordpress/blocks": "^12.28.1", + "@wordpress/compose": "^6.28.0", + "@wordpress/data": "^9.21.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/html-entities": "^3.51.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/is-shallow-equal": "^4.51.0", + "@wordpress/private-apis": "^0.33.0", + "@wordpress/rich-text": "^6.28.1", + "@wordpress/sync": "^0.13.0", + "@wordpress/undo-manager": "^0.11.0", + "@wordpress/url": "^3.52.0", "change-case": "^4.1.2", "equivalent-key-map": "^0.2.2", "fast-deep-equal": "^3.1.3", @@ -7882,9 +7797,9 @@ } }, "node_modules/@wordpress/core-data/node_modules/@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.33.0.tgz", + "integrity": "sha512-Dc8y7m17gAKnDVFOPDqPcb2jo9cDhDNikLdepTkRXLywYUPT2PFH4GrXsVK87BLc+nCIqgs3DFU/AJx1db4y/w==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -8808,15 +8723,15 @@ } }, "node_modules/@wordpress/keyboard-shortcuts": { - "version": "4.27.0", - "resolved": "https://registry.npmjs.org/@wordpress/keyboard-shortcuts/-/keyboard-shortcuts-4.27.0.tgz", - "integrity": "sha512-mpYhaSAMHXbRMp9hP08LejX/u1nLQaZONhwGSytqIhN1DQwpBbNbmV8ZNm1dnevUsYqEfPVVov6HFyPxYQ6m4w==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@wordpress/keyboard-shortcuts/-/keyboard-shortcuts-4.28.0.tgz", + "integrity": "sha512-mywx2ExlpraMt2cjHmxC4cHXLErSwJ7OkFR+6byJ7BpxQEhv9tDYrKN6LBAMtYpUeyMtdGavyNCUlFtv/r325Q==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/data": "^9.20.0", - "@wordpress/element": "^5.27.0", - "@wordpress/keycodes": "^3.50.0", + "@wordpress/data": "^9.21.0", + "@wordpress/element": "^5.28.0", + "@wordpress/keycodes": "^3.51.0", "rememo": "^4.0.2" }, "engines": { @@ -8856,14 +8771,14 @@ } }, "node_modules/@wordpress/notices": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@wordpress/notices/-/notices-4.18.0.tgz", - "integrity": "sha512-Y2XpY6niJ7NuqPBtGYvDYSPCfw/y4yxv60ahu1kYd8r5BamKSchTYwKSnV0yrx/IUfNO04VAsNq9NCUQG12pRA==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@wordpress/notices/-/notices-4.19.0.tgz", + "integrity": "sha512-9Em2R+YsdMsaOXvWkZWyi/tbDP1JHxpIgASMpoRWIteA422s01NWafwizQwY1f0kvw4JbbyMF283UXmjWnzxQw==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.50.0", - "@wordpress/data": "^9.20.0" + "@wordpress/a11y": "^3.51.0", + "@wordpress/data": "^9.21.0" }, "engines": { "node": ">=12" @@ -9045,21 +8960,21 @@ } }, "node_modules/@wordpress/preferences": { - "version": "3.27.0", - "resolved": "https://registry.npmjs.org/@wordpress/preferences/-/preferences-3.27.0.tgz", - "integrity": "sha512-LMhOHX5FI4CJHv2YhtpiEtHfLqL/pjKAMja/v7skkHPlrh64Sgzi/gep016/My5SjcR64JUD1Na2U2j/BnrBNQ==", + "version": "3.28.1", + "resolved": "https://registry.npmjs.org/@wordpress/preferences/-/preferences-3.28.1.tgz", + "integrity": "sha512-fDhp7lIAnCSHQBg5HeCQLvUh4O+VKNproMSAphLx9XpVgjak781G41Hi4Vj9/sozp24DeK1J+ONUfiYQJBh67A==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.50.0", - "@wordpress/components": "^25.16.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/data": "^9.20.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/private-apis": "^0.32.0", + "@wordpress/a11y": "^3.51.0", + "@wordpress/components": "^26.0.1", + "@wordpress/compose": "^6.28.0", + "@wordpress/data": "^9.21.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/icons": "^9.42.0", + "@wordpress/private-apis": "^0.33.0", "classnames": "^2.3.1" }, "engines": { @@ -9070,75 +8985,10 @@ "react-dom": "^18.0.0" } }, - "node_modules/@wordpress/preferences/node_modules/@wordpress/components": { - "version": "25.16.0", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", - "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", - "dev": true, - "dependencies": { - "@ariakit/react": "^0.3.12", - "@babel/runtime": "^7.16.0", - "@emotion/cache": "^11.7.1", - "@emotion/css": "^11.7.1", - "@emotion/react": "^11.7.1", - "@emotion/serialize": "^1.0.2", - "@emotion/styled": "^11.6.0", - "@emotion/utils": "^1.0.0", - "@floating-ui/react-dom": "^2.0.1", - "@types/gradient-parser": "0.1.3", - "@types/highlight-words-core": "1.2.1", - "@use-gesture/react": "^10.2.24", - "@wordpress/a11y": "^3.50.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/date": "^4.50.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/escape-html": "^2.50.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/primitives": "^3.48.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/warning": "^2.50.0", - "change-case": "^4.1.2", - "classnames": "^2.3.1", - "colord": "^2.7.0", - "date-fns": "^2.28.0", - "deepmerge": "^4.3.0", - "dom-scroll-into-view": "^1.2.1", - "downshift": "^6.0.15", - "fast-deep-equal": "^3.1.3", - "framer-motion": "^10.13.0", - "gradient-parser": "^0.1.5", - "highlight-words-core": "^1.2.2", - "is-plain-object": "^5.0.0", - "memize": "^2.1.0", - "path-to-regexp": "^6.2.1", - "re-resizable": "^6.4.0", - "react-colorful": "^5.3.1", - "reakit": "^1.3.11", - "remove-accents": "^0.5.0", - "use-lilius": "^2.0.1", - "uuid": "^9.0.1", - "valtio": "1.7.0" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" - } - }, "node_modules/@wordpress/preferences/node_modules/@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.33.0.tgz", + "integrity": "sha512-Dc8y7m17gAKnDVFOPDqPcb2jo9cDhDNikLdepTkRXLywYUPT2PFH4GrXsVK87BLc+nCIqgs3DFU/AJx1db4y/w==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -9147,19 +8997,6 @@ "node": ">=12" } }, - "node_modules/@wordpress/preferences/node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true, - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/@wordpress/prettier-config": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/@wordpress/prettier-config/-/prettier-config-3.8.0.tgz", @@ -9347,9 +9184,9 @@ } }, "node_modules/@wordpress/rich-text": { - "version": "6.28.0", - "resolved": "https://registry.npmjs.org/@wordpress/rich-text/-/rich-text-6.28.0.tgz", - "integrity": "sha512-Fl0TQOELar08jtRWus2qRz1mqvwMWsgxrZTInbWTEnRdxC/s8MuSEPuHLLJSO1dNnOqmaVIvui5285iuZM5slg==", + "version": "6.28.1", + "resolved": "https://registry.npmjs.org/@wordpress/rich-text/-/rich-text-6.28.1.tgz", + "integrity": "sha512-cdMpzhnRQMBCw2SewaZt1SLaUGApb+IfQjQFAW9WXwh5GbJEi5xZX6DRulMoU0Jd7lOepq/w0gbwxDePUegyCA==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", @@ -9877,9 +9714,9 @@ } }, "node_modules/@wordpress/shortcode": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/shortcode/-/shortcode-3.50.0.tgz", - "integrity": "sha512-RnlqS2OsNUaI6VOLwyUiaL3trAJcWjtoiW21BjIXODbTkEreRJgBJnch7wdFpGimJmKIWBwRD8jQ4hdTND8xVw==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/shortcode/-/shortcode-3.51.0.tgz", + "integrity": "sha512-t5GHbDY3awJEcQfeb2fXK6y34RBcZUFgjSUrdFBlGmjHcdnQnyWba41mesk+chTVRiK8URogtZ52WrQsMb0Cvw==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", @@ -9890,9 +9727,9 @@ } }, "node_modules/@wordpress/style-engine": { - "version": "1.33.1", - "resolved": "https://registry.npmjs.org/@wordpress/style-engine/-/style-engine-1.33.1.tgz", - "integrity": "sha512-mkur1jw3Trz76iwxU6DalTFsJyF5P/NTdU9xniMT8bo1H9HspgKrzqXAaxkTL9F9BXkyiYs+ctVekJYRUKlgcw==", + "version": "1.34.0", + "resolved": "https://registry.npmjs.org/@wordpress/style-engine/-/style-engine-1.34.0.tgz", + "integrity": "sha512-CMSifFEg1YRpodUEZ8+1XTrKpu61idz/qa9Uz4yYS4aK23HfY8gPH+9FYYeRmtPUnKgAUwIMgKbyNXpCKmslUA==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", @@ -9919,14 +9756,14 @@ } }, "node_modules/@wordpress/sync": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/sync/-/sync-0.12.0.tgz", - "integrity": "sha512-45gU1Gu/ys3zqYO4dDQf6eG5gGgJK9nXa62IUtUWFXIH4FN29XlvGppMVK/zzhJwejF/XnDuT7mQuVEFCZGswA==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@wordpress/sync/-/sync-0.13.0.tgz", + "integrity": "sha512-elkzQmkf/7cU/0QQBnzb2akFgrt36ZSV4OEuheCp0iXR2sZdzZQ2UqkwdEmtdvAuU83eU51HM72ja9k+fr1VVw==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", "@types/simple-peer": "^9.11.5", - "@wordpress/url": "^3.51.0", + "@wordpress/url": "^3.52.0", "import-locals": "^2.0.0", "lib0": "^0.2.42", "simple-peer": "^9.11.0", @@ -9940,9 +9777,9 @@ } }, "node_modules/@wordpress/token-list": { - "version": "2.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/token-list/-/token-list-2.50.0.tgz", - "integrity": "sha512-LTjXkoljQpJIHqs0isTUzIc1fMu68y0N9HcDIdsCMGkmKptWUCETtb+DItnraxDDLuyWNuTYf840S83a3XAVRA==", + "version": "2.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/token-list/-/token-list-2.51.0.tgz", + "integrity": "sha512-5YsRinAlpy6mX4QJssebXp9sPCkpbvHqdLXdnYJoMP0ABffGqny6/9PuoRrDMLwljs2kZFBiTyQsH945LWkFqg==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -9952,13 +9789,13 @@ } }, "node_modules/@wordpress/undo-manager": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-0.10.0.tgz", - "integrity": "sha512-ODDqAL6BSvD+J7FV+sQTAaVHiPChh/4KBnKg8pb2ogg+Weq6VynthxDxGpQnN8FcMKB9ZoyS3SNIl8pVXLKIwA==", + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-0.11.0.tgz", + "integrity": "sha512-f9izRRzLlZRBXhve1OU9sBGWRvfGU94nhENN7gtf7l31q3xdsnrGf5NE/R1yhwCAHifUFF1dVcIGC1cfT2jQIg==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/is-shallow-equal": "^4.50.0" + "@wordpress/is-shallow-equal": "^4.51.0" }, "engines": { "node": ">=12" @@ -28783,9 +28620,9 @@ } }, "node_modules/yjs": { - "version": "13.6.11", - "resolved": "https://registry.npmjs.org/yjs/-/yjs-13.6.11.tgz", - "integrity": "sha512-FvRRJKX9u270dOLkllGF/UDCWwmIv2Z+ucM4v1QO1TuxdmoiMnSUXH1HAcOKOrkBEhQtPTkxep7tD2DrQB+l0g==", + "version": "13.6.12", + "resolved": "https://registry.npmjs.org/yjs/-/yjs-13.6.12.tgz", + "integrity": "sha512-KOT8ILoyVH2f/PxPadeu5kVVS055D1r3x1iFfJVJzFdnN98pVGM8H07NcKsO+fG3F7/0tf30Vnokf5YIqhU/iw==", "dev": true, "dependencies": { "lib0": "^0.2.86" @@ -30387,22 +30224,30 @@ } }, "@floating-ui/dom": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.5.1.tgz", - "integrity": "sha512-KwvVcPSXg6mQygvA1TjbN/gh///36kKtllIF8SUm0qpFj8+rvYrpvlYdL1JoA71SHpDqgSSdGOSoQ0Mp3uY5aw==", + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.3.tgz", + "integrity": "sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw==", "dev": true, "requires": { - "@floating-ui/core": "^1.4.1", - "@floating-ui/utils": "^0.1.1" + "@floating-ui/core": "^1.0.0", + "@floating-ui/utils": "^0.2.0" + }, + "dependencies": { + "@floating-ui/utils": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.1.tgz", + "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==", + "dev": true + } } }, "@floating-ui/react-dom": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.2.tgz", - "integrity": "sha512-5qhlDvjaLmAst/rKb3VdlCinwTF4EYMiVxuuc/HVUjs46W0zgtbMmAZ1UTsDrRTxRmUEzl92mOtWbeeXL26lSQ==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.8.tgz", + "integrity": "sha512-HOdqOt3R3OGeTKidaLvJKcgg75S6tibQ3Tif4eyd91QnIJWr0NLvoXFpJA/j8HqkFSL68GDca9AuyWEHlhyClw==", "dev": true, "requires": { - "@floating-ui/dom": "^1.5.1" + "@floating-ui/dom": "^1.6.1" } }, "@floating-ui/utils": { @@ -34125,9 +33970,9 @@ } }, "@wordpress/autop": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/autop/-/autop-3.50.0.tgz", - "integrity": "sha512-4E0vq2MvSOVDKXs4OulIbTdKU6S5O9QjT4qc63rAd0uiKGBYV12ViPzmwbJ6k38zOO0PKdcwlVCj55Gq4aoPDw==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/autop/-/autop-3.51.0.tgz", + "integrity": "sha512-n33dunOrA3lLNXlHHVzU0f5Sns67XvxHTYd86cdBLZFLDeScfCnFzJ4+5K4l+1ayuNK511Njf+76Z0vYKrGc9w==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" @@ -34167,53 +34012,53 @@ "dev": true }, "@wordpress/blob": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/blob/-/blob-3.50.0.tgz", - "integrity": "sha512-QvBhsW9WPdsOJhJ0BxzZ83i+cH/gAdjJ1iHY4Rkb02qbZEz4jhdvucGQf2oVnWwvAsFiFPKWk7CwAM5XjoahCA==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/blob/-/blob-3.51.0.tgz", + "integrity": "sha512-DICMSq7Y6gI6Lz+euG1v1xsIExIFrQ8bcINmnUmwcujgHckm0BaJwAKXXO4CHQVwNLWbHZiu5ySuzorw5rhG8w==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" } }, "@wordpress/block-editor": { - "version": "12.18.2", - "resolved": "https://registry.npmjs.org/@wordpress/block-editor/-/block-editor-12.18.2.tgz", - "integrity": "sha512-LDZIcp5Bl2FCyfkf07XgfM0kzY+AYhyTS4kt2U4GRSeUey79AM+GIYXb8TM2Y68B09HP/rpntBW4e/cBqjHfjw==", + "version": "12.19.1", + "resolved": "https://registry.npmjs.org/@wordpress/block-editor/-/block-editor-12.19.1.tgz", + "integrity": "sha512-ZzG0XiakM5GHVvpJw0MTEYmX0WPJJwGegMTbhkSCrMnsAY0uRpYjrZwbSbPoweFdBpkIWdKs7W9BGIQ69WVcsA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", "@emotion/react": "^11.7.1", "@emotion/styled": "^11.6.0", "@react-spring/web": "^9.4.5", - "@wordpress/a11y": "^3.50.0", - "@wordpress/api-fetch": "^6.47.0", - "@wordpress/blob": "^3.50.0", - "@wordpress/blocks": "^12.27.1", - "@wordpress/commands": "^0.21.0", - "@wordpress/components": "^25.16.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/data": "^9.20.0", - "@wordpress/date": "^4.50.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/escape-html": "^2.50.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/keyboard-shortcuts": "^4.27.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/notices": "^4.18.0", - "@wordpress/preferences": "^3.27.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/style-engine": "^1.33.1", - "@wordpress/token-list": "^2.50.0", - "@wordpress/url": "^3.51.0", - "@wordpress/warning": "^2.50.0", - "@wordpress/wordcount": "^3.50.0", + "@wordpress/a11y": "^3.51.0", + "@wordpress/api-fetch": "^6.48.0", + "@wordpress/blob": "^3.51.0", + "@wordpress/blocks": "^12.28.1", + "@wordpress/commands": "^0.22.1", + "@wordpress/components": "^26.0.1", + "@wordpress/compose": "^6.28.0", + "@wordpress/data": "^9.21.0", + "@wordpress/date": "^4.51.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/dom": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/escape-html": "^2.51.0", + "@wordpress/hooks": "^3.51.0", + "@wordpress/html-entities": "^3.51.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/icons": "^9.42.0", + "@wordpress/is-shallow-equal": "^4.51.0", + "@wordpress/keyboard-shortcuts": "^4.28.0", + "@wordpress/keycodes": "^3.51.0", + "@wordpress/notices": "^4.19.0", + "@wordpress/preferences": "^3.28.1", + "@wordpress/private-apis": "^0.33.0", + "@wordpress/rich-text": "^6.28.1", + "@wordpress/style-engine": "^1.34.0", + "@wordpress/token-list": "^2.51.0", + "@wordpress/url": "^3.52.0", + "@wordpress/warning": "^2.51.0", + "@wordpress/wordcount": "^3.51.0", "change-case": "^4.1.2", "classnames": "^2.3.1", "colord": "^2.7.0", @@ -34232,96 +34077,32 @@ }, "dependencies": { "@wordpress/commands": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.21.0.tgz", - "integrity": "sha512-MzMUGCT9cQXto1jrA5lHAtnieTyAhcuNIxfyxlcE+316KNQfbyD8bc7KOzSV2sxXD/rfHuCxvHjfomFyyP+4kA==", + "version": "0.22.1", + "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.22.1.tgz", + "integrity": "sha512-lA5LH7fyV0ov8QgZ1cetstTH9pQL+3b0RAYoR/MJJLOzlEdg7NXbb2vIKTYZ13oF1Oo4oIdrG+JDUeL94wVVvQ==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/components": "^25.16.0", - "@wordpress/data": "^9.20.0", - "@wordpress/element": "^5.27.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/keyboard-shortcuts": "^4.27.0", - "@wordpress/private-apis": "^0.32.0", + "@wordpress/components": "^26.0.1", + "@wordpress/data": "^9.21.0", + "@wordpress/element": "^5.28.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/icons": "^9.42.0", + "@wordpress/keyboard-shortcuts": "^4.28.0", + "@wordpress/private-apis": "^0.33.0", "classnames": "^2.3.1", "cmdk": "^0.2.0", "rememo": "^4.0.2" } }, - "@wordpress/components": { - "version": "25.16.0", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", - "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", - "dev": true, - "requires": { - "@ariakit/react": "^0.3.12", - "@babel/runtime": "^7.16.0", - "@emotion/cache": "^11.7.1", - "@emotion/css": "^11.7.1", - "@emotion/react": "^11.7.1", - "@emotion/serialize": "^1.0.2", - "@emotion/styled": "^11.6.0", - "@emotion/utils": "^1.0.0", - "@floating-ui/react-dom": "^2.0.1", - "@types/gradient-parser": "0.1.3", - "@types/highlight-words-core": "1.2.1", - "@use-gesture/react": "^10.2.24", - "@wordpress/a11y": "^3.50.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/date": "^4.50.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/escape-html": "^2.50.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/primitives": "^3.48.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/warning": "^2.50.0", - "change-case": "^4.1.2", - "classnames": "^2.3.1", - "colord": "^2.7.0", - "date-fns": "^2.28.0", - "deepmerge": "^4.3.0", - "dom-scroll-into-view": "^1.2.1", - "downshift": "^6.0.15", - "fast-deep-equal": "^3.1.3", - "framer-motion": "^10.13.0", - "gradient-parser": "^0.1.5", - "highlight-words-core": "^1.2.2", - "is-plain-object": "^5.0.0", - "memize": "^2.1.0", - "path-to-regexp": "^6.2.1", - "re-resizable": "^6.4.0", - "react-colorful": "^5.3.1", - "reakit": "^1.3.11", - "remove-accents": "^0.5.0", - "use-lilius": "^2.0.1", - "uuid": "^9.0.1", - "valtio": "1.7.0" - } - }, "@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.33.0.tgz", + "integrity": "sha512-Dc8y7m17gAKnDVFOPDqPcb2jo9cDhDNikLdepTkRXLywYUPT2PFH4GrXsVK87BLc+nCIqgs3DFU/AJx1db4y/w==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" } - }, - "uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true } } }, @@ -34451,36 +34232,36 @@ } }, "@wordpress/block-serialization-default-parser": { - "version": "4.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/block-serialization-default-parser/-/block-serialization-default-parser-4.50.0.tgz", - "integrity": "sha512-ihf2vr+w2zHBOvYTPQZXDiR2IMvso8yJJtzKIHA2ZEgVQ+VVLb4X86n34hfWXtPA3i2KDW+t1WCtq56aNq3Zag==", + "version": "4.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/block-serialization-default-parser/-/block-serialization-default-parser-4.51.0.tgz", + "integrity": "sha512-GQQ6hu7exCmk8KN7wW2Mvmo1CZjBC8sVZZ87lwciKYs963AKrFSySS6JIvI1fxJagHVAddP1MbW5xLYrFt+ISg==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" } }, "@wordpress/blocks": { - "version": "12.27.1", - "resolved": "https://registry.npmjs.org/@wordpress/blocks/-/blocks-12.27.1.tgz", - "integrity": "sha512-9uZtuTG6+fiFV2bLn8b1gzv4BgMpBu4SDQGnvzc5f9U5GL5oYns3PP8vXDOwM2cK1DEmqPsohQWhRnz8QYZDtw==", + "version": "12.28.1", + "resolved": "https://registry.npmjs.org/@wordpress/blocks/-/blocks-12.28.1.tgz", + "integrity": "sha512-eOmNQQyaXiYQLyW5U+pTkX/+2nFcRc+hGJKQhCbPzotWlFeOexTu1J7X9drfN7ikfFSYxtG2EGWMgHcY2PtU5A==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/autop": "^3.50.0", - "@wordpress/blob": "^3.50.0", - "@wordpress/block-serialization-default-parser": "^4.50.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/data": "^9.20.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/shortcode": "^3.50.0", + "@wordpress/autop": "^3.51.0", + "@wordpress/blob": "^3.51.0", + "@wordpress/block-serialization-default-parser": "^4.51.0", + "@wordpress/compose": "^6.28.0", + "@wordpress/data": "^9.21.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/dom": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/hooks": "^3.51.0", + "@wordpress/html-entities": "^3.51.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/is-shallow-equal": "^4.51.0", + "@wordpress/private-apis": "^0.33.0", + "@wordpress/rich-text": "^6.28.1", + "@wordpress/shortcode": "^3.51.0", "change-case": "^4.1.2", "colord": "^2.7.0", "fast-deep-equal": "^3.1.3", @@ -34496,9 +34277,9 @@ }, "dependencies": { "@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.33.0.tgz", + "integrity": "sha512-Dc8y7m17gAKnDVFOPDqPcb2jo9cDhDNikLdepTkRXLywYUPT2PFH4GrXsVK87BLc+nCIqgs3DFU/AJx1db4y/w==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" @@ -34621,9 +34402,9 @@ } }, "@wordpress/components": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-26.0.0.tgz", - "integrity": "sha512-23poBjhN4Lgqw3mYQwrHSiF0qrfDVlwr8voqLampeNXFHgJfST13aOCeD3y9ZpML2urOKt5Mi//+Lype9p29FA==", + "version": "26.0.1", + "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-26.0.1.tgz", + "integrity": "sha512-kHrQVm109nXYHfoea0KlIKa8RIIMrx/vgnUb0mKKA4BGhg/kGaNW+vYnWVE5W/kGEDk+7Y8fiDnwicc5AisuBg==", "dev": true, "requires": { "@ariakit/react": "^0.3.12", @@ -34634,7 +34415,7 @@ "@emotion/serialize": "^1.0.2", "@emotion/styled": "^11.6.0", "@emotion/utils": "^1.0.0", - "@floating-ui/react-dom": "^2.0.1", + "@floating-ui/react-dom": "^2.0.8", "@types/gradient-parser": "0.1.3", "@types/highlight-words-core": "1.2.1", "@use-gesture/react": "^10.2.24", @@ -34653,7 +34434,7 @@ "@wordpress/keycodes": "^3.51.0", "@wordpress/primitives": "^3.49.0", "@wordpress/private-apis": "^0.33.0", - "@wordpress/rich-text": "^6.28.0", + "@wordpress/rich-text": "^6.28.1", "@wordpress/warning": "^2.51.0", "change-case": "^4.1.2", "classnames": "^2.3.1", @@ -34713,18 +34494,6 @@ "clipboard": "^2.0.11", "mousetrap": "^1.6.5", "use-memo-one": "^1.1.1" - }, - "dependencies": { - "@wordpress/undo-manager": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-0.11.0.tgz", - "integrity": "sha512-f9izRRzLlZRBXhve1OU9sBGWRvfGU94nhENN7gtf7l31q3xdsnrGf5NE/R1yhwCAHifUFF1dVcIGC1cfT2jQIg==", - "dev": true, - "requires": { - "@babel/runtime": "^7.16.0", - "@wordpress/is-shallow-equal": "^4.51.0" - } - } } }, "@wordpress/core-commands": { @@ -34747,27 +34516,27 @@ } }, "@wordpress/core-data": { - "version": "6.27.2", - "resolved": "https://registry.npmjs.org/@wordpress/core-data/-/core-data-6.27.2.tgz", - "integrity": "sha512-Jsy+vW/izrd/T36D/4b266ScobCezNYX2Me/clCmHGB4eRW3drXZPbMnWZLNEDagYr87sQcM1Namasb69dnDhA==", + "version": "6.28.1", + "resolved": "https://registry.npmjs.org/@wordpress/core-data/-/core-data-6.28.1.tgz", + "integrity": "sha512-nsWF83Ssf7QH+jPSkxv5w1PYTC7yZ281kcQBJHWcb27NWsJu0iJ6qPO/h94PItU8yOdeWQ7e6zOJ2gWSvZVtHg==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/api-fetch": "^6.47.0", - "@wordpress/block-editor": "^12.18.2", - "@wordpress/blocks": "^12.27.1", - "@wordpress/compose": "^6.27.0", - "@wordpress/data": "^9.20.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/sync": "^0.12.0", - "@wordpress/undo-manager": "^0.10.0", - "@wordpress/url": "^3.51.0", + "@wordpress/api-fetch": "^6.48.0", + "@wordpress/block-editor": "^12.19.1", + "@wordpress/blocks": "^12.28.1", + "@wordpress/compose": "^6.28.0", + "@wordpress/data": "^9.21.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/html-entities": "^3.51.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/is-shallow-equal": "^4.51.0", + "@wordpress/private-apis": "^0.33.0", + "@wordpress/rich-text": "^6.28.1", + "@wordpress/sync": "^0.13.0", + "@wordpress/undo-manager": "^0.11.0", + "@wordpress/url": "^3.52.0", "change-case": "^4.1.2", "equivalent-key-map": "^0.2.2", "fast-deep-equal": "^3.1.3", @@ -34777,9 +34546,9 @@ }, "dependencies": { "@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.33.0.tgz", + "integrity": "sha512-Dc8y7m17gAKnDVFOPDqPcb2jo9cDhDNikLdepTkRXLywYUPT2PFH4GrXsVK87BLc+nCIqgs3DFU/AJx1db4y/w==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" @@ -35492,15 +35261,15 @@ } }, "@wordpress/keyboard-shortcuts": { - "version": "4.27.0", - "resolved": "https://registry.npmjs.org/@wordpress/keyboard-shortcuts/-/keyboard-shortcuts-4.27.0.tgz", - "integrity": "sha512-mpYhaSAMHXbRMp9hP08LejX/u1nLQaZONhwGSytqIhN1DQwpBbNbmV8ZNm1dnevUsYqEfPVVov6HFyPxYQ6m4w==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@wordpress/keyboard-shortcuts/-/keyboard-shortcuts-4.28.0.tgz", + "integrity": "sha512-mywx2ExlpraMt2cjHmxC4cHXLErSwJ7OkFR+6byJ7BpxQEhv9tDYrKN6LBAMtYpUeyMtdGavyNCUlFtv/r325Q==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/data": "^9.20.0", - "@wordpress/element": "^5.27.0", - "@wordpress/keycodes": "^3.50.0", + "@wordpress/data": "^9.21.0", + "@wordpress/element": "^5.28.0", + "@wordpress/keycodes": "^3.51.0", "rememo": "^4.0.2" } }, @@ -35528,14 +35297,14 @@ } }, "@wordpress/notices": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@wordpress/notices/-/notices-4.18.0.tgz", - "integrity": "sha512-Y2XpY6niJ7NuqPBtGYvDYSPCfw/y4yxv60ahu1kYd8r5BamKSchTYwKSnV0yrx/IUfNO04VAsNq9NCUQG12pRA==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@wordpress/notices/-/notices-4.19.0.tgz", + "integrity": "sha512-9Em2R+YsdMsaOXvWkZWyi/tbDP1JHxpIgASMpoRWIteA422s01NWafwizQwY1f0kvw4JbbyMF283UXmjWnzxQw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.50.0", - "@wordpress/data": "^9.20.0" + "@wordpress/a11y": "^3.51.0", + "@wordpress/data": "^9.21.0" } }, "@wordpress/npm-package-json-lint-config": { @@ -35671,96 +35440,32 @@ } }, "@wordpress/preferences": { - "version": "3.27.0", - "resolved": "https://registry.npmjs.org/@wordpress/preferences/-/preferences-3.27.0.tgz", - "integrity": "sha512-LMhOHX5FI4CJHv2YhtpiEtHfLqL/pjKAMja/v7skkHPlrh64Sgzi/gep016/My5SjcR64JUD1Na2U2j/BnrBNQ==", + "version": "3.28.1", + "resolved": "https://registry.npmjs.org/@wordpress/preferences/-/preferences-3.28.1.tgz", + "integrity": "sha512-fDhp7lIAnCSHQBg5HeCQLvUh4O+VKNproMSAphLx9XpVgjak781G41Hi4Vj9/sozp24DeK1J+ONUfiYQJBh67A==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.50.0", - "@wordpress/components": "^25.16.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/data": "^9.20.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/private-apis": "^0.32.0", + "@wordpress/a11y": "^3.51.0", + "@wordpress/components": "^26.0.1", + "@wordpress/compose": "^6.28.0", + "@wordpress/data": "^9.21.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/icons": "^9.42.0", + "@wordpress/private-apis": "^0.33.0", "classnames": "^2.3.1" }, "dependencies": { - "@wordpress/components": { - "version": "25.16.0", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", - "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", - "dev": true, - "requires": { - "@ariakit/react": "^0.3.12", - "@babel/runtime": "^7.16.0", - "@emotion/cache": "^11.7.1", - "@emotion/css": "^11.7.1", - "@emotion/react": "^11.7.1", - "@emotion/serialize": "^1.0.2", - "@emotion/styled": "^11.6.0", - "@emotion/utils": "^1.0.0", - "@floating-ui/react-dom": "^2.0.1", - "@types/gradient-parser": "0.1.3", - "@types/highlight-words-core": "1.2.1", - "@use-gesture/react": "^10.2.24", - "@wordpress/a11y": "^3.50.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/date": "^4.50.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/escape-html": "^2.50.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/primitives": "^3.48.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/warning": "^2.50.0", - "change-case": "^4.1.2", - "classnames": "^2.3.1", - "colord": "^2.7.0", - "date-fns": "^2.28.0", - "deepmerge": "^4.3.0", - "dom-scroll-into-view": "^1.2.1", - "downshift": "^6.0.15", - "fast-deep-equal": "^3.1.3", - "framer-motion": "^10.13.0", - "gradient-parser": "^0.1.5", - "highlight-words-core": "^1.2.2", - "is-plain-object": "^5.0.0", - "memize": "^2.1.0", - "path-to-regexp": "^6.2.1", - "re-resizable": "^6.4.0", - "react-colorful": "^5.3.1", - "reakit": "^1.3.11", - "remove-accents": "^0.5.0", - "use-lilius": "^2.0.1", - "uuid": "^9.0.1", - "valtio": "1.7.0" - } - }, "@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.33.0.tgz", + "integrity": "sha512-Dc8y7m17gAKnDVFOPDqPcb2jo9cDhDNikLdepTkRXLywYUPT2PFH4GrXsVK87BLc+nCIqgs3DFU/AJx1db4y/w==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" } - }, - "uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true } } }, @@ -35909,9 +35614,9 @@ } }, "@wordpress/rich-text": { - "version": "6.28.0", - "resolved": "https://registry.npmjs.org/@wordpress/rich-text/-/rich-text-6.28.0.tgz", - "integrity": "sha512-Fl0TQOELar08jtRWus2qRz1mqvwMWsgxrZTInbWTEnRdxC/s8MuSEPuHLLJSO1dNnOqmaVIvui5285iuZM5slg==", + "version": "6.28.1", + "resolved": "https://registry.npmjs.org/@wordpress/rich-text/-/rich-text-6.28.1.tgz", + "integrity": "sha512-cdMpzhnRQMBCw2SewaZt1SLaUGApb+IfQjQFAW9WXwh5GbJEi5xZX6DRulMoU0Jd7lOepq/w0gbwxDePUegyCA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", @@ -36316,9 +36021,9 @@ } }, "@wordpress/shortcode": { - "version": "3.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/shortcode/-/shortcode-3.50.0.tgz", - "integrity": "sha512-RnlqS2OsNUaI6VOLwyUiaL3trAJcWjtoiW21BjIXODbTkEreRJgBJnch7wdFpGimJmKIWBwRD8jQ4hdTND8xVw==", + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/shortcode/-/shortcode-3.51.0.tgz", + "integrity": "sha512-t5GHbDY3awJEcQfeb2fXK6y34RBcZUFgjSUrdFBlGmjHcdnQnyWba41mesk+chTVRiK8URogtZ52WrQsMb0Cvw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", @@ -36326,9 +36031,9 @@ } }, "@wordpress/style-engine": { - "version": "1.33.1", - "resolved": "https://registry.npmjs.org/@wordpress/style-engine/-/style-engine-1.33.1.tgz", - "integrity": "sha512-mkur1jw3Trz76iwxU6DalTFsJyF5P/NTdU9xniMT8bo1H9HspgKrzqXAaxkTL9F9BXkyiYs+ctVekJYRUKlgcw==", + "version": "1.34.0", + "resolved": "https://registry.npmjs.org/@wordpress/style-engine/-/style-engine-1.34.0.tgz", + "integrity": "sha512-CMSifFEg1YRpodUEZ8+1XTrKpu61idz/qa9Uz4yYS4aK23HfY8gPH+9FYYeRmtPUnKgAUwIMgKbyNXpCKmslUA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", @@ -36346,14 +36051,14 @@ } }, "@wordpress/sync": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@wordpress/sync/-/sync-0.12.0.tgz", - "integrity": "sha512-45gU1Gu/ys3zqYO4dDQf6eG5gGgJK9nXa62IUtUWFXIH4FN29XlvGppMVK/zzhJwejF/XnDuT7mQuVEFCZGswA==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@wordpress/sync/-/sync-0.13.0.tgz", + "integrity": "sha512-elkzQmkf/7cU/0QQBnzb2akFgrt36ZSV4OEuheCp0iXR2sZdzZQ2UqkwdEmtdvAuU83eU51HM72ja9k+fr1VVw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", "@types/simple-peer": "^9.11.5", - "@wordpress/url": "^3.51.0", + "@wordpress/url": "^3.52.0", "import-locals": "^2.0.0", "lib0": "^0.2.42", "simple-peer": "^9.11.0", @@ -36364,22 +36069,22 @@ } }, "@wordpress/token-list": { - "version": "2.50.0", - "resolved": "https://registry.npmjs.org/@wordpress/token-list/-/token-list-2.50.0.tgz", - "integrity": "sha512-LTjXkoljQpJIHqs0isTUzIc1fMu68y0N9HcDIdsCMGkmKptWUCETtb+DItnraxDDLuyWNuTYf840S83a3XAVRA==", + "version": "2.51.0", + "resolved": "https://registry.npmjs.org/@wordpress/token-list/-/token-list-2.51.0.tgz", + "integrity": "sha512-5YsRinAlpy6mX4QJssebXp9sPCkpbvHqdLXdnYJoMP0ABffGqny6/9PuoRrDMLwljs2kZFBiTyQsH945LWkFqg==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" } }, "@wordpress/undo-manager": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-0.10.0.tgz", - "integrity": "sha512-ODDqAL6BSvD+J7FV+sQTAaVHiPChh/4KBnKg8pb2ogg+Weq6VynthxDxGpQnN8FcMKB9ZoyS3SNIl8pVXLKIwA==", + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@wordpress/undo-manager/-/undo-manager-0.11.0.tgz", + "integrity": "sha512-f9izRRzLlZRBXhve1OU9sBGWRvfGU94nhENN7gtf7l31q3xdsnrGf5NE/R1yhwCAHifUFF1dVcIGC1cfT2jQIg==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/is-shallow-equal": "^4.50.0" + "@wordpress/is-shallow-equal": "^4.51.0" } }, "@wordpress/url": { @@ -50381,9 +50086,9 @@ } }, "yjs": { - "version": "13.6.11", - "resolved": "https://registry.npmjs.org/yjs/-/yjs-13.6.11.tgz", - "integrity": "sha512-FvRRJKX9u270dOLkllGF/UDCWwmIv2Z+ucM4v1QO1TuxdmoiMnSUXH1HAcOKOrkBEhQtPTkxep7tD2DrQB+l0g==", + "version": "13.6.12", + "resolved": "https://registry.npmjs.org/yjs/-/yjs-13.6.12.tgz", + "integrity": "sha512-KOT8ILoyVH2f/PxPadeu5kVVS055D1r3x1iFfJVJzFdnN98pVGM8H07NcKsO+fG3F7/0tf30Vnokf5YIqhU/iw==", "dev": true, "requires": { "lib0": "^0.2.86" diff --git a/package.json b/package.json index 7479d4a02..a7eab7756 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "@wordpress/blocks": "^12.26.0", "@wordpress/components": "^26.0.0", "@wordpress/compose": "^6.18.0", - "@wordpress/core-data": "^6.26.0", + "@wordpress/core-data": "^6.28.1", "@wordpress/data": "^9.19.0", "@wordpress/e2e-test-utils": "^10.22.0", "@wordpress/edit-post": "^7.24.0", From 636642452ea9ada171fbff64d2069102eeddbb35 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 08:33:40 +0000 Subject: [PATCH 027/110] build(deps-dev): bump husky from 9.0.10 to 9.0.11 (#2213) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6701315a8..c59b851f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,7 +51,7 @@ "@wordpress/wordcount": "^3.51.0", "concurrently": "^8.2.2", "eslint-plugin-jest": "^27.6.3", - "husky": "^9.0.10", + "husky": "^9.0.11", "prettier": "^3.2.5", "ts-loader": "^9.5.1", "typescript": "^5.3.3" @@ -16233,9 +16233,9 @@ } }, "node_modules/husky": { - "version": "9.0.10", - "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.10.tgz", - "integrity": "sha512-TQGNknoiy6bURzIO77pPRu+XHi6zI7T93rX+QnJsoYFf3xdjKOur+IlfqzJGMHIK/wXrLg+GsvMs8Op7vI2jVA==", + "version": "9.0.11", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz", + "integrity": "sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==", "dev": true, "bin": { "husky": "bin.mjs" @@ -40906,9 +40906,9 @@ "dev": true }, "husky": { - "version": "9.0.10", - "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.10.tgz", - "integrity": "sha512-TQGNknoiy6bURzIO77pPRu+XHi6zI7T93rX+QnJsoYFf3xdjKOur+IlfqzJGMHIK/wXrLg+GsvMs8Op7vI2jVA==", + "version": "9.0.11", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz", + "integrity": "sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==", "dev": true }, "iconv-lite": { diff --git a/package.json b/package.json index a7eab7756..3356db898 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "@wordpress/wordcount": "^3.51.0", "concurrently": "^8.2.2", "eslint-plugin-jest": "^27.6.3", - "husky": "^9.0.10", + "husky": "^9.0.11", "prettier": "^3.2.5", "ts-loader": "^9.5.1", "typescript": "^5.3.3" From 91a21583532d036c436987d8dce48473d9795f35 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 09:10:27 +0000 Subject: [PATCH 028/110] build(deps-dev): bump @wordpress/env from 9.2.0 to 9.3.0 (#2214) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index c59b851f0..f29110d3a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,7 +40,7 @@ "@wordpress/edit-post": "^7.24.0", "@wordpress/editor": "^13.27.2", "@wordpress/element": "^5.25.0", - "@wordpress/env": "^9.2.0", + "@wordpress/env": "^9.3.0", "@wordpress/eslint-plugin": "^17.7.0", "@wordpress/hooks": "^3.41.0", "@wordpress/i18n": "^4.41.0", @@ -8313,9 +8313,9 @@ } }, "node_modules/@wordpress/env": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-9.2.0.tgz", - "integrity": "sha512-2gl65WYbkuTjnW2SHKjeqdpLTgnPc/xVvFiwG+2p/RJwDHSuw1xXSdFqFUh3+wC/4cuXy9b2ZBm/SYsBoc8DDw==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-9.3.0.tgz", + "integrity": "sha512-qFu/my4SnlM43SItbmTCEVZrXC1p9Qyk/JQ7/6/0GYS/2vuKTjYgb/wfn3HJpUzay3DrbATlqAv9WfJHlyaEZw==", "dev": true, "dependencies": { "chalk": "^4.0.0", @@ -34960,9 +34960,9 @@ } }, "@wordpress/env": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-9.2.0.tgz", - "integrity": "sha512-2gl65WYbkuTjnW2SHKjeqdpLTgnPc/xVvFiwG+2p/RJwDHSuw1xXSdFqFUh3+wC/4cuXy9b2ZBm/SYsBoc8DDw==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-9.3.0.tgz", + "integrity": "sha512-qFu/my4SnlM43SItbmTCEVZrXC1p9Qyk/JQ7/6/0GYS/2vuKTjYgb/wfn3HJpUzay3DrbATlqAv9WfJHlyaEZw==", "dev": true, "requires": { "chalk": "^4.0.0", diff --git a/package.json b/package.json index 3356db898..d363c50bc 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "@wordpress/edit-post": "^7.24.0", "@wordpress/editor": "^13.27.2", "@wordpress/element": "^5.25.0", - "@wordpress/env": "^9.2.0", + "@wordpress/env": "^9.3.0", "@wordpress/eslint-plugin": "^17.7.0", "@wordpress/hooks": "^3.41.0", "@wordpress/i18n": "^4.41.0", From a35581669bc86143e3a4670b9359e5ac4d162f39 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Feb 2024 06:48:03 +0000 Subject: [PATCH 029/110] build(deps-dev): bump @wordpress/plugins from 6.19.0 to 6.19.1 (#2217) --- package-lock.json | 18 +++++++++--------- package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index f29110d3a..040bf55e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ "@wordpress/hooks": "^3.41.0", "@wordpress/i18n": "^4.41.0", "@wordpress/icons": "^9.42.0", - "@wordpress/plugins": "^6.19.0", + "@wordpress/plugins": "^6.19.1", "@wordpress/scripts": "^27.2.0", "@wordpress/url": "^3.52.0", "@wordpress/wordcount": "^3.51.0", @@ -8921,13 +8921,13 @@ } }, "node_modules/@wordpress/plugins": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@wordpress/plugins/-/plugins-6.19.0.tgz", - "integrity": "sha512-yJ7WinsxebDyKJKHfn1cLVl6Sv6WbREBGJ4L+jzlPM7JRjcAfazpcdzpoa4Y6+31B8dKVZxSVZXurqYIj4U0MQ==", + "version": "6.19.1", + "resolved": "https://registry.npmjs.org/@wordpress/plugins/-/plugins-6.19.1.tgz", + "integrity": "sha512-2TAIhzknhRXKcrIK87T6IJR5HkPb4cV8pmsRvcbw6D04euQBPzWR66D+cTVN/nj/Qoqf4YPcfgrahFOV8FHthA==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/components": "^26.0.0", + "@wordpress/components": "^26.0.1", "@wordpress/compose": "^6.28.0", "@wordpress/element": "^5.28.0", "@wordpress/hooks": "^3.51.0", @@ -35414,13 +35414,13 @@ } }, "@wordpress/plugins": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@wordpress/plugins/-/plugins-6.19.0.tgz", - "integrity": "sha512-yJ7WinsxebDyKJKHfn1cLVl6Sv6WbREBGJ4L+jzlPM7JRjcAfazpcdzpoa4Y6+31B8dKVZxSVZXurqYIj4U0MQ==", + "version": "6.19.1", + "resolved": "https://registry.npmjs.org/@wordpress/plugins/-/plugins-6.19.1.tgz", + "integrity": "sha512-2TAIhzknhRXKcrIK87T6IJR5HkPb4cV8pmsRvcbw6D04euQBPzWR66D+cTVN/nj/Qoqf4YPcfgrahFOV8FHthA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/components": "^26.0.0", + "@wordpress/components": "^26.0.1", "@wordpress/compose": "^6.28.0", "@wordpress/element": "^5.28.0", "@wordpress/hooks": "^3.51.0", diff --git a/package.json b/package.json index d363c50bc..7c57541b1 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "@wordpress/hooks": "^3.41.0", "@wordpress/i18n": "^4.41.0", "@wordpress/icons": "^9.42.0", - "@wordpress/plugins": "^6.19.0", + "@wordpress/plugins": "^6.19.1", "@wordpress/scripts": "^27.2.0", "@wordpress/url": "^3.52.0", "@wordpress/wordcount": "^3.51.0", From ec3161f0aa1d204068f62983b555553454c984e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Feb 2024 06:54:00 +0000 Subject: [PATCH 030/110] build(deps-dev): bump eslint-plugin-jest from 27.6.3 to 27.8.0 (#2218) --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 040bf55e8..4148d5ec2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ "@wordpress/url": "^3.52.0", "@wordpress/wordcount": "^3.51.0", "concurrently": "^8.2.2", - "eslint-plugin-jest": "^27.6.3", + "eslint-plugin-jest": "^27.8.0", "husky": "^9.0.11", "prettier": "^3.2.5", "ts-loader": "^9.5.1", @@ -13983,9 +13983,9 @@ } }, "node_modules/eslint-plugin-jest": { - "version": "27.6.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.6.3.tgz", - "integrity": "sha512-+YsJFVH6R+tOiO3gCJon5oqn4KWc+mDq2leudk8mrp8RFubLOo9CVyi3cib4L7XMpxExmkmBZQTPDYVBzgpgOA==", + "version": "27.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.8.0.tgz", + "integrity": "sha512-347hVFiu4ZKMYl5xFp0X81gLNwBdno0dl0CMpUMjwuAux9X/M2a7z+ab2VHmPL6XCT87q8nv1vaVzhIO4TE/hw==", "dev": true, "dependencies": { "@typescript-eslint/utils": "^5.10.0" @@ -13994,7 +13994,7 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^5.0.0 || ^6.0.0", + "@typescript-eslint/eslint-plugin": "^5.0.0 || ^6.0.0 || ^7.0.0", "eslint": "^7.0.0 || ^8.0.0", "jest": "*" }, @@ -39376,9 +39376,9 @@ } }, "eslint-plugin-jest": { - "version": "27.6.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.6.3.tgz", - "integrity": "sha512-+YsJFVH6R+tOiO3gCJon5oqn4KWc+mDq2leudk8mrp8RFubLOo9CVyi3cib4L7XMpxExmkmBZQTPDYVBzgpgOA==", + "version": "27.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.8.0.tgz", + "integrity": "sha512-347hVFiu4ZKMYl5xFp0X81gLNwBdno0dl0CMpUMjwuAux9X/M2a7z+ab2VHmPL6XCT87q8nv1vaVzhIO4TE/hw==", "dev": true, "requires": { "@typescript-eslint/utils": "^5.10.0" diff --git a/package.json b/package.json index 7c57541b1..6afd234be 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "@wordpress/url": "^3.52.0", "@wordpress/wordcount": "^3.51.0", "concurrently": "^8.2.2", - "eslint-plugin-jest": "^27.6.3", + "eslint-plugin-jest": "^27.8.0", "husky": "^9.0.11", "prettier": "^3.2.5", "ts-loader": "^9.5.1", From 2ef94c07a6970f38fd06b9e102ea6673920bd4f9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Feb 2024 06:59:44 +0000 Subject: [PATCH 031/110] build(deps-dev): bump @wordpress/editor from 13.27.2 to 13.28.1 (#2219) --- package-lock.json | 1001 ++++++++++----------------------------------- package.json | 2 +- 2 files changed, 206 insertions(+), 797 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4148d5ec2..01d2a84b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,7 @@ "@wordpress/data": "^9.19.0", "@wordpress/e2e-test-utils": "^10.22.0", "@wordpress/edit-post": "^7.24.0", - "@wordpress/editor": "^13.27.2", + "@wordpress/editor": "^13.28.1", "@wordpress/element": "^5.25.0", "@wordpress/env": "^9.3.0", "@wordpress/eslint-plugin": "^17.7.0", @@ -8126,42 +8126,42 @@ } }, "node_modules/@wordpress/editor": { - "version": "13.27.2", - "resolved": "https://registry.npmjs.org/@wordpress/editor/-/editor-13.27.2.tgz", - "integrity": "sha512-Wk1dwG5bkmDD74zip36yC1NO3EleXe/t35Z9GHfLaiZkUYlhZV2gv66QrrGN7Y59Zl68j+b4lRGLkUxEMWkleA==", + "version": "13.28.1", + "resolved": "https://registry.npmjs.org/@wordpress/editor/-/editor-13.28.1.tgz", + "integrity": "sha512-KqNOI3iaPUAkPSp7i/IxnOl1TCLrQ4win9NzRMXg7DN7G5KiobpFYYWre1NrbDbBbRMxpu/G12uN1jWGIvGQKQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.50.0", - "@wordpress/api-fetch": "^6.47.0", - "@wordpress/blob": "^3.50.0", - "@wordpress/block-editor": "^12.18.2", - "@wordpress/blocks": "^12.27.1", - "@wordpress/commands": "^0.21.0", - "@wordpress/components": "^25.16.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/core-data": "^6.27.2", - "@wordpress/data": "^9.20.0", - "@wordpress/date": "^4.50.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/keyboard-shortcuts": "^4.27.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/media-utils": "^4.41.0", - "@wordpress/notices": "^4.18.0", - "@wordpress/patterns": "^1.11.2", - "@wordpress/preferences": "^3.27.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/reusable-blocks": "^4.27.2", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/server-side-render": "^4.27.1", - "@wordpress/url": "^3.51.0", - "@wordpress/wordcount": "^3.50.0", + "@wordpress/a11y": "^3.51.0", + "@wordpress/api-fetch": "^6.48.0", + "@wordpress/blob": "^3.51.0", + "@wordpress/block-editor": "^12.19.1", + "@wordpress/blocks": "^12.28.1", + "@wordpress/commands": "^0.22.1", + "@wordpress/components": "^26.0.1", + "@wordpress/compose": "^6.28.0", + "@wordpress/core-data": "^6.28.1", + "@wordpress/data": "^9.21.0", + "@wordpress/date": "^4.51.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/dom": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/hooks": "^3.51.0", + "@wordpress/html-entities": "^3.51.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/icons": "^9.42.0", + "@wordpress/keyboard-shortcuts": "^4.28.0", + "@wordpress/keycodes": "^3.51.0", + "@wordpress/media-utils": "^4.42.0", + "@wordpress/notices": "^4.19.0", + "@wordpress/patterns": "^1.12.1", + "@wordpress/preferences": "^3.28.1", + "@wordpress/private-apis": "^0.33.0", + "@wordpress/reusable-blocks": "^4.28.1", + "@wordpress/rich-text": "^6.28.1", + "@wordpress/server-side-render": "^4.28.1", + "@wordpress/url": "^3.52.0", + "@wordpress/wordcount": "^3.51.0", "classnames": "^2.3.1", "date-fns": "^2.28.0", "memize": "^2.1.0", @@ -8178,19 +8178,19 @@ } }, "node_modules/@wordpress/editor/node_modules/@wordpress/commands": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.21.0.tgz", - "integrity": "sha512-MzMUGCT9cQXto1jrA5lHAtnieTyAhcuNIxfyxlcE+316KNQfbyD8bc7KOzSV2sxXD/rfHuCxvHjfomFyyP+4kA==", + "version": "0.22.1", + "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.22.1.tgz", + "integrity": "sha512-lA5LH7fyV0ov8QgZ1cetstTH9pQL+3b0RAYoR/MJJLOzlEdg7NXbb2vIKTYZ13oF1Oo4oIdrG+JDUeL94wVVvQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/components": "^25.16.0", - "@wordpress/data": "^9.20.0", - "@wordpress/element": "^5.27.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/keyboard-shortcuts": "^4.27.0", - "@wordpress/private-apis": "^0.32.0", + "@wordpress/components": "^26.0.1", + "@wordpress/data": "^9.21.0", + "@wordpress/element": "^5.28.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/icons": "^9.42.0", + "@wordpress/keyboard-shortcuts": "^4.28.0", + "@wordpress/private-apis": "^0.33.0", "classnames": "^2.3.1", "cmdk": "^0.2.0", "rememo": "^4.0.2" @@ -8203,75 +8203,10 @@ "react-dom": "^18.0.0" } }, - "node_modules/@wordpress/editor/node_modules/@wordpress/components": { - "version": "25.16.0", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", - "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", - "dev": true, - "dependencies": { - "@ariakit/react": "^0.3.12", - "@babel/runtime": "^7.16.0", - "@emotion/cache": "^11.7.1", - "@emotion/css": "^11.7.1", - "@emotion/react": "^11.7.1", - "@emotion/serialize": "^1.0.2", - "@emotion/styled": "^11.6.0", - "@emotion/utils": "^1.0.0", - "@floating-ui/react-dom": "^2.0.1", - "@types/gradient-parser": "0.1.3", - "@types/highlight-words-core": "1.2.1", - "@use-gesture/react": "^10.2.24", - "@wordpress/a11y": "^3.50.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/date": "^4.50.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/escape-html": "^2.50.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/primitives": "^3.48.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/warning": "^2.50.0", - "change-case": "^4.1.2", - "classnames": "^2.3.1", - "colord": "^2.7.0", - "date-fns": "^2.28.0", - "deepmerge": "^4.3.0", - "dom-scroll-into-view": "^1.2.1", - "downshift": "^6.0.15", - "fast-deep-equal": "^3.1.3", - "framer-motion": "^10.13.0", - "gradient-parser": "^0.1.5", - "highlight-words-core": "^1.2.2", - "is-plain-object": "^5.0.0", - "memize": "^2.1.0", - "path-to-regexp": "^6.2.1", - "re-resizable": "^6.4.0", - "react-colorful": "^5.3.1", - "reakit": "^1.3.11", - "remove-accents": "^0.5.0", - "use-lilius": "^2.0.1", - "uuid": "^9.0.1", - "valtio": "1.7.0" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" - } - }, "node_modules/@wordpress/editor/node_modules/@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.33.0.tgz", + "integrity": "sha512-Dc8y7m17gAKnDVFOPDqPcb2jo9cDhDNikLdepTkRXLywYUPT2PFH4GrXsVK87BLc+nCIqgs3DFU/AJx1db4y/w==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -8280,19 +8215,6 @@ "node": ">=12" } }, - "node_modules/@wordpress/editor/node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true, - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/@wordpress/element": { "version": "5.28.0", "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-5.28.0.tgz", @@ -8755,16 +8677,16 @@ } }, "node_modules/@wordpress/media-utils": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@wordpress/media-utils/-/media-utils-4.41.0.tgz", - "integrity": "sha512-wCxk8DAhmZ/3/a+oPRrieGurMOKDrYoDnnA0jhTm2D45kvn9y+NfnNBvLo2q1Is1ZiVTtNq54IRUXcdOjZgR9A==", + "version": "4.42.0", + "resolved": "https://registry.npmjs.org/@wordpress/media-utils/-/media-utils-4.42.0.tgz", + "integrity": "sha512-gUKtF94RmFJwlGSoRKaRB/NipM7u1OVYR4UepMFtLB7La8UBWaklTZfpYGjOHfnFkhxiFTULk1j/7b0OVkPMSw==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/api-fetch": "^6.47.0", - "@wordpress/blob": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/i18n": "^4.50.0" + "@wordpress/api-fetch": "^6.48.0", + "@wordpress/blob": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/i18n": "^4.51.0" }, "engines": { "node": ">=12" @@ -8800,26 +8722,26 @@ } }, "node_modules/@wordpress/patterns": { - "version": "1.11.2", - "resolved": "https://registry.npmjs.org/@wordpress/patterns/-/patterns-1.11.2.tgz", - "integrity": "sha512-cN7xjw5pfKq73mVF0q0ebZh4DmAab5SlQ9CvM7PtB03JOl3GMwVIDV5Tnbbhfi1KIsFwep2/CGft3xwuJlS3FQ==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@wordpress/patterns/-/patterns-1.12.1.tgz", + "integrity": "sha512-7WcnfGeGVYa2QiRgES04NGf+dqJD4qinx9nPQowkTGxNmblC5ySl0v74IuTXkibPw94bw4ivpXsinHvJa1dyVQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.50.0", - "@wordpress/block-editor": "^12.18.2", - "@wordpress/blocks": "^12.27.1", - "@wordpress/components": "^25.16.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/core-data": "^6.27.2", - "@wordpress/data": "^9.20.0", - "@wordpress/element": "^5.27.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/notices": "^4.18.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/url": "^3.51.0", + "@wordpress/a11y": "^3.51.0", + "@wordpress/block-editor": "^12.19.1", + "@wordpress/blocks": "^12.28.1", + "@wordpress/components": "^26.0.1", + "@wordpress/compose": "^6.28.0", + "@wordpress/core-data": "^6.28.1", + "@wordpress/data": "^9.21.0", + "@wordpress/element": "^5.28.0", + "@wordpress/html-entities": "^3.51.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/icons": "^9.42.0", + "@wordpress/notices": "^4.19.0", + "@wordpress/private-apis": "^0.33.0", + "@wordpress/url": "^3.52.0", "nanoid": "^3.3.4" }, "engines": { @@ -8830,75 +8752,10 @@ "react-dom": "^18.0.0" } }, - "node_modules/@wordpress/patterns/node_modules/@wordpress/components": { - "version": "25.16.0", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", - "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", - "dev": true, - "dependencies": { - "@ariakit/react": "^0.3.12", - "@babel/runtime": "^7.16.0", - "@emotion/cache": "^11.7.1", - "@emotion/css": "^11.7.1", - "@emotion/react": "^11.7.1", - "@emotion/serialize": "^1.0.2", - "@emotion/styled": "^11.6.0", - "@emotion/utils": "^1.0.0", - "@floating-ui/react-dom": "^2.0.1", - "@types/gradient-parser": "0.1.3", - "@types/highlight-words-core": "1.2.1", - "@use-gesture/react": "^10.2.24", - "@wordpress/a11y": "^3.50.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/date": "^4.50.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/escape-html": "^2.50.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/primitives": "^3.48.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/warning": "^2.50.0", - "change-case": "^4.1.2", - "classnames": "^2.3.1", - "colord": "^2.7.0", - "date-fns": "^2.28.0", - "deepmerge": "^4.3.0", - "dom-scroll-into-view": "^1.2.1", - "downshift": "^6.0.15", - "fast-deep-equal": "^3.1.3", - "framer-motion": "^10.13.0", - "gradient-parser": "^0.1.5", - "highlight-words-core": "^1.2.2", - "is-plain-object": "^5.0.0", - "memize": "^2.1.0", - "path-to-regexp": "^6.2.1", - "re-resizable": "^6.4.0", - "react-colorful": "^5.3.1", - "reakit": "^1.3.11", - "remove-accents": "^0.5.0", - "use-lilius": "^2.0.1", - "uuid": "^9.0.1", - "valtio": "1.7.0" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" - } - }, "node_modules/@wordpress/patterns/node_modules/@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.33.0.tgz", + "integrity": "sha512-Dc8y7m17gAKnDVFOPDqPcb2jo9cDhDNikLdepTkRXLywYUPT2PFH4GrXsVK87BLc+nCIqgs3DFU/AJx1db4y/w==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -8907,19 +8764,6 @@ "node": ">=12" } }, - "node_modules/@wordpress/patterns/node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true, - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/@wordpress/plugins": { "version": "6.19.1", "resolved": "https://registry.npmjs.org/@wordpress/plugins/-/plugins-6.19.1.tgz", @@ -9067,88 +8911,23 @@ } }, "node_modules/@wordpress/reusable-blocks": { - "version": "4.27.2", - "resolved": "https://registry.npmjs.org/@wordpress/reusable-blocks/-/reusable-blocks-4.27.2.tgz", - "integrity": "sha512-kkhZyYFj4rbf7lPOqDMfaNO3fqLEyHYKjWITWzRMUPtLeIHin/DHepVz6Z6NERANHpbP0mD4BDoBEGYJ9/brbA==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.16.0", - "@wordpress/block-editor": "^12.18.2", - "@wordpress/blocks": "^12.27.1", - "@wordpress/components": "^25.16.0", - "@wordpress/core-data": "^6.27.2", - "@wordpress/data": "^9.20.0", - "@wordpress/element": "^5.27.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/notices": "^4.18.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/url": "^3.51.0" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" - } - }, - "node_modules/@wordpress/reusable-blocks/node_modules/@wordpress/components": { - "version": "25.16.0", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", - "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@wordpress/reusable-blocks/-/reusable-blocks-4.28.1.tgz", + "integrity": "sha512-+d6Yal7cIYbUPaDRsRxg3L3pNUR1Aa5bWTIi9kdyYMsB9rcrWDNjpIFG9olLedVFk5j3Dn/dG10wTrp39YxyqA==", "dev": true, "dependencies": { - "@ariakit/react": "^0.3.12", "@babel/runtime": "^7.16.0", - "@emotion/cache": "^11.7.1", - "@emotion/css": "^11.7.1", - "@emotion/react": "^11.7.1", - "@emotion/serialize": "^1.0.2", - "@emotion/styled": "^11.6.0", - "@emotion/utils": "^1.0.0", - "@floating-ui/react-dom": "^2.0.1", - "@types/gradient-parser": "0.1.3", - "@types/highlight-words-core": "1.2.1", - "@use-gesture/react": "^10.2.24", - "@wordpress/a11y": "^3.50.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/date": "^4.50.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/escape-html": "^2.50.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/primitives": "^3.48.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/warning": "^2.50.0", - "change-case": "^4.1.2", - "classnames": "^2.3.1", - "colord": "^2.7.0", - "date-fns": "^2.28.0", - "deepmerge": "^4.3.0", - "dom-scroll-into-view": "^1.2.1", - "downshift": "^6.0.15", - "fast-deep-equal": "^3.1.3", - "framer-motion": "^10.13.0", - "gradient-parser": "^0.1.5", - "highlight-words-core": "^1.2.2", - "is-plain-object": "^5.0.0", - "memize": "^2.1.0", - "path-to-regexp": "^6.2.1", - "re-resizable": "^6.4.0", - "react-colorful": "^5.3.1", - "reakit": "^1.3.11", - "remove-accents": "^0.5.0", - "use-lilius": "^2.0.1", - "uuid": "^9.0.1", - "valtio": "1.7.0" + "@wordpress/block-editor": "^12.19.1", + "@wordpress/blocks": "^12.28.1", + "@wordpress/components": "^26.0.1", + "@wordpress/core-data": "^6.28.1", + "@wordpress/data": "^9.21.0", + "@wordpress/element": "^5.28.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/icons": "^9.42.0", + "@wordpress/notices": "^4.19.0", + "@wordpress/private-apis": "^0.33.0", + "@wordpress/url": "^3.52.0" }, "engines": { "node": ">=12" @@ -9159,9 +8938,9 @@ } }, "node_modules/@wordpress/reusable-blocks/node_modules/@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.33.0.tgz", + "integrity": "sha512-Dc8y7m17gAKnDVFOPDqPcb2jo9cDhDNikLdepTkRXLywYUPT2PFH4GrXsVK87BLc+nCIqgs3DFU/AJx1db4y/w==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0" @@ -9170,19 +8949,6 @@ "node": ">=12" } }, - "node_modules/@wordpress/reusable-blocks/node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true, - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/@wordpress/rich-text": { "version": "6.28.1", "resolved": "https://registry.npmjs.org/@wordpress/rich-text/-/rich-text-6.28.1.tgz", @@ -9598,21 +9364,21 @@ } }, "node_modules/@wordpress/server-side-render": { - "version": "4.27.1", - "resolved": "https://registry.npmjs.org/@wordpress/server-side-render/-/server-side-render-4.27.1.tgz", - "integrity": "sha512-hovofyT0z75NSK/CSkkSbbTdkq9Afc1MKbEVGXTGpqq5sKOa7IAcxWjzmh8byTgT8x7GEaAyHZUr31p4l0CGnQ==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@wordpress/server-side-render/-/server-side-render-4.28.1.tgz", + "integrity": "sha512-xXGUOvsDZ+QV3NcqMm1ag8kREV8WQz15+bntd4PUus24qvexvqBO+KzfxNSjgfrJw/vl1kgSgATBHtaOUMCmcQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.16.0", - "@wordpress/api-fetch": "^6.47.0", - "@wordpress/blocks": "^12.27.1", - "@wordpress/components": "^25.16.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/data": "^9.20.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/url": "^3.51.0", + "@wordpress/api-fetch": "^6.48.0", + "@wordpress/blocks": "^12.28.1", + "@wordpress/components": "^26.0.1", + "@wordpress/compose": "^6.28.0", + "@wordpress/data": "^9.21.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/url": "^3.52.0", "fast-deep-equal": "^3.1.3" }, "engines": { @@ -9623,96 +9389,6 @@ "react-dom": "^18.0.0" } }, - "node_modules/@wordpress/server-side-render/node_modules/@wordpress/components": { - "version": "25.16.0", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", - "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", - "dev": true, - "dependencies": { - "@ariakit/react": "^0.3.12", - "@babel/runtime": "^7.16.0", - "@emotion/cache": "^11.7.1", - "@emotion/css": "^11.7.1", - "@emotion/react": "^11.7.1", - "@emotion/serialize": "^1.0.2", - "@emotion/styled": "^11.6.0", - "@emotion/utils": "^1.0.0", - "@floating-ui/react-dom": "^2.0.1", - "@types/gradient-parser": "0.1.3", - "@types/highlight-words-core": "1.2.1", - "@use-gesture/react": "^10.2.24", - "@wordpress/a11y": "^3.50.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/date": "^4.50.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/escape-html": "^2.50.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/primitives": "^3.48.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/warning": "^2.50.0", - "change-case": "^4.1.2", - "classnames": "^2.3.1", - "colord": "^2.7.0", - "date-fns": "^2.28.0", - "deepmerge": "^4.3.0", - "dom-scroll-into-view": "^1.2.1", - "downshift": "^6.0.15", - "fast-deep-equal": "^3.1.3", - "framer-motion": "^10.13.0", - "gradient-parser": "^0.1.5", - "highlight-words-core": "^1.2.2", - "is-plain-object": "^5.0.0", - "memize": "^2.1.0", - "path-to-regexp": "^6.2.1", - "re-resizable": "^6.4.0", - "react-colorful": "^5.3.1", - "reakit": "^1.3.11", - "remove-accents": "^0.5.0", - "use-lilius": "^2.0.1", - "uuid": "^9.0.1", - "valtio": "1.7.0" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" - } - }, - "node_modules/@wordpress/server-side-render/node_modules/@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.16.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@wordpress/server-side-render/node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true, - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/@wordpress/shortcode": { "version": "3.51.0", "resolved": "https://registry.npmjs.org/@wordpress/shortcode/-/shortcode-3.51.0.tgz", @@ -34805,42 +34481,42 @@ } }, "@wordpress/editor": { - "version": "13.27.2", - "resolved": "https://registry.npmjs.org/@wordpress/editor/-/editor-13.27.2.tgz", - "integrity": "sha512-Wk1dwG5bkmDD74zip36yC1NO3EleXe/t35Z9GHfLaiZkUYlhZV2gv66QrrGN7Y59Zl68j+b4lRGLkUxEMWkleA==", + "version": "13.28.1", + "resolved": "https://registry.npmjs.org/@wordpress/editor/-/editor-13.28.1.tgz", + "integrity": "sha512-KqNOI3iaPUAkPSp7i/IxnOl1TCLrQ4win9NzRMXg7DN7G5KiobpFYYWre1NrbDbBbRMxpu/G12uN1jWGIvGQKQ==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.50.0", - "@wordpress/api-fetch": "^6.47.0", - "@wordpress/blob": "^3.50.0", - "@wordpress/block-editor": "^12.18.2", - "@wordpress/blocks": "^12.27.1", - "@wordpress/commands": "^0.21.0", - "@wordpress/components": "^25.16.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/core-data": "^6.27.2", - "@wordpress/data": "^9.20.0", - "@wordpress/date": "^4.50.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/keyboard-shortcuts": "^4.27.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/media-utils": "^4.41.0", - "@wordpress/notices": "^4.18.0", - "@wordpress/patterns": "^1.11.2", - "@wordpress/preferences": "^3.27.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/reusable-blocks": "^4.27.2", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/server-side-render": "^4.27.1", - "@wordpress/url": "^3.51.0", - "@wordpress/wordcount": "^3.50.0", + "@wordpress/a11y": "^3.51.0", + "@wordpress/api-fetch": "^6.48.0", + "@wordpress/blob": "^3.51.0", + "@wordpress/block-editor": "^12.19.1", + "@wordpress/blocks": "^12.28.1", + "@wordpress/commands": "^0.22.1", + "@wordpress/components": "^26.0.1", + "@wordpress/compose": "^6.28.0", + "@wordpress/core-data": "^6.28.1", + "@wordpress/data": "^9.21.0", + "@wordpress/date": "^4.51.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/dom": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/hooks": "^3.51.0", + "@wordpress/html-entities": "^3.51.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/icons": "^9.42.0", + "@wordpress/keyboard-shortcuts": "^4.28.0", + "@wordpress/keycodes": "^3.51.0", + "@wordpress/media-utils": "^4.42.0", + "@wordpress/notices": "^4.19.0", + "@wordpress/patterns": "^1.12.1", + "@wordpress/preferences": "^3.28.1", + "@wordpress/private-apis": "^0.33.0", + "@wordpress/reusable-blocks": "^4.28.1", + "@wordpress/rich-text": "^6.28.1", + "@wordpress/server-side-render": "^4.28.1", + "@wordpress/url": "^3.52.0", + "@wordpress/wordcount": "^3.51.0", "classnames": "^2.3.1", "date-fns": "^2.28.0", "memize": "^2.1.0", @@ -34850,96 +34526,32 @@ }, "dependencies": { "@wordpress/commands": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.21.0.tgz", - "integrity": "sha512-MzMUGCT9cQXto1jrA5lHAtnieTyAhcuNIxfyxlcE+316KNQfbyD8bc7KOzSV2sxXD/rfHuCxvHjfomFyyP+4kA==", + "version": "0.22.1", + "resolved": "https://registry.npmjs.org/@wordpress/commands/-/commands-0.22.1.tgz", + "integrity": "sha512-lA5LH7fyV0ov8QgZ1cetstTH9pQL+3b0RAYoR/MJJLOzlEdg7NXbb2vIKTYZ13oF1Oo4oIdrG+JDUeL94wVVvQ==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/components": "^25.16.0", - "@wordpress/data": "^9.20.0", - "@wordpress/element": "^5.27.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/keyboard-shortcuts": "^4.27.0", - "@wordpress/private-apis": "^0.32.0", + "@wordpress/components": "^26.0.1", + "@wordpress/data": "^9.21.0", + "@wordpress/element": "^5.28.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/icons": "^9.42.0", + "@wordpress/keyboard-shortcuts": "^4.28.0", + "@wordpress/private-apis": "^0.33.0", "classnames": "^2.3.1", "cmdk": "^0.2.0", "rememo": "^4.0.2" } }, - "@wordpress/components": { - "version": "25.16.0", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", - "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", - "dev": true, - "requires": { - "@ariakit/react": "^0.3.12", - "@babel/runtime": "^7.16.0", - "@emotion/cache": "^11.7.1", - "@emotion/css": "^11.7.1", - "@emotion/react": "^11.7.1", - "@emotion/serialize": "^1.0.2", - "@emotion/styled": "^11.6.0", - "@emotion/utils": "^1.0.0", - "@floating-ui/react-dom": "^2.0.1", - "@types/gradient-parser": "0.1.3", - "@types/highlight-words-core": "1.2.1", - "@use-gesture/react": "^10.2.24", - "@wordpress/a11y": "^3.50.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/date": "^4.50.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/escape-html": "^2.50.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/primitives": "^3.48.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/warning": "^2.50.0", - "change-case": "^4.1.2", - "classnames": "^2.3.1", - "colord": "^2.7.0", - "date-fns": "^2.28.0", - "deepmerge": "^4.3.0", - "dom-scroll-into-view": "^1.2.1", - "downshift": "^6.0.15", - "fast-deep-equal": "^3.1.3", - "framer-motion": "^10.13.0", - "gradient-parser": "^0.1.5", - "highlight-words-core": "^1.2.2", - "is-plain-object": "^5.0.0", - "memize": "^2.1.0", - "path-to-regexp": "^6.2.1", - "re-resizable": "^6.4.0", - "react-colorful": "^5.3.1", - "reakit": "^1.3.11", - "remove-accents": "^0.5.0", - "use-lilius": "^2.0.1", - "uuid": "^9.0.1", - "valtio": "1.7.0" - } - }, "@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.33.0.tgz", + "integrity": "sha512-Dc8y7m17gAKnDVFOPDqPcb2jo9cDhDNikLdepTkRXLywYUPT2PFH4GrXsVK87BLc+nCIqgs3DFU/AJx1db4y/w==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" } - }, - "uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true } } }, @@ -35284,16 +34896,16 @@ } }, "@wordpress/media-utils": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/@wordpress/media-utils/-/media-utils-4.41.0.tgz", - "integrity": "sha512-wCxk8DAhmZ/3/a+oPRrieGurMOKDrYoDnnA0jhTm2D45kvn9y+NfnNBvLo2q1Is1ZiVTtNq54IRUXcdOjZgR9A==", + "version": "4.42.0", + "resolved": "https://registry.npmjs.org/@wordpress/media-utils/-/media-utils-4.42.0.tgz", + "integrity": "sha512-gUKtF94RmFJwlGSoRKaRB/NipM7u1OVYR4UepMFtLB7La8UBWaklTZfpYGjOHfnFkhxiFTULk1j/7b0OVkPMSw==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/api-fetch": "^6.47.0", - "@wordpress/blob": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/i18n": "^4.50.0" + "@wordpress/api-fetch": "^6.48.0", + "@wordpress/blob": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/i18n": "^4.51.0" } }, "@wordpress/notices": { @@ -35315,101 +34927,37 @@ "requires": {} }, "@wordpress/patterns": { - "version": "1.11.2", - "resolved": "https://registry.npmjs.org/@wordpress/patterns/-/patterns-1.11.2.tgz", - "integrity": "sha512-cN7xjw5pfKq73mVF0q0ebZh4DmAab5SlQ9CvM7PtB03JOl3GMwVIDV5Tnbbhfi1KIsFwep2/CGft3xwuJlS3FQ==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@wordpress/patterns/-/patterns-1.12.1.tgz", + "integrity": "sha512-7WcnfGeGVYa2QiRgES04NGf+dqJD4qinx9nPQowkTGxNmblC5ySl0v74IuTXkibPw94bw4ivpXsinHvJa1dyVQ==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/a11y": "^3.50.0", - "@wordpress/block-editor": "^12.18.2", - "@wordpress/blocks": "^12.27.1", - "@wordpress/components": "^25.16.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/core-data": "^6.27.2", - "@wordpress/data": "^9.20.0", - "@wordpress/element": "^5.27.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/notices": "^4.18.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/url": "^3.51.0", + "@wordpress/a11y": "^3.51.0", + "@wordpress/block-editor": "^12.19.1", + "@wordpress/blocks": "^12.28.1", + "@wordpress/components": "^26.0.1", + "@wordpress/compose": "^6.28.0", + "@wordpress/core-data": "^6.28.1", + "@wordpress/data": "^9.21.0", + "@wordpress/element": "^5.28.0", + "@wordpress/html-entities": "^3.51.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/icons": "^9.42.0", + "@wordpress/notices": "^4.19.0", + "@wordpress/private-apis": "^0.33.0", + "@wordpress/url": "^3.52.0", "nanoid": "^3.3.4" }, "dependencies": { - "@wordpress/components": { - "version": "25.16.0", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", - "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", - "dev": true, - "requires": { - "@ariakit/react": "^0.3.12", - "@babel/runtime": "^7.16.0", - "@emotion/cache": "^11.7.1", - "@emotion/css": "^11.7.1", - "@emotion/react": "^11.7.1", - "@emotion/serialize": "^1.0.2", - "@emotion/styled": "^11.6.0", - "@emotion/utils": "^1.0.0", - "@floating-ui/react-dom": "^2.0.1", - "@types/gradient-parser": "0.1.3", - "@types/highlight-words-core": "1.2.1", - "@use-gesture/react": "^10.2.24", - "@wordpress/a11y": "^3.50.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/date": "^4.50.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/escape-html": "^2.50.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/primitives": "^3.48.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/warning": "^2.50.0", - "change-case": "^4.1.2", - "classnames": "^2.3.1", - "colord": "^2.7.0", - "date-fns": "^2.28.0", - "deepmerge": "^4.3.0", - "dom-scroll-into-view": "^1.2.1", - "downshift": "^6.0.15", - "fast-deep-equal": "^3.1.3", - "framer-motion": "^10.13.0", - "gradient-parser": "^0.1.5", - "highlight-words-core": "^1.2.2", - "is-plain-object": "^5.0.0", - "memize": "^2.1.0", - "path-to-regexp": "^6.2.1", - "re-resizable": "^6.4.0", - "react-colorful": "^5.3.1", - "reakit": "^1.3.11", - "remove-accents": "^0.5.0", - "use-lilius": "^2.0.1", - "uuid": "^9.0.1", - "valtio": "1.7.0" - } - }, "@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.33.0.tgz", + "integrity": "sha512-Dc8y7m17gAKnDVFOPDqPcb2jo9cDhDNikLdepTkRXLywYUPT2PFH4GrXsVK87BLc+nCIqgs3DFU/AJx1db4y/w==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" } - }, - "uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true } } }, @@ -35519,97 +35067,33 @@ } }, "@wordpress/reusable-blocks": { - "version": "4.27.2", - "resolved": "https://registry.npmjs.org/@wordpress/reusable-blocks/-/reusable-blocks-4.27.2.tgz", - "integrity": "sha512-kkhZyYFj4rbf7lPOqDMfaNO3fqLEyHYKjWITWzRMUPtLeIHin/DHepVz6Z6NERANHpbP0mD4BDoBEGYJ9/brbA==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@wordpress/reusable-blocks/-/reusable-blocks-4.28.1.tgz", + "integrity": "sha512-+d6Yal7cIYbUPaDRsRxg3L3pNUR1Aa5bWTIi9kdyYMsB9rcrWDNjpIFG9olLedVFk5j3Dn/dG10wTrp39YxyqA==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/block-editor": "^12.18.2", - "@wordpress/blocks": "^12.27.1", - "@wordpress/components": "^25.16.0", - "@wordpress/core-data": "^6.27.2", - "@wordpress/data": "^9.20.0", - "@wordpress/element": "^5.27.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/notices": "^4.18.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/url": "^3.51.0" + "@wordpress/block-editor": "^12.19.1", + "@wordpress/blocks": "^12.28.1", + "@wordpress/components": "^26.0.1", + "@wordpress/core-data": "^6.28.1", + "@wordpress/data": "^9.21.0", + "@wordpress/element": "^5.28.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/icons": "^9.42.0", + "@wordpress/notices": "^4.19.0", + "@wordpress/private-apis": "^0.33.0", + "@wordpress/url": "^3.52.0" }, "dependencies": { - "@wordpress/components": { - "version": "25.16.0", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", - "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", - "dev": true, - "requires": { - "@ariakit/react": "^0.3.12", - "@babel/runtime": "^7.16.0", - "@emotion/cache": "^11.7.1", - "@emotion/css": "^11.7.1", - "@emotion/react": "^11.7.1", - "@emotion/serialize": "^1.0.2", - "@emotion/styled": "^11.6.0", - "@emotion/utils": "^1.0.0", - "@floating-ui/react-dom": "^2.0.1", - "@types/gradient-parser": "0.1.3", - "@types/highlight-words-core": "1.2.1", - "@use-gesture/react": "^10.2.24", - "@wordpress/a11y": "^3.50.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/date": "^4.50.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/escape-html": "^2.50.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/primitives": "^3.48.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/warning": "^2.50.0", - "change-case": "^4.1.2", - "classnames": "^2.3.1", - "colord": "^2.7.0", - "date-fns": "^2.28.0", - "deepmerge": "^4.3.0", - "dom-scroll-into-view": "^1.2.1", - "downshift": "^6.0.15", - "fast-deep-equal": "^3.1.3", - "framer-motion": "^10.13.0", - "gradient-parser": "^0.1.5", - "highlight-words-core": "^1.2.2", - "is-plain-object": "^5.0.0", - "memize": "^2.1.0", - "path-to-regexp": "^6.2.1", - "re-resizable": "^6.4.0", - "react-colorful": "^5.3.1", - "reakit": "^1.3.11", - "remove-accents": "^0.5.0", - "use-lilius": "^2.0.1", - "uuid": "^9.0.1", - "valtio": "1.7.0" - } - }, "@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.33.0.tgz", + "integrity": "sha512-Dc8y7m17gAKnDVFOPDqPcb2jo9cDhDNikLdepTkRXLywYUPT2PFH4GrXsVK87BLc+nCIqgs3DFU/AJx1db4y/w==", "dev": true, "requires": { "@babel/runtime": "^7.16.0" } - }, - "uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true } } }, @@ -35927,97 +35411,22 @@ } }, "@wordpress/server-side-render": { - "version": "4.27.1", - "resolved": "https://registry.npmjs.org/@wordpress/server-side-render/-/server-side-render-4.27.1.tgz", - "integrity": "sha512-hovofyT0z75NSK/CSkkSbbTdkq9Afc1MKbEVGXTGpqq5sKOa7IAcxWjzmh8byTgT8x7GEaAyHZUr31p4l0CGnQ==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@wordpress/server-side-render/-/server-side-render-4.28.1.tgz", + "integrity": "sha512-xXGUOvsDZ+QV3NcqMm1ag8kREV8WQz15+bntd4PUus24qvexvqBO+KzfxNSjgfrJw/vl1kgSgATBHtaOUMCmcQ==", "dev": true, "requires": { "@babel/runtime": "^7.16.0", - "@wordpress/api-fetch": "^6.47.0", - "@wordpress/blocks": "^12.27.1", - "@wordpress/components": "^25.16.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/data": "^9.20.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/url": "^3.51.0", + "@wordpress/api-fetch": "^6.48.0", + "@wordpress/blocks": "^12.28.1", + "@wordpress/components": "^26.0.1", + "@wordpress/compose": "^6.28.0", + "@wordpress/data": "^9.21.0", + "@wordpress/deprecated": "^3.51.0", + "@wordpress/element": "^5.28.0", + "@wordpress/i18n": "^4.51.0", + "@wordpress/url": "^3.52.0", "fast-deep-equal": "^3.1.3" - }, - "dependencies": { - "@wordpress/components": { - "version": "25.16.0", - "resolved": "https://registry.npmjs.org/@wordpress/components/-/components-25.16.0.tgz", - "integrity": "sha512-voQuMsO5JbH+JW33TnWurwwvpSb8IQ4XU5wyVMubX4TUwadt+/2ToNJbZIDXoaJPei7vbM81Ft+pH+zGlN8CyA==", - "dev": true, - "requires": { - "@ariakit/react": "^0.3.12", - "@babel/runtime": "^7.16.0", - "@emotion/cache": "^11.7.1", - "@emotion/css": "^11.7.1", - "@emotion/react": "^11.7.1", - "@emotion/serialize": "^1.0.2", - "@emotion/styled": "^11.6.0", - "@emotion/utils": "^1.0.0", - "@floating-ui/react-dom": "^2.0.1", - "@types/gradient-parser": "0.1.3", - "@types/highlight-words-core": "1.2.1", - "@use-gesture/react": "^10.2.24", - "@wordpress/a11y": "^3.50.0", - "@wordpress/compose": "^6.27.0", - "@wordpress/date": "^4.50.0", - "@wordpress/deprecated": "^3.50.0", - "@wordpress/dom": "^3.50.0", - "@wordpress/element": "^5.27.0", - "@wordpress/escape-html": "^2.50.0", - "@wordpress/hooks": "^3.50.0", - "@wordpress/html-entities": "^3.50.0", - "@wordpress/i18n": "^4.50.0", - "@wordpress/icons": "^9.41.0", - "@wordpress/is-shallow-equal": "^4.50.0", - "@wordpress/keycodes": "^3.50.0", - "@wordpress/primitives": "^3.48.0", - "@wordpress/private-apis": "^0.32.0", - "@wordpress/rich-text": "^6.27.0", - "@wordpress/warning": "^2.50.0", - "change-case": "^4.1.2", - "classnames": "^2.3.1", - "colord": "^2.7.0", - "date-fns": "^2.28.0", - "deepmerge": "^4.3.0", - "dom-scroll-into-view": "^1.2.1", - "downshift": "^6.0.15", - "fast-deep-equal": "^3.1.3", - "framer-motion": "^10.13.0", - "gradient-parser": "^0.1.5", - "highlight-words-core": "^1.2.2", - "is-plain-object": "^5.0.0", - "memize": "^2.1.0", - "path-to-regexp": "^6.2.1", - "re-resizable": "^6.4.0", - "react-colorful": "^5.3.1", - "reakit": "^1.3.11", - "remove-accents": "^0.5.0", - "use-lilius": "^2.0.1", - "uuid": "^9.0.1", - "valtio": "1.7.0" - } - }, - "@wordpress/private-apis": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@wordpress/private-apis/-/private-apis-0.32.0.tgz", - "integrity": "sha512-P7nxI/bGMDQhtlTfSe1Y2SDfrd20K5UMnTHbq+hmIkzBGRpNPbdGeNu2bZaZtIvmXk1OCR0Fkef+e6QqkOfYPg==", - "dev": true, - "requires": { - "@babel/runtime": "^7.16.0" - } - }, - "uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true - } } }, "@wordpress/shortcode": { diff --git a/package.json b/package.json index 6afd234be..b48e6541e 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "@wordpress/data": "^9.19.0", "@wordpress/e2e-test-utils": "^10.22.0", "@wordpress/edit-post": "^7.24.0", - "@wordpress/editor": "^13.27.2", + "@wordpress/editor": "^13.28.1", "@wordpress/element": "^5.25.0", "@wordpress/env": "^9.3.0", "@wordpress/eslint-plugin": "^17.7.0", From e4a606fd3dd1ee3472d5e4763eebcbe8efe31d95 Mon Sep 17 00:00:00 2001 From: Alex Cicovic <23142906+acicovic@users.noreply.github.com> Date: Fri, 16 Feb 2024 09:49:33 +0200 Subject: [PATCH 032/110] Include more metadata for non-posts --- src/Metadata/class-metadata-builder.php | 486 +++++++++++++++++++++++- src/Metadata/class-page-builder.php | 11 +- src/Metadata/class-post-builder.php | 475 +---------------------- 3 files changed, 505 insertions(+), 467 deletions(-) diff --git a/src/Metadata/class-metadata-builder.php b/src/Metadata/class-metadata-builder.php index 96377bfe6..ecca2625f 100644 --- a/src/Metadata/class-metadata-builder.php +++ b/src/Metadata/class-metadata-builder.php @@ -11,6 +11,10 @@ namespace Parsely\Metadata; use Parsely\Parsely; +use WP_Post; +use WP_User; + +use function Parsely\Utils\get_default_category; /** * Abstract class that implements modular builders for Metadata. @@ -20,6 +24,8 @@ * * @since 1.0.0 * @since 3.3.0 Logic extracted from Parsely\Parsely class to separate file/class. + * + * @phpstan-import-type Parsely_Options from Parsely */ abstract class Metadata_Builder { /** @@ -66,7 +72,7 @@ protected function build_basic(): void { } /** - * Populates the `url` field in the metadata object by getting the current page's URL. + * Populates the url field in the metadata object. * * @since 3.4.0 */ @@ -74,6 +80,144 @@ protected function build_url(): void { $this->metadata['url'] = $this->get_current_url(); } + /** + * Populates the author and creator fields in the metadata object. + * + * @since 3.4.0 + * @since 3.14.0 Moved from `Post_Builder` to `Metadata_Builder`. + * + * @param WP_Post $post The post/page for which to populate the fields. + */ + protected function build_author( WP_Post $post ): void { + $authors = $this->get_author_names( $post ); + $author_objects = array(); + foreach ( $authors as $author ) { + $author_tag = array( + '@type' => 'Person', + 'name' => $author, + ); + $author_objects[] = $author_tag; + } + $this->metadata['author'] = $author_objects; + $this->metadata['creator'] = $authors; + } + + /** + * Populates all the fields related to time in the metadata object. + * + * @param WP_Post $post The post/page for which to populate the field. + * + * @since 3.0.2 + * @since 3.3.0 Moved to class-metadata. + * @since 3.14.0 Moved from `Post_Builder` to `Metadata_Builder`. + */ + protected function build_metadata_post_times( WP_Post $post ): void { + $date_format = 'Y-m-d\TH:i:s\Z'; + $post_created_gmt = get_post_time( $date_format, true, $post ); + + if ( false === $post_created_gmt ) { + return; + } + + $this->metadata['dateCreated'] = $post_created_gmt; + $this->metadata['datePublished'] = $post_created_gmt; + $this->metadata['dateModified'] = $post_created_gmt; + + $post_modified_gmt = get_post_modified_time( $date_format, true, $post ); + + if ( false !== $post_modified_gmt && $post_modified_gmt > $post_created_gmt ) { + $this->metadata['dateModified'] = $post_modified_gmt; + } + } + + /** + * Populates the articleSection field in the metadata object. + * + * @since 3.4.0 + * @since 3.14.0 Moved from `Post_Builder` to `Metadata_Builder`. + * + * @param WP_Post $post The post/page for which to populate the field. + */ + protected function build_article_section( WP_Post $post ): void { + $this->metadata['articleSection'] = $this->get_category_name( $post, $this->parsely->get_options() ); + } + + /** + * Populates the keywords field in the metadata object. + * + * @since 3.4.0 + * @since 3.14.0 Moved from `Post_Builder` to `Metadata_Builder`. + * + * @param WP_Post $post The post/page for which to populate the field. + */ + protected function build_keywords( WP_Post $post ): void { + $options = $this->parsely->get_options(); + $tags = $this->get_tags( $post->ID ); + if ( $options['cats_as_tags'] ) { + $tags = array_merge( $tags, $this->get_categories( $post->ID ) ); + // add custom taxonomy values. + $tags = array_merge( $tags, $this->get_custom_taxonomy_values( $post ) ); + } + // The function 'mb_strtolower' is not enabled by default in php, so this check + // falls back to the native php function 'strtolower' if necessary. + if ( function_exists( 'mb_strtolower' ) ) { + $lowercase_callback = 'mb_strtolower'; + } else { + $lowercase_callback = 'strtolower'; + } + if ( $options['lowercase_tags'] ) { + $tags = array_map( $lowercase_callback, $tags ); + } + + /** + * Filters the post tags that are used as metadata keywords. + * + * @since 1.8.0 + * + * @param array $tags Post tags. + * @param int $ID Post ID. + */ + $tags = apply_filters( 'wp_parsely_post_tags', $tags, $post->ID ); + $tags = array_map( array( $this, 'clean_value' ), $tags ); + + $this->metadata['keywords'] = array_values( array_unique( $tags ) ); + } + + /** + * Populates the thumbnailUrl field in the metadata object. + * + * @param WP_Post $post The post/page for which to populate the field. + * + * @since 3.4.0 + * @since 3.14.0 Moved from `Post_Builder` to `Metadata_Builder`. + */ + protected function build_thumbnail_url( WP_Post $post ): void { + $thumb_url = get_the_post_thumbnail_url( $post, 'thumbnail' ); + if ( ! is_string( $thumb_url ) ) { + $thumb_url = ''; + } + $this->metadata['thumbnailUrl'] = $thumb_url; + } + + /** + * Populates the image field in the metadata object. + * + * @param WP_Post $post The post/page for which to populate the field. + * + * @since 3.4.0 + * @since 3.14.0 Moved from `Post_Builder` to `Metadata_Builder`. + */ + protected function build_image( WP_Post $post ): void { + $image_url = get_the_post_thumbnail_url( $post, 'full' ); + if ( ! is_string( $image_url ) ) { + $image_url = ''; + } + $this->metadata['image'] = array( + '@type' => 'ImageObject', + 'url' => $image_url, + ); + } + /** * Sanitizes string content. * @@ -134,4 +278,344 @@ protected function get_current_url( string $parsely_type = 'non-post', int $post ? str_replace( 'http://', 'https://', $url ) : str_replace( 'https://', 'http://', $url ); } + + /** + * Returns a properly cleaned category/taxonomy value and will optionally + * use the top-level category/taxonomy value, if so instructed via the + * use_top_level_cats option. + * + * @since 3.3.0 Moved to class-metadata. + * @since 3.14.0 Moved from `Post_Builder` to `Metadata_Builder`. + * + * @param WP_Post $post_obj The object for the post. + * @param Parsely_Options $parsely_options The parsely options. + * @return string Cleaned category name for the post in question. + */ + private function get_category_name( WP_Post $post_obj, $parsely_options ): string { + $taxonomy_dropdown_choice = get_the_terms( $post_obj->ID, $parsely_options['custom_taxonomy_section'] ); + // Get top-level taxonomy name for chosen taxonomy and assign to $parent_name; it will be used + // as the category value if 'use_top_level_cats' option is checked. + // Assign as the default category name if no value is checked for the chosen taxonomy. + $category_name = get_cat_name( get_default_category() ); + if ( false !== $taxonomy_dropdown_choice && ! is_wp_error( $taxonomy_dropdown_choice ) ) { + if ( $parsely_options['use_top_level_cats'] ) { + $first_term = array_shift( $taxonomy_dropdown_choice ); + if ( null !== $first_term ) { + $term_name = $this->get_top_level_term( $first_term->term_id, $first_term->taxonomy ); + } + } else { + $term_name = $this->get_bottom_level_term( $post_obj->ID, $parsely_options['custom_taxonomy_section'] ); + } + + if ( isset( $term_name ) && is_string( $term_name ) && 0 < strlen( $term_name ) ) { + $category_name = $term_name; + } + } + + /** + * Filters the constructed category name. + * + * @since 1.8.0 + * + * @param string $category Category name. + * @param WP_Post $post_obj Post object. + * @param array $parsely_options The Parsely options. + */ + $category_name = apply_filters( 'wp_parsely_post_category', $category_name, $post_obj, $parsely_options ); + + return $this->clean_value( $category_name ); + } + + /** + * Returns the top-most category/taxonomy value in a hierarchy given a + * taxonomy value's ID. + * + * (WordPress calls taxonomy values 'terms'). + * + * @since 3.3.0 Moved to class-metadata. + * @since 3.14.0 Moved from `Post_Builder` to `Metadata_Builder`. + * + * @param int $term_id The ID of the top level term. + * @param string $taxonomy_name The name of the taxonomy. + * @return string|false $parent The top level name of the category/taxonomy. + */ + private function get_top_level_term( int $term_id, string $taxonomy_name ) { + $parent = get_term_by( 'id', $term_id, $taxonomy_name ); + + while ( false !== $parent && isset( $parent->parent ) && 0 !== $parent->parent ) { + $parent = get_term_by( 'id', $parent->parent, $taxonomy_name ); + } + + return $parent->name ?? false; + } + + /** + * Returns the bottom-most category/taxonomy value in a hierarchy given a + * post ID. + * + * (WordPress calls taxonomy values 'terms'). + * + * @since 3.3.0 Moved to class-metadata. + * @since 3.14.0 Moved from `Post_Builder` to `Metadata_Builder`. + * + * @param int $post_id The post id you're interested in. + * @param string $taxonomy_name The name of the taxonomy. + * @return string Name of the custom taxonomy. + */ + private function get_bottom_level_term( int $post_id, string $taxonomy_name ): string { + $terms = get_the_terms( $post_id, $taxonomy_name ); + + if ( ! is_array( $terms ) ) { + return ''; + } + + $term_ids = wp_list_pluck( $terms, 'term_id' ); + $parents = array_filter( wp_list_pluck( $terms, 'parent' ) ); + + // Get array of IDs of terms which are not parents. + $term_ids_not_parents = array_diff( $term_ids, $parents ); + // Get corresponding term objects, which are mapped to array index keys. + $terms_not_parents = array_intersect_key( $terms, $term_ids_not_parents ); + // remove array index keys. + $terms_not_parents_cleaned = array_values( $terms_not_parents ); + + if ( isset( $terms_not_parents_cleaned[0] ) ) { + // If you assign multiple child terms in a custom taxonomy, will only return the first. + return $terms_not_parents_cleaned[0]->name; + } + + return ''; + } + + /** + * Retrieves all the authors for a post as an array. Can include multiple + * authors if the Co-Authors Plus plugin is in use. + * + * @since 3.3.0 Moved to class-metadata. + * @since 3.14.0 Moved from `Post_Builder` to `Metadata_Builder`. + * + * @param WP_Post $post The post object. + * @return array + */ + private function get_author_names( WP_Post $post ): array { + $authors = $this->get_coauthor_names( $post->ID ); + if ( 0 === count( $authors ) ) { + $post_author = get_user_by( 'id', $post->post_author ); + if ( false !== $post_author ) { + $authors = array( $post_author ); + } + } + + /** + * Filters the list of author WP_User objects for a post. + * + * @since 1.14.0 + * + * @param array $authors One or more authors as WP_User objects. + * @param WP_Post $post Post object. + */ + $authors = apply_filters( 'wp_parsely_pre_authors', $authors, $post ); + + // Getting the author name for each author. + $authors = array_map( array( $this, 'get_author_name' ), $authors ); + + /** + * Filters the list of author names for a post. + * + * @since 1.14.0 + * + * @param array $authors One or more author names. + * @param WP_Post $post Post object. + */ + $authors = apply_filters( 'wp_parsely_post_authors', $authors, $post ); + + return array_map( array( $this, 'clean_value' ), $authors ); + } + + /** + * Returns a list of coauthors for a post assuming the Co-Authors Plus plugin + * is installed. + * + * Borrowed from + * https://github.com/Automattic/Co-Authors-Plus/blob/master/template-tags.php#L3-35 + * + * @since 3.3.0 Moved to class-metadata. + * @since 3.14.0 Moved from `Post_Builder` to `Metadata_Builder`. + * + * @param int $post_id The ID of the post. + * @return array List of coauthors, or an empty array if the Co-Authors Plus plugin is not active. + */ + private function get_coauthor_names( int $post_id ): array { + $coauthors = array(); + if ( class_exists( 'coauthors_plus' ) ) { + global $post, $post_ID, $coauthors_plus; + + if ( $post_id <= 0 && $post_ID ) { + $post_id = $post_ID; + } + + if ( ! $post_id && $post ) { + $post_id = $post->ID; + } + + if ( $post_id ) { + $coauthor_terms = get_the_terms( $post_id, $coauthors_plus->coauthor_taxonomy ); + + if ( is_array( $coauthor_terms ) ) { + foreach ( $coauthor_terms as $coauthor ) { + $coauthor_slug = preg_replace( '#^cap-#', '', $coauthor->slug ); + $post_author = $coauthors_plus->get_coauthor_by( 'user_nicename', $coauthor_slug ); + // In case the user has been deleted while plugin was deactivated. + if ( false !== $post_author ) { + $coauthors[] = new WP_User( $post_author ); + } + } + } elseif ( ! $coauthors_plus->force_guest_authors ) { + if ( $post && $post_id === $post->ID ) { + $post_author = get_userdata( $post->post_author ); + } + if ( isset( $post_author ) && false !== $post_author ) { + $coauthors[] = $post_author; + } + } + // The empty else case is because if we force guest authors, we don't ever care what value wp_posts.post_author has. + } + } + return $coauthors; + } + + /** + * Determines author name from display name, falling back to firstname + * lastname, then nickname and finally the nicename. + * + * @since 3.3.0 Moved to class-metadata. + * @since 3.14.0 Moved from `Post_Builder` to `Metadata_Builder`. + * + * @param ?WP_User $author The author of the post. + * @return string An author name. + */ + private function get_author_name( ?WP_User $author ): string { + // Gracefully handle situation where no author is available. + if ( null === $author ) { + return ''; + } + + if ( '' !== $author->display_name ) { + return $author->display_name; + } + + $author_name = $author->user_firstname . ' ' . $author->user_lastname; + if ( ' ' !== $author_name ) { + return $author_name; + } + + if ( '' !== $author->nickname ) { + return $author->nickname; + } + + if ( '' !== $author->user_nicename ) { + return $author->user_nicename; + } + + return ''; + } + + /** + * Returns the tags associated with this page or post. + * + * @since 3.3.0 Moved to class-metadata. + * @since 3.14.0 Moved from `Post_Builder` to `Metadata_Builder`. + * + * @param int $post_id The ID of the post you're trying to get tags for. + * @return array The tags of the post represented by the post id. + */ + private function get_tags( int $post_id ): array { + /** + * Variable. + * + * @var array<\WP_Term|null>|\WP_Error + */ + $post_tags = wp_get_post_tags( $post_id ); + $tags = array(); + + if ( ! is_wp_error( $post_tags ) ) { + foreach ( $post_tags as $wp_tag ) { + if ( null !== $wp_tag ) { + $tags[] = $wp_tag->name; + } + } + } + + return $tags; + } + + /** + * Returns an array of all the child categories for the current post. + * + * @since 3.3.0 Moved to class-metadata. + * @since 3.14.0 Moved from `Post_Builder` to `Metadata_Builder`. + * + * @param int $post_id The ID of the post you're trying to get categories for. + * @param string $delimiter What character will delimit the categories. + * @return array All the child categories of the current post. + */ + private function get_categories( int $post_id, string $delimiter = '/' ): array { + $tags = array(); + foreach ( get_the_category( $post_id ) as $category ) { + $hierarchy = get_category_parents( $category->term_id, false, $delimiter ); + if ( ! is_wp_error( $hierarchy ) ) { + $tags[] = rtrim( $hierarchy, '/' ); + } + } + // Take last element in the hierarchy, a string representing the full + // parent->child tree, and split it into individual category names. + $last_tag = end( $tags ); + if ( false !== $last_tag ) { + $tags = explode( '/', $last_tag ); + } + + // Remove default category name from tags if needed. + $default_category_name = get_cat_name( get_default_category() ); + return array_diff( $tags, array( $default_category_name ) ); + } + + /** + * Gets all term names from all custom taxonomies assigned to a post. + * + * @since 3.3.0 Moved to class-metadata. + * @since 3.4.0 Moved to class-post-builder. + * @since 3.14.0 Moved from `Post_Builder` to `Metadata_Builder`. + * + * @param WP_Post $post_obj The post object to find the terms for. + * @return array Term names. + */ + private function get_custom_taxonomy_values( WP_Post $post_obj ): array { + // Filter out default WordPress taxonomies. + $all_taxonomies = array_diff( + get_taxonomies(), + array( 'post_tag', 'nav_menu', 'author', 'link_category', 'post_format' ) + ); + + /** + * Filters the taxonomies. + * + * @since 3.11.0 + * + * @param array $all_taxonomies Taxonomies. + * @param WP_Post $post_obj Post object. + */ + $all_taxonomies = apply_filters( 'wp_parsely_custom_taxonomies', $all_taxonomies, $post_obj ); + $all_values = array(); + + foreach ( $all_taxonomies as $taxonomy ) { + $custom_taxonomy_objects = get_the_terms( $post_obj->ID, $taxonomy ); + if ( is_array( $custom_taxonomy_objects ) ) { + foreach ( $custom_taxonomy_objects as $custom_taxonomy_object ) { + $all_values[] = $custom_taxonomy_object->name; + } + } + } + + return $all_values; + } } diff --git a/src/Metadata/class-page-builder.php b/src/Metadata/class-page-builder.php index 5f55913bd..ef159c611 100644 --- a/src/Metadata/class-page-builder.php +++ b/src/Metadata/class-page-builder.php @@ -51,11 +51,18 @@ public function get_metadata(): array { $this->build_headline(); $this->build_url(); + $this->build_thumbnail_url( $this->post ); + $this->build_image( $this->post ); + $this->build_article_section( $this->post ); + $this->build_author( $this->post ); + $this->build_keywords( $this->post ); + $this->build_metadata_post_times( $this->post ); + return $this->metadata; } /** - * Populates the `headline` field in the metadata object. + * Populates the headline field in the metadata object. * * @since 3.4.0 */ @@ -64,7 +71,7 @@ private function build_headline(): void { } /** - * Populates the `url` field in the metadata object by getting the current page's URL. + * Populates the url field in the metadata object by getting the current page's URL. * * @since 3.4.0 */ diff --git a/src/Metadata/class-post-builder.php b/src/Metadata/class-post-builder.php index 5247d6c1f..8d8aad241 100644 --- a/src/Metadata/class-post-builder.php +++ b/src/Metadata/class-post-builder.php @@ -12,17 +12,12 @@ use Parsely\Parsely; use WP_Post; -use WP_User; - -use function Parsely\Utils\get_default_category; /** * Implements abstract Metadata Builder class to generate the metadata array * for a post page. * * @since 3.4.0 - * - * @phpstan-import-type Parsely_Options from Parsely */ class Post_Builder extends Metadata_Builder { /** @@ -58,19 +53,19 @@ public function get_metadata(): array { $this->build_type(); $this->build_main_entity(); - $this->build_thumbnail_url(); - $this->build_image(); - $this->build_article_section(); - $this->build_author(); + $this->build_thumbnail_url( $this->post ); + $this->build_image( $this->post ); + $this->build_article_section( $this->post ); + $this->build_author( $this->post ); $this->build_publisher(); - $this->build_keywords(); - $this->build_metadata_post_times(); + $this->build_keywords( $this->post ); + $this->build_metadata_post_times( $this->post ); return $this->metadata; } /** - * Populates the `headline` field in the metadata object. + * Populates the headline field in the metadata object. * * @since 3.4.0 */ @@ -79,7 +74,7 @@ private function build_headline(): void { } /** - * Populates the `url` field in the metadata object by getting the current page's URL. + * Populates the url field in the metadata object by getting the current page's URL. * * @since 3.4.0 */ @@ -88,7 +83,7 @@ protected function build_url(): void { } /** - * Populates the `@type` field in the metadata object. + * Populates the @type field in the metadata object. * * @since 3.4.0 */ @@ -122,7 +117,7 @@ private function build_type(): void { } /** - * Populates the `mainEntityOfPage` field in the metadata object. + * Populates the mainEntityOfPage field in the metadata object. * * @since 3.4.0 */ @@ -134,64 +129,7 @@ private function build_main_entity(): void { } /** - * Populates the `thumbnailUrl` field in the metadata object. - * - * @since 3.4.0 - */ - private function build_thumbnail_url(): void { - $thumb_url = get_the_post_thumbnail_url( $this->post, 'thumbnail' ); - if ( ! is_string( $thumb_url ) ) { - $thumb_url = ''; - } - $this->metadata['thumbnailUrl'] = $thumb_url; - } - - /** - * Populates the `image` field in the metadata object. - * - * @since 3.4.0 - */ - private function build_image(): void { - $image_url = get_the_post_thumbnail_url( $this->post, 'full' ); - if ( ! is_string( $image_url ) ) { - $image_url = ''; - } - $this->metadata['image'] = array( - '@type' => 'ImageObject', - 'url' => $image_url, - ); - } - - /** - * Populates the `articleSection` field in the metadata object. - * - * @since 3.4.0 - */ - private function build_article_section(): void { - $this->metadata['articleSection'] = $this->get_category_name( $this->post, $this->parsely->get_options() ); - } - - /** - * Populates the `author` and `creator` fields in the metadata object. - * - * @since 3.4.0 - */ - private function build_author(): void { - $authors = $this->get_author_names( $this->post ); - $author_objects = array(); - foreach ( $authors as $author ) { - $author_tag = array( - '@type' => 'Person', - 'name' => $author, - ); - $author_objects[] = $author_tag; - } - $this->metadata['author'] = $author_objects; - $this->metadata['creator'] = $authors; - } - - /** - * Populates the `publisher` field in the metadata object. + * Populates the publisher field in the metadata object. * * @since 3.4.0 */ @@ -202,395 +140,4 @@ private function build_publisher(): void { 'logo' => $this->parsely->get_options()['logo'], ); } - - /** - * Populates the `keywords` field in the metadata object. - * - * @since 3.4.0 - */ - private function build_keywords(): void { - $options = $this->parsely->get_options(); - $tags = $this->get_tags( $this->post->ID ); - if ( $options['cats_as_tags'] ) { - $tags = array_merge( $tags, $this->get_categories( $this->post->ID ) ); - // add custom taxonomy values. - $tags = array_merge( $tags, $this->get_custom_taxonomy_values( $this->post ) ); - } - // The function 'mb_strtolower' is not enabled by default in php, so this check - // falls back to the native php function 'strtolower' if necessary. - if ( function_exists( 'mb_strtolower' ) ) { - $lowercase_callback = 'mb_strtolower'; - } else { - $lowercase_callback = 'strtolower'; - } - if ( $options['lowercase_tags'] ) { - $tags = array_map( $lowercase_callback, $tags ); - } - - /** - * Filters the post tags that are used as metadata keywords. - * - * @since 1.8.0 - * - * @param array $tags Post tags. - * @param int $ID Post ID. - */ - $tags = apply_filters( 'wp_parsely_post_tags', $tags, $this->post->ID ); - $tags = array_map( array( $this, 'clean_value' ), $tags ); - - $this->metadata['keywords'] = array_values( array_unique( $tags ) ); - } - - /** - * Sets all metadata values related to post time. - * - * @since 3.0.2 - * @since 3.3.0 Moved to class-metadata. - */ - private function build_metadata_post_times(): void { - $date_format = 'Y-m-d\TH:i:s\Z'; - $post_created_gmt = get_post_time( $date_format, true, $this->post ); - - if ( false === $post_created_gmt ) { - return; - } - - $this->metadata['dateCreated'] = $post_created_gmt; - $this->metadata['datePublished'] = $post_created_gmt; - $this->metadata['dateModified'] = $post_created_gmt; - - $post_modified_gmt = get_post_modified_time( $date_format, true, $this->post ); - - if ( false !== $post_modified_gmt && $post_modified_gmt > $post_created_gmt ) { - $this->metadata['dateModified'] = $post_modified_gmt; - } - } - - /** - * Returns a properly cleaned category/taxonomy value and will optionally - * use the top-level category/taxonomy value, if so instructed via the - * `use_top_level_cats` option. - * - * @since 3.3.0 Moved to class-metadata. - * - * @param WP_Post $post_obj The object for the post. - * @param Parsely_Options $parsely_options The parsely options. - * @return string Cleaned category name for the post in question. - */ - private function get_category_name( WP_Post $post_obj, $parsely_options ): string { - $taxonomy_dropdown_choice = get_the_terms( $post_obj->ID, $parsely_options['custom_taxonomy_section'] ); - // Get top-level taxonomy name for chosen taxonomy and assign to $parent_name; it will be used - // as the category value if 'use_top_level_cats' option is checked. - // Assign as the default category name if no value is checked for the chosen taxonomy. - $category_name = get_cat_name( get_default_category() ); - if ( false !== $taxonomy_dropdown_choice && ! is_wp_error( $taxonomy_dropdown_choice ) ) { - if ( $parsely_options['use_top_level_cats'] ) { - $first_term = array_shift( $taxonomy_dropdown_choice ); - if ( null !== $first_term ) { - $term_name = $this->get_top_level_term( $first_term->term_id, $first_term->taxonomy ); - } - } else { - $term_name = $this->get_bottom_level_term( $post_obj->ID, $parsely_options['custom_taxonomy_section'] ); - } - - if ( isset( $term_name ) && is_string( $term_name ) && 0 < strlen( $term_name ) ) { - $category_name = $term_name; - } - } - - /** - * Filters the constructed category name. - * - * @since 1.8.0 - * - * @param string $category Category name. - * @param WP_Post $post_obj Post object. - * @param array $parsely_options The Parsely options. - */ - $category_name = apply_filters( 'wp_parsely_post_category', $category_name, $post_obj, $parsely_options ); - - return $this->clean_value( $category_name ); - } - - /** - * Returns the top-most category/taxonomy value in a hierarchy given a - * taxonomy value's ID. - * - * (WordPress calls taxonomy values 'terms'). - * - * @since 3.3.0 Moved to class-metadata. - * - * @param int $term_id The ID of the top level term. - * @param string $taxonomy_name The name of the taxonomy. - * @return string|false $parent The top level name of the category / taxonomy. - */ - private function get_top_level_term( int $term_id, string $taxonomy_name ) { - $parent = get_term_by( 'id', $term_id, $taxonomy_name ); - - while ( false !== $parent && isset( $parent->parent ) && 0 !== $parent->parent ) { - $parent = get_term_by( 'id', $parent->parent, $taxonomy_name ); - } - - return $parent->name ?? false; - } - - /** - * Returns the bottom-most category/taxonomy value in a hierarchy given a - * post ID. - * - * (WordPress calls taxonomy values 'terms'). - * - * @since 3.3.0 Moved to class-metadata. - * - * @param int $post_id The post id you're interested in. - * @param string $taxonomy_name The name of the taxonomy. - * @return string Name of the custom taxonomy. - */ - private function get_bottom_level_term( int $post_id, string $taxonomy_name ): string { - $terms = get_the_terms( $post_id, $taxonomy_name ); - - if ( ! is_array( $terms ) ) { - return ''; - } - - $term_ids = wp_list_pluck( $terms, 'term_id' ); - $parents = array_filter( wp_list_pluck( $terms, 'parent' ) ); - - // Get array of IDs of terms which are not parents. - $term_ids_not_parents = array_diff( $term_ids, $parents ); - // Get corresponding term objects, which are mapped to array index keys. - $terms_not_parents = array_intersect_key( $terms, $term_ids_not_parents ); - // remove array index keys. - $terms_not_parents_cleaned = array_values( $terms_not_parents ); - - if ( isset( $terms_not_parents_cleaned[0] ) ) { - // If you assign multiple child terms in a custom taxonomy, will only return the first. - return $terms_not_parents_cleaned[0]->name; - } - - return ''; - } - - /** - * Retrieves all the authors for a post as an array. Can include multiple - * authors if the Co-Authors Plus plugin is in use. - * - * @since 3.3.0 Moved to class-metadata. - * - * @param WP_Post $post The post object. - * @return array - */ - public function get_author_names( WP_Post $post ): array { - $authors = $this->get_coauthor_names( $post->ID ); - if ( 0 === count( $authors ) ) { - $post_author = get_user_by( 'id', $post->post_author ); - if ( false !== $post_author ) { - $authors = array( $post_author ); - } - } - - /** - * Filters the list of author WP_User objects for a post. - * - * @since 1.14.0 - * - * @param array $authors One or more authors as WP_User objects. - * @param WP_Post $post Post object. - */ - $authors = apply_filters( 'wp_parsely_pre_authors', $authors, $post ); - - // Getting the author name for each author. - $authors = array_map( array( $this, 'get_author_name' ), $authors ); - - /** - * Filters the list of author names for a post. - * - * @since 1.14.0 - * - * @param array $authors One or more author names. - * @param WP_Post $post Post object. - */ - $authors = apply_filters( 'wp_parsely_post_authors', $authors, $post ); - - return array_map( array( $this, 'clean_value' ), $authors ); - } - - /** - * Returns a list of coauthors for a post assuming the Co-Authors Plus plugin - * is installed. - * - * Borrowed from - * https://github.com/Automattic/Co-Authors-Plus/blob/master/template-tags.php#L3-35 - * - * @since 3.3.0 Moved to class-metadata. - * - * @param int $post_id The ID of the post. - * @return array List of coauthors, or an empty array if the Co-Authors Plus plugin is not active. - */ - private function get_coauthor_names( int $post_id ): array { - $coauthors = array(); - if ( class_exists( 'coauthors_plus' ) ) { - global $post, $post_ID, $coauthors_plus; - - if ( $post_id <= 0 && $post_ID ) { - $post_id = $post_ID; - } - - if ( ! $post_id && $post ) { - $post_id = $post->ID; - } - - if ( $post_id ) { - $coauthor_terms = get_the_terms( $post_id, $coauthors_plus->coauthor_taxonomy ); - - if ( is_array( $coauthor_terms ) ) { - foreach ( $coauthor_terms as $coauthor ) { - $coauthor_slug = preg_replace( '#^cap-#', '', $coauthor->slug ); - $post_author = $coauthors_plus->get_coauthor_by( 'user_nicename', $coauthor_slug ); - // In case the user has been deleted while plugin was deactivated. - if ( false !== $post_author ) { - $coauthors[] = new WP_User( $post_author ); - } - } - } elseif ( ! $coauthors_plus->force_guest_authors ) { - if ( $post && $post_id === $post->ID ) { - $post_author = get_userdata( $post->post_author ); - } - if ( isset( $post_author ) && false !== $post_author ) { - $coauthors[] = $post_author; - } - } - // The empty else case is because if we force guest authors, we don't ever care what value wp_posts.post_author has. - } - } - return $coauthors; - } - - /** - * Determines author name from display name, falling back to firstname - * lastname, then nickname and finally the nicename. - * - * @since 3.3.0 Moved to class-metadata. - * - * @param ?WP_User $author The author of the post. - * @return string An author name. - */ - private function get_author_name( ?WP_User $author ): string { - // Gracefully handle situation where no author is available. - if ( null === $author ) { - return ''; - } - - if ( '' !== $author->display_name ) { - return $author->display_name; - } - - $author_name = $author->user_firstname . ' ' . $author->user_lastname; - if ( ' ' !== $author_name ) { - return $author_name; - } - - if ( '' !== $author->nickname ) { - return $author->nickname; - } - - if ( '' !== $author->user_nicename ) { - return $author->user_nicename; - } - - return ''; - } - - /** - * Returns the tags associated with this page or post. - * - * @since 3.3.0 Moved to class-metadata. - * - * @param int $post_id The ID of the post you're trying to get tags for. - * @return array The tags of the post represented by the post id. - */ - private function get_tags( int $post_id ): array { - /** - * Variable. - * - * @var array<\WP_Term|null>|\WP_Error - */ - $post_tags = wp_get_post_tags( $post_id ); - $tags = array(); - - if ( ! is_wp_error( $post_tags ) ) { - foreach ( $post_tags as $wp_tag ) { - if ( null !== $wp_tag ) { - $tags[] = $wp_tag->name; - } - } - } - - return $tags; - } - - /** - * Returns an array of all the child categories for the current post. - * - * @since 3.3.0 Moved to class-metadata. - * - * @param int $post_id The ID of the post you're trying to get categories for. - * @param string $delimiter What character will delimit the categories. - * @return array All the child categories of the current post. - */ - private function get_categories( int $post_id, string $delimiter = '/' ): array { - $tags = array(); - foreach ( get_the_category( $post_id ) as $category ) { - $hierarchy = get_category_parents( $category->term_id, false, $delimiter ); - if ( ! is_wp_error( $hierarchy ) ) { - $tags[] = rtrim( $hierarchy, '/' ); - } - } - // Take last element in the hierarchy, a string representing the full parent->child tree, - // and split it into individual category names. - $last_tag = end( $tags ); - if ( false !== $last_tag ) { - $tags = explode( '/', $last_tag ); - } - - // Remove default category name from tags if needed. - $default_category_name = get_cat_name( get_default_category() ); - return array_diff( $tags, array( $default_category_name ) ); - } - - /** - * Gets all term names from all custom taxonomies assigned to a post. - * - * @since 3.3.0 Moved to class-metadata. - * @since 3.4.0 Moved to class-post-builder. - * - * @param WP_Post $post_obj The post object to find the terms for. - * @return array Term names. - */ - private function get_custom_taxonomy_values( WP_Post $post_obj ): array { - // Filter out default WordPress taxonomies. - $all_taxonomies = array_diff( get_taxonomies(), array( 'post_tag', 'nav_menu', 'author', 'link_category', 'post_format' ) ); - - /** - * Filters the taxonomies. - * - * @since 3.11.0 - * - * @param array $all_taxonomies Taxonomies. - * @param WP_Post $post_obj Post object. - */ - $all_taxonomies = apply_filters( 'wp_parsely_custom_taxonomies', $all_taxonomies, $post_obj ); - $all_values = array(); - - foreach ( $all_taxonomies as $taxonomy ) { - $custom_taxonomy_objects = get_the_terms( $post_obj->ID, $taxonomy ); - if ( is_array( $custom_taxonomy_objects ) ) { - foreach ( $custom_taxonomy_objects as $custom_taxonomy_object ) { - $all_values[] = $custom_taxonomy_object->name; - } - } - } - - return $all_values; - } } From 9270f242e47c83f7c69a875327bac76fac86e8e9 Mon Sep 17 00:00:00 2001 From: Alex Cicovic <23142906+acicovic@users.noreply.github.com> Date: Fri, 16 Feb 2024 09:54:35 +0200 Subject: [PATCH 033/110] Update and add more integration tests --- .../Integration/Metadata/NonPostTestCase.php | 10 +- tests/Integration/Metadata/SinglePageTest.php | 480 +++++++++++++++++- 2 files changed, 475 insertions(+), 15 deletions(-) diff --git a/tests/Integration/Metadata/NonPostTestCase.php b/tests/Integration/Metadata/NonPostTestCase.php index 5ff79640e..44d087016 100644 --- a/tests/Integration/Metadata/NonPostTestCase.php +++ b/tests/Integration/Metadata/NonPostTestCase.php @@ -34,8 +34,12 @@ public function assert_data_has_required_properties( array $structured_data ): v array_walk( $required_properties, - static function ( $property ) use ( $structured_data ) { - self::assertArrayHasKey( $property, $structured_data, 'Data does not have required property: ' . $property ); + static function ( string $property ) use ( $structured_data ) { + self::assertArrayHasKey( + $property, + $structured_data, + 'Data does not have required property: ' . $property + ); } ); } @@ -45,7 +49,7 @@ static function ( $property ) use ( $structured_data ) { * * @return array */ - private function get_required_properties(): array { + protected function get_required_properties(): array { return array( '@context', '@type', diff --git a/tests/Integration/Metadata/SinglePageTest.php b/tests/Integration/Metadata/SinglePageTest.php index 01290aacc..7afc84600 100644 --- a/tests/Integration/Metadata/SinglePageTest.php +++ b/tests/Integration/Metadata/SinglePageTest.php @@ -20,14 +20,24 @@ * @covers \Parsely\Metadata::construct_metadata */ final class SinglePageTest extends NonPostTestCase { - /** * Verifies that the metadata generated for Single Page pages is as - * expected. + * expected. No author, category, or tag is set. + * + * @since 3.14.0 * - * @covers \Parsely\Metadata::__construct - * @covers \Parsely\Metadata::construct_metadata + * @covers \Parsely\Metadata\Metadata_Builder::build_article_section + * @covers \Parsely\Metadata\Metadata_Builder::build_author + * @covers \Parsely\Metadata\Metadata_Builder::build_image + * @covers \Parsely\Metadata\Metadata_Builder::build_keywords + * @covers \Parsely\Metadata\Metadata_Builder::build_metadata_post_times + * @covers \Parsely\Metadata\Metadata_Builder::build_thumbnail_url + * @covers \Parsely\Metadata\Metadata_Builder::get_author_names + * @covers \Parsely\Metadata\Metadata_Builder::get_category_name + * @covers \Parsely\Metadata\Metadata_Builder::get_coauthor_names * @covers \Parsely\Metadata\Metadata_Builder::get_current_url + * @covers \Parsely\Metadata\Metadata_Builder::get_tags + * @uses \Parsely\Metadata::__construct * @uses \Parsely\Metadata\Metadata_Builder::__construct * @uses \Parsely\Metadata\Metadata_Builder::build_basic * @uses \Parsely\Metadata\Metadata_Builder::clean_value @@ -35,25 +45,404 @@ final class SinglePageTest extends NonPostTestCase { * @uses \Parsely\Metadata\Page_Builder::build_headline * @uses \Parsely\Metadata\Page_Builder::build_url * @uses \Parsely\Metadata\Page_Builder::get_metadata + * @uses \Parsely\Parsely::__construct + * @uses \Parsely\Parsely::allow_parsely_remote_requests + * @uses \Parsely\Parsely::are_credentials_managed + * @uses \Parsely\Parsely::get_managed_credentials * @uses \Parsely\Parsely::get_options * @uses \Parsely\Parsely::post_has_trackable_status + * @uses \Parsely\Parsely::set_managed_options * @uses \Parsely\Parsely::update_metadata_endpoint + * @uses \Parsely\Utils\get_default_category * @group metadata */ public function test_single_page(): void { + $this->run_single_page_test( false, false, false ); + } + + /** + * Verifies that the metadata generated for Single Page pages is as + * expected. An author is set. + * + * @since 3.14.0 + * + * @covers \Parsely\Metadata\Metadata_Builder::build_article_section + * @covers \Parsely\Metadata\Metadata_Builder::build_author + * @covers \Parsely\Metadata\Metadata_Builder::build_image + * @covers \Parsely\Metadata\Metadata_Builder::build_keywords + * @covers \Parsely\Metadata\Metadata_Builder::build_metadata_post_times + * @covers \Parsely\Metadata\Metadata_Builder::build_thumbnail_url + * @covers \Parsely\Metadata\Metadata_Builder::get_author_names + * @covers \Parsely\Metadata\Metadata_Builder::get_category_name + * @covers \Parsely\Metadata\Metadata_Builder::get_coauthor_names + * @covers \Parsely\Metadata\Metadata_Builder::get_current_url + * @covers \Parsely\Metadata\Metadata_Builder::get_tags + * @uses \Parsely\Metadata::__construct + * @uses \Parsely\Metadata\Metadata_Builder::__construct + * @uses \Parsely\Metadata\Metadata_Builder::build_basic + * @uses \Parsely\Metadata\Metadata_Builder::clean_value + * @uses \Parsely\Metadata\Page_Builder::__construct + * @uses \Parsely\Metadata\Page_Builder::build_headline + * @uses \Parsely\Metadata\Page_Builder::build_url + * @uses \Parsely\Metadata\Page_Builder::get_metadata + * @uses \Parsely\Parsely::__construct + * @uses \Parsely\Parsely::allow_parsely_remote_requests + * @uses \Parsely\Parsely::are_credentials_managed + * @uses \Parsely\Parsely::get_managed_credentials + * @uses \Parsely\Parsely::get_options + * @uses \Parsely\Parsely::post_has_trackable_status + * @uses \Parsely\Parsely::set_managed_options + * @uses \Parsely\Parsely::update_metadata_endpoint + * @uses \Parsely\Utils\get_default_category + * @group metadata + */ + public function test_single_page_with_author(): void { + $this->run_single_page_test( true, false, false ); + } + + /** + * Verifies that the metadata generated for Single Page pages is as + * expected. A category is set. + * + * @since 3.14.0 + * + * @covers \Parsely\Metadata\Metadata_Builder::build_article_section + * @covers \Parsely\Metadata\Metadata_Builder::build_author + * @covers \Parsely\Metadata\Metadata_Builder::build_image + * @covers \Parsely\Metadata\Metadata_Builder::build_keywords + * @covers \Parsely\Metadata\Metadata_Builder::build_metadata_post_times + * @covers \Parsely\Metadata\Metadata_Builder::build_thumbnail_url + * @covers \Parsely\Metadata\Metadata_Builder::get_author_names + * @covers \Parsely\Metadata\Metadata_Builder::get_category_name + * @covers \Parsely\Metadata\Metadata_Builder::get_coauthor_names + * @covers \Parsely\Metadata\Metadata_Builder::get_current_url + * @covers \Parsely\Metadata\Metadata_Builder::get_tags + * @uses \Parsely\Metadata::__construct + * @uses \Parsely\Metadata\Metadata_Builder::__construct + * @uses \Parsely\Metadata\Metadata_Builder::build_basic + * @uses \Parsely\Metadata\Metadata_Builder::clean_value + * @uses \Parsely\Metadata\Page_Builder::__construct + * @uses \Parsely\Metadata\Page_Builder::build_headline + * @uses \Parsely\Metadata\Page_Builder::build_url + * @uses \Parsely\Metadata\Page_Builder::get_metadata + * @uses \Parsely\Parsely::__construct + * @uses \Parsely\Parsely::allow_parsely_remote_requests + * @uses \Parsely\Parsely::are_credentials_managed + * @uses \Parsely\Parsely::get_managed_credentials + * @uses \Parsely\Parsely::get_options + * @uses \Parsely\Parsely::post_has_trackable_status + * @uses \Parsely\Parsely::set_managed_options + * @uses \Parsely\Parsely::update_metadata_endpoint + * @uses \Parsely\Utils\get_default_category + * @group metadata + */ + public function test_single_page_with_category(): void { + $this->run_single_page_test( false, true, false ); + } + + /** + * Verifies that the metadata generated for Single Page pages is as + * expected. A tag is set. + * + * @since 3.14.0 + * + * @covers \Parsely\Metadata\Metadata_Builder::build_article_section + * @covers \Parsely\Metadata\Metadata_Builder::build_author + * @covers \Parsely\Metadata\Metadata_Builder::build_image + * @covers \Parsely\Metadata\Metadata_Builder::build_keywords + * @covers \Parsely\Metadata\Metadata_Builder::build_metadata_post_times + * @covers \Parsely\Metadata\Metadata_Builder::build_thumbnail_url + * @covers \Parsely\Metadata\Metadata_Builder::get_author_names + * @covers \Parsely\Metadata\Metadata_Builder::get_category_name + * @covers \Parsely\Metadata\Metadata_Builder::get_coauthor_names + * @covers \Parsely\Metadata\Metadata_Builder::get_current_url + * @covers \Parsely\Metadata\Metadata_Builder::get_tags + * @uses \Parsely\Metadata::__construct + * @uses \Parsely\Metadata\Metadata_Builder::__construct + * @uses \Parsely\Metadata\Metadata_Builder::build_basic + * @uses \Parsely\Metadata\Metadata_Builder::clean_value + * @uses \Parsely\Metadata\Page_Builder::__construct + * @uses \Parsely\Metadata\Page_Builder::build_headline + * @uses \Parsely\Metadata\Page_Builder::build_url + * @uses \Parsely\Metadata\Page_Builder::get_metadata + * @uses \Parsely\Parsely::__construct + * @uses \Parsely\Parsely::allow_parsely_remote_requests + * @uses \Parsely\Parsely::are_credentials_managed + * @uses \Parsely\Parsely::get_managed_credentials + * @uses \Parsely\Parsely::get_options + * @uses \Parsely\Parsely::post_has_trackable_status + * @uses \Parsely\Parsely::set_managed_options + * @uses \Parsely\Parsely::update_metadata_endpoint + * @uses \Parsely\Utils\get_default_category + * @group metadata + */ + public function test_single_page_with_tag(): void { + $this->run_single_page_test( false, false, true ); + } + + /** + * Verifies that the metadata generated for Single Page pages is as + * expected. A tag is set and the lowercase_tags option is off. + * + * @since 3.14.0 + * + * @covers \Parsely\Metadata\Metadata_Builder::build_article_section + * @covers \Parsely\Metadata\Metadata_Builder::build_author + * @covers \Parsely\Metadata\Metadata_Builder::build_image + * @covers \Parsely\Metadata\Metadata_Builder::build_keywords + * @covers \Parsely\Metadata\Metadata_Builder::build_metadata_post_times + * @covers \Parsely\Metadata\Metadata_Builder::build_thumbnail_url + * @covers \Parsely\Metadata\Metadata_Builder::get_author_names + * @covers \Parsely\Metadata\Metadata_Builder::get_category_name + * @covers \Parsely\Metadata\Metadata_Builder::get_coauthor_names + * @covers \Parsely\Metadata\Metadata_Builder::get_current_url + * @covers \Parsely\Metadata\Metadata_Builder::get_tags + * @uses \Parsely\Metadata::__construct + * @uses \Parsely\Metadata\Metadata_Builder::__construct + * @uses \Parsely\Metadata\Metadata_Builder::build_basic + * @uses \Parsely\Metadata\Metadata_Builder::clean_value + * @uses \Parsely\Metadata\Page_Builder::__construct + * @uses \Parsely\Metadata\Page_Builder::build_headline + * @uses \Parsely\Metadata\Page_Builder::build_url + * @uses \Parsely\Metadata\Page_Builder::get_metadata + * @uses \Parsely\Parsely::__construct + * @uses \Parsely\Parsely::allow_parsely_remote_requests + * @uses \Parsely\Parsely::are_credentials_managed + * @uses \Parsely\Parsely::get_managed_credentials + * @uses \Parsely\Parsely::get_options + * @uses \Parsely\Parsely::post_has_trackable_status + * @uses \Parsely\Parsely::set_managed_options + * @uses \Parsely\Parsely::update_metadata_endpoint + * @uses \Parsely\Utils\get_default_category + * @group metadata + */ + public function test_single_page_with_tag_lowercase_off(): void { + $this->run_single_page_test( false, false, true, false ); + } + + /** + * Verifies that the metadata generated for Single Page pages is as + * expected. An author and a category are set. + * + * @since 3.14.0 + * + * @covers \Parsely\Metadata\Metadata_Builder::build_article_section + * @covers \Parsely\Metadata\Metadata_Builder::build_author + * @covers \Parsely\Metadata\Metadata_Builder::build_image + * @covers \Parsely\Metadata\Metadata_Builder::build_keywords + * @covers \Parsely\Metadata\Metadata_Builder::build_metadata_post_times + * @covers \Parsely\Metadata\Metadata_Builder::build_thumbnail_url + * @covers \Parsely\Metadata\Metadata_Builder::get_author_names + * @covers \Parsely\Metadata\Metadata_Builder::get_category_name + * @covers \Parsely\Metadata\Metadata_Builder::get_coauthor_names + * @covers \Parsely\Metadata\Metadata_Builder::get_current_url + * @covers \Parsely\Metadata\Metadata_Builder::get_tags + * @uses \Parsely\Metadata::__construct + * @uses \Parsely\Metadata\Metadata_Builder::__construct + * @uses \Parsely\Metadata\Metadata_Builder::build_basic + * @uses \Parsely\Metadata\Metadata_Builder::clean_value + * @uses \Parsely\Metadata\Page_Builder::__construct + * @uses \Parsely\Metadata\Page_Builder::build_headline + * @uses \Parsely\Metadata\Page_Builder::build_url + * @uses \Parsely\Metadata\Page_Builder::get_metadata + * @uses \Parsely\Parsely::__construct + * @uses \Parsely\Parsely::allow_parsely_remote_requests + * @uses \Parsely\Parsely::are_credentials_managed + * @uses \Parsely\Parsely::get_managed_credentials + * @uses \Parsely\Parsely::get_options + * @uses \Parsely\Parsely::post_has_trackable_status + * @uses \Parsely\Parsely::set_managed_options + * @uses \Parsely\Parsely::update_metadata_endpoint + * @uses \Parsely\Utils\get_default_category + * @group metadata + */ + public function test_single_page_with_author_and_category(): void { + $this->run_single_page_test( true, true, false ); + } + + /** + * Verifies that the metadata generated for Single Page pages is as + * expected. An author and a tag are set. + * + * @since 3.14.0 + * + * @covers \Parsely\Metadata\Metadata_Builder::build_article_section + * @covers \Parsely\Metadata\Metadata_Builder::build_author + * @covers \Parsely\Metadata\Metadata_Builder::build_image + * @covers \Parsely\Metadata\Metadata_Builder::build_keywords + * @covers \Parsely\Metadata\Metadata_Builder::build_metadata_post_times + * @covers \Parsely\Metadata\Metadata_Builder::build_thumbnail_url + * @covers \Parsely\Metadata\Metadata_Builder::get_author_names + * @covers \Parsely\Metadata\Metadata_Builder::get_category_name + * @covers \Parsely\Metadata\Metadata_Builder::get_coauthor_names + * @covers \Parsely\Metadata\Metadata_Builder::get_current_url + * @covers \Parsely\Metadata\Metadata_Builder::get_tags + * @uses \Parsely\Metadata::__construct + * @uses \Parsely\Metadata\Metadata_Builder::__construct + * @uses \Parsely\Metadata\Metadata_Builder::build_basic + * @uses \Parsely\Metadata\Metadata_Builder::clean_value + * @uses \Parsely\Metadata\Page_Builder::__construct + * @uses \Parsely\Metadata\Page_Builder::build_headline + * @uses \Parsely\Metadata\Page_Builder::build_url + * @uses \Parsely\Metadata\Page_Builder::get_metadata + * @uses \Parsely\Parsely::__construct + * @uses \Parsely\Parsely::allow_parsely_remote_requests + * @uses \Parsely\Parsely::are_credentials_managed + * @uses \Parsely\Parsely::get_managed_credentials + * @uses \Parsely\Parsely::get_options + * @uses \Parsely\Parsely::post_has_trackable_status + * @uses \Parsely\Parsely::set_managed_options + * @uses \Parsely\Parsely::update_metadata_endpoint + * @uses \Parsely\Utils\get_default_category + * @group metadata + */ + public function test_single_page_with_author_and_tag(): void { + $this->run_single_page_test( true, false, true ); + } + + /** + * Verifies that the metadata generated for Single Page pages is as + * expected. A category and a tag are set. + * + * @since 3.14.0 + * + * @covers \Parsely\Metadata\Metadata_Builder::build_article_section + * @covers \Parsely\Metadata\Metadata_Builder::build_author + * @covers \Parsely\Metadata\Metadata_Builder::build_image + * @covers \Parsely\Metadata\Metadata_Builder::build_keywords + * @covers \Parsely\Metadata\Metadata_Builder::build_metadata_post_times + * @covers \Parsely\Metadata\Metadata_Builder::build_thumbnail_url + * @covers \Parsely\Metadata\Metadata_Builder::get_author_names + * @covers \Parsely\Metadata\Metadata_Builder::get_category_name + * @covers \Parsely\Metadata\Metadata_Builder::get_coauthor_names + * @covers \Parsely\Metadata\Metadata_Builder::get_current_url + * @covers \Parsely\Metadata\Metadata_Builder::get_tags + * @uses \Parsely\Metadata::__construct + * @uses \Parsely\Metadata\Metadata_Builder::__construct + * @uses \Parsely\Metadata\Metadata_Builder::build_basic + * @uses \Parsely\Metadata\Metadata_Builder::clean_value + * @uses \Parsely\Metadata\Page_Builder::__construct + * @uses \Parsely\Metadata\Page_Builder::build_headline + * @uses \Parsely\Metadata\Page_Builder::build_url + * @uses \Parsely\Metadata\Page_Builder::get_metadata + * @uses \Parsely\Parsely::__construct + * @uses \Parsely\Parsely::allow_parsely_remote_requests + * @uses \Parsely\Parsely::are_credentials_managed + * @uses \Parsely\Parsely::get_managed_credentials + * @uses \Parsely\Parsely::get_options + * @uses \Parsely\Parsely::post_has_trackable_status + * @uses \Parsely\Parsely::set_managed_options + * @uses \Parsely\Parsely::update_metadata_endpoint + * @uses \Parsely\Utils\get_default_category + * @group metadata + */ + public function test_single_page_with_category_and_tag(): void { + $this->run_single_page_test( false, true, true ); + } + + /** + * Verifies that the metadata generated for Single Page pages is as + * expected. An author, a category, and a tag are set. + * + * @since 3.14.0 + * + * @covers \Parsely\Metadata\Metadata_Builder::build_article_section + * @covers \Parsely\Metadata\Metadata_Builder::build_author + * @covers \Parsely\Metadata\Metadata_Builder::build_image + * @covers \Parsely\Metadata\Metadata_Builder::build_keywords + * @covers \Parsely\Metadata\Metadata_Builder::build_metadata_post_times + * @covers \Parsely\Metadata\Metadata_Builder::build_thumbnail_url + * @covers \Parsely\Metadata\Metadata_Builder::get_author_names + * @covers \Parsely\Metadata\Metadata_Builder::get_category_name + * @covers \Parsely\Metadata\Metadata_Builder::get_coauthor_names + * @covers \Parsely\Metadata\Metadata_Builder::get_current_url + * @covers \Parsely\Metadata\Metadata_Builder::get_tags + * @uses \Parsely\Metadata::__construct + * @uses \Parsely\Metadata\Metadata_Builder::__construct + * @uses \Parsely\Metadata\Metadata_Builder::build_basic + * @uses \Parsely\Metadata\Metadata_Builder::clean_value + * @uses \Parsely\Metadata\Page_Builder::__construct + * @uses \Parsely\Metadata\Page_Builder::build_headline + * @uses \Parsely\Metadata\Page_Builder::build_url + * @uses \Parsely\Metadata\Page_Builder::get_metadata + * @uses \Parsely\Parsely::__construct + * @uses \Parsely\Parsely::allow_parsely_remote_requests + * @uses \Parsely\Parsely::are_credentials_managed + * @uses \Parsely\Parsely::get_managed_credentials + * @uses \Parsely\Parsely::get_options + * @uses \Parsely\Parsely::post_has_trackable_status + * @uses \Parsely\Parsely::set_managed_options + * @uses \Parsely\Parsely::update_metadata_endpoint + * @uses \Parsely\Utils\get_default_category + * @group metadata + */ + public function test_single_page_with_author_and_category_and_tag(): void { + $this->run_single_page_test( true, true, true ); + } + + /** + * Runs the single page test with the desired parameters. + * + * @since 3.14.0 Renamed from test_single_page. + * + * @param bool $with_author Whether to test with an author. + * @param bool $with_category Whether to test with a category. + * @param bool $with_tag Whether to test with a tag. + * @param bool $lowercase_tags The value of the `lowercase_tags` option. + */ + private function run_single_page_test( + bool $with_author, + bool $with_category, + bool $with_tag, + bool $lowercase_tags = true + ): void { // Setup Parsely object. $parsely = new Parsely(); + $page_data = array( + 'post_type' => 'page', + 'post_title' => 'Single Page', + 'post_name' => 'foo', + 'post_date' => '2024-01-01 12:00:00', + ); + + if ( $with_author ) { + $page_data['post_author'] = 1; + } + // Insert a single page. /** @var int $page_id */ - $page_id = self::factory()->post->create( - array( - 'post_type' => 'page', - 'post_title' => 'Single Page', - 'post_name' => 'foo', - ) - ); - $page = $this->get_post( $page_id ); + $page_id = self::factory()->post->create( $page_data ); + + if ( $with_category ) { + // Create a category and assign it to the page. + /** @var int $category_id */ + $category_id = self::factory()->category->create( + array( + 'name' => 'Category 1', + 'slug' => 'category-1', + ) + ); + wp_set_post_categories( $page_id, array( $category_id ) ); + } + + if ( $with_tag ) { + // Set the `lowercase_tags` option as needed. + $parsely_options = $parsely->get_options(); + $parsely_options['lowercase_tags'] = $lowercase_tags; + update_option( 'parsely', $parsely_options ); + + // Create a tag and assign it to the page. + $tag_id = self::factory()->tag->create( + array( + 'name' => 'Tag 1', + 'slug' => 'tag-1', + ) + ); + wp_set_post_tags( $page_id, array( $tag_id ) ); + } + + $page = $this->get_post( $page_id ); // Set permalinks, as Parsely currently strips ?page_id=... from the URL // property. See https://github.com/Parsely/wp-parsely/issues/151. @@ -74,9 +463,76 @@ public function test_single_page(): void { // The headline should be the post_title of the page. self::assertSame( 'Single Page', $structured_data['headline'] ?? null ); self::assertSame( get_permalink( $page_id ), $structured_data['url'] ?? null ); + self::assertSame( '2024-01-01T12:00:00Z', $structured_data['dateCreated'] ); + self::assertSame( '2024-01-01T12:00:00Z', $structured_data['datePublished'] ); + self::assertSame( '2024-01-01T12:00:00Z', $structured_data['dateModified'] ); + self::assertSame( '', $structured_data['thumbnailUrl'] ); + self::assertSame( + array( + '@type' => 'ImageObject', + 'url' => '', + ), + $structured_data['image'] + ); self::assertQueryTrue( 'is_page', 'is_singular' ); + // Test author/creator values. + if ( $with_author ) { + /** @var array> $author */ + $author = $structured_data['author']; + /** @var array $creator */ + $creator = $structured_data['creator']; + + self::assertSame( 'Person', $author[0]['@type'] ); + self::assertSame( 'admin', $author[0]['name'] ); + self::assertSame( 'admin', $creator[0] ); + } else { + self::assertSame( array(), $structured_data['author'] ); + self::assertSame( array(), $structured_data['creator'] ); + } + + // Test category value. + if ( $with_category ) { + self::assertSame( 'Category 1', $structured_data['articleSection'] ); + } else { + self::assertSame( 'Uncategorized', $structured_data['articleSection'] ); + } + + // Test tag value. + if ( $with_tag ) { + /** @var array $keywords */ + $keywords = $structured_data['keywords']; + + if ( true === $lowercase_tags ) { + self::assertSame( 'tag 1', $keywords[0] ); + } else { + self::assertSame( 'Tag 1', $keywords[0] ); + } + } else { + self::assertSame( array(), $structured_data['keywords'] ); + } + // Reset permalinks to plain. $wp_rewrite->set_permalink_structure( '' ); } + + /** + * Returns the required properties for non-posts. + * + * @since 3.14.0 + * + * @return array + */ + protected function get_required_properties(): array { + return array( + '@context', + '@type', + 'articleSection', + 'author', + 'creator', + 'headline', + 'keywords', + 'url', + ); + } } From 0c2572fe76c0223ac3f44a709bdb9a5144b036a0 Mon Sep 17 00:00:00 2001 From: Alex Cicovic <23142906+acicovic@users.noreply.github.com> Date: Fri, 16 Feb 2024 10:18:06 +0200 Subject: [PATCH 034/110] Update and add more E2E tests --- tests/e2e/specs/front-end-metadata.spec.ts | 37 ++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/tests/e2e/specs/front-end-metadata.spec.ts b/tests/e2e/specs/front-end-metadata.spec.ts index 14754b68f..71c0b65dd 100644 --- a/tests/e2e/specs/front-end-metadata.spec.ts +++ b/tests/e2e/specs/front-end-metadata.spec.ts @@ -61,7 +61,7 @@ describe( 'Front end metadata insertion', () => { expect( content ).not.toContain( ' { + it( 'Should insert JSON-LD on post', async () => { await setMetadataFormat( 'json_ld' ); await page.goto( createURL( '/', '?p=1' ) ); @@ -74,6 +74,19 @@ describe( 'Front end metadata insertion', () => { expect( content ).not.toContain( ' { + await setMetadataFormat( 'json_ld' ); + + await page.goto( createURL( '/', '?p=2' ) ); + + const content = await page.content(); + + expect( content ).toContain( '