@automattic/jetpack-ai-client 0.23.0 → 0.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.24.1] - 2024-11-04
9
+ ### Added
10
+ - Enable test coverage. [#39961]
11
+
12
+ ### Fixed
13
+ - Jetpack AI: Fix for the "Generate with AI" for images text box triggering P2 keyboard shortcuts. [#39964]
14
+
15
+ ## [0.24.0] - 2024-10-29
16
+ ### Added
17
+ - AI Client: export image generator hook constants [#39917]
18
+
8
19
  ## [0.23.0] - 2024-10-28
9
20
  ### Changed
10
21
  - AI Client: Decouple prompt input as component and export it for reusability. [#39864]
@@ -447,6 +458,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
447
458
  - Updated package dependencies. [#31659]
448
459
  - Updated package dependencies. [#31785]
449
460
 
461
+ [0.24.1]: https://github.com/Automattic/jetpack-ai-client/compare/v0.24.0...v0.24.1
462
+ [0.24.0]: https://github.com/Automattic/jetpack-ai-client/compare/v0.23.0...v0.24.0
450
463
  [0.23.0]: https://github.com/Automattic/jetpack-ai-client/compare/v0.22.0...v0.23.0
451
464
  [0.22.0]: https://github.com/Automattic/jetpack-ai-client/compare/v0.21.0...v0.22.0
452
465
  [0.21.0]: https://github.com/Automattic/jetpack-ai-client/compare/v0.20.1...v0.21.0
@@ -9,6 +9,7 @@ export { default as useAudioTranscription } from './hooks/use-audio-transcriptio
9
9
  export { default as useTranscriptionPostProcessing } from './hooks/use-transcription-post-processing/index.js';
10
10
  export { default as useAudioValidation } from './hooks/use-audio-validation/index.js';
11
11
  export { default as useImageGenerator } from './hooks/use-image-generator/index.js';
12
+ export * from './hooks/use-image-generator/constants.js';
12
13
  export * from './icons/index.js';
13
14
  export * from './components/index.js';
14
15
  export * from './data-flow/index.js';
@@ -15,6 +15,7 @@ export { default as useAudioTranscription } from './hooks/use-audio-transcriptio
15
15
  export { default as useTranscriptionPostProcessing } from './hooks/use-transcription-post-processing/index.js';
16
16
  export { default as useAudioValidation } from './hooks/use-audio-validation/index.js';
17
17
  export { default as useImageGenerator } from './hooks/use-image-generator/index.js';
18
+ export * from './hooks/use-image-generator/constants.js';
18
19
  /*
19
20
  * Components: Icons
20
21
  */
@@ -46,6 +46,7 @@ export const AiModalPromptInput = ({ prompt = '', setPrompt = () => { }, disable
46
46
  event.preventDefault();
47
47
  generateHandler();
48
48
  }
49
+ event.stopPropagation();
49
50
  };
50
51
  return (_jsxs("div", { className: "jetpack-ai-logo-generator__prompt-query", children: [_jsx("div", { role: "textbox", tabIndex: 0, ref: inputRef, contentEditable: !disabled,
51
52
  // The content editable div is expected to be updated by the enhance prompt, so warnings are suppressed
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@automattic/jetpack-ai-client",
4
- "version": "0.23.0",
4
+ "version": "0.24.1",
5
5
  "description": "A JS client for consuming Jetpack AI services",
6
6
  "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/ai-client/#readme",
7
7
  "bugs": {
@@ -19,6 +19,7 @@
19
19
  "clean": "rm -rf build/",
20
20
  "compile-ts": "tsc --pretty",
21
21
  "test": "NODE_OPTIONS=--experimental-vm-modules jest",
22
+ "test-coverage": "pnpm run test --coverage",
22
23
  "watch": "tsc --watch --pretty"
23
24
  },
24
25
  "type": "module",
@@ -44,8 +45,8 @@
44
45
  "types": "./build/index.d.ts",
45
46
  "dependencies": {
46
47
  "@automattic/jetpack-base-styles": "^0.6.34",
47
- "@automattic/jetpack-connection": "^0.35.14",
48
- "@automattic/jetpack-shared-extension-utils": "^0.15.14",
48
+ "@automattic/jetpack-connection": "^0.35.15",
49
+ "@automattic/jetpack-shared-extension-utils": "^0.15.15",
49
50
  "@microsoft/fetch-event-source": "2.0.1",
50
51
  "@types/react": "18.3.3",
51
52
  "@types/wordpress__block-editor": "11.5.15",
package/src/index.ts CHANGED
@@ -16,6 +16,7 @@ export { default as useAudioTranscription } from './hooks/use-audio-transcriptio
16
16
  export { default as useTranscriptionPostProcessing } from './hooks/use-transcription-post-processing/index.js';
17
17
  export { default as useAudioValidation } from './hooks/use-audio-validation/index.js';
18
18
  export { default as useImageGenerator } from './hooks/use-image-generator/index.js';
19
+ export * from './hooks/use-image-generator/constants.js';
19
20
 
20
21
  /*
21
22
  * Components: Icons
@@ -84,6 +84,7 @@ export const AiModalPromptInput = ( {
84
84
  event.preventDefault();
85
85
  generateHandler();
86
86
  }
87
+ event.stopPropagation();
87
88
  };
88
89
 
89
90
  return (