ssml-builder-js 2.1.0 → 2.3.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/dist/react.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, CSSProperties } from 'react';
3
+ import { OnMount, Monaco } from '@monaco-editor/react';
3
4
 
4
5
  type SsmlAttributeValue = string | number;
5
6
  type SsmlAttributes = Record<string, SsmlAttributeValue>;
@@ -149,6 +150,11 @@ interface EditorCopy {
149
150
  previewSelection: string;
150
151
  previewSelectionTitle: string;
151
152
  noAvailableOptions: string;
153
+ styleNotSupported: string;
154
+ categoryEmotions: string;
155
+ categoryScenarios: string;
156
+ categoryMedia: string;
157
+ categoryOther: string;
152
158
  }
153
159
  interface InlineBadgeCopy {
154
160
  pause: string;
@@ -306,6 +312,8 @@ interface SsmlEditorProps {
306
312
  showToolbarLabels?: boolean;
307
313
  /** Whether inline SSML decorations are displayed. The toolbar switch can change this at runtime. */
308
314
  showDecorations?: boolean;
315
+ /** Whether SSML CodeLens quick controls are displayed. */
316
+ enableCodeLens?: boolean;
309
317
  /** Controls which editor action buttons are displayed. Unspecified buttons are shown. */
310
318
  buttonVisibility?: SsmlEditorButtonVisibility;
311
319
  /** Monaco editor settings. */
@@ -371,4 +379,25 @@ interface SsmlEditorRef {
371
379
  }
372
380
  declare const SsmlEditor: react.ForwardRefExoticComponent<SsmlEditorProps & react.RefAttributes<SsmlEditorRef>>;
373
381
 
374
- export { EDITOR_COPY, type EditorCopy, INLINE_BADGE_COPY, type InlineBadgeCopy, SSML_HOVER_COPY, SSML_INSERTIONS, type SelectionInfo, SsmlEditor, type SsmlEditorButton, type SsmlEditorButtonVisibility, type SsmlEditorCustomInsertion, type SsmlEditorCustomInsertionCollection, type SsmlEditorCustomInsertionDefinition, 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, createSsmlEditorInsertionDefinition };
382
+ type MonacoEditor = Parameters<OnMount>[0];
383
+
384
+ interface SsmlTagRange {
385
+ start: number;
386
+ end: number;
387
+ }
388
+ declare function updateTagAttribute(text: string, tagRange: SsmlTagRange, attributeName: string, newValue: string): string;
389
+
390
+ type SsmlCodeLensAction = {
391
+ type: "attribute";
392
+ insertionId: "rate" | "pitch" | "break";
393
+ attributeName: "rate" | "pitch" | "time";
394
+ tagRange: SsmlTagRange;
395
+ } | {
396
+ type: "unwrap" | "delete";
397
+ tagRange: SsmlTagRange;
398
+ elementRange: SsmlTagRange;
399
+ };
400
+ type SsmlCodeLensCallback = (action: SsmlCodeLensAction) => void;
401
+ declare function registerSsmlCodeLens(monaco: Monaco, editor: MonacoEditor, onOpenPopover: SsmlCodeLensCallback): ReturnType<Monaco["languages"]["registerCodeLensProvider"]>;
402
+
403
+ 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 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, createSsmlEditorInsertionDefinition, registerSsmlCodeLens, updateTagAttribute };