@superinterface/react 5.3.0-beta.10 → 5.3.0-beta.12
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.cjs +93 -101
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +93 -101
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -47600,7 +47600,7 @@ var useMessageAudio = function(_ref) {
|
|
|
47600
47600
|
}
|
|
47601
47601
|
var run = /* @__PURE__ */ function() {
|
|
47602
47602
|
var _ref2 = _asyncToGenerator11(function() {
|
|
47603
|
-
var assistantsDesc, assistantsAsc, nowTs, lastNIds, prevQueue, prevById, prevUnfinishedIds, streamingIds, includeIds, segCache, nextQueue, changed, touch, i, _existing$nextIndex, _existing$stopped, m_6,
|
|
47603
|
+
var assistantsDesc, assistantsAsc, nowTs, lastNIds, prevQueue, prevById, prevUnfinishedIds, streamingIds, includeIds, segCache, nextQueue, changed, touch, i, _existing$nextIndex, _existing$stopped, m_6, input2, prevEntry, nextEntry, playableSegments, customSegments, safeSegments, base, fullSegments, readyCount, last3, readySegments, existing, nextIndex, stopped, reuse, unfinished, finished, prunedFinished, combined, i_0, idsInQueue, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, id_3, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, id_4, entries, toRemove, i_1;
|
|
47604
47604
|
return _ts_generator(this, function(_state) {
|
|
47605
47605
|
switch(_state.label){
|
|
47606
47606
|
case 0:
|
|
@@ -47661,10 +47661,10 @@ var useMessageAudio = function(_ref) {
|
|
|
47661
47661
|
3,
|
|
47662
47662
|
5
|
|
47663
47663
|
];
|
|
47664
|
-
|
|
47664
|
+
input2 = input({
|
|
47665
47665
|
message: m_6
|
|
47666
47666
|
});
|
|
47667
|
-
if (
|
|
47667
|
+
if (input2 == null) {
|
|
47668
47668
|
segCache.delete(m_6.id);
|
|
47669
47669
|
messagesByIdRef.current.delete(m_6.id);
|
|
47670
47670
|
return [
|
|
@@ -47684,14 +47684,14 @@ var useMessageAudio = function(_ref) {
|
|
|
47684
47684
|
4,
|
|
47685
47685
|
Promise.resolve(providedGetSegments({
|
|
47686
47686
|
message: m_6,
|
|
47687
|
-
|
|
47687
|
+
input: input2
|
|
47688
47688
|
}))
|
|
47689
47689
|
];
|
|
47690
47690
|
case 2:
|
|
47691
47691
|
customSegments = _state.sent();
|
|
47692
47692
|
safeSegments = Array.isArray(customSegments) ? customSegments : [];
|
|
47693
47693
|
nextEntry = {
|
|
47694
|
-
input:
|
|
47694
|
+
input: input2,
|
|
47695
47695
|
segments: safeSegments,
|
|
47696
47696
|
touched: nowTs
|
|
47697
47697
|
};
|
|
@@ -47701,7 +47701,7 @@ var useMessageAudio = function(_ref) {
|
|
|
47701
47701
|
4
|
|
47702
47702
|
];
|
|
47703
47703
|
case 3:
|
|
47704
|
-
base = getIncrementalSegments(prevEntry,
|
|
47704
|
+
base = getIncrementalSegments(prevEntry, input2, nowTs);
|
|
47705
47705
|
nextEntry = {
|
|
47706
47706
|
input: base.input,
|
|
47707
47707
|
segments: base.segments,
|
|
@@ -47723,7 +47723,7 @@ var useMessageAudio = function(_ref) {
|
|
|
47723
47723
|
existing = prevById.get(m_6.id);
|
|
47724
47724
|
nextIndex = Math.min((_existing$nextIndex = existing === null || existing === void 0 ? void 0 : existing.nextIndex) !== null && _existing$nextIndex !== void 0 ? _existing$nextIndex : 0, playableSegments.length);
|
|
47725
47725
|
stopped = (_existing$stopped = existing === null || existing === void 0 ? void 0 : existing.stopped) !== null && _existing$stopped !== void 0 ? _existing$stopped : false;
|
|
47726
|
-
reuse = !!existing && existing.status === m_6.status && existing.
|
|
47726
|
+
reuse = !!existing && existing.status === m_6.status && existing.messageInput === input2 && existing.nextIndex === nextIndex && existing.stopped === stopped && segmentsEqual(existing.segments, playableSegments);
|
|
47727
47727
|
if (reuse) {
|
|
47728
47728
|
nextQueue.push(existing);
|
|
47729
47729
|
} else {
|
|
@@ -47733,7 +47733,7 @@ var useMessageAudio = function(_ref) {
|
|
|
47733
47733
|
segments: playableSegments,
|
|
47734
47734
|
nextIndex: nextIndex,
|
|
47735
47735
|
stopped: stopped,
|
|
47736
|
-
|
|
47736
|
+
messageInput: input2
|
|
47737
47737
|
});
|
|
47738
47738
|
changed = true;
|
|
47739
47739
|
}
|
|
@@ -47886,13 +47886,13 @@ var useMessageAudio = function(_ref) {
|
|
|
47886
47886
|
]);
|
|
47887
47887
|
var defaultPlay = (0, import_react67.useCallback)(/* @__PURE__ */ function() {
|
|
47888
47888
|
var _ref5 = _asyncToGenerator11(function(_ref4) {
|
|
47889
|
-
var
|
|
47889
|
+
var input_0, onPlay, onStop, onEnd_0, searchParams;
|
|
47890
47890
|
return _ts_generator(this, function(_state) {
|
|
47891
47891
|
switch(_state.label){
|
|
47892
47892
|
case 0:
|
|
47893
|
-
|
|
47893
|
+
input_0 = _ref4.input, onPlay = _ref4.onPlay, onStop = _ref4.onStop, onEnd_0 = _ref4.onEnd;
|
|
47894
47894
|
searchParams = new URLSearchParams(_objectSpread47({
|
|
47895
|
-
input:
|
|
47895
|
+
input: input_0
|
|
47896
47896
|
}, superinterfaceContext.variables));
|
|
47897
47897
|
return [
|
|
47898
47898
|
4,
|
|
@@ -48139,7 +48139,7 @@ var useMessageAudio = function(_ref) {
|
|
|
48139
48139
|
candidate = {
|
|
48140
48140
|
messageId: msg.id,
|
|
48141
48141
|
message: message_0,
|
|
48142
|
-
|
|
48142
|
+
messageInput: msg.messageInput,
|
|
48143
48143
|
startIndex: msg.nextIndex,
|
|
48144
48144
|
segments: msg.segments.slice(msg.nextIndex)
|
|
48145
48145
|
};
|
|
@@ -48742,29 +48742,12 @@ var _excluded7 = [
|
|
|
48742
48742
|
var _excluded22 = [
|
|
48743
48743
|
"children",
|
|
48744
48744
|
"play",
|
|
48745
|
+
"playSegments",
|
|
48746
|
+
"getSegments",
|
|
48745
48747
|
"onEnd",
|
|
48746
48748
|
"className",
|
|
48747
|
-
"style"
|
|
48748
|
-
"playback"
|
|
48749
|
+
"style"
|
|
48749
48750
|
];
|
|
48750
|
-
function _objectWithoutProperties7(e, t) {
|
|
48751
|
-
if (null == e) return {};
|
|
48752
|
-
var o, r, i = _objectWithoutPropertiesLoose7(e, t);
|
|
48753
|
-
if (Object.getOwnPropertySymbols) {
|
|
48754
|
-
var n = Object.getOwnPropertySymbols(e);
|
|
48755
|
-
for(r = 0; r < n.length; r++)o = n[r], -1 === t.indexOf(o) && ({}).propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
48756
|
-
}
|
|
48757
|
-
return i;
|
|
48758
|
-
}
|
|
48759
|
-
function _objectWithoutPropertiesLoose7(r, e) {
|
|
48760
|
-
if (null == r) return {};
|
|
48761
|
-
var t = {};
|
|
48762
|
-
for(var n in r)if (({}).hasOwnProperty.call(r, n)) {
|
|
48763
|
-
if (-1 !== e.indexOf(n)) continue;
|
|
48764
|
-
t[n] = r[n];
|
|
48765
|
-
}
|
|
48766
|
-
return t;
|
|
48767
|
-
}
|
|
48768
48751
|
function ownKeys50(e, r) {
|
|
48769
48752
|
var t = Object.keys(e);
|
|
48770
48753
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -48808,6 +48791,24 @@ function _toPrimitive50(t, r) {
|
|
|
48808
48791
|
}
|
|
48809
48792
|
return ("string" === r ? String : Number)(t);
|
|
48810
48793
|
}
|
|
48794
|
+
function _objectWithoutProperties7(e, t) {
|
|
48795
|
+
if (null == e) return {};
|
|
48796
|
+
var o, r, i = _objectWithoutPropertiesLoose7(e, t);
|
|
48797
|
+
if (Object.getOwnPropertySymbols) {
|
|
48798
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
48799
|
+
for(r = 0; r < n.length; r++)o = n[r], -1 === t.indexOf(o) && ({}).propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
48800
|
+
}
|
|
48801
|
+
return i;
|
|
48802
|
+
}
|
|
48803
|
+
function _objectWithoutPropertiesLoose7(r, e) {
|
|
48804
|
+
if (null == r) return {};
|
|
48805
|
+
var t = {};
|
|
48806
|
+
for(var n in r)if (({}).hasOwnProperty.call(r, n)) {
|
|
48807
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
48808
|
+
t[n] = r[n];
|
|
48809
|
+
}
|
|
48810
|
+
return t;
|
|
48811
|
+
}
|
|
48811
48812
|
var Content9 = function(t0) {
|
|
48812
48813
|
var $ = (0, import_react_compiler_runtime90.c)(4);
|
|
48813
48814
|
var children = t0.children, className = t0.className, style = t0.style;
|
|
@@ -48832,34 +48833,30 @@ var Content9 = function(t0) {
|
|
|
48832
48833
|
};
|
|
48833
48834
|
var AudioRuntimeProvider = function(t0) {
|
|
48834
48835
|
var $ = (0, import_react_compiler_runtime90.c)(6);
|
|
48835
|
-
var children = t0.children, onEnd = t0.onEnd,
|
|
48836
|
+
var children = t0.children, onEnd = t0.onEnd, play = t0.play, playSegments = t0.playSegments, getSegments = t0.getSegments;
|
|
48836
48837
|
var audioThreadContext = useAudioThreadContext();
|
|
48837
48838
|
if (audioThreadContext.audioRuntime) {
|
|
48838
48839
|
return children;
|
|
48839
48840
|
}
|
|
48840
48841
|
var t1;
|
|
48841
|
-
if ($[0] !==
|
|
48842
|
-
t1 =
|
|
48843
|
-
|
|
48844
|
-
|
|
48845
|
-
|
|
48846
|
-
|
|
48847
|
-
}
|
|
48848
|
-
var t2;
|
|
48849
|
-
if ($[2] !== children || $[3] !== onEnd || $[4] !== t1) {
|
|
48850
|
-
t2 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TtsAudioRuntimeProvider, _objectSpread50(_objectSpread50({
|
|
48851
|
-
onEnd: onEnd
|
|
48852
|
-
}, t1), {}, {
|
|
48842
|
+
if ($[0] !== children || $[1] !== getSegments || $[2] !== onEnd || $[3] !== play || $[4] !== playSegments) {
|
|
48843
|
+
t1 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TtsAudioRuntimeProvider, {
|
|
48844
|
+
onEnd: onEnd,
|
|
48845
|
+
play: play,
|
|
48846
|
+
playSegments: playSegments,
|
|
48847
|
+
getSegments: getSegments,
|
|
48853
48848
|
children: children
|
|
48854
|
-
})
|
|
48855
|
-
$[
|
|
48856
|
-
$[
|
|
48857
|
-
$[
|
|
48858
|
-
$[
|
|
48849
|
+
});
|
|
48850
|
+
$[0] = children;
|
|
48851
|
+
$[1] = getSegments;
|
|
48852
|
+
$[2] = onEnd;
|
|
48853
|
+
$[3] = play;
|
|
48854
|
+
$[4] = playSegments;
|
|
48855
|
+
$[5] = t1;
|
|
48859
48856
|
} else {
|
|
48860
|
-
|
|
48857
|
+
t1 = $[5];
|
|
48861
48858
|
}
|
|
48862
|
-
return
|
|
48859
|
+
return t1;
|
|
48863
48860
|
};
|
|
48864
48861
|
var Provider5 = function(t0) {
|
|
48865
48862
|
var $ = (0, import_react_compiler_runtime90.c)(9);
|
|
@@ -48905,88 +48902,83 @@ var Root16 = function(t0) {
|
|
|
48905
48902
|
var $ = (0, import_react_compiler_runtime90.c)(22);
|
|
48906
48903
|
var children;
|
|
48907
48904
|
var className;
|
|
48905
|
+
var getSegments;
|
|
48908
48906
|
var onEnd;
|
|
48909
48907
|
var play;
|
|
48910
|
-
var
|
|
48908
|
+
var playSegments;
|
|
48911
48909
|
var rest;
|
|
48912
48910
|
var style;
|
|
48913
48911
|
if ($[0] !== t0) {
|
|
48914
48912
|
var _t2 = t0;
|
|
48915
48913
|
var ref;
|
|
48916
|
-
ref = _t2, children = ref.children, play = ref.play,
|
|
48914
|
+
ref = _t2, children = ref.children, play = ref.play, playSegments = ref.playSegments, getSegments = ref.getSegments, onEnd = ref.onEnd, className = ref.className, style = ref.style, ref;
|
|
48917
48915
|
rest = _objectWithoutProperties7(_t2, _excluded22);
|
|
48918
48916
|
_t2;
|
|
48919
48917
|
$[0] = t0;
|
|
48920
48918
|
$[1] = children;
|
|
48921
48919
|
$[2] = className;
|
|
48922
|
-
$[3] =
|
|
48923
|
-
$[4] =
|
|
48924
|
-
$[5] =
|
|
48925
|
-
$[6] =
|
|
48926
|
-
$[7] =
|
|
48920
|
+
$[3] = getSegments;
|
|
48921
|
+
$[4] = onEnd;
|
|
48922
|
+
$[5] = play;
|
|
48923
|
+
$[6] = playSegments;
|
|
48924
|
+
$[7] = rest;
|
|
48925
|
+
$[8] = style;
|
|
48927
48926
|
} else {
|
|
48928
48927
|
children = $[1];
|
|
48929
48928
|
className = $[2];
|
|
48930
|
-
|
|
48931
|
-
|
|
48932
|
-
|
|
48933
|
-
|
|
48934
|
-
|
|
48929
|
+
getSegments = $[3];
|
|
48930
|
+
onEnd = $[4];
|
|
48931
|
+
play = $[5];
|
|
48932
|
+
playSegments = $[6];
|
|
48933
|
+
rest = $[7];
|
|
48934
|
+
style = $[8];
|
|
48935
48935
|
}
|
|
48936
48936
|
var t1;
|
|
48937
|
-
if ($[
|
|
48938
|
-
t1 =
|
|
48939
|
-
play: play
|
|
48940
|
-
} : void 0;
|
|
48941
|
-
$[8] = play;
|
|
48942
|
-
$[9] = playback;
|
|
48943
|
-
$[10] = t1;
|
|
48944
|
-
} else {
|
|
48945
|
-
t1 = $[10];
|
|
48946
|
-
}
|
|
48947
|
-
var playbackOverrides = t1;
|
|
48948
|
-
var t2;
|
|
48949
|
-
if ($[11] !== children || $[12] !== className || $[13] !== style) {
|
|
48950
|
-
t2 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(ToastsProvider, {
|
|
48937
|
+
if ($[9] !== children || $[10] !== className || $[11] !== style) {
|
|
48938
|
+
t1 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(ToastsProvider, {
|
|
48951
48939
|
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Content9, {
|
|
48952
48940
|
className: className,
|
|
48953
48941
|
style: style,
|
|
48954
48942
|
children: children
|
|
48955
48943
|
})
|
|
48956
48944
|
});
|
|
48957
|
-
$[
|
|
48958
|
-
$[
|
|
48959
|
-
$[
|
|
48960
|
-
$[
|
|
48945
|
+
$[9] = children;
|
|
48946
|
+
$[10] = className;
|
|
48947
|
+
$[11] = style;
|
|
48948
|
+
$[12] = t1;
|
|
48961
48949
|
} else {
|
|
48962
|
-
|
|
48950
|
+
t1 = $[12];
|
|
48963
48951
|
}
|
|
48964
|
-
var
|
|
48965
|
-
if ($[
|
|
48966
|
-
|
|
48952
|
+
var t2;
|
|
48953
|
+
if ($[13] !== getSegments || $[14] !== onEnd || $[15] !== play || $[16] !== playSegments || $[17] !== t1) {
|
|
48954
|
+
t2 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(AudioRuntimeProvider, {
|
|
48967
48955
|
onEnd: onEnd,
|
|
48968
|
-
|
|
48969
|
-
|
|
48956
|
+
play: play,
|
|
48957
|
+
playSegments: playSegments,
|
|
48958
|
+
getSegments: getSegments,
|
|
48959
|
+
children: t1
|
|
48970
48960
|
});
|
|
48971
|
-
$[
|
|
48972
|
-
$[
|
|
48973
|
-
$[
|
|
48974
|
-
$[
|
|
48961
|
+
$[13] = getSegments;
|
|
48962
|
+
$[14] = onEnd;
|
|
48963
|
+
$[15] = play;
|
|
48964
|
+
$[16] = playSegments;
|
|
48965
|
+
$[17] = t1;
|
|
48966
|
+
$[18] = t2;
|
|
48975
48967
|
} else {
|
|
48976
|
-
|
|
48968
|
+
t2 = $[18];
|
|
48977
48969
|
}
|
|
48978
|
-
var
|
|
48979
|
-
if ($[19] !== rest || $[20] !==
|
|
48980
|
-
|
|
48981
|
-
children:
|
|
48970
|
+
var t3;
|
|
48971
|
+
if ($[19] !== rest || $[20] !== t2) {
|
|
48972
|
+
t3 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Provider5, _objectSpread50(_objectSpread50({}, rest), {}, {
|
|
48973
|
+
children: t2
|
|
48982
48974
|
}));
|
|
48983
48975
|
$[19] = rest;
|
|
48984
|
-
$[20] =
|
|
48985
|
-
$[21] =
|
|
48976
|
+
$[20] = t2;
|
|
48977
|
+
$[21] = t3;
|
|
48986
48978
|
} else {
|
|
48987
|
-
|
|
48979
|
+
t3 = $[21];
|
|
48988
48980
|
}
|
|
48989
|
-
return
|
|
48981
|
+
return t3;
|
|
48990
48982
|
};
|
|
48991
48983
|
// src/components/threads/AudioThread/Visualization/index.tsx
|
|
48992
48984
|
var import_react_compiler_runtime92 = require("react-compiler-runtime");
|