@superinterface/react 2.9.0 → 2.9.2
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 +15 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2764,7 +2764,7 @@ var useStatus = function(param) {
|
|
|
2764
2764
|
if (createMessageProps.isPending) return "creatingMessage";
|
|
2765
2765
|
if (messageAudioProps.paused || !messageAudioProps.isAudioPlayed) return "playerPaused";
|
|
2766
2766
|
if (messageAudioProps.playing || messageAudioProps.isPending) return "playing";
|
|
2767
|
-
if (!messageAudioProps.isReady) return "loading";
|
|
2767
|
+
if (!messageAudioProps.isAudioPlayed && !messageAudioProps.isReady) return "loading";
|
|
2768
2768
|
if (((_latestMessageProps_latestMessage = latestMessageProps.latestMessage) === null || _latestMessageProps_latestMessage === void 0 ? void 0 : _latestMessageProps_latestMessage.status) === "in_progress") return "creatingMessage";
|
|
2769
2769
|
if (recorderProps.status === "idle") return "idle";
|
|
2770
2770
|
if (recorderProps.status === "paused") return "recorderPaused";
|
|
@@ -2955,7 +2955,7 @@ var unsupportedNames = [
|
|
|
2955
2955
|
var isHtmlAudioSupported = !unsupportedNames.includes(((_detect = detect()) === null || _detect === void 0 ? void 0 : _detect.name) || "");
|
|
2956
2956
|
// src/hooks/audioThreads/useMessageAudio/index.ts
|
|
2957
2957
|
var SPLIT_SENTENCE_REGEX = /[^\.\?!]+[\.\?!]/g;
|
|
2958
|
-
var FULL_SENTENCE_REGEX =
|
|
2958
|
+
var FULL_SENTENCE_REGEX = /[\.?!]$/;
|
|
2959
2959
|
var getMessageSentences = function(param) {
|
|
2960
2960
|
var messageId = param.messageId, input2 = param.input;
|
|
2961
2961
|
var sentences = input2.match(SPLIT_SENTENCE_REGEX) || [];
|
|
@@ -3053,6 +3053,15 @@ var useMessageAudio = function(param) {
|
|
|
3053
3053
|
playedMessageSentences,
|
|
3054
3054
|
onEnd
|
|
3055
3055
|
]);
|
|
3056
|
+
useEffect5(function() {
|
|
3057
|
+
if (isHtmlAudioSupported) {
|
|
3058
|
+
var _Howler__howls___sounds_, _Howler__howls_;
|
|
3059
|
+
if (!(Howler === null || Howler === void 0 ? void 0 : (_Howler__howls_ = Howler._howls[0]) === null || _Howler__howls_ === void 0 ? void 0 : (_Howler__howls___sounds_ = _Howler__howls_._sounds[0]) === null || _Howler__howls___sounds_ === void 0 ? void 0 : _Howler__howls___sounds_._node)) return;
|
|
3060
|
+
Howler._howls[0]._sounds[0]._node.crossOrigin = "anonymous";
|
|
3061
|
+
}
|
|
3062
|
+
}, [
|
|
3063
|
+
audioPlayer
|
|
3064
|
+
]);
|
|
3056
3065
|
var _useState43 = _sliced_to_array(useState4(null), 2), audioEngine = _useState43[0], setAudioEngine = _useState43[1];
|
|
3057
3066
|
var isAudioEngineInited = useRef5(false);
|
|
3058
3067
|
useEffect5(function() {
|
|
@@ -3290,15 +3299,16 @@ var ActionButton = function() {
|
|
|
3290
3299
|
onClick: audioThreadContext.recorderProps.pause,
|
|
3291
3300
|
color: "gray",
|
|
3292
3301
|
radius: "full",
|
|
3302
|
+
variant: "soft",
|
|
3293
3303
|
size: "1",
|
|
3294
3304
|
children: /* @__PURE__ */ jsx58(PauseIcon, {})
|
|
3295
3305
|
})
|
|
3296
3306
|
}),
|
|
3297
3307
|
/* @__PURE__ */ jsx58(IconButton4, {
|
|
3298
3308
|
onClick: audioThreadContext.recorderProps.stop,
|
|
3299
|
-
color: "gray",
|
|
3300
3309
|
highContrast: true,
|
|
3301
3310
|
radius: "full",
|
|
3311
|
+
variant: "soft",
|
|
3302
3312
|
size: "4",
|
|
3303
3313
|
style: {
|
|
3304
3314
|
border: "2px solid var(--gray-8)"
|
|
@@ -3341,6 +3351,7 @@ var ActionButton = function() {
|
|
|
3341
3351
|
size: "4",
|
|
3342
3352
|
color: "gray",
|
|
3343
3353
|
radius: "full",
|
|
3354
|
+
variant: "soft",
|
|
3344
3355
|
style: {
|
|
3345
3356
|
border: "2px solid var(--gray-8)"
|
|
3346
3357
|
},
|
|
@@ -3355,7 +3366,6 @@ var ActionButton = function() {
|
|
|
3355
3366
|
size: "4",
|
|
3356
3367
|
radius: "full",
|
|
3357
3368
|
style: {
|
|
3358
|
-
backgroundColor: "var(--accent-11)",
|
|
3359
3369
|
border: "2px solid var(--gray-8)"
|
|
3360
3370
|
},
|
|
3361
3371
|
children: /* @__PURE__ */ jsx58(ResumeIcon, {})
|
|
@@ -3363,8 +3373,8 @@ var ActionButton = function() {
|
|
|
3363
3373
|
}
|
|
3364
3374
|
return /* @__PURE__ */ jsx58(IconButton4, {
|
|
3365
3375
|
size: "4",
|
|
3366
|
-
color: "red",
|
|
3367
3376
|
radius: "full",
|
|
3377
|
+
variant: "soft",
|
|
3368
3378
|
disabled: true,
|
|
3369
3379
|
style: {
|
|
3370
3380
|
border: "2px solid var(--gray-8)"
|