@voicenter-team/voicenter-ui-plus 4.0.0-beta.1 → 4.0.0-beta.3

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.
Files changed (79) hide show
  1. package/MIGRATION_v3.md +196 -0
  2. package/README.md +20 -51
  3. package/library/assets/assets/sass/main.css +1 -1
  4. package/library/assets/components/VcChatComposer/VcChatComposer.css +1 -1
  5. package/library/assets/components/VcMdEditor/ParameterNode.css +1 -1
  6. package/library/assets/components/VcMdEditor/VcMdEditorContent.css +1 -1
  7. package/library/assets/components/VcSoundplayer/VcSoundPlayerCompact.css +1 -0
  8. package/library/assets/components/VcSoundplayer/VcSoundVolume.css +1 -1
  9. package/library/components/VcChatComposer/VcChatComposer.vue.mjs +173 -139
  10. package/library/components/VcChatComposer/tiptap.mjs +45 -0
  11. package/library/components/VcCodeBlock/VcCodeBlock.vue.mjs +18 -5
  12. package/library/components/VcCodeBlock/highlight.mjs +8 -0
  13. package/library/components/VcEmojiPicker/VcEmojiPicker.vue.mjs +3 -4
  14. package/library/components/VcEmojiPicker/emojiData.mjs +16 -21
  15. package/library/components/VcHtmlEditor/VcHtmlEditor.vue.mjs +19 -12
  16. package/library/components/VcHtmlEditor/codemirror.mjs +14 -0
  17. package/library/components/VcImageUploader/VcImageUploader.vue.mjs +14 -8
  18. package/library/components/VcImageUploader/cropper.mjs +5 -0
  19. package/library/components/VcJsonSchema/Components/JsonCodeMirror.vue.mjs +16 -7
  20. package/library/components/VcJsonSchema/Components/codemirror.mjs +15 -0
  21. package/library/components/VcMdEditor/ParameterNode.vue.mjs +1 -1
  22. package/library/components/VcMdEditor/ParameterNode.vue2.mjs +2 -2
  23. package/library/components/VcMdEditor/VcMdEditor.vue.mjs +114 -108
  24. package/library/components/VcMdEditor/VcMdEditorContent.vue.mjs +18 -21
  25. package/library/components/VcMdEditor/ltrNumbersPlugin.mjs +42 -39
  26. package/library/components/VcMdEditor/mdEditor.config.mjs +107 -99
  27. package/library/components/VcMdEditor/milkdown.mjs +67 -0
  28. package/library/components/VcMdEditor/rtlCursorPlugin.mjs +3 -3
  29. package/library/components/VcPdfViewer/VcPdfDocument.vue.mjs +4 -8
  30. package/library/components/VcPdfViewer/pdfjslib.mjs +13 -16
  31. package/library/components/VcSoundplayer/VcPlayerPlayStopButton.vue.mjs +2 -1
  32. package/library/components/VcSoundplayer/VcSoundPlayer.vue.mjs +2 -8
  33. package/library/components/VcSoundplayer/VcSoundPlayerCompact.vue.mjs +197 -0
  34. package/library/components/VcSoundplayer/VcSoundPlayerCompact.vue3.mjs +5 -0
  35. package/library/components/VcSoundplayer/VcSoundPlayerProgress.vue.mjs +1 -1
  36. package/library/components/VcSoundplayer/VcSoundPlayerWrapper.vue.mjs +19 -7
  37. package/library/components/VcSoundplayer/player.options.mjs +8 -0
  38. package/library/components/VcSoundplayer/wavesurfer.mjs +14 -0
  39. package/library/index.mjs +59 -56
  40. package/library/index.mjs.br +0 -0
  41. package/library/index.mjs.gz +0 -0
  42. package/library/plugin-components.gen.mjs +91 -88
  43. package/library/plugin.mjs +59 -56
  44. package/library/plugin.mjs.br +0 -0
  45. package/library/plugin.mjs.gz +0 -0
  46. package/library/style.css +7 -5
  47. package/library/style.css.br +0 -0
  48. package/library/style.css.gz +0 -0
  49. package/library/types/components/VcChatComposer/VcChatComposer.vue.d.ts +2 -1
  50. package/library/types/components/VcChatComposer/tiptap.d.ts +61 -0
  51. package/library/types/components/VcCodeBlock/highlight.d.ts +3 -0
  52. package/library/types/components/VcEmojiPicker/VcEmojiPicker.vue.d.ts +1 -1
  53. package/library/types/components/VcEmojiPicker/emojiData.d.ts +3 -3
  54. package/library/types/components/VcHtmlEditor/codemirror.d.ts +8 -0
  55. package/library/types/components/VcImageUploader/VcImageUploader.vue.d.ts +1 -1
  56. package/library/types/components/VcImageUploader/cropper.d.ts +34 -0
  57. package/library/types/components/VcJsonSchema/Components/codemirror.d.ts +9 -0
  58. package/library/types/components/VcMdEditor/ltrNumbersPlugin.d.ts +7 -13
  59. package/library/types/components/VcMdEditor/mdEditor.config.d.ts +12 -16
  60. package/library/types/components/VcMdEditor/milkdown.d.ts +25 -0
  61. package/library/types/components/VcMdEditor/rtlCursorPlugin.d.ts +3 -2
  62. package/library/types/components/VcPdfViewer/VcPdfDocument.vue.d.ts +1 -1
  63. package/library/types/components/VcPdfViewer/VcPdfDocumentPage.vue.d.ts +1 -1
  64. package/library/types/components/VcPdfViewer/pdfjslib.d.ts +1 -1
  65. package/library/types/components/VcSoundplayer/VcPlayerPlayStopButton.vue.d.ts +11 -0
  66. package/library/types/components/VcSoundplayer/VcSoundPlayerCompact.vue.d.ts +75 -0
  67. package/library/types/components/VcSoundplayer/VcSoundPlayerWrapper.vue.d.ts +3 -1
  68. package/library/types/components/VcSoundplayer/player.options.d.ts +2 -0
  69. package/library/types/components/VcSoundplayer/wavesurfer.d.ts +8 -0
  70. package/library/types/components/exports.d.ts +3 -1
  71. package/library/types/components.gen.d.ts +1 -0
  72. package/library/types/types/VcSoundPlayer.types.d.ts +1 -1
  73. package/library/types/utils/optionalPeer.d.ts +33 -0
  74. package/library/utils/excelParser/helper.mjs +2 -7
  75. package/library/utils/optionalPeer.mjs +32 -0
  76. package/package.json +96 -1
  77. package/src/theme/index.ts +101 -101
  78. package/src/theme/theme.types.ts +31 -31
  79. package/tailwind.config.d.ts +5 -5
@@ -0,0 +1,61 @@
1
+ declare function importTiptap(): Promise<{
2
+ Editor: typeof import("@tiptap/vue-3").Editor;
3
+ EditorContent: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ editor: {
5
+ default: null;
6
+ type: import("vue").PropType<import("@tiptap/vue-3").Editor>;
7
+ };
8
+ }>, {
9
+ rootEl: import("vue").Ref<Element | undefined, Element | undefined>;
10
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
11
+ editor: {
12
+ default: null;
13
+ type: import("vue").PropType<import("@tiptap/vue-3").Editor>;
14
+ };
15
+ }>> & Readonly<{}>, {
16
+ editor: import("@tiptap/vue-3").Editor;
17
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
18
+ Extension: typeof import("@tiptap/core").Extension;
19
+ Placeholder: import("@tiptap/core").Extension<import("@tiptap/extensions").PlaceholderOptions, any>;
20
+ UndoRedo: import("@tiptap/core").Extension<import("@tiptap/extensions").UndoRedoOptions, any>;
21
+ Document: import("@tiptap/core").Node<any, any>;
22
+ Paragraph: import("@tiptap/core").Node<import("@tiptap/extension-paragraph").ParagraphOptions, any>;
23
+ Text: import("@tiptap/core").Node<any, any>;
24
+ Bold: import("@tiptap/core").Mark<import("@tiptap/extension-bold").BoldOptions, any>;
25
+ Italic: import("@tiptap/core").Mark<import("@tiptap/extension-italic").ItalicOptions, any>;
26
+ Strike: import("@tiptap/core").Mark<import("@tiptap/extension-strike").StrikeOptions, any>;
27
+ Code: import("@tiptap/core").Mark<import("@tiptap/extension-code").CodeOptions, any>;
28
+ Mention: import("@tiptap/core").Node<import("@tiptap/extension-mention").MentionOptions<any, import("@tiptap/extension-mention").MentionNodeAttrs>, any>;
29
+ }>;
30
+ export type Tiptap = Awaited<ReturnType<typeof importTiptap>>;
31
+ /** The tiptap packages of the composer, optional peers (src/utils/optionalPeer.ts), shared by every composer. */
32
+ export declare const loadTiptap: () => Promise<{
33
+ Editor: typeof import("@tiptap/vue-3").Editor;
34
+ EditorContent: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
35
+ editor: {
36
+ default: null;
37
+ type: import("vue").PropType<import("@tiptap/vue-3").Editor>;
38
+ };
39
+ }>, {
40
+ rootEl: import("vue").Ref<Element | undefined, Element | undefined>;
41
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
42
+ editor: {
43
+ default: null;
44
+ type: import("vue").PropType<import("@tiptap/vue-3").Editor>;
45
+ };
46
+ }>> & Readonly<{}>, {
47
+ editor: import("@tiptap/vue-3").Editor;
48
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
49
+ Extension: typeof import("@tiptap/core").Extension;
50
+ Placeholder: import("@tiptap/core").Extension<import("@tiptap/extensions").PlaceholderOptions, any>;
51
+ UndoRedo: import("@tiptap/core").Extension<import("@tiptap/extensions").UndoRedoOptions, any>;
52
+ Document: import("@tiptap/core").Node<any, any>;
53
+ Paragraph: import("@tiptap/core").Node<import("@tiptap/extension-paragraph").ParagraphOptions, any>;
54
+ Text: import("@tiptap/core").Node<any, any>;
55
+ Bold: import("@tiptap/core").Mark<import("@tiptap/extension-bold").BoldOptions, any>;
56
+ Italic: import("@tiptap/core").Mark<import("@tiptap/extension-italic").ItalicOptions, any>;
57
+ Strike: import("@tiptap/core").Mark<import("@tiptap/extension-strike").StrikeOptions, any>;
58
+ Code: import("@tiptap/core").Mark<import("@tiptap/extension-code").CodeOptions, any>;
59
+ Mention: import("@tiptap/core").Node<import("@tiptap/extension-mention").MentionOptions<any, import("@tiptap/extension-mention").MentionNodeAttrs>, any>;
60
+ }>;
61
+ export {};
@@ -0,0 +1,3 @@
1
+ /// <reference types="highlight.js" />
2
+ /** highlight.js with its common languages, an optional peer (src/utils/optionalPeer.ts), shared by every code block. */
3
+ export declare const loadHljs: () => Promise<import("highlight.js").HLJSApi>;
@@ -1,5 +1,5 @@
1
1
  import type { PopoverPlacementType, VcEmojiPickerProps } from '../../types';
2
- declare function open(): void;
2
+ declare function open(): Promise<void> | undefined;
3
3
  declare function close(returnFocus?: boolean): void;
4
4
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<VcEmojiPickerProps>, {
5
5
  recentEmojis: () => never[];
@@ -10,7 +10,7 @@ export interface EmojiGroup {
10
10
  emojis: Array<EmojiItem>;
11
11
  }
12
12
  /**
13
- * Emoji grouped by category, in the Unicode order. The data (~100 KB gzipped) is loaded
14
- * from emojibase-data on the first call and shared by every picker afterwards.
13
+ * Emoji grouped by category, in the Unicode order. The data (~100 KB gzipped) comes from emojibase-data,
14
+ * an optional peer (src/utils/optionalPeer.ts), loaded on the first call and shared by every picker.
15
15
  */
16
- export declare function loadEmojiGroups(): Promise<EmojiGroup[]>;
16
+ export declare const loadEmojiGroups: () => Promise<EmojiGroup[]>;
@@ -0,0 +1,8 @@
1
+ import type CodeMirror from 'vue-codemirror6';
2
+ import type { html } from '@codemirror/lang-html';
3
+ export interface IHtmlCodeMirrorModules {
4
+ CodeMirror: typeof CodeMirror;
5
+ html: typeof html;
6
+ }
7
+ /** vue-codemirror6 and its HTML language, optional peers (src/utils/optionalPeer.ts), shared by every HTML editor. */
8
+ export declare const loadHtmlCodeMirror: () => Promise<IHtmlCodeMirrorModules>;
@@ -1,4 +1,4 @@
1
- import { Coordinates, CropperResult, ImageTransforms } from 'vue-advanced-cropper';
1
+ import type { Coordinates, CropperResult, ImageTransforms } from 'vue-advanced-cropper';
2
2
  import type { ButtonColor, ButtonType, TIcon } from '../../types';
3
3
  type resultDataType = {
4
4
  coordinates: null | Coordinates;
@@ -0,0 +1,34 @@
1
+ export type TCropperModule = typeof import('vue-advanced-cropper');
2
+ /** vue-advanced-cropper, an optional peer (src/utils/optionalPeer.ts), shared by every image uploader. */
3
+ export declare const loadCropper: () => Promise<{
4
+ default: typeof import("vue-advanced-cropper");
5
+ ManipulateImageEvent: typeof import("vue-advanced-cropper").ManipulateImageEvent;
6
+ ResizeEvent: typeof import("vue-advanced-cropper").ResizeEvent;
7
+ MoveEvent: typeof import("vue-advanced-cropper").MoveEvent;
8
+ DragEvent: typeof import("vue-advanced-cropper").DragEvent;
9
+ Cropper: import("vue").DefineComponent<any, {
10
+ getResult: () => import("vue-advanced-cropper").CropperResult;
11
+ setCoordinates: (transform: import("vue-advanced-cropper").Transform | import("vue-advanced-cropper").Transform[]) => void;
12
+ refresh: () => void;
13
+ zoom: (factor: number, center?: import("vue-advanced-cropper").Point | undefined) => void;
14
+ move: (left: number, top?: number | undefined) => void;
15
+ rotate: (angle: number) => void;
16
+ flip: (horizontal: boolean, vertical?: boolean | undefined) => void;
17
+ reset: () => void;
18
+ }>;
19
+ PreviewResult: import("vue").DefineComponent<any>;
20
+ DraggableArea: import("vue").DefineComponent<any>;
21
+ BoundingBox: import("vue").DefineComponent<any>;
22
+ LineWrapper: import("vue").DefineComponent<any>;
23
+ HandlerWrapper: import("vue").DefineComponent<any>;
24
+ DraggableElement: import("vue").DefineComponent<any>;
25
+ StencilPreview: import("vue").DefineComponent<any>;
26
+ RectangleStencil: import("vue").DefineComponent<any>;
27
+ CircleStencil: import("vue").DefineComponent<any>;
28
+ SimpleHandler: import("vue").DefineComponent<any>;
29
+ SimpleLine: import("vue").DefineComponent<any>;
30
+ TransformableImage: import("vue").DefineComponent<any>;
31
+ Preview: import("vue").DefineComponent<any, {
32
+ refresh: () => void;
33
+ }>;
34
+ }>;
@@ -0,0 +1,9 @@
1
+ import type CodeMirror from 'vue-codemirror6';
2
+ import type { json, jsonParseLinter } from '@codemirror/lang-json';
3
+ export interface IJsonCodeMirrorModules {
4
+ CodeMirror: typeof CodeMirror;
5
+ json: typeof json;
6
+ jsonParseLinter: typeof jsonParseLinter;
7
+ }
8
+ /** vue-codemirror6 and its JSON language, optional peers (src/utils/optionalPeer.ts), shared by every JSON editor. */
9
+ export declare const loadJsonCodeMirror: () => Promise<IJsonCodeMirrorModules>;
@@ -1,16 +1,10 @@
1
- import { DecorationSet } from '@milkdown/kit/prose/view';
2
1
  import type { EditorView } from '@milkdown/kit/prose/view';
3
- import type { Node } from '@milkdown/kit/prose/model';
2
+ import type { TMilkdown } from './milkdown';
4
3
  /**
5
- * A `dir="ltr"` decoration on every number run in the text blocks of `doc`. Code blocks and inline
6
- * code are left out: they read left to right already.
4
+ * The plugin and its refresh, on the loaded milkdown modules. They share the plugin key, so an
5
+ * editor takes both from one call.
7
6
  */
8
- export declare function ltrNumberDecorations(doc: Node): DecorationSet;
9
- /**
10
- * The decorations while `enabled()` (a read-only editor) is true, recomputed on every change of
11
- * the document (each update of a streamed answer replaces the whole document) and by
12
- * `refreshLtrNumbers`.
13
- */
14
- export declare function ltrNumbersPlugin(enabled: () => boolean): import("@milkdown/utils").$Prose;
15
- /** Recomputes the decorations of `view`, after `enabled()` of its plugin changed. */
16
- export declare function refreshLtrNumbers(view: EditorView): void;
7
+ export declare function createLtrNumbers(milkdown: TMilkdown): {
8
+ ltrNumbersPlugin: (enabled: () => boolean) => import("@milkdown/utils").$Prose;
9
+ refreshLtrNumbers: (view: EditorView) => void;
10
+ };
@@ -1,7 +1,8 @@
1
- import { Crepe } from '@milkdown/crepe';
1
+ import type { Crepe } from '@milkdown/crepe';
2
2
  import type { Attrs, NodeType } from '@milkdown/kit/prose/model';
3
- import { Command, Transaction } from '@milkdown/kit/prose/state';
4
- import { WidgetViewFactory } from '@prosemirror-adapter/vue';
3
+ import type { Command, Transaction } from '@milkdown/kit/prose/state';
4
+ import type { WidgetViewFactory } from '@prosemirror-adapter/vue';
5
+ import type { TMilkdown } from './milkdown';
5
6
  import type { TIcon } from '../../types/icons.types';
6
7
  export type TMdToolbarAction = {
7
8
  label: string;
@@ -33,25 +34,20 @@ export declare const LIST_ITEM_SCHEMA = "listItemSchema";
33
34
  export declare const IMAGE_SCHEMA = "imageBlockSchema";
34
35
  export declare const CODE_BLOCK_SCHEMA = "codeBlockSchema";
35
36
  export declare const TABLE_SCHEMA = "tableSchema";
36
- type SchemaWithCtxType = {
37
- type: (ctx: import('@milkdown/kit/ctx').Ctx) => NodeType;
38
- };
39
- type SchemaCommandFactory = (nodeType: NodeType, attrs: Attrs | null) => Command;
40
- export declare const SCHEMA_TYPES: Record<string, SchemaWithCtxType | null>;
41
- export declare const SCHEMA_TYPE_ACTION: Record<string, SchemaCommandFactory | null>;
42
37
  export declare const headingMenuItems: import("vue").ComputedRef<TMdToolbarAction[]>;
43
38
  export declare const listMenuItems: import("vue").ComputedRef<TMdToolbarAction[]>;
44
39
  export declare const advancedMenuItems: import("vue").ComputedRef<TMdToolbarAction[]>;
45
- export declare function dispatchEditorAction(crepeInstance: Crepe | null, actionType: TSetBlockTypeEvent): void;
46
- export declare function dispatchAdvancedEditorAction(crepeInstance: Crepe | null, actionType: TSetBlockTypeEvent): void;
47
- export declare function dispatchEditorTableAction(crepeInstance: Crepe | null): void;
40
+ /**
41
+ * The block actions of the toolbar (`TSetBlockTypeEvent`) on a Crepe editor, on the loaded milkdown modules.
42
+ */
43
+ export declare function createEditorActions(milkdown: TMilkdown): {
44
+ dispatchEditorAction: (crepeInstance: Crepe | null, actionType: TSetBlockTypeEvent) => void;
45
+ dispatchAdvancedEditorAction: (crepeInstance: Crepe | null, actionType: TSetBlockTypeEvent) => void;
46
+ };
48
47
  export declare function clearRange(tr: Transaction): Transaction;
49
48
  export declare function clearContentAndAddBlockType(nodeType: NodeType, attrs?: Attrs | null): Command;
50
49
  export declare function setBlockType(tr: Transaction, nodeType: NodeType, attrs?: Attrs | null): Transaction;
51
50
  export declare function addEditorBlockType(tr: Transaction, nodeType: NodeType, attrs?: Attrs | null): Transaction | null;
52
51
  export declare function setContentBlockType(nodeType: NodeType, attrs?: Attrs | null): Command;
53
52
  export declare function contentAddBlockType(nodeType: NodeType, attrs?: Attrs | null): Command;
54
- export declare function wrapInBlockType(tr: Transaction, nodeType: NodeType, attrs?: Attrs | null): Transaction | null;
55
- export declare function setContentAndWrapInBlockType(nodeType: NodeType, attrs?: Attrs | null): Command;
56
- export declare const useMustachePlugin: (replaceTest: (testContent: string, from: number, to: number) => void, widgetViewFactory: WidgetViewFactory) => import("@milkdown/utils").$Prose;
57
- export {};
53
+ export declare const useMustachePlugin: (milkdown: TMilkdown, replaceTest: (testContent: string, from: number, to: number) => void, widgetViewFactory: WidgetViewFactory) => import("@milkdown/utils").$Prose;
@@ -0,0 +1,25 @@
1
+ import type { InjectionKey, ShallowRef } from 'vue';
2
+ export type TMilkdown = {
3
+ vue: typeof import('@milkdown/vue');
4
+ kit: {
5
+ core: typeof import('@milkdown/kit/core');
6
+ proseState: typeof import('@milkdown/kit/prose/state');
7
+ proseView: typeof import('@milkdown/kit/prose/view');
8
+ proseModel: typeof import('@milkdown/kit/prose/model');
9
+ proseTransform: typeof import('@milkdown/kit/prose/transform');
10
+ presetCommonmark: typeof import('@milkdown/kit/preset/commonmark');
11
+ presetGfm: typeof import('@milkdown/kit/preset/gfm');
12
+ imageBlock: typeof import('@milkdown/kit/component/image-block');
13
+ };
14
+ utils: typeof import('@milkdown/utils');
15
+ crepe: typeof import('@milkdown/crepe');
16
+ adapter: typeof import('@prosemirror-adapter/vue');
17
+ langMarkdown: typeof import('@codemirror/lang-markdown');
18
+ codemirror: typeof import('vue-codemirror6');
19
+ };
20
+ /** The modules, loaded on the first call and shared by every editor afterwards. */
21
+ export declare const loadMilkdown: () => Promise<TMilkdown>;
22
+ /** Provided by VcMdEditor: undefined until the modules are loaded. */
23
+ export declare const milkdownKey: InjectionKey<Readonly<ShallowRef<TMilkdown | undefined>>>;
24
+ /** The loaded modules, in a component that VcMdEditor renders once they are loaded. */
25
+ export declare function injectMilkdown(): TMilkdown;
@@ -1,8 +1,9 @@
1
- import { MilkdownPlugin } from '@milkdown/kit/ctx';
1
+ import type { MilkdownPlugin } from '@milkdown/kit/ctx';
2
+ import type { TMilkdown } from './milkdown';
2
3
  /**
3
4
  * Custom Milkdown plugin to fix RTL cursor navigation and Hebrew text deletion issues
4
5
  * This plugin directly intercepts ProseMirror's DOM events to handle:
5
6
  * - RTL cursor movement (swaps arrow key behavior in RTL mode)
6
7
  * - Simple deletion for Hebrew text only (when ProseMirror fails)
7
8
  */
8
- export declare const rtlCursorPlugin: MilkdownPlugin;
9
+ export declare const rtlCursorPlugin: (milkdown: TMilkdown) => MilkdownPlugin;
@@ -1,4 +1,4 @@
1
- import { PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api';
1
+ import type { PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api';
2
2
  declare function downloadPdfFile(): Promise<Blob | undefined>;
3
3
  declare function openFile(): Promise<void>;
4
4
  declare function onPrintDocument(dpi?: number, pageNumberOnly?: Array<number>): Promise<void> | undefined;
@@ -1,4 +1,4 @@
1
- import { PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api';
1
+ import type { PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api';
2
2
  interface IPdfPageProps {
3
3
  id?: string;
4
4
  document?: PDFDocumentProxy;
@@ -2,7 +2,7 @@ import type * as PdfNs from 'pdfjs-dist';
2
2
  import type { PDFLinkService as PDFLinkServiceCtor } from 'pdfjs-dist/web/pdf_viewer';
3
3
  export type PdfLib = typeof PdfNs;
4
4
  export type PdfLinkServiceCtor = typeof PDFLinkServiceCtor;
5
- export declare function loadPdf(): Promise<{
5
+ export declare const loadPdf: () => Promise<{
6
6
  pdf: PdfLib;
7
7
  PDFLinkService: PdfLinkServiceCtor;
8
8
  }>;
@@ -2,6 +2,10 @@ import type { TIcon } from '../../types';
2
2
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3
3
  disabled?: boolean | undefined;
4
4
  iconClass?: string | undefined;
5
+ /**
6
+ * @description Show the "stop" button once the sound has started.
7
+ */
8
+ showStop?: boolean | undefined;
5
9
  /**
6
10
  * @description Icon for the "play" action. Accepts a class
7
11
  * string (legacy `vc-icon-*`) or a Vue component (e.g. a
@@ -22,6 +26,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
22
26
  stopIcon?: TIcon | undefined;
23
27
  }>, {
24
28
  iconClass: string;
29
+ showStop: boolean;
25
30
  playIcon: () => import("@lucide/vue").LucideIcon;
26
31
  pauseIcon: () => import("@lucide/vue").LucideIcon;
27
32
  stopIcon: () => import("@lucide/vue").LucideIcon;
@@ -32,6 +37,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
32
37
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
33
38
  disabled?: boolean | undefined;
34
39
  iconClass?: string | undefined;
40
+ /**
41
+ * @description Show the "stop" button once the sound has started.
42
+ */
43
+ showStop?: boolean | undefined;
35
44
  /**
36
45
  * @description Icon for the "play" action. Accepts a class
37
46
  * string (legacy `vc-icon-*`) or a Vue component (e.g. a
@@ -52,6 +61,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
52
61
  stopIcon?: TIcon | undefined;
53
62
  }>, {
54
63
  iconClass: string;
64
+ showStop: boolean;
55
65
  playIcon: () => import("@lucide/vue").LucideIcon;
56
66
  pauseIcon: () => import("@lucide/vue").LucideIcon;
57
67
  stopIcon: () => import("@lucide/vue").LucideIcon;
@@ -61,6 +71,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
61
71
  "onClick:stop"?: (() => any) | undefined;
62
72
  }>, {
63
73
  iconClass: string;
74
+ showStop: boolean;
64
75
  playIcon: TIcon;
65
76
  pauseIcon: TIcon;
66
77
  stopIcon: TIcon;
@@ -0,0 +1,75 @@
1
+ import type { PopoverPlacementType } from '../../types';
2
+ import type { VcSoundPlayerSize } from '../../types/VcSoundPlayer.types';
3
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
4
+ src: string;
5
+ soundId?: string | number | undefined;
6
+ disabled?: boolean | undefined;
7
+ /**
8
+ * @description Size of the play button in the row.
9
+ */
10
+ size?: VcSoundPlayerSize | undefined;
11
+ /**
12
+ * @description Where the player opens relative to the button; the opposite side when there is no room.
13
+ */
14
+ placement?: PopoverPlacementType | undefined;
15
+ }>, {
16
+ soundId: undefined;
17
+ disabled: boolean;
18
+ size: string;
19
+ placement: string;
20
+ }>>, {
21
+ play: () => void;
22
+ pause: () => void | undefined;
23
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
+ ready: (soundId: string) => void;
25
+ start: (soundId: string | number, src: string) => void;
26
+ stop: (soundId: string | number, src: string) => void;
27
+ onPlay: (soundId: string | number, src: string) => void;
28
+ pause: (soundId: string | number, src: string) => void;
29
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
30
+ src: string;
31
+ soundId?: string | number | undefined;
32
+ disabled?: boolean | undefined;
33
+ /**
34
+ * @description Size of the play button in the row.
35
+ */
36
+ size?: VcSoundPlayerSize | undefined;
37
+ /**
38
+ * @description Where the player opens relative to the button; the opposite side when there is no room.
39
+ */
40
+ placement?: PopoverPlacementType | undefined;
41
+ }>, {
42
+ soundId: undefined;
43
+ disabled: boolean;
44
+ size: string;
45
+ placement: string;
46
+ }>>> & Readonly<{
47
+ onStart?: ((soundId: string | number, src: string) => any) | undefined;
48
+ onPause?: ((soundId: string | number, src: string) => any) | undefined;
49
+ onStop?: ((soundId: string | number, src: string) => any) | undefined;
50
+ onOnPlay?: ((soundId: string | number, src: string) => any) | undefined;
51
+ onReady?: ((soundId: string) => any) | undefined;
52
+ }>, {
53
+ size: VcSoundPlayerSize;
54
+ disabled: boolean;
55
+ placement: PopoverPlacementType;
56
+ soundId: string | number;
57
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
58
+ export default _default;
59
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
60
+ type __VLS_TypePropsToRuntimeProps<T> = {
61
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
62
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
63
+ } : {
64
+ type: import('vue').PropType<T[K]>;
65
+ required: true;
66
+ };
67
+ };
68
+ type __VLS_WithDefaults<P, D> = {
69
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
70
+ default: D[K];
71
+ }> : P[K];
72
+ };
73
+ type __VLS_Prettify<T> = {
74
+ [K in keyof T]: T[K];
75
+ } & {};
@@ -1,4 +1,4 @@
1
- import { WaveSurferOptions } from 'wavesurfer.js';
1
+ import type { WaveSurferOptions } from 'wavesurfer.js';
2
2
  import type { HoverPluginOptions } from 'wavesurfer.js/dist/plugins/hover';
3
3
  import type { GenericPlugin } from 'wavesurfer.js/dist/base-plugin';
4
4
  import { VcSoundPlayerSize } from '../../types/VcSoundPlayer.types';
@@ -110,6 +110,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
110
110
  stop: (soundId: string | number | undefined, src: string | undefined) => void;
111
111
  onPlay: (soundId: string | number | undefined, src: string | undefined) => void;
112
112
  pause: (soundId: string | number | undefined, src: string | undefined) => void;
113
+ finish: (soundId: string | number | undefined, src: string | undefined) => void;
113
114
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<IWrapperProps>, {
114
115
  soundId: undefined;
115
116
  src: undefined;
@@ -174,6 +175,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
174
175
  "onUpdate:time"?: ((time: number) => any) | undefined;
175
176
  "onUpdate:duration"?: ((time: number) => any) | undefined;
176
177
  "onUpdate:currentPlay"?: ((src: string | undefined, isPlaying: boolean) => any) | undefined;
178
+ onFinish?: ((soundId: string | number | undefined, src: string | undefined) => any) | undefined;
177
179
  }>, {
178
180
  size: VcSoundPlayerSize;
179
181
  disabled: boolean;
@@ -1,6 +1,8 @@
1
1
  import type { WaveSurferOptions } from 'wavesurfer.js';
2
+ import type { VcSoundPlayerSize } from '../../types/VcSoundPlayer.types';
2
3
  export declare const DEFAULT_OPTIONS: WaveSurferOptions;
3
4
  export declare function themedWaveColors(element?: Element | null): Pick<WaveSurferOptions, 'waveColor' | 'progressColor'>;
5
+ export declare function playerIconClass(size: VcSoundPlayerSize): string;
4
6
  export declare const DEFAULT_HOVER_OPTIONS: {
5
7
  lineColor: string;
6
8
  lineWidth: number;
@@ -0,0 +1,8 @@
1
+ import type WaveSurfer from 'wavesurfer.js';
2
+ import type Hover from 'wavesurfer.js/dist/plugins/hover';
3
+ export interface IWaveSurferModules {
4
+ WaveSurfer: typeof WaveSurfer;
5
+ Hover: typeof Hover;
6
+ }
7
+ /** wavesurfer.js and its hover plugin, an optional peer (src/utils/optionalPeer.ts), shared by every sound player. */
8
+ export declare const loadWaveSurfer: () => Promise<IWaveSurferModules>;
@@ -79,6 +79,7 @@ import VcMeterGroupLabel from './VcMeterGroup/VcMeterGroupLabel.vue';
79
79
  import VcMdEditor from './VcMdEditor/VcMdEditor.vue';
80
80
  import VcSystemUserPrompt from './VcSystemUserPrompt/VcSystemUserPrompt.vue';
81
81
  import VcSoundPlayer from './VcSoundplayer/VcSoundPlayer.vue';
82
+ import VcSoundPlayerCompact from './VcSoundplayer/VcSoundPlayerCompact.vue';
82
83
  import VcJsonSchema from './VcJsonSchema/VcJsonSchema.vue';
83
84
  import VcJsonViewer from './VcJsonViewer/VcJsonViewer.vue';
84
85
  import VcMessage from './VcMessage/VcMessage.vue';
@@ -123,7 +124,7 @@ import VcBaseVerticalForm from '../entity/components/Form/VcBaseVerticalForm.vue
123
124
  import VcEntityVerticalCreateForm from '../entity/components/Form/VcEntityVerticalCreateForm.vue';
124
125
  import VcEntityVerticalEditForm from '../entity/components/Form/VcEntityVerticalEditForm.vue';
125
126
  import VcEntityEditPageForm from '../entity/components/Form/VcEntityEditPageForm.vue';
126
- export { VcButton, VcButtonIcon, VcToggleButton, VcInput, VcInputNumber, VcInputError, VcInputLabel, VcSelect, VcSelectGrouped, VcSelectOption, VcInfiniteScrollSelect, VcAutocomplete, VcCheckbox, VcCheckboxButton, VcCheckboxButtonGroup, VcCheckboxGroup, VcRadio, VcRadioGroup, VcRadioButtonsGroup, VcSwitch, VcSlider, VcColorPicker, VcDatePicker, VcDatePickerPanel, VcDatetimeRangePicker, VcExtendedDatetimeRangePicker, VcTimeInput, VcPhoneInput, VcTagInput, VcOtpInput, VcFileUploader, VcFileUploaderSimple, VcFileUploaderArea, VcFileItem, VcCard, VcCodeBlock, VcModal, VcConfirmModal, VcPopover, VcConfirmPopover, VcSelectPopover, VcTabs, VcTabNav, VcTabPane, VcVerticalTabs, VcRadioTabs, VcRadioTabsNav, VcCollapse, VcCollapseItem, VcWizard, VcDropdown, VcDropdownItem, VcTable, VcPagination, VcTree, VcTreeSelect, VcTransfer, VcTag, VcAvatar, VcBadgeTag, VcDelimitedList, VcSparkline, VcViewSwitcher, VcSegmented, VcLoading, VcProgress, VcProgressCircular, VcSkeletonLoader, VcNotification, VcPluginOverlays, VcForm, VcFormItem, VcSplitButton, VcHyperLink, VcIcon, VcIconPicker, VcMeterGroup, VcMeterGroupLabel, VcMdEditor, VcSystemUserPrompt, VcSoundPlayer, VcJsonSchema, VcJsonViewer, VcMessage, VcMessagesWrapper, VcLightbox, VcToolCall, VcApprovalCard, VcAskUserCard, VcPlayerPlaybackRate, VcPlayerPlaybackRatePopup, VcPlayerPlayStopButton, VcPlayerSkipButtons, VcSoundCurrentTime, VcSoundDuration, VcSoundPlayerError, VcSoundPlayerMarker, VcSoundPlayerMarkers, VcSoundPlayerProgress, VcSoundPlayerWrapper, VcSoundVolume, VcHtmlEditor, VcPdfDocument, VcExcelFileUploader, VcImageUploader, VcTour, VcSipFlow, VcEmojiPicker, VcChatComposer, VcAiReasoning, VcAgentRunCard, VcAgentRunGroup, VcPdfViewer, VcEntityAddButton, VcEntityCancelButton, VcEntityDeleteIconButton, VcEntityEditIconButton, VcEntityRestoreButton, VcEntityStatusButton, VcEntityEditableTabs, VcEntityListTable, VcBaseVerticalForm, VcEntityVerticalCreateForm, VcEntityVerticalEditForm, VcEntityEditPageForm, };
127
+ export { VcButton, VcButtonIcon, VcToggleButton, VcInput, VcInputNumber, VcInputError, VcInputLabel, VcSelect, VcSelectGrouped, VcSelectOption, VcInfiniteScrollSelect, VcAutocomplete, VcCheckbox, VcCheckboxButton, VcCheckboxButtonGroup, VcCheckboxGroup, VcRadio, VcRadioGroup, VcRadioButtonsGroup, VcSwitch, VcSlider, VcColorPicker, VcDatePicker, VcDatePickerPanel, VcDatetimeRangePicker, VcExtendedDatetimeRangePicker, VcTimeInput, VcPhoneInput, VcTagInput, VcOtpInput, VcFileUploader, VcFileUploaderSimple, VcFileUploaderArea, VcFileItem, VcCard, VcCodeBlock, VcModal, VcConfirmModal, VcPopover, VcConfirmPopover, VcSelectPopover, VcTabs, VcTabNav, VcTabPane, VcVerticalTabs, VcRadioTabs, VcRadioTabsNav, VcCollapse, VcCollapseItem, VcWizard, VcDropdown, VcDropdownItem, VcTable, VcPagination, VcTree, VcTreeSelect, VcTransfer, VcTag, VcAvatar, VcBadgeTag, VcDelimitedList, VcSparkline, VcViewSwitcher, VcSegmented, VcLoading, VcProgress, VcProgressCircular, VcSkeletonLoader, VcNotification, VcPluginOverlays, VcForm, VcFormItem, VcSplitButton, VcHyperLink, VcIcon, VcIconPicker, VcMeterGroup, VcMeterGroupLabel, VcMdEditor, VcSystemUserPrompt, VcSoundPlayer, VcSoundPlayerCompact, VcJsonSchema, VcJsonViewer, VcMessage, VcMessagesWrapper, VcLightbox, VcToolCall, VcApprovalCard, VcAskUserCard, VcPlayerPlaybackRate, VcPlayerPlaybackRatePopup, VcPlayerPlayStopButton, VcPlayerSkipButtons, VcSoundCurrentTime, VcSoundDuration, VcSoundPlayerError, VcSoundPlayerMarker, VcSoundPlayerMarkers, VcSoundPlayerProgress, VcSoundPlayerWrapper, VcSoundVolume, VcHtmlEditor, VcPdfDocument, VcExcelFileUploader, VcImageUploader, VcTour, VcSipFlow, VcEmojiPicker, VcChatComposer, VcAiReasoning, VcAgentRunCard, VcAgentRunGroup, VcPdfViewer, VcEntityAddButton, VcEntityCancelButton, VcEntityDeleteIconButton, VcEntityEditIconButton, VcEntityRestoreButton, VcEntityStatusButton, VcEntityEditableTabs, VcEntityListTable, VcBaseVerticalForm, VcEntityVerticalCreateForm, VcEntityVerticalEditForm, VcEntityEditPageForm, };
127
128
  declare module '@vue/runtime-core' {
128
129
  interface GlobalComponents {
129
130
  VcButton: typeof VcButton;
@@ -207,6 +208,7 @@ declare module '@vue/runtime-core' {
207
208
  VcMdEditor: typeof VcMdEditor;
208
209
  VcSystemUserPrompt: typeof VcSystemUserPrompt;
209
210
  VcSoundPlayer: typeof VcSoundPlayer;
211
+ VcSoundPlayerCompact: typeof VcSoundPlayerCompact;
210
212
  VcJsonSchema: typeof VcJsonSchema;
211
213
  VcJsonViewer: typeof VcJsonViewer;
212
214
  VcMessage: typeof VcMessage;
@@ -79,6 +79,7 @@ export { default as VcMeterGroupLabel } from './components/VcMeterGroup/VcMeterG
79
79
  export { default as VcMdEditor } from './components/VcMdEditor/VcMdEditor.vue';
80
80
  export { default as VcSystemUserPrompt } from './components/VcSystemUserPrompt/VcSystemUserPrompt.vue';
81
81
  export { default as VcSoundPlayer } from './components/VcSoundplayer/VcSoundPlayer.vue';
82
+ export { default as VcSoundPlayerCompact } from './components/VcSoundplayer/VcSoundPlayerCompact.vue';
82
83
  export { default as VcJsonSchema } from './components/VcJsonSchema/VcJsonSchema.vue';
83
84
  export { default as VcJsonViewer } from './components/VcJsonViewer/VcJsonViewer.vue';
84
85
  export { default as VcMessage } from './components/VcMessage/VcMessage.vue';
@@ -18,7 +18,7 @@ export declare type VcSoundPlayerProvideType = {
18
18
  volume?: Ref<number>;
19
19
  defaultVolume?: () => number;
20
20
  isPlayingInProgress?: Ref<boolean>;
21
- initWavesurfer?: (id: string, el?: HTMLElement) => void;
21
+ initWavesurfer?: (id: string, el?: HTMLElement) => Promise<void>;
22
22
  play?: (time?: number) => void;
23
23
  pause?: () => void;
24
24
  stop?: () => void;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Loading the optional peers: the packages that package.json `peerDependenciesMeta` marks optional
3
+ * (README, "Optional peers"). An application installs only those of the components it renders, so the
4
+ * library loads each of them with `import()` where it is used and never with a static import (eslint
5
+ * fails on one; `import type` loads nothing and is allowed).
6
+ *
7
+ * Why `import()`: the application's bundler builds a module in place of a peer that is not installed.
8
+ * Vite's one throws when it is evaluated (the dev server, a Vite 7+ production build) or is an empty
9
+ * `export default {}` (a Vite 5 production build), and a static named import from it fails the
10
+ * application's build, also in a chunk the application never loads. Behind a static import the throw
11
+ * fails the whole chunk that imports the peer, and in plugin mode the application, since the plugin
12
+ * imports every component. Behind `import()` it is a rejected promise when a component renders:
13
+ * only that component fails, and as the component returns the promise from its hook, the rejection
14
+ * reaches the application's error handler.
15
+ *
16
+ * A loader is a `cachedLoad` of `loadOptionalPeer` calls (`loadOptionalPeer('@tiptap/vue-3', import('@tiptap/vue-3'))`).
17
+ * The component's documentation page lists the packages it loads (documentation/components/OptionalPeersInstall.vue).
18
+ *
19
+ * A peer's stylesheet is not loaded this way: Vite builds no module in place of a missing stylesheet, and
20
+ * the application's build fails on it. It is an `@import` in the component's `<style>` instead, which
21
+ * Vite's CSS `@import` inlining builds into the library's stylesheet.
22
+ */
23
+ /**
24
+ * The module of an optional peer: resolves with what `module` (an `import()` of `packageName` or of a
25
+ * path inside it) resolves with, and rejects with the error of `module` or, when the module is the empty
26
+ * one Vite 5 builds in place of a missing package, with an error that names `packageName`.
27
+ */
28
+ export declare function loadOptionalPeer<T>(packageName: string, module: Promise<T>): Promise<T>;
29
+ /**
30
+ * `load`, called once and its promise shared by every call after it. A rejected promise is dropped,
31
+ * so the next call loads again.
32
+ */
33
+ export declare function cachedLoad<T>(load: () => Promise<T>): () => Promise<T>;
@@ -1,11 +1,6 @@
1
1
  import { ignoredAsciiCodeSymbols } from "./configs.mjs";
2
- let xlsxPromise = null;
3
- function getXlsx() {
4
- if (!xlsxPromise) {
5
- xlsxPromise = import("xlsx");
6
- }
7
- return xlsxPromise;
8
- }
2
+ import { cachedLoad, loadOptionalPeer } from "../optionalPeer.mjs";
3
+ const getXlsx = cachedLoad(() => loadOptionalPeer("xlsx", import("xlsx")));
9
4
  const readXLSXFile = async (bStr) => {
10
5
  const XLSX = await getXlsx();
11
6
  return XLSX.read(bStr, { type: "binary" });
@@ -0,0 +1,32 @@
1
+ function isMissingPeerModule(module) {
2
+ if (typeof module !== "object" || module === null) {
3
+ return false;
4
+ }
5
+ const keys = Object.keys(module);
6
+ if (keys.length !== 1 || keys[0] !== "default") {
7
+ return false;
8
+ }
9
+ const value = Reflect.get(module, "default");
10
+ return typeof value === "object" && value !== null && Object.getPrototypeOf(value) === Object.prototype && Object.keys(value).length === 0;
11
+ }
12
+ async function loadOptionalPeer(packageName, module) {
13
+ const loaded = await module;
14
+ if (isMissingPeerModule(loaded)) {
15
+ throw new Error(`[voicenter-ui-plus] ${packageName} is not installed: it is an optional peer dependency of @voicenter-team/voicenter-ui-plus that this component needs (README, "Optional peers")`);
16
+ }
17
+ return loaded;
18
+ }
19
+ function cachedLoad(load) {
20
+ let promise;
21
+ return () => {
22
+ promise ?? (promise = load().catch((error) => {
23
+ promise = void 0;
24
+ throw error;
25
+ }));
26
+ return promise;
27
+ };
28
+ }
29
+ export {
30
+ cachedLoad,
31
+ loadOptionalPeer
32
+ };