@automattic/jetpack-ai-client 0.27.7 → 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 +9 -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 +1 -1
- 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 -2
- package/build/components/ai-image/components/ai-image-modal.js +7 -7
- 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 +5 -5
- 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 -1
- 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-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 +1 -1
- 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 +24 -24
- package/build/logo-generator/store/reducer.js +3 -3
- 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 +5 -5
- 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 +2 -2
- 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-image/components/ai-image-modal.tsx +7 -7
- package/src/components/ai-image/components/carrousel.scss +4 -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-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/quota-exceeded-message/index.tsx +3 -3
- package/src/components/quota-exceeded-message/style.scss +1 -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/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.tsx +15 -15
- package/src/logo-generator/components/history-carousel.tsx +2 -2
- package/src/logo-generator/components/logo-presenter.tsx +12 -12
- 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
|
@@ -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,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
|
|
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' );
|