@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
|
@@ -7,12 +7,12 @@ import React from 'react';
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
|
-
import AiStatusIndicator from '../ai-status-indicator/index.
|
|
10
|
+
import AiStatusIndicator from '../ai-status-indicator/index.tsx';
|
|
11
11
|
import './style.scss';
|
|
12
12
|
/**
|
|
13
13
|
* Types
|
|
14
14
|
*/
|
|
15
|
-
import type { RequestingStateProp } from '../../types.
|
|
15
|
+
import type { RequestingStateProp } from '../../types.ts';
|
|
16
16
|
import type { ReactElement } from 'react';
|
|
17
17
|
|
|
18
18
|
type AIControlProps = {
|
|
@@ -27,7 +27,7 @@ type AIControlProps = {
|
|
|
27
27
|
error?: ReactElement;
|
|
28
28
|
actions?: ReactElement;
|
|
29
29
|
message?: ReactElement;
|
|
30
|
-
promptUserInputRef?:
|
|
30
|
+
promptUserInputRef?: PlainText.Props[ 'ref' ];
|
|
31
31
|
wrapperRef?: React.MutableRefObject< HTMLDivElement | null >;
|
|
32
32
|
};
|
|
33
33
|
|
|
@@ -18,13 +18,13 @@ import React, { forwardRef } from 'react';
|
|
|
18
18
|
/**
|
|
19
19
|
* Internal dependencies
|
|
20
20
|
*/
|
|
21
|
-
import { GuidelineMessage } from '../message/index.
|
|
22
|
-
import AIControl from './ai-control.
|
|
21
|
+
import { GuidelineMessage } from '../message/index.tsx';
|
|
22
|
+
import AIControl from './ai-control.tsx';
|
|
23
23
|
import './style.scss';
|
|
24
24
|
/**
|
|
25
25
|
* Types
|
|
26
26
|
*/
|
|
27
|
-
import type { RequestingStateProp } from '../../types.
|
|
27
|
+
import type { RequestingStateProp } from '../../types.ts';
|
|
28
28
|
import type { ReactElement } from 'react';
|
|
29
29
|
|
|
30
30
|
type BlockAIControlProps = {
|
|
@@ -15,13 +15,13 @@ import {
|
|
|
15
15
|
ErrorMessage,
|
|
16
16
|
UpgradeMessage,
|
|
17
17
|
FairUsageLimitMessage,
|
|
18
|
-
} from '../message/index.
|
|
19
|
-
import AIControl from './ai-control.
|
|
18
|
+
} from '../message/index.tsx';
|
|
19
|
+
import AIControl from './ai-control.tsx';
|
|
20
20
|
import './style.scss';
|
|
21
21
|
/**
|
|
22
22
|
* Types
|
|
23
23
|
*/
|
|
24
|
-
import type { RequestingErrorProps, RequestingStateProp } from '../../types.
|
|
24
|
+
import type { RequestingErrorProps, RequestingStateProp } from '../../types.ts';
|
|
25
25
|
import type { ReactElement, MouseEvent } from 'react';
|
|
26
26
|
|
|
27
27
|
type ExtensionAIControlProps = {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as AIControl } from './ai-control.
|
|
2
|
-
export { default as BlockAIControl } from './block-ai-control.
|
|
3
|
-
export { default as ExtensionAIControl } from './extension-ai-control.
|
|
1
|
+
export { default as AIControl } from './ai-control.tsx';
|
|
2
|
+
export { default as BlockAIControl } from './block-ai-control.tsx';
|
|
3
|
+
export { default as ExtensionAIControl } from './extension-ai-control.tsx';
|
|
@@ -14,13 +14,13 @@ import {
|
|
|
14
14
|
IMAGE_STYLE_AUTO,
|
|
15
15
|
ImageStyleObject,
|
|
16
16
|
ImageStyle,
|
|
17
|
-
} from '../../../hooks/use-image-generator/constants.
|
|
18
|
-
import { AiModalPromptInput } from '../../../logo-generator/index.
|
|
19
|
-
import AiModalFooter from '../../ai-modal-footer/index.
|
|
20
|
-
import AiAssistantModal from '../../modal/index.
|
|
21
|
-
import QuotaExceededMessage from '../../quota-exceeded-message/index.
|
|
22
|
-
import Carrousel, { CarrouselImages } from './carrousel.
|
|
23
|
-
import UsageCounter from './usage-counter.
|
|
17
|
+
} from '../../../hooks/use-image-generator/constants.ts';
|
|
18
|
+
import { AiModalPromptInput } from '../../../logo-generator/index.ts';
|
|
19
|
+
import AiModalFooter from '../../ai-modal-footer/index.tsx';
|
|
20
|
+
import AiAssistantModal from '../../modal/index.tsx';
|
|
21
|
+
import QuotaExceededMessage from '../../quota-exceeded-message/index.tsx';
|
|
22
|
+
import Carrousel, { CarrouselImages } from './carrousel.tsx';
|
|
23
|
+
import UsageCounter from './usage-counter.tsx';
|
|
24
24
|
import './ai-image-modal.scss';
|
|
25
25
|
|
|
26
26
|
type AiImageModalProps = {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
$scale-factor: 0.55;
|
|
2
2
|
|
|
3
3
|
.ai-assistant-image {
|
|
4
|
+
|
|
4
5
|
&__blank {
|
|
5
6
|
display: flex;
|
|
6
7
|
justify-content: center;
|
|
@@ -36,7 +37,7 @@ $scale-factor: 0.55;
|
|
|
36
37
|
|
|
37
38
|
&-message {
|
|
38
39
|
font-size: 10px;
|
|
39
|
-
color:
|
|
40
|
+
color: #f00;
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
|
|
@@ -52,6 +53,7 @@ $scale-factor: 0.55;
|
|
|
52
53
|
height: calc( 768px * $scale-factor );
|
|
53
54
|
|
|
54
55
|
.ai-carrousel {
|
|
56
|
+
|
|
55
57
|
&__prev {
|
|
56
58
|
left: 0;
|
|
57
59
|
}
|
|
@@ -62,15 +64,17 @@ $scale-factor: 0.55;
|
|
|
62
64
|
|
|
63
65
|
&__prev,
|
|
64
66
|
&__next {
|
|
67
|
+
|
|
65
68
|
&:hover {
|
|
66
69
|
background-color: rgba( 0, 0, 0, 0.3 );
|
|
67
70
|
opacity: 1;
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
&-icon {
|
|
71
|
-
fill:
|
|
74
|
+
fill: #fff;
|
|
75
|
+
|
|
72
76
|
&.is-disabled {
|
|
73
|
-
fill:
|
|
77
|
+
fill: #808080;
|
|
74
78
|
}
|
|
75
79
|
}
|
|
76
80
|
|
|
@@ -111,6 +115,7 @@ $scale-factor: 0.55;
|
|
|
111
115
|
padding: 6px 0;
|
|
112
116
|
|
|
113
117
|
.ai-carrousel {
|
|
118
|
+
|
|
114
119
|
&__prev,
|
|
115
120
|
&__next {
|
|
116
121
|
display: flex;
|
|
@@ -122,8 +127,9 @@ $scale-factor: 0.55;
|
|
|
122
127
|
padding: 0;
|
|
123
128
|
|
|
124
129
|
&-icon {
|
|
130
|
+
|
|
125
131
|
&.is-disabled {
|
|
126
|
-
fill:
|
|
132
|
+
fill: #808080;
|
|
127
133
|
}
|
|
128
134
|
}
|
|
129
135
|
}
|
|
@@ -9,8 +9,8 @@ import clsx from 'clsx';
|
|
|
9
9
|
/**
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
|
-
import AiFeedbackThumbs from '../../ai-feedback/index.
|
|
13
|
-
import AiIcon from '../../ai-icon/index.
|
|
12
|
+
import AiFeedbackThumbs from '../../ai-feedback/index.tsx';
|
|
13
|
+
import AiIcon from '../../ai-icon/index.tsx';
|
|
14
14
|
import './carrousel.scss';
|
|
15
15
|
|
|
16
16
|
export type CarrouselImageData = {
|
|
@@ -16,22 +16,22 @@ import debugFactory from 'debug';
|
|
|
16
16
|
* Internal dependencies
|
|
17
17
|
*/
|
|
18
18
|
import './style.scss';
|
|
19
|
-
import { PLACEMENT_JETPACK_SIDEBAR, PLACEMENT_DOCUMENT_SETTINGS } from '../../constants.
|
|
20
|
-
import useAiFeature from '../../hooks/use-ai-feature/index.
|
|
21
|
-
import { ImageStyle } from '../../hooks/use-image-generator/constants.
|
|
22
|
-
import usePostContent from '../../hooks/use-post-content.
|
|
23
|
-
import useSaveToMediaLibrary from '../../hooks/use-save-to-media-library.
|
|
24
|
-
import AiImageModal from './components/ai-image-modal.
|
|
25
|
-
import useAiImage from './hooks/use-ai-image.
|
|
26
|
-
import useSiteType from './hooks/use-site-type.
|
|
19
|
+
import { PLACEMENT_JETPACK_SIDEBAR, PLACEMENT_DOCUMENT_SETTINGS } from '../../constants.ts';
|
|
20
|
+
import useAiFeature from '../../hooks/use-ai-feature/index.ts';
|
|
21
|
+
import { ImageStyle } from '../../hooks/use-image-generator/constants.ts';
|
|
22
|
+
import usePostContent from '../../hooks/use-post-content.ts';
|
|
23
|
+
import useSaveToMediaLibrary from '../../hooks/use-save-to-media-library.ts';
|
|
24
|
+
import AiImageModal from './components/ai-image-modal.tsx';
|
|
25
|
+
import useAiImage from './hooks/use-ai-image.ts';
|
|
26
|
+
import useSiteType from './hooks/use-site-type.ts';
|
|
27
27
|
import {
|
|
28
28
|
FEATURED_IMAGE_FEATURE_NAME,
|
|
29
29
|
IMAGE_GENERATION_MODEL_STABLE_DIFFUSION,
|
|
30
30
|
IMAGE_GENERATION_MODEL_DALL_E_3,
|
|
31
31
|
PLACEMENT_MEDIA_SOURCE_DROPDOWN,
|
|
32
|
-
} from './types.
|
|
33
|
-
import type { ImageResponse } from './hooks/use-ai-image.
|
|
34
|
-
import type { EditorSelectors } from './types.
|
|
32
|
+
} from './types.ts';
|
|
33
|
+
import type { ImageResponse } from './hooks/use-ai-image.ts';
|
|
34
|
+
import type { EditorSelectors } from './types.ts';
|
|
35
35
|
|
|
36
36
|
const debug = debugFactory( 'jetpack-ai-client:featured-image' );
|
|
37
37
|
|
|
@@ -14,17 +14,17 @@ import debugFactory from 'debug';
|
|
|
14
14
|
* Internal dependencies
|
|
15
15
|
*/
|
|
16
16
|
import './style.scss';
|
|
17
|
-
import useAiFeature from '../../hooks/use-ai-feature/index.
|
|
18
|
-
import usePostContent from '../../hooks/use-post-content.
|
|
19
|
-
import useSaveToMediaLibrary from '../../hooks/use-save-to-media-library.
|
|
20
|
-
import AiImageModal from './components/ai-image-modal.
|
|
21
|
-
import useAiImage from './hooks/use-ai-image.
|
|
22
|
-
import useSiteType from './hooks/use-site-type.
|
|
17
|
+
import useAiFeature from '../../hooks/use-ai-feature/index.ts';
|
|
18
|
+
import usePostContent from '../../hooks/use-post-content.ts';
|
|
19
|
+
import useSaveToMediaLibrary from '../../hooks/use-save-to-media-library.ts';
|
|
20
|
+
import AiImageModal from './components/ai-image-modal.tsx';
|
|
21
|
+
import useAiImage from './hooks/use-ai-image.ts';
|
|
22
|
+
import useSiteType from './hooks/use-site-type.ts';
|
|
23
23
|
import {
|
|
24
24
|
IMAGE_GENERATION_MODEL_STABLE_DIFFUSION,
|
|
25
25
|
IMAGE_GENERATION_MODEL_DALL_E_3,
|
|
26
26
|
GENERAL_IMAGE_FEATURE_NAME,
|
|
27
|
-
} from './types.
|
|
27
|
+
} from './types.ts';
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* The type for the callback function that is called when the user selects an image.
|
|
@@ -9,11 +9,11 @@ import React from 'react';
|
|
|
9
9
|
/**
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
|
-
import askQuestionSync from '../../../ask-question/sync.
|
|
13
|
-
import useAiFeature from '../../../hooks/use-ai-feature/index.
|
|
14
|
-
import { ImageStyleObject, ImageStyle } from '../../../hooks/use-image-generator/constants.
|
|
15
|
-
import useImageGenerator from '../../../hooks/use-image-generator/index.
|
|
16
|
-
import useSaveToMediaLibrary from '../../../hooks/use-save-to-media-library.
|
|
12
|
+
import askQuestionSync from '../../../ask-question/sync.ts';
|
|
13
|
+
import useAiFeature from '../../../hooks/use-ai-feature/index.ts';
|
|
14
|
+
import { ImageStyleObject, ImageStyle } from '../../../hooks/use-image-generator/constants.ts';
|
|
15
|
+
import useImageGenerator from '../../../hooks/use-image-generator/index.ts';
|
|
16
|
+
import useSaveToMediaLibrary from '../../../hooks/use-save-to-media-library.ts';
|
|
17
17
|
/**
|
|
18
18
|
* Types
|
|
19
19
|
*/
|
|
@@ -21,9 +21,9 @@ import {
|
|
|
21
21
|
CoreSelectors,
|
|
22
22
|
FEATURED_IMAGE_FEATURE_NAME,
|
|
23
23
|
GENERAL_IMAGE_FEATURE_NAME,
|
|
24
|
-
} from '../types.
|
|
25
|
-
import type { RoleType } from '../../../types.
|
|
26
|
-
import type { CarrouselImageData, CarrouselImages } from '../components/carrousel.
|
|
24
|
+
} from '../types.ts';
|
|
25
|
+
import type { RoleType } from '../../../types.ts';
|
|
26
|
+
import type { CarrouselImageData, CarrouselImages } from '../components/carrousel.tsx';
|
|
27
27
|
import type { FeatureControl } from '@automattic/jetpack-shared-extension-utils/store/wordpress-com/types';
|
|
28
28
|
|
|
29
29
|
type ImageFeatureControl = FeatureControl & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import FeaturedImage from './featured-image.
|
|
2
|
-
import GeneralPurposeImage from './general-purpose-image.
|
|
3
|
-
import { PLACEMENT_MEDIA_SOURCE_DROPDOWN, PLACEMENT_BLOCK_PLACEHOLDER_BUTTON } from './types.
|
|
1
|
+
import FeaturedImage from './featured-image.tsx';
|
|
2
|
+
import GeneralPurposeImage from './general-purpose-image.tsx';
|
|
3
|
+
import { PLACEMENT_MEDIA_SOURCE_DROPDOWN, PLACEMENT_BLOCK_PLACEHOLDER_BUTTON } from './types.ts';
|
|
4
4
|
|
|
5
5
|
export {
|
|
6
6
|
FeaturedImage,
|
|
@@ -6,7 +6,7 @@ import clsx from 'clsx';
|
|
|
6
6
|
/*
|
|
7
7
|
* Types
|
|
8
8
|
*/
|
|
9
|
-
import type { RequestingStateProp } from '../../types.
|
|
9
|
+
import type { RequestingStateProp } from '../../types.ts';
|
|
10
10
|
export type AiStatusIndicatorIconSize = 24 | 32 | 48 | 64;
|
|
11
11
|
import type React from 'react';
|
|
12
12
|
|
package/src/components/index.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
export { AIControl, BlockAIControl, ExtensionAIControl } from './ai-control/index.
|
|
2
|
-
export { default as AiFeedbackThumbs } from './ai-feedback/index.
|
|
3
|
-
export { default as AiIcon, AiSVG } from './ai-icon/index.
|
|
1
|
+
export { AIControl, BlockAIControl, ExtensionAIControl } from './ai-control/index.tsx';
|
|
2
|
+
export { default as AiFeedbackThumbs } from './ai-feedback/index.tsx';
|
|
3
|
+
export { default as AiIcon, AiSVG } from './ai-icon/index.tsx';
|
|
4
4
|
export {
|
|
5
5
|
FeaturedImage,
|
|
6
6
|
GeneralPurposeImage,
|
|
7
7
|
PLACEMENT_MEDIA_SOURCE_DROPDOWN,
|
|
8
8
|
PLACEMENT_BLOCK_PLACEHOLDER_BUTTON,
|
|
9
|
-
} from './ai-image/index.
|
|
10
|
-
export { default as AiStatusIndicator } from './ai-status-indicator/index.
|
|
11
|
-
export { default as AudioDurationDisplay } from './audio-duration-display/index.
|
|
12
|
-
export { default as AiModalFooter } from './ai-modal-footer/index.
|
|
9
|
+
} from './ai-image/index.ts';
|
|
10
|
+
export { default as AiStatusIndicator } from './ai-status-indicator/index.tsx';
|
|
11
|
+
export { default as AudioDurationDisplay } from './audio-duration-display/index.tsx';
|
|
12
|
+
export { default as AiModalFooter } from './ai-modal-footer/index.tsx';
|
|
13
13
|
export {
|
|
14
14
|
GuidelineMessage,
|
|
15
15
|
UpgradeMessage,
|
|
16
16
|
ErrorMessage,
|
|
17
17
|
default as FooterMessage,
|
|
18
|
-
} from './message/index.
|
|
19
|
-
export { default as AiAssistantModal } from './modal/index.
|
|
18
|
+
} from './message/index.tsx';
|
|
19
|
+
export { default as AiAssistantModal } from './modal/index.tsx';
|
|
20
20
|
export {
|
|
21
21
|
default as QuotaExceededMessage,
|
|
22
22
|
FairUsageNotice,
|
|
23
|
-
} from './quota-exceeded-message/index.
|
|
23
|
+
} from './quota-exceeded-message/index.tsx';
|
|
@@ -10,13 +10,13 @@ import clsx from 'clsx';
|
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
12
|
import './style.scss';
|
|
13
|
-
import errorExclamation from '../../icons/error-exclamation.
|
|
14
|
-
import { ERROR_QUOTA_EXCEEDED } from '../../types.
|
|
15
|
-
import AiFeedbackThumbs from '../ai-feedback/index.
|
|
13
|
+
import errorExclamation from '../../icons/error-exclamation.tsx';
|
|
14
|
+
import { ERROR_QUOTA_EXCEEDED } from '../../types.ts';
|
|
15
|
+
import AiFeedbackThumbs from '../ai-feedback/index.tsx';
|
|
16
16
|
/**
|
|
17
17
|
* Types
|
|
18
18
|
*/
|
|
19
|
-
import type { SuggestionErrorCode } from '../../types.
|
|
19
|
+
import type { SuggestionErrorCode } from '../../types.ts';
|
|
20
20
|
import type React from 'react';
|
|
21
21
|
|
|
22
22
|
export const MESSAGE_SEVERITY_WARNING = 'warning';
|
|
@@ -7,8 +7,8 @@ import { close } from '@wordpress/icons';
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
|
-
import AiStatusIndicator from '../ai-status-indicator/index.
|
|
11
|
-
import type { RequestingStateProp } from '../../types.
|
|
10
|
+
import AiStatusIndicator from '../ai-status-indicator/index.tsx';
|
|
11
|
+
import type { RequestingStateProp } from '../../types.ts';
|
|
12
12
|
import './style.scss';
|
|
13
13
|
|
|
14
14
|
const ModalHeader = ( {
|
|
@@ -11,9 +11,9 @@ import debugFactory from 'debug';
|
|
|
11
11
|
/*
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
|
-
import useAICheckout from '../../hooks/use-ai-checkout/index.
|
|
15
|
-
import useAiFeature from '../../hooks/use-ai-feature/index.
|
|
16
|
-
import { LightNudge } from './light-nudge.
|
|
14
|
+
import useAICheckout from '../../hooks/use-ai-checkout/index.ts';
|
|
15
|
+
import useAiFeature from '../../hooks/use-ai-feature/index.ts';
|
|
16
|
+
import { LightNudge } from './light-nudge.tsx';
|
|
17
17
|
import type { ReactElement } from 'react';
|
|
18
18
|
import './style.scss';
|
|
19
19
|
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.jetpack-upgrade-plan-banner.jetpack-ai-upgrade-banner {
|
|
8
|
+
|
|
8
9
|
.jetpack-upgrade-plan-banner__wrapper {
|
|
10
|
+
|
|
9
11
|
.components-button.is-primary.is-busy {
|
|
10
12
|
background: var( --jp-white );
|
|
11
13
|
color: var( --jp-black );
|
|
@@ -18,7 +20,7 @@
|
|
|
18
20
|
margin: 0px;
|
|
19
21
|
text-wrap: pretty;
|
|
20
22
|
font-size: calc(13px);
|
|
21
|
-
font-weight:
|
|
23
|
+
font-weight: 400;
|
|
22
24
|
color: #757575;
|
|
23
25
|
|
|
24
26
|
a {
|
|
@@ -5,10 +5,10 @@ import React, { createContext } from 'react';
|
|
|
5
5
|
/**
|
|
6
6
|
* Types & Constants
|
|
7
7
|
*/
|
|
8
|
-
import SuggestionsEventSource from '../suggestions-event-source/index.
|
|
9
|
-
import type { AskQuestionOptionsArgProps } from '../ask-question/index.
|
|
10
|
-
import type { RequestingErrorProps } from '../hooks/use-ai-suggestions/index.
|
|
11
|
-
import type { PromptProp, RequestingStateProp } from '../types.
|
|
8
|
+
import SuggestionsEventSource from '../suggestions-event-source/index.ts';
|
|
9
|
+
import type { AskQuestionOptionsArgProps } from '../ask-question/index.ts';
|
|
10
|
+
import type { RequestingErrorProps } from '../hooks/use-ai-suggestions/index.ts';
|
|
11
|
+
import type { PromptProp, RequestingStateProp } from '../types.ts';
|
|
12
12
|
|
|
13
13
|
export type AiDataContextProps = {
|
|
14
14
|
/*
|
package/src/data-flow/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AiDataContext, AiDataContextProvider } from './context.
|
|
2
|
-
export { default as withAiDataProvider } from './with-ai-assistant-data.
|
|
3
|
-
export { default as useAiContext } from './use-ai-context.
|
|
1
|
+
export { AiDataContext, AiDataContextProvider } from './context.tsx';
|
|
2
|
+
export { default as withAiDataProvider } from './with-ai-assistant-data.tsx';
|
|
3
|
+
export { default as useAiContext } from './use-ai-context.ts';
|
|
@@ -5,13 +5,13 @@ import { useCallback, useContext, useEffect } from 'react';
|
|
|
5
5
|
/**
|
|
6
6
|
* Internal dependencies
|
|
7
7
|
*/
|
|
8
|
-
import { ERROR_RESPONSE, RequestingErrorProps } from '../types.
|
|
9
|
-
import { AiDataContext } from './index.
|
|
8
|
+
import { ERROR_RESPONSE, RequestingErrorProps } from '../types.ts';
|
|
9
|
+
import { AiDataContext } from './index.ts';
|
|
10
10
|
/**
|
|
11
11
|
* Types & constants
|
|
12
12
|
*/
|
|
13
|
-
import type { AiDataContextProps } from './context.
|
|
14
|
-
import type { AskQuestionOptionsArgProps } from '../ask-question/index.
|
|
13
|
+
import type { AiDataContextProps } from './context.tsx';
|
|
14
|
+
import type { AskQuestionOptionsArgProps } from '../ask-question/index.ts';
|
|
15
15
|
|
|
16
16
|
export type UseAiContextOptions = {
|
|
17
17
|
/*
|
|
@@ -7,8 +7,8 @@ import React from 'react';
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal Dependencies
|
|
9
9
|
*/
|
|
10
|
-
import useAiSuggestions from '../hooks/use-ai-suggestions/index.
|
|
11
|
-
import { AiDataContextProvider } from './index.
|
|
10
|
+
import useAiSuggestions from '../hooks/use-ai-suggestions/index.ts';
|
|
11
|
+
import { AiDataContextProvider } from './index.ts';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* High Order Component that provides the
|
|
@@ -6,8 +6,8 @@ import { __ } from '@wordpress/i18n';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import askQuestion from '../../ask-question/index.
|
|
10
|
-
import ChromeAIFactory from '../../chrome-ai/factory.
|
|
9
|
+
import askQuestion from '../../ask-question/index.ts';
|
|
10
|
+
import ChromeAIFactory from '../../chrome-ai/factory.ts';
|
|
11
11
|
import {
|
|
12
12
|
ERROR_CONTEXT_TOO_LARGE,
|
|
13
13
|
ERROR_MODERATION,
|
|
@@ -16,13 +16,13 @@ import {
|
|
|
16
16
|
ERROR_SERVICE_UNAVAILABLE,
|
|
17
17
|
ERROR_UNCLEAR_PROMPT,
|
|
18
18
|
ERROR_RESPONSE,
|
|
19
|
-
} from '../../types.
|
|
19
|
+
} from '../../types.ts';
|
|
20
20
|
/**
|
|
21
21
|
* Types & constants
|
|
22
22
|
*/
|
|
23
|
-
import type { AskQuestionOptionsArgProps } from '../../ask-question/index.
|
|
24
|
-
import type SuggestionsEventSource from '../../suggestions-event-source/index.
|
|
25
|
-
import type { PromptProp, SuggestionErrorCode, RequestingStateProp } from '../../types.
|
|
23
|
+
import type { AskQuestionOptionsArgProps } from '../../ask-question/index.ts';
|
|
24
|
+
import type SuggestionsEventSource from '../../suggestions-event-source/index.ts';
|
|
25
|
+
import type { PromptProp, SuggestionErrorCode, RequestingStateProp } from '../../types.ts';
|
|
26
26
|
|
|
27
27
|
export type RequestingErrorProps = {
|
|
28
28
|
/*
|
|
@@ -7,7 +7,7 @@ import debugFactory from 'debug';
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
|
-
import transcribeAudio from '../../audio-transcription/index.
|
|
10
|
+
import transcribeAudio from '../../audio-transcription/index.ts';
|
|
11
11
|
|
|
12
12
|
const debug = debugFactory( 'jetpack-ai-client:use-audio-transcription' );
|
|
13
13
|
|
|
@@ -5,8 +5,8 @@ import debugFactory from 'debug';
|
|
|
5
5
|
/**
|
|
6
6
|
* Internal dependencies
|
|
7
7
|
*/
|
|
8
|
-
import askQuestionSync from '../../ask-question/sync.
|
|
9
|
-
import requestJwt from '../../jwt/index.
|
|
8
|
+
import askQuestionSync from '../../ask-question/sync.ts';
|
|
9
|
+
import requestJwt from '../../jwt/index.ts';
|
|
10
10
|
|
|
11
11
|
const debug = debugFactory( 'ai-client:use-image-generator' );
|
|
12
12
|
|
|
@@ -263,4 +263,4 @@ const useImageGenerator = () => {
|
|
|
263
263
|
};
|
|
264
264
|
|
|
265
265
|
export default useImageGenerator;
|
|
266
|
-
export * from './constants.
|
|
266
|
+
export * from './constants.ts';
|
|
@@ -6,8 +6,8 @@ import debugFactory from 'debug';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import useAiSuggestions, { RequestingErrorProps } from '../use-ai-suggestions/index.
|
|
10
|
-
import type { PromptProp } from '../../types.
|
|
9
|
+
import useAiSuggestions, { RequestingErrorProps } from '../use-ai-suggestions/index.ts';
|
|
10
|
+
import type { PromptProp } from '../../types.ts';
|
|
11
11
|
|
|
12
12
|
const debug = debugFactory( 'jetpack-ai-client:use-transcription-post-processing' );
|
|
13
13
|
|