zartui 3.1.55 → 3.1.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/zartui.cjs.js CHANGED
@@ -11883,7 +11883,7 @@ var stdin_default$T = vue.defineComponent({
11883
11883
  if (!props.autoChangeToChildren) {
11884
11884
  return item && (item == null ? void 0 : item.children);
11885
11885
  }
11886
- return props.asyncGetter && (item == null ? void 0 : item.children) || !props.asyncGetter && ((_a = item == null ? void 0 : item.children) == null ? void 0 : _a.length);
11886
+ return props.asyncGetter && (item == null ? void 0 : item.children) || !props.asyncGetter && !!((_a = item == null ? void 0 : item.children) == null ? void 0 : _a.length);
11887
11887
  };
11888
11888
  const getToSubDisabled = (item) => {
11889
11889
  var _a;
@@ -17470,7 +17470,7 @@ var __async = (__this, __arguments, generator) => {
17470
17470
  step((generator = generator.apply(__this, __arguments)).next());
17471
17471
  });
17472
17472
  };
17473
- function useRecorder(emit) {
17473
+ function useRecorder(emit, type = "") {
17474
17474
  const recordedBlobs = vue.ref([]);
17475
17475
  const mediaRecorder = vue.ref();
17476
17476
  if (!navigator.mediaDevices) {
@@ -17505,6 +17505,10 @@ function useRecorder(emit) {
17505
17505
  mediaRecorder.value.ondataavailable = (event) => {
17506
17506
  if (event.data && event.data.size > 0) {
17507
17507
  recordedBlobs.value.push(event.data);
17508
+ if (type === "raw") {
17509
+ emit("change", recordedBlobs.value);
17510
+ return;
17511
+ }
17508
17512
  const blob = new Blob(recordedBlobs.value, { type: "audio/wav" });
17509
17513
  convertBlobToBase64(blob);
17510
17514
  }
@@ -17524,6 +17528,7 @@ const [name$c, bem$c] = createNamespace("speech-recognizer");
17524
17528
  const speechRecognizerProps = {
17525
17529
  title: String,
17526
17530
  value: String,
17531
+ type: String,
17527
17532
  show: Boolean,
17528
17533
  closeOnPopstate: truthProp,
17529
17534
  closeOnClickOverlay: truthProp
@@ -17531,7 +17536,7 @@ const speechRecognizerProps = {
17531
17536
  var stdin_default$j = vue.defineComponent({
17532
17537
  name: name$c,
17533
17538
  props: speechRecognizerProps,
17534
- emits: ["change", "confirm", "close", "update:show", "update:value"],
17539
+ emits: ["change", "confirm", "close", "update:show", "update:value", "onTouchstart", "onTouchend"],
17535
17540
  setup(props, {
17536
17541
  emit,
17537
17542
  slots
@@ -17541,7 +17546,7 @@ var stdin_default$j = vue.defineComponent({
17541
17546
  const {
17542
17547
  startRecording,
17543
17548
  stopRecording
17544
- } = useRecorder(emit);
17549
+ } = useRecorder(emit, props.type);
17545
17550
  const modelValue = vue.computed({
17546
17551
  get: () => props.value,
17547
17552
  set: (val) => {
@@ -17646,12 +17651,14 @@ var stdin_default$j = vue.defineComponent({
17646
17651
  e.preventDefault();
17647
17652
  };
17648
17653
  const onTouchstart = () => {
17654
+ emit("onTouchstart");
17649
17655
  isPlaying.value = true;
17650
17656
  startRecording();
17651
17657
  };
17652
17658
  const onTouchend = () => {
17653
17659
  isPlaying.value = false;
17654
17660
  stopRecording();
17661
+ emit("onTouchend");
17655
17662
  };
17656
17663
  const renderPlay = () => {
17657
17664
  const text = props.value ? props.value : "请说话";
@@ -20956,7 +20963,7 @@ const Lazyload = {
20956
20963
  });
20957
20964
  }
20958
20965
  };
20959
- const version = "3.1.54";
20966
+ const version = "3.1.56";
20960
20967
  function install(app) {
20961
20968
  const components = [
20962
20969
  ActionSheet,
package/lib/zartui.es.js CHANGED
@@ -11881,7 +11881,7 @@ var stdin_default$T = defineComponent({
11881
11881
  if (!props.autoChangeToChildren) {
11882
11882
  return item && (item == null ? void 0 : item.children);
11883
11883
  }
11884
- return props.asyncGetter && (item == null ? void 0 : item.children) || !props.asyncGetter && ((_a = item == null ? void 0 : item.children) == null ? void 0 : _a.length);
11884
+ return props.asyncGetter && (item == null ? void 0 : item.children) || !props.asyncGetter && !!((_a = item == null ? void 0 : item.children) == null ? void 0 : _a.length);
11885
11885
  };
11886
11886
  const getToSubDisabled = (item) => {
11887
11887
  var _a;
@@ -17468,7 +17468,7 @@ var __async = (__this, __arguments, generator) => {
17468
17468
  step((generator = generator.apply(__this, __arguments)).next());
17469
17469
  });
17470
17470
  };
17471
- function useRecorder(emit) {
17471
+ function useRecorder(emit, type = "") {
17472
17472
  const recordedBlobs = ref([]);
17473
17473
  const mediaRecorder = ref();
17474
17474
  if (!navigator.mediaDevices) {
@@ -17503,6 +17503,10 @@ function useRecorder(emit) {
17503
17503
  mediaRecorder.value.ondataavailable = (event) => {
17504
17504
  if (event.data && event.data.size > 0) {
17505
17505
  recordedBlobs.value.push(event.data);
17506
+ if (type === "raw") {
17507
+ emit("change", recordedBlobs.value);
17508
+ return;
17509
+ }
17506
17510
  const blob = new Blob(recordedBlobs.value, { type: "audio/wav" });
17507
17511
  convertBlobToBase64(blob);
17508
17512
  }
@@ -17522,6 +17526,7 @@ const [name$c, bem$c] = createNamespace("speech-recognizer");
17522
17526
  const speechRecognizerProps = {
17523
17527
  title: String,
17524
17528
  value: String,
17529
+ type: String,
17525
17530
  show: Boolean,
17526
17531
  closeOnPopstate: truthProp,
17527
17532
  closeOnClickOverlay: truthProp
@@ -17529,7 +17534,7 @@ const speechRecognizerProps = {
17529
17534
  var stdin_default$j = defineComponent({
17530
17535
  name: name$c,
17531
17536
  props: speechRecognizerProps,
17532
- emits: ["change", "confirm", "close", "update:show", "update:value"],
17537
+ emits: ["change", "confirm", "close", "update:show", "update:value", "onTouchstart", "onTouchend"],
17533
17538
  setup(props, {
17534
17539
  emit,
17535
17540
  slots
@@ -17539,7 +17544,7 @@ var stdin_default$j = defineComponent({
17539
17544
  const {
17540
17545
  startRecording,
17541
17546
  stopRecording
17542
- } = useRecorder(emit);
17547
+ } = useRecorder(emit, props.type);
17543
17548
  const modelValue = computed({
17544
17549
  get: () => props.value,
17545
17550
  set: (val) => {
@@ -17644,12 +17649,14 @@ var stdin_default$j = defineComponent({
17644
17649
  e.preventDefault();
17645
17650
  };
17646
17651
  const onTouchstart = () => {
17652
+ emit("onTouchstart");
17647
17653
  isPlaying.value = true;
17648
17654
  startRecording();
17649
17655
  };
17650
17656
  const onTouchend = () => {
17651
17657
  isPlaying.value = false;
17652
17658
  stopRecording();
17659
+ emit("onTouchend");
17653
17660
  };
17654
17661
  const renderPlay = () => {
17655
17662
  const text = props.value ? props.value : "请说话";
@@ -20954,7 +20961,7 @@ const Lazyload = {
20954
20961
  });
20955
20962
  }
20956
20963
  };
20957
- const version = "3.1.54";
20964
+ const version = "3.1.56";
20958
20965
  function install(app) {
20959
20966
  const components = [
20960
20967
  ActionSheet,
package/lib/zartui.js CHANGED
@@ -12121,7 +12121,7 @@
12121
12121
  if (!props.autoChangeToChildren) {
12122
12122
  return item && (item == null ? void 0 : item.children);
12123
12123
  }
12124
- return props.asyncGetter && (item == null ? void 0 : item.children) || !props.asyncGetter && ((_a = item == null ? void 0 : item.children) == null ? void 0 : _a.length);
12124
+ return props.asyncGetter && (item == null ? void 0 : item.children) || !props.asyncGetter && !!((_a = item == null ? void 0 : item.children) == null ? void 0 : _a.length);
12125
12125
  };
12126
12126
  const getToSubDisabled = (item) => {
12127
12127
  var _a;
@@ -21553,7 +21553,7 @@
21553
21553
  step((generator = generator.apply(__this, __arguments)).next());
21554
21554
  });
21555
21555
  };
21556
- function useRecorder(emit) {
21556
+ function useRecorder(emit, type = "") {
21557
21557
  const recordedBlobs = vue.ref([]);
21558
21558
  const mediaRecorder = vue.ref();
21559
21559
  if (!navigator.mediaDevices) {
@@ -21588,6 +21588,10 @@
21588
21588
  mediaRecorder.value.ondataavailable = (event) => {
21589
21589
  if (event.data && event.data.size > 0) {
21590
21590
  recordedBlobs.value.push(event.data);
21591
+ if (type === "raw") {
21592
+ emit("change", recordedBlobs.value);
21593
+ return;
21594
+ }
21591
21595
  const blob = new Blob(recordedBlobs.value, { type: "audio/wav" });
21592
21596
  convertBlobToBase64(blob);
21593
21597
  }
@@ -21607,6 +21611,7 @@
21607
21611
  const speechRecognizerProps = {
21608
21612
  title: String,
21609
21613
  value: String,
21614
+ type: String,
21610
21615
  show: Boolean,
21611
21616
  closeOnPopstate: truthProp,
21612
21617
  closeOnClickOverlay: truthProp
@@ -21614,7 +21619,7 @@
21614
21619
  var stdin_default$j = vue.defineComponent({
21615
21620
  name: name$c,
21616
21621
  props: speechRecognizerProps,
21617
- emits: ["change", "confirm", "close", "update:show", "update:value"],
21622
+ emits: ["change", "confirm", "close", "update:show", "update:value", "onTouchstart", "onTouchend"],
21618
21623
  setup(props, {
21619
21624
  emit,
21620
21625
  slots
@@ -21624,7 +21629,7 @@
21624
21629
  const {
21625
21630
  startRecording,
21626
21631
  stopRecording
21627
- } = useRecorder(emit);
21632
+ } = useRecorder(emit, props.type);
21628
21633
  const modelValue = vue.computed({
21629
21634
  get: () => props.value,
21630
21635
  set: (val) => {
@@ -21729,12 +21734,14 @@
21729
21734
  e.preventDefault();
21730
21735
  };
21731
21736
  const onTouchstart = () => {
21737
+ emit("onTouchstart");
21732
21738
  isPlaying.value = true;
21733
21739
  startRecording();
21734
21740
  };
21735
21741
  const onTouchend = () => {
21736
21742
  isPlaying.value = false;
21737
21743
  stopRecording();
21744
+ emit("onTouchend");
21738
21745
  };
21739
21746
  const renderPlay = () => {
21740
21747
  const text = props.value ? props.value : "请说话";
@@ -25016,7 +25023,7 @@
25016
25023
  });
25017
25024
  }
25018
25025
  };
25019
- const version = "3.1.54";
25026
+ const version = "3.1.56";
25020
25027
  function install(app) {
25021
25028
  const components = [
25022
25029
  ActionSheet,