@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
package/src/icons/index.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/src/index.ts
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Core library exports
|
|
3
3
|
*/
|
|
4
|
-
export { default as requestJwt } from './jwt/index.
|
|
5
|
-
export { default as SuggestionsEventSource } from './suggestions-event-source/index.
|
|
6
|
-
export { default as askQuestion } from './ask-question/index.
|
|
7
|
-
export { default as askQuestionSync } from './ask-question/sync.
|
|
8
|
-
export { default as transcribeAudio } from './audio-transcription/index.
|
|
4
|
+
export { default as requestJwt } from './jwt/index.ts';
|
|
5
|
+
export { default as SuggestionsEventSource } from './suggestions-event-source/index.ts';
|
|
6
|
+
export { default as askQuestion } from './ask-question/index.ts';
|
|
7
|
+
export { default as askQuestionSync } from './ask-question/sync.ts';
|
|
8
|
+
export { default as transcribeAudio } from './audio-transcription/index.ts';
|
|
9
9
|
|
|
10
10
|
/*
|
|
11
11
|
* Hooks
|
|
12
12
|
*/
|
|
13
|
-
export { default as useAICheckout } from './hooks/use-ai-checkout/index.
|
|
14
|
-
export { default as useAiFeature } from './hooks/use-ai-feature/index.
|
|
15
|
-
export { default as useAiSuggestions, getErrorData } from './hooks/use-ai-suggestions/index.
|
|
16
|
-
export { default as useMediaRecording } from './hooks/use-media-recording/index.
|
|
17
|
-
export { default as useAudioTranscription } from './hooks/use-audio-transcription/index.
|
|
18
|
-
export { default as useTranscriptionPostProcessing } from './hooks/use-transcription-post-processing/index.
|
|
19
|
-
export { default as useAudioValidation } from './hooks/use-audio-validation/index.
|
|
20
|
-
export { default as useImageGenerator } from './hooks/use-image-generator/index.
|
|
21
|
-
export { default as usePostContent } from './hooks/use-post-content.
|
|
22
|
-
export * from './hooks/use-image-generator/constants.
|
|
13
|
+
export { default as useAICheckout } from './hooks/use-ai-checkout/index.ts';
|
|
14
|
+
export { default as useAiFeature } from './hooks/use-ai-feature/index.ts';
|
|
15
|
+
export { default as useAiSuggestions, getErrorData } from './hooks/use-ai-suggestions/index.ts';
|
|
16
|
+
export { default as useMediaRecording } from './hooks/use-media-recording/index.ts';
|
|
17
|
+
export { default as useAudioTranscription } from './hooks/use-audio-transcription/index.ts';
|
|
18
|
+
export { default as useTranscriptionPostProcessing } from './hooks/use-transcription-post-processing/index.ts';
|
|
19
|
+
export { default as useAudioValidation } from './hooks/use-audio-validation/index.ts';
|
|
20
|
+
export { default as useImageGenerator } from './hooks/use-image-generator/index.ts';
|
|
21
|
+
export { default as usePostContent } from './hooks/use-post-content.ts';
|
|
22
|
+
export * from './hooks/use-image-generator/constants.ts';
|
|
23
23
|
|
|
24
24
|
/*
|
|
25
25
|
* Components: Icons
|
|
26
26
|
*/
|
|
27
|
-
export * from './icons/index.
|
|
27
|
+
export * from './icons/index.ts';
|
|
28
28
|
|
|
29
29
|
/*
|
|
30
30
|
* Components
|
|
31
31
|
*/
|
|
32
|
-
export * from './components/index.
|
|
32
|
+
export * from './components/index.ts';
|
|
33
33
|
|
|
34
34
|
/*
|
|
35
35
|
* Contexts
|
|
36
36
|
*/
|
|
37
|
-
export * from './data-flow/index.
|
|
37
|
+
export * from './data-flow/index.ts';
|
|
38
38
|
|
|
39
39
|
/*
|
|
40
40
|
* Types
|
|
41
41
|
*/
|
|
42
|
-
export * from './types.
|
|
42
|
+
export * from './types.ts';
|
|
43
43
|
|
|
44
44
|
/*
|
|
45
45
|
* Libs
|
|
46
46
|
*/
|
|
47
|
-
export * from './libs/index.
|
|
47
|
+
export * from './libs/index.ts';
|
|
48
48
|
|
|
49
49
|
/*
|
|
50
50
|
* Constants
|
|
51
51
|
*/
|
|
52
|
-
export * from './constants.
|
|
52
|
+
export * from './constants.ts';
|
|
53
53
|
|
|
54
54
|
/*
|
|
55
55
|
* Logo Generator
|
|
56
56
|
*/
|
|
57
|
-
export * from './logo-generator/index.
|
|
57
|
+
export * from './logo-generator/index.ts';
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* Chrome AI
|
|
61
61
|
*/
|
|
62
|
-
export * from './chrome-ai/index.
|
|
62
|
+
export * from './chrome-ai/index.ts';
|
package/src/jwt/index.ts
CHANGED
package/src/libs/index.ts
CHANGED
|
@@ -4,12 +4,12 @@ export {
|
|
|
4
4
|
renderHTMLFromMarkdown,
|
|
5
5
|
renderMarkdownFromHTML,
|
|
6
6
|
fixes,
|
|
7
|
-
} from './markdown/index.
|
|
7
|
+
} from './markdown/index.ts';
|
|
8
8
|
|
|
9
|
-
export { mapActionToHumanText } from './map-action-to-human-text.
|
|
10
|
-
export { openBlockSidebar } from './open-block-sidebar.
|
|
11
|
-
export { showAiAssistantSection } from './show-ai-assistant-section.
|
|
12
|
-
export { getAllBlocks } from './get-all-blocks.
|
|
13
|
-
export { getBase64Image } from './get-base64-image.
|
|
9
|
+
export { mapActionToHumanText } from './map-action-to-human-text.ts';
|
|
10
|
+
export { openBlockSidebar } from './open-block-sidebar.ts';
|
|
11
|
+
export { showAiAssistantSection } from './show-ai-assistant-section.ts';
|
|
12
|
+
export { getAllBlocks } from './get-all-blocks.ts';
|
|
13
|
+
export { getBase64Image } from './get-base64-image.ts';
|
|
14
14
|
|
|
15
|
-
export type { RenderHTMLRules } from './markdown/index.
|
|
15
|
+
export type { RenderHTMLRules } from './markdown/index.ts';
|
|
@@ -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
|
|
|
11
11
|
const defaultMarkdownConverter = new MarkdownToHTML();
|
|
12
12
|
const defaultHTMLConverter = new HTMLToMarkdown();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Notice } from '@wordpress/components';
|
|
2
|
-
import useFairUsageNoticeMessage from '../hooks/use-fair-usage-notice-message.
|
|
2
|
+
import useFairUsageNoticeMessage from '../hooks/use-fair-usage-notice-message.tsx';
|
|
3
3
|
|
|
4
4
|
type FairUsageNoticeProps = {
|
|
5
5
|
variant?: 'error' | 'muted';
|
|
@@ -11,31 +11,31 @@ import { useState, useEffect, useCallback, useRef } from 'react';
|
|
|
11
11
|
/**
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
|
-
import AiModalFooter from '../../components/ai-modal-footer/index.
|
|
14
|
+
import AiModalFooter from '../../components/ai-modal-footer/index.tsx';
|
|
15
15
|
import {
|
|
16
16
|
DEFAULT_LOGO_COST,
|
|
17
17
|
EVENT_MODAL_OPEN,
|
|
18
18
|
EVENT_FEEDBACK,
|
|
19
19
|
EVENT_MODAL_CLOSE,
|
|
20
20
|
EVENT_GENERATE,
|
|
21
|
-
} from '../constants.
|
|
22
|
-
import { useCheckout } from '../hooks/use-checkout.
|
|
23
|
-
import useLogoGenerator from '../hooks/use-logo-generator.
|
|
24
|
-
import useRequestErrors from '../hooks/use-request-errors.
|
|
25
|
-
import { isLogoHistoryEmpty, clearDeletedMedia } from '../lib/logo-storage.
|
|
26
|
-
import { STORE_NAME } from '../store/index.
|
|
27
|
-
import { FeatureFetchFailureScreen } from './feature-fetch-failure-screen.
|
|
28
|
-
import { FirstLoadScreen } from './first-load-screen.
|
|
29
|
-
import { HistoryCarousel } from './history-carousel.
|
|
30
|
-
import { LogoPresenter } from './logo-presenter.
|
|
31
|
-
import { Prompt } from './prompt.
|
|
32
|
-
import { UpgradeScreen } from './upgrade-screen.
|
|
33
|
-
import { VisitSiteBanner } from './visit-site-banner.
|
|
21
|
+
} from '../constants.ts';
|
|
22
|
+
import { useCheckout } from '../hooks/use-checkout.ts';
|
|
23
|
+
import useLogoGenerator from '../hooks/use-logo-generator.ts';
|
|
24
|
+
import useRequestErrors from '../hooks/use-request-errors.ts';
|
|
25
|
+
import { isLogoHistoryEmpty, clearDeletedMedia } from '../lib/logo-storage.ts';
|
|
26
|
+
import { STORE_NAME } from '../store/index.ts';
|
|
27
|
+
import { FeatureFetchFailureScreen } from './feature-fetch-failure-screen.tsx';
|
|
28
|
+
import { FirstLoadScreen } from './first-load-screen.tsx';
|
|
29
|
+
import { HistoryCarousel } from './history-carousel.tsx';
|
|
30
|
+
import { LogoPresenter } from './logo-presenter.tsx';
|
|
31
|
+
import { Prompt } from './prompt.tsx';
|
|
32
|
+
import { UpgradeScreen } from './upgrade-screen.tsx';
|
|
33
|
+
import { VisitSiteBanner } from './visit-site-banner.tsx';
|
|
34
34
|
import './generator-modal.scss';
|
|
35
35
|
/**
|
|
36
36
|
* Types
|
|
37
37
|
*/
|
|
38
|
-
import type { GeneratorModalProps } from '../types.
|
|
38
|
+
import type { GeneratorModalProps } from '../types.ts';
|
|
39
39
|
import type React from 'react';
|
|
40
40
|
|
|
41
41
|
const debug = debugFactory( 'jetpack-ai-calypso:generator-modal' );
|
|
@@ -8,8 +8,8 @@ import clsx from 'clsx';
|
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
10
|
import loader from '../assets/images/loader.gif';
|
|
11
|
-
import { EVENT_NAVIGATE } from '../constants.
|
|
12
|
-
import useLogoGenerator from '../hooks/use-logo-generator.
|
|
11
|
+
import { EVENT_NAVIGATE } from '../constants.ts';
|
|
12
|
+
import useLogoGenerator from '../hooks/use-logo-generator.ts';
|
|
13
13
|
import './history-carousel.scss';
|
|
14
14
|
/**
|
|
15
15
|
* Types
|
|
@@ -9,22 +9,22 @@ import debugFactory from 'debug';
|
|
|
9
9
|
/**
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
|
-
import AiFeedbackThumbs from '../../components/ai-feedback/index.
|
|
13
|
-
import CheckIcon from '../assets/icons/check.
|
|
14
|
-
import LogoIcon from '../assets/icons/logo.
|
|
15
|
-
import MediaIcon from '../assets/icons/media.
|
|
16
|
-
import { EVENT_SAVE, EVENT_USE } from '../constants.
|
|
17
|
-
import useLogoGenerator from '../hooks/use-logo-generator.
|
|
18
|
-
import useRequestErrors from '../hooks/use-request-errors.
|
|
19
|
-
import { updateLogo } from '../lib/logo-storage.
|
|
20
|
-
import { STORE_NAME } from '../store/index.
|
|
21
|
-
import { ImageLoader } from './image-loader.
|
|
12
|
+
import AiFeedbackThumbs from '../../components/ai-feedback/index.tsx';
|
|
13
|
+
import CheckIcon from '../assets/icons/check.tsx';
|
|
14
|
+
import LogoIcon from '../assets/icons/logo.tsx';
|
|
15
|
+
import MediaIcon from '../assets/icons/media.tsx';
|
|
16
|
+
import { EVENT_SAVE, EVENT_USE } from '../constants.ts';
|
|
17
|
+
import useLogoGenerator from '../hooks/use-logo-generator.ts';
|
|
18
|
+
import useRequestErrors from '../hooks/use-request-errors.ts';
|
|
19
|
+
import { updateLogo } from '../lib/logo-storage.ts';
|
|
20
|
+
import { STORE_NAME } from '../store/index.ts';
|
|
21
|
+
import { ImageLoader } from './image-loader.tsx';
|
|
22
22
|
import './logo-presenter.scss';
|
|
23
23
|
/**
|
|
24
24
|
* Types
|
|
25
25
|
*/
|
|
26
|
-
import type { Logo } from '../store/types.
|
|
27
|
-
import type { LogoPresenterProps } from '../types.
|
|
26
|
+
import type { Logo } from '../store/types.ts';
|
|
27
|
+
import type { LogoPresenterProps } from '../types.ts';
|
|
28
28
|
import type React from 'react';
|
|
29
29
|
|
|
30
30
|
const debug = debugFactory( 'jetpack-ai-calypso:logo-presenter' );
|
|
@@ -10,8 +10,8 @@ import { useCallback, useEffect, useState, useRef, Dispatch, SetStateAction } fr
|
|
|
10
10
|
/**
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
|
-
import { IMAGE_STYLE_NONE, IMAGE_STYLE_AUTO } from '../../hooks/use-image-generator/constants.
|
|
14
|
-
import AiIcon from '../assets/icons/ai.
|
|
13
|
+
import { IMAGE_STYLE_NONE, IMAGE_STYLE_AUTO } from '../../hooks/use-image-generator/constants.ts';
|
|
14
|
+
import AiIcon from '../assets/icons/ai.tsx';
|
|
15
15
|
import {
|
|
16
16
|
EVENT_GENERATE,
|
|
17
17
|
MINIMUM_PROMPT_LENGTH,
|
|
@@ -19,17 +19,17 @@ import {
|
|
|
19
19
|
EVENT_PLACEMENT_INPUT_FOOTER,
|
|
20
20
|
EVENT_SWITCH_STYLE,
|
|
21
21
|
EVENT_GUESS_STYLE,
|
|
22
|
-
} from '../constants.
|
|
23
|
-
import { useCheckout } from '../hooks/use-checkout.
|
|
24
|
-
import useLogoGenerator from '../hooks/use-logo-generator.
|
|
25
|
-
import useRequestErrors from '../hooks/use-request-errors.
|
|
26
|
-
import { FairUsageNotice } from './fair-usage-notice.
|
|
27
|
-
import { UpgradeNudge } from './upgrade-nudge.
|
|
22
|
+
} from '../constants.ts';
|
|
23
|
+
import { useCheckout } from '../hooks/use-checkout.ts';
|
|
24
|
+
import useLogoGenerator from '../hooks/use-logo-generator.ts';
|
|
25
|
+
import useRequestErrors from '../hooks/use-request-errors.ts';
|
|
26
|
+
import { FairUsageNotice } from './fair-usage-notice.tsx';
|
|
27
|
+
import { UpgradeNudge } from './upgrade-nudge.tsx';
|
|
28
28
|
import './prompt.scss';
|
|
29
29
|
/**
|
|
30
30
|
* Types
|
|
31
31
|
*/
|
|
32
|
-
import type { ImageStyle, ImageStyleObject } from '../../hooks/use-image-generator/constants.
|
|
32
|
+
import type { ImageStyle, ImageStyleObject } from '../../hooks/use-image-generator/constants.ts';
|
|
33
33
|
|
|
34
34
|
const debug = debugFactory( 'jetpack-ai-calypso:prompt-box' );
|
|
35
35
|
|
|
@@ -9,9 +9,9 @@ import { Icon, warning } from '@wordpress/icons';
|
|
|
9
9
|
/**
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
|
-
import { EVENT_PLACEMENT_UPGRADE_PROMPT, EVENT_UPGRADE } from '../constants.
|
|
13
|
-
import { useCheckout } from '../hooks/use-checkout.
|
|
14
|
-
import useLogoGenerator from '../hooks/use-logo-generator.
|
|
12
|
+
import { EVENT_PLACEMENT_UPGRADE_PROMPT, EVENT_UPGRADE } from '../constants.ts';
|
|
13
|
+
import { useCheckout } from '../hooks/use-checkout.ts';
|
|
14
|
+
import useLogoGenerator from '../hooks/use-logo-generator.ts';
|
|
15
15
|
import './upgrade-nudge.scss';
|
|
16
16
|
|
|
17
17
|
export const UpgradeNudge = () => {
|
|
@@ -8,8 +8,8 @@ import { __ } from '@wordpress/i18n';
|
|
|
8
8
|
/**
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
|
-
import { EVENT_PLACEMENT_FREE_USER_SCREEN, EVENT_UPGRADE } from '../constants.
|
|
12
|
-
import useLogoGenerator from '../hooks/use-logo-generator.
|
|
11
|
+
import { EVENT_PLACEMENT_FREE_USER_SCREEN, EVENT_UPGRADE } from '../constants.ts';
|
|
12
|
+
import useLogoGenerator from '../hooks/use-logo-generator.ts';
|
|
13
13
|
/**
|
|
14
14
|
* Types
|
|
15
15
|
*/
|
|
@@ -10,11 +10,11 @@ import { useSelect } from '@wordpress/data';
|
|
|
10
10
|
/**
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
|
-
import { STORE_NAME } from '../store/index.
|
|
13
|
+
import { STORE_NAME } from '../store/index.ts';
|
|
14
14
|
/**
|
|
15
15
|
* Types
|
|
16
16
|
*/
|
|
17
|
-
import type { Selectors } from '../store/types.
|
|
17
|
+
import type { Selectors } from '../store/types.ts';
|
|
18
18
|
|
|
19
19
|
export const useCheckout = () => {
|
|
20
20
|
const { nextTier, tierPlansEnabled } = useSelect( select => {
|
|
@@ -5,11 +5,11 @@ import { __, sprintf } from '@wordpress/i18n';
|
|
|
5
5
|
/**
|
|
6
6
|
* Internal dependencies
|
|
7
7
|
*/
|
|
8
|
-
import { STORE_NAME } from '../store/index.
|
|
8
|
+
import { STORE_NAME } from '../store/index.ts';
|
|
9
9
|
/**
|
|
10
10
|
* Types
|
|
11
11
|
*/
|
|
12
|
-
import type { Selectors } from '../store/types.
|
|
12
|
+
import type { Selectors } from '../store/types.ts';
|
|
13
13
|
|
|
14
14
|
const useFairUsageNoticeMessage = (): Element => {
|
|
15
15
|
const { usagePeriod } = useSelect( select => {
|
|
@@ -7,20 +7,20 @@ import { useCallback } from 'react';
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
|
-
import askQuestionSync from '../../ask-question/sync.
|
|
11
|
-
import useImageGenerator from '../../hooks/use-image-generator/index.
|
|
12
|
-
import useSaveToMediaLibrary from '../../hooks/use-save-to-media-library/index.
|
|
13
|
-
import requestJwt from '../../jwt/index.
|
|
14
|
-
import { stashLogo } from '../lib/logo-storage.
|
|
15
|
-
import { setSiteLogo } from '../lib/set-site-logo.
|
|
16
|
-
import { STORE_NAME } from '../store/index.
|
|
17
|
-
import useRequestErrors from './use-request-errors.
|
|
10
|
+
import askQuestionSync from '../../ask-question/sync.ts';
|
|
11
|
+
import useImageGenerator from '../../hooks/use-image-generator/index.ts';
|
|
12
|
+
import useSaveToMediaLibrary from '../../hooks/use-save-to-media-library/index.ts';
|
|
13
|
+
import requestJwt from '../../jwt/index.ts';
|
|
14
|
+
import { stashLogo } from '../lib/logo-storage.ts';
|
|
15
|
+
import { setSiteLogo } from '../lib/set-site-logo.ts';
|
|
16
|
+
import { STORE_NAME } from '../store/index.ts';
|
|
17
|
+
import useRequestErrors from './use-request-errors.ts';
|
|
18
18
|
/**
|
|
19
19
|
* Types
|
|
20
20
|
*/
|
|
21
|
-
import type { ImageStyle, ImageStyleObject } from '../../hooks/use-image-generator/constants.
|
|
22
|
-
import type { RoleType } from '../../types.
|
|
23
|
-
import type { Logo, Selectors, SaveLogo, LogoGeneratorFeatureControl } from '../store/types.
|
|
21
|
+
import type { ImageStyle, ImageStyleObject } from '../../hooks/use-image-generator/constants.ts';
|
|
22
|
+
import type { RoleType } from '../../types.ts';
|
|
23
|
+
import type { Logo, Selectors, SaveLogo, LogoGeneratorFeatureControl } from '../store/types.ts';
|
|
24
24
|
|
|
25
25
|
const debug = debugFactory( 'jetpack-ai-calypso:use-logo-generator' );
|
|
26
26
|
|
|
@@ -5,11 +5,11 @@ import { useDispatch, useSelect } from '@wordpress/data';
|
|
|
5
5
|
/**
|
|
6
6
|
* Internal dependencies
|
|
7
7
|
*/
|
|
8
|
-
import { STORE_NAME } from '../store/index.
|
|
8
|
+
import { STORE_NAME } from '../store/index.ts';
|
|
9
9
|
/**
|
|
10
10
|
* Types
|
|
11
11
|
*/
|
|
12
|
-
import type { Selectors } from '../store/types.
|
|
12
|
+
import type { Selectors } from '../store/types.ts';
|
|
13
13
|
|
|
14
14
|
const useRequestErrors = () => {
|
|
15
15
|
const {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './components/generator-modal.
|
|
2
|
-
export { AiModalPromptInput } from './components/prompt.
|
|
1
|
+
export * from './components/generator-modal.tsx';
|
|
2
|
+
export { AiModalPromptInput } from './components/prompt.tsx';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Types
|
|
3
3
|
*/
|
|
4
|
-
import { Logo } from '../store/types.
|
|
5
|
-
import { RemoveFromStorageProps, SaveToStorageProps, UpdateInStorageProps } from '../types.
|
|
6
|
-
import { mediaExists } from './media-exists.
|
|
4
|
+
import { Logo } from '../store/types.ts';
|
|
5
|
+
import { RemoveFromStorageProps, SaveToStorageProps, UpdateInStorageProps } from '../types.ts';
|
|
6
|
+
import { mediaExists } from './media-exists.ts';
|
|
7
7
|
|
|
8
8
|
const MAX_LOGOS = 10;
|
|
9
9
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import apiFetch from '../../api-fetch/index.
|
|
4
|
+
import apiFetch from '../../api-fetch/index.ts';
|
|
5
5
|
/**
|
|
6
6
|
* Types
|
|
7
7
|
*/
|
|
8
|
-
import type { CheckMediaProps } from '../types.
|
|
8
|
+
import type { CheckMediaProps } from '../types.ts';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Uses the media information to confirm it exists or not on the server.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import wpcomLimitedRequest from './wpcom-limited-request.
|
|
4
|
+
import wpcomLimitedRequest from './wpcom-limited-request.ts';
|
|
5
5
|
/**
|
|
6
6
|
* Types
|
|
7
7
|
*/
|
|
8
|
-
import type { SetSiteLogoProps, SetSiteLogoResponseProps } from '../types.
|
|
8
|
+
import type { SetSiteLogoProps, SetSiteLogoResponseProps } from '../types.ts';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Set the site logo using a backend request.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { getSiteLogoHistory } from '../lib/logo-storage.
|
|
5
|
-
import wpcomLimitedRequest from '../lib/wpcom-limited-request.
|
|
4
|
+
import { getSiteLogoHistory } from '../lib/logo-storage.ts';
|
|
5
|
+
import wpcomLimitedRequest from '../lib/wpcom-limited-request.ts';
|
|
6
6
|
/**
|
|
7
7
|
* Types & Constants
|
|
8
8
|
*/
|
|
@@ -29,14 +29,14 @@ import {
|
|
|
29
29
|
ACTION_SET_SAVE_TO_LIBRARY_ERROR,
|
|
30
30
|
ACTION_SET_CONTEXT,
|
|
31
31
|
ACTION_SET_IS_LOADING_HISTORY,
|
|
32
|
-
} from './constants.
|
|
32
|
+
} from './constants.ts';
|
|
33
33
|
import type {
|
|
34
34
|
AiFeatureProps,
|
|
35
35
|
AiAssistantFeatureEndpointResponseProps,
|
|
36
36
|
Logo,
|
|
37
37
|
RequestError,
|
|
38
|
-
} from './types.
|
|
39
|
-
import type { SiteDetails } from '../types.
|
|
38
|
+
} from './types.ts';
|
|
39
|
+
import type { SiteDetails } from '../types.ts';
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Map the response from the `sites/$site/ai-assistant-feature`
|
|
@@ -5,9 +5,9 @@ import { createReduxStore, register } from '@wordpress/data';
|
|
|
5
5
|
/**
|
|
6
6
|
* Internal dependencies
|
|
7
7
|
*/
|
|
8
|
-
import actions from './actions.
|
|
9
|
-
import reducer from './reducer.
|
|
10
|
-
import selectors from './selectors.
|
|
8
|
+
import actions from './actions.ts';
|
|
9
|
+
import reducer from './reducer.ts';
|
|
10
|
+
import selectors from './selectors.ts';
|
|
11
11
|
|
|
12
12
|
export const STORE_NAME = 'jetpack-ai/logo-generator';
|
|
13
13
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Types & Constants
|
|
3
3
|
*/
|
|
4
|
-
import { ASYNC_REQUEST_COUNTDOWN_INIT_VALUE, FREE_PLAN_REQUESTS_LIMIT } from './constants.
|
|
5
|
-
import { LogoGeneratorStateProp } from './types.
|
|
4
|
+
import { ASYNC_REQUEST_COUNTDOWN_INIT_VALUE, FREE_PLAN_REQUESTS_LIMIT } from './constants.ts';
|
|
5
|
+
import { LogoGeneratorStateProp } from './types.ts';
|
|
6
6
|
|
|
7
7
|
const INITIAL_STATE: LogoGeneratorStateProp = {
|
|
8
8
|
siteDetails: {},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Types & Constants
|
|
3
3
|
*/
|
|
4
|
-
import { DEFAULT_LOGO_COST } from '../constants.
|
|
4
|
+
import { DEFAULT_LOGO_COST } from '../constants.ts';
|
|
5
5
|
import {
|
|
6
6
|
ACTION_INCREASE_AI_ASSISTANT_REQUESTS_COUNT,
|
|
7
7
|
ACTION_REQUEST_AI_ASSISTANT_FEATURE,
|
|
@@ -28,10 +28,10 @@ import {
|
|
|
28
28
|
ACTION_SET_LOGO_UPDATE_ERROR,
|
|
29
29
|
ACTION_SET_CONTEXT,
|
|
30
30
|
ACTION_SET_IS_LOADING_HISTORY,
|
|
31
|
-
} from './constants.
|
|
32
|
-
import INITIAL_STATE from './initial-state.
|
|
33
|
-
import type { AiFeatureStateProps, RequestError, TierLimitProp } from './types.
|
|
34
|
-
import type { SiteDetails } from '../types.
|
|
31
|
+
} from './constants.ts';
|
|
32
|
+
import INITIAL_STATE from './initial-state.ts';
|
|
33
|
+
import type { AiFeatureStateProps, RequestError, TierLimitProp } from './types.ts';
|
|
34
|
+
import type { SiteDetails } from '../types.ts';
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Reducer for the Logo Generator store.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Types
|
|
3
3
|
*/
|
|
4
|
-
import { DEFAULT_LOGO_COST } from '../constants.
|
|
5
|
-
import type { AiFeatureProps, LogoGeneratorStateProp, Logo, RequestError } from './types.
|
|
6
|
-
import type { SiteDetails } from '../types.
|
|
4
|
+
import { DEFAULT_LOGO_COST } from '../constants.ts';
|
|
5
|
+
import type { AiFeatureProps, LogoGeneratorStateProp, Logo, RequestError } from './types.ts';
|
|
6
|
+
import type { SiteDetails } from '../types.ts';
|
|
7
7
|
|
|
8
8
|
const selectors = {
|
|
9
9
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ImageStyleObject } from '../../hooks/use-image-generator/constants.
|
|
2
|
-
import type { SiteDetails } from '../types.
|
|
1
|
+
import type { ImageStyleObject } from '../../hooks/use-image-generator/constants.ts';
|
|
2
|
+
import type { SiteDetails } from '../types.ts';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Types for the AI Assistant feature.
|