@automattic/jetpack-ai-client 0.27.6 → 0.27.8
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 +17 -0
- package/build/api-fetch/index.d.ts +3 -1
- package/build/ask-question/index.d.ts +2 -2
- package/build/ask-question/index.js +1 -1
- package/build/ask-question/sync.d.ts +2 -2
- package/build/ask-question/sync.js +1 -1
- package/build/audio-transcription/index.js +1 -1
- package/build/chrome-ai/factory.d.ts +2 -2
- package/build/chrome-ai/factory.js +2 -2
- package/build/chrome-ai/index.d.ts +2 -2
- package/build/chrome-ai/index.js +2 -2
- package/build/chrome-ai/suggestions.d.ts +1 -1
- package/build/chrome-ai/suggestions.js +4 -4
- package/build/components/ai-control/ai-control.d.ts +6 -2
- package/build/components/ai-control/ai-control.js +1 -1
- package/build/components/ai-control/block-ai-control.d.ts +1 -1
- package/build/components/ai-control/block-ai-control.js +2 -2
- package/build/components/ai-control/extension-ai-control.d.ts +1 -1
- package/build/components/ai-control/extension-ai-control.js +2 -2
- package/build/components/ai-control/index.d.ts +3 -3
- package/build/components/ai-control/index.js +3 -3
- package/build/components/ai-image/components/ai-image-modal.d.ts +2 -3
- package/build/components/ai-image/components/ai-image-modal.js +7 -7
- package/build/components/ai-image/components/carrousel.d.ts +0 -1
- package/build/components/ai-image/components/carrousel.js +2 -2
- package/build/components/ai-image/featured-image.js +8 -8
- package/build/components/ai-image/general-purpose-image.js +7 -7
- package/build/components/ai-image/hooks/use-ai-image.d.ts +3 -3
- package/build/components/ai-image/hooks/use-ai-image.js +7 -7
- package/build/components/ai-image/index.d.ts +3 -3
- package/build/components/ai-image/index.js +3 -3
- package/build/components/ai-status-indicator/index.d.ts +1 -1
- package/build/components/audio-duration-display/index.js +1 -1
- package/build/components/index.d.ts +10 -10
- package/build/components/index.js +10 -10
- package/build/components/message/index.d.ts +1 -1
- package/build/components/message/index.js +3 -3
- package/build/components/modal/index.d.ts +1 -2
- package/build/components/modal/index.js +1 -1
- package/build/components/quota-exceeded-message/index.js +3 -3
- package/build/data-flow/context.d.ts +4 -4
- package/build/data-flow/index.d.ts +3 -3
- package/build/data-flow/index.js +3 -3
- package/build/data-flow/use-ai-context.d.ts +3 -3
- package/build/data-flow/use-ai-context.js +2 -2
- package/build/data-flow/with-ai-assistant-data.js +2 -2
- package/build/hooks/use-ai-checkout/index.js +1 -1
- package/build/hooks/use-ai-feature/index.d.ts +1 -1
- package/build/hooks/use-ai-feature/index.js +1 -1
- package/build/hooks/use-ai-suggestions/index.d.ts +3 -3
- package/build/hooks/use-ai-suggestions/index.js +3 -3
- package/build/hooks/use-audio-transcription/index.js +1 -1
- package/build/hooks/use-image-generator/index.d.ts +2 -2
- package/build/hooks/use-image-generator/index.js +3 -3
- package/build/hooks/use-post-content.js +1 -1
- package/build/hooks/use-transcription-post-processing/index.js +1 -1
- package/build/icons/index.d.ts +7 -7
- package/build/icons/index.js +7 -7
- package/build/index.d.ts +23 -23
- package/build/index.js +23 -23
- package/build/jwt/index.js +1 -1
- package/build/libs/get-all-blocks.d.ts +1 -1
- package/build/libs/index.d.ts +7 -7
- package/build/libs/index.js +6 -6
- package/build/libs/map-action-to-human-text.js +1 -1
- package/build/libs/markdown/index.d.ts +3 -3
- package/build/libs/markdown/index.js +2 -2
- package/build/logo-generator/components/fair-usage-notice.js +1 -1
- package/build/logo-generator/components/first-load-screen.js +1 -1
- package/build/logo-generator/components/generator-modal.d.ts +1 -1
- package/build/logo-generator/components/generator-modal.js +14 -14
- package/build/logo-generator/components/history-carousel.js +2 -2
- package/build/logo-generator/components/logo-presenter.d.ts +1 -1
- package/build/logo-generator/components/logo-presenter.js +10 -10
- package/build/logo-generator/components/prompt.js +8 -8
- package/build/logo-generator/components/upgrade-nudge.js +3 -3
- package/build/logo-generator/components/upgrade-screen.js +2 -2
- package/build/logo-generator/hooks/use-checkout.js +1 -1
- package/build/logo-generator/hooks/use-fair-usage-notice-message.js +1 -1
- package/build/logo-generator/hooks/use-logo-generator.d.ts +3 -3
- package/build/logo-generator/hooks/use-logo-generator.js +8 -8
- package/build/logo-generator/hooks/use-request-errors.d.ts +6 -6
- package/build/logo-generator/hooks/use-request-errors.js +1 -1
- package/build/logo-generator/index.d.ts +2 -2
- package/build/logo-generator/index.js +2 -2
- package/build/logo-generator/lib/logo-storage.d.ts +2 -2
- package/build/logo-generator/lib/logo-storage.js +1 -1
- package/build/logo-generator/lib/media-exists.d.ts +1 -1
- package/build/logo-generator/lib/media-exists.js +1 -1
- package/build/logo-generator/lib/set-site-logo.d.ts +1 -1
- package/build/logo-generator/lib/set-site-logo.js +1 -1
- package/build/logo-generator/lib/wpcom-limited-request.js +1 -1
- package/build/logo-generator/store/actions.d.ts +2 -2
- package/build/logo-generator/store/actions.js +3 -3
- package/build/logo-generator/store/index.js +3 -3
- package/build/logo-generator/store/initial-state.d.ts +1 -1
- package/build/logo-generator/store/initial-state.js +1 -1
- package/build/logo-generator/store/reducer.d.ts +26 -26
- package/build/logo-generator/store/reducer.js +4 -4
- package/build/logo-generator/store/selectors.d.ts +2 -2
- package/build/logo-generator/store/selectors.js +1 -1
- package/build/logo-generator/store/types.d.ts +2 -2
- package/build/logo-generator/types.d.ts +1 -1
- package/build/suggestions-event-source/index.d.ts +1 -1
- package/build/suggestions-event-source/index.js +3 -3
- package/build/types.d.ts +8 -8
- package/build/types.js +1 -1
- package/package.json +21 -20
- package/src/ask-question/index.ts +2 -2
- package/src/ask-question/sync.ts +3 -3
- package/src/audio-transcription/index.ts +1 -1
- package/src/chrome-ai/factory.ts +3 -3
- package/src/chrome-ai/index.ts +2 -2
- package/src/chrome-ai/suggestions.ts +4 -4
- package/src/components/ai-control/ai-control.tsx +3 -3
- package/src/components/ai-control/block-ai-control.tsx +3 -3
- package/src/components/ai-control/extension-ai-control.tsx +3 -3
- package/src/components/ai-control/index.tsx +3 -3
- package/src/components/ai-control/style.scss +1 -0
- package/src/components/ai-feedback/style.scss +1 -0
- package/src/components/ai-image/components/ai-image-modal.scss +2 -0
- package/src/components/ai-image/components/ai-image-modal.tsx +7 -7
- package/src/components/ai-image/components/carrousel.scss +10 -4
- package/src/components/ai-image/components/carrousel.tsx +2 -2
- package/src/components/ai-image/components/usage-counter.scss +1 -1
- package/src/components/ai-image/featured-image.tsx +11 -11
- package/src/components/ai-image/general-purpose-image.tsx +7 -7
- package/src/components/ai-image/hooks/use-ai-image.ts +8 -8
- package/src/components/ai-image/index.ts +3 -3
- package/src/components/ai-image/style.scss +2 -0
- package/src/components/ai-status-indicator/index.tsx +1 -1
- package/src/components/audio-duration-display/index.tsx +1 -1
- package/src/components/index.ts +10 -10
- package/src/components/message/index.tsx +4 -4
- package/src/components/modal/index.tsx +2 -2
- package/src/components/modal/style.scss +2 -0
- package/src/components/quota-exceeded-message/index.tsx +3 -3
- package/src/components/quota-exceeded-message/style.scss +3 -1
- package/src/data-flow/context.tsx +4 -4
- package/src/data-flow/index.ts +3 -3
- package/src/data-flow/use-ai-context.ts +4 -4
- package/src/data-flow/with-ai-assistant-data.tsx +2 -2
- package/src/hooks/use-ai-checkout/index.ts +1 -1
- package/src/hooks/use-ai-suggestions/index.ts +6 -6
- package/src/hooks/use-audio-transcription/index.ts +1 -1
- package/src/hooks/use-image-generator/index.ts +3 -3
- package/src/hooks/use-post-content.ts +1 -1
- package/src/hooks/use-save-to-media-library/index.ts +1 -1
- package/src/hooks/use-save-to-media-library.ts +1 -1
- package/src/hooks/use-transcription-post-processing/index.ts +2 -2
- package/src/icons/index.ts +7 -7
- package/src/index.ts +23 -23
- package/src/jwt/index.ts +1 -1
- package/src/libs/get-all-blocks.ts +1 -1
- package/src/libs/index.ts +7 -7
- package/src/libs/map-action-to-human-text.ts +1 -1
- package/src/libs/markdown/index.ts +3 -3
- package/src/logo-generator/assets/icons/icons.scss +1 -0
- package/src/logo-generator/components/fair-usage-notice.tsx +1 -1
- package/src/logo-generator/components/first-load-screen.tsx +1 -1
- package/src/logo-generator/components/generator-modal.scss +1 -0
- package/src/logo-generator/components/generator-modal.tsx +15 -15
- package/src/logo-generator/components/history-carousel.tsx +2 -2
- package/src/logo-generator/components/logo-presenter.scss +1 -0
- package/src/logo-generator/components/logo-presenter.tsx +12 -12
- package/src/logo-generator/components/prompt.scss +1 -0
- package/src/logo-generator/components/prompt.tsx +9 -9
- package/src/logo-generator/components/upgrade-nudge.tsx +3 -3
- package/src/logo-generator/components/upgrade-screen.tsx +2 -2
- package/src/logo-generator/hooks/use-checkout.ts +2 -2
- package/src/logo-generator/hooks/use-fair-usage-notice-message.tsx +2 -2
- package/src/logo-generator/hooks/use-logo-generator.ts +11 -11
- package/src/logo-generator/hooks/use-request-errors.ts +2 -2
- package/src/logo-generator/index.ts +2 -2
- package/src/logo-generator/lib/logo-storage.ts +3 -3
- package/src/logo-generator/lib/media-exists.ts +2 -2
- package/src/logo-generator/lib/set-site-logo.ts +2 -2
- package/src/logo-generator/lib/wpcom-limited-request.ts +1 -1
- package/src/logo-generator/store/actions.ts +5 -5
- package/src/logo-generator/store/index.ts +3 -3
- package/src/logo-generator/store/initial-state.ts +2 -2
- package/src/logo-generator/store/reducer.ts +5 -5
- package/src/logo-generator/store/selectors.ts +3 -3
- package/src/logo-generator/store/types.ts +2 -2
- package/src/logo-generator/types.ts +1 -1
- package/src/suggestions-event-source/index.ts +4 -4
- package/src/types.ts +8 -8
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import getRedirectUrl from '@automattic/jetpack-components/tools/jp-redirect';
|
|
5
5
|
import { isAtomicSite, isSimpleSite, getSiteFragment, useAutosaveAndRedirect, } from '@automattic/jetpack-shared-extension-utils';
|
|
6
|
-
import useAiFeature from
|
|
6
|
+
import useAiFeature from "../use-ai-feature/index.js";
|
|
7
7
|
const getWPComRedirectToURL = () => {
|
|
8
8
|
const searchParams = new URLSearchParams(window.location.search);
|
|
9
9
|
const site = getSiteFragment();
|
|
@@ -22,7 +22,7 @@ export default function useAiFeature(): {
|
|
|
22
22
|
nextStart: string;
|
|
23
23
|
requestsCount: number;
|
|
24
24
|
};
|
|
25
|
-
nextTier?: import("@automattic/jetpack-shared-extension-utils/store/wordpress-com/types").TierProp;
|
|
25
|
+
nextTier?: import("@automattic/jetpack-shared-extension-utils/store/wordpress-com/types").TierProp | null;
|
|
26
26
|
tierPlansEnabled?: boolean;
|
|
27
27
|
costs?: {
|
|
28
28
|
[key: string]: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Types & constants
|
|
3
3
|
*/
|
|
4
|
-
import type { AskQuestionOptionsArgProps } from '../../ask-question/index.
|
|
5
|
-
import type SuggestionsEventSource from '../../suggestions-event-source/index.
|
|
6
|
-
import type { PromptProp, SuggestionErrorCode, RequestingStateProp } from '../../types.
|
|
4
|
+
import type { AskQuestionOptionsArgProps } from '../../ask-question/index.ts';
|
|
5
|
+
import type SuggestionsEventSource from '../../suggestions-event-source/index.ts';
|
|
6
|
+
import type { PromptProp, SuggestionErrorCode, RequestingStateProp } from '../../types.ts';
|
|
7
7
|
export type RequestingErrorProps = {
|
|
8
8
|
code: SuggestionErrorCode;
|
|
9
9
|
message: string;
|
|
@@ -6,9 +6,9 @@ import { __ } from '@wordpress/i18n';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import askQuestion from
|
|
10
|
-
import ChromeAIFactory from
|
|
11
|
-
import { ERROR_CONTEXT_TOO_LARGE, ERROR_MODERATION, ERROR_NETWORK, ERROR_QUOTA_EXCEEDED, ERROR_SERVICE_UNAVAILABLE, ERROR_UNCLEAR_PROMPT, ERROR_RESPONSE, } from
|
|
9
|
+
import askQuestion from "../../ask-question/index.js";
|
|
10
|
+
import ChromeAIFactory from "../../chrome-ai/factory.js";
|
|
11
|
+
import { ERROR_CONTEXT_TOO_LARGE, ERROR_MODERATION, ERROR_NETWORK, ERROR_QUOTA_EXCEEDED, ERROR_SERVICE_UNAVAILABLE, ERROR_UNCLEAR_PROMPT, ERROR_RESPONSE, } from "../../types.js";
|
|
12
12
|
/**
|
|
13
13
|
* Get the error data for a given error code.
|
|
14
14
|
*
|
|
@@ -7,7 +7,7 @@ import debugFactory from 'debug';
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
|
-
import transcribeAudio from
|
|
10
|
+
import transcribeAudio from "../../audio-transcription/index.js";
|
|
11
11
|
const debug = debugFactory('jetpack-ai-client:use-audio-transcription');
|
|
12
12
|
/**
|
|
13
13
|
* Map error response to a string.
|
|
@@ -10,7 +10,7 @@ declare const useImageGenerator: () => {
|
|
|
10
10
|
generateImage: ({ feature, postContent, responseFormat, userPrompt, }: {
|
|
11
11
|
feature: string;
|
|
12
12
|
postContent: string;
|
|
13
|
-
responseFormat?:
|
|
13
|
+
responseFormat?: "url" | "b64_json";
|
|
14
14
|
userPrompt?: string;
|
|
15
15
|
}) => Promise<ImageGenerationResponse>;
|
|
16
16
|
generateImageWithStableDiffusion: ({ feature, postContent, userPrompt, }: {
|
|
@@ -21,4 +21,4 @@ declare const useImageGenerator: () => {
|
|
|
21
21
|
generateImageWithParameters: (parameters: object) => Promise<ImageGenerationResponse>;
|
|
22
22
|
};
|
|
23
23
|
export default useImageGenerator;
|
|
24
|
-
export * from './constants.
|
|
24
|
+
export * from './constants.ts';
|
|
@@ -5,8 +5,8 @@ import debugFactory from 'debug';
|
|
|
5
5
|
/**
|
|
6
6
|
* Internal dependencies
|
|
7
7
|
*/
|
|
8
|
-
import askQuestionSync from
|
|
9
|
-
import requestJwt from
|
|
8
|
+
import askQuestionSync from "../../ask-question/sync.js";
|
|
9
|
+
import requestJwt from "../../jwt/index.js";
|
|
10
10
|
const debug = debugFactory('ai-client:use-image-generator');
|
|
11
11
|
/**
|
|
12
12
|
* Cut the post content on a given lenght so the total length of the prompt is not longer than 4000 characters.
|
|
@@ -202,4 +202,4 @@ const useImageGenerator = () => {
|
|
|
202
202
|
};
|
|
203
203
|
};
|
|
204
204
|
export default useImageGenerator;
|
|
205
|
-
export * from
|
|
205
|
+
export * from "./constants.js";
|
|
@@ -8,7 +8,7 @@ import { useCallback } from '@wordpress/element';
|
|
|
8
8
|
/**
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
|
-
import { renderMarkdownFromHTML } from
|
|
11
|
+
import { renderMarkdownFromHTML } from "../libs/markdown/index.js";
|
|
12
12
|
/*
|
|
13
13
|
* Simple helper to get the post content as markdown
|
|
14
14
|
*/
|
|
@@ -6,7 +6,7 @@ import debugFactory from 'debug';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import useAiSuggestions from
|
|
9
|
+
import useAiSuggestions from "../use-ai-suggestions/index.js";
|
|
10
10
|
const debug = debugFactory('jetpack-ai-client:use-transcription-post-processing');
|
|
11
11
|
/**
|
|
12
12
|
* Post-processing types.
|
package/build/icons/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { default as aiAssistantIcon } from './ai-assistant.
|
|
2
|
-
export { default as micIcon } from './mic.
|
|
3
|
-
export { default as origamiPlaneIcon } from './origami-plane.
|
|
4
|
-
export { default as playerPlayIcon } from './player-play.
|
|
5
|
-
export { default as playerStopIcon } from './player-stop.
|
|
6
|
-
export { default as playerPauseIcon } from './player-pause.
|
|
7
|
-
export { default as speakToneIcon } from './speak-tone.
|
|
1
|
+
export { default as aiAssistantIcon } from './ai-assistant.tsx';
|
|
2
|
+
export { default as micIcon } from './mic.tsx';
|
|
3
|
+
export { default as origamiPlaneIcon } from './origami-plane.tsx';
|
|
4
|
+
export { default as playerPlayIcon } from './player-play.tsx';
|
|
5
|
+
export { default as playerStopIcon } from './player-stop.tsx';
|
|
6
|
+
export { default as playerPauseIcon } from './player-pause.tsx';
|
|
7
|
+
export { default as speakToneIcon } from './speak-tone.tsx';
|
package/build/icons/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { default as aiAssistantIcon } from
|
|
2
|
-
export { default as micIcon } from
|
|
3
|
-
export { default as origamiPlaneIcon } from
|
|
4
|
-
export { default as playerPlayIcon } from
|
|
5
|
-
export { default as playerStopIcon } from
|
|
6
|
-
export { default as playerPauseIcon } from
|
|
7
|
-
export { default as speakToneIcon } from
|
|
1
|
+
export { default as aiAssistantIcon } from "./ai-assistant.js";
|
|
2
|
+
export { default as micIcon } from "./mic.js";
|
|
3
|
+
export { default as origamiPlaneIcon } from "./origami-plane.js";
|
|
4
|
+
export { default as playerPlayIcon } from "./player-play.js";
|
|
5
|
+
export { default as playerStopIcon } from "./player-stop.js";
|
|
6
|
+
export { default as playerPauseIcon } from "./player-pause.js";
|
|
7
|
+
export { default as speakToneIcon } from "./speak-tone.js";
|
package/build/index.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
export { default as requestJwt } from './jwt/index.
|
|
2
|
-
export { default as SuggestionsEventSource } from './suggestions-event-source/index.
|
|
3
|
-
export { default as askQuestion } from './ask-question/index.
|
|
4
|
-
export { default as askQuestionSync } from './ask-question/sync.
|
|
5
|
-
export { default as transcribeAudio } from './audio-transcription/index.
|
|
6
|
-
export { default as useAICheckout } from './hooks/use-ai-checkout/index.
|
|
7
|
-
export { default as useAiFeature } from './hooks/use-ai-feature/index.
|
|
8
|
-
export { default as useAiSuggestions, getErrorData } from './hooks/use-ai-suggestions/index.
|
|
9
|
-
export { default as useMediaRecording } from './hooks/use-media-recording/index.
|
|
10
|
-
export { default as useAudioTranscription } from './hooks/use-audio-transcription/index.
|
|
11
|
-
export { default as useTranscriptionPostProcessing } from './hooks/use-transcription-post-processing/index.
|
|
12
|
-
export { default as useAudioValidation } from './hooks/use-audio-validation/index.
|
|
13
|
-
export { default as useImageGenerator } from './hooks/use-image-generator/index.
|
|
14
|
-
export { default as usePostContent } from './hooks/use-post-content.
|
|
15
|
-
export * from './hooks/use-image-generator/constants.
|
|
16
|
-
export * from './icons/index.
|
|
17
|
-
export * from './components/index.
|
|
18
|
-
export * from './data-flow/index.
|
|
19
|
-
export * from './types.
|
|
20
|
-
export * from './libs/index.
|
|
21
|
-
export * from './constants.
|
|
22
|
-
export * from './logo-generator/index.
|
|
1
|
+
export { default as requestJwt } from './jwt/index.ts';
|
|
2
|
+
export { default as SuggestionsEventSource } from './suggestions-event-source/index.ts';
|
|
3
|
+
export { default as askQuestion } from './ask-question/index.ts';
|
|
4
|
+
export { default as askQuestionSync } from './ask-question/sync.ts';
|
|
5
|
+
export { default as transcribeAudio } from './audio-transcription/index.ts';
|
|
6
|
+
export { default as useAICheckout } from './hooks/use-ai-checkout/index.ts';
|
|
7
|
+
export { default as useAiFeature } from './hooks/use-ai-feature/index.ts';
|
|
8
|
+
export { default as useAiSuggestions, getErrorData } from './hooks/use-ai-suggestions/index.ts';
|
|
9
|
+
export { default as useMediaRecording } from './hooks/use-media-recording/index.ts';
|
|
10
|
+
export { default as useAudioTranscription } from './hooks/use-audio-transcription/index.ts';
|
|
11
|
+
export { default as useTranscriptionPostProcessing } from './hooks/use-transcription-post-processing/index.ts';
|
|
12
|
+
export { default as useAudioValidation } from './hooks/use-audio-validation/index.ts';
|
|
13
|
+
export { default as useImageGenerator } from './hooks/use-image-generator/index.ts';
|
|
14
|
+
export { default as usePostContent } from './hooks/use-post-content.ts';
|
|
15
|
+
export * from './hooks/use-image-generator/constants.ts';
|
|
16
|
+
export * from './icons/index.ts';
|
|
17
|
+
export * from './components/index.ts';
|
|
18
|
+
export * from './data-flow/index.ts';
|
|
19
|
+
export * from './types.ts';
|
|
20
|
+
export * from './libs/index.ts';
|
|
21
|
+
export * from './constants.ts';
|
|
22
|
+
export * from './logo-generator/index.ts';
|
|
23
23
|
/**
|
|
24
24
|
* Chrome AI
|
|
25
25
|
*/
|
|
26
|
-
export * from './chrome-ai/index.
|
|
26
|
+
export * from './chrome-ai/index.ts';
|
package/build/index.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Core library exports
|
|
3
3
|
*/
|
|
4
|
-
export { default as requestJwt } from
|
|
5
|
-
export { default as SuggestionsEventSource } from
|
|
6
|
-
export { default as askQuestion } from
|
|
7
|
-
export { default as askQuestionSync } from
|
|
8
|
-
export { default as transcribeAudio } from
|
|
4
|
+
export { default as requestJwt } from "./jwt/index.js";
|
|
5
|
+
export { default as SuggestionsEventSource } from "./suggestions-event-source/index.js";
|
|
6
|
+
export { default as askQuestion } from "./ask-question/index.js";
|
|
7
|
+
export { default as askQuestionSync } from "./ask-question/sync.js";
|
|
8
|
+
export { default as transcribeAudio } from "./audio-transcription/index.js";
|
|
9
9
|
/*
|
|
10
10
|
* Hooks
|
|
11
11
|
*/
|
|
12
|
-
export { default as useAICheckout } from
|
|
13
|
-
export { default as useAiFeature } from
|
|
14
|
-
export { default as useAiSuggestions, getErrorData } from
|
|
15
|
-
export { default as useMediaRecording } from
|
|
16
|
-
export { default as useAudioTranscription } from
|
|
17
|
-
export { default as useTranscriptionPostProcessing } from
|
|
18
|
-
export { default as useAudioValidation } from
|
|
19
|
-
export { default as useImageGenerator } from
|
|
20
|
-
export { default as usePostContent } from
|
|
21
|
-
export * from
|
|
12
|
+
export { default as useAICheckout } from "./hooks/use-ai-checkout/index.js";
|
|
13
|
+
export { default as useAiFeature } from "./hooks/use-ai-feature/index.js";
|
|
14
|
+
export { default as useAiSuggestions, getErrorData } from "./hooks/use-ai-suggestions/index.js";
|
|
15
|
+
export { default as useMediaRecording } from "./hooks/use-media-recording/index.js";
|
|
16
|
+
export { default as useAudioTranscription } from "./hooks/use-audio-transcription/index.js";
|
|
17
|
+
export { default as useTranscriptionPostProcessing } from "./hooks/use-transcription-post-processing/index.js";
|
|
18
|
+
export { default as useAudioValidation } from "./hooks/use-audio-validation/index.js";
|
|
19
|
+
export { default as useImageGenerator } from "./hooks/use-image-generator/index.js";
|
|
20
|
+
export { default as usePostContent } from "./hooks/use-post-content.js";
|
|
21
|
+
export * from "./hooks/use-image-generator/constants.js";
|
|
22
22
|
/*
|
|
23
23
|
* Components: Icons
|
|
24
24
|
*/
|
|
25
|
-
export * from
|
|
25
|
+
export * from "./icons/index.js";
|
|
26
26
|
/*
|
|
27
27
|
* Components
|
|
28
28
|
*/
|
|
29
|
-
export * from
|
|
29
|
+
export * from "./components/index.js";
|
|
30
30
|
/*
|
|
31
31
|
* Contexts
|
|
32
32
|
*/
|
|
33
|
-
export * from
|
|
33
|
+
export * from "./data-flow/index.js";
|
|
34
34
|
/*
|
|
35
35
|
* Types
|
|
36
36
|
*/
|
|
37
|
-
export * from
|
|
37
|
+
export * from "./types.js";
|
|
38
38
|
/*
|
|
39
39
|
* Libs
|
|
40
40
|
*/
|
|
41
|
-
export * from
|
|
41
|
+
export * from "./libs/index.js";
|
|
42
42
|
/*
|
|
43
43
|
* Constants
|
|
44
44
|
*/
|
|
45
|
-
export * from
|
|
45
|
+
export * from "./constants.js";
|
|
46
46
|
/*
|
|
47
47
|
* Logo Generator
|
|
48
48
|
*/
|
|
49
|
-
export * from
|
|
49
|
+
export * from "./logo-generator/index.js";
|
|
50
50
|
/**
|
|
51
51
|
* Chrome AI
|
|
52
52
|
*/
|
|
53
|
-
export * from
|
|
53
|
+
export * from "./chrome-ai/index.js";
|
package/build/jwt/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import debugFactory from 'debug';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import apiFetch from
|
|
9
|
+
import apiFetch from "../api-fetch/index.js";
|
|
10
10
|
const debug = debugFactory('jetpack-ai-client:jwt');
|
|
11
11
|
const JWT_TOKEN_ID = 'jetpack-ai-jwt';
|
|
12
12
|
const JWT_TOKEN_EXPIRATION_TIME = 2 * 60 * 1000; // 2 minutes
|
package/build/libs/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { MarkdownToHTML, HTMLToMarkdown, renderHTMLFromMarkdown, renderMarkdownFromHTML, fixes, } from './markdown/index.
|
|
2
|
-
export { mapActionToHumanText } from './map-action-to-human-text.
|
|
3
|
-
export { openBlockSidebar } from './open-block-sidebar.
|
|
4
|
-
export { showAiAssistantSection } from './show-ai-assistant-section.
|
|
5
|
-
export { getAllBlocks } from './get-all-blocks.
|
|
6
|
-
export { getBase64Image } from './get-base64-image.
|
|
7
|
-
export type { RenderHTMLRules } from './markdown/index.
|
|
1
|
+
export { MarkdownToHTML, HTMLToMarkdown, renderHTMLFromMarkdown, renderMarkdownFromHTML, fixes, } from './markdown/index.ts';
|
|
2
|
+
export { mapActionToHumanText } from './map-action-to-human-text.ts';
|
|
3
|
+
export { openBlockSidebar } from './open-block-sidebar.ts';
|
|
4
|
+
export { showAiAssistantSection } from './show-ai-assistant-section.ts';
|
|
5
|
+
export { getAllBlocks } from './get-all-blocks.ts';
|
|
6
|
+
export { getBase64Image } from './get-base64-image.ts';
|
|
7
|
+
export type { RenderHTMLRules } from './markdown/index.ts';
|
package/build/libs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { MarkdownToHTML, HTMLToMarkdown, renderHTMLFromMarkdown, renderMarkdownFromHTML, fixes, } from
|
|
2
|
-
export { mapActionToHumanText } from
|
|
3
|
-
export { openBlockSidebar } from
|
|
4
|
-
export { showAiAssistantSection } from
|
|
5
|
-
export { getAllBlocks } from
|
|
6
|
-
export { getBase64Image } from
|
|
1
|
+
export { MarkdownToHTML, HTMLToMarkdown, renderHTMLFromMarkdown, renderMarkdownFromHTML, fixes, } from "./markdown/index.js";
|
|
2
|
+
export { mapActionToHumanText } from "./map-action-to-human-text.js";
|
|
3
|
+
export { openBlockSidebar } from "./open-block-sidebar.js";
|
|
4
|
+
export { showAiAssistantSection } from "./show-ai-assistant-section.js";
|
|
5
|
+
export { getAllBlocks } from "./get-all-blocks.js";
|
|
6
|
+
export { getBase64Image } from "./get-base64-image.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LANGUAGE_MAP, PROMPT_TONES_MAP, PROMPT_TYPE_CHANGE_LANGUAGE, PROMPT_TYPE_CHANGE_TONE, PROMPT_TYPE_CONTINUE, PROMPT_TYPE_CORRECT_SPELLING, PROMPT_TYPE_GENERATE_TITLE, PROMPT_TYPE_MAKE_LONGER, PROMPT_TYPE_MAKE_SHORTER, PROMPT_TYPE_SIMPLIFY, PROMPT_TYPE_SUMMARIZE, PROMPT_TYPE_SUMMARY_BY_TITLE, PROMPT_TYPE_TRANSFORM_LIST_TO_TABLE, PROMPT_TYPE_WRITE_POST_FROM_LIST, CONTINUE_LABEL, CORRECT_SPELLING_LABEL, GENERATE_TITLE_LABEL, MAKE_LONGER_LABEL, MAKE_SHORTER_LABEL, SIMPLIFY_LABEL, SUMMARIZE_LABEL, SUMMARY_BASED_ON_TITLE_LABEL, TONE_LABEL, TRANSLATE_LABEL, TURN_LIST_INTO_TABLE_LABEL, WRITE_POST_FROM_LIST_LABEL, } from
|
|
1
|
+
import { LANGUAGE_MAP, PROMPT_TONES_MAP, PROMPT_TYPE_CHANGE_LANGUAGE, PROMPT_TYPE_CHANGE_TONE, PROMPT_TYPE_CONTINUE, PROMPT_TYPE_CORRECT_SPELLING, PROMPT_TYPE_GENERATE_TITLE, PROMPT_TYPE_MAKE_LONGER, PROMPT_TYPE_MAKE_SHORTER, PROMPT_TYPE_SIMPLIFY, PROMPT_TYPE_SUMMARIZE, PROMPT_TYPE_SUMMARY_BY_TITLE, PROMPT_TYPE_TRANSFORM_LIST_TO_TABLE, PROMPT_TYPE_WRITE_POST_FROM_LIST, CONTINUE_LABEL, CORRECT_SPELLING_LABEL, GENERATE_TITLE_LABEL, MAKE_LONGER_LABEL, MAKE_SHORTER_LABEL, SIMPLIFY_LABEL, SUMMARIZE_LABEL, SUMMARY_BASED_ON_TITLE_LABEL, TONE_LABEL, TRANSLATE_LABEL, TURN_LIST_INTO_TABLE_LABEL, WRITE_POST_FROM_LIST_LABEL, } from "../constants.js";
|
|
2
2
|
/**
|
|
3
3
|
* Maps an action to a human-readable text.
|
|
4
4
|
*
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import HTMLToMarkdown from './html-to-markdown.
|
|
5
|
-
import MarkdownToHTML, { fixes } from './markdown-to-html.
|
|
4
|
+
import HTMLToMarkdown from './html-to-markdown.ts';
|
|
5
|
+
import MarkdownToHTML, { fixes } from './markdown-to-html.ts';
|
|
6
6
|
/**
|
|
7
7
|
* Types
|
|
8
8
|
*/
|
|
9
|
-
import type { Fix as HTMLFix } from './markdown-to-html.
|
|
9
|
+
import type { Fix as HTMLFix } from './markdown-to-html.ts';
|
|
10
10
|
export type RenderHTMLRules = Array<HTMLFix>;
|
|
11
11
|
declare const renderHTMLFromMarkdown: ({ content, rules, extension, }: {
|
|
12
12
|
content: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import HTMLToMarkdown from
|
|
5
|
-
import MarkdownToHTML, { fixes } from
|
|
4
|
+
import HTMLToMarkdown from "./html-to-markdown.js";
|
|
5
|
+
import MarkdownToHTML, { fixes } from "./markdown-to-html.js";
|
|
6
6
|
const defaultMarkdownConverter = new MarkdownToHTML();
|
|
7
7
|
const defaultHTMLConverter = new HTMLToMarkdown();
|
|
8
8
|
const renderHTMLFromMarkdown = ({ content, rules, extension, }) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Notice } from '@wordpress/components';
|
|
3
|
-
import useFairUsageNoticeMessage from
|
|
3
|
+
import useFairUsageNoticeMessage from "../hooks/use-fair-usage-notice-message.js";
|
|
4
4
|
/**
|
|
5
5
|
* The fair usage notice component.
|
|
6
6
|
* @param {FairUsageNoticeProps} props - Fair usage notice component props.
|
|
@@ -6,7 +6,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { ImageLoader } from
|
|
9
|
+
import { ImageLoader } from "./image-loader.js";
|
|
10
10
|
import './first-load-screen.scss';
|
|
11
11
|
export const FirstLoadScreen = ({ state = 'loadingFeature' }) => {
|
|
12
12
|
const loadingLabel = __('Loading…', 'jetpack-ai-client');
|
|
@@ -2,6 +2,6 @@ import './generator-modal.scss';
|
|
|
2
2
|
/**
|
|
3
3
|
* Types
|
|
4
4
|
*/
|
|
5
|
-
import type { GeneratorModalProps } from '../types.
|
|
5
|
+
import type { GeneratorModalProps } from '../types.ts';
|
|
6
6
|
import type React from 'react';
|
|
7
7
|
export declare const GeneratorModal: React.FC<GeneratorModalProps>;
|
|
@@ -12,20 +12,20 @@ import { useState, useEffect, useCallback, useRef } from 'react';
|
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
|
-
import AiModalFooter from
|
|
16
|
-
import { DEFAULT_LOGO_COST, EVENT_MODAL_OPEN, EVENT_FEEDBACK, EVENT_MODAL_CLOSE, EVENT_GENERATE, } from
|
|
17
|
-
import { useCheckout } from
|
|
18
|
-
import useLogoGenerator from
|
|
19
|
-
import useRequestErrors from
|
|
20
|
-
import { isLogoHistoryEmpty, clearDeletedMedia } from
|
|
21
|
-
import { STORE_NAME } from
|
|
22
|
-
import { FeatureFetchFailureScreen } from
|
|
23
|
-
import { FirstLoadScreen } from
|
|
24
|
-
import { HistoryCarousel } from
|
|
25
|
-
import { LogoPresenter } from
|
|
26
|
-
import { Prompt } from
|
|
27
|
-
import { UpgradeScreen } from
|
|
28
|
-
import { VisitSiteBanner } from
|
|
15
|
+
import AiModalFooter from "../../components/ai-modal-footer/index.js";
|
|
16
|
+
import { DEFAULT_LOGO_COST, EVENT_MODAL_OPEN, EVENT_FEEDBACK, EVENT_MODAL_CLOSE, EVENT_GENERATE, } from "../constants.js";
|
|
17
|
+
import { useCheckout } from "../hooks/use-checkout.js";
|
|
18
|
+
import useLogoGenerator from "../hooks/use-logo-generator.js";
|
|
19
|
+
import useRequestErrors from "../hooks/use-request-errors.js";
|
|
20
|
+
import { isLogoHistoryEmpty, clearDeletedMedia } from "../lib/logo-storage.js";
|
|
21
|
+
import { STORE_NAME } from "../store/index.js";
|
|
22
|
+
import { FeatureFetchFailureScreen } from "./feature-fetch-failure-screen.js";
|
|
23
|
+
import { FirstLoadScreen } from "./first-load-screen.js";
|
|
24
|
+
import { HistoryCarousel } from "./history-carousel.js";
|
|
25
|
+
import { LogoPresenter } from "./logo-presenter.js";
|
|
26
|
+
import { Prompt } from "./prompt.js";
|
|
27
|
+
import { UpgradeScreen } from "./upgrade-screen.js";
|
|
28
|
+
import { VisitSiteBanner } from "./visit-site-banner.js";
|
|
29
29
|
import './generator-modal.scss';
|
|
30
30
|
const debug = debugFactory('jetpack-ai-calypso:generator-modal');
|
|
31
31
|
export const GeneratorModal = ({ isOpen, onClose, onApplyLogo, onReload = null, siteDetails, context, placement, }) => {
|
|
@@ -9,8 +9,8 @@ import clsx from 'clsx';
|
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
11
|
import loader from '../assets/images/loader.gif';
|
|
12
|
-
import { EVENT_NAVIGATE } from
|
|
13
|
-
import useLogoGenerator from
|
|
12
|
+
import { EVENT_NAVIGATE } from "../constants.js";
|
|
13
|
+
import useLogoGenerator from "../hooks/use-logo-generator.js";
|
|
14
14
|
import './history-carousel.scss';
|
|
15
15
|
export const HistoryCarousel = () => {
|
|
16
16
|
const { tracks } = useAnalytics();
|
|
@@ -10,16 +10,16 @@ import debugFactory from 'debug';
|
|
|
10
10
|
/**
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
|
-
import AiFeedbackThumbs from
|
|
14
|
-
import CheckIcon from
|
|
15
|
-
import LogoIcon from
|
|
16
|
-
import MediaIcon from
|
|
17
|
-
import { EVENT_SAVE, EVENT_USE } from
|
|
18
|
-
import useLogoGenerator from
|
|
19
|
-
import useRequestErrors from
|
|
20
|
-
import { updateLogo } from
|
|
21
|
-
import { STORE_NAME } from
|
|
22
|
-
import { ImageLoader } from
|
|
13
|
+
import AiFeedbackThumbs from "../../components/ai-feedback/index.js";
|
|
14
|
+
import CheckIcon from "../assets/icons/check.js";
|
|
15
|
+
import LogoIcon from "../assets/icons/logo.js";
|
|
16
|
+
import MediaIcon from "../assets/icons/media.js";
|
|
17
|
+
import { EVENT_SAVE, EVENT_USE } from "../constants.js";
|
|
18
|
+
import useLogoGenerator from "../hooks/use-logo-generator.js";
|
|
19
|
+
import useRequestErrors from "../hooks/use-request-errors.js";
|
|
20
|
+
import { updateLogo } from "../lib/logo-storage.js";
|
|
21
|
+
import { STORE_NAME } from "../store/index.js";
|
|
22
|
+
import { ImageLoader } from "./image-loader.js";
|
|
23
23
|
import './logo-presenter.scss';
|
|
24
24
|
const debug = debugFactory('jetpack-ai-calypso:logo-presenter');
|
|
25
25
|
const SaveInLibraryButton = ({ siteId }) => {
|
|
@@ -11,14 +11,14 @@ import { useCallback, useEffect, useState, useRef } from 'react';
|
|
|
11
11
|
/**
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
|
-
import { IMAGE_STYLE_NONE, IMAGE_STYLE_AUTO } from
|
|
15
|
-
import AiIcon from
|
|
16
|
-
import { EVENT_GENERATE, MINIMUM_PROMPT_LENGTH, EVENT_UPGRADE, EVENT_PLACEMENT_INPUT_FOOTER, EVENT_SWITCH_STYLE, EVENT_GUESS_STYLE, } from
|
|
17
|
-
import { useCheckout } from
|
|
18
|
-
import useLogoGenerator from
|
|
19
|
-
import useRequestErrors from
|
|
20
|
-
import { FairUsageNotice } from
|
|
21
|
-
import { UpgradeNudge } from
|
|
14
|
+
import { IMAGE_STYLE_NONE, IMAGE_STYLE_AUTO } from "../../hooks/use-image-generator/constants.js";
|
|
15
|
+
import AiIcon from "../assets/icons/ai.js";
|
|
16
|
+
import { EVENT_GENERATE, MINIMUM_PROMPT_LENGTH, EVENT_UPGRADE, EVENT_PLACEMENT_INPUT_FOOTER, EVENT_SWITCH_STYLE, EVENT_GUESS_STYLE, } from "../constants.js";
|
|
17
|
+
import { useCheckout } from "../hooks/use-checkout.js";
|
|
18
|
+
import useLogoGenerator from "../hooks/use-logo-generator.js";
|
|
19
|
+
import useRequestErrors from "../hooks/use-request-errors.js";
|
|
20
|
+
import { FairUsageNotice } from "./fair-usage-notice.js";
|
|
21
|
+
import { UpgradeNudge } from "./upgrade-nudge.js";
|
|
22
22
|
import './prompt.scss';
|
|
23
23
|
const debug = debugFactory('jetpack-ai-calypso:prompt-box');
|
|
24
24
|
export const AiModalPromptInput = ({ prompt = '', setPrompt = () => { }, disabled = false, actionDisabled = false, generateHandler = () => { }, placeholder = '', buttonLabel = '', }) => {
|
|
@@ -10,9 +10,9 @@ import { Icon, warning } from '@wordpress/icons';
|
|
|
10
10
|
/**
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
|
-
import { EVENT_PLACEMENT_UPGRADE_PROMPT, EVENT_UPGRADE } from
|
|
14
|
-
import { useCheckout } from
|
|
15
|
-
import useLogoGenerator from
|
|
13
|
+
import { EVENT_PLACEMENT_UPGRADE_PROMPT, EVENT_UPGRADE } from "../constants.js";
|
|
14
|
+
import { useCheckout } from "../hooks/use-checkout.js";
|
|
15
|
+
import useLogoGenerator from "../hooks/use-logo-generator.js";
|
|
16
16
|
import './upgrade-nudge.scss';
|
|
17
17
|
export const UpgradeNudge = () => {
|
|
18
18
|
const { tracks } = useAnalytics();
|
|
@@ -9,8 +9,8 @@ import { __ } from '@wordpress/i18n';
|
|
|
9
9
|
/**
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
|
-
import { EVENT_PLACEMENT_FREE_USER_SCREEN, EVENT_UPGRADE } from
|
|
13
|
-
import useLogoGenerator from
|
|
12
|
+
import { EVENT_PLACEMENT_FREE_USER_SCREEN, EVENT_UPGRADE } from "../constants.js";
|
|
13
|
+
import useLogoGenerator from "../hooks/use-logo-generator.js";
|
|
14
14
|
export const UpgradeScreen = ({ onCancel, upgradeURL, reason }) => {
|
|
15
15
|
const { tracks } = useAnalytics();
|
|
16
16
|
const { recordEvent: recordTracksEvent } = tracks;
|
|
@@ -6,7 +6,7 @@ import { useSelect } from '@wordpress/data';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { STORE_NAME } from
|
|
9
|
+
import { STORE_NAME } from "../store/index.js";
|
|
10
10
|
export const useCheckout = () => {
|
|
11
11
|
const { nextTier, tierPlansEnabled } = useSelect(select => {
|
|
12
12
|
const selectors = select(STORE_NAME);
|
|
@@ -6,7 +6,7 @@ import { __, sprintf } from '@wordpress/i18n';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { STORE_NAME } from
|
|
9
|
+
import { STORE_NAME } from "../store/index.js";
|
|
10
10
|
const useFairUsageNoticeMessage = () => {
|
|
11
11
|
const { usagePeriod } = useSelect(select => {
|
|
12
12
|
const selectors = select(STORE_NAME);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Types
|
|
3
3
|
*/
|
|
4
|
-
import type { ImageStyle, ImageStyleObject } from '../../hooks/use-image-generator/constants.
|
|
5
|
-
import type { Logo, SaveLogo } from '../store/types.
|
|
4
|
+
import type { ImageStyle, ImageStyleObject } from '../../hooks/use-image-generator/constants.ts';
|
|
5
|
+
import type { Logo, SaveLogo } from '../store/types.ts';
|
|
6
6
|
declare const useLogoGenerator: () => {
|
|
7
7
|
logos: Logo[];
|
|
8
8
|
selectedLogoIndex: number;
|
|
@@ -42,7 +42,7 @@ declare const useLogoGenerator: () => {
|
|
|
42
42
|
isSavingLogoToLibrary: boolean;
|
|
43
43
|
isApplyingLogo: boolean;
|
|
44
44
|
isBusy: boolean;
|
|
45
|
-
getAiAssistantFeature: (siteId?: string) => Partial<import("../store/types.
|
|
45
|
+
getAiAssistantFeature: (siteId?: string) => Partial<import("../store/types.ts").AiFeatureProps>;
|
|
46
46
|
requireUpgrade: boolean;
|
|
47
47
|
context: string;
|
|
48
48
|
tierPlansEnabled: boolean;
|
|
@@ -7,14 +7,14 @@ import { useCallback } from 'react';
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
|
-
import askQuestionSync from
|
|
11
|
-
import useImageGenerator from
|
|
12
|
-
import useSaveToMediaLibrary from
|
|
13
|
-
import requestJwt from
|
|
14
|
-
import { stashLogo } from
|
|
15
|
-
import { setSiteLogo } from
|
|
16
|
-
import { STORE_NAME } from
|
|
17
|
-
import useRequestErrors from
|
|
10
|
+
import askQuestionSync from "../../ask-question/sync.js";
|
|
11
|
+
import useImageGenerator from "../../hooks/use-image-generator/index.js";
|
|
12
|
+
import useSaveToMediaLibrary from "../../hooks/use-save-to-media-library/index.js";
|
|
13
|
+
import requestJwt from "../../jwt/index.js";
|
|
14
|
+
import { stashLogo } from "../lib/logo-storage.js";
|
|
15
|
+
import { setSiteLogo } from "../lib/set-site-logo.js";
|
|
16
|
+
import { STORE_NAME } from "../store/index.js";
|
|
17
|
+
import useRequestErrors from "./use-request-errors.js";
|
|
18
18
|
const debug = debugFactory('jetpack-ai-calypso:use-logo-generator');
|
|
19
19
|
const useLogoGenerator = () => {
|
|
20
20
|
const { setSelectedLogoIndex, setIsSavingLogoToLibrary, setIsApplyingLogo, setIsRequestingImage, setIsEnhancingPrompt, increaseAiAssistantRequestsCount, addLogoToHistory, setContext, setIsLoadingHistory, } = useDispatch(STORE_NAME);
|