@ssml-builder-js/ssml-editor-react 2.12.0 → 2.14.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/CHANGELOG.md +22 -0
- package/dist/index.d.mts +65 -11
- package/dist/index.d.ts +65 -11
- package/dist/index.js +412 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +411 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/SsmlEditor.tsx +31 -1
- package/src/components/VisualSsmlEditor.tsx +265 -24
- package/src/index.tsx +9 -2
- package/src/locales.ts +226 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @ssml-builder-js/ssml-editor-react
|
|
2
2
|
|
|
3
|
+
## 2.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add safe container-aware audio merging, preflight-validated SSML chunk synthesis with structured progress events, source mapping metadata, controlled URL validation, and voice capability details in the Visual Editor.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @ssml-builder-js/ssml-core@2.14.0
|
|
13
|
+
|
|
14
|
+
## 2.13.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- Add structured SSML chunk metadata and background-audio replication policies, merged synthesis synchronization offsets, safe preflight synthesis with custom URL validation, chunk progress reporting, source tracking, and extensible Japanese-localized Visual Editor controls.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @ssml-builder-js/ssml-core@2.13.0
|
|
24
|
+
|
|
3
25
|
## 2.12.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode,
|
|
3
|
-
import { SsmlDocument } from '@ssml-builder-js/ssml-core';
|
|
2
|
+
import { ReactNode, ReactElement, CSSProperties } from 'react';
|
|
3
|
+
import { SsmlDocument, SsmlElement } from '@ssml-builder-js/ssml-core';
|
|
4
4
|
import { OnMount, Monaco } from '@monaco-editor/react';
|
|
5
5
|
|
|
6
6
|
type SsmlEditorInsertionButton = "break" | "emphasis" | "rate" | "pitch" | "volume" | "emotion" | "say-as" | "phoneme" | "audio" | "sub" | "lang" | "mark" | "bookmark" | "mstts:silence" | "mstts:audioduration" | "mstts:viseme" | (string & {});
|
|
@@ -63,10 +63,60 @@ interface SsmlHoverLocale {
|
|
|
63
63
|
noParameters: string;
|
|
64
64
|
tags: Readonly<Record<string, SsmlHoverTagCopy>>;
|
|
65
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>>>>;
|
|
66
73
|
declare const EDITOR_COPY: Readonly<Record<SsmlEditorLocale, EditorCopy>>;
|
|
67
74
|
declare const INLINE_BADGE_COPY: Readonly<Record<SsmlEditorLocale, InlineBadgeCopy>>;
|
|
68
75
|
declare const SSML_HOVER_COPY: Readonly<Record<SsmlEditorLocale, SsmlHoverLocale>>;
|
|
69
76
|
|
|
77
|
+
interface VisualVoiceCatalogEntry {
|
|
78
|
+
name: string;
|
|
79
|
+
locale: string;
|
|
80
|
+
region?: string;
|
|
81
|
+
regions?: readonly string[];
|
|
82
|
+
styles?: readonly string[];
|
|
83
|
+
supportedTags?: readonly string[];
|
|
84
|
+
unsupportedTags?: readonly string[];
|
|
85
|
+
preview?: boolean;
|
|
86
|
+
status?: "ga" | "preview" | "deprecated";
|
|
87
|
+
}
|
|
88
|
+
interface VoiceSelectorRenderProps {
|
|
89
|
+
value: string;
|
|
90
|
+
voices: readonly VisualVoiceCatalogEntry[];
|
|
91
|
+
selectedVoice?: VisualVoiceCatalogEntry;
|
|
92
|
+
readOnly: boolean;
|
|
93
|
+
locale: SsmlEditorLocale;
|
|
94
|
+
onChange: (voice: string) => void;
|
|
95
|
+
}
|
|
96
|
+
interface VisualInspectorRenderProps {
|
|
97
|
+
document: SsmlDocument;
|
|
98
|
+
element: SsmlElement;
|
|
99
|
+
path: number[];
|
|
100
|
+
readOnly: boolean;
|
|
101
|
+
onChange: (document: SsmlDocument) => void;
|
|
102
|
+
locale: SsmlEditorLocale;
|
|
103
|
+
}
|
|
104
|
+
type VisualInspectorRenderer = (props: VisualInspectorRenderProps) => ReactNode;
|
|
105
|
+
interface VisualSsmlEditorProps {
|
|
106
|
+
document: SsmlDocument;
|
|
107
|
+
readOnly?: boolean;
|
|
108
|
+
onChange?: (document: SsmlDocument) => void;
|
|
109
|
+
onPreviewSelection?: (ssml: string) => void;
|
|
110
|
+
locale?: SsmlEditorLocale;
|
|
111
|
+
customInspectors?: Readonly<Record<string, VisualInspectorRenderer>>;
|
|
112
|
+
renderVoiceSelector?: (props: VoiceSelectorRenderProps) => ReactNode;
|
|
113
|
+
voiceCatalog?: readonly VisualVoiceCatalogEntry[];
|
|
114
|
+
voiceLocale?: string;
|
|
115
|
+
voiceRegion?: string;
|
|
116
|
+
voiceStyle?: string;
|
|
117
|
+
}
|
|
118
|
+
declare function VisualSsmlEditor({ document, readOnly, onChange, onPreviewSelection, locale, customInspectors, renderVoiceSelector, voiceCatalog, voiceLocale, voiceRegion, voiceStyle, }: VisualSsmlEditorProps): ReactElement;
|
|
119
|
+
|
|
70
120
|
type SsmlEditorInsertionMode = "insert" | "wrap";
|
|
71
121
|
interface SsmlEditorInsertionOption {
|
|
72
122
|
value: string;
|
|
@@ -239,6 +289,18 @@ interface SsmlEditorProps {
|
|
|
239
289
|
customInsertions?: SsmlEditorCustomInsertionCollection;
|
|
240
290
|
/** Adds insertion definitions without replacing built-in definitions. */
|
|
241
291
|
additionalInsertions?: SsmlEditorCustomInsertionCollection;
|
|
292
|
+
/** Replaces the visual inspector for an element type or serialized tag name. */
|
|
293
|
+
customInspectors?: Readonly<Record<string, VisualInspectorRenderer>>;
|
|
294
|
+
/** Replaces the built-in voice catalog selector in visual mode. */
|
|
295
|
+
renderVoiceSelector?: (props: VoiceSelectorRenderProps) => ReactNode;
|
|
296
|
+
/** Voice metadata used by the visual selector. */
|
|
297
|
+
voiceCatalog?: readonly VisualVoiceCatalogEntry[];
|
|
298
|
+
/** Optional locale filter for the visual voice selector. */
|
|
299
|
+
voiceLocale?: string;
|
|
300
|
+
/** Optional region filter for the visual voice selector. */
|
|
301
|
+
voiceRegion?: string;
|
|
302
|
+
/** Optional style filter for the visual voice selector. */
|
|
303
|
+
voiceStyle?: string;
|
|
242
304
|
/** Candidate style values shown by the built-in emotion insertion. */
|
|
243
305
|
emotionStyles?: readonly string[];
|
|
244
306
|
/** Class name applied to the editor container. */
|
|
@@ -267,14 +329,6 @@ interface SsmlEditorRef {
|
|
|
267
329
|
}
|
|
268
330
|
declare const SsmlEditor: react.ForwardRefExoticComponent<SsmlEditorProps & react.RefAttributes<SsmlEditorRef>>;
|
|
269
331
|
|
|
270
|
-
interface VisualSsmlEditorProps {
|
|
271
|
-
document: SsmlDocument;
|
|
272
|
-
readOnly?: boolean;
|
|
273
|
-
onChange?: (document: SsmlDocument) => void;
|
|
274
|
-
onPreviewSelection?: (ssml: string) => void;
|
|
275
|
-
}
|
|
276
|
-
declare function VisualSsmlEditor({ document, readOnly, onChange, onPreviewSelection, }: VisualSsmlEditorProps): ReactElement;
|
|
277
|
-
|
|
278
332
|
type MonacoEditor = Parameters<OnMount>[0];
|
|
279
333
|
|
|
280
334
|
interface SsmlTagRange {
|
|
@@ -296,4 +350,4 @@ type SsmlCodeLensAction = {
|
|
|
296
350
|
type SsmlCodeLensCallback = (action: SsmlCodeLensAction) => void;
|
|
297
351
|
declare function registerSsmlCodeLens(monaco: Monaco, editor: MonacoEditor, onOpenPopover: SsmlCodeLensCallback): ReturnType<Monaco["languages"]["registerCodeLensProvider"]>;
|
|
298
352
|
|
|
299
|
-
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 };
|
|
353
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode,
|
|
3
|
-
import { SsmlDocument } from '@ssml-builder-js/ssml-core';
|
|
2
|
+
import { ReactNode, ReactElement, CSSProperties } from 'react';
|
|
3
|
+
import { SsmlDocument, SsmlElement } from '@ssml-builder-js/ssml-core';
|
|
4
4
|
import { OnMount, Monaco } from '@monaco-editor/react';
|
|
5
5
|
|
|
6
6
|
type SsmlEditorInsertionButton = "break" | "emphasis" | "rate" | "pitch" | "volume" | "emotion" | "say-as" | "phoneme" | "audio" | "sub" | "lang" | "mark" | "bookmark" | "mstts:silence" | "mstts:audioduration" | "mstts:viseme" | (string & {});
|
|
@@ -63,10 +63,60 @@ interface SsmlHoverLocale {
|
|
|
63
63
|
noParameters: string;
|
|
64
64
|
tags: Readonly<Record<string, SsmlHoverTagCopy>>;
|
|
65
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>>>>;
|
|
66
73
|
declare const EDITOR_COPY: Readonly<Record<SsmlEditorLocale, EditorCopy>>;
|
|
67
74
|
declare const INLINE_BADGE_COPY: Readonly<Record<SsmlEditorLocale, InlineBadgeCopy>>;
|
|
68
75
|
declare const SSML_HOVER_COPY: Readonly<Record<SsmlEditorLocale, SsmlHoverLocale>>;
|
|
69
76
|
|
|
77
|
+
interface VisualVoiceCatalogEntry {
|
|
78
|
+
name: string;
|
|
79
|
+
locale: string;
|
|
80
|
+
region?: string;
|
|
81
|
+
regions?: readonly string[];
|
|
82
|
+
styles?: readonly string[];
|
|
83
|
+
supportedTags?: readonly string[];
|
|
84
|
+
unsupportedTags?: readonly string[];
|
|
85
|
+
preview?: boolean;
|
|
86
|
+
status?: "ga" | "preview" | "deprecated";
|
|
87
|
+
}
|
|
88
|
+
interface VoiceSelectorRenderProps {
|
|
89
|
+
value: string;
|
|
90
|
+
voices: readonly VisualVoiceCatalogEntry[];
|
|
91
|
+
selectedVoice?: VisualVoiceCatalogEntry;
|
|
92
|
+
readOnly: boolean;
|
|
93
|
+
locale: SsmlEditorLocale;
|
|
94
|
+
onChange: (voice: string) => void;
|
|
95
|
+
}
|
|
96
|
+
interface VisualInspectorRenderProps {
|
|
97
|
+
document: SsmlDocument;
|
|
98
|
+
element: SsmlElement;
|
|
99
|
+
path: number[];
|
|
100
|
+
readOnly: boolean;
|
|
101
|
+
onChange: (document: SsmlDocument) => void;
|
|
102
|
+
locale: SsmlEditorLocale;
|
|
103
|
+
}
|
|
104
|
+
type VisualInspectorRenderer = (props: VisualInspectorRenderProps) => ReactNode;
|
|
105
|
+
interface VisualSsmlEditorProps {
|
|
106
|
+
document: SsmlDocument;
|
|
107
|
+
readOnly?: boolean;
|
|
108
|
+
onChange?: (document: SsmlDocument) => void;
|
|
109
|
+
onPreviewSelection?: (ssml: string) => void;
|
|
110
|
+
locale?: SsmlEditorLocale;
|
|
111
|
+
customInspectors?: Readonly<Record<string, VisualInspectorRenderer>>;
|
|
112
|
+
renderVoiceSelector?: (props: VoiceSelectorRenderProps) => ReactNode;
|
|
113
|
+
voiceCatalog?: readonly VisualVoiceCatalogEntry[];
|
|
114
|
+
voiceLocale?: string;
|
|
115
|
+
voiceRegion?: string;
|
|
116
|
+
voiceStyle?: string;
|
|
117
|
+
}
|
|
118
|
+
declare function VisualSsmlEditor({ document, readOnly, onChange, onPreviewSelection, locale, customInspectors, renderVoiceSelector, voiceCatalog, voiceLocale, voiceRegion, voiceStyle, }: VisualSsmlEditorProps): ReactElement;
|
|
119
|
+
|
|
70
120
|
type SsmlEditorInsertionMode = "insert" | "wrap";
|
|
71
121
|
interface SsmlEditorInsertionOption {
|
|
72
122
|
value: string;
|
|
@@ -239,6 +289,18 @@ interface SsmlEditorProps {
|
|
|
239
289
|
customInsertions?: SsmlEditorCustomInsertionCollection;
|
|
240
290
|
/** Adds insertion definitions without replacing built-in definitions. */
|
|
241
291
|
additionalInsertions?: SsmlEditorCustomInsertionCollection;
|
|
292
|
+
/** Replaces the visual inspector for an element type or serialized tag name. */
|
|
293
|
+
customInspectors?: Readonly<Record<string, VisualInspectorRenderer>>;
|
|
294
|
+
/** Replaces the built-in voice catalog selector in visual mode. */
|
|
295
|
+
renderVoiceSelector?: (props: VoiceSelectorRenderProps) => ReactNode;
|
|
296
|
+
/** Voice metadata used by the visual selector. */
|
|
297
|
+
voiceCatalog?: readonly VisualVoiceCatalogEntry[];
|
|
298
|
+
/** Optional locale filter for the visual voice selector. */
|
|
299
|
+
voiceLocale?: string;
|
|
300
|
+
/** Optional region filter for the visual voice selector. */
|
|
301
|
+
voiceRegion?: string;
|
|
302
|
+
/** Optional style filter for the visual voice selector. */
|
|
303
|
+
voiceStyle?: string;
|
|
242
304
|
/** Candidate style values shown by the built-in emotion insertion. */
|
|
243
305
|
emotionStyles?: readonly string[];
|
|
244
306
|
/** Class name applied to the editor container. */
|
|
@@ -267,14 +329,6 @@ interface SsmlEditorRef {
|
|
|
267
329
|
}
|
|
268
330
|
declare const SsmlEditor: react.ForwardRefExoticComponent<SsmlEditorProps & react.RefAttributes<SsmlEditorRef>>;
|
|
269
331
|
|
|
270
|
-
interface VisualSsmlEditorProps {
|
|
271
|
-
document: SsmlDocument;
|
|
272
|
-
readOnly?: boolean;
|
|
273
|
-
onChange?: (document: SsmlDocument) => void;
|
|
274
|
-
onPreviewSelection?: (ssml: string) => void;
|
|
275
|
-
}
|
|
276
|
-
declare function VisualSsmlEditor({ document, readOnly, onChange, onPreviewSelection, }: VisualSsmlEditorProps): ReactElement;
|
|
277
|
-
|
|
278
332
|
type MonacoEditor = Parameters<OnMount>[0];
|
|
279
333
|
|
|
280
334
|
interface SsmlTagRange {
|
|
@@ -296,4 +350,4 @@ type SsmlCodeLensAction = {
|
|
|
296
350
|
type SsmlCodeLensCallback = (action: SsmlCodeLensAction) => void;
|
|
297
351
|
declare function registerSsmlCodeLens(monaco: Monaco, editor: MonacoEditor, onOpenPopover: SsmlCodeLensCallback): ReturnType<Monaco["languages"]["registerCodeLensProvider"]>;
|
|
298
352
|
|
|
299
|
-
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 };
|
|
353
|
+
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 };
|