@leavepulse/ui 0.85.0 → 0.85.1
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineComponent, useModel, computed, ref, shallowRef, onMounted, watch, onBeforeUnmount, openBlock, createElementBlock, createVNode, createElementVNode, toDisplayString, unref, withCtx, createBlock, createTextVNode, Fragment, createCommentVNode, mergeModels } from "vue";
|
|
2
|
+
import { useLocale } from "../composables/useLocale.js";
|
|
2
3
|
import { useLabels } from "../composables/useLpConfig.js";
|
|
3
4
|
import { canTranscodeVideo, estimateTranscodedBytes, clipLength, probeVideo, transcodeVideo } from "../composables/videoTranscode.js";
|
|
4
5
|
import { formatBytes } from "../components/format.js";
|
|
@@ -77,12 +78,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
77
78
|
},
|
|
78
79
|
() => props.labels
|
|
79
80
|
);
|
|
81
|
+
const locale = useLocale();
|
|
82
|
+
const size = (bytes) => formatBytes(bytes, locale.value);
|
|
80
83
|
const choices = computed(() => props.presets ?? [
|
|
81
84
|
{ key: "original", label: text.value.original },
|
|
82
85
|
{ key: "p1080", label: text.value.p1080, maxHeight: 1080 },
|
|
83
86
|
{ key: "p720", label: text.value.p720, maxHeight: 720 },
|
|
84
87
|
{ key: "p480", label: text.value.p480, maxHeight: 480 },
|
|
85
|
-
{ key: "fit", label: text.value.fit.replace("{size}",
|
|
88
|
+
{ key: "fit", label: text.value.fit.replace("{size}", size(FIT_BYTES)), maxHeight: 720, targetBytes: FIT_BYTES }
|
|
86
89
|
]);
|
|
87
90
|
const url = ref("");
|
|
88
91
|
const info = shallowRef(null);
|
|
@@ -130,7 +133,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
130
133
|
const estimateLine = computed(() => {
|
|
131
134
|
if (estimate.value === null) return text.value.probing;
|
|
132
135
|
if (!worthIt.value) return text.value.bigger;
|
|
133
|
-
return text.value.estimate.replace("{size}",
|
|
136
|
+
return text.value.estimate.replace("{size}", size(estimate.value)).replace("{original}", size(props.file.size));
|
|
134
137
|
});
|
|
135
138
|
const busy = computed(() => progress.value !== null);
|
|
136
139
|
watch(busy, (value) => emit("busy", value));
|
package/dist/index.js
CHANGED
|
@@ -101,7 +101,7 @@ import { _ as _70 } from "./chunks/LpRangeSlider-BaAM7XIs.js";
|
|
|
101
101
|
import { _ as _71 } from "./chunks/LpVideoBackdrop-57i8RY8g.js";
|
|
102
102
|
import { formatClipTime, isNativeLoop, planLoop, seamProgress, seamReached } from "./components/videoBackdrop.js";
|
|
103
103
|
import { default as default12 } from "./components/LpVideoTrim.vue.js";
|
|
104
|
-
import { _ as _72 } from "./chunks/LpVideoCompress-
|
|
104
|
+
import { _ as _72 } from "./chunks/LpVideoCompress-BfulQ8Rs.js";
|
|
105
105
|
import { bitrateForHeight, canTranscodeVideo, estimateTranscodedBytes, probeVideo, transcodeVideo, transcodedName } from "./composables/videoTranscode.js";
|
|
106
106
|
import { _ as _73 } from "./chunks/LpVideoPlayer-koYKHKkC.js";
|
|
107
107
|
import { useVideoMedia } from "./composables/useVideoMedia.js";
|
package/package.json
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { computed, onBeforeUnmount, onMounted, ref, shallowRef, watch } from "vue"
|
|
17
17
|
|
|
18
|
+
import { useLocale } from "../composables/useLocale"
|
|
18
19
|
import { useLabels } from "../composables/useLpConfig"
|
|
19
20
|
import {
|
|
20
21
|
canTranscodeVideo,
|
|
@@ -108,13 +109,15 @@ const text = useLabels<VideoCompressLabels>(
|
|
|
108
109
|
)
|
|
109
110
|
|
|
110
111
|
const FIT_BYTES = 10 * 1024 * 1024
|
|
112
|
+
const locale = useLocale()
|
|
113
|
+
const size = (bytes: number) => formatBytes(bytes, locale.value)
|
|
111
114
|
|
|
112
115
|
const choices = computed<VideoCompressPreset[]>(() => props.presets ?? [
|
|
113
116
|
{ key: "original", label: text.value.original },
|
|
114
117
|
{ key: "p1080", label: text.value.p1080, maxHeight: 1080 },
|
|
115
118
|
{ key: "p720", label: text.value.p720, maxHeight: 720 },
|
|
116
119
|
{ key: "p480", label: text.value.p480, maxHeight: 480 },
|
|
117
|
-
{ key: "fit", label: text.value.fit.replace("{size}",
|
|
120
|
+
{ key: "fit", label: text.value.fit.replace("{size}", size(FIT_BYTES)), maxHeight: 720, targetBytes: FIT_BYTES },
|
|
118
121
|
])
|
|
119
122
|
|
|
120
123
|
const url = ref("")
|
|
@@ -167,7 +170,7 @@ const worthIt = computed(() => estimate.value !== null && (estimate.value < prop
|
|
|
167
170
|
const estimateLine = computed(() => {
|
|
168
171
|
if (estimate.value === null) return text.value.probing
|
|
169
172
|
if (!worthIt.value) return text.value.bigger
|
|
170
|
-
return text.value.estimate.replace("{size}",
|
|
173
|
+
return text.value.estimate.replace("{size}", size(estimate.value)).replace("{original}", size(props.file.size))
|
|
171
174
|
})
|
|
172
175
|
|
|
173
176
|
const busy = computed(() => progress.value !== null)
|