@automattic/jetpack-ai-client 0.33.3 → 0.33.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 +18 -0
- package/build/components/ai-image/hooks/use-ai-image.js +1 -1
- package/build/components/ai-image/types.d.ts +1 -1
- package/build/components/message/index.js +2 -2
- package/build/components/quota-exceeded-message/index.js +4 -3
- package/build/components/quota-exceeded-message/light-nudge.js +1 -1
- package/build/constants.d.ts +34 -34
- package/build/logo-generator/components/prompt.js +1 -1
- package/build/logo-generator/components/upgrade-nudge.js +1 -1
- package/build/logo-generator/components/upgrade-screen.js +1 -1
- package/build/logo-generator/components/visit-site-banner.js +1 -1
- package/build/logo-generator/hooks/use-fair-usage-notice-message.js +2 -1
- package/package.json +41 -41
- package/src/components/ai-control/style.scss +2 -2
- package/src/components/ai-image/components/usage-counter.scss +1 -1
- package/src/components/ai-image/hooks/use-ai-image.ts +2 -1
- package/src/components/ai-image/style.scss +2 -2
- package/src/components/ai-image/types.ts +5 -1
- package/src/components/ai-status-indicator/style.scss +1 -1
- package/src/components/message/index.tsx +3 -3
- package/src/components/message/style.scss +5 -5
- package/src/components/modal/style.scss +1 -1
- package/src/components/quota-exceeded-message/index.tsx +4 -3
- package/src/components/quota-exceeded-message/light-nudge.tsx +1 -1
- package/src/components/quota-exceeded-message/style.scss +3 -3
- package/src/logo-generator/components/generator-modal.scss +1 -1
- package/src/logo-generator/components/history-carousel.scss +1 -1
- package/src/logo-generator/components/logo-presenter.scss +1 -1
- package/src/logo-generator/components/prompt.scss +1 -1
- package/src/logo-generator/components/prompt.tsx +1 -1
- package/src/logo-generator/components/upgrade-nudge.scss +1 -1
- package/src/logo-generator/components/upgrade-nudge.tsx +1 -1
- package/src/logo-generator/components/upgrade-screen.tsx +3 -3
- package/src/logo-generator/components/visit-site-banner.scss +1 -1
- package/src/logo-generator/components/visit-site-banner.tsx +1 -1
- package/src/logo-generator/hooks/use-fair-usage-notice-message.tsx +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.33.6] - 2025-08-11
|
|
9
|
+
### Changed
|
|
10
|
+
- Update package dependencies. [#44677]
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- I18n: Improve context hints in comments for translators. [#44686]
|
|
14
|
+
|
|
15
|
+
## [0.33.5] - 2025-08-04
|
|
16
|
+
### Changed
|
|
17
|
+
- Update dependencies. [#44551]
|
|
18
|
+
|
|
19
|
+
## [0.33.4] - 2025-07-28
|
|
20
|
+
### Fixed
|
|
21
|
+
- Block Editor: Fix Jetpack AI upgrade links. [#44405]
|
|
22
|
+
|
|
8
23
|
## [0.33.3] - 2025-07-21
|
|
9
24
|
### Changed
|
|
10
25
|
- Internal updates.
|
|
@@ -667,6 +682,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
667
682
|
- AI Client: stop using smart document visibility handling on the fetchEventSource library, so it does not restart the completion when changing tabs. [#32004]
|
|
668
683
|
- Updated package dependencies. [#31468] [#31659] [#31785]
|
|
669
684
|
|
|
685
|
+
[0.33.6]: https://github.com/Automattic/jetpack-ai-client/compare/v0.33.5...v0.33.6
|
|
686
|
+
[0.33.5]: https://github.com/Automattic/jetpack-ai-client/compare/v0.33.4...v0.33.5
|
|
687
|
+
[0.33.4]: https://github.com/Automattic/jetpack-ai-client/compare/v0.33.3...v0.33.4
|
|
670
688
|
[0.33.3]: https://github.com/Automattic/jetpack-ai-client/compare/v0.33.2...v0.33.3
|
|
671
689
|
[0.33.2]: https://github.com/Automattic/jetpack-ai-client/compare/v0.33.1...v0.33.2
|
|
672
690
|
[0.33.1]: https://github.com/Automattic/jetpack-ai-client/compare/v0.33.0...v0.33.1
|
|
@@ -50,7 +50,7 @@ export default function useAiImage({ feature, type, cost, autoStart = true, prev
|
|
|
50
50
|
});
|
|
51
51
|
}, []);
|
|
52
52
|
// the selec/useEffect combo...
|
|
53
|
-
const loadedMedia = useSelect((select) => select('core')?.
|
|
53
|
+
const loadedMedia = useSelect((select) => select('core')?.getEntityRecord?.('postType', 'attachment', previousMediaId), [previousMediaId]);
|
|
54
54
|
useEffect(() => {
|
|
55
55
|
if (loadedMedia) {
|
|
56
56
|
updateImages({
|
|
@@ -9,7 +9,7 @@ export interface EditorSelectors {
|
|
|
9
9
|
isEditorPanelOpened: (panel: string) => boolean;
|
|
10
10
|
}
|
|
11
11
|
export interface CoreSelectors {
|
|
12
|
-
|
|
12
|
+
getEntityRecord: (kind: string, name: string, key: number) => {
|
|
13
13
|
id: number;
|
|
14
14
|
source_url: string;
|
|
15
15
|
} | null;
|
|
@@ -90,7 +90,7 @@ export function UpgradeMessage({ requestsRemaining, severity, onUpgradeClick, up
|
|
|
90
90
|
}
|
|
91
91
|
return (_jsxs(Message, { severity: messageSeverity, children: [_jsx("span", { children: sprintf(
|
|
92
92
|
// translators: %1$d: number of requests remaining
|
|
93
|
-
__('You have %1$d requests remaining.', 'jetpack-ai-client'), requestsRemaining) }), _jsx(Button, { variant: "link", onClick: onUpgradeClick, href: upgradeUrl, target: upgradeUrl ? '_blank' : null, children: __('Upgrade now', 'jetpack-ai-client') })] }));
|
|
93
|
+
__('You have %1$d requests remaining.', 'jetpack-ai-client'), requestsRemaining) }), _jsx(Button, { variant: "link", onClick: onUpgradeClick, href: upgradeUrl, target: upgradeUrl ? '_blank' : null, children: _jsx("span", { children: __('Upgrade now', 'jetpack-ai-client') }) })] }));
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
96
|
* React component to render an error message
|
|
@@ -102,5 +102,5 @@ export function ErrorMessage({ error, code, onTryAgainClick, onUpgradeClick, upg
|
|
|
102
102
|
const errorMessage = error || __('Something went wrong', 'jetpack-ai-client');
|
|
103
103
|
return (_jsxs(Message, { severity: MESSAGE_SEVERITY_ERROR, children: [_jsx("span", { children: sprintf(
|
|
104
104
|
// translators: %1$d: A dynamic error message
|
|
105
|
-
__('Error: %1$s', 'jetpack-ai-client'), errorMessage) }), code === ERROR_QUOTA_EXCEEDED ? (_jsx(Button, { variant: "link", onClick: onUpgradeClick, href: upgradeUrl, target: upgradeUrl ? '_blank' : null, children: __('Upgrade now', 'jetpack-ai-client') })) : (_jsx(Button, { variant: "link", onClick: onTryAgainClick, children: __('Try again', 'jetpack-ai-client') }))] }));
|
|
105
|
+
__('Error: %1$s', 'jetpack-ai-client'), errorMessage) }), code === ERROR_QUOTA_EXCEEDED ? (_jsx(Button, { variant: "link", onClick: onUpgradeClick, href: upgradeUrl, target: upgradeUrl ? '_blank' : null, children: _jsx("span", { children: __('Upgrade now', 'jetpack-ai-client') }) })) : (_jsx(Button, { variant: "link", onClick: onTryAgainClick, children: _jsx("span", { children: __('Try again', 'jetpack-ai-client') }) }))] }));
|
|
106
106
|
}
|
|
@@ -33,7 +33,7 @@ const useFairUsageNoticeMessage = () => {
|
|
|
33
33
|
nextUsagePeriodStartDate.getDate());
|
|
34
34
|
};
|
|
35
35
|
const getFairUsageNoticeMessage = resetDateString => {
|
|
36
|
-
const fairUsageMessage = __("You've reached this month's request limit, per our <link>fair usage policy</link>.", 'jetpack-ai-client');
|
|
36
|
+
const fairUsageMessage = __("You've reached this month's request limit, per our <link><span>fair usage policy</span></link>.", 'jetpack-ai-client');
|
|
37
37
|
if (!resetDateString) {
|
|
38
38
|
return fairUsageMessage;
|
|
39
39
|
}
|
|
@@ -47,6 +47,7 @@ const useFairUsageNoticeMessage = () => {
|
|
|
47
47
|
const fairUsageNoticeMessage = getFairUsageNoticeMessage(nextUsagePeriodStartDateString);
|
|
48
48
|
const fairUsageNoticeMessageElement = createInterpolateElement(fairUsageNoticeMessage, {
|
|
49
49
|
link: (_jsx("a", { href: "https://jetpack.com/redirect/?source=ai-assistant-fair-usage-policy", target: "_blank", rel: "noreferrer" })),
|
|
50
|
+
span: _jsx("span", {}),
|
|
50
51
|
});
|
|
51
52
|
return fairUsageNoticeMessageElement;
|
|
52
53
|
};
|
|
@@ -90,12 +91,12 @@ const DefaultUpgradePrompt = ({ placement = null, description = null, useLightNu
|
|
|
90
91
|
return (_jsx(Nudge, { buttonText: __('Contact Us', 'jetpack-ai-client'), description: description || contactUsDescription, className: 'jetpack-ai-upgrade-banner', checkoutUrl: contactHref, visible: true, align: null, title: null, context: null, goToCheckoutPage: handleContactUsClick, target: "_blank" }));
|
|
91
92
|
}
|
|
92
93
|
const upgradeDescription = createInterpolateElement(sprintf(
|
|
93
|
-
/* Translators: number of requests */
|
|
94
|
+
/* Translators: %d: the number of requests allowed */
|
|
94
95
|
__('You have reached the requests limit for your current plan. <strong>Upgrade now to increase your requests limit to %d.</strong>', 'jetpack-ai-client'), nextTier.limit), {
|
|
95
96
|
strong: _jsx("strong", {}),
|
|
96
97
|
});
|
|
97
98
|
return (_jsx(Nudge, { buttonText: sprintf(
|
|
98
|
-
/* Translators: number of requests */
|
|
99
|
+
/* Translators: %d: the number of requests */
|
|
99
100
|
__('Upgrade to %d requests', 'jetpack-ai-client'), nextTier.limit), checkoutUrl: checkoutUrl, className: 'jetpack-ai-upgrade-banner', description: description || upgradeDescription, goToCheckoutPage: handleUpgradeClick, visible: true, align: 'center', title: null, context: null, target: "_blank" }));
|
|
100
101
|
}
|
|
101
102
|
return (_jsx(Nudge, { buttonText: __('Upgrade', 'jetpack-ai-client'), checkoutUrl: checkoutUrl, className: 'jetpack-ai-upgrade-banner', description: createInterpolateElement(__('Congratulations on exploring Jetpack AI and reaching the free requests limit! <strong>Upgrade now to keep using it.</strong>', 'jetpack-ai-client'), {
|
|
@@ -4,5 +4,5 @@ import { __ } from '@wordpress/i18n';
|
|
|
4
4
|
import './style.scss';
|
|
5
5
|
export const LightNudge = ({ title, description, buttonText = null, checkoutUrl = null, goToCheckoutPage = null, isRedirecting = false, showButton = true, target = '_top', }) => {
|
|
6
6
|
const redirectingText = __('Redirecting…', 'jetpack-ai-client');
|
|
7
|
-
return (_jsx("div", { className: "jetpack-upgrade-plan-banner-light", children: _jsx(Notice, { status: "error", isDismissible: false, children: _jsxs("p", { children: [title && _jsx("strong", { children: title }), description, ' ', showButton && (_jsx(Button, { href: isRedirecting ? null : checkoutUrl, onClick: goToCheckoutPage, variant: "link", target: target, children: isRedirecting ? redirectingText : buttonText }))] }) }) }));
|
|
7
|
+
return (_jsx("div", { className: "jetpack-upgrade-plan-banner-light", children: _jsx(Notice, { status: "error", isDismissible: false, children: _jsxs("p", { children: [title && _jsx("strong", { children: title }), description, ' ', showButton && (_jsx(Button, { href: isRedirecting ? null : checkoutUrl, onClick: goToCheckoutPage, variant: "link", target: target, children: _jsx("span", { children: isRedirecting ? redirectingText : buttonText }) }))] }) }) }));
|
|
8
8
|
};
|
package/build/constants.d.ts
CHANGED
|
@@ -1,80 +1,80 @@
|
|
|
1
1
|
export declare const LANGUAGE_MAP: {
|
|
2
2
|
en: {
|
|
3
|
-
label:
|
|
3
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"English">;
|
|
4
4
|
};
|
|
5
5
|
es: {
|
|
6
|
-
label:
|
|
6
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Spanish">;
|
|
7
7
|
};
|
|
8
8
|
fr: {
|
|
9
|
-
label:
|
|
9
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"French">;
|
|
10
10
|
};
|
|
11
11
|
de: {
|
|
12
|
-
label:
|
|
12
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"German">;
|
|
13
13
|
};
|
|
14
14
|
it: {
|
|
15
|
-
label:
|
|
15
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Italian">;
|
|
16
16
|
};
|
|
17
17
|
pt: {
|
|
18
|
-
label:
|
|
18
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Portuguese">;
|
|
19
19
|
};
|
|
20
20
|
ru: {
|
|
21
|
-
label:
|
|
21
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Russian">;
|
|
22
22
|
};
|
|
23
23
|
zh: {
|
|
24
|
-
label:
|
|
24
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Chinese">;
|
|
25
25
|
};
|
|
26
26
|
ja: {
|
|
27
|
-
label:
|
|
27
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Japanese">;
|
|
28
28
|
};
|
|
29
29
|
ar: {
|
|
30
|
-
label:
|
|
30
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Arabic">;
|
|
31
31
|
};
|
|
32
32
|
hi: {
|
|
33
|
-
label:
|
|
33
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Hindi">;
|
|
34
34
|
};
|
|
35
35
|
ko: {
|
|
36
|
-
label:
|
|
36
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Korean">;
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
39
|
export declare const PROMPT_TONES_MAP: {
|
|
40
40
|
formal: {
|
|
41
|
-
label:
|
|
41
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Formal">;
|
|
42
42
|
emoji: string;
|
|
43
43
|
};
|
|
44
44
|
informal: {
|
|
45
|
-
label:
|
|
45
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Informal">;
|
|
46
46
|
emoji: string;
|
|
47
47
|
};
|
|
48
48
|
optimistic: {
|
|
49
|
-
label:
|
|
49
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Optimistic">;
|
|
50
50
|
emoji: string;
|
|
51
51
|
};
|
|
52
52
|
humorous: {
|
|
53
|
-
label:
|
|
53
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Humorous">;
|
|
54
54
|
emoji: string;
|
|
55
55
|
};
|
|
56
56
|
serious: {
|
|
57
|
-
label:
|
|
57
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Serious">;
|
|
58
58
|
emoji: string;
|
|
59
59
|
};
|
|
60
60
|
skeptical: {
|
|
61
|
-
label:
|
|
61
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Skeptical">;
|
|
62
62
|
emoji: string;
|
|
63
63
|
};
|
|
64
64
|
empathetic: {
|
|
65
|
-
label:
|
|
65
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Empathetic">;
|
|
66
66
|
emoji: string;
|
|
67
67
|
};
|
|
68
68
|
confident: {
|
|
69
|
-
label:
|
|
69
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Confident">;
|
|
70
70
|
emoji: string;
|
|
71
71
|
};
|
|
72
72
|
passionate: {
|
|
73
|
-
label:
|
|
73
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Passionate">;
|
|
74
74
|
emoji: string;
|
|
75
75
|
};
|
|
76
76
|
provocative: {
|
|
77
|
-
label:
|
|
77
|
+
label: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Provocative">;
|
|
78
78
|
emoji: string;
|
|
79
79
|
};
|
|
80
80
|
};
|
|
@@ -92,18 +92,18 @@ export declare const PROMPT_TYPE_USER_PROMPT: "userPrompt";
|
|
|
92
92
|
export declare const PROMPT_TYPE_JETPACK_FORM_CUSTOM_PROMPT: "jetpackFormCustomPrompt";
|
|
93
93
|
export declare const PROMPT_TYPE_TRANSFORM_LIST_TO_TABLE: "transformListToTable";
|
|
94
94
|
export declare const PROMPT_TYPE_WRITE_POST_FROM_LIST: "writePostFromList";
|
|
95
|
-
export declare const TRANSLATE_LABEL:
|
|
96
|
-
export declare const TONE_LABEL:
|
|
97
|
-
export declare const CORRECT_SPELLING_LABEL:
|
|
98
|
-
export declare const SIMPLIFY_LABEL:
|
|
99
|
-
export declare const SUMMARIZE_LABEL:
|
|
100
|
-
export declare const MAKE_SHORTER_LABEL:
|
|
101
|
-
export declare const MAKE_LONGER_LABEL:
|
|
102
|
-
export declare const TURN_LIST_INTO_TABLE_LABEL:
|
|
103
|
-
export declare const WRITE_POST_FROM_LIST_LABEL:
|
|
104
|
-
export declare const GENERATE_TITLE_LABEL:
|
|
105
|
-
export declare const SUMMARY_BASED_ON_TITLE_LABEL:
|
|
106
|
-
export declare const CONTINUE_LABEL:
|
|
95
|
+
export declare const TRANSLATE_LABEL: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Translate">;
|
|
96
|
+
export declare const TONE_LABEL: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Change tone">;
|
|
97
|
+
export declare const CORRECT_SPELLING_LABEL: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Correct spelling and grammar">;
|
|
98
|
+
export declare const SIMPLIFY_LABEL: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Simplify">;
|
|
99
|
+
export declare const SUMMARIZE_LABEL: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Summarize">;
|
|
100
|
+
export declare const MAKE_SHORTER_LABEL: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Make shorter">;
|
|
101
|
+
export declare const MAKE_LONGER_LABEL: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Expand">;
|
|
102
|
+
export declare const TURN_LIST_INTO_TABLE_LABEL: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Turn list into a table">;
|
|
103
|
+
export declare const WRITE_POST_FROM_LIST_LABEL: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Write a post from this list">;
|
|
104
|
+
export declare const GENERATE_TITLE_LABEL: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Generate a post title">;
|
|
105
|
+
export declare const SUMMARY_BASED_ON_TITLE_LABEL: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Summary based on title">;
|
|
106
|
+
export declare const CONTINUE_LABEL: import("@wordpress/i18n/build-types/types.js").TranslatableText<"Continue writing">;
|
|
107
107
|
export declare const PLACEMENT_JETPACK_SIDEBAR: "jetpack-sidebar";
|
|
108
108
|
export declare const PLACEMENT_DOCUMENT_SETTINGS: "document-settings";
|
|
109
109
|
export declare const PLACEMENT_PRE_PUBLISH: "pre-publish";
|
|
@@ -156,5 +156,5 @@ export const Prompt = ({ initialPrompt = '' }) => {
|
|
|
156
156
|
}, [context, setStyle, recordTracksEvent]);
|
|
157
157
|
return (_jsxs("div", { className: "jetpack-ai-logo-generator__prompt", children: [_jsxs("div", { className: "jetpack-ai-logo-generator__prompt-header", children: [_jsx("div", { className: "jetpack-ai-logo-generator__prompt-label", children: __('Describe your site:', 'jetpack-ai-client') }), _jsx("div", { className: "jetpack-ai-logo-generator__prompt-actions", children: _jsxs(Button, { variant: "link", disabled: isBusy || requireUpgrade || !hasPrompt, onClick: onEnhance, children: [_jsx(AiIcon, {}), enhanceButtonLabel] }) }), showStyleSelector && (_jsx(SelectControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, value: style, options: styles, onChange: updateStyle, disabled: isBusy || requireUpgrade }))] }), _jsx(AiModalPromptInput, { prompt: prompt, setPrompt: setPrompt, generateHandler: onGenerate, disabled: isBusy || requireUpgrade, actionDisabled: isBusy || requireUpgrade || !hasPrompt, placeholder: __('Describe your site or simply ask for a logo specifying some details about it', 'jetpack-ai-client') }), _jsxs("div", { className: "jetpack-ai-logo-generator__prompt-footer", children: [!isUnlimited && !requireUpgrade && (_jsxs("div", { className: "jetpack-ai-logo-generator__prompt-requests", children: [_jsx("div", { children: sprintf(
|
|
158
158
|
// translators: %u is the number of requests
|
|
159
|
-
__('%u requests remaining.', 'jetpack-ai-client'), requestsRemaining) }), hasNextTier && (_jsxs(_Fragment, { children: ["\u00A0", _jsx(Button, { variant: "link", href: checkoutUrl, target: "_blank", onClick: onUpgradeClick, children: __('Upgrade', 'jetpack-ai-client') })] })), "\u00A0", _jsx(Tooltip, { text: __('Logo generation costs 10 requests; prompt enhancement costs 1 request each', 'jetpack-ai-client'), placement: "bottom", children: _jsx(Icon, { className: "prompt-footer__icon", icon: info }) })] })), requireUpgrade && tierPlansEnabled && _jsx(UpgradeNudge, {}), requireUpgrade && !tierPlansEnabled && _jsx(FairUsageNotice, {}), enhancePromptFetchError && (_jsx("div", { className: "jetpack-ai-logo-generator__prompt-error", children: __('Error enhancing prompt. Please try again.', 'jetpack-ai-client') })), logoFetchError && (_jsx("div", { className: "jetpack-ai-logo-generator__prompt-error", children: __('Error generating logo. Please try again.', 'jetpack-ai-client') }))] })] }));
|
|
159
|
+
__('%u requests remaining.', 'jetpack-ai-client'), requestsRemaining) }), hasNextTier && (_jsxs(_Fragment, { children: ["\u00A0", _jsx(Button, { variant: "link", href: checkoutUrl, target: "_blank", onClick: onUpgradeClick, children: _jsx("span", { children: __('Upgrade', 'jetpack-ai-client') }) })] })), "\u00A0", _jsx(Tooltip, { text: __('Logo generation costs 10 requests; prompt enhancement costs 1 request each', 'jetpack-ai-client'), placement: "bottom", children: _jsx(Icon, { className: "prompt-footer__icon", icon: info }) })] })), requireUpgrade && tierPlansEnabled && _jsx(UpgradeNudge, {}), requireUpgrade && !tierPlansEnabled && _jsx(FairUsageNotice, {}), enhancePromptFetchError && (_jsx("div", { className: "jetpack-ai-logo-generator__prompt-error", children: __('Error enhancing prompt. Please try again.', 'jetpack-ai-client') })), logoFetchError && (_jsx("div", { className: "jetpack-ai-logo-generator__prompt-error", children: __('Error generating logo. Please try again.', 'jetpack-ai-client') }))] })] }));
|
|
160
160
|
};
|
|
@@ -26,5 +26,5 @@ export const UpgradeNudge = () => {
|
|
|
26
26
|
const handleUpgradeClick = () => {
|
|
27
27
|
recordTracksEvent(EVENT_UPGRADE, { context, placement: EVENT_PLACEMENT_UPGRADE_PROMPT });
|
|
28
28
|
};
|
|
29
|
-
return (_jsx("div", { className: "jetpack-upgrade-plan-banner", children: _jsxs("div", { className: "jetpack-upgrade-plan-banner__wrapper", children: [_jsxs("div", { children: [_jsx(Icon, { className: "jetpack-upgrade-plan-banner__icon", icon: warning }), _jsx("span", { className: "jetpack-upgrade-plan-banner__banner-description", children: upgradeMessage })] }), _jsx(Button, { href: checkoutUrl, target: "_blank", className: "is-primary", onClick: handleUpgradeClick, children: buttonText })] }) }));
|
|
29
|
+
return (_jsx("div", { className: "jetpack-upgrade-plan-banner", children: _jsxs("div", { className: "jetpack-upgrade-plan-banner__wrapper", children: [_jsxs("div", { children: [_jsx(Icon, { className: "jetpack-upgrade-plan-banner__icon", icon: warning }), _jsx("span", { className: "jetpack-upgrade-plan-banner__banner-description", children: upgradeMessage })] }), _jsx(Button, { href: checkoutUrl, target: "_blank", className: "is-primary", onClick: handleUpgradeClick, children: _jsx("span", { children: buttonText }) })] }) }));
|
|
30
30
|
};
|
|
@@ -24,5 +24,5 @@ export const UpgradeScreen = ({ onCancel, upgradeURL, reason }) => {
|
|
|
24
24
|
recordTracksEvent(EVENT_UPGRADE, { context, placement: EVENT_PLACEMENT_FREE_USER_SCREEN });
|
|
25
25
|
onCancel();
|
|
26
26
|
};
|
|
27
|
-
return (_jsxs("div", { className: "jetpack-ai-logo-generator-modal__notice-message-wrapper", children: [_jsxs("div", { className: "jetpack-ai-logo-generator-modal__notice-message", children: [_jsx("span", { className: "jetpack-ai-logo-generator-modal__loading-message", children: reason === 'feature' ? upgradeMessageFeature : upgradeMessageRequests }), "\u00A0", _jsx(Button, { variant: "link", href: upgradeInfoUrl, target: "_blank", children: __('Learn more about Jetpack AI.', 'jetpack-ai-client') })] }), _jsxs("div", { className: "jetpack-ai-logo-generator-modal__notice-actions", children: [_jsx(Button, { variant: "tertiary", onClick: onCancel, children: __('Cancel', 'jetpack-ai-client') }), _jsx(Button, { variant: "primary", href: upgradeURL, target: "_blank", onClick: handleUpgradeClick, children: __('Upgrade', 'jetpack-ai-client') })] })] }));
|
|
27
|
+
return (_jsxs("div", { className: "jetpack-ai-logo-generator-modal__notice-message-wrapper", children: [_jsxs("div", { className: "jetpack-ai-logo-generator-modal__notice-message", children: [_jsx("span", { className: "jetpack-ai-logo-generator-modal__loading-message", children: reason === 'feature' ? upgradeMessageFeature : upgradeMessageRequests }), "\u00A0", _jsx(Button, { variant: "link", href: upgradeInfoUrl, target: "_blank", children: _jsx("span", { children: __('Learn more about Jetpack AI.', 'jetpack-ai-client') }) })] }), _jsxs("div", { className: "jetpack-ai-logo-generator-modal__notice-actions", children: [_jsx(Button, { variant: "tertiary", onClick: onCancel, children: _jsx("span", { children: __('Cancel', 'jetpack-ai-client') }) }), _jsx(Button, { variant: "primary", href: upgradeURL, target: "_blank", onClick: handleUpgradeClick, children: _jsx("span", { children: __('Upgrade', 'jetpack-ai-client') }) })] })] }));
|
|
28
28
|
};
|
|
@@ -12,5 +12,5 @@ import clsx from 'clsx';
|
|
|
12
12
|
import jetpackLogo from '../assets/images/jetpack-logo.svg';
|
|
13
13
|
import './visit-site-banner.scss';
|
|
14
14
|
export const VisitSiteBanner = ({ className = null, onVisitBlankTarget }) => {
|
|
15
|
-
return (_jsxs("div", { className: clsx('jetpack-ai-logo-generator-modal-visit-site-banner', className), children: [_jsx("div", { className: "jetpack-ai-logo-generator-modal-visit-site-banner__jetpack-logo", children: _jsx("img", { src: jetpackLogo, alt: "Jetpack" }) }), _jsxs("div", { className: "jetpack-ai-logo-generator-modal-visit-site-banner__content", children: [_jsx("strong", { children: __('Do you want to know all the amazing things you can do with Jetpack AI?', 'jetpack-ai-client') }), _jsx("span", { children: __('Generate and tweak content, create forms, get feedback and much more.', 'jetpack-ai-client') }), _jsx("div", { children: _jsxs(Button, { variant: "link", href: "https://jetpack.com/redirect/?source=logo_generator_learn_more_about_jetpack_ai", target: "_blank", onClick: onVisitBlankTarget ? onVisitBlankTarget : null, children: [__('Learn more about Jetpack AI', 'jetpack-ai-client'), _jsx(Icon, { icon: external, size: 20 })] }) })] })] }));
|
|
15
|
+
return (_jsxs("div", { className: clsx('jetpack-ai-logo-generator-modal-visit-site-banner', className), children: [_jsx("div", { className: "jetpack-ai-logo-generator-modal-visit-site-banner__jetpack-logo", children: _jsx("img", { src: jetpackLogo, alt: "Jetpack" }) }), _jsxs("div", { className: "jetpack-ai-logo-generator-modal-visit-site-banner__content", children: [_jsx("strong", { children: __('Do you want to know all the amazing things you can do with Jetpack AI?', 'jetpack-ai-client') }), _jsx("span", { children: __('Generate and tweak content, create forms, get feedback and much more.', 'jetpack-ai-client') }), _jsx("div", { children: _jsxs(Button, { variant: "link", href: "https://jetpack.com/redirect/?source=logo_generator_learn_more_about_jetpack_ai", target: "_blank", onClick: onVisitBlankTarget ? onVisitBlankTarget : null, children: [_jsx("span", { children: __('Learn more about Jetpack AI', 'jetpack-ai-client') }), _jsx(Icon, { icon: external, size: 20 })] }) })] })] }));
|
|
16
16
|
};
|
|
@@ -24,7 +24,7 @@ const useFairUsageNoticeMessage = () => {
|
|
|
24
24
|
nextUsagePeriodStartDate.getDate());
|
|
25
25
|
};
|
|
26
26
|
const getFairUsageNoticeMessage = resetDateString => {
|
|
27
|
-
const fairUsageMessage = __("You've reached this month's request limit, per our <link>fair usage policy</link>.", 'jetpack-ai-client');
|
|
27
|
+
const fairUsageMessage = __("You've reached this month's request limit, per our <link><span>fair usage policy</span></link>.", 'jetpack-ai-client');
|
|
28
28
|
if (!resetDateString) {
|
|
29
29
|
return fairUsageMessage;
|
|
30
30
|
}
|
|
@@ -41,6 +41,7 @@ const useFairUsageNoticeMessage = () => {
|
|
|
41
41
|
});
|
|
42
42
|
const fairUsageNoticeMessageElement = createInterpolateElement(fairUsageNoticeMessage, {
|
|
43
43
|
link: _jsx("a", { href: upgradeInfoUrl, target: "_blank", rel: "noreferrer" }),
|
|
44
|
+
span: _jsx("span", {}),
|
|
44
45
|
});
|
|
45
46
|
return fairUsageNoticeMessageElement;
|
|
46
47
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"private": false,
|
|
3
2
|
"name": "@automattic/jetpack-ai-client",
|
|
4
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.6",
|
|
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",
|
|
7
7
|
"bugs": {
|
|
@@ -14,27 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "GPL-2.0-or-later",
|
|
16
16
|
"author": "Automattic",
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "pnpm run clean && pnpm run compile-ts",
|
|
19
|
-
"clean": "rm -rf build/",
|
|
20
|
-
"compile-ts": "tsc --pretty",
|
|
21
|
-
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
22
|
-
"test-coverage": "pnpm run test --coverage",
|
|
23
|
-
"typecheck": "tsc --noEmit",
|
|
24
|
-
"watch": "tsc --watch --pretty"
|
|
25
|
-
},
|
|
26
17
|
"type": "module",
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"@storybook/addon-docs": "9.0.15",
|
|
29
|
-
"@storybook/react": "9.0.15",
|
|
30
|
-
"@testing-library/dom": "10.4.0",
|
|
31
|
-
"@types/markdown-it": "14.1.2",
|
|
32
|
-
"@types/turndown": "5.0.5",
|
|
33
|
-
"jest": "30.0.4",
|
|
34
|
-
"jest-environment-jsdom": "30.0.4",
|
|
35
|
-
"storybook": "9.0.15",
|
|
36
|
-
"typescript": "5.8.3"
|
|
37
|
-
},
|
|
38
18
|
"exports": {
|
|
39
19
|
".": {
|
|
40
20
|
"types": "./build/index.d.ts",
|
|
@@ -43,36 +23,56 @@
|
|
|
43
23
|
},
|
|
44
24
|
"main": "./build/index.js",
|
|
45
25
|
"types": "./build/index.d.ts",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "pnpm run clean && pnpm run compile-ts",
|
|
28
|
+
"clean": "rm -rf build/",
|
|
29
|
+
"compile-ts": "tsc --pretty",
|
|
30
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
31
|
+
"test-coverage": "pnpm run test --coverage",
|
|
32
|
+
"typecheck": "tsc --noEmit",
|
|
33
|
+
"watch": "tsc --watch --pretty"
|
|
34
|
+
},
|
|
46
35
|
"dependencies": {
|
|
47
|
-
"@automattic/jetpack-base-styles": "^1.0.
|
|
48
|
-
"@automattic/jetpack-components": "^1.1.
|
|
49
|
-
"@automattic/jetpack-connection": "^1.
|
|
36
|
+
"@automattic/jetpack-base-styles": "^1.0.7",
|
|
37
|
+
"@automattic/jetpack-components": "^1.1.18",
|
|
38
|
+
"@automattic/jetpack-connection": "^1.4.1",
|
|
50
39
|
"@automattic/jetpack-explat": "workspace:*",
|
|
51
|
-
"@automattic/jetpack-script-data": "^0.5.
|
|
52
|
-
"@automattic/jetpack-shared-extension-utils": "^1.3.
|
|
40
|
+
"@automattic/jetpack-script-data": "^0.5.1",
|
|
41
|
+
"@automattic/jetpack-shared-extension-utils": "^1.3.10",
|
|
53
42
|
"@microsoft/fetch-event-source": "2.0.1",
|
|
54
43
|
"@types/jest": "30.0.0",
|
|
55
44
|
"@types/react": "18.3.23",
|
|
56
45
|
"@types/wordpress__block-editor": "11.5.16",
|
|
57
|
-
"@wordpress/api-fetch": "7.
|
|
58
|
-
"@wordpress/base-styles": "6.
|
|
59
|
-
"@wordpress/blob": "4.
|
|
60
|
-
"@wordpress/block-editor": "
|
|
61
|
-
"@wordpress/blocks": "
|
|
62
|
-
"@wordpress/components": "
|
|
63
|
-
"@wordpress/compose": "7.
|
|
64
|
-
"@wordpress/data": "10.
|
|
65
|
-
"@wordpress/editor": "14.
|
|
66
|
-
"@wordpress/element": "6.
|
|
67
|
-
"@wordpress/i18n": "
|
|
68
|
-
"@wordpress/icons": "10.
|
|
69
|
-
"@wordpress/primitives": "4.
|
|
70
|
-
"@wordpress/url": "4.
|
|
46
|
+
"@wordpress/api-fetch": "7.27.0",
|
|
47
|
+
"@wordpress/base-styles": "6.3.0",
|
|
48
|
+
"@wordpress/blob": "4.27.0",
|
|
49
|
+
"@wordpress/block-editor": "15.0.0",
|
|
50
|
+
"@wordpress/blocks": "15.0.0",
|
|
51
|
+
"@wordpress/components": "30.0.0",
|
|
52
|
+
"@wordpress/compose": "7.27.0",
|
|
53
|
+
"@wordpress/data": "10.27.0",
|
|
54
|
+
"@wordpress/editor": "14.27.0",
|
|
55
|
+
"@wordpress/element": "6.27.0",
|
|
56
|
+
"@wordpress/i18n": "6.0.0",
|
|
57
|
+
"@wordpress/icons": "10.27.0",
|
|
58
|
+
"@wordpress/primitives": "4.27.0",
|
|
59
|
+
"@wordpress/url": "4.27.0",
|
|
71
60
|
"clsx": "2.1.1",
|
|
72
61
|
"debug": "4.4.1",
|
|
73
62
|
"markdown-it": "14.1.0",
|
|
74
63
|
"react": "18.3.1",
|
|
75
64
|
"react-dom": "18.3.1",
|
|
76
65
|
"turndown": "7.1.2"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@storybook/addon-docs": "9.0.15",
|
|
69
|
+
"@storybook/react": "9.0.15",
|
|
70
|
+
"@testing-library/dom": "10.4.0",
|
|
71
|
+
"@types/markdown-it": "14.1.2",
|
|
72
|
+
"@types/turndown": "5.0.5",
|
|
73
|
+
"jest": "30.0.4",
|
|
74
|
+
"jest-environment-jsdom": "30.0.4",
|
|
75
|
+
"storybook": "9.0.15",
|
|
76
|
+
"typescript": "5.8.3"
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use
|
|
1
|
+
@use "@automattic/jetpack-base-styles/root-variables";
|
|
2
2
|
|
|
3
3
|
.jetpack-components-ai-control__container-wrapper {
|
|
4
4
|
position: sticky;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
box-shadow: 0 12px 15px 0 rgba(0, 0, 0, 0.12), 0 3px 9px 0 rgba(0, 0, 0, 0.12), 0 1px 3px 0 rgba(0, 0, 0, 0.15);
|
|
12
12
|
font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
13
13
|
border-radius: 6px;
|
|
14
|
-
border: 1px solid var(--gutenberg-gray-400, #
|
|
14
|
+
border: 1px solid var(--gutenberg-gray-400, #ccc);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.jetpack-components-ai-control__wrapper {
|
|
@@ -119,7 +119,8 @@ export default function useAiImage( {
|
|
|
119
119
|
|
|
120
120
|
// the selec/useEffect combo...
|
|
121
121
|
const loadedMedia = useSelect(
|
|
122
|
-
( select: ( store ) => CoreSelectors ) =>
|
|
122
|
+
( select: ( store ) => CoreSelectors ) =>
|
|
123
|
+
select( 'core' )?.getEntityRecord?.( 'postType', 'attachment', previousMediaId ),
|
|
123
124
|
[ previousMediaId ]
|
|
124
125
|
);
|
|
125
126
|
useEffect( () => {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
textarea {
|
|
31
31
|
width: 100%;
|
|
32
32
|
outline: none;
|
|
33
|
-
border: 1px solid #
|
|
33
|
+
border: 1px solid #ccc;
|
|
34
34
|
border-radius: 6px;
|
|
35
35
|
padding: 12px;
|
|
36
36
|
color: var(--studio-black);
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
margin-top: 32px;
|
|
77
77
|
margin-bottom: -32px;
|
|
78
78
|
padding: 8px 32px;
|
|
79
|
-
border-top: solid 1px #
|
|
79
|
+
border-top: solid 1px #dcdcde;
|
|
80
80
|
height: 60px;
|
|
81
81
|
|
|
82
82
|
&__feedback-button {
|
|
@@ -209,7 +209,7 @@ export function UpgradeMessage( {
|
|
|
209
209
|
href={ upgradeUrl }
|
|
210
210
|
target={ upgradeUrl ? '_blank' : null }
|
|
211
211
|
>
|
|
212
|
-
{ __( 'Upgrade now', 'jetpack-ai-client' ) }
|
|
212
|
+
<span>{ __( 'Upgrade now', 'jetpack-ai-client' ) }</span>
|
|
213
213
|
</Button>
|
|
214
214
|
</Message>
|
|
215
215
|
);
|
|
@@ -246,11 +246,11 @@ export function ErrorMessage( {
|
|
|
246
246
|
href={ upgradeUrl }
|
|
247
247
|
target={ upgradeUrl ? '_blank' : null }
|
|
248
248
|
>
|
|
249
|
-
{ __( 'Upgrade now', 'jetpack-ai-client' ) }
|
|
249
|
+
<span>{ __( 'Upgrade now', 'jetpack-ai-client' ) }</span>
|
|
250
250
|
</Button>
|
|
251
251
|
) : (
|
|
252
252
|
<Button variant="link" onClick={ onTryAgainClick }>
|
|
253
|
-
{ __( 'Try again', 'jetpack-ai-client' ) }
|
|
253
|
+
<span>{ __( 'Try again', 'jetpack-ai-client' ) }</span>
|
|
254
254
|
</Button>
|
|
255
255
|
) }
|
|
256
256
|
</Message>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use
|
|
1
|
+
@use "@automattic/jetpack-base-styles/root-variables";
|
|
2
2
|
|
|
3
3
|
.jetpack-ai-assistant__message {
|
|
4
4
|
display: flex;
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
color: var(--jp-gray-50);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
// Force padding 0 in link buttons, since default Gutenberg
|
|
36
|
-
// Buttons receive styles from edit-post-visual-editor.
|
|
35
|
+
// Force padding 0 in link buttons, since default Gutenberg in WordPress
|
|
36
|
+
// doesn't use iframe and Buttons receive styles from edit-post-visual-editor.
|
|
37
37
|
.components-button.is-link {
|
|
38
38
|
padding: 0;
|
|
39
39
|
}
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.jetpack-ai-assistant__message-severity-warning {
|
|
54
|
-
background-color: #
|
|
54
|
+
background-color: #fef8ee;
|
|
55
55
|
color: var(--jp-gray-100);
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
color: var(--jp-gray-100);
|
|
61
61
|
|
|
62
62
|
> svg {
|
|
63
|
-
fill: var(--jp-red-40, #
|
|
63
|
+
fill: var(--jp-red-40, #e65054);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -47,7 +47,7 @@ const useFairUsageNoticeMessage = () => {
|
|
|
47
47
|
|
|
48
48
|
const getFairUsageNoticeMessage = resetDateString => {
|
|
49
49
|
const fairUsageMessage = __(
|
|
50
|
-
"You've reached this month's request limit, per our <link>fair usage policy</link>.",
|
|
50
|
+
"You've reached this month's request limit, per our <link><span>fair usage policy</span></link>.",
|
|
51
51
|
'jetpack-ai-client'
|
|
52
52
|
);
|
|
53
53
|
|
|
@@ -75,6 +75,7 @@ const useFairUsageNoticeMessage = () => {
|
|
|
75
75
|
rel="noreferrer"
|
|
76
76
|
/>
|
|
77
77
|
),
|
|
78
|
+
span: <span />,
|
|
78
79
|
} );
|
|
79
80
|
|
|
80
81
|
return fairUsageNoticeMessageElement;
|
|
@@ -166,7 +167,7 @@ const DefaultUpgradePrompt = ( {
|
|
|
166
167
|
|
|
167
168
|
const upgradeDescription = createInterpolateElement(
|
|
168
169
|
sprintf(
|
|
169
|
-
/* Translators: number of requests */
|
|
170
|
+
/* Translators: %d: the number of requests allowed */
|
|
170
171
|
__(
|
|
171
172
|
'You have reached the requests limit for your current plan. <strong>Upgrade now to increase your requests limit to %d.</strong>',
|
|
172
173
|
'jetpack-ai-client'
|
|
@@ -181,7 +182,7 @@ const DefaultUpgradePrompt = ( {
|
|
|
181
182
|
return (
|
|
182
183
|
<Nudge
|
|
183
184
|
buttonText={ sprintf(
|
|
184
|
-
/* Translators: number of requests */
|
|
185
|
+
/* Translators: %d: the number of requests */
|
|
185
186
|
__( 'Upgrade to %d requests', 'jetpack-ai-client' ),
|
|
186
187
|
nextTier.limit
|
|
187
188
|
) }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use
|
|
1
|
+
@use "@automattic/jetpack-base-styles/style";
|
|
2
2
|
|
|
3
3
|
.jetpack-upgrade-plan-banner__wrapper {
|
|
4
4
|
column-gap: 32px;
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.jetpack-ai-fair-usage-notice {
|
|
32
|
-
color: #
|
|
32
|
+
color: #1e1e1e;
|
|
33
33
|
|
|
34
34
|
a {
|
|
35
|
-
color: #
|
|
35
|
+
color: #1e1e1e;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -307,7 +307,7 @@ export const Prompt = ( { initialPrompt = '' }: PromptProps ) => {
|
|
|
307
307
|
target="_blank"
|
|
308
308
|
onClick={ onUpgradeClick }
|
|
309
309
|
>
|
|
310
|
-
{ __( 'Upgrade', 'jetpack-ai-client' ) }
|
|
310
|
+
<span>{ __( 'Upgrade', 'jetpack-ai-client' ) }</span>
|
|
311
311
|
</Button>
|
|
312
312
|
</>
|
|
313
313
|
) }
|
|
@@ -52,12 +52,12 @@ export const UpgradeScreen: FC< {
|
|
|
52
52
|
</span>
|
|
53
53
|
|
|
54
54
|
<Button variant="link" href={ upgradeInfoUrl } target="_blank">
|
|
55
|
-
{ __( 'Learn more about Jetpack AI.', 'jetpack-ai-client' ) }
|
|
55
|
+
<span>{ __( 'Learn more about Jetpack AI.', 'jetpack-ai-client' ) }</span>
|
|
56
56
|
</Button>
|
|
57
57
|
</div>
|
|
58
58
|
<div className="jetpack-ai-logo-generator-modal__notice-actions">
|
|
59
59
|
<Button variant="tertiary" onClick={ onCancel }>
|
|
60
|
-
{ __( 'Cancel', 'jetpack-ai-client' ) }
|
|
60
|
+
<span>{ __( 'Cancel', 'jetpack-ai-client' ) }</span>
|
|
61
61
|
</Button>
|
|
62
62
|
<Button
|
|
63
63
|
variant="primary"
|
|
@@ -65,7 +65,7 @@ export const UpgradeScreen: FC< {
|
|
|
65
65
|
target="_blank"
|
|
66
66
|
onClick={ handleUpgradeClick }
|
|
67
67
|
>
|
|
68
|
-
{ __( 'Upgrade', 'jetpack-ai-client' ) }
|
|
68
|
+
<span>{ __( 'Upgrade', 'jetpack-ai-client' ) }</span>
|
|
69
69
|
</Button>
|
|
70
70
|
</div>
|
|
71
71
|
</div>
|
|
@@ -44,7 +44,7 @@ export const VisitSiteBanner: FC< {
|
|
|
44
44
|
target="_blank"
|
|
45
45
|
onClick={ onVisitBlankTarget ? onVisitBlankTarget : null }
|
|
46
46
|
>
|
|
47
|
-
{ __( 'Learn more about Jetpack AI', 'jetpack-ai-client' ) }
|
|
47
|
+
<span>{ __( 'Learn more about Jetpack AI', 'jetpack-ai-client' ) }</span>
|
|
48
48
|
<Icon icon={ external } size={ 20 } />
|
|
49
49
|
</Button>
|
|
50
50
|
</div>
|
|
@@ -33,7 +33,7 @@ const useFairUsageNoticeMessage = (): Element => {
|
|
|
33
33
|
|
|
34
34
|
const getFairUsageNoticeMessage = resetDateString => {
|
|
35
35
|
const fairUsageMessage = __(
|
|
36
|
-
"You've reached this month's request limit, per our <link>fair usage policy</link>.",
|
|
36
|
+
"You've reached this month's request limit, per our <link><span>fair usage policy</span></link>.",
|
|
37
37
|
'jetpack-ai-client'
|
|
38
38
|
);
|
|
39
39
|
|
|
@@ -59,6 +59,7 @@ const useFairUsageNoticeMessage = (): Element => {
|
|
|
59
59
|
|
|
60
60
|
const fairUsageNoticeMessageElement = createInterpolateElement( fairUsageNoticeMessage, {
|
|
61
61
|
link: <a href={ upgradeInfoUrl } target="_blank" rel="noreferrer" />,
|
|
62
|
+
span: <span />,
|
|
62
63
|
} );
|
|
63
64
|
|
|
64
65
|
return fairUsageNoticeMessageElement;
|