@naersen/tts-rich-text 0.2.0 → 0.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.
@@ -4,20 +4,20 @@ declare function __VLS_template(): {
4
4
  attrs: Partial<{}>;
5
5
  slots: {
6
6
  'toolbar-before'?(_: {
7
- editor: Editor | undefined;
7
+ editor: import('@tiptap/vue-3').Editor | undefined;
8
8
  }): any;
9
9
  'toolbar-after'?(_: {
10
- editor: Editor | undefined;
10
+ editor: import('@tiptap/vue-3').Editor | undefined;
11
11
  }): any;
12
12
  'editor-after'?(_: {
13
- editor: Editor | undefined;
13
+ editor: import('@tiptap/vue-3').Editor | undefined;
14
14
  }): any;
15
15
  'footer-before'?(_: {
16
- editor: Editor | undefined;
16
+ editor: import('@tiptap/vue-3').Editor | undefined;
17
17
  textLength: number;
18
18
  }): any;
19
19
  'footer-after'?(_: {
20
- editor: Editor | undefined;
20
+ editor: import('@tiptap/vue-3').Editor | undefined;
21
21
  textLength: number;
22
22
  }): any;
23
23
  };
@@ -28,15 +28,14 @@ declare function __VLS_template(): {
28
28
  $props: {
29
29
  readonly disabled?: boolean | undefined;
30
30
  readonly placeholder?: string | undefined;
31
- readonly modelValue?: JSONContent | undefined;
32
31
  readonly textLimit?: number | undefined;
33
32
  readonly voiceVersion?: number | undefined;
34
33
  readonly features?: import('../../type').TtsEditorFeatures | undefined;
35
34
  readonly services?: import('../../type').TtsRichTextServices | undefined;
36
35
  readonly getPreviewParams?: (() => Record<string, unknown>) | undefined;
37
36
  readonly showSelectionMenu?: boolean | undefined;
38
- readonly "onUpdate:modelValue"?: ((value: JSONContent) => any) | undefined;
39
- readonly onChange?: ((value: JSONContent) => any) | undefined;
37
+ readonly initialContent?: JSONContent | undefined;
38
+ readonly onChange?: (() => any) | undefined;
40
39
  readonly onReady?: ((editor: Editor) => any) | undefined;
41
40
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
42
41
  $attrs: import('vue').Attrs;
@@ -49,11 +48,10 @@ declare function __VLS_template(): {
49
48
  $root: import('vue').ComponentPublicInstance | null;
50
49
  $parent: import('vue').ComponentPublicInstance | null;
51
50
  $host: Element | null;
52
- $emit: ((event: "update:modelValue", value: JSONContent) => void) & ((event: "change", value: JSONContent) => void) & ((event: "ready", editor: Editor) => void);
51
+ $emit: ((event: "change") => void) & ((event: "ready", editor: Editor) => void);
53
52
  $el: any;
54
53
  $options: import('vue').ComponentOptionsBase<Readonly<import('../../type').TtsEditorRootProps> & Readonly<{
55
- "onUpdate:modelValue"?: ((value: JSONContent) => any) | undefined;
56
- onChange?: ((value: JSONContent) => any) | undefined;
54
+ onChange?: (() => any) | undefined;
57
55
  onReady?: ((editor: Editor) => any) | undefined;
58
56
  }>, {
59
57
  clear: () => void;
@@ -61,19 +59,60 @@ declare function __VLS_template(): {
61
59
  getJson: () => JSONContent;
62
60
  getTtsData: () => TtsInputData;
63
61
  replaceText: (text: string) => void;
62
+ editor: import('vue').ShallowRef<import('@tiptap/vue-3').Editor | undefined, import('@tiptap/vue-3').Editor | undefined>;
63
+ driveMode: import('vue').Ref<import('../tts-rich-text/editor').DriveModeEnum, import('../tts-rich-text/editor').DriveModeEnum>;
64
+ insertToken: (data: {
65
+ categ: import('../tts-rich-text/editor').CustomTagType;
66
+ payload: Record<string, any>;
67
+ }) => void;
68
+ insertWrappedToken: (data: {
69
+ categ: import('../tts-rich-text/editor').CustomTagType;
70
+ payload: Record<string, any>;
71
+ }) => void;
72
+ clearContent: () => void;
73
+ setContent: (content: JSONContent) => void;
74
+ getSelectedText: () => string;
75
+ getSelectedJson: () => JSONContent | null;
76
+ selectedText: import('vue').Ref<string, string>;
77
+ hasSelectedText: import('vue').ComputedRef<boolean>;
78
+ isSelectedPureNumber: import('vue').ComputedRef<boolean>;
79
+ textLimitLength: number;
80
+ getGenerateAudioParams: () => {
81
+ pitch?: number;
82
+ speed?: number;
83
+ timberId?: string;
84
+ volume?: number;
85
+ };
86
+ services: import('vue').Ref<import('../../type').TtsRichTextServices, import('../../type').TtsRichTextServices>;
87
+ features: import('vue').Ref<import('../../type').TtsEditorFeatures, import('../../type').TtsEditorFeatures>;
88
+ notify: (type: import('../../type').NotificationType, message: string) => void;
89
+ getReferencedVirtualElement: () => {
90
+ getBoundingClientRect(): {
91
+ x: number;
92
+ y: number;
93
+ left: number;
94
+ top: number;
95
+ right: number;
96
+ bottom: number;
97
+ width: number;
98
+ height: number;
99
+ };
100
+ } | null;
101
+ replaceContentWithText: (text: string) => void;
102
+ textLength: import('vue').ComputedRef<number>;
103
+ voiceVersion: import('vue').Ref<number, number>;
64
104
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
65
- "update:modelValue": (value: JSONContent) => any;
66
- change: (value: JSONContent) => any;
105
+ change: () => any;
67
106
  ready: (editor: Editor) => any;
68
107
  }, string, {
69
108
  disabled: boolean;
70
109
  placeholder: string;
71
- modelValue: JSONContent;
72
110
  textLimit: number;
73
111
  voiceVersion: number;
74
112
  features: import('../../type').TtsEditorFeatures;
75
113
  services: import('../../type').TtsRichTextServices;
76
114
  showSelectionMenu: boolean;
115
+ initialContent: JSONContent;
77
116
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
78
117
  beforeCreate?: (() => void) | (() => void)[];
79
118
  created?: (() => void) | (() => void)[];
@@ -97,27 +136,68 @@ declare function __VLS_template(): {
97
136
  } & Readonly<{
98
137
  disabled: boolean;
99
138
  placeholder: string;
100
- modelValue: JSONContent;
101
139
  textLimit: number;
102
140
  voiceVersion: number;
103
141
  features: import('../../type').TtsEditorFeatures;
104
142
  services: import('../../type').TtsRichTextServices;
105
143
  showSelectionMenu: boolean;
144
+ initialContent: JSONContent;
106
145
  }> & Omit<Readonly<import('../../type').TtsEditorRootProps> & Readonly<{
107
- "onUpdate:modelValue"?: ((value: JSONContent) => any) | undefined;
108
- onChange?: ((value: JSONContent) => any) | undefined;
146
+ onChange?: (() => any) | undefined;
109
147
  onReady?: ((editor: Editor) => any) | undefined;
110
- }>, "clear" | "focus" | ("disabled" | "placeholder" | "modelValue" | "textLimit" | "voiceVersion" | "features" | "services" | "showSelectionMenu") | "getJson" | "getTtsData" | "replaceText"> & {
148
+ }>, "clear" | "editor" | "focus" | "textLimitLength" | "notify" | "getGenerateAudioParams" | "clearContent" | "setContent" | "insertToken" | "insertWrappedToken" | "getSelectedText" | "getSelectedJson" | "selectedText" | "hasSelectedText" | "isSelectedPureNumber" | "driveMode" | "getReferencedVirtualElement" | "replaceContentWithText" | "textLength" | ("disabled" | "placeholder" | "textLimit" | "voiceVersion" | "features" | "services" | "showSelectionMenu" | "initialContent") | "getJson" | "getTtsData" | "replaceText"> & {
111
149
  clear: () => void;
112
150
  focus: () => void;
113
151
  getJson: () => JSONContent;
114
152
  getTtsData: () => TtsInputData;
115
153
  replaceText: (text: string) => void;
154
+ editor: import('@tiptap/vue-3').Editor | undefined;
155
+ driveMode: import('../tts-rich-text/editor').DriveModeEnum;
156
+ insertToken: (data: {
157
+ categ: import('../tts-rich-text/editor').CustomTagType;
158
+ payload: Record<string, any>;
159
+ }) => void;
160
+ insertWrappedToken: (data: {
161
+ categ: import('../tts-rich-text/editor').CustomTagType;
162
+ payload: Record<string, any>;
163
+ }) => void;
164
+ clearContent: () => void;
165
+ setContent: (content: JSONContent) => void;
166
+ getSelectedText: () => string;
167
+ getSelectedJson: () => JSONContent | null;
168
+ selectedText: string;
169
+ hasSelectedText: boolean;
170
+ isSelectedPureNumber: boolean;
171
+ textLimitLength: number;
172
+ getGenerateAudioParams: () => {
173
+ pitch?: number;
174
+ speed?: number;
175
+ timberId?: string;
176
+ volume?: number;
177
+ };
178
+ services: import('../../type').TtsRichTextServices;
179
+ features: import('../../type').TtsEditorFeatures;
180
+ notify: (type: import('../../type').NotificationType, message: string) => void;
181
+ getReferencedVirtualElement: () => {
182
+ getBoundingClientRect(): {
183
+ x: number;
184
+ y: number;
185
+ left: number;
186
+ top: number;
187
+ right: number;
188
+ bottom: number;
189
+ width: number;
190
+ height: number;
191
+ };
192
+ } | null;
193
+ replaceContentWithText: (text: string) => void;
194
+ textLength: number;
195
+ voiceVersion: number;
116
196
  } & {} & import('vue').ComponentCustomProperties & {} & {
117
197
  $slots: Readonly<{
118
- default(props: import('../tts-editor-root').TtsEditorRootSlotProps): unknown;
198
+ default(): unknown;
119
199
  }> & {
120
- default(props: import('../tts-editor-root').TtsEditorRootSlotProps): unknown;
200
+ default(): unknown;
121
201
  };
122
202
  }) | null;
123
203
  };
@@ -155,15 +235,14 @@ declare const __VLS_component: import('vue').DefineComponent<TtsRichTextEditorPr
155
235
  $props: {
156
236
  readonly disabled?: boolean | undefined;
157
237
  readonly placeholder?: string | undefined;
158
- readonly modelValue?: JSONContent | undefined;
159
238
  readonly textLimit?: number | undefined;
160
239
  readonly voiceVersion?: number | undefined;
161
240
  readonly features?: import('../../type').TtsEditorFeatures | undefined;
162
241
  readonly services?: import('../../type').TtsRichTextServices | undefined;
163
242
  readonly getPreviewParams?: (() => Record<string, unknown>) | undefined;
164
243
  readonly showSelectionMenu?: boolean | undefined;
165
- readonly "onUpdate:modelValue"?: ((value: JSONContent) => any) | undefined;
166
- readonly onChange?: ((value: JSONContent) => any) | undefined;
244
+ readonly initialContent?: JSONContent | undefined;
245
+ readonly onChange?: (() => any) | undefined;
167
246
  readonly onReady?: ((editor: Editor) => any) | undefined;
168
247
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
169
248
  $attrs: import('vue').Attrs;
@@ -176,11 +255,10 @@ declare const __VLS_component: import('vue').DefineComponent<TtsRichTextEditorPr
176
255
  $root: import('vue').ComponentPublicInstance | null;
177
256
  $parent: import('vue').ComponentPublicInstance | null;
178
257
  $host: Element | null;
179
- $emit: ((event: "update:modelValue", value: JSONContent) => void) & ((event: "change", value: JSONContent) => void) & ((event: "ready", editor: Editor) => void);
258
+ $emit: ((event: "change") => void) & ((event: "ready", editor: Editor) => void);
180
259
  $el: any;
181
260
  $options: import('vue').ComponentOptionsBase<Readonly<import('../../type').TtsEditorRootProps> & Readonly<{
182
- "onUpdate:modelValue"?: ((value: JSONContent) => any) | undefined;
183
- onChange?: ((value: JSONContent) => any) | undefined;
261
+ onChange?: (() => any) | undefined;
184
262
  onReady?: ((editor: Editor) => any) | undefined;
185
263
  }>, {
186
264
  clear: () => void;
@@ -188,19 +266,60 @@ declare const __VLS_component: import('vue').DefineComponent<TtsRichTextEditorPr
188
266
  getJson: () => JSONContent;
189
267
  getTtsData: () => TtsInputData;
190
268
  replaceText: (text: string) => void;
269
+ editor: import('vue').ShallowRef<import('@tiptap/vue-3').Editor | undefined, import('@tiptap/vue-3').Editor | undefined>;
270
+ driveMode: import('vue').Ref<import('../tts-rich-text/editor').DriveModeEnum, import('../tts-rich-text/editor').DriveModeEnum>;
271
+ insertToken: (data: {
272
+ categ: import('../tts-rich-text/editor').CustomTagType;
273
+ payload: Record<string, any>;
274
+ }) => void;
275
+ insertWrappedToken: (data: {
276
+ categ: import('../tts-rich-text/editor').CustomTagType;
277
+ payload: Record<string, any>;
278
+ }) => void;
279
+ clearContent: () => void;
280
+ setContent: (content: JSONContent) => void;
281
+ getSelectedText: () => string;
282
+ getSelectedJson: () => JSONContent | null;
283
+ selectedText: import('vue').Ref<string, string>;
284
+ hasSelectedText: import('vue').ComputedRef<boolean>;
285
+ isSelectedPureNumber: import('vue').ComputedRef<boolean>;
286
+ textLimitLength: number;
287
+ getGenerateAudioParams: () => {
288
+ pitch?: number;
289
+ speed?: number;
290
+ timberId?: string;
291
+ volume?: number;
292
+ };
293
+ services: import('vue').Ref<import('../../type').TtsRichTextServices, import('../../type').TtsRichTextServices>;
294
+ features: import('vue').Ref<import('../../type').TtsEditorFeatures, import('../../type').TtsEditorFeatures>;
295
+ notify: (type: import('../../type').NotificationType, message: string) => void;
296
+ getReferencedVirtualElement: () => {
297
+ getBoundingClientRect(): {
298
+ x: number;
299
+ y: number;
300
+ left: number;
301
+ top: number;
302
+ right: number;
303
+ bottom: number;
304
+ width: number;
305
+ height: number;
306
+ };
307
+ } | null;
308
+ replaceContentWithText: (text: string) => void;
309
+ textLength: import('vue').ComputedRef<number>;
310
+ voiceVersion: import('vue').Ref<number, number>;
191
311
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
192
- "update:modelValue": (value: JSONContent) => any;
193
- change: (value: JSONContent) => any;
312
+ change: () => any;
194
313
  ready: (editor: Editor) => any;
195
314
  }, string, {
196
315
  disabled: boolean;
197
316
  placeholder: string;
198
- modelValue: JSONContent;
199
317
  textLimit: number;
200
318
  voiceVersion: number;
201
319
  features: import('../../type').TtsEditorFeatures;
202
320
  services: import('../../type').TtsRichTextServices;
203
321
  showSelectionMenu: boolean;
322
+ initialContent: JSONContent;
204
323
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
205
324
  beforeCreate?: (() => void) | (() => void)[];
206
325
  created?: (() => void) | (() => void)[];
@@ -224,27 +343,68 @@ declare const __VLS_component: import('vue').DefineComponent<TtsRichTextEditorPr
224
343
  } & Readonly<{
225
344
  disabled: boolean;
226
345
  placeholder: string;
227
- modelValue: JSONContent;
228
346
  textLimit: number;
229
347
  voiceVersion: number;
230
348
  features: import('../../type').TtsEditorFeatures;
231
349
  services: import('../../type').TtsRichTextServices;
232
350
  showSelectionMenu: boolean;
351
+ initialContent: JSONContent;
233
352
  }> & Omit<Readonly<import('../../type').TtsEditorRootProps> & Readonly<{
234
- "onUpdate:modelValue"?: ((value: JSONContent) => any) | undefined;
235
- onChange?: ((value: JSONContent) => any) | undefined;
353
+ onChange?: (() => any) | undefined;
236
354
  onReady?: ((editor: Editor) => any) | undefined;
237
- }>, "clear" | "focus" | ("disabled" | "placeholder" | "modelValue" | "textLimit" | "voiceVersion" | "features" | "services" | "showSelectionMenu") | "getJson" | "getTtsData" | "replaceText"> & {
355
+ }>, "clear" | "editor" | "focus" | "textLimitLength" | "notify" | "getGenerateAudioParams" | "clearContent" | "setContent" | "insertToken" | "insertWrappedToken" | "getSelectedText" | "getSelectedJson" | "selectedText" | "hasSelectedText" | "isSelectedPureNumber" | "driveMode" | "getReferencedVirtualElement" | "replaceContentWithText" | "textLength" | ("disabled" | "placeholder" | "textLimit" | "voiceVersion" | "features" | "services" | "showSelectionMenu" | "initialContent") | "getJson" | "getTtsData" | "replaceText"> & {
238
356
  clear: () => void;
239
357
  focus: () => void;
240
358
  getJson: () => JSONContent;
241
359
  getTtsData: () => TtsInputData;
242
360
  replaceText: (text: string) => void;
361
+ editor: import('@tiptap/vue-3').Editor | undefined;
362
+ driveMode: import('../tts-rich-text/editor').DriveModeEnum;
363
+ insertToken: (data: {
364
+ categ: import('../tts-rich-text/editor').CustomTagType;
365
+ payload: Record<string, any>;
366
+ }) => void;
367
+ insertWrappedToken: (data: {
368
+ categ: import('../tts-rich-text/editor').CustomTagType;
369
+ payload: Record<string, any>;
370
+ }) => void;
371
+ clearContent: () => void;
372
+ setContent: (content: JSONContent) => void;
373
+ getSelectedText: () => string;
374
+ getSelectedJson: () => JSONContent | null;
375
+ selectedText: string;
376
+ hasSelectedText: boolean;
377
+ isSelectedPureNumber: boolean;
378
+ textLimitLength: number;
379
+ getGenerateAudioParams: () => {
380
+ pitch?: number;
381
+ speed?: number;
382
+ timberId?: string;
383
+ volume?: number;
384
+ };
385
+ services: import('../../type').TtsRichTextServices;
386
+ features: import('../../type').TtsEditorFeatures;
387
+ notify: (type: import('../../type').NotificationType, message: string) => void;
388
+ getReferencedVirtualElement: () => {
389
+ getBoundingClientRect(): {
390
+ x: number;
391
+ y: number;
392
+ left: number;
393
+ top: number;
394
+ right: number;
395
+ bottom: number;
396
+ width: number;
397
+ height: number;
398
+ };
399
+ } | null;
400
+ replaceContentWithText: (text: string) => void;
401
+ textLength: number;
402
+ voiceVersion: number;
243
403
  } & {} & import('vue').ComponentCustomProperties & {} & {
244
404
  $slots: Readonly<{
245
- default(props: import('../tts-editor-root').TtsEditorRootSlotProps): unknown;
405
+ default(): unknown;
246
406
  }> & {
247
- default(props: import('../tts-editor-root').TtsEditorRootSlotProps): unknown;
407
+ default(): unknown;
248
408
  };
249
409
  }) | null;
250
410
  }, any>;
@@ -1,4 +1,4 @@
1
- export { useEditorContext, useEditorProvider, useRichTextEditor, type UseRichTextEditorOptions } from '../components/tts-rich-text/editor/useRichTextEditor';
1
+ export { useEditorContext, useEditorProvider, useRichTextEditor, type RichTextEditor, type UseRichTextEditorOptions } from '../components/tts-rich-text/editor/useRichTextEditor';
2
2
  export { createCustomTagNode, CustomTagName } from '../components/tts-rich-text/editor/nodes/tag-node';
3
3
  export { createTtsCharacterCount } from '../components/tts-rich-text/editor/plugins/tts-character-count';
4
4
  export { useVoiceChangeConfirm } from '../components/tts-rich-text/hooks/useVoiceChangeConfirm';