ssml-builder-js 2.12.0 → 2.13.0
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/README.md +26 -1
- package/dist/{chunk-4BVNAUVR.mjs → chunk-25LOR4AJ.mjs} +134 -10
- package/dist/chunk-25LOR4AJ.mjs.map +1 -0
- package/dist/chunk-CZ2F3TET.mjs +1745 -0
- package/dist/chunk-CZ2F3TET.mjs.map +1 -0
- package/dist/{chunk-FHDFRM2F.mjs → chunk-LCTE26LS.mjs} +248 -1722
- package/dist/chunk-LCTE26LS.mjs.map +1 -0
- package/dist/core.d.mts +45 -3
- package/dist/core.d.ts +45 -3
- package/dist/core.js +133 -9
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +1 -1
- package/dist/elements.js +118 -1
- package/dist/elements.js.map +1 -1
- package/dist/elements.mjs +6 -4
- package/dist/elements.mjs.map +1 -1
- package/dist/index.d-Xbr6ZWnK.d.mts +214 -0
- package/dist/index.d-Xbr6ZWnK.d.ts +214 -0
- package/dist/index.d.mts +95 -2
- package/dist/index.d.ts +95 -2
- package/dist/index.js +1732 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +135 -4
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +61 -163
- package/dist/react.d.ts +61 -163
- package/dist/react.js +397 -15
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +139 -18
- package/dist/react.mjs.map +1 -1
- package/package.json +3 -2
- package/dist/chunk-4BVNAUVR.mjs.map +0 -1
- package/dist/chunk-FHDFRM2F.mjs.map +0 -1
package/dist/react.d.ts
CHANGED
|
@@ -1,160 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode,
|
|
2
|
+
import { ReactNode, ReactElement, CSSProperties } from 'react';
|
|
3
|
+
import { a as SsmlDocument, b as SsmlElement } from './index.d-Xbr6ZWnK.js';
|
|
3
4
|
import { OnMount, Monaco } from '@monaco-editor/react';
|
|
4
5
|
|
|
5
|
-
type SsmlAttributeValue = string | number;
|
|
6
|
-
type SsmlAttributes = Record<string, SsmlAttributeValue>;
|
|
7
|
-
interface SsmlText {
|
|
8
|
-
type: "text";
|
|
9
|
-
value: string;
|
|
10
|
-
}
|
|
11
|
-
type SsmlNode = string | SsmlText | SsmlElement;
|
|
12
|
-
interface SsmlElementBase {
|
|
13
|
-
children?: SsmlNode[];
|
|
14
|
-
attributes?: SsmlAttributes;
|
|
15
|
-
}
|
|
16
|
-
interface VoiceElement extends SsmlElementBase {
|
|
17
|
-
type: "voice";
|
|
18
|
-
name?: string;
|
|
19
|
-
effect?: string;
|
|
20
|
-
}
|
|
21
|
-
interface ProsodyElement extends SsmlElementBase {
|
|
22
|
-
type: "prosody";
|
|
23
|
-
rate?: SsmlAttributeValue;
|
|
24
|
-
pitch?: SsmlAttributeValue;
|
|
25
|
-
volume?: SsmlAttributeValue;
|
|
26
|
-
contour?: string;
|
|
27
|
-
range?: SsmlAttributeValue;
|
|
28
|
-
}
|
|
29
|
-
interface BreakElement extends SsmlElementBase {
|
|
30
|
-
type: "break";
|
|
31
|
-
time?: SsmlAttributeValue;
|
|
32
|
-
strength?: string;
|
|
33
|
-
}
|
|
34
|
-
interface ExpressAsElement extends SsmlElementBase {
|
|
35
|
-
type: "express-as" | "expressAs" | "mstts:express-as";
|
|
36
|
-
style?: string;
|
|
37
|
-
styleDegree?: SsmlAttributeValue;
|
|
38
|
-
role?: string;
|
|
39
|
-
}
|
|
40
|
-
interface SayAsElement extends SsmlElementBase {
|
|
41
|
-
type: "say-as" | "sayAs";
|
|
42
|
-
interpretAs?: string;
|
|
43
|
-
format?: string;
|
|
44
|
-
detail?: string;
|
|
45
|
-
}
|
|
46
|
-
interface PhonemeElement extends SsmlElementBase {
|
|
47
|
-
type: "phoneme";
|
|
48
|
-
alphabet?: string;
|
|
49
|
-
ph?: string;
|
|
50
|
-
}
|
|
51
|
-
interface EmphasisElement extends SsmlElementBase {
|
|
52
|
-
type: "emphasis";
|
|
53
|
-
level?: string;
|
|
54
|
-
}
|
|
55
|
-
interface AudioElement extends SsmlElementBase {
|
|
56
|
-
type: "audio";
|
|
57
|
-
src?: string;
|
|
58
|
-
desc?: string;
|
|
59
|
-
clipBegin?: SsmlAttributeValue;
|
|
60
|
-
clipEnd?: SsmlAttributeValue;
|
|
61
|
-
speed?: SsmlAttributeValue;
|
|
62
|
-
repeatCount?: SsmlAttributeValue;
|
|
63
|
-
repeatDuration?: SsmlAttributeValue;
|
|
64
|
-
soundLevel?: SsmlAttributeValue;
|
|
65
|
-
}
|
|
66
|
-
interface SubElement extends SsmlElementBase {
|
|
67
|
-
type: "sub";
|
|
68
|
-
alias?: string;
|
|
69
|
-
}
|
|
70
|
-
interface LangElement extends SsmlElementBase {
|
|
71
|
-
type: "lang";
|
|
72
|
-
lang?: string;
|
|
73
|
-
}
|
|
74
|
-
interface MarkElement extends SsmlElementBase {
|
|
75
|
-
type: "mark";
|
|
76
|
-
name?: string;
|
|
77
|
-
}
|
|
78
|
-
interface BookmarkElement extends SsmlElementBase {
|
|
79
|
-
type: "bookmark";
|
|
80
|
-
mark?: string;
|
|
81
|
-
}
|
|
82
|
-
interface LexiconElement extends SsmlElementBase {
|
|
83
|
-
type: "lexicon";
|
|
84
|
-
uri?: string;
|
|
85
|
-
}
|
|
86
|
-
interface ParagraphElement extends SsmlElementBase {
|
|
87
|
-
type: "p";
|
|
88
|
-
}
|
|
89
|
-
interface SentenceElement extends SsmlElementBase {
|
|
90
|
-
type: "s";
|
|
91
|
-
}
|
|
92
|
-
interface WordElement extends SsmlElementBase {
|
|
93
|
-
type: "w";
|
|
94
|
-
}
|
|
95
|
-
interface MsttsSilenceElement extends SsmlElementBase {
|
|
96
|
-
type: "mstts:silence" | "silence";
|
|
97
|
-
typeValue?: string;
|
|
98
|
-
silenceType?: string;
|
|
99
|
-
value?: SsmlAttributeValue;
|
|
100
|
-
}
|
|
101
|
-
interface MsttsVisemeElement extends SsmlElementBase {
|
|
102
|
-
type: "mstts:viseme" | "viseme";
|
|
103
|
-
typeValue?: string;
|
|
104
|
-
visemeType?: string;
|
|
105
|
-
}
|
|
106
|
-
interface MsttsAudioDurationElement extends SsmlElementBase {
|
|
107
|
-
type: "mstts:audioduration";
|
|
108
|
-
value?: SsmlAttributeValue;
|
|
109
|
-
}
|
|
110
|
-
interface SsmlDialogNode extends SsmlElementBase {
|
|
111
|
-
type: "mstts:dialog";
|
|
112
|
-
}
|
|
113
|
-
interface SsmlTurnNode extends SsmlElementBase {
|
|
114
|
-
type: "mstts:turn";
|
|
115
|
-
voice?: string;
|
|
116
|
-
speaker?: string;
|
|
117
|
-
}
|
|
118
|
-
interface SsmlBackgroundAudioNode extends SsmlElementBase {
|
|
119
|
-
type: "mstts:backgroundaudio";
|
|
120
|
-
src?: string;
|
|
121
|
-
volume?: SsmlAttributeValue;
|
|
122
|
-
fadeIn?: SsmlAttributeValue;
|
|
123
|
-
fadeOut?: SsmlAttributeValue;
|
|
124
|
-
/** XML spelling aliases retained for ergonomic object construction. */
|
|
125
|
-
fadein?: SsmlAttributeValue;
|
|
126
|
-
fadeout?: SsmlAttributeValue;
|
|
127
|
-
}
|
|
128
|
-
interface MsttsTtsEmbeddingElement extends SsmlElementBase {
|
|
129
|
-
type: "mstts:ttsembedding";
|
|
130
|
-
speakerProfileId?: string;
|
|
131
|
-
}
|
|
132
|
-
interface MsttsEmbeddingElement extends SsmlElementBase {
|
|
133
|
-
type: "mstts:embedding";
|
|
134
|
-
id?: string;
|
|
135
|
-
speakerProfileId?: string;
|
|
136
|
-
}
|
|
137
|
-
interface MsttsVoiceConversionElement extends SsmlElementBase {
|
|
138
|
-
type: "mstts:voiceconversion";
|
|
139
|
-
url?: string;
|
|
140
|
-
profile?: string;
|
|
141
|
-
speakerProfileId?: string;
|
|
142
|
-
}
|
|
143
|
-
interface CustomElement extends SsmlElementBase {
|
|
144
|
-
type: "custom" | "element";
|
|
145
|
-
name: string;
|
|
146
|
-
}
|
|
147
|
-
type SsmlElement = VoiceElement | ProsodyElement | BreakElement | ExpressAsElement | SayAsElement | PhonemeElement | EmphasisElement | AudioElement | SubElement | LangElement | MarkElement | BookmarkElement | LexiconElement | ParagraphElement | SentenceElement | WordElement | MsttsSilenceElement | MsttsVisemeElement | MsttsAudioDurationElement | SsmlDialogNode | SsmlTurnNode | SsmlBackgroundAudioNode | MsttsTtsEmbeddingElement | MsttsEmbeddingElement | MsttsVoiceConversionElement | CustomElement;
|
|
148
|
-
interface SsmlDocument {
|
|
149
|
-
type?: "speak";
|
|
150
|
-
version: string;
|
|
151
|
-
lang: string;
|
|
152
|
-
children?: SsmlNode[];
|
|
153
|
-
/** @deprecated Use children to represent the document body. */
|
|
154
|
-
content?: string;
|
|
155
|
-
attributes?: SsmlAttributes;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
6
|
type SsmlEditorInsertionButton = "break" | "emphasis" | "rate" | "pitch" | "volume" | "emotion" | "say-as" | "phoneme" | "audio" | "sub" | "lang" | "mark" | "bookmark" | "mstts:silence" | "mstts:audioduration" | "mstts:viseme" | (string & {});
|
|
159
7
|
type SsmlEditorButton = "help" | SsmlEditorInsertionButton | "undo" | "redo" | "clearAll" | "format" | "decorations" | (string & {});
|
|
160
8
|
type SsmlEditorButtonVisibility = Readonly<Partial<Record<string, boolean>>>;
|
|
@@ -215,10 +63,56 @@ interface SsmlHoverLocale {
|
|
|
215
63
|
noParameters: string;
|
|
216
64
|
tags: Readonly<Record<string, SsmlHoverTagCopy>>;
|
|
217
65
|
}
|
|
66
|
+
interface SsmlElementLocaleCopy {
|
|
67
|
+
label: string;
|
|
68
|
+
description: string;
|
|
69
|
+
validationErrors: Readonly<Record<string, string>>;
|
|
70
|
+
}
|
|
71
|
+
/** Localized labels and validation copy for Azure extension elements. */
|
|
72
|
+
declare const SSML_ELEMENT_COPY: Readonly<Record<SsmlEditorLocale, Readonly<Record<string, SsmlElementLocaleCopy>>>>;
|
|
218
73
|
declare const EDITOR_COPY: Readonly<Record<SsmlEditorLocale, EditorCopy>>;
|
|
219
74
|
declare const INLINE_BADGE_COPY: Readonly<Record<SsmlEditorLocale, InlineBadgeCopy>>;
|
|
220
75
|
declare const SSML_HOVER_COPY: Readonly<Record<SsmlEditorLocale, SsmlHoverLocale>>;
|
|
221
76
|
|
|
77
|
+
interface VisualVoiceCatalogEntry {
|
|
78
|
+
name: string;
|
|
79
|
+
locale: string;
|
|
80
|
+
region?: string;
|
|
81
|
+
styles?: readonly string[];
|
|
82
|
+
preview?: boolean;
|
|
83
|
+
status?: "ga" | "preview" | "deprecated";
|
|
84
|
+
}
|
|
85
|
+
interface VoiceSelectorRenderProps {
|
|
86
|
+
value: string;
|
|
87
|
+
voices: readonly VisualVoiceCatalogEntry[];
|
|
88
|
+
readOnly: boolean;
|
|
89
|
+
locale: SsmlEditorLocale;
|
|
90
|
+
onChange: (voice: string) => void;
|
|
91
|
+
}
|
|
92
|
+
interface VisualInspectorRenderProps {
|
|
93
|
+
document: SsmlDocument;
|
|
94
|
+
element: SsmlElement;
|
|
95
|
+
path: number[];
|
|
96
|
+
readOnly: boolean;
|
|
97
|
+
onChange: (document: SsmlDocument) => void;
|
|
98
|
+
locale: SsmlEditorLocale;
|
|
99
|
+
}
|
|
100
|
+
type VisualInspectorRenderer = (props: VisualInspectorRenderProps) => ReactNode;
|
|
101
|
+
interface VisualSsmlEditorProps {
|
|
102
|
+
document: SsmlDocument;
|
|
103
|
+
readOnly?: boolean;
|
|
104
|
+
onChange?: (document: SsmlDocument) => void;
|
|
105
|
+
onPreviewSelection?: (ssml: string) => void;
|
|
106
|
+
locale?: SsmlEditorLocale;
|
|
107
|
+
customInspectors?: Readonly<Record<string, VisualInspectorRenderer>>;
|
|
108
|
+
renderVoiceSelector?: (props: VoiceSelectorRenderProps) => ReactNode;
|
|
109
|
+
voiceCatalog?: readonly VisualVoiceCatalogEntry[];
|
|
110
|
+
voiceLocale?: string;
|
|
111
|
+
voiceRegion?: string;
|
|
112
|
+
voiceStyle?: string;
|
|
113
|
+
}
|
|
114
|
+
declare function VisualSsmlEditor({ document, readOnly, onChange, onPreviewSelection, locale, customInspectors, renderVoiceSelector, voiceCatalog, voiceLocale, voiceRegion, voiceStyle, }: VisualSsmlEditorProps): ReactElement;
|
|
115
|
+
|
|
222
116
|
type SsmlEditorInsertionMode = "insert" | "wrap";
|
|
223
117
|
interface SsmlEditorInsertionOption {
|
|
224
118
|
value: string;
|
|
@@ -391,6 +285,18 @@ interface SsmlEditorProps {
|
|
|
391
285
|
customInsertions?: SsmlEditorCustomInsertionCollection;
|
|
392
286
|
/** Adds insertion definitions without replacing built-in definitions. */
|
|
393
287
|
additionalInsertions?: SsmlEditorCustomInsertionCollection;
|
|
288
|
+
/** Replaces the visual inspector for an element type or serialized tag name. */
|
|
289
|
+
customInspectors?: Readonly<Record<string, VisualInspectorRenderer>>;
|
|
290
|
+
/** Replaces the built-in voice catalog selector in visual mode. */
|
|
291
|
+
renderVoiceSelector?: (props: VoiceSelectorRenderProps) => ReactNode;
|
|
292
|
+
/** Voice metadata used by the visual selector. */
|
|
293
|
+
voiceCatalog?: readonly VisualVoiceCatalogEntry[];
|
|
294
|
+
/** Optional locale filter for the visual voice selector. */
|
|
295
|
+
voiceLocale?: string;
|
|
296
|
+
/** Optional region filter for the visual voice selector. */
|
|
297
|
+
voiceRegion?: string;
|
|
298
|
+
/** Optional style filter for the visual voice selector. */
|
|
299
|
+
voiceStyle?: string;
|
|
394
300
|
/** Candidate style values shown by the built-in emotion insertion. */
|
|
395
301
|
emotionStyles?: readonly string[];
|
|
396
302
|
/** Class name applied to the editor container. */
|
|
@@ -419,14 +325,6 @@ interface SsmlEditorRef {
|
|
|
419
325
|
}
|
|
420
326
|
declare const SsmlEditor: react.ForwardRefExoticComponent<SsmlEditorProps & react.RefAttributes<SsmlEditorRef>>;
|
|
421
327
|
|
|
422
|
-
interface VisualSsmlEditorProps {
|
|
423
|
-
document: SsmlDocument;
|
|
424
|
-
readOnly?: boolean;
|
|
425
|
-
onChange?: (document: SsmlDocument) => void;
|
|
426
|
-
onPreviewSelection?: (ssml: string) => void;
|
|
427
|
-
}
|
|
428
|
-
declare function VisualSsmlEditor({ document, readOnly, onChange, onPreviewSelection, }: VisualSsmlEditorProps): ReactElement;
|
|
429
|
-
|
|
430
328
|
type MonacoEditor = Parameters<OnMount>[0];
|
|
431
329
|
|
|
432
330
|
interface SsmlTagRange {
|
|
@@ -448,4 +346,4 @@ type SsmlCodeLensAction = {
|
|
|
448
346
|
type SsmlCodeLensCallback = (action: SsmlCodeLensAction) => void;
|
|
449
347
|
declare function registerSsmlCodeLens(monaco: Monaco, editor: MonacoEditor, onOpenPopover: SsmlCodeLensCallback): ReturnType<Monaco["languages"]["registerCodeLensProvider"]>;
|
|
450
348
|
|
|
451
|
-
export { EDITOR_COPY, type EditorCopy, INLINE_BADGE_COPY, type InlineBadgeCopy, SSML_HOVER_COPY, SSML_INSERTIONS, type SelectionInfo, type SsmlCodeLensAction, type SsmlCodeLensCallback, SsmlEditor, type SsmlEditorButton, type SsmlEditorButtonVisibility, type SsmlEditorCustomInsertion, type SsmlEditorCustomInsertionCollection, type SsmlEditorCustomInsertionDefinition, type SsmlEditorEditMode, type SsmlEditorInsertionButton, type SsmlEditorInsertionDefinition, type SsmlEditorInsertionGroup, type SsmlEditorInsertionMode, type SsmlEditorInsertionOption, type SsmlEditorInsertionTemplate, type SsmlEditorLanguage, type SsmlEditorLineNumbers, type SsmlEditorLocale, type SsmlEditorLocalizedText, type SsmlEditorOptions, type SsmlEditorProps, type SsmlEditorRef, type SsmlEditorTheme, type SsmlEditorToolbarGroup, type SsmlEditorWordWrap, type SsmlHoverLocale, type SsmlHoverParameterCopy, type SsmlHoverTagCopy, type SsmlInsertionDefinition, type SsmlInsertionOption, type SsmlInsertionTemplate, type SsmlTagRange, VisualSsmlEditor, type VisualSsmlEditorProps, createSsmlEditorInsertionDefinition, registerSsmlCodeLens, updateTagAttribute };
|
|
349
|
+
export { EDITOR_COPY, type EditorCopy, INLINE_BADGE_COPY, type InlineBadgeCopy, SSML_ELEMENT_COPY, SSML_HOVER_COPY, SSML_INSERTIONS, type SelectionInfo, type SsmlCodeLensAction, type SsmlCodeLensCallback, SsmlEditor, type SsmlEditorButton, type SsmlEditorButtonVisibility, type SsmlEditorCustomInsertion, type SsmlEditorCustomInsertionCollection, type SsmlEditorCustomInsertionDefinition, type SsmlEditorEditMode, type SsmlEditorInsertionButton, type SsmlEditorInsertionDefinition, type SsmlEditorInsertionGroup, type SsmlEditorInsertionMode, type SsmlEditorInsertionOption, type SsmlEditorInsertionTemplate, type SsmlEditorLanguage, type SsmlEditorLineNumbers, type SsmlEditorLocale, type SsmlEditorLocalizedText, type SsmlEditorOptions, type SsmlEditorProps, type SsmlEditorRef, type SsmlEditorTheme, type SsmlEditorToolbarGroup, type SsmlEditorWordWrap, type SsmlElementLocaleCopy, type SsmlHoverLocale, type SsmlHoverParameterCopy, type SsmlHoverTagCopy, type SsmlInsertionDefinition, type SsmlInsertionOption, type SsmlInsertionTemplate, type SsmlTagRange, type VisualInspectorRenderProps, type VisualInspectorRenderer, VisualSsmlEditor, type VisualSsmlEditorProps, type VisualVoiceCatalogEntry, type VoiceSelectorRenderProps, createSsmlEditorInsertionDefinition, registerSsmlCodeLens, updateTagAttribute };
|