@ssml-builder-js/ssml-editor-react 2.11.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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @ssml-builder-js/ssml-editor-react
2
2
 
3
+ ## 2.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 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.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @ssml-builder-js/ssml-core@2.13.0
13
+
14
+ ## 2.12.0
15
+
16
+ ### Minor Changes
17
+
18
+ - Add Visual Editor forms for the supported SSML and Azure extension elements and preserve parent context during selection preview.
19
+
3
20
  ## 2.11.0
4
21
 
5
22
  ### Minor Changes
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, CSSProperties, ReactElement } from 'react';
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,56 @@ 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
+ 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
+
70
116
  type SsmlEditorInsertionMode = "insert" | "wrap";
71
117
  interface SsmlEditorInsertionOption {
72
118
  value: string;
@@ -239,6 +285,18 @@ interface SsmlEditorProps {
239
285
  customInsertions?: SsmlEditorCustomInsertionCollection;
240
286
  /** Adds insertion definitions without replacing built-in definitions. */
241
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;
242
300
  /** Candidate style values shown by the built-in emotion insertion. */
243
301
  emotionStyles?: readonly string[];
244
302
  /** Class name applied to the editor container. */
@@ -267,14 +325,6 @@ interface SsmlEditorRef {
267
325
  }
268
326
  declare const SsmlEditor: react.ForwardRefExoticComponent<SsmlEditorProps & react.RefAttributes<SsmlEditorRef>>;
269
327
 
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
328
  type MonacoEditor = Parameters<OnMount>[0];
279
329
 
280
330
  interface SsmlTagRange {
@@ -296,4 +346,4 @@ type SsmlCodeLensAction = {
296
346
  type SsmlCodeLensCallback = (action: SsmlCodeLensAction) => void;
297
347
  declare function registerSsmlCodeLens(monaco: Monaco, editor: MonacoEditor, onOpenPopover: SsmlCodeLensCallback): ReturnType<Monaco["languages"]["registerCodeLensProvider"]>;
298
348
 
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 };
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 };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, CSSProperties, ReactElement } from 'react';
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,56 @@ 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
+ 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
+
70
116
  type SsmlEditorInsertionMode = "insert" | "wrap";
71
117
  interface SsmlEditorInsertionOption {
72
118
  value: string;
@@ -239,6 +285,18 @@ interface SsmlEditorProps {
239
285
  customInsertions?: SsmlEditorCustomInsertionCollection;
240
286
  /** Adds insertion definitions without replacing built-in definitions. */
241
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;
242
300
  /** Candidate style values shown by the built-in emotion insertion. */
243
301
  emotionStyles?: readonly string[];
244
302
  /** Class name applied to the editor container. */
@@ -267,14 +325,6 @@ interface SsmlEditorRef {
267
325
  }
268
326
  declare const SsmlEditor: react.ForwardRefExoticComponent<SsmlEditorProps & react.RefAttributes<SsmlEditorRef>>;
269
327
 
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
328
  type MonacoEditor = Parameters<OnMount>[0];
279
329
 
280
330
  interface SsmlTagRange {
@@ -296,4 +346,4 @@ type SsmlCodeLensAction = {
296
346
  type SsmlCodeLensCallback = (action: SsmlCodeLensAction) => void;
297
347
  declare function registerSsmlCodeLens(monaco: Monaco, editor: MonacoEditor, onOpenPopover: SsmlCodeLensCallback): ReturnType<Monaco["languages"]["registerCodeLensProvider"]>;
298
348
 
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 };
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 };