@automattic/jetpack-ai-client 0.34.4 → 0.34.6
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 +10 -0
- package/build/{ask-question → src/ask-question}/index.d.ts +1 -1
- package/build/{ask-question → src/ask-question}/index.js +1 -1
- package/build/{ask-question → src/ask-question}/sync.js +1 -1
- package/build/{audio-transcription → src/audio-transcription}/index.js +1 -1
- package/build/{components → src/components}/ai-control/ai-control.d.ts +1 -1
- package/build/{components → src/components}/ai-control/ai-control.js +4 -2
- package/build/{components → src/components}/ai-control/block-ai-control.d.ts +1 -1
- package/build/{components → src/components}/ai-control/block-ai-control.js +7 -4
- package/build/{components → src/components}/ai-control/extension-ai-control.d.ts +1 -1
- package/build/{components → src/components}/ai-control/extension-ai-control.js +6 -4
- package/build/src/components/ai-control/index.js +3 -0
- package/build/{components → src/components}/ai-feedback/index.d.ts +1 -1
- package/build/{components → src/components}/ai-feedback/index.js +4 -2
- package/build/src/components/ai-icon/index.js +17 -0
- package/build/{components → src/components}/ai-image/components/ai-image-modal.d.ts +1 -1
- package/build/{components → src/components}/ai-image/components/ai-image-modal.js +14 -9
- package/build/{components → src/components}/ai-image/components/carrousel.d.ts +1 -1
- package/build/{components → src/components}/ai-image/components/carrousel.js +15 -7
- package/build/{components → src/components}/ai-image/components/usage-counter.js +3 -1
- package/build/{components → src/components}/ai-image/featured-image.d.ts +1 -1
- package/build/{components → src/components}/ai-image/featured-image.js +13 -10
- package/build/{components → src/components}/ai-image/general-purpose-image.d.ts +1 -1
- package/build/{components → src/components}/ai-image/general-purpose-image.js +7 -7
- package/build/{components → src/components}/ai-image/hooks/use-ai-image.d.ts +2 -2
- package/build/{components → src/components}/ai-image/hooks/use-ai-image.js +5 -5
- package/build/{components → src/components}/ai-image/index.js +3 -3
- package/build/{components → src/components}/ai-modal-footer/index.d.ts +1 -1
- package/build/src/components/ai-modal-footer/index.js +31 -0
- package/build/{components → src/components}/audio-duration-display/index.d.ts +1 -1
- package/build/{components → src/components}/audio-duration-display/index.js +1 -1
- package/build/src/components/index.js +10 -0
- package/build/{components → src/components}/message/index.d.ts +4 -4
- package/build/{components → src/components}/message/index.js +12 -7
- package/build/{components → src/components}/modal/index.d.ts +1 -1
- package/build/{components → src/components}/modal/index.js +8 -3
- package/build/{components → src/components}/quota-exceeded-message/index.js +3 -3
- package/build/{data-flow → src/data-flow}/context.d.ts +1 -1
- package/build/src/data-flow/index.js +3 -0
- package/build/{data-flow → src/data-flow}/use-ai-context.d.ts +1 -1
- package/build/{data-flow → src/data-flow}/use-ai-context.js +2 -2
- package/build/{data-flow → src/data-flow}/with-ai-assistant-data.js +2 -2
- package/build/{hooks → src/hooks}/use-ai-checkout/index.js +1 -1
- package/build/{hooks → src/hooks}/use-ai-feature/index.d.ts +8 -8
- package/build/{hooks → src/hooks}/use-ai-suggestions/index.d.ts +1 -1
- package/build/{hooks → src/hooks}/use-ai-suggestions/index.js +2 -2
- package/build/{hooks → src/hooks}/use-audio-transcription/index.d.ts +1 -1
- package/build/{hooks → src/hooks}/use-audio-transcription/index.js +1 -1
- package/build/{hooks → src/hooks}/use-image-generator/index.d.ts +1 -1
- package/build/{hooks → src/hooks}/use-image-generator/index.js +3 -3
- package/build/{hooks → src/hooks}/use-media-recording/index.d.ts +1 -1
- package/build/{hooks → src/hooks}/use-post-content.js +1 -1
- package/build/{hooks → src/hooks}/use-transcription-post-processing/index.d.ts +1 -1
- package/build/{hooks → src/hooks}/use-transcription-post-processing/index.js +1 -1
- package/build/src/icons/ai-assistant.js +9 -0
- package/build/src/icons/error-exclamation.js +9 -0
- package/build/src/icons/index.js +7 -0
- package/build/src/icons/mic.js +9 -0
- package/build/src/icons/origami-plane.js +9 -0
- package/build/src/icons/player-pause.js +9 -0
- package/build/src/icons/player-play.js +9 -0
- package/build/src/icons/player-stop.js +9 -0
- package/build/src/icons/speak-tone.js +9 -0
- package/build/src/index.js +49 -0
- package/build/{jwt → src/jwt}/index.d.ts +1 -1
- package/build/{jwt → src/jwt}/index.js +1 -1
- package/build/{libs → src/libs}/get-all-blocks.d.ts +1 -1
- package/build/src/libs/index.js +6 -0
- package/build/{libs → src/libs}/map-action-to-human-text.js +1 -1
- package/build/{libs → src/libs}/markdown/html-to-markdown.d.ts +1 -1
- package/build/{libs → src/libs}/markdown/index.js +2 -2
- package/build/{libs → src/libs}/markdown/markdown-to-html.d.ts +1 -1
- package/build/src/logo-generator/assets/icons/ai.js +10 -0
- package/build/src/logo-generator/assets/icons/media.js +10 -0
- package/build/{logo-generator → src/logo-generator}/components/fair-usage-notice.js +1 -1
- package/build/src/logo-generator/components/feature-fetch-failure-screen.js +14 -0
- package/build/{logo-generator → src/logo-generator}/components/first-load-screen.js +4 -2
- package/build/{logo-generator → src/logo-generator}/components/generator-modal.js +20 -16
- package/build/{logo-generator → src/logo-generator}/components/history-carousel.js +2 -2
- package/build/{logo-generator → src/logo-generator}/components/logo-presenter.js +42 -19
- package/build/{logo-generator → src/logo-generator}/components/prompt.js +24 -13
- package/build/{logo-generator → src/logo-generator}/components/upgrade-nudge.js +8 -4
- package/build/{logo-generator → src/logo-generator}/components/upgrade-screen.js +11 -3
- package/build/src/logo-generator/components/visit-site-banner.js +22 -0
- package/build/{logo-generator → src/logo-generator}/hooks/use-checkout.js +1 -1
- package/build/{logo-generator → src/logo-generator}/hooks/use-fair-usage-notice-message.js +1 -1
- package/build/{logo-generator → src/logo-generator}/hooks/use-logo-generator.d.ts +5 -5
- package/build/{logo-generator → src/logo-generator}/hooks/use-logo-generator.js +9 -9
- package/build/{logo-generator → src/logo-generator}/hooks/use-request-errors.js +1 -1
- package/build/src/logo-generator/index.js +2 -0
- package/build/{logo-generator → src/logo-generator}/lib/logo-storage.d.ts +1 -1
- package/build/{logo-generator → src/logo-generator}/lib/logo-storage.js +1 -1
- package/build/{logo-generator → src/logo-generator}/lib/media-exists.js +1 -1
- package/build/{logo-generator → src/logo-generator}/lib/set-site-logo.js +1 -1
- package/build/{logo-generator → src/logo-generator}/lib/wpcom-limited-request.js +1 -1
- package/build/{logo-generator → src/logo-generator}/store/actions.js +3 -3
- package/build/{logo-generator → src/logo-generator}/store/index.js +3 -3
- package/build/{logo-generator → src/logo-generator}/store/initial-state.js +1 -1
- package/build/{logo-generator → src/logo-generator}/store/reducer.d.ts +94 -94
- package/build/{logo-generator → src/logo-generator}/store/reducer.js +3 -3
- package/build/{logo-generator → src/logo-generator}/store/selectors.d.ts +3 -3
- package/build/{logo-generator → src/logo-generator}/store/selectors.js +1 -1
- package/build/{suggestions-event-source → src/suggestions-event-source}/index.d.ts +1 -1
- package/build/{suggestions-event-source → src/suggestions-event-source}/index.js +4 -4
- package/build/{types.js → src/types.js} +1 -1
- package/package.json +10 -10
- package/build/components/ai-control/index.js +0 -3
- package/build/components/ai-icon/index.js +0 -13
- package/build/components/ai-modal-footer/index.js +0 -27
- package/build/components/index.js +0 -10
- package/build/data-flow/index.js +0 -3
- package/build/icons/ai-assistant.js +0 -7
- package/build/icons/error-exclamation.js +0 -7
- package/build/icons/index.js +0 -7
- package/build/icons/mic.js +0 -7
- package/build/icons/origami-plane.js +0 -7
- package/build/icons/player-pause.js +0 -7
- package/build/icons/player-play.js +0 -7
- package/build/icons/player-stop.js +0 -7
- package/build/icons/speak-tone.js +0 -7
- package/build/index.js +0 -49
- package/build/libs/index.js +0 -6
- package/build/logo-generator/assets/icons/ai.js +0 -8
- package/build/logo-generator/assets/icons/media.js +0 -8
- package/build/logo-generator/components/feature-fetch-failure-screen.js +0 -11
- package/build/logo-generator/components/visit-site-banner.js +0 -16
- package/build/logo-generator/index.js +0 -2
- package/build/{api-fetch → src/api-fetch}/index.d.ts +0 -0
- package/build/{api-fetch → src/api-fetch}/index.js +0 -0
- package/build/{ask-question → src/ask-question}/sync.d.ts +0 -0
- package/build/{audio-transcription → src/audio-transcription}/index.d.ts +0 -0
- package/build/{components → src/components}/ai-control/index.d.ts +0 -0
- package/build/{components → src/components}/ai-icon/index.d.ts +0 -0
- package/build/{components → src/components}/ai-image/components/usage-counter.d.ts +0 -0
- package/build/{components → src/components}/ai-image/hooks/use-site-type.d.ts +0 -0
- package/build/{components → src/components}/ai-image/hooks/use-site-type.js +0 -0
- package/build/{components → src/components}/ai-image/index.d.ts +0 -0
- package/build/{components → src/components}/ai-image/types.d.ts +0 -0
- package/build/{components → src/components}/ai-image/types.js +0 -0
- package/build/{components → src/components}/ai-status-indicator/index.d.ts +0 -0
- package/build/{components → src/components}/ai-status-indicator/index.js +0 -0
- package/build/{components → src/components}/audio-duration-display/lib/media.d.ts +0 -0
- package/build/{components → src/components}/audio-duration-display/lib/media.js +0 -0
- package/build/{components → src/components}/index.d.ts +0 -0
- package/build/{components → src/components}/quota-exceeded-message/index.d.ts +0 -0
- package/build/{components → src/components}/quota-exceeded-message/light-nudge.d.ts +2 -2
- /package/build/{components → src/components}/quota-exceeded-message/light-nudge.js +0 -0
- /package/build/{constants.d.ts → src/constants.d.ts} +0 -0
- /package/build/{constants.js → src/constants.js} +0 -0
- /package/build/{data-flow → src/data-flow}/context.js +0 -0
- /package/build/{data-flow → src/data-flow}/index.d.ts +0 -0
- /package/build/{data-flow → src/data-flow}/with-ai-assistant-data.d.ts +0 -0
- /package/build/{hooks → src/hooks}/use-ai-checkout/index.d.ts +0 -0
- /package/build/{hooks → src/hooks}/use-ai-feature/index.js +0 -0
- /package/build/{hooks → src/hooks}/use-audio-validation/index.d.ts +0 -0
- /package/build/{hooks → src/hooks}/use-audio-validation/index.js +0 -0
- /package/build/{hooks → src/hooks}/use-image-generator/constants.d.ts +0 -0
- /package/build/{hooks → src/hooks}/use-image-generator/constants.js +0 -0
- /package/build/{hooks → src/hooks}/use-media-recording/index.js +0 -0
- /package/build/{hooks → src/hooks}/use-post-content.d.ts +0 -0
- /package/build/{hooks → src/hooks}/use-save-to-media-library/index.d.ts +0 -0
- /package/build/{hooks → src/hooks}/use-save-to-media-library/index.js +0 -0
- /package/build/{hooks → src/hooks}/use-save-to-media-library.d.ts +0 -0
- /package/build/{hooks → src/hooks}/use-save-to-media-library.js +0 -0
- /package/build/{icons → src/icons}/ai-assistant.d.ts +0 -0
- /package/build/{icons → src/icons}/error-exclamation.d.ts +0 -0
- /package/build/{icons → src/icons}/index.d.ts +0 -0
- /package/build/{icons → src/icons}/mic.d.ts +0 -0
- /package/build/{icons → src/icons}/origami-plane.d.ts +0 -0
- /package/build/{icons → src/icons}/player-pause.d.ts +0 -0
- /package/build/{icons → src/icons}/player-play.d.ts +0 -0
- /package/build/{icons → src/icons}/player-stop.d.ts +0 -0
- /package/build/{icons → src/icons}/speak-tone.d.ts +0 -0
- /package/build/{index.d.ts → src/index.d.ts} +0 -0
- /package/build/{libs → src/libs}/get-all-blocks.js +0 -0
- /package/build/{libs → src/libs}/get-base64-image.d.ts +0 -0
- /package/build/{libs → src/libs}/get-base64-image.js +0 -0
- /package/build/{libs → src/libs}/index.d.ts +0 -0
- /package/build/{libs → src/libs}/map-action-to-human-text.d.ts +0 -0
- /package/build/{libs → src/libs}/markdown/html-to-markdown.js +0 -0
- /package/build/{libs → src/libs}/markdown/index.d.ts +0 -0
- /package/build/{libs → src/libs}/markdown/markdown-to-html.js +0 -0
- /package/build/{libs → src/libs}/open-block-sidebar.d.ts +0 -0
- /package/build/{libs → src/libs}/open-block-sidebar.js +0 -0
- /package/build/{libs → src/libs}/show-ai-assistant-section.d.ts +0 -0
- /package/build/{libs → src/libs}/show-ai-assistant-section.js +0 -0
- /package/build/{logo-generator → src/logo-generator}/assets/icons/ai.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/assets/icons/check.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/assets/icons/check.js +0 -0
- /package/build/{logo-generator → src/logo-generator}/assets/icons/logo.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/assets/icons/logo.js +0 -0
- /package/build/{logo-generator → src/logo-generator}/assets/icons/media.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/components/fair-usage-notice.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/components/feature-fetch-failure-screen.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/components/first-load-screen.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/components/generator-modal.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/components/history-carousel.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/components/image-loader.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/components/image-loader.js +0 -0
- /package/build/{logo-generator → src/logo-generator}/components/logo-presenter.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/components/prompt.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/components/upgrade-nudge.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/components/upgrade-screen.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/components/visit-site-banner.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/constants.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/constants.js +0 -0
- /package/build/{logo-generator → src/logo-generator}/hooks/use-checkout.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/hooks/use-fair-usage-notice-message.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/hooks/use-request-errors.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/index.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/lib/media-exists.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/lib/set-site-logo.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/lib/wpcom-limited-request.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/store/actions.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/store/constants.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/store/constants.js +0 -0
- /package/build/{logo-generator → src/logo-generator}/store/index.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/store/initial-state.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/store/types.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/store/types.js +0 -0
- /package/build/{logo-generator → src/logo-generator}/types.d.ts +0 -0
- /package/build/{logo-generator → src/logo-generator}/types.js +0 -0
- /package/build/{types.d.ts → src/types.d.ts} +0 -0
|
@@ -54,28 +54,35 @@ export default function reducer(state: import("./types.ts").LogoGeneratorStatePr
|
|
|
54
54
|
context?: string;
|
|
55
55
|
isLoadingHistory?: boolean;
|
|
56
56
|
}): {
|
|
57
|
+
_meta?: {
|
|
58
|
+
isSavingLogoToLibrary: boolean;
|
|
59
|
+
isApplyingLogo: boolean;
|
|
60
|
+
isRequestingImage: boolean;
|
|
61
|
+
isEnhancingPrompt: boolean;
|
|
62
|
+
featureFetchError?: RequestError;
|
|
63
|
+
firstLogoPromptFetchError?: RequestError;
|
|
64
|
+
enhancePromptFetchError?: RequestError;
|
|
65
|
+
logoFetchError?: RequestError;
|
|
66
|
+
saveToLibraryError?: RequestError;
|
|
67
|
+
logoUpdateError?: RequestError;
|
|
68
|
+
context: string;
|
|
69
|
+
isLoadingHistory: boolean;
|
|
70
|
+
};
|
|
71
|
+
siteDetails?: Record<string, never> | SiteDetails;
|
|
72
|
+
history: import("./types.ts").Logo[];
|
|
73
|
+
selectedLogoIndex: number;
|
|
57
74
|
features: {
|
|
58
75
|
aiAssistantFeature: {
|
|
59
|
-
isOverLimit: boolean;
|
|
60
|
-
requestsCount: number;
|
|
61
|
-
requireUpgrade: boolean;
|
|
62
|
-
usagePeriod: {
|
|
63
|
-
currentStart: string;
|
|
64
|
-
nextStart: string;
|
|
65
|
-
requestsCount: number;
|
|
66
|
-
} | {
|
|
67
|
-
requestsCount: number;
|
|
68
|
-
};
|
|
69
76
|
hasFeature: boolean;
|
|
70
77
|
requestsLimit: number;
|
|
71
78
|
errorMessage?: string;
|
|
72
79
|
errorCode?: string;
|
|
73
80
|
upgradeType: import("./types.ts").UpgradeTypeProp;
|
|
74
81
|
currentTier?: import("./types.ts").TierProp;
|
|
75
|
-
nextTier?: import("./types.ts").TierProp
|
|
82
|
+
nextTier?: import("./types.ts").TierProp;
|
|
76
83
|
tierPlansEnabled?: boolean;
|
|
77
84
|
costs?: {
|
|
78
|
-
|
|
85
|
+
'jetpack-ai-logo-generator': {
|
|
79
86
|
logo: number;
|
|
80
87
|
};
|
|
81
88
|
};
|
|
@@ -86,8 +93,19 @@ export default function reducer(state: import("./types.ts").LogoGeneratorStatePr
|
|
|
86
93
|
asyncRequestTimerId: number;
|
|
87
94
|
isRequestingImage: boolean;
|
|
88
95
|
};
|
|
96
|
+
isOverLimit: boolean;
|
|
97
|
+
requestsCount: number;
|
|
98
|
+
requireUpgrade: boolean;
|
|
99
|
+
usagePeriod: {
|
|
100
|
+
currentStart: string;
|
|
101
|
+
nextStart: string;
|
|
102
|
+
requestsCount: number;
|
|
103
|
+
} | {
|
|
104
|
+
requestsCount: number;
|
|
105
|
+
};
|
|
89
106
|
};
|
|
90
107
|
};
|
|
108
|
+
} | {
|
|
91
109
|
_meta?: {
|
|
92
110
|
isSavingLogoToLibrary: boolean;
|
|
93
111
|
isApplyingLogo: boolean;
|
|
@@ -102,36 +120,23 @@ export default function reducer(state: import("./types.ts").LogoGeneratorStatePr
|
|
|
102
120
|
context: string;
|
|
103
121
|
isLoadingHistory: boolean;
|
|
104
122
|
};
|
|
105
|
-
siteDetails?:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
123
|
+
siteDetails?: Record<string, never> | SiteDetails;
|
|
124
|
+
features: {
|
|
125
|
+
aiAssistantFeature?: AiFeatureStateProps;
|
|
126
|
+
};
|
|
109
127
|
history: {
|
|
110
128
|
url: string;
|
|
111
129
|
description: string;
|
|
112
130
|
}[];
|
|
113
131
|
selectedLogoIndex: number;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
isApplyingLogo: boolean;
|
|
117
|
-
isRequestingImage: boolean;
|
|
118
|
-
isEnhancingPrompt: boolean;
|
|
119
|
-
featureFetchError?: RequestError;
|
|
120
|
-
firstLogoPromptFetchError?: RequestError;
|
|
121
|
-
enhancePromptFetchError?: RequestError;
|
|
122
|
-
logoFetchError?: RequestError;
|
|
123
|
-
saveToLibraryError?: RequestError;
|
|
124
|
-
logoUpdateError?: RequestError;
|
|
125
|
-
context: string;
|
|
126
|
-
isLoadingHistory: boolean;
|
|
127
|
-
};
|
|
128
|
-
siteDetails?: SiteDetails | Record<string, never>;
|
|
132
|
+
} | {
|
|
133
|
+
siteDetails?: Record<string, never> | SiteDetails;
|
|
129
134
|
features: {
|
|
130
135
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
131
136
|
};
|
|
132
|
-
|
|
137
|
+
history: import("./types.ts").Logo[];
|
|
138
|
+
selectedLogoIndex: number;
|
|
133
139
|
_meta: {
|
|
134
|
-
isSavingLogoToLibrary: boolean;
|
|
135
140
|
isApplyingLogo?: boolean;
|
|
136
141
|
isRequestingImage?: boolean;
|
|
137
142
|
isEnhancingPrompt?: boolean;
|
|
@@ -143,16 +148,16 @@ export default function reducer(state: import("./types.ts").LogoGeneratorStatePr
|
|
|
143
148
|
logoUpdateError?: RequestError;
|
|
144
149
|
context?: string;
|
|
145
150
|
isLoadingHistory?: boolean;
|
|
151
|
+
isSavingLogoToLibrary: boolean;
|
|
146
152
|
};
|
|
147
|
-
|
|
153
|
+
} | {
|
|
154
|
+
siteDetails?: Record<string, never> | SiteDetails;
|
|
148
155
|
features: {
|
|
149
156
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
150
157
|
};
|
|
151
|
-
history:
|
|
158
|
+
history: import("./types.ts").Logo[];
|
|
152
159
|
selectedLogoIndex: number;
|
|
153
|
-
} | {
|
|
154
160
|
_meta: {
|
|
155
|
-
isApplyingLogo: boolean;
|
|
156
161
|
isSavingLogoToLibrary?: boolean;
|
|
157
162
|
isRequestingImage?: boolean;
|
|
158
163
|
isEnhancingPrompt?: boolean;
|
|
@@ -164,16 +169,16 @@ export default function reducer(state: import("./types.ts").LogoGeneratorStatePr
|
|
|
164
169
|
logoUpdateError?: RequestError;
|
|
165
170
|
context?: string;
|
|
166
171
|
isLoadingHistory?: boolean;
|
|
172
|
+
isApplyingLogo: boolean;
|
|
167
173
|
};
|
|
168
|
-
|
|
174
|
+
} | {
|
|
175
|
+
siteDetails?: Record<string, never> | SiteDetails;
|
|
169
176
|
features: {
|
|
170
177
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
171
178
|
};
|
|
172
|
-
history:
|
|
179
|
+
history: import("./types.ts").Logo[];
|
|
173
180
|
selectedLogoIndex: number;
|
|
174
|
-
} | {
|
|
175
181
|
_meta: {
|
|
176
|
-
isRequestingImage: boolean;
|
|
177
182
|
isSavingLogoToLibrary?: boolean;
|
|
178
183
|
isApplyingLogo?: boolean;
|
|
179
184
|
isEnhancingPrompt?: boolean;
|
|
@@ -185,16 +190,16 @@ export default function reducer(state: import("./types.ts").LogoGeneratorStatePr
|
|
|
185
190
|
logoUpdateError?: RequestError;
|
|
186
191
|
context?: string;
|
|
187
192
|
isLoadingHistory?: boolean;
|
|
193
|
+
isRequestingImage: boolean;
|
|
188
194
|
};
|
|
189
|
-
|
|
195
|
+
} | {
|
|
196
|
+
siteDetails?: Record<string, never> | SiteDetails;
|
|
190
197
|
features: {
|
|
191
198
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
192
199
|
};
|
|
193
|
-
history:
|
|
200
|
+
history: import("./types.ts").Logo[];
|
|
194
201
|
selectedLogoIndex: number;
|
|
195
|
-
} | {
|
|
196
202
|
_meta: {
|
|
197
|
-
isEnhancingPrompt: boolean;
|
|
198
203
|
isSavingLogoToLibrary?: boolean;
|
|
199
204
|
isApplyingLogo?: boolean;
|
|
200
205
|
isRequestingImage?: boolean;
|
|
@@ -206,22 +211,14 @@ export default function reducer(state: import("./types.ts").LogoGeneratorStatePr
|
|
|
206
211
|
logoUpdateError?: RequestError;
|
|
207
212
|
context?: string;
|
|
208
213
|
isLoadingHistory?: boolean;
|
|
214
|
+
isEnhancingPrompt: boolean;
|
|
209
215
|
};
|
|
210
|
-
siteDetails?: SiteDetails | Record<string, never>;
|
|
211
|
-
features: {
|
|
212
|
-
aiAssistantFeature?: AiFeatureStateProps;
|
|
213
|
-
};
|
|
214
|
-
history: Array<import("./types.ts").Logo>;
|
|
215
|
-
selectedLogoIndex: number;
|
|
216
216
|
} | {
|
|
217
|
+
siteDetails?: Record<string, never> | SiteDetails;
|
|
218
|
+
history: import("./types.ts").Logo[];
|
|
219
|
+
selectedLogoIndex: number;
|
|
217
220
|
features: {
|
|
218
221
|
aiAssistantFeature: {
|
|
219
|
-
_meta: {
|
|
220
|
-
isRequesting: boolean;
|
|
221
|
-
asyncRequestCountdown: number;
|
|
222
|
-
asyncRequestTimerId: number;
|
|
223
|
-
isRequestingImage: boolean;
|
|
224
|
-
};
|
|
225
222
|
hasFeature: boolean;
|
|
226
223
|
isOverLimit: boolean;
|
|
227
224
|
requestsCount: number;
|
|
@@ -236,18 +233,23 @@ export default function reducer(state: import("./types.ts").LogoGeneratorStatePr
|
|
|
236
233
|
nextStart: string;
|
|
237
234
|
requestsCount: number;
|
|
238
235
|
};
|
|
239
|
-
nextTier?: import("./types.ts").TierProp
|
|
236
|
+
nextTier?: import("./types.ts").TierProp;
|
|
240
237
|
tierPlansEnabled?: boolean;
|
|
241
238
|
costs?: {
|
|
242
|
-
|
|
239
|
+
'jetpack-ai-logo-generator': {
|
|
243
240
|
logo: number;
|
|
244
241
|
};
|
|
245
242
|
};
|
|
246
243
|
featuresControl?: import("./types.ts").FeaturesControl;
|
|
244
|
+
_meta: {
|
|
245
|
+
asyncRequestCountdown: number;
|
|
246
|
+
asyncRequestTimerId: number;
|
|
247
|
+
isRequestingImage: boolean;
|
|
248
|
+
isRequesting: boolean;
|
|
249
|
+
};
|
|
247
250
|
};
|
|
248
251
|
};
|
|
249
252
|
_meta: {
|
|
250
|
-
featureFetchError: RequestError;
|
|
251
253
|
isSavingLogoToLibrary?: boolean;
|
|
252
254
|
isApplyingLogo?: boolean;
|
|
253
255
|
isRequestingImage?: boolean;
|
|
@@ -259,13 +261,16 @@ export default function reducer(state: import("./types.ts").LogoGeneratorStatePr
|
|
|
259
261
|
logoUpdateError?: RequestError;
|
|
260
262
|
context?: string;
|
|
261
263
|
isLoadingHistory?: boolean;
|
|
264
|
+
featureFetchError: RequestError;
|
|
262
265
|
};
|
|
263
|
-
siteDetails?: SiteDetails | Record<string, never>;
|
|
264
|
-
history: Array<import("./types.ts").Logo>;
|
|
265
|
-
selectedLogoIndex: number;
|
|
266
266
|
} | {
|
|
267
|
+
siteDetails?: Record<string, never> | SiteDetails;
|
|
268
|
+
features: {
|
|
269
|
+
aiAssistantFeature?: AiFeatureStateProps;
|
|
270
|
+
};
|
|
271
|
+
history: import("./types.ts").Logo[];
|
|
272
|
+
selectedLogoIndex: number;
|
|
267
273
|
_meta: {
|
|
268
|
-
firstLogoPromptFetchError: RequestError;
|
|
269
274
|
isSavingLogoToLibrary?: boolean;
|
|
270
275
|
isApplyingLogo?: boolean;
|
|
271
276
|
isRequestingImage?: boolean;
|
|
@@ -277,16 +282,16 @@ export default function reducer(state: import("./types.ts").LogoGeneratorStatePr
|
|
|
277
282
|
logoUpdateError?: RequestError;
|
|
278
283
|
context?: string;
|
|
279
284
|
isLoadingHistory?: boolean;
|
|
285
|
+
firstLogoPromptFetchError: RequestError;
|
|
280
286
|
};
|
|
281
|
-
|
|
287
|
+
} | {
|
|
288
|
+
siteDetails?: Record<string, never> | SiteDetails;
|
|
282
289
|
features: {
|
|
283
290
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
284
291
|
};
|
|
285
|
-
history:
|
|
292
|
+
history: import("./types.ts").Logo[];
|
|
286
293
|
selectedLogoIndex: number;
|
|
287
|
-
} | {
|
|
288
294
|
_meta: {
|
|
289
|
-
enhancePromptFetchError: RequestError;
|
|
290
295
|
isSavingLogoToLibrary?: boolean;
|
|
291
296
|
isApplyingLogo?: boolean;
|
|
292
297
|
isRequestingImage?: boolean;
|
|
@@ -298,16 +303,16 @@ export default function reducer(state: import("./types.ts").LogoGeneratorStatePr
|
|
|
298
303
|
logoUpdateError?: RequestError;
|
|
299
304
|
context?: string;
|
|
300
305
|
isLoadingHistory?: boolean;
|
|
306
|
+
enhancePromptFetchError: RequestError;
|
|
301
307
|
};
|
|
302
|
-
|
|
308
|
+
} | {
|
|
309
|
+
siteDetails?: Record<string, never> | SiteDetails;
|
|
303
310
|
features: {
|
|
304
311
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
305
312
|
};
|
|
306
|
-
history:
|
|
313
|
+
history: import("./types.ts").Logo[];
|
|
307
314
|
selectedLogoIndex: number;
|
|
308
|
-
} | {
|
|
309
315
|
_meta: {
|
|
310
|
-
logoFetchError: RequestError;
|
|
311
316
|
isSavingLogoToLibrary?: boolean;
|
|
312
317
|
isApplyingLogo?: boolean;
|
|
313
318
|
isRequestingImage?: boolean;
|
|
@@ -319,16 +324,16 @@ export default function reducer(state: import("./types.ts").LogoGeneratorStatePr
|
|
|
319
324
|
logoUpdateError?: RequestError;
|
|
320
325
|
context?: string;
|
|
321
326
|
isLoadingHistory?: boolean;
|
|
327
|
+
logoFetchError: RequestError;
|
|
322
328
|
};
|
|
323
|
-
|
|
329
|
+
} | {
|
|
330
|
+
siteDetails?: Record<string, never> | SiteDetails;
|
|
324
331
|
features: {
|
|
325
332
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
326
333
|
};
|
|
327
|
-
history:
|
|
334
|
+
history: import("./types.ts").Logo[];
|
|
328
335
|
selectedLogoIndex: number;
|
|
329
|
-
} | {
|
|
330
336
|
_meta: {
|
|
331
|
-
saveToLibraryError: RequestError;
|
|
332
337
|
isSavingLogoToLibrary?: boolean;
|
|
333
338
|
isApplyingLogo?: boolean;
|
|
334
339
|
isRequestingImage?: boolean;
|
|
@@ -340,16 +345,16 @@ export default function reducer(state: import("./types.ts").LogoGeneratorStatePr
|
|
|
340
345
|
logoUpdateError?: RequestError;
|
|
341
346
|
context?: string;
|
|
342
347
|
isLoadingHistory?: boolean;
|
|
348
|
+
saveToLibraryError: RequestError;
|
|
343
349
|
};
|
|
344
|
-
|
|
350
|
+
} | {
|
|
351
|
+
siteDetails?: Record<string, never> | SiteDetails;
|
|
345
352
|
features: {
|
|
346
353
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
347
354
|
};
|
|
348
|
-
history:
|
|
355
|
+
history: import("./types.ts").Logo[];
|
|
349
356
|
selectedLogoIndex: number;
|
|
350
|
-
} | {
|
|
351
357
|
_meta: {
|
|
352
|
-
logoUpdateError: RequestError;
|
|
353
358
|
isSavingLogoToLibrary?: boolean;
|
|
354
359
|
isApplyingLogo?: boolean;
|
|
355
360
|
isRequestingImage?: boolean;
|
|
@@ -361,16 +366,16 @@ export default function reducer(state: import("./types.ts").LogoGeneratorStatePr
|
|
|
361
366
|
saveToLibraryError?: RequestError;
|
|
362
367
|
context?: string;
|
|
363
368
|
isLoadingHistory?: boolean;
|
|
369
|
+
logoUpdateError: RequestError;
|
|
364
370
|
};
|
|
365
|
-
|
|
371
|
+
} | {
|
|
372
|
+
siteDetails?: Record<string, never> | SiteDetails;
|
|
366
373
|
features: {
|
|
367
374
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
368
375
|
};
|
|
369
|
-
history:
|
|
376
|
+
history: import("./types.ts").Logo[];
|
|
370
377
|
selectedLogoIndex: number;
|
|
371
|
-
} | {
|
|
372
378
|
_meta: {
|
|
373
|
-
context: string;
|
|
374
379
|
isSavingLogoToLibrary?: boolean;
|
|
375
380
|
isApplyingLogo?: boolean;
|
|
376
381
|
isRequestingImage?: boolean;
|
|
@@ -382,16 +387,16 @@ export default function reducer(state: import("./types.ts").LogoGeneratorStatePr
|
|
|
382
387
|
saveToLibraryError?: RequestError;
|
|
383
388
|
logoUpdateError?: RequestError;
|
|
384
389
|
isLoadingHistory?: boolean;
|
|
390
|
+
context: string;
|
|
385
391
|
};
|
|
386
|
-
|
|
392
|
+
} | {
|
|
393
|
+
siteDetails?: Record<string, never> | SiteDetails;
|
|
387
394
|
features: {
|
|
388
395
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
389
396
|
};
|
|
390
|
-
history:
|
|
397
|
+
history: import("./types.ts").Logo[];
|
|
391
398
|
selectedLogoIndex: number;
|
|
392
|
-
} | {
|
|
393
399
|
_meta: {
|
|
394
|
-
isLoadingHistory: boolean;
|
|
395
400
|
isSavingLogoToLibrary?: boolean;
|
|
396
401
|
isApplyingLogo?: boolean;
|
|
397
402
|
isRequestingImage?: boolean;
|
|
@@ -403,11 +408,6 @@ export default function reducer(state: import("./types.ts").LogoGeneratorStatePr
|
|
|
403
408
|
saveToLibraryError?: RequestError;
|
|
404
409
|
logoUpdateError?: RequestError;
|
|
405
410
|
context?: string;
|
|
411
|
+
isLoadingHistory: boolean;
|
|
406
412
|
};
|
|
407
|
-
siteDetails?: SiteDetails | Record<string, never>;
|
|
408
|
-
features: {
|
|
409
|
-
aiAssistantFeature?: AiFeatureStateProps;
|
|
410
|
-
};
|
|
411
|
-
history: Array<import("./types.ts").Logo>;
|
|
412
|
-
selectedLogoIndex: number;
|
|
413
413
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Types & Constants
|
|
3
3
|
*/
|
|
4
|
-
import { DEFAULT_LOGO_COST } from
|
|
5
|
-
import { ACTION_INCREASE_AI_ASSISTANT_REQUESTS_COUNT, ACTION_REQUEST_AI_ASSISTANT_FEATURE, ACTION_SET_AI_ASSISTANT_FEATURE_REQUIRE_UPGRADE, ACTION_STORE_AI_ASSISTANT_FEATURE, ASYNC_REQUEST_COUNTDOWN_INIT_VALUE, FREE_PLAN_REQUESTS_LIMIT, UNLIMITED_PLAN_REQUESTS_LIMIT, ACTION_SET_TIER_PLANS_ENABLED, ACTION_SET_SITE_DETAILS, ACTION_SET_SELECTED_LOGO_INDEX, ACTION_ADD_LOGO_TO_HISTORY, ACTION_SAVE_SELECTED_LOGO, ACTION_SET_IS_SAVING_LOGO_TO_LIBRARY, ACTION_SET_IS_REQUESTING_IMAGE, ACTION_SET_IS_APPLYING_LOGO, ACTION_SET_IS_ENHANCING_PROMPT, ACTION_SET_SITE_HISTORY, ACTION_SET_FEATURE_FETCH_ERROR, ACTION_SET_FIRST_LOGO_PROMPT_FETCH_ERROR, ACTION_SET_ENHANCE_PROMPT_FETCH_ERROR, ACTION_SET_LOGO_FETCH_ERROR, ACTION_SET_SAVE_TO_LIBRARY_ERROR, ACTION_SET_LOGO_UPDATE_ERROR, ACTION_SET_CONTEXT, ACTION_SET_IS_LOADING_HISTORY, } from
|
|
6
|
-
import INITIAL_STATE from
|
|
4
|
+
import { DEFAULT_LOGO_COST } from '../constants.js';
|
|
5
|
+
import { ACTION_INCREASE_AI_ASSISTANT_REQUESTS_COUNT, ACTION_REQUEST_AI_ASSISTANT_FEATURE, ACTION_SET_AI_ASSISTANT_FEATURE_REQUIRE_UPGRADE, ACTION_STORE_AI_ASSISTANT_FEATURE, ASYNC_REQUEST_COUNTDOWN_INIT_VALUE, FREE_PLAN_REQUESTS_LIMIT, UNLIMITED_PLAN_REQUESTS_LIMIT, ACTION_SET_TIER_PLANS_ENABLED, ACTION_SET_SITE_DETAILS, ACTION_SET_SELECTED_LOGO_INDEX, ACTION_ADD_LOGO_TO_HISTORY, ACTION_SAVE_SELECTED_LOGO, ACTION_SET_IS_SAVING_LOGO_TO_LIBRARY, ACTION_SET_IS_REQUESTING_IMAGE, ACTION_SET_IS_APPLYING_LOGO, ACTION_SET_IS_ENHANCING_PROMPT, ACTION_SET_SITE_HISTORY, ACTION_SET_FEATURE_FETCH_ERROR, ACTION_SET_FIRST_LOGO_PROMPT_FETCH_ERROR, ACTION_SET_ENHANCE_PROMPT_FETCH_ERROR, ACTION_SET_LOGO_FETCH_ERROR, ACTION_SET_SAVE_TO_LIBRARY_ERROR, ACTION_SET_LOGO_UPDATE_ERROR, ACTION_SET_CONTEXT, ACTION_SET_IS_LOADING_HISTORY, } from './constants.js';
|
|
6
|
+
import INITIAL_STATE from './initial-state.js';
|
|
7
7
|
/**
|
|
8
8
|
* Reducer for the Logo Generator store.
|
|
9
9
|
*
|
|
@@ -12,7 +12,7 @@ declare const selectors: {
|
|
|
12
12
|
* @param {LogoGeneratorStateProp} state - The app state tree.
|
|
13
13
|
* @return {Partial<SiteDetails> | undefined} The site details.
|
|
14
14
|
*/
|
|
15
|
-
getSiteDetails(state: LogoGeneratorStateProp): Partial<SiteDetails
|
|
15
|
+
getSiteDetails(state: LogoGeneratorStateProp): Partial<SiteDetails>;
|
|
16
16
|
/**
|
|
17
17
|
* Get the isRequesting flag for the AI Assistant feature.
|
|
18
18
|
* @param {LogoGeneratorStateProp} state - The app state tree.
|
|
@@ -24,13 +24,13 @@ declare const selectors: {
|
|
|
24
24
|
* @param {LogoGeneratorStateProp} state - The app state tree.
|
|
25
25
|
* @return {Array<Logo>} The logos history array.
|
|
26
26
|
*/
|
|
27
|
-
getLogos(state: LogoGeneratorStateProp):
|
|
27
|
+
getLogos(state: LogoGeneratorStateProp): Logo[];
|
|
28
28
|
/**
|
|
29
29
|
* Get the selected logo index.
|
|
30
30
|
* @param {LogoGeneratorStateProp} state - The app state tree.
|
|
31
31
|
* @return {number | null} The selected logo index.
|
|
32
32
|
*/
|
|
33
|
-
getSelectedLogoIndex(state: LogoGeneratorStateProp): number
|
|
33
|
+
getSelectedLogoIndex(state: LogoGeneratorStateProp): number;
|
|
34
34
|
/**
|
|
35
35
|
* Get the selected logo.
|
|
36
36
|
* @param {LogoGeneratorStateProp} state - The app state tree.
|
|
@@ -46,7 +46,7 @@ export default class SuggestionsEventSource extends EventTarget {
|
|
|
46
46
|
controller: AbortController;
|
|
47
47
|
errorUnclearPromptTriggered: boolean;
|
|
48
48
|
constructor(data: SuggestionsEventSourceConstructorArgs);
|
|
49
|
-
initEventSource({ url, question, token, options
|
|
49
|
+
initEventSource({ url, question, token, options }: SuggestionsEventSourceConstructorArgs): Promise<void>;
|
|
50
50
|
checkForUnclearPrompt(): void;
|
|
51
51
|
close(): void;
|
|
52
52
|
processEvent(e: EventSourceMessage): void;
|
|
@@ -6,12 +6,12 @@ import debugFactory from 'debug';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { getErrorData } from
|
|
10
|
-
import requestJwt from
|
|
9
|
+
import { getErrorData } from '../hooks/use-ai-suggestions/index.js';
|
|
10
|
+
import requestJwt from '../jwt/index.js';
|
|
11
11
|
/*
|
|
12
12
|
* Types & constants
|
|
13
13
|
*/
|
|
14
|
-
import { ERROR_CONTEXT_TOO_LARGE, ERROR_MODERATION, ERROR_NETWORK, ERROR_QUOTA_EXCEEDED, ERROR_RESPONSE, ERROR_SERVICE_UNAVAILABLE, ERROR_UNCLEAR_PROMPT, } from
|
|
14
|
+
import { ERROR_CONTEXT_TOO_LARGE, ERROR_MODERATION, ERROR_NETWORK, ERROR_QUOTA_EXCEEDED, ERROR_RESPONSE, ERROR_SERVICE_UNAVAILABLE, ERROR_UNCLEAR_PROMPT, } from '../types.js';
|
|
15
15
|
const debug = debugFactory('jetpack-ai-client:suggestions-event-source');
|
|
16
16
|
/**
|
|
17
17
|
* SuggestionsEventSource is a wrapper around EvenTarget that emits
|
|
@@ -124,7 +124,7 @@ export default class SuggestionsEventSource extends EventTarget {
|
|
|
124
124
|
onmessage: ev => {
|
|
125
125
|
this.processEvent(ev);
|
|
126
126
|
},
|
|
127
|
-
onopen: async
|
|
127
|
+
onopen: async response => {
|
|
128
128
|
if (response.ok) {
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
@@ -12,7 +12,7 @@ export const ROLE_JETPACK_AI = 'jetpack-ai';
|
|
|
12
12
|
/*
|
|
13
13
|
* Hook constants
|
|
14
14
|
*/
|
|
15
|
-
export { TRANSCRIPTION_POST_PROCESSING_ACTION_SIMPLE_DRAFT } from
|
|
15
|
+
export { TRANSCRIPTION_POST_PROCESSING_ACTION_SIMPLE_DRAFT } from './hooks/use-transcription-post-processing/index.js';
|
|
16
16
|
/*
|
|
17
17
|
* Requests types
|
|
18
18
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/jetpack-ai-client",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A JS client for consuming Jetpack AI services",
|
|
6
6
|
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/ai-client/#readme",
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "pnpm run clean && pnpm run compile-ts",
|
|
27
27
|
"clean": "rm -rf build/",
|
|
28
|
-
"compile-ts": "
|
|
28
|
+
"compile-ts": "tsgo --pretty",
|
|
29
29
|
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
30
30
|
"test-coverage": "pnpm run test --coverage",
|
|
31
|
-
"typecheck": "
|
|
32
|
-
"watch": "
|
|
31
|
+
"typecheck": "tsgo --noEmit",
|
|
32
|
+
"watch": "tsgo --watch --pretty"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@automattic/jetpack-base-styles": "^1.0.18",
|
|
36
|
-
"@automattic/jetpack-components": "^1.
|
|
37
|
-
"@automattic/jetpack-connection": "^1.4.
|
|
36
|
+
"@automattic/jetpack-components": "^1.5.0",
|
|
37
|
+
"@automattic/jetpack-connection": "^1.4.39",
|
|
38
38
|
"@automattic/jetpack-explat": "workspace:*",
|
|
39
|
-
"@automattic/jetpack-script-data": "^0.6.
|
|
40
|
-
"@automattic/jetpack-shared-extension-utils": "^1.5.
|
|
39
|
+
"@automattic/jetpack-script-data": "^0.6.1",
|
|
40
|
+
"@automattic/jetpack-shared-extension-utils": "^1.5.3",
|
|
41
41
|
"@microsoft/fetch-event-source": "2.0.1",
|
|
42
42
|
"@types/jest": "30.0.0",
|
|
43
43
|
"@types/react": "18.3.28",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"@testing-library/dom": "10.4.1",
|
|
70
70
|
"@types/markdown-it": "14.1.2",
|
|
71
71
|
"@types/turndown": "5.0.6",
|
|
72
|
+
"@typescript/native-preview": "7.0.0-dev.20260225.1",
|
|
72
73
|
"jest": "30.2.0",
|
|
73
|
-
"storybook": "10.2.11"
|
|
74
|
-
"typescript": "5.9.3"
|
|
74
|
+
"storybook": "10.2.11"
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { G, Path, SVG, Rect } from '@wordpress/components';
|
|
3
|
-
import { Icon } from '@wordpress/icons';
|
|
4
|
-
import { Defs } from '@wordpress/primitives';
|
|
5
|
-
export const AiSVG = (_jsxs(SVG, { width: "42", height: "42", viewBox: "0 0 42 42", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsxs(G, { clipPath: "url(#clip0_4479_1006)", children: [_jsx(Path, { d: "M7.87488 0L10.1022 5.64753L15.7498 7.87488L10.1022 10.1022L7.87488 15.7498L5.64753 10.1022L0 7.87488L5.64753 5.64753L7.87488 0Z", fill: "#A7AAAD" }), _jsx(Path, { d: "M31.4998 0L34.4696 7.53004L41.9997 10.4998L34.4696 13.4696L31.4998 20.9997L28.53 13.4696L21 10.4998L28.53 7.53004L31.4998 0Z", fill: "#A7AAAD" }), _jsx(Path, { d: "M18.3748 15.7496L22.0871 25.1621L31.4996 28.8744L22.0871 32.5866L18.3748 41.9992L14.6625 32.5866L5.25 28.8744L14.6625 25.1621L18.3748 15.7496Z", fill: "#A7AAAD" })] }), _jsx(Defs, { children: _jsx("clipPath", { id: "clip0_4479_1006", children: _jsx(Rect, { width: "41.9997", height: "41.9992", fill: "white" }) }) })] }));
|
|
6
|
-
/**
|
|
7
|
-
* AiIcon component
|
|
8
|
-
* @param {string} className - The wrapper class name.
|
|
9
|
-
* @return {ReactElement} The `AiIcon` component.
|
|
10
|
-
*/
|
|
11
|
-
export default function AiIcon({ className, size = 42 }) {
|
|
12
|
-
return _jsx(Icon, { icon: AiSVG, width: size, height: size, className: className });
|
|
13
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* External dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { Button } from '@wordpress/components';
|
|
6
|
-
import { useCallback } from '@wordpress/element';
|
|
7
|
-
import { __ } from '@wordpress/i18n';
|
|
8
|
-
import { Icon, info } from '@wordpress/icons';
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
|
-
import './style.scss';
|
|
13
|
-
/**
|
|
14
|
-
* AiModalFooter component.
|
|
15
|
-
*
|
|
16
|
-
* @param {AiModalFooterProps} props - component props.
|
|
17
|
-
* @return {ReactElement} - rendered component.
|
|
18
|
-
*/
|
|
19
|
-
export default function AiModalFooter({ onGuidelinesClick, onFeedbackClick, }) {
|
|
20
|
-
const handleGuidelinesClick = useCallback(() => {
|
|
21
|
-
onGuidelinesClick?.();
|
|
22
|
-
}, [onGuidelinesClick]);
|
|
23
|
-
const handleFeedbackClick = useCallback(() => {
|
|
24
|
-
onFeedbackClick?.();
|
|
25
|
-
}, [onFeedbackClick]);
|
|
26
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "ai-image-modal__footer-disclaimer", children: [_jsx(Icon, { icon: info }), _jsx("span", { children: __('Generated images could be inaccurate, biased or include text.', 'jetpack-ai-client') }), _jsx(Button, { variant: "link", className: "ai-image-modal__guidelines-button", href: "https://jetpack.com/redirect/?source=ai-guidelines", target: "_blank", onClick: handleGuidelinesClick, children: _jsxs("span", { children: [__('Guidelines', 'jetpack-ai-client'), " \u2197"] }) })] }), _jsx(Button, { variant: "link", className: "ai-image-modal__feedback-button", href: "https://jetpack.com/redirect/?source=jetpack-ai-feedback", target: "_blank", onClick: handleFeedbackClick, children: _jsxs("span", { children: [__('Give feedback', 'jetpack-ai-client'), " \u2197"] }) })] }));
|
|
27
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { AIControl, BlockAIControl, ExtensionAIControl } from "./ai-control/index.js";
|
|
2
|
-
export { default as AiFeedbackThumbs } from "./ai-feedback/index.js";
|
|
3
|
-
export { default as AiIcon, AiSVG } from "./ai-icon/index.js";
|
|
4
|
-
export { FeaturedImage, GeneralPurposeImage, PLACEMENT_MEDIA_SOURCE_DROPDOWN, PLACEMENT_BLOCK_PLACEHOLDER_BUTTON, } from "./ai-image/index.js";
|
|
5
|
-
export { default as AiStatusIndicator } from "./ai-status-indicator/index.js";
|
|
6
|
-
export { default as AudioDurationDisplay } from "./audio-duration-display/index.js";
|
|
7
|
-
export { default as AiModalFooter } from "./ai-modal-footer/index.js";
|
|
8
|
-
export { GuidelineMessage, UpgradeMessage, ErrorMessage, default as FooterMessage, } from "./message/index.js";
|
|
9
|
-
export { default as AiAssistantModal } from "./modal/index.js";
|
|
10
|
-
export { default as QuotaExceededMessage, FairUsageNotice, } from "./quota-exceeded-message/index.js";
|
package/build/data-flow/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { SVG, Path } from '@wordpress/components';
|
|
6
|
-
const aiAssistant = (_jsxs(SVG, { viewBox: "0 0 32 32", width: "32", height: "32", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", className: "ai-assistant-icon", children: [_jsx(Path, { className: "spark-first", d: "M9.33301 5.33325L10.4644 8.20188L13.333 9.33325L10.4644 10.4646L9.33301 13.3333L8.20164 10.4646L5.33301 9.33325L8.20164 8.20188L9.33301 5.33325Z" }), _jsx(Path, { className: "spark-second", d: "M21.3333 5.33333L22.8418 9.15817L26.6667 10.6667L22.8418 12.1752L21.3333 16L19.8248 12.1752L16 10.6667L19.8248 9.15817L21.3333 5.33333Z" }), _jsx(Path, { className: "spark-third", d: "M14.6667 13.3333L16.5523 18.1144L21.3333 20L16.5523 21.8856L14.6667 26.6667L12.781 21.8856L8 20L12.781 18.1144L14.6667 13.3333Z" })] }));
|
|
7
|
-
export default aiAssistant;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* External dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { SVG, Path } from '@wordpress/components';
|
|
6
|
-
const errorExclamation = (_jsxs(SVG, { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx(Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M10 3.95833C6.66328 3.95833 3.95833 6.66327 3.95833 9.99999C3.95833 13.3367 6.66328 16.0417 10 16.0417C13.3367 16.0417 16.0417 13.3367 16.0417 9.99999C16.0417 6.66327 13.3367 3.95833 10 3.95833ZM2.70833 9.99999C2.70833 5.97292 5.97292 2.70833 10 2.70833C14.0271 2.70833 17.2917 5.97292 17.2917 9.99999C17.2917 14.0271 14.0271 17.2917 10 17.2917C5.97292 17.2917 2.70833 14.0271 2.70833 9.99999Z" }), _jsx(Path, { d: "M10.8333 5.83333H9.16667V10.8333H10.8333V5.83333Z" }), _jsx(Path, { d: "M10.8333 12.5H9.16667V14.1667H10.8333V12.5Z" })] }));
|
|
7
|
-
export default errorExclamation;
|
package/build/icons/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { default as aiAssistantIcon } from "./ai-assistant.js";
|
|
2
|
-
export { default as micIcon } from "./mic.js";
|
|
3
|
-
export { default as origamiPlaneIcon } from "./origami-plane.js";
|
|
4
|
-
export { default as playerPlayIcon } from "./player-play.js";
|
|
5
|
-
export { default as playerStopIcon } from "./player-stop.js";
|
|
6
|
-
export { default as playerPauseIcon } from "./player-pause.js";
|
|
7
|
-
export { default as speakToneIcon } from "./speak-tone.js";
|
package/build/icons/mic.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* External dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { SVG, Rect, Path } from '@wordpress/components';
|
|
6
|
-
const mic = (_jsxs(SVG, { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/SVG", children: [_jsx(Path, { d: "M12 4.75C11.0479 4.75 10.1052 4.93753 9.22554 5.30187C8.34593 5.66622 7.5467 6.20025 6.87348 6.87348C6.20025 7.5467 5.66622 8.34593 5.30187 9.22554C4.93753 10.1052 4.75 11.0479 4.75 12C4.75 12.9521 4.93753 13.8948 5.30187 14.7745C5.66622 15.6541 6.20025 16.4533 6.87348 17.1265C7.5467 17.7997 8.34593 18.3338 9.22554 18.6981C10.1052 19.0625 11.0479 19.25 12 19.25C13.9228 19.25 15.7669 18.4862 17.1265 17.1265C18.4862 15.7669 19.25 13.9228 19.25 12C19.25 10.0772 18.4862 8.23312 17.1265 6.87348C15.7669 5.51384 13.9228 4.75 12 4.75ZM3.25 12C3.25 9.67936 4.17187 7.45376 5.81282 5.81282C7.45376 4.17187 9.67936 3.25 12 3.25C14.3206 3.25 16.5462 4.17187 18.1872 5.81282C19.8281 7.45376 20.75 9.67936 20.75 12C20.75 14.3206 19.8281 16.5462 18.1872 18.1872C16.5462 19.8281 14.3206 20.75 12 20.75C9.67936 20.75 7.45376 19.8281 5.81282 18.1872C4.17187 16.5462 3.25 14.3206 3.25 12Z", fill: "#008710" }), _jsx(Rect, { x: "10.5", y: "8.25", width: "3", height: "4.875", rx: "1.5", fill: "#008710" }), _jsx(Path, { d: "M15 11.25C15 11.644 14.9224 12.0341 14.7716 12.3981C14.6209 12.762 14.3999 13.0927 14.1213 13.3713C13.8427 13.6499 13.512 13.8709 13.1481 14.0216C12.7841 14.1724 12.394 14.25 12 14.25C11.606 14.25 11.2159 14.1724 10.8519 14.0216C10.488 13.8709 10.1573 13.6499 9.87868 13.3713C9.6001 13.0927 9.37913 12.762 9.22836 12.3981C9.0776 12.0341 9 11.644 9 11.25", stroke: "#008710", strokeWidth: "1.125", strokeLinecap: "round" }), _jsx(Path, { d: "M11.4375 15.75C11.4375 16.0607 11.6893 16.3125 12 16.3125C12.3107 16.3125 12.5625 16.0607 12.5625 15.75L11.4375 15.75ZM11.4375 14.25L11.4375 15.75L12.5625 15.75L12.5625 14.25L11.4375 14.25Z", fill: "#008710" })] }));
|
|
7
|
-
export default mic;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* External dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { SVG, Path } from '@wordpress/components';
|
|
6
|
-
const origamiPlane = (_jsxs(SVG, { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/SVG", children: [_jsx(Path, { d: "M13.5142 18.5098C14.1227 19.6569 14.5367 20.5899 14.5367 20.5899L18.7588 3.84402L4.05433 12.901C4.05433 12.901 5.10588 12.9894 6.41062 13.2114C7.97628 13.4777 9.90652 13.9362 10.8219 14.6646C11.7434 15.3979 12.7731 17.1127 13.5142 18.5098ZM14.0468 16.3975C13.8238 16.0255 13.5879 15.6537 13.3445 15.3013C12.8931 14.6478 12.3509 13.9643 11.7559 13.4909C11.1195 12.9844 10.2767 12.6409 9.51316 12.3968C9.11301 12.2689 8.69633 12.1567 8.28231 12.0585L16.4016 7.05758L14.0468 16.3975Z" }), _jsx(Path, { d: "M18 5L11 14", stroke: "currentColor" })] }));
|
|
7
|
-
export default origamiPlane;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* External dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { SVG, Path, Rect } from '@wordpress/components';
|
|
6
|
-
const playerPause = (_jsxs(SVG, { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/SVG", children: [_jsx(Path, { d: "M12 4.75C11.0479 4.75 10.1052 4.93753 9.22554 5.30187C8.34593 5.66622 7.5467 6.20025 6.87348 6.87348C6.20025 7.5467 5.66622 8.34593 5.30187 9.22554C4.93753 10.1052 4.75 11.0479 4.75 12C4.75 12.9521 4.93753 13.8948 5.30187 14.7745C5.66622 15.6541 6.20025 16.4533 6.87348 17.1265C7.5467 17.7997 8.34593 18.3338 9.22554 18.6981C10.1052 19.0625 11.0479 19.25 12 19.25C13.9228 19.25 15.7669 18.4862 17.1265 17.1265C18.4862 15.7669 19.25 13.9228 19.25 12C19.25 10.0772 18.4862 8.23312 17.1265 6.87348C15.7669 5.51384 13.9228 4.75 12 4.75ZM3.25 12C3.25 9.67936 4.17187 7.45376 5.81282 5.81282C7.45376 4.17187 9.67936 3.25 12 3.25C14.3206 3.25 16.5462 4.17187 18.1872 5.81282C19.8281 7.45376 20.75 9.67936 20.75 12C20.75 14.3206 19.8281 16.5462 18.1872 18.1872C16.5462 19.8281 14.3206 20.75 12 20.75C9.67936 20.75 7.45376 19.8281 5.81282 18.1872C4.17187 16.5462 3.25 14.3206 3.25 12Z", fill: "#008710" }), _jsx(Rect, { x: "12.75", y: "9", width: "2.25", height: "6", fill: "#008710" }), _jsx(Rect, { x: "9", y: "9", width: "2.25", height: "6", fill: "#008710" })] }));
|
|
7
|
-
export default playerPause;
|