diff --git a/.github/files/generate-ci-matrix.php b/.github/files/generate-ci-matrix.php index 4688293fb60bb..15026f8b28d93 100755 --- a/.github/files/generate-ci-matrix.php +++ b/.github/files/generate-ci-matrix.php @@ -26,6 +26,9 @@ // {string} Name for the job. Required, and must be unique. 'name' => null, + // {string} Runner name as found in https://github.com/actions/runner-images/. + 'runner' => 'ubuntu-latest', + // {string} Composer script for the job. Required. 'script' => null, @@ -68,9 +71,10 @@ ); } -// TODO: When WordPress 6.5 is no longer supported, this can be removed. +// TODO: When WordPress 6.5 is no longer supported, this can be removed. Runs too slow on ubuntu-24.04 (ubuntu-latest). $matrix[] = array( 'name' => 'PHP tests: PHP 7.0 WP previous', + 'runner' => 'ubuntu-22.04', 'script' => 'test-php', 'php' => '7.0', 'wp' => 'previous', diff --git a/.github/workflows/block-performance.yml b/.github/workflows/block-performance.yml index 33d61eeba7658..f8fe67cfe3316 100644 --- a/.github/workflows/block-performance.yml +++ b/.github/workflows/block-performance.yml @@ -36,7 +36,7 @@ jobs: npx playwright install chromium --with-deps npm run build:packages - - name: Setup tools for J + - name: Setup tools for Jetpack uses: ./.github/actions/tool-setup - name: Build Production Jetpack diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index caef4109236b8..65015806bd992 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,7 @@ jobs: run-tests: name: ${{ matrix.name }} - runs-on: ubuntu-latest + runs-on: ${{ matrix.runner }} needs: create-matrix services: database: diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 65d00d631cbc9..d20a403bb87c6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4240,9 +4240,6 @@ importers: clsx: specifier: 2.1.1 version: 2.1.1 - diff: - specifier: ^4.0.2 - version: 4.0.2 moment: specifier: 2.29.4 version: 2.29.4 @@ -4327,6 +4324,9 @@ importers: '@automattic/jetpack-publicize-components': specifier: workspace:* version: link:../../js-packages/publicize-components + '@automattic/jetpack-script-data': + specifier: workspace:* + version: link:../../js-packages/script-data '@automattic/jetpack-shared-extension-utils': specifier: workspace:* version: link:../../js-packages/shared-extension-utils @@ -4759,6 +4759,9 @@ importers: '@slack/web-api': specifier: 7.3.2 version: 7.3.2 + '@types/lodash-es': + specifier: 4.17.12 + version: 4.17.12 allure-playwright: specifier: 2.9.2 version: 2.9.2 @@ -4774,7 +4777,7 @@ importers: localtunnel: specifier: 2.0.2 version: 2.0.2 - lodash: + lodash-es: specifier: 4.17.21 version: 4.17.21 node-fetch: @@ -7374,6 +7377,9 @@ packages: '@types/linkify-it@5.0.0': resolution: {integrity: sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==} + '@types/lodash-es@4.17.12': + resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==} + '@types/lodash@4.17.10': resolution: {integrity: sha512-YpS0zzoduEhuOWjAotS6A5AVCva7X4lVlYLF0FYHAY9sdraBfnatttHItlWeZdGhuEkf+OzMNg2ZYAx8t+52uQ==} @@ -11080,6 +11086,9 @@ packages: resolution: {integrity: sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + lodash-es@4.17.21: + resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} + lodash._baseiteratee@4.7.0: resolution: {integrity: sha512-nqB9M+wITz0BX/Q2xg6fQ8mLkyfF7MU7eE+MNBNjTHFKeKaZAPEzEg+E8LWxKWf1DQVflNEn9N49yAuqKh2mWQ==} @@ -17309,6 +17318,10 @@ snapshots: '@types/linkify-it@5.0.0': {} + '@types/lodash-es@4.17.12': + dependencies: + '@types/lodash': 4.17.10 + '@types/lodash@4.17.10': {} '@types/markdown-it@14.1.2': @@ -23299,6 +23312,8 @@ snapshots: dependencies: p-locate: 6.0.0 + lodash-es@4.17.21: {} + lodash._baseiteratee@4.7.0: dependencies: lodash._stringtopath: 4.8.0 diff --git a/projects/js-packages/ai-client/CHANGELOG.md b/projects/js-packages/ai-client/CHANGELOG.md index 68b9c5d015438..99bcab06d2685 100644 --- a/projects/js-packages/ai-client/CHANGELOG.md +++ b/projects/js-packages/ai-client/CHANGELOG.md @@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.22.0] - 2024-10-21 +### Changed +- AI Client: Add types for AI assistant feature payload data branch featuresControl. [#39826] + +## [0.21.0] - 2024-10-14 +### Added +- AI Client: Add image styles 'auto' and 'none' to the logo generator. Order styles so those are on top in the dropdown selector. [#39689] +- AI Client: Add prompt processing and style guess function for logo generator [#39712] + +### Changed +- AI Client: Change plans limit to use and accept new 3000 value. [#39705] +- AI Client: Change upgrade copy edit and redirect URL. [#39671] +- AI Client: If site details show empty or default, do not trigger a logo generation, use empty placeholders. [#39536] +- AI Client: Remove provision of image styles via flag prop and internal definition, take it from ai-assistant-feature payload now. [#39589] +- Updated package dependencies. [#39669] [#39707] + ## [0.20.1] - 2024-10-07 ### Changed - Updated package dependencies. [#39594] @@ -423,6 +439,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated package dependencies. [#31659] - Updated package dependencies. [#31785] +[0.22.0]: https://github.com/Automattic/jetpack-ai-client/compare/v0.21.0...v0.22.0 +[0.21.0]: https://github.com/Automattic/jetpack-ai-client/compare/v0.20.1...v0.21.0 [0.20.1]: https://github.com/Automattic/jetpack-ai-client/compare/v0.20.0...v0.20.1 [0.20.0]: https://github.com/Automattic/jetpack-ai-client/compare/v0.19.0...v0.20.0 [0.19.0]: https://github.com/Automattic/jetpack-ai-client/compare/v0.18.1...v0.19.0 diff --git a/projects/js-packages/ai-client/changelog/add-jetpack-ai-image-styles-auto-none b/projects/js-packages/ai-client/changelog/add-jetpack-ai-image-styles-auto-none deleted file mode 100644 index 3986f9d6a5687..0000000000000 --- a/projects/js-packages/ai-client/changelog/add-jetpack-ai-image-styles-auto-none +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: added - -AI Client - Logo generator: add image styles 'auto' and 'none'. Order styles so those are on top in the dropdown selector diff --git a/projects/js-packages/ai-client/changelog/add-jetpack-ai-style-guessing b/projects/js-packages/ai-client/changelog/add-jetpack-ai-style-guessing deleted file mode 100644 index 73062f0e6af4e..0000000000000 --- a/projects/js-packages/ai-client/changelog/add-jetpack-ai-style-guessing +++ /dev/null @@ -1,4 +0,0 @@ -Significance: minor -Type: added - -AI Client: add prompt processing and style guess function for logo generator diff --git a/projects/js-packages/ai-client/changelog/change-jetpack-ai-fetch-error-retry-optional b/projects/js-packages/ai-client/changelog/change-jetpack-ai-fetch-error-retry-optional new file mode 100644 index 0000000000000..22ca3f2a46ba9 --- /dev/null +++ b/projects/js-packages/ai-client/changelog/change-jetpack-ai-fetch-error-retry-optional @@ -0,0 +1,4 @@ +Significance: minor +Type: changed + +AI Client: make reload handler prop optional as it still works in a fuzzy way. The error notice (modal) will instruct to reload the page when the optional prop is not provided diff --git a/projects/js-packages/ai-client/changelog/change-jetpack-ai-first-logo-notice b/projects/js-packages/ai-client/changelog/change-jetpack-ai-first-logo-notice deleted file mode 100644 index 8dc60ddbfdddf..0000000000000 --- a/projects/js-packages/ai-client/changelog/change-jetpack-ai-first-logo-notice +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: changed - -AI Client: change plans limit to use and accept new 3000 value diff --git a/projects/js-packages/ai-client/changelog/change-jetpack-ai-logo-first-generation-condition b/projects/js-packages/ai-client/changelog/change-jetpack-ai-logo-first-generation-condition deleted file mode 100644 index 2d9dd476dd3cc..0000000000000 --- a/projects/js-packages/ai-client/changelog/change-jetpack-ai-logo-first-generation-condition +++ /dev/null @@ -1,4 +0,0 @@ -Significance: minor -Type: changed - -AI Client: if site details show empty or default, do not trigger a logo generation, use empty placeholders diff --git a/projects/js-packages/ai-client/changelog/change-jetpack-ai-logo-generator-styles-source b/projects/js-packages/ai-client/changelog/change-jetpack-ai-logo-generator-styles-source deleted file mode 100644 index 7f35b97fbe921..0000000000000 --- a/projects/js-packages/ai-client/changelog/change-jetpack-ai-logo-generator-styles-source +++ /dev/null @@ -1,4 +0,0 @@ -Significance: minor -Type: changed - -AI Client: remove provision of image styles via flag prop and internal definition, take it from ai-assistant-feature payload now diff --git a/projects/js-packages/ai-client/changelog/change-jetpack-ai-logo-generator-upgrade-message b/projects/js-packages/ai-client/changelog/change-jetpack-ai-logo-generator-upgrade-message deleted file mode 100644 index ae2b7edeaf3c7..0000000000000 --- a/projects/js-packages/ai-client/changelog/change-jetpack-ai-logo-generator-upgrade-message +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: changed - -AI Client: change upgrade copy edit and redirect URL diff --git a/projects/js-packages/ai-client/changelog/fix-jetpack-ai-default-initial-state-setting b/projects/js-packages/ai-client/changelog/fix-jetpack-ai-default-initial-state-setting new file mode 100644 index 0000000000000..41efeee76f1f9 --- /dev/null +++ b/projects/js-packages/ai-client/changelog/fix-jetpack-ai-default-initial-state-setting @@ -0,0 +1,4 @@ +Significance: minor +Type: fixed + +AI Client: fix initial state being mapped even when fetch fails, making the default state nonsensical diff --git a/projects/js-packages/ai-client/changelog/renovate-storybook-monorepo b/projects/js-packages/ai-client/changelog/renovate-storybook-monorepo deleted file mode 100644 index c47cb18e82997..0000000000000 --- a/projects/js-packages/ai-client/changelog/renovate-storybook-monorepo +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: changed - -Updated package dependencies. diff --git a/projects/js-packages/ai-client/changelog/renovate-wordpress-monorepo b/projects/js-packages/ai-client/changelog/renovate-wordpress-monorepo deleted file mode 100644 index c47cb18e82997..0000000000000 --- a/projects/js-packages/ai-client/changelog/renovate-wordpress-monorepo +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: changed - -Updated package dependencies. diff --git a/projects/js-packages/ai-client/package.json b/projects/js-packages/ai-client/package.json index 4fb727a7728ce..a35a4e132b951 100644 --- a/projects/js-packages/ai-client/package.json +++ b/projects/js-packages/ai-client/package.json @@ -1,7 +1,7 @@ { "private": false, "name": "@automattic/jetpack-ai-client", - "version": "0.20.1", + "version": "0.22.0", "description": "A JS client for consuming Jetpack AI services", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/ai-client/#readme", "bugs": { diff --git a/projects/js-packages/ai-client/src/logo-generator/components/feature-fetch-failure-screen.tsx b/projects/js-packages/ai-client/src/logo-generator/components/feature-fetch-failure-screen.tsx index cd1f53acdf38c..3404e7c1fbb0b 100644 --- a/projects/js-packages/ai-client/src/logo-generator/components/feature-fetch-failure-screen.tsx +++ b/projects/js-packages/ai-client/src/logo-generator/components/feature-fetch-failure-screen.tsx @@ -10,25 +10,34 @@ import type React from 'react'; export const FeatureFetchFailureScreen: React.FC< { onCancel: () => void; - onRetry: () => void; + onRetry?: () => void; } > = ( { onCancel, onRetry } ) => { const errorMessage = __( 'We are sorry. There was an error loading your Jetpack AI plan data. Please, try again.', 'jetpack-ai-client' ); + const errorMessageWithoutRetry = __( + 'We are sorry. There was an error loading your Jetpack AI plan data. Please, reload the page and try again.', + 'jetpack-ai-client' + ); + return (
+ get_error_message() ); + ?> +
+