@twick/studio 0.15.26 → 0.15.27

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/dist/index.mjs CHANGED
@@ -6945,7 +6945,7 @@ function GenerateCaptionsPanel({
6945
6945
  const [pollingStatus, setPollingStatus] = useState("idle");
6946
6946
  const [errorMessage, setErrorMessage] = useState(null);
6947
6947
  const [selectedLanguage, setSelectedLanguage] = useState("auto");
6948
- const [wordsPerPhrase, setWordsPerPhrase] = useState(4);
6948
+ const [phraseLength, setPhraseLength] = useState("medium");
6949
6949
  const pollingIntervalRef = useRef(null);
6950
6950
  const currentReqIdRef = useRef(null);
6951
6951
  useEffect(() => {
@@ -7010,7 +7010,7 @@ function GenerateCaptionsPanel({
7010
7010
  const reqId = await onGenerateCaptions(
7011
7011
  videoElement,
7012
7012
  language,
7013
- wordsPerPhrase
7013
+ phraseLength
7014
7014
  );
7015
7015
  if (!reqId) {
7016
7016
  setPollingStatus("error");
@@ -7095,18 +7095,19 @@ function GenerateCaptionsPanel({
7095
7095
  )
7096
7096
  ] }),
7097
7097
  !isLoading && containsAudio === true && /* @__PURE__ */ jsxs("div", { className: "panel-section", children: [
7098
- /* @__PURE__ */ jsx("label", { className: "label-dark", htmlFor: "caption-words-per-phrase", children: "Words per phrase" }),
7099
- /* @__PURE__ */ jsx(
7098
+ /* @__PURE__ */ jsx("label", { className: "label-dark", htmlFor: "caption-phrase-length", children: "Caption length" }),
7099
+ /* @__PURE__ */ jsxs(
7100
7100
  "select",
7101
7101
  {
7102
- id: "caption-words-per-phrase",
7102
+ id: "caption-phrase-length",
7103
7103
  className: "select-dark",
7104
- value: String(wordsPerPhrase),
7105
- onChange: (e) => setWordsPerPhrase(Number(e.target.value) || 4),
7106
- children: Array.from({ length: 10 }).map((_, index) => {
7107
- const value = index + 1;
7108
- return /* @__PURE__ */ jsx("option", { value, children: value }, value);
7109
- })
7104
+ value: phraseLength,
7105
+ onChange: (e) => setPhraseLength(e.target.value),
7106
+ children: [
7107
+ /* @__PURE__ */ jsx("option", { value: "short", children: "Short" }),
7108
+ /* @__PURE__ */ jsx("option", { value: "medium", children: "Medium" }),
7109
+ /* @__PURE__ */ jsx("option", { value: "long", children: "Long" })
7110
+ ]
7110
7111
  }
7111
7112
  )
7112
7113
  ] }),
@@ -7777,14 +7778,14 @@ function TwickStudio({ studioConfig }) {
7777
7778
  const useGenerateCaptions = (studioConfig) => {
7778
7779
  var _a;
7779
7780
  const { editor, present } = useTimelineContext();
7780
- const onGenerateCaptions = async (videoElement, language, wordsPerPhrase) => {
7781
+ const onGenerateCaptions = async (videoElement, language, phraseLength) => {
7781
7782
  if (studioConfig == null ? void 0 : studioConfig.captionGenerationService) {
7782
7783
  const service = studioConfig.captionGenerationService;
7783
7784
  const reqId = await service.generateCaptions(
7784
7785
  videoElement,
7785
7786
  present,
7786
7787
  language,
7787
- wordsPerPhrase
7788
+ phraseLength
7788
7789
  );
7789
7790
  return reqId;
7790
7791
  }