| @@ -6,10 +6,36 @@ | ||
| 6 | 6 | export const DASHBOARD_BASE_URL = 'https://dash.parsely.com'; |
| 7 | 7 | export const PUBLIC_API_BASE_URL = 'https://api.parsely.com/v2'; |
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | - * Periods that are available in the Content Helper. | |
| 10 | + * The maximum length of a free-text (custom) tone or persona, in characters. | |
| 11 | 11 | * |
| 12 | + * @since 3.24.0 | |
| 13 | + */ | |
| 14 | +export const MAX_CUSTOM_VALUE_LENGTH = 32; | |
| 15 | + | |
| 16 | +/** | |
| 17 | + * The key denoting that a free-text (custom) tone or persona is in use. | |
| 18 | + * | |
| 19 | + * @since 3.24.0 | |
| 20 | + */ | |
| 21 | +export const CUSTOM_VALUE = 'custom'; | |
| 22 | + | |
| 23 | +/** | |
| 24 | + * The tone and persona shipped with the plugin, shared by the suggestion | |
| 25 | + * features. Only a last resort: PHP injects the site's own defaults, which | |
| 26 | + * take precedence. | |
| 27 | + * | |
| 28 | + * Kept in sync with DEFAULT_PERSONA and DEFAULT_TONE in Suggestion_Defaults. | |
| 29 | + * | |
| 30 | + * @since 3.24.0 | |
| 31 | + */ | |
| 32 | +export const DEFAULT_PERSONA = 'journalist'; | |
| 33 | +export const DEFAULT_TONE = 'neutral'; | |
| 34 | + | |
| 35 | +/** | |
| 36 | + * Periods that are available in Content Intelligence. | |
| 37 | + * | |
| 12 | 38 | * @since 3.10.0 |
| 13 | 39 | * @since 3.11.0 Moved to constants.ts. |
| 14 | 40 | */ |
| 15 | 41 | export enum Period { |
| @@ -22,9 +48,9 @@ | ||
| 22 | 48 | Days30 = '30d' |
| 23 | 49 | } |
| 24 | 50 | |
| 25 | 51 | /** |
| 26 | - * Metrics that are available in the Content Helper. | |
| 52 | + * Metrics that are available in Content Intelligence. | |
| 27 | 53 | * |
| 28 | 54 | * @since 3.10.0 |
| 29 | 55 | * @since 3.11.0 Moved to constants.ts. |
| 30 | 56 | */ |
| @@ -33,9 +59,9 @@ | ||
| 33 | 59 | AvgEngaged = 'avg_engaged' |
| 34 | 60 | } |
| 35 | 61 | |
| 36 | 62 | /** |
| 37 | - * Post filter types that are available in the Content Helper. | |
| 63 | + * Post filter types that are available in Content Intelligence. | |
| 38 | 64 | * |
| 39 | 65 | * @since 3.11.0 |
| 40 | 66 | */ |
| 41 | 67 | export enum PostFilterType { |
| @@ -84,9 +110,9 @@ | ||
| 84 | 110 | ): string { |
| 85 | 111 | const timeValue = parseInt( period, 10 ); |
| 86 | 112 | const timeUnit = period.charAt( period.length - 1 ); |
| 87 | 113 | |
| 88 | - let description = __( 'Unknown Period', 'wp-parsely' ); | |
| 114 | + let description: string = __( 'Unknown Period', 'wp-parsely' ); | |
| 89 | 115 | |
| 90 | 116 | /* eslint-disable @wordpress/valid-sprintf */ |
| 91 | 117 | switch ( timeUnit ) { |
| 92 | 118 | case 'm': |