@voicenter-team/voicenter-ui-plus 3.3.3 → 3.4.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.
Files changed (54) hide show
  1. package/library/assets/assets/sass/main.css +1 -1
  2. package/library/assets/components/VcSoundplayer/VcSoundPlayerMarker.css +1 -0
  3. package/library/assets/components/VcSoundplayer/VcSoundPlayerProgress.css +1 -1
  4. package/library/components/VcCheckbox/VcCheckbox.vue.mjs +1 -1
  5. package/library/components/VcCheckbox/VcCheckboxButton.vue.mjs +1 -1
  6. package/library/components/VcDatePicker/VcDatePicker.vue.mjs +1 -1
  7. package/library/components/VcDropdown/VcDropdownItem.vue.mjs +1 -1
  8. package/library/components/VcForm/VcForm.vue.mjs +1 -1
  9. package/library/components/VcForm/VcFormItem.vue.mjs +1 -1
  10. package/library/components/VcHtmlEditor/VcHtmlEditorToolbar.vue.mjs +1 -1
  11. package/library/components/VcInput/VcInput.vue.mjs +1 -1
  12. package/library/components/VcMdEditor/VcMdEditor.vue.mjs +1 -1
  13. package/library/components/VcMdEditor/VcMdEditorToolbar.vue.mjs +1 -1
  14. package/library/components/VcPdfViewer/VcPdfDocument.vue.mjs +2 -2
  15. package/library/components/VcPdfViewer/VcPdfDocumentPage.vue.mjs +3 -3
  16. package/library/components/VcPdfViewer/pdf.worker.min.js +4 -4
  17. package/library/components/VcPdfViewer/pdfjslib.mjs +2 -2
  18. package/library/components/VcRadio/VcRadio.vue.mjs +1 -1
  19. package/library/components/VcSelect/VcSelect.vue.mjs +1 -1
  20. package/library/components/VcSlider/VcSlider.vue.mjs +1 -1
  21. package/library/components/VcSoundplayer/VcSoundPlayer.vue.mjs +54 -14
  22. package/library/components/VcSoundplayer/VcSoundPlayerMarker.vue.mjs +131 -0
  23. package/library/components/VcSoundplayer/VcSoundPlayerMarker.vue3.mjs +5 -0
  24. package/library/components/VcSoundplayer/VcSoundPlayerMarkers.vue.mjs +49 -0
  25. package/library/components/VcSoundplayer/VcSoundPlayerMarkers.vue2.mjs +4 -0
  26. package/library/components/VcSoundplayer/VcSoundPlayerProgress.vue.mjs +13 -3
  27. package/library/components/VcSoundplayer/VcSoundPlayerWrapper.vue.mjs +17 -1
  28. package/library/index.mjs +53 -48
  29. package/library/index.mjs.br +0 -0
  30. package/library/index.mjs.gz +0 -0
  31. package/library/plugin-components.gen.mjs +47 -42
  32. package/library/plugin.mjs +53 -48
  33. package/library/plugin.mjs.br +0 -0
  34. package/library/plugin.mjs.gz +0 -0
  35. package/library/style.css +4 -2
  36. package/library/style.css.br +0 -0
  37. package/library/style.css.gz +0 -0
  38. package/library/types/components/VcModal/VcModal.vue.d.ts +1 -1
  39. package/library/types/components/VcNotification/VcNotification.vue.d.ts +1 -1
  40. package/library/types/components/VcPdfViewer/VcPdfDocument.vue.d.ts +2 -2
  41. package/library/types/components/VcPdfViewer/VcPdfDocumentPage.vue.d.ts +1 -1
  42. package/library/types/components/VcPdfViewer/pdfjslib.d.ts +2 -2
  43. package/library/types/components/VcRadioTabs/UiComponents/VcRadioTabsNav.vue.d.ts +3 -3
  44. package/library/types/components/VcSoundplayer/VcSoundPlayer.vue.d.ts +43 -3
  45. package/library/types/components/VcSoundplayer/VcSoundPlayerMarker.vue.d.ts +95 -0
  46. package/library/types/components/VcSoundplayer/VcSoundPlayerMarkers.vue.d.ts +52 -0
  47. package/library/types/components/VcSoundplayer/VcSoundPlayerProgress.vue.d.ts +10 -2
  48. package/library/types/components/VcSoundplayer/VcSoundPlayerWrapper.vue.d.ts +2 -0
  49. package/library/types/components/VcSoundplayer/soundPlayerParts.d.ts +3 -1
  50. package/library/types/components/exports.d.ts +5 -1
  51. package/library/types/components.gen.d.ts +2 -0
  52. package/library/types/types/VcSoundPlayer.types.d.ts +36 -1
  53. package/package.json +3 -3
  54. /package/library/assets/node_modules/element-plus/theme-chalk/src/{tooltip.css → date-picker.css} +0 -0
@@ -2,8 +2,8 @@ let pdfPromise = null;
2
2
  function loadPdf() {
3
3
  if (!pdfPromise) {
4
4
  pdfPromise = (async () => {
5
- const pdfImport = import("pdfjs-dist/legacy/build/pdf.js");
6
- const viewerImport = import("pdfjs-dist/legacy/web/pdf_viewer");
5
+ const pdfImport = import("pdfjs-dist/build/pdf.js");
6
+ const viewerImport = import("pdfjs-dist/web/pdf_viewer");
7
7
  const [pdf, viewer] = await Promise.all([pdfImport, viewerImport]);
8
8
  pdf.GlobalWorkerOptions.workerSrc = new URL("./pdf.worker.min.js", import.meta.url).toString();
9
9
  return {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, computed, openBlock, createBlock, unref, normalizeClass, withCtx, renderSlot, createTextVNode, toDisplayString } from "vue";
2
2
  import { ElRadio } from "element-plus";
3
- import '../../assets/node_modules/element-plus/theme-chalk/src/popover.css';import '../../assets/node_modules/element-plus/theme-chalk/src/transfer.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tree.css';import '../../assets/node_modules/element-plus/theme-chalk/src/text.css';import '../../assets/node_modules/element-plus/theme-chalk/src/slider.css';import '../../assets/node_modules/element-plus/theme-chalk/src/color-picker.css';import '../../assets/node_modules/element-plus/theme-chalk/src/color-picker-panel.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tooltip.css';import '../../assets/node_modules/element-plus/theme-chalk/src/date-picker-panel.css';import '../../assets/node_modules/element-plus/theme-chalk/src/button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox-button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio-button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio.css';import '../../assets/node_modules/element-plus/theme-chalk/src/select.css';import '../../assets/node_modules/element-plus/theme-chalk/src/option-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/option.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tag.css';import '../../assets/node_modules/element-plus/theme-chalk/src/autocomplete.css';import '../../assets/node_modules/element-plus/theme-chalk/src/popper.css';import '../../assets/node_modules/element-plus/theme-chalk/src/scrollbar.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input-number.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input.css';import '../../assets/node_modules/element-plus/theme-chalk/src/form-item.css';import '../../assets/node_modules/element-plus/theme-chalk/src/form.css';import '../../assets/node_modules/element-plus/theme-chalk/src/base.css';
3
+ import '../../assets/node_modules/element-plus/theme-chalk/src/popover.css';import '../../assets/node_modules/element-plus/theme-chalk/src/transfer.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tree.css';import '../../assets/node_modules/element-plus/theme-chalk/src/text.css';import '../../assets/node_modules/element-plus/theme-chalk/src/slider.css';import '../../assets/node_modules/element-plus/theme-chalk/src/color-picker.css';import '../../assets/node_modules/element-plus/theme-chalk/src/color-picker-panel.css';import '../../assets/node_modules/element-plus/theme-chalk/src/date-picker.css';import '../../assets/node_modules/element-plus/theme-chalk/src/date-picker-panel.css';import '../../assets/node_modules/element-plus/theme-chalk/src/button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox-button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio-button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio.css';import '../../assets/node_modules/element-plus/theme-chalk/src/select.css';import '../../assets/node_modules/element-plus/theme-chalk/src/option-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/option.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tag.css';import '../../assets/node_modules/element-plus/theme-chalk/src/autocomplete.css';import '../../assets/node_modules/element-plus/theme-chalk/src/popper.css';import '../../assets/node_modules/element-plus/theme-chalk/src/scrollbar.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input-number.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input.css';import '../../assets/node_modules/element-plus/theme-chalk/src/form-item.css';import '../../assets/node_modules/element-plus/theme-chalk/src/form.css';import '../../assets/node_modules/element-plus/theme-chalk/src/base.css';
4
4
  import '../../assets/components/VcRadio/VcRadio.css';/* empty css */
5
5
  /* empty css */
6
6
  /* empty css */
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, computed, markRaw, h, watch, openBlock, createBlock, unref, mergeProps, isRef, createSlots, withCtx, renderSlot, createElementBlock, Fragment, createVNode, createTextVNode, toDisplayString, createCommentVNode, renderList, createElementVNode, normalizeStyle, normalizeClass } from "vue";
2
2
  import { ElSelect } from "element-plus";
3
- import '../../assets/components/VcIcon/VcIcon.css';import '../../assets/components/VcForm/VcFormItem.css';import '../../assets/components/VcCheckbox/VcCheckbox.css';import '../../assets/components/VcSelect/VcSelectOption.css';import '../../assets/node_modules/element-plus/theme-chalk/src/popover.css';import '../../assets/node_modules/element-plus/theme-chalk/src/transfer.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tree.css';import '../../assets/node_modules/element-plus/theme-chalk/src/text.css';import '../../assets/node_modules/element-plus/theme-chalk/src/slider.css';import '../../assets/node_modules/element-plus/theme-chalk/src/color-picker.css';import '../../assets/node_modules/element-plus/theme-chalk/src/color-picker-panel.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tooltip.css';import '../../assets/node_modules/element-plus/theme-chalk/src/date-picker-panel.css';import '../../assets/node_modules/element-plus/theme-chalk/src/button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox-button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio-button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio.css';import '../../assets/node_modules/element-plus/theme-chalk/src/select.css';import '../../assets/node_modules/element-plus/theme-chalk/src/option-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/option.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tag.css';import '../../assets/node_modules/element-plus/theme-chalk/src/autocomplete.css';import '../../assets/node_modules/element-plus/theme-chalk/src/popper.css';import '../../assets/node_modules/element-plus/theme-chalk/src/scrollbar.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input-number.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input.css';import '../../assets/node_modules/element-plus/theme-chalk/src/form-item.css';import '../../assets/node_modules/element-plus/theme-chalk/src/form.css';import '../../assets/node_modules/element-plus/theme-chalk/src/base.css';
3
+ import '../../assets/components/VcIcon/VcIcon.css';import '../../assets/components/VcForm/VcFormItem.css';import '../../assets/components/VcCheckbox/VcCheckbox.css';import '../../assets/components/VcSelect/VcSelectOption.css';import '../../assets/node_modules/element-plus/theme-chalk/src/popover.css';import '../../assets/node_modules/element-plus/theme-chalk/src/transfer.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tree.css';import '../../assets/node_modules/element-plus/theme-chalk/src/text.css';import '../../assets/node_modules/element-plus/theme-chalk/src/slider.css';import '../../assets/node_modules/element-plus/theme-chalk/src/color-picker.css';import '../../assets/node_modules/element-plus/theme-chalk/src/color-picker-panel.css';import '../../assets/node_modules/element-plus/theme-chalk/src/date-picker.css';import '../../assets/node_modules/element-plus/theme-chalk/src/date-picker-panel.css';import '../../assets/node_modules/element-plus/theme-chalk/src/button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox-button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio-button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio.css';import '../../assets/node_modules/element-plus/theme-chalk/src/select.css';import '../../assets/node_modules/element-plus/theme-chalk/src/option-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/option.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tag.css';import '../../assets/node_modules/element-plus/theme-chalk/src/autocomplete.css';import '../../assets/node_modules/element-plus/theme-chalk/src/popper.css';import '../../assets/node_modules/element-plus/theme-chalk/src/scrollbar.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input-number.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input.css';import '../../assets/node_modules/element-plus/theme-chalk/src/form-item.css';import '../../assets/node_modules/element-plus/theme-chalk/src/form.css';import '../../assets/node_modules/element-plus/theme-chalk/src/base.css';
4
4
  import '../../assets/components/VcSelect/VcSelect.css';/* empty css */
5
5
  /* empty css */
6
6
  /* empty css */
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps } from "vue";
2
2
  import { ElSlider } from "element-plus";
3
- import '../../assets/node_modules/element-plus/theme-chalk/src/slider.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input-number.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tooltip.css';import '../../assets/node_modules/element-plus/theme-chalk/src/popper.css';import '../../assets/node_modules/element-plus/theme-chalk/src/base.css';
3
+ import '../../assets/node_modules/element-plus/theme-chalk/src/slider.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input-number.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input.css';import '../../assets/node_modules/element-plus/theme-chalk/src/date-picker.css';import '../../assets/node_modules/element-plus/theme-chalk/src/popper.css';import '../../assets/node_modules/element-plus/theme-chalk/src/base.css';
4
4
  import '../../assets/components/VcSlider/VcSlider.css';/* empty css */
5
5
  /* empty css */
6
6
  /* empty css */
@@ -1,19 +1,20 @@
1
1
  import '../../assets/components/VcSoundplayer/VcSoundPlayer.css';
2
- import { defineComponent, ref, computed, watch, openBlock, createElementBlock, createBlock, withCtx, createVNode, createCommentVNode, withDirectives, normalizeClass, vShow, createElementVNode, Fragment, renderList, withModifiers } from "vue";
2
+ import { defineComponent, useSlots, computed, ref, watch, openBlock, createElementBlock, createBlock, withCtx, createVNode, createCommentVNode, withDirectives, normalizeClass, createSlots, renderSlot, normalizeProps, guardReactiveProps, vShow, createElementVNode, Fragment, renderList, withModifiers } from "vue";
3
3
  import _sfc_main$2 from "./VcSoundPlayerError.vue.mjs";
4
4
  import _sfc_main$3 from "./VcPlayerPlayStopButton.vue.mjs";
5
5
  import _sfc_main$4 from "./VcPlayerSkipButtons.vue.mjs";
6
6
  import '../../assets/components/VcIcon/VcIcon.css';import '../../assets/components/VcPopover/VcPopover.css';import '../../assets/components/VcSoundplayer/VcSoundPlayerWrapper.css';import '../../assets/components/VcSoundplayer/VcSoundPlayerProgress.css';import '../../assets/components/VcSoundplayer/VcSoundVolume.css';import '../../assets/components/VcSoundplayer/VcPlayerSkipButtons.css';/* empty css */
7
7
  import _sfc_main$6 from "./VcSoundCurrentTime.vue.mjs";
8
- import _sfc_main$8 from "./VcSoundDuration.vue.mjs";
9
- import _sfc_main$9 from "./VcSoundVolume.vue.mjs";
8
+ import _sfc_main$9 from "./VcSoundDuration.vue.mjs";
9
+ import _sfc_main$a from "./VcSoundVolume.vue.mjs";
10
10
  /* empty css */
11
11
  import _sfc_main$7 from "./VcSoundPlayerProgress.vue.mjs";
12
12
  /* empty css */
13
+ import _sfc_main$8 from "./VcSoundPlayerMarkers.vue.mjs";
13
14
  import _sfc_main$1 from "./VcSoundPlayerWrapper.vue.mjs";
14
15
  /* empty css */
15
16
  import { DEFAULT_OPTIONS } from "./player.options.mjs";
16
- import _sfc_main$a from "../VcPopover/VcPopover.vue.mjs";
17
+ import _sfc_main$b from "../VcPopover/VcPopover.vue.mjs";
17
18
  /* empty css */
18
19
  import _sfc_main$5 from "../VcIcon/VcIcon.vue.mjs";
19
20
  /* empty css */
@@ -42,11 +43,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
42
43
  showSkipButtons: { type: Boolean, default: false },
43
44
  skipLength: { default: void 0 },
44
45
  size: { default: "md" },
45
- downloadLinks: { default: () => [] }
46
+ downloadLinks: { default: () => [] },
47
+ markers: { default: () => [] },
48
+ preloadSound: { type: Boolean, default: void 0 }
46
49
  },
47
- emits: ["ready", "start", "stop", "onPlay", "pause"],
50
+ emits: ["ready", "start", "stop", "onPlay", "pause", "marker-click"],
48
51
  setup(__props, { expose: __expose, emit: __emit }) {
49
52
  const props = __props;
53
+ const slots = useSlots();
54
+ const hasMarkersContent = computed(() => {
55
+ return Boolean(slots.markers) || Boolean(slots.marker) || props.markers.length > 0;
56
+ });
57
+ const resolvedPreloadSound = computed(() => {
58
+ if (props.preloadSound !== void 0) {
59
+ return props.preloadSound;
60
+ }
61
+ return hasMarkersContent.value;
62
+ });
50
63
  const emit = __emit;
51
64
  const SoundPlayerWrapper = ref();
52
65
  const isError = ref(false);
@@ -96,7 +109,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
96
109
  emit("pause", soundId || "", src || "");
97
110
  }
98
111
  function onReady(soundId) {
99
- emit("ready", soundId);
112
+ emit("ready", soundId ?? "");
113
+ }
114
+ function onMarkerClick(marker, index, time, event) {
115
+ emit("marker-click", marker, index, time, event);
100
116
  }
101
117
  function stop() {
102
118
  var _a;
@@ -186,6 +202,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
186
202
  "sound-id": __props.soundId,
187
203
  options: playerOptions.value,
188
204
  "skip-seconds": __props.skipLength,
205
+ "preload-sound": resolvedPreloadSound.value,
189
206
  class: "w-full",
190
207
  onReady,
191
208
  onPause,
@@ -220,20 +237,43 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
220
237
  class: "sound-time-current"
221
238
  })) : createCommentVNode("", true),
222
239
  withDirectives(createVNode(_sfc_main$7, {
223
- class: normalizeClass(height.value)
224
- }, null, 8, ["class"]), [
240
+ class: normalizeClass(height.value),
241
+ "show-by-init": hasMarkersContent.value
242
+ }, createSlots({ _: 2 }, [
243
+ hasMarkersContent.value ? {
244
+ name: "markers",
245
+ fn: withCtx(() => [
246
+ renderSlot(_ctx.$slots, "markers", { markers: __props.markers }, () => [
247
+ __props.markers && __props.markers.length ? (openBlock(), createBlock(_sfc_main$8, {
248
+ key: 0,
249
+ markers: __props.markers,
250
+ onClick: onMarkerClick
251
+ }, createSlots({ _: 2 }, [
252
+ _ctx.$slots.marker ? {
253
+ name: "marker",
254
+ fn: withCtx((slotProps) => [
255
+ renderSlot(_ctx.$slots, "marker", normalizeProps(guardReactiveProps(slotProps)))
256
+ ]),
257
+ key: "0"
258
+ } : void 0
259
+ ]), 1032, ["markers"])) : createCommentVNode("", true)
260
+ ])
261
+ ]),
262
+ key: "0"
263
+ } : void 0
264
+ ]), 1032, ["class", "show-by-init"]), [
225
265
  [vShow, !__props.simple]
226
266
  ]),
227
- !__props.simple ? (openBlock(), createBlock(_sfc_main$8, {
267
+ !__props.simple ? (openBlock(), createBlock(_sfc_main$9, {
228
268
  key: 3,
229
269
  class: "sound-duration"
230
270
  })) : createCommentVNode("", true),
231
- !__props.simple ? (openBlock(), createBlock(_sfc_main$9, {
271
+ !__props.simple ? (openBlock(), createBlock(_sfc_main$a, {
232
272
  key: 4,
233
273
  disabled: __props.disabled
234
274
  }, null, 8, ["disabled"])) : createCommentVNode("", true),
235
275
  showDownloadButton.value && !__props.simple ? (openBlock(), createElementBlock("div", _hoisted_4, [
236
- createVNode(_sfc_main$a, {
276
+ createVNode(_sfc_main$b, {
237
277
  disabled: __props.disabled,
238
278
  "popover-class": "!min-w-max",
239
279
  "popover-width": "auto"
@@ -265,8 +305,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
265
305
  ])) : createCommentVNode("", true)
266
306
  ]))
267
307
  ]),
268
- _: 1
269
- }, 8, ["disabled", "src", "current-play", "size", "sound-id", "options", "skip-seconds"])) : createCommentVNode("", true)
308
+ _: 3
309
+ }, 8, ["disabled", "src", "current-play", "size", "sound-id", "options", "skip-seconds", "preload-sound"])) : createCommentVNode("", true)
270
310
  ]);
271
311
  };
272
312
  }
@@ -0,0 +1,131 @@
1
+ import '../../assets/components/VcSoundplayer/VcSoundPlayerMarker.css';
2
+ import { defineComponent, computed, openBlock, createElementBlock, withKeys, withModifiers, normalizeStyle, normalizeClass, renderSlot, createCommentVNode, createElementVNode, createBlock, toDisplayString } from "vue";
3
+ import { useSoundPlayerInject } from "./useSoundPlayerProvideInject.mjs";
4
+ import { toMinutes } from "./player.options.mjs";
5
+ import _sfc_main$1 from "../VcIcon/VcIcon.vue.mjs";
6
+ import '../../assets/components/VcIcon/VcIcon.css';/* empty css */
7
+ const _hoisted_1 = ["disabled", "aria-label", "title", "onKeydown"];
8
+ const _hoisted_2 = {
9
+ key: 0,
10
+ class: "vc-sound-player__marker-stem"
11
+ };
12
+ const _hoisted_3 = { class: "vc-sound-player__marker-glyph" };
13
+ const _hoisted_4 = {
14
+ key: 1,
15
+ class: "vc-sound-player__marker-dot"
16
+ };
17
+ const _hoisted_5 = {
18
+ key: 1,
19
+ class: "vc-sound-player__marker-label"
20
+ };
21
+ const _sfc_main = /* @__PURE__ */ defineComponent({
22
+ __name: "VcSoundPlayerMarker",
23
+ props: {
24
+ time: {},
25
+ label: { default: "" },
26
+ color: { default: void 0 },
27
+ disabled: { type: Boolean, default: false },
28
+ ariaLabel: { default: "" },
29
+ seekOnClick: { type: Boolean, default: true },
30
+ showStem: { type: Boolean, default: true },
31
+ icon: { default: void 0 },
32
+ iconClass: { default: "icon-md" },
33
+ placement: { default: "top" }
34
+ },
35
+ emits: ["click"],
36
+ setup(__props, { emit: __emit }) {
37
+ const PLACEMENT_CLASSES = {
38
+ top: "vc-sound-player__marker--placement-top",
39
+ center: "vc-sound-player__marker--placement-center",
40
+ bottom: "vc-sound-player__marker--placement-bottom"
41
+ };
42
+ const props = __props;
43
+ const emit = __emit;
44
+ const { duration, currentTime, seekTo } = useSoundPlayerInject();
45
+ const isPositioned = computed(() => ((duration == null ? void 0 : duration.value) ?? 0) > 0);
46
+ const position = computed(() => {
47
+ const dur = (duration == null ? void 0 : duration.value) ?? 0;
48
+ if (dur <= 0) {
49
+ return 0;
50
+ }
51
+ const raw = props.time / dur * 100;
52
+ return Math.min(Math.max(raw, 0), 100);
53
+ });
54
+ const isPast = computed(() => {
55
+ return ((currentTime == null ? void 0 : currentTime.value) ?? 0) >= props.time;
56
+ });
57
+ const markerClasses = computed(() => ({
58
+ "vc-sound-player__marker--past": isPast.value,
59
+ "vc-sound-player__marker--disabled": props.disabled,
60
+ "vc-sound-player__marker--no-stem": !props.showStem,
61
+ "vc-sound-player__marker--has-icon": Boolean(props.icon),
62
+ [PLACEMENT_CLASSES[props.placement]]: true
63
+ }));
64
+ const markerStyle = computed(() => {
65
+ const style = {
66
+ left: `${position.value}%`
67
+ };
68
+ if (props.color) {
69
+ style["--vc-marker-color"] = props.color;
70
+ }
71
+ return style;
72
+ });
73
+ const titleText = computed(() => {
74
+ return props.label || toMinutes(props.time);
75
+ });
76
+ const resolvedAriaLabel = computed(() => {
77
+ if (props.ariaLabel) {
78
+ return props.ariaLabel;
79
+ }
80
+ const readableTime = toMinutes(props.time);
81
+ return props.label ? `${props.label} at ${readableTime}` : `Seek to ${readableTime}`;
82
+ });
83
+ function handleClick(event) {
84
+ if (props.disabled) {
85
+ return;
86
+ }
87
+ if (props.seekOnClick && seekTo) {
88
+ seekTo(props.time);
89
+ }
90
+ emit("click", props.time, event);
91
+ }
92
+ return (_ctx, _cache) => {
93
+ return isPositioned.value ? (openBlock(), createElementBlock("button", {
94
+ key: 0,
95
+ type: "button",
96
+ class: normalizeClass(["vc-sound-player__marker", markerClasses.value]),
97
+ style: normalizeStyle(markerStyle.value),
98
+ disabled: __props.disabled,
99
+ "aria-label": resolvedAriaLabel.value,
100
+ title: titleText.value,
101
+ onClick: withModifiers(handleClick, ["stop"]),
102
+ onKeydown: [
103
+ withKeys(withModifiers(handleClick, ["prevent"]), ["enter"]),
104
+ withKeys(withModifiers(handleClick, ["prevent"]), ["space"])
105
+ ]
106
+ }, [
107
+ renderSlot(_ctx.$slots, "default", {
108
+ time: __props.time,
109
+ position: position.value,
110
+ isPast: isPast.value,
111
+ label: __props.label,
112
+ disabled: __props.disabled,
113
+ icon: __props.icon
114
+ }, () => [
115
+ __props.showStem ? (openBlock(), createElementBlock("span", _hoisted_2)) : createCommentVNode("", true),
116
+ createElementVNode("span", _hoisted_3, [
117
+ __props.icon ? (openBlock(), createBlock(_sfc_main$1, {
118
+ key: 0,
119
+ icon: __props.icon,
120
+ class: normalizeClass(__props.iconClass)
121
+ }, null, 8, ["icon", "class"])) : (openBlock(), createElementBlock("span", _hoisted_4))
122
+ ]),
123
+ __props.label ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(__props.label), 1)) : createCommentVNode("", true)
124
+ ])
125
+ ], 46, _hoisted_1)) : createCommentVNode("", true);
126
+ };
127
+ }
128
+ });
129
+ export {
130
+ _sfc_main as default
131
+ };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./VcSoundPlayerMarker.vue.mjs";
2
+ import '../../assets/components/VcSoundplayer/VcSoundPlayerMarker.css';/* empty css */
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -0,0 +1,49 @@
1
+ import { defineComponent, openBlock, createElementBlock, Fragment, renderList, createBlock, createSlots, withCtx, renderSlot, mergeProps } from "vue";
2
+ import _sfc_main$1 from "./VcSoundPlayerMarker.vue.mjs";
3
+ import '../../assets/components/VcSoundplayer/VcSoundPlayerMarker.css';/* empty css */
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ __name: "VcSoundPlayerMarkers",
6
+ props: {
7
+ markers: {},
8
+ seekOnClick: { type: Boolean, default: true }
9
+ },
10
+ emits: ["click"],
11
+ setup(__props, { emit: __emit }) {
12
+ const emit = __emit;
13
+ function onMarkerClick(marker, index, time, event) {
14
+ emit("click", marker, index, time, event);
15
+ }
16
+ return (_ctx, _cache) => {
17
+ return openBlock(true), createElementBlock(Fragment, null, renderList(__props.markers, (marker, index) => {
18
+ return openBlock(), createBlock(_sfc_main$1, {
19
+ key: marker.id ?? `${marker.time}-${index}`,
20
+ time: marker.time,
21
+ label: marker.label,
22
+ color: marker.color,
23
+ disabled: marker.disabled,
24
+ "aria-label": marker.ariaLabel,
25
+ "show-stem": marker.showStem ?? true,
26
+ icon: marker.icon,
27
+ "icon-class": marker.iconClass,
28
+ placement: marker.placement ?? "top",
29
+ "seek-on-click": __props.seekOnClick,
30
+ onClick: (time, event) => onMarkerClick(marker, index, time, event)
31
+ }, createSlots({ _: 2 }, [
32
+ _ctx.$slots.marker ? {
33
+ name: "default",
34
+ fn: withCtx((slotProps) => [
35
+ renderSlot(_ctx.$slots, "marker", mergeProps({ ref_for: true }, slotProps, {
36
+ marker,
37
+ index
38
+ }))
39
+ ]),
40
+ key: "0"
41
+ } : void 0
42
+ ]), 1032, ["time", "label", "color", "disabled", "aria-label", "show-stem", "icon", "icon-class", "placement", "seek-on-click", "onClick"]);
43
+ }), 128);
44
+ };
45
+ }
46
+ });
47
+ export {
48
+ _sfc_main as default
49
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./VcSoundPlayerMarkers.vue.mjs";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -1,11 +1,15 @@
1
1
  import '../../assets/components/VcSoundplayer/VcSoundPlayerProgress.css';
2
- import { defineComponent, computed, ref, onMounted, openBlock, createElementBlock, unref, createBlock, createCommentVNode, withDirectives, createElementVNode, vShow } from "vue";
2
+ import { defineComponent, useSlots, computed, ref, onMounted, openBlock, createElementBlock, unref, createBlock, createCommentVNode, withDirectives, createElementVNode, renderSlot, vShow } from "vue";
3
3
  import { useSoundPlayerInject } from "./useSoundPlayerProvideInject.mjs";
4
4
  import _sfc_main$1 from "../VcSkeletonLoader/VcSkeletonLoader.vue.mjs";
5
5
  const _hoisted_1 = { class: "vc-sound-progress-bar" };
6
6
  const _hoisted_2 = { class: "flex-grow w-full h-full wave-form-content" };
7
7
  const _hoisted_3 = ["id"];
8
8
  const _hoisted_4 = {
9
+ key: 0,
10
+ class: "vc-sound-player__markers-layer"
11
+ };
12
+ const _hoisted_5 = {
9
13
  key: 1,
10
14
  class: "w-full h-px bg-ui-lines rounded-full"
11
15
  };
@@ -17,12 +21,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
17
21
  setup(__props) {
18
22
  const { componentId, loading, options, isPlayingInProgress, initWavesurfer, isInitialized, isInitSound } = useSoundPlayerInject();
19
23
  const props = __props;
24
+ const slots = useSlots();
20
25
  const isVisibleLine = computed(() => {
21
26
  if (props.showByInit) {
22
27
  return (loading == null ? void 0 : loading.value) || !(isInitSound == null ? void 0 : isInitSound.value);
23
28
  }
24
29
  return !(loading == null ? void 0 : loading.value) && !(isPlayingInProgress == null ? void 0 : isPlayingInProgress.value);
25
30
  });
31
+ const hasMarkers = computed(() => Boolean(slots.markers || slots.default));
26
32
  const waveformProgress = ref();
27
33
  onMounted(() => {
28
34
  if (isInitialized == null ? void 0 : isInitialized.value) {
@@ -47,11 +53,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
47
53
  ref_key: "waveformProgress",
48
54
  ref: waveformProgress,
49
55
  class: "waveform-progress"
50
- }, null, 8, _hoisted_3)
56
+ }, null, 8, _hoisted_3),
57
+ hasMarkers.value ? (openBlock(), createElementBlock("div", _hoisted_4, [
58
+ renderSlot(_ctx.$slots, "markers"),
59
+ renderSlot(_ctx.$slots, "default")
60
+ ])) : createCommentVNode("", true)
51
61
  ], 512), [
52
62
  [vShow, __props.showByInit ? unref(isInitSound) : unref(isPlayingInProgress)]
53
63
  ]),
54
- isVisibleLine.value ? (openBlock(), createElementBlock("div", _hoisted_4)) : createCommentVNode("", true)
64
+ isVisibleLine.value ? (openBlock(), createElementBlock("div", _hoisted_5)) : createCommentVNode("", true)
55
65
  ]);
56
66
  };
57
67
  }
@@ -178,6 +178,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
178
178
  var _a;
179
179
  (_a = wavesurfer.value) == null ? void 0 : _a.setTime(time);
180
180
  }
181
+ function seekTo(time) {
182
+ var _a;
183
+ if (props.disabled) {
184
+ return;
185
+ }
186
+ const dur = duration.value;
187
+ const target = dur > 0 ? Math.min(Math.max(time, 0), dur) : Math.max(time, 0);
188
+ if (!isInitSound.value) {
189
+ initialStartTime.value = target;
190
+ loadingSound(target);
191
+ return;
192
+ }
193
+ (_a = wavesurfer.value) == null ? void 0 : _a.setTime(target);
194
+ }
181
195
  function setTimeAndPlay(time) {
182
196
  stop();
183
197
  play(time);
@@ -257,7 +271,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
257
271
  initWavesurfer,
258
272
  skipBackward,
259
273
  skipForward,
260
- setPlaybackRate
274
+ setPlaybackRate,
275
+ seekTo
261
276
  });
262
277
  __expose({
263
278
  initSound,
@@ -269,6 +284,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
269
284
  skipBackward,
270
285
  skipForward,
271
286
  setTime,
287
+ seekTo,
272
288
  getCurrentTime: () => currentTime.value,
273
289
  getDurationTime: () => duration.value,
274
290
  setDurationTime,
package/library/index.mjs CHANGED
@@ -165,54 +165,57 @@ import { default as default91 } from "./components/VcSoundplayer/VcSoundDuration
165
165
  import { default as default92 } from "./components/VcSoundplayer/VcSoundPlayer.vue.mjs";
166
166
  /* empty css */
167
167
  import { default as default93 } from "./components/VcSoundplayer/VcSoundPlayerError.vue.mjs";
168
- import { default as default94 } from "./components/VcSoundplayer/VcSoundPlayerProgress.vue.mjs";
168
+ import { default as default94 } from "./components/VcSoundplayer/VcSoundPlayerMarker.vue.mjs";
169
+ /* empty css */
170
+ import { default as default95 } from "./components/VcSoundplayer/VcSoundPlayerMarkers.vue.mjs";
171
+ import { default as default96 } from "./components/VcSoundplayer/VcSoundPlayerProgress.vue.mjs";
169
172
  /* empty css */
170
- import { default as default95 } from "./components/VcSoundplayer/VcSoundPlayerWrapper.vue.mjs";
173
+ import { default as default97 } from "./components/VcSoundplayer/VcSoundPlayerWrapper.vue.mjs";
171
174
  /* empty css */
172
- import { default as default96 } from "./components/VcSoundplayer/VcSoundVolume.vue.mjs";
175
+ import { default as default98 } from "./components/VcSoundplayer/VcSoundVolume.vue.mjs";
173
176
  /* empty css */
174
- import { default as default97 } from "./components/VcSparkline/VcSparkline.vue.mjs";
175
- import { default as default98 } from "./components/VcSplitButton/VcSplitButton.vue.mjs";
177
+ import { default as default99 } from "./components/VcSparkline/VcSparkline.vue.mjs";
178
+ import { default as default100 } from "./components/VcSplitButton/VcSplitButton.vue.mjs";
176
179
  /* empty css */
177
- import { default as default99 } from "./components/VcSwitch/VcSwitch.vue.mjs";
180
+ import { default as default101 } from "./components/VcSwitch/VcSwitch.vue.mjs";
178
181
  /* empty css */
179
- import { default as default100 } from "./components/VcSystemUserPrompt/VcSystemUserPrompt.vue.mjs";
182
+ import { default as default102 } from "./components/VcSystemUserPrompt/VcSystemUserPrompt.vue.mjs";
180
183
  /* empty css */
181
- import { default as default101 } from "./components/VcTabs/VcTabNav.vue.mjs";
184
+ import { default as default103 } from "./components/VcTabs/VcTabNav.vue.mjs";
182
185
  /* empty css */
183
- import { default as default102 } from "./components/VcTabs/VcTabPane.vue.mjs";
186
+ import { default as default104 } from "./components/VcTabs/VcTabPane.vue.mjs";
184
187
  /* empty css */
185
- import { default as default103 } from "./components/VcTable/VcTable.vue.mjs";
188
+ import { default as default105 } from "./components/VcTable/VcTable.vue.mjs";
186
189
  /* empty css */
187
190
  /* empty css */
188
- import { default as default104 } from "./components/VcTabs/VcTabs.vue.mjs";
191
+ import { default as default106 } from "./components/VcTabs/VcTabs.vue.mjs";
189
192
  /* empty css */
190
- import { default as default105 } from "./components/VcTag/VcTag.vue.mjs";
193
+ import { default as default107 } from "./components/VcTag/VcTag.vue.mjs";
191
194
  /* empty css */
192
- import { default as default106 } from "./components/VcTagInput/VcTagInput.vue.mjs";
195
+ import { default as default108 } from "./components/VcTagInput/VcTagInput.vue.mjs";
193
196
  /* empty css */
194
- import { default as default107 } from "./components/VcTimeInput/VcTimeInput.vue.mjs";
197
+ import { default as default109 } from "./components/VcTimeInput/VcTimeInput.vue.mjs";
195
198
  /* empty css */
196
- import { default as default108 } from "./components/VcButton/VcToggleButton.vue.mjs";
199
+ import { default as default110 } from "./components/VcButton/VcToggleButton.vue.mjs";
197
200
  /* empty css */
198
- import { default as default109 } from "./components/VcTour/VcTour.vue.mjs";
201
+ import { default as default111 } from "./components/VcTour/VcTour.vue.mjs";
199
202
  /* empty css */
200
- import { default as default110 } from "./components/VcTransfer/VcTransfer.vue.mjs";
203
+ import { default as default112 } from "./components/VcTransfer/VcTransfer.vue.mjs";
201
204
  /* empty css */
202
- import { default as default111 } from "./components/VcTree/VcTree.vue.mjs";
205
+ import { default as default113 } from "./components/VcTree/VcTree.vue.mjs";
203
206
  /* empty css */
204
- import { default as default112 } from "./components/VcTree/VcTreeSelect.vue.mjs";
207
+ import { default as default114 } from "./components/VcTree/VcTreeSelect.vue.mjs";
205
208
  /* empty css */
206
209
  /* empty css */
207
- import { default as default113 } from "./components/VcVerticalTabs/VcVerticalTabs.vue.mjs";
210
+ import { default as default115 } from "./components/VcVerticalTabs/VcVerticalTabs.vue.mjs";
208
211
  /* empty css */
209
- import { default as default114 } from "./components/VcViewSwitcher/VcViewSwitcher.vue.mjs";
212
+ import { default as default116 } from "./components/VcViewSwitcher/VcViewSwitcher.vue.mjs";
210
213
  /* empty css */
211
- import { default as default115 } from "./components/VcWizard/VcWizard.vue.mjs";
214
+ import { default as default117 } from "./components/VcWizard/VcWizard.vue.mjs";
212
215
  /* empty css */
213
216
  export * from "element-plus/es/components/form/src/constants";
214
- import { default as default116 } from "./components/VcFileUploader/VcFileUploader.vue.mjs";
215
- import { default as default117 } from "./components/VcLoading/VcLoading.vue.mjs";
217
+ import { default as default118 } from "./components/VcFileUploader/VcFileUploader.vue.mjs";
218
+ import { default as default119 } from "./components/VcLoading/VcLoading.vue.mjs";
216
219
  export {
217
220
  ALIAS_ITEM_SPACE,
218
221
  BaseEntityService,
@@ -285,7 +288,7 @@ export {
285
288
  default44 as VcEntityVerticalEditForm,
286
289
  default45 as VcExcelFileUploader,
287
290
  default46 as VcExtendedDatetimeRangePicker,
288
- default116 as VcFileUploader,
291
+ default118 as VcFileUploader,
289
292
  default47 as VcForm,
290
293
  default48 as VcFormItem,
291
294
  default49 as VcHtmlEditor,
@@ -300,7 +303,7 @@ export {
300
303
  default57 as VcInputLabel,
301
304
  default58 as VcInputNumber,
302
305
  default59 as VcJsonSchema,
303
- default117 as VcLoading,
306
+ default119 as VcLoading,
304
307
  default60 as VcMdEditor,
305
308
  default61 as VcMeterGroup,
306
309
  default62 as VcMeterGroupLabel,
@@ -336,31 +339,33 @@ export {
336
339
  default91 as VcSoundDuration,
337
340
  default92 as VcSoundPlayer,
338
341
  default93 as VcSoundPlayerError,
339
- default94 as VcSoundPlayerProgress,
342
+ default94 as VcSoundPlayerMarker,
343
+ default95 as VcSoundPlayerMarkers,
344
+ default96 as VcSoundPlayerProgress,
340
345
  VcSoundPlayerProvideKey,
341
- default95 as VcSoundPlayerWrapper,
342
- default96 as VcSoundVolume,
343
- default97 as VcSparkline,
344
- default98 as VcSplitButton,
345
- default99 as VcSwitch,
346
- default100 as VcSystemUserPrompt,
347
- default101 as VcTabNav,
348
- default102 as VcTabPane,
346
+ default97 as VcSoundPlayerWrapper,
347
+ default98 as VcSoundVolume,
348
+ default99 as VcSparkline,
349
+ default100 as VcSplitButton,
350
+ default101 as VcSwitch,
351
+ default102 as VcSystemUserPrompt,
352
+ default103 as VcTabNav,
353
+ default104 as VcTabPane,
349
354
  VcTabPaneProvideKey,
350
- default103 as VcTable,
351
- default104 as VcTabs,
355
+ default105 as VcTable,
356
+ default106 as VcTabs,
352
357
  VcTabsProvideKey,
353
- default105 as VcTag,
354
- default106 as VcTagInput,
355
- default107 as VcTimeInput,
356
- default108 as VcToggleButton,
357
- default109 as VcTour,
358
- default110 as VcTransfer,
359
- default111 as VcTree,
360
- default112 as VcTreeSelect,
361
- default113 as VcVerticalTabs,
362
- default114 as VcViewSwitcher,
363
- default115 as VcWizard,
358
+ default107 as VcTag,
359
+ default108 as VcTagInput,
360
+ default109 as VcTimeInput,
361
+ default110 as VcToggleButton,
362
+ default111 as VcTour,
363
+ default112 as VcTransfer,
364
+ default113 as VcTree,
365
+ default114 as VcTreeSelect,
366
+ default115 as VcVerticalTabs,
367
+ default116 as VcViewSwitcher,
368
+ default117 as VcWizard,
364
369
  default9 as ZIndexUtils,
365
370
  add,
366
371
  addDays,
Binary file