@voiceflow/dtos-interact 2.28.1 → 2.28.2-523fcfdb7c.147
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/build/main.d.ts +3 -0
- package/build/main.d.ts.map +1 -1
- package/build/main.js +3 -0
- package/build/main.js.map +1 -1
- package/build/request/request-config.dto.d.ts +1 -0
- package/build/request/request-config.dto.d.ts.map +1 -1
- package/build/request/request-config.dto.js +1 -0
- package/build/request/request-config.dto.js.map +1 -1
- package/build/socket/socket-client-start.dto.d.ts +1 -0
- package/build/socket/socket-client-start.dto.d.ts.map +1 -1
- package/build/socket/socket-client-start.dto.js +1 -0
- package/build/socket/socket-client-start.dto.js.map +1 -1
- package/build/socket/socket-message.dto.d.ts +2 -0
- package/build/socket/socket-message.dto.d.ts.map +1 -1
- package/build/widget-settings/widget-settings-chat-settings/widget-settings-chat-settings.dto.d.ts +17 -17
- package/build/widget-settings/widget-settings-chat-settings/widget-settings-chat-settings.dto.js +9 -9
- package/build/widget-settings/widget-settings-chat-settings/widget-settings-chat-settings.dto.js.map +1 -1
- package/build/widget-settings/widget-settings-locale.util.d.ts +8 -0
- package/build/widget-settings/widget-settings-locale.util.d.ts.map +1 -0
- package/build/widget-settings/widget-settings-locale.util.js +16 -0
- package/build/widget-settings/widget-settings-locale.util.js.map +1 -0
- package/build/widget-settings/widget-settings-localized-content.constant.d.ts +9 -0
- package/build/widget-settings/widget-settings-localized-content.constant.d.ts.map +1 -0
- package/build/widget-settings/widget-settings-localized-content.constant.js +299 -0
- package/build/widget-settings/widget-settings-localized-content.constant.js.map +1 -0
- package/build/widget-settings/widget-settings-localized-content.test.d.ts +2 -0
- package/build/widget-settings/widget-settings-localized-content.test.d.ts.map +1 -0
- package/build/widget-settings/widget-settings-localized-content.test.js +29 -0
- package/build/widget-settings/widget-settings-localized-content.test.js.map +1 -0
- package/build/widget-settings/widget-settings.constant.d.ts +77 -2
- package/build/widget-settings/widget-settings.constant.d.ts.map +1 -1
- package/build/widget-settings/widget-settings.constant.js +128 -15
- package/build/widget-settings/widget-settings.constant.js.map +1 -1
- package/build/widget-settings/widget-settings.dto.d.ts +90 -24
- package/build/widget-settings/widget-settings.dto.d.ts.map +1 -1
- package/build/widget-settings/widget-settings.dto.js +60 -5
- package/build/widget-settings/widget-settings.dto.js.map +1 -1
- package/build/widget-settings/widget-settings.util.d.ts +6 -0
- package/build/widget-settings/widget-settings.util.d.ts.map +1 -0
- package/build/widget-settings/widget-settings.util.js +7 -0
- package/build/widget-settings/widget-settings.util.js.map +1 -0
- package/package.json +2 -2
|
@@ -28,13 +28,74 @@ export const WIDGET_SETTINGS_DEFAULT_WIDTH = '400';
|
|
|
28
28
|
* A number (not a numeric string) because every consumer uses it for comparison.
|
|
29
29
|
*/
|
|
30
30
|
export const WIDGET_SETTINGS_MIN_WIDTH = 320;
|
|
31
|
+
/**
|
|
32
|
+
* The canonical set of widget content strings that are translatable — the shared contract between
|
|
33
|
+
* the creator-app editor (which writes `settings.widget.translations[locale][key]`) and the webchat
|
|
34
|
+
* widget (which reads it and resolves against the base catalog). Both repos MUST index
|
|
35
|
+
* `translations` by these exact key strings; a key present in one repo but not the other is a
|
|
36
|
+
* silently-broken translation. creator-app maps each key to its `settings.widget` path; webchat maps
|
|
37
|
+
* each to its `content.*` base-catalog key. URLs and images are intentionally excluded (never
|
|
38
|
+
* translated). Extend here — in one place — when a new content string becomes translatable.
|
|
39
|
+
*/
|
|
40
|
+
export const WIDGET_TRANSLATABLE_CONTENT_KEYS = [
|
|
41
|
+
'banner.title',
|
|
42
|
+
'banner.description',
|
|
43
|
+
'placeholderText',
|
|
44
|
+
'aiDisclaimer.text',
|
|
45
|
+
'disclaimer.title',
|
|
46
|
+
'disclaimer.description',
|
|
47
|
+
'disclaimer.primaryButtonText',
|
|
48
|
+
'disclaimer.secondaryButtonText',
|
|
49
|
+
'launcher.text',
|
|
50
|
+
'voice.callToActionText',
|
|
51
|
+
'voice.startButtonText',
|
|
52
|
+
'voice.listeningText',
|
|
53
|
+
'voice.talkingText',
|
|
54
|
+
'voice.endButtonText',
|
|
55
|
+
];
|
|
56
|
+
/**
|
|
57
|
+
* The Voiceflow default English copy for the 14 translatable content strings, keyed by
|
|
58
|
+
* {@link WidgetTranslatableContentKey}. This is the text every template and
|
|
59
|
+
* `WIDGET_SETTINGS_DEFAULT_SETTINGS` seed into new projects, and it is also the widget's identity
|
|
60
|
+
* check for "this is our copy": while a widget is multilingual, stored text exactly equal to its
|
|
61
|
+
* field's entry here renders from the shipped catalog in the visitor's language, and anything else
|
|
62
|
+
* is treated as customer-authored and rendered as-is.
|
|
63
|
+
*
|
|
64
|
+
* FROZEN. Changing or removing a string silently re-classifies every stored copy of the old string
|
|
65
|
+
* as customer-authored, so it stops translating. The webchat English catalog (`content.<key>` in
|
|
66
|
+
* `libs/chat/src/i18n/locales/en.json`) must equal this map exactly; a future copy change needs the
|
|
67
|
+
* widget to recognise both the old and the new string as ours before either side is edited.
|
|
68
|
+
*/
|
|
69
|
+
export const WIDGET_SETTINGS_FALLBACK_CONTENT = {
|
|
70
|
+
'banner.title': 'Your AI agent',
|
|
71
|
+
'banner.description': 'How can I help you today?',
|
|
72
|
+
placeholderText: 'Message...',
|
|
73
|
+
'aiDisclaimer.text': 'Generated by AI, double-check for accuracy.',
|
|
74
|
+
'disclaimer.title': 'Privacy notice',
|
|
75
|
+
'disclaimer.description': 'Before we can proceed with your conversation, we kindly ask you to review and accept our privacy policy, outlining how we handle and protect your personal information throughout our services.',
|
|
76
|
+
'disclaimer.primaryButtonText': 'Submit',
|
|
77
|
+
'disclaimer.secondaryButtonText': 'Privacy policy',
|
|
78
|
+
'launcher.text': 'Test your agent',
|
|
79
|
+
'voice.callToActionText': 'How can I help you?',
|
|
80
|
+
'voice.startButtonText': 'Start a call',
|
|
81
|
+
'voice.listeningText': 'Listening...',
|
|
82
|
+
'voice.talkingText': 'Talk to interrupt',
|
|
83
|
+
'voice.endButtonText': 'End',
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Settings for a widget with nothing stored. Carries the Voiceflow default copy for every
|
|
87
|
+
* translatable string (the same literals new projects have always been seeded with), and
|
|
88
|
+
* deliberately NO `languages` block: every path that falls back to this object (the `v13_00`
|
|
89
|
+
* backfill, a first save from a settings-less version, the runtime's fallback for a version with no
|
|
90
|
+
* widget settings) must produce a single-language widget. A `languages` block here would opt all of
|
|
91
|
+
* those projects into multilingual behaviour without anyone choosing it.
|
|
92
|
+
*/
|
|
31
93
|
export const WIDGET_SETTINGS_DEFAULT_SETTINGS = {
|
|
32
94
|
type: WidgetSettingsWidgetType.CHAT,
|
|
33
95
|
chat: {
|
|
34
96
|
voiceInput: true,
|
|
35
97
|
voiceOutput: false,
|
|
36
98
|
voiceMode: true,
|
|
37
|
-
notificationSound: false,
|
|
38
99
|
renderMode: WidgetSettingsChatRenderMode.WIDGET,
|
|
39
100
|
headerImage: {
|
|
40
101
|
enabled: true,
|
|
@@ -43,21 +104,21 @@ export const WIDGET_SETTINGS_DEFAULT_SETTINGS = {
|
|
|
43
104
|
enabled: true,
|
|
44
105
|
},
|
|
45
106
|
banner: {
|
|
107
|
+
title: WIDGET_SETTINGS_FALLBACK_CONTENT['banner.title'],
|
|
108
|
+
description: WIDGET_SETTINGS_FALLBACK_CONTENT['banner.description'],
|
|
46
109
|
enabled: true,
|
|
47
|
-
title: 'Your AI agent',
|
|
48
|
-
description: 'How can I help you today?',
|
|
49
110
|
},
|
|
50
|
-
placeholderText:
|
|
111
|
+
placeholderText: WIDGET_SETTINGS_FALLBACK_CONTENT.placeholderText,
|
|
51
112
|
aiDisclaimer: {
|
|
52
113
|
enabled: false,
|
|
53
|
-
text: '
|
|
114
|
+
text: WIDGET_SETTINGS_FALLBACK_CONTENT['aiDisclaimer.text'],
|
|
54
115
|
},
|
|
55
116
|
disclaimer: {
|
|
56
117
|
enabled: false,
|
|
57
|
-
title: '
|
|
58
|
-
description: '
|
|
59
|
-
primaryButtonText: '
|
|
60
|
-
secondaryButtonText: '
|
|
118
|
+
title: WIDGET_SETTINGS_FALLBACK_CONTENT['disclaimer.title'],
|
|
119
|
+
description: WIDGET_SETTINGS_FALLBACK_CONTENT['disclaimer.description'],
|
|
120
|
+
primaryButtonText: WIDGET_SETTINGS_FALLBACK_CONTENT['disclaimer.primaryButtonText'],
|
|
121
|
+
secondaryButtonText: WIDGET_SETTINGS_FALLBACK_CONTENT['disclaimer.secondaryButtonText'],
|
|
61
122
|
secondaryButtonURL: '',
|
|
62
123
|
},
|
|
63
124
|
handoffToAgentImageURL: '',
|
|
@@ -69,17 +130,17 @@ export const WIDGET_SETTINGS_DEFAULT_SETTINGS = {
|
|
|
69
130
|
voice: {
|
|
70
131
|
renderMode: WidgetSettingsVoiceRenderMode.FULL,
|
|
71
132
|
content: {
|
|
72
|
-
callToActionText: '
|
|
73
|
-
startButtonText: '
|
|
74
|
-
listeningText: '
|
|
75
|
-
talkingText: '
|
|
76
|
-
endButtonText: '
|
|
133
|
+
callToActionText: WIDGET_SETTINGS_FALLBACK_CONTENT['voice.callToActionText'],
|
|
134
|
+
startButtonText: WIDGET_SETTINGS_FALLBACK_CONTENT['voice.startButtonText'],
|
|
135
|
+
listeningText: WIDGET_SETTINGS_FALLBACK_CONTENT['voice.listeningText'],
|
|
136
|
+
talkingText: WIDGET_SETTINGS_FALLBACK_CONTENT['voice.talkingText'],
|
|
137
|
+
endButtonText: WIDGET_SETTINGS_FALLBACK_CONTENT['voice.endButtonText'],
|
|
77
138
|
},
|
|
78
139
|
},
|
|
79
140
|
common: {
|
|
80
141
|
fontFamily: 'UCity Pro',
|
|
81
142
|
launcher: {
|
|
82
|
-
text: '
|
|
143
|
+
text: WIDGET_SETTINGS_FALLBACK_CONTENT['launcher.text'],
|
|
83
144
|
type: WidgetSettingsLauncherType.BOTH,
|
|
84
145
|
},
|
|
85
146
|
poweredBy: true,
|
|
@@ -103,4 +164,56 @@ export const WIDGET_SETTINGS_DEFAULT_SETTINGS = {
|
|
|
103
164
|
disableTranscript: false,
|
|
104
165
|
},
|
|
105
166
|
};
|
|
167
|
+
/**
|
|
168
|
+
* The language config the settings UI starts from when a widget has none stored: English only.
|
|
169
|
+
* Pure config: it carries no `enabled` flag, so reading it never opts a widget in.
|
|
170
|
+
*/
|
|
171
|
+
export const WIDGET_SETTINGS_DEFAULT_LANGUAGES = {
|
|
172
|
+
default: 'en-US',
|
|
173
|
+
supported: ['en-US'],
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* Tier 1 of the widget language rollout: left-to-right locales the widget's font stack fully covers. The
|
|
177
|
+
* "All supported languages" option snapshots this list into `languages.supported`, and new projects
|
|
178
|
+
* start from it. Every entry is a `LegacyVFLocale` value — pinned by a test in `@voiceflow/utils-designer`,
|
|
179
|
+
* since that enum cannot be imported here.
|
|
180
|
+
*/
|
|
181
|
+
export const WIDGET_SHIPPED_LOCALES = [
|
|
182
|
+
'en-US',
|
|
183
|
+
'bg-BG',
|
|
184
|
+
'ca-ES',
|
|
185
|
+
'cs-CZ',
|
|
186
|
+
'da-DK',
|
|
187
|
+
'nl-NL',
|
|
188
|
+
'nl-BE',
|
|
189
|
+
'et-EE',
|
|
190
|
+
'fr-FR',
|
|
191
|
+
'fr-CA',
|
|
192
|
+
'de-DE',
|
|
193
|
+
'hu-HU',
|
|
194
|
+
'it-IT',
|
|
195
|
+
'pl-PL',
|
|
196
|
+
'pt-BR',
|
|
197
|
+
'pt-PT',
|
|
198
|
+
'ro-RO',
|
|
199
|
+
'ru-RU',
|
|
200
|
+
'es-ES',
|
|
201
|
+
'es-MX',
|
|
202
|
+
'tr-TR',
|
|
203
|
+
'uk-UA',
|
|
204
|
+
'vi-VN',
|
|
205
|
+
];
|
|
206
|
+
/**
|
|
207
|
+
* New-project language config: English only, multilingual off. `enabled` is derived from the language count
|
|
208
|
+
* (`supported.length > 1`), so a new project starts single-language and turns multilingual on only once its
|
|
209
|
+
* owner opts a second language in from the settings page.
|
|
210
|
+
*
|
|
211
|
+
* Applied ONLY at genuine new-project creation (`AssistantService.createOneFromTemplate` and
|
|
212
|
+
* `GenerationService.runAssistantGeneration`), gated by `FEAT_MULTILINGUAL_WIDGET`.
|
|
213
|
+
*/
|
|
214
|
+
export const WIDGET_SETTINGS_NEW_PROJECT_LANGUAGES = {
|
|
215
|
+
default: 'en-US',
|
|
216
|
+
supported: ['en-US'],
|
|
217
|
+
enabled: false,
|
|
218
|
+
};
|
|
106
219
|
//# sourceMappingURL=widget-settings.constant.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-settings.constant.js","sourceRoot":"","sources":["../../src/widget-settings/widget-settings.constant.ts"],"names":[],"mappings":"AACA,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC5B,0BAA0B,EAC1B,6BAA6B,EAC7B,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,CAAC,MAAM,kCAAkC,GAAG,SAAS,CAAC;AAE5D,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,EAAE,EAAE,SAAS;IACb,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,kCAAkC;IACvC,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;CACf,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,KAAK,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAE7C,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,IAAI,EAAE,wBAAwB,CAAC,IAAI;IAEnC,IAAI,EAAE;QACJ,UAAU,EAAE,IAAI;QAChB,WAAW,EAAE,KAAK;QAClB,SAAS,EAAE,IAAI;
|
|
1
|
+
{"version":3,"file":"widget-settings.constant.js","sour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AC,MAAM,qCAAqC,GAAG;IACnD,OAAO,EAAE,OAAO;IAChB,SAAS,EAAE,CAAC,OAAO,CAAC;IACpB,OAAO,EAAE,KAAK;CACoC,CAAC"}
|
|
@@ -30,11 +30,11 @@ export declare const WidgetSettingsPrimaryColorDTO: z.ZodObject<{
|
|
|
30
30
|
export type WidgetSettingsPrimaryColor = z.infer<typeof WidgetSettingsPrimaryColorDTO>;
|
|
31
31
|
export declare const WidgetSettingsVoiceSettingsContentDTO: z.ZodObject<{
|
|
32
32
|
imageURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
33
|
-
talkingText: z.ZodString
|
|
34
|
-
endButtonText: z.ZodString
|
|
35
|
-
listeningText: z.ZodString
|
|
36
|
-
startButtonText: z.ZodString
|
|
37
|
-
callToActionText: z.ZodString
|
|
33
|
+
talkingText: z.ZodOptional<z.ZodString>;
|
|
34
|
+
endButtonText: z.ZodOptional<z.ZodString>;
|
|
35
|
+
listeningText: z.ZodOptional<z.ZodString>;
|
|
36
|
+
startButtonText: z.ZodOptional<z.ZodString>;
|
|
37
|
+
callToActionText: z.ZodOptional<z.ZodString>;
|
|
38
38
|
}, z.core.$strip>;
|
|
39
39
|
export type WidgetSettingsVoiceSettingsContent = z.infer<typeof WidgetSettingsVoiceSettingsContentDTO>;
|
|
40
40
|
export declare const WidgetSettingsVoiceSettingsDTO: z.ZodObject<{
|
|
@@ -45,11 +45,11 @@ export declare const WidgetSettingsVoiceSettingsDTO: z.ZodObject<{
|
|
|
45
45
|
}>;
|
|
46
46
|
content: z.ZodObject<{
|
|
47
47
|
imageURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
48
|
-
talkingText: z.ZodString
|
|
49
|
-
endButtonText: z.ZodString
|
|
50
|
-
listeningText: z.ZodString
|
|
51
|
-
startButtonText: z.ZodString
|
|
52
|
-
callToActionText: z.ZodString
|
|
48
|
+
talkingText: z.ZodOptional<z.ZodString>;
|
|
49
|
+
endButtonText: z.ZodOptional<z.ZodString>;
|
|
50
|
+
listeningText: z.ZodOptional<z.ZodString>;
|
|
51
|
+
startButtonText: z.ZodOptional<z.ZodString>;
|
|
52
|
+
callToActionText: z.ZodOptional<z.ZodString>;
|
|
53
53
|
}, z.core.$strip>;
|
|
54
54
|
}, z.core.$strip>;
|
|
55
55
|
export type WidgetSettingsVoiceSettings = z.infer<typeof WidgetSettingsVoiceSettingsDTO>;
|
|
@@ -131,6 +131,61 @@ export declare const WidgetSettingsSecuritySettingsDTO: z.ZodObject<{
|
|
|
131
131
|
isTranscriptDownloadEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
132
132
|
}, z.core.$strip>;
|
|
133
133
|
export type WidgetSettingsSecuritySettings = z.infer<typeof WidgetSettingsSecuritySettingsDTO>;
|
|
134
|
+
/**
|
|
135
|
+
* Presentation-layer language config for the widget: the default UI language and the set of languages
|
|
136
|
+
* offered to end-users (`supported`, which always contains `default`, listed first). The visitor's
|
|
137
|
+
* language is auto-detected from their device against `supported`, falling back to `default`. Locale
|
|
138
|
+
* codes are members of the `LegacyVFLocale` enum, but stored as strings because that enum lives in
|
|
139
|
+
* `@voiceflow/dtos`, which depends on this package (so it cannot be imported here). The allowed set is
|
|
140
|
+
* enforced at the settings UI. Distinct from `version.prototype.data.locales`, which is the agent/NLU
|
|
141
|
+
* build locale — see COR-13728.
|
|
142
|
+
*
|
|
143
|
+
* `enabled` is the explicit per-project opt-in: the widget is multilingual only when it is `true`.
|
|
144
|
+
* Absent or `false` means the widget renders exactly as a single-language widget did before multilingual
|
|
145
|
+
* shipped, and no locale is sent to the runtime. Opting out writes `false` rather than removing the
|
|
146
|
+
* block, so the language config survives and re-enabling restores it.
|
|
147
|
+
*
|
|
148
|
+
* The pure opt-in roster (COR-14107) removed the legacy `mode`, `offered` and `chosen` fields; the
|
|
149
|
+
* settings UI coerces any config still carrying them into this shape on its next write.
|
|
150
|
+
*/
|
|
151
|
+
export declare const WidgetSettingsLanguageSettingsDTO: z.ZodObject<{
|
|
152
|
+
default: z.ZodString;
|
|
153
|
+
supported: z.ZodArray<z.ZodString>;
|
|
154
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
export type WidgetSettingsLanguageSettings = z.infer<typeof WidgetSettingsLanguageSettingsDTO>;
|
|
157
|
+
/**
|
|
158
|
+
* A single translation of one content string into one locale. `value` is the translated text;
|
|
159
|
+
* `sourceHash` is the sha256 hex of the source string it was derived from — stamped on machine results and
|
|
160
|
+
* on hand-edited overrides alike — so staleness is detectable when the source changes; `modified` marks a
|
|
161
|
+
* hand-edited translation (an override), which re-translation never clobbers unless explicitly asked;
|
|
162
|
+
* `failed` marks the last machine attempt for `sourceHash` as failed. A failed entry always has
|
|
163
|
+
* `value: ''`: the widget only uses a translation whose value is non-empty, so it falls back to the source
|
|
164
|
+
* text with no widget-side handling. Any later successful write replaces the entry and drops the flag.
|
|
165
|
+
*/
|
|
166
|
+
export declare const WidgetSettingsTranslationEntryDTO: z.ZodObject<{
|
|
167
|
+
value: z.ZodString;
|
|
168
|
+
sourceHash: z.ZodOptional<z.ZodString>;
|
|
169
|
+
modified: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
+
failed: z.ZodOptional<z.ZodBoolean>;
|
|
171
|
+
}, z.core.$strip>;
|
|
172
|
+
export type WidgetSettingsTranslationEntry = z.infer<typeof WidgetSettingsTranslationEntryDTO>;
|
|
173
|
+
/**
|
|
174
|
+
* Per-locale translations of widget content strings, keyed `[locale][contentKey]`. Only consulted
|
|
175
|
+
* while the widget is multilingual (`languages.enabled === true`). A hand-edited (`modified`) entry
|
|
176
|
+
* always wins; a machine entry only applies to customer-authored text, because stored text that
|
|
177
|
+
* exactly equals the Voiceflow default for its field renders from the widget's shipped catalog in
|
|
178
|
+
* the visitor's language instead. Partial per locale. Which keys are valid is enforced at the
|
|
179
|
+
* settings UI (`WIDGET_TRANSLATABLE_CONTENT_KEYS`), not here, so the schema stays migration-free as
|
|
180
|
+
* the translatable surface evolves. Locale codes match `languages.supported`.
|
|
181
|
+
*/
|
|
182
|
+
export declare const WidgetSettingsTranslationsDTO: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
183
|
+
value: z.ZodString;
|
|
184
|
+
sourceHash: z.ZodOptional<z.ZodString>;
|
|
185
|
+
modified: z.ZodOptional<z.ZodBoolean>;
|
|
186
|
+
failed: z.ZodOptional<z.ZodBoolean>;
|
|
187
|
+
}, z.core.$strip>>>;
|
|
188
|
+
export type WidgetSettingsTranslations = z.infer<typeof WidgetSettingsTranslationsDTO>;
|
|
134
189
|
export declare const WidgetSettingsDTO: z.ZodObject<{
|
|
135
190
|
type: z.ZodEnum<{
|
|
136
191
|
readonly CHAT: 'chat';
|
|
@@ -151,22 +206,22 @@ export declare const WidgetSettingsDTO: z.ZodObject<{
|
|
|
151
206
|
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
152
207
|
}, z.core.$strip>;
|
|
153
208
|
banner: z.ZodObject<{
|
|
154
|
-
title: z.ZodString
|
|
155
|
-
description: z.ZodString
|
|
209
|
+
title: z.ZodOptional<z.ZodString>;
|
|
210
|
+
description: z.ZodOptional<z.ZodString>;
|
|
156
211
|
enabled: z.ZodBoolean;
|
|
157
212
|
imageURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
158
213
|
}, z.core.$strip>;
|
|
159
|
-
placeholderText: z.ZodString
|
|
214
|
+
placeholderText: z.ZodOptional<z.ZodString>;
|
|
160
215
|
disclaimer: z.ZodOptional<z.ZodObject<{
|
|
161
216
|
enabled: z.ZodBoolean;
|
|
162
|
-
title: z.ZodString
|
|
163
|
-
description: z.ZodString
|
|
164
|
-
primaryButtonText: z.ZodString
|
|
165
|
-
secondaryButtonText: z.ZodString
|
|
166
|
-
secondaryButtonURL: z.ZodString
|
|
217
|
+
title: z.ZodOptional<z.ZodString>;
|
|
218
|
+
description: z.ZodOptional<z.ZodString>;
|
|
219
|
+
primaryButtonText: z.ZodOptional<z.ZodString>;
|
|
220
|
+
secondaryButtonText: z.ZodOptional<z.ZodString>;
|
|
221
|
+
secondaryButtonURL: z.ZodOptional<z.ZodString>;
|
|
167
222
|
}, z.core.$strip>>;
|
|
168
223
|
aiDisclaimer: z.ZodObject<{
|
|
169
|
-
text: z.ZodString
|
|
224
|
+
text: z.ZodOptional<z.ZodString>;
|
|
170
225
|
enabled: z.ZodBoolean;
|
|
171
226
|
}, z.core.$strip>;
|
|
172
227
|
handoffToAgentImageURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -201,11 +256,11 @@ export declare const WidgetSettingsDTO: z.ZodObject<{
|
|
|
201
256
|
}>;
|
|
202
257
|
content: z.ZodObject<{
|
|
203
258
|
imageURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
204
|
-
talkingText: z.ZodString
|
|
205
|
-
endButtonText: z.ZodString
|
|
206
|
-
listeningText: z.ZodString
|
|
207
|
-
startButtonText: z.ZodString
|
|
208
|
-
callToActionText: z.ZodString
|
|
259
|
+
talkingText: z.ZodOptional<z.ZodString>;
|
|
260
|
+
endButtonText: z.ZodOptional<z.ZodString>;
|
|
261
|
+
listeningText: z.ZodOptional<z.ZodString>;
|
|
262
|
+
startButtonText: z.ZodOptional<z.ZodString>;
|
|
263
|
+
callToActionText: z.ZodOptional<z.ZodString>;
|
|
209
264
|
}, z.core.$strip>;
|
|
210
265
|
}, z.core.$strip>;
|
|
211
266
|
common: z.ZodObject<{
|
|
@@ -262,6 +317,17 @@ export declare const WidgetSettingsDTO: z.ZodObject<{
|
|
|
262
317
|
disableTranscript: z.ZodBoolean;
|
|
263
318
|
isTranscriptDownloadEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
264
319
|
}, z.core.$strip>>;
|
|
320
|
+
languages: z.ZodOptional<z.ZodObject<{
|
|
321
|
+
default: z.ZodString;
|
|
322
|
+
supported: z.ZodArray<z.ZodString>;
|
|
323
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
324
|
+
}, z.core.$strip>>;
|
|
325
|
+
translations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
326
|
+
value: z.ZodString;
|
|
327
|
+
sourceHash: z.ZodOptional<z.ZodString>;
|
|
328
|
+
modified: z.ZodOptional<z.ZodBoolean>;
|
|
329
|
+
failed: z.ZodOptional<z.ZodBoolean>;
|
|
330
|
+
}, z.core.$strip>>>>;
|
|
265
331
|
}, z.core.$strip>;
|
|
266
332
|
export type WidgetSettings = z.infer<typeof WidgetSettingsDTO>;
|
|
267
333
|
//# sourceMappingURL=widget-settings.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-settings.dto.d.ts","sourceRoot":"","sources":["../../src/widget-settings/widget-settings.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,6BAA6B;;;;;;;;;;;iBAaG,CAAC;AAE9C,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEvF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;iBAKG,CAAC;AAE9C,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEvF,eAAO,MAAM,qCAAqC;;;;;;;iBASG,CAAC;AAEtD,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEvG,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;iBAKG,CAAC;AAE/C,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEzF,eAAO,MAAM,uCAAuC;;;;;;;;iBAMG,CAAC;AAExD,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCA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M,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEvF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUG,CAAC;AAElC,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -24,11 +24,11 @@ export const WidgetSettingsPrimaryColorDTO = z
|
|
|
24
24
|
export const WidgetSettingsVoiceSettingsContentDTO = z
|
|
25
25
|
.object({
|
|
26
26
|
imageURL: z.string().nullable().optional(),
|
|
27
|
-
talkingText: z.string(),
|
|
28
|
-
endButtonText: z.string(),
|
|
29
|
-
listeningText: z.string(),
|
|
30
|
-
startButtonText: z.string(),
|
|
31
|
-
callToActionText: z.string(),
|
|
27
|
+
talkingText: z.string().optional(),
|
|
28
|
+
endButtonText: z.string().optional(),
|
|
29
|
+
listeningText: z.string().optional(),
|
|
30
|
+
startButtonText: z.string().optional(),
|
|
31
|
+
callToActionText: z.string().optional(),
|
|
32
32
|
})
|
|
33
33
|
.meta({ id: 'WidgetSettingsVoiceSettingsContent' });
|
|
34
34
|
export const WidgetSettingsVoiceSettingsDTO = z
|
|
@@ -82,6 +82,59 @@ export const WidgetSettingsSecuritySettingsDTO = z
|
|
|
82
82
|
isTranscriptDownloadEnabled: z.boolean().optional(),
|
|
83
83
|
})
|
|
84
84
|
.meta({ id: 'WidgetSettingsSecuritySettings' });
|
|
85
|
+
/**
|
|
86
|
+
* Presentation-layer language config for the widget: the default UI language and the set of languages
|
|
87
|
+
* offered to end-users (`supported`, which always contains `default`, listed first). The visitor's
|
|
88
|
+
* language is auto-detected from their device against `supported`, falling back to `default`. Locale
|
|
89
|
+
* codes are members of the `LegacyVFLocale` enum, but stored as strings because that enum lives in
|
|
90
|
+
* `@voiceflow/dtos`, which depends on this package (so it cannot be imported here). The allowed set is
|
|
91
|
+
* enforced at the settings UI. Distinct from `version.prototype.data.locales`, which is the agent/NLU
|
|
92
|
+
* build locale — see COR-13728.
|
|
93
|
+
*
|
|
94
|
+
* `enabled` is the explicit per-project opt-in: the widget is multilingual only when it is `true`.
|
|
95
|
+
* Absent or `false` means the widget renders exactly as a single-language widget did before multilingual
|
|
96
|
+
* shipped, and no locale is sent to the runtime. Opting out writes `false` rather than removing the
|
|
97
|
+
* block, so the language config survives and re-enabling restores it.
|
|
98
|
+
*
|
|
99
|
+
* The pure opt-in roster (COR-14107) removed the legacy `mode`, `offered` and `chosen` fields; the
|
|
100
|
+
* settings UI coerces any config still carrying them into this shape on its next write.
|
|
101
|
+
*/
|
|
102
|
+
export const WidgetSettingsLanguageSettingsDTO = z
|
|
103
|
+
.object({
|
|
104
|
+
default: z.string(),
|
|
105
|
+
supported: z.array(z.string()),
|
|
106
|
+
enabled: z.boolean().optional(),
|
|
107
|
+
})
|
|
108
|
+
.meta({ id: 'WidgetSettingsLanguageSettings' });
|
|
109
|
+
/**
|
|
110
|
+
* A single translation of one content string into one locale. `value` is the translated text;
|
|
111
|
+
* `sourceHash` is the sha256 hex of the source string it was derived from — stamped on machine results and
|
|
112
|
+
* on hand-edited overrides alike — so staleness is detectable when the source changes; `modified` marks a
|
|
113
|
+
* hand-edited translation (an override), which re-translation never clobbers unless explicitly asked;
|
|
114
|
+
* `failed` marks the last machine attempt for `sourceHash` as failed. A failed entry always has
|
|
115
|
+
* `value: ''`: the widget only uses a translation whose value is non-empty, so it falls back to the source
|
|
116
|
+
* text with no widget-side handling. Any later successful write replaces the entry and drops the flag.
|
|
117
|
+
*/
|
|
118
|
+
export const WidgetSettingsTranslationEntryDTO = z
|
|
119
|
+
.object({
|
|
120
|
+
value: z.string(),
|
|
121
|
+
sourceHash: z.string().optional(),
|
|
122
|
+
modified: z.boolean().optional(),
|
|
123
|
+
failed: z.boolean().optional(),
|
|
124
|
+
})
|
|
125
|
+
.meta({ id: 'WidgetSettingsTranslationEntry' });
|
|
126
|
+
/**
|
|
127
|
+
* Per-locale translations of widget content strings, keyed `[locale][contentKey]`. Only consulted
|
|
128
|
+
* while the widget is multilingual (`languages.enabled === true`). A hand-edited (`modified`) entry
|
|
129
|
+
* always wins; a machine entry only applies to customer-authored text, because stored text that
|
|
130
|
+
* exactly equals the Voiceflow default for its field renders from the widget's shipped catalog in
|
|
131
|
+
* the visitor's language instead. Partial per locale. Which keys are valid is enforced at the
|
|
132
|
+
* settings UI (`WIDGET_TRANSLATABLE_CONTENT_KEYS`), not here, so the schema stays migration-free as
|
|
133
|
+
* the translatable surface evolves. Locale codes match `languages.supported`.
|
|
134
|
+
*/
|
|
135
|
+
export const WidgetSettingsTranslationsDTO = z
|
|
136
|
+
.record(z.string(), z.record(z.string(), WidgetSettingsTranslationEntryDTO))
|
|
137
|
+
.meta({ id: 'WidgetSettingsTranslations' });
|
|
85
138
|
export const WidgetSettingsDTO = z
|
|
86
139
|
.object({
|
|
87
140
|
type: WidgetSettingsWidgetTypeDTO,
|
|
@@ -89,6 +142,8 @@ export const WidgetSettingsDTO = z
|
|
|
89
142
|
voice: WidgetSettingsVoiceSettingsDTO,
|
|
90
143
|
common: WidgetSettingsCommonSettingsDTO,
|
|
91
144
|
security: WidgetSettingsSecuritySettingsDTO.optional(),
|
|
145
|
+
languages: WidgetSettingsLanguageSettingsDTO.optional(),
|
|
146
|
+
translations: WidgetSettingsTranslationsDTO.optional(),
|
|
92
147
|
})
|
|
93
148
|
.meta({ id: 'WidgetSettings' });
|
|
94
149
|
//# sourceMappingURL=widget-settings.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-settings.dto.js","sourceRoot":"","sources":["../../src/widget-settings/widget-settings.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC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'./widget-settings.constant.js';
|
|
2
|
+
import type { WidgetSettingsLanguageSettings } from './widget-settings.dto.js';
|
|
3
|
+
export declare const isWidgetMultilingualEnabled: (languages: WidgetSettingsLanguageSettings | null | undefined) => boolean;
|
|
4
|
+
export declare const isWidgetDefaultContent: (key: WidgetTranslatableContentKey, value: string | null | undefined) => boolean;
|
|
5
|
+
export declare const getWidgetLocalizedContent: (locale: string, key: WidgetTranslatableContentKey) => string;
|
|
6
|
+
//# sourceMappingURL=widget-settings.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-settings.util.d.ts","sourceRoot":"","sources":["../../src/widget-settings/widget-settings.util.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE/E,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAE5E,eAAO,MAAM,2BAA2B,cAAe,8BAA8B,GAAG,IAAI,GAAG,SAAS,KAAG,OAC9E,CAAC;AAE9B,eAAO,MAAM,sBAAsB,QAAS,4BAA4B,SAAS,MAAM,GAAG,IAAI,GAAG,SAAS,KAAG,OAC5D,CAAC;AAElD,eAAO,MAAM,yBAAyB,WAAY,MAAM,OAAO,4BAA4B,KAAG,MAGlD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { resolveWidgetLocale } from './widget-settings-locale.util.js';
|
|
2
|
+
import { WIDGET_SETTINGS_LOCALIZED_CONTENT } from './widget-settings-localized-content.constant.js';
|
|
3
|
+
import { WIDGET_SETTINGS_FALLBACK_CONTENT } from './widget-settings.constant.js';
|
|
4
|
+
export const isWidgetMultilingualEnabled = (languages) => languages?.enabled === true;
|
|
5
|
+
export const isWidgetDefaultContent = (key, value) => value === WIDGET_SETTINGS_FALLBACK_CONTENT[key];
|
|
6
|
+
export const getWidgetLocalizedContent = (locale, key) => WIDGET_SETTINGS_LOCALIZED_CONTENT[resolveWidgetLocale(locale, Object.keys(WIDGET_SETTINGS_LOCALIZED_CONTENT))]?.[key] ?? WIDGET_SETTINGS_FALLBACK_CONTENT[key];
|
|
7
|
+
//# sourceMappingURL=widget-settings.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-settings.util.js","sourceRoot":"","sources":["../../src/widget-settings/widget-settings.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,iCAAiC,EAAE,MAAM,8CAA8C,CAAC;AAEjG,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAG9E,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,SAA4D,EAAW,EAAE,CACnH,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;AAE9B,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,GAAiC,EAAE,KAAgC,EAAW,EAAE,CACrH,KAAK,KAAK,gCAAgC,CAAC,GAAG,CAAC,CAAC;AAElD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,MAAc,EAAE,GAAiC,EAAU,EAAE,CACrG,iCAAiC,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC,CAAC,EAAE,CAC9G,GAAG,CACJ,IAAI,gCAAgC,CAAC,GAAG,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voiceflow/dtos-interact",
|
|
3
|
-
"version": "2.28.
|
|
3
|
+
"version": "2.28.2-523fcfdb7c.147+523fcfdb7c",
|
|
4
4
|
"files": [
|
|
5
5
|
"build"
|
|
6
6
|
],
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"volta": {
|
|
36
36
|
"extends": "../../package.json"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "523fcfdb7c7170a99b62884205098a938266f559"
|
|
39
39
|
}
|